-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.in
112 lines (93 loc) · 2.77 KB
/
configure.in
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
AC_INIT
AC_PREREQ(2.2)
dnl AC_CONFIG_AUX_DIR(admin)
AC_CONFIG_HEADER(model1d/reflconfig.h)
dnl Compilers
AC_PROG_CC
AC_PROG_CXX
sinclude(ax_cflags_warn_all.m4)
sinclude(ax_cflags_gcc_option.m4)
AX_CFLAGS_WARN_ALL
AX_CXXFLAGS_WARN_ALL
dnl Check if we are building fat binaries for OS X
dnl AX_CFLAGS_GCC_OPTION(-arch ppc -arch i386,ARCHFLAGS)
dnl AC_SUBST(ARCHFLAGS)
dnl If single precision is to be used (with CUDA or OpenCL for example)
AC_MSG_CHECKING([whether to turn on double precision])
AC_ARG_ENABLE(double,
[ --disable-double use single precision numbers when modeling],
[],
[enable_double=yes])
AC_MSG_RESULT([$enable_double])
ENABLE_DOUBLE=$enable_double
AC_SUBST(ENABLE_DOUBLE)
dnl If magnetic is to be used (requires Fortran compiler)
AC_MSG_CHECKING([whether to turn on magnetic])
AC_ARG_ENABLE(magnetic,
[ --disable-magnetic skip magnetic models (if Fortran unavailable)],
[],
[enable_magnetic=yes])
AC_MSG_RESULT([$enable_magnetic])
dnl Do not use fortran compiler if non-magnetic
if test x"$enable_magnetic" = xyes; then
AC_MSG_NOTICE([Note: rerun with --disable-magnetic if Fortran is unavailable])
AC_PROG_F77
fi
if test -n "$F77"; then
AC_F77_LIBRARY_LDFLAGS
AC_F77_WRAPPERS
else
FLIBS=
AC_SUBST(FLIBS)
fi
dnl Finish handling magnetic --- disable magnetic if fortran is unavailable
if test -z "$F77"; then enable_magnetic=no; fi
if test x"$enable_magnetic" = xyes; then
AC_DEFINE(HAVE_MAGNETIC,1,[Define to 1 if you want to support magnetic systems])
fi
ENABLE_MAGNETIC=$enable_magnetic
AC_SUBST(ENABLE_MAGNETIC)
dnl Profiling support
AC_MSG_CHECKING([which profiling flags to use])
AC_ARG_ENABLE(profile,
[ --enable-profile turn on profiling (default=no)],
[if test x"$enable_profile" = xyes; then PROFFLAG="-pg";
elif test x"$enable_profile" != xno; then PROFFLAG="$enable_profile";
fi])
AC_SUBST(PROFFLAG)
if test -z "$PROFFLAG"; then
AC_MSG_RESULT([none])
else
AC_MSG_RESULT([$PROFFLAG])
fi
dnl Standard helper programs
AC_PROG_RANLIB
AC_PROG_LN_S
AC_PROG_INSTALL
AC_CHECK_PROG(AR,ar,ar,:)
if test -z "$ARFLAGS"; then ARFLAGS="rc"; fi
AC_SUBST(ARFLAGS)
dnl MKOCTFILE=...
dnl AC_CHECK_PROG(MKOCTFILE,mkoctfile,mkoctfile,:)
dnl PYTHON=...
dnl AC_CHECK_PROG(PYTHON,python,python,:)
dnl SVN2CL=...
AC_CHECK_PROG(SVN2CL,svn2cl.sh,svn2cl.sh,:)
dnl Add -lm to LIBS
AC_CHECK_LIB(m,sin)
AC_CHECK_FUNCS(sincos nice setrlimit)
dnl Additional common header definitions
AH_BOTTOM([
/* _GNU_SOURCE needs to be defined to pick up sincos for glibc */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
])
exdir=examples
exmake=
for ex in volfrac multimag xray incoherent; do
exmake="$exmake $exdir/$ex/Makefile:$exdir/Makefile.template"
done
AC_CONFIG_FILES([Makeconf $exmake])
AC_OUTPUT($CONFIGURE_OUTPUTS)
# $Id$