]> git.donarmstrong.com Git - lilypond.git/blob - configure.in
release: 0.0.42.pre3
[lilypond.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script. -*-shell-script-*-
2
3 dnl should cache result.
4 dnl should  look in $prefix first.
5
6 AC_DEFUN(AC_TEX_SUBDIR, [
7
8     # do something sensible if root hasn't specced dir yet attempts install
9
10     AC_MSG_CHECKING(TeX installation directory)
11
12     ac_tmp_prefix=$prefix
13     test "x$ac_tmp_prefix" = xNONE && ac_tmp_prefix=$ac_default_prefix
14
15     for texdir in $ac_tmp_prefix $ac_tmp_prefix/lib; do
16         if test -d $texdir/texmf; then
17             TEXTOP=$texdir/texmf
18             break
19         else    
20         if test -d $texdir/tex; then 
21             TEXTOP=$texdir/tex
22             break
23         fi
24         fi
25     done
26     $1=$ac_tmp_prefix/lib/texmf/tex
27     if test x = "x$TEXTOP"; then
28         AC_MSG_WARN(Cannot determine a tex-directory. Please use --enable-texprefix)
29     else
30         $1=`$FIND $TEXTOP -type d -a -name tex -print |sort|head -1`
31     fi
32     fi
33
34     AC_MSG_RESULT($$1)
35 ])
36
37 AC_INIT(flower/choleski.cc)
38
39
40 AC_LANG_CPLUSPLUS
41
42 AC_ARG_ENABLE(printing,
43         [  enable-printing        set debug printing],
44         [],
45         [DEFINES="$DEFINES -DNPRINT=1"])
46 AC_ARG_ENABLE(checking,
47         [  disable-checking       set runtime checks],
48         [DEFINES="$DEFINES -DNDEBUG=1"],
49         [])
50 AC_ARG_ENABLE(debug,
51         [  disable-debug          set debug info],
52         [],
53         [DEFINES="$DEFINES -g"])
54 AC_ARG_ENABLE(optimise,
55         [  enable-optimise       use maximal speed optimisations],
56         [DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED"])
57 AC_ARG_ENABLE(profiling,
58         [  enable-profiling      compile with gprof support],
59         [DEFINES="$DEFINES -pg"])
60 AC_ARG_ENABLE(texprefix,
61         [  texprefix=DIR  set the tex-directory to put the lilypond subdir in.],
62         [TEXPREFIX=$enableval],
63         [TEXPREFIX=auto] )
64
65 dnl COMPILEINFO="$HOST $host $TARGET $target"
66 AUTOHEADER="This file was automatically generated by configure"
67 CXXFLAGS=${CXXFLAGS:-""}        # we don't want -g -O junk
68 AC_PROG_CXX
69 AC_PROG_RANLIB
70 AC_PROG_INSTALL
71 AC_CHECK_PROGS(FIND, find, error)
72
73 dnl should check out -print
74 if test FIND = error; then
75    AC_MSG_WARN(Couldn't find \`find'.  Please use --enable-texprefix)
76 else 
77     
78
79 AC_SUBST(DEFINES)
80 AC_SUBST(COMPILEINFO)
81 AC_SUBST(AUTOHEADER)
82 AC_SUBST(BISON)
83 AC_SUBST(FLEX)
84 AC_SUBST(TEXPREFIX)
85
86
87 AC_CHECK_PROGS(BISON, bison, error)
88 AC_CHECK_PROGS(FLEX, flex, error)
89 AC_CHECK_PROGS(MAKE, make, error)
90 AC_CHECK_PROGS(PODMAN, pod2man, error)
91
92 if test $TEXPREFIX = auto ; then
93     AC_TEX_SUBDIR(TEXPREFIX)
94 fi
95
96 if test $MAKE = "error" 
97 then
98         AC_MSG_ERROR(Please install GNU make)
99 else
100         $MAKE -v| grep -q GNU
101         if test "$?" = 1
102         then
103                 AC_MSG_WARN(Please install *GNU* make)
104         fi
105 fi
106
107
108 if test $BISON = "error" 
109 then
110         AC_MSG_WARN(can't find bison. Please install Bison (1.24 or better))
111 fi
112
113 if test $PODMAN = "error" 
114 then
115         AC_MSG_WARN(can't find pod. You should install Perl (version 5 or better))
116 fi
117
118 if test $FLEX = "error" 
119 then
120         AC_MSG_WARN(can't find flex. Please install Flex (2.5 or better))
121 fi
122
123 if $CXX --version | grep -q '2\.7'
124 then
125         true
126 else
127         AC_MSG_WARN(can't find g++ 2.7)
128 fi
129
130 AC_CHECK_HEADER(FlexLexer.h, true,
131         AC_MSG_ERROR(can't find flex header. Please install Flex headers correctly))
132 AC_CONFIG_SUBDIRS(flower)
133 AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in)
134
135
136
137 dnl URG!!!!!!
138 eval "DIR_DATADIR=$datadir"
139 DIR_DATADIR="$DIR_DATADIR/lilypond"
140 AC_MSG_CHECKING
141
142 cat << EOF > lib/out/config.hh
143
144 /* automatically generated by configure */
145 /* include this file only once! */
146
147 #define  DIR_DATADIR "$DIR_DATADIR"
148
149 EOF
150
151 CXX="$ac_cv_prog_CXX" bin/make_version >> lib/out/config.hh
152
153 touch make/out/Site.make
154
155 # ugr
156 (cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
157 dnl    echo 0 > out/.build
158 )
159 # rgu
160 sed 's/TOPLEVEL_//g' <  .version >  lily/.version
161 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
162 dnl    echo 0 > out/.build
163 )
164  (cd flower;
165 dnl    echo 0 > out/.build
166 )
167 cat << END
168
169 Finished configuring. For making everything, do:
170
171         make all
172
173 If you only want help on the make targets, do a
174
175         make help
176
177 END