source: trunk/drmaa_utils/configure.ac @ 1

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

Torque/PBS DRMAA initial commit

Line 
1AC_INIT([FedStage DRMAA utilities library], [2.0.1], [drmaa-pbspro-users@lists.fedstage.com], [drmaa_utils])
2AC_PREREQ(2.59)
3AC_REVISION([$Id: configure.ac 1673 2008-11-21 20:17:05Z lukasz $])
4AC_COPYRIGHT([
5FedStage DRMAA utilities library
6Copyright (C) 2006-2008  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
22DRMAA_UTILS_MAJOR=2
23DRMAA_UTILS_MINOR=0
24DRMAA_UTILS_MICRO=1
25DRMAA_UTILS_VERSION_INFO=2:1:0
26AC_SUBST([DRMAA_UTILS_MAJOR])
27AC_SUBST([DRMAA_UTILS_MINOR])
28AC_SUBST([DRMAA_UTILS_MICRO])
29AC_SUBST([DRMAA_UTILS_VERSION_INFO])
30
31AC_CONFIG_SRCDIR([drmaa_utils/xmalloc.c])
32AC_CONFIG_MACRO_DIR([m4])
33AC_CONFIG_AUX_DIR([scripts])
34
35AM_INIT_AUTOMAKE
36DEVELOPER_MODE="no"
37AM_CONDITIONAL([DEVELOPER_MODE], [test "x$DEVELOPER_MODE" = "xyes"])
38
39# command-line arguments:
40AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
41                        [produce code suiteable for debugging and print logs at runtime]))
42AC_ARG_ENABLE(development, AC_HELP_STRING([--enable-development],
43                        [enable development mode: make additional checks (suiteable for FedStage DRMAA utilities library developers)]))
44
45AC_ARG_WITH(drmaa-utils, AC_HELP_STRING([--with-drmaa-utils=...],
46                [used only to detect that drmaa utils is sub packaged]))
47AM_CONDITIONAL([DRMAA_UTILS_STANDALONE],
48                [test x$with_drmaa_utils = x])
49
50# programs:
51AC_PROG_CC
52AC_PROG_CPP
53AC_PROG_RANLIB
54AC_PROG_INSTALL
55AC_PROG_LIBTOOL
56AC_PROG_MAKE_SET
57AC_PROG_LN_S
58
59
60# code generation tools:
61AC_PROG_YACC
62AX_GPERF
63AC_CHECK_PROGS([RAGEL], [ragel], [sh m4/missing-dev-prog.sh ragel])
64
65# reStructuredText processing:
66AX_DOCUTILS
67# documentation generation:
68AC_CHECK_PROGS([DOT], [dot])
69if test x$DOT != x; then
70        HAVE_DOT=yes
71else
72        HAVE_DOT=no
73fi
74AC_SUBST([HAVE_DOT])
75
76# check compiler / set basic flags:
77if test x$ac_cv_prog_cc_stdc = xno; then
78        AC_MSG_ERROR([ANSI C compiler is required])
79fi
80
81if test x$GCC = xyes; then
82        CFLAGS="-pedantic -ansi ${CFLAGS}"
83fi
84AM_CONDITIONAL([GCC], [test x$GCC = xyes])
85
86AX_GCC_WARNINGS()
87
88AH_TEMPLATE([DEBUGGING], [Produce debugging code])
89if test x$enable_debug = xyes; then
90        AC_DEFINE(DEBUGGING,[1])
91        CFLAGS="${CFLAGS} -O0"
92else
93        CPPFLAGS="-DNDEBUG ${CPPFLAGS}"
94fi
95
96AH_TEMPLATE([DEVELOPMENT], [Development mode])
97if test x$enable_development = xyes; then
98        AC_DEFINE(DEVELOPMENT, [1])
99fi
100
101AH_BOTTOM([
102#ifndef __GNUC__
103#       define __attribute__ /* nothing */
104#endif
105])
106
107# system:
108CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE ${CPPFLAGS}"
109
110AC_CANONICAL_HOST
111case "$host_os" in
112        *linux*)
113                CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
114                ;;
115        *solaris*)
116                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
117                ;;
118        *freebsd*)
119                ;;
120        *darwin*)
121                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=400"
122                ;;
123        *aix*)                                                                                                                                                                                                                                 
124                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED=1 -D__linux__" 
125                ;;
126        *)
127                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D__USE_BSD"
128                ;;
129esac
130
131
132AC_C_BIGENDIAN_CROSS
133
134# project prerequisites:
135
136# libraries:
137ACX_PTHREAD([CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS"],
138                [AC_MSG_ERROR([POSIX threads library is required by DRMAA.])])
139
140# headers:
141AC_CHECK_HEADERS([execinfo.h fcntl.h inttypes.h libintl.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h])
142AC_HEADER_STDBOOL
143AC_HEADER_TIME
144
145# types and structures:
146AC_TYPE_PID_T
147AC_TYPE_SIZE_T
148AC_TYPE_SSIZE_T
149AC_TYPE_MODE_T
150AC_TYPE_UINT16_T
151AC_TYPE_UINT32_T
152AC_TYPE_UINT8_T
153AC_STRUCT_TM
154AC_CHECK_MEMBER(struct tm.tm_gmtoff,[AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm])],,[#include <time.h>])
155
156# compiler characteristic
157AC_C_CONST
158AC_C_INLINE
159AC_C_VOLATILE
160
161# functions:
162AC_FUNC_ALLOCA
163AC_FUNC_STRERROR_R
164AC_FUNC_STRFTIME
165AC_CHECK_FUNCS([ \
166        asprintf \
167        fstat \
168        getcwd \
169        gettimeofday \
170        localtime_r \
171        memset \
172        strchr \
173        strdup \
174        strerror \
175        strlcpy \
176        strndup \
177        strstr \
178        vasprintf])
179AX_FUNC_GETTID
180AX_FUNC_VA_COPY
181AC_SEARCH_LIBS([backtrace], [execinfo])
182
183# system services:
184
185# turn on warning after all tests
186if test x$GCC = xyes; then
187        if test x$enable_development = xyes; then
188                CFLAGS="-Werror ${CFLAGS}"
189        fi
190        CFLAGS="-Wall -W -Wno-unused  $GCC_W_NO_FORMAT_ZERO_LENGTH  $GCC_W_NO_MISSING_FIELD_INITIALIZERS ${CFLAGS}"
191fi
192
193AC_CONFIG_FILES([
194        Makefile
195        drmaa_utils/Makefile
196        test/Makefile
197        Doxyfile
198])
199AC_CONFIG_HEADERS([config.h])
200AC_OUTPUT
201
202echo
203echo "Run 'make' now."
204
Note: See TracBrowser for help on using the repository browser.