File: bootstrap

package info (click to toggle)
patchutils 0.4.3-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 3,976 kB
  • sloc: ansic: 20,804; sh: 11,956; xml: 2,831; perl: 419; makefile: 300; python: 23
file content (53 lines) | stat: -rwxr-xr-x 1,531 bytes parent folder | download
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
#! /bin/sh

set -e

echo "Bootstrap: Setting up patchutils build environment..."

# Check if we need to update gnulib files
update_gnulib=false
if [ "$1" = "--update-gnulib" ] || [ "$1" = "-u" ]; then
    update_gnulib=true
    echo "Updating gnulib modules..."
fi

echo "Cleaning autogenerated files..."

rm -f *.o *.so config.sub config.guess config.cache
rm -f config.log config.h config.status config.h.in
rm -f Makefile configure builtin/*.o pgcrypto.sql
rm -f Makefile.in aclocal.m4 confdefs.h ltconfig ltmain.sh
rm -f install-sh mkinstalldirs missing stamp*
rm -f interdiff filterdiff combinediff
rm -f compile depcomp
rm -f *~
rm -rf autom4te.cache/
rm -f INSTALL
rm -f test-driver

# Update gnulib if requested or if gnulib files seem missing/outdated
if [ "$update_gnulib" = true ] || [ ! -f "lib/Makefile.am" ] || [ ! -f "m4/gnulib-comp.m4" ]; then
    echo "Updating gnulib modules..."

    if command -v gnulib-tool >/dev/null 2>&1; then
        echo "Using gnulib-tool..."
        if gnulib-tool --update; then
            echo "Gnulib modules updated."
        else
            echo "Error: gnulib-tool failed. Please check your gnulib installation."
            exit 1
        fi
    else
        echo "Error: gnulib-tool not found. Please install gnulib package."
        exit 1
    fi
fi

echo "Running autoreconf..."
autoreconf --install --verbose

echo ""
echo "Bootstrap completed successfully!"
echo "Now you may run ./configure"
echo ""
echo "Tip: Use './bootstrap --update-gnulib' to update gnulib modules"