]> git.donarmstrong.com Git - lilypond.git/blob - configure.in
release: 0.0.46.jcn1
[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 printing_b=no
42 checking_b=yes
43 debug_b=yes
44 optimise_b=no
45 profile_b=no
46     
47 AC_ARG_ENABLE(printing,
48     [  enable-printing        set debug printing],
49     [printing_b=$enableval])
50
51         
52 AC_ARG_ENABLE(checking,
53     [  disable-checking       set runtime checks],
54     [checking_b=$enableval] )
55
56
57
58 AC_ARG_ENABLE(debug,
59     [  disable-debug          set debug info],
60     [debug_b=$enableval])
61
62 AC_ARG_ENABLE(optimise,
63     [  enable-optimise       use maximal speed optimisations],
64     [optimise_b=$enableval])
65     
66    
67 AC_ARG_ENABLE(profiling, 
68     [  enable-profiling      compile with gprof support],
69     [profile_b=$enableval])
70     
71 AC_ARG_ENABLE(texprefix,
72     [  texprefix=DIR  set the tex-directory to put the lilypond subdir in.],
73     [TEXPREFIX=$enableval],
74     [TEXPREFIX=auto] )
75    
76 if test $profile_b = yes; then
77     EXTRA_LIBES="-pg"
78     DEFINES="$DEFINES -pg"
79 fi
80     
81 if test $printing_b = no; then
82     DEFINES="$DEFINES -DNPRINT=1"
83 fi
84     
85 if test $debug_b = yes; then    
86     DEFINES="$DEFINES -g"
87 fi
88 if test $checking_b = no; then
89     DEFINES="$DEFINES -DNDEBUG=1"
90 fi
91
92 if test $optimise_b = yes; then
93     DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED"
94 fi
95 dnl COMPILEINFO="$HOST $host $TARGET $target"
96 AUTOHEADER="This file was automatically generated by configure"
97 CXXFLAGS=${CXXFLAGS:-""}        # we don't want -g -O junk
98 AC_PROG_CXX
99 AC_PROG_RANLIB
100 AC_PROG_INSTALL
101 AC_CHECK_PROGS(FIND, find, error)
102
103 dnl should check out -print
104 if test FIND = error; then
105    AC_MSG_WARN(Couldn't find \`find'.  Please use --enable-texprefix)
106 else 
107     
108 AC_SUBST(CXX)
109 AC_SUBST(DEFINES)
110 AC_SUBST(COMPILEINFO)
111 AC_SUBST(AUTOHEADER)
112 AC_SUBST(BISON)
113 AC_SUBST(FLEX)
114 AC_SUBST(TEXPREFIX)
115 AC_SUBST(EXTRA_LIBES)
116
117 AC_CHECK_PROGS(BISON, bison, error)
118 AC_CHECK_PROGS(FLEX, flex, error)
119 AC_CHECK_PROGS(MAKE, make, error)
120 AC_CHECK_PROGS(PODMAN, pod2man, error)
121
122 if test $TEXPREFIX = auto ; then
123     AC_TEX_SUBDIR(TEXPREFIX)
124 fi
125
126 if test $MAKE = "error" 
127 then
128         AC_MSG_ERROR(Please install GNU make)
129 else
130         $MAKE -v| grep GNU >& /dev/null
131         if test "$?" = 1
132         then
133                 AC_MSG_WARN(Please install *GNU* make)
134         fi
135 fi
136
137
138 if test $BISON = "error" 
139 then
140         AC_MSG_WARN(can't find bison. Please install Bison (1.24 or better))
141 fi
142
143 if test $PODMAN = "error" 
144 then
145         AC_MSG_WARN(can't find pod. You should install Perl (version 5 or better))
146 fi
147
148 if test $FLEX = "error" 
149 then
150         AC_MSG_WARN(can't find flex. Please install Flex (2.5 or better))
151 fi
152
153 if $CXX --version | grep '2\.7' >& /dev/null
154 then
155         true
156 else
157         AC_MSG_WARN(can't find g++ 2.7)
158 fi
159
160 AC_CHECK_HEADER(FlexLexer.h, true,
161         AC_MSG_WARN(can't find flex header. Please install Flex headers correctly))
162 AC_CONFIG_SUBDIRS(flower)
163 AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in
164     Makefile:make/Toplevel.make.in
165     )
166
167
168
169 dnl URG!!!!!!
170 eval "DIR_DATADIR=$datadir"
171 DIR_DATADIR="$DIR_DATADIR/lilypond"
172 AC_MSG_CHECKING
173
174 cat << EOF > lib/out/config.hh
175
176 /* automatically generated by configure */
177 /* include this file only once! */
178
179 #define  DIR_DATADIR "$DIR_DATADIR"
180
181 EOF
182
183 CXX="$ac_cv_prog_CXX" bin/make_version >> lib/out/config.hh
184
185 touch make/out/Site.make
186
187 # ugr
188 (cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
189 dnl    echo 0 > out/.build
190 )
191 # rgu
192 sed 's/TOPLEVEL_//g' <  .version >  lily/.version
193 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
194 )
195  (cd flower;
196 )
197
198 cat << END
199 Finished configuring. For making everything, do:
200
201         make all
202
203 If you only want help on the make targets, do a
204
205         make help
206
207 END