[45] | 1 | AC_INIT([DRMAA for PBS Pro], [1.0.11], [mamonski@man.poznan.pl], [pbs-drmaa]) |
---|
[1] | 2 | AC_PREREQ(2.59) |
---|
[12] | 3 | AC_REVISION([$Id$]) |
---|
[1] | 4 | AC_COPYRIGHT([ |
---|
[12] | 5 | DRMAA for Torque/PBS Professional |
---|
[1] | 6 | Copyright (C) 2006-2009 FedStage Systems |
---|
[12] | 7 | Copyright (C) 2011 Poznan Supercomputing and Networking Center |
---|
[1] | 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 |
---|
[45] | 25 | PBS_DRMAA_MICRO=11 |
---|
| 26 | PBS_DRMAA_VERSION_INFO=1:11:0 |
---|
[1] | 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], |
---|
[12] | 42 | [enable development mode: make additional checks (suiteable for developers)])) |
---|
[1] | 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 | setenv \ |
---|
| 146 | strcasecmp \ |
---|
| 147 | strchr \ |
---|
| 148 | strdup \ |
---|
| 149 | strerror \ |
---|
| 150 | strlcpy \ |
---|
| 151 | strndup \ |
---|
| 152 | strstr \ |
---|
| 153 | strtol \ |
---|
| 154 | vasprintf \ |
---|
| 155 | ]) |
---|
| 156 | |
---|
| 157 | # system services: |
---|
| 158 | |
---|
| 159 | # turn on warning after all tests |
---|
| 160 | if test x$GCC = xyes; then |
---|
| 161 | if test x$enable_development = xyes; then |
---|
| 162 | CFLAGS="-Werror ${CFLAGS}" |
---|
| 163 | fi |
---|
| 164 | CFLAGS="-Wall -W -Wno-unused-parameter $GCC_W_NO_FORMAT_ZERO_LENGTH ${CFLAGS}" |
---|
| 165 | fi |
---|
| 166 | |
---|
| 167 | AC_CONFIG_FILES([ |
---|
| 168 | Makefile |
---|
| 169 | pbs_drmaa/Makefile |
---|
| 170 | ]) |
---|
| 171 | AC_CONFIG_HEADERS([config.h]) |
---|
| 172 | AC_CONFIG_SUBDIRS([drmaa_utils]) |
---|
| 173 | AC_OUTPUT |
---|
| 174 | |
---|
| 175 | echo |
---|
| 176 | echo "Run 'make' now." |
---|
| 177 | |
---|