From: <mg...@us...> - 2008-02-03 12:52:47
|
Revision: 744 http://planeshift.svn.sourceforge.net/planeshift/?rev=744&view=rev Author: mgist Date: 2008-02-03 04:52:51 -0800 (Sun, 03 Feb 2008) Log Message: ----------- - Updated some build files. Modified Paths: -------------- trunk/configure.ac trunk/mk/autoconf/checkbuild.m4 trunk/mk/autoconf/compiler.m4 trunk/mk/autoconf/emit.m4 trunk/mk/autoconf/warnings.m4 trunk/mk/jam/crystalspace_staticplugins_msvc.jam trunk/mk/jam/win32.jam Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-02-03 11:40:12 UTC (rev 743) +++ trunk/configure.ac 2008-02-03 12:52:51 UTC (rev 744) @@ -127,10 +127,10 @@ 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 - min) enable_cpu_specific_optimizations=minimum ;; - yes|max) enable_cpu_specific_optimizations=maximum ;; + yes|min) enable_cpu_specific_optimizations=minimum ;; + max) enable_cpu_specific_optimizations=maximum ;; esac], - [enable_cpu_specific_optimizations=maximum]) + [enable_cpu_specific_optimizations=minimum]) AC_MSG_RESULT([$enable_cpu_specific_optimizations]) case $enable_cpu_specific_optimizations in @@ -259,151 +259,28 @@ 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 gcc below version 4.1 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)) +# Check how to declare symbol visibility. #------------------------------------------------------------------------------ -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"], - [CS_CHECK_PROG_VERSION([g++], [$CXX --version], [4.1], [9.9|.9], - [cs_cv_gxx_version_4_1=yes], - [cs_cv_gxx_version_4_1=no]) - 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 -a cs_cv_gxx_version_4_1 = no \) \ - || 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_VISIBILITY_FLAG_INLINES_HIDDEN( [CS_EMIT_BUILD_PROPERTY([COMPILER.C++FLAGS], - [$cs_cv_prog_cxx_visibility_inlines_hidden], [+])]) + [$cs_prog_cxx_visibility_inlines_hidden], [+])]) +CS_VISIBILITY_FLAG_HIDDEN([C], [], + [CS_EMIT_BUILD_PROPERTY([COMPILER.CFLAGS], + [$cs_cv_prog_c_visibility_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_VISIBILITY_FLAG_DEFAULT([C], [], + [CS_EMIT_BUILD_PROPERTY([COMPILER.CFLAGS.VISIBILITY_DEFAULT], + [$cs_cv_prog_c_visibility_default])]) -CS_SYMBOL_QUALIFIER([how to declare default visibility], - [cs_cv_prog_cxx_declare_visible_def], - [__attribute__((visibility("default")))], [], [C++]) +CS_VISIBILITY_DECLARE_HIDDEN([C++], [], + [CS_HEADER_PROPERTY([CS_VISIBILITY_HIDDEN], + [$cs_cv_prog_cxx_declare_visibility_hidden])]) -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])]) +CS_VISIBILITY_DECLARE_DEFAULT([C++], [], + [CS_HEADER_PROPERTY([CS_VISIBILITY_DEFAULT], + [$cs_cv_prog_cxx_declare_visibility_default])]) -#------------------------------------------------------------------------------ -# 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 <X11/Xlib.h> - #include <X11/Xutil.h> - #include <X11/Xatom.h> - #include <X11/extensions/xf86vmode.h>]], - [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 <X11/Shell.h> - #include <X11/Xaw/Form.h>]], - [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) #---------------------------------------------------------------------------- Modified: trunk/mk/autoconf/checkbuild.m4 =================================================================== --- trunk/mk/autoconf/checkbuild.m4 2008-02-03 11:40:12 UTC (rev 743) +++ trunk/mk/autoconf/checkbuild.m4 2008-02-03 12:52:51 UTC (rev 744) @@ -1,6 +1,6 @@ # checkbuild.m4 -*- Autoconf -*- #============================================================================== -# Copyright (C)2003 by Eric Sunshine <sun...@su...> +# Copyright (C)2003-2008 by Eric Sunshine <sun...@su...> # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published by @@ -53,24 +53,6 @@ #------------------------------------------------------------------------------ -# CS_LANG_CFLAGS -# Return the literal string CFLAGS if the current language is C. Return -# the literal string CXXFLAGS if the current language is C++. Generic -# compiler test macros which need to modify or save the compiler flags -# can invoke this macro to get the name of the compiler flags environment -# variable (either CFLAGS or CXXFLAGS) depending upon the current -# language. For example: -# CS_LANG_CFLAGS="$CS_LANG_CFLAGS -Wall" -# With C, this expands to: -# CFLAGS="$CFLAGS -Wall" -# With C++, it expands to: -# CXXFLAGS="$CXXFLAGS -Wall" -#------------------------------------------------------------------------------ -AC_DEFUN([CS_LANG_CFLAGS], [AC_LANG_CASE([C], [CFLAGS], [C++], [CXXFLAGS])]) - - - -#------------------------------------------------------------------------------ # CS_BUILD_IFELSE([PROGRAM], [FLAGS], [LANGUAGE], [ACTION-IF-BUILT], # [ACTION-IF-NOT-BUILT], [OTHER-CFLAGS], [OTHER-LFLAGS], # [OTHER-LIBS], [INHIBIT-OTHER-FLAGS], [ERROR-REGEX]) @@ -120,8 +102,8 @@ # conftest.err before it returns. #------------------------------------------------------------------------------ AC_DEFUN([CS_BUILD_IFELSE], - [AC_LANG_PUSH(m4_default([$3],[C])) - cs_cflags_save="$CS_LANG_CFLAGS" + [AC_LANG_PUSH(CS_LANG_RESOLVE([$3])) + cs_cflags_save="$_CS_LANG_CFLAGS([$3])" cs_lflags_save="$LDFLAGS" cs_libs_save="$LIBS" cs_build_ok=no @@ -131,7 +113,7 @@ do CS_SPLIT_TUPLE( [$cs_build_item],[cs_cflags_test,cs_lflags_test,cs_libs_test]) - CS_LANG_CFLAGS="$cs_cflags_test $6 $cs_cflags_save" + _CS_LANG_CFLAGS([$3])="$cs_cflags_test $6 $cs_cflags_save" LDFLAGS="$cs_lflags_test $7 $cs_lflags_save" LIBS="$cs_libs_test $8 $cs_libs_save" AC_LINK_IFELSE(m4_default([$1], [AC_LANG_PROGRAM([],[])]), @@ -144,10 +126,10 @@ done m4_ifval([$10], [m4_popdef([AC_TRY_EVAL]) rm -f conftest.err]) - CS_LANG_CFLAGS=$cs_cflags_save + _CS_LANG_CFLAGS([$3])=$cs_cflags_save LDFLAGS=$cs_lflags_save LIBS=$cs_libs_save - AC_LANG_POP(m4_default([$3],[C])) + AC_LANG_POP(CS_LANG_RESOLVE([$3])) AS_IF([test $cs_build_ok = yes], [cs_build_cflags=CS_TRIM([$cs_cflags_test[]m4_ifval([$9],[],[ $6])]) @@ -157,7 +139,12 @@ [$5])]) +# Return an appropriate CFLAGS-style variable name for $1 (for example, returns +# CXXFLAGS for "C++"). +AC_DEFUN([_CS_LANG_CFLAGS], [CS_TR_SH_LANG([CS_LANG_RESOLVE([$1])FLAGS])]) + + #------------------------------------------------------------------------------ # CS_CHECK_BUILD(MESSAGE, CACHE-VAR, [PROGRAM], [FLAGS], [LANGUAGE], # [ACTION-IF-BUILT], [ACTION-IF-NOT-BUILT], [IGNORE-CACHE], Modified: trunk/mk/autoconf/compiler.m4 =================================================================== --- trunk/mk/autoconf/compiler.m4 2008-02-03 11:40:12 UTC (rev 743) +++ trunk/mk/autoconf/compiler.m4 2008-02-03 12:52:51 UTC (rev 744) @@ -1,5 +1,6 @@ # compiler.m4 -*- Autoconf -*- #============================================================================= +# Copyright (C)2003-2007 by Eric Sunshine <sun...@su...> # Copyright (C)2003 by Matze Braun <ma...@br...> # # This library is free software; you can redistribute it and/or modify it @@ -25,8 +26,9 @@ # Detects the C compiler. Also takes care of the CFLAGS, CPPFLAGS and CC # environment variables. This will filter out all -g and -O from the # CFLAGS variable because Autoconf's -g and -O defaults are not always -# desired. This will also set the CMD.CC and COMPILER.CFLAGS variables -# in Jamconfig +# desired. This will also set the CMD.CC, COMPILER.CFLAGS, +# COMPILER.C.TYPE, and (as an historic anomaly) COMPILER.TYPE variables +# in Jamconfig. The shell variable cs_compiler_name_c is also exported. #----------------------------------------------------------------------------- AC_DEFUN([CS_PROG_CC],[ CFLAGS="$CFLAGS" # Filter undesired flags @@ -34,6 +36,7 @@ AS_IF([test -n "$CC"],[ CS_EMIT_BUILD_PROPERTY([CMD.CC], [$CC]) CS_EMIT_BUILD_PROPERTY([COMPILER.CFLAGS], [$CPPFLAGS $CFLAGS], [+]) + _CS_COMPILER_NAME([$CC], [C], [$ac_compiler_gnu]) # Check if compiler recognizes -pipe directive. CS_EMIT_BUILD_FLAGS([if $CC accepts -pipe], [cs_cv_prog_cc_pipe], @@ -46,16 +49,17 @@ # Detects the C++ compiler. Also takes care of the CXXFLAGS, CPPFLAGS # and CXX environment variables. This will filter out all -g and -O from # the CXXFLAGS variable because Autoconf's -g and -O defaults are not -# always desired. This will also set the CMD.C++ and COMPILER.C++FLAGS -# variables in Jamconfig +# always desired. This will also set the CMD.C++, COMPILER.C++FLAGS, +# COMPILER.C++.TYPE, and (as an historic anomaly) COMPILER.TYPE variables +# in Jamconfig. The shell variable cs_compiler_name_cxx is also exported. #----------------------------------------------------------------------------- AC_DEFUN([CS_PROG_CXX],[ CXXFLAGS="$CXXFLAGS" # Filter undesired flags AC_PROG_CXX AS_IF([test -n "$CXX"],[ CS_EMIT_BUILD_PROPERTY([CMD.C++], [$CXX]) - CS_EMIT_BUILD_PROPERTY([COMPILER.C++FLAGS], [$CPPFLAGS $CXXFLAGS], [+]) + _CS_COMPILER_NAME([$CXX], [C++], [$ac_compiler_gnu]) # Check if compiler can be instructed to produce position-independent-code # (PIC). This feature is required by some platforms when building plugin @@ -67,6 +71,50 @@ ]) #----------------------------------------------------------------------------- +# _CS_COMPILER_NAME(COMPILER, LANGUAGE, [IS_GNU]) +# Attempt to glean COMPILER's name and export it as shell variable +# cs_compiler_name_{language} and as build properties +# COMPILER.LANGUAGE.TYPE and (as an historic anomaly) COMPILER.TYPE. +# LANGUAGE is typically either C or C++ and specifies the compiler's +# language. If provided, IS_GNU should be 'yes' or 'no', and is employed +# as a hint when determining the compiler's name. The output of this +# macro is perhaps useful for display purposes, but should not generally +# be used for decision making since name-gleaning is unreliable. For +# decision-making, it is better to perform actual compiler tests rather +# than basing a decision upon the compiler's name. +# +# *IMPLEMENTATION NOTES* +# +# Since there is no obvious generic way to determine a compiler's name, +# this implementation emits "GCC" if IS_GNU is 'yes', otherwise it +# attempts to fashion a name by invoking AS_TR_CPP(COMPILER), but this is +# only a very rough and unreliable approximation of the compiler's name. +# For instance, if a user configures the project with a non-GNU compiler +# by setting the environment variable CXX="ccache c++comp -blazing-fast", +# then the gleaned compiler name will be CCACHE_CPPCOMP__BLAZING_FAST +# rather than "C++COMP" or "CXXCOMP" as one might expect. +# +# When fashioning the shell variable name cs_compiler_name_{language}, +# "+" in LANGUAGE is replaced with "x", rather than with "p" as would be +# the case normally when AS_TR_SH() is employed. The use of "x", however, +# is more sensible in this context, since a language of "C++" translates +# to "cxx", which is the expected variable name in the context of +# compilers. +#----------------------------------------------------------------------------- +AC_DEFUN([_CS_COMPILER_NAME], + [AS_IF([test "m4_default([$3],[no])" = yes], + [_CS_COMPILER_NAME_SH([$2])=GCC], + [_CS_COMPILER_NAME_SH([$2])=AS_TR_CPP([$1])]) + CS_EMIT_BUILD_PROPERTY([COMPILER.$2.TYPE], [$_CS_COMPILER_NAME_SH([$2])]) + CS_EMIT_BUILD_PROPERTY([COMPILER.TYPE], [$_CS_COMPILER_NAME_SH([$2])], + [], [], [], [Y])]) + +AC_DEFUN([_CS_COMPILER_NAME_SH], + [cs_compiler_name_[]AS_TR_SH(m4_translit([$1],[+A-Z],[xa-z]))]) + + + +#----------------------------------------------------------------------------- # CS_PROG_LINK # Tries to determine a linker. This is done by checking if a C++ or # Objecctive-C++ compiler is available in which case it is used for Modified: trunk/mk/autoconf/emit.m4 =================================================================== --- trunk/mk/autoconf/emit.m4 2008-02-03 11:40:12 UTC (rev 743) +++ trunk/mk/autoconf/emit.m4 2008-02-03 12:52:51 UTC (rev 744) @@ -43,7 +43,8 @@ [cs_build_prop_val="$2" cs_build_prop_val=CS_TRIM([$cs_build_prop_val]) m4_ifval([$4], - [CS_JAMCONFIG_PROPERTY([$1], [$cs_build_prop_val], [$3])], + [m4_default([$5],CS_JAMCONFIG_PROPERTY)( + [$1], [$cs_build_prop_val], [$3], [$6])], AS_IF([test -n "$cs_build_prop_val"], [m4_default([$5],[CS_JAMCONFIG_PROPERTY])( [$1], [$cs_build_prop_val], [$3], [$6])]))]) @@ -79,19 +80,19 @@ # [ACTION-IF-NOT-RECOGNIZED], [EMITTER]) # A convenience wrapper for CS_CHECK_BUILD_FLAGS() which also records the # results via CS_EMIT_BUILD_PROPERTY(). Checks if the compiler or linker -# recognizes a command-line option. MESSAGE is the "checking" message. -# CACHE-VAR is the shell cache variable which receives the flag -# recognized by the compiler or linker, or "no" if the flag was not -# recognized. FLAGS is a whitespace- delimited list of build tuples -# created with CS_CREATE_TUPLE(). Each tuple from FLAGS is attempted in -# order until one is found which is recognized by the compiler. After -# that, no further flags are checked. LANGUAGE is typically either C or -# C++ and specifies which compiler to use for the test. If LANGUAGE is -# omitted, C is used. EMITTER-KEY is the name to pass as the emitter's -# "key" argument if a usable flag is encountered. If APPEND is not the -# empty string, then the discovered flag is appended to the existing -# value of the EMITTER-KEY. If the command-line option was recognized, -# then ACTION-IF-RECOGNIZED is invoked, otherwise +# recognizes one of a list of command-line options. MESSAGE is the +# "checking" message. CACHE-VAR is the shell cache variable which +# receives the flag recognized by the compiler or linker, or "no" if the +# flag was not recognized. FLAGS is a whitespace-delimited list of build +# tuples created with CS_CREATE_TUPLE(). Each tuple from FLAGS is +# attempted in order until one is found which is recognized by the +# compiler. After that, no further flags are checked. LANGUAGE is +# typically either C or C++ and specifies which compiler to use for the +# test. If LANGUAGE is omitted, C is used. EMITTER-KEY is the name to +# pass as the emitter's "key" argument if a usable flag is encountered. +# If APPEND is not the empty string, then the discovered flag is appended +# to the existing value of the EMITTER-KEY. If the command-line option +# was recognized, then ACTION-IF-RECOGNIZED is invoked, otherwise # ACTION-IF-NOT-RECOGNIZED is invoked. EMITTER is a macro name, such as # CS_JAMCONFIG_PROPERTY or CS_MAKEFILE_PROPERTY, which performs the # actual task of emitting the KEY/VALUE tuple; it should also accept @@ -119,15 +120,16 @@ # # - If EMITTER is omitted, then CS_NULL_EMITTER is returned, effectively # disabling output by the CS_EMIT_FOO() macro. -# - If EMITTER is the literal string "emit" or "yes", then it returns an -# empty string, which signals to the CS_EMIT_FOO() macro that is should -# use its default emitter. +# - If EMITTER is the literal string "default", "emit", or "yes", then it +# returns an empty string, which signals to the CS_EMIT_FOO() macro +# that is should use its default emitter. # - Any other value for EMITTER is passed along as-is to the # CS_EMIT_FOO() macro. #------------------------------------------------------------------------------ AC_DEFUN([CS_EMITTER_OPTIONAL], [m4_case([$1], [], [[CS_NULL_EMITTER]], + [default], [], [emit], [], [yes], [], [[$1]])]) @@ -137,7 +139,8 @@ #------------------------------------------------------------------------------ # CS_NULL_EMITTER(KEY, VALUE, [APPEND]) # A do-nothing emitter suitable for use as the EMITTER argument of one of -# the CS_EMIT_FOO() macros. +# the CS_EMIT_FOO() macros. Useful for cases when you are interested only +# in the result of a check but not any emitter side-effects. #------------------------------------------------------------------------------ AC_DEFUN([CS_NULL_EMITTER], [: ]) Modified: trunk/mk/autoconf/warnings.m4 =================================================================== --- trunk/mk/autoconf/warnings.m4 2008-02-03 11:40:12 UTC (rev 743) +++ trunk/mk/autoconf/warnings.m4 2008-02-03 12:52:51 UTC (rev 744) @@ -1,6 +1,6 @@ # warnings.m4 -*- Autoconf -*- #============================================================================== -# Copyright (C)2005 by Eric Sunshine <sun...@su...> +# Copyright (C)2005-2008 by Eric Sunshine <sun...@su...> # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published by @@ -25,10 +25,11 @@ # Check how to enable compilation warnings. If LANGUAGE is not provided, # then `C' is assumed (other options include `C++'). If CACHE-VAR is not # provided, then it defaults to the name -# "cs_cv_prog_compiler_enable_warnings". If an option for enabling -# warnings (such as `-Wall') is discovered, then it is assigned to -# CACHE-VAR and ACTION-IF-FOUND is invoked; otherwise the empty string is -# assigned to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked. +# "cs_cv_prog_{language}_enable_warnings" where {language} is the result +# of CS_TR_SH_lang(). If an option for enabling warnings (such as +# `-Wall') is discovered, then it is assigned to CACHE-VAR and +# ACTION-IF-FOUND is invoked; otherwise the empty string is assigned to +# CACHE-VAR and ACTION-IF-NOT-FOUND is invoked. # # IMPLEMENTATION NOTES # @@ -38,8 +39,8 @@ #------------------------------------------------------------------------------ AC_DEFUN([CS_COMPILER_WARNINGS], [CS_CHECK_BUILD_FLAGS( - [how to enable m4_default([$1],[C]) compilation warnings], - [m4_default([$2],[cs_cv_prog_compiler_enable_warnings])], + [how to enable ]CS_LANG_RESOLVE([$1])[ compilation warnings], + [_CS_WARNING_CACHE_VAR([$2], [$1], [enable_warnings])], [CS_CREATE_TUPLE([-Wmost]) CS_CREATE_TUPLE([-Wall])], [$1], [$3], [$4])]) @@ -51,15 +52,16 @@ # Check how to promote compilation diganostics from warning to error # status. If LANGUAGE is not provided, then `C' is assumed (other options # include `C++'). If CACHE-VAR is not provided, then it defaults to the -# name "cs_cv_prog_compiler_enable_errors". If an option for performing -# this promotion (such as `-Werror') is discovered, then it is assigned -# to CACHE-VAR and ACTION-IF-FOUND is invoked; otherwise the empty string -# is assigned to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked. +# name "cs_cv_prog_{language}_enable_errors" where {language} is the +# result of CS_TR_SH_lang(). If an option for performing this promotion +# (such as `-Werror') is discovered, then it is assigned to CACHE-VAR and +# ACTION-IF-FOUND is invoked; otherwise the empty string is assigned to +# CACHE-VAR and ACTION-IF-NOT-FOUND is invoked. #------------------------------------------------------------------------------ AC_DEFUN([CS_COMPILER_ERRORS], [CS_CHECK_BUILD_FLAGS( - [how to treat m4_default([$1],[C]) warnings as errors], - [m4_default([$2],[cs_cv_prog_compiler_enable_errors])], + [how to treat ]CS_LANG_RESOLVE([$1])[ warnings as errors], + [_CS_WARNING_CACHE_VAR([$2], [$1], [enable_errors])], [CS_CREATE_TUPLE([-Werror])], [$1], [$3], [$4])]) @@ -73,15 +75,16 @@ # wishes to compile without excessive diagnostic spew. If LANGUAGE is # not provided, then `C' is assumed (other options include `C++'). If # CACHE-VAR is not provided, then it defaults to the name -# "cs_cv_prog_compiler_ignore_unused". If an option (such as -# `-Wno-unused') is discovered, then it is assigned to CACHE-VAR and -# ACTION-IF-FOUND is invoked; otherwise the empty string is assigned to -# CACHE-VAR and ACTION-IF-NOT-FOUND is invoked. +# "cs_cv_prog_{language}_ignore_unused" where {language} is the result of +# CS_TR_SH_lang(). If an option (such as `-Wno-unused') is discovered, +# then it is assigned to CACHE-VAR and ACTION-IF-FOUND is invoked; +# otherwise the empty string is assigned to CACHE-VAR and +# ACTION-IF-NOT-FOUND is invoked. #------------------------------------------------------------------------------ AC_DEFUN([CS_COMPILER_IGNORE_UNUSED], [CS_CHECK_BUILD_FLAGS( - [how to suppress m4_default([$1],[C]) unused variable warnings], - [m4_default([$2],[cs_cv_prog_compiler_ignore_unused])], + [_CS_WARNING_SUPPRESS_MSG([unused variable], [$1])], + [_CS_WARNING_CACHE_VAR([$2], [$1], [ignore_unused])], [CS_CREATE_TUPLE([-Wno-unused])], [$1], [$3], [$4])]) @@ -95,16 +98,16 @@ # without excessive diagnostic spew. If LANGUAGE is not provided, then # `C' is assumed (other options include `C++'). If CACHE-VAR is not # provided, then it defaults to the name -# "cs_cv_prog_compiler_ignore_uninitialized". If an option (such as -# `-Wno-uninitialized') is discovered, then it is assigned to CACHE-VAR -# and ACTION-IF-FOUND is invoked; otherwise the empty string is assigned -# to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked. +# "cs_cv_prog_{language}_ignore_uninitialized" where {language} is the +# result of CS_TR_SH_lang(). If an option (such as `-Wno-uninitialized') +# is discovered, then it is assigned to CACHE-VAR and ACTION-IF-FOUND is +# invoked; otherwise the empty string is assigned to CACHE-VAR and +# ACTION-IF-NOT-FOUND is invoked. #------------------------------------------------------------------------------ AC_DEFUN([CS_COMPILER_IGNORE_UNINITIALIZED], [CS_CHECK_BUILD_FLAGS( - [how to suppress m4_default([$1],[C]) uninitialized warnings], - [m4_default([$2], - [cs_cv_prog_compiler_ignore_uninitialized_variables])], + [_CS_WARNING_SUPPRESS_MSG([uninitialized variable], [$1])], + [_CS_WARNING_CACHE_VAR([$2], [$1], [ignore_uninitialized])], [CS_CREATE_TUPLE([-Wno-uninitialized])], [$1], [$3], [$4])]) @@ -117,15 +120,16 @@ # unprotected #pragmas which are not understood by all compilers. If # LANGUAGE is not provided, then `C' is assumed (other options include # `C++'). If CACHE-VAR is not provided, then it defaults to the name -# "cs_cv_prog_compiler_ignore_unknown_pragmas". If an option (such as +# "cs_cv_prog_{language}_ignore_unknown_pragmas" where {language} is the +# result of CS_TR_SH_lang(). If an option (such as # `-Wno-unknown-pragmas') is discovered, then it is assigned to CACHE-VAR # and ACTION-IF-FOUND is invoked; otherwise the empty string is assigned # to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked. #------------------------------------------------------------------------------ AC_DEFUN([CS_COMPILER_IGNORE_PRAGMAS], [CS_CHECK_BUILD_FLAGS( - [how to suppress m4_default([$1],[C]) unknown [#pragma] warnings], - [m4_default([$2],[cs_cv_prog_compiler_ignore_unknown_pragmas])], + [_CS_WARNING_SUPPRESS_MSG([unknown [#pragma]], [$1])], + [_CS_WARNING_CACHE_VAR([$2], [$1], [ignore_unknown_pragmas])], [CS_CREATE_TUPLE([-Wno-unknown-pragmas])], [$1], [$3], [$4])]) @@ -139,15 +143,16 @@ # to compile without excessive diagnostic spew. If LANGUAGE is not # provided, then `C' is assumed (other options include `C++'). If # CACHE-VAR is not provided, then it defaults to the name -# "cs_cv_prog_compiler_ignore_long_double". If an option (such as -# `-Wno-long-double') is discovered, then it is assigned to CACHE-VAR and -# ACTION-IF-FOUND is invoked; otherwise the empty string is assigned to -# CACHE-VAR and ACTION-IF-NOT-FOUND is invoked. +# "cs_cv_prog_{language}_ignore_long_double" where {language} is the +# result of CS_TR_SH_lang(). If an option (such as `-Wno-long-double') +# is discovered, then it is assigned to CACHE-VAR and ACTION-IF-FOUND is +# invoked; otherwise the empty string is assigned to CACHE-VAR and +# ACTION-IF-NOT-FOUND is invoked. #------------------------------------------------------------------------------ AC_DEFUN([CS_COMPILER_IGNORE_LONG_DOUBLE], [CS_CHECK_BUILD_FLAGS( - [how to suppress m4_default([$1],[C]) `long double' warnings], - [m4_default([$2],[cs_cv_prog_compiler_ignore_long_double])], + [_CS_WARNING_SUPPRESS_MSG([`long double'], [$1])], + [_CS_WARNING_CACHE_VAR([$2], [$1], [ignore_long_double])], [CS_CREATE_TUPLE([-Wno-long-double])], [$1], [$3], [$4])]) @@ -161,13 +166,39 @@ # 3rd-party headers or code generated by tools. If LANGUAGE is not # provided, then `C' is assumed (other options include `C++'). If # CACHE-VAR is not provided, then it defaults to the name -# "cs_cv_prog_compiler_ignore_non_virtual_dtor". If an option (such as +# "cs_cv_prog_{language}_ignore_non_virtual_dtor" where {language} is the +# result of CS_TR_SH_lang(). If an option (such as # `-Wno-non-virtual-dtor') is discovered, then it is assigned to # CACHE-VAR and ACTION-IF-FOUND is invoked; otherwise the empty string is # assigned to CACHE-VAR and ACTION-IF-NOT-FOUND is invoked. #------------------------------------------------------------------------------ AC_DEFUN([CS_COMPILER_IGNORE_NON_VIRTUAL_DTOR], [CS_CHECK_BUILD_FLAGS( - [how to suppress m4_default([$1],[C]) non-virtual destructor warnings], - [m4_default([$2],[cs_cv_prog_compiler_ignore_non_virtual_dtor])], + [_CS_WARNING_SUPPRESS_MSG([non-virtual destructor], [$1])], + [_CS_WARNING_CACHE_VAR([$2], [$1], [ignore_non_virtual_dtor])], [CS_CREATE_TUPLE([-Wno-non-virtual-dtor])], [$1], [$3], [$4])]) + + + +#------------------------------------------------------------------------------ +# _CS_WARNING_SUPPRESS_MSG(DESCRIPTION, [LANGUAGE]) +# Helper macro which composes the message for warning suppression +# checks. DESCRIPTION is a human-readable description of the particular +# check. LANGUAGE is the language being checked, typically `C' or `C++' +# (defaulting to `C' if not provided). +#------------------------------------------------------------------------------ +AC_DEFUN([_CS_WARNING_SUPPRESS_MSG], + [how to suppress CS_LANG_RESOLVE([$2]) $1 warnings]) + + + +#------------------------------------------------------------------------------ +# _CS_WARNING_CACHE_VAR([CACHE-VAR], [LANGUAGE], DEFAULT-CACHE-VAR-SUFFIX) +# Helper macro which returns the client-supplied cache variable name or +# composes one from LANGUAGE and DEFAULT-CACHE-VAR-SUFFIX if not +# provided. LANGUAGE typically is `C' or `C++' (defaulting to `C' if not +# provided). +#------------------------------------------------------------------------------ +AC_DEFUN([_CS_WARNING_CACHE_VAR], + [m4_default([$1], + [CS_TR_SH_lang([cs_cv_prog_]CS_LANG_RESOLVE([$2])[_$3])])]) Modified: trunk/mk/jam/crystalspace_staticplugins_msvc.jam =================================================================== --- trunk/mk/jam/crystalspace_staticplugins_msvc.jam 2008-02-03 11:40:12 UTC (rev 743) +++ trunk/mk/jam/crystalspace_staticplugins_msvc.jam 2008-02-03 12:52:51 UTC (rev 744) @@ -9,7 +9,7 @@ # refer to the files inside CS or a copy in your project's sources; either # way, the include statements below would obviously have to adjusted # appropriately. -include $(TOP)/mk/jam/crystalspace_staticplugins_msvc7.jam ; -include $(TOP)/mk/jam/crystalspace_staticplugins_msvc71.jam ; -include $(TOP)/mk/jam/crystalspace_staticplugins_msvc8.jam ; -include $(TOP)/mk/jam/crystalspace_staticplugins_msvc9.jam ; +include $(TOP)/mk/msvc/crystalspace_staticplugins_msvc7.jam ; +include $(TOP)/mk/msvc/crystalspace_staticplugins_msvc71.jam ; +include $(TOP)/mk/msvc/crystalspace_staticplugins_msvc8.jam ; +include $(TOP)/mk/msvc/crystalspace_staticplugins_msvc9.jam ; Modified: trunk/mk/jam/win32.jam =================================================================== --- trunk/mk/jam/win32.jam 2008-02-03 11:40:12 UTC (rev 743) +++ trunk/mk/jam/win32.jam 2008-02-03 12:52:51 UTC (rev 744) @@ -245,7 +245,7 @@ rule ConstructSharedLibraryTarget { local libbase = [ LibraryBaseName $(<) ] ; - return $(libbase)-$(COMPILER.TYPE).dll ; + return $(libbase)-$(COMPILER.C++.TYPE).dll ; } rule ConstructSharedLibraryLinkLib { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |