GNUPG_SYS_SYMBOL_UNDERSCORE fails with underscores

quetschke@scytek.de quetschke@scytek.de
Tue Jul 9 21:28:01 2002


--xB0nW4MQa6jZONgY
Content-Type: multipart/mixed; boundary="R+My9LyyhiUvIEro"
Content-Disposition: inline


--R+My9LyyhiUvIEro
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

I recently found a problem in GNUPG_SYS_SYMBOL_UNDERSCORE. This macro is
defined in aclocal.m4 and called by configure. It is ment to check if=20
the symbols have underscores. And it fails if the symbols really have=20
underscores.

The problem arises from GNUPG_SYS_NM_PARSE, which is a required macro
for GNUPG_SYS_SYMBOL_UNDERSCORE, GNUPG_SYS_NM_PARSE failes to parse the
output of nm when the symbols have underscores.

The attached patch fixes this problem. The patch is against acinclude.m4=20
from GnuPG 1.1.90.

Bye
   Volker

P.S.: I am sorry for the one line concerning cygwin, but unfortunately
it was my test case for a system with symbols with underscores ;-)

--=20
PGP7.0.3H1 key (ID: 0x9F8A785D) available from keyserver.pgp.com
key-fingerprint 550D F17E B082 A3E9 F913  9E53 3D35 C9BA 9F8A 785D

--R+My9LyyhiUvIEro
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="acinclude.m4.diff"
Content-Transfer-Encoding: quoted-printable

--- gnupg-1.1.90.org/acinclude.m4	2002-06-29 16:15:02.000000000 +0200
+++ ../gnupg/gnupg-1.1.90/acinclude.m4	2002-07-08 19:18:11.000000000 +0200
@@ -570,8 +570,9 @@
     fi
=20
     # Make sure that we snagged all the symbols we need.
-    if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
-      if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
+    # Fix: Adding the [_] makes this test also work with underscore symbols
+    if egrep ' [[_]]nm_test_var$' "$ac_nlist" >/dev/null; then
+      if egrep ' [[_]]nm_test_func$' "$ac_nlist" >/dev/null; then
         cat <<EOF > conftest.c
 #ifdef __cplusplus
 extern "C" {
@@ -579,7 +580,8 @@
=20
 EOF
         # Now generate the symbol file.
-        sed 's/^.* \(.*\)$/extern char \1;/' < "$ac_nlist" >> conftest.c
+        # Fix: Adding the [_] makes this test also work with underscore sy=
mbols
+        sed 's/^.* [[_]]\(.*\)$/extern char \1;/' < "$ac_nlist" >> conftes=
t.c
=20
         cat <<EOF >> conftest.c
 #if defined (__STDC__) && __STDC__
@@ -601,7 +603,8 @@
 changequote([,])dnl
 {
 EOF
-        sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$ac_nlist" >=
> conftest.c
+        # Fix: Adding the [_] makes this test also work with underscore sy=
mbols
+        sed 's/^[[_]]\(.*\) [[_]]\(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$a=
c_nlist" >> conftest.c
         cat <<\EOF >> conftest.c
   {0, (__ptr_t) 0}
 };
@@ -661,7 +664,7 @@
 AC_DEFUN(GNUPG_SYS_SYMBOL_UNDERSCORE,
 [tmp_do_check=3D"no"
 case "${target}" in
-    i386-emx-os2 | i[3456]86-pc-os2*emx | i386-pc-msdosdjgpp | *-*-cygwin)
+    i386-emx-os2 | i[3456]86-pc-os2*emx | i386-pc-msdosdjgpp)
         ac_cv_sys_symbol_underscore=3Dyes
         ;;
     *)

--R+My9LyyhiUvIEro--

--xB0nW4MQa6jZONgY
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.1.90 (Cygwin32)

iD8DBQE9KzmWPTXJup+KeF0RAjYCAJ4zobxKEN9gzy6eSLyq4JPnul+bMACeOD9F
9SytBq+yyHcbIrzh8+fROHU=
=bif+
-----END PGP SIGNATURE-----

--xB0nW4MQa6jZONgY--