| 1 | AC_INIT([DRMAA for PBS Pro], [1.0.7], [mamonski@man.poznan.pl], [pbs-drmaa]) |
|---|
| 2 | AC_PREREQ(2.59) |
|---|
| 3 | AC_REVISION([$Id$]) |
|---|
| 4 | AC_COPYRIGHT([ |
|---|
| 5 | DRMAA for Torque/PBS Professional |
|---|
| 6 | Copyright (C) 2006-2009 FedStage Systems |
|---|
| 7 | Copyright (C) 2011 Poznan Supercomputing and Networking Center |
|---|
| 8 | |
|---|
| 9 | This program is free software: you can redistribute it and/or modify |
|---|
| 10 | it under the terms of the GNU General Public License as published by |
|---|
| 11 | the Free Software Foundation, either version 3 of the License, or |
|---|
| 12 | (at your option) any later version. |
|---|
| 13 | |
|---|
| 14 | This program is distributed in the hope that it will be useful, |
|---|
| 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 | GNU General Public License for more details. |
|---|
| 18 | |
|---|
| 19 | You should have received a copy of the GNU General Public License |
|---|
| 20 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 21 | ]) |
|---|
| 22 | |
|---|
| 23 | PBS_DRMAA_MAJOR=1 |
|---|
| 24 | PBS_DRMAA_MINOR=0 |
|---|
| 25 | PBS_DRMAA_MICRO=7 |
|---|
| 26 | PBS_DRMAA_VERSION_INFO=1:7:0 |
|---|
| 27 | AC_SUBST([PBS_DRMAA_MAJOR]) |
|---|
| 28 | AC_SUBST([PBS_DRMAA_MINOR]) |
|---|
| 29 | AC_SUBST([PBS_DRMAA_MICRO]) |
|---|
| 30 | AC_SUBST([PBS_DRMAA_VERSION_INFO]) |
|---|
| 31 | |
|---|
| 32 | AC_CONFIG_SRCDIR([pbs_drmaa/drmaa.c]) |
|---|
| 33 | AC_CONFIG_MACRO_DIR([m4]) |
|---|
| 34 | AC_CONFIG_AUX_DIR([scripts]) |
|---|
| 35 | |
|---|
| 36 | AM_INIT_AUTOMAKE |
|---|
| 37 | |
|---|
| 38 | # command-line arguments: |
|---|
| 39 | AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], |
|---|
| 40 | [produce code suiteable for debugging and print logs at runtime])) |
|---|
| 41 | AC_ARG_ENABLE(development, AC_HELP_STRING([--enable-development], |
|---|
| 42 | [enable development mode: make additional checks (suiteable for developers)])) |
|---|
| 43 | |
|---|
| 44 | # programs: |
|---|
| 45 | AC_PROG_CC |
|---|
| 46 | AC_PROG_CPP |
|---|
| 47 | AC_PROG_RANLIB |
|---|
| 48 | AC_PROG_INSTALL |
|---|
| 49 | AC_PROG_LIBTOOL |
|---|
| 50 | AC_PROG_MAKE_SET |
|---|
| 51 | AC_PROG_LN_S |
|---|
| 52 | |
|---|
| 53 | # code generation tools: |
|---|
| 54 | AX_GPERF |
|---|
| 55 | |
|---|
| 56 | # check compiler / set basic flags: |
|---|
| 57 | if test x$ac_cv_prog_cc_stdc = xno; then |
|---|
| 58 | AC_MSG_ERROR([ANSI C compiler is required]) |
|---|
| 59 | fi |
|---|
| 60 | |
|---|
| 61 | if test x$GCC = xyes; then |
|---|
| 62 | CFLAGS="-pedantic -ansi ${CFLAGS}" |
|---|
| 63 | fi |
|---|
| 64 | AM_CONDITIONAL([GCC], [test x$GCC = xyes]) |
|---|
| 65 | |
|---|
| 66 | AX_GCC_WARNINGS() |
|---|
| 67 | |
|---|
| 68 | AH_TEMPLATE([DEBUGGING], [Produce debugging code]) |
|---|
| 69 | if test x$enable_debug = xyes; then |
|---|
| 70 | AC_DEFINE(DEBUGGING,[1]) |
|---|
| 71 | CFLAGS="${CFLAGS} -O0" |
|---|
| 72 | else |
|---|
| 73 | CPPFLAGS="-DNDEBUG ${CPPFLAGS}" |
|---|
| 74 | fi |
|---|
| 75 | |
|---|
| 76 | AH_TEMPLATE([DEVELOPMENT], [Development mode]) |
|---|
| 77 | if test x$enable_development = xyes; then |
|---|
| 78 | AC_DEFINE(DEVELOPMENT, [1]) |
|---|
| 79 | fi |
|---|
| 80 | |
|---|
| 81 | AH_BOTTOM([ |
|---|
| 82 | #ifndef __GNUC__ |
|---|
| 83 | # define __attribute__ /* nothing */ |
|---|
| 84 | #endif |
|---|
| 85 | ]) |
|---|
| 86 | |
|---|
| 87 | # system: |
|---|
| 88 | CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE ${CPPFLAGS}" |
|---|
| 89 | |
|---|
| 90 | AC_CANONICAL_HOST |
|---|
| 91 | case "$host_os" in |
|---|
| 92 | *linux*) |
|---|
| 93 | CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" |
|---|
| 94 | ;; |
|---|
| 95 | *solaris*) |
|---|
| 96 | CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D__EXTENSIONS__" |
|---|
| 97 | ;; |
|---|
| 98 | *freebsd*) |
|---|
| 99 | ;; |
|---|
| 100 | *darwin*) |
|---|
| 101 | CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=400" |
|---|
| 102 | ;; |
|---|
| 103 | *) |
|---|
| 104 | CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500" |
|---|
| 105 | ;; |
|---|
| 106 | esac |
|---|
| 107 | |
|---|
| 108 | # project prerequisites: |
|---|
| 109 | |
|---|
| 110 | # libraries: |
|---|
| 111 | ACX_PTHREAD([CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS"], |
|---|
| 112 | [AC_MSG_ERROR([POSIX threads library is required.])]) |
|---|
| 113 | |
|---|
| 114 | AX_PBS([:], [AC_MSG_ERROR([ |
|---|
| 115 | PBS libraries/headers not found; |
|---|
| 116 | add --with-pbs to set PBS installation root.]) ]) |
|---|
| 117 | CPPFLAGS="${CPPFLAGS} -DCONFDIR=${sysconfdir}" |
|---|
| 118 | |
|---|
| 119 | # headers: |
|---|
| 120 | AC_HEADER_STDC |
|---|
| 121 | AC_HEADER_TIME |
|---|
| 122 | AC_HEADER_STDBOOL |
|---|
| 123 | AC_CHECK_HEADERS([stddef.h stdlib.h string.h strings.h sys/time.h unistd.h]) |
|---|
| 124 | |
|---|
| 125 | # types and structures: |
|---|
| 126 | AC_TYPE_SIZE_T |
|---|
| 127 | AC_STRUCT_TM |
|---|
| 128 | |
|---|
| 129 | # compiler characteristic |
|---|
| 130 | AC_C_CONST |
|---|
| 131 | AC_C_INLINE |
|---|
| 132 | AC_C_VOLATILE |
|---|
| 133 | |
|---|
| 134 | # functions: |
|---|
| 135 | AC_FUNC_MALLOC |
|---|
| 136 | AC_FUNC_STRFTIME |
|---|
| 137 | AC_FUNC_VPRINTF |
|---|
| 138 | AC_CHECK_FUNCS([ \ |
|---|
| 139 | asprintf \ |
|---|
| 140 | fstat \ |
|---|
| 141 | getcwd \ |
|---|
| 142 | gettimeofday \ |
|---|
| 143 | localtime_r \ |
|---|
| 144 | memset \ |
|---|
| 145 | mkstemp \ |
|---|
| 146 | setenv \ |
|---|
| 147 | strcasecmp \ |
|---|
| 148 | strchr \ |
|---|
| 149 | strdup \ |
|---|
| 150 | strerror \ |
|---|
| 151 | strlcpy \ |
|---|
| 152 | strndup \ |
|---|
| 153 | strstr \ |
|---|
| 154 | strtol \ |
|---|
| 155 | vasprintf \ |
|---|
| 156 | ]) |
|---|
| 157 | |
|---|
| 158 | # system services: |
|---|
| 159 | |
|---|
| 160 | # turn on warning after all tests |
|---|
| 161 | if test x$GCC = xyes; then |
|---|
| 162 | if test x$enable_development = xyes; then |
|---|
| 163 | CFLAGS="-Werror ${CFLAGS}" |
|---|
| 164 | fi |
|---|
| 165 | CFLAGS="-Wall -W -Wno-unused-parameter $GCC_W_NO_FORMAT_ZERO_LENGTH ${CFLAGS}" |
|---|
| 166 | fi |
|---|
| 167 | |
|---|
| 168 | AC_CONFIG_FILES([ |
|---|
| 169 | Makefile |
|---|
| 170 | pbs_drmaa/Makefile |
|---|
| 171 | ]) |
|---|
| 172 | AC_CONFIG_HEADERS([config.h]) |
|---|
| 173 | AC_CONFIG_SUBDIRS([drmaa_utils]) |
|---|
| 174 | AC_OUTPUT |
|---|
| 175 | |
|---|
| 176 | echo |
|---|
| 177 | echo "Run 'make' now." |
|---|
| 178 | |
|---|