1 dnl configure.in -*-shell-script-*-
2 dnl Process this file with autoconf to produce a configure script.
6 # Bootstrap the init process.
9 # Bootstrap StepMake configure
11 AC_CONFIG_AUX_DIR([stepmake/bin])
13 # For stepmake package:
14 # AC_CONFIG_AUX_DIR(bin)
19 # List a file that identifies your package.
20 AC_CONFIG_SRCDIR([lily/main.cc])
23 AC_CONFIG_HEADERS([$CONFIGFILE.hh:config.hh.in])
25 # Uncomment the configuration options your package needs.
28 AC_ARG_ENABLE(documentation,
29 [AS_HELP_STRING([--enable-documentation],
30 [build Documentation. Default: on])],
31 [DOCUMENTATION=$enableval])
32 AC_SUBST(DOCUMENTATION)
35 [AS_HELP_STRING([--with-ncsb-dir=DIR],
36 [location of Century Schoolbook fonts.])],
41 AC_ARG_ENABLE(relocation,
42 [AS_HELP_STRING([--enable-relocation],
43 [compile with dynamic relocation. Default: off])],
48 [AS_HELP_STRING([--enable-rpath],
49 [hardcode runtime library path. Default: off])],
52 LINK_GXX_STATICALLY=no
53 AC_ARG_ENABLE(static-gxx,
54 [AS_HELP_STRING([--enable-static-gxx],
55 [link libstdc++.a statically. Default: off])],
56 [LINK_GXX_STATICALLY=$enableval])
57 AC_SUBST(LINK_GXX_STATICALLY)
59 # must come before any header checks
62 AC_CHECK_PROG(FCLIST, fc-list, fc-list)
63 AC_MSG_CHECKING([New Century Schoolbook PFB files])
64 AC_SUBST(NCSB_SOURCE_FILES)
66 UNCHECKED_NCSB_SOURCE_FILES=""
67 if test "$NCSB_DIR" != "" ; then
68 for f in c059013l c059016l c059033l c059036l; do
69 if test ! -f "$NCSB_DIR/$f.pfb"; then
70 STEPMAKE_WARN($NCSB_DIR does not contain $f.pfb.)
72 UNCHECKED_NCSB_SOURCE_FILES="$NCSB_DIR/$f.pfb $UNCHECKED_NCSB_SOURCE_FILES"
76 if test "$FCLIST" != ""; then
77 for style in Roman Italic "Bold Italic" Bold; do
78 NCSB_FILE=`$FCLIST "Century Schoolbook L:style=$style:foundry=urw:fontformat=Type 1" file \
80 NCSB_FILE=`echo $NCSB_FILE | sed 's/\(:.*\)$//g'`
81 NCSB_FILE=`$PYTHON "$srcdir/scripts/auxiliar/readlink.py" $NCSB_FILE`
82 UNCHECKED_NCSB_SOURCE_FILES="$NCSB_FILE $UNCHECKED_NCSB_SOURCE_FILES"
84 NCSB_DIR=`AS_DIRNAME($NCSB_FILE)`
86 AC_MSG_RESULT(not found)
87 echo "Can't find Century Schoolbook files. Install FontConfig's fc-list,"
88 echo "or use --with-ncsb-dir"
92 for f in $UNCHECKED_NCSB_SOURCE_FILES; do
93 if test "`grep Cyrillic "$f"`" = ""; then
94 STEPMAKE_WARN($f does not have Cyrillic characters.)
96 NCSB_SOURCE_FILES="$f $NCSB_SOURCE_FILES"
99 AC_MSG_RESULT($NCSB_SOURCE_FILES)
103 STEPMAKE_PYTHON(REQUIRED, 2.4)
104 # this checks if we have GNU C by compiling a program with
105 # __GNUC__, but that macro now unofficially means "the compiler
106 # supports the GNU C extensions" -- the intel C compiler and clang
107 # both support __GNUC__!
108 STEPMAKE_GCC_OR_CLANG(REQUIRED, 3.4)
110 STEPMAKE_CXX(REQUIRED)
111 STEPMAKE_GXX_OR_CLANG(REQUIRED, 3.4)
112 STEPMAKE_GXXCODEGENBUG
114 STEPMAKE_STL_DATA_METHOD
115 STEPMAKE_LIB(REQUIRED)
117 # Do not use bison 1.50 and 1.75.
118 # 1.29 is required fr %locations, but I'm not sure it's enough --ns
119 STEPMAKE_BISON(OPTIONAL, 1.29)
120 STEPMAKE_FLEX(REQUIRED)
121 STEPMAKE_FLEXLEXER(REQUIRED)
122 STEPMAKE_FLEXLEXER_LOCATION
125 STEPMAKE_MSGFMT(REQUIRED)
126 STEPMAKE_TEXMF(REQUIRED)
128 STEPMAKE_GUILE_DEVEL(REQUIRED, 1.8.2)
130 # check for 3 typedefs added in Guile 1.9
131 save_CXXFLAGS="$CXXFLAGS"
132 CXXFLAGS="$GUILE_CFLAGS $CXXFLAGS"
133 AC_CHECK_TYPES([scm_t_hash_fold_fn, scm_t_hash_handle_fn],
134 [AC_DEFINE(HAVE_GUILE_HASH_FUNC)], [],
135 [#include <libguile.h>])
136 AC_CHECK_TYPES([scm_t_subr],
137 [AC_DEFINE(HAVE_GUILE_SUBR_TYPE)], [],
138 [#include <libguile.h>])
139 CXXFLAGS="$save_CXXFLAGS"
141 ## Check for usable cxxabi
143 LIBS="$LIBS $CXXABI_LIBS"
144 AC_MSG_CHECKING(for usable C++ demangler)
145 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <cxxabi.h>],
146 [abi::__cxa_demangle ("", 0, 0, 0)])],
147 [AC_DEFINE(HAVE_CXA_DEMANGLE)
148 AC_MSG_RESULT(yes)],[
149 LIBS="$LIBS -lsupc++"
150 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <cxxabi.h>],
151 [abi::__cxa_demangle ("", 0, 0, 0)])],
152 [AC_DEFINE(HAVE_CXA_DEMANGLE)
153 AC_MSG_RESULT([yes, using -lsupc++])
154 CXXABI_LIBS="$CXXABI_LIBS -lsupc++"],
155 [AC_MSG_RESULT([no, use c++filt -t for manual demangling])])])
157 AC_SUBST(CXXABI_LIBS)
159 ## check rational bugfix.
160 save_CPPFLAGS="$CPPFLAGS"
161 CPPFLAGS="$GUILE_CFLAGS $CPPFLAGS"
162 AC_MSG_CHECKING(GUILE rational bugfix)
163 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <libguile.h>
164 #ifdef SCM_FRACTION_REDUCED_BIT
167 ]])],[AC_MSG_RESULT(ok)],[REQUIRED="$REQUIRED GUILE-with-rational-bugfix"
168 AC_MSG_RESULT(Must have patched GUILE rational support. See INSTALL.txt)])
169 CPPFLAGS="$save_CPPFLAGS"
172 STEPMAKE_PYTHON_DEVEL(REQUIRED)
174 STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, OPTIONAL, 8.60)
176 STEPMAKE_PATH_PROG(FONTFORGE, fontforge, REQUIRED, 20100501)
177 STEPMAKE_PATH_PROG(FONTFORGE, fontforge, OPTIONAL, 20110222)
179 STEPMAKE_PATH_PROG(T1ASM, t1asm, REQUIRED)
181 AC_CHECK_HEADERS([assert.h grp.h libio.h pwd.h sys/stat.h wchar.h fpu_control.h])
182 AC_CHECK_HEADERS([sstream])
186 AC_CHECK_FUNCS([chroot fopencookie gettext isinf memmem snprintf vsnprintf])
188 STEPMAKE_PROGS(PKG_CONFIG, pkg-config, REQUIRED, 0.9.0)
190 AC_MSG_CHECKING(whether to enable dynamic relocation)
191 if test "$reloc_b" = "yes"; then
192 AC_DEFINE(ARGV0_RELOCATION)
194 AC_MSG_RESULT($reloc_b)
196 AC_MSG_CHECKING(for rpath linkage)
197 if test "$rpath_b" = "yes"; then
198 LDFLAGS="$LDFLAGS -Wl,-rpath -Wl,\\\$\$ORIGIN/../lib"
199 elif test "$rpath_b" != "no"; then
200 LDFLAGS="$LDFLAGS -Wl,-rpath -Wl,$rpath_b"
202 AC_MSG_RESULT($rpath_b)
204 HOST_ARCH=`$CC -dumpmachine`
207 STEPMAKE_PANGO_FT2(pangoft2, REQUIRED, 1.6.0)
208 STEPMAKE_FONTCONFIG(fontconfig, REQUIRED, 2.4.0)
209 STEPMAKE_FREETYPE2(freetype2, REQUIRED, 2.1.10)
213 ## Optional tools for building documentation, website, extra fonts.
215 # guile executable for some scripts
216 STEPMAKE_GUILE(OPTIONAL)
219 STEPMAKE_PERL(OPTIONAL)
221 STEPMAKE_PROGS(MAKEINFO, makeinfo, REQUIRED, 4.11)
222 STEPMAKE_PROGS(TEXI2HTML, texi2html, OPTIONAL, 1.82)
223 STEPMAKE_PROGS(DBLATEX, dblatex, OPTIONAL, 0.1.4)
224 STEPMAKE_PROGS(PDFLATEX, pdflatex, OPTIONAL)
225 STEPMAKE_PROGS(NETPBM, pngtopnm, OPTIONAL)
226 STEPMAKE_PROGS(IMAGEMAGICK, convert, OPTIONAL)
227 # this name avoids a conflict with ZIP in stepmake/aclocal.m4
228 STEPMAKE_PROGS(ZIPDOC, zip, OPTIONAL)
229 STEPMAKE_PROGS(RSYNC, rsync, OPTIONAL)
232 AC_DEFINE_UNQUOTED(FLOWER_VERSION, "${FULL_FLOWER_VERSION}")
234 # must also have local.make if configure fails.
237 if test "$reloc_b$rpath_b" = "yesno"; then
238 STEPMAKE_WARN([Using --enable-relocation without --enable-rpath. LilyPond may have trouble finding libraries.])
241 # Gather requirements and generate output.
244 test -n "$CONFIGURATION" && mc=" conf=$CONFIGURATION" || mc=""
246 if make top-doc 1>/dev/null 2>&1; then
247 rm -f INSTALL.txt && ln Documentation/topdocs/out/INSTALL.txt .
248 rm -f README.txt && ln Documentation/topdocs/out/README.txt .
254 make$mc all to build LilyPond
255 make$mc install to install LilyPond
256 make$mc help to see all possible targets
258 Edit local.make for local Makefile overrides.