X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=configure.ac;h=2ce392d076a09af503a529cc2e2accbd03bc9c69;hp=d13290cce893207a39161816ff089b833a8c502b;hb=d42d3d062dd1aca92b5a2552a1f474aab0bee610;hpb=294a10772740d04c66b2ea9284a6d7e243e55c99 diff --git a/configure.ac b/configure.ac index d13290c..2ce392d 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,8 @@ dnl CDPATH= AC_INIT AC_CONFIG_SRCDIR([src/ctsim.cpp]) -AM_INIT_AUTOMAKE(ctsim,3.5.6) +AM_MAINTAINER_MODE +AM_INIT_AUTOMAKE(ctsim,4.3.0) AM_CONFIG_HEADER(config.h) dnl Checks for programs. @@ -40,13 +41,14 @@ AC_CHECK_LIB(readline, main, [readline=true; AC_DEFINE([HAVE_READLINE],1,[Readline library])], [readline=false], [-lcurses]) wxwin=false -AC_CHECK_LIB(wx_gtk-2.3, main, [wxwin=true; wx_gtk=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])]) -AC_CHECK_LIB(fftw, fftw_one, [fftw=true; AC_DEFINE(HAVE_FFTW,1,[FFTW library])], [fftw=false]) -AC_CHECK_LIB(GL, main, [libgl=true], [libgl=false], [-L/usr/X11R6/lib -lXt -lXext]) +AC_CHECK_LIB(wx_gtk-2.4, main, [wxwin=true; wx_gtk=true; AC_DEFINE(HAVE_WXWINDOWS,1,[wxwindows library])]) +AC_CHECK_LIB(wx_mac-2.4, 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]) +AC_CHECK_LIB(GL, main, [libgl=true], [libgl=false], [-L/usr/X11R6/lib -L/usr/X11R6/lib64 -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,1,[PNG library])], [png=false]) + AC_CHECK_LIB(png, main, [png=true ; AC_DEFINE(HAVE_PNG,1,[PNG library])], [png=false], [-lz -lm]) fi dnl Checks for header files. @@ -67,6 +69,7 @@ AC_CHECK_FUNC(setjmp) AC_CHECK_FUNC(setpriority) AC_CHECK_FUNC(time) AC_CHECK_FUNC(gettimeofday) +AC_CHECK_FUNC(getopt, [ getopt=true ], [ getopt=false ]) if test "${OSTYPE}" = "cygwin" ; then getopt_long=false @@ -79,8 +82,9 @@ if test "${getopt_long}" = "false" ; then AC_DEFINE(HAVE_GETOPT_LONG,1,[getopt_long library]) ctlibs_base="$ctlibs_base -lgetopt" LDFLAGS="$LDFLAGS -L../getopt" - AM_CONDITIONAL(INCLUDED_GETOPT_LONG, test 1==1) + GETOPTLONG=1 fi +AM_CONDITIONAL(INCLUDED_GETOPT_LONG, test "$GETOPTLONG"="1") if test "${readline}" = "true" ; then ctlibs_base="$ctlibs_base -lreadline" @@ -118,7 +122,7 @@ if test "$debug" = "true" ; then CFLAGS="$CFLAGS -g -DDEBUG" AC_DEFINE(DEBUG,1,[turn on debugging]) else - CFLAGS="$CFLAGS -O3 -DNDEBUG -fomit-frame-pointer -funroll-loops" + CFLAGS="$CFLAGS -O2 -DNDEBUG -fomit-frame-pointer" AC_DEFINE(NDEBUG,1,[no debugging]) fi @@ -129,11 +133,13 @@ fi AC_MSG_CHECKING(sstream) if [ test -f /usr/include/sstream || test -f /usr/include/g++/sstream || - test -f /usr/include/g++-2/sstream || test -f /usr/include/g++-3/sstream ]; then - AC_DEFINE(HAVE_SSTREAM,1,[sstream header]) - AC_MSG_RESULT(yes) -fi -AC_MSG_RESULT(no) + test -f /usr/include/g++-2/sstream || test -f /usr/include/g++-3/sstream || + test -f /usr/include/gcc/darwin/3.1/g++-v3/sstream ]; then + AC_DEFINE(HAVE_SSTREAM,1,[sstream header]) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi CFLAGS="$CFLAGS -Wall" @@ -155,7 +161,7 @@ AC_ARG_ENABLE(verbose-warnings, AC_MSG_CHECKING(static executables) AC_ARG_ENABLE(static, [ --enable-static - Enable static executables.], + Enable static executables.], [ case "$enableval" in yes) AC_MSG_RESULT(yes) @@ -169,7 +175,7 @@ AC_ARG_ENABLE(static, dnl Set LAM path AC_ARG_WITH(lam, -[ --with-lam[=PATH] Set path of LAM MPI ], +[ --with-lam[=PATH] Set path of LAM MPI ], [ if test "$withval" != "no" ; then trylamdir=$withval fi ] @@ -203,7 +209,7 @@ fi dnl Set CTN path AC_ARG_WITH(ctn, -[ --with-ctn[=PATH] Set path of CTN DICOM library ], +[ --with-ctn[=PATH] Set path of CTN DICOM library ], [ if test "$withval" != "no" ; then tryctndir=$withval fi ] @@ -237,6 +243,18 @@ else fi fi +dnl Set CPU +AC_MSG_CHECKING([for CPU specification]) +AC_ARG_WITH(mcpu, +[ --with-mcpu[=CPU] Set name of CPU for gcc -mcpu]) + +if test "$withval" == "no" -o "$withval" == "yes" -o "$withval" == ""; then + AC_MSG_RESULT([no]) +else + AC_MSG_RESULT([$withval]) + CFLAGS="$CFLAGS -mcpu=$withval" +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 ], @@ -328,24 +346,31 @@ LDFLAGS="$LDFLAGS -L/usr/local/lib" AC_MSG_CHECKING([for X]) if test "$no_x" != "yes" ; then AC_DEFINE(HAVE_X11,1,[X11 system]) - LDFLAGS="$LDFLAGS -L../libctgraphics -L/usr/X11R6/lib" + LDFLAGS="$LDFLAGS -L../libctgraphics -L/usr/X11R6/lib -L/usr/X11R6/lib64" + my_includes="$my_includes -I/usr/X11R6/include" ctlib_graphics="$ctlibs_base -lctgraphics" AC_MSG_RESULT(yes) ctlib_graphics="$ctlib_graphics $X_BASIC_LIBS $X_TOOLKIT_LIBS" if test "$libgl" = "true" ; then - ctlib_graphics="$ctlib_graphics -lglut -lGL -lGLU" + # Removed "-lglut" for Mac OS X compilation + ctlib_graphics="$ctlib_graphics -lGL -lGLU" if test "$wxwin" = "true" ; then - ctlib_graphics="$ctlib_graphics -lwx_gtk_gl-2.3" + if [ "$wx_gtk" ]; then + ctlib_graphics="$ctlib_graphics -lwx_gtk_gl-2.4" + elif [ "$wx_mac" ]; then + ctlib_graphics="$ctlib_graphics -lwx_mac_gl-2.4" + fi fi fi if test "$wxwin" = "true" ; then AC_DEFINE(HAVE_SGP,1,[use sgp library]) - AM_CONDITIONAL(HAVE_SGP, test 1==1) fi else AC_MSG_RESULT(no) fi +AM_CONDITIONAL(HAVE_SGP, test "$wxwin" = "true") + if test "$png" = "true" ; then ctlibs_tools="$ctlibs_tools -lpng" fi @@ -353,7 +378,7 @@ if test "$zlib" = "true" ; then ctlibs_tools="$ctlibs_tools -lz" fi if test "$fftw" = "true" ; then - ctlibs_tools="$ctlibs_tools -lrfftw -lfftw" + ctlibs_tools="$ctlibs_tools -lfftw3" fi if test "$ctn" = "true"; then ctlibs_tools="$ctlibs_tools -lctn" @@ -406,19 +431,19 @@ if test "$efence" = "true" -a "$useefence" = "true" ; then fi if test "$wxwin" = "true" ; then - if test "$wx_gtk" = "true" ; then + if [ "$wx_gtk" = "true" ] || [ "$wx_mac" == "true" ] ; then wxcflags=`$wxconfig --cflags` wxlibs=`$wxconfig --libs` else wxcflags="-D__WXMSW__ -D__WIN32__ -D__GNUWIN32__" - wxlibs="-lwx -lglui -ljpeg -lxpm -lzlib -ltiff" + wxlibs="-lwx -lglui -ljpeg -lxpm -lzlib -ltiff" fi CFLAGS="$CFLAGS -I../include $wxcflags" ctlib_graphics="$ctlib_graphics $wxlibs" - AM_CONDITIONAL(HAVE_WXWINDOWS, test 1==1 ) fi AC_SUBST(wxcflags) AC_SUBST(wxlibs) +AM_CONDITIONAL(HAVE_WXWINDOWS, test "$wxwin"="true") dnl Setting projet libraries and includes LDFLAGS="$LDFLAGS -L../libctsupport -L../libctsim"