+dnl *****************************************************************************
+dnl FILE IDENTIFICATION
+dnl Name: ctsim.cpp
+dnl Purpose: Top-level routines of CTSim program
+dnl Programmer: Kevin Rosenberg
+dnl Date Started: July 2000
+dnl
+dnl This is part of the CTSim program
+dnl Copyright (c) 1983-2009 Kevin Rosenberg
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License (version 2) as
+dnl published by the Free Software Foundation.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl****************************************************************************/
+
dnl Process this file with autoconf to produce a configure script.
dnl Must reset CDPATH so that bash's cd does not print to stdout
dnl CDPATH=
-AC_INIT
+AC_INIT([CTSim], [5.2.0], [ctsim-users@b9.com], [ctsim], [http://www.ctsim.org/])
AC_CONFIG_SRCDIR([src/ctsim.cpp])
AM_MAINTAINER_MODE
-AM_INIT_AUTOMAKE(ctsim,5.0.0)
+AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
-CFLAGS=""
-CXXFLAGS=""
-
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_INSTALL
AC_DEFINE([HAVE_READLINE],1,[Readline library])],
[readline=false], [-lcurses])
wxwin=false
-AC_CHECK_LIB(wx_gtk2u_core-2.8, main, [wxwin=true; wx_gtk=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])], [], [-L/usr/lib64 -L/usr/lib `gtk-config --libs` `glib-config --libs glib gmodule gthread` ])
-AC_CHECK_LIB(wx_mac-2.8, main, [wxwin=true; wx_mac=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])])
+AC_CHECK_LIB(gtk-x11-2.0, main, [hasx11gtk2=true], [])
+if test "x$hasx11gtk2" = "x" ; then
+ AC_MSG_NOTICE([Does not have X11 GTK2])
+ AC_DEFUN([AM_PATH_GLIB_2_0], [])
+ AC_DEFUN([AM_PATH_GTK_2_0], [])
+fi
+if test "$hasx11gtk2" = "true" ; then
+ AM_PATH_GLIB_2_0(2.0.0,,AC_MSG_ERROR(You should get glib 2.0.0 or better.))
+ AM_PATH_GTK_2_0(2.0.0,havegtk_am=yes,havegtk_am=no)
+ CFLAGS="${CFLAGS} ${g76GTK_CFLAGS} ${GLIB_CFLAGS}"
+fi
+
+AC_CHECK_LIB(wx_gtk2u_core-2.8, main, [wxwin=true; wx_gtk=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])], [], [-L/usr/lib64 -L/usr/lib ${GTK_LIBS} ${GLIB_LIBS} ])
+AC_CHECK_LIB(wx_mac_core-2.8, main, [wxwin=true; wx_mac=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])])
AC_CHECK_LIB(fftw3, fftw_malloc, [fftw=true; AC_DEFINE(HAVE_FFTW,1,[FFTW library])], [fftw=false], [-L/usr/lib64 -L/usr/lib])
AC_CHECK_LIB(GL, main, [libgl=true], [libgl=false], [-L/usr/X11R6/lib -L/usr/X11R6/lib64])
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,1,[PNG library])], [png=false], [-lz -lm])
+ AC_CHECK_LIB(png, main, [png=true ; AC_DEFINE(HAVE_PNG,1,[PNG library])], [png=false], [-L/opt/local/lib -lz -lm])
fi
dnl Checks for header files.
dnl LDFLAGS="$LDFLAGS -L/usr/local/lib"
if test "$debug" = "true" ; then
- CFLAGS="$CFLAGS -g -DDEBUG"
+ CFLAGS="$CFLAGS -g -O0 -DDEBUG"
AC_DEFINE(DEBUG,1,[turn on debugging])
else
CFLAGS="$CFLAGS -O2 -DNDEBUG -fomit-frame-pointer"
fi ]
)
-if test "$withval" == "no" -o "$withval" == "NONE" ; then
+if test "$withval" = "no" -o "$withval" = "NONE" ; then
AC_MSG_CHECKING([for CTN DICOM installation])
AC_MSG_RESULT([disabled])
else
break
fi
done
- if test "$ctnlib" == "true" -a "$ctninclude" == "true" ; then
+ if test "$ctnlib" = "true" -a "$ctninclude" = "true" ; then
ctn="true"
AC_DEFINE(HAVE_CTN_DICOM,1,[ctn dicom library])
AC_MSG_RESULT([yes])
AC_ARG_WITH(mcpu,
[ --with-mcpu[=CPU] Set name of CPU for gcc -mcpu])
-if test "$withval" == "no" -o "$withval" == "yes" -o "$withval" == ""; then
+if test "$withval" = "no" -o "$withval" = "yes" -o "$withval" = ""; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([$withval])
AC_ARG_WITH(html-dir, [ --with-html-dir=PATH Set directory of html files],
[ html_%dir=$withval ; AC_SUBST(htmldir) ] )
-if test -n "$cgibindir" -o -n "$cgibinurl" ; then
+if test "x$cgibindir" != "x" -o "x$cgibinurl" != "x" ; then
cgiprograms="ctsim.cgi ctsim.conf"
AC_SUBST(cgiprograms)
fi
-if test -n "$html_dir" ; then
+if test "x$html_dir" = "x" ; then
htmldata=simulate.html
AC_SUBST(htmldata)
fi
-AM_CONDITIONAL(USE_HTML, test -n "$html_dir")
+AM_CONDITIONAL(USE_HTML, test "x$html_dir" = "x")
-if test -n "$cgibindir" -o -n "$cgibinurl" -o -n "$webdatadir" -o -n "$webdataurl" -o -n "$html_dir" ; then
+if test "x$cgibindir" != "x" -o "x$cgibinurl" != "x" -o "x$webdatadir" != "x" -o "x$webdataurl" != "x" -o "x$html_dir" != "x" ; then
webenabled=true
AC_SUBST(webenabled)
AC_MSG_RESULT([yes])
- if test -z "$cgibindir" ; then
+ if test "x$cgibindir" = "x" ; then
AC_MSG_ERROR([--with-cgibin-dir not set for web access])
- elif test -z "$cgibinurl" ; then
+ elif test "x$cgibinurl" = "x" ; then
AC_MSG_ERROR([--with-cgibin-url not set for web access])
- elif test -z "$webdatadir" ; then
+ elif test "x$webdatadir" = "x" ; then
AC_MSG_ERROR([--with-webdata-dir not set for web access])
- elif test -z "$webdataurl" ; then
+ elif test "x$webdataurl" = "x" ; then
AC_MSG_ERROR([--with-webdata-url not set for web access])
- elif test -z "$html_dir" ; then
+ elif test "x$html_dir" = "x" ; then
AC_MSG_ERROR([--with-html-dir not set for web access])
fi
else
AC_MSG_RESULT([no])
fi
-AM_CONDITIONAL(USE_LAM, test -n "$lamdir")
+AM_CONDITIONAL(USE_LAM, test "x$lamdir" != "x")
AC_PATH_XTRA
AC_SUBST(X_CFLAGS)
if test "$debug" = "true"; then
wxdebug="--debug"
fi
- if [ "$wx_gtk" ]; then
- ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --libs --version=2.8` -lwx_gtk2u_gl-2.8 `gtk-config --libs` `glib-config --libs glib gmodule gthread`"
- elif [ "$wx_mac" ]; then
- ctlib_graphics="$ctlib_graphics -lwx_mac_gl-2.8"
+ if test "x$wx_gtk" != "x" ; then
+ ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=2.8 --libs std,gl` ${GTK_LIBS} ${GLIB_LIBS}"
+ elif test "x$wx_mac" != "x" ; then
+ ctlib_graphics="$ctlib_graphics `$wxconfig $wxdebug --version=2.8 --libs std,gl`"
fi
fi
fi
fi
if test "$wxwin" = "true" ; then
- if [ "$wx_gtk" = "true" ] || [ "$wx_mac" = "true" ] ; then
+ if test "$wx_gtk" = "true" -o "$wx_mac" = "true" ; then
wxcflags=`$wxconfig $wxdebug --cxxflags --version=2.8`
#wxlibs=`$wxconfig --libs`
else
ctlibs="$ctlibs_base -lctsim $ctlib_graphics -lctsupport $ctlibs_tools"
AC_SUBST(ctlibs)
-if test -n "$lamdir" ; then
+if test "x$lamdir" != "x" ; then
lamprograms="ctsimtext-lam"
AC_SUBST(lamprograms)
lamdefs="$CFLAGS"