]> granicus.if.org Git - strace/commitdiff
build: fix --with-libiberty
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 19 Feb 2019 01:39:32 +0000 (01:39 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 19 Feb 2019 01:39:32 +0000 (01:39 +0000)
* m4/st_demangle.m4 (st_DEMANGLE): Move the check for cplus_demangle
out of AC_CHECK_HEADERS because the latter checks for demangle.h in two
different places and an absence of demangle.h in one of these places
would cause a build error in --with-libiberty=yes mode.
* NEWS: Mention this fix.

Resolves: https://github.com/strace/strace/issues/92

NEWS
m4/st_demangle.m4

diff --git a/NEWS b/NEWS
index ae1a94e4f20f3c297ae2bb89b4044174dba592c4..9ae753120c90ed558a68ee4f011421feacf2bc1e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ Noteworthy changes in release ?.?? (????-??-??)
   * Fixed strace-k test on alpha.
   * Fixed build on mips o32.
   * Fixed build on NOMMU architectures.
+  * Fixed build in --with-libiberty=yes mode.
 
 Noteworthy changes in release 4.26 (2018-12-26)
 ===============================================
index ba019eb83a8e81a8f80600899d4e977e743349fa..8f617fba9b1b6dd13257f7bb06264d3a124119dc 100644 (file)
@@ -27,26 +27,29 @@ use_libiberty=no
 AS_IF([test "x$with_libiberty" != xno],
       [saved_CPPFLAGS="$CPPFLAGS"
        CPPFLAGS="$CPPFLAGS $libiberty_CPPFLAGS"
+       found_demangle_h=no
        AC_CHECK_HEADERS([demangle.h libiberty/demangle.h],
-        [saved_LDFLAGS="$LDFLAGS"
-         LDFLAGS="$LDFLAGS $libiberty_LDFLAGS"
-         AC_CHECK_LIB([iberty],[cplus_demangle],
-           [libiberty_LIBS="-liberty"
-            use_libiberty=yes
-           ],
-           [if test "x$with_libiberty" != xcheck; then
-              AC_MSG_FAILURE([failed to find cplus_demangle in libiberty])
-            fi
-           ]
-         )
-         LDFLAGS="$saved_LDFLAGS"
-        ],
-        [if test "x$with_libiberty" != xcheck; then
-             AC_MSG_FAILURE([failed to find demangle.h])
-         fi
-        ]
-       )
+                       [found_demangle_h=yes])
        CPPFLAGS="$saved_CPPFLAGS"
+       AS_IF([test "x$found_demangle_h" = xyes],
+            [saved_LDFLAGS="$LDFLAGS"
+             LDFLAGS="$LDFLAGS $libiberty_LDFLAGS"
+             AC_CHECK_LIB([iberty],[cplus_demangle],
+               [libiberty_LIBS="-liberty"
+                use_libiberty=yes
+               ],
+               [if test "x$with_libiberty" != xcheck; then
+                  AC_MSG_FAILURE([failed to find cplus_demangle in libiberty])
+                fi
+               ]
+             )
+             LDFLAGS="$saved_LDFLAGS"
+            ],
+            [if test "x$with_libiberty" != xcheck; then
+               AC_MSG_FAILURE([failed to find demangle.h])
+             fi
+            ]
+       )
       ]
 )