X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=configure.in;h=5f804d593ceb292e56166921caec0052b4990444;hb=301180c6c8edb98580ee6657e87f5a21342b5d96;hp=6f1310999a7dcf7c7662a09ebfe092483d210e88;hpb=4784f9c3756229a0cf8741abf0a93af0bfcb9e54;p=ctsim.git diff --git a/configure.in b/configure.in index 6f13109..5f804d5 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl Must reset CDPATH so that bash's cd does not print to stdout dnl CDPATH= AC_INIT(src/ctrec.c) -AM_INIT_AUTOMAKE(ctsim,0.5.2-b1) +AM_INIT_AUTOMAKE(ctsim,0.5.4-b2) AM_CONFIG_HEADER(config.h) dnl Checks for programs. @@ -13,6 +13,35 @@ AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_RANLIB AC_PROG_CC +AC_PROG_CXX + +dnl Check for C operation +AC_CANONICAL_HOST +dnl AC_C_BIGENDIAN +dnl AC_C_INLINE +dnl AC_CHECK_SIZEOF(int) +dnl AC_CHECK_SIZEOF(long int) +dnl AC_CHECK_SIZEOF(float) +dnl AC_CHECK_SIZEOF(double) + +AC_MSG_CHECKING(endian) + +case "$host_cpu" in +i386* | i486* | i586* | i686* | vax*) + endian=low + CFLAGS="$CFLAGS -DENDIAN_LOW=1 -DENDIAN_HIGH=0" + AC_MSG_RESULT(low) + ;; +sparc* | mot*) + endian=high + CFLAGS="$CFLAGS -DENDIAN_LOW=0 -DENDIAN_HIGH=1" + AC_MSG_RESULT(high) + ;; +*) + AC_MSG_ERROR([Unknown host cpu $host_cpu +Can't set endian]) + ;; +esac dnl Checks for libraries. AC_CHECK_LIB(z, main, @@ -26,10 +55,11 @@ AC_CHECK_LIB(z, main, AC_CHECK_LIB(m, main) AC_CHECK_LIB(curses, main, [curses=true], [curses=false]) AC_CHECK_LIB(ncurses, main, [ncurses=true], [ncurses=false]) +AC_CHECK_LIB(g2, main, [g2=true], [g2=false]) dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h unistd.h getopt.h sys/fcntl.h setjmp.h stdarg.h stddef.h sys/types.h sys/stat.h string.h ctype.h math.h stdio.h) +AC_CHECK_HEADERS(fcntl.h unistd.h getopt.h sys/fcntl.h setjmp.h stdarg.h stddef.h sys/types.h sys/stat.h string.h ctype.h math.h stdio.h netinet/in.h inttypes.h sys/param.h stdint.h stdlib.h g2.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -39,7 +69,7 @@ AC_STRUCT_TM dnl Checks for library functions. AC_FUNC_VPRINTF -AC_CHECK_FUNCS(strtod strtol) +AC_CHECK_FUNCS(strtod strtol snprintf htonl) AC_CHECK_FUNC(basename) AC_CHECK_FUNC(setjmp) AC_CHECK_FUNC(getopt_long, @@ -82,9 +112,14 @@ dnl Check for debug mode AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging], [case "${enableval}" in - yes) debug=true ;; - no) debug=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; + yes) debug=true + CFLAGS="$CFLAGS -g" + ;; + no) debug=false + CFLAGS="$CFLAGS -O2" + ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) + ;; esac],[debug=false]) AM_CONDITIONAL(DEBUG, test "$debug" = "true") @@ -160,6 +195,8 @@ if test "$withval" != "no" ; then CFLAGS="$CFLAGS -I$testlamdir/include" lamdir="$testlamdir" AC_SUBST(lamdir) + mpienable="true" + AC_SUBST(mpienable) break fi done @@ -189,7 +226,7 @@ if test -n "$cgibindir" -o -n "$cgibinurl" ; then fi if test -n "$htmldir" ; then - htmldata=ctsim.html + htmldata=simulate.html AC_SUBST(htmldata) fi AM_CONDITIONAL(USE_HTML, test -n "$htmldir") @@ -213,26 +250,6 @@ else AC_MSG_RESULT([no]) fi -dnl Setting projet libraries and includes -LDFLAGS="$LDFLAGS -L../libezplot -L../libgraph -L../libkmath -L../libk -L../libcio -L../libir" -ctlibs_base="$ctlibs_base -lezplot -lgraph -lkmath -lk -lcio" -if test -n "$pngdir" ; then - ctlibs_base="$ctlibs_base -lpng" -fi -if test "$zlib" = "true" ; then - ctlibs_base="$ctlibs_base -lz" -fi -ctlibs="-lir $ctlibs_base" - -AC_SUBST(ctlibs) - -if test -n "$lamdir" ; then - ctlamlibs="-lir_lam $ctlibs_base" - lamprograms="ctrec-lam phm2sdf-lam phm2rs-lam" - AC_SUBST(lamprograms) - AC_SUBST(ctlamlibs) -fi - AM_CONDITIONAL(USE_LAM, test -n "$lamdir") dnl Prepare to support X. If the user gave the command-line option @@ -285,6 +302,40 @@ AM_CONDITIONAL(NO_X, test "x$no_x" = "xyes") my_includes="$my_includes -I../include -I.." AC_SUBST(my_includes) -AM_CONDITIONAL(HAVE_INTERACTIVE_GRAPHICS, test 1==0) +AC_MSG_CHECKING([interactive graphics]) +if test "x$no_x" != "xyes" ; then + AC_DEFINE(HAVE_SGP) + AC_DEFINE(HAVE_X11) + AM_CONDITIONAL(HAVE_SGP, test 1==1) + LDFLAGS="$LDFLAGS -L../libezplot -L../libgraph -L/usr/X11R6/lib" + ctlibs_base="$ctlibs_base -lezplot -lgraph $X_BASIC_LIBS $X_TOOLKIT_LIBS" + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl Setting projet libraries and includes +LDFLAGS="$LDFLAGS -L../libkmath -L../libk -L../libcio -L../libir" +ctlibs_base="$ctlibs_base -lkmath -lk -lcio" +if test -n "$pngdir" ; then + ctlibs_base="$ctlibs_base -lpng" +fi +if test "$zlib" = "true" ; then + ctlibs_base="$ctlibs_base -lz" +fi +if test "$g2" = "true" ; then + ctlibs_base="$ctlibs_base -lg2" +fi + +ctlibs="-lir $ctlibs_base" + +AC_SUBST(ctlibs) + +if test -n "$lamdir" ; then + ctlamlibs="-lir_lam $ctlibs_base" + lamprograms="ctrec-lam phm2sdf-lam phm2rs-lam" + AC_SUBST(lamprograms) + AC_SUBST(ctlamlibs) +fi -AC_OUTPUT(Makefile libezplot/Makefile src/Makefile libgraph/Makefile libkmath/Makefile Makefile libk/Makefile libir/Makefile libcio/Makefile man/Makefile cgi-bin/ctsim.cgi cgi-bin/Makefile html/ctsim.html html/Makefile include/Makefile getopt/Makefile src/sample-ctrec.sh cgi-bin/ctsim.conf) +AC_OUTPUT(Makefile libezplot/Makefile src/Makefile libgraph/Makefile libkmath/Makefile Makefile libk/Makefile libir/Makefile libcio/Makefile man/Makefile cgi-bin/ctsim.cgi cgi-bin/Makefile html/simulate.html html/Makefile include/Makefile getopt/Makefile src/sample-ctrec.sh cgi-bin/ctsim.conf)