File: configure.ac

package info (click to toggle)
libalberta2 2.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 6,260 kB
  • ctags: 4,829
  • sloc: ansic: 62,180; sh: 9,256; makefile: 446; cpp: 225; fortran: 148
file content (312 lines) | stat: -rw-r--r-- 8,794 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT([alberta], [2.0.1], [claus@mathematik.uni-freiburg.de])

AC_CONFIG_SRCDIR([alberta/src/Common/alberta.h])
AM_MAINTAINER_MODE
AC_CANONICAL_BUILD
AC_CANONICAL_HOST

AC_CONFIG_FILES([Makefile gnu-compat/Makefile
                 alberta_util/Makefile alberta_util/src/Makefile
                 alberta_util/src/alberta_util_inlines.h.in
		 add_ons/Makefile
		 add_ons/geomview/Makefile
		 add_ons/grape/Makefile
		 add_ons/grape/mesh/Makefile
                 add_ons/grape/mesh/2d/Makefile
                 add_ons/grape/mesh/3d/Makefile
		 add_ons/meshtv/Makefile
		 add_ons/meshtv/1d/Makefile
		 add_ons/meshtv/2d/Makefile
		 add_ons/meshtv/3d/Makefile
		 demo/src/Makefile
		 demo/src/1d/Makefile demo/src/2d/Makefile demo/src/3d/Makefile
		 alberta/Makefile alberta/src/Makefile
		 alberta/src/Common/Makefile alberta/src/Common/Makefile.alberta])

AC_CONFIG_COMMANDS([demo],
[if ! test "$srcdir" = \. ; then
	AC_MSG_NOTICE([Copying $srcdir/demo sources to current directory])
	( cd $srcdir && tar cf - demo ) | tar xf -
fi])

#
# A special command that checks whether alberta_util_inlines.h exists
# and is identical to alberta_util_inlines.h.in. Then do nothing. If
# something has changed, copy albert_util_inlines.h.in to
# alberta_util_inlines.h
#
AC_CONFIG_COMMANDS([alberta_util/src/alberta_util_inlines.h],
[if test -f alberta_util/src/alberta_util_inlines.h && \
    cmp alberta_util/src/alberta_util_inlines.h alberta_util/src/alberta_util_inlines.h.in
then
	AC_MSG_NOTICE([alberta_util/src/alberta_util_inlines.h is unchanged])
else
	AC_MSG_NOTICE([Creating alberta_util/src/alberta_util_inlines.h])
	cp \
		alberta_util/src/alberta_util_inlines.h.in \
		alberta_util/src/alberta_util_inlines.h
fi])

dnl
dnl all CONFIG_FILES for the ALBERTA libraries are added through the
dnl ALBERT_DIMENSION_ENABLE/DISABLE() macros
dnl

AM_INIT_AUTOMAKE([1.7])
AM_CONFIG_HEADER([config.h])

# change the installation directory. This could surely be done more elegantly...
dnl
dnl cH: hey, boys and girls, why do we do that?
dnl
AC_PREFIX_DEFAULT([`pwd`])

# Checks for programs.
AC_PROG_INSTALL
AC_PROG_LN_S
AC_CHECK_PROGS([GZIP_PROGRAM],[gzip])
AC_CHECK_PROGS([TAR_PROGRAM],[gtar tar])
AC_ARG_VAR([GZIP_PROGRAM],[name of gzip program])
AC_ARG_VAR([TAR_PROGRAM],[name of tar program (need _not_ be GNU-tar)])

# Compiler characteristics
dnl
dnl ****************************************************************************
dnl
dnl First, we zap CFLAGS, FFLAGS and CXXFLAGS (unless explicitly set
dnl by the user). We then choose -O3 for gcc and -O for all other
dnl compilers, and no optimization for the debugging library.
dnl
dnl NOTE: we use 7 spaces to distinguish a user-override of "" from
dnl our internal hack. Personally, I'd prefer to leave the fiddling
dnl with the CFLAGS to the user. Mmmh.
dnl
test -z "$CFLAGS" && CFLAGS="       "
test -z "$FFLAGS" && FFLAGS="       "
dnl test -z "$CXXFLAGS" && CXXFLAGS="       "
dnl
dnl ****************************************************************************
dnl
dnl now check for compilers
dnl

AC_PROG_CC
AC_C_INLINE
AC_PROG_F77

dnl
dnl Support for FORTRAN code in ALBERTA
dnl

AC_F77_LIBRARY_LDFLAGS
AC_F77_FUNC([dnrm2],[DNRM2_F77_FUNC])
AC_F77_FUNC([daxpy],[DAXPY_F77_FUNC])
AC_F77_FUNC([dexpy],[DEXPY_F77_FUNC])
AC_F77_FUNC([dmxpy],[DMXPY_F77_FUNC])
AC_F77_FUNC([dcopy],[DCOPY_F77_FUNC])
AC_F77_FUNC([ddot],[DDOT_F77_FUNC])
AC_F77_FUNC([dscal],[DSCAL_F77_FUNC])
AC_F77_FUNC([dswap],[DSWAP_F77_FUNC])
AC_F77_FUNC([dxpay],[DXPAY_F77_FUNC])
AC_F77_FUNC([drandn],[DRANDN_F77_FUNC])
AC_SUBST([DNRM2_F77_FUNC])
AC_SUBST([DAXPY_F77_FUNC])
AC_SUBST([DEXPY_F77_FUNC])
AC_SUBST([DMXPY_F77_FUNC])
AC_SUBST([DCOPY_F77_FUNC])
AC_SUBST([DDOT_F77_FUNC])
AC_SUBST([DSCAL_F77_FUNC])
AC_SUBST([DSWAP_F77_FUNC])
AC_SUBST([DXPAY_F77_FUNC])
AC_SUBST([DRANDN_F77_FUNC])

dnl
dnl ****************************************************************************
dnl
dnl quick and very dirty hack for icc
dnl
if test `basename $CC` = icc; then
	GCC=yes
fi
dnl
dnl work around a bug in libtool which pulls in the C++ compiler which
dnl we do not want at the moment. Remove the next two lines when this
dnl changes!
dnl
dnl AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG],[:])
dnl AC_DEFUN([AC_LIBTOOL_CXX],[:])

dnl *********************** end CXX hack ***************************************
AC_PROG_LIBTOOL

if test `basename $CC` = icc; then
	GCC=no
fi
dnl
dnl ****************************************************************************
dnl
dnl set default debugging flags, but allow for user-override
dnl
if test -z "${ALBERTA_DEBUG_CFLAGS}"; then
	if test "$GCC" = yes; then
		ALBERTA_DEBUG_CFLAGS="-Wall -O0 -ggdb3"
	else
		ALBERTA_DEBUG_CFLAGS="-g"
	fi
fi
AC_ARG_VAR([ALBERTA_DEBUG_CFLAGS],[Compiler-flags used to create the debug-enabled libraries])
dnl
dnl ****************************************************************************
dnl
dnl Set default optimizing flags, but allow for user-override.
dnl With gcc, provide basic debugging facilities even with optimized
dnl code.
dnl
if test -z "${ALBERTA_OPTIMIZE_CFLAGS}"; then
	if test "$GCC" = yes; then
		ALBERTA_OPTIMIZE_CFLAGS="-Wall -O3"
	else
		ALBERTA_OPTIMIZE_CFLAGS="-O"
	fi
fi
AC_ARG_VAR([ALBERTA_OPTIMIZE_CFLAGS],[Compiler-flags used to create the optimised libraries])
if test "${FFLAGS}" = "       "; then
	if test "$GCC" = yes; then
		FFLAGS="-O3"
	else
		FFLAGS="-O"
	fi
fi
dnl if test "${CXXFLAGS}" = "       "; then
dnl 	if test "$GCC" = yes; then
dnl 		CXXFLAGS="-O3"
dnl 	else
dnl 		CXXFLAGS="-O"
dnl 	fi
dnl fi
dnl
dnl ****************************************************************************
dnl

# Checks for libraries.

# Replace `main' with a function in -lm:
AC_CHECK_LIB([m],[main],,
             [AC_MSG_ERROR([no math library, exiting...!])])

AC_CHECK_FUNCS([alarm pow sqrt strdup strchr strstr random srandom],,
	       [AC_MSG_ERROR([Sorry, these are needed..])])

AC_FUNC_MALLOC
AC_FUNC_VPRINTF

AC_CHECK_FUNCS([unsetenv])
AC_CHECK_FUNCS([getopt_long],[],
	[AC_LIBOBJ([getopt])
	AC_LIBOBJ([getopt1])
	GNUCOMPAT_INCLUDE_PATH='$(top_srcdir)/gnu-compat/'])
AC_SUBST([GNUCOMPAT_INCLUDE_PATH])

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([unistd.h X11/Xlib.h X11/Xutil.h],,
		 [AC_MSG_ERROR([Exiting...])])
AC_CHECK_HEADERS([rpc/xdr.h],,[AC_MSG_ERROR([Exiting...])])

# xdr_intXX_t() functions (i.e. processor independent type sizes)
AC_CHECK_FUNCS([xdr_int32_t xdr_int64_t xdr_int])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL

dnl -----------------------
dnl THESE ARE OUR OWN TESTS
dnl -----------------------
dnl
dnl check for BLAS library. The BLAS may come under different names. We default
dnl to -lblas, but other possibilities are sunperf, atlas, cxml (Alpha AXP)
dnl etc etc etc etc etc etc etc etc etc etc ...........................
dnl
dnl Let the user decide what it wants (handled by ALBERTA_CHECK_PACKAGE()
dnl
ALBERTA_CHECK_PACKAGE(blas, blas, , ${FLIBS},,,,required)

dnl
dnl check for X11
dnl
AC_PATH_X
AC_PATH_XTRA
X_ALL_LIBS="${X_PRE_LIBS} ${X_LIBS} -lX11 ${X_EXTRA_LIBS}"
AC_SUBST(X_ALL_LIBS)

dnl
dnl check for OpenGL
dnl
ALBERTA_CHECK_PACKAGE(opengl, GL, ,${X_ALL_LIBS}, GL/gl.h,,,required)

dnl
dnl check for optional package gltools
dnl
ALBERTA_CHECK_PACKAGE(gltools, gltools, ,${OPENGL_ALL_LIB} ${X_ALL_LIBS}, glmesh.h,,,optional)

dnl
dnl check for optional package dx
dnl
ALBERTA_CHECK_PACKAGE(dx, DXL, ,-lrt -lDXcallm,dx/dx.h,,,optional)

if test -n "${HAVE_DX_FALSE}"; then
AC_CHECK_HEADERS([unistd.h errno.h Xm/Xm.h Xm/Form.h Xm/DrawingA.h pthread.h],,
		 [AC_MSG_ERROR([Sorry, needed for dxtools, exiting...])])
fi

dnl
dnl GRAPE interface stuff
dnl
ALBERTA_GRAPE_STUFF

dnl
dnl MeshTV interface stuff
dnl
ALBERTA_CHECK_PACKAGE(silo, silo, ,, silo.h, , ,optional)

dnl
dnl Geomview interface, should not depend on any other installed
dnl library, just a conversion tool.
dnl
AM_CONDITIONAL(GEOMVIEW, false)

dnl
dnl Debugging
dnl

ALBERTA_ENABLE_FLAG([debug],
                    [disable building of ALBERTA libraries with debugging information.],
                    1,
                    ALBERTA_DEBUG)

dnl
dnl Install libtool.alberta for shared libraries?
dnl
ALBERTA_ENABLE_FLAG([install-libtool], [disable installation of libtool.alberta], 1)

# building of all versions is enabled by default, but can be
# disabled using --disable-DOW-dimension switches (the macros
# below do _not_ disable the builds, but simply implement
# AC_ARG_ENABLE() stuff
#
# BIG FAT NOTE: the DIMENSION_DISABLE macro MUST COME LAST, right
# before the AC_OUTPUT
#
ALBERTA_DIMENSION_DISABLE(1)
ALBERTA_DIMENSION_DISABLE(2)
ALBERTA_DIMENSION_DISABLE(3)

#
# flush everything to disk
#
AC_OUTPUT