[ovs-dev] [PATCH 1/2] build: Allow building with autoconf 2.63

Flavio Leitner fbl at redhat.com
Thu Sep 11 14:04:51 UTC 2014


From: Thomas Graf <tgraf at noironetworks.com>

Reduces the dependency on autoconf from 2.64 to 2.63 to ease building
on older platforms. There is only a few macros missing and they can
be provided easily.

A handful of tests needed modification. The difference in quoting
behaviour between 2.63 and later require the m4_define() to be
manually unfolded.

The Debian control file is left untouched on purpose. The decision
whether to adjust the dependency is left to the respective maintainers.

Tested with autoconf 2.63 and 2.69.

Cc: Scott Mann <smann at noironetworks.com>
Cc: Don Kehn <dkehn at noironetworks.com>
Signed-off-by: Thomas Graf <tgraf at noironetworks.com>
Signed-off-by: Ben Pfaff <blp at nicira.com>
Signed-off-by: Flavio Leitner <fbl at redhat.com>
---
 INSTALL               |    2 +-
 INSTALL.RHEL          |    4 +-
 NEWS                  |    1 +
 configure.ac          |    2 +-
 m4/compat.at          |   32 +++++++++++++++++++++++++
 m4/openvswitch.m4     |    2 +
 tests/ovsdb-row.at    |   62 +++++++++++++++++++++++-------------------------
 tests/ovsdb-server.at |    2 +-
 tests/testsuite.at    |    2 +
 9 files changed, 72 insertions(+), 37 deletions(-)
 create mode 100644 m4/compat.at

diff --git a/INSTALL b/INSTALL
index 5c869b2..65009a8 100644
--- a/INSTALL
+++ b/INSTALL
@@ -85,7 +85,7 @@ If you are working from a Git tree or snapshot (instead of from a
 distribution tarball), or if you modify the Open vSwitch build system
 or the database schema, you will also need the following software:
 
-    - Autoconf version 2.64 or later.
+    - Autoconf version 2.63 or later.
 
     - Automake version 1.10 or later.
 
diff --git a/INSTALL.RHEL b/INSTALL.RHEL
index b7b294b..3301a45 100644
--- a/INSTALL.RHEL
+++ b/INSTALL.RHEL
@@ -20,10 +20,10 @@ RHEL.  On RHEL 5, the default RPM source directory is
 1. If you are building from a distribution tarball, proceed to step 2.
    Otherwise, if you are building from an Open vSwitch Git tree,
    determine the version of Autoconf available in the RHEL version you
-   are using.  If it is not at least version 2.64, then you have two
+   are using.  If it is not at least version 2.63, then you have two
    choices:
 
-     a. Install Autoconf 2.64 or later, one way or another.
+     a. Install Autoconf 2.63 or later, one way or another.
 
      b. Create a distribution tarball on some other machine, by
         running "./boot.sh; ./configure; make dist" in the Git tree.
diff --git a/NEWS b/NEWS
index 39c6486..8bec498 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
 v2.3.1 - xx xxx xxxx
 ---------------------
+   - Compatibility with autoconf 2.63 (previously >=2.64)
 
 
 v2.3.0 - 14 Aug 2014
diff --git a/configure.ac b/configure.ac
index 6ca0592..5c1f398 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-AC_PREREQ(2.64)
+AC_PREREQ(2.63)
 AC_INIT(openvswitch, 2.3.1, bugs at openvswitch.org)
 AC_CONFIG_SRCDIR([datapath/datapath.c])
 AC_CONFIG_MACRO_DIR([m4])
diff --git a/m4/compat.at b/m4/compat.at
new file mode 100644
index 0000000..736f1ff
--- /dev/null
+++ b/m4/compat.at
@@ -0,0 +1,32 @@
+# -*- autoconf -*-
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+m4_ifndef([AT_CHECK_UNQUOTED],
+  [m4_define([AT_CHECK_UNQUOTED],
+  [_AT_CHECK([$1], [$2], AS_ESCAPE(m4_dquote(m4_expand([$3])), [""]),
+    AS_ESCAPE(m4_dquote(m4_expand([$4])),[""]), [$5], [$6])])])
+
+m4_ifndef([AT_SKIP_IF],
+  [m4_define([AT_SKIP_IF],
+    [AT_CHECK([($1) \
+    && exit 77 || exit 0], [0], [ignore], [ignore])])])
+
+m4_ifndef([AT_FAIL_IF],
+  [m4_define([AT_FAIL_IF],
+    [AT_CHECK([($1) \
+    && exit 99 || exit 0], [0], [ignore], [ignore])])])
+
+m4_ifndef([AS_VAR_COPY],
+  [m4_define([AS_VAR_COPY],
+    [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])])
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index fa741f6..1308d1c 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -13,6 +13,8 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+#
+m4_include([m4/compat.at])
 
 dnl Checks for --enable-coverage and updates CFLAGS and LDFLAGS appropriately.
 AC_DEFUN([OVS_CHECK_COVERAGE],
diff --git a/tests/ovsdb-row.at b/tests/ovsdb-row.at
index 34a102c..0b2ae77 100644
--- a/tests/ovsdb-row.at
+++ b/tests/ovsdb-row.at
@@ -1,7 +1,5 @@
 AT_BANNER([OVSDB -- rows])
 
-m4_define([RESERVED_COLUMNS], [["_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"]]])
-
 OVSDB_CHECK_POSITIVE([row with one string column],
   [[parse-rows \
     '{"columns": {"name": {"type": "string"}}}' \
@@ -9,14 +7,14 @@ OVSDB_CHECK_POSITIVE([row with one string column],
     '{"name": ""}' \
     '{"name": "longer string with spaces"}' \
     '{}']],
-  [{RESERVED_COLUMNS,"name":"value"}
+  [[{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"name":"value"}
 name
-{RESERVED_COLUMNS,"name":""}
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"name":""}
 name
-{RESERVED_COLUMNS,"name":"longer string with spaces"}
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"name":"longer string with spaces"}
 name
-{RESERVED_COLUMNS,"name":""}
-<none>], [])
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"name":""}
+<none>]], [])
 
 OVSDB_CHECK_POSITIVE([row with one integer column],
   [[parse-rows \
@@ -25,14 +23,14 @@ OVSDB_CHECK_POSITIVE([row with one integer column],
     '{"count": -1}' \
     '{"count": 2e10}' \
     '{}']],
-  [{RESERVED_COLUMNS,"count":1}
+  [[{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"count":1}
 count
-{RESERVED_COLUMNS,"count":-1}
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"count":-1}
 count
-{RESERVED_COLUMNS,"count":20000000000}
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"count":20000000000}
 count
-{RESERVED_COLUMNS,"count":0}
-<none>], [])
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"count":0}
+<none>]], [])
 
 OVSDB_CHECK_POSITIVE([row with one real column],
   [[parse-rows \
@@ -41,14 +39,14 @@ OVSDB_CHECK_POSITIVE([row with one real column],
     '{"cost": -2.0}' \
     '{"cost": 123000}' \
     '{}']],
-  [{RESERVED_COLUMNS,"cost":1}
+  [[{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"cost":1}
 cost
-{RESERVED_COLUMNS,"cost":-2}
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"cost":-2}
 cost
-{RESERVED_COLUMNS,"cost":123000}
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"cost":123000}
 cost
-{RESERVED_COLUMNS,"cost":0}
-<none>], [])
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"cost":0}
+<none>]], [])
 
 OVSDB_CHECK_POSITIVE([row with one boolean column],
   [[parse-rows \
@@ -56,12 +54,12 @@ OVSDB_CHECK_POSITIVE([row with one boolean column],
     '{"feasible": true}' \
     '{"feasible": false}' \
     '{}']],
-  [{RESERVED_COLUMNS,"feasible":true}
+  [[{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"feasible":true}
 feasible
-{RESERVED_COLUMNS,"feasible":false}
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"feasible":false}
 feasible
-{RESERVED_COLUMNS,"feasible":false}
-<none>], [])
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"feasible":false}
+<none>]], [])
 
 OVSDB_CHECK_POSITIVE([row with one uuid column],
   [[parse-rows \
@@ -69,26 +67,26 @@ OVSDB_CHECK_POSITIVE([row with one uuid column],
     '{"ref": ["uuid", "f707423d-bf5b-48b5-b6c0-797c900ba4b6"]}' \
     '{"ref": ["uuid", "33583cc5-d2f4-43de-b1ca-8aac14071b51"]}' \
     '{}']],
-  [{RESERVED_COLUMNS,"ref":[["uuid","f707423d-bf5b-48b5-b6c0-797c900ba4b6"]]}
+  [[{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"ref":["uuid","f707423d-bf5b-48b5-b6c0-797c900ba4b6"]}
 ref
-{RESERVED_COLUMNS,"ref":[["uuid","33583cc5-d2f4-43de-b1ca-8aac14071b51"]]}
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"ref":["uuid","33583cc5-d2f4-43de-b1ca-8aac14071b51"]}
 ref
-{RESERVED_COLUMNS,"ref":[["uuid","00000000-0000-0000-0000-000000000000"]]}
-<none>], [])
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"ref":["uuid","00000000-0000-0000-0000-000000000000"]}
+<none>]], [])
 
 OVSDB_CHECK_POSITIVE([row with set of 1 to 2 elements],
   [[parse-rows \
     '{"columns": {"myset": {"type": {"key": "integer", "min": 1, "max": 2}}}}' \
     '{}']],
-  [{RESERVED_COLUMNS,["myset":0]}
-<none>])
+  [[{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"myset":0}
+<none>]])
 
 OVSDB_CHECK_POSITIVE([row with map of 1 to 2 elements],
   [[parse-rows \
     '{"columns": {"mymap": {"type": {"key": "integer", "value": "uuid", "min": 1, "max": 2}}}}' \
     '{}']],
-  [{RESERVED_COLUMNS,["mymap":["map",[[0,["uuid","00000000-0000-0000-0000-000000000000"]]]]]}
-<none>], [])
+  [[{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"mymap":["map",[[0,["uuid","00000000-0000-0000-0000-000000000000"]]]]}
+<none>]], [])
 
 OVSDB_CHECK_POSITIVE([row with several columns],
   [[parse-rows \
@@ -107,10 +105,10 @@ OVSDB_CHECK_POSITIVE([row with several columns],
       "datapath_id": "000ae4256bb0",
       "hwaddr": "00:0a:e4:25:6b:b0"}' \
     '{}']],
- [{RESERVED_COLUMNS,["controller":["set",[]],"datapath_id":"000ae4256bb0","hwaddr":"00:0a:e4:25:6b:b0","listeners":["set",[]],"mirrors":["set",[]],"name":"br0","netflows":["set",[]],"snoops":["set",[]],"vswitch":["uuid","1a5c7280-0d4c-4e34-9ec7-c772339f7774"]]}
+ [[{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"controller":["set",[]],"datapath_id":"000ae4256bb0","hwaddr":"00:0a:e4:25:6b:b0","listeners":["set",[]],"mirrors":["set",[]],"name":"br0","netflows":["set",[]],"snoops":["set",[]],"vswitch":["uuid","1a5c7280-0d4c-4e34-9ec7-c772339f7774"]}
 datapath_id, hwaddr, name, vswitch
-{RESERVED_COLUMNS,["controller":["set",[]],"datapath_id":["set",[]],"hwaddr":"","listeners":["set",[]],"mirrors":["set",[]],"name":"","netflows":["set",[]],"snoops":["set",[]],"vswitch":["uuid","00000000-0000-0000-0000-000000000000"]]}
-<none>], [])
+{"_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"],"controller":["set",[]],"datapath_id":["set",[]],"hwaddr":"","listeners":["set",[]],"mirrors":["set",[]],"name":"","netflows":["set",[]],"snoops":["set",[]],"vswitch":["uuid","00000000-0000-0000-0000-000000000000"]}
+<none>]], [])
 
 OVSDB_CHECK_POSITIVE([row hashing (scalars)],
   [[compare-rows \
diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at
index 86179bd..67b107d 100644
--- a/tests/ovsdb-server.at
+++ b/tests/ovsdb-server.at
@@ -526,7 +526,7 @@ AT_CHECK(
 cat stdout >> output
 AT_CHECK_UNQUOTED(
   [cat output], [0],
-  [[[{"rows":[{"private_key":"$PKIDIR/testpki-privkey2.pem"}]}]
+  [[@<:@{"rows":@<:@{"private_key":"$PKIDIR/testpki-privkey2.pem"}@:>@}@:>@
 ]], [ignore], [test ! -e pid || kill `cat pid`])
 OVSDB_SERVER_SHUTDOWN
 AT_CLEANUP
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 264a15f..9e23ebe 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -18,6 +18,8 @@ AT_TESTED([ovs-vswitchd])
 AT_TESTED([ovs-vsctl])
 AT_TESTED([perl])
 
+m4_include([m4/compat.at])
+
 m4_divert_push([PREPARE_TESTS])
 [
 ovs_wait () {
-- 
1.7.1




More information about the dev mailing list