source: trunk/configure.ac @ 29

Revision 29, 4.2 KB checked in by mmamonski, 12 years ago (diff)

bump version, avoid segault on missing jobs

  • Property svn:keywords set to Id Revision
Line 
1AC_INIT([PSNC DRMAA for SLURM], [1.0.6], [mamonski@man.poznan.pl], [slurm-drmaa])
2AC_PREREQ(2.59)
3AC_REVISION([$Id$])
4AC_COPYRIGHT([
5PSNC DRMAA for SLURM
6Copyright (C) 2011 Poznan Supercomputing and Networking Center
7
8
9This program is free software: you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation, either version 3 of the License, or
12(at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program.  If not, see <http://www.gnu.org/licenses/>.
21])
22
23SLURM_DRMAA_MAJOR=1
24SLURM_DRMAA_MINOR=0
25SLURM_DRMAA_MICRO=6
26SLURM_DRMAA_VERSION_INFO=1:6:0
27AC_SUBST([SLURM_DRMAA_MAJOR])
28AC_SUBST([SLURM_DRMAA_MINOR])
29AC_SUBST([SLURM_DRMAA_MICRO])
30AC_SUBST([SLURM_DRMAA_VERSION_INFO])
31
32AC_CONFIG_SRCDIR([slurm_drmaa/drmaa.c])
33AC_CONFIG_MACRO_DIR([m4])
34AC_CONFIG_AUX_DIR([scripts])
35
36AM_INIT_AUTOMAKE
37
38# command-line arguments:
39AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
40                        [produce code suiteable for debugging and print logs at runtime]))
41AC_ARG_ENABLE(development, AC_HELP_STRING([--enable-development],
42                        [enable development mode: make additional checks (suitable for PSNC DRMAA for SLURM)]))
43
44# programs:
45AC_PROG_CC
46AC_PROG_CPP
47AC_PROG_RANLIB
48AC_PROG_INSTALL
49AC_PROG_LIBTOOL
50AC_PROG_MAKE_SET
51AC_PROG_LN_S
52
53AX_DOCUTILS()
54if test x$RST2HTML = x; then
55        RST2HTML="sh m4/missing-dev-prog.sh docutils"
56fi
57if test x$RST2LATEX = x; then
58        RST2LATEX="sh m4/missing-dev-prog.sh docutils"
59fi
60
61# check compiler / set basic flags:
62if test x$ac_cv_prog_cc_stdc = xno; then
63        AC_MSG_ERROR([ANSI C compiler is required])
64fi
65
66if test x$GCC = xyes; then
67        CFLAGS="-pedantic -ansi ${CFLAGS}"
68fi
69AM_CONDITIONAL([GCC], [test x$GCC = xyes])
70
71AX_GCC_WARNINGS()
72
73AH_TEMPLATE([DEBUGGING], [Produce debugging code])
74if test x$enable_debug = xyes; then
75        AC_DEFINE(DEBUGGING,[1])
76        CFLAGS="${CFLAGS} -O0"
77else
78        CPPFLAGS="-DNDEBUG ${CPPFLAGS}"
79fi
80
81AH_TEMPLATE([DEVELOPMENT], [Development mode])
82if test x$enable_development = xyes; then
83        AC_DEFINE(DEVELOPMENT, [1])
84fi
85
86AH_BOTTOM([
87#ifndef __GNUC__
88#       define __attribute__ /* nothing */
89#endif
90])
91
92# system:
93CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE ${CPPFLAGS}"
94
95AC_CANONICAL_HOST
96case "$host_os" in
97        *linux*)
98                CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
99                ;;
100        *solaris*)
101                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
102                ;;
103        *freebsd*)
104                ;;
105        *darwin*)
106                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=400"
107                ;;
108        *)
109                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500"
110                ;;
111esac
112
113# project prerequisites:
114
115# libraries:
116ACX_PTHREAD([CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS"],
117                [AC_MSG_ERROR([POSIX threads library is required.])])
118               
119AX_SLURM([:], [AC_MSG_ERROR([
120SLURM libraries/headers not found;
121add --with-slurm-inc and --with-slurm-lib with appropriate locations.]) ])
122if ! echo $ac_configure_args | ${EGREP} -q '(--)(exec-)?prefix'; then
123        if test ${sysconfdir} == '${prefix}/etc'; then
124                # do not install configuration in /usr/local/etc
125                sysconfdir='/etc'
126                ac_configure_args="${ac_configure_args} --sysconfdir=${sysconfdir}"
127        fi
128fi
129CPPFLAGS="${CPPFLAGS} -DCONFDIR=${sysconfdir}"
130
131# headers:
132AC_HEADER_STDC
133AC_HEADER_TIME
134AC_HEADER_STDBOOL
135AC_CHECK_HEADERS([stddef.h stdlib.h string.h strings.h sys/time.h unistd.h])
136
137# types and structures:
138AC_TYPE_SIZE_T
139AC_STRUCT_TM
140
141# compiler characteristic
142AC_C_CONST
143AC_C_INLINE
144AC_C_VOLATILE
145
146# functions:
147AC_FUNC_MALLOC
148AC_FUNC_STRFTIME
149AC_FUNC_VPRINTF
150AC_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
173if 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}"
178fi
179
180AC_CONFIG_FILES([
181        Makefile
182        slurm_drmaa/Makefile
183])
184AC_CONFIG_HEADERS([config.h])
185AC_CONFIG_SUBDIRS([drmaa_utils])
186AC_OUTPUT
187
188echo
189echo "Run 'make' now."
190
Note: See TracBrowser for help on using the repository browser.