]> git.donarmstrong.com Git - lilypond.git/blob - configure.in
release: 0.0.52
[lilypond.git] / configure.in
1 dnl -*-shell-script-*-
2 dnl  Process this file with autoconf to produce a configure script. 
3
4 dnl should cache result.
5 dnl should  look in $prefix first.
6
7 AC_DEFUN(AC_TEX_PREFIX, [
8     
9
10     AC_MSG_CHECKING(TeX/MF root dir directory)    
11
12     find_root_prefix="$prefix"
13     
14
15     test "x$find_root_prefix" = xNONE && find_root_prefix="$ac_default_prefix"
16     find_texpostfix="";
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
21             break;
22         fi
23     done
24     
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)
28     fi
29
30     find_texprefix="$find_root_prefix/$find_texpostfix"
31     $1='${prefix}'/"$find_texpostfix"
32
33     AC_MSG_RESULT($find_texprefix)
34
35 ])
36
37 AC_DEFUN(AC_TEX_SUBDIR, [
38
39     # do something sensible if root hasn't specced dir yet attempts install
40      test "x$find_texprefix" != x || find_texprefix="$TEXPREFIX"
41
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#^\./##')`
45     
46
47     if test "x$find_texdir" = x; then
48        find_texdir="/tex";
49        AC_MSG_WARN(Cannot determine the TeX-subdirectory. Please use --enable-tex-dir)
50         true
51     fi
52     
53     $1="$TEXPREFIX/$find_texdir"
54     
55     AC_MSG_RESULT($find_texprefix/$find_texdir)
56
57 ])
58
59 AC_INIT(flower/choleski.cc)
60
61
62 AC_LANG_CPLUSPLUS
63 printing_b=no
64 checking_b=yes
65 debug_b=yes
66 optimise_b=no
67 profile_b=no
68 #shared_b=no
69
70 AC_ARG_ENABLE(printing,
71     [  enable-printing        set debug printing],
72     [printing_b=$enableval])
73
74         
75 AC_ARG_ENABLE(checking,
76     [  disable-checking       set runtime checks],
77     [checking_b=$enableval] )
78
79
80
81 AC_ARG_ENABLE(debug,
82     [  disable-debug          set debug info],
83     [debug_b=$enableval])
84
85 AC_ARG_ENABLE(optimise,
86     [  enable-optimise       use maximal speed optimisations],
87     [optimise_b=$enableval])
88     
89    
90 AC_ARG_ENABLE(profiling, 
91     [  enable-profiling      compile with gprof support],
92     [profile_b=$enableval])
93     
94 AC_ARG_ENABLE(tex-prefix,
95     [  tex-prefix=DIR  set the tex-directory to find TeX subdirectories.],
96     [TEXPREFIX=$enableval],
97     [TEXPREFIX=auto] )
98     
99 AC_ARG_ENABLE(tex-dir,
100     [  tex-dir=DIR  set the directory to put LilyPond  TeX files in.],
101     [TEXDIR=$enableval],
102     [TEXDIR=auto] )
103
104 if test $profile_b = yes; then
105     EXTRA_LIBES="-pg"
106     DEFINES="$DEFINES -pg"
107 fi
108     
109 if test $printing_b = no; then
110     DEFINES="$DEFINES -DNPRINT=1"
111 fi
112     
113 if test $debug_b = yes; then    
114     DEFINES="$DEFINES -g"
115 fi
116 if test $checking_b = no; then
117     DEFINES="$DEFINES -DNDEBUG=1"
118 fi
119
120 if test $optimise_b = yes; then
121     DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED"
122 fi
123
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
127 AC_PROG_CXX
128 AC_PROG_RANLIB
129 AC_PROG_INSTALL
130 AC_CHECK_PROGS(FIND, find, error)
131
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)
135 fi
136     
137 AC_SUBST(CXX)
138 AC_SUBST(DEFINES)
139 AC_SUBST(COMPILEINFO)
140 AC_SUBST(AUTOHEADER)
141 AC_SUBST(BISON)
142 AC_SUBST(FLEX)
143 AC_SUBST(TEXPREFIX)
144 AC_SUBST(TEXDIR)
145 AC_SUBST(EXTRA_LIBES)
146
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)
151
152     
153 if test "x$TEXPREFIX" = xauto ; then
154     AC_TEX_PREFIX(TEXPREFIX)
155 fi
156     
157 if test "x$TEXDIR" = xauto ; then
158     AC_TEX_SUBDIR(TEXDIR)
159 fi
160
161 if test $MAKE = "error" 
162 then
163         AC_MSG_ERROR(Please install GNU make)
164 else
165         $MAKE -v| grep GNU > /dev/null
166         if test "$?" = 1
167         then
168             AC_MSG_WARN(Please install *GNU* make) 
169     fi 
170 fi 
171     
172 if test $BISON = "error" 
173 then
174         AC_MSG_WARN(can't find bison. Please install Bison (1.24 or better))
175 fi
176
177 if test $PODMAN = "error" 
178 then
179         AC_MSG_WARN(can't find pod. You should install Perl (version 5 or better))
180 fi
181
182 if test $FLEX = "error" 
183 then
184         AC_MSG_WARN(can't find flex. Please install Flex (2.5 or better))
185 fi
186
187 if $CXX --version | grep '2\.7' > /dev/null
188 then
189         true
190 else
191         AC_MSG_WARN(can't find g++ 2.7)
192 fi
193
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
199     )
200
201
202
203 dnl URG!!!!!!
204 eval "DIR_DATADIR=$datadir"
205 DIR_DATADIR="$DIR_DATADIR/lilypond"
206 AC_MSG_CHECKING
207
208 cat << EOF > lib/out/config.hh
209
210 /* automatically generated by configure */
211 /* include this file only once! */
212
213 #define  DIR_DATADIR "$DIR_DATADIR"
214
215 EOF
216
217 CXX="$ac_cv_prog_CXX" bin/make_version >> lib/out/config.hh
218
219 touch make/out/Site.make
220
221 # ugr
222 (cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
223 dnl    echo 0 > out/.build
224 )
225 # rgu
226 sed 's/TOPLEVEL_//g' <  .version >  lily/.version
227 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
228 )
229
230 cat << END
231 Finished configuring. For making everything, do:
232
233         make all
234
235 If you only want help on the make targets, do a
236
237         make help
238
239
240 END
241
242     
243 #if test $shared_b = yes; then
244 #    echo "NOTE: you are building the *shared* library. You should 
245 #fi