+LDFLAGS="$LDFLAGS -L/usr/local/lib"
+
+AC_MSG_CHECKING([for X])
+if test "$no_x" != "yes" ; then
+ AC_DEFINE(HAVE_SGP)
+ AM_CONDITIONAL(HAVE_SGP, test 1==1)
+ AC_DEFINE(HAVE_X11)
+ LDFLAGS="$LDFLAGS -L../libctgraphics -L/usr/X11R6/lib"
+ ctlibs_graphics="$ctlibs_base -lctgraphics"
+ AC_MSG_RESULT(yes)
+ if test "$g2" = "true" ; then
+ ctlibs_graphics="$ctlibs_graphics -lg2"
+ AC_DEFINE(HAVE_G2)
+ fi
+ ctlibs_graphics="$ctlibs_graphics $X_BASIC_LIBS $X_TOOLKIT_LIBS"
+else
+ if test "$wxwin" = "true" ; then
+ AC_DEFINE(HAVE_SGP)
+ AM_CONDITIONAL(HAVE_SGP, test 1==1)
+ fi
+ AC_MSG_RESULT(no)
+fi
+
+if test "$png" = "true" ; then
+ ctlibs_tools="$ctlibs_tools -lpng"
+fi
+if test "$zlib" = "true" ; then
+ ctlibs_tools="$ctlibs_tools -lz"
+fi
+if test "$fftw" = "true" ; then
+ ctlibs_tools="$ctlibs_tools -lrfftw -lfftw"
+fi
+
+dnl Check for dmalloc
+AC_CHECK_LIB(dmallocxx, main, [dmallocxx=true], [dmallocxx=false])
+AC_MSG_CHECKING([for enable-dmalloc])
+AC_ARG_ENABLE(dmalloc,
+[ --enable-dmalloc Use dmalloc memory allocation],
+[case "${enableval}" in
+ yes) usedmalloc=true
+ AC_MSG_RESULT(yes)
+ ;;
+ no) usedmalloc=false
+ AC_MSG_RESULT(no)
+ ;;
+ *) AC_MSG_RESULT([bad value ${enableval} for --enable-dmalloc])
+ ;;
+esac],
+[usedmalloc=false; AC_MSG_RESULT(no)])
+
+if test "$dmallocxx" = "true" -a "$usedmalloc" = "true" ; then
+ ctlibs_tools="$ctlibs_tools -ldmallocxx"
+ AC_DEFINE(HAVE_DMALLOC)
+ AC_MSG_RESULT(Using dmalloc)
+fi
+
+if test "$wxwin" = "true" ; then
+ if test "$wx_gtk" = "true" ; then
+ wxcflags=`$wxconfig --cflags`
+ wxlibs=`$wxconfig --libs`
+ else
+ wxcflags="-D__WXMSW__ -D__WIN32__ -D__GNUWIN32__"
+ wxlibs="-lwx -lglui -ljpeg -lxpm -lzlib -ltiff"
+ fi
+ CFLAGS="$CFLAGS -I../include $wxcflags"
+ ctlibs_graphics="$ctlibs_graphics $wxlibs"
+ AM_CONDITIONAL(HAVE_WXWINDOWS, test 1==1 )
+fi
+AC_SUBST(wxcflags)
+AC_SUBST(wxlibs)
+
+dnl Setting projet libraries and includes
+LDFLAGS="$LDFLAGS -L../libctsupport -L../libctsim"
+ctlibs="$ctlibs_base -lctsim $ctlibs_graphics -lctsupport $ctlibs_tools"
+AC_SUBST(ctlibs)
+
+if test -n "$lamdir" ; then
+ lamprograms="pjrec-lam phm2if-lam phm2pj-lam"
+ AC_SUBST(lamprograms)
+ lamdefs="$CFLAGS"
+ AC_SUBST(lamdefs)