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

Revision 77, 5.9 KB checked in by mmamonski, 12 years ago (diff)

DRMAA 2.0 utils - first skeleton

Line 
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
88if test x$GCC = xyes; then
89        CFLAGS="-pedantic -ansi ${CFLAGS}"
90fi
91AM_CONDITIONAL([GCC], [test x$GCC = xyes])
92
93AX_GCC_WARNINGS()
94
95AH_TEMPLATE([DEBUGGING], [Produce debugging code])
96if test x$enable_debug = xyes; then
97        AC_DEFINE(DEBUGGING,[1])
98        CFLAGS="${CFLAGS} -O0"
99else
100        CPPFLAGS="-DNDEBUG ${CPPFLAGS}"
101fi
102
103AH_TEMPLATE([DEVELOPMENT], [Development mode])
104if test x$enable_development = xyes; then
105        AC_DEFINE(DEVELOPMENT, [1])
106fi
107
108AH_BOTTOM([
109#ifndef __GNUC__
110#       define __attribute__ /* nothing */
111#endif
112])
113
114# system:
115CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE ${CPPFLAGS}"
116
117AC_CANONICAL_HOST
118case "$host_os" in
119        *linux*)
120                CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
121                ;;
122        *solaris*)
123                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
124                ;;
125        *freebsd*)
126                ;;
127        *darwin*)
128                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=400"
129                ;;
130        *aix*)                                                                                                                                                                                                                                 
131                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED=1 -D__linux__" 
132                ;;
133        *)
134                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D__USE_BSD"
135                ;;
136esac
137
138
139AC_C_BIGENDIAN_CROSS
140
141# project prerequisites:
142
143# libraries:
144ACX_PTHREAD([CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS"],
145                [AC_MSG_ERROR([POSIX threads library is required by DRMAA.])])
146
147# headers:
148AC_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])
149AC_HEADER_STDBOOL
150AC_HEADER_TIME
151
152# types and structures:
153AC_TYPE_PID_T
154AC_TYPE_SIZE_T
155AC_TYPE_SSIZE_T
156AC_TYPE_MODE_T
157AC_TYPE_UINT16_T
158AC_TYPE_UINT32_T
159AC_TYPE_UINT8_T
160AC_STRUCT_TM
161AC_CHECK_MEMBER(struct tm.tm_gmtoff,[AC_DEFINE([HAVE_STRUCT_TM_GMTOFF],[1],[gmtoff in struct tm])],,[#include <time.h>])
162
163# compiler characteristic
164AC_C_CONST
165AC_C_INLINE
166AC_C_VOLATILE
167
168# functions:
169AC_FUNC_ALLOCA
170AC_FUNC_STRERROR_R
171AC_FUNC_STRFTIME
172AC_CHECK_FUNCS([ \
173        asprintf \
174        fstat \
175        getcwd \
176        gettimeofday \
177        localtime_r \
178        memset \
179        strchr \
180        strdup \
181        strerror \
182        strlcpy \
183        strndup \
184        strstr \
185        vasprintf])
186AX_FUNC_GETTID
187AX_FUNC_VA_COPY
188AC_SEARCH_LIBS([backtrace], [execinfo])
189
190# system services:
191
192# turn on warning after all tests
193if test x$GCC = xyes; then
194        if test x$enable_development = xyes; then
195                CFLAGS="-Werror ${CFLAGS}"
196        fi
197        CFLAGS="-Wall -W -Wno-unused  $GCC_W_NO_FORMAT_ZERO_LENGTH  $GCC_W_NO_MISSING_FIELD_INITIALIZERS ${CFLAGS}"
198fi
199
200# put all usefull paths in config.h
201AH_TEMPLATE([DRMAA_DIR_PREFIX], [The installation prefix])
202AH_TEMPLATE([DRMAA_DIR_BIN], [Location of binary files])
203AH_TEMPLATE([DRMAA_DIR_SYSCONF], [Location of system configuration files])
204AH_TEMPLATE([DRMAA_DIR_LOCALSTATE], [Location of variable data files])
205AH_TEMPLATE([DRMAA_DIR_DATA], [Location of package data files])
206
207test "$prefix" = NONE && prefix="$ac_default_prefix"
208test "$exec_prefix" = NONE && exec_prefix='${prefix}'
209
210for i in bindir prefix localstatedir  sysconfdir datadir; do
211        name=`echo $i | $SED -e 's/dir$//' | $TR 'a-z' 'A-Z'`
212        x="\$$i"
213        eval y="$x"
214        while test "$x" != "$y"; do
215                x="$y"
216                eval y="$x"
217        done
218        AC_DEFINE_UNQUOTED([DRMAA_DIR_$name], ["$x"])
219done
220
221
222AC_CONFIG_FILES([
223        Makefile
224        drmaa_utils/Makefile
225  tests/Makefile
226        Doxyfile
227])
228AC_CONFIG_HEADERS([config.h])
229AC_OUTPUT
230
231echo
232echo "Run 'make' now."
233
Note: See TracBrowser for help on using the repository browser.