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