#---------------------------------------------------------------------------- # Copyright (C)2003-2005 by Atomic Blue. # # Script taken from the Crystal Space SDK project. # # Autoconf input script for Planeshift. Start the ./autogen.sh script which # calls autoconf to produce a configure script. #---------------------------------------------------------------------------- AC_PREREQ([2.56]) #---------------------------------------------------------------------------- # Initialize autoconf #---------------------------------------------------------------------------- AC_INIT([PlaneShift], [0.3.017], [planeshift-develop@lists.sourceforge.net]) CS_PACKAGEINFO([PlaneShift a 3d MMORPG], [Copyright (c)2005 by Atomic Blue], [http://www.planeshift.it]) AC_CONFIG_SRCDIR([mk/jam/build.jam]) AC_CONFIG_AUX_DIR([mk/autoconf]) AC_CANONICAL_HOST AC_PREFIX_DEFAULT(/usr/local/planeshift) #---------------------------------------------------------------------------- # Setup for the configuration header #---------------------------------------------------------------------------- AC_CONFIG_HEADERS(include/psconfig.h:include/psconfig.h.in) #AC_CONFIG_HEADERS(include/config.h:include/psconfig.h.in) AH_TOP([ #ifdef __CONFIG_H__ # error PLEASE include this file only once in each .cpp file! (not in .h) #endif #define __CONFIG_H__ /* we'll use CS everywhere... and that too has it's config.h like type... we * just include it here */ #include ]) #---------------------------------------------------------------------------- # Check for applications #---------------------------------------------------------------------------- CS_PROG_CC CS_PROG_CXX CS_PROG_LINK CS_CHECK_COMMON_TOOLS_LINK CS_CHECK_COMMON_TOOLS_BASIC #---------------------------------------------------------------------------- # Determine system type #---------------------------------------------------------------------------- CS_CHECK_HOST AS_IF([test "$cs_host_family" = "windows"], [AC_DEFINE([USE_WINSOCK],, [Define when using winsock]) CS_JAMCONFIG_PROPERTY([COMPILER.LFLAGS], [-lwsock32], [+])], [AC_DEFINE([USE_UNISOCK],, [Define when using normal sockets])]) #---------------------------------------------------------------------------- # Check for syntax problems / header files #---------------------------------------------------------------------------- TYPE_SOCKLEN_T AC_NEED_STDINT_H(include/psstdint.h) #------------------------------------------------------------------------------ # Check for sizeof(long) to determine whether the platform is 32 or 64 bit. #------------------------------------------------------------------------------ AC_DEFUN([CS_CHECK_LONG_BITS], [AC_CHECK_SIZEOF([long]) AS_IF([test $ac_cv_sizeof_long = 8], [cs_long_bits=64], [cs_long_bits=32])]) CS_CHECK_LONG_BITS CS_HEADER_PROPERTY([CS_PROCESSOR_SIZE], [$cs_long_bits]) CS_EMIT_BUILD_PROPERTY([TARGET.PROCESSORSIZE], [$cs_long_bits]) CS_HEADER_PROPERTY([CS_LONG_SIZE], [$ac_cv_sizeof_long]) #------------------------------------------------------------------------------ # Check how to enable and disable compilation warnings. These are only enabled # in debug. # We enable warnings in optimize mode as well, which can be found in Jamrules. #------------------------------------------------------------------------------ CS_COMPILER_WARNINGS([C++], [cs_cv_prog_cxx_enable_warnings], [CS_EMIT_BUILD_PROPERTY([COMPILER.CFLAGS.debug], [$cs_cv_prog_cxx_enable_warnings], [+])]) #------------------------------------------------------------------------------ # Check for compiler- and CPU-specific code generation flags. These flags are # mutually exclusive. Exclusivity is enforced by the CS_CHECK_CODE_GEN_FLAG() # macro. Note that use of these flags typically means that the resulting # binary will not be backward compatible. For instance, if Pentium-specific # instructions are used, the program will not work with earlier processors, # such as the Intel 486. Because these options are potentially dangerous, # their use it controlled by the user via --enable-cpu-specific-optimizations # which accepts "no" (same as "disable"), "minimum" (the default), and # "maximum". The "minimum" option selects optimizations which are likely to be # supported by reasonably modern hardware, thus making the resulting # executables fairly portable. # # CS_CHECK_CODE_GEN_FLAG(CPU-PATTERN, FLAGS, [LANGUAGE]) # If compiler- and CPU-specific optimization flags have not already been # determined, and if the canonical host CPU matches CPU-PATTERN, try # using the provided compiler FLAGS with the compiler represented by # LANGUAGE (typically either "C" or "C++"). If language is omitted, C++ # is used. If the compiler accepts the flags, assign them to the shell # variable cs_cv_prog_cxx_code_gen. #------------------------------------------------------------------------------ AC_DEFUN([CS_CHECK_CODE_GEN_FLAG], [AC_REQUIRE([AC_CANONICAL_HOST]) AS_IF([test "$cs_cv_prog_cxx_code_gen" = no], [case $host_cpu in $1) CS_BUILD_IFELSE([], [CS_CREATE_TUPLE([$2])], m4_default([$3],[C++]), [cs_cv_prog_cxx_code_gen=$cs_build_cflags], []) ;; esac])]) AC_MSG_CHECKING([whether to use CPU-specific optimizations]) AC_ARG_ENABLE([cpu-specific-optimizations], [AC_HELP_STRING([--enable-cpu-specific-optimizations=level], [enable CPU-specific optimizations; recognized levels are `no', `minimum' or `min', `maximum' or `max' (default MINIMUM); the `minimum' option selects optimizations which are likely to be supported by reasonably modern hardware, thus making the resulting executables fairly portable; use the `maximum' option with caution since code for one processor will not work with earlier processors (for example, Intel 686-specific code will not work with a 586)])], [case $enable_cpu_specific_optimizations in yes|min) enable_cpu_specific_optimizations=minimum ;; max) enable_cpu_specific_optimizations=maximum ;; esac], [enable_cpu_specific_optimizations=minimum]) AC_MSG_RESULT([$enable_cpu_specific_optimizations]) case $enable_cpu_specific_optimizations in no|minimum|maximum) ;; *) CS_MSG_ERROR([unrecognized option; use `no', `minimum', or `maximum']) ;; esac AS_IF([test $enable_cpu_specific_optimizations != no], [AC_CACHE_CHECK([for code generation flags], [cs_cv_prog_cxx_code_gen], [cs_cv_prog_cxx_code_gen=no AS_IF([test $enable_cpu_specific_optimizations = maximum], [CS_CHECK_CODE_GEN_FLAG([athlon], [-march=athlon]) CS_CHECK_CODE_GEN_FLAG([athlon], [-mcpu=athlon -march=athlon]) CS_CHECK_CODE_GEN_FLAG([athlon], [-mcpu=athlon]) CS_CHECK_CODE_GEN_FLAG([*686], [-march=i686]) CS_CHECK_CODE_GEN_FLAG([*686], [-mcpu=pentiumpro -march=i686]) CS_CHECK_CODE_GEN_FLAG([*686], [-mcpu=pentiumpro]) CS_CHECK_CODE_GEN_FLAG([*686], [-mpentiumpro -march=i686]) CS_CHECK_CODE_GEN_FLAG([*686], [-mpentiumpro])]) AS_IF([test $host_vendor = apple], [# Work around issue on intel macs, where "-fpmath=sse" is on by # default, but this breaks compilation when combined with # the "-march=i586" selected below. So the "minimum" optimization # on x86 Apples is -march=i686. CS_CHECK_CODE_GEN_FLAG([*[3-9]86], [-march=i686])]) CS_CHECK_CODE_GEN_FLAG([x86_64], [-march=k8]) CS_CHECK_CODE_GEN_FLAG([x86_64], [-mtune=k8]) CS_CHECK_CODE_GEN_FLAG([[*[5-6]86]], [-march=i586]) CS_CHECK_CODE_GEN_FLAG([[*[5-6]86]], [-mcpu=pentium -march=i586]) CS_CHECK_CODE_GEN_FLAG([[*[5-6]86]], [-mcpu=pentium]) CS_CHECK_CODE_GEN_FLAG([[*[5-6]86]], [-mpentium -march=i586]) CS_CHECK_CODE_GEN_FLAG([[*[5-6]86]], [-mpentium]) CS_CHECK_CODE_GEN_FLAG([[*[3-9]86]], [-march=i486]) CS_CHECK_CODE_GEN_FLAG([[*[3-9]86]], [-mcpu=i486 -march=i486]) CS_CHECK_CODE_GEN_FLAG([[*[3-9]86]], [-mcpu=i486]) CS_CHECK_CODE_GEN_FLAG([[*[3-9]86]], [-m486]) CS_CHECK_CODE_GEN_FLAG([alpha], [-mieee])]) AS_IF([test "$cs_cv_prog_cxx_code_gen" != no], [CS_EMIT_BUILD_PROPERTY( [COMPILER.CFLAGS], [$cs_cv_prog_cxx_code_gen], [+])])]) #------------------------------------------------------------------------------ # Check for compiler debug flags. #------------------------------------------------------------------------------ binutils_recent=no AS_IF([test -n "$OBJCOPY"], [CS_CHECK_PROG_VERSION([binutils], [$OBJCOPY -V], [2.16.0], [9.9.9|.9.9], [binutils_recent=yes])]) AC_ARG_WITH([separate-debug-info], [AC_HELP_STRING([--with-separate-debug-info], [split debug information into separate files. (default YES if binutils >= 2.16 detected, otherwise default NO)])]) AS_IF([test -z "$with_separate_debug_info"], [with_separate_debug_info=$binutils_recent]) CS_EMIT_BUILD_PROPERTY([LINK.DEBUG.INFO.SEPARATE], [$with_separate_debug_info]) CS_EMIT_BUILD_FLAGS([how to enable debug mode debugging symbols], [cs_cv_prog_cxx_debug_symbols_extra], [CS_CREATE_TUPLE([-g3]) CS_CREATE_TUPLE([-g2]) CS_CREATE_TUPLE([-g])], [C++], [COMPILER.CFLAGS.debug], [+], [CS_EMIT_BUILD_PROPERTY([COMPILER.LFLAGS.debug], [$cs_cv_prog_cxx_debug_symbols_extra], [+])]) AC_ARG_WITH([optimize-debug-info], [AC_HELP_STRING([--with-optimize-debug-info], [whether to enable debug information even in optimize builds. (default YES if separate debug information is enabled, otherwise default NO)])]) AS_IF([test -z "$with_optimize_debug_info"], [with_optimize_debug_info=$with_separate_debug_info]) AS_IF([test "$with_optimize_debug_info" != no], [CS_EMIT_BUILD_FLAGS([how to enable optimize mode debugging symbols], [cs_cv_prog_cxx_debug_symbols_normal], [CS_CREATE_TUPLE([-g2]) CS_CREATE_TUPLE([-g])], [C++], [COMPILER.CFLAGS.optimize], [+], [CS_EMIT_BUILD_PROPERTY([COMPILER.LFLAGS.optimize], [$cs_cv_prog_cxx_debug_symbols_normal], [+])])]) #------------------------------------------------------------------------------ # Check for compiler optimization flags. #------------------------------------------------------------------------------ AC_DEFUN([CS_CHECK_OPTIMIZE_FLAGS], [AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CXX]) cs_optimize_flags='' CS_EMIT_BUILD_FLAGS([how to enable optimizations], [cs_cv_prog_cxx_optimize], [CS_CREATE_TUPLE([-O3]) CS_CREATE_TUPLE([-O2]) CS_CREATE_TUPLE([-Os]) CS_CREATE_TUPLE([-O])], [C++], [COMPILER.CFLAGS.optimize], [+], [cs_optimize_flags="$cs_optimize_flags $cs_cv_prog_cxx_optimize"]) CS_EMIT_BUILD_FLAGS([if -fomit-frame-pointer is accepted], [cs_cv_prog_cxx_omit_frame_pointer], [CS_CREATE_TUPLE([-fomit-frame-pointer])], [C++], [COMPILER.CFLAGS.optimize], [+], [cs_optimize_flags="$cs_optimize_flags \ $cs_cv_prog_cxx_omit_frame_pointer"]) CS_EMIT_BUILD_FLAGS([if -ffast-math is accepted], [cs_cv_prog_cxx_fast_math], [CS_CREATE_TUPLE([-ffast-math])], [C++], [COMPILER.CFLAGS.optimize], [+], [cs_optimize_flags="$cs_optimize_flags $cs_cv_prog_cxx_fast_math"])]) CS_CHECK_OPTIMIZE_FLAGS #------------------------------------------------------------------------------ # Check if "hidden" visibilty for inline functions is supported. # # IMPLEMENTATION NOTES # # There is an obscure bug in gcc 3.4.x and 4.0.x where # -fvisibility-inlines-hidden on AMD64 in combination with -fPIC and -shared # flags causes the linker to fail with a bogus error stating that the target # library needs to be built with -fPIC even when it has been built using that # option. On such installations, if Crystal Space is built with # -fvisibility-inlines-hidden, then clients liking against Crystal Space # experience this bogus error. Normally, we would test for this anomaly by # manipulating a std::basic_string<> in a test program, and avoid # -fvisibility-inlines-hidden if the test program fails to link, however, # practical experience has shown that this test is not 100% reliable for all # such installations. Instead, for simplicity, we disable this flag presently # for all versions of gcc on AMD64. References: # # http://dev.gentoo.org/~kugelfang/pappy-visibility.txt # http://www.gnu.org/software/gcc/gcc-4.0/changes.html#visibility # http://www.nedprod.com/programs/gccvisibility.html # http://bugs.gentoo.org/show_bug.cgi?id=78720 # # Furthermore, there seems to be a bug on MacOS/X with gcc 4.0.x where use of # -fvisibility-inlines-hidden causes link problems with external clients which # do not specify this flag. For this reason, we also disable this flag on # MacOS/X. In particular, clients receive errors of this sort: # # /usr/bin/ld: libcrystalspace.a(scf.o) malformed object, illegal # reference for -dynamic code (reference to a coalesced section # (__TEXT,__textcoal_nt) from section (__TEXT,__text) relocation # entry (1)) #------------------------------------------------------------------------------ CS_CHECK_BUILD_FLAGS([for inline visibility flag], [cs_cv_prog_cxx_visibility_inlines_hidden], [CS_CREATE_TUPLE([-fvisibility-inlines-hidden])],[C++]) AS_IF([test -n "$cs_cv_prog_cxx_visibility_inlines_hidden"], [AC_CACHE_CHECK([if $cs_cv_prog_cxx_visibility_inlines_hidden is buggy], [cs_cv_prog_cxx_visibility_inlines_hidden_buggy], [AS_IF([test $ac_compiler_gnu = yes], [AS_IF([test $host_cpu = x86_64 || test x$cs_host_macosx = xyes], [cs_cv_prog_cxx_visibility_inlines_hidden_buggy=yes], [cs_cv_prog_cxx_visibility_inlines_hidden_buggy=no])], [cs_cv_prog_cxx_visibility_inlines_hidden_buggy=no])])], [cs_cv_prog_cxx_visibility_inlines_hidden_buggy=no]) AS_IF([test $cs_cv_prog_cxx_visibility_inlines_hidden_buggy != yes], [CS_EMIT_BUILD_PROPERTY([COMPILER.C++FLAGS], [$cs_cv_prog_cxx_visibility_inlines_hidden], [+])]) #------------------------------------------------------------------------------ # Check how to set default symbol visibility, and how to override the setting # in code. #------------------------------------------------------------------------------ CS_CHECK_BUILD_FLAGS([for symbol visibility flag], [cs_cv_prog_cxx_visibility_hidden], [CS_CREATE_TUPLE([-fvisibility=hidden])], [C++]) CS_SYMBOL_QUALIFIER([how to declare default visibility], [cs_cv_prog_cxx_declare_visible_def], [__attribute__((visibility("default")))], [], [C++]) AS_IF([test $cs_cv_prog_cxx_declare_visible_def != no && \ test -n "$cs_cv_prog_cxx_visibility_hidden"], [CS_EMIT_BUILD_PROPERTY([COMPILER.C++FLAGS], [$cs_cv_prog_cxx_visibility_hidden], [+]) CS_HEADER_PROPERTY([CS_VISIBILITY_DEFAULT], [$cs_cv_prog_cxx_declare_visible_def])]) #------------------------------------------------------------------------------ # Check for X-Windows. If the X-Windows implementation is XFree86, then also # enable the `VideoMode' extension. #------------------------------------------------------------------------------ AC_DEFUN([CS_X_CHECK_PREPARE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([CS_CHECK_HOST]) # Explicitly disable X checking on Windows to avoid discovering XFree86 in # case Cygwin is installed. Doing so allows us to avoid Mesa's OpenGL # headers during the OpenGL check, and prefer Microsoft's OpenGL headers. # The Mesa OpenGL headers cause link errors because they do not employ # __stdcall. case $host_os in mingw*|cygwin*) with_x=no ;; esac # Explicitly disable X checking on MacOS/X in case the optional XFree86 is # installed since we want to avoid an undesirable dependency upon XFree86 # in the CS executables and plugins. If the user is actually # cross-building for Darwin on MacOS/X, then the --with-x option will # override this test (by setting cs_host_macosx to "no"). AS_IF([test x$cs_host_macosx = xyes], [with_x=no])]) CS_X_CHECK_PREPARE AC_PATH_X AC_PATH_XTRA AS_IF([test "$no_x" != yes], [# We must be especially careful to instruct CS_EMIT_BUILD_PROPERTY() to # emit the following properties even if their values are empty. This is # necessary because of the way that Jam performs "product-wise" variable # expansion. For example, if X is "x" and Y is undefined, Jam will expand # "$(X) $(Y)" to "", whereas every other tool in the world will expand it # to "x ". Since the emitted X11.CFLAGS, X11.LFLAGS, XFREE86VM.CFLAGS, and # XFREE86VM.LFLAGS properties reference the other variables by name, we # must ensure that those other variables are defined (even if only with an # empty string). CS_EMIT_BUILD_PROPERTY([X11.AVAILABLE], [yes]) CS_EMIT_BUILD_PROPERTY([X_CFLAGS], [$X_CFLAGS], [], [Y]) CS_EMIT_BUILD_PROPERTY([X_LIBS], [$X_LIBS], [], [Y]) CS_EMIT_BUILD_PROPERTY([X_PRE_LIBS], [$X_PRE_LIBS], [], [Y]) CS_EMIT_BUILD_PROPERTY([X_EXTRA_LIBS], [$X_EXTRA_LIBS], [], [Y]) CS_EMIT_BUILD_PROPERTY([X11.CFLAGS], [AS_ESCAPE([$(X_CFLAGS)])]) CS_EMIT_BUILD_PROPERTY([X11.LFLAGS], [AS_ESCAPE([$(X_PRE_LIBS) $(X_LIBS) -lXext -lX11 $(X_EXTRA_LIBS)])]) CS_CHECK_LIB_WITH([Xxf86vm], [AC_LANG_PROGRAM( [[#define XK_MISCELLANY 1 #include #include #include #include ]], [XF86VidModeLockModeSwitch(0, 0, 0)])], [], [], [CS_EMIT_BUILD_PROPERTY([XFREE86VM.AVAILABLE], [yes]) CS_EMIT_BUILD_PROPERTY([XFREE86VM.CFLAGS], [AS_ESCAPE([$(X_CFLAGS)])]) CS_EMIT_BUILD_PROPERTY([XFREE86VM.LFLAGS], [AS_ESCAPE([$(X_PRE_LIBS) $(X_LIBS) -lXxf86vm -lXext -lX11 $(X_EXTRA_LIBS)])])], [], [$X_CFLAGS], [], [$X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS]) CS_CHECK_LIB_WITH([Xaw], [AC_LANG_PROGRAM( [[#include #include ]], [XtVaGetValues(0,0,0,0)])], [], [], [CS_EMIT_BUILD_RESULT([cs_cv_libXaw], [XAW])], [], [$X_CFLAGS], [], [$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS])]) #---------------------------------------------------------------------------- # Check for Crystal Space (CS) #---------------------------------------------------------------------------- AC_ARG_WITH([cs], [AC_HELP_STRING([--without-cs], [do not look for an installed Crystal Space SDK; this option is useful only if you need to perform routine maintenance tasks, such as generating project files or converting documentation, without having the Crystal Space SDK installed])]) AS_IF([test -z "$with_cs"], [with_cs=yes]) AS_IF([test $with_cs != no], [CS_PATH_CRYSTAL_EMIT([1.1], [], [AC_MSG_ERROR([ *** Crystal Space could not be found or was unusable. The latest version is *** always available from http://www.crystalspace3d.org/ *** Also, be sure that you have either installed Crystal Space or set the *** CRYSTAL environment variable properly. ])], [crystalspace])]) #---------------------------------------------------------------------------- # Check for MySQL #---------------------------------------------------------------------------- CS_CHECK_LIB_WITH([mysqlclient], [AC_LANG_PROGRAM([[#include ]], [USED_MEM check; check.left = 0;])], [/usr /usr/include/mysql|/usr/lib /usr/local/mysql /usr/include/mysql|/usr/lib/mysql /usr/local/include/mysql|/usr/local/lib/mysql /usr/lib /usr/local/mysql], [], [CS_EMIT_BUILD_RESULT([cs_cv_libmysqlclient], [LIBMYSQLCLIENT])], [], [], [], [], []) #---------------------------------------------------------------------------- # Check for Curl #---------------------------------------------------------------------------- PS_CHECK_LIBCURL #------------------------------------------------------------------------------ # Check if TemplateToolkit2 is installed (needed for MSVC project generation). #------------------------------------------------------------------------------ CS_CHECK_TEMPLATE_TOOLKIT2([emit]) #------------------------------------------------------------------------------ # The cs-win32libs package is a convenience archive made available to Windows # users of Crystal Space. It contains common libraries, headers, and tools # (such as zlib, libjpeg, cal3d, etc.) usable by MSVC, Mingw/MSYS, and Cygwin # users. It saves users the bother of having to install these packages # manually one at a time. #------------------------------------------------------------------------------ CS_CHECK_CSWIN32LIBS #------------------------------------------------------------------------------ # Use the CPPFLAGS, CXXFLAGS, CFLAGS, and LDFLAGS passed to configure, as well # as any additional flags provided by cs-win32libs. #------------------------------------------------------------------------------ CS_EMIT_BUILD_PROPERTY([COMPILER.CFLAGS], [$CPPFLAGS $CFLAGS], [+]) CS_EMIT_BUILD_PROPERTY([COMPILER.C++FLAGS], [$CPPFLAGS $CXXFLAGS], [+]) CS_EMIT_BUILD_PROPERTY([COMPILER.LFLAGS], [$LDFLAGS], [+]) #---------------------------------------------------------------------------- # Check if the Crystal Space static plugins library was built. #---------------------------------------------------------------------------- AS_IF([test $with_cs != no], [AC_MSG_CHECKING([for Crystal Space static plugins]) cc_have_crystal_static=no for m in $CRYSTAL_AVAILABLE_LIBS; do AS_IF([test crystalspace_staticplugins = "$m"], [cc_have_crystal_static=yes break]) done AC_MSG_RESULT([$cc_have_crystal_static])], [cc_have_crystal_static=no]) #---------------------------------------------------------------------------- # Check for Crystal Entity Layer (CEL) #---------------------------------------------------------------------------- m4_define([cel_desired], [yes]) CS_EMIT_BUILD_PROPERTY([CEL.DESIRED], [cel_desired]) m4_if(cel_desired, [yes], [AC_ARG_WITH([cel], [AC_HELP_STRING([--without-cel], [do not look for an installed Crystal Entity Layer SDK; this option is useful only if you need to perform routine maintenance tasks, such as generating project files or converting documentation, without having the CEL SDK installed])]) AS_IF([test -z "$with_cel"], [with_cel=yes]) AS_IF([test $with_cel != no], [CS_PATH_CEL_EMIT([0.99], [], [AC_MSG_ERROR([ *** CEL could not be found or was unusable. The latest version is always *** available from http://cel.crystalspace3d.org/ ])]) AC_DEFINE([USE_CEL], [], [Define to enable CEL.]) AC_DEFINE_UNQUOTED([CEL_PLUGIN_DIR], ["$CEL_PLUGIN_DIR"], [Define with path to CEL plugins.]) ])]) #---------------------------------------------------------------------------- # Check if the CEL static plugins library was built. #---------------------------------------------------------------------------- AS_IF([test $with_cel != no], [AC_MSG_CHECKING([for CEL static plugins]) cc_have_cel_static=no for m in $CEL_AVAILABLE_LIBS; do AS_IF([test cel_staticplugins = "$m"], [cc_have_cel_static=yes break]) done AC_MSG_RESULT([$cc_have_cel_static])], [cc_have_cel_static=no]) AS_IF([test $cc_have_cel_static != no && test $cc_have_crystal_static != no], [CS_EMIT_BUILD_PROPERTY([HAVE_STATIC_PLUGINS], [yes])]) #------------------------------------------------------------------------------ # Check for Cal3D. #------------------------------------------------------------------------------ CS_CHECK_LIB_WITH([cal3d], [AC_LANG_PROGRAM([[#include ]], [CalModel* m = 0; m->getMixer();])], [], [C++]) AS_IF([test $cs_cv_libcal3d = yes], [CS_CHECK_BUILD([if cal3d is sufficiently recent], [cs_cv_cal3d_recent], [AC_LANG_PROGRAM( [[#include ]], [CalCoreAnimation* p = 0; unsigned int n = p->getTrackCount();])], [], [C++], [CS_EMIT_BUILD_RESULT([cs_cv_libcal3d], [CAL3D])], [], [], [$cs_cv_libcal3d_cflags], [$cs_cv_libcal3d_lflags], [$cs_cv_libcal3d_libs])]) #------------------------------------------------------------------------------ # Determine if plugin meta-information should be embedded directly into plugin # modules or if it should exist in stand-alone .csplugin files. On Unix, # embedding is accomplished via libbfd which carries a GPL license. If your # project is compatible with GPL, then set gpl_compatible to "yes". This will # cause embedding to be enabled on Unix by default. Otherwise, set it to "no", # which will cause embedding to be disabled by default on Unix. (In any event, # the user can override the default setting with the # --enable-meta-info-embedding option.) #------------------------------------------------------------------------------ m4_define([gpl_compatible], [yes]) CS_META_INFO_EMBED([emit], gpl_compatible) AS_IF([test $enable_meta_info_embedding = yes], [CS_EMIT_BUILD_PROPERTY([COMPILER.CFLAGS], [AS_ESCAPE([$(EMBED_META.CFLAGS)])], [+]) CS_EMIT_BUILD_PROPERTY([COMPILER.LFLAGS], [AS_ESCAPE([$(EMBED_META.LFLAGS)])], [+])]) #------------------------------------------------------------------------------ # Determine if memory tracker should be enabled. #------------------------------------------------------------------------------ AC_MSG_CHECKING([whether to use memory tracker]) AC_ARG_ENABLE([memory-tracker], [AC_HELP_STRING([--enable-memory-tracker], [enable the memory tracker which checks memory usage per source file (default NO)])], [], [enable_memory_tracker=no]) AC_MSG_RESULT([$enable_memory_tracker]) CS_EMIT_BUILD_PROPERTY([MEMORY_TRACKER], [$enable_memory_tracker]) AS_IF([test $enable_memory_tracker = yes], [CS_HEADER_PROPERTY([CS_MEMORY_TRACKER])]) #------------------------------------------------------------------------------ # Determine if reference tracker should be enabled. #------------------------------------------------------------------------------ AC_MSG_CHECKING([whether to use reference tracker]) AC_ARG_ENABLE([ref-tracker], [AC_HELP_STRING([--enable-ref-tracker], [enable the reference tracker which dumps information about leaked references (default NO)])], [], [enable_ref_tracker=no]) AC_MSG_RESULT([$enable_ref_tracker]) CS_EMIT_BUILD_PROPERTY([REF_TRACKER], [$enable_ref_tracker]) AS_IF([test $enable_ref_tracker = yes], [CS_HEADER_PROPERTY([CS_REF_TRACKER])]) #---------------------------------------------------------------------------- # Package configuration switches #---------------------------------------------------------------------------- AC_ARG_ENABLE([debug], [AC_HELP_STRING([--enable-debug], [build with debugging information (default NO)])], [], [enable_debug=no]) AC_MSG_CHECKING([build mode]) AS_IF([test $enable_debug = yes], [build_mode=debug], [build_mode=optimize]) AC_MSG_RESULT([$build_mode]) CS_EMIT_BUILD_PROPERTY([MODE], [$build_mode]) #----------------------------------------------------------------------------- # Emit install paths and package information. #----------------------------------------------------------------------------- CS_OUTPUT_INSTALLDIRS CS_EMIT_PACKAGEINFO #---------------------------------------------------------------------------- # Emit generated files. #---------------------------------------------------------------------------- CS_JAMCONFIG_OUTPUT([Jamconfig]) AC_CONFIG_FILES([Jamfile]) AC_OUTPUT AC_MSG_NOTICE([ Please note that this project uses Jam as its build tool, therefore you must type 'jam' to build the project. Jam home: http://www.perforce.com/jam/jam.html Jam source: ftp://ftp.perforce.com/jam/ ])