瀏覽代碼

Ticket 49177 - rpm would not create valid pkgconfig files

Bug Description:  pkgconfig from the rpm was not valid.

Fix Description:  Resolve an issue in the way we handle the file
substiution to resolve this issue.

https://pagure.io/389-ds-base/issue/49177

Author: wibrown

Review by: mreynolds (Thanks!)
William Brown 8 年之前
父節點
當前提交
4fb30a0006
共有 4 個文件被更改,包括 13 次插入8 次删除
  1. 2 8
      Makefile.am
  2. 3 0
      configure.ac
  3. 4 0
      m4/mozldap.m4
  4. 4 0
      m4/openldap.m4

+ 2 - 8
Makefile.am

@@ -110,14 +110,12 @@ if OPENLDAP
 # shared lib _fini for one will stomp on the other, and the program will crash
 LDAPSDK_LINK_NOTHR = @openldap_lib@ -lldap@ol_libver@ @ldap_lib_ldif@ -llber@ol_libver@
 LDAPSDK_LINK = @openldap_lib@ -lldap_r@ol_libver@ @ldap_lib_ldif@ -llber@ol_libver@
-ldaplib = openldap
-ldaplib_defs = -DUSE_OPENLDAP
 else
 LDAPSDK_LINK = @ldapsdk_lib@ -lssldap60 -lprldap60 -lldap60 -lldif60
 LDAPSDK_LINK_NOTHR = $(LDAPSDK_LINK)
-ldaplib = mozldap
-ldaplib_defs =
 endif
+ldaplib = @ldaplib@
+ldaplib_defs = @ldaplib_defs@
 
 DB_LINK = @db_lib@ -ldb-@db_libver@
 SASL_LINK = @sasl_lib@ -lsasl2
@@ -2234,10 +2232,6 @@ else
 	$(fixupcmd) $^ | sed -n -e 's/@preamble@//' -e '/^#/{p;d;}' -e '/^$$/{p;d;}' -e 's/^\([^=]*\)\(=.*\)$$/\1\2 ; export \1/ ; p' > $@
 endif
 
-%/$(PACKAGE_NAME).pc: %/dirsrv.pc.in
-	if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi
-	$(fixupcmd) $^ > $@
-
 %/$(PACKAGE_NAME)-snmp: %/ldap-agent-initscript.in
 	if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi
 	$(fixupcmd) $^ > $@

+ 3 - 0
configure.ac

@@ -784,6 +784,8 @@ AC_SUBST(openldap_inc)
 AC_SUBST(openldap_lib)
 AC_SUBST(openldap_libdir)
 AC_SUBST(openldap_bindir)
+AC_SUBST(ldaplib)
+AC_SUBST(ldaplib_defs)
 AC_SUBST(ldaptool_bindir)
 AC_SUBST(ldaptool_opts)
 AC_SUBST(plainldif_opts)
@@ -852,6 +854,7 @@ if test "$GCC" != yes ; then
 fi
 
 # Build our pkgconfig files
+# This currently conflicts with %.in: rule in Makefile.am, which should be removed eventually.
 AC_CONFIG_FILES([src/pkgconfig/dirsrv.pc src/pkgconfig/nunc-stans.pc src/pkgconfig/libsds.pc])
 
 AC_CONFIG_FILES([Makefile rpm/389-ds-base.spec  ])

+ 4 - 0
m4/mozldap.m4

@@ -15,6 +15,8 @@ AC_ARG_WITH(ldapsdk, AS_HELP_STRING([--with-ldapsdk@<:@=PATH@:>@],[Mozilla LDAP
   if test "$withval" = yes
   then
     AC_MSG_RESULT(yes)
+    ldaplib="mozldap"
+    ldaplib_defs=""
   elif test "$withval" = no
   then
     AC_MSG_RESULT(no)
@@ -22,6 +24,8 @@ AC_ARG_WITH(ldapsdk, AS_HELP_STRING([--with-ldapsdk@<:@=PATH@:>@],[Mozilla LDAP
   then
     AC_MSG_RESULT([using $withval])
     LDAPSDKDIR=$withval
+    ldaplib="mozldap"
+    ldaplib_defs=""
     ldapsdk_inc="-I$LDAPSDKDIR/include"
     ldapsdk_lib="-L$LDAPSDKDIR/lib"
     ldapsdk_libdir="$LDAPSDKDIR/lib"

+ 4 - 0
m4/openldap.m4

@@ -15,6 +15,8 @@ AC_ARG_WITH(openldap, AS_HELP_STRING([--with-openldap@<:@=PATH@:>@],[Use OpenLDA
   if test "$withval" = yes
   then
     AC_MSG_RESULT([using system OpenLDAP])
+    ldaplib="openldap"
+    ldaplib_defs="-DUSE_OPENLDAP"
   elif test "$withval" = no
   then
     AC_MSG_RESULT(no)
@@ -22,6 +24,8 @@ AC_ARG_WITH(openldap, AS_HELP_STRING([--with-openldap@<:@=PATH@:>@],[Use OpenLDA
   then
     AC_MSG_RESULT([using $withval])
     OPENLDAPDIR=$withval
+    ldaplib="openldap"
+    ldaplib_defs="-DUSE_OPENLDAP"
     openldap_incdir="$OPENLDAPDIR/include"
     openldap_inc="-I$openldap_incdir"
     openldap_lib="-L$OPENLDAPDIR/lib"