comparison spandsp-0.0.6pre17/autogen.sh @ 4:26cd8f1ef0b1

import spandsp-0.0.6pre17
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Fri, 25 Jun 2010 15:50:58 +0200
parents
children
comparison
equal deleted inserted replaced
3:c6c5a16ce2f2 4:26cd8f1ef0b1
1 #!/usr/bin/env sh
2 #
3 # SpanDSP - a series of DSP components for telephony
4 #
5 # autogen script
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU Lesser General Public License version 2.1,
9 # as published by the Free Software Foundation.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #
20 # $Id: autogen.sh,v 1.6 2008/03/30 18:33:24 steveu Exp $
21 #
22
23 UNAME=`uname`
24
25 if [ "x$UNAME" = "xFreeBSD" ]; then
26 echo ""
27 echo ""
28 echo "******************************************"
29 echo "*** NOTICE ***"
30 echo "******************************************"
31 echo " "
32 echo "FreeBSD is buggy. Please use this "
33 echo "workaround if you want to bootstrap "
34 echo "on FreeBSD. "
35 echo " "
36 echo "cd /usr/local/share/aclocal19 "
37 echo "ln -s ../aclocal/libtool15.m4 . "
38 echo "ln -s ../aclocal/ltdl15.m4 . "
39 echo " "
40 echo "******************************************"
41 echo ""
42 fi
43
44 debug ()
45 {
46 # Outputs debug statments if DEBUG var is set
47 if [ ! -z "$DEBUG" ]; then
48 echo "DEBUG: $1"
49 fi
50 }
51
52 version_compare()
53 {
54 # Checks a command is found and the version is high enough
55 PROGRAM=$1
56 MAJOR=$2
57 MINOR=$3
58 MICRO=$4
59 test -z "$MAJOR" && MAJOR=0
60 test -z "$MINOR" && MINOR=0
61 test -z "$MICRO" && MICRO=0
62
63 debug "Checking $PROGRAM >= $MAJOR.$MINOR.$MICRO"
64
65 WHICH_PATH=`whereis which | cut -f2 -d' '`
66 COMMAND=`$WHICH_PATH $PROGRAM`
67 if [ -z $COMMAND ]; then
68 echo "$PROGRAM-$MAJOR.$MINOR.$MICRO is required and was not found."
69 return 1
70 else
71 debug "Found $COMMAND"
72 fi
73
74 INS_VER=`$COMMAND --version | head -1 | sed 's/[^0-9]*//' | cut -d' ' -f1`
75 INS_MAJOR=`echo $INS_VER | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
76 INS_MINOR=`echo $INS_VER | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
77 INS_MICRO=`echo $INS_VER | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
78 test -z "$INS_MAJOR" && INS_MAJOR=0
79 test -z "$INS_MINOR" && INS_MINOR=0
80 test -z "$INS_MICRO" && INS_MICRO=0
81 debug "Installed version: $INS_VER"
82
83 if [ "$INS_MAJOR" -gt "$MAJOR" ]; then
84 debug "MAJOR: $INS_MAJOR > $MAJOR"
85 return 0
86 elif [ "$INS_MAJOR" -eq "$MAJOR" ]; then
87 debug "MAJOR: $INS_MAJOR = $MAJOR"
88 if [ "$INS_MINOR" -gt "$MINOR" ]; then
89 debug "MINOR: $INS_MINOR > $MINOR"
90 return 0
91 elif [ "$INS_MINOR" -eq "$MINOR" ]; then
92 if [ "$INS_MICRO" -ge "$MICRO" ]; then
93 debug "MICRO: $INS_MICRO >= $MICRO"
94 return 0
95 else
96 debug "MICRO: $INS_MICRO < $MICRO"
97 fi
98 else
99 debug "MINOR: $INS_MINOR < $MINOR"
100 fi
101 else
102 debug "MAJOR: $INS_MAJOR < $MAJOR"
103 fi
104
105 echo "You have the wrong version of $PROGRAM. The minimum required version is $MAJOR.$MINOR.$MICRO"
106 echo " and the version installed is $INS_MAJOR.$INS_MINOR.$INS_MICRO ($COMMAND)."
107 return 1
108 }
109
110 # Check for required version and die if unhappy
111
112 if [ "x$UNAME" = "xFreeBSD" ]; then
113 version_compare libtoolize 1 5 16 || exit 1
114 version_compare automake19 1 9 5 || exit 1
115 version_compare autoconf259 2 59 || exit 1
116 ACLOCAL=aclocal19
117 AUTOHEADER=autoheader259
118 AUTOMAKE=automake19
119 AUTOCONF=autoconf259
120 else
121 version_compare libtoolize 1 5 16 || exit 1
122 version_compare automake 1 9 5 || exit 1
123 version_compare autoconf 2 59 || exit 1
124 ACLOCAL=aclocal
125 AUTOHEADER=autoheader
126 AUTOMAKE=automake
127 AUTOCONF=autoconf
128 fi
129
130 libtoolize --copy --force --ltdl
131 #NetBSD seems to need this file writable
132 chmod u+w libltdl/configure
133
134 $ACLOCAL
135 $AUTOHEADER --force
136 $AUTOMAKE --copy --add-missing
137 $AUTOCONF --force
138
139 #chmod ug+x debian/rules
140
141 if [ "x$UNAME" = "xNetBSD" ]; then
142 echo ""
143 echo "Please remember to run gmake instead of make on NetBSD"
144 echo ""
145 fi

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.