For SNAT, don't store the pre-fragment L2 header before actions are applied.
[sliver-openvswitch.git] / boot.sh
1 #! /bin/sh
2
3 set -e
4
5 have_ext=$(if test -e ext/automake.mk; then echo yes; else echo no; fi)
6 for opt
7 do
8     case $opt in
9         (--enable-ext) have_ext=yes ;;
10         (--disable-ext) have_ext=no ;;
11         (--help) cat <<EOF
12 $0: bootstrap OpenFlow from a Git repository
13 usage: $0 [OPTIONS]
14 The recognized options are:
15   --enable-ext      include openflowext
16   --disable-ext     exclude openflowext
17 By default, openflowext is included if it is present.
18 EOF
19         exit 0
20         ;;
21         (*) echo "unknown option $opt; use --help for help"; exit 1 ;;
22     esac
23 done
24
25 # Generate list of files in debian/ to distribute.
26 (echo '# Automatically generated by boot.sh (from Git tree).' &&
27  printf 'EXTRA_DIST += \\\n' &&
28  git ls-files debian | grep -v '^debian/\.gitignore$' | 
29  sed -e 's/\(.*\)/      \1 \\/' -e '$s/ \\//') > debian/automake.mk
30
31 # Enable or disable ext.
32 if test "$have_ext" = yes; then
33     echo 'Enabling openflowext...'
34     echo 'include ext/automake.mk' > ext.mk
35     echo 'm4_include([ext/configure.m4])' > ext.m4
36     cat debian/control.in ext/debian/control.in > debian/control
37     for d in $(cd ext/debian && git ls-files --exclude-from=debian/dontlink)
38     do
39         test -e debian/$d || ln -s ../ext/debian/$d debian/$d
40         if ! fgrep -q $d debian/.gitignore; then
41             echo "Adding $d to debian/.gitignore"
42             (cat debian/.gitignore && printf '/%s' "$d") \
43                 | LC_ALL=C sort > tmp$$ \
44                 && mv tmp$$ debian/.gitignore
45         fi
46     done
47 else
48     echo 'Disabling openflowext...'
49     echo '# This file intentionally left blank.' > ext.mk
50     echo '# This file intentionally left blank.' > ext.m4
51     cat debian/control.in > debian/control
52 fi
53
54 # Bootstrap configure system from .ac/.am files
55 autoreconf --install -I config --force