+AC_DEFUN(AC_STEPMAKE_BIBTEX2HTML, [
+ AC_CHECK_PROGS(BIBTEX2HTML, bibtex2html bib2html, error)
+ if test "$BIBTEX2HTML" = "bib2html"; then
+ BIBTEX2HTML_FLAGS='$< $(@)'
+ else
+ BIBTEX2HTML_FLAGS='-o $(@D)/$(*F) $<'
+ fi
+ AC_SUBST(BIBTEX2HTML)
+ AC_SUBST(BIBTEX2HTML_FLAGS)
+])
+
+
+AC_DEFUN(AC_STEPMAKE_COMPILE, [
+ # -O is necessary to get inlining
+ OPTIMIZE=""
+ CFLAGS=${CFLAGS:-""}
+ CXXFLAGS=${CXXFLAGS:-$CFLAGS}
+ LDFLAGS=${LDFLAGS:-""}
+ checking_b=yes
+ optimise_b=no
+ profile_b=no
+ debug_b=yes
+
+ AC_ARG_ENABLE(checking,
+ [ enable-checking set runtime checks (assert calls). Default: on],
+ [checking_b=$enableval] )
+
+ # actually, the default is: tja='-O' to get inlining...
+ # off='' --jcn
+
+ #actually, that sucks.
+ # tja looks like a typo. Default is optimisation off. --hwn
+
+ AC_ARG_ENABLE(optimise,
+ [ enable-optimise use maximal speed optimisations. Default: off],
+ [optimise_b=$enableval])
+
+ AC_ARG_ENABLE(profiling,
+ [ enable-profiling compile with gprof support. Default: off],
+ [profile_b=$enableval])
+
+ AC_ARG_ENABLE(debugging,
+ [ enable-debugging set debug info. Default: on],
+ [debug_b=$enableval])
+
+ AC_ARG_ENABLE(mingw-prefix,
+ [ enable-mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
+ [MINGWPREFIX=$enableval],
+ [MINGWPREFIX=no])
+
+ if test "$checking_b" = no; then
+ # ugh
+ AC_DEFINE(NDEBUG)
+ DEFINES="$DEFINES -DNDEBUG"
+ fi
+
+ if test "$optimise_b" = yes; then
+ OPTIMIZE="-O2 -finline-functions"
+ fi
+
+ if test "$optimise_b" = no; then
+ OPTIMIZE=""
+ fi
+
+ if test $profile_b = yes; then
+ EXTRA_LIBES="-pg"
+ OPTIMIZE="$OPTIMIZE -pg"
+ fi
+
+ if test $debug_b = yes; then
+ OPTIMIZE="$OPTIMIZE -g"
+ fi
+
+ # however, C++ support in mingw32 v 0.1.4 is still flaky
+ if test x$MINGWPREFIX != xno; then
+ ICFLAGS="-I$MINGWPREFIX/include"
+ ILDFLAGS="-$MINGWPREFIX/lib"
+ fi
+
+ AC_PROG_CC
+ LD='$(CC)'
+ AC_SUBST(LD)
+
+ CFLAGS="$CFLAGS $OPTIMIZE"
+ CPPFLAGS=${CPPFLAGS:-""}
+ AC_SUBST(cross_compiling)
+ AC_SUBST(CFLAGS)
+ AC_SUBST(CPPFLAGS)
+ AC_SUBST(LDFLAGS)
+ AC_SUBST(ICFLAGS)
+ AC_SUBST(ILDFLAGS)
+ AC_SUBST(DEFINES)
+ AC_SUBST(EXTRA_LIBES)
+])
+
+AC_DEFUN(AC_STEPMAKE_CXX, [
+ AC_LANG_CPLUSPLUS
+ AC_PROG_CXX
+
+ AC_CHECK_HEADER(FlexLexer.h, true,
+ AC_STEPMAKE_WARN(can"\'"t find flex header. Please install Flex headers correctly))
+
+ CPPFLAGS="$CPPFLAGS $DEFINES"
+ CXXFLAGS="$CXXFLAGS $OPTIMIZE"
+ LDFLAGS="$LDFLAGS $EXTRA_LIBES"
+
+ AC_SUBST(CXXFLAGS)
+ AC_SUBST(CXX)
+ LD='$(CXX)'
+ AC_SUBST(LD)
+])
+
+AC_DEFUN(AC_STEPMAKE_CXXTEMPLATE, [
+ AC_CACHE_CHECK([whether explicit instantiation is needed],
+ lily_cv_need_explicit_instantiation,
+ AC_TRY_LINK([
+ 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
+ AC_DEFINE(NEED_EXPLICIT_INSTANTIATION)
+ fi
+])
+
+AC_DEFUN(AC_STEPMAKE_DATADIR, [
+ if test "$datadir" = "\${prefix}/share"; then
+ datadir='${prefix}/share/'$package
+ fi
+ DIR_DATADIR=${datadir}
+ presome=${prefix}
+ if test "$prefix" = "NONE"; then
+ presome=${ac_default_prefix}
+ fi
+ DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
+ AC_SUBST(datadir)
+ AC_SUBST(DIR_DATADIR)
+ AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
+])
+
+AC_DEFUN(AC_STEPMAKE_END, [
+ AC_OUTPUT($CONFIGFILE.make:config.make.in)
+
+ rm -f $srcdir/GNUmakefile
+ cp $srcdir/make/toplevel.make.in $srcdir/GNUmakefile
+ chmod 444 $srcdir/GNUmakefile
+ if test "$builddir" != "."; then
+ rm -f GNUmakefile
+ cp $srcdir/make/srcdir.make.in GNUmakefile
+ chmod 444 GNUmakefile
+ fi
+])
+
+AC_DEFUN(AC_STEPMAKE_GXX, [
+ # ugh autoconf
+ # urg, egcs: how to check for egcs >= 1.1?
+ changequote(<<, >>)dnl
+ if $CXX --version | egrep '2\.[89]' > /dev/null ||
+ $CXX --version | grep 'egcs' > /dev/null
+ changequote([, ])dnl
+ then
+ true
+ else
+ AC_STEPMAKE_WARN(can\'t find g++ 2.8, 2.9 or egcs 1.1)
+ fi
+])
+
+AC_DEFUN(AC_STEPMAKE_GUILE, [
+ ## First, let's just see if we can find Guile at all.
+ AC_MSG_CHECKING("for guile-config")
+ for guile_config in guile-config $target-guile-config $build-guile-config; do
+ AC_MSG_RESULT("$guile_config")
+ if ! $guile_config --version > /dev/null 2>&1 ; then
+ AC_MSG_WARN("cannot execute $guile_config")
+ AC_MSG_CHECKING("if we are cross compiling")
+ guile_config=error
+ else
+ break
+ fi
+ done
+ if test "$guile_config" = "error"; then
+ AC_MSG_ERROR("cannot find guile-config; is Guile installed?")
+ exit 1
+ fi
+ AC_MSG_CHECKING("Guile version")
+ need_guile_version="1.3.4"
+ need_guile_version_numeric=100304
+ guile_version=`$guile_config --version 2>&1 | awk '{print $NF}'`
+ guile_version_numeric=`echo $guile_version | awk -F. '
+{if ([$]3) {last = [$]3}
+else {last =0}}
+{printf "%s%s%s\n",[$]1*100, [$]2*10,last}'`
+ AC_MSG_RESULT("$guile_version")
+ if test $guile_version_numeric -lt $need_guile_version_numeric
+ then
+ AC_STEPMAKE_WARN("Guile version "$need_guile_version" or newer is needed")
+ fi
+ GUILE_FLAGS
+ AC_PATH_PROG(GUILE, guile, error)
+ AC_SUBST(GUILE)
+])
+
+AC_DEFUN(AC_STEPMAKE_INIT, [
+
+ . $srcdir/VERSION
+ FULL_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
+ if test x$MY_PATCH_LEVEL != x; then
+ FULL_VERSION=$FULL_VERSION.$MY_PATCH_LEVEL
+ fi
+
+ # urg: don't "fix" this: irix doesn't know about [:lower:] and [:upper:]
+ changequote(<<, >>)dnl
+ PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'`
+ package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
+ changequote([, ])dnl
+
+ # No versioning on directory names of sub-packages
+ # urg, urg
+ stepmake=${datadir}/stepmake
+ presome=${prefix}
+ if test "$prefix" = "NONE"; then
+ presome=${ac_default_prefix}
+ fi
+ stepmake=`echo ${stepmake} | sed "s!\\\${prefix}!$presome!"`
+
+ # urg, how is this supposed to work?
+ if test "$program_prefix" = "NONE"; then
+ program_prefix=
+ fi
+ if test "$program_suffix" = "NONE"; then
+ program_suffix=
+ fi
+
+ AC_MSG_CHECKING(Package)
+ if test "x$PACKAGE" = "xSTEPMAKE"; then
+ AC_MSG_RESULT(Stepmake package!)
+
+ #if test "x$builddir" != "x"; then
+ # builddir="../$builddir"
+ #else
+ # builddir=..
+ #fi
+ if test "$srcdir" != "."; then
+ absolute_builddir="`pwd`"
+ package_absolute_builddir="`dirname $absolute_builddir`"
+ package_srcdir="`dirname $srcdir`"
+ builddir="`dirname $package_srcdir`/`basename $package_absolute_builddir`/`basename $absolute_builddir`"
+ else
+ builddir=.
+ fi
+
+ (cd stepmake 2>/dev/null || mkdir stepmake)
+ (cd stepmake; rm -f stepmake; ln -s ../$srcdir/stepmake .)
+ (cd stepmake; rm -f bin; ln -s ../$srcdir/bin .)
+ AC_CONFIG_AUX_DIR(bin)
+ stepmake=stepmake
+ else
+ AC_MSG_RESULT($PACKAGE)
+
+ if test "$srcdir" != "."; then
+ absolute_builddir="`pwd`"
+ builddir="`dirname $srcdir`/`basename $absolute_builddir`"
+ else
+ builddir=.
+ fi
+
+ AC_MSG_CHECKING(for stepmake)
+ # Check for installed stepmake
+ if test -d $stepmake; then
+ AC_MSG_RESULT($stepmake)
+ else
+ stepmake='$(depth)'/$srcdir/stepmake
+ AC_MSG_RESULT($srcdir/stepmake ($datadir/stepmake not found))
+ fi
+ AC_CONFIG_AUX_DIR(\
+ $HOME/usr/local/share/stepmake/bin\
+ $HOME/usr/local/lib/stepmake/bin\
+ $HOME/usr/share/stepmake/bin\
+ $HOME/usr/lib/stepmake/bin\
+ /usr/local/share/stepmake/bin\
+ /usr/local/lib/stepmake/bin\
+ /usr/share/stepmake/bin\
+ /usr/lib/stepmake/bin\
+ stepmake/bin\
+ $srcdir/stepmake/bin\
+ )
+ fi
+
+ AC_SUBST(builddir)
+ AC_SUBST(stepmake)
+ AC_SUBST(package)
+ AC_SUBST(PACKAGE)
+ AC_SUBST(PACKAGE_NAME)
+ AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE_NAME}")
+ AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
+
+ if test "$package_depth" = "" ; then
+ package_depth="."
+ else
+ package_depth="../$package_depth"
+ fi
+ export package_depth
+ AC_SUBST(package_depth)
+
+ AUTOGENERATE="This file was automatically generated by configure"
+ AC_SUBST(AUTOGENERATE)
+
+ CONFIGSUFFIX=
+ AC_ARG_ENABLE(config,
+ [ enable-config=FILE put configure settings in config-FILE.make],
+ [CONFIGSUFFIX=-$enableval])
+
+ CONFIGFILE=config$CONFIGSUFFIX
+ AC_SUBST(CONFIGSUFFIX)
+
+ AC_CANONICAL_HOST
+ AC_CHECK_PROGS(MAKE, gmake make, error)
+ AC_CHECK_PROGS(FIND, find, error)
+
+dnl system supplied INSTALL is unsafe; use our own install.
+dnl AC_PROG_INSTALL
+dnl if test "$INSTALL" = "bin/install-sh"; then
+dnl export INSTALL="\$\(depth\)/bin/install-sh"
+dnl fi
+
+ AC_CHECK_PROGS(TAR, tar, error)
+
+ if test "x`uname`" = "xHP-UX"; then
+ AC_PATH_PROG(BASH, bash, /bin/sh)
+ AC_STEPMAKE_WARN(avoiding buggy /bin/sh)
+ AC_PATH_PROG(SHELL, bash, /bin/ksh)
+ else
+ AC_PATH_PROG(BASH, bash, /bin/sh)
+ SHELL=/bin/sh
+ AC_SUBST(SHELL)
+ fi
+
+
+ AC_PATH_PROG(PYTHON, ${PYTHON:-python}, -echo no python)
+ AC_SUBST(PYTHON)
+
+ if test $MAKE != "error" ; then
+ $MAKE -v 2> /dev/null | grep GNU > /dev/null
+ if test "$?" = 1
+ then
+ AC_STEPMAKE_WARN(Please install *GNU* make)
+ fi
+ fi
+
+ AC_CHECK_SEARCH_RESULT($PYTHON, python, You should install Python)
+
+ if test "x$OSTYPE" = "xcygwin32" || test "x$OSTYPE" = "xWindows_NT"; then
+ LN=cp # hard link does not work under cygnus-nt
+ LN_S='cp -r' # symbolic link does not work for native nt
+ ZIP="zip -r -9" #
+ program_suffix=.exe
+ # urg
+ # DIRSEP='\\'
+ # PATHSEP=';'
+ #
+ # cygwin fixes all these things.
+ # it seems these were used because of dos-style TEXINPUTS and
+ # MFINPUTS needed for miktex.
+ # but this breaks parsing of all other cygwin/unix style paths.
+ #
+ # if your (mik)tex breaks, make a:
+ # /usr/local/bin/tex:
+ # #!/bin/sh
+ # TEXINPUTS=`cygpath -pw $TEXINPUTS` /texmf/miktex/bin/tex $*
+ #
+ # and
+ #
+ # /usr/local/bin/mf:
+ # #!/bin/sh
+ # MFINPUTS=`cygpath -pw $MFINPUTS` /texmf/miktex/bin/mf $*
+ #
+ # this way, you may have buildscripts/out/lilypond-profile
+ # 'automatically' sourced from /usr/etc/profile.d/ too.
+ #
+ DIRSEP='/'
+ PATHSEP=':'
+ INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
+ else
+ DIRSEP='/'
+ PATHSEP=':'
+ LN=ln
+ LN_S='ln -s'
+ ZIP="zip -r -9"
+ INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
+ fi
+ AC_SUBST(program_prefix)
+ AC_SUBST(program_suffix)
+ AC_SUBST(ZIP)
+ AC_SUBST(LN)
+ AC_SUBST(LN_S)
+ AC_SUBST(INSTALL)
+ AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
+ AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
+ AC_SUBST(PATHSEP)
+ AC_SUBST(DIRSEP)
+
+ AC_STEPMAKE_DATADIR
+])
+
+AC_DEFUN(AC_STEPMAKE_KPATHSEA, [
+
+ kpathsea_b=yes
+ AC_ARG_ENABLE(kpathsea,
+ [ enable-kpathsea use kpathsea lib. Default: on],
+ [kpathsea_b=$enableval])
+
+ if test $kpathsea_b = yes; then
+ AC_HAVE_HEADERS(kpathsea/kpathsea.h)
+ AC_CHECK_LIB(kpathsea, kpse_find_file)
+ # urg: kpse_find_tfm is a #define, how to check for this?
+ # AC_CHECK_LIB(kpathsea, kpse_find_tfm)
+ # AC_CHECK_FUNCS(kpse_find_file kpse_find_tfm,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.))
+ AC_CHECK_FUNCS(kpse_find_file,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.) kpathsea_b=no)
+ fi
+ AC_MSG_CHECKING(whether to use kpathsea)
+ if test $kpathsea_b = yes; then
+ AC_MSG_RESULT(yes)
+ KPATHSEA=1
+ else
+ AC_MSG_RESULT(no)
+ KPATHSEA=0
+ fi
+
+ AC_SUBST(KPATHSEA)
+ AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
+])
+
+AC_DEFUN(AC_STEPMAKE_LEXYACC, [
+ # ugh, automake: we want (and check for) bison
+ AC_PROG_YACC
+ # ugh, automake: we want (and check for) flex
+ # AC_PROG_LEX
+ # urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
+
+ # AC_DECL_YYTEXT
+ # ugh, ugh
+ ac_cv_prog_lex_root=lex.yy
+
+ AC_CHECK_PROGS(BISON, bison, error)
+ AC_CHECK_PROGS(FLEX, flex, error)
+ AC_CHECK_SEARCH_RESULT($BISON, bison, Please install Bison, 1.25 or newer)
+ AC_CHECK_SEARCH_RESULT($FLEX, flex, Please install Flex, 2.5 or newer)
+
+ if test $BISON != "error"; then
+ bison_version=`$BISON --version | sed 's/^.*version 1.//g'`
+ if test `echo $bison_version | sed 's/\..*$//g'` -lt 25; then
+ AC_STEPMAKE_WARN(Your bison is a bit old (1.$bison_version). You might have to install 1.25)
+ fi
+ fi
+
+ AC_SUBST(BISON)
+ AC_SUBST(FLEX)
+])
+
+AC_DEFUN(AC_STEPMAKE_LIB, [
+ AC_CHECK_PROGS(AR, ar, error)
+ AC_PROG_RANLIB
+
+ AC_SUBST(AR)
+ AC_SUBST(RANLIB)
+])
+
+AC_DEFUN(AC_STEPMAKE_LIBTOOL, [
+ # libtool.info ...
+ # **Never** try to set library version numbers so that they correspond
+ # to the release number of your package. This is an abuse that only
+ # fosters misunderstanding of the purpose of library versions.
+
+ REVISION=$PATCH_LEVEL
+ # CURRENT=$MINOR_VERSION
+ CURRENT=`expr $MINOR_VERSION + 1`
+ # AGE=$(expr $MAJOR_VERSION + 1)
+ AGE=$MAJOR_VERSION
+ AC_SUBST(CURRENT)
+ AC_SUBST(REVISION)
+ AC_SUBST(AGE)
+])
+
+AC_DEFUN(AC_STEPMAKE_LOCALE, [
+ lang=English
+ ALL_LINGUAS="en nl"
+
+ # with/enable ??
+ AC_ARG_WITH(localedir,
+ [ with-localedir=LOCALE use LOCALE as locale dir. 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],
+ language=$with_lang,
+ language=English)