r617: *** empty log message ***
[ctsim.git] / configure.in
index db07adfad3141cc51eba55a2c5d5927d69c491b9..9e071f6900491e284615613e76190c09f3702e23 100644 (file)
@@ -4,7 +4,7 @@ dnl Must reset CDPATH so that bash's cd does not print to stdout
 dnl CDPATH=
 
 AC_INIT(src/ctsim.cpp)
-AM_INIT_AUTOMAKE(ctsim,3.0.0beta1)
+AM_INIT_AUTOMAKE(ctsim,3.1.0)
 AM_CONFIG_HEADER(config.h)
 
 dnl Checks for programs.
@@ -48,7 +48,7 @@ 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(wx_gtk_gl, main, [wxgtkgl=true], [wxgtkgl=false], -lwx_gtk -lGL)
+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])
@@ -132,6 +132,10 @@ fi
 AC_MSG_RESULT(no)
 
 
+if test "${pthread}" = "true" ; then
+  AC_ADD_GCC_CFLAGS([-pthread])
+fi
+
 AC_ADD_GCC_CFLAGS([-Wall])
 AC_MSG_CHECKING(whether to enable verbose warnings)
 AC_ARG_ENABLE(verbose-warnings,
@@ -202,6 +206,40 @@ else
   AC_MSG_RESULT([no])
 fi
 
+
+dnl Set CTN path
+AC_ARG_WITH(ctn,
+[  --with-ctn[=PATH]       Set path of CTN DICOM library ],
+[    if test "$withval" != "no" ; then
+         tryctndir=$withval
+     fi ]
+)
+
+if test "$withval" != "no" ; then
+  if test "$prefix" != "NONE" ; then
+     tryctndir="$tryctndir $prefix"
+  fi
+
+  AC_MSG_CHECKING([for CTN DICOM installation])
+  for testctndir in "." $tryctndir /usr/local /usr/local/ctn /usr /usr/ctn /opt /opt/ctn ; do
+    if test -f "$testctndir/lib/libctn.a" ; then
+      if test "$testctndir" != "/usr"; then    
+        LDFLAGS="$LDFLAGS -L$testctndir/lib"
+        CFLAGS="$CFLAGS -I$testctndir/include"
+      fi
+      ctndir="$testctndir"
+      ctn="true"
+      AC_DEFINE(HAVE_CTN_DICOM)
+      break
+    fi
+  done
+  AC_MSG_RESULT($ctndir)
+else
+  AC_MSG_RESULT([no])
+fi
+
+
+
 AC_MSG_CHECKING([for web access])
 dnl Set cgi-bin directory
 AC_ARG_WITH(cgibin-dir, [  --with-cgibin-dir=PATH  Set path of CGI binaries directory ], 
@@ -316,8 +354,8 @@ if test "$no_x" != "yes" ; then
     AC_DEFINE(HAVE_G2)
   fi   
   ctlib_graphics="$ctlib_graphics $X_BASIC_LIBS $X_TOOLKIT_LIBS"
-  if test "$libgl" = "true" -a "$wxgtkgl" = "true" ; then
-    ctlib_graphics="$ctlib_graphics -lglut -lGL -lGLU -lwx_gtk_gl"
+  if test "$libgl" = "true" ; then
+    ctlib_graphics="$ctlib_graphics -lwx_gtk_gl -lglut -lGL -lGLU"
   fi
 else
   if test "$wxwin" = "true" ; then
@@ -336,6 +374,9 @@ fi
 if test "$fftw" = "true" ; then
   ctlibs_tools="$ctlibs_tools -lrfftw -lfftw"
 fi
+if test "$ctn" = "true"; then
+  ctlibs_tools="$ctlibs_tools -lctn"
+fi
 
 dnl Check for dmalloc
 AC_CHECK_LIB(dmallocxx, main, [dmallocxx=true], [dmallocxx=false])
@@ -389,4 +430,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 doc/tex2rtf/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)