summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-04-07 10:18:44 -0400
committerNick Mathewson <nickm@torproject.org>2021-04-07 10:18:44 -0400
commit02816d60591a6b3887f47df81fb99cb72d5ad2db (patch)
tree5886f82559989477f7d32996645ea97cdade551f
parent3271c0bde782769ba30685ca8907240328f771c9 (diff)
downloadtor-02816d60591a6b3887f47df81fb99cb72d5ad2db.tar.gz
tor-02816d60591a6b3887f47df81fb99cb72d5ad2db.zip
Try making our configure.ac script build with AC 2.70.
In versions <=2.69, according to the autoconf docs, AC_PROG_CC_C99 is needed with some compilers, if they require extra arguments to build C99 programs. In versions >=2.70, AC_PROG_CC checks for these compilers automatically, and so the AC_PROG_CC_C99 macro is obsolete. So, what can you do if you want your script to work right with both autoconf versions? IIUC, neither including AC_PROG_CC_C99 macro nor leaving it out will give you the right behavior with both versions. It looks like you need to look at the autoconf version explicitly. (Now, the autoconf manual implies that it's "against autoconf philosophy" to look at the autoconf version rather than trying the behavior to see if it works, but they don't actually tell you how to detect recoverably at autoconf-time whether a macro is obsolete or not, and I can't find a way to do that.) So, is it safe to use m4_version_prereq, like I do here? It isn't listed in the autoconf 2.63 manual (which is the oldest version we support). But a mailing list message [1] (which added the documentation back in 2008) implies that m4_version_prereq has been there since "at least back to autoconf 2.59". https://lists.gnu.org/archive/html/autoconf-patches/2008-12/msg00025.html So I think this will work. I am basing this patch against Tor 0.3.5 since, if autoconf 2.70 becomes widespread before 0.3.5 is unsupported, we might need this patch to continue 0.3.5 development. But I don't think we should backport farther than 0.4.5 until/unless that actually happens. This is part of a fix for #40355.
-rw-r--r--changes/autoconf-2.703
-rw-r--r--configure.ac6
2 files changed, 8 insertions, 1 deletions
diff --git a/changes/autoconf-2.70 b/changes/autoconf-2.70
new file mode 100644
index 0000000000..27a9f243b1
--- /dev/null
+++ b/changes/autoconf-2.70
@@ -0,0 +1,3 @@
+ o Minor features (compilation):
+ - Make the autoconf script build correctly with autoconf versions 2.70
+ and later. Closes part of ticket 40335.
diff --git a/configure.ac b/configure.ac
index 619e91528c..179e8915b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -292,7 +292,11 @@ AC_PATH_PROGS([A2X], [a2x a2x.py], none)
AM_CONDITIONAL(USE_ASCIIDOC, test "x$asciidoc" = "xtrue")
AM_PROG_CC_C_O
-AC_PROG_CC_C99
+
+dnl Before autoconf 2.70, AC_PROG_CC_C99 is supposedly necessary for some
+dnl compilers if you wan't C99 support. Starting with 2.70, it is obsolete and
+dnl forbidden.
+m4_version_prereq([2.70], [:], [AC_PROG_CC_C99])
AC_ARG_VAR([PYTHON], [path to Python binary])
AC_CHECK_PROGS(PYTHON, [ \