source: trunk/configure.ac @ 10

Revision 10, 4.0 KB checked in by mmamonski, 9 years ago (diff)

DRMAA utils - keep conf in PREFIX/etc, log_info all communication with Torque, do not log_error on timout and vector operations

Line 
1AC_INIT([DRMAA for PBS Pro], [1.0.6], [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=6
25PBS_DRMAA_VERSION_INFO=1:6: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.]) ])
125CPPFLAGS="${CPPFLAGS} -DCONFDIR=${sysconfdir}"
126
127# headers:
128AC_HEADER_STDC
129AC_HEADER_TIME
130AC_HEADER_STDBOOL
131AC_CHECK_HEADERS([stddef.h stdlib.h string.h strings.h sys/time.h unistd.h])
132
133# types and structures:
134AC_TYPE_SIZE_T
135AC_STRUCT_TM
136
137# compiler characteristic
138AC_C_CONST
139AC_C_INLINE
140AC_C_VOLATILE
141
142# functions:
143AC_FUNC_MALLOC
144AC_FUNC_STRFTIME
145AC_FUNC_VPRINTF
146AC_CHECK_FUNCS([ \
147        asprintf \
148        fstat \
149        getcwd \
150        gettimeofday \
151        localtime_r \
152        memset \
153        mkstemp \
154        setenv \
155        strcasecmp \
156        strchr \
157        strdup \
158        strerror \
159        strlcpy \
160        strndup \
161        strstr \
162        strtol \
163        vasprintf \
164        ])
165
166# system services:
167
168# turn on warning after all tests
169if test x$GCC = xyes; then
170        if test x$enable_development = xyes; then
171                CFLAGS="-Werror ${CFLAGS}"
172        fi
173        CFLAGS="-Wall -W -Wno-unused-parameter $GCC_W_NO_FORMAT_ZERO_LENGTH ${CFLAGS}"
174fi
175
176AC_CONFIG_FILES([
177        Makefile
178        pbs_drmaa/Makefile
179        doc/Makefile
180])
181AC_CONFIG_HEADERS([config.h])
182AC_CONFIG_SUBDIRS([drmaa_utils])
183AC_OUTPUT
184
185echo
186echo "Run 'make' now."
187
Note: See TracBrowser for help on using the repository browser.