]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/aclocal.m4
Fix build with Autoconf 2.64
[lilypond.git] / stepmake / aclocal.m4
index 77074a62dca865b94151d27e0416a3fd02a9966e..3786968be37961ffde0fdf15a9a6aa21b4dd50ab 100644 (file)
@@ -205,7 +205,6 @@ AC_DEFUN(STEPMAKE_COMPILE, [
        OPTIMIZE="$OPTIMIZE -g"
     fi
  
-    AC_PROG_CC
     STEPMAKE_OPTIONAL_REQUIRED(CC, cc, $1)
     LD='$(CC)'
     AC_SUBST(LD)
@@ -215,12 +214,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
@@ -265,12 +264,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 <class T> struct foo { static int baz; };
     template <class T> int foo<T>::baz = 1;
-    ]], [[ return foo<int>::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<int>::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
 ])
@@ -317,7 +316,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)
     
@@ -377,6 +400,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
@@ -421,7 +445,7 @@ AC_DEFUN(STEPMAKE_FLEXLEXER, [
     # 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 <FlexLexer.h>
@@ -434,9 +458,9 @@ 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++)
@@ -985,16 +1009,16 @@ AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
 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 <vector>
 using namespace std;
 vector <int> 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++)