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)
31 [AS_HELP_STRING([--enable-guile2],
32 [highly experimental GUILE 2 support. Default: off])],
35 AC_ARG_WITH(texgyre-dir,
36 [AS_HELP_STRING([--with-texgyre-dir=DIR],
37 [location of TeX Gyre fonts.])],
38 [TEXGYRE_DIR=$withval],
41 AC_ARG_WITH(urwotf-dir,
42 [AS_HELP_STRING([--with-urwotf-dir=DIR],
43 [location of URW++ OTF fonts.])],
44 [URWOTF_DIR=$withval],
48 AC_ARG_ENABLE(relocation,
49 [AS_HELP_STRING([--enable-relocation],
50 [compile with dynamic relocation. Default: off])],
55 [AS_HELP_STRING([--enable-rpath],
56 [hardcode runtime library path. Default: off])],
59 LINK_GXX_STATICALLY=no
60 AC_ARG_ENABLE(static-gxx,
61 [AS_HELP_STRING([--enable-static-gxx],
62 [link libstdc++.a statically. Default: off])],
63 [LINK_GXX_STATICALLY=$enableval])
64 AC_SUBST(LINK_GXX_STATICALLY)
66 # must come before any header checks
69 AC_CHECK_PROG(FCLIST, fc-list, fc-list)
70 AC_MSG_CHECKING([for TeX Gyre fonts OTF files])
72 AC_SUBST(TEXGYRE_FILES)
73 if test "$TEXGYRE_DIR" = ""; then
74 if test "$FCLIST" != ""; then
75 TEXGYRE_FILE=`$FCLIST "TeX Gyre Schola:fontformat=CFF" file | head -n 1`
76 if test "$TEXGYRE_FILE" != ""; then
77 TEXGYRE_FILE=`echo $TEXGYRE_FILE | sed 's/\(:.*\)$//g'`
78 TEXGYRE_FILE=`$PYTHON "$srcdir/scripts/auxiliar/readlink.py" $TEXGYRE_FILE`
79 TEXGYRE_DIR=`AS_DIRNAME($TEXGYRE_FILE)`
83 if test "$TEXGYRE_DIR" != "" ; then
84 for f in texgyreschola-regular.otf texgyreschola-italic.otf \
85 texgyreschola-bold.otf texgyreschola-bolditalic.otf \
86 texgyreheros-regular.otf texgyreheros-italic.otf \
87 texgyreheros-bold.otf texgyreheros-bolditalic.otf \
88 texgyrecursor-regular.otf texgyrecursor-italic.otf \
89 texgyrecursor-bold.otf texgyrecursor-bolditalic.otf; do
90 if test ! -f "$TEXGYRE_DIR/$f"; then
91 MISSING_TEXGYRE_FILES="$MISSING_TEXGYRE_FILES $f"
93 TEXGYRE_FILES="$TEXGYRE_FILES $f"
97 if test "$TEXGYRE_DIR" = "" -o "$MISSING_TEXGYRE_FILES" != ""; then
99 STEPMAKE_ADD_ENTRY(REQUIRED,TeX Gyre fonts OTF)
100 if test "$TEXGYRE_DIR" = ""; then
101 if test "$FCLIST" = ""; then
102 STEPMAKE_ADD_ENTRY(REQUIRED,'(install the fc-list utility from FontConfig, or use --with-texgyre-dir)')
104 STEPMAKE_ADD_ENTRY(REQUIRED,"(make sure the fc-list utility can see them, e.g. 'sudo apt-get install fonts-texgyre', or use --with-texgyre-dir)")
107 STEPMAKE_ADD_ENTRY(REQUIRED,'(these files are missing: $MISSING_TEXGYRE_FILES)')
112 AC_MSG_CHECKING([for URW++ OTF files])
114 AC_SUBST(URWOTF_FILES)
115 if test "$URWOTF_DIR" = ""; then
116 if test "$FCLIST" != ""; then
117 URWOTF_FILE=`$FCLIST "C059:fontformat=CFF" file | head -n 1`
118 if test "$URWOTF_FILE" != ""; then
119 URWOTF_FILE=`echo $URWOTF_FILE | sed 's/\(:.*\)$//g'`
120 URWOTF_FILE=`$PYTHON "$srcdir/scripts/auxiliar/readlink.py" $URWOTF_FILE`
121 URWOTF_DIR=`AS_DIRNAME($URWOTF_FILE)`
125 if test "$URWOTF_DIR" != "" ; then
126 for f in C059-BdIta.otf C059-Bold.otf \
127 C059-Italic.otf C059-Roman.otf \
128 NimbusMonoPS-Bold.otf NimbusMonoPS-BoldItalic.otf \
129 NimbusMonoPS-Italic.otf NimbusMonoPS-Regular.otf \
130 NimbusSans-Bold.otf NimbusSans-BoldOblique.otf \
131 NimbusSans-Oblique.otf NimbusSans-Regular.otf; do
132 if test ! -f "$URWOTF_DIR/$f"; then
133 MISSING_URWOTF_FILES="$MISSING_URWOTF_FILES $f"
135 URWOTF_FILES="$URWOTF_FILES $f"
139 if test "$URWOTF_DIR" = "" -o "$MISSING_URWOTF_FILES" != ""; then
141 STEPMAKE_ADD_ENTRY(OPTIONAL,URW++ OTF fonts)
142 if test "$URWOTF_DIR" = ""; then
143 if test "$FCLIST" = ""; then
144 STEPMAKE_ADD_ENTRY(OPTIONAL,'(install the fc-list utility from FontConfig, or use --with-urwotf-dir)')
146 STEPMAKE_ADD_ENTRY(OPTIONAL,"(download OTF files from 'http://git.ghostscript.com/?p=urw-core35-fonts.git;a=commit;h=79bcdfb34fbce12b592cce389fa7a19da6b5b018' and put them under '~/.local/share/fonts' etc., or use --with-urwotf-dir)")
149 STEPMAKE_ADD_ENTRY(OPTIONAL,'(these files are missing: $MISSING_URWOTF_FILES)')
157 STEPMAKE_PYTHON(REQUIRED, 2.4, 3.0)
158 # this checks if we have GNU C by compiling a program with
159 # __GNUC__, but that macro now unofficially means "the compiler
160 # supports the GNU C extensions" -- the intel C compiler and clang
161 # both support __GNUC__!
162 STEPMAKE_GCC_OR_CLANG(REQUIRED, 3.4)
164 STEPMAKE_CXX(REQUIRED)
165 STEPMAKE_GXX_OR_CLANG(REQUIRED, 3.4)
166 STEPMAKE_GXXCODEGENBUG
168 STEPMAKE_STL_DATA_METHOD
169 STEPMAKE_LIB(REQUIRED)
171 # Do not use bison 1.50 and 1.75.
172 # 1.29 is required fr %locations, but I'm not sure it's enough --ns
173 STEPMAKE_BISON(REQUIRED, 1.29)
174 STEPMAKE_FLEX(REQUIRED)
175 STEPMAKE_FLEXLEXER(REQUIRED)
176 STEPMAKE_FLEXLEXER_LOCATION
179 STEPMAKE_MSGFMT(REQUIRED)
180 STEPMAKE_TEXMF(REQUIRED)
181 STEPMAKE_TEXMF_DIRS(REQUIRED)
182 if test "$GUILEv2" = "yes"
184 STEPMAKE_GUILE_DEVEL(REQUIRED, 2.0.7, 2.2.0)
186 STEPMAKE_GUILE_DEVEL(REQUIRED, 1.8.2, 1.9.0)
189 # check for 3 typedefs added in Guile 1.9
190 save_CXXFLAGS="$CXXFLAGS"
191 CXXFLAGS="$GUILE_CFLAGS $CXXFLAGS"
192 AC_CHECK_TYPES([scm_t_hash_fold_fn, scm_t_hash_handle_fn],
193 [AC_DEFINE(HAVE_GUILE_HASH_FUNC)], [],
194 [#include <libguile.h>])
195 AC_CHECK_TYPES([scm_t_subr],
196 [AC_DEFINE(HAVE_GUILE_SUBR_TYPE)], [],
197 [#include <libguile.h>])
198 CXXFLAGS="$save_CXXFLAGS"
200 ## Check for usable cxxabi
202 LIBS="$LIBS $CXXABI_LIBS"
203 AC_MSG_CHECKING(for usable C++ demangler)
204 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <cxxabi.h>],
205 [abi::__cxa_demangle ("", 0, 0, 0)])],
206 [AC_DEFINE(HAVE_CXA_DEMANGLE)
207 AC_MSG_RESULT(yes)],[
208 LIBS="$LIBS -lsupc++"
209 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <cxxabi.h>],
210 [abi::__cxa_demangle ("", 0, 0, 0)])],
211 [AC_DEFINE(HAVE_CXA_DEMANGLE)
212 AC_MSG_RESULT([yes, using -lsupc++])
213 CXXABI_LIBS="$CXXABI_LIBS -lsupc++"],
214 [AC_MSG_RESULT([no, use c++filt -t for manual demangling])])])
216 AC_SUBST(CXXABI_LIBS)
218 ## check rational bugfix.
219 save_CPPFLAGS="$CPPFLAGS"
220 CPPFLAGS="$GUILE_CFLAGS $CPPFLAGS"
221 AC_MSG_CHECKING(GUILE rational bugfix)
222 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <libguile.h>
223 #ifdef SCM_FRACTION_REDUCED_BIT
226 ]])],[AC_MSG_RESULT(ok)],[REQUIRED="$REQUIRED GUILE-with-rational-bugfix"
227 AC_MSG_RESULT(Must have patched GUILE rational support. See INSTALL.txt)])
228 CPPFLAGS="$save_CPPFLAGS"
231 STEPMAKE_PYTHON_DEVEL(REQUIRED, 2.4, 3.0)
233 STEPMAKE_PATH_PROG(FONTFORGE, fontforge, REQUIRED, 20110222)
235 STEPMAKE_PATH_PROG(T1ASM, t1asm, REQUIRED)
237 AC_CHECK_HEADERS([assert.h grp.h libio.h pwd.h sys/stat.h wchar.h fpu_control.h])
238 AC_CHECK_HEADERS([sstream])
242 AC_CHECK_FUNCS([chroot fopencookie gettext isinf memmem snprintf vsnprintf])
244 STEPMAKE_PROGS(PKG_CONFIG, pkg-config, REQUIRED, 0.9.0)
246 AC_MSG_CHECKING(whether to enable dynamic relocation)
247 if test "$reloc_b" = "yes"; then
248 AC_DEFINE(ARGV0_RELOCATION)
250 AC_MSG_RESULT($reloc_b)
252 AC_MSG_CHECKING(for rpath linkage)
253 if test "$rpath_b" = "yes"; then
254 LDFLAGS="$LDFLAGS -Wl,-rpath -Wl,\\\$\$ORIGIN/../lib"
255 elif test "$rpath_b" != "no"; then
256 LDFLAGS="$LDFLAGS -Wl,-rpath -Wl,$rpath_b"
258 AC_MSG_RESULT($rpath_b)
260 HOST_ARCH=`$CC -dumpmachine`
263 STEPMAKE_PANGO_FT2(pangoft2, REQUIRED, 1.6.0)
264 STEPMAKE_FONTCONFIG(fontconfig, REQUIRED, 2.4.0)
265 STEPMAKE_FREETYPE2(freetype2, REQUIRED, 2.1.10)
269 # guile executable for some scripts
270 STEPMAKE_GUILE(OPTIONAL, 1.8.2, 1.9.0)
272 # perl for help2man and for mf2pt1.pl
273 STEPMAKE_PERL(REQUIRED)
275 ## Optional tools for building documentation, website, extra fonts.
276 if test "$DOCUMENTATION" = "yes"; then
277 DOCUMENTATION_REQUIRED=REQUIRED
279 DOCUMENTATION_REQUIRED=OPTIONAL
282 STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, $DOCUMENTATION_REQUIRED, 8.60)
285 AC_SUBST(EXTRACTPDFMARK)
286 AC_SUBST(USE_EXTRACTPDFMARK)
287 STEPMAKE_PROGS(GS920, gs, OPTIONAL, 9.20)
288 STEPMAKE_PROGS(EXTRACTPDFMARK, extractpdfmark, OPTIONAL)
289 req=`STEPMAKE_NUMERIC_VERSION(9.20)`
290 USE_EXTRACTPDFMARK=yes
291 if test "$GS920_VERSION" -lt "$req"; then
293 USE_EXTRACTPDFMARK=no
295 if test "$EXTRACTPDFMARK" != "extractpdfmark"; then
297 USE_EXTRACTPDFMARK=no
299 if test "$USE_EXTRACTPDFMARK" != "yes"; then
300 STEPMAKE_ADD_ENTRY(OPTIONAL,
301 ["(Optionally using Ghostscript >= 9.20 together with"])
302 STEPMAKE_ADD_ENTRY(OPTIONAL,
303 [" Extract PDFmark can significantly reduce the disk space required"])
304 STEPMAKE_ADD_ENTRY(OPTIONAL,
305 [" for building the documentation and the final PDF files.)"])
308 STEPMAKE_PROGS(MAKEINFO, makeinfo, REQUIRED, 4.11)
309 STEPMAKE_PROGS(TEXI2HTML, texi2html, $DOCUMENTATION_REQUIRED, 1.82)
310 STEPMAKE_PROGS(DBLATEX, dblatex, $DOCUMENTATION_REQUIRED, 0.1.4)
311 STEPMAKE_PROGS(BIBTEX, bibtex, $DOCUMENTATION_REQUIRED)
312 STEPMAKE_PROGS(PDFLATEX, xelatex pdflatex, $DOCUMENTATION_REQUIRED)
313 if test "$PDFLATEX" = "xelatex"; then
314 STEPMAKE_PROGS(PDFTEX, xetex, $DOCUMENTATION_REQUIRED)
315 if test "$PDFTEX" = "xetex"; then
316 # For avoiding PDF destination name replacement.
317 PDFTEX=$ugh_ugh_autoconf250_builddir/scripts/build/out$CONFIGSUFFIX/xetex-with-options
318 PDFLATEX=$ugh_ugh_autoconf250_builddir/scripts/build/out$CONFIGSUFFIX/xelatex-with-options
321 STEPMAKE_PROGS(PDFTEX, pdfetex pdftex etex, $DOCUMENTATION_REQUIRED)
323 STEPMAKE_PROGS(TEXI2PDF, texi2pdf, $DOCUMENTATION_REQUIRED)
324 STEPMAKE_PROGS(TEXINDEX, texindex, $DOCUMENTATION_REQUIRED)
325 AC_MSG_CHECKING(for epsf.tex)
326 TEX_EPSF=`kpsewhich tex epsf`
327 if test "$TEX_EPSF" = ""; then
328 AC_MSG_RESULT(not found)
329 STEPMAKE_ADD_ENTRY($DOCUMENTATION_REQUIRED,epsf.tex)
331 AC_MSG_RESULT($TEX_EPSF)
333 AC_MSG_CHECKING(for Cyrillic characters support in TeX)
334 TEX_FIKPARM=`kpsewhich -format=mf fikparm`
335 if test "$TEX_FIKPARM" = ""; then
336 AC_MSG_RESULT(not found)
337 STEPMAKE_ADD_ENTRY($DOCUMENTATION_REQUIRED,
338 ['lh CTAN package (texlive-lang-cyrillic or texlive-texmf-fonts)'])
342 STEPMAKE_PROGS(NETPBM, pngtopnm, $DOCUMENTATION_REQUIRED)
343 STEPMAKE_PROGS(IMAGEMAGICK, convert, $DOCUMENTATION_REQUIRED)
344 # this name avoids a conflict with ZIP in stepmake/aclocal.m4
345 STEPMAKE_PROGS(ZIPDOC, zip, $DOCUMENTATION_REQUIRED)
346 STEPMAKE_PROGS(RSYNC, rsync, $DOCUMENTATION_REQUIRED)
348 AC_DEFINE_UNQUOTED(FLOWER_VERSION, "${FULL_FLOWER_VERSION}")
350 # must also have local.make if configure fails.
353 if test "$reloc_b$rpath_b" = "yesno"; then
354 STEPMAKE_WARN([Using --enable-relocation without --enable-rpath. LilyPond may have trouble finding libraries.])
357 # Gather requirements and generate output.
360 test -n "$CONFIGURATION" && mc=" conf=$CONFIGURATION" || mc=""
362 if make top-doc 1>/dev/null 2>&1; then
363 rm -f INSTALL.txt && ln Documentation/topdocs/out/INSTALL.txt .
364 rm -f README.txt && ln Documentation/topdocs/out/README.txt .
370 make$mc all to build LilyPond
371 make$mc install to install LilyPond
372 make$mc help to see all possible targets
374 Edit local.make for local Makefile overrides.