Browse Source

Remove the nss3 path prefix from the cert.h C preprocessor source file inclusion

Bug Description:
The NSS header cert.h resides in different paths on different operating
systems. Hardcoding a path prefix as #include <nss3/cert.h> caused
fatal compile-time errors on some operating systems, such as Debian,
because the C preprocessor could not find the header.

Fix Description:
Removing the 'nss3' path prefix allows compilation to succeed, as
the compiler can locate cert.h in the NSS include path detected
by pkg-config.

Changes to rpm/389-ds-base.spec.in included at the request of
Matus Honek in https://pagure.io/389-ds-base/pull-request/50352

Author: Hugh McMaster <[email protected]>

Reviewed by: firstyear, mhonek, mreynolds

Remove NSS header and library path hacks from the rpm package spec file

Patch suggested by Matus Honek in https://pagure.io/389-ds-base/pull-request/50352
Hugh McMaster 6 years ago
parent
commit
06c9f534e2
3 changed files with 3 additions and 5 deletions
  1. 1 1
      include/ldaputil/certmap.h
  2. 1 1
      lib/ldaputil/examples/init.c
  3. 1 3
      rpm/389-ds-base.spec.in

+ 1 - 1
include/ldaputil/certmap.h

@@ -16,7 +16,7 @@
 /* What was extcmap.h begins ... */
 
 #include <ldap.h>
-#include <nss3/cert.h>
+#include <cert.h>
 
 #ifndef NSAPI_PUBLIC
 #define NSAPI_PUBLIC

+ 1 - 1
lib/ldaputil/examples/init.c

@@ -15,7 +15,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
-#include <nss3/cert.h>
+#include <cert.h>
 #include "certmap.h" /* Public Certmap API */
 #include "plugin.h"  /* must define extern "C" functions */
 

+ 1 - 3
rpm/389-ds-base.spec.in

@@ -333,8 +333,6 @@ CLANG_FLAGS="--enable-clang"
 %endif
 
 %{?with_tmpfiles_d: TMPFILES_FLAG="--with-tmpfiles-d=%{with_tmpfiles_d}"}
-# hack hack hack https://bugzilla.redhat.com/show_bug.cgi?id=833529
-NSSARGS="--with-nss-lib=%{_libdir} --with-nss-inc=%{_includedir}/nss3"
 
 %if %{use_asan} && !%{use_rust}
 ASAN_FLAGS="--enable-asan --enable-debug"
@@ -379,7 +377,7 @@ autoreconf -fiv
            --with-systemdsystemconfdir=%{_sysconfdir}/systemd/system \
            --with-systemdgroupname=%{groupname} \
            --libexecdir=%{_libexecdir}/%{pkgname} \
-           $NSSARGS $ASAN_FLAGS $MSAN_FLAGS $TSAN_FLAGS $UBSAN_FLAGS $RUST_FLAGS $PERL_FLAGS $CLANG_FLAGS \
+           $ASAN_FLAGS $MSAN_FLAGS $TSAN_FLAGS $UBSAN_FLAGS $RUST_FLAGS $PERL_FLAGS $CLANG_FLAGS \
            --enable-cmocka \
            --enable-perl