source: branches/2.0/configure.ac @ 77

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

DRMAA 2.0 utils - first skeleton

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