source: trunk/configure.ac @ 1

Revision 1, 4.2 KB checked in by mmamonski, 13 years ago (diff)

Torque/PBS DRMAA initial commit

Line 
1AC_INIT([DRMAA for PBS Pro], [1.0.4], [mamonski@man.poznan.pl], [pbs_drmaa])
2AC_PREREQ(2.59)
3AC_REVISION([$Id: configure.ac 2694 2009-09-12 17:17:35Z mmamonski $])
4AC_COPYRIGHT([
5DRMAA for PBS Pro
6Copyright (C) 2006-2009  FedStage Systems
7
8This program is free software: you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation, either version 3 of the License, or
11(at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with this program.  If not, see <http://www.gnu.org/licenses/>.
20])
21
22PBS_DRMAA_MAJOR=1
23PBS_DRMAA_MINOR=0
24PBS_DRMAA_MICRO=4
25PBS_DRMAA_VERSION_INFO=1:4:0
26AC_SUBST([PBS_DRMAA_MAJOR])
27AC_SUBST([PBS_DRMAA_MINOR])
28AC_SUBST([PBS_DRMAA_MICRO])
29AC_SUBST([PBS_DRMAA_VERSION_INFO])
30
31AC_CONFIG_SRCDIR([pbs_drmaa/drmaa.c])
32AC_CONFIG_MACRO_DIR([m4])
33AC_CONFIG_AUX_DIR([scripts])
34
35AM_INIT_AUTOMAKE
36
37# command-line arguments:
38AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
39                        [produce code suiteable for debugging and print logs at runtime]))
40AC_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:
44AC_PROG_CC
45AC_PROG_CPP
46AC_PROG_RANLIB
47AC_PROG_INSTALL
48AC_PROG_LIBTOOL
49AC_PROG_MAKE_SET
50AC_PROG_LN_S
51
52# code generation tools:
53AX_GPERF
54
55# reStructuredText processing:
56AX_DOCUTILS()
57if test x$RST2HTML = x; then
58        RST2HTML="sh m4/missing-dev-prog.sh docutils"
59fi
60if test x$RST2LATEX = x; then
61        RST2LATEX="sh m4/missing-dev-prog.sh docutils"
62fi
63
64# check compiler / set basic flags:
65if test x$ac_cv_prog_cc_stdc = xno; then
66        AC_MSG_ERROR([ANSI C compiler is required])
67fi
68
69if test x$GCC = xyes; then
70        CFLAGS="-pedantic -ansi ${CFLAGS}"
71fi
72AM_CONDITIONAL([GCC], [test x$GCC = xyes])
73
74AX_GCC_WARNINGS()
75
76AH_TEMPLATE([DEBUGGING], [Produce debugging code])
77if test x$enable_debug = xyes; then
78        AC_DEFINE(DEBUGGING,[1])
79        CFLAGS="${CFLAGS} -O0"
80else
81        CPPFLAGS="-DNDEBUG ${CPPFLAGS}"
82fi
83
84AH_TEMPLATE([DEVELOPMENT], [Development mode])
85if test x$enable_development = xyes; then
86        AC_DEFINE(DEVELOPMENT, [1])
87fi
88
89AH_BOTTOM([
90#ifndef __GNUC__
91#       define __attribute__ /* nothing */
92#endif
93])
94
95# system:
96CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE ${CPPFLAGS}"
97
98AC_CANONICAL_HOST
99case "$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                ;;
114esac
115
116# project prerequisites:
117
118# libraries:
119ACX_PTHREAD([CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS"],
120                [AC_MSG_ERROR([POSIX threads library is required.])])
121
122AX_PBS([:], [AC_MSG_ERROR([
123PBS libraries/headers not found;
124add --with-pbs to set PBS installation root.]) ])
125if test ${sysconfdir} == '${prefix}/etc' -a "$prefix" == 'NONE'; then
126        sysconfdir='/etc'
127        ac_configure_args="${ac_configure_args} --sysconfdir=${sysconfdir}"
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        pbs_drmaa/Makefile
183        doc/Makefile
184])
185AC_CONFIG_HEADERS([config.h])
186AC_CONFIG_SUBDIRS([drmaa_utils])
187AC_OUTPUT
188
189echo
190echo "Run 'make' now."
191
Note: See TracBrowser for help on using the repository browser.