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_SUBDIR, [
9 # do something sensible if root hasn't specced dir yet attempts install
11 AC_MSG_CHECKING(TeX installation directory)
14 test "x$ac_tmp_prefix" = xNONE && ac_tmp_prefix=$ac_default_prefix
16 for texdir in $ac_tmp_prefix $ac_tmp_prefix/lib; do
17 if test -d $texdir/texmf; then
21 if test -d $texdir/tex; then
27 $1=$ac_tmp_prefix/lib/texmf/tex
28 if test x = "x$TEXTOP"; then
29 AC_MSG_WARN(Cannot determine a tex-directory. Please use --enable-texprefix)
31 $1=`$FIND $TEXTOP -type d -a -name tex -print |sort|head -1`
38 AC_INIT(flower/choleski.cc)
48 AC_ARG_ENABLE(printing,
49 [ enable-printing set debug printing],
50 [printing_b=$enableval])
53 AC_ARG_ENABLE(checking,
54 [ disable-checking set runtime checks],
55 [checking_b=$enableval] )
60 [ disable-debug set debug info],
63 AC_ARG_ENABLE(optimise,
64 [ enable-optimise use maximal speed optimisations],
65 [optimise_b=$enableval])
68 AC_ARG_ENABLE(profiling,
69 [ enable-profiling compile with gprof support],
70 [profile_b=$enableval])
72 AC_ARG_ENABLE(texprefix,
73 [ texprefix=DIR set the tex-directory to put the lilypond subdir in.],
74 [TEXPREFIX=$enableval],
77 if test $profile_b = yes; then
79 DEFINES="$DEFINES -pg"
82 if test $printing_b = no; then
83 DEFINES="$DEFINES -DNPRINT=1"
86 if test $debug_b = yes; then
89 if test $checking_b = no; then
90 DEFINES="$DEFINES -DNDEBUG=1"
93 if test $optimise_b = yes; then
94 DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED"
96 dnl COMPILEINFO="$HOST $host $TARGET $target"
97 AUTOHEADER="This file was automatically generated by configure"
98 CXXFLAGS=${CXXFLAGS:-""} # we don't want -g -O junk
102 AC_CHECK_PROGS(FIND, find, error)
104 dnl should check out -print
105 if test FIND = error; then
106 AC_MSG_WARN(Couldn't find \`find'. Please use --enable-texprefix)
111 AC_SUBST(COMPILEINFO)
116 AC_SUBST(EXTRA_LIBES)
118 AC_CHECK_PROGS(BISON, bison, error)
119 AC_CHECK_PROGS(FLEX, flex, error)
120 AC_CHECK_PROGS(MAKE, make, error)
121 AC_CHECK_PROGS(PODMAN, pod2man, error)
123 if test $TEXPREFIX = auto ; then
124 AC_TEX_SUBDIR(TEXPREFIX)
127 if test $MAKE = "error"
129 AC_MSG_ERROR(Please install GNU make)
131 $MAKE -v| grep GNU >& /dev/null
134 AC_MSG_WARN(Please install *GNU* make)
139 if test $BISON = "error"
141 AC_MSG_WARN(can't find bison. Please install Bison (1.24 or better))
144 if test $PODMAN = "error"
146 AC_MSG_WARN(can't find pod. You should install Perl (version 5 or better))
149 if test $FLEX = "error"
151 AC_MSG_WARN(can't find flex. Please install Flex (2.5 or better))
154 if $CXX --version | grep '2\.7' >& /dev/null
158 AC_MSG_WARN(can't find g++ 2.7)
161 AC_CHECK_HEADER(FlexLexer.h, true,
162 AC_MSG_WARN(can't find flex header. Please install Flex headers correctly))
163 AC_CONFIG_SUBDIRS(flower)
164 AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in
165 Makefile:make/Toplevel.make.in
171 eval "DIR_DATADIR=$datadir"
172 DIR_DATADIR="$DIR_DATADIR/lilypond"
175 cat << EOF > lib/out/config.hh
177 /* automatically generated by configure */
178 /* include this file only once! */
180 #define DIR_DATADIR "$DIR_DATADIR"
184 CXX="$ac_cv_prog_CXX" bin/make_version >> lib/out/config.hh
186 touch make/out/Site.make
189 (cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
190 dnl echo 0 > out/.build
193 sed 's/TOPLEVEL_//g' < .version > lily/.version
194 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
198 Finished configuring. For making everything, do:
202 If you only want help on the make targets, do a