source: trunk/configure.ac @ 39

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

version in autoconf header

  • Property svn:keywords set to Id
Line 
1AC_INIT([DRMAA for PBS Pro], [1.0.10], [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=10
26PBS_DRMAA_VERSION_INFO=1:10: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        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([drmaa_utils])
173AC_OUTPUT
174
175echo
176echo "Run 'make' now."
177
Note: See TracBrowser for help on using the repository browser.