r1018: *** empty log message ***
[ctsim.git] / configure.in
index 88722def7e014c7b7b3f76bf7ba30f5c7645f39f..bb61c8619c958f19728205427b83f9328a6c7384 100644 (file)
@@ -39,7 +39,7 @@ AC_CHECK_LIB(m, sin)
 AC_CHECK_LIB(curses, main, [curses=true], [curses=false])
 AC_CHECK_LIB(ncurses, main, [ncurses=true], [ncurses=false])
 AC_CHECK_LIB(g2, main, [g2=true], [g2=false])
-AC_CHECK_LIB(readline, main, [readline=true; AC_DEFINE(HAVE_READLINE)], [readline=false])
+AC_CHECK_LIB(readline, main, [readline=true; AC_DEFINE(HAVE_READLINE)], [readline=false], [-lcurses])
 AC_CHECK_LIB(ncurses, main, [ncurses=true; AC_DEFINE(HAVE_NCURSES)], [ncurses=false])
 AC_CHECK_LIB(curses, main, [curses=true; AC_DEFINE(HAVE_CURSES)], [curses=false])
 wxwin=false
@@ -47,7 +47,8 @@ AC_CHECK_LIB(wx_gtk, main, [wxwin=true; wx_gtk=true; AC_DEFINE(HAVE_WXWINDOWS)])
 AC_CHECK_LIB(wx, main, [wxwin=true; wx_msw=true; AC_DEFINE(HAVE_WXWINDOWS)])
 AC_CHECK_LIB(hdf5, main, [hdf5=true], [hdf5=false], -lz)
 AC_CHECK_LIB(fftw, fftw_one, [fftw=true; AC_DEFINE(HAVE_FFTW)], [fftw=false])
-AC_CHECK_LIB(GL, main, [libgl=true], [libgl=false])
+AC_CHECK_LIB(GL, main, [libgl=true], [libgl=false], [-L/usr/X11R6/lib -lXt -lXext])
+AC_CHECK_LIB(pthread, main, [pthread=true], [pthread=false])
 
 if test "$zlib" = "true" ; then
   AC_CHECK_LIB(png, main, [png=true ; AC_DEFINE(HAVE_PNG)], [png=false])
@@ -78,6 +79,11 @@ else
   AC_CHECK_FUNC(getopt_long, [ getopt_long=true ], [ getopt_long=false ])
 fi
 
+if test "${pthread}" = "true" ; then
+  AC_ADD_GCC_CFLAGS([-pthread -D_REENTRANT])
+  AC_DEFINE(HAVE_WXTHREADS)
+fi
+
 if test "${getopt_long}" = "false" ; then
   my_includes="$my_includes -I../getopt"
   AC_DEFINE(HAVE_GETOPT_LONG)
@@ -117,7 +123,7 @@ dnl  AC_ADD_GCC_CFLAGS([-g -DDEBUG])
   CFLAGS="-g -DDEBUG"
   AC_DEFINE(DEBUG)
 else
-dnl  AC_ADD_GCC_CFLAGS([-O2 -DNDEBUG])
+dnl  AC_ADD_GCC_CFLAGS([-O2 -fexpensive-optimizations -DNDEBUG])
   CFLAGS="-O3 -DNDEBUG -fomit-frame-pointer"
   AC_DEFINE(NDEBUG)
 fi
@@ -305,7 +311,7 @@ AC_SUBST(X_BASIC_LIBS)
 AC_SUBST(X_EXTRA_LIBS)
 
 X_TOOLKIT_LIBS="-lXt"
-X_BASIC_LIBS="-lXext -lX11"
+X_BASIC_LIBS="-lXext -lX11 -lXmu"
 
 dnl Check whether libXt has thread support.  Some platforms may have
 dnl pthread support in libc, but no thread support in libXt/libX11.
@@ -396,6 +402,29 @@ if test "$dmallocxx" = "true" -a "$usedmalloc" = "true" ; then
   AC_MSG_RESULT(Using dmalloc)
 fi
 
+dnl Check for efence
+AC_CHECK_LIB(efence, main, [efence=true], [efence=false])
+AC_MSG_CHECKING([for enable-efence])
+AC_ARG_ENABLE(efence,
+[  --enable-efence        Use ElectricFence memory allocation],
+[case "${enableval}" in
+  yes) useefence=true 
+       AC_MSG_RESULT(yes)
+       ;;
+  no)  useefence=false 
+       AC_MSG_RESULT(no)
+       ;;
+  *) AC_MSG_RESULT([bad value ${enableval} for --enable-efence]) 
+       ;;
+esac],
+[useefence=false; AC_MSG_RESULT(no)])
+
+if test "$efence" = "true" -a "$useefence" = "true" ; then
+  ctlibs_tools="$ctlibs_tools -lefence"
+  AC_DEFINE(HAVE_EFENCE)
+  AC_MSG_RESULT(Using efence)
+fi
+
 if test "$wxwin" = "true" ; then
   if test "$wx_gtk" = "true" ; then    
     wxcflags=`$wxconfig --cflags`
@@ -425,4 +454,4 @@ fi
 
 CXXFLAGS="$CFLAGS"
 
-AC_OUTPUT(Makefile libctgraphics/Makefile libctsupport/Makefile libctsim/Makefile Makefile man/Makefile doc/Makefile cgi-bin/ctsim.cgi cgi-bin/Makefile html/simulate.html html/Makefile include/Makefile getopt/Makefile tools/sample-ctsim.sh cgi-bin/ctsim.conf tools/Makefile src/Makefile)
+AC_OUTPUT(Makefile libctgraphics/Makefile libctsupport/Makefile libctsim/Makefile Makefile man/Makefile doc/Makefile cgi-bin/ctsim.cgi cgi-bin/Makefile html/simulate.html html/Makefile include/Makefile getopt/Makefile tools/sample-ctsim.sh cgi-bin/ctsim.conf tools/Makefile src/Makefile helical/Makefile helical/sample-helical.sh)