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"
31 $1='${prefix}'/"$find_texpostfix"
33 AC_MSG_RESULT($find_texprefix)
37 AC_DEFUN(AC_TEX_SUBDIR, [
39 # do something sensible if root hasn't specced dir yet attempts install
40 test "x$find_texprefix" != x || find_texprefix="$TEXPREFIX"
42 AC_MSG_CHECKING(TeX tex input directory)
43 find_texdir=`(cd $find_texprefix;
44 $FIND -type d -a -name tex -print |sort|head -1|sed 's#^\./##')`
47 if test "x$find_texdir" = x; then
49 AC_MSG_WARN(Cannot determine the TeX-subdirectory. Please use --enable-tex-dir)
53 $1="$TEXPREFIX/$find_texdir"
55 AC_MSG_RESULT($find_texprefix/$find_texdir)
59 AC_INIT(flower/choleski.cc)
70 AC_ARG_ENABLE(printing,
71 [ enable-printing set debug printing],
72 [printing_b=$enableval])
75 AC_ARG_ENABLE(checking,
76 [ disable-checking set runtime checks],
77 [checking_b=$enableval] )
82 [ disable-debug set debug info],
85 AC_ARG_ENABLE(optimise,
86 [ enable-optimise use maximal speed optimisations],
87 [optimise_b=$enableval])
90 AC_ARG_ENABLE(profiling,
91 [ enable-profiling compile with gprof support],
92 [profile_b=$enableval])
94 AC_ARG_ENABLE(tex-prefix,
95 [ tex-prefix=DIR set the tex-directory to find TeX subdirectories.],
96 [TEXPREFIX=$enableval],
99 AC_ARG_ENABLE(tex-dir,
100 [ tex-dir=DIR set the directory to put LilyPond TeX files in.],
104 if test $profile_b = yes; then
106 DEFINES="$DEFINES -pg"
109 if test $printing_b = no; then
110 DEFINES="$DEFINES -DNPRINT=1"
113 if test $debug_b = yes; then
114 DEFINES="$DEFINES -g"
116 if test $checking_b = no; then
117 DEFINES="$DEFINES -DNDEBUG=1"
120 if test $optimise_b = yes; then
121 DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED"
124 dnl COMPILEINFO="$HOST $host $TARGET $target"
125 AUTOHEADER="This file was automatically generated by configure"
126 CXXFLAGS=${CXXFLAGS:-""} # we don't want -g -O junk
130 AC_CHECK_PROGS(FIND, find, error)
132 dnl should check out -print
133 if test FIND = error; then
134 AC_MSG_WARN(Couldn't find \`find'. Please use --enable-tex-dir)
139 AC_SUBST(COMPILEINFO)
145 AC_SUBST(EXTRA_LIBES)
147 AC_CHECK_PROGS(BISON, bison, error)
148 AC_CHECK_PROGS(FLEX, flex, error)
149 AC_CHECK_PROGS(MAKE, make, error)
150 AC_CHECK_PROGS(PODMAN, pod2man, error)
153 if test "x$TEXPREFIX" = xauto ; then
154 AC_TEX_PREFIX(TEXPREFIX)
157 if test "x$TEXDIR" = xauto ; then
158 AC_TEX_SUBDIR(TEXDIR)
161 if test $MAKE = "error"
163 AC_MSG_ERROR(Please install GNU make)
165 $MAKE -v| grep GNU > /dev/null
168 AC_MSG_WARN(Please install *GNU* make)
172 if test $BISON = "error"
174 AC_MSG_WARN(can't find bison. Please install Bison (1.24 or better))
177 if test $PODMAN = "error"
179 AC_MSG_WARN(can't find pod. You should install Perl (version 5 or better))
182 if test $FLEX = "error"
184 AC_MSG_WARN(can't find flex. Please install Flex (2.5 or better))
187 if $CXX --version | grep '2\.7' > /dev/null
191 AC_MSG_WARN(can't find g++ 2.7)
194 AC_CHECK_HEADER(FlexLexer.h, true,
195 AC_MSG_WARN(can't find flex header. Please install Flex headers correctly))
196 AC_CONFIG_SUBDIRS(flower)
197 AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in
198 Makefile:make/Toplevel.make.in
204 eval "DIR_DATADIR=$datadir"
205 DIR_DATADIR="$DIR_DATADIR/lilypond"
208 cat << EOF > lib/out/config.hh
210 /* automatically generated by configure */
211 /* include this file only once! */
213 #define DIR_DATADIR "$DIR_DATADIR"
217 CXX="$ac_cv_prog_CXX" bin/make_version >> lib/out/config.hh
219 touch make/out/Site.make
222 (cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
223 dnl echo 0 > out/.build
226 sed 's/TOPLEVEL_//g' < .version > lily/.version
227 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
231 Finished configuring. For making everything, do:
235 If you only want help on the make targets, do a
243 #if test $shared_b = yes; then
244 # echo "NOTE: you are building the *shared* library. You should