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_LILY_WARN, [
11 AC_DEFUN(AC_TEX_PREFIX, [
14 AC_MSG_CHECKING(TeX/MF root dir directory)
16 find_root_prefix="$prefix"
19 test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
21 for postfix in "/lib/tex/" "/lib/texmf" "/lib" "/tex" "/texmf"; do
22 find_texprefix="$find_root_prefix$postfix"
23 if test -d $find_texprefix; then
24 find_texpostfix=$postfix
29 if test "x$find_texpostfix" = x; then
30 find_texpostfix='/lib/texmf/tex'
31 AC_LILY_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
34 find_texprefix="$find_root_prefix/$find_texpostfix"
36 # only assign if variablename not empty
37 if test x != "x$1"; then
38 $1='${prefix}'/"$find_texpostfix"
40 AC_MSG_RESULT($find_texprefix)
45 # find a directory inside a prefix,
46 # $1 the prefix (expanded version)
47 # $2 variable to assign
48 # $3 the directory name
50 AC_DEFUN(AC_FIND_DIR_IN_PREFIX, [
52 AC_MSG_CHECKING($4 directory)
54 $FIND ./ -type d -a -name $3 -print |sort|head -1|sed 's#^\./##')`
57 if test "x$find_dirdir" = x; then
59 AC_LILY_WARN(Cannot determine $4 subdirectory. Please set from command-line)
63 AC_MSG_RESULT($1/$find_dirdir)
66 AC_DEFUN(AC_TEX_SUBDIR, [
67 dnl AC_REQUIRE([AC_TEX_PREFIX])
68 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, tex,TeX input)
72 AC_DEFUN(AC_MF_SUBDIR, [
73 dnl AC_REQUIRE([AC_TEX_PREFIX])
74 AC_FIND_DIR_IN_PREFIX($find_texprefix, $1, source, MF input)
78 AC_INIT(flower/choleski.cc)
81 # if given here, these vars are initted at the checking point.
82 if test x$host = xNONE; then
85 buildprefix="$host-build-dir"
87 for a in `find -type d -and -not -name '*-build-dir'`; do
88 mkdir $buildprefix/$a;
99 AC_ARG_ENABLE(printing,
100 [ enable-printing turn on debug printing],
101 [printing_b=$enableval])
104 AC_ARG_ENABLE(checking,
105 [ enable-checking set runtime checks (assert calls). Default: on],
106 [checking_b=$enableval] )
108 AC_ARG_ENABLE(debugging,
109 [ enable-debugging set debug info. Default: on],
110 [debug_b=$enableval])
112 AC_ARG_ENABLE(optimise,
113 [ enable-optimise use maximal speed optimisations. Default: off],
114 [optimise_b=$enableval])
116 AC_ARG_ENABLE(profiling,
117 [ enable-profiling compile with gprof support. Default: off],
118 [profile_b=$enableval])
120 AC_ARG_ENABLE(mingw-prefix,
121 [ mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)],
122 [MINGWPREFIX=$enableval],
125 AC_ARG_ENABLE(tex-prefix,
126 [ tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)],
127 [TEXPREFIX=$enableval],
130 AC_ARG_ENABLE(tex-dir,
131 [ tex-dir=DIR set the directory to put LilyPond TeX files in. ],
135 AC_ARG_ENABLE(mf-dir,
136 [ mf-dir=DIR set the directory to put LilyPond MetaFont files in.],
140 if test $profile_b = yes; then
142 DEFINES="$DEFINES -pg"
145 if test $printing_b = no; then
146 DEFINES="$DEFINES -DNPRINT=1"
149 if test $debug_b = yes; then
150 DEFINES="$DEFINES -g"
152 if test $checking_b = no; then
153 DEFINES="$DEFINES -DNDEBUG=1"
156 # however, C++ support in mingw32 v 0.1.4 is still flaky
157 if test x$MINGWPREFIX != xno; then
158 ICFLAGS="-I$MINGWPREFIX/include"
159 ILDFLAGS="-$MINGWPREFIX/lib"
162 if test $optimise_b = yes; then
163 DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED"
166 dnl COMPILEINFO="$HOST $host $TARGET $target"
167 AUTOHEADER="This file was automatically generated by configure"
168 CPPFLAGS=${CPPFLAGS:-""} # we don't want -g -O junk
169 CXXFLAGS=${CXXFLAGS:-""} # we don't want -g -O junk
174 AC_CHECK_PROGS(TAR, tar, error)
175 AC_CHECK_PROGS(FIND, find, error)
177 dnl should check out -print
178 if test FIND = error; then
179 AC_LILY_WARN(Couldn't find \`find'. Please use --enable-tex-dir)
188 AC_SUBST(COMPILEINFO)
196 AC_SUBST(EXTRA_LIBES)
198 AC_CHECK_PROGS(BISON, bison, error)
199 AC_CHECK_PROGS(FLEX, flex, error)
200 AC_CHECK_PROGS(MAKE, make, error)
201 AC_PATH_PROG(PERL, perl, error)
202 AC_CHECK_PROGS(PODMAN, pod2man, error)
205 if test "x$TEXPREFIX" = xauto ; then
206 AC_TEX_PREFIX(TEXPREFIX)
208 find_texprefix=$TEXPREFIX
211 if test "x$TEXDIR" = xauto ; then
212 AC_TEX_SUBDIR(TEXDIR)
215 dnl if test "x$MFDIR" = xauto; then
216 dnl AC_MF_SUBDIR(MFDIR)
219 if test $MAKE = "error"
221 AC_MSG_ERROR(Please install GNU make)
223 $MAKE -v| grep GNU > /dev/null
226 AC_LILY_WARN(Please install *GNU* make)
230 if test $BISON = "error"
232 AC_LILY_WARN(can't find bison. Please install Bison (1.25 or better))
234 bison_version=`$BISON --version| sed 's/^.*version 1.//g' `
235 if test $bison_version -lt 25; then
236 AC_LILY_WARN(Your bison is too old (1.$bison_version). Please install 1.25)
240 if test $PERL = "error"
242 AC_LILY_WARN(can't find perl. You should install Perl (version 5 or better))
246 if test $PODMAN = "error"
248 AC_LILY_WARN(can't find pod. You should install Perl (version 5 or better))
251 if test $FLEX = "error"
253 AC_LILY_WARN(can't find flex. Please install Flex (2.5 or better))
256 if $CXX --version | grep '2\.7' > /dev/null
260 AC_LILY_WARN(can't find g++ 2.7)
263 AC_CHECK_HEADER(FlexLexer.h, true,
264 AC_LILY_WARN(can't find flex header. Please install Flex headers correctly))
266 AC_CONFIG_SUBDIRS(flower)
267 AC_OUTPUT($buildprefix/make/out/Configure_variables.make:make/Configure_variables.make.in)
272 eval "DIR_DATADIR=$datadir"
273 DIR_DATADIR="$DIR_DATADIR/lilypond"
276 cat << EOF > $buildprefix/lib/out/config.hh
278 /* automatically generated by configure */
279 /* include this file only once! */
281 #define DIR_DATADIR "$DIR_DATADIR"
285 CXX="$ac_cv_prog_CXX" bin/make-version >> $buildprefix/lib/out/config.hh
287 touch $buildprefix/make/out/Site.make
290 (cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make-version > ../$buildprefix/mi2mu/out/version.hh
293 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make-version > ../$buildprefix/lily/out/version.hh
296 echo '# WARNING : Automatically generated from make/Toplevel.make.in' \
297 | cat - make/Toplevel.make.in > Makefile
301 For making everything, do:
305 or if you used --host=SunUltraWitteReus
307 make buildprefix=SunUltraWitteReus-build-dir
309 If you want to make site-wide extensions to the makefiles, please use
315 if test $warn_b = "yes" ; then
318 **************************************************
319 Warning: configure encountered warnings or errors.
320 Please try to resolve these, and rerun configure
321 before sending a bugreport.
322 If you cannot resolve some warnings, the make
323 process may still be succesful, but be warned.
324 **************************************************