6a5ac53db622634ff67b9aeeae65356ed15e036f
[sliver-openvswitch.git] / boot.sh
1 #! /bin/sh -e
2
3 have_ext=$(if test -e ext/automake.mk; then echo yes; else echo no; fi)
4 for opt
5 do
6     case $opt in
7         (--enable-ext) have_ext=yes ;;
8         (--disable-ext) have_ext=no ;;
9         (--help) cat <<EOF
10 $0: bootstrap OpenFlow from a Git repository
11 usage: $0 [OPTIONS]
12 The recognized options are:
13   --enable-ext      include openflowext
14   --disable-ext     exclude openflowext
15 By default, openflowext is included if it is present.
16 EOF
17         exit 0
18         ;;
19         (*) echo "unknown option $opt; use --help for help"; exit 1 ;;
20     esac
21 done
22
23 # Generate list of files in debian/ to distribute.
24 (echo '# Automatically generated by boot.sh (from Git tree).' &&
25  echo 'EXTRA_DIST += \' &&
26  git ls-files debian | grep -v '^debian/\.gitignore$' | 
27  sed -e 's/\(.*\)/      \1 \\/' -e '$s/ \\//') > debian/automake.mk
28
29 # Enable or disable ext.
30 if test "$have_ext" = yes; then
31     echo 'Enabling openflowext...'
32     echo 'include ext/automake.mk' > ext.mk
33     echo 'm4_include([ext/configure.m4])' > ext.m4
34 else
35     echo 'Disabling openflowext...'
36     echo '# This file intentionally left blank.' > ext.mk
37     echo '# This file intentionally left blank.' > ext.m4
38 fi
39
40 # Bootstrap configure system from .ac/.am files
41 autoreconf --install -I config --force