-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
executable file
·130 lines (121 loc) · 3.65 KB
/
configure.ac
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
dnl Configure input for iasp-grh - G. Helffrich/U. Bristol April 21 2008
AC_INIT(limits.inc.in)
AC_CONFIG_AUX_DIR(utils)
dnl AC_PROG_CC(cc gcc)
AC_PROG_F77(gfortran g77 f77)
dnl AC_PROG_RANLIB
AC_PROG_INSTALL
AC_F77_LIBRARY_LDFLAGS
AC_CANONICAL_HOST
JSEG=40 JBRN=150 JOUT=3350 NOPT=1
case $host in
*-apple-darwin*) # Override default Darwin mandir
test "$mandir" = '${prefix}/man' && mandir='${prefix}/share/man'
;;
esac
dnl Have to undo damage done by F77_LIBRARY_LDFLAGS on MacOS systems
KLUDGE= KEEP=
for L in $ac_cv_flibs $ac_cv_f77_libs ; do
case $L in
-l*) ;;
-L*) KEEP=1 ;;
*) ;;
esac
test -z "${KEEP}" || KLUDGE="${KLUDGE} $L"
done
sym=neither
test -z "$ac_cv_flibs" || sym=ac_cv_flibs
test -z "$ac_cv_f77_libs" || sym=ac_cv_f77_libs
: ${sym}="${KLUDGE}" ; FLIBS="${KLUDGE}"
dnl Set default CFLAGS, FFLAGS to what we want
KEEP=
for L in $FFLAGS ; do
case $L in
-g* | -O*) ;;
*) KEEP="${KEEP} $L"
;;
esac
done
FFLAGS=`echo "${KEEP}"`
AC_SUBST(ADD_FFLAGS)
AC_ARG_VAR(BINDIR,[ttimes program location])
AC_ARG_VAR(LIBDIR,[tpttsub.o library routine location])
dnl C library routine checks
dnl AC_CHECK_LIB(SystemStubs,err$LDBLStub)
dnl AC_CHECK_FUNC(snprintf,,[ADD_CFLAGS="${ADD_CFLAGS} -DDONTHAVE_SNPRINTF"])
dnl AC_CHECK_FUNC(reallocf,,[ADD_CFLAGS="${ADD_CFLAGS} -DDONTHAVE_REALLOCF"])
LIBS="${LDFLAGS} ${LIBS}"
AC_LANG_PUSH(Fortran 77)
SV_FFLAGS="${FFLAGS}" F77BC=
dnl Check for useful Fortran options
for F in fbounds-check C unavailable-option ; do
FFLAGS="-c -$F"
AC_TRY_COMPILE([],[
integer array(2)
array(1)=1
array(2)=2
],[break])
done
test "$F" = "unavailable-option" || F77BC="-$F"
dnl Check Fortran for brief debug info availability
FFLAGS="-g -feliminate-unused-debug-symbols"
AC_TRY_COMPILE([],[
integer array(2)
array(1)=1
array(2)=2
],[FDEBUG=" -feliminate-unused-debug-symbols"],[FDEBUG=])
dnl Check for need for Fortran equivalence/common table size options
rm -f conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
program main
end
_ACEOF
F77MISC=
for F in Nq300 Nn2000 std=legacy ; do
FFLAGS="-c -$F"
AC_TRY_COMPILE([],[
integer array(2)
array(1)=1
array(2)=2
],[F77MISC="${F77MISC} -$F"])
done
rm -f conftest.$ac_objext conftest.$ac_ext
AC_LANG_POP(Fortran 77)
FFLAGS="${SV_FFLAGS} ${F77MISC}"
test ${enable_debug-no} = yes && \
ADD_FFLAGS="${ADD_FFLAGS} -g${FDEBUG}"
test ${enable_opt-yes} = yes && \
ADD_FFLAGS="${ADD_FFLAGS} ${FOPT}"
test ${enable_range_check-no} = yes && ADD_FFLAGS="${ADD_FFLAGS} ${F77BC}"
AC_CONFIG_FILES(limits.inc)
AC_SUBST(JSEG)
AC_SUBST(JBRN)
AC_SUBST(JOUT)
AC_SUBST(NOPT)
dnl Optional compilation defines
AC_ARG_ENABLE(core,
[ --enable-core adds PmKP m=3,4 and SmKS m=3,4,5],
[JSEG=`expr $JSEG + 5` JOUT=`expr $JOUT + 450` NOPT=`expr $NOPT + 4`]
)
AC_ARG_ENABLE(depth,
[ --disable-depth suppress depth phases for most phases (smaller tables)],
[JSEG=`expr $JSEG - 10` JOUT=`expr $JOUT - 750` NOPT=`expr $NOPT - 1`]
)
AC_ARG_ENABLE(debug,
[
--enable-debug compiles programs with debugging enabled]
)
AC_ARG_ENABLE(range_check,
[ --enable-range-check checks that array references are within bounds]
)
AC_ARG_ENABLE(opt,
[ --disable-opt compiles programs with optimizing disabled]
)
test "${BINDIR}" = NONE && BINDIR=$bindir
test -z "${LIBDIR}" && LIBDIR=$libdir
AC_OUTPUT(Makefile)
echo "Configured with Fortran compiler" $F77
echo "Configured with Fortran compiler flags" $FFLAGS $ADD_FFLAGS
echo "Programs will be installed in:" ${prefix}/bin
echo "Libraries will be installed in:" ${prefix}/lib
echo "man pages will be installed in:" ${datarootdir}/man