X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=stepmake%2Faclocal.m4;h=682b6b1bd15e22504106c520493900346a541f34;hb=c20fff645e325d392d2588721144f4204d0ef9da;hp=2a6e2233c674f69115e333994bdbad80ec9147c5;hpb=26931452681464f768bc7117a0fe2b6338c487d1;p=lilypond.git diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index 2a6e2233c6..682b6b1bd1 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -178,19 +178,23 @@ AC_DEFUN(STEPMAKE_COMPILE_BEFORE, [ pipe_b=yes AC_ARG_ENABLE(debugging, - [ --enable-debugging compile with debugging info. Default: on], + [AS_HELP_STRING([--enable-debugging], + [compile with debugging info. Default: on])], [debug_b=$enableval]) AC_ARG_ENABLE(optimising, - [ --enable-optimising compile with optimising. Default: on], + [AS_HELP_STRING([--enable-optimising], + [compile with optimising. Default: on])], [optimise_b=$enableval]) AC_ARG_ENABLE(profiling, - [ --enable-profiling compile with gprof support. Default: off], + [AS_HELP_STRING([--enable-profiling], + [compile with gprof support. Default: off])], [profile_b=$enableval]) AC_ARG_ENABLE(pipe, - [ --enable-pipe compile with -pipe. Default: on], + [AS_HELP_STRING([--enable-pipe], + [compile with -pipe. Default: on])], [pipe_b=$enableval]) if test "$optimise_b" = yes; then @@ -258,7 +262,6 @@ AC_DEFUN(STEPMAKE_COMPILE, [ ]) AC_DEFUN(STEPMAKE_CXX, [ - AC_LANG([C++]) AC_PROG_CXX STEPMAKE_OPTIONAL_REQUIRED(CXX, c++, $1) @@ -283,6 +286,22 @@ AC_DEFUN(STEPMAKE_CXXTEMPLATE, [ fi ]) +AC_DEFUN(STEPMAKE_GXXCODEGENBUG, [ + AC_MSG_CHECKING([options for known g++ bugs]) + case "$GXX:$CXX_VERSION" in + yes:400600[[0-2]]) + AC_MSG_RESULT([-fno-optimize-sibling-calls (tail call bug)]) + CXXFLAGS="$CXXFLAGS -fno-optimize-sibling-calls" + ;; + yes:400700?) + AC_MSG_RESULT([-fno-tree-vrp (comparison bug)]) + CXXFLAGS="$CXXFLAGS -fno-tree-vrp" + ;; + *) AC_MSG_RESULT([none]) + esac + AC_SUBST(CXXFLAGS) +]) + AC_DEFUN(STEPMAKE_DATADIR, [ if test "$datadir" = "\${prefix}/share"; then @@ -402,9 +421,22 @@ EOF exit 2 fi - for d in 2 3 4 ; do - for mf in `cd $srcdir ; find -maxdepth $d -mindepth $d -name GNUmakefile`; do - mkdir -p $(dirname $mf) + abssrcdir="`cd $srcdir; pwd`" + absbuilddir="`pwd`" + for d in 2 3 4 5 ; do + for mf in `cd $srcdir ; find . -maxdepth $d -mindepth $d -name GNUmakefile`; do + case "$abssrcdir" in + "$absbuilddir"/*) +# source is below build directory, always copy + ;; + *) + case "$abssrcdir/${mf#./}" in + "$absbuilddir"/*) +# find descended into build directory, don't copy + continue + esac + esac + mkdir -p ${mf%/*} cat < $mf print 'depth=' + ('../' * ( $d-1 ) ) print 'include \$(depth)/config\$(if \$(conf),-\$(conf),).make' @@ -412,8 +444,19 @@ print 'include \$(configure-srcdir)/$mf' print 'MODULE_INCLUDES += \$(src-dir)/\$(outbase)' EOF done - for mf in `cd $srcdir ; find -maxdepth $d -mindepth $d -name '*.make' | grep -v config.make `; do - mkdir -p $(dirname $mf) + for mf in `cd $srcdir ; find . -maxdepth $d -mindepth $d -name '*.make' | grep -v config.make `; do + case "$abssrcdir" in + "$absbuilddir"/*) +# source is below build directory, always copy + ;; + *) + case "$abssrcdir/${mf#./}" in + "$absbuilddir"/*) +# find descended into build directory, don't copy + continue + esac + esac + mkdir -p ${mf%/*} cat < $mf print 'include \$(depth)/config\$(if \$(conf),-\$(conf),).make' print 'include \$(configure-srcdir)/$mf' @@ -421,12 +464,13 @@ EOF done done - + rm -f GNUmakefile cat < GNUmakefile -depth = ./ +depth = . include config\$(if \$(conf),-\$(conf),).make include \$(configure-srcdir)/GNUmakefile.in EOF + chmod 444 GNUmakefile AC_SUBST(VPATH) fi ]) @@ -452,7 +496,6 @@ AC_DEFUN(STEPMAKE_FLEXLEXER, [ fi # check for yyFlexLexer.yy_current_buffer, # in 2.5.4 <= flex < 2.5.29 - AC_LANG_PUSH(C++) AC_CACHE_CHECK([for yyFlexLexer.yy_current_buffer], [stepmake_cv_flexlexer_yy_current_buffer], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ @@ -472,7 +515,6 @@ class yy_flex_lexer: public yyFlexLexer if test $stepmake_cv_flexlexer_yy_current_buffer = yes; then AC_DEFINE(HAVE_FLEXLEXER_YY_CURRENT_BUFFER, 1, [Define to 1 if yyFlexLexer has yy_current_buffer.]) fi - AC_LANG_POP(C++) ]) @@ -493,13 +535,17 @@ EOF AC_MSG_RESULT($FLEXLEXER_FILE) ]) -AC_DEFUN(STEPMAKE_GCC, [ - if test "$GCC" = "yes"; then - STEPMAKE_CHECK_VERSION(CC, $1, $2) - else - warn="$CC (Please install *GNU* cc)" - STEPMAKE_ADD_ENTRY($1, $warn) +AC_DEFUN(STEPMAKE_GCC_OR_CLANG, [ + STEPMAKE_HAS_CLANG() + if test "$HAS_CLANG" = "no"; then + if test "$GCC" = "yes"; then + STEPMAKE_CHECK_VERSION(CC, $1, $2) + else + warn="$CC (Please install *GNU* cc)" + STEPMAKE_ADD_ENTRY($1, $warn) + fi fi + # no else, we're fine with any clang ]) AC_DEFUN(STEPMAKE_GETTEXT, [ @@ -511,29 +557,13 @@ AC_DEFUN(STEPMAKE_GETTEXT, [ AC_SUBST(localedir) AC_DEFINE_UNQUOTED(LOCALEDIR, ["${LOCALEDIR}"]) - # ouch. autoconf <= 2.57's gettext check fails for - # g++ >= 3.3 (with -std=gnu++98, the default). - # While the check is OK for g++ -std=c++98, - # LilyPond needs GNU g++, so who is to blame here? - # Use a workaround until this is resolved: - # for g++ >= 3.3, select C language. - GCC_UNSUPPORTED= - STEPMAKE_CHECK_VERSION_UNSUPPORTED(CXX, GCC_UNSUPPORTED, 3.3) - if test -n "$GCC_UNSUPPORTED"; then - AC_MSG_WARN([autoconf <= 2.59 with g++ >= 3.3 gettext test broken.]) - AC_MSG_WARN([Trying gcc, cross fingers.]) - AC_LANG_PUSH(C) - fi AC_CHECK_LIB(intl, gettext) AC_CHECK_FUNCS(gettext) - if test -n "$GCC_UNSUPPORTED"; then - AC_LANG_POP(C) - fi ]) AC_DEFUN(STEPMAKE_GUILE, [ - STEPMAKE_PATH_PROG(GUILE, guile, $1) + STEPMAKE_PATH_PROG(GUILE, guile guile1, $1) ]) @@ -575,7 +605,7 @@ AC_DEFUN(STEPMAKE_GUILE_DEVEL, [ test -n "$target_alias" && target_guile_config=$target_alias-guile-config test -n "$host_alias" && host_guile_config=$host_alias-guile-config AC_MSG_CHECKING([for guile-config]) - for guile_config in $GUILE_CONFIG $target_guile_config $host_guile_config $build_guile_config guile-config; do + for guile_config in $GUILE_CONFIG $target_guile_config $host_guile_config $build_guile_config guile-config guile1-config; do AC_MSG_RESULT([$guile_config]) if ! $guile_config --version > /dev/null 2>&1 ; then AC_MSG_WARN([cannot execute $guile_config]) @@ -588,7 +618,7 @@ AC_DEFUN(STEPMAKE_GUILE_DEVEL, [ done STEPMAKE_OPTIONAL_REQUIRED(GUILE_CONFIG, $guile_config, $1) if test $? -ne 0; then - STEPMAKE_ADD_ENTRY($1, 'guile-config (guile-devel, guile-dev or libguile-dev package)') + STEPMAKE_ADD_ENTRY($1, 'guile-config (guile-devel, guile-dev or libguile-dev package) or guile1-config (guile1-devel package)') fi STEPMAKE_CHECK_SEARCH_RESULT(GUILE_CONFIG) @@ -631,13 +661,25 @@ AC_DEFUN(STEPMAKE_DLOPEN, [ AC_CHECK_FUNCS(dlopen) ]) -AC_DEFUN(STEPMAKE_GXX, [ - if test "$GXX" = "yes"; then - STEPMAKE_CHECK_VERSION(CXX, $1, $2) - else - warn="$CXX (Please install *GNU* c++)" - STEPMAKE_ADD_ENTRY($1, $warn) +AC_DEFUN(STEPMAKE_HAS_CLANG, [ + AC_EGREP_CPP(yes, + [#ifdef __clang__ + yes + #endif + ], HAS_CLANG=yes, HAS_CLANG=no) +]) + +AC_DEFUN(STEPMAKE_GXX_OR_CLANG, [ + STEPMAKE_HAS_CLANG() + if test "$HAS_CLANG" = "no"; then + if test "$GXX" = "yes"; then + STEPMAKE_CHECK_VERSION(CXX, $1, $2) + else + warn="$CXX (Please install *GNU* c++)" + STEPMAKE_ADD_ENTRY($1, $warn) + fi fi + # no else, we're fine with any clang ]) @@ -764,8 +806,9 @@ AC_DEFUN(STEPMAKE_INIT, [ CONFIGSUFFIX= AC_ARG_ENABLE(config, - [ --enable-config=CONF put settings in config-CONF.make and config-CONF.h; - do `make conf=CONF' to get output in ./out-CONF], + [AS_HELP_STRING([--enable-config=CONF], + [put settings in config-CONF.make and config-CONF.h; + do `make conf=CONF' to get output in ./out-CONF])], [CONFIGURATION=$enableval]) ##'`# @@ -856,12 +899,14 @@ AC_DEFUN(STEPMAKE_LOCALE, [ # with/enable ?? AC_ARG_WITH(localedir, - [ --with-localedir=DIR location of locales. Default: PREFIX/share/locale ], + [AS_HELP_STRING([--with-localedir=DIR], + [location of locales. Default: PREFIX/share/locale])], localedir=$with_localedir, localedir='${prefix}/share/locale') AC_ARG_WITH(lang, - [ --with-lang=LANG use LANG as language to emit messages], + [AS_HELP_STRING([--with-lang=LANG], + [use LANG as language to emit messages])], language=$with_lang, language=English) @@ -911,7 +956,7 @@ AC_DEFUN(STEPMAKE_PATH_PROG, [ AC_CHECK_PROGS($1, $2, no) STEPMAKE_OPTIONAL_REQUIRED($1, $2, $3) if test $? -eq 0; then - AC_PATH_PROG($1, $2) + AC_PATH_PROGS($1, $2) if test -n "$4"; then STEPMAKE_CHECK_VERSION($1, $3, $4) fi @@ -965,23 +1010,24 @@ AC_DEFUN(STEPMAKE_PYTHON, [ AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [ AC_ARG_WITH(python-include, - [ --with-python-include=DIR - location of the python include dir],[ - if test "$withval" = "yes" -o "$withval" = "no"; then - AC_MSG_WARN(Usage: --with-python-include=includedir) - else - PYTHON_CFLAGS="-I${withval}" - fi - ]) + [AS_HELP_STRING([--with-python-include=DIR], + [location of the python include dir])],[ + if test "$withval" = "yes" -o "$withval" = "no"; then + AC_MSG_WARN(Usage: --with-python-include=includedir) + else + PYTHON_CFLAGS="-I${withval}" + fi + ]) AC_ARG_WITH(python-lib, - [ --with-python-lib=NAME name of the python lib],[ - if test "$withval" = "yes" -o "$withval" = "no"; then - AC_MSG_WARN(Usage: --with-python-lib=name) - else - LDFLAGS="$LDFLAGS -l${withval}" - fi - ]) + [AS_HELP_STRING([--with-python-lib=NAME], + [name of the python lib])],[ + if test "$withval" = "yes" -o "$withval" = "no"; then + AC_MSG_WARN(Usage: --with-python-lib=name) + else + LDFLAGS="$LDFLAGS -l${withval}" + fi + ]) AC_CHECK_PROGS(PYTHON_CONFIG, python-config, no) @@ -989,7 +1035,11 @@ AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [ # Clean out junk: http://bugs.python.org/issue3290 # Python headers may need some -f* flags, leave them in. # We want the sed commands to look like 's/-[WDOm][[:alnum:][:punct:]][[:alnum:][:punct:]]*//g' and 's/-arch [^[:space:]]*//g', but automake eats brackets. - PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags | sed -e 's/-[[WDOm]][[[:alnum:][:punct:]]][[[:alnum:][:punct:]]]*//g' | sed -e 's/-arch @<:@^@<:@:space:@:>@@:>@*//g'` + #PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags | sed -e 's/-[[WDOm]][[[:alnum:][:punct:]]][[[:alnum:][:punct:]]]*//g' | sed -e 's/-arch @<:@^@<:@:space:@:>@@:>@*//g'` + # The above sed BRE matches parts of legal options, stipping down part of that option, resulting in invalid gcc arguments. Gentoo Bug #415793 + # For instance, '-floop-stip-mime' becomes '-floop-strip', and '-fvect-cost-model' becomes '-fvect-cost'. + # Tentative fix to require a non alphanumeric character before the initial hyphen of the BRE or the hyphen being the first character in the string. + PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags | sed -e 's/\(^\|[[^[:alnum:]]]\)-[[WDOm]][[[:alnum:][:punct:]]][[[:alnum:][:punct:]]]*//g' | sed -e 's/-arch @<:@^@<:@:space:@:>@@:>@*//g'` PYTHON_LDFLAGS=`$PYTHON_CONFIG --ldflags` fi @@ -1016,7 +1066,6 @@ AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [ AC_DEFUN(STEPMAKE_STL_DATA_METHOD, [ - AC_LANG_PUSH(C++) AC_CACHE_CHECK([for stl.data () method], [stepmake_cv_stl_data_method], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ @@ -1030,7 +1079,6 @@ void *p = v.data (); if test $stepmake_cv_stl_data_method = yes; then AC_DEFINE(HAVE_STL_DATA_METHOD, 1, [define if stl classes have data () method]) fi - AC_LANG_POP(C++) ])