2 dnl Process this file with autoconf to produce a configure script.
4 dnl should cache result.
5 dnl should look in $prefix first.
8 AC_DEFUN(AC_TEX_PREFIX, [
11 AC_MSG_CHECKING(TeX/MF root dir directory)
13 find_root_prefix="$prefix"
16 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
18 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
19 find_texprefix="$find_root_prefix$postfix"
20 if test -d $find_texprefix; then
21 find_texpostfix=$postfix
26 if test "x$find_texpostfix" = x; then
27 find_texpostfix='/lib/texmf/tex'
28 AC_MSG_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
31 find_texprefix="$find_root_prefix/$find_texpostfix"
33 # only assign if variablename not empty
34 if test x != "x$1"; then
35 $1='${prefix}'/"$find_texpostfix"
37 AC_MSG_RESULT($find_texprefix)
42 # find a directory inside a prefix,
43 # $1 the prefix (expanded version)
44 # $2 variable to assign
45 # $3 the directory name
47 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
49 AC_MSG_CHECKING($4 directory)
51 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
54 if test "x$find_dirdir" = x; then
56 AC_MSG_WARN(Cannot determine $4 subdirectory. Please set from command-line)
60 AC_MSG_RESULT($1/$find_dirdir)
63 AC_DEFUN(AC_TEX_SUBDIR, [
64 dnl AC_REQUIRE([AC_TEX_PREFIX])
65 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
69 AC_DEFUN(AC_MF_SUBDIR, [
70 dnl AC_REQUIRE([AC_TEX_PREFIX])
71 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
75 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])
104 AC_ARG_ENABLE(profiling,
105 [ enable-profiling compile with gprof support],
106 [profile_b=$enableval])
108 AC_ARG_ENABLE(tex-prefix,
109 [ tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
110 [TEXPREFIX=$enableval],
113 AC_ARG_ENABLE(tex-dir,
114 [ tex-dir=DIR set the directory to put LilyPond TeX files in. ],
117 AC_ARG_ENABLE(mf-dir,
118 [ mf-dir=DIR set the directory to put LilyPond MetaFont files in.],
122 if test $profile_b = yes; then
124 DEFINES="$DEFINES -pg"
127 if test $printing_b = no; then
128 DEFINES="$DEFINES -DNPRINT=1"
131 if test $debug_b = yes; then
132 DEFINES="$DEFINES -g"
134 if test $checking_b = no; then
135 DEFINES="$DEFINES -DNDEBUG=1"
138 if test $optimise_b = yes; then
139 DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED"
142 dnl COMPILEINFO="$HOST $host $TARGET $target"
143 AUTOHEADER="This file was automatically generated by configure"
144 CXXFLAGS=${CXXFLAGS:-""} # we don't want -g -O junk
148 AC_CHECK_PROGS(FIND, find, error)
150 dnl should check out -print
151 if test FIND = error; then
152 AC_MSG_WARN(Couldn't find \`find'. Please use --enable-tex-dir)
157 AC_SUBST(COMPILEINFO)
164 AC_SUBST(EXTRA_LIBES)
166 AC_CHECK_PROGS(BISON, bison, error)
167 AC_CHECK_PROGS(FLEX, flex, error)
168 AC_CHECK_PROGS(MAKE, make, error)
169 AC_CHECK_PROGS(PODMAN, pod2man, error)
172 if test "x$TEXPREFIX" = xauto ; then
173 AC_TEX_PREFIX(TEXPREFIX)
175 find_texprefix=$TEXPREFIX
178 if test "x$TEXDIR" = xauto ; then
179 AC_TEX_SUBDIR(TEXDIR)
182 if test "x$MFDIR" = xauto; then
186 if test $MAKE = "error"
188 AC_MSG_ERROR(Please install GNU make)
190 $MAKE -v| grep GNU > /dev/null
193 AC_MSG_WARN(Please install *GNU* make)
197 if test $BISON = "error"
199 AC_MSG_WARN(can't find bison. Please install Bison (1.24 or better))
202 if test $PODMAN = "error"
204 AC_MSG_WARN(can't find pod. You should install Perl (version 5 or better))
207 if test $FLEX = "error"
209 AC_MSG_WARN(can't find flex. Please install Flex (2.5 or better))
212 if $CXX --version | grep '2\.7' > /dev/null
216 AC_MSG_WARN(can't find g++ 2.7)
219 AC_CHECK_HEADER(FlexLexer.h, true,
220 AC_MSG_WARN(can't find flex header. Please install Flex headers correctly))
221 AC_CONFIG_SUBDIRS(flower)
222 AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in
223 Makefile:make/Toplevel.make.in
229 eval "DIR_DATADIR=$datadir"
230 DIR_DATADIR="$DIR_DATADIR/lilypond"
233 cat << EOF > lib/out/config.hh
235 /* automatically generated by configure */
236 /* include this file only once! */
238 #define DIR_DATADIR "$DIR_DATADIR"
242 CXX="$ac_cv_prog_CXX" bin/make_version >> lib/out/config.hh
244 touch make/out/Site.make
247 (cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
248 dnl echo 0 > out/.build
251 sed 's/TOPLEVEL_//g' < .version > lily/.version
252 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
256 Finished configuring. For making everything, do:
260 If you only want help on the make targets, do a
264 assuming that \`make' is GNU make, of course.
266 If you want to make site-wide extensions to the makefiles, please use