source: branches/2.0/drmaa2_utils/configure.ac @ 81

Revision 81, 5.8 KB checked in by mmamonski, 12 years ago (diff)

DRMAA 2.0 for PBS compiles

RevLine 
[77]1AC_INIT([PSNC DRMAA 2.0 utilities library], [2.0.1], [mamonski@man.poznan.pl], [drmaa2_utils])
2AC_PREREQ(2.59)
3AC_REVISION([$Id: configure.ac 13 2011-04-20 15:41:43Z mmamonski $])
4AC_COPYRIGHT([
5PSNC DRMAA utilities library
6Copyright (C) 2012  Poznan Supercomputing and Networking Center
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 PSNC 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
59AC_ARG_VAR([SED], [Location of the sed utility])
60AC_PATH_PROG(SED, [sed])
61AC_SUBST([SED])
62
63AC_ARG_VAR([TR], [Location of the tr utility])
64AC_PATH_PROG([TR], [tr])
65
66
67# code generation tools:
68AC_PROG_YACC
69AX_GPERF
70AC_CHECK_PROGS([RAGEL], [ragel], [sh m4/missing-dev-prog.sh ragel])
71
72# reStructuredText processing:
73AX_DOCUTILS
74# documentation generation:
75AC_CHECK_PROGS([DOT], [dot])
76if test x$DOT != x; then
77        HAVE_DOT=yes
78else
79        HAVE_DOT=no
80fi
81AC_SUBST([HAVE_DOT])
82
83# check compiler / set basic flags:
84if test x$ac_cv_prog_cc_stdc = xno; then
85        AC_MSG_ERROR([ANSI C compiler is required])
86fi
87
88AM_CONDITIONAL([GCC], [test x$GCC = xyes])
89
90AX_GCC_WARNINGS()
91
92AH_TEMPLATE([DEBUGGING], [Produce debugging code])
93if test x$enable_debug = xyes; then
94        AC_DEFINE(DEBUGGING,[1])
95        CFLAGS="${CFLAGS} -O0"
96else
97        CPPFLAGS="-DNDEBUG ${CPPFLAGS}"
98fi
99
100AH_TEMPLATE([DEVELOPMENT], [Development mode])
101if test x$enable_development = xyes; then
102        AC_DEFINE(DEVELOPMENT, [1])
103fi
104
105AH_BOTTOM([
106#ifndef __GNUC__
107#       define __attribute__ /* nothing */
108#endif
109])
110
111# system:
112CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE ${CPPFLAGS}"
113
114AC_CANONICAL_HOST
115case "$host_os" in
116        *linux*)
117                CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
118                ;;
119        *solaris*)
120                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
121                ;;
122        *freebsd*)
123                ;;
124        *darwin*)
125                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=400"
126                ;;
127        *aix*)                                                                                                                                                                                                                                 
128                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED=1 -D__linux__" 
129                ;;
130        *)
131                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D__USE_BSD"
132                ;;
133esac
134
135
136AC_C_BIGENDIAN_CROSS
137
138# project prerequisites:
139
140# libraries:
141ACX_PTHREAD([CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS"],
142                [AC_MSG_ERROR([POSIX threads library is required by DRMAA.])])
143
144# headers:
145AC_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])
146AC_HEADER_STDBOOL
147AC_HEADER_TIME
148
149# types and structures:
150AC_TYPE_PID_T
151AC_TYPE_SIZE_T
152AC_TYPE_SSIZE_T
153AC_TYPE_MODE_T
154AC_TYPE_UINT16_T
155AC_TYPE_UINT32_T
156AC_TYPE_UINT8_T
157AC_STRUCT_TM
158AC_CHECK_MEMBER(struct tm.tm_gmtoff,[AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm])],,[#include <time.h>])
159
160# compiler characteristic
161AC_C_CONST
162AC_C_INLINE
163AC_C_VOLATILE
164
165# functions:
166AC_FUNC_ALLOCA
167AC_FUNC_STRERROR_R
168AC_FUNC_STRFTIME
169AC_CHECK_FUNCS([ \
170        asprintf \
171        fstat \
172        getcwd \
173        gettimeofday \
174        localtime_r \
175        memset \
176        strchr \
177        strdup \
178        strerror \
179        strlcpy \
180        strndup \
181        strstr \
182        vasprintf])
183AX_FUNC_GETTID
184AX_FUNC_VA_COPY
185AC_SEARCH_LIBS([backtrace], [execinfo])
186
187# system services:
188
189# turn on warning after all tests
190if test x$GCC = xyes; then
191        if test x$enable_development = xyes; then
192                CFLAGS="-Werror ${CFLAGS}"
193        fi
194        CFLAGS="-Wall -W -Wno-unused  $GCC_W_NO_FORMAT_ZERO_LENGTH  $GCC_W_NO_MISSING_FIELD_INITIALIZERS ${CFLAGS}"
195fi
196
197# put all usefull paths in config.h
198AH_TEMPLATE([DRMAA_DIR_PREFIX], [The installation prefix])
199AH_TEMPLATE([DRMAA_DIR_BIN], [Location of binary files])
200AH_TEMPLATE([DRMAA_DIR_SYSCONF], [Location of system configuration files])
201AH_TEMPLATE([DRMAA_DIR_LOCALSTATE], [Location of variable data files])
202AH_TEMPLATE([DRMAA_DIR_DATA], [Location of package data files])
203
204test "$prefix" = NONE && prefix="$ac_default_prefix"
205test "$exec_prefix" = NONE && exec_prefix='${prefix}'
206
207for i in bindir prefix localstatedir  sysconfdir datadir; do
208        name=`echo $i | $SED -e 's/dir$//' | $TR 'a-z' 'A-Z'`
209        x="\$$i"
210        eval y="$x"
211        while test "$x" != "$y"; do
212                x="$y"
213                eval y="$x"
214        done
215        AC_DEFINE_UNQUOTED([DRMAA_DIR_$name], ["$x"])
216done
217
218
219AC_CONFIG_FILES([
220        Makefile
221        drmaa_utils/Makefile
222        Doxyfile
223])
224AC_CONFIG_HEADERS([config.h])
225AC_OUTPUT
226
227echo
228echo "Run 'make' now."
229
Note: See TracBrowser for help on using the repository browser.