pkgsrc/lang/spidermonkey52/patches/patch-js_src_old-configure_in
leot 226d069278 spidermonkey52: Do not build with debug symbols and strip
configure forced to pass `-g' to CFLAGS and did not strip resulting binaries and
libraries. Pass `--disable-debug-symbols' and `--enable-strip' to respectively
address that.
Fix PR pkg/54228 reported by matt farnsworth.

While here, avoid to pass `-Wl,-z,wxneeded' to LDFLAGS on NetBSD.
2019-05-24 18:15:38 +00:00

93 lines
2.9 KiB
Text

$NetBSD: patch-js_src_old-configure_in,v 1.4 2019/05/24 18:15:38 leot Exp $
2nd chunk:
From 7e6d628456af3e99ebcb9a01a27e1461585082a4 Mon Sep 17 00:00:00 2001
From: Till Schneidereit <till@tillschneidereit.net>
Date: Thu, 1 Oct 2015 12:59:09 +0200
Subject: [PATCH] Disable MOZ_GLUE_IN_PROGRAM in stand-alone builds on all platforms
Index: js/src/old-configure.in
--- js/src/old-configure.in.orig 2018-04-28 01:04:03.000000000 +0000
+++ js/src/old-configure.in
@@ -599,6 +599,11 @@ dnl System overrides of the defaults for
dnl ========================================================
case "$target" in
+
+*-solaris*)
+ MOZ_FIX_LINK_PATHS=
+ ;;
+
*-darwin*)
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
@@ -917,18 +922,34 @@ case "$target" in
if test "$LIBRUNPATH"; then
DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
fi
- MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(DSO_SONAME) -o $@'
- MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(DSO_SONAME) -o $@'
+ if test "$GNU_LD"; then
+ # Don't allow undefined symbols in libraries
+ DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
+ fi
+ LDFLAGS="$LDFLAGS"
+ MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
+ MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
;;
*-openbsd*)
- DLL_SUFFIX=".so.1.0"
+ if test "$SO_VERSION"; then
+ DLL_SUFFIX=".so.$SO_VERSION"
+ else
+ DLL_SUFFIX=".so.1.0"
+ fi
DSO_CFLAGS=''
DSO_PIC_CFLAGS='-fPIC'
DSO_LDOPTS='-shared -fPIC'
if test "$LIBRUNPATH"; then
- DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
+ DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
+ fi
+ if test "$GNU_LD"; then
+ # Don't allow undefined symbols in libraries
+ DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
fi
+ LDFLAGS="$LDFLAGS -Wl,-z,wxneeded"
+ MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
+ MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
;;
esac
@@ -1623,16 +1644,21 @@ dnl ====================================
dnl = Enable jemalloc
dnl ========================================================
-case "${OS_TARGET}" in
-Android|WINNT|Darwin)
+dnl In stand-alone builds we always only want to link executables against mozglue.
+if test "$JS_STANDALONE"; then
MOZ_GLUE_IN_PROGRAM=
- ;;
-*)
- dnl On !Android !Windows !OSX, we only want to link executables against mozglue
- MOZ_GLUE_IN_PROGRAM=1
- AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
- ;;
-esac
+else
+ case "${OS_TARGET}" in
+ Android|WINNT|Darwin)
+ MOZ_GLUE_IN_PROGRAM=
+ ;;
+ *)
+ dnl On !Android !Windows !OSX, we only want to link executables against mozglue
+ MOZ_GLUE_IN_PROGRAM=1
+ AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
+ ;;
+ esac
+fi
if test "$MOZ_MEMORY"; then
if test "x$MOZ_DEBUG" = "x1"; then