]> git.donarmstrong.com Git - lilypond.git/blob - configure.ac
Issue 3254: align unassociated lyrics using NoteColumn extent.
[lilypond.git] / configure.ac
1 dnl configure.ac   -*-shell-script-*-
2 dnl Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.60)
5
6 # Bootstrap the init process.
7 AC_INIT
8
9 # Bootstrap StepMake configure
10 AC_CONFIG_AUX_DIR([config])
11
12 STEPMAKE_INIT
13
14 # List a file that identifies your package.
15 AC_CONFIG_SRCDIR([lily/main.cc])
16
17 # Move to aclocal.m4?
18 AC_CONFIG_HEADERS([$CONFIGFILE.hh:config.hh.in])
19
20 # Uncomment the configuration options your package needs.
21
22 DOCUMENTATION=yes
23 AC_ARG_ENABLE(documentation,
24     [AS_HELP_STRING([--enable-documentation],
25                     [build Documentation.  Default: on])],
26     [DOCUMENTATION=$enableval])
27 AC_SUBST(DOCUMENTATION)
28
29 AC_ARG_WITH(ncsb-dir,
30     [AS_HELP_STRING([--with-ncsb-dir=DIR],
31                     [location of Century Schoolbook fonts.])],
32     [NCSB_DIR=$withval],
33     [NCSB_DIR=""])
34
35 reloc_b=no
36 AC_ARG_ENABLE(relocation,
37     [AS_HELP_STRING([--enable-relocation],
38                     [compile with dynamic relocation.  Default: off])],
39     [reloc_b=$enableval])
40
41 rpath_b=no
42 AC_ARG_ENABLE(rpath,
43     [AS_HELP_STRING([--enable-rpath],
44                     [hardcode runtime library path.  Default: off])],
45     [rpath_b=$enableval])
46
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)
53
54 # must come before any header checks
55 STEPMAKE_COMPILE
56
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)
60 AC_SUBST(NCSB_DIR)
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 \
64               | head -n 1`
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)`
69     fi
70   fi
71 fi
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"
76     else
77       if test "`grep Cyrillic "$NCSB_DIR/$f"`" = ""; then
78         INCOMPLETE_NCSB_SOURCE_FILES="$f $INCOMPLETE_NCSB_SOURCE_FILES"
79       else
80         NCSB_SOURCE_FILES="$NCSB_DIR/$f $NCSB_SOURCE_FILES"
81       fi
82     fi
83   done
84 fi
85 if test "$NCSB_DIR" = "" -o "$MISSING_NCSB_SOURCE_FILES" != "$INCOMPLETE_NCSB_SOURCE_FILES"; then
86   AC_MSG_RESULT(no)
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)')
91     else
92       STEPMAKE_ADD_ENTRY(REQUIRED,'(make sure the fc-list utility can see them, or use --with-ncsb-dir)')
93     fi
94   fi
95   if test "$MISSING_NCSB_SOURCE_FILES" != ""; then
96     STEPMAKE_ADD_ENTRY(REQUIRED,'(these files are missing: $MISSING_NCSB_SOURCE_FILES)')
97   fi
98   if test "$INCOMPLETE_NCSB_SOURCE_FILES" != ""; then
99     STEPMAKE_ADD_ENTRY(REQUIRED,'(these files do not contain Cyrillic characters: $INCOMPLETE_NCSB_SOURCE_FILES)')
100   fi
101 else
102   AC_MSG_RESULT(yes)
103 fi
104
105 AC_LANG([C++])
106
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)
113
114 STEPMAKE_CXX(REQUIRED)
115 STEPMAKE_GXX_OR_CLANG(REQUIRED, 3.4)
116 STEPMAKE_GXXCODEGENBUG
117 STEPMAKE_CXXTEMPLATE
118 STEPMAKE_STL_DATA_METHOD
119 STEPMAKE_LIB(REQUIRED)
120 STEPMAKE_DLOPEN
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
127 STEPMAKE_LOCALE
128 STEPMAKE_GETTEXT
129 STEPMAKE_MSGFMT(REQUIRED)
130 STEPMAKE_TEXMF(REQUIRED)
131 STEPMAKE_TEXMF_DIRS(REQUIRED)
132 STEPMAKE_GUILE_DEVEL(REQUIRED, 1.8.2, 1.9.0)
133
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"
144
145 ## Check for usable cxxabi
146 save_LIBS="$LIBS"
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])])])
160 LIBS="$save_LIBS"
161 AC_SUBST(CXXABI_LIBS)
162
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
169 #error
170 #endif
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"
174
175
176 STEPMAKE_PYTHON_DEVEL(REQUIRED, 2.4, 3.0)
177
178 STEPMAKE_PATH_PROG(FONTFORGE, fontforge, REQUIRED, 20110222)
179
180 STEPMAKE_PATH_PROG(T1ASM, t1asm, REQUIRED)
181
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])
184 AC_HEADER_STAT
185 AC_FUNC_MEMCMP
186 AC_FUNC_VPRINTF
187 AC_CHECK_FUNCS([chroot fopencookie gettext isinf memmem snprintf vsnprintf])
188
189 STEPMAKE_PROGS(PKG_CONFIG, pkg-config, REQUIRED, 0.9.0)
190
191 AC_MSG_CHECKING(whether to enable dynamic relocation)
192 if test "$reloc_b" = "yes"; then
193     AC_DEFINE(ARGV0_RELOCATION)
194 fi
195 AC_MSG_RESULT($reloc_b)
196
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"
202 fi
203 AC_MSG_RESULT($rpath_b)
204
205 HOST_ARCH=`$CC -dumpmachine`
206 AC_SUBST(HOST_ARCH)
207
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)
211
212 STEPMAKE_WINDOWS
213
214 # guile executable for some scripts
215 STEPMAKE_GUILE(OPTIONAL, 1.8.2, 1.9.0)
216
217 # perl for help2man and for mf2pt1.pl
218 STEPMAKE_PERL(REQUIRED)
219
220 ## Optional tools for building documentation, website, extra fonts.
221 if test "$DOCUMENTATION" = "yes"; then
222   DOCUMENTATION_REQUIRED=REQUIRED
223 else
224   DOCUMENTATION_REQUIRED=OPTIONAL
225 fi
226
227 STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, $DOCUMENTATION_REQUIRED, 8.60)
228
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)
242 else
243     AC_MSG_RESULT($TEX_EPSF)
244 fi
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)'])
251 else
252     AC_MSG_RESULT(yes)
253 fi
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)
259
260 AC_DEFINE_UNQUOTED(FLOWER_VERSION, "${FULL_FLOWER_VERSION}")
261
262 # must also have local.make if configure fails.
263 touch local.make
264
265 if test "$reloc_b$rpath_b" = "yesno"; then
266     STEPMAKE_WARN([Using --enable-relocation without --enable-rpath.  LilyPond may have trouble finding libraries.])
267 fi
268
269 # Gather requirements and generate output.
270 STEPMAKE_END
271
272 test -n "$CONFIGURATION" && mc=" conf=$CONFIGURATION" || mc=""
273
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 .
277 fi
278
279 cat <<EOF
280
281 Type:
282     make$mc all       to build LilyPond
283     make$mc install   to install LilyPond
284     make$mc help      to see all possible targets
285
286 Edit local.make for local Makefile overrides.
287
288
289 EOF