| 1 | AC_INIT([DRMAA for PBS Pro], [1.0.5], [mamonski@man.poznan.pl], [pbs_drmaa]) |
|---|
| 2 | AC_PREREQ(2.59) |
|---|
| 3 | AC_REVISION([$Id: configure.ac 2694 2009-09-12 17:17:35Z mmamonski $]) |
|---|
| 4 | AC_COPYRIGHT([ |
|---|
| 5 | DRMAA for PBS Pro |
|---|
| 6 | Copyright (C) 2006-2009 FedStage Systems |
|---|
| 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 | |
|---|
| 22 | PBS_DRMAA_MAJOR=1 |
|---|
| 23 | PBS_DRMAA_MINOR=0 |
|---|
| 24 | PBS_DRMAA_MICRO=5 |
|---|
| 25 | PBS_DRMAA_VERSION_INFO=1:5:0 |
|---|
| 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], |
|---|
| 41 | [enable development mode: make additional checks (suiteable for FedStage DRMAA for PBS Pro developers)])) |
|---|
| 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 | # reStructuredText processing: |
|---|
| 56 | AX_DOCUTILS() |
|---|
| 57 | if test x$RST2HTML = x; then |
|---|
| 58 | RST2HTML="sh m4/missing-dev-prog.sh docutils" |
|---|
| 59 | fi |
|---|
| 60 | if test x$RST2LATEX = x; then |
|---|
| 61 | RST2LATEX="sh m4/missing-dev-prog.sh docutils" |
|---|
| 62 | fi |
|---|
| 63 | |
|---|
| 64 | # check compiler / set basic flags: |
|---|
| 65 | if test x$ac_cv_prog_cc_stdc = xno; then |
|---|
| 66 | AC_MSG_ERROR([ANSI C compiler is required]) |
|---|
| 67 | fi |
|---|
| 68 | |
|---|
| 69 | if test x$GCC = xyes; then |
|---|
| 70 | CFLAGS="-pedantic -ansi ${CFLAGS}" |
|---|
| 71 | fi |
|---|
| 72 | AM_CONDITIONAL([GCC], [test x$GCC = xyes]) |
|---|
| 73 | |
|---|
| 74 | AX_GCC_WARNINGS() |
|---|
| 75 | |
|---|
| 76 | AH_TEMPLATE([DEBUGGING], [Produce debugging code]) |
|---|
| 77 | if test x$enable_debug = xyes; then |
|---|
| 78 | AC_DEFINE(DEBUGGING,[1]) |
|---|
| 79 | CFLAGS="${CFLAGS} -O0" |
|---|
| 80 | else |
|---|
| 81 | CPPFLAGS="-DNDEBUG ${CPPFLAGS}" |
|---|
| 82 | fi |
|---|
| 83 | |
|---|
| 84 | AH_TEMPLATE([DEVELOPMENT], [Development mode]) |
|---|
| 85 | if test x$enable_development = xyes; then |
|---|
| 86 | AC_DEFINE(DEVELOPMENT, [1]) |
|---|
| 87 | fi |
|---|
| 88 | |
|---|
| 89 | AH_BOTTOM([ |
|---|
| 90 | #ifndef __GNUC__ |
|---|
| 91 | # define __attribute__ /* nothing */ |
|---|
| 92 | #endif |
|---|
| 93 | ]) |
|---|
| 94 | |
|---|
| 95 | # system: |
|---|
| 96 | CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE ${CPPFLAGS}" |
|---|
| 97 | |
|---|
| 98 | AC_CANONICAL_HOST |
|---|
| 99 | case "$host_os" in |
|---|
| 100 | *linux*) |
|---|
| 101 | CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" |
|---|
| 102 | ;; |
|---|
| 103 | *solaris*) |
|---|
| 104 | CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D__EXTENSIONS__" |
|---|
| 105 | ;; |
|---|
| 106 | *freebsd*) |
|---|
| 107 | ;; |
|---|
| 108 | *darwin*) |
|---|
| 109 | CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=400" |
|---|
| 110 | ;; |
|---|
| 111 | *) |
|---|
| 112 | CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500" |
|---|
| 113 | ;; |
|---|
| 114 | esac |
|---|
| 115 | |
|---|
| 116 | # project prerequisites: |
|---|
| 117 | |
|---|
| 118 | # libraries: |
|---|
| 119 | ACX_PTHREAD([CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS"], |
|---|
| 120 | [AC_MSG_ERROR([POSIX threads library is required.])]) |
|---|
| 121 | |
|---|
| 122 | AX_PBS([:], [AC_MSG_ERROR([ |
|---|
| 123 | PBS libraries/headers not found; |
|---|
| 124 | add --with-pbs to set PBS installation root.]) ]) |
|---|
| 125 | if test ${sysconfdir} == '${prefix}/etc' -a "$prefix" == 'NONE'; then |
|---|
| 126 | sysconfdir='/etc' |
|---|
| 127 | ac_configure_args="${ac_configure_args} --sysconfdir=${sysconfdir}" |
|---|
| 128 | fi |
|---|
| 129 | CPPFLAGS="${CPPFLAGS} -DCONFDIR=${sysconfdir}" |
|---|
| 130 | |
|---|
| 131 | # headers: |
|---|
| 132 | AC_HEADER_STDC |
|---|
| 133 | AC_HEADER_TIME |
|---|
| 134 | AC_HEADER_STDBOOL |
|---|
| 135 | AC_CHECK_HEADERS([stddef.h stdlib.h string.h strings.h sys/time.h unistd.h]) |
|---|
| 136 | |
|---|
| 137 | # types and structures: |
|---|
| 138 | AC_TYPE_SIZE_T |
|---|
| 139 | AC_STRUCT_TM |
|---|
| 140 | |
|---|
| 141 | # compiler characteristic |
|---|
| 142 | AC_C_CONST |
|---|
| 143 | AC_C_INLINE |
|---|
| 144 | AC_C_VOLATILE |
|---|
| 145 | |
|---|
| 146 | # functions: |
|---|
| 147 | AC_FUNC_MALLOC |
|---|
| 148 | AC_FUNC_STRFTIME |
|---|
| 149 | AC_FUNC_VPRINTF |
|---|
| 150 | AC_CHECK_FUNCS([ \ |
|---|
| 151 | asprintf \ |
|---|
| 152 | fstat \ |
|---|
| 153 | getcwd \ |
|---|
| 154 | gettimeofday \ |
|---|
| 155 | localtime_r \ |
|---|
| 156 | memset \ |
|---|
| 157 | mkstemp \ |
|---|
| 158 | setenv \ |
|---|
| 159 | strcasecmp \ |
|---|
| 160 | strchr \ |
|---|
| 161 | strdup \ |
|---|
| 162 | strerror \ |
|---|
| 163 | strlcpy \ |
|---|
| 164 | strndup \ |
|---|
| 165 | strstr \ |
|---|
| 166 | strtol \ |
|---|
| 167 | vasprintf \ |
|---|
| 168 | ]) |
|---|
| 169 | |
|---|
| 170 | # system services: |
|---|
| 171 | |
|---|
| 172 | # turn on warning after all tests |
|---|
| 173 | if test x$GCC = xyes; then |
|---|
| 174 | if test x$enable_development = xyes; then |
|---|
| 175 | CFLAGS="-Werror ${CFLAGS}" |
|---|
| 176 | fi |
|---|
| 177 | CFLAGS="-Wall -W -Wno-unused-parameter $GCC_W_NO_FORMAT_ZERO_LENGTH ${CFLAGS}" |
|---|
| 178 | fi |
|---|
| 179 | |
|---|
| 180 | AC_CONFIG_FILES([ |
|---|
| 181 | Makefile |
|---|
| 182 | pbs_drmaa/Makefile |
|---|
| 183 | doc/Makefile |
|---|
| 184 | ]) |
|---|
| 185 | AC_CONFIG_HEADERS([config.h]) |
|---|
| 186 | AC_CONFIG_SUBDIRS([drmaa_utils]) |
|---|
| 187 | AC_OUTPUT |
|---|
| 188 | |
|---|
| 189 | echo |
|---|
| 190 | echo "Run 'make' now." |
|---|
| 191 | |
|---|