Pass LDFLAGS when linking; adding then removing -lrt on Darwin didn't make much sense; clean-up

This commit is contained in:
adam 2011-04-14 07:08:00 +00:00
parent da81394791
commit 3dd480cab1
4 changed files with 18 additions and 22 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.3 2011/03/12 11:00:01 tron Exp $
# $NetBSD: Makefile,v 1.4 2011/04/14 07:08:00 adam Exp $
DISTNAME= libvpx-v0.9.6
PKGNAME= ${DISTNAME:S/-v/-/}
@ -13,8 +13,14 @@ LICENSE= modified-bsd
PKG_DESTDIR_SUPPORT= user-destdir
USE_LIBTOOL= YES
USE_TOOLS+= gmake bash:build perl:build
USE_LANGUAGES= c c++
USE_LIBTOOL= yes
USE_TOOLS+= gmake bash:build perl:build
HAS_CONFIGURE= yes
CONFIGURE_ARGS+= --disable-postproc
CONFIGURE_ARGS+= --enable-pic
CONFIGURE_ARGS+= --enable-runtime-cpu-detect
CONFIGURE_ARGS+= --prefix=${PREFIX}
.include "../../mk/bsd.prefs.mk"
@ -22,23 +28,13 @@ USE_TOOLS+= gmake bash:build perl:build
BUILD_DEPENDS+= yasm-[0-9]*:../../devel/yasm
.endif
HAS_CONFIGURE= YES
USE_LANGUAGES= c c++
REPLACE_BASH= configure \
build/make/version.sh \
build/make/gen_asm_deps.sh \
examples/gen_example_text.sh \
examples/gen_example_code.sh
CONFIGURE_ARGS+= --enable-pic \
--disable-postproc \
--enable-runtime-cpu-detect \
--prefix=${PREFIX}
.if ${OPSYS} == "Darwin"
BUILDLINK_TRANSFORM+= rm:-lrt
. if ${MACHINE_ARCH} == "i386"
. if empty(OS_VERSION:M8.*)
CONFIGURE_ARGS+= --target=x86-darwin9-gcc

View file

@ -1,9 +1,9 @@
$NetBSD: distinfo,v 1.2 2011/03/11 15:25:26 drochner Exp $
$NetBSD: distinfo,v 1.3 2011/04/14 07:08:00 adam Exp $
SHA1 (libvpx-v0.9.6.tar.bz2) = a3522bd2b73d52381ba767ded1cbf4760e9cc6f8
RMD160 (libvpx-v0.9.6.tar.bz2) = b85038b92d911b29b3b912c3d71c60e13f89a551
Size (libvpx-v0.9.6.tar.bz2) = 1230418 bytes
SHA1 (patch-aa) = d6d968fddf826284f49eb907182012e57935c25f
SHA1 (patch-aa) = 7f0816d094a7855cfb059905a7a21e438eb03000
SHA1 (patch-ab) = bd8cc8cf876eb3a8c6dbc317fb9eba3867f2cf2b
SHA1 (patch-ac) = e41b971e300a108beb5ae717ab6a57abc25318d9
SHA1 (patch-ad) = 82b2e70518042a55efb0f400a8f4be6d99bcd50e
SHA1 (patch-ad) = 95be9236d4a534961f77339fc3a0e2f03cff5724

View file

@ -1,4 +1,4 @@
$NetBSD: patch-aa,v 1.1.1.1 2011/01/19 21:15:51 ryoon Exp $
$NetBSD: patch-aa,v 1.2 2011/04/14 07:08:00 adam Exp $
--- build/make/Makefile.orig 2010-10-28 13:14:14.000000000 +0000
+++ build/make/Makefile
@ -26,8 +26,8 @@ $NetBSD: patch-aa,v 1.1.1.1 2011/01/19 21:15:51 ryoon Exp $
$(1):
$(if $(quiet),@echo " [LD] $$@")
- $(qexec)$$(LD) $$(strip $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
+ $(qexec)${LIBTOOL} --mode=link $(CC) -o $$@ $$(filter-out -lvpx,$(2)) \
+ libvpx.la $$(extralibs)
+ $(qexec)${LIBTOOL} --mode=link $(CC) $(LDFLAGS) -o $$@ \
+ $$(filter-out -lvpx,$(2)) libvpx.la $$(extralibs)
endef
# make-3.80 has a bug with expanding large input strings to the eval function,
# which was triggered in some cases by the following component of
@ -51,7 +51,7 @@ $NetBSD: patch-aa,v 1.1.1.1 2011/01/19 21:15:51 ryoon Exp $
$(1):
$(if $(quiet),@echo " [AR] $$@")
- $(qexec)$$(AR) $$(ARFLAGS) $$@ $$?
+ $(qexec)${LIBTOOL} --mode=link $(CC) -o $$(patsubst %.a,%.la,$$@) \
+ $(qexec)${LIBTOOL} --mode=link $(CC) $(LDFLAGS) -o $$(patsubst %.a,%.la,$$@) \
+ $$(patsubst %.o,%.lo,$$?) -rpath $(DIST_DIR)/lib $$(extralibs) \
+ -version-info $(VERSION_MINOR):$(VERSION_PATCH):$(VERSION_MINOR)
endef

View file

@ -1,4 +1,4 @@
$NetBSD: patch-ad,v 1.1.1.1 2011/01/19 21:15:51 ryoon Exp $
$NetBSD: patch-ad,v 1.2 2011/04/14 07:08:00 adam Exp $
*BSD are identified as linux.
@ -10,7 +10,7 @@ $NetBSD: patch-ad,v 1.1.1.1 2011/01/19 21:15:51 ryoon Exp $
+ case ${tgt_os} in
+ darwin*)
+ add_extralibs -lm -lrt
+ add_extralibs -lm
+ ;;
+ solaris*)
+ add_extralibs -lm -lrt