3
PATH=/usr/local/gnu-autotools/bin/:$PATH
6
# Start from one level above the build directory
7
if [ -f version ]; then
11
if [ \! -f build/version ]; then
12
echo "Can't find source directory"
16
# BSD make's "OBJDIR" support freaks out the automake-generated
17
# Makefile. Effectively disable it.
18
export MAKEOBJDIRPREFIX=/junk
20
# Start from the build directory, where the version file is located
21
if [ -f build/version ]; then
25
if [ \! -f version ]; then
26
echo "Can't find version file"
30
# Update the build number in the 'version' file.
31
# Separate number from additional alpha/beta/etc marker
32
MARKER=`cat version | sed 's/[0-9.]//g'`
34
VN=`cat version | sed 's/[^0-9.]//g'`
35
# Build out the string.
36
VS="$(($VN/1000000)).$(( ($VN/1000)%1000 )).$(( $VN%1000 ))$MARKER"
40
# Clean up the source dir as much as we can.
41
/bin/sh build/clean.sh
43
# Substitute the integer version into Libarchive's archive.h
44
perl -p -i -e "s/^(#define\tARCHIVE_VERSION_NUMBER).*/\$1 $VN/" libarchive/archive.h
45
perl -p -i -e "s/^(#define\tARCHIVE_VERSION_STRING).*/\$1 \"libarchive $VS\"/" libarchive/archive.h
46
# Substitute versions into configure.ac as well
47
perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_S\]),.*\)/$1,['"$VS"'])/' configure.ac
48
perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_N\]),.*\)/$1,['"$VN"'])/' configure.ac
51
aclocal -I build/autoconf
53
# Note: --automake flag needed only for libtoolize from
54
# libtool 1.5.x; in libtool 2.2.x it is a synonym for --quiet
56
Darwin) glibtoolize --automake -c;;
57
*) libtoolize --automake -c;;
b'\\ No newline at end of file'