2 dnl Process this file with autoconf to produce a configure script.
4 dnl should cache result.
5 dnl should look in $prefix first.
7 AC_DEFUN(AC_TEX_PREFIX, [
10 AC_MSG_CHECKING(TeX/MF root dir directory)
12 find_root_prefix="$prefix"
15 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
17 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
18 find_texprefix="$find_root_prefix$postfix"
19 if test -d $find_texprefix; then
20 find_texpostfix=$postfix
25 if test "x$find_texpostfix" = x; then
26 find_texpostfix='/lib/texmf/tex'
27 AC_MSG_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
30 find_texprefix="$find_root_prefix/$find_texpostfix"
32 # only assign if variablename not empty
33 if test x != "x$1"; then
34 $1='${prefix}'/"$find_texpostfix"
36 AC_MSG_RESULT($find_texprefix)
41 # find a directory inside a prefix,
42 # $1 the prefix (expanded version)
43 # $2 variable to assign
44 # $3 the directory name
46 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
48 AC_MSG_CHECKING($4 directory)
50 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
53 if test "x$find_dirdir" = x; then
55 AC_MSG_WARN(Cannot determine $4 subdirectory. Please set from command-line)
59 AC_MSG_RESULT($1/$find_dirdir)
62 AC_DEFUN(AC_TEX_SUBDIR, [
63 dnl AC_REQUIRE([AC_TEX_PREFIX])
64 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
68 AC_DEFUN(AC_MF_SUBDIR, [
69 dnl AC_REQUIRE([AC_TEX_PREFIX])
70 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
74 AC_INIT(flower/choleski.cc)
77 # if given here, these vars are initted at the checking point.
86 AC_ARG_ENABLE(printing,
87 [ enable-printing turn on debug printing],
88 [printing_b=$enableval])
91 AC_ARG_ENABLE(checking,
92 [ disable-checking set runtime checks (assert calls)],
93 [checking_b=$enableval] )
95 AC_ARG_ENABLE(debugging,
96 [ disable-debugging set debug info ],
99 AC_ARG_ENABLE(optimise,
100 [ enable-optimise use maximal speed optimisations],
101 [optimise_b=$enableval])
103 AC_ARG_ENABLE(profiling,
104 [ enable-profiling compile with gprof support],
105 [profile_b=$enableval])
107 AC_ARG_ENABLE(mingw32,
108 [ mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
109 [MINGWPREFIX=$enableval],
112 AC_ARG_ENABLE(tex-prefix,
113 [ tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
114 [TEXPREFIX=$enableval],
117 AC_ARG_ENABLE(tex-dir,
118 [ tex-dir=DIR set the directory to put LilyPond TeX files in. ],
122 AC_ARG_ENABLE(mf-dir,
123 [ mf-dir=DIR set the directory to put LilyPond MetaFont files in.],
127 if test $profile_b = yes; then
129 DEFINES="$DEFINES -pg"
132 if test $printing_b = no; then
133 DEFINES="$DEFINES -DNPRINT=1"
136 if test $debug_b = yes; then
137 DEFINES="$DEFINES -g"
139 if test $checking_b = no; then
140 DEFINES="$DEFINES -DNDEBUG=1"
143 # however, C++ support in mingw32 v 0.1.4 is still flaky
144 if test x$MINGWPREFIX != xno; then
145 ICFLAGS="-I$MINGWPREFIX/include"
146 ILDFLAGS="-$MINGWPREFIX/lib"
149 if test $optimise_b = yes; then
150 DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED"
153 dnl COMPILEINFO="$HOST $host $TARGET $target"
154 AUTOHEADER="This file was automatically generated by configure"
155 CPPFLAGS=${CPPFLAGS:-""} # we don't want -g -O junk
156 CXXFLAGS=${CXXFLAGS:-""} # we don't want -g -O junk
161 AC_CHECK_PROGS(FIND, find, error)
163 dnl should check out -print
164 if test FIND = error; then
165 AC_MSG_WARN(Couldn't find \`find'. Please use --enable-tex-dir)
174 AC_SUBST(COMPILEINFO)
181 AC_SUBST(EXTRA_LIBES)
183 AC_CHECK_PROGS(BISON, bison, error)
184 AC_CHECK_PROGS(FLEX, flex, error)
185 AC_CHECK_PROGS(MAKE, make, error)
186 AC_CHECK_PROGS(PODMAN, pod2man, error)
189 if test "x$TEXPREFIX" = xauto ; then
190 AC_TEX_PREFIX(TEXPREFIX)
192 find_texprefix=$TEXPREFIX
195 if test "x$TEXDIR" = xauto ; then
196 AC_TEX_SUBDIR(TEXDIR)
199 if test "x$MFDIR" = xauto; then
203 if test $MAKE = "error"
205 AC_MSG_ERROR(Please install GNU make)
207 $MAKE -v| grep GNU > /dev/null
210 AC_MSG_WARN(Please install *GNU* make)
214 if test $BISON = "error"
216 AC_MSG_WARN(can't find bison. Please install Bison (1.25 or better))
218 bison_version=`$BISON --version| sed 's/^.*version 1.//g' `
219 if test $bison_version -lt 25; then
220 AC_MSG_WARN(Your bison is too old (1.$bison_version). Please install 1.25)
224 if test $PODMAN = "error"
226 AC_MSG_WARN(can't find pod. You should install Perl (version 5 or better))
229 if test $FLEX = "error"
231 AC_MSG_WARN(can't find flex. Please install Flex (2.5 or better))
234 if $CXX --version | grep '2\.7' > /dev/null
238 AC_MSG_WARN(can't find g++ 2.7)
241 AC_CHECK_HEADER(FlexLexer.h, true,
242 AC_MSG_WARN(can't find flex header. Please install Flex headers correctly))
243 AC_CONFIG_SUBDIRS(flower)
244 AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in)
249 eval "DIR_DATADIR=$datadir"
250 DIR_DATADIR="$DIR_DATADIR/lilypond"
253 cat << EOF > lib/out/config.hh
255 /* automatically generated by configure */
256 /* include this file only once! */
258 #define DIR_DATADIR "$DIR_DATADIR"
262 CXX="$ac_cv_prog_CXX" bin/make_version >> lib/out/config.hh
264 touch make/out/Site.make
267 (cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
268 dnl echo 0 > out/.build
271 sed 's/TOPLEVEL_//g' < .version > lily/.version
272 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
275 $MAKE -f make/Toplevel.make.in Makefile
278 Finished configuring. For making everything, do:
282 If you only want help on the make targets, do a
286 assuming that \`make' is GNU make, of course.
288 If you want to make site-wide extensions to the makefiles, please use
292 If you can't find a toplevel makefile, please execute
294 make -f make/Toplevel.make.in Makefile # GNU make, of course