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)
85 AC_ARG_ENABLE(printing,
86 [ enable-printing set debug printing],
87 [printing_b=$enableval])
90 AC_ARG_ENABLE(checking,
91 [ disable-checking set runtime checks],
92 [checking_b=$enableval] )
94 AC_ARG_ENABLE(debugging,
95 [ disable-debugging set debug info],
98 AC_ARG_ENABLE(optimise,
99 [ enable-optimise use maximal speed optimisations],
100 [optimise_b=$enableval])
103 AC_ARG_ENABLE(profiling,
104 [ enable-profiling compile with gprof support],
105 [profile_b=$enableval])
107 AC_ARG_ENABLE(tex-prefix,
108 [ tex-prefix=DIR set the tex-directory to find TeX subdirectories.],
109 [TEXPREFIX=$enableval],
112 AC_ARG_ENABLE(tex-dir,
113 [ tex-dir=DIR set the directory to put LilyPond TeX files in.],
116 AC_ARG_ENABLE(mf-dir,
117 [ mf-dir=DIR set the directory to put LilyPond MetaFont files in.],
121 if test $profile_b = yes; then
123 DEFINES="$DEFINES -pg"
126 if test $printing_b = no; then
127 DEFINES="$DEFINES -DNPRINT=1"
130 if test $debug_b = yes; then
131 DEFINES="$DEFINES -g"
133 if test $checking_b = no; then
134 DEFINES="$DEFINES -DNDEBUG=1"
137 if test $optimise_b = yes; then
138 DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED"
141 dnl COMPILEINFO="$HOST $host $TARGET $target"
142 AUTOHEADER="This file was automatically generated by configure"
143 CXXFLAGS=${CXXFLAGS:-""} # we don't want -g -O junk
147 AC_CHECK_PROGS(FIND, find, error)
149 dnl should check out -print
150 if test FIND = error; then
151 AC_MSG_WARN(Couldn't find \`find'. Please use --enable-tex-dir)
156 AC_SUBST(COMPILEINFO)
163 AC_SUBST(EXTRA_LIBES)
165 AC_CHECK_PROGS(BISON, bison, error)
166 AC_CHECK_PROGS(FLEX, flex, error)
167 AC_CHECK_PROGS(MAKE, make, error)
168 AC_CHECK_PROGS(PODMAN, pod2man, error)
171 if test "x$TEXPREFIX" = xauto ; then
172 AC_TEX_PREFIX(TEXPREFIX)
175 if test "x$TEXDIR" = xauto ; then
176 AC_TEX_SUBDIR(TEXDIR)
179 if test "x$MFDIR" = xauto; then
183 if test $MAKE = "error"
185 AC_MSG_ERROR(Please install GNU make)
187 $MAKE -v| grep GNU > /dev/null
190 AC_MSG_WARN(Please install *GNU* make)
194 if test $BISON = "error"
196 AC_MSG_WARN(can't find bison. Please install Bison (1.24 or better))
199 if test $PODMAN = "error"
201 AC_MSG_WARN(can't find pod. You should install Perl (version 5 or better))
204 if test $FLEX = "error"
206 AC_MSG_WARN(can't find flex. Please install Flex (2.5 or better))
209 if $CXX --version | grep '2\.7' > /dev/null
213 AC_MSG_WARN(can't find g++ 2.7)
216 AC_CHECK_HEADER(FlexLexer.h, true,
217 AC_MSG_WARN(can't find flex header. Please install Flex headers correctly))
218 AC_CONFIG_SUBDIRS(flower)
219 AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in
220 Makefile:make/Toplevel.make.in
226 eval "DIR_DATADIR=$datadir"
227 DIR_DATADIR="$DIR_DATADIR/lilypond"
230 cat << EOF > lib/out/config.hh
232 /* automatically generated by configure */
233 /* include this file only once! */
235 #define DIR_DATADIR "$DIR_DATADIR"
239 CXX="$ac_cv_prog_CXX" bin/make_version >> lib/out/config.hh
241 touch make/out/Site.make
244 (cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
245 dnl echo 0 > out/.build
248 sed 's/TOPLEVEL_//g' < .version > lily/.version
249 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
253 Finished configuring. For making everything, do:
257 If you only want help on the make targets, do a
261 assuming that \`make' is GNU make, of course.
263 If you want to make site-wide extensions to the makefiles, please use