Ken Moffat wrote:
I'd got a bit fed up with writing everything into a .pc in a here
document, and having to change hardcoded values every time there was
a small change to the build.
On that point, here. The nspr patch is courtesy Gentoo and works from
the configure options. Not so lucky with the nss patch. I just clobbed
it together to automate creating the nss{-config,.pc} files so that at
least the versions are correct based on the build tree (also added
-lsoftokn3 to nss.pc and nss-config) when applying to any version.
Libs and includes are hard coded in the nss one, but it was a 10 minute
fix that works well enough for me (and changes the libdir while I'm at
it)...maybe it can include and use the other makefiles (and a manifest)
and do everything correctly later on. Anyway, when I get it all
working together correctly, I'll post all 4 sets of build commands to
this thread.
-- DJ Lucas
--
This message has been scanned for viruses and
dangerous content, and is believed to be clean.
diff -Naur nss-3.12-orig/mozilla/security/coreconf/location.mk nss-3.12/mozilla/security/coreconf/location.mk
--- nss-3.12-orig/mozilla/security/coreconf/location.mk 2006-02-24 13:40:32.000000000 -0600
+++ nss-3.12/mozilla/security/coreconf/location.mk 2008-11-10 21:48:33.000000000 -0600
@@ -72,7 +72,7 @@
endif
ifndef NSPR_LIB_DIR
- NSPR_LIB_DIR = $(DIST)/lib
+ NSPR_LIB_DIR = $(DIST)/lib/nspr
endif
ifdef NSS_INCLUDE_DIR
@@ -80,7 +80,7 @@
endif
ifndef NSS_LIB_DIR
- NSS_LIB_DIR = $(DIST)/lib
+ NSS_LIB_DIR = $(DIST)/lib/nss
endif
MK_LOCATION = included
diff -Naur nss-3.12-orig/mozilla/security/nss/cmd/manifest.mn nss-3.12/mozilla/security/nss/cmd/manifest.mn
--- nss-3.12-orig/mozilla/security/nss/cmd/manifest.mn 2007-01-25 13:04:56.000000000 -0600
+++ nss-3.12/mozilla/security/nss/cmd/manifest.mn 2008-11-10 21:50:42.000000000 -0600
@@ -54,6 +54,7 @@
dbtest \
derdump \
digest \
+ disttools \
fipstest \
makepqg \
ocspclnt \
diff -Naur nss-3.12-orig/mozilla/security/nss/cmd/disttools/Makefile nss-3.12/mozilla/security/nss/cmd/disttools/Makefile
--- nss-3.12-orig/mozilla/security/nss/cmd/disttools/Makefile 1969-12-31 18:00:00.000000000 -0600
+++ nss-3.12/mozilla/security/nss/cmd/disttools/Makefile 2008-11-10 22:19:41.000000000 -0600
@@ -0,0 +1,64 @@
+#! gmake
+#
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is the Netscape security libraries.
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications Corporation.
+# Portions created by the Initial Developer are Copyright (C) 1994-2000
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s): DJ Lucas <[EMAIL PROTECTED]>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+CORE_DEPTH = ../../..
+
+VERSION = $(shell grep NSS_VERSION $(CORE_DEPTH)/../dist/public/nss/nss.h | \
+ cut -d\" -f2)
+NSS_VERSION_MAJOR = $(shell echo $(VERSION) | cut -d. -f1)
+NSS_VERSION_MINOR = $(shell echo $(VERSION) | cut -d. -f2)
+NSS_VERSION_PATCH = $(shell echo $(VERSION) | cut -d. -f3)
+NSS_VERSION_BUILD = $(shell echo $(VERSION) | cut -d. -f4)
+
+
+all: export
+
+export:
+ sed -e 's/@NSS_VERSION_MAJOR@/$(NSS_VERSION_MAJOR)/' \
+ -e 's/@NSS_VERSION_MINOR@/$(NSS_VERSION_MINOR)/' \
+ -e 's/@NSS_VERSION_PATCH@/$(NSS_VERSION_PATCH)/' \
+ -e 's/@NSS_VERSION_BUILD@/$(NSS_VERSION_BUILD)/' \
+ nss-config.in > nss-config
+ sed -e 's/@NSS_VERSION_MAJOR@/$(NSS_VERSION_MAJOR)/' \
+ -e 's/@NSS_VERSION_MINOR@/$(NSS_VERSION_MINOR)/' \
+ -e 's/@NSS_VERSION_PATCH@/$(NSS_VERSION_PATCH)/' \
+ -e 's/@NSS_VERSION_BUILD@/$(NSS_VERSION_BUILD)/' \
+ nss.pc.in > nss.pc
+
+.phony: all export
+
diff -Naur nss-3.12-orig/mozilla/security/nss/cmd/disttools/nss-config.in nss-3.12/mozilla/security/nss/cmd/disttools/nss-config.in
--- nss-3.12-orig/mozilla/security/nss/cmd/disttools/nss-config.in 1969-12-31 18:00:00.000000000 -0600
+++ nss-3.12/mozilla/security/nss/cmd/disttools/nss-config.in 2008-11-10 22:22:13.000000000 -0600
@@ -0,0 +1,142 @@
+#!/bin/sh
+
+prefix=/usr
+
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
+
+usage()
+{
+ cat <<EOF
+Usage: nss-config [OPTIONS] [LIBRARIES]
+Options:
+ [--prefix[=DIR]]
+ [--exec-prefix[=DIR]]
+ [--includedir[=DIR]]
+ [--libdir[=DIR]]
+ [--version]
+ [--libs]
+ [--cflags]
+Dynamic Libraries:
+ nss
+ ssl
+ smime
+EOF
+ exit $1
+}
+
+if test $# -eq 0; then
+ usage 1 1>&2
+fi
+
+lib_ssl=yes
+lib_smime=yes
+lib_nss=yes
+lib_softokn=yes
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $1 in
+ --prefix=*)
+ prefix=$optarg
+ ;;
+ --prefix)
+ echo_prefix=yes
+ ;;
+ --exec-prefix=*)
+ exec_prefix=$optarg
+ ;;
+ --exec-prefix)
+ echo_exec_prefix=yes
+ ;;
+ --includedir=*)
+ includedir=$optarg
+ ;;
+ --includedir)
+ echo_includedir=yes
+ ;;
+ --libdir=*)
+ libdir=$optarg
+ ;;
+ --libdir)
+ echo_libdir=yes
+ ;;
+ --version)
+ echo ${major_version}.${minor_version}.${patch_version}.${build_version}
+ ;;
+ --cflags)
+ echo_cflags=yes
+ ;;
+ --libs)
+ echo_libs=yes
+ ;;
+ ssl)
+ lib_ssl=yes
+ ;;
+ smime)
+ lib_smime=yes
+ ;;
+ nss)
+ lib_nss=yes
+ ;;
+ *)
+ usage 1 1>&2
+ ;;
+ esac
+ shift
+done
+
+# Set variables that may be dependent upon other variables
+if test -z "$exec_prefix"; then
+ exec_prefix=${prefix}
+fi
+if test -z "$includedir"; then
+ includedir=${prefix}/include/nss
+fi
+if test -z "$libdir"; then
+ libdir=${prefix}/lib/nss
+fi
+
+if test "$echo_prefix" = "yes"; then
+ echo $prefix
+fi
+
+if test "$echo_exec_prefix" = "yes"; then
+ echo $exec_prefix
+fi
+
+if test "$echo_includedir" = "yes"; then
+ echo $includedir
+fi
+
+if test "$echo_libdir" = "yes"; then
+ echo $libdir
+fi
+
+if test "$echo_cflags" = "yes"; then
+ echo -I$includedir
+fi
+
+if test "$echo_libs" = "yes"; then
+ libdirs="-Wl,-rpath-link,$libdir -L$libdir"
+ if test -n "$lib_ssl"; then
+ libdirs="$libdirs -lssl${major_version}"
+ fi
+ if test -n "$lib_smime"; then
+ libdirs="$libdirs -lsmime${major_version}"
+ fi
+ if test -n "$lib_nss"; then
+ libdirs="$libdirs -lnss${major_version}"
+ fi
+ if test -n "$lib_softokn"; then
+ libdirs="$libdirs -lsoftokn${major_version}"
+ fi
+ echo $libdirs
+fi
+
diff -Naur nss-3.12-orig/mozilla/security/nss/cmd/disttools/nss.pc.in nss-3.12/mozilla/security/nss/cmd/disttools/nss.pc.in
--- nss-3.12-orig/mozilla/security/nss/cmd/disttools/nss.pc.in 1969-12-31 18:00:00.000000000 -0600
+++ nss-3.12/mozilla/security/nss/cmd/disttools/nss.pc.in 2008-11-10 22:06:55.000000000 -0600
@@ -0,0 +1,12 @@
+prefix=/usr
+exec_prefix=/usr
+libdir=/usr/lib/nss
+includedir=/usr/include/nss
+
+Name: NSS
+Description: Mozilla Network Security Services
+Version: @[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@NSS_VERSION_BUILD@
+Requires: nspr >= 4.7.0
+Libs: -L${libdir} -lnss3 -lsmime3 -lssl3 -lsoftokn3
+Cflags: -I${includedir}/nss
+
diff -Naur nspr-4.7.3-orig/mozilla/nsprpub/config/Makefile.in nspr-4.7.3/mozilla/nsprpub/config/Makefile.in
--- nspr-4.7.3-orig/mozilla/nsprpub/config/Makefile.in 2008-05-02 03:18:03.000000000 -0500
+++ nspr-4.7.3/mozilla/nsprpub/config/Makefile.in 2008-11-10 01:26:35.000000000 -0600
@@ -54,7 +54,7 @@
# because it is included by every makefile.
DIST_GARBAGE = nsprincl.mk nsprincl.sh nspr-config
-RELEASE_BINS = nspr-config
+RELEASE_BINS = nspr-config nspr.pc
include $(topsrcdir)/config/config.mk
@@ -131,6 +131,7 @@
export:: $(TARGETS)
rm -f $(dist_bindir)/nspr-config
+ rm -f $(dist_bindir)/nspr.pc
ifdef WRAP_SYSTEM_INCLUDES
export::
diff -Naur nspr-4.7.3-orig/mozilla/nsprpub/config/nspr.pc.in nspr-4.7.3/mozilla/nsprpub/config/nspr.pc.in
--- nspr-4.7.3-orig/mozilla/nsprpub/config/nspr.pc.in 1969-12-31 18:00:00.000000000 -0600
+++ nspr-4.7.3/mozilla/nsprpub/config/nspr.pc.in 2008-11-10 01:26:35.000000000 -0600
@@ -0,0 +1,10 @@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
+
+Name: NSPR
+Description: The Netscape Portable Runtime
+Version: @[EMAIL PROTECTED]@[EMAIL PROTECTED]@MOD_PATCH_VERSION@
+Libs: -L${libdir} -lplds4 -lplc4 -lnspr4 @OS_LIBS@ -Wl,-R${libdir}
+Cflags: -I${includedir}
diff -Naur nspr-4.7.3-orig/mozilla/nsprpub/configure nspr-4.7.3/mozilla/nsprpub/configure
--- nspr-4.7.3-orig/mozilla/nsprpub/configure 2008-11-04 12:07:16.000000000 -0600
+++ nspr-4.7.3/mozilla/nsprpub/configure 2008-11-10 01:26:35.000000000 -0600
@@ -5899,6 +5899,7 @@
config/nsprincl.mk
config/nsprincl.sh
config/nspr-config
+config/nspr.pc
lib/Makefile
lib/ds/Makefile
lib/libc/Makefile
--
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page