X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=configure.in;h=4efaad3b199b140404f0cf7fb4a1c4f13e7f5e1e;hp=d99301354cac1e8729ac4cdb4d8babdb53841edc;hb=6404682526633f7f2b9a2f94071d802b7b50dd07;hpb=352012a3e032ffe20957eb90215e8365c3d2bc16 diff --git a/configure.in b/configure.in index d993013..4efaad3 100644 --- a/configure.in +++ b/configure.in @@ -1,10 +1,10 @@ -dnl Process this file with autoconf to produce a configure script. +IZEOFdnl 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(src/ctrec.c) -AM_INIT_AUTOMAKE(ctsim,0.5.2-b4) +AM_INIT_AUTOMAKE(ctsim,0.5.4-b3) AM_CONFIG_HEADER(config.h) dnl Checks for programs. @@ -13,6 +13,39 @@ AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_RANLIB AC_PROG_CC +AC_PROG_CXX + + +dnl AC_MSG_CHECKING([that the compiler works]) +dnl AC_TRY_RUN([ main(int ac, char **av) { return 0; } ], AC_MSG_RESULT(yes), AC_MSG_RESULT(no) AC_MSG_ERROR(Could not compile and run even a trivial ANSI C program - check CC.), AC_MSG_ERROR(Could not compile and run even a trivial ANSI C program - check CC.)) + +dnl Check for C operation +AC_CANONICAL_HOST +AC_C_BIGENDIAN +AC_C_INLINE +AC_CHECK_SIZEOF(short, 2) +AC_CHECK_SIZEOF(int, 4) +AC_CHECK_SIZEOF(long, 4) +AC_CHECK_SIZEOF(float, 4) +AC_CHECK_SIZEOF(double, 8) + +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* | ia64*) + endian=high + CFLAGS="$CFLAGS -DENDIAN_LOW=0 -DENDIAN_HIGH=1" + AC_MSG_RESULT(high) + ;; +*) + AC_MSG_WARN([Unknown host cpu $host_cpu. Can't set endian]) + ;; +esac dnl Checks for libraries. AC_CHECK_LIB(z, main, @@ -26,10 +59,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 netinet/in.h inttypes.h sys/param.h stdint.h stdlib.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,21 +73,21 @@ 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, -[ - getopt_long=true -], -[ +if ${OSTYPE} == "cygwin" ; then getopt_long=false +else + AC_CHECK_FUNC(getopt_long, [ getopt_long=true ], [ getopt_long=false ]) +fi +if test getopt_long == "false" ; then my_includes="$myincludes -I../getopt" AC_DEFINE(HAVE_GETOPT_LONG) ctlibs_base="$ctlibs_base -lgetopt" LDFLAGS="$LDFLAGS -L../getopt" AM_CONDITIONAL(INCLUDED_GETOPT_LONG, test 1==1) -]) +fi AC_ADD_GCC_CFLAGS([-Wall]) @@ -82,9 +116,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") @@ -166,6 +205,8 @@ if test "$withval" != "no" ; then fi done AC_MSG_RESULT($lamdir) +else + AC_MSG_RESULT([no]) fi AC_MSG_CHECKING([for web access]) @@ -267,11 +308,16 @@ AM_CONDITIONAL(NO_X, test "x$no_x" = "xyes") my_includes="$my_includes -I../include -I.." AC_SUBST(my_includes) +AC_MSG_CHECKING([interactive graphics]) if test "x$no_x" != "xyes" ; then - AC_DEFINE(HAVE_INTERACTIVE_GRAPHICS) - AM_CONDITIONAL(HAVE_INTERACTIVE_GRAPHICS, test 1==1) - LDFLAGS="$LDFLAGS -L../libezplot -L../libgraph" - ctlibs_base="$ctlibs_base -lezplot -lgraph" + 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 @@ -283,6 +329,10 @@ 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)