1 dnl configure.ac -*-shell-script-*-
2 dnl Process this file with autoconf to produce a configure script.
6 # Bootstrap the init process.
9 # Bootstrap StepMake configure
10 AC_CONFIG_AUX_DIR([config])
14 # List a file that identifies your package.
15 AC_CONFIG_SRCDIR([lily/main.cc])
18 AC_CONFIG_HEADERS([$CONFIGFILE.hh:config.hh.in])
20 # Uncomment the configuration options your package needs.
23 AC_ARG_ENABLE(documentation,
24 [AS_HELP_STRING([--enable-documentation],
25 [build Documentation. Default: on])],
26 [DOCUMENTATION=$enableval])
27 AC_SUBST(DOCUMENTATION)
30 [AS_HELP_STRING([--with-ncsb-dir=DIR],
31 [location of Century Schoolbook fonts.])],
36 AC_ARG_ENABLE(relocation,
37 [AS_HELP_STRING([--enable-relocation],
38 [compile with dynamic relocation. Default: off])],
43 [AS_HELP_STRING([--enable-rpath],
44 [hardcode runtime library path. Default: off])],
47 LINK_GXX_STATICALLY=no
48 AC_ARG_ENABLE(static-gxx,
49 [AS_HELP_STRING([--enable-static-gxx],
50 [link libstdc++.a statically. Default: off])],
51 [LINK_GXX_STATICALLY=$enableval])
52 AC_SUBST(LINK_GXX_STATICALLY)
54 # must come before any header checks
57 AC_CHECK_PROG(FCLIST, fc-list, fc-list)
58 AC_MSG_CHECKING([for New Century Schoolbook PFB files])
59 AC_SUBST(NCSB_SOURCE_FILES)
61 if test "$NCSB_DIR" = ""; then
62 if test "$FCLIST" != ""; then
63 NCSB_FILE=`$FCLIST "Century Schoolbook L:foundry=urw:fontformat=Type 1:lang=ru" file \
65 if test "$NCSB_FILE" != ""; then
66 NCSB_FILE=`echo $NCSB_FILE | sed 's/\(:.*\)$//g'`
67 NCSB_FILE=`$PYTHON "$srcdir/scripts/auxiliar/readlink.py" $NCSB_FILE`
68 NCSB_DIR=`AS_DIRNAME($NCSB_FILE)`
72 if test "$NCSB_DIR" != "" ; then
73 for f in c059013l.pfb c059016l.pfb c059033l.pfb c059036l.pfb; do
74 if test ! -f "$NCSB_DIR/$f"; then
75 MISSING_NCSB_SOURCE_FILES="$f $MISSING_NCSB_SOURCE_FILES"
77 if test "`grep Cyrillic "$NCSB_DIR/$f"`" = ""; then
78 INCOMPLETE_NCSB_SOURCE_FILES="$f $INCOMPLETE_NCSB_SOURCE_FILES"
80 NCSB_SOURCE_FILES="$NCSB_DIR/$f $NCSB_SOURCE_FILES"
85 if test "$NCSB_DIR" = "" -o "$MISSING_NCSB_SOURCE_FILES" != "$INCOMPLETE_NCSB_SOURCE_FILES"; then
87 STEPMAKE_ADD_ENTRY(REQUIRED,International New Century Schoolbook fonts)
88 if test "$NCSB_DIR" = ""; then
89 if test "$FCLIST" = ""; then
90 STEPMAKE_ADD_ENTRY(REQUIRED,'(install the fc-list utility from FontConfig, or use --with-ncsb-dir)')
92 STEPMAKE_ADD_ENTRY(REQUIRED,'(make sure the fc-list utility can see them, or use --with-ncsb-dir)')
95 if test "$MISSING_NCSB_SOURCE_FILES" != ""; then
96 STEPMAKE_ADD_ENTRY(REQUIRED,'(these files are missing: $MISSING_NCSB_SOURCE_FILES)')
98 if test "$INCOMPLETE_NCSB_SOURCE_FILES" != ""; then
99 STEPMAKE_ADD_ENTRY(REQUIRED,'(these files do not contain Cyrillic characters: $INCOMPLETE_NCSB_SOURCE_FILES)')
107 STEPMAKE_PYTHON(REQUIRED, 2.4, 3.0)
108 # this checks if we have GNU C by compiling a program with
109 # __GNUC__, but that macro now unofficially means "the compiler
110 # supports the GNU C extensions" -- the intel C compiler and clang
111 # both support __GNUC__!
112 STEPMAKE_GCC_OR_CLANG(REQUIRED, 3.4)
114 STEPMAKE_CXX(REQUIRED)
115 STEPMAKE_GXX_OR_CLANG(REQUIRED, 3.4)
116 STEPMAKE_GXXCODEGENBUG
118 STEPMAKE_STL_DATA_METHOD
119 STEPMAKE_LIB(REQUIRED)
121 # Do not use bison 1.50 and 1.75.
122 # 1.29 is required fr %locations, but I'm not sure it's enough --ns
123 STEPMAKE_BISON(REQUIRED, 1.29)
124 STEPMAKE_FLEX(REQUIRED)
125 STEPMAKE_FLEXLEXER(REQUIRED)
126 STEPMAKE_FLEXLEXER_LOCATION
129 STEPMAKE_MSGFMT(REQUIRED)
130 STEPMAKE_TEXMF(REQUIRED)
131 STEPMAKE_TEXMF_DIRS(REQUIRED)
132 STEPMAKE_GUILE_DEVEL(REQUIRED, 1.8.2, 1.9.0)
134 # check for 3 typedefs added in Guile 1.9
135 save_CXXFLAGS="$CXXFLAGS"
136 CXXFLAGS="$GUILE_CFLAGS $CXXFLAGS"
137 AC_CHECK_TYPES([scm_t_hash_fold_fn, scm_t_hash_handle_fn],
138 [AC_DEFINE(HAVE_GUILE_HASH_FUNC)], [],
139 [#include <libguile.h>])
140 AC_CHECK_TYPES([scm_t_subr],
141 [AC_DEFINE(HAVE_GUILE_SUBR_TYPE)], [],
142 [#include <libguile.h>])
143 CXXFLAGS="$save_CXXFLAGS"
145 ## Check for usable cxxabi
147 LIBS="$LIBS $CXXABI_LIBS"
148 AC_MSG_CHECKING(for usable C++ demangler)
149 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <cxxabi.h>],
150 [abi::__cxa_demangle ("", 0, 0, 0)])],
151 [AC_DEFINE(HAVE_CXA_DEMANGLE)
152 AC_MSG_RESULT(yes)],[
153 LIBS="$LIBS -lsupc++"
154 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <cxxabi.h>],
155 [abi::__cxa_demangle ("", 0, 0, 0)])],
156 [AC_DEFINE(HAVE_CXA_DEMANGLE)
157 AC_MSG_RESULT([yes, using -lsupc++])
158 CXXABI_LIBS="$CXXABI_LIBS -lsupc++"],
159 [AC_MSG_RESULT([no, use c++filt -t for manual demangling])])])
161 AC_SUBST(CXXABI_LIBS)
163 ## check rational bugfix.
164 save_CPPFLAGS="$CPPFLAGS"
165 CPPFLAGS="$GUILE_CFLAGS $CPPFLAGS"
166 AC_MSG_CHECKING(GUILE rational bugfix)
167 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <libguile.h>
168 #ifdef SCM_FRACTION_REDUCED_BIT
171 ]])],[AC_MSG_RESULT(ok)],[REQUIRED="$REQUIRED GUILE-with-rational-bugfix"
172 AC_MSG_RESULT(Must have patched GUILE rational support. See INSTALL.txt)])
173 CPPFLAGS="$save_CPPFLAGS"
176 STEPMAKE_PYTHON_DEVEL(REQUIRED, 2.4, 3.0)
178 STEPMAKE_PATH_PROG(FONTFORGE, fontforge, REQUIRED, 20110222)
180 STEPMAKE_PATH_PROG(T1ASM, t1asm, REQUIRED)
182 AC_CHECK_HEADERS([assert.h grp.h libio.h pwd.h sys/stat.h wchar.h fpu_control.h])
183 AC_CHECK_HEADERS([sstream])
187 AC_CHECK_FUNCS([chroot fopencookie gettext isinf memmem snprintf vsnprintf])
189 STEPMAKE_PROGS(PKG_CONFIG, pkg-config, REQUIRED, 0.9.0)
191 AC_MSG_CHECKING(whether to enable dynamic relocation)
192 if test "$reloc_b" = "yes"; then
193 AC_DEFINE(ARGV0_RELOCATION)
195 AC_MSG_RESULT($reloc_b)
197 AC_MSG_CHECKING(for rpath linkage)
198 if test "$rpath_b" = "yes"; then
199 LDFLAGS="$LDFLAGS -Wl,-rpath -Wl,\\\$\$ORIGIN/../lib"
200 elif test "$rpath_b" != "no"; then
201 LDFLAGS="$LDFLAGS -Wl,-rpath -Wl,$rpath_b"
203 AC_MSG_RESULT($rpath_b)
205 HOST_ARCH=`$CC -dumpmachine`
208 STEPMAKE_PANGO_FT2(pangoft2, REQUIRED, 1.6.0)
209 STEPMAKE_FONTCONFIG(fontconfig, REQUIRED, 2.4.0)
210 STEPMAKE_FREETYPE2(freetype2, REQUIRED, 2.1.10)
214 # guile executable for some scripts
215 STEPMAKE_GUILE(OPTIONAL, 1.8.2, 1.9.0)
217 # perl for help2man and for mf2pt1.pl
218 STEPMAKE_PERL(REQUIRED)
220 ## Optional tools for building documentation, website, extra fonts.
221 if test "$DOCUMENTATION" = "yes"; then
222 DOCUMENTATION_REQUIRED=REQUIRED
224 DOCUMENTATION_REQUIRED=OPTIONAL
227 STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, $DOCUMENTATION_REQUIRED, 8.60)
229 STEPMAKE_PROGS(MAKEINFO, makeinfo, REQUIRED, 4.11)
230 STEPMAKE_PROGS(TEXI2HTML, texi2html, $DOCUMENTATION_REQUIRED, 1.82)
231 STEPMAKE_PROGS(DBLATEX, dblatex, $DOCUMENTATION_REQUIRED, 0.1.4)
232 STEPMAKE_PROGS(BIBTEX, bibtex, $DOCUMENTATION_REQUIRED)
233 STEPMAKE_PROGS(PDFLATEX, pdflatex, $DOCUMENTATION_REQUIRED)
234 STEPMAKE_PROGS(PDFTEX, pdfetex pdftex etex, $DOCUMENTATION_REQUIRED)
235 STEPMAKE_PROGS(TEXI2PDF, texi2pdf, $DOCUMENTATION_REQUIRED)
236 STEPMAKE_PROGS(TEXINDEX, texindex, $DOCUMENTATION_REQUIRED)
237 AC_MSG_CHECKING(for epsf.tex)
238 TEX_EPSF=`kpsewhich tex epsf`
239 if test "$TEX_EPSF" = ""; then
240 AC_MSG_RESULT(not found)
241 STEPMAKE_ADD_ENTRY($DOCUMENTATION_REQUIRED,epsf.tex)
243 AC_MSG_RESULT($TEX_EPSF)
245 AC_MSG_CHECKING(for Cyrillic characters support in TeX)
246 TEX_FIKPARM=`kpsewhich -format=mf fikparm`
247 if test "$TEX_FIKPARM" = ""; then
248 AC_MSG_RESULT(not found)
249 STEPMAKE_ADD_ENTRY($DOCUMENTATION_REQUIRED,
250 ['lh CTAN package (texlive-lang-cyrillic or texlive-texmf-fonts)'])
254 STEPMAKE_PROGS(NETPBM, pngtopnm, $DOCUMENTATION_REQUIRED)
255 STEPMAKE_PROGS(IMAGEMAGICK, convert, $DOCUMENTATION_REQUIRED)
256 # this name avoids a conflict with ZIP in stepmake/aclocal.m4
257 STEPMAKE_PROGS(ZIPDOC, zip, $DOCUMENTATION_REQUIRED)
258 STEPMAKE_PROGS(RSYNC, rsync, $DOCUMENTATION_REQUIRED)
260 AC_DEFINE_UNQUOTED(FLOWER_VERSION, "${FULL_FLOWER_VERSION}")
262 # must also have local.make if configure fails.
265 if test "$reloc_b$rpath_b" = "yesno"; then
266 STEPMAKE_WARN([Using --enable-relocation without --enable-rpath. LilyPond may have trouble finding libraries.])
269 # Gather requirements and generate output.
272 test -n "$CONFIGURATION" && mc=" conf=$CONFIGURATION" || mc=""
274 if make top-doc 1>/dev/null 2>&1; then
275 rm -f INSTALL.txt && ln Documentation/topdocs/out/INSTALL.txt .
276 rm -f README.txt && ln Documentation/topdocs/out/README.txt .
282 make$mc all to build LilyPond
283 make$mc install to install LilyPond
284 make$mc help to see all possible targets
286 Edit local.make for local Makefile overrides.