File: buildconf

package info (click to toggle)
libapreq2 2.17-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,164 kB
  • sloc: ansic: 8,283; perl: 5,451; sh: 4,627; cpp: 380; makefile: 270; javascript: 186
file content (97 lines) | stat: -rwxr-xr-x 2,764 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/sh
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# buildconf: Build the support scripts needed to compile from a
#            checked-out version of the source code.

perl="${PERL:-perl}"
libtool="${LIBTOOL:-libtool}"
aclocal="${ACLOCAL:-aclocal}"
automake="${AUTOMAKE:-automake}"
autoconf="${AUTOCONF:-autoconf}"
autoheader="${AUTOHEADER:-autoheader}"

save_args="$*";

while test $# -gt 0 
do
  # Normalize
  case "$1" in
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  case "$1" in
  --with-perl=*)
  perl=$optarg
  ;;
  --with-libtool=*)
  libtool=$optarg
  ;;
  --with-aclocal=*)
  aclocal=$optarg
  ;;
  --with-automake=*)
  automake=$optarg
  ;;
  --with-autoconf=*)
  autoconf=$optarg
  ;;
  --with-autoheader=*)
  autoheader=$optarg
  ;;
  esac

  shift
done

libtoolize="${libtool}ize --automake --copy --force"

echo "removing stale config files"
touch .deps
rm -f aclocal.m4
rm -f generated_lists
rm -rf autom4te*.cache

echo "checking buildconf prereqs";
$perl build/version_check.pl libtool $libtool  || exit 1
$perl build/version_check.pl autoconf $autoconf  || exit 1
$perl build/version_check.pl automake $automake  || exit 1
$perl build/version_check.pl ExtUtils::XSBuilder || exit 1
#$perl build/version_check.pl Test::Inline || exit 1
PREREQ_PM=`$perl build/version_check.pl perl_prereqs`

echo "running $libtoolize" && $libtoolize && \
echo "running $aclocal"  && $aclocal && \
echo "running $autoconf" && $autoconf && \
echo "running $autoheader" && $autoheader && \
echo "running $automake -a -c" && $automake -a -c && \
echo "running xsbuilder" && (cd glue/perl && $perl ../../build/xsbuilder.pl) && \
echo "running cpan prereq fixups" && $perl -i -wpe "s/PREREQ_PM/$PREREQ_PM/" Makefile.in && \
echo "saving arguments for reuse." && cat >buildconf.nice <<END_CAT
#!/bin/sh
./buildconf $save_args
END_CAT

if [ "$?" -eq "0" ] ; then
  chmod +x buildconf.nice && \
  echo "buildconf successful."
else
  echo "saving buildconf arguments failed."
  exit 1
fi