source: trunk/configure.ac @ 24

Revision 24, 3.8 KB checked in by mmamonski, 8 years ago (diff)

lost commit :/ thx Dominique

  • Property svn:keywords set to Id
Line 
1AC_INIT([DRMAA for PBS Pro], [1.0.9], [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  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=9
26PBS_DRMAA_VERSION_INFO=1:9: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_CPP
47AC_PROG_RANLIB
48AC_PROG_INSTALL
49AC_PROG_LIBTOOL
50AC_PROG_MAKE_SET
51AC_PROG_LN_S
52
53# code generation tools:
54AX_GPERF
55
56# check compiler / set basic flags:
57if test x$ac_cv_prog_cc_stdc = xno; then
58        AC_MSG_ERROR([ANSI C compiler is required])
59fi
60
61if test x$GCC = xyes; then
62        CFLAGS="-pedantic -ansi ${CFLAGS}"
63fi
64AM_CONDITIONAL([GCC], [test x$GCC = xyes])
65
66AX_GCC_WARNINGS()
67
68AH_TEMPLATE([DEBUGGING], [Produce debugging code])
69if test x$enable_debug = xyes; then
70        AC_DEFINE(DEBUGGING,[1])
71        CFLAGS="${CFLAGS} -O0"
72else
73        CPPFLAGS="-DNDEBUG ${CPPFLAGS}"
74fi
75
76AH_TEMPLATE([DEVELOPMENT], [Development mode])
77if test x$enable_development = xyes; then
78        AC_DEFINE(DEVELOPMENT, [1])
79fi
80
81AH_BOTTOM([
82#ifndef __GNUC__
83#       define __attribute__ /* nothing */
84#endif
85])
86
87# system:
88CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE ${CPPFLAGS}"
89
90AC_CANONICAL_HOST
91case "$host_os" in
92        *linux*)
93                CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
94                ;;
95        *solaris*)
96                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
97                ;;
98        *freebsd*)
99                ;;
100        *darwin*)
101                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=400"
102                ;;
103        *)
104                CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=500"
105                ;;
106esac
107
108# project prerequisites:
109
110# libraries:
111ACX_PTHREAD([CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS"],
112                [AC_MSG_ERROR([POSIX threads library is required.])])
113
114AX_PBS([:], [AC_MSG_ERROR([
115PBS libraries/headers not found;
116add --with-pbs to set PBS installation root.]) ])
117CPPFLAGS="${CPPFLAGS} -DCONFDIR=${sysconfdir}"
118
119# headers:
120AC_HEADER_STDC
121AC_HEADER_TIME
122AC_HEADER_STDBOOL
123AC_CHECK_HEADERS([stddef.h stdlib.h string.h strings.h sys/time.h unistd.h])
124
125# types and structures:
126AC_TYPE_SIZE_T
127AC_STRUCT_TM
128
129# compiler characteristic
130AC_C_CONST
131AC_C_INLINE
132AC_C_VOLATILE
133
134# functions:
135AC_FUNC_MALLOC
136AC_FUNC_STRFTIME
137AC_FUNC_VPRINTF
138AC_CHECK_FUNCS([ \
139        asprintf \
140        fstat \
141        getcwd \
142        gettimeofday \
143        localtime_r \
144        memset \
145        mkstemp \
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.