]> git.donarmstrong.com Git - lilypond.git/blob - bin/configure
release: 0.0.39-1
[lilypond.git] / bin / configure
1 #!/bin/sh
2 #
3 # project  LilyPond -- the musical typesetter
4 # title    (bash/sh/ksh) script to setup library and auto generated files
5 # file     bin/configure
6 #
7 # Copyright (c) 1997 by    
8 #       Han-Wen Nienhuys <hanwen@stack.nl>
9 #       Jan Nieuwenhuizen <jan@digicash.com>
10
11
12 MAKE=${MAKE:-make}
13 NEEDFLOWERVER=1.1.6
14 PREFIX=${PREFIX:-.}
15
16
17 #############
18 #############
19
20 # without "function" ok for ksh, bash
21 setversion() {
22         eval `sed -n 's/^\([A-Z_]*\)[   ]*=[     ]*\([^         \#]*\).*$/\1=\2/p' $1`
23 #       NEWVER=$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL
24         NEWVER=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL$MY_PATCH_LEVEL
25         echo
26         echo "Current  version ("`pwd`") is:"
27         echo "  $NEWVER"
28         echo
29 }
30
31 do_outdir() {
32         if [ \! -d $1/out ]
33         then
34                 mkdir $1/out
35                 echo 0 > $1/.build
36         fi
37 }
38
39 echo using PREFIX=$PREFIX
40 echo I need Flower version $NEEDFLOWERVER
41
42 flowertar=flower-$NEEDFLOWERVER
43
44 #ugh
45 do_outdir flower/lib
46 do_outdir Documentation
47 do_outdir lib
48 do_outdir lily
49 do_outdir m2m
50
51 # mmm
52 if [ -x flower ]
53 then
54         echo Found flowerdir
55 else
56         if [ -d $flowertar ]
57         then
58                 ln -fs $flowertar flower
59         elif [ -d ../$flowertar ]
60         then
61                 ln -fs ../$flowertar flower
62         else
63                 echo "can't find $flowertar"
64                 exit 1;
65         fi
66 fi
67
68 echo Configuring Flower Library
69 setversion ./flower/.version
70 if [ $NEWVER != $NEEDFLOWERVER ]; then
71         echo "You seem to be having an incorrect version of the Flower library"
72 else
73         echo "You got the correct Flower version."
74 fi
75
76 #ugh
77 echo '#define LIBDIR "'$PREFIX'/"'> lib/out/config.hh
78 touch flower/lib/out/flower-config.hh
79 touch make/Site.make
80 $MAKE -C make -f Initial.make
81
82 echo "The sources are ready for compiling. "
83 echo "To make sure that you don't have any stale dependencies: do"
84 echo "          make clean"
85