ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/ac-tools/configure.in
Revision: 2315
Committed: Tue Sep 20 22:03:35 2005 UTC (18 years, 9 months ago) by gezelter
File size: 13627 byte(s)
Log Message:
added check for zlib in configure

File Contents

# User Rev Content
1 gezelter 1490 dnl **** Process this file with autoconf to produce a configure script.
2    
3 gezelter 1499 AC_INIT(OOPSE, 2.0, gezelter@nd.edu, oopse)
4 gezelter 1490 AC_CONFIG_AUX_DIR(ac-tools)
5    
6     builtin(include, ac-tools/fortran90.m4)
7     builtin(include, ac-tools/aclocal.m4)
8    
9 gezelter 1509 AC_CONFIG_SRCDIR([src/applications/oopse/oopse.cpp])
10 gezelter 1490
11     AC_PREFIX_DEFAULT("/usr/local")
12    
13     # set program name
14     PROGNAME="oopse"
15     AC_SUBST(PROGNAME)
16    
17     # there are two ways to do debugging. One with the --enable-debug flag
18     # and one using the DEBUG environment variable
19    
20     debug=0
21     AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Compile OOPSE in debug mode]), [debug=1])
22     if test "${DEBUG}"; then
23     AC_DEFINE(debug, 1, [Code compiled in debug mode])
24     msg="$msg, debug mode"
25     fi
26     AC_SUBST(debug)
27    
28     # who am i
29     AC_CANONICAL_HOST
30    
31 gezelter 1509
32    
33 gezelter 1490 dnl Checks for C compiler
34     AC_PROG_CC([icc xlc gcc cc])
35    
36     dnl Checks for C++ compiler
37     AC_PROG_CXX([icpc icc xlc++ xlC CC g++ c++])
38    
39     dnl If we are not running g++ then we might need some other flags
40     dnl to get the templates compiled correctly
41     OOPSE_TEMPLATE_FLAGS=""
42     if test $ac_cv_prog_gxx = no; then
43     AC_MSG_CHECKING([checking whether ${CXX} accepts -ptused -no_prelink])
44     echo 'void f(){}' > conftest.cc
45     if test -z "`${CXX} -ptused -no_prelink -c conftest.cc 2>&1`"; then
46     AC_MSG_RESULT(yes)
47     OOPSE_TEMPLATE_FLAGS="-ptused -no_prelink"
48     else
49     AC_MSG_RESULT(no)
50     fi
51     rm -f conftest*
52     AC_MSG_CHECKING([checking whether ${CXX} accepts -instances=static])
53     echo 'void f(){}' > conftest.cc
54     if test -z "`${CXX} -instances=static -c conftest.cc 2>&1`"; then
55     AC_MSG_RESULT(yes)
56     OOPSE_TEMPLATE_FLAGS="-instances=static"
57     else
58     AC_MSG_RESULT(no)
59     fi
60     rm -f conftest*
61     AC_MSG_CHECKING([checking whether ${CXX} accepts -pto])
62     echo 'void f(){}' > conftest.cc
63     if test -z "`${CXX} -pto -c conftest.cc 2>&1`"; then
64     AC_MSG_RESULT(yes)
65     OOPSE_TEMPLATE_FLAGS="-pto"
66     else
67     AC_MSG_RESULT(no)
68     fi
69     rm -f conftest*
70     AC_MSG_CHECKING([checking whether ${CXX} accepts -LANG:std])
71     echo 'void f(){}' > conftest.cc
72     if test -z "`${CXX} -LANG:std -c conftest.cc 2>&1`"; then
73     AC_MSG_RESULT(yes)
74    
75    
76     EXTRA_CC_FLAG=${EXTRA_CC_FLAG}" -LANG:std"
77     else
78     AC_MSG_RESULT(no)
79     fi
80     fi
81     AC_SUBST(OOPSE_TEMPLATE_FLAGS)
82     AC_SUBST(EXTRA_CC_FLAG)
83    
84     dnl Fortran 90 compilation checks are next
85    
86     AC_PROG_F90([ifort ifc f90 xlf90 pgf90 epcf90 f95 xlf95 lf95 fort g95])
87     dnl Check the flag for Fortran90 preprocessing
88     ACX_PROG_F90_PREPFLAG
89     dnl Check to see if a flag is required for preprocessing defines
90     ACX_PROG_F90_PREPDEFFLAG
91     AC_LANG_PUSH(Fortran 90)
92     AC_LANG_PREPROC(Fortran 90)
93     AC_F90_LIBRARY_LDFLAGS
94     dnl How does Fortran mangle function names
95     AC_F90_WRAPPERS
96     AC_SUBST(F90_FUNC)
97     AC_SUBST(F90_FUNC_)
98     dnl Fortran 90 module suffix
99     AC_CHECK_MODSUFFIX
100     dnl Fortran 90 module path specifier
101     AC_CHECK_MODDIRFLAG
102 gezelter 1535 AC_F90_MODULE_NAMES
103     pat=`echo $ac_cv_f90_module_names | sed 's/.*\(%.*%\).*/\1/'`
104     F90_MODULE_NAMES=empty
105     case $pat in
106     %MODULE%)
107     F90_MODULE_NAMES=UPPER ;;
108     %Module%)
109     F90_MODULE_NAMES=Mixed ;;
110     %module%)
111     F90_MODULE_NAMES=lower ;;
112     *)
113     F90_MODULE_NAMES=unknown ;;
114     esac
115     AC_SUBST(F90_MODULE_NAMES)
116 gezelter 1490 AC_LANG_POP
117    
118 tim 1997 AC_LANG_PUSH(C)
119 gezelter 2315 ACX_CHECK_ZLIB
120 tim 1997 AC_CHECK_HEADERS(unistd.h sys/pstat.h sys/sysmp.h sys/sysinfo.h sys/table.h sys/param.h sys/sysctl.h sys/sytemcfg.h machine/hal_sysinfo.h)
121     AC_CHECK_FUNCS(pstat_getstatic sysmp getsysinfo sysctl table)
122     # special check for _system_configuration because AIX <4.3.2 do not
123     # contain the `physmem' member.
124     AC_MSG_CHECKING([for external symbol _system_configuration])
125     AC_TRY_COMPILE([#include <sys/systemcfg.h>],
126     [double x = _system_configuration.physmem;],
127     [AC_MSG_RESULT([yes])
128     AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1,
129     [Define if you have the _system_configuration variable.])],
130     [AC_MSG_RESULT([no])])
131    
132 gezelter 1490 dnl check for system getopt
133     adl_FUNC_GETOPT_LONG
134    
135     dnl check for strong optimization options
136    
137     case $debug in
138     1)
139     ;;
140     *)
141     ACX_PROG_CC_MAXOPT
142     ACX_PROG_CXX_MAXOPT
143     ACX_PROG_F90_MAXOPT
144     ;;
145     esac
146    
147     AC_PROG_INSTALL
148     AC_PROG_LN_S
149     AC_PROG_MAKE_SET
150     AC_PROG_RANLIB
151     AC_PROG_YACC
152     AC_PROG_LEX
153 gezelter 2199 AX_SYS_PERLSHARPBANG
154 gezelter 1490 AC_CHECK_PROG(AR, ar, ar, NONE)
155     if test "$AR" = "NONE"; then
156     AC_MSG_ERROR(--> Can't find \`ar'!)
157     AC_CACHE_SAVE
158     exit 1
159     fi
160    
161 gezelter 2023 AC_PATH_PROG(PS, ps)
162 gezelter 2024 AC_CACHE_CHECK([for POSIX or BSD ps syntax], ac_cv_prog_ps_syntax, [
163 gezelter 2026 if $PS ax -o rss > /dev/null 2>&1; then
164     ac_cv_prog_ps_ax=yes
165     else
166     ac_cv_prog_ps_ax=no
167     fi
168 gezelter 2024 if $PS -ef -o rss > /dev/null 2>&1; then
169     ac_cv_prog_ps_ef=yes
170 gezelter 2022 else
171 gezelter 2024 ac_cv_prog_ps_ef=no
172 gezelter 2022 fi
173 gezelter 2026 if test "$ac_cv_prog_ps_ax" = yes; then
174     ac_cv_prog_ps_syntax=BSD
175 gezelter 2024 else
176 gezelter 2029 if test "$ac_cv_prog_ps_ef" = yes; then
177 gezelter 2026 ac_cv_prog_ps_syntax=POSIX
178 gezelter 2024 else
179     AC_MSG_ERROR(Could not determine ps syntax)
180     fi
181     fi
182 gezelter 2022 ])
183 gezelter 2029
184 gezelter 2027 AC_DEFINE_UNQUOTED(PSCOMMAND, $PS, [Path to ps program])
185 gezelter 1490
186 gezelter 2029 if test "$ac_cv_prog_ps_syntax" = BSD; then
187     AC_DEFINE(PSTYPE_IS_BSD, 1)
188     else
189     if test "$ac_cv_prog_ps_syntax" = POSIX; then
190     AC_DEFINE(PSTYPE_IS_POSIX, 1)
191     else
192     AC_MSG_ERROR(Unknown ps syntax type!)
193     fi
194     fi
195 gezelter 2022
196 gezelter 1490 AC_ARG_WITH(mpi,
197     [AC_HELP_STRING([--with-mpi=<prefix>],
198     [compile with MPI installed in <prefix> [default=no]])],
199     with_mpi=$withval,
200     with_mpi="no")
201    
202     case "x$with_mpi" in
203     xyes | "x") USE_MPI=yes;;
204     xno) USE_MPI=no ;;
205     *) MPI="$with_mpi"; USE_MPI=yes ;;
206     esac
207     if test "$USE_MPI" = "yes" -a -z "$with_mpi"; then
208     MPI="/usr/local"
209     fi
210     if test "$USE_MPI" = "yes"; then
211     ACX_MPI
212     fi
213     AC_SUBST(USE_MPI)
214    
215 gezelter 2081 dnl AC_ARG_WITH(sprng,
216     dnl [AC_HELP_STRING([--with-sprng=<prefix>],
217     dnl [compile with SPRNG installed in <prefix> [default=/usr/local]])],
218     dnl with_sprng=$withval,
219     dnl with_sprng="/usr/local")
220     dnl
221     dnl case "x$with_sprng" in
222     dnl xyes | "x") USE_SPRNG=yes;;
223     dnl xno) USE_SPRNG=no ;;
224     dnl *) SPRNG="$with_sprng"; USE_SPRNG=yes ;;
225     dnl esac
226     dnl if test "$USE_SPRNG" = "yes" -a -z "$with_sprng"; then
227     dnl SPRNG="/usr/local"
228     dnl fi
229     dnl if test "$USE_SPRNG" = "yes"; then
230     dnl ACX_SPRNG
231     dnl fi
232     dnl AC_SUBST(USE_SPRNG)
233 gezelter 1490
234 gezelter 2190 dnl ########################################
235     dnl # Check for CGAL headers and libraries #
236     dnl ########################################
237    
238     USE_CGAL=no
239     cgal_makefile=auto
240     AC_ARG_WITH(cgal-makefile,[ --with-cgal-makefile=FILE CGAL makefile that should be used], cgal_makefile="$withval")
241    
242     if test "x$cgal_makefile" != xno; then
243    
244     if test "x$cgal_makefile" = xauto -a "x$CGAL_MAKEFILE" != x; then
245     cgal_makefile="$CGAL_MAKEFILE"
246     fi
247    
248 gezelter 2203 AC_MSG_CHECKING(for cgal_makefile: $cgal_makefile)
249 gezelter 2190
250     if test -f "$cgal_makefile"; then
251    
252     cat >config.tmp.Makefile <<EOF
253     include $cgal_makefile
254     default:
255     @echo CGAL_OS_COMPILER=\"\${CGAL_OS_COMPILER}\" >config.tmp.cgalvariables
256     @echo CGAL_INCLDIR=\"\${CGAL_INCL_DIR}\" >>config.tmp.cgalvariables
257     @echo CGAL_INCLCONFDIR=\"\${CGAL_INCL_CONF_DIR}\" >>config.tmp.cgalvariables
258     @echo CGAL_LIBDIR=\"\${CGAL_LIB_DIR}/\${CGAL_OS_COMPILER}\" >>config.tmp.cgalvariables
259     @echo CGAL_RLIBDIR=\"\${CGAL_LIB_DIR}/\${CGAL_OS_COMPILER}\" >>config.tmp.cgalvariables
260     @echo CGAL_CXXFLAGS=\"\${CGAL_CXXFLAGS}\" >>config.tmp.cgalvariables
261     @echo GMP_INCLDIR=\"\${GMP_INCL_DIR}\" >>config.tmp.cgalvariables
262     @echo GMP_LIBDIR=\"\${GMP_LIB_DIR}\" >>config.tmp.cgalvariables
263     @echo GMP_RLIBDIR=\"\${GMP_LIB_DIR}\" >>config.tmp.cgalvariables
264     @echo LEDA_INCLDIR=\"\${LEDA_INCL_DIR}\" >>config.tmp.cgalvariables
265     @echo LEDA_LIBDIR=\"\${LEDA_LIB_DIR}\" >>config.tmp.cgalvariables
266     @echo LEDA_RLIBDIR=\"\${LEDA_LIB_DIR}\" >>config.tmp.cgalvariables
267     EOF
268    
269     make -s -f config.tmp.Makefile
270     . config.tmp.cgalvariables
271    
272     rm -f config.tmp.Makefile config.tmp.cgalvariables
273    
274     if test "x$CGAL_INCLDIR" = "x"; then
275     CGAL_INCLDIR=""
276     fi
277    
278     if test "x$CGAL_LIBDIR" = "x"; then
279     CGAL_LIBDIR=""
280     fi
281    
282     if test "x$CGAL_RLIBDIR" = "x"; then
283     CGAL_RLIBDIR=""
284     fi
285    
286     if test "x$LEDA_INCLDIR" = "x"; then
287     LEDA_INCLDIR=""
288     fi
289    
290     if test "x$LEDA_LIBDIR" = "x"; then
291     LEDA_LIBDIR=""
292     fi
293    
294     if test "x$LEDA_RLIBDIR" = "x"; then
295     LEDA_RLIBDIR=""
296     fi
297    
298     if test "x$GMP_INCLDIR" = "x"; then
299     GMP_INCLDIR=""
300     fi
301    
302     if test "x$GMP_LIBDIR" = "x"; then
303     GMP_LIBDIR=""
304     fi
305    
306     if test "x$GMP_RLIBDIR" = "x"; then
307     GMP_RLIBDIR=""
308     fi
309    
310 gezelter 2203 AC_MSG_RESULT(CGAL_OS_COMPILER= $CGAL_OS_COMPILER)
311     AC_MSG_RESULT(CGAL_INCLDIR= $CGAL_INCLDIR)
312     AC_MSG_RESULT(CGAL_INCLCONFDIR= $CGAL_INCLCONFDIR)
313     AC_MSG_RESULT(CGAL_LIBDIR= $CGAL_LIBDIR)
314     AC_MSG_RESULT(CGAL_CXXFLAGS= $CGAL_CXXFLAGS)
315     AC_MSG_RESULT(LEDA_INCLDIR= $LEDA_INCLDIR)
316     AC_MSG_RESULT(LEDA_LIBDIR= $LEDA_LIBDIR)
317     AC_MSG_RESULT(GMP_INCLDIR= $GMP_INCLDIR)
318     AC_MSG_RESULT(GMP_LIBDIR= $GMP_LIBDIR)
319 gezelter 2190
320     AC_LANG_PUSH(C++)
321     save_CXXFLAGS="$CXXFLAGS"
322     CXXFLAGS="$CXXFLAGS -I$CGAL_INCLDIR -I$CGAL_INCLCONFDIR"
323     AC_CHECK_HEADER(CGAL/Cartesian.h, cgal=yes, cgal=no)
324     CXXFLAGS="$save_CXXFLAGS"
325    
326     if test "x$cgal" = xyes; then
327     AC_MSG_CHECKING([for CGAL version])
328     LOCATION=${CGAL_INCLDIR}
329     LOCATION=${LOCATION:-/usr/include}
330     if test -f $LOCATION/CGAL/version.h; then
331     CGAL_VERSION=`grep '#define.*\<CGAL_VERSION\>.*' $LOCATION/CGAL/version.h | sed 's/[^0-9\.]*//g'`
332     else
333     CGAL_VERSION=`grep '#define.*\<CGAL_VERSION\>.*' $LOCATION/CGAL/config.h | sed 's/[^0-9\.]*//g'`
334     fi
335     changequote({, })dnl
336     if echo $CGAL_VERSION | grep -q "^[3456789]"; then
337     changequote([, ])dnl
338     AC_MSG_RESULT([($CGAL_VERSION) yes])
339     else
340     AC_MSG_RESULT([($CGAL_VERSION) no])
341     cgal=no
342     fi
343     fi
344    
345     if test "x$cgal" = xyes; then
346     CGAL_LIBS="-lCGAL"
347     AC_MSG_CHECKING([whether CGAL uses LEDA])
348     if echo $CGAL_CXXFLAGS | grep -q -- -DCGAL_USE_LEDA; then
349     CGAL_USES_LEDA=yes
350     AC_MSG_RESULT([yes])
351     CGAL_DEFINES="-DCGAL_USE_LEDA -DLEDA_PREFIX"
352     else
353     AC_MSG_RESULT([no])
354     CGAL_USES_LEDA=no
355     fi
356    
357     AC_MSG_CHECKING([whether CGAL uses GMP])
358     if echo $CGAL_CXXFLAGS | grep -q -- -DCGAL_USE_GMP; then
359     CGAL_USES_GMP=yes
360     AC_MSG_RESULT([yes])
361     CGAL_DEFINES="-DCGAL_USE_GMP $CGAL_DEFINES"
362     else
363     AC_MSG_RESULT([no])
364     CGAL_USES_GMP=no
365     fi
366    
367     CGAL_LIBS="$CGAL_LIBS -lm"
368    
369     CGAL_CXXFLAGS="-ftemplate-depth-50"
370    
371 gezelter 2203 AC_MSG_RESULT(CGAL_USES_LEDA= $CGAL_USES_LEDA)
372     AC_MSG_RESULT(CGAL_USES_GMP = $CGAL_USES_GMP)
373     AC_MSG_RESULT(CGAL_INCLDIR = $CGAL_INCLDIR)
374     AC_MSG_RESULT(CGAL_LIBDIR = $CGAL_LIBDIR)
375     AC_MSG_RESULT(CGAL_DEFINES = $CGAL_DEFINES)
376     AC_MSG_RESULT(CGAL_CXXFLAGS = $CGAL_CXXFLAGS)
377     AC_MSG_RESULT(CGAL_LIBS = $CGAL_LIBS)
378 gezelter 2190 fi
379    
380     if test "x$cgal" = xyes; then
381     save_LIBS="$LIBS"
382     LIBS="$LIBS -L$CGAL_LIBDIR"
383     if test "x$CGAL_USES_LEDA" = xyes; then
384     LIBS="-lL $LIBS -L$LEDA_LIBDIR"
385     fi
386     # if test "x$CGAL_USES_GMP" = xyes; then
387     # LIBS="-lgmp $LIBS $GMP_LIBDIR"
388     # fi
389     AC_CHECK_CXX_LIB(CGAL, ::CGAL::Cartesian<int>::Point_2, [#include <CGAL/Cartesian.h>], [::CGAL::Cartesian<int>::Point_2 P], [cgal=yes], [cgal=no], -I$CGAL_INCLDIR -I$CGAL_INCLCONFDIR)
390     LIBS="$save_LIBS"
391     fi
392    
393     fi
394     AC_LANG_POP()
395    
396     fi
397    
398     if test "x$cgal" = xyes; then
399     USE_CGAL=yes
400     AC_DEFINE(HAVE_CGAL, 1, [Is defined if the CGAL library is available.])
401     AC_DEFINE_UNQUOTED(CGAL_VERSION, $CGAL_VERSION, [The CGAL version number.])
402     changequote({, })dnl
403     if ! echo $CGAL_VERSION | grep -q "^3.0"; then
404     changequote([, ])dnl
405     AC_MSG_WARN(*****************************************************)
406     AC_MSG_WARN(*** Warning: Your CGAL version is newer than the ***)
407     AC_MSG_WARN(*** supported versions. It may still work though. ***)
408     AC_MSG_WARN(*****************************************************)
409     fi
410     else
411     if test "x$cgal_makefile" != xno; then
412 gezelter 2203 AC_MSG_RESULT(No CGAL support. These are not the droids you want.)
413 gezelter 2190 fi
414     CGAL_INCLDIR=
415     CGAL_LIBDIR=
416     CGAL_RLIBDIR=
417     CGAL_DEFINES=
418     CGAL_CXXFLAGS=
419     CGAL_LIBS=
420     fi
421    
422     AC_SUBST(USE_CGAL)
423     CGAL_INC_DIR="${CGAL_INCLDIR} ${CGAL_INCLCONFDIR}"
424     AC_SUBST(CGAL_INC_DIR)
425     CGAL_LIB_DIR=${CGAL_LIBDIR}
426     AC_SUBST(CGAL_LIB_DIR)
427     CGAL_RLIB_DIR=${CGAL_RLIBDIR}
428     AC_SUBST(CGAL_RLIB_DIR)
429     AC_SUBST(CGAL_DEFINES)
430     AC_SUBST(CGAL_CXXFLAGS)
431     AC_SUBST(CGAL_LIBS)
432    
433 gezelter 2081 dnl CHECK_MKL
434 gezelter 1490
435 gezelter 1540 BB_ENABLE_DOXYGEN
436 gezelter 1490
437     AC_EXEEXT
438     AC_OBJEXT
439     OBJEXT=".$OBJEXT"
440    
441     OOPSE=oopse
442    
443     dnl **** define home dir of oopse
444     if test "x${prefix}" = "xNONE"
445     then
446     OOPSE_HOME=${ac_default_prefix}/oopse
447     else
448     OOPSE_HOME=${prefix}/oopse
449     fi
450     AC_ARG_ENABLE(oopse-home,
451     [ --enable-oopse-home=DIR define oopse home dir [PREFIX/oopse]],
452     [OOPSE_HOME="${enableval}"])
453    
454     case "x$INSTALL" in
455     x/*) ;;
456     *) INSTALL=`pwd`/ac-tools/"shtool install -c" ;
457     esac
458    
459     MKINSTALLDIRS=`pwd`/ac-tools/"shtool mkdir -p -f"
460    
461     dnl **** Define CFLAGS etc empty to prevent configure from setting them
462     CFLAGS=${CFLAGS-""}
463     CXXFLAGS=${CXXFLAGS-""}
464     CPPFLAGS=${CPPFLAGS-""}
465     FFLAGS=${FFLAGS-""}
466     F90FLAGS=${F90FLAGS-""}
467     LDFLAGS=${LDFLAGS-""}
468     DEBUG=${DEBUG-"-g"}
469    
470     case $debug in
471     1)
472     FFLAGS="$DEBUG $FFLAGS"
473     F90FLAGS="$DEBUG $F90FLAGS"
474     ;;
475     *)
476     ;;
477     esac
478    
479    
480     AC_SUBST(EXEEXT)
481     AC_SUBST(OBJEXT)
482     AC_SUBST(BATEXT)
483     AC_SUBST(MKINSTALLDIRS)
484     AC_SUBST(OOPSE)
485     AC_SUBST(OOPSE_HOME)
486     AC_SUBST(SUBDIRS)
487     AC_SUBST(CFLAGS)
488     AC_SUBST(CXXFLAGS)
489     AC_SUBST(CPPFLAGS)
490     AC_SUBST(FFLAGS)
491     AC_SUBST(F90FLAGS)
492     AC_SUBST(LDFLAGS)
493     AC_SUBST(PREPFLAG)
494     AC_SUBST(PREPDEFFLAG)
495 gezelter 1535 AC_SUBST(F90_MODULE_NAMES)
496 gezelter 1499 AC_CONFIG_HEADER([src/config.h])
497 gezelter 2199 AC_CONFIG_FILES([make/Makefile src/utils/Makefile src/applications/nanoRodBuilder/Makefile scripts/filepp], [chmod 0755 scripts/*])
498 gezelter 1490
499     AC_OUTPUT