source: trunk/configure.ac @ 97

Revision 97, 3.8 KB checked in by mmamonski, 6 years ago (diff)

DRMAA 1.0.17

  • Property svn:keywords set to Id
Line 
1AC_INIT([DRMAA for PBS Pro], [1.0.17], [mamonski@man.poznan.pl], [pbs-drmaa])
2AC_PREREQ(2.59)
3AC_REVISION([$Id$])
4AC_COPYRIGHT([
5DRMAA for Torque/PBS Professional
6Copyright (C) 2006-2009  FedStage Systems
7Copyright (C) 2011-2013  Poznan Supercomputing and Networking Center
8
9This program is free software: you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation, either version 3 of the License, or
12(at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program.  If not, see <http://www.gnu.org/licenses/>.
21])
22
23PBS_DRMAA_MAJOR=1
24PBS_DRMAA_MINOR=0
25PBS_DRMAA_MICRO=17
26PBS_DRMAA_VERSION_INFO=1:17:0
27AC_SUBST([PBS_DRMAA_MAJOR])
28AC_SUBST([PBS_DRMAA_MINOR])
29AC_SUBST([PBS_DRMAA_MICRO])
30AC_SUBST([PBS_DRMAA_VERSION_INFO])
31
32AC_CONFIG_SRCDIR([pbs_drmaa/drmaa.c])
33AC_CONFIG_MACRO_DIR([m4])
34AC_CONFIG_AUX_DIR([scripts])
35
36AM_INIT_AUTOMAKE
37
38# command-line arguments:
39AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
40                        [produce code suiteable for debugging and print logs at runtime]))
41AC_ARG_ENABLE(development, AC_HELP_STRING([--enable-development],
42                        [enable development mode: make additional checks (suiteable for developers)]))
43
44# programs:
45AC_PROG_CC
46AC_PROG_CXX
47AC_PROG_CPP
48AC_PROG_RANLIB
49AC_PROG_INSTALL
50AC_PROG_LIBTOOL
51AC_PROG_MAKE_SET
52AC_PROG_LN_S
53
54# code generation tools:
55AX_GPERF
56
57# check compiler / set basic flags:
58if test x$ac_cv_prog_cc_stdc = xno; then
59        AC_MSG_ERROR([ANSI C compiler is required])
60fi
61
62if test x$GCC = xyes; then
63        CFLAGS="-pedantic -ansi ${CFLAGS}"
64fi
65AM_CONDITIONAL([GCC], [test x$GCC = xyes])
66
67AX_GCC_WARNINGS()
68
69AH_TEMPLATE([DEBUGGING], [Produce debugging code])
70if test x$enable_debug = xyes; then
71        AC_DEFINE(DEBUGGING,[1])
72        CFLAGS="${CFLAGS} -O0"
73else
74        CPPFLAGS="-DNDEBUG ${CPPFLAGS}"
75fi
76
77AH_TEMPLATE([DEVELOPMENT], [Development mode])
78if test x$enable_development = xyes; then
79        AC_DEFINE(DEVELOPMENT, [1])
80fi
81
82AH_BOTTOM([
83#ifndef __GNUC__
84#       define __attribute__ /* nothing */
85#endif
86])
87
88# system:
89CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE ${CPPFLAGS}"
90
91AC_CANONICAL_HOST
92case "$host_os" in
93        *linux*)
94                CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
95                ;;
96        *solaris*)
97                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
98                ;;
99        *freebsd*)
100                ;;
101        *darwin*)
102                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=400"
103                ;;
104        *)
105                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500"
106                ;;
107esac
108
109# project prerequisites:
110
111# libraries:
112ACX_PTHREAD([CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS"],
113                [AC_MSG_ERROR([POSIX threads library is required.])])
114
115AX_PBS([:], [AC_MSG_ERROR([
116PBS libraries/headers not found;
117add --with-pbs to set PBS installation root.]) ])
118CPPFLAGS="${CPPFLAGS} -DCONFDIR=${sysconfdir}"
119
120# headers:
121AC_HEADER_STDC
122AC_HEADER_TIME
123AC_HEADER_STDBOOL
124AC_CHECK_HEADERS([stddef.h stdlib.h string.h strings.h sys/time.h unistd.h])
125
126# types and structures:
127AC_TYPE_SIZE_T
128AC_STRUCT_TM
129
130# compiler characteristic
131AC_C_CONST
132AC_C_INLINE
133AC_C_VOLATILE
134
135# functions:
136AC_FUNC_MALLOC
137AC_FUNC_STRFTIME
138AC_FUNC_VPRINTF
139AC_CHECK_FUNCS([ \
140        asprintf \
141        fstat \
142        getcwd \
143        gettimeofday \
144        localtime_r \
145        memset \
146        setenv \
147        strcasecmp \
148        strchr \
149        strdup \
150        strerror \
151        strlcpy \
152        strndup \
153        strstr \
154        strtol \
155        vasprintf \
156        ])
157
158# system services:
159
160# turn on warning after all tests
161if test x$GCC = xyes; then
162        if test x$enable_development = xyes; then
163                CFLAGS="-Werror ${CFLAGS}"
164        fi
165        CFLAGS="-Wall -W -Wno-unused-parameter $GCC_W_NO_FORMAT_ZERO_LENGTH ${CFLAGS}"
166fi
167
168AC_CONFIG_FILES([
169        Makefile
170        pbs_drmaa/Makefile
171])
172AC_CONFIG_HEADERS([config.h])
173AC_CONFIG_SUBDIRS([drmaa_utils])
174AC_OUTPUT
175
176echo
177echo "Run 'make' now."
178
Note: See TracBrowser for help on using the repository browser.