]> git.donarmstrong.com Git - lilypond.git/blob - configure.in
4292dfc92d52b2af58e149eece8a0c4c83c05a81
[lilypond.git] / configure.in
1 dnl configure.in   -*-shell-script-*-
2 dnl Process this file with autoconf to produce a configure script. 
3
4 # Bootstrap the init proces.
5 AC_INIT
6
7 # Bootstrap StepMake configure
8 # For user package:
9 AC_CONFIG_AUX_DIR([stepmake/bin])
10
11 # For stepmake package:
12 # AC_CONFIG_AUX_DIR(bin)
13
14
15 STEPMAKE_INIT
16
17 # List a file that identifies your package.
18 AC_CONFIG_SRCDIR([lily/main.cc])
19
20 # Move to aclocal.m4?
21 AC_CONFIG_HEADER([$CONFIGFILE.hh:config.hh.in])
22
23 # Uncomment the configuration options your package needs.
24
25 DOCUMENTATION=yes
26 AC_ARG_ENABLE(documentation,
27     [  --enable-documentation  build Documentation.  Default: on],
28     [DOCUMENTATION=$enableval])
29 AC_SUBST(DOCUMENTATION)
30
31 gui_b=no
32 AC_ARG_ENABLE(gui,
33     [  --enable-gui            compile with experimental GNOME output.  Default: off],
34     [gui_b=$enableval])
35
36
37 AC_ARG_WITH(ncsb-dir,
38     [  --with-ncsb-dir=DIR     location of Century Schoolbook fonts.],
39     [NCSB_DIR=$withval],
40     [NCSB_DIR=""])
41
42 reloc_b=no
43 AC_ARG_ENABLE(relocation,
44     [  --enable-relocation     compile with dynamic relocation.  Default: off],
45     [reloc_b=$enableval])
46
47 LINK_GXX_STATICALLY=no
48 AC_ARG_ENABLE(static-gxx,
49     [  --enable-static-gxx     link libstdc++.a statically. Default: off],
50     [LINK_GXX_STATICALLY=$enableval])
51 AC_SUBST(LINK_GXX_STATICALLY)
52
53 # must come before any header checks
54 STEPMAKE_COMPILE
55
56 # os.path.realpath() requires python 2.2 and unix
57 STEPMAKE_PYTHON(REQUIRED, 2.2)
58 AC_CHECK_PROG(FCMATCH, fc-match, fc-match)
59 AC_MSG_CHECKING([New Century Schoolbook PFB files])
60 AC_SUBST(NCSB_SOURCE_FILES)
61 if test "$NCSB_DIR" != "" ;  then
62   NCSB_SOURCE_FILES=""
63   for f in c059013l c059016l c059033l c059036l; do
64     if test ! -f "$NCSB_DIR/$f.pfb"; then
65       AC_MSG_WARN($NCSB_DIR does not contain $f.pfb.)
66     else
67       NCSB_SOURCE_FILES="$NCSB_DIR/$f.pfb $NCSB_SOURCE_FILES"
68     fi
69   done
70 else
71   if test "$FCMATCH" != ""; then
72     for style in Roman Italic "Bold Italic" Bold; do
73       NCSB_FILE=`$FCMATCH --verbose "Century Schoolbook L:style=$style" | grep 'file:' | grep -v "\.ttf"`
74
75       NCSB_FILE=`echo $NCSB_FILE | sed 's/^.*"\(.*\)".*$/\1/g'`
76       NCSB_FILE=`$PYTHON "$srcdir/buildscripts/readlink.py" $NCSB_FILE`
77       NCSB_SOURCE_FILES="$NCSB_FILE $NCSB_SOURCE_FILES"
78     done
79   else
80     AC_MSG_RESULT(not found)
81     echo "Can't find Century Schoolbook files. Install FontConfig's fc-match,"
82     echo "or use --with-ncsb-dir"
83   fi
84 fi
85 AC_MSG_RESULT($NCSB_SOURCE_FILES)
86
87
88
89 STEPMAKE_PYTHON(REQUIRED, 2.4)
90 STEPMAKE_GCC(REQUIRED, 4.0)
91
92 STEPMAKE_CXX(REQUIRED)
93 STEPMAKE_GXX(REQUIRED, 4.0)
94 STEPMAKE_CXXTEMPLATE
95 STEPMAKE_STL_DATA_METHOD
96 STEPMAKE_LIB(REQUIRED)
97 STEPMAKE_DLOPEN
98 # Do not use bison 1.50 and 1.75.
99 # 1.29 is required fr %locations, but I'm not sure it's enough --ns
100 STEPMAKE_BISON(OPTIONAL, 1.29)
101 STEPMAKE_FLEX(REQUIRED)
102 STEPMAKE_FLEXLEXER(REQUIRED)
103 STEPMAKE_FLEXLEXER_LOCATION
104 AC_LANG_C
105 STEPMAKE_LOCALE
106 STEPMAKE_GETTEXT
107 STEPMAKE_MSGFMT(REQUIRED)
108 STEPMAKE_TEXMF(REQUIRED)
109 STEPMAKE_TEXMF_DIRS
110
111 ## should check for 1.8.2 ?  
112 STEPMAKE_GUILE_DEVEL(REQUIRED, 1.8.0)
113
114
115 ## check rational bugfix.
116 save_CPPFLAGS="$CPPFLAGS"
117 CPPFLAGS="$GUILE_CFLAGS $CPPFLAGS"
118 AC_MSG_CHECKING(GUILE rational bugfix)
119 AC_TRY_CPP(
120 #include <libguile.h>
121 #ifdef SCM_FRACTION_REDUCED_BIT
122 #error 
123 #endif
124 ,
125 AC_MSG_RESULT(ok),
126 REQUIRED="$REQUIRED GUILE-with-rational-bugfix"
127 AC_MSG_RESULT(Must have patched GUILE rational support. See INSTALL.txt))
128 CPPFLAGS="$save_CPPFLAGS"
129
130
131 STEPMAKE_MAKEINFO(REQUIRED, 4.11)
132 STEPMAKE_PYTHON_DEVEL(REQUIRED)
133
134 STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, OPTIONAL, 8.15)
135
136 STEPMAKE_PROGS(MFTRACE, mftrace, REQUIRED, 1.1.19)
137 STEPMAKE_PATH_PROG(FONTFORGE, fontforge, REQUIRED, 20050624)
138
139 AC_CHECK_HEADERS([assert.h grp.h libio.h pwd.h sys/stat.h wchar.h])
140 AC_LANG_PUSH(C++)
141 AC_CHECK_HEADERS([sstream boost/lambda/lambda.hpp])
142 AC_LANG_POP(C++)
143 AC_HEADER_STAT
144 AC_FUNC_MEMCMP
145 AC_FUNC_VPRINTF
146 AC_CHECK_FUNCS([chroot fopencookie funopen gettext isinf mbrtowc memmem snprintf vsnprintf wcrtomb])
147 AC_CHECK_HEADERS([utf8/wchar.h], LIBS="$LIBS -lutf8")
148 AC_SEARCH_LIBS(mbrtowc, [mingwex msvcp60])
149
150 STEPMAKE_PROGS(PKG_CONFIG, pkg-config, REQUIRED, 0.9.0)
151
152 if test "$gui_b" = "yes"; then
153     STEPMAKE_GTK2(gtk+-2.0, REQUIRED, 2.4.0)
154 fi
155
156 if test "$reloc_b" = "yes"; then
157     AC_DEFINE(ARGV0_RELOCATION)
158 fi
159
160
161 HOST_ARCH=`$CC -dumpmachine`
162 AC_SUBST(HOST_ARCH)
163
164 STEPMAKE_PANGO_FT2(pangoft2, REQUIRED, 1.6.0)
165 #STEPMAKE_PANGO(pango, REQUIRED, 1.6.0)
166 STEPMAKE_FONTCONFIG(fontconfig, REQUIRED, 2.2.0)
167 STEPMAKE_FREETYPE2(freetype2, REQUIRED, 2.1.10)
168
169 STEPMAKE_WINDOWS
170
171 ## Optional tools for building documentation, website, extra fonts.
172
173 # guile executable for some scripts
174 STEPMAKE_GUILE(OPTIONAL)
175
176 # perl for help2man.
177 STEPMAKE_PERL(OPTIONAL)
178
179 # New makeinfo for multi-page website docs Simply always require new
180 # makeinfo should avoid bug reports; if people want to build lily
181 # without the docs, they can find this comment and use an older
182 # makeinfo--but hopefully won't report makeinfo problems.
183 STEPMAKE_PROGS(MAKEINFO, makeinfo, REQUIRED, 4.8)
184
185 AC_DEFINE_UNQUOTED(FLOWER_VERSION, "${FULL_FLOWER_VERSION}")
186
187
188 # must also have local.make if configure fails.
189 touch local.make
190
191 # Gather requirements and generate output.
192 STEPMAKE_END
193
194 test -n "$CONFIGURATION" && mc=" conf=$CONFIGURATION" || mc=""
195
196 cat <<EOF
197
198 Type:
199     make$mc all       to build LilyPond
200     make$mc install   to install LilyPond
201     make$mc help      to see all possible targets
202
203 Edit local.make for local Makefile overrides.
204
205
206 EOF