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],
42 AC_ARG_ENABLE(relocation,
43 [AS_HELP_STRING([--enable-relocation],
44 [compile with dynamic relocation. Default: off])],
49 [AS_HELP_STRING([--enable-rpath],
50 [hardcode runtime library path. Default: off])],
53 LINK_GXX_STATICALLY=no
54 AC_ARG_ENABLE(static-gxx,
55 [AS_HELP_STRING([--enable-static-gxx],
56 [link libstdc++.a statically. Default: off])],
57 [LINK_GXX_STATICALLY=$enableval])
58 AC_SUBST(LINK_GXX_STATICALLY)
60 # must come before any header checks
63 AC_CHECK_PROG(FCLIST, fc-list, fc-list)
64 AC_MSG_CHECKING([for TeX Gyre fonts OTF files])
66 AC_SUBST(TEXGYRE_FILES)
67 if test "$TEXGYRE_DIR" = ""; then
68 if test "$FCLIST" != ""; then
69 TEXGYRE_FILE=`$FCLIST "TeX Gyre Schola:fontformat=CFF" file | head -n 1`
70 if test "$TEXGYRE_FILE" != ""; then
71 TEXGYRE_FILE=`echo $TEXGYRE_FILE | sed 's/\(:.*\)$//g'`
72 TEXGYRE_FILE=`$PYTHON "$srcdir/scripts/auxiliar/readlink.py" $TEXGYRE_FILE`
73 TEXGYRE_DIR=`AS_DIRNAME($TEXGYRE_FILE)`
77 if test "$TEXGYRE_DIR" != "" ; then
78 for f in texgyreschola-regular.otf texgyreschola-italic.otf \
79 texgyreschola-bold.otf texgyreschola-bolditalic.otf \
80 texgyreheros-regular.otf texgyreheros-italic.otf \
81 texgyreheros-bold.otf texgyreheros-bolditalic.otf \
82 texgyrecursor-regular.otf texgyrecursor-italic.otf \
83 texgyrecursor-bold.otf texgyrecursor-bolditalic.otf; do
84 if test ! -f "$TEXGYRE_DIR/$f"; then
85 MISSING_TEXGYRE_FILES="$MISSING_TEXGYRE_FILES $f"
87 TEXGYRE_FILES="$TEXGYRE_FILES $f"
91 if test "$TEXGYRE_DIR" = "" -o "$MISSING_TEXGYRE_FILES" != ""; then
93 STEPMAKE_ADD_ENTRY(REQUIRED,TeX Gyre fonts OTF)
94 if test "$TEXGYRE_DIR" = ""; then
95 if test "$FCLIST" = ""; then
96 STEPMAKE_ADD_ENTRY(REQUIRED,'(install the fc-list utility from FontConfig, or use --with-texgyre-dir)')
98 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)")
101 STEPMAKE_ADD_ENTRY(REQUIRED,'(these files are missing: $MISSING_TEXGYRE_FILES)')
109 STEPMAKE_PYTHON(REQUIRED, 2.4, 3.0)
110 # this checks if we have GNU C by compiling a program with
111 # __GNUC__, but that macro now unofficially means "the compiler
112 # supports the GNU C extensions" -- the intel C compiler and clang
113 # both support __GNUC__!
114 STEPMAKE_GCC_OR_CLANG(REQUIRED, 3.4)
116 STEPMAKE_CXX(REQUIRED)
117 STEPMAKE_GXX_OR_CLANG(REQUIRED, 3.4)
118 STEPMAKE_GXXCODEGENBUG
120 STEPMAKE_STL_DATA_METHOD
121 STEPMAKE_LIB(REQUIRED)
123 # Do not use bison 1.50 and 1.75.
124 # 1.29 is required fr %locations, but I'm not sure it's enough --ns
125 STEPMAKE_BISON(REQUIRED, 1.29)
126 STEPMAKE_FLEX(REQUIRED)
127 STEPMAKE_FLEXLEXER(REQUIRED)
128 STEPMAKE_FLEXLEXER_LOCATION
131 STEPMAKE_MSGFMT(REQUIRED)
132 STEPMAKE_TEXMF(REQUIRED)
133 STEPMAKE_TEXMF_DIRS(REQUIRED)
134 if test "$GUILEv2" = "yes"
136 STEPMAKE_GUILE_DEVEL(REQUIRED, 2.0.7, 2.2.0)
138 STEPMAKE_GUILE_DEVEL(REQUIRED, 1.8.2, 1.9.0)
141 # check for 3 typedefs added in Guile 1.9
142 save_CXXFLAGS="$CXXFLAGS"
143 CXXFLAGS="$GUILE_CFLAGS $CXXFLAGS"
144 AC_CHECK_TYPES([scm_t_hash_fold_fn, scm_t_hash_handle_fn],
145 [AC_DEFINE(HAVE_GUILE_HASH_FUNC)], [],
146 [#include <libguile.h>])
147 AC_CHECK_TYPES([scm_t_subr],
148 [AC_DEFINE(HAVE_GUILE_SUBR_TYPE)], [],
149 [#include <libguile.h>])
150 CXXFLAGS="$save_CXXFLAGS"
152 ## Check for usable cxxabi
154 LIBS="$LIBS $CXXABI_LIBS"
155 AC_MSG_CHECKING(for usable C++ demangler)
156 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <cxxabi.h>],
157 [abi::__cxa_demangle ("", 0, 0, 0)])],
158 [AC_DEFINE(HAVE_CXA_DEMANGLE)
159 AC_MSG_RESULT(yes)],[
160 LIBS="$LIBS -lsupc++"
161 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <cxxabi.h>],
162 [abi::__cxa_demangle ("", 0, 0, 0)])],
163 [AC_DEFINE(HAVE_CXA_DEMANGLE)
164 AC_MSG_RESULT([yes, using -lsupc++])
165 CXXABI_LIBS="$CXXABI_LIBS -lsupc++"],
166 [AC_MSG_RESULT([no, use c++filt -t for manual demangling])])])
168 AC_SUBST(CXXABI_LIBS)
170 ## check rational bugfix.
171 save_CPPFLAGS="$CPPFLAGS"
172 CPPFLAGS="$GUILE_CFLAGS $CPPFLAGS"
173 AC_MSG_CHECKING(GUILE rational bugfix)
174 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <libguile.h>
175 #ifdef SCM_FRACTION_REDUCED_BIT
178 ]])],[AC_MSG_RESULT(ok)],[REQUIRED="$REQUIRED GUILE-with-rational-bugfix"
179 AC_MSG_RESULT(Must have patched GUILE rational support. See INSTALL.txt)])
180 CPPFLAGS="$save_CPPFLAGS"
183 STEPMAKE_PYTHON_DEVEL(REQUIRED, 2.4, 3.0)
185 STEPMAKE_PATH_PROG(FONTFORGE, fontforge, REQUIRED, 20110222)
187 STEPMAKE_PATH_PROG(T1ASM, t1asm, REQUIRED)
189 AC_CHECK_HEADERS([assert.h grp.h libio.h pwd.h sys/stat.h wchar.h fpu_control.h])
190 AC_CHECK_HEADERS([sstream])
194 AC_CHECK_FUNCS([chroot fopencookie gettext isinf memmem snprintf vsnprintf])
196 STEPMAKE_PROGS(PKG_CONFIG, pkg-config, REQUIRED, 0.9.0)
198 AC_MSG_CHECKING(whether to enable dynamic relocation)
199 if test "$reloc_b" = "yes"; then
200 AC_DEFINE(ARGV0_RELOCATION)
202 AC_MSG_RESULT($reloc_b)
204 AC_MSG_CHECKING(for rpath linkage)
205 if test "$rpath_b" = "yes"; then
206 LDFLAGS="$LDFLAGS -Wl,-rpath -Wl,\\\$\$ORIGIN/../lib"
207 elif test "$rpath_b" != "no"; then
208 LDFLAGS="$LDFLAGS -Wl,-rpath -Wl,$rpath_b"
210 AC_MSG_RESULT($rpath_b)
212 HOST_ARCH=`$CC -dumpmachine`
215 STEPMAKE_PANGO_FT2(pangoft2, REQUIRED, 1.6.0)
216 STEPMAKE_FONTCONFIG(fontconfig, REQUIRED, 2.4.0)
217 STEPMAKE_FREETYPE2(freetype2, REQUIRED, 2.1.10)
221 # guile executable for some scripts
222 STEPMAKE_GUILE(OPTIONAL, 1.8.2, 1.9.0)
224 # perl for help2man and for mf2pt1.pl
225 STEPMAKE_PERL(REQUIRED)
227 ## Optional tools for building documentation, website, extra fonts.
228 if test "$DOCUMENTATION" = "yes"; then
229 DOCUMENTATION_REQUIRED=REQUIRED
231 DOCUMENTATION_REQUIRED=OPTIONAL
234 STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, $DOCUMENTATION_REQUIRED, 8.60)
236 STEPMAKE_PROGS(MAKEINFO, makeinfo, REQUIRED, 4.11)
237 STEPMAKE_PROGS(TEXI2HTML, texi2html, $DOCUMENTATION_REQUIRED, 1.82)
238 STEPMAKE_PROGS(DBLATEX, dblatex, $DOCUMENTATION_REQUIRED, 0.1.4)
239 STEPMAKE_PROGS(BIBTEX, bibtex, $DOCUMENTATION_REQUIRED)
240 STEPMAKE_PROGS(PDFLATEX, xelatex pdflatex, $DOCUMENTATION_REQUIRED)
241 if test "$PDFLATEX" = "xelatex"; then
242 STEPMAKE_PROGS(PDFTEX, xetex, $DOCUMENTATION_REQUIRED)
243 if test "$PDFTEX" = "xetex"; then
244 # For avoiding PDF destination name replacement.
245 PDFTEX=$ugh_ugh_autoconf250_builddir/scripts/build/out$CONFIGSUFFIX/xetex-with-options
248 STEPMAKE_PROGS(PDFTEX, pdfetex pdftex etex, $DOCUMENTATION_REQUIRED)
250 STEPMAKE_PROGS(TEXI2PDF, texi2pdf, $DOCUMENTATION_REQUIRED)
251 STEPMAKE_PROGS(TEXINDEX, texindex, $DOCUMENTATION_REQUIRED)
252 AC_MSG_CHECKING(for epsf.tex)
253 TEX_EPSF=`kpsewhich tex epsf`
254 if test "$TEX_EPSF" = ""; then
255 AC_MSG_RESULT(not found)
256 STEPMAKE_ADD_ENTRY($DOCUMENTATION_REQUIRED,epsf.tex)
258 AC_MSG_RESULT($TEX_EPSF)
260 AC_MSG_CHECKING(for Cyrillic characters support in TeX)
261 TEX_FIKPARM=`kpsewhich -format=mf fikparm`
262 if test "$TEX_FIKPARM" = ""; then
263 AC_MSG_RESULT(not found)
264 STEPMAKE_ADD_ENTRY($DOCUMENTATION_REQUIRED,
265 ['lh CTAN package (texlive-lang-cyrillic or texlive-texmf-fonts)'])
269 STEPMAKE_PROGS(NETPBM, pngtopnm, $DOCUMENTATION_REQUIRED)
270 STEPMAKE_PROGS(IMAGEMAGICK, convert, $DOCUMENTATION_REQUIRED)
271 # this name avoids a conflict with ZIP in stepmake/aclocal.m4
272 STEPMAKE_PROGS(ZIPDOC, zip, $DOCUMENTATION_REQUIRED)
273 STEPMAKE_PROGS(RSYNC, rsync, $DOCUMENTATION_REQUIRED)
275 AC_DEFINE_UNQUOTED(FLOWER_VERSION, "${FULL_FLOWER_VERSION}")
277 # must also have local.make if configure fails.
280 if test "$reloc_b$rpath_b" = "yesno"; then
281 STEPMAKE_WARN([Using --enable-relocation without --enable-rpath. LilyPond may have trouble finding libraries.])
284 # Gather requirements and generate output.
287 test -n "$CONFIGURATION" && mc=" conf=$CONFIGURATION" || mc=""
289 if make top-doc 1>/dev/null 2>&1; then
290 rm -f INSTALL.txt && ln Documentation/topdocs/out/INSTALL.txt .
291 rm -f README.txt && ln Documentation/topdocs/out/README.txt .
297 make$mc all to build LilyPond
298 make$mc install to install LilyPond
299 make$mc help to see all possible targets
301 Edit local.make for local Makefile overrides.