# ************************************************************************** # FIXME: try to fix all problems with spaces in directory names; # whether it's the src dir, the install/build dir or directories with # dependent libraries. Alternatively, we should at least detect and # warn/exit. Ditto goes for all our other software modules aswell, of # course. 20020519 mortene. # FIXME: need to figure out when libstdc++ is necessary to link. GCC # 3.2 on Solaris seems to demand it, or we'll get unresolved symbols. # 20021128 mortene. # ************************************************************************** # release version number info m4_define([COIN_MAJOR], [2]) m4_define([COIN_MINOR], [4]) m4_define([COIN_MICRO], [6]) m4_define([COIN_BETA], []) # This is probably a more correct setup, but will be harder to keep if # we want major and minor to grow slowly (but is that any point?) # 20010807 larsa m4_define([COIN_ABI_CURRENT], [m4_eval((COIN_MAJOR*20)+COIN_MINOR)]) m4_define([COIN_ABI_REVISION], [COIN_MICRO]) m4_define([COIN_ABI_AGE], [COIN_MINOR]) # only used on Linux for debian packages m4_define([SO_NUMBER], [m4_eval(COIN_MAJOR*20)]) # For Mac OS X Compiler Frameworks: m4_define([MAC_FRAMEWORK_NAME_DEFAULT], [Inventor]) m4_define([MAC_FRAMEWORK_PREFIX_DEFAULT], [/Library/Frameworks]) m4_define([MAC_FRAMEWORK_VERSION_DEFAULT], [B]) # ************************************************************************** AC_PREREQ(2.50) AC_INIT([Coin], [COIN_MAJOR.COIN_MINOR.COIN_MICRO[]COIN_BETA], [coin-support@coin3d.org]) AC_CONFIG_AUX_DIR(cfg) AC_CONFIG_SRCDIR(src/misc/SoDB.cpp) # FIXME: detect and exit upon this problem (as seen reported on # coin-bugs): the install prefix is set to the same directory as the # build directory (or also as the srccode dir). 20020129 mortene. AH_TOP([ #ifndef COIN_INTERNAL #error this is a private header file #endif #include #include ]) AC_CANONICAL_SYSTEM # For include/Inventor/system/inttypes.h. AC_DEFINE_UNQUOTED(COIN_CONFIGURE_BUILD, SIM_AS_TR_CPP([$build]), [Build system.]) AC_DEFINE_UNQUOTED(COIN_CONFIGURE_HOST, SIM_AS_TR_CPP([$host]), [Build host system.]) AC_DEFINE_UNQUOTED(COIN_CONFIGURE_TARGET, SIM_AS_TR_CPP([$target]), [Build target system.]) # date used by debian setup SIM_AC_DATE_RFC822([RFC822_DATE]) AC_SUBST([RFC822_DATE_DAYSTRING]) AC_SUBST([RFC822_DATE_NODAYSTRING]) # date used by redhat setup SIM_AC_ISO8601_DATE([coin_configure_date]) AC_SUBST([coin_configure_date]) SIM_AC_SETUP_MKS SIM_AC_MSVC_DSP_ENABLE_OPTION # If the Microsoft Visual C++ cl.exe compiler is available, set us up for # compiling with it and to generate an MSWindows .dll file. SIM_AC_SETUP_MSVCPP_IFELSE # ************************************************************************** # Mac OS X: gcc AC_ARG_WITH([framework], [AC_HELP_STRING([--without-framework], [Do 'UNIX-style' installation on Mac OS X])], [sim_ac_framework_name="MAC_FRAMEWORK_NAME_DEFAULT" case $withval in yes | true ) sim_ac_framework=true ;; no | false ) sim_ac_framework=false ;; * ) sim_ac_framework=true; sim_ac_framework_name="$withval" ;; esac], [sim_ac_framework_name="MAC_FRAMEWORK_NAME_DEFAULT" case $host_os in darwin* ) sim_ac_framework=true ;; * ) sim_ac_framework=false ;; esac]) # don't allow name to be overrided - just toggled on/off sim_ac_framework_name="MAC_FRAMEWORK_NAME_DEFAULT" AC_ARG_WITH([framework-prefix], [ --with-framework-prefix= (default: "MAC_FRAMEWORK_PREFIX_DEFAULT")], [sim_ac_framework_prefix="$withval"], [sim_ac_framework_prefix="MAC_FRAMEWORK_PREFIX_DEFAULT"]) # don't allow version to be overrided # AC_ARG_WITH([framework-version], # [ --with-framework-version= (default: "MAC_FRAMEWORK_VERSION_DEFAULT")], # [sim_ac_framework_version="$withval"], # [sim_ac_framework_version="MAC_FRAMEWORK_VERSION_DEFAULT"]) sim_ac_framework_version="MAC_FRAMEWORK_VERSION_DEFAULT" AC_SUBST([MAC_FRAMEWORK], [$sim_ac_framework]) AC_SUBST([MAC_FRAMEWORK_NAME], [$sim_ac_framework_name]) AC_SUBST([MAC_FRAMEWORK_PREFIX], [$sim_ac_framework_prefix]) AC_SUBST([MAC_FRAMEWORK_VERSION], [$sim_ac_framework_version]) AC_SUBST([nop], []) frameworkdir= if $sim_ac_framework; then frameworkdir=${sim_ac_framework_prefix}/${sim_ac_framework_name}.framework includedir=$frameworkdir/Resources/include fi ivincludedir=$includedir AC_SUBST([ivincludedir]) AC_SUBST([frameworkdir]) # ************************************************************************** AC_SUBST([COIN_MAJOR_VERSION], [COIN_MAJOR]) AC_SUBST([COIN_MINOR_VERSION], [COIN_MINOR]) AC_SUBST([COIN_MICRO_VERSION], [COIN_MICRO]) AC_SUBST([COIN_BETA_VERSION], [COIN_BETA]) AC_SUBST([COIN_VERSION], [$COIN_MAJOR_VERSION.$COIN_MINOR_VERSION.$COIN_MICRO_VERSION$COIN_BETA_VERSION]) VERSION=$COIN_VERSION SIM_AC_CONFIGURATION_SETTING([Library version], [$COIN_VERSION]) # Libtool versioning AC_SUBST([LT_CURRENT], [COIN_ABI_CURRENT]) AC_SUBST([LT_REVISION], [COIN_ABI_REVISION]) AC_SUBST([LT_AGE], [COIN_ABI_AGE]) AC_SUBST([COIN_SO_VERSION], [SO_NUMBER]) # These are for include/Inventor/C/basic.h. AC_DEFINE_UNQUOTED([COIN_MAJOR_VERSION], [$COIN_MAJOR_VERSION], [define this to the libCoin major version number]) AC_DEFINE_UNQUOTED([COIN_MINOR_VERSION], [$COIN_MINOR_VERSION], [define this to the libCoin minor version number]) AC_DEFINE_UNQUOTED([COIN_MICRO_VERSION], [$COIN_MICRO_VERSION], [define this to the libCoin release version number]) AC_DEFINE_UNQUOTED([COIN_VERSION], ["$COIN_VERSION"], [define this to the full libCoin major.minor.micro version number]) if test x"$COIN_BETA_VERSION" = x""; then :; else AC_DEFINE_UNQUOTED([COIN_BETA_VERSION], [$COIN_BETA_VERSION], [define this to the libCoin beta version letter]) fi # ******************************************************************* # Miscellaneous options and initializations. coin_build_dir=`pwd` coin_src_dir=`cd "$srcdir"; pwd` coin_w32_build_dir=`cygpath -w "$coin_build_dir" 2>/dev/null || echo "$coin_build_dir"` coin_w32_src_dir=`cygpath -w "$coin_src_dir" 2>/dev/null || echo "$coin_src_dir"` SIM_AC_RELATIVE_SRC_DIR # ******************************************************************* # set up configure options for "make distcheck" mode - we want to # ensure that all options that can be turned on works... AC_MSG_CHECKING([for distcheck mode]) case "$prefix:$coin_build_dir" in */=inst:*/=build ) enable_threads=yes enable_threadsafe=yes enable_html=yes enable_man=yes enable_3ds_import=yes enable_debug=no AC_MSG_RESULT([yes]) ;; * ) AC_MSG_RESULT([no]) ;; esac # ************************************************************************** # Locate C++ compiler and set C++ as the default language to use # in tests. The configure script will automatically terminate if # it doesn't find a C++ compiler. # cross_compiling: On MKS, configure will open a window when trying to run # the executable a.out in the cross-compilation test because it is not # named *.exe, halting the configure script until it has been closed, even # resulting in a faulty conclusion for the test (cross_compiling=yes). # By setting the $cross_compiling variable to yes in advance, this test is # skipped. We are of course not cross-compiling, so we correct the variable # afterwards. 2003-06-25 larsa case $build in *-mks ) cross_compiling=yes ;; esac AC_PROG_CC case $build in *-mks ) cross_compiling=no ;; esac # ************************************************************************** # Locate C++ compiler and set C++ as the default language to use # in tests. The configure script will automatically terminate if # it doesn't find a C++ compiler. # # Note that due to bugs in the libtool.m4 set of checks (of libtool v1.4.2) # that makes AC_PROG_LIBTOOL dependent on the current compiler being a C # compiler, we don't activate the C++ compiler until _after_ running # AC_PROG_LIBTOOL. # # (The specific checks we know not to work are the checks for "-c -o" # compatibility, where only CFLAGS is set up (and not CXXFLAGS) before the # check is run). AC_PROG_CXX AC_PROG_CXXCPP # we only interface with C libraries AC_LANG(C) # ************************************************************************** # Figure out if library should be built static or dynamic. # Note that $COIN_STATIC is only a valid variable for MSVC builds. # (and only there it has been used so far anyways). 20050724 larsa if $BUILD_WITH_MSVC; then case ${enable_static-no} in yes | true) COIN_STATIC=true enable_shared=no ;; # fix --enable-static bug? in autoconf 2.58 *) COIN_STATIC=false ;; esac case ${enable_shared-default} in default) ;; yes | true) COIN_STATIC=false ;; *) COIN_STATIC=true ;; esac fi # The above mentioned "bug" might not be a bug for Unix platforms, but for # Windows you can't compile for both shared and static library linkage at # the same time, hence we do need to disable shared when enabling static # builds. 20041021 larsa # ************************************************************************** # NOTE: if we touch CFLAGS/CXXFLAGS before AC_PROG_CC is invoked, the -g # flag will be lost 20020104 larsa if $BUILD_WITH_MSVC; then CPPFLAGS="$CPPFLAGS -D_CRT_SECURE_NO_DEPRECATE" SIM_AC_SETUP_MSVCRT([ CPPFLAGS="$CPPFLAGS $sim_ac_msvcrt_CPPFLAGS" CFLAGS="$CFLAGS $sim_ac_msvcrt_CFLAGS" CXXFLAGS="$CXXFLAGS $sim_ac_msvcrt_CXXFLAGS" LDFLAGS="$LDFLAGS $sim_ac_msvcrt_LDFLAGS" LIBS="$LIBS $sim_ac_msvcrt_LIBS" COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_msvcrt_CPPFLAGS" COIN_EXTRA_CFLAGS="$COIN_EXTRA_CFLAGS $sim_ac_msvcrt_CFLAGS" COIN_EXTRA_CXXFLAGS="$COIN_EXTRA_CXXFLAGS $sim_ac_msvcrt_CXXFLAGS" # sim_ac_msvcrt_LIBLIBS is set up at the end # sim_ac_msvcrt_LIBLDFLAGS is set up at the end ]) fi AC_SUBST([COIN_MSVC_LIBC], [$sim_ac_msvcrt]) AC_SUBST([BUILD_WITH_MSVC]) # ************************************************************************** # Universal Binary support (Mac OS X) SIM_AC_UNIVERSAL_BINARIES # ************************************************************************** AM_INIT_AUTOMAKE(Coin, $VERSION) # Default to not building a static library. # Can be overridden by the user with --enable-static. AM_DISABLE_STATIC # Turn off default maintainer make-rules -- use ./bootstrap instead. AM_MAINTAINER_MODE if $BUILD_WITH_MSVC; then RANLIB=: export RANLIB fi # Detect Mac OS X in general and Mac OS 10.2 "Jaguar" or 10.3 # "Panther" in particular case $host_os in darwin6.* ) # Mac OS 10.2 "Jaguar" sim_ac_macosx=true sim_ac_macosx_10_2ff=true sim_ac_macosx_10_3ff=false sim_ac_macosx_name="Jaguar" ;; darwin7.* ) # Mac OS 10.3 "Panther" sim_ac_macosx=true sim_ac_macosx_10_2ff=true sim_ac_macosx_10_3ff=true sim_ac_macosx_name="Panther" ;; darwin8.* ) # Mac OS 10.4 "Tiger" sim_ac_macosx=true sim_ac_macosx_10_2ff=true sim_ac_macosx_10_3ff=true sim_ac_macosx_name="Tiger" ;; darwin* ) # earlier Mac OS X versions sim_ac_macosx=true sim_ac_macosx_10_2ff=false sim_ac_macosx_10_3ff=false sim_ac_macosx_name="" ;; * ) # not a Mac OS X sim_ac_macosx=false sim_ac_macosx_10_2ff=false sim_ac_macosx_10_3ff=false sim_ac_macosx_name="" ;; esac AM_CONDITIONAL([MAC_FRAMEWORK], [$sim_ac_framework]) AM_CONDITIONAL([MACOSX_10_2FF], [$sim_ac_macosx_10_2ff]) AM_CONDITIONAL([MACOSX_10_3FF], [$sim_ac_macosx_10_3ff]) AM_CONDITIONAL([MACOSX], [$sim_ac_macosx]) AC_SUBST([MACOSX_NAME], [$sim_ac_macosx_name]) AC_SUBST([MACOSX_10_2FF], [$sim_ac_macosx_10_2ff]) # ************************************************************************** # Initialize libtool # # FIXME: this must be done even when we're not using libtool (as when # building with MSVC++), because that's where at least the enable_static # and enable_shared flags are set up. 20030324 mortene. AC_PROG_LIBTOOL # ************************************************************************** # These are used for constructing the coin-config file. AC_SUBST([COIN_EXTRA_CPPFLAGS]) AC_SUBST([COIN_EXTRA_CFLAGS]) AC_SUBST([COIN_EXTRA_CXXFLAGS]) AC_SUBST([COIN_EXTRA_LDFLAGS]) AC_SUBST([COIN_EXTRA_LIBS]) # ******************************************************************* # Enable/disable separate Coin modules sim_ac_enable_next_minor=false AC_ARG_ENABLE( [next-minor], AC_HELP_STRING([--enable-next-minor], [enable new features in development]), [ case $enableval in yes | true) sim_ac_enable_next_minor=true ;; *) ;; esac]) if $sim_ac_enable_next_minor; then if test x"$COIN_BETA_VERSION" = x"" -a \ x"$COIN_MICRO_VERSION" = x"0"; then AC_DEFINE([COIN_NEXT_MINOR], [#error invalid], [define/option invalid for minor releases]) AC_MSG_ERROR([--enable-next-minor error -- this *is* the next minor]) else AC_DEFINE([COIN_NEXT_MINOR], 1, [Define this to enable new features in development between minor releases]) SIM_AC_CONFIGURATION_SETTING([New in-development features], [Yes]) fi else if test x"$COIN_BETA_VERSION" = x"" -a \ x"$COIN_MICRO_VERSION" = x"0"; then AC_DEFINE([COIN_NEXT_MINOR], [#error invalid], [define/option invalid for minor releases]) fi SIM_AC_CONFIGURATION_SETTING([New in-development features], [No (default)]) fi sim_ac_enable_java_wrapper=false AC_ARG_ENABLE( [java-wrapper], AC_HELP_STRING([--enable-java-wrapper], [enable building java wrapper]), [ case $enableval in yes | true) sim_ac_enable_java_wrapper=true ;; *) ;; esac]) AM_CONDITIONAL([BUILD_JAVA_WRAPPER], [$sim_ac_enable_java_wrapper]) if $sim_ac_enable_java_wrapper; then AC_DEFINE([HAVE_JAVA_WRAPPER], 1, [Define this if you build the Java wrapper]) SIM_AC_CONFIGURATION_SETTING([Generate Java wrapper], [Yes (not really)]) else SIM_AC_CONFIGURATION_SETTING([Generate Java wrapper], [No (default)]) fi # ******************************************************************* # Compiler checking. ## Make it possible for the user to turn off optimization flags for ## the compiler before running the fatal error checks below. SIM_AC_COMPILER_OPTIMIZATION ## Smoke out some known defunct compilers. SIM_AC_COMPILER_CPLUSPLUS_FATAL_ERRORS ## See which way the compiler knows the name of the current function. #### SIM_AC_CHECK_VAR_FUNCTIONNAME SIM_AC_MAC_CPP_ADJUSTMENTS if test x"$prefix" = x"NONE"; then prefix=/usr/local fi # ******************************************************************* # Enable/disable separate Coin modules # ******************************************************************* # See if we should build with 3ds import capabilities. sim_ac_enable_3ds_import=false AC_ARG_ENABLE( [3ds-import], AC_HELP_STRING([--enable-3ds-import], [enable 3ds import capabilities]), [ case $enableval in yes | true) sim_ac_enable_3ds_import=true ;; *) ;; esac]) HAVE_3DS_IMPORT_CAPABILITIES=1 if $sim_ac_enable_3ds_import ; then AC_DEFINE([HAVE_3DS_IMPORT_CAPABILITIES],, [for setup.h]) SIM_AC_CONFIGURATION_SETTING([3ds import capabilities], [Yes (warning: experimental)]) else HAVE_3DS_IMPORT_CAPABILITIES=0 SIM_AC_CONFIGURATION_SETTING([3ds import capabilities], [No (enable with --enable-3ds-import)]) fi AC_SUBST(HAVE_3DS_IMPORT_CAPABILITIES) # ******************************************************************* # See if we should build with javascript capabilities. sim_ac_enable_javascript=false AC_ARG_ENABLE( [javascript-api], AC_HELP_STRING([--enable-javascript-api], [enable javascript capabilities]), [ case $enableval in yes | true) sim_ac_enable_javascript=true ;; *) ;; esac]) HAVE_JAVASCRIPT=1 if $sim_ac_enable_javascript ; then AC_DEFINE([COIN_HAVE_JAVASCRIPT],, [for setup.h]) SIM_AC_CONFIGURATION_SETTING([javascript capabilities], [Yes (warning: experimental)]) else HAVE_JAVASCRIPT=0 SIM_AC_CONFIGURATION_SETTING([javascript capabilities], [No (enable with --enable-javascript-api)]) fi AC_SUBST(HAVE_JAVASCRIPT) # ******************************************************************* # Search for the vrml97 extension sim_ac_enable_vrml97=true AC_ARG_ENABLE( [vrml97], AC_HELP_STRING([--disable-vrml97], [disable VRML97 support]), [ case $enableval in yes | true) sim_ac_enable_vrml97=true ;; no | false) sim_ac_enable_vrml97=false ;; *) ;; esac]) HAVE_VRML97=1 if $sim_ac_enable_vrml97 ; then AC_DEFINE([HAVE_VRML97],, [for setup.h]) VRML97MAKEFILE=src/vrml97/Makefile SIM_AC_CONFIGURATION_SETTING([VRML97 support], [Yes]) else HAVE_VRML97=0 VRML97MAKEFILE= SIM_AC_CONFIGURATION_SETTING([VRML97 support], [No (enable with --enable-vrml97)]) fi AC_SUBST(HAVE_VRML97) # ******************************************************************* # Search for the "local GLU" extension enable_superglu=false if test -x ${srcdir}/src/extensions/superglu/configure; then enable_superglu=true AC_DEFINE(HAVE_SUPERGLU,1, [*EXPERIMENTAL* to use the GLU we've "appropriated" from SGI]) HAVE_SUPERGLU=1 AC_CONFIG_SUBDIRS([src/extensions/superglu]) CPPFLAGS="-I$coin_build_dir/src/extensions/superglu/include -I$coin_src_dir/src/extensions/superglu/include $CPPFLAGS" else enable_superglu=false HAVE_SUPERGLU=0 fi AC_SUBST([HAVE_SUPERGLU]) AC_SUBST([SUPERGLUPREFIX], [Super]) export SUPERGLUPREFIX AM_CONDITIONAL(BUILD_WITH_SUPERGLU, $enable_superglu) # ******************************************************************* AC_ARG_ENABLE([threads], [AC_HELP_STRING([--disable-threads], [disable platform-independent multithreading abstraction classes])], [case $enableval in yes | true ) sim_ac_enable_threads=true ;; no | false ) sim_ac_enable_threads=false ;; *) AC_MSG_ERROR([invalid arg "$enableval" for --enable-threads option]) ;; esac], [sim_ac_enable_threads=true]) HAVE_THREADS=0 if $sim_ac_enable_threads; then sim_ac_threads_api="none" # Make it possible to explicitly turn off Win32 threads, to for instance # use POSIX threads instead under Win32. AC_ARG_ENABLE([w32threads], [AC_HELP_STRING([--disable-w32threads], [never use Win32 threads, even when available])], [case $enableval in yes | true ) sim_ac_w32_enable_threads=true ;; no | false ) sim_ac_w32_enable_threads=false ;; *) AC_MSG_ERROR([invalid arg "$enableval" for --disable-w32threads option]) ;; esac], [sim_ac_w32_enable_threads=true]) sim_ac_win32_threads_available=false # Check for platform-native Win32 thread API first. if $sim_ac_w32_enable_threads; then AC_MSG_CHECKING([for Win32 threads]) AC_TRY_LINK( [#include ], [HANDLE h = CreateThread(NULL, 0, NULL, NULL, 0, NULL); (void)SetThreadPriority(h, 0); ExitThread(0);], [sim_ac_win32_threads_available=true sim_ac_threads_api="native Win32" AC_DEFINE([USE_W32THREAD], , [define to use the Win32 threads API]) AC_DEFINE([COIN_THREADID_TYPE], DWORD, [System dependant thread ID type])]) # (we just ignore failure, as we fall through to POSIX threads) AC_MSG_RESULT($sim_ac_win32_threads_available) fi if ! $sim_ac_win32_threads_available; then SIM_AC_CHECK_PTHREAD([ AC_DEFINE([USE_PTHREAD], , [define to use the POSIX threads API]) AC_DEFINE([COIN_THREADID_TYPE], pthread_t, [System dependent thread ID type]) sim_ac_threads_api="POSIX" COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_pthread_cppflags" COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_pthread_ldflags" COIN_EXTRA_LIBS="$sim_ac_pthread_libs $COIN_EXTRA_LIBS" ]) fi if test "$sim_ac_threads_api" = "none"; then AC_MSG_ERROR([Could not find any usable native thread-handling API/library/devkit! (If you do not want to enable the platform-independent thread-handling classes in Coin, specify the "--disable-threads" option to the configure script.)]) fi HAVE_THREADS=1 AC_DEFINE([HAVE_THREADS],, [to use the platform-independent thread-handling abstractions]) else sim_ac_threads_api="Disabled (enable with --enable-threads)" fi AC_SUBST([HAVE_THREADS]) SIM_AC_CONFIGURATION_SETTING([System threads API], [$sim_ac_threads_api]) AM_CONDITIONAL([BUILD_WITH_THREADS], [$sim_ac_enable_threads]) # ******************************************************************* # Thread safe library AC_ARG_ENABLE([threadsafe], AC_HELP_STRING([--enable-threadsafe], [enable thread safe traversals]), [case $enableval in yes | true ) sim_ac_enable_threadsafe=true ;; *) ;; esac], [sim_ac_enable_threadsafe=false]) HAVE_THREADSAFE=0 if $sim_ac_enable_threadsafe; then if test "$HAVE_THREADS" = "0"; then AC_MSG_ERROR([You can not enable thread safe action traversals while at the same time disabling the portable thread-handling abstractions. You must use "--enable-threadsafe" with "--enable-threads".]) fi HAVE_THREADSAFE=1 AC_DEFINE([COIN_THREADSAFE], 1, [for setup.h]) SIM_AC_CONFIGURATION_SETTING([Thread safe traversals], [Yes (in development)]) else SIM_AC_CONFIGURATION_SETTING([Thread safe traversals], [No (enable with --enable-threadsafe)]) fi AC_SUBST([HAVE_THREADSAFE]) # ******************************************************************* # Headers we might want to use # We expect these to include their dependencies. # # A non-empty last argument indicates to Autoconf that we would like to heed # the result from compilation, not just pre-processing. (A space is enough # to indicate non-emptiness.) AC_CHECK_HEADERS( [unistd.h sys/types.h inttypes.h stdint.h sys/param.h sys/time.h sys/timeb.h time.h io.h windows.h libgen.h direct.h ieeefp.h], [], [], [ ]) SIM_AC_CHECK_HEADER_TLHELP32_H SIM_AC_CHECK_FUNC__SPLITPATH SIM_AC_CHECK_WIN32_API # Various systems (like MKS NuTCracker) needs explicit gdi32 linkage. if $sim_ac_have_win32_api; then LIBS="$LIBS -lgdi32" COIN_EXTRA_LIBS="$COIN_EXTRA_LIBS -lgdi32" fi # A non-empty last argument indicates to Autoconf that we would like to heed # the result from compilation, not just pre-processing. (A space is enough # to indicate non-emptiness.) AC_CHECK_HEADERS( [sys/unistd.h], [sim_ac_have_sys_unistd_h=true], [sim_ac_have_sys_unistd_h=false], [ ]) if $sim_ac_have_sys_unistd_h; then AC_MSG_CHECKING([for IN_PATH define conflict]) AC_TRY_COMPILE( [#include ], [void * v; v = (void*) IN_PATH;], [sim_ac_in_path_defined=true], [sim_ac_in_path_defined=false]) if $sim_ac_in_path_defined; then AC_MSG_RESULT([yes]) AC_DEFINE([COIN_UNDEF_IN_PATH_HACK],1, [define to "remove" conflicting IN_PATH define from ]) else AC_MSG_RESULT([no]) fi fi # According to Coin user Ralf Corsepius, at least SunOS4 needs # to include sys/types.h before netinet/in.h. There have also # been a problem report for FreeBSD which seems to indicate # the same dependency on that platform aswell. # # FIXME: should we make this into a general macro # SIM_AC_CHECK_DEPENDENT_HEADER(HEADER, DEPENDONHEADERS..)? 20001025 mortene. # # FIXME2: is this really necessary? AC _CHECK_HEADER(S) tests by using the # preprocessor, not by doing a compile, so we could probably just # include netinet/in.h in the above list to AC _CHECK_HEADERS. We wouldn't # catch problems quiet so early on, though. 20001025 mortene. AC_CACHE_CHECK([for netinet/in.h], sim_cv_netinet_in_h, [ AC_TRY_CPP([ #ifdef HAVE_SYS_TYPES_H #include #endif /* HAVE_SYS_TYPES_H */ #include ], [sim_cv_netinet_in_h=true], [sim_cv_netinet_in_h=false])]) if $sim_cv_netinet_in_h; then AC_DEFINE_UNQUOTED([HAVE_NETINET_IN_H], [1], [Define if you have the header file.]) fi # For Inventor/system/inttypes.h.in. # # Note: this assumes AC_CHECK_HEADERS(sys/types.h stdint.h) has been done. # # FIXME: the header file checking should be AC_REQUIREd, if possible. # 20010711 mortene. SIM_AC_DEFINE_BYTESIZE_TYPES # ******************************************************************* AC_MSG_CHECKING([for _strdup() function]) AC_TRY_LINK( [#ifdef HAVE__STRDUP #include #endif], [char * ptr = 0; _strdup(ptr);], [AC_DEFINE(HAVE__STRDUP, 1, [define if _strdup() is to be used]) AC_MSG_RESULT([available])], [AC_MSG_RESULT([not available])]) AC_MSG_CHECKING([for fstat() function]) AC_TRY_LINK( [#ifdef HAVE_SYS_STAT_H #include #endif], [struct stat sb; int result = fstat(0, &sb);], [AC_DEFINE(HAVE_FSTAT, 1, [define if fstat() is available]) AC_MSG_RESULT([available])], [AC_MSG_RESULT([not available])]) # ******************************************************************* # We want to use BSD 4.3's isinf(), isnan(), finite() if they are # available. AC_MSG_CHECKING([for BSD 4.3 isinf() function]) AC_TRY_LINK( [#include ], [int result = isinf(42.0);], [AC_DEFINE(HAVE_ISINF, 1, [define if isinf() is available]) AC_MSG_RESULT([available])], [AC_MSG_RESULT([not available])]) AC_MSG_CHECKING([for BSD 4.3 isnan() function]) AC_TRY_LINK( [#include ], [int result = isnan(42.0);], [AC_DEFINE(HAVE_ISNAN, 1, [whether or not isnan() is available]) AC_MSG_RESULT([available])], [AC_MSG_RESULT([not available]) AC_MSG_CHECKING([for _isnan() function]) AC_TRY_LINK( [#include ], [int result = _isnan(42.0);], [AC_DEFINE(HAVE__ISNAN, 1, [whether or not _isnan() is available]) AC_MSG_RESULT([available])], [AC_MSG_RESULT([not available])]) ]) AC_MSG_CHECKING([for BSD 4.3 finite() function]) AC_TRY_LINK( [#include ], [int result = finite(42.0);], [AC_DEFINE(HAVE_FINITE, 1, [whether or not finite() is available]) AC_MSG_RESULT([available])], [AC_MSG_RESULT([not available]) AC_MSG_CHECKING([for _finite() function]) AC_TRY_LINK( [#include ], [int result = _finite(42.0);], [AC_DEFINE(HAVE__FINITE, 1, [whether or not _finite() is available]) AC_MSG_RESULT([available])], [AC_MSG_RESULT([not available])]) ]) AC_MSG_CHECKING([for fpclass() function]) AC_TRY_LINK( [#ifdef HAVE_IEEEFP_H #include #endif], [int result = fpclass(42.0);], [AC_DEFINE(HAVE_FPCLASS, 1, [whether or not fpclass() is available]) AC_MSG_RESULT([available])], [AC_MSG_RESULT([not available])]) AC_MSG_CHECKING([for _fpclass() function]) AC_TRY_LINK( [#include ], [int result = _fpclass(42.0);], [AC_DEFINE(HAVE__FPCLASS, 1, [whether or not _fpclass() is available]) AC_MSG_RESULT([available])], [AC_MSG_RESULT([not available])]) SIM_AC_CHECK_TYPEOF_STRUCT_MEMBER([ #include #ifdef HAVE_TIME_H #include // struct timeval (Linux) #endif // HAVE_TIME_H #ifdef HAVE_SYS_TIME_H #include // struct timeval (IRIX) #endif // HAVE_SYS_TIME_H #ifdef HAVE_WINDOWS_H #include #endif // HAVE_WINDOWS_H ], [timeval], [tv_sec], [SIM_TIMEVAL_TV_SEC_T], []) SIM_AC_CHECK_TYPEOF_STRUCT_MEMBER([ #include #ifdef HAVE_TIME_H #include // struct timeval (Linux) #endif // HAVE_TIME_H #ifdef HAVE_SYS_TIME_H #include // struct timeval (IRIX) #endif // HAVE_SYS_TIME_H #ifdef HAVE_WINDOWS_H #include #endif // HAVE_WINDOWS_H ], [timeval], [tv_usec], [SIM_TIMEVAL_TV_USEC_T], []) # ******************************************************************* sim_ac_build_library=true AC_ARG_ENABLE( [build], [AC_HELP_STRING([--disable-build], [disable configuration for library build])], [case $enableval in no | false) sim_ac_build_library=false SIM_AC_CONFIGURATION_SETTING([Coin build type], [build disabled]) ;; esac]) AM_CONDITIONAL(BUILD_LIBRARY, $sim_ac_build_library) # ******************************************************************* # * Do we want to build the documentation? # ******************************************************************* AC_ARG_VAR([htmldir], [destination for HTML docs (default ${datadir}/Coin/html)]) AC_ARG_ENABLE(html, AC_HELP_STRING([--enable-html], [build and install Coin HTML documentation]), [case $enableval in yes | true) want_html=yes ;; *) want_html=no ;; esac], [want_html=no]) case $htmldir in "") htmldir="$datadir/Coin/html" ;; /*) # do nothing - absolute path ;; *) htmldir="\${prefix}/$htmldir" ;; esac AC_SUBST(htmldir) AC_ARG_ENABLE(man, AC_HELP_STRING([--enable-man], [build and install Coin man pages]), [case $enableval in yes | true) want_man=yes ;; *) want_man=no ;; esac], [want_man=no]) AC_ARG_VAR([htmlhelpdir], [destination for HTML-help docs (default ${datadir}/Coin/htmlhelp)]) AC_ARG_ENABLE([html-help], AC_HELP_STRING([--enable-html-help], [build and install Coin HTML-help documentation]), [case $enableval in yes | true) want_html_help=yes ;; *) want_html_help=no ;; esac], [want_html_help=no]) case $htmlhelpdir in "") htmlhelpdir="$datadir/Coin/htmlhelp" ;; /*) # do nothing - absolute path ;; *) htmlhelpdir="\${prefix}/$htmlhelpdir" ;; esac AC_SUBST(htmlhelpdir) # We must turn on html-generation if html-help is turned on, # but without affecting the setup of the BUILD_HTMLPAGES # conditional, so HTML files aren't installed if you don't # use --enable-html. 20031202 larsa coin_doc_html=`echo $want_html | tr '[a-z]' '[A-Z]'` if test x"$want_html_help" = x"yes"; then coin_doc_html=YES fi # Used in the Doxygen parameter file. AC_SUBST([COIN_DOC_HTML], [$coin_doc_html]) AC_SUBST([coin_html_dir], [`pwd`/html]) AC_SUBST([COIN_DOC_HTML_HELP], [`echo $want_html_help | tr '[a-z]' '[A-Z]'`]) AC_SUBST([coin_html_help_dir], [`pwd`/htmlhelp]) AC_SUBST([COIN_DOC_MAN], [`echo $want_man | tr '[a-z]' '[A-Z]'`]) AC_SUBST([coin_man_dir], [`pwd`/man]) AM_CONDITIONAL(BUILD_MANPAGES, test x"$want_man" = x"yes") AM_CONDITIONAL(BUILD_HTMLPAGES, test x"$want_html" = x"yes") AM_CONDITIONAL(BUILD_HTMLHELP, test x"$want_html_help" = x"yes") if test x"$want_man" = x"yes"; then SIM_AC_CONFIGURATION_SETTING([manpage installation], [$mandir]) fi if test x"$want_html" = x"yes"; then SIM_AC_CONFIGURATION_SETTING([HTML installation], [$htmldir]) fi sim_ac_hhc_exe= case $host in *-cygwin) AC_PATH_PROG([sim_ac_hhc_exe], [hhc]) ;; esac if test x"$want_html_help" = x"yes"; then SIM_AC_CONFIGURATION_SETTING([HTML-help installation], [$htmlhelpdir]) if test x"$sim_ac_hhc_exe" = x; then AC_MSG_WARN([Could not find the HTML Help Compiler (hhc) executable]) fi fi # Perl is used for the Doxygen-based doc generation, plus when making # NSIS installation packages. AC_PATH_PROG(sim_ac_perl_exe, perl, false, $PATH) if test x"$want_html" != xno -o x"$want_man" != xno -o x"$want_html_help" != xno; then SIM_AC_DOXYGEN_TOOL([], [SIM_AC_ERROR([no-doxygen])]) if test x"$sim_ac_perl_exe" = xfalse; then AC_MSG_ERROR([Could not find the Perl executable, which is needed for Doxygen doc generation.]) fi fi # path_tag is used to identify paths in docs/coin.doxygen that needs to be # transformed using cygpath under cygwin. case $host in *-cygwin) path_tag="" ;; *) path_tag= ;; esac AC_SUBST(path_tag) sim_ac_makensis_exe=false case $host in *-cygwin) AC_PATH_PROG([sim_ac_makensis_exe], [makensis], [false], [$PATH]) ;; esac AC_PATH_PROG([sim_ac_dpkg_buildpackage_exe], [dpkg-buildpackage], [false], [$PATH]) sim_ac_windows_packagable=true if test x"$sim_ac_perl_exe" = xfalse || test x"$sim_ac_makensis_exe" = xfalse; then sim_ac_windows_packageable=false fi AM_CONDITIONAL([WIN_PACKAGEABLE], $sim_ac_windows_packageable) sim_ac_debian_packageable=true if test x"$sim_ac_dpkg_buildpackage_exe" = xfalse; then sim_ac_debian_packageable=false fi AM_CONDITIONAL([DEB_PACKAGEABLE], [$sim_ac_debian_packageable]) SIM_AC_PACKAGEMAKER_APP AC_SUBST([sim_ac_packagemaker_app]) sim_ac_macosx_packageable=true if test x"$sim_ac_packagemaker_app" = xfalse; then sim_ac_macosx_packageable=false fi AM_CONDITIONAL([MACOSX_PACKAGEABLE], [$sim_ac_macosx_packageable]) # ******************************************************************* # Configure an alternate installation? AC_ARG_WITH( [alternate], [AC_HELP_STRING([--with-alternate=string], [specify name of alternate configuration])], [CONFIG=$withval], [CONFIG=default]) AC_ARG_WITH( [suffix], [AC_HELP_STRING([--with-suffix=string], [specify library name suffix (e.g. "_g")])], [SUFFIX=$withval], [SUFFIX=]) AC_SUBST(CONFIG) AC_SUBST(SUFFIX) # ******************************************************************* # * Check compiler features, bugs, etc. # ******************************************************************* # FIXME: the extra strict warning settings for GCC below should be # placed in a macro, so they can be easily used from other src-code # modules aswell. 20021218 mortene. SIM_AC_COMPILE_DEBUG([ CPPFLAGS="$CPPFLAGS -DCOIN_DEBUG=1" ], [ CPPFLAGS="$CPPFLAGS -DCOIN_DEBUG=0" ]) SIM_AC_DEBUGSYMBOLS SIM_AC_RTTI_SUPPORT SIM_AC_EXCEPTION_HANDLING SIM_AC_PROFILING_SUPPORT SIM_AC_COMPILER_WARNINGS SIM_AC_DETECT_COMMON_COMPILER_FLAGS # Disable bool type with MSVC. # # "/noBool" should not be part of the SIM_AC_DETECT_COMMON_COMPILER_FLAGS # macro, because some projects will not compile properly with it. # (Like at least SoQt, since the Qt headers defines the bool type, which # will then cause a compiler error when q[whatever].h is included.) SIM_AC_COMPILER_NOBOOL([ sim_ac_compiler_CXXFLAGS="$sim_ac_compiler_CXXFLAGS $sim_ac_nobool_CXXFLAGS" ]) # Yep, this is important in case we want to add code to make # the API interface "Open Inventor strict", meaning the user must # use the exact same include files as under "real" Open Inventor. # We would then need to know that we are actually allowed to include # any file during internal build. # # The COIN_INTERNAL define is also in use to detect # "inefficient including" internally. CPPFLAGS="$CPPFLAGS -DCOIN_INTERNAL" # ************************************************************************** # Check for various system specifics. # Try to find snprintf() and vsnprintf() on the system. SIM_AC_CHECK_NPRINTF # C99 va_copy() available? AC_MSG_CHECKING([for va_copy() stdarg macro]) AC_TRY_LINK([#include static void hepp(int dummy, ...) { va_list l, c; va_start(l, dummy); va_copy(c, l); va_end(c); va_end(l); } ], [hepp(0, 1, 2); ], [AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_VA_COPY_MACRO], 1, [Define to use va_copy() when available])], [AC_MSG_RESULT([no])]) # How to string quote. SIM_AC_CHECK_MACRO_QUOTE([], [SIM_AC_ERROR([no-cpp-quoting])]) if test x"$sim_ac_quote_hash" = xyes; then AC_DEFINE([HAVE_HASH_QUOTING],1, [define if preprocessor can quote arguments with the hash symbol]) else if test x"$sim_ac_quote_apostrophes" = xyes; then AC_DEFINE([HAVE_APOSTROPHES_QUOTING],1, [define if preprocessor can quote arguments with apostophes]) fi fi # ******************************************************************* # Instead of getenv() on most Win32 platforms (not Windows CE). AC_MSG_CHECKING([for GetEnvironmentVariable() function]) AC_TRY_LINK([#include ], [(void)GetEnvironmentVariable("FOOBAR", NULL, 0);], [AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_GETENVIRONMENTVARIABLE],1, [Define to use GetEnvironmentVariable() instead of getenv()])], [AC_MSG_RESULT([no])]) # ******************************************************************* # sim_ac_save_LIBS=$LIBS LIBS="$LIBS -lwinmm" AC_MSG_CHECKING([for timeGetTime() function]) AC_TRY_LINK([ #ifdef HAVE_WINDOWS_H #include #endif ], [ (void)timeGetTime(); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_TIMEGETTIME],, [Define to use timeGetTime()]) COIN_EXTRA_LIBS="$COIN_EXTRA_LIBS -lwinmm" ], [ AC_MSG_RESULT([no]) LIBS=$sim_ac_save_LIBS ]) # ******************************************************************* # The MessageBox() Win32 API call is used in SoDB.cpp to throw up # an error message when multiple Coin-instances are detected in the # same process image. sim_ac_save_LIBS=$LIBS LIBS="$LIBS -luser32" AC_MSG_CHECKING([for MessageBox() function]) AC_TRY_LINK([ #ifdef HAVE_WINDOWS_H #include #endif ], [ (void)MessageBox(NULL, NULL, NULL, 0); ], [ AC_MSG_RESULT([yes]) COIN_EXTRA_LIBS="$COIN_EXTRA_LIBS -luser32" ], [ AC_MSG_RESULT([no]) LIBS=$sim_ac_save_LIBS ]) # ******************************************************************* # Test for misc functions to get systemtime with. AC_MSG_CHECKING([for QueryPerformanceCounter() function]) AC_TRY_LINK([ #ifdef HAVE_WINDOWS_H #include #endif ], [ LARGE_INTEGER l; (void)QueryPerformanceFrequency(&l); (void)QueryPerformanceCounter(&l); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_QUERYPERFORMANCECOUNTER],1, [Define to use Win32 QueryPerformanceCounter()]) ], [ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([for _dup() function]) AC_TRY_LINK([ #ifdef HAVE_WINDOWS_H #include #endif #include ], [ int file = 0, dfile; dfile = _dup(file); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE__DUP],1, [Define to use _dup() instead of dup()]) ], [ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([for _fdopen() function]) AC_TRY_LINK([ #ifdef HAVE_WINDOWS_H #include #endif #include ], [ int file = 0; _fdopen(file, ""); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE__FDOPEN],1, [Define to use _fdopen() instead of fdopen()]) ], [ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([for _fileno() function]) AC_TRY_LINK([ #ifdef HAVE_WINDOWS_H #include #endif #include ], [ FILE * file = 0; (void)_fileno(file); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE__FILENO],1, [Define to use _fileno() instead of fileno()]) ], [ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([for _isatty() function]) AC_TRY_LINK([ #ifdef HAVE_WINDOWS_H #include #endif ], [ int i = 0; (void)_isatty(i); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE__ISATTY],1, [Define to use _isatty()()]) ], [ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([for _ftime64_s() function]) AC_TRY_LINK([ #include #include #include ], [ struct _timeb timebuffer; _ftime64_s(&timebuffer); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE__FTIME64_S],1, [Define to use Win32 _ftime64_s()]) ], [ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([for _ftime() function]) AC_TRY_LINK([ #include #include #include ], [ struct _timeb timebuffer; _ftime(&timebuffer); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE__FTIME],1, [Define to use Win32 _ftime()]) ], [ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([for ftime() function]) AC_TRY_LINK([ #include ], [ struct timeb timebuffer; ftime(&timebuffer); ], [ # ftime() is not available in libSystem on Mac OS X < 10.4, # so don't use it when building the binary SDK. case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[0123]]) AC_MSG_RESULT([yes (unused)]) ;; *) AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_FTIME],1, [Define to use ftime()]) ;; esac ], [ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([for _getcwd() function]) AC_TRY_LINK([ #include ], [ char buf[512]; _getcwd(buf, 512); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE__GETCWD],1, [Define to use Win32 _getcwd()]) ], [ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([for getcwd() function]) AC_TRY_LINK([ #include ], [ char buf[512]; getcwd(buf, 512); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_GETCWD],1, [Define to use getcwd()]) ], [ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([for gettimeofday() function]) AC_TRY_LINK([ #ifdef HAVE_TIME_H #include #endif /* HAVE_TIME_H */ #ifdef HAVE_SYS_TIME_H #include #endif /* HAVE_SYS_TIME_H */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_SYS_UNISTD_H #include #endif /* HAVE_SYS_UNISTD_H */ ], [ struct timeval tmp; (void)gettimeofday(&tmp, NULL); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_GETTIMEOFDAY],1, [Define to use SVr4 / BSD4.3 gettimeofday()]) ], [ AC_MSG_RESULT([no]) ]) # ******************************************************************* # Test for misc functions, typically not part of neither ISO C or POSIX. AC_MSG_CHECKING([for strncasecmp() function]) AC_TRY_LINK([ #include ], [ (void)strncasecmp(NULL, NULL, 0); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_STRNCASECMP],1, [Define to use BSD4.3 strncasecmp()]) ], [ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([for _logb() function]) AC_TRY_LINK([ #include #include ], [ (void)_logb(1.0); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE__LOGB],1, [Define to use Win32 _logb()]) ], [ AC_MSG_RESULT([no]) ]) # ******************************************************************* # * Test to see if dynamic linking through either the (Linux/IRIX/...) # * dl library or the Win32 LoadLibrary() call is available. # ******************************************************************* coin_can_do_runtime_linking=false # On Mac OS X < 10.4, dlopen() is missing and has to be emulated; from # 10.4 on, we can use dlopen() directly. Note that the latter does not # obsolete the dyld check, since we also use other dyld functionility. SIM_AC_CHECK_DYLD([ AC_DEFINE_UNQUOTED([HAVE_DYLD_RUNTIME_BINDING],1, [define if the Mac OS X dyld can be used for runtime binding]) coin_can_do_runtime_linking=true ]) case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[0123]]) # Do *not* pick up dlopen() support when building on 10.4 for earlier # Mac OS X versions (< 10.4 did not support dlopen(), so we have to use # our own implementation based on built-in dyld functions there). ;; *) SIM_AC_CHECK_DL([ AC_DEFINE_UNQUOTED([HAVE_DL_LIB],1, [define if you have the dl library]) COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_dl_cppflags" COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_dl_ldflags" COIN_EXTRA_LIBS="$sim_ac_dl_libs $COIN_EXTRA_LIBS" coin_can_do_runtime_linking=true ]) ;; esac if ! $coin_can_do_runtime_linking; then SIM_AC_CHECK_LOADLIBRARY([ AC_DEFINE_UNQUOTED([HAVE_WINDLL_RUNTIME_BINDING],1, [define if the Win32 LoadLibrary method is available]) coin_can_do_runtime_linking=true ]) fi if ! $coin_can_do_runtime_linking; then SIM_AC_CHECK_DLD([ AC_DEFINE_UNQUOTED([HAVE_DLD_LIB],1, [define if the DLD shared library loader is available]) COIN_EXTRA_LIBS="$sim_ac_dld_libs $COIN_EXTRA_LIBS" coin_can_do_runtime_linking=true ]) fi if $coin_can_do_runtime_linking; then AC_DEFINE_UNQUOTED([HAVE_DYNAMIC_LINKING], 1, [should be defined if there is some way of doing dynamic linking]) fi # ******************************************************************* # * Set us up for using the simage library (if wanted, and if # * available). # ******************************************************************* AC_ARG_ENABLE([dl-simage], AC_HELP_STRING([--disable-dl-simage], [disable runtime dynamic linking for libsimage if possible [[default=--enable-dl-simage]]]), [case "${enableval}" in yes | true) enable_dl_simage=true ;; no | false) enable_dl_simage=false ;; *) SIM_AC_ENABLE_ERROR([--enable-dl-simage]) ;; esac], [enable_dl_simage=true]) if $enable_dl_simage && $coin_can_do_runtime_linking; then AC_DEFINE_UNQUOTED([SIMAGE_RUNTIME_LINKING],1, [define for runtime linking with simage]) SIM_AC_CONFIGURATION_SETTING([simage linkage], [run-time binding]) else SIM_AC_HAVE_SIMAGE_IFELSE([ AC_DEFINE([HAVE_LIBSIMAGE],1, [define if you have the simage library]) CPPFLAGS="$CPPFLAGS $sim_ac_simage_cppflags" if $BUILD_WITH_MSVC; then # When building static Coin, we don't want to reference the simage # library on the link line - it should be referenced first when an # application is linked. 20041021 larsa if $COIN_STATIC; then :; else LDFLAGS="$LDFLAGS $sim_ac_simage_ldflags" LIBS="$sim_ac_simage_libs $LIBS" fi else LDFLAGS="$LDFLAGS $sim_ac_simage_ldflags" LIBS="$sim_ac_simage_libs $LIBS" fi COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_simage_cppflags" COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_simage_ldflags" COIN_EXTRA_LIBS="$sim_ac_simage_libs $COIN_EXTRA_LIBS" SIM_AC_CONFIGURATION_SETTING([simage linkage], [link-time binding]) ], [ if $sim_ac_simage_desired; then AC_MSG_WARN(simage development system not found); fi SIM_AC_CONFIGURATION_SETTING([simage linkage], [no simage support]) ]) fi # Check if sound is enabled sim_ac_enable_sound=true AC_ARG_ENABLE( [sound], AC_HELP_STRING([--disable-sound], [disable sound support]), [ case $enableval in no | false) sim_ac_enable_sound=false ;; *) ;; esac]) # Check for openal (required for sound) AC_ARG_ENABLE([dl-openal], AC_HELP_STRING([--disable-dl-openal], [disable runtime dynamic linking for OpenAL if possible [[default=--enable-dl-openal]]]), [case "${enableval}" in yes | true) enable_dl_openal=true ;; no | false) enable_dl_openal=false ;; *) SIM_AC_ENABLE_ERROR([--enable-dl-openal]) ;; esac], [enable_dl_openal=true]) if $sim_ac_enable_sound && $enable_dl_openal && $coin_can_do_runtime_linking; then AC_DEFINE_UNQUOTED([OPENAL_RUNTIME_LINKING],1, [define for runtime linking with OpenAL]) SIM_AC_CONFIGURATION_SETTING([OpenAL support], [Yes, run-time binding]) else SIM_AC_HAVE_OPENAL_IFELSE([ CPPFLAGS="$CPPFLAGS $sim_ac_openal_cppflags" LDFLAGS="$LDFLAGS $sim_ac_openal_ldflags" LIBS="$LIBS $sim_ac_openal_libs" COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_openal_cppflags" COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_openal_ldflags" COIN_EXTRA_LIBS="$COIN_EXTRA_LIBS $sim_ac_openal_libs" AC_DEFINE(HAVE_OPENAL, 1, [openal extensions available]) SIM_AC_CONFIGURATION_SETTING([OpenAL support], [Yes, link-time binding]) ], [ if $sim_ac_enable_sound; then AC_MSG_WARN([openal is needed for sound]) sim_ac_enable_sound=false fi SIM_AC_CONFIGURATION_SETTING([OpenAL support], [No]) ]) fi HAVE_SOUND=1 if $sim_ac_enable_sound ; then AC_DEFINE([HAVE_SOUND],, [for setup.h]) SIM_AC_CONFIGURATION_SETTING([Sound support], [Yes]) else HAVE_SOUND=0 SIM_AC_CONFIGURATION_SETTING([Sound support], [No (enable with --enable-sound)]) fi AC_SUBST(HAVE_SOUND) # ******************************************************************** # * Set us up for using the Fontconfig font library (if wanted, and if # * available). # ******************************************************************** AC_ARG_ENABLE([dl-fontconfig], AC_HELP_STRING([--disable-dl-fontconfig], [disable runtime dynamic linking for fontconfig if possible [[default=--enable-dl-fontconfig]]]), [case "${enableval}" in yes | true) enable_dl_fontconfig=true ;; no | false) enable_dl_fontconfig=false ;; *) SIM_AC_ENABLE_ERROR([--enable-dl-fontconfig]) ;; esac], [enable_dl_fontconfig=true]) sim_ac_have_fontconfig=false if $enable_dl_fontconfig && $coin_can_do_runtime_linking; then AC_DEFINE_UNQUOTED([FONTCONFIG_RUNTIME_LINKING], 1, [define for runtime linking with fontconfig]) SIM_AC_CONFIGURATION_SETTING([Fontconfig support], [Yes, run-time binding]) else SIM_AC_HAVE_FONTCONFIG_IFELSE([ AC_DEFINE(HAVE_FONTCONFIG, 1, [define if you have the fontconfig library]) CPPFLAGS="$CPPFLAGS $sim_ac_fontconfig_cppflags" LDFLAGS="$LDFLAGS $sim_ac_fontconfig_ldflags" LIBS="$sim_ac_fontconfig_libs $LIBS" COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_fontconfig_cppflags" COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_fontconfig_ldflags" COIN_EXTRA_LIBS="$sim_ac_fontconfig_libs $COIN_EXTRA_LIBS" SIM_AC_CONFIGURATION_SETTING([Fontconfig support], [Yes, link-time binding]) ], [ if $sim_ac_fontconfig_desired; then SIM_AC_CONFIGURATION_SETTING([Fontconfig support], [No]) fi ]) fi AM_CONDITIONAL(HAVE_FONTCONFIG, $sim_ac_have_fontconfig) # ******************************************************************** # * Set us up for using the SpiderMonkey javascript library (if wanted, # * and if available). # ******************************************************************** AC_ARG_ENABLE([dl-spidermonkey], AC_HELP_STRING([--disable-dl-spidermonkey], [disable runtime dynamic linking for SpiderMonkey if possible [[default=--enable-dl-spidermonkey]]]), [case "${enableval}" in yes | true) enable_dl_spidermonkey=true ;; no | false) enable_dl_spidermonkey=false ;; *) SIM_AC_ENABLE_ERROR([--enable-dl-spidermonkey]) ;; esac], [enable_dl_spidermonkey=true]) sim_ac_have_spidermonkey=false if $enable_dl_spidermonkey && $coin_can_do_runtime_linking; then AC_DEFINE_UNQUOTED([SPIDERMONKEY_RUNTIME_LINKING], 1, [define for runtime linking with SpiderMonkey]) if $sim_ac_enable_javascript ; then SIM_AC_CONFIGURATION_SETTING([SpiderMonkey support], [Yes, run-time binding]) fi else SIM_AC_HAVE_SPIDERMONKEY_IFELSE([ AC_DEFINE(HAVE_SPIDERMONKEY_VIA_LINKTIME_LINKING, 1, [define if you have the SpiderMonkey library]) CPPFLAGS="$CPPFLAGS $sim_ac_spidermonkey_cppflags" LDFLAGS="$LDFLAGS $sim_ac_spidermonkey_ldflags" LIBS="$sim_ac_spidermonkey_libs $LIBS" COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_spidermonkey_cppflags" COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_spidermonkey_ldflags" COIN_EXTRA_LIBS="$sim_ac_spidermonkey_libs $COIN_EXTRA_LIBS" if $sim_ac_enable_javascript ; then SIM_AC_CONFIGURATION_SETTING([SpiderMonkey support], [Yes, link-time binding]) sim_ac_have_spidermonkey=true fi ], [ if $sim_ac_spidermonkey_desired; then SIM_AC_CONFIGURATION_SETTING([SpiderMonkey support], [No]) fi ]) fi AM_CONDITIONAL(HAVE_SPIDERMONKEY_VIA_LINKTIME_LINKING, $sim_ac_have_spidermonkey) # ************************************************************************** # Set us up for using TrueType fonts. Through the FreeType library (if # wanted, and if available), and / or the Win32 API. if $sim_ac_have_win32_api; then SIM_AC_CONFIGURATION_SETTING([Win32 TrueType fonts], [Yes]) fi AC_ARG_ENABLE([dl-freetype], AC_HELP_STRING([--disable-dl-freetype], [disable runtime dynamic linking for freetype if possible [[default=--enable-dl-freetype]]]), [case "${enableval}" in yes | true) enable_dl_freetype=true ;; no | false) enable_dl_freetype=false ;; *) SIM_AC_ENABLE_ERROR([--enable-dl-freetype]) ;; esac], [enable_dl_freetype=true]) sim_ac_have_freetype=false if $enable_dl_freetype && $coin_can_do_runtime_linking; then AC_DEFINE_UNQUOTED([FREETYPE_RUNTIME_LINKING], 1, [define for runtime linking with freetype]) SIM_AC_CONFIGURATION_SETTING([FreeType library], [Yes, run-time binding]) else SIM_AC_HAVE_FREETYPE_IFELSE([ AC_DEFINE(HAVE_FREETYPE, 1, [define if you have the freetype library]) CPPFLAGS="$CPPFLAGS $sim_ac_freetype_cppflags" LDFLAGS="$LDFLAGS $sim_ac_freetype_ldflags" LIBS="$sim_ac_freetype_libs $LIBS" COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_freetype_cppflags" COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_freetype_ldflags" COIN_EXTRA_LIBS="$sim_ac_freetype_libs $COIN_EXTRA_LIBS" SIM_AC_CONFIGURATION_SETTING([FreeType library], [Yes, link-time binding]) ], [ if $sim_ac_freetype_desired; then SIM_AC_CONFIGURATION_SETTING([FreeType library], [No]) fi ]) fi AM_CONDITIONAL(HAVE_FREETYPE, $sim_ac_have_freetype) # ******************************************************************* # * Mathlib stuff. # ******************************************************************* # Need to check necessity of including "-lm" on the link-line for both # C and C++ compiled code, as it could differ. We've had a gcc/g++ # on AIX problem with missing "-lm" on the final link-line which I # suspect to stem from this. . AC_LANG_PUSH(C) SIM_AC_CHECK_MATHLIB( [COIN_EXTRA_LIBS="$COIN_EXTRA_LIBS $sim_ac_libm"], [SIM_AC_ERROR([no-math-library])]) AC_LANG_POP(C) AC_LANG_PUSH(C++) SIM_AC_MATHLIB_READY_IFELSE([], [ SIM_AC_CHECK_MATHLIB( [COIN_EXTRA_LIBS="$COIN_EXTRA_LIBS $sim_ac_libm"], [SIM_AC_ERROR([no-math-library])])]) AC_LANG_POP(C++) # ******************************************************************* # * Check for ilogb() after mathlib test # ******************************************************************* AC_MSG_CHECKING([for ilogb() function]) AC_TRY_LINK([ #include ], [ (void)ilogb(1.0); ], [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_ILOGB],1, [Define to use ilogb()]) ], [ AC_MSG_RESULT([no]) ]) # ******************************************************************* # * Handle the detection and inclusion of compression libraries # ******************************************************************* AC_ARG_ENABLE([dl-zlib], AC_HELP_STRING([--disable-dl-zlib], [disable runtime dynamic linking for libz if possible [[default=--enable-dl-zlib]]]), [case "${enableval}" in yes | true) enable_dl_zlib=true ;; no | false) enable_dl_zlib=false ;; *) SIM_AC_ENABLE_ERROR([--enable-dl-zlib]) ;; esac], [enable_dl_zlib=true]) if $enable_dl_zlib && $coin_can_do_runtime_linking; then AC_DEFINE_UNQUOTED([ZLIB_RUNTIME_LINKING],1, [define for runtime linking with zlib]) SIM_AC_CONFIGURATION_SETTING([zlib support], [Yes, run-time binding]) else SIM_AC_HAVE_LIBZLIB_IFELSE([ COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_libzlib_cppflags" COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_libzlib_ldflags" COIN_EXTRA_LIBS="$sim_ac_libzlib_libs $COIN_EXTRA_LIBS" CPPFLAGS="$CPPFLAGS $sim_ac_libzlib_cppflags" LDFLAGS="$LDFLAGS $sim_ac_libzlib_ldflags" LIBS="$sim_ac_libzlib_libs $LIBS" SIM_AC_CONFIGURATION_SETTING([zlib support], [Yes, link-time binding]) AC_DEFINE([HAVE_ZLIB], 1, [Define to use zlib]) ],[ SIM_AC_CONFIGURATION_SETTING([zlib support], [No]) ]) fi # Bug in gzdopen() on Mac OS X -> use gzopen() instead... case $host_os in darwin* ) ;; * ) AC_DEFINE([HAVE_GZDOPEN], 1, [Define to use gzdopen()]) esac # ******************************************************************* AC_ARG_ENABLE([dl-libbzip2], AC_HELP_STRING([--disable-dl-libbzip2], [disable runtime dynamic linking for libz if possible [[default=--enable-dl-libbzip2]]]), [case "${enableval}" in yes | true) enable_dl_libbzip2=true ;; no | false) enable_dl_libbzip2=false ;; *) SIM_AC_ENABLE_ERROR([--enable-dl-libbzip2]) ;; esac], [enable_dl_libbzip2=true]) if $enable_dl_libbzip2 && $coin_can_do_runtime_linking; then AC_DEFINE_UNQUOTED([LIBBZIP2_RUNTIME_LINKING],1, [define for runtime linking with zlib]) SIM_AC_CONFIGURATION_SETTING([bzip2 support], [Yes, run-time binding]) else SIM_AC_HAVE_LIBBZIP2_IFELSE([ COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_libbzip2_cppflags" COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_libbzip2_ldflags" COIN_EXTRA_LIBS="$sim_ac_libbzip2_libs $COIN_EXTRA_LIBS" CPPFLAGS="$CPPFLAGS $sim_ac_libbzip2_cppflags" LDFLAGS="$LDFLAGS $sim_ac_libbzip2_ldflags" LIBS="$sim_ac_libbzip2_libs $LIBS" SIM_AC_CONFIGURATION_SETTING([bzip2 support], [Yes, link-time binding]) AC_DEFINE([HAVE_BZIP2], 1, [Define to use bzip2]) ],[ SIM_AC_CONFIGURATION_SETTING([bzip2 support], [No]) ]) fi # ******************************************************************* # * Handle the detection and inclusion of X11 libraries. # ******************************************************************* SIM_AC_CHECK_X11([ COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_x11_cppflags" COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_x11_ldflags" COIN_EXTRA_LIBS="$sim_ac_x11_libs $COIN_EXTRA_LIBS"]) if test x"$sim_ac_x11_avail" = xyes; then # If the X11 shared memory extension is available, include it as # the Mesa library has probably been linked against it. SIM_AC_CHECK_X11SHMEM( COIN_EXTRA_LIBS="$sim_ac_x11shmem_libs $COIN_EXTRA_LIBS" ) fi ## We need this extra, final X11 check to set up the HAVE_X11_AVAILABLE ## define -- the X_DISPLAY_MISSING define provided by the built-in ## Autoconf X11 check is not strict enough. SIM_AC_CHECK_X11_READY([AC_DEFINE([HAVE_X11_AVAILABLE],1, [define if it is possible to build against X11])]) # ******************************************************************* # * Test for installation of Mesa or OpenGL development system. # ******************************************************************* SIM_AC_CHECK_OPENGL( [ AC_DEFINE([HAVE_OPENGL],1, [define if you have OpenGL]) COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_ogl_cppflags" COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_ogl_ldflags" COIN_EXTRA_LIBS="$sim_ac_ogl_libs $COIN_EXTRA_LIBS" SIM_AC_CHECK_HEADER_GLEXT([ CPPFLAGS="$CPPFLAGS $sim_ac_glext_cppflags" COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_glext_cppflags" ]) # ******************************************************************* # Check what OpenGL->windowsystem bindings are available. # # If WGL is available, we don't want AGL nor GLX, as that has the # potential to cause harm: e.g. while we at one place in the code # might use WGL to create a context, other places we might use GLX to # make that same context current -- *kaboom*. # # (It is at least possible that both AGL and GLX are available at the # same time, or WGL and GLX, since X11 is a portable window system.) # # On Mac OS X/Darwin, we want to link either with GLX or AGL, # depending on whether Coin is built against X11 or not. (X11 is # only needed if you want to use SoXt, and must be enabled explicitly # by passing the --enable-darwin-x11 configure flag.) # # Else, the tests for WGL/GLX below are nested, so we're guaranteed # that only one of HAVE_WGL and HAVE_GLX will be set: case $host_os in darwin* ) if test x"$sim_ac_x11_avail" = xyes; then SIM_AC_HAVE_GLX_IFELSE([ AC_DEFINE([HAVE_GLX], 1, [define if you have GLX X11 OpenGL bindings]) ], [SIM_AC_CONFIGURATION_WARNING([Could not find or compile or link against GLX (OpenGL on X11) but X linkage was specified. The SoOffscreenRenderer functionality will be disabled. ])]) else SIM_AC_HAVE_AGL_IFELSE([ AC_DEFINE([HAVE_AGL], 1, [define if you have AGL OpenGL bindings]) LDFLAGS="$LDFLAGS $sim_ac_agl_ldflags" # indirect linking is not supported in static libs if $COIN_STATIC; then COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_agl_ldflags" fi AC_CHECK_HEADERS( [OpenGL/CGLCurrent.h], [], [AC_MSG_ERROR([AGL is available but CGL is not? Dude. Something went very wrong here. Please get in touch with us at coin-support@sim.no.])], [ ] ) SIM_AC_HAVE_AGL_PBUFFER([ AC_DEFINE_UNQUOTED([HAVE_AGL_PBUFFER],1, [define if AGL pBuffers are available on the system]) ])], [SIM_AC_CONFIGURATION_WARNING([Could not find or compile or link against AGL. The SoOffscreenRenderer functionality will be disabled. ]) ]) fi ;; * ) SIM_AC_HAVE_WGL_IFELSE([ AC_DEFINE([HAVE_WGL], 1, [define if you have WGL Win32 OpenGL bindings]) LIBS="$LIBS $sim_ac_wgl_libs" COIN_EXTRA_LIBS="$COIN_EXTRA_LIBS $sim_ac_wgl_libs" ], [SIM_AC_HAVE_GLX_IFELSE([ AC_DEFINE([HAVE_GLX], 1, [define if you have GLX X11 OpenGL bindings]) ], [ SIM_AC_CONFIGURATION_WARNING([Could not find or compile or link against any usable window-system OpenGL binding, neither GLX (OpenGL on X11), nor WGL (OpenGL on Win32) nor AGL (OpenGL on Mac OS). The SoOffscreenRenderer functionality will be disabled. Note: this might be a configure bug. Check the file config.log.]) ]) ]) ;; esac # ******************************************************************* if $enable_superglu; then SIM_AC_CONFIGURATION_SETTING([GLU linkage], [superglu]) else # ******************************************************************* # ** Check if GLU should be loaded and linked at runtime (to avoid # ** install dependency libCoin -> libGLU). # ******************************************************************* AC_ARG_ENABLE([dl-glu], AC_HELP_STRING([--disable-dl-glu], [disable runtime dynamic linking for GLU if possible [[default=--enable-dl-glu]]]), [case "${enableval}" in yes | true) enable_dl_glu=true ;; no | false) enable_dl_glu=false ;; *) SIM_AC_ENABLE_ERROR([--enable-dl-glu]) ;; esac], [enable_dl_glu=true]) if $coin_can_do_runtime_linking && $enable_dl_glu; then # See if GLU is part of GL library (this is the case on Mac OS X # and BeOS, for instance) before setting us up for runtime # linking. SIM_AC_GLU_READY_IFELSE([ AC_DEFINE([GLU_IS_PART_OF_GL],1, [define if GLU is part of the GL library]) AC_DEFINE_UNQUOTED([GLU_RUNTIME_LINKING],1, [define for runtime linking with GLU]) SIM_AC_CONFIGURATION_SETTING([GLU linkage], [run-time binding, part of GL library]) ], [ AC_DEFINE_UNQUOTED([GLU_RUNTIME_LINKING],1, [define for runtime linking with GLU]) SIM_AC_CONFIGURATION_SETTING([GLU linkage], [run-time binding]) ]) else # ******************************************************************* # ** Check if GLU headers and lib is available on build host. # ******************************************************************* SIM_AC_CHECK_GLU([ AC_DEFINE([HAVE_GLU],1, [define if you have GLU]) COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_glu_cppflags" COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_glu_ldflags" COIN_EXTRA_LIBS="$sim_ac_glu_libs $COIN_EXTRA_LIBS" SIM_AC_CONFIGURATION_SETTING([GLU linkage], [link-time binding]) ], [ SIM_AC_CONFIGURATION_SETTING([GLU linkage], [no GLU support]) ]) fi fi ], # OpenGL-linkage ok, end of block [ # Couldn't link with OpenGL: SIM_AC_ERROR([no-opengl]) # FIXME: should perhaps be able to handle systems where OpenGL is not # available, as it would be handy for making e.g. import/export-only # versions of the library. 20000123 mortene. ] ) # ************************************************************************** # Make name of dynamic GL library available to Coin source code (used in # src/glue/dl.c, at least). # Will set $sim_ac_shlibext. Note: there's a dependency on this later in # the configure script aswell. SIM_AC_DYNLIB_EXT AC_DEFINE_UNQUOTED([DYNAMIC_LIBRARY_EXTENSION], ["$sim_ac_shlibext"], [define this to the dynamic library extension suffix on this system]) AC_SUBST([LIBEXT], [$sim_ac_shlibext]) sim_ac_opengl_dll_name=$sim_ac_ogl_lib if test "$sim_ac_ogl_lib" = "opengl32"; then :; else sim_ac_opengl_dll_name="lib${sim_ac_opengl_dll_name}" fi sim_ac_opengl_dll_name="${sim_ac_opengl_dll_name}${sim_ac_shlibext}" AC_DEFINE_UNQUOTED([OPENGL_SYSTEM_LIBRARY_NAME], ["$sim_ac_opengl_dll_name"], [define this to the dynamic library name of OpenGL]) # ******************************************************************* # * Provide this nasty hack to help building Coin on platforms # * where one can bump into the "Arg list too long" problem # * (IBM AIX, SGI IRIX 6.2 and IRIX 6.5 with standard settings are # * known to fail). # ******************************************************************* AC_ARG_ENABLE(compact, AC_HELP_STRING([--enable-compact], [enable hack for compact compilation [[default=no]]]), [case "${enableval}" in yes | true) enable_compact=yes ;; no | false) enable_compact=no ;; *) SIM_AC_ENABLE_ERROR([--enable-compact]) ;; esac], enable_compact=no) AM_CONDITIONAL(HACKING_COMPACT_BUILD, test x"$enable_compact" = x"yes") # ******************************************************************* # * Enable/disable compilation with the "incremental linking through # * the use of dynamic libraries"-hack. # ******************************************************************* AC_ARG_ENABLE(hacking, AC_HELP_STRING([--enable-hacking], [enable hacks for quick turn-around cycles during development [[default=no]]]), [case "${enableval}" in yes | true) enable_hacking=yes ;; no | false) enable_hacking=no ;; *) SIM_AC_ENABLE_ERROR([--enable-hacking]) ;; esac], enable_hacking=no) AM_CONDITIONAL(HACKING_DYNAMIC_MODULES, test x"$enable_hacking" = x"yes") # enable_hacking requires runtime symbol lookup, which is not available # on Mac OS X < 10.3 and requires the deployment target to be >= 10.3. sim_ac_macosx_use_dynamic_lookup=false if test x"$enable_hacking" = x"yes"; then if test x"$sim_ac_macosx" = x"true"; then if test x"$sim_ac_macosx_10_3ff" = x"true"; then sim_ac_macosx_use_dynamic_lookup=true case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[34]]) ;; *) SIM_AC_CONFIGURATION_WARNING([Using MACOSX_DEPLOYMENT_TARGET=10.3 (required by --enable-hacking)]) ;; esac AC_SUBST([MACOSX_DEPLOYMENT_TARGET], [10.3]) else AC_MSG_ERROR([--enable-hacking requires Mac OS X version >= 10.3]) fi fi for dir in \ base actions bundles caches details draggers elements \ elements/GL:glelements engines errors events fields fonts glue io \ manips misc lists nodekits nodes shapenodes projectors \ sensors upgraders hardcopy collision 3ds:format3ds; \ do case $dir in *:* ) lib=`echo $dir | cut -d: -f2` dir=`echo $dir | cut -d: -f1` ;; * ) lib=$dir ;; esac HACKING_LIBDIRS="$HACKING_LIBDIRS -L${coin_build_dir}/src/$dir/.libs" EXTRA_LIBS="$EXTRA_LIBS -l$lib${SUFFIX}LINKHACK" done if $sim_ac_enable_vrml97; then HACKING_LIBDIRS="$HACKING_LIBDIRS -L${coin_build_dir}/src/vrml97/.libs" EXTRA_LIBS="$EXTRA_LIBS -lvrml97${SUFFIX}LINKHACK" fi if $enable_superglu; then HACKING_LIBDIRS="$HACKING_LIBDIRS -L${coin_build_dir}/src/extensions/superglu/.libs" EXTRA_LIBS="$EXTRA_LIBS -l${SUPERGLUPREFIX}GLU" fi if $sim_ac_enable_threads; then HACKING_LIBDIRS="$HACKING_LIBDIRS -L${coin_build_dir}/src/threads/.libs" EXTRA_LIBS="$EXTRA_LIBS -lthreads${SUFFIX}LINKHACK" fi COIN_HACKING_LIBDIRS="$HACKING_LIBDIRS" COIN_EXTRA_LIBS="$EXTRA_LIBS $COIN_EXTRA_LIBS" fi AC_SUBST(COIN_HACKING_LIBDIRS) # linker flag -undefined dynamic_lookup, needed for --enable-hacking AM_CONDITIONAL([MACOSX_USE_DYNAMIC_LOOKUP], [test x$sim_ac_macosx_use_dynamic_lookup = xtrue]) # ******************************************************************* # * For exposing various build, src and installation paths to # * misc configuration files under the $top_src_dir/build/ directory. # ******************************************************************* AC_SUBST([coin_build_dir]) AC_SUBST([coin_w32_build_dir]) AC_SUBST([coin_src_dir]) AC_SUBST([coin_w32_src_dir]) # ************************************************************************** # Remove redundant options from certain option lists. # FIXME: somehow the sed expressions used in this macro fails on MKS so the # variables end up empty. Figure out why and how to fix it after the other # MKS problems are taken care of. 2003-06-03 larsa # SIM_AC_UNIQIFY_OPTION_LIST(COIN_EXTRA_CPPFLAGS, -I$includedir $COIN_EXTRA_CPPFLAGS) # SIM_AC_UNIQIFY_OPTION_LIST(COIN_EXTRA_LDFLAGS, -L$libdir $COIN_EXTRA_LDFLAGS) # SIM_AC_UNIQIFY_OPTION_LIST(COIN_EXTRA_LIBS, $COIN_EXTRA_LIBS) # SIM_AC_UNIQIFY_OPTION_LIST(CPPFLAGS, $CPPFLAGS) # SIM_AC_UNIQIFY_OPTION_LIST(LDFLAGS, $LDFLAGS) # SIM_AC_UNIQIFY_OPTION_LIST(LIBS, $LIBS) # FIXME: these side-effects of the above macros needs to be included though # as long as the above macros are disabled. 2003-06-03 larsa COIN_EXTRA_CPPFLAGS="-I$includedir -I$includedir/Inventor/annex $COIN_EXTRA_CPPFLAGS" COIN_EXTRA_LDFLAGS="-L$libdir $COIN_EXTRA_LDFLAGS" # ************************************************************************** # Remove gcc system directories includes from the CPPFLAGS. CPP_AC_SEARCH_ORDER_FILTER(CPPFLAGS, $CPPFLAGS) CPP_AC_SEARCH_ORDER_FILTER(COIN_EXTRA_CPPFLAGS, $COIN_EXTRA_CPPFLAGS) AC_SUBST([LIBFLAGS], []) # ************************************************************************** # setup for # include windows.h? if test x"$ac_cv_header_windows_h" = x"yes"; then sim_include_windows_h="#include " else sim_include_windows_h="/* #include - not needed on system */" fi # how to include gl.h if test x"$ac_cv_header_GL_gl_h" = x"yes"; then sim_include_gl_h="#include " else if test x"$ac_cv_header_OpenGL_gl_h" = x"yes"; then sim_include_gl_h="#include " else sim_include_gl_h="#error \"don't know how to include gl.h header\"" fi fi if $enable_superglu; then sim_include_glu_h="/* #include - not used, Coin linked with embedded SuperGLU */" else if test x"$ac_cv_header_GL_glu_h" = x"yes"; then sim_include_glu_h="#include " else if test x"$ac_cv_header_OpenGL_glu_h" = x"yes"; then sim_include_glu_h="#include " else sim_include_glu_h="/* #include - not found on system */" fi fi fi if test x"$ac_cv_header_GL_glext_h" = x"yes"; then sim_include_glext_h="#include " else if test x"$ac_cv_header_OpenGL_glext_h" = x"yes"; then sim_include_glext_h="#include " else sim_include_glext_h="/* #include - not found on system */" fi fi AC_SUBST([SIM_INCLUDE_WINDOWS_H], [$sim_include_windows_h]) AC_SUBST([SIM_INCLUDE_GL_H], [$sim_include_gl_h]) AC_SUBST([SIM_INCLUDE_GLU_H], [$sim_include_glu_h]) AC_SUBST([SIM_INCLUDE_GLEXT_H], [$sim_include_glext_h]) # ************************************************************************** # append compiler flags detected earlier, now that all configure tests # are done... CFLAGS="$CFLAGS $sim_ac_compiler_CFLAGS" CXXFLAGS="$CXXFLAGS $sim_ac_compiler_CXXFLAGS" # ************************************************************************** # Remaining setup based on platform. AM_CONDITIONAL(BUILD_WITH_MSVC, $BUILD_WITH_MSVC) COIN_COMPILER="$CXX" if $BUILD_WITH_MSVC; then rm -f vc60.pdb LIBFLAGS="$LIBFLAGS $sim_ac_msvcrt_LIBLDFLAGS" LIBS="$LIBS $sim_ac_msvcrt_LIBLIBS" if $COIN_STATIC; then COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS -DCOIN_NOT_DLL" COIN_EXTRA_LIBS="$COIN_EXTRA_LIBS $LIBS" LIBS="" else CPPFLAGS="-DCOIN_MAKE_DLL $CPPFLAGS" COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS -DCOIN_DLL" fi debugfile="`pwd`/src/coin${COIN_MAJOR_VERSION}${SUFFIX}.pdb" debugfile=`cygpath -w "$debugfile" | sed 's,\\\\,\\\\\\\\,g'` if $COIN_STATIC; then LIBFLAGS="-LIB $LIBFLAGS" LIBFLAGS="$LIBFLAGS /OUT:coin$COIN_MAJOR_VERSION$SUFFIX.lib" case $enable_symbols in no | false) SIM_AC_CONFIGURATION_SETTING([Coin build type], [static .lib, no symbols]) ;; *) SIM_AC_CONFIGURATION_SETTING([Coin build type], [static .lib, with symbols]) CFLAGS="-g /Yd /Z7 $CFLAGS" CXXFLAGS="-g /Yd /Z7 $CXXFLAGS" ;; esac else LIBFLAGS="-DLL /INCREMENTAL:NO $LIBFLAGS" case $enable_symbols in no | false) SIM_AC_CONFIGURATION_SETTING([Coin build type], [dynamic .dll, no symbols]) LIBFLAGS="$LIBFLAGS /RELEASE" ;; *) SIM_AC_CONFIGURATION_SETTING([Coin build type], [dynamic .dll + .pdb]) CFLAGS="-g /Yd /Z7 $CFLAGS" CXXFLAGS="-g /Yd /Z7 $CXXFLAGS" LIBFLAGS="$LIBFLAGS /DEBUG /PDB:coin$COIN_MAJOR_VERSION$SUFFIX.pdb" ;; esac LIBFLAGS="$LIBFLAGS /OUT:coin$COIN_MAJOR_VERSION$SUFFIX.dll" fi SIM_AC_CONFIGURATION_SETTING([C library version], [$sim_ac_msvcrt]) # We use a version suffix on the .dll-file, so several incompatible # (major) versions can be installed on a system. # # BTW, when linking DLLs, the 3rd-party .lib files will be # linked into the .dll file. I believe it is still advisable to # list all libs used upon `coin-config --libs`, as we can then # also use them from "parent" code (remember that their interfaces # is not exposed from the DLL) without any fuss. sim_ac_coin_noextname="coin${COIN_MAJOR_VERSION}${SUFFIX}" if test -n "$COIN_EXTRA_LIBS"; then COIN_EXTRA_LIBS="-l${sim_ac_coin_noextname} $COIN_EXTRA_LIBS" else COIN_EXTRA_LIBS="-l${sim_ac_coin_noextname}" fi sim_ac_coin_dll_name="${sim_ac_coin_noextname}${sim_ac_shlibext}" else COIN_EXTRA_LIBS="-lCoin${SUFFIX} $COIN_EXTRA_LIBS" sim_ac_coin_dll_name="libCoin${SUFFIX}${sim_ac_shlibext}" case $build in *-mks ) # MKS builds uses the MSVC compiler too, but with different command line # options - the __declspectacle needs to be handled here too... COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS -DCOIN_NOT_DLL" ;; esac fi AC_DEFINE_UNQUOTED([COIN_SYSTEM_LIBRARY_NAME], ["$sim_ac_coin_dll_name"], [define this to the dynamic library name of Coin]) if $BUILD_WITH_MSVC; then # we'll use the installed wrapper when we use the coin-config script later # so we can remove the source code hierarchy COIN_COMPILER="wrapmsvc" fi sim_ac_path_problem=false # This block expands exec_prefix to it's final value, which we don't want to # happen - the coin-*.cfg files uses that value, and needs it to be relative # to ${prefix} - so it has been disabled until I've added save/restore of the # prefix/exec-prefix/bindir variables. 20030314 larsa # sim_ac_path_problem=true # until proven otherwise # eval "prefix=${prefix}" # if test x"$prefix" = x"NONE"; then prefix=/usr/local; fi # eval "exec_prefix=${exec_prefix}" # if test x"$exec_prefix" = x"NONE"; then exec_prefix="$prefix"; fi # eval "bindir=${bindir}" # if test -d "${bindir}"; then # # search by inode id seems safer than strings because of noncanonical paths # ( eval set dummy `ls -id "${bindir}" 2>/dev/null`; # findinode=$2; # IFS=:; for dir in $PATH; do # # inode=`ls -id "$dir" 2>/dev/null | sed 's/^\([ ]*\)\([0-9]*\).*/\2/g'`; # eval set dummy `ls -id "$dir" 2>/dev/null`; # inode=$2; # test x"$inode" = x"$findinode" && exit 0; # done; exit 1 ) && sim_ac_path_problem=false # fi # if $sim_ac_path_problem; then # ( IFS=:; for dir in $PATH; do # test x"$dir" = x"${bindir}" && exit 0; # done; exit 1 ) && sim_ac_path_problem=false # fi # *********************************************************** # Mac OS X tweaks # # Disallow static libraries in framework (doesn't make sense) if $sim_ac_framework; then if test x$enable_static = xyes; then AC_MSG_ERROR([Creation of static libraries requested, but this is incompatible with the Mac OS X framework setup. Use --without-framework to do UNIX-style build.]) fi fi if $sim_ac_framework; then SIM_AC_CONFIGURATION_SETTING([Coin build type], [Mac OS X framework]) elif $sim_ac_path_problem; then SIM_AC_CONFIGURATION_WARNING([Your \$PATH variable does not appear to include \"$prefix/bin\"]) fi if $sim_ac_framework; then # set up the Coin-related flags COIN_EXTRA_CPPFLAGS= COIN_EXTRA_CFLAGS= COIN_EXTRA_CXXFLAGS= if test x"$enable_hacking" = x"yes"; then COIN_EXTRA_LDFLAGS="-L$frameworkdir/Libraries" else # we don't want -lCoin when doing framework build COIN_EXTRA_LIBS= COIN_EXTRA_LDFLAGS= fi COIN_EXTRA_LDFLAGS="-Wl,-framework,$MAC_FRAMEWORK_NAME $COIN_EXTRA_LDFLAGS" # adjust for OpenGL usage COIN_EXTRA_CPPFLAGS="$COIN_EXTRA_CPPFLAGS $sim_ac_ogl_cppflags" COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_ogl_ldflags" COIN_EXTRA_LIBS="$sim_ac_ogl_libs $COIN_EXTRA_LIBS" # adjust for simage usage COIN_EXTRA_LDFLAGS="$COIN_EXTRA_LDFLAGS $sim_ac_simage_ldflags" COIN_EXTRA_LIBS="$sim_ac_simage_libs $COIN_EXTRA_LIBS" # adjust for OpenAL usage COIN_EXTRA_LIBS="$COIN_EXTRA_LIBS $sim_ac_openal_libs" fi case "$sim_ac_framework:$sim_ac_make_dsp" in true:* | *:true ) ;; * ) SIM_AC_CONFIGURATION_SETTING([Installation prefix], [$prefix]) ;; esac AC_SUBST([COIN_COMPILER]) AC_SUBST([ac_compiler_gnu]) # ************************************************************************** # Microsoft Developer Studio Project files SIM_AC_MSVC_DSP_SETUP([COIN], [Coin], [coin], [-I$coin_build_dir -I$coin_build_dir/include -I$coin_src_dir/include -I$coin_src_dir/include/Inventor/annex]) # ************************************************************************** AM_CONFIG_HEADER([include/discard.h include/config.h include/setup.h]) # sim_ac_tmpfile=/tmp/Coin-2-config-h.$$ # # sed -e '/^\/\* for setup.h \*\//, /^$/ d' \ # <$srcdir/include/discard.h.in \ # >$sim_ac_tmpfile # # if cmp -s $sim_ac_tmpfile $srcdir/include/config.h.in; then # : # else # rm $sim_ac_tmpfile # AC_ERROR([config.h.in is out of sync - maintainer must update]) # fi # # rm $sim_ac_tmpfile # ************************************************************************** AC_CONFIG_FILES([ Makefile bin/Makefile include/Makefile include/Inventor/Makefile include/Inventor/C/Makefile include/Inventor/C/base/Makefile include/Inventor/C/errors/Makefile include/Inventor/C/glue/Makefile include/Inventor/C/threads/Makefile include/Inventor/VRMLnodes/Makefile include/Inventor/actions/Makefile include/Inventor/annex/Makefile include/Inventor/annex/HardCopy/Makefile include/Inventor/bundles/Makefile include/Inventor/caches/Makefile include/Inventor/collision/Makefile include/Inventor/details/Makefile include/Inventor/draggers/Makefile include/Inventor/elements/Makefile include/Inventor/engines/Makefile include/Inventor/errors/Makefile include/Inventor/events/Makefile include/Inventor/fields/Makefile include/Inventor/lists/Makefile include/Inventor/lock/Makefile include/Inventor/manips/Makefile include/Inventor/misc/Makefile include/Inventor/nodekits/Makefile include/Inventor/nodes/Makefile include/Inventor/projectors/Makefile include/Inventor/sensors/Makefile include/Inventor/system/Makefile include/Inventor/threads/Makefile data/Makefile data/draggerDefaults/Makefile man/Makefile man/man1/Makefile man/man3/Makefile html/Makefile htmlhelp/Makefile src/Makefile src/base/Makefile src/actions/Makefile src/bundles/Makefile src/caches/Makefile src/collision/Makefile src/details/Makefile src/draggers/Makefile src/elements/Makefile src/elements/GL/Makefile src/engines/Makefile src/errors/Makefile src/events/Makefile src/fields/Makefile src/fonts/Makefile src/glue/Makefile src/io/Makefile src/manips/Makefile src/misc/Makefile src/lists/Makefile src/nodekits/Makefile src/nodes/Makefile src/projectors/Makefile src/sensors/Makefile src/upgraders/Makefile src/shapenodes/Makefile src/threads/Makefile src/extensions/Makefile src/vrml97/Makefile src/3ds/Makefile src/hardcopy/Makefile tools/Makefile java/Makefile cfg/gendsp.sh cfg/gendsp.pl ]) # MKS will have "\c" as $ECHO_C, but that string in the config.status # substitution command will cause config.status to hang because it is # somehow translated to "&c". We therefore blank it here, and restore # it further below, after AC_OUTPUT. sim_ac_ECHO_C=$ECHO_C case $build in *-mks ) ECHO_C="" ;; esac AC_OUTPUT # Putting this in AC_CONFIG_FILES arg 2 will make it executed after *each* # file that is generated, which is a waste and slows stuff down on cygwin. if test -f cfg/gendsp.sh; then chmod +x cfg/gendsp.sh fi if test -f cfg/gendsp.pl; then chmod +x cfg/gendsp.pl fi # test for older checkouts if test -d $srcdir/src/share; then :; else AC_MSG_ERROR([Detected old CVS checkout of Coin-2, exiting. To fix, do a 'cvs co coinsharegl' from the Coin-2 root directory, then 'cvs update -d', and re-run configure.]) fi # in case someone has the old generated SbBasic.h lying about... if test -f include/Inventor/SbBasic.h; then if cmp -s $srcdir/include/Inventor/SbBasic.h include/Inventor/SbBasic.h; then : else rm include/Inventor/SbBasic.h fi fi ECHO_C=$sim_ac_ECHO_C # ******************************************************************* # * Platform-specific stuff. # ******************************************************************* if $sim_ac_build_library; then ac_coin_untested_platform=true ac_coin_not_sim_platform=true else ac_coin_untested_platform=false ac_coin_not_sim_platform=false fi case "$host_os" in irix6.2) case $CXX in CC | */CC ) ac_coin_untested_platform=false ;; esac ;; irix6.5) case $CXX in CC | */CC ) ac_coin_untested_platform=false ac_coin_not_sim_platform=false ;; esac ;; aix*) case $CXX in xlC | */xlC ) ac_coin_untested_platform=false ;; esac ;; solaris*) case $CXX in g++ ) ac_coin_untested_platform=false ;; CC ) ac_coin_untested_platform=false ;; esac ;; hpux10.20) case $CXX in aCC | */aCC ) ac_coin_untested_platform=false ;; esac ;; linux-gnu) case "$host_cpu" in i?86) ac_coin_untested_platform=false ac_coin_not_sim_platform=false ;; x86_64) ac_coin_untested_platform=false ac_coin_not_sim_platform=false ;; ia64) case "$CXX" in g++) ac_coin_untested_platform=false ;; esac ;; esac ;; cygwin*) case "$CXX" in *wrapmsvc* ) ac_coin_untested_platform=false ac_coin_not_sim_platform=false ;; esac ;; darwin*) case "$CXX" in c++ | g++) ac_coin_untested_platform=false ac_coin_not_sim_platform=false ;; esac ;; beos) case "$host_cpu" in i?86) if test "$CXX" = c++; then ac_coin_untested_platform=false; fi ;; esac ;; esac case "$CXX" in *gendsp* ) ac_coin_untested_platform=false ac_coin_not_sim_platform=false ;; esac if $ac_coin_untested_platform; then echo echo "************************* WARNING ****************************" echo "*" echo "* We have not tested Coin on the $host_os $host_cpu" echo "* platform with the $CXX C++ compiler. Please report" echo "* back to us at how it works out." echo "*" echo "**************************************************************" echo else if $ac_coin_not_sim_platform; then echo echo "NOTE: This platform ($host_os $host_cpu with the $CXX C++ compiler)" echo " is not among our internal development systems. Please let us" echo " know at if you run into any problems." echo fi fi if $sim_ac_build_library; then case "$host_os" in irix*) echo "" echo " Detected SGI IRIX. There are some hints regarding this platform" echo " in the file " echo "" echo " ${srcdir}/README.IRIX" echo "" echo " Please take a look if this is your first time building on IRIX." echo "" ;; aix*) echo "" echo " Detected IBM AIX. There are some hints regarding this platform" echo " in the file " echo "" echo " ${srcdir}/README.AIX" echo "" echo " Please take a look if this is your first time building on AIX." echo "" ;; esac fi SIM_AC_CONFIGURATION_SUMMARY echo ""