-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure.in
200 lines (168 loc) · 5.61 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
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(GSS, 0.46, gdiso@ustc.edu)
AC_CONFIG_SRCDIR([src/main.cc])
# Create a configuration header
AC_CONFIG_HEADERS([config.h])
GSS_DIR=`(pwd)`
AC_CANONICAL_HOST
#--------------------------------------------------------------------------
# Checks for programs.
#--------------------------------------------------------------------------
AC_PROG_CC(icc gcc cc)
AC_PROG_CXX(icpc g++ CC)
AC_PROG_LEX
if test "$LEX" != flex ; then
AC_MSG_ERROR(ERROR: Can't find flex!)
fi
AC_PROG_YACC
if test "$YACC" != "bison -y" ; then
AC_MSG_ERROR(ERROR: Can't find bison!)
fi
AC_PROG_MAKE_SET
CFLAGS=" -O1 "
CXXFLAGS=" -O1 "
#LDFLAGS=
#CPPFLAGS=""
#LIBS=""
#--------------------------------------------------------------------------
# check if debug requested
#--------------------------------------------------------------------------
AC_MSG_CHECKING([if debugging is enabled])
AC_ARG_ENABLE(debug,
[ --enable-debug[=OPTS] build for debugging [default=no]],,
enableval=no)
if test "$enableval" = "no"; then
debug=no
else
if test "$enableval" = "" || test "$enableval" = "yes"; then
opt=-g
else
opt=$enableval
fi
CFLAGS="$opt"
CXXFLAGS="$opt"
debug=yes
fi
AC_MSG_RESULT($debug)
#--------------------------------------------------------------------------
# get executable extensions
#--------------------------------------------------------------------------
AC_EXEEXT
#---------------------------------------------------------------------------
# get CGNS header path and library
#---------------------------------------------------------------------------
for d in \
"/usr" \
"/usr/local" \
"$HOME" \
"$HOME/local" ; do
if test -f "$d/include/cgnslib.h" && test -f "$d/lib/libcgns.a"; then
CGNSDIR=`(cd $d; pwd)`
break
fi
done
AC_MSG_CHECKING([if CGNS directory was specified])
AC_ARG_WITH(cgns,
[ --with-cgns=CGNSdir directory containing CGNS distribution.
$CGNSdir/include for header
$CGNSdir/lib for library],
CGNSDIR=$withval)
if test ! -z "$CGNSDIR" || test ! "$CGNSDIR" = "no"; then
AC_MSG_RESULT($CGNSDIR)
if test ! -f "$CGNSDIR/include/cgnslib.h"; then
AC_MSG_ERROR($CGNSDIR directory does not contain cgnslib.h)
fi
fi
#---------------------------------------------------------------------------
# get TIFF header path and library
#---------------------------------------------------------------------------
AC_CHECK_HEADERS([tiffio.h],[AC_DEFINE([HAVE_TIFF],,[Use tiff to save screen])])
AC_CHECK_LIB([tiff], [TIFFOpen],[LIBS="$LIBS -ltiff"])
#---------------------------------------------------------------------------
# check if gsl library installed
#---------------------------------------------------------------------------
AC_ARG_ENABLE(gsl,
[ --enable-gsl[=OPTS] use gsl Fermi function [default=no]],,
enableval=no)
if test "$enableval" = "yes"; then
AC_CHECK_HEADERS([gsl/gsl_sf_fermi_dirac.h],AC_DEFINE([HAVE_GSL],[],[Use GSL to compute Fermi Integral]))
AC_CHECK_LIB([gsl -lgslcblas], [gsl_sf_fermi_dirac_half],[LIBS="$LIBS -lgsl -lgslcblas"])
fi
#---------------------------------------------------------------------------
# check if PETSC installed
#---------------------------------------------------------------------------
if test -z "$PETSC_DIR" ; then
AC_MSG_ERROR(ERROR: Can't find PETSC dir! Please install PETSC first.)
fi
#---------------------------------------------------------------------------
# Checks for system libraries.
#---------------------------------------------------------------------------
AC_CHECK_LIB([dl], [dlopen])
AC_CHECK_LIB([m], [sin],[LIBS="$LIBS -lm"])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h float.h limits.h stddef.h stdlib.h string.h stdio.h assert.h sys/time.h ])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STRTOD
AC_CHECK_FUNCS([memset pow sqrt])
#---------------------------------------------------------------------------
# Checks for system define
#---------------------------------------------------------------------------
case $host_os in
*cygwin* )
AC_DEFINE([CYGWIN],,[Define to use CYGWIN env]);;
*linux* )
AC_DEFINE([LINUX],,[Define to use LINUX env]);;
*darwin* )
AC_DEFINE([DARWIN],,[Define to use DARWIN env]);;
esac
AC_ARG_WITH(Win32,
[ --with-Win32 use Win32 native graphic function for plot],
AC_DEFINE([HAVE_WIN32],,[Define to use Win32 native graphic function])
Win32API=1,
Win32API=0)
#echo $Win32API
if test "$Win32API" = 0 ; then
AC_PATH_X
AC_PATH_XTRA
if ! test "$x_includes" = ""; then
X11INCS=-I$x_includes
AC_DEFINE([HAVE_X11],,[Define to use X11 graphic function])
else
AC_CHECK_HEADERS([X11/Xlib.h],AC_DEFINE([HAVE_X11],,[Define to use X11 graphic function]))
fi
if ! test "$x_libraries" = ""; then
X11LIBS="-L$x_libraries -lX11"
else
AC_CHECK_LIB([X11], [XFlush],[X11LIBS="-lX11"])
fi
fi
AC_MSG_CHECKING([options for building dynamic library])
case $host_os in
*darwin* )
LDFSHARED=" -dynamiclib ";;
*)
LDFSHARED=" -shared";;
esac
AC_PROG_MAKE_SET
AC_SUBST(GSS_DIR)
AC_SUBST(CGNSDIR)
AC_SUBST(X11INCS)
AC_SUBST(X11LIBS)
AC_SUBST(HAVE_X11)
AC_SUBST(INSTLIST)
AC_SUBST(BIN_INSTALL_DIR)
AC_SUBST(LIB_INSTALL_DIR)
AC_SUBST(LDFSHARED)
AC_CONFIG_FILES([make.defs])
AC_OUTPUT