]> git.donarmstrong.com Git - lilypond.git/blob - configure.in
Work around compiler bug, Issue 1997: segfault in tablature-negative-fret.ly
[lilypond.git] / configure.in
1 dnl configure.in   -*-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 proces.
7 AC_INIT
8
9 # Bootstrap StepMake configure
10 # For user package:
11 AC_CONFIG_AUX_DIR([stepmake/bin])
12
13 # For stepmake package:
14 # AC_CONFIG_AUX_DIR(bin)
15
16
17 STEPMAKE_INIT
18
19 # List a file that identifies your package.
20 AC_CONFIG_SRCDIR([lily/main.cc])
21
22 # Move to aclocal.m4?
23 AC_CONFIG_HEADERS([$CONFIGFILE.hh:config.hh.in])
24
25 # Uncomment the configuration options your package needs.
26
27 DOCUMENTATION=yes
28 AC_ARG_ENABLE(documentation,
29     [AS_HELP_STRING([--enable-documentation],
30                     [build Documentation.  Default: on])],
31     [DOCUMENTATION=$enableval])
32 AC_SUBST(DOCUMENTATION)
33
34 AC_ARG_WITH(ncsb-dir,
35     [AS_HELP_STRING([--with-ncsb-dir=DIR],
36                     [location of Century Schoolbook fonts.])],
37     [NCSB_DIR=$withval],
38     [NCSB_DIR=""])
39
40 reloc_b=no
41 AC_ARG_ENABLE(relocation,
42     [AS_HELP_STRING([--enable-relocation],
43                     [compile with dynamic relocation.  Default: off])],
44     [reloc_b=$enableval])
45
46 rpath_b=no
47 AC_ARG_ENABLE(rpath,
48     [AS_HELP_STRING([--enable-rpath],
49                     [hardcode runtime library path.  Default: off])],
50     [rpath_b=$enableval])
51
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)
58
59 # must come before any header checks
60 STEPMAKE_COMPILE
61
62 AC_CHECK_PROG(FCLIST, fc-list, fc-list)
63 AC_MSG_CHECKING([New Century Schoolbook PFB files])
64 AC_SUBST(NCSB_SOURCE_FILES)
65 if test "$NCSB_DIR" != "" ;  then
66   NCSB_SOURCE_FILES=""
67   for f in c059013l c059016l c059033l c059036l; do
68     if test ! -f "$NCSB_DIR/$f.pfb"; then
69       STEPMAKE_WARN($NCSB_DIR does not contain $f.pfb.)
70     else
71       NCSB_SOURCE_FILES="$NCSB_DIR/$f.pfb $NCSB_SOURCE_FILES"
72     fi
73   done
74 else
75   if test "$FCLIST" != ""; then
76     for style in Roman Italic "Bold Italic" Bold; do
77       NCSB_FILE=`$FCLIST "Century Schoolbook L:style=$style:foundry=urw:fontformat=Type 1" file \
78                 | head -n 1`
79       NCSB_FILE=`echo $NCSB_FILE | sed 's/^\(.*\):$/\1/g'`
80       NCSB_FILE=`$PYTHON "$srcdir/scripts/auxiliar/readlink.py" $NCSB_FILE`
81       NCSB_SOURCE_FILES="$NCSB_FILE $NCSB_SOURCE_FILES"
82     done
83   else
84     AC_MSG_RESULT(not found)
85     echo "Can't find Century Schoolbook files. Install FontConfig's fc-list,"
86     echo "or use --with-ncsb-dir"
87   fi
88 fi
89 AC_MSG_RESULT($NCSB_SOURCE_FILES)
90
91 AC_LANG([C++])
92
93 STEPMAKE_PYTHON(REQUIRED, 2.4)
94 # this checks if we have GNU C by compiling a program with
95 # __GNUC__, but that macro now unofficially means "the compiler
96 # supports the GNU C extensions" -- the intel C compiler and clang
97 # both support __GNUC__!
98 STEPMAKE_GCC_OR_CLANG(REQUIRED, 3.4)
99
100 STEPMAKE_CXX(REQUIRED)
101 STEPMAKE_GXX_OR_CLANG(REQUIRED, 3.4)
102 STEPMAKE_GXXCODEGENBUG
103 STEPMAKE_CXXTEMPLATE
104 STEPMAKE_STL_DATA_METHOD
105 STEPMAKE_LIB(REQUIRED)
106 STEPMAKE_DLOPEN
107 # Do not use bison 1.50 and 1.75.
108 # 1.29 is required fr %locations, but I'm not sure it's enough --ns
109 STEPMAKE_BISON(OPTIONAL, 1.29)
110 STEPMAKE_FLEX(REQUIRED)
111 STEPMAKE_FLEXLEXER(REQUIRED)
112 STEPMAKE_FLEXLEXER_LOCATION
113 STEPMAKE_LOCALE
114 STEPMAKE_GETTEXT
115 STEPMAKE_MSGFMT(REQUIRED)
116 STEPMAKE_TEXMF(REQUIRED)
117 STEPMAKE_TEXMF_DIRS
118 STEPMAKE_GUILE_DEVEL(REQUIRED, 1.8.2)
119
120 # check for 3 typedefs added in Guile 1.9
121 save_CXXFLAGS="$CXXFLAGS"
122 CXXFLAGS="$GUILE_CFLAGS $CXXFLAGS"
123 AC_CHECK_TYPES([scm_t_hash_fold_fn, scm_t_hash_handle_fn],
124                [AC_DEFINE(HAVE_GUILE_HASH_FUNC)], [],
125                [#include <libguile.h>])
126 AC_CHECK_TYPES([scm_t_subr],
127                [AC_DEFINE(HAVE_GUILE_SUBR_TYPE)], [],
128                [#include <libguile.h>])
129 CXXFLAGS="$save_CXXFLAGS"
130
131 ## Check for usable cxxabi
132 AC_MSG_CHECKING(for usable C++ demangler)
133 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <cxxabi.h>],
134             [abi::__cxa_demangle ("", 0, 0, 0)]);],
135     [AC_DEFINE(HAVE_CXA_DEMANGLE)
136 AC_MSG_RESULT(yes)],
137     [AC_MSG_RESULT([no, use c++filt -t for manual demangling])])
138
139 ## check rational bugfix.
140 save_CPPFLAGS="$CPPFLAGS"
141 CPPFLAGS="$GUILE_CFLAGS $CPPFLAGS"
142 AC_MSG_CHECKING(GUILE rational bugfix)
143 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <libguile.h>
144 #ifdef SCM_FRACTION_REDUCED_BIT
145 #error
146 #endif
147 ]])],[AC_MSG_RESULT(ok)],[REQUIRED="$REQUIRED GUILE-with-rational-bugfix"
148 AC_MSG_RESULT(Must have patched GUILE rational support. See INSTALL.txt)])
149 CPPFLAGS="$save_CPPFLAGS"
150
151
152 STEPMAKE_PYTHON_DEVEL(REQUIRED)
153
154 STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, OPTIONAL, 8.60)
155
156 STEPMAKE_PATH_PROG(FONTFORGE, fontforge, REQUIRED, 20100501)
157 STEPMAKE_PATH_PROG(FONTFORGE, fontforge, OPTIONAL, 20110222)
158
159 STEPMAKE_PATH_PROG(T1ASM, t1asm, REQUIRED)
160
161 AC_CHECK_HEADERS([assert.h grp.h libio.h pwd.h sys/stat.h wchar.h fpu_control.h])
162 AC_CHECK_HEADERS([sstream])
163 AC_HEADER_STAT
164 AC_FUNC_MEMCMP
165 AC_FUNC_VPRINTF
166 AC_CHECK_FUNCS([chroot fopencookie gettext isinf memmem snprintf vsnprintf])
167
168 STEPMAKE_PROGS(PKG_CONFIG, pkg-config, REQUIRED, 0.9.0)
169
170 AC_MSG_CHECKING(whether to enable dynamic relocation)
171 if test "$reloc_b" = "yes"; then
172     AC_DEFINE(ARGV0_RELOCATION)
173 fi
174 AC_MSG_RESULT($reloc_b)
175
176 AC_MSG_CHECKING(for rpath linkage)
177 if test "$rpath_b" = "yes"; then
178     LDFLAGS="$LDFLAGS -Wl,-rpath -Wl,\\\$\$ORIGIN/../lib"
179 elif test "$rpath_b" != "no"; then
180     LDFLAGS="$LDFLAGS -Wl,-rpath -Wl,$rpath_b"
181 fi
182 AC_MSG_RESULT($rpath_b)
183
184 HOST_ARCH=`$CC -dumpmachine`
185 AC_SUBST(HOST_ARCH)
186
187 STEPMAKE_PANGO_FT2(pangoft2, REQUIRED, 1.6.0)
188 STEPMAKE_FONTCONFIG(fontconfig, REQUIRED, 2.4.0)
189 STEPMAKE_FREETYPE2(freetype2, REQUIRED, 2.1.10)
190
191 STEPMAKE_WINDOWS
192
193 ## Optional tools for building documentation, website, extra fonts.
194
195 # guile executable for some scripts
196 STEPMAKE_GUILE(OPTIONAL)
197
198 # perl for help2man.
199 STEPMAKE_PERL(OPTIONAL)
200
201 STEPMAKE_PROGS(MAKEINFO, makeinfo, REQUIRED, 4.11)
202 STEPMAKE_PROGS(TEXI2HTML, texi2html, OPTIONAL, 1.82)
203 STEPMAKE_PROGS(DBLATEX, dblatex, OPTIONAL)
204 STEPMAKE_PROGS(PDFLATEX, pdflatex, OPTIONAL)
205 STEPMAKE_PROGS(NETPBM, pngtopnm, OPTIONAL)
206 STEPMAKE_PROGS(IMAGEMAGICK, convert, OPTIONAL)
207 # this name avoids a conflict with ZIP in stepmake/aclocal.m4
208 STEPMAKE_PROGS(ZIPDOC, zip, OPTIONAL)
209 STEPMAKE_PROGS(RSYNC, rsync, OPTIONAL)
210
211
212 AC_DEFINE_UNQUOTED(FLOWER_VERSION, "${FULL_FLOWER_VERSION}")
213
214 # must also have local.make if configure fails.
215 touch local.make
216
217 if test "$reloc_b$rpath_b" = "yesno"; then
218     STEPMAKE_WARN([Using --enable-relocation without --enable-rpath.  LilyPond may have trouble finding libraries.])
219 fi
220
221 # Gather requirements and generate output.
222 STEPMAKE_END
223
224 test -n "$CONFIGURATION" && mc=" conf=$CONFIGURATION" || mc=""
225
226 if make top-doc 1>/dev/null 2>&1; then
227     rm -f INSTALL.txt && ln Documentation/topdocs/out/INSTALL.txt .
228     rm -f README.txt && ln Documentation/topdocs/out/README.txt .
229 fi
230
231 cat <<EOF
232
233 Type:
234     make$mc all       to build LilyPond
235     make$mc install   to install LilyPond
236     make$mc help      to see all possible targets
237
238 Edit local.make for local Makefile overrides.
239
240
241 EOF