2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(GSS, 0.46, gdiso@ustc.edu)
6 AC_CONFIG_SRCDIR([src/main.cc])
8 # Create a configuration header
9 AC_CONFIG_HEADERS([config.h])
15 #--------------------------------------------------------------------------
16 # Checks for programs.
17 #--------------------------------------------------------------------------
18 AC_PROG_CC(icc gcc cc)
19 AC_PROG_CXX(icpc g++ CC)
21 if test "$LEX" != flex ; then
22 AC_MSG_ERROR(ERROR: Can't find flex!)
25 if test "$YACC" != "bison -y" ; then
26 AC_MSG_ERROR(ERROR: Can't find bison!)
38 #--------------------------------------------------------------------------
39 # check if debug requested
40 #--------------------------------------------------------------------------
41 AC_MSG_CHECKING([if debugging is enabled])
43 [ --enable-debug[=OPTS] build for debugging [default=no]],,
45 if test "$enableval" = "no"; then
48 if test "$enableval" = "" || test "$enableval" = "yes"; then
60 #--------------------------------------------------------------------------
61 # get executable extensions
62 #--------------------------------------------------------------------------
66 #---------------------------------------------------------------------------
67 # get CGNS header path and library
68 #---------------------------------------------------------------------------
74 if test -f "$d/include/cgnslib.h" && test -f "$d/lib/libcgns.a"; then
75 CGNSDIR=`(cd $d; pwd)`
80 AC_MSG_CHECKING([if CGNS directory was specified])
82 [ --with-cgns=CGNSdir directory containing CGNS distribution.
83 $CGNSdir/include for header
84 $CGNSdir/lib for library],
86 if test ! -z "$CGNSDIR" || test ! "$CGNSDIR" = "no"; then
87 AC_MSG_RESULT($CGNSDIR)
88 if test ! -f "$CGNSDIR/include/cgnslib.h"; then
89 AC_MSG_ERROR($CGNSDIR directory does not contain cgnslib.h)
93 #---------------------------------------------------------------------------
94 # get TIFF header path and library
95 #---------------------------------------------------------------------------
96 AC_CHECK_HEADERS([tiffio.h],[AC_DEFINE([HAVE_TIFF],,[Use tiff to save screen])])
97 AC_CHECK_LIB([tiff], [TIFFOpen],[LIBS="$LIBS -ltiff"])
100 #---------------------------------------------------------------------------
101 # check if gsl library installed
102 #---------------------------------------------------------------------------
104 [ --enable-gsl[=OPTS] use gsl Fermi function [default=no]],,
106 if test "$enableval" = "yes"; then
107 AC_CHECK_HEADERS([gsl/gsl_sf_fermi_dirac.h],AC_DEFINE([HAVE_GSL],[],[Use GSL to compute Fermi Integral]))
108 AC_CHECK_LIB([gsl -lgslcblas], [gsl_sf_fermi_dirac_half],[LIBS="$LIBS -lgsl -lgslcblas"])
112 #---------------------------------------------------------------------------
113 # check if PETSC installed
114 #---------------------------------------------------------------------------
115 if test -z "$PETSC_DIR" ; then
116 AC_MSG_ERROR(ERROR: Can't find PETSC dir! Please install PETSC first.)
121 #---------------------------------------------------------------------------
122 # Checks for system libraries.
123 #---------------------------------------------------------------------------
124 AC_CHECK_LIB([dl], [dlopen])
125 AC_CHECK_LIB([m], [sin],[LIBS="$LIBS -lm"])
127 # Checks for header files.
129 AC_CHECK_HEADERS([fcntl.h float.h limits.h stddef.h stdlib.h string.h stdio.h assert.h sys/time.h ])
131 # Checks for typedefs, structures, and compiler characteristics.
138 # Checks for library functions.
142 AC_CHECK_FUNCS([memset pow sqrt])
145 #---------------------------------------------------------------------------
146 # Checks for system define
147 #---------------------------------------------------------------------------
150 AC_DEFINE([CYGWIN],,[Define to use CYGWIN env]);;
152 AC_DEFINE([LINUX],,[Define to use LINUX env]);;
154 AC_DEFINE([DARWIN],,[Define to use DARWIN env]);;
159 [ --with-Win32 use Win32 native graphic function for plot],
160 AC_DEFINE([HAVE_WIN32],,[Define to use Win32 native graphic function])
164 if test "$Win32API" = 0 ; then
167 if ! test "$x_includes" = ""; then
168 X11INCS=-I$x_includes
169 AC_DEFINE([HAVE_X11],,[Define to use X11 graphic function])
171 AC_CHECK_HEADERS([X11/Xlib.h],AC_DEFINE([HAVE_X11],,[Define to use X11 graphic function]))
173 if ! test "$x_libraries" = ""; then
174 X11LIBS="-L$x_libraries -lX11"
176 AC_CHECK_LIB([X11], [XFlush],[X11LIBS="-lX11"])
180 AC_MSG_CHECKING([options for building dynamic library])
183 LDFSHARED=" -dynamiclib ";;
185 LDFSHARED=" -shared";;
195 AC_SUBST(BIN_INSTALL_DIR)
196 AC_SUBST(LIB_INSTALL_DIR)
199 AC_CONFIG_FILES([make.defs])