Debian Codegraph @

buildconf

raw
1 #!/bin/sh
2 #
3 # Licensed to the Apache Software Foundation (ASF) under one or more
4 # contributor license agreements. See the NOTICE file distributed with
5 # this work for additional information regarding copyright ownership.
6 # The ASF licenses this file to You under the Apache License, Version 2.0
7 # (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 #
19 # buildconf: Build the support scripts needed to compile from a
20 # checked-out version of the source code.
21
22 perl="${PERL:-perl}"
23 libtool="${LIBTOOL:-libtool}"
24 aclocal="${ACLOCAL:-aclocal}"
25 automake="${AUTOMAKE:-automake}"
26 autoconf="${AUTOCONF:-autoconf}"
27 autoheader="${AUTOHEADER:-autoheader}"
28
29 save_args="$*";
30
31 while test $# -gt 0
32 do
33 # Normalize
34 case "$1" in
35 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
36 *) optarg= ;;
37 esac
38
39 case "$1" in
40 --with-perl=*)
41 perl=$optarg
42 ;;
43 --with-libtool=*)
44 libtool=$optarg
45 ;;
46 --with-aclocal=*)
47 aclocal=$optarg
48 ;;
49 --with-automake=*)
50 automake=$optarg
51 ;;
52 --with-autoconf=*)
53 autoconf=$optarg
54 ;;
55 --with-autoheader=*)
56 autoheader=$optarg
57 ;;
58 esac
59
60 shift
61 done
62
63 libtoolize="${libtool}ize --automake --copy --force"
64
65 echo "removing stale config files"
66 touch .deps
67 rm -f aclocal.m4
68 rm -f generated_lists
69 rm -rf autom4te*.cache
70
71 echo "checking buildconf prereqs";
72 $perl build/version_check.pl libtool $libtool || exit 1
73 $perl build/version_check.pl autoconf $autoconf || exit 1
74 $perl build/version_check.pl automake $automake || exit 1
75 $perl build/version_check.pl ExtUtils::XSBuilder || exit 1
76 #$perl build/version_check.pl Test::Inline || exit 1
77 PREREQ_PM=`$perl build/version_check.pl perl_prereqs`
78
79 echo "running $libtoolize" && $libtoolize && \
80 echo "running $aclocal" && $aclocal && \
81 echo "running $autoconf" && $autoconf && \
82 echo "running $autoheader" && $autoheader && \
83 echo "running $automake -a -c" && $automake -a -c && \
84 echo "running xsbuilder" && (cd glue/perl && $perl ../../build/xsbuilder.pl) && \
85 echo "running cpan prereq fixups" && $perl -i -wpe "s/PREREQ_PM/$PREREQ_PM/" Makefile.in && \
86 echo "saving arguments for reuse." && cat >buildconf.nice <<END_CAT
87 #!/bin/sh
88 ./buildconf $save_args
89 END_CAT
90
91 if [ "$?" -eq "0" ] ; then
92 chmod +x buildconf.nice && \
93 echo "buildconf successful."
94 else
95 echo "saving buildconf arguments failed."
96 exit 1
97 fi