Skip to contentSkip to conversation

configure: fix libsmartcard_nss compile check

PATCH In review Alexander Graf 3 participants 4 messages Jul 9, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: fix libsmartcard_nss compile check

When just calling ./configure on my box, I always ran into the same issue:

In file included from /usr/include/nss3/pkcs11t.h:1780,

                 from /usr/include/nss3/keythi.h:41,
                 from /usr/include/nss3/keyt.h:41,
                 from /usr/include/nss3/pk11pub.h:43,
                 from libcacard/vcard_emul_nss.c:21:

/usr/include/nss3/pkcs11n.h:365:26: error: "__GNUC_MINOR" is not defined

This is a bug in nss3. But why didn't configure bail out of the feature if it doesn't even compile? Because this really is just a warning, not an error. But configure builds its test program without -Werror, while we do build our sources with -Werror by default.

Force the check to also use -Werror. This fixes the default build for me again.

---
 configure |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
configure +4 -0
index 9f071b7..d28a909 100755
@@ -2642,6 +2642,10 @@ EOF
         smartcard_cflags="-I\$(SRC_PATH)/libcacard"
         libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs"
         libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags"
+        # nss < 3.13.3 has a nasty warning that can trigger compile failures
+        # with -Werror. Unfortunately, we don't know if -Werror is goint to
+        # be used here yet, so let's just assume it to be safe.
+        libcacard_cflags="$libcacard_cflags -Werror"
         if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \
           compile_prog "$smartcard_cflags $libcacard_cflags" "$libcacard_libs"; then
             smartcard_nss="yes"
Signature · 1 line
1.6.0.2
#1 lore raw

Am 09.07.2012 14:06, schrieb Alexander Graf:

Quoted 26 lines

When just calling ./configure on my box, I always ran into the same issue:

In file included from /usr/include/nss3/pkcs11t.h:1780,

                 from /usr/include/nss3/keythi.h:41,
                 from /usr/include/nss3/keyt.h:41,
                 from /usr/include/nss3/pk11pub.h:43,
                 from libcacard/vcard_emul_nss.c:21:

/usr/include/nss3/pkcs11n.h:365:26: error: "__GNUC_MINOR" is not defined

This is a bug in nss3. But why didn't configure bail out of the feature if it doesn't even compile? Because this really is just a warning, not an error. But configure builds its test program without -Werror, while we do build our sources with -Werror by default.

Force the check to also use -Werror. This fixes the default build for me again.

---
 configure |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
configure +0 -0
index 9f071b7..d28a909 100755

configure EOF · line 2646

Quoted 5 lines
configure +2 -0
@@ -2642,6 +2642,10 @@ EOF
         smartcard_cflags="-I\$(SRC_PATH)/libcacard"
         libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs"
         libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags"
+        # nss < 3.13.3 has a nasty warning that can trigger compile failures
+        # with -Werror. Unfortunately, we don't know if -Werror is goint to

"going"

configure EOF · line 2647

Quoted 1 line
configure +1 -0
+        # be used here yet, so let's just assume it to be safe.

Maybe you can just temporarily supply it to compile_prog below then?

Andreas

Quoted 5 lines
configure +1 -0
+        libcacard_cflags="$libcacard_cflags -Werror"
         if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \
           compile_prog "$smartcard_cflags $libcacard_cflags" "$libcacard_libs"; then
             smartcard_nss="yes"
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#2 lore raw
In reply to Alexander Graf
Quoted 7 lines · Alexander Graf

When just calling ./configure on my box, I always ran into the same issue:

In file included from /usr/include/nss3/pkcs11t.h:1780,

                 from /usr/include/nss3/keythi.h:41,
                 from /usr/include/nss3/keyt.h:41,
                 from /usr/include/nss3/pk11pub.h:43,
                 from libcacard/vcard_emul_nss.c:21:
Quoted 8 lines

/usr/include/nss3/pkcs11n.h:365:26: error: "__GNUC_MINOR" is not defined

This is a bug in nss3. But why didn't configure bail out of the feature if it doesn't even compile? Because this really is just a warning, not an error. But configure builds its test program without -Werror, while we do build our sources with -Werror by default.

Force the check to also use -Werror. This fixes the default build for me again.

Good idea, but shouldn't we do that
(a) for all compile tests and
(b) only with --enable-werror

?

cheers,
Gerd

#3 lore raw
Quoted 15 lines · Gerd Hoffmann
Quoted 14 lines · Alexander Graf

When just calling ./configure on my box, I always ran into the same issue:

In file included from /usr/include/nss3/pkcs11t.h:1780,

                from /usr/include/nss3/keythi.h:41,
                from /usr/include/nss3/keyt.h:41,
                from /usr/include/nss3/pk11pub.h:43,
                from libcacard/vcard_emul_nss.c:21:

/usr/include/nss3/pkcs11n.h:365:26: error: "__GNUC_MINOR" is not defined

This is a bug in nss3. But why didn't configure bail out of the feature if it doesn't even compile? Because this really is just a warning, not an error. But configure builds its test program without -Werror, while we do build our sources with -Werror by default.

Quoted 5 lines
Quoted 1 line

Force the check to also use -Werror. This fixes the default build for me again.

Good idea, but shouldn't we do that
(a) for all compile tests and
(b) only with --enable-werror

Yeah, my configure foo wasn't good enough to figure out when exactly -Werror is passed in. At the point in time when the smartcard check is done, neither $werror nor $QEMU_CFLAGS have been set.

Alex