source: branches/2.0/configure.ac @ 81

Revision 81, 3.7 KB checked in by mmamonski, 11 years ago (diff)

DRMAA 2.0 for PBS compiles

  • Property svn:keywords set to Id
Line 
1AC_INIT([DRMAA for Torque/PBS Pro], [2.0.0], [mamonski@man.poznan.pl], [pbs-drmaa2])
2AC_PREREQ(2.59)
3AC_REVISION([$Id$])
4AC_COPYRIGHT([
5DRMAA for Torque/PBS Professional
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
22PBS_DRMAA_MAJOR=2
23PBS_DRMAA_MINOR=0
24PBS_DRMAA_MICRO=0
25PBS_DRMAA_VERSION_INFO=2:0: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 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# check compiler / set basic flags:
56if test x$ac_cv_prog_cc_stdc = xno; then
57        AC_MSG_ERROR([ANSI C compiler is required])
58fi
59
60AM_CONDITIONAL([GCC], [test x$GCC = xyes])
61
62AX_GCC_WARNINGS()
63
64AH_TEMPLATE([DEBUGGING], [Produce debugging code])
65if test x$enable_debug = xyes; then
66        AC_DEFINE(DEBUGGING,[1])
67        CFLAGS="${CFLAGS} -O0"
68else
69        CPPFLAGS="-DNDEBUG ${CPPFLAGS}"
70fi
71
72AH_TEMPLATE([DEVELOPMENT], [Development mode])
73if test x$enable_development = xyes; then
74        AC_DEFINE(DEVELOPMENT, [1])
75fi
76
77AH_BOTTOM([
78#ifndef __GNUC__
79#       define __attribute__ /* nothing */
80#endif
81])
82
83# system:
84CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE ${CPPFLAGS}"
85
86AC_CANONICAL_HOST
87case "$host_os" in
88        *linux*)
89                CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
90                ;;
91        *solaris*)
92                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
93                ;;
94        *freebsd*)
95                ;;
96        *darwin*)
97                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=400"
98                ;;
99        *)
100                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500"
101                ;;
102esac
103
104# project prerequisites:
105
106# libraries:
107ACX_PTHREAD([CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS"],
108                [AC_MSG_ERROR([POSIX threads library is required.])])
109
110AX_PBS([:], [AC_MSG_ERROR([
111PBS libraries/headers not found;
112add --with-pbs to set PBS installation root.]) ])
113CPPFLAGS="${CPPFLAGS} -DCONFDIR=${sysconfdir}"
114
115# headers:
116AC_HEADER_STDC
117AC_HEADER_TIME
118AC_HEADER_STDBOOL
119AC_CHECK_HEADERS([stddef.h stdlib.h string.h strings.h sys/time.h unistd.h])
120
121# types and structures:
122AC_TYPE_SIZE_T
123AC_STRUCT_TM
124
125# compiler characteristic
126AC_C_CONST
127AC_C_INLINE
128AC_C_VOLATILE
129
130# functions:
131AC_FUNC_MALLOC
132AC_FUNC_STRFTIME
133AC_FUNC_VPRINTF
134AC_CHECK_FUNCS([ \
135        asprintf \
136        fstat \
137        getcwd \
138        gettimeofday \
139        localtime_r \
140        memset \
141        mkstemp \
142        setenv \
143        strcasecmp \
144        strchr \
145        strdup \
146        strerror \
147        strlcpy \
148        strndup \
149        strstr \
150        strtol \
151        vasprintf \
152        ])
153
154# system services:
155
156# turn on warning after all tests
157if test x$GCC = xyes; then
158        if test x$enable_development = xyes; then
159                CFLAGS="-Werror ${CFLAGS}"
160        fi
161        CFLAGS="-Wall -W -Wno-unused-parameter $GCC_W_NO_FORMAT_ZERO_LENGTH ${CFLAGS}"
162fi
163
164AC_CONFIG_FILES([
165        Makefile
166        pbs_drmaa/Makefile
167  drmaa2_testsuite/Makefile
168])
169AC_CONFIG_HEADERS([config.h])
170AC_CONFIG_SUBDIRS([drmaa2_utils])
171AC_OUTPUT
172
173echo
174echo "Run 'make' now."
175
Note: See TracBrowser for help on using the repository browser.