AC_INIT
AC_CONFIG_SRCDIR([src/ctsim.cpp])
-AM_INIT_AUTOMAKE(ctsim,4.0.2)
+AM_MAINTAINER_MODE
+AM_INIT_AUTOMAKE(ctsim,4.3.0)
AM_CONFIG_HEADER(config.h)
dnl Checks for programs.
wxwin=false
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(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(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
dnl Checks for library functions.
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(strtod strtol snprintf htonl usleep vsprintf vsnprintf)
+AC_CHECK_FUNCS(strtod strtol snprintf htonl usleep vsprintf vsnprintf basename setjmp setpriority time gettimeofday getenv)
AC_CHECK_FUNC(basename)
AC_CHECK_FUNC(setjmp)
AC_CHECK_FUNC(setpriority)
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"
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
AC_ARG_WITH(mcpu,
[ --with-mcpu[=CPU] Set name of CPU for gcc -mcpu])
-if test "$withval" == "pentium4" -o "$withval" == "athlon" ; then
- AC_MSG_RESULT([$withval])
- CFLAGS="$CFLAGS -mcpu=$withval"
-elif test "$withval" == "no"; then
+if test "$withval" == "no" -o "$withval" == "yes" -o "$withval" == ""; then
AC_MSG_RESULT([no])
else
- AC_MSG_RESULT([Unknown])
+ AC_MSG_RESULT([$withval])
+ CFLAGS="$CFLAGS -mcpu=$withval"
fi
AC_MSG_CHECKING([for web access])
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)
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
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"
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"