2 dnl Process this file with autoconf to produce a configure script.
4 dnl should cache result.
5 dnl should look in $prefix first.
13 AC_DEFUN(AC_TEX_PREFIX, [
16 AC_MSG_CHECKING(TeX/MF root dir directory)
18 find_root_prefix="$prefix"
21 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
23 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
24 find_texprefix="$find_root_prefix$postfix"
25 if test -d $find_texprefix; then
26 find_texpostfix=$postfix
31 if test "x$find_texpostfix" = x; then
32 find_texpostfix='/lib/texmf/tex'
33 AC_MSG_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
36 find_texprefix="$find_root_prefix/$find_texpostfix"
38 # only assign if variablename not empty
39 if test x != "x$1"; then
40 $1='${prefix}'/"$find_texpostfix"
42 AC_MSG_RESULT($find_texprefix)
47 # find a directory inside a prefix,
48 # $1 the prefix (expanded version)
49 # $2 variable to assign
50 # $3 the directory name
52 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
54 AC_MSG_CHECKING($4 directory)
56 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
59 if test "x$find_dirdir" = x; then
61 AC_MSG_WARN(Cannot determine $4 subdirectory. Please set from command-line)
65 AC_MSG_RESULT($1/$find_dirdir)
68 AC_DEFUN(AC_TEX_SUBDIR, [
69 dnl AC_REQUIRE([AC_TEX_PREFIX])
70 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
74 AC_DEFUN(AC_MF_SUBDIR, [
75 dnl AC_REQUIRE([AC_TEX_PREFIX])
76 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
80 AC_INIT(flower/choleski.cc)
85 AC_ARG_ENABLE(printing,
86 [ enable-printing turn on debug printing],
87 [printing_b=$enableval])
90 AC_ARG_ENABLE(checking,
91 [ disable-checking set runtime checks (assert calls)],
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. (default: PREFIX)],
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)
174 find_texprefix=$TEXPREFIX
177 if test "x$TEXDIR" = xauto ; then
178 AC_TEX_SUBDIR(TEXDIR)
181 if test "x$MFDIR" = xauto; then
185 if test $MAKE = "error"
187 AC_MSG_ERROR(Please install GNU make)
189 $MAKE -v| grep GNU > /dev/null
192 AC_MSG_WARN(Please install *GNU* make)
196 if test $BISON = "error"
198 AC_MSG_WARN(can't find bison. Please install Bison (1.24 or better))
201 if test $PODMAN = "error"
203 AC_MSG_WARN(can't find pod. You should install Perl (version 5 or better))
206 if test $FLEX = "error"
208 AC_MSG_WARN(can't find flex. Please install Flex (2.5 or better))
211 if $CXX --version | grep '2\.7' > /dev/null
215 AC_MSG_WARN(can't find g++ 2.7)
218 AC_CHECK_HEADER(FlexLexer.h, true,
219 AC_MSG_WARN(can't find flex header. Please install Flex headers correctly))
220 AC_CONFIG_SUBDIRS(flower)
221 AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in
222 Makefile:make/Toplevel.make.in
228 eval "DIR_DATADIR=$datadir"
229 DIR_DATADIR="$DIR_DATADIR/lilypond"
232 cat << EOF > lib/out/config.hh
234 /* automatically generated by configure */
235 /* include this file only once! */
237 #define DIR_DATADIR "$DIR_DATADIR"
241 CXX="$ac_cv_prog_CXX" bin/make_version >> lib/out/config.hh
243 touch make/out/Site.make
246 (cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
247 dnl echo 0 > out/.build
250 sed 's/TOPLEVEL_//g' < .version > lily/.version
251 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
255 Finished configuring. For making everything, do:
259 If you only want help on the make targets, do a
263 assuming that \`make' is GNU make, of course.
265 If you want to make site-wide extensions to the makefiles, please use