]>
Commit | Line | Data |
---|---|---|
ee50ecdf TK |
1 | #!/bin/sh |
2 | ||
192fd4ff TK |
3 | PATH=/usr/local/gnu-autotools/bin/:$PATH |
4 | export PATH | |
ee50ecdf TK |
5 | |
6 | # Start from one level above the build directory | |
7 | if [ -f version ]; then | |
8 | cd .. | |
9 | fi | |
10 | ||
11 | if [ \! -f build/version ]; then | |
12 | echo "Can't find source directory" | |
13 | exit 1 | |
14 | fi | |
15 | ||
192fd4ff TK |
16 | # BSD make's "OBJDIR" support freaks out the automake-generated |
17 | # Makefile. Effectively disable it. | |
18 | export MAKEOBJDIRPREFIX=/junk | |
19 | ||
20 | # Start from the build directory, where the version file is located | |
21 | if [ -f build/version ]; then | |
22 | cd build | |
23 | fi | |
24 | ||
25 | if [ \! -f version ]; then | |
26 | echo "Can't find version file" | |
27 | exit 1 | |
28 | fi | |
29 | ||
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'` | |
33 | # Bump the number | |
34 | VN=`cat version | sed 's/[^0-9.]//g'` | |
35 | # Build out the string. | |
36 | VS="$(($VN/1000000)).$(( ($VN/1000)%1000 )).$(( $VN%1000 ))$MARKER" | |
37 | ||
38 | cd .. | |
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 | 44 | perl -p -i -e "s/^(#define\tARCHIVE_VERSION_NUMBER).*/\$1 $VN/" libarchive/archive.h |
911dc2bf | 45 | perl -p -i -e "s/^(#define\tARCHIVE_VERSION_NUMBER).*/\$1 $VN/" libarchive/archive_entry.h |
884f82a9 | 46 | perl -p -i -e "s/^(#define\tARCHIVE_VERSION_ONLY_STRING).*/\$1 \"$VS\"/" libarchive/archive.h |
192fd4ff TK |
47 | # Substitute versions into configure.ac as well |
48 | perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_S\]),.*\)/$1,['"$VS"'])/' configure.ac | |
49 | perl -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 |
52 | if [ -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 |
55 | fi |
56 | ||
ee50ecdf | 57 | set -xe |
b1e75e9c CW |
58 | aclocal -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 |
62 | case `uname` in |
63 | Darwin) glibtoolize --automake -c;; | |
64 | *) libtoolize --automake -c;; | |
65 | esac | |
b1e75e9c CW |
66 | autoconf |
67 | autoheader | |
ee50ecdf | 68 | automake -a -c |