]> git.donarmstrong.com Git - lilypond.git/blob - configure.in
release: 0.0.47
[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_SUBDIR, [
8
9     # do something sensible if root hasn't specced dir yet attempts install
10
11     AC_MSG_CHECKING(TeX installation directory)
12
13     ac_tmp_prefix=$prefix
14     test "x$ac_tmp_prefix" = xNONE && ac_tmp_prefix=$ac_default_prefix
15
16     for texdir in $ac_tmp_prefix $ac_tmp_prefix/lib; do
17         if test -d $texdir/texmf; then
18             TEXTOP=$texdir/texmf
19             break
20         else    
21         if test -d $texdir/tex; then 
22             TEXTOP=$texdir/tex
23             break
24         fi
25         fi
26     done
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)
30     else
31         $1=`$FIND $TEXTOP -type d -a -name tex -print |sort|head -1`
32     fi
33     fi
34
35     AC_MSG_RESULT($$1)
36 ])
37
38 AC_INIT(flower/choleski.cc)
39
40
41 AC_LANG_CPLUSPLUS
42 printing_b=no
43 checking_b=yes
44 debug_b=yes
45 optimise_b=no
46 profile_b=no
47     
48 AC_ARG_ENABLE(printing,
49     [  enable-printing        set debug printing],
50     [printing_b=$enableval])
51
52         
53 AC_ARG_ENABLE(checking,
54     [  disable-checking       set runtime checks],
55     [checking_b=$enableval] )
56
57
58
59 AC_ARG_ENABLE(debug,
60     [  disable-debug          set debug info],
61     [debug_b=$enableval])
62
63 AC_ARG_ENABLE(optimise,
64     [  enable-optimise       use maximal speed optimisations],
65     [optimise_b=$enableval])
66     
67    
68 AC_ARG_ENABLE(profiling, 
69     [  enable-profiling      compile with gprof support],
70     [profile_b=$enableval])
71     
72 AC_ARG_ENABLE(texprefix,
73     [  texprefix=DIR  set the tex-directory to put the lilypond subdir in.],
74     [TEXPREFIX=$enableval],
75     [TEXPREFIX=auto] )
76    
77 if test $profile_b = yes; then
78     EXTRA_LIBES="-pg"
79     DEFINES="$DEFINES -pg"
80 fi
81     
82 if test $printing_b = no; then
83     DEFINES="$DEFINES -DNPRINT=1"
84 fi
85     
86 if test $debug_b = yes; then    
87     DEFINES="$DEFINES -g"
88 fi
89 if test $checking_b = no; then
90     DEFINES="$DEFINES -DNDEBUG=1"
91 fi
92
93 if test $optimise_b = yes; then
94     DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED"
95 fi
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
99 AC_PROG_CXX
100 AC_PROG_RANLIB
101 AC_PROG_INSTALL
102 AC_CHECK_PROGS(FIND, find, error)
103
104 dnl should check out -print
105 if test FIND = error; then
106    AC_MSG_WARN(Couldn't find \`find'.  Please use --enable-texprefix)
107 else 
108     
109 AC_SUBST(CXX)
110 AC_SUBST(DEFINES)
111 AC_SUBST(COMPILEINFO)
112 AC_SUBST(AUTOHEADER)
113 AC_SUBST(BISON)
114 AC_SUBST(FLEX)
115 AC_SUBST(TEXPREFIX)
116 AC_SUBST(EXTRA_LIBES)
117
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)
122
123 if test $TEXPREFIX = auto ; then
124     AC_TEX_SUBDIR(TEXPREFIX)
125 fi
126
127 if test $MAKE = "error" 
128 then
129         AC_MSG_ERROR(Please install GNU make)
130 else
131         $MAKE -v| grep GNU >& /dev/null
132         if test "$?" = 1
133         then
134                 AC_MSG_WARN(Please install *GNU* make)
135         fi
136 fi
137
138
139 if test $BISON = "error" 
140 then
141         AC_MSG_WARN(can't find bison. Please install Bison (1.24 or better))
142 fi
143
144 if test $PODMAN = "error" 
145 then
146         AC_MSG_WARN(can't find pod. You should install Perl (version 5 or better))
147 fi
148
149 if test $FLEX = "error" 
150 then
151         AC_MSG_WARN(can't find flex. Please install Flex (2.5 or better))
152 fi
153
154 if $CXX --version | grep '2\.7' >& /dev/null
155 then
156         true
157 else
158         AC_MSG_WARN(can't find g++ 2.7)
159 fi
160
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
166     )
167
168
169
170 dnl URG!!!!!!
171 eval "DIR_DATADIR=$datadir"
172 DIR_DATADIR="$DIR_DATADIR/lilypond"
173 AC_MSG_CHECKING
174
175 cat << EOF > lib/out/config.hh
176
177 /* automatically generated by configure */
178 /* include this file only once! */
179
180 #define  DIR_DATADIR "$DIR_DATADIR"
181
182 EOF
183
184 CXX="$ac_cv_prog_CXX" bin/make_version >> lib/out/config.hh
185
186 touch make/out/Site.make
187
188 # ugr
189 (cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
190 dnl    echo 0 > out/.build
191 )
192 # rgu
193 sed 's/TOPLEVEL_//g' <  .version >  lily/.version
194 (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
195 )
196
197 cat << END
198 Finished configuring. For making everything, do:
199
200         make all
201
202 If you only want help on the make targets, do a
203
204         make help
205
206 END