Avoid leaving Makefile.am and configure.ac slightly modified by boot.sh.
authorBen Pfaff <blp@nicira.com>
Fri, 17 Oct 2008 23:15:34 +0000 (16:15 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 17 Oct 2008 23:15:34 +0000 (16:15 -0700)
(This turned out to be more annoying than I expected.)

.gitignore
Makefile.am
boot.sh
configure.ac

index fb1103765656d464a4bbf85f899ef19873dc9ee5..be6113cd43d6fd3d9ff1d338332246cb5e7dbf70 100644 (file)
@@ -39,4 +39,6 @@
 Module.symvers
 TAGS
 cscope.*
+ext.m4
+ext.mk
 tags
index b1221fd9040dea70b2e37cb498b15d6dd7f9c9a6..26ac9eabf1c78e2e6b621ceb9d38c65b4ebc63ab 100644 (file)
@@ -60,4 +60,4 @@ include tests/automake.mk
 include include/automake.mk
 include third-party/automake.mk
 include debian/automake.mk
-include ext/automake.mk
+include ext.mk
diff --git a/boot.sh b/boot.sh
index 7c674c5079f7ae85c332a0db8745e011751773a2..6a5ac53db622634ff67b9aeeae65356ed15e036f 100755 (executable)
--- a/boot.sh
+++ b/boot.sh
@@ -20,35 +20,22 @@ EOF
     esac
 done
 
-
 # Generate list of files in debian/ to distribute.
 (echo '# Automatically generated by boot.sh (from Git tree).' &&
  echo 'EXTRA_DIST += \' &&
  git ls-files debian | grep -v '^debian/\.gitignore$' | 
  sed -e 's/\(.*\)/     \1 \\/' -e '$s/ \\//') > debian/automake.mk
 
-# Find the "include ext/automake.mk" line in Makefile.am and comment
-# it out or in according to whether ext is available, and similarly
-# for "m4_include(ext/configure.m4)" in configure.ac.
-subst() {
-    perl -pe "$1" < "$2" > "$2.tmp"
-    if cmp -s "$2.tmp" "$2"; then
-       rm "$2.tmp"
-    else
-       mv "$2.tmp" "$2"
-    fi
-}
+# Enable or disable ext.
 if test "$have_ext" = yes; then
     echo 'Enabling openflowext...'
-    OC='#'
-    NC=
+    echo 'include ext/automake.mk' > ext.mk
+    echo 'm4_include([ext/configure.m4])' > ext.m4
 else
     echo 'Disabling openflowext...'
-    OC=
-    NC='#'
+    echo '# This file intentionally left blank.' > ext.mk
+    echo '# This file intentionally left blank.' > ext.m4
 fi
-subst "s|^$OC(include ext/automake\\.mk)\$|$NC\$1|" Makefile.am
-subst "s|^$OC(m4_include\\(ext/configure\.m4\\))\$|$NC\$1|" configure.ac
 
 # Bootstrap configure system from .ac/.am files
 autoreconf --install -I config --force
index 9cca05971ea74c719012922ee6b5cee7e298cfbc..f4e923a95ea3e11c6975f2ad91bef2cf97f78d51 100644 (file)
@@ -63,7 +63,7 @@ OFP_CHECK_DPKG_BUILDPACKAGE
 CFLAGS="$CFLAGS -Wall -Wno-sign-compare -Wpointer-arith -Wdeclaration-after-statement"
 
 OFP_ENABLE_EXT
-m4_include(ext/configure.m4)
+m4_include([ext.m4])
 
 AC_CONFIG_FILES([Makefile 
 datapath/Makefile