File: configure.ac

package info (click to toggle)
regina-normal 4.5-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 16,824 kB
  • ctags: 7,862
  • sloc: cpp: 63,296; ansic: 12,913; sh: 10,556; perl: 3,294; makefile: 947; python: 188
file content (460 lines) | stat: -rw-r--r-- 15,194 bytes parent folder | download
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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
dnl
dnl    DO NOT EDIT THIS FILE DIRECTLY if this source tree has been checked
dnl    out from subversion or CVS.  It has been automatically generated by
dnl    Makefile.svn and any changes will be overwritten.  Try editing
dnl    configure.ac.top or configure.ac.bot from subdirectory ./admin instead.
dnl
dnl    Regina - A Normal Surface Theory Calculator
dnl    Configure Script Generator
dnl
dnl    Copyright (c) 2002-2008, Ben Burton
dnl    For further details contact Ben Burton (bab@debian.org).
dnl
dnl    Process this file with autoconf to produce a configure script.
dnl    Autoconf version >= 2.50 is required.
dnl
dnl    This file is free software; you can redistribute it and/or
dnl    modify it under the terms of the GNU General Public License as
dnl    published by the Free Software Foundation; either version 2 of the
dnl    License, or (at your option) any later version.
dnl
dnl    This file is distributed in the hope that it will be useful, but
dnl    WITHOUT ANY WARRANTY; without even the implied warranty of
dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dnl    General Public License for more details.
dnl
dnl    You should have received a copy of the GNU General Public
dnl    License along with this program; if not, write to the Free
dnl    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
dnl    MA 02110-1301, USA.
dnl

###########################################################
#
# Initialisation.
#
###########################################################

AC_INIT(Regina, [4.5], [regina-user@lists.sourceforge.net], regina)
AC_PREREQ(2.50)
AC_CONFIG_AUX_DIR(admin)
AC_CONFIG_SRCDIR(engine/triangulation/ntriangulation.cpp)

# Having a correct --prefix is critical.  Make a reasonable guess.
AC_PREFIX_PROGRAM(meinproc)

# Recommended by the KDE folks to avoid ksh/zsh problems.
unset CDPATH

# This will run AC_CANONICAL_{BUILD,HOST,TARGET}, all of which replace
# AC_CANONICAL_SYSTEM, according to the autoconf docs.
AC_CANONICAL_TARGET

# Transform program names.
AC_ARG_PROGRAM

# The KDE folks say that we should not do the automake initialisation
# until this point.
AM_INIT_AUTOMAKE(regina, [4.5])
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(engine/regina-config.h)

# Do we need to install using a non-standard package name?
AC_ARG_VAR(PKGNAME, [the package name to install as (default: regina)])
if test "x" != "x$PKGNAME"; then
  AC_SUBST(PACKAGE, [$PKGNAME])
fi

# Extract major and minor package version numbers.
REGINA_PACKAGE_VERSIONS

###########################################################
#
# Check for C/C++ tools.
#
###########################################################

AC_CHECK_COMPILERS

# Put back the exception handling that KDE takes out, since we need it
# for boost.
CXXFLAGS="`echo "$CXXFLAGS" | sed s/-fno-exceptions//`"

KDE_PROG_LIBTOOL
LIBTOOL="$LIBTOOL --silent"
AM_KDE_WITH_NLS

# Set the default language to C++ for subsequent tests.
AC_LANG(C++)

AC_CHECK_PROGS(_UTIL_FIND, [find], none)
if test "$_UTIL_FIND" = "none"; then
  REGINA_ERR_MISSING([The find utility], [the build system])
fi

AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S

###########################################################
#
# Check for compiler characteristics.
#
###########################################################

# Check for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_CHECK_TYPES(__int64)

# Check for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([strtol strtoul])

# Other custom checks.
REGINA_CXX_PARTIAL_SPECIALISATION
REGINA_TYPE_HASH_SET
REGINA_VAR_IOS_NOCREATE
REGINA_LD_ADD_STDCALL_ALIAS
AC_CHECK_KDEMAXPATHLEN

###########################################################
#
# Determine which components the user is disabling.
#
###########################################################

AC_ARG_ENABLE(kdeui, AC_HELP_STRING([--disable-kdeui],
    [do not build the Regina KDE user interface]), [
  if test "$enableval" = "no"; then
    REGINA_DO_NOT_COMPILE([KDEUI])
  fi
])
AC_ARG_ENABLE(python, AC_HELP_STRING([--disable-python],
    [do not build the Regina python module]), [
  if test "$enableval" = "no"; then
    REGINA_DO_NOT_COMPILE([PYTHON])
  fi
])
AC_ARG_ENABLE(mpi, AC_HELP_STRING([--disable-mpi],
    [do not build any Regina MPI-enabled utilities]), [
  if test "$enableval" = "no"; then
    REGINA_DO_NOT_COMPILE([MPI])
  fi
])
AC_ARG_ENABLE(docs, AC_HELP_STRING([--disable-docs],
    [do not build the Regina API documentation]), [
  if test "$enableval" = "no"; then
    REGINA_DO_NOT_COMPILE([DOCSENGINE])
  fi
])
AC_ARG_ENABLE(release-mode, AC_HELP_STRING([--enable-release-mode],
    [additional tasks for preparing new source releases]), [
  if test "$enableval" = "yes"; then
    release_mode=true
  else
    release_mode=false
  fi
])
AM_CONDITIONAL(COND_RELEASE_MODE, test "$release_mode" = true)

###########################################################
#
# Check for documentation tools.
#
###########################################################

REGINA_PROG_OPTIONAL(doxygen, DOXYGEN,
  [Doxygen command for C++ source documentation], [DOCSENGINE],
  [calculation engine documentation])

AC_ARG_VAR([DOCBOOK2MAN], [Command for converting SGML to man pages])
AC_CHECK_PROGS([DOCBOOK2MAN], [docbook2man], none)
AM_CONDITIONAL(HAVE_DOCBOOK2MAN, test "$DOCBOOK2MAN" != "none")

###########################################################
#
# Check for mandatory headers and libraries.
#
###########################################################

# Process --with-extra-includes and --with-extra-libs.
# We move these flags into CFLAGS/CXXFLAGS/LDFLAGS so that non-KDE
# material can benefit from them as well.
KDE_CHECK_EXTRA_LIBS
if test -n "$USER_INCLUDES"; then
  CFLAGS="$CFLAGS $USER_INCLUDES"
  CXXFLAGS="$CXXFLAGS $USER_INCLUDES"
  USER_INCLUDES=
fi
if test -n "$USER_LDFLAGS"; then
  LDFLAGS="$LDFLAGS $USER_LDFLAGS"
  USER_LDFLAGS=
fi

REGINA_HEADER_REQUIRED(zlib.h, [the calculation engine])
REGINA_LIB_REQUIRED(z, zlibVersion, [the calculation engine])

# It seems libm is required by libxml2 when doing static linking.
REGINA_LIB_REQUIRED(m, log10, [the calculation engine])

REGINA_HEADER_REQUIRED(gmp.h, [the calculation engine])
REGINA_LIB_REQUIRED(gmp, __gmpz_init, [the calculation engine])

KDE_CHECK_THREADING
if test "$kde_use_threading" != "yes"; then
  REGINA_ERR_MISSING([POSIX pthread support], [the calculation engine])
fi
LDFLAGS="$LDFLAGS $USE_THREADS"

# The libxml2 check seems to need to be done under C, not C++.
AC_LANG_PUSH(C)
AM_PATH_XML2([2.0.0], , [
  REGINA_ERR_MISSING([Library libxml2], [the calculation engine])
])
AC_LANG_POP(C)

###########################################################
#
# Check for optional headers and libraries.
#
###########################################################

REGINA_HEADER_OPTIONAL(popt.h, [UTILS MPI], [command-line utilities])
REGINA_LIB_OPTIONAL(popt, poptGetContext, UTILS_LIBS, [UTILS MPI],
  [command-line utilities])

AM_ICONV

AM_PATH_CPPUNIT([1.8.0], , [
  REGINA_WARN_MISSING([Library cppunit], [the test suite])
  REGINA_DO_NOT_COMPILE(TESTSUITE)
])

REGINA_SHOULD_BUILD_INTERNAL(PYTHON)
if test "$should_build" = "yes"; then
  REGINA_LIB_BOOST_PYTHON(PYTHON, [the Python interface])
  REGINA_CHECK_BOOST_MAKE_CONSTRUCTOR
fi

REGINA_SHOULD_BUILD_INTERNAL(KDEUI)
if test "$should_build" = "yes"; then
  KDE_USE_QT(3.2, [>= Qt 3.2], [QT_VERSION >= 0x030200])
  KDE_SET_PREFIX
  AC_PATH_KDE
  REGINA_CHECK_KDE_MODULEDIR
  REGINA_CHECK_KDE_VERSION
else
  # There are some tests from AC_PATH_KDE that need to be run regardless.
  AC_CHECK_FUNCS([vsnprintf snprintf])

  # There are also some conditionals that must be defined.
  AM_CONDITIONAL(include_ARTS, false)
fi

REGINA_SHOULD_BUILD_INTERNAL(MPI)
if test "$should_build" = "yes"; then
  ACX_MPI([], [
    REGINA_WARN_MISSING([MPI development environment], [MPI-enabled utilities])
    REGINA_DO_NOT_COMPILE(MPI)
  ])
fi

###########################################################
#
# Miscellaneous other headers.
#
###########################################################

AC_HEADER_STDC
AC_CHECK_HEADERS([unistd.h])

###########################################################
#
# Verify that shared libraries are enabled if required.
#
###########################################################

REGINA_SHOULD_BUILD_INTERNAL(KDEUI)
if test "$should_build" = "yes"; then
  REGINA_LIBTOOL_SHLIBS_REQUIRED([the KDE user interface], [--disable-kdeui])
fi

REGINA_SHOULD_BUILD_INTERNAL(PYTHON)
if test "$should_build" = "yes"; then
  REGINA_LIBTOOL_SHLIBS_REQUIRED([the Python interface], [--disable-python])
fi

###########################################################
#
# Finalise include and library paths.
#
###########################################################

# Includes required by the calculation engine.
# AM_PATH_XML2 seems to have switched recently from using XML_CFLAGS to
# XML_CPPFLAGS; we'd better allow for either here.
ENGINE_EXTERNAL_INCLUDES="$XML_CFLAGS $XML_CPPFLAGS"
ENGINE_INCLUDES="-I\$(top_srcdir)/engine $ENGINE_EXTERNAL_INCLUDES"
AC_SUBST(ENGINE_EXTERNAL_INCLUDES)
AC_SUBST(ENGINE_INCLUDES)

# Libraries required by the calculation engine.
ENGINE_LIBS="$XML_LIBS $LIBPTHREAD"
AC_SUBST(ENGINE_LIBS)

# Additional libraries required by the test suite.
TESTSUITE_LIBS="$CPPUNIT_LIBS"
AC_SUBST(TESTSUITE_LIBS)

# The set of all Qt/KDE libraries required by the GUI.
GUI_KDE_LIBS="$LIB_KPARTS $LIB_KABC $LIB_KDEUI $LIB_KIO $LIB_KDECORE $LIB_QT -lktexteditor"
AC_SUBST(GUI_KDE_LIBS)

# Do we wish to statically link the calculation engine into final targets?
__static_final=no
LIB_ENGINE="\$(top_builddir)/engine/libregina-engine.la"
AC_ARG_ENABLE(static-final, AC_HELP_STRING([--enable-static-final],
    [statically link the calculation engine into final executables and modules [[default=no]]]), [
  if test "$enableval" != "no"; then
    __static_final=yes
    LIB_ENGINE="\$(top_builddir)/engine/libregina-engine-noinst.la"
  fi
])
AM_CONDITIONAL(STATIC_FINAL, test "$__static_final" = "yes")

# The actual calculation engine library with which to link; note that
# this depends on whether --enable-static-final is being used.
AC_SUBST(LIB_ENGINE)

###########################################################
#
# Create alternate sets of compiler flags.
#
###########################################################

# Make a set of compilation flags without debugging symbols.
CXXFLAGS_NODEBUG="`echo "$CXXFLAGS" | sed 's/-g[[0-9]]\? //'`"
AC_SUBST(CXXFLAGS_NODEBUG)

###########################################################
#
# Decide what should and should not be built.
#
###########################################################

REGINA_SHOULD_BUILD(ENGINE, engine, [the calculation engine library])
REGINA_SHOULD_BUILD(KDEUI, kdeui, [the KDE user interface])
REGINA_SHOULD_BUILD(PYTHON, python, [the Python interface])
REGINA_SHOULD_BUILD(UTILS, utils, [command-line utilities])
REGINA_SHOULD_BUILD(MPI, mpi, [MPI-enabled utilities])
REGINA_SHOULD_BUILD(TESTSUITE, testsuite, [the test suite])
REGINA_SHOULD_BUILD(DOCSENGINE, engine, [calculation engine docs])

AM_CONDITIONAL(COND_BUILD_PYTHON, test -n "$REGINA_BUILD_PYTHON")

###########################################################
#
# Prepare output files.
#
###########################################################

# List of Makefiles (automatically generated by Makefile.svn):
AC_CONFIG_FILES([admin/Makefile])
AC_CONFIG_FILES([admin/stubs/Makefile])
AC_CONFIG_FILES([docs/engine/Makefile])
AC_CONFIG_FILES([docs/Makefile])
AC_CONFIG_FILES([docs/man/Makefile])
AC_CONFIG_FILES([engine/algebra/Makefile])
AC_CONFIG_FILES([engine/angle/Makefile])
AC_CONFIG_FILES([engine/census/Makefile])
AC_CONFIG_FILES([engine/doxygen/Makefile])
AC_CONFIG_FILES([engine/enumerate/Makefile])
AC_CONFIG_FILES([engine/file/Makefile])
AC_CONFIG_FILES([engine/foreign/Makefile])
AC_CONFIG_FILES([engine/Makefile])
AC_CONFIG_FILES([engine/manifold/Makefile])
AC_CONFIG_FILES([engine/maths/Makefile])
AC_CONFIG_FILES([engine/packet/Makefile])
AC_CONFIG_FILES([engine/progress/Makefile])
AC_CONFIG_FILES([engine/snappea/kernel/Makefile])
AC_CONFIG_FILES([engine/snappea/Makefile])
AC_CONFIG_FILES([engine/split/Makefile])
AC_CONFIG_FILES([engine/subcomplex/Makefile])
AC_CONFIG_FILES([engine/surfaces/Makefile])
AC_CONFIG_FILES([engine/triangulation/Makefile])
AC_CONFIG_FILES([engine/utilities/Makefile])
AC_CONFIG_FILES([examples/Makefile])
AC_CONFIG_FILES([examples/sigs/Makefile])
AC_CONFIG_FILES([icons/Makefile])
AC_CONFIG_FILES([icons/povray/Makefile])
AC_CONFIG_FILES([kdeui/doc/en/Makefile])
AC_CONFIG_FILES([kdeui/doc/Makefile])
AC_CONFIG_FILES([kdeui/Makefile])
AC_CONFIG_FILES([kdeui/src/common/Makefile])
AC_CONFIG_FILES([kdeui/src/common/python/Makefile])
AC_CONFIG_FILES([kdeui/src/Makefile])
AC_CONFIG_FILES([kdeui/src/part/foreign/Makefile])
AC_CONFIG_FILES([kdeui/src/part/Makefile])
AC_CONFIG_FILES([kdeui/src/part/packettypes/Makefile])
AC_CONFIG_FILES([kdeui/src/pics/Makefile])
AC_CONFIG_FILES([kdeui/src/shell/Makefile])
AC_CONFIG_FILES([kdeui/src/toolbar-main/Makefile])
AC_CONFIG_FILES([kdeui/src/toolbar/Makefile])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([pylib/Makefile])
AC_CONFIG_FILES([python/algebra/Makefile])
AC_CONFIG_FILES([python/angle/Makefile])
AC_CONFIG_FILES([python/census/Makefile])
AC_CONFIG_FILES([python/file/Makefile])
AC_CONFIG_FILES([python/foreign/Makefile])
AC_CONFIG_FILES([python/Makefile])
AC_CONFIG_FILES([python/manifold/Makefile])
AC_CONFIG_FILES([python/maths/Makefile])
AC_CONFIG_FILES([python/packet/Makefile])
AC_CONFIG_FILES([python/progress/Makefile])
AC_CONFIG_FILES([python/snappea/Makefile])
AC_CONFIG_FILES([python/split/Makefile])
AC_CONFIG_FILES([python/srcutils/Makefile])
AC_CONFIG_FILES([python/subcomplex/Makefile])
AC_CONFIG_FILES([python/surfaces/Makefile])
AC_CONFIG_FILES([python/testsuite/Makefile])
AC_CONFIG_FILES([python/triangulation/Makefile])
AC_CONFIG_FILES([python/utilities/Makefile])
AC_CONFIG_FILES([scripts/Makefile])
AC_CONFIG_FILES([testsuite/angle/Makefile])
AC_CONFIG_FILES([testsuite/census/Makefile])
AC_CONFIG_FILES([testsuite/Makefile])
AC_CONFIG_FILES([testsuite/maths/Makefile])
AC_CONFIG_FILES([testsuite/snappea/Makefile])
AC_CONFIG_FILES([testsuite/surfaces/Makefile])
AC_CONFIG_FILES([testsuite/triangulation/Makefile])
AC_CONFIG_FILES([testsuite/utilities/Makefile])
AC_CONFIG_FILES([utils/Makefile])
AC_CONFIG_FILES([utils/mpi/Makefile])

# Other files:
AC_CONFIG_FILES([engine/doxygen/docs.conf])
AC_CONFIG_FILES([engine/regina-engine-config], [chmod +x engine/regina-engine-config])
AC_CONFIG_FILES([python/regina-python], [chmod +x python/regina-python])
AC_CONFIG_FILES([python/testsuite/testall], [chmod +x python/testsuite/testall])

AC_OUTPUT

# From the KDE configure scripts:
if test "$all_tests" = "bad"; then
  if test ! "$cache_file" = "/dev/null"; then
    echo ""
    echo "Please remove the file $cache_file after changing your setup"
    echo "so that configure will find the changes next time."
    echo ""
  fi
else
  echo ""
  echo "Good - your configure finished.  Start make now."
  echo ""
fi