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