build: indent shell functions in configure
Script has lots of shell functions but never indented properly.
This commit is contained in:
parent
d29feaaa35
commit
07a6f5eca2
|
|
@ -1,5 +1,5 @@
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
# This is not an autconf generated configure
|
# This is not an autoconf generated configure
|
||||||
#
|
#
|
||||||
INCLUDE=${1:-"$PWD/include"}
|
INCLUDE=${1:-"$PWD/include"}
|
||||||
|
|
||||||
|
|
@ -9,16 +9,16 @@ trap 'status=$?; rm -rf $TMPDIR; exit $status' EXIT HUP INT QUIT TERM
|
||||||
|
|
||||||
check_toolchain()
|
check_toolchain()
|
||||||
{
|
{
|
||||||
: ${PKG_CONFIG:=pkg-config}
|
: ${PKG_CONFIG:=pkg-config}
|
||||||
: ${AR=ar}
|
: ${AR=ar}
|
||||||
: ${CC=gcc}
|
: ${CC=gcc}
|
||||||
echo "AR:=${AR}" >>Config
|
echo "AR:=${AR}" >>Config
|
||||||
echo "CC:=${CC}" >>Config
|
echo "CC:=${CC}" >>Config
|
||||||
}
|
}
|
||||||
|
|
||||||
check_atm()
|
check_atm()
|
||||||
{
|
{
|
||||||
cat >$TMPDIR/atmtest.c <<EOF
|
cat >$TMPDIR/atmtest.c <<EOF
|
||||||
#include <atm.h>
|
#include <atm.h>
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
struct atm_qos qos;
|
struct atm_qos qos;
|
||||||
|
|
@ -26,21 +26,22 @@ int main(int argc, char **argv) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
$CC -I$INCLUDE -o $TMPDIR/atmtest $TMPDIR/atmtest.c -latm >/dev/null 2>&1
|
|
||||||
if [ $? -eq 0 ]
|
$CC -I$INCLUDE -o $TMPDIR/atmtest $TMPDIR/atmtest.c -latm >/dev/null 2>&1
|
||||||
then
|
if [ $? -eq 0 ]
|
||||||
echo "TC_CONFIG_ATM:=y" >>Config
|
then
|
||||||
echo yes
|
echo "TC_CONFIG_ATM:=y" >>Config
|
||||||
else
|
echo yes
|
||||||
echo no
|
else
|
||||||
fi
|
echo no
|
||||||
rm -f $TMPDIR/atmtest.c $TMPDIR/atmtest
|
fi
|
||||||
|
rm -f $TMPDIR/atmtest.c $TMPDIR/atmtest
|
||||||
}
|
}
|
||||||
|
|
||||||
check_xt()
|
check_xt()
|
||||||
{
|
{
|
||||||
#check if we have xtables from iptables >= 1.4.5.
|
#check if we have xtables from iptables >= 1.4.5.
|
||||||
cat >$TMPDIR/ipttest.c <<EOF
|
cat >$TMPDIR/ipttest.c <<EOF
|
||||||
#include <xtables.h>
|
#include <xtables.h>
|
||||||
#include <linux/netfilter.h>
|
#include <linux/netfilter.h>
|
||||||
static struct xtables_globals test_globals = {
|
static struct xtables_globals test_globals = {
|
||||||
|
|
@ -57,27 +58,27 @@ int main(int argc, char **argv)
|
||||||
xtables_init_all(&test_globals, NFPROTO_IPV4);
|
xtables_init_all(&test_globals, NFPROTO_IPV4);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL $(${PKG_CONFIG} xtables --cflags --libs) -ldl >/dev/null 2>&1
|
if $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL \
|
||||||
then
|
$(${PKG_CONFIG} xtables --cflags --libs) -ldl >/dev/null 2>&1
|
||||||
|
then
|
||||||
echo "TC_CONFIG_XT:=y" >>Config
|
echo "TC_CONFIG_XT:=y" >>Config
|
||||||
echo "using xtables"
|
echo "using xtables"
|
||||||
fi
|
fi
|
||||||
rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest
|
rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest
|
||||||
}
|
}
|
||||||
|
|
||||||
check_xt_old()
|
check_xt_old()
|
||||||
{
|
{
|
||||||
# bail if previous XT checks has already succeded.
|
# bail if previous XT checks has already succeded.
|
||||||
if grep TC_CONFIG_XT Config > /dev/null
|
if grep -q TC_CONFIG_XT Config
|
||||||
then
|
then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#check if we dont need our internal header ..
|
#check if we dont need our internal header ..
|
||||||
cat >$TMPDIR/ipttest.c <<EOF
|
cat >$TMPDIR/ipttest.c <<EOF
|
||||||
#include <xtables.h>
|
#include <xtables.h>
|
||||||
char *lib_dir;
|
char *lib_dir;
|
||||||
unsigned int global_option_offset = 0;
|
unsigned int global_option_offset = 0;
|
||||||
|
|
@ -97,26 +98,26 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
$CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1
|
|
||||||
|
|
||||||
if [ $? -eq 0 ]
|
$CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1
|
||||||
then
|
if [ $? -eq 0 ]
|
||||||
|
then
|
||||||
echo "TC_CONFIG_XT_OLD:=y" >>Config
|
echo "TC_CONFIG_XT_OLD:=y" >>Config
|
||||||
echo "using old xtables (no need for xt-internal.h)"
|
echo "using old xtables (no need for xt-internal.h)"
|
||||||
fi
|
fi
|
||||||
rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest
|
rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest
|
||||||
}
|
}
|
||||||
|
|
||||||
check_xt_old_internal_h()
|
check_xt_old_internal_h()
|
||||||
{
|
{
|
||||||
# bail if previous XT checks has already succeded.
|
# bail if previous XT checks has already succeded.
|
||||||
if grep TC_CONFIG_XT Config > /dev/null
|
if grep -q TC_CONFIG_XT Config
|
||||||
then
|
then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#check if we need our own internal.h
|
#check if we need our own internal.h
|
||||||
cat >$TMPDIR/ipttest.c <<EOF
|
cat >$TMPDIR/ipttest.c <<EOF
|
||||||
#include <xtables.h>
|
#include <xtables.h>
|
||||||
#include "xt-internal.h"
|
#include "xt-internal.h"
|
||||||
char *lib_dir;
|
char *lib_dir;
|
||||||
|
|
@ -137,14 +138,14 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
$CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1
|
$CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1
|
||||||
|
|
||||||
if [ $? -eq 0 ]
|
if [ $? -eq 0 ]
|
||||||
then
|
then
|
||||||
echo "using old xtables with xt-internal.h"
|
echo "using old xtables with xt-internal.h"
|
||||||
echo "TC_CONFIG_XT_OLD_H:=y" >>Config
|
echo "TC_CONFIG_XT_OLD_H:=y" >>Config
|
||||||
fi
|
fi
|
||||||
rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest
|
rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest
|
||||||
}
|
}
|
||||||
|
|
||||||
check_ipt()
|
check_ipt()
|
||||||
|
|
@ -179,7 +180,7 @@ check_ipt_lib_dir()
|
||||||
|
|
||||||
check_setns()
|
check_setns()
|
||||||
{
|
{
|
||||||
cat >$TMPDIR/setnstest.c <<EOF
|
cat >$TMPDIR/setnstest.c <<EOF
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|
@ -187,20 +188,20 @@ int main(int argc, char **argv)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
$CC -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 2>&1
|
$CC -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 2>&1
|
||||||
if [ $? -eq 0 ]
|
if [ $? -eq 0 ]
|
||||||
then
|
then
|
||||||
echo "IP_CONFIG_SETNS:=y" >>Config
|
echo "IP_CONFIG_SETNS:=y" >>Config
|
||||||
echo "yes"
|
echo "yes"
|
||||||
else
|
else
|
||||||
echo "no"
|
echo "no"
|
||||||
fi
|
fi
|
||||||
rm -f $TMPDIR/setnstest.c $TMPDIR/setnstest
|
rm -f $TMPDIR/setnstest.c $TMPDIR/setnstest
|
||||||
}
|
}
|
||||||
|
|
||||||
check_ipset()
|
check_ipset()
|
||||||
{
|
{
|
||||||
cat >$TMPDIR/ipsettest.c <<EOF
|
cat >$TMPDIR/ipsettest.c <<EOF
|
||||||
#include <linux/netfilter/ipset/ip_set.h>
|
#include <linux/netfilter/ipset/ip_set.h>
|
||||||
#ifndef IP_SET_INVALID
|
#ifndef IP_SET_INVALID
|
||||||
#define IPSET_DIM_MAX 3
|
#define IPSET_DIM_MAX 3
|
||||||
|
|
@ -219,14 +220,14 @@ int main(void)
|
||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if $CC -I$INCLUDE -o $TMPDIR/ipsettest $TMPDIR/ipsettest.c >/dev/null 2>&1
|
if $CC -I$INCLUDE -o $TMPDIR/ipsettest $TMPDIR/ipsettest.c >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
echo "TC_CONFIG_IPSET:=y" >>Config
|
echo "TC_CONFIG_IPSET:=y" >>Config
|
||||||
echo "yes"
|
echo "yes"
|
||||||
else
|
else
|
||||||
echo "no"
|
echo "no"
|
||||||
fi
|
fi
|
||||||
rm -f $TMPDIR/ipsettest.c $TMPDIR/ipsettest
|
rm -f $TMPDIR/ipsettest.c $TMPDIR/ipsettest
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "# Generated config based on" $INCLUDE >Config
|
echo "# Generated config based on" $INCLUDE >Config
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue