X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=stepmake%2Faclocal.m4;h=c06224717b002f795b4ef184a37f48931c1b15f9;hb=c58b9bd118958423656e674c25d940cdec71f58a;hp=b51d087712eb3eb0b43e483094293863c495c0fd;hpb=1e2c23a85f2dbb849f5c71696c1bd320816270cb;p=lilypond.git diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index b51d087712..c06224717b 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -26,14 +26,20 @@ AC_DEFUN(STEPMAKE_GET_VERSION, [ ## -V: Workaround for python changequote(<<, >>)#dnl + ## Assume and hunt for dotted version multiplet. ## use eval trickery, because we cannot use multi-level $() instead of `` ## for compatibility reasons. - ## FIXME: what systems still do not have $() in /bin/sh? - eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep '[0-9]\.[0-9]' \ - | head -n 1 \ - | sed -e 's/.*[^-.0-9]\([0-9][0-9]*\.[0-9][.0-9]*\).*/\1/' \ - -e 's/^[^.0-9]*//' -e 's/[^.0-9]*$//'\`\" + + ## grab the first version number in --version output. + eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | + grep -E '(^| )[0-9][0-9]*\.[0-9]' | + head -n 1 | + tr ' ' '\n' | + sed 's/\([0-9][0-9]*\.[0-9][0-9.]*\).*/\1/g' | + grep -E '(^| )[0-9][0-9]*\.[0-9]' | + head -n 1\`\" + if test -z "$_ver"; then ## If empty, try date [fontforge] eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep '[0-9]\{6,8\}' \ @@ -161,8 +167,7 @@ AC_DEFUN(STEPMAKE_BISON, [ fi ]) - -AC_DEFUN(STEPMAKE_COMPILE, [ +AC_DEFUN(STEPMAKE_COMPILE_BEFORE, [ # -O is necessary to get inlining CFLAGS=${CFLAGS-""} CXXFLAGS=${CXXFLAGS-$CFLAGS} @@ -173,19 +178,23 @@ AC_DEFUN(STEPMAKE_COMPILE, [ 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 @@ -202,8 +211,13 @@ AC_DEFUN(STEPMAKE_COMPILE, [ if test $debug_b = yes; then OPTIMIZE="$OPTIMIZE -g" fi - - AC_PROG_CC +]) + +AC_DEFUN(STEPMAKE_COMPILE, [ + + AC_REQUIRE([STEPMAKE_COMPILE_BEFORE]) + AC_REQUIRE([AC_PROG_CC]) + STEPMAKE_OPTIONAL_REQUIRED(CC, cc, $1) LD='$(CC)' AC_SUBST(LD) @@ -213,12 +227,12 @@ AC_DEFUN(STEPMAKE_COMPILE, [ save_cflags="$CFLAGS" CFLAGS=" -pipe $CFLAGS"; AC_CACHE_CHECK([whether compiler understands -pipe], - [stepmake_cflags_pipe], + [stepmake_cv_cflags_pipe], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[/* -pipe test */]])], - [stepmake_cflags_pipe=yes], - [stepmake_cflags_pipe=no])) + [stepmake_cv_cflags_pipe=yes], + [stepmake_cv_cflags_pipe=no])) CFLAGS=$save_cflags - if test $stepmake_cflags_pipe = yes; then + if test $stepmake_cv_cflags_pipe = yes; then OPTIMIZE="$OPTIMIZE -pipe" fi fi @@ -248,7 +262,6 @@ AC_DEFUN(STEPMAKE_COMPILE, [ ]) AC_DEFUN(STEPMAKE_CXX, [ - AC_LANG([C++]) AC_PROG_CXX STEPMAKE_OPTIONAL_REQUIRED(CXX, c++, $1) @@ -263,12 +276,12 @@ AC_DEFUN(STEPMAKE_CXX, [ AC_DEFUN(STEPMAKE_CXXTEMPLATE, [ AC_CACHE_CHECK([whether explicit instantiation is needed], - lily_cv_need_explicit_instantiation, + stepmake_cv_need_explicit_instantiation, AC_LINK_IFELSE([AC_LANG_PROGRAM([[ template struct foo { static int baz; }; template int foo::baz = 1; - ]], [[ return foo::baz; ]])],[lily_cv_need_explicit_instantiation=no],[lily_cv_need_explicit_instantiation=yes])) - if test x"$lily_cv_need_explicit_instantiation"x = x"yes"x; then + ]], [[ return foo::baz; ]])],[stepmake_cv_need_explicit_instantiation=no],[stepmake_cv_need_explicit_instantiation=yes])) + if test x"$stepmake_cv_need_explicit_instantiation"x = x"yes"x; then AC_DEFINE(NEED_EXPLICIT_INSTANTIATION) fi ]) @@ -285,10 +298,12 @@ AC_DEFUN(STEPMAKE_DATADIR, [ build_package_datadir=$ugh_ugh_autoconf250_builddir/out$CONFIGSUFFIX/share/$package - DATADIR=`echo ${datadir} | sed "s!\\\${prefix}!$presome!"` + DATADIR=`echo ${datadir} | sed "s!\\\${datarootdir}!${prefix}/share!"` + DATADIR=`echo ${DATADIR} | sed "s!\\\${prefix}!$presome!"` BUILD_PACKAGE_DATADIR=`echo ${build_package_datadir} | sed "s!\\\${prefix}!$presome!"` AC_SUBST(datadir) + AC_SUBST(datarootdir) AC_SUBST(build_package_datadir) AC_DEFINE_UNQUOTED(DATADIR, ["${DATADIR}"]) AC_DEFINE_UNQUOTED(BUILD_PACKAGE_DATADIR, ["${BUILD_PACKAGE_DATADIR}"]) @@ -313,7 +328,31 @@ AC_DEFUN(STEPMAKE_LIBDIR, [ ]) +AC_DEFUN(STEPMAKE_PREFIX_EXPAND_FIXUP, [ + # undo expanding of explicit --infodir=/usr/share + # to ease install-time override with prefix=... + strip=`echo $includedir | eval sed s@^$prefix@@` + if test "$includedir" = "`eval echo $prefix$strip`"; then + includedir='${prefix}'$strip'' + fi + strip=`echo $libdir | eval sed s@^$exec_prefix@@` + if test "$libdir" = "`eval echo $exec_prefix$strip`"; then + libdir='${exec_prefix}'$strip'' + fi + strip=`echo $infodir | eval sed s@^$datarootdir@@` + if test "$infodir" = "`eval echo $datarootdir$strip`"; then + infodir='${datarootdir}'$strip'' + fi + strip=`echo $mandir | eval sed s@^$datarootdir@@` + if test "$mandir" = "`eval echo $datarootdir$strip`"; then + mandir='${datarootdir}'$strip'' + fi +]) + + AC_DEFUN(STEPMAKE_END, [ + STEPMAKE_PREFIX_EXPAND_FIXUP + AC_SUBST(OPTIONAL) AC_SUBST(REQUIRED) @@ -373,6 +412,7 @@ EOF print 'depth=' + ('../' * ( $d-1 ) ) print 'include \$(depth)/config\$(if \$(conf),-\$(conf),).make' 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 @@ -386,7 +426,7 @@ EOF cat < GNUmakefile -depth = ./ +depth = . include config\$(if \$(conf),-\$(conf),).make include \$(configure-srcdir)/GNUmakefile.in EOF @@ -415,9 +455,8 @@ 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_flexlexer_yy_current_buffer], + [stepmake_cv_flexlexer_yy_current_buffer], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ using namespace std; #include @@ -430,12 +469,11 @@ class yy_flex_lexer: public yyFlexLexer } }; ]])], - [stepmake_flexlexer_yy_current_buffer=yes], - [stepmake_flexlexer_yy_current_buffer=no])) - if test $stepmake_flexlexer_yy_current_buffer = yes; then + [stepmake_cv_flexlexer_yy_current_buffer=yes], + [stepmake_cv_flexlexer_yy_current_buffer=no])) + 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++) ]) @@ -448,9 +486,9 @@ AC_DEFUN(STEPMAKE_FLEXLEXER_LOCATION, [ using namespace std; #include EOF - FLEXLEXER_FILE=`$CXX -E conftest.cc | \ + FLEXLEXER_FILE=`eval $ac_cpp conftest.cc | \ sed 's!# 1 "\(.*FlexLexer.h\)"!@FLEXLEXER@\1@@!g' | grep '@@' | \ - sed 's!.*@FLEXLEXER@\(.*\)@@.*$!\1!g' ` >& /dev/null + sed 's!.*@FLEXLEXER@\(.*\)@@.*$!\1!g' ` 1> /dev/null 2> /dev/null rm conftest.cc AC_SUBST(FLEXLEXER_FILE) AC_MSG_RESULT($FLEXLEXER_FILE) @@ -474,24 +512,8 @@ 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 ]) @@ -606,7 +628,6 @@ AC_DEFUN(STEPMAKE_GXX, [ AC_DEFUN(STEPMAKE_INIT, [ - AC_PREREQ(2.50) . $srcdir/VERSION FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL MICRO_VERSION=$PATCH_LEVEL @@ -664,7 +685,11 @@ AC_DEFUN(STEPMAKE_INIT, [ AC_MSG_CHECKING(builddir) ugh_ugh_autoconf250_builddir="`pwd`" - if test "$srcdir" = "."; then + + here_dir=$(cd . && pwd) + full_src_dir=$(cd $srcdir && pwd) + + if test "$full_src_dir" = "$here_dir"; then srcdir_build=yes else srcdir_build=no @@ -724,8 +749,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]) ##'`# @@ -786,84 +812,6 @@ AC_DEFUN(STEPMAKE_INIT, [ ]) -AC_DEFUN(STEPMAKE_KPATHSEA, [ - - AC_ARG_WITH(kpathsea-include, - [ --with-kpathsea-include=DIR - location of the kpathsea include dir],[ - if test "$withval" = "yes" -o "$withval" = "no"; then - AC_MSG_WARN(Usage: --with-kpathsea-include=includedir) - else - CPPFLAGS="$CPPFLAGS -I${withval}" - fi - ]) - - AC_ARG_WITH(kpathsea-lib, - [ --with-kpathsea-lib=DIR location of the kpathsea lib dir],[ - if test "$withval" = "yes" -o "$withval" = "no"; then - AC_MSG_WARN(Usage: --with-kpathsea-lib=libdir) - else - LDFLAGS="$LDFLAGS -L${withval}" - fi - ]) - - kpathsea_b=yes - AC_ARG_ENABLE(kpathsea, - [ --enable-kpathsea use kpathsea lib. Default: on], - [kpathsea_b=$enableval]) - - save_LIBS="$LIBS" - if test "$kpathsea_b" != "no"; then - AC_CHECK_HEADERS([kpathsea/kpathsea.h],,kpathsea_b=no) - AC_CHECK_LIB(kpathsea, kpse_find_file) - AC_CHECK_FUNCS(kpse_find_file,,kpathsea_b=no) - if test "$kpathsea_b" = "no"; then - STEPMAKE_ADD_ENTRY(OPTIONAL, $warn) - fi - fi - - save_CFLAGS="$CFLAGS" - CFLAGS=`echo "-shared $CFLAGS" | sed -e 's/ -g//'` - AC_MSG_CHECKING([for shared libkpathsea]) - AC_TRY_LINK([#include ], - [kpse_var_expand ("\$TEXMF");], - [have_libkpathsea_so=maybe; - shared_size=`wc -c conftest$ac_exeext`; - shared_size=`echo $shared_size | sed -e 's/ .*//g'`], - [have_libkpathsea_so=no]) - - if test "$have_libkpathsea_so" = "maybe"; then - if test "$shared_size" -lt 40000 ; then - have_libkpathsea_so=yes - else - have_libkpathsea_so=no - fi - fi - - AC_MSG_RESULT($have_libkpathsea_so) - if test "$have_libkpathsea_so" = "yes"; then - AC_DEFINE(HAVE_LIBKPATHSEA_SO) - fi - CFLAGS="$save_CFLAGS" - - KPATHSEA_LIBS="$LIBS" - LIBS="$save_LIBS" - AC_MSG_CHECKING(whether to use kpathsea) - if test "$kpathsea_b" != no; then - AC_MSG_RESULT(yes) - KPATHSEA=1 - else - AC_MSG_RESULT(no) - KPATHSEA=0 - fi - - AC_SUBST(KPATHSEA) - AC_SUBST(KPATHSEA_LIBS) - AC_SUBST(HAVE_LIBKPATHSEA_SO, $have_libkpathsea_so) - AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA) -]) - - AC_DEFUN(STEPMAKE_LIB, [ STEPMAKE_PROGS(AR, ar, $1) AC_PROG_RANLIB @@ -894,12 +842,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) @@ -994,31 +944,45 @@ AC_DEFUN(STEPMAKE_PYTHON, [ if test -n "$pv"; then STEPMAKE_ADD_ENTRY($1, $pv) fi + # clear cached value since arg 2 might point us to a new binary + unset ac_cv_path_PYTHON + AC_PATH_PROG(PYTHON, $PYTHON) AC_SUBST(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) + + if test -z "$PYTHON_CFLAGS" -a "$PYTHON_CONFIG" != "no"; then + # 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_LDFLAGS=`$PYTHON_CONFIG --ldflags` + fi - if test "$cross_compiling" = "no" -a -z "$PYTHON_CFLAGS"; then + if test -z "$PYTHON_CFLAGS" -a "$cross_compiling" = "no"; then changequote(<<, >>)#dnl # alternatively, for python >= 2.0 # 'import sys, distutils.sysconfig; sys.stdout.write (distutils.sysconfig.get_python_inc ())' @@ -1038,22 +1002,22 @@ AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [ fi ]) + + AC_DEFUN(STEPMAKE_STL_DATA_METHOD, [ - AC_LANG_PUSH(C++) AC_CACHE_CHECK([for stl.data () method], - [stepmake_stl_data_method], + [stepmake_cv_stl_data_method], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include using namespace std; vector v; void *p = v.data (); ]])], - [stepmake_stl_data_method=yes], - [stepmake_stl_data_method=no])) - if test $stepmake_stl_data_method = yes; then + [stepmake_cv_stl_data_method=yes], + [stepmake_cv_stl_data_method=no])) + 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++) ]) @@ -1064,7 +1028,7 @@ AC_DEFUN(STEPMAKE_TEXMF_DIRS, [ AC_DEFUN(STEPMAKE_TEXMF, [ STEPMAKE_PROGS(METAFONT, mf-nowin mf mfw mfont, $1) - # STEPMAKE_PROGS(INIMETAFONT, inimf inimfont "$METAFONT -ini", $1) + STEPMAKE_PROGS(METAPOST, mpost, $1) AC_MSG_CHECKING(for working metafont mode) modelist='ljfour lj4 lj3 lj2 ljet laserjet' @@ -1161,28 +1125,6 @@ AC_DEFUN(STEPMAKE_FREETYPE2, [ fi ]) -AC_DEFUN(STEPMAKE_GTK2, [ - PKG_CHECK_MODULES(GTK2, $1 >= $3, have_gtk2=yes, true) - if test "$have_gtk2" = yes ; then - AC_DEFINE(HAVE_GTK2) - # Do not pollute user-CPPFLAGS with configure-CPPFLAGS - save_CPPFLAGS="$CPPFLAGS" - save_LIBS="$LIBS" - CPPFLAGS="$GTK2_CFLAGS $CPPFLAGS" - LIBS="$GTK2_LIBS $LIBS" - AC_SUBST(GTK2_CFLAGS) - AC_SUBST(GTK2_LIBS) - CPPFLAGS="$save_CPPFLAGS" - LIBS="$save_LIBS" - else - # UGR - # r="lib$1-dev or $1-devel" - r="libgtk2.0-dev or gtk2-devel" - ver="`pkg-config --modversion $1`" - STEPMAKE_ADD_ENTRY($2, ["$r >= $3 (installed: $ver)"]) - fi -]) - AC_DEFUN(STEPMAKE_PANGO, [ PKG_CHECK_MODULES(PANGO, $1 >= $3, have_pango16=yes, true) if test "$have_pango16" = yes ; then @@ -1256,11 +1198,11 @@ AC_DEFUN(STEPMAKE_WINDOWS, [ AC_CYGWIN AC_MINGW32 - if test "$CYGWIN" == "yes"; then + if test "$CYGWIN" = "yes"; then LN_S='cp -r' # Cygwin symbolic links do not work for native apps. program_suffix=.exe INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c" - elif test "$MINGW32" == "yes"; then + elif test "$MINGW32" = "yes"; then LN='cp -r' LN_S='cp -r' program_suffix=.exe @@ -1277,7 +1219,7 @@ AC_DEFUN(STEPMAKE_WINDOWS, [ AC_SUBST(program_suffix) AC_MSG_CHECKING([for some flavor of Windows]) - if test "$CYGWIN$MINGW32" == "nono"; then + if test "$CYGWIN$MINGW32" = "nono"; then PLATFORM_WINDOWS=no else PLATFORM_WINDOWS=yes