]> git.ipfire.org Git - thirdparty/libarchive.git/blame - build/autogen.sh
Never allow empty passwords (#2116)
[thirdparty/libarchive.git] / build / autogen.sh
CommitLineData
ee50ecdf
TK
1#!/bin/sh
2
192fd4ff
TK
3PATH=/usr/local/gnu-autotools/bin/:$PATH
4export PATH
ee50ecdf
TK
5
6# Start from one level above the build directory
7if [ -f version ]; then
8 cd ..
9fi
10
11if [ \! -f build/version ]; then
12 echo "Can't find source directory"
13 exit 1
14fi
15
192fd4ff
TK
16# BSD make's "OBJDIR" support freaks out the automake-generated
17# Makefile. Effectively disable it.
18export MAKEOBJDIRPREFIX=/junk
19
20# Start from the build directory, where the version file is located
21if [ -f build/version ]; then
22 cd build
23fi
24
25if [ \! -f version ]; then
26 echo "Can't find version file"
27 exit 1
28fi
29
30# Update the build number in the 'version' file.
31# Separate number from additional alpha/beta/etc marker
32MARKER=`cat version | sed 's/[0-9.]//g'`
33# Bump the number
34VN=`cat version | sed 's/[^0-9.]//g'`
35# Build out the string.
36VS="$(($VN/1000000)).$(( ($VN/1000)%1000 )).$(( $VN%1000 ))$MARKER"
37
38cd ..
39
40# Clean up the source dir as much as we can.
41/bin/sh build/clean.sh
42
911dc2bf 43# Substitute the versions into Libarchive's archive.h and archive_entry.h
192fd4ff 44perl -p -i -e "s/^(#define\tARCHIVE_VERSION_NUMBER).*/\$1 $VN/" libarchive/archive.h
911dc2bf 45perl -p -i -e "s/^(#define\tARCHIVE_VERSION_NUMBER).*/\$1 $VN/" libarchive/archive_entry.h
884f82a9 46perl -p -i -e "s/^(#define\tARCHIVE_VERSION_ONLY_STRING).*/\$1 \"$VS\"/" libarchive/archive.h
192fd4ff
TK
47# Substitute versions into configure.ac as well
48perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_S\]),.*\)/$1,['"$VS"'])/' configure.ac
49perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_N\]),.*\)/$1,['"$VN"'])/' configure.ac
50
581841b8
AM
51# Remove developer CFLAGS if a release build is being made
52if [ -n "${MAKE_LIBARCHIVE_RELEASE}" ]; then
53 perl -p -i -e "s/^(DEV_CFLAGS.*)/# \$1/" Makefile.am
22aab5ff 54 perl -p -i -e 's/CMAKE_BUILD_TYPE "[A-Za-z]*"/CMAKE_BUILD_TYPE "Release"/' CMakeLists.txt
581841b8
AM
55fi
56
ee50ecdf 57set -xe
b1e75e9c
CW
58aclocal -I build/autoconf
59
60# Note: --automake flag needed only for libtoolize from
61# libtool 1.5.x; in libtool 2.2.x it is a synonym for --quiet
ee50ecdf
TK
62case `uname` in
63Darwin) glibtoolize --automake -c;;
64*) libtoolize --automake -c;;
65esac
b1e75e9c
CW
66autoconf
67autoheader
ee50ecdf 68automake -a -c