]> git.donarmstrong.com Git - lilypond.git/blobdiff - configure.in
use trap to remove tmp directory on failure to avoid hiding mpost
[lilypond.git] / configure.in
index 2cc862690a7df5db08357433b1e962efb2dbfa7b..0189be15b2aedb767832d777eccd8c6955dde845 100644 (file)
@@ -1,7 +1,9 @@
 dnl configure.in   -*-shell-script-*-
-dnl Process this file with autoconf to produce a configure script. 
+dnl Process this file with autoconf to produce a configure script.
 
-# Bootstrap the init proces.
+AC_PREREQ(2.60)
+
+# Bootstrap the init process.
 AC_INIT
 
 # Bootstrap StepMake configure
@@ -18,47 +20,46 @@ STEPMAKE_INIT
 AC_CONFIG_SRCDIR([lily/main.cc])
 
 # Move to aclocal.m4?
-AC_CONFIG_HEADER([$CONFIGFILE.hh:config.hh.in])
+AC_CONFIG_HEADERS([$CONFIGFILE.hh:config.hh.in])
 
 # Uncomment the configuration options your package needs.
 
 DOCUMENTATION=yes
 AC_ARG_ENABLE(documentation,
-    [  --enable-documentation  build Documentation.  Default: on],
+    [AS_HELP_STRING([--enable-documentation],
+                   [build Documentation.  Default: on])],
     [DOCUMENTATION=$enableval])
 AC_SUBST(DOCUMENTATION)
 
-gui_b=no
-AC_ARG_ENABLE(gui,
-    [  --enable-gui            compile with experimental GNOME output.  Default: off],
-    [gui_b=$enableval])
-
-
 AC_ARG_WITH(ncsb-dir,
-    [  --with-ncsb-dir=DIR     location of Century Schoolbook fonts.],
+    [AS_HELP_STRING([--with-ncsb-dir=DIR],
+                   [location of Century Schoolbook fonts.])],
     [NCSB_DIR=$withval],
     [NCSB_DIR=""])
 
 reloc_b=no
 AC_ARG_ENABLE(relocation,
-    [  --enable-relocation     compile with dynamic relocation.  Default: off],
+    [AS_HELP_STRING([--enable-relocation],
+                   [compile with dynamic relocation.  Default: off])],
     [reloc_b=$enableval])
 
 rpath_b=no
 AC_ARG_ENABLE(rpath,
-    [  --enable-rpath          hardcode runtime library path.  Default: off],
+    [AS_HELP_STRING([--enable-rpath],
+                   [hardcode runtime library path.  Default: off])],
     [rpath_b=$enableval])
 
 LINK_GXX_STATICALLY=no
 AC_ARG_ENABLE(static-gxx,
-    [  --enable-static-gxx     link libstdc++.a statically. Default: off],
+    [AS_HELP_STRING([--enable-static-gxx],
+                   [link libstdc++.a statically.  Default: off])],
     [LINK_GXX_STATICALLY=$enableval])
 AC_SUBST(LINK_GXX_STATICALLY)
 
 # must come before any header checks
 STEPMAKE_COMPILE
 
-AC_CHECK_PROG(FCMATCH, fc-match, fc-match)
+AC_CHECK_PROG(FCLIST, fc-list, fc-list)
 AC_MSG_CHECKING([New Century Schoolbook PFB files])
 AC_SUBST(NCSB_SOURCE_FILES)
 if test "$NCSB_DIR" != "" ;  then
@@ -71,29 +72,34 @@ if test "$NCSB_DIR" != "" ;  then
     fi
   done
 else
-  if test "$FCMATCH" != ""; then
+  if test "$FCLIST" != ""; then
     for style in Roman Italic "Bold Italic" Bold; do
-      NCSB_FILE=`$FCMATCH --verbose "Century Schoolbook L:style=$style" | grep 'file:' | grep -v "\.ttf"`
-
-      NCSB_FILE=`echo $NCSB_FILE | sed 's/^.*"\(.*\)".*$/\1/g'`
+      NCSB_FILE=`$FCLIST "Century Schoolbook L:style=$style:foundry=urw:fontformat=Type 1" file \
+                | head -n 1`
+      NCSB_FILE=`echo $NCSB_FILE | sed 's/^\(.*\):$/\1/g'`
       NCSB_FILE=`$PYTHON "$srcdir/scripts/auxiliar/readlink.py" $NCSB_FILE`
       NCSB_SOURCE_FILES="$NCSB_FILE $NCSB_SOURCE_FILES"
     done
   else
     AC_MSG_RESULT(not found)
-    echo "Can't find Century Schoolbook files. Install FontConfig's fc-match,"
+    echo "Can't find Century Schoolbook files. Install FontConfig's fc-list,"
     echo "or use --with-ncsb-dir"
   fi
 fi
 AC_MSG_RESULT($NCSB_SOURCE_FILES)
 
-
+AC_LANG([C++])
 
 STEPMAKE_PYTHON(REQUIRED, 2.4)
-STEPMAKE_GCC(REQUIRED, 3.4)
+# this checks if we have GNU C by compiling a program with
+# __GNUC__, but that macro now unofficially means "the compiler
+# supports the GNU C extensions" -- the intel C compiler and clang
+# both support __GNUC__!
+STEPMAKE_GCC_OR_CLANG(REQUIRED, 3.4)
 
 STEPMAKE_CXX(REQUIRED)
-STEPMAKE_GXX(REQUIRED, 3.4)
+STEPMAKE_GXX_OR_CLANG(REQUIRED, 3.4)
+STEPMAKE_GXXCODEGENBUG
 STEPMAKE_CXXTEMPLATE
 STEPMAKE_STL_DATA_METHOD
 STEPMAKE_LIB(REQUIRED)
@@ -104,58 +110,73 @@ STEPMAKE_BISON(OPTIONAL, 1.29)
 STEPMAKE_FLEX(REQUIRED)
 STEPMAKE_FLEXLEXER(REQUIRED)
 STEPMAKE_FLEXLEXER_LOCATION
-AC_LANG_C
 STEPMAKE_LOCALE
 STEPMAKE_GETTEXT
 STEPMAKE_MSGFMT(REQUIRED)
 STEPMAKE_TEXMF(REQUIRED)
 STEPMAKE_TEXMF_DIRS
-
-## should check for 1.8.2 ?  
-STEPMAKE_GUILE_DEVEL(REQUIRED, 1.8.0)
-
+STEPMAKE_GUILE_DEVEL(REQUIRED, 1.8.2)
+
+# check for 3 typedefs added in Guile 1.9
+save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$GUILE_CFLAGS $CXXFLAGS"
+AC_CHECK_TYPES([scm_t_hash_fold_fn, scm_t_hash_handle_fn],
+              [AC_DEFINE(HAVE_GUILE_HASH_FUNC)], [],
+              [#include <libguile.h>])
+AC_CHECK_TYPES([scm_t_subr],
+              [AC_DEFINE(HAVE_GUILE_SUBR_TYPE)], [],
+              [#include <libguile.h>])
+CXXFLAGS="$save_CXXFLAGS"
+
+## Check for usable cxxabi
+save_LIBS="$LIBS"
+LIBS="$LIBS $CXXABI_LIBS"
+AC_MSG_CHECKING(for usable C++ demangler)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <cxxabi.h>],
+           [abi::__cxa_demangle ("", 0, 0, 0)])],
+    [AC_DEFINE(HAVE_CXA_DEMANGLE)
+       AC_MSG_RESULT(yes)],[
+       LIBS="$LIBS -lsupc++"
+       AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <cxxabi.h>],
+                   [abi::__cxa_demangle ("", 0, 0, 0)])],
+           [AC_DEFINE(HAVE_CXA_DEMANGLE)
+               AC_MSG_RESULT([yes, using -lsupc++])
+               CXXABI_LIBS="$CXXABI_LIBS -lsupc++"],
+           [AC_MSG_RESULT([no, use c++filt -t for manual demangling])])])
+LIBS="$save_LIBS"
+AC_SUBST(CXXABI_LIBS)
 
 ## check rational bugfix.
 save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$GUILE_CFLAGS $CPPFLAGS"
 AC_MSG_CHECKING(GUILE rational bugfix)
-AC_TRY_CPP(
-#include <libguile.h>
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <libguile.h>
 #ifdef SCM_FRACTION_REDUCED_BIT
-#error 
+#error
 #endif
-,
-AC_MSG_RESULT(ok),
-REQUIRED="$REQUIRED GUILE-with-rational-bugfix"
-AC_MSG_RESULT(Must have patched GUILE rational support. See INSTALL.txt))
+]])],[AC_MSG_RESULT(ok)],[REQUIRED="$REQUIRED GUILE-with-rational-bugfix"
+AC_MSG_RESULT(Must have patched GUILE rational support. See INSTALL.txt)])
 CPPFLAGS="$save_CPPFLAGS"
 
 
 STEPMAKE_PYTHON_DEVEL(REQUIRED)
 
-STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, OPTIONAL, 8.15)
+STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, OPTIONAL, 8.60)
 
-STEPMAKE_PATH_PROG(FONTFORGE, fontforge, REQUIRED, 20050624)
+STEPMAKE_PATH_PROG(FONTFORGE, fontforge, REQUIRED, 20100501)
+STEPMAKE_PATH_PROG(FONTFORGE, fontforge, OPTIONAL, 20110222)
 
 STEPMAKE_PATH_PROG(T1ASM, t1asm, REQUIRED)
 
 AC_CHECK_HEADERS([assert.h grp.h libio.h pwd.h sys/stat.h wchar.h fpu_control.h])
-AC_LANG_PUSH(C++)
-AC_CHECK_HEADERS([sstream boost/lambda/lambda.hpp])
-AC_LANG_POP(C++)
+AC_CHECK_HEADERS([sstream])
 AC_HEADER_STAT
 AC_FUNC_MEMCMP
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([chroot fopencookie funopen gettext isinf mbrtowc memmem snprintf vsnprintf wcrtomb])
-AC_CHECK_HEADERS([utf8/wchar.h], LIBS="$LIBS -lutf8")
-AC_SEARCH_LIBS(mbrtowc, [mingwex msvcp60])
+AC_CHECK_FUNCS([chroot fopencookie gettext isinf memmem snprintf vsnprintf])
 
 STEPMAKE_PROGS(PKG_CONFIG, pkg-config, REQUIRED, 0.9.0)
 
-if test "$gui_b" = "yes"; then
-    STEPMAKE_GTK2(gtk+-2.0, REQUIRED, 2.4.0)
-fi
-
 AC_MSG_CHECKING(whether to enable dynamic relocation)
 if test "$reloc_b" = "yes"; then
     AC_DEFINE(ARGV0_RELOCATION)
@@ -174,8 +195,7 @@ HOST_ARCH=`$CC -dumpmachine`
 AC_SUBST(HOST_ARCH)
 
 STEPMAKE_PANGO_FT2(pangoft2, REQUIRED, 1.6.0)
-#STEPMAKE_PANGO(pango, REQUIRED, 1.6.0)
-STEPMAKE_FONTCONFIG(fontconfig, REQUIRED, 2.2.0)
+STEPMAKE_FONTCONFIG(fontconfig, REQUIRED, 2.4.0)
 STEPMAKE_FREETYPE2(freetype2, REQUIRED, 2.1.10)
 
 STEPMAKE_WINDOWS
@@ -189,7 +209,15 @@ STEPMAKE_GUILE(OPTIONAL)
 STEPMAKE_PERL(OPTIONAL)
 
 STEPMAKE_PROGS(MAKEINFO, makeinfo, REQUIRED, 4.11)
-STEPMAKE_PROGS(TEXI2HTML, texi2html, REQUIRED, 1.80)
+STEPMAKE_PROGS(TEXI2HTML, texi2html, OPTIONAL, 1.82)
+STEPMAKE_PROGS(DBLATEX, dblatex, OPTIONAL, 0.1.4)
+STEPMAKE_PROGS(PDFLATEX, pdflatex, OPTIONAL)
+STEPMAKE_PROGS(NETPBM, pngtopnm, OPTIONAL)
+STEPMAKE_PROGS(IMAGEMAGICK, convert, OPTIONAL)
+# this name avoids a conflict with ZIP in stepmake/aclocal.m4
+STEPMAKE_PROGS(ZIPDOC, zip, OPTIONAL)
+STEPMAKE_PROGS(RSYNC, rsync, OPTIONAL)
+
 
 AC_DEFINE_UNQUOTED(FLOWER_VERSION, "${FULL_FLOWER_VERSION}")
 
@@ -205,6 +233,11 @@ STEPMAKE_END
 
 test -n "$CONFIGURATION" && mc=" conf=$CONFIGURATION" || mc=""
 
+if make top-doc 1>/dev/null 2>&1; then
+    rm -f INSTALL.txt && ln Documentation/topdocs/out/INSTALL.txt .
+    rm -f README.txt && ln Documentation/topdocs/out/README.txt .
+fi
+
 cat <<EOF
 
 Type: