Mon Mar 10 11:59:26 2008 UTC ()
now that that we rely on the fact that we get correct PIC from yasm
we can as well use libtool, to get a proper .so which can be
dynamically loaded, tested by Mihai Chelaru,
bump PKGREVISION
(drochner)
diff -r1.7 -r1.8 pkgsrc/multimedia/x264-devel/Makefile
diff -r1.1.1.1 -r1.2 pkgsrc/multimedia/x264-devel/PLIST
diff -r1.5 -r1.6 pkgsrc/multimedia/x264-devel/buildlink3.mk
diff -r1.5 -r1.6 pkgsrc/multimedia/x264-devel/distinfo
diff -r0 -r1.3 pkgsrc/multimedia/x264-devel/patches/patch-ab
diff -r0 -r1.1 pkgsrc/multimedia/x264-devel/patches/patch-ac
--- pkgsrc/multimedia/x264-devel/Attic/Makefile 2008/03/07 21:50:41 1.7
+++ pkgsrc/multimedia/x264-devel/Attic/Makefile 2008/03/10 11:59:26 1.8
--- pkgsrc/multimedia/x264-devel/Attic/PLIST 2006/02/12 14:11:22 1.1.1.1
+++ pkgsrc/multimedia/x264-devel/Attic/PLIST 2008/03/10 11:59:26 1.2
--- pkgsrc/multimedia/x264-devel/Attic/buildlink3.mk 2006/07/08 23:11:02 1.5
+++ pkgsrc/multimedia/x264-devel/Attic/buildlink3.mk 2008/03/10 11:59:26 1.6
--- pkgsrc/multimedia/x264-devel/Attic/distinfo 2008/01/07 13:33:28 1.5
+++ pkgsrc/multimedia/x264-devel/Attic/distinfo 2008/03/10 11:59:26 1.6
$NetBSD: patch-ab,v 1.3 2008/03/10 11:59:26 drochner Exp $
--- Makefile.orig 2007-12-18 22:45:04.000000000 +0100
+++ Makefile
@@ -26,7 +26,7 @@ ASMSRC = common/i386/dct-a.asm common/i
common/i386/mc-a2.asm common/i386/predict-a.asm \
common/i386/pixel-sse2.asm common/i386/quant-a.asm \
common/i386/deblock-a.asm
-OBJASM = $(ASMSRC:%.asm=%.o)
+OBJASM = $(ASMSRC:%.asm=%.lo)
ASFLAGS += -Icommon/i386/
endif
endif
@@ -40,7 +40,7 @@ ASMSRC = common/amd64/dct-a.asm common/
common/amd64/mc-a2.asm common/amd64/predict-a.asm \
common/amd64/pixel-sse2.asm common/amd64/quant-a.asm \
common/amd64/deblock-a.asm
-OBJASM = $(ASMSRC:%.asm=%.o)
+OBJASM = $(ASMSRC:%.asm=%.lo)
ASFLAGS += -Icommon/amd64
endif
endif
@@ -51,20 +51,20 @@ ALTIVECSRC += common/ppc/mc.c common/ppc
common/ppc/quant.c common/ppc/deblock.c \
common/ppc/predict.c
SRCS += $(ALTIVECSRC)
-$(ALTIVECSRC:%.c=%.o): CFLAGS += $(ALTIVECFLAGS)
+$(ALTIVECSRC:%.c=%.lo): CFLAGS += $(ALTIVECFLAGS)
endif
# VIS optims
ifeq ($(ARCH),UltraSparc)
ASMSRC += common/sparc/pixel.asm
-OBJASM = $(ASMSRC:%.asm=%.o)
+OBJASM = $(ASMSRC:%.asm=%.lo)
endif
ifneq ($(HAVE_GETOPT_LONG),1)
SRCS += extras/getopt.c
endif
-OBJS = $(SRCS:%.c=%.o)
+OBJS = $(SRCS:%.c=%.lo)
OBJCLI = $(SRCCLI:%.c=%.o)
DEP = depend
@@ -73,15 +73,17 @@ all: default
default: $(DEP) x264$(EXE)
-libx264.a: .depend $(OBJS) $(OBJASM)
- ar rc libx264.a $(OBJS) $(OBJASM)
- ranlib libx264.a
+%.lo: %.c
+ ${LIBTOOL} --mode=compile ${CC} -c ${CFLAGS} -o $@ $<
+
+libx264.la: .depend $(OBJS) $(OBJASM)
+ ${LIBTOOL} --mode=link ${CC} -o libx264.la $(OBJS) $(OBJASM) ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} -rpath ${PREFIX}/lib -version-info 0
$(SONAME): .depend $(OBJS) $(OBJASM)
$(CC) -shared -o $@ $(OBJS) $(OBJASM) -Wl,-soname,$(SONAME) $(LDFLAGS)
-x264$(EXE): $(OBJCLI) libx264.a
- $(CC) -o $@ $+ $(LDFLAGS)
+x264$(EXE): $(OBJCLI) libx264.la
+ ${LIBTOOL} --mode=link $(CC) -o $@ $+ $(LDFLAGS)
libx264gtk.a: muxers.o libx264.a
$(MAKE) -C gtk
@@ -89,10 +91,10 @@ libx264gtk.a: muxers.o libx264.a
checkasm: tools/checkasm.o libx264.a
$(CC) -o $@ $+ $(LDFLAGS)
-common/amd64/*.o: common/amd64/amd64inc.asm
-common/i386/*.o: common/i386/i386inc.asm
-%.o: %.asm
- $(AS) $(ASFLAGS) -o $@ $<
+common/amd64/*.lo: common/amd64/amd64inc.asm
+common/i386/*.lo: common/i386/i386inc.asm
+%.lo: %.asm
+ ${LIBTOOL} --mode=compile --tag=ASM sh strip_fPIC.sh $(AS) $(ASFLAGS) -o $@ $<
# delete local/anonymous symbols, so they don't show up in oprofile
-@ strip -x $@
@@ -153,12 +155,9 @@ install: x264 $(SONAME)
install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir)
install -d $(DESTDIR)$(libdir) $(DESTDIR)$(libdir)/pkgconfig
install -m 644 x264.h $(DESTDIR)$(includedir)
- install -m 644 libx264.a $(DESTDIR)$(libdir)
+ ${LIBTOOL} --mode=install install -m 644 libx264.la $(DESTDIR)$(libdir)
install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
- install x264 $(DESTDIR)$(bindir)
- ranlib $(DESTDIR)$(libdir)/libx264.a
- $(if $(SONAME), ln -sf $(SONAME) $(DESTDIR)$(libdir)/libx264.so)
- $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir))
+ ${LIBTOOL} --mode=install install x264 $(DESTDIR)$(bindir)
install-gtk: libx264gtk.a
$(MAKE) -C gtk install
$NetBSD: patch-ac,v 1.1 2008/03/10 11:59:26 drochner Exp $
--- strip_fPIC.sh.orig 2008-01-11 20:38:05.000000000 +0100
+++ strip_fPIC.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# libtool assumes that the compiler can handle the -fPIC flag
+# This isn't always true (for example, nasm can't handle it)
+command=""
+while [ $1 ]; do
+ if [ "$1" != "-fPIC" ]; then
+ if [ "$1" = "-DPIC" ]; then
+ command="$command -D__PIC__"
+ else
+ command="$command $1"
+ fi
+ fi
+ shift
+done
+echo $command
+exec $command