File: setup

package info (click to toggle)
discover 2.1.2-7.1+deb9u1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 6,248 kB
  • sloc: sh: 8,115; ansic: 7,275; xml: 1,809; makefile: 732
file content (105 lines) | stat: -rwxr-xr-x 2,532 bytes parent folder | download | duplicates (7)
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
98
99
100
101
102
103
104
105
#! /bin/sh

# Run this program to setup the build environment.

# $Progeny$

# This program is in the public domain.

# Too bad we don't have something like sysexits.h for POSIX sh...
EX_USAGE=64

usage ()
{
    cat <<EOF
usage: $0
       $0 (aclocal|autoheader|autoconf) ...

Setup the build environment.  If arguments are given, only those actions
are performed.
EOF
}

do_aclocal ()
{
    echo "cat $@ > aclocal.m4"
    cat "$@" > aclocal.m4
    return $?
}

do_autoheader ()
{
    echo "autoheader && touch config.h.in"
    autoheader && touch config.h.in
    return $?
}

do_autoconf ()
{
    echo "autoconf"
    autoconf
    return $?
}

###############################################################################

buildtools=buildtools
aclibs="${buildtools}/check.m4"
aclibs="${aclibs} ${buildtools}/config-script.m4"
aclibs="${aclibs} ${buildtools}/libtool.m4"
aclibs="${aclibs} ${buildtools}/show-config.m4"
aclibs="${aclibs} ${buildtools}/java/ac_check_class.m4"
aclibs="${aclibs} ${buildtools}/java/ac_check_classpath.m4"
aclibs="${aclibs} ${buildtools}/java/ac_check_junit.m4"
aclibs="${aclibs} ${buildtools}/java/ac_check_rqrd_class.m4"
aclibs="${aclibs} ${buildtools}/java/ac_java_options.m4"
aclibs="${aclibs} ${buildtools}/java/ac_prog_jar.m4"
aclibs="${aclibs} ${buildtools}/java/ac_prog_java.m4"
aclibs="${aclibs} ${buildtools}/java/ac_prog_java_cc.m4"
aclibs="${aclibs} ${buildtools}/java/ac_prog_java_works.m4"
aclibs="${aclibs} ${buildtools}/java/ac_prog_javac.m4"
aclibs="${aclibs} ${buildtools}/java/ac_prog_javac_works.m4"
aclibs="${aclibs} ${buildtools}/java/ac_prog_javadoc.m4"
aclibs="${aclibs} ${buildtools}/java/ac_prog_javah.m4"
aclibs="${aclibs} ${buildtools}/java/ac_try_compile_java.m4"
aclibs="${aclibs} ${buildtools}/java/ac_try_run_javac.m4"
aclibs="${aclibs} ${buildtools}/python/ac_py_check_lib.m4"
aclibs="${aclibs} ${buildtools}/python/ac_prog_python.m4"
aclibs="${aclibs} ${buildtools}/python/ac_prog_python_works.m4"
aclibs="${aclibs} ${buildtools}/python/ac_py_lib_path.m4"

if [ -f aclibs ]; then
    aclibs=$(sed -e 's/#.*//' aclibs)
fi

if [ $# -eq 0 ]; then
    set aclocal autoheader autoconf
fi

while [ $# -gt 0 ]; do
    case $1 in
    aclocal)
        do_aclocal ${aclibs}
        ;;
    autoheader)
        do_autoheader
        ;;
    autoconf)
        do_autoconf
        ;;
    *)
        usage
        exit ${EX_USAGE}
        ;;
    esac

    result=$?
    if [ ${result} -ne 0 ]; then
        echo "$0: $1 failed."
        exit ${result}
    fi

    shift
done

exit 0