[1] | 1 | AC_INIT([PSNC DRMAA for LoadLeveler], [1.0.1], [mamonski@man.poznan.pl], [ll_drmaa]) |
---|
| 2 | AC_PREREQ(2.58) |
---|
| 3 | AC_REVISION([$Id: configure.ac 228 2010-05-25 15:34:28Z mamonski $]) |
---|
| 4 | AC_COPYRIGHT([ |
---|
| 5 | PSNC DRMAA for LoadLeveler |
---|
| 6 | Copyright (C) 2010 Poznan Supercomputing and Networking Center |
---|
| 7 | |
---|
| 8 | Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 9 | you may not use this file except in compliance with the License. |
---|
| 10 | You may obtain a copy of the License at |
---|
| 11 | |
---|
| 12 | http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 13 | |
---|
| 14 | Unless required by applicable law or agreed to in writing, software |
---|
| 15 | distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 17 | See the License for the specific language governing permissions and |
---|
| 18 | limitations under the License. |
---|
| 19 | ]) |
---|
| 20 | |
---|
| 21 | LL_DRMAA_MAJOR=1 |
---|
| 22 | LL_DRMAA_MINOR=0 |
---|
| 23 | LL_DRMAA_MICRO=1 |
---|
| 24 | LL_DRMAA_VERSION_INFO=1:1:0 |
---|
| 25 | AC_SUBST([LL_DRMAA_MAJOR]) |
---|
| 26 | AC_SUBST([LL_DRMAA_MINOR]) |
---|
| 27 | AC_SUBST([LL_DRMAA_MICRO]) |
---|
| 28 | AC_SUBST([LL_DRMAA_VERSION_INFO]) |
---|
| 29 | |
---|
| 30 | AC_CONFIG_SRCDIR([ll_drmaa/drmaa.c]) |
---|
| 31 | AC_CONFIG_MACRO_DIR([m4]) |
---|
| 32 | AC_CONFIG_AUX_DIR([scripts]) |
---|
| 33 | |
---|
| 34 | AM_INIT_AUTOMAKE |
---|
| 35 | |
---|
| 36 | # command-line arguments: |
---|
| 37 | AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], |
---|
| 38 | [produce code suiteable for debugging and print logs at runtime])) |
---|
| 39 | AC_ARG_ENABLE(development, AC_HELP_STRING([--enable-development], |
---|
| 40 | [enable development mode: make additional checks (suitable for PSNC DRMAA for LL developers)])) |
---|
| 41 | |
---|
| 42 | # programs: |
---|
| 43 | AC_PROG_CC |
---|
| 44 | AC_PROG_CPP |
---|
| 45 | AC_PROG_RANLIB |
---|
| 46 | AC_PROG_INSTALL |
---|
| 47 | AC_PROG_LIBTOOL |
---|
| 48 | AC_PROG_MAKE_SET |
---|
| 49 | AC_PROG_LN_S |
---|
| 50 | |
---|
| 51 | AX_DOCUTILS() |
---|
| 52 | if test x$RST2HTML = x; then |
---|
| 53 | RST2HTML="sh m4/missing-dev-prog.sh docutils" |
---|
| 54 | fi |
---|
| 55 | if test x$RST2LATEX = x; then |
---|
| 56 | RST2LATEX="sh m4/missing-dev-prog.sh docutils" |
---|
| 57 | fi |
---|
| 58 | |
---|
| 59 | # check compiler / set basic flags: |
---|
| 60 | if test x$ac_cv_prog_cc_stdc = xno; then |
---|
| 61 | AC_MSG_ERROR([ANSI C compiler is required]) |
---|
| 62 | fi |
---|
| 63 | |
---|
| 64 | if test x$GCC = xyes; then |
---|
| 65 | CFLAGS="-pedantic ${CFLAGS}" |
---|
| 66 | fi |
---|
| 67 | AM_CONDITIONAL([GCC], [test x$GCC = xyes]) |
---|
| 68 | |
---|
| 69 | AX_GCC_WARNINGS() |
---|
| 70 | |
---|
| 71 | AH_TEMPLATE([DEBUGGING], [Produce debugging code]) |
---|
| 72 | if test x$enable_debug = xyes; then |
---|
| 73 | AC_DEFINE(DEBUGGING,[1]) |
---|
| 74 | CFLAGS="${CFLAGS} -O0" |
---|
| 75 | else |
---|
| 76 | CPPFLAGS="-DNDEBUG ${CPPFLAGS}" |
---|
| 77 | fi |
---|
| 78 | |
---|
| 79 | AH_TEMPLATE([DEVELOPMENT], [Development mode]) |
---|
| 80 | if test x$enable_development = xyes; then |
---|
| 81 | AC_DEFINE(DEVELOPMENT, [1]) |
---|
| 82 | fi |
---|
| 83 | |
---|
| 84 | AH_BOTTOM([ |
---|
| 85 | #ifndef __GNUC__ |
---|
| 86 | # define __attribute__ /* nothing */ |
---|
| 87 | #endif |
---|
| 88 | ]) |
---|
| 89 | |
---|
| 90 | # system: |
---|
| 91 | CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE ${CPPFLAGS}" |
---|
| 92 | |
---|
| 93 | AC_CANONICAL_HOST |
---|
| 94 | case "$host_os" in |
---|
| 95 | *linux*) |
---|
| 96 | CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" |
---|
| 97 | ;; |
---|
| 98 | *solaris*) |
---|
| 99 | CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D__EXTENSIONS__" |
---|
| 100 | ;; |
---|
| 101 | *freebsd*) |
---|
| 102 | ;; |
---|
| 103 | *darwin*) |
---|
| 104 | CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=400" |
---|
| 105 | ;; |
---|
| 106 | *aix*) |
---|
| 107 | CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED=1 -D__linux__" |
---|
| 108 | ;; |
---|
| 109 | *) |
---|
| 110 | CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500" |
---|
| 111 | ;; |
---|
| 112 | esac |
---|
| 113 | |
---|
| 114 | # project prerequisites: |
---|
| 115 | |
---|
| 116 | # libraries: |
---|
| 117 | ACX_PTHREAD([CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS"], |
---|
| 118 | [AC_MSG_ERROR([POSIX threads library is required.])]) |
---|
| 119 | |
---|
| 120 | AX_LL([:], [AC_MSG_ERROR([ |
---|
| 121 | LL libraries/headers not found; |
---|
| 122 | add --with-ll-inc and --with-ll-lib with appropriate locations.]) ]) |
---|
| 123 | if ! echo $ac_configure_args | ${EGREP} -q '(--)(exec-)?prefix'; then |
---|
| 124 | if test ${sysconfdir} == '${prefix}/etc'; then |
---|
| 125 | # do not install configuration in /usr/local/etc |
---|
| 126 | sysconfdir='/etc' |
---|
| 127 | ac_configure_args="${ac_configure_args} --sysconfdir=${sysconfdir}" |
---|
| 128 | fi |
---|
| 129 | fi |
---|
| 130 | CPPFLAGS="${CPPFLAGS} -DCONFDIR=${sysconfdir}" |
---|
| 131 | |
---|
| 132 | # headers: |
---|
| 133 | AC_HEADER_STDC |
---|
| 134 | AC_HEADER_TIME |
---|
| 135 | AC_HEADER_STDBOOL |
---|
| 136 | |
---|
| 137 | AC_CHECK_HEADERS([stddef.h stdlib.h string.h strings.h sys/time.h unistd.h]) |
---|
| 138 | |
---|
| 139 | # types and structures: |
---|
| 140 | AC_TYPE_SIZE_T |
---|
| 141 | AC_STRUCT_TM |
---|
| 142 | |
---|
| 143 | # compiler characteristic |
---|
| 144 | AC_C_CONST |
---|
| 145 | AC_C_INLINE |
---|
| 146 | AC_C_VOLATILE |
---|
| 147 | |
---|
| 148 | # functions: |
---|
| 149 | # this cause problem on AIX systems |
---|
| 150 | #AC_FUNC_MALLOC |
---|
| 151 | AC_FUNC_STRFTIME |
---|
| 152 | AC_FUNC_VPRINTF |
---|
| 153 | AC_CHECK_FUNCS([ \ |
---|
| 154 | asprintf \ |
---|
| 155 | fstat \ |
---|
| 156 | getcwd \ |
---|
| 157 | gettimeofday \ |
---|
| 158 | localtime_r \ |
---|
| 159 | memset \ |
---|
| 160 | mkstemp \ |
---|
| 161 | setenv \ |
---|
| 162 | strcasecmp \ |
---|
| 163 | strchr \ |
---|
| 164 | strdup \ |
---|
| 165 | strerror \ |
---|
| 166 | strlcpy \ |
---|
| 167 | strndup \ |
---|
| 168 | strstr \ |
---|
| 169 | strtol \ |
---|
| 170 | vasprintf \ |
---|
| 171 | ]) |
---|
| 172 | |
---|
| 173 | # system services: |
---|
| 174 | |
---|
| 175 | # turn on warning after all tests |
---|
| 176 | if test x$GCC = xyes; then |
---|
| 177 | if test x$enable_development = xyes; then |
---|
| 178 | CFLAGS="-Werror ${CFLAGS}" |
---|
| 179 | fi |
---|
| 180 | CFLAGS="-Wall -W -Wno-unused-parameter $GCC_W_NO_FORMAT_ZERO_LENGTH ${CFLAGS}" |
---|
| 181 | fi |
---|
| 182 | |
---|
| 183 | #eval bindir |
---|
| 184 | AH_TEMPLATE([LL_DRMAA_BIN_DIR], [Location of binary files]) |
---|
| 185 | test "$prefix" = NONE && prefix="$ac_default_prefix" |
---|
| 186 | test "$exec_prefix" = NONE && exec_prefix='${prefix}' |
---|
| 187 | x="\$bindir" |
---|
| 188 | eval y="$x" |
---|
| 189 | while test "$x" != "$y"; do |
---|
| 190 | x="$y" |
---|
| 191 | eval y="$x" |
---|
| 192 | done |
---|
| 193 | AC_DEFINE_UNQUOTED([LL_DRMAA_BIN_DIR], ["$x"]) |
---|
| 194 | |
---|
| 195 | |
---|
| 196 | AC_CONFIG_FILES([ |
---|
| 197 | Makefile |
---|
| 198 | ll_drmaa/Makefile |
---|
| 199 | doc/Makefile |
---|
| 200 | ]) |
---|
| 201 | AC_CONFIG_HEADERS([config.h]) |
---|
| 202 | AC_CONFIG_SUBDIRS([drmaa_utils]) |
---|
| 203 | AC_OUTPUT |
---|
| 204 | |
---|
| 205 | echo |
---|
| 206 | echo "Run 'make' now." |
---|
| 207 | |
---|