pkgsrc/multimedia/x264-devel/patches/patch-ab

115 lines
3.6 KiB
Text
Raw Normal View History

$NetBSD: patch-ab,v 1.12 2010/05/04 18:18:57 drochner Exp $
--- Makefile.orig 2009-09-20 20:45:09.000000000 +0000
+++ Makefile
@@ -40,9 +40,9 @@ endif
ifdef ARCH_X86
ASFLAGS += -Icommon/x86/
SRCS += common/x86/mc-c.c common/x86/predict-c.c
-OBJASM = $(ASMSRC:%.asm=%.o)
+OBJASM = $(ASMSRC:%.asm=%.lo)
$(OBJASM): common/x86/x86inc.asm common/x86/x86util.asm
-checkasm: tools/checkasm-a.o
+checkasm: tools/checkasm-a.lo
endif
endif
@@ -52,7 +52,7 @@ 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
# NEON optims
@@ -62,44 +62,49 @@ ASMSRC += common/arm/cpu-a.S common/arm/
common/arm/dct-a.S common/arm/quant-a.S common/arm/deblock-a.S \
common/arm/predict-a.S
SRCS += common/arm/mc-c.c common/arm/predict-c.c
-OBJASM = $(ASMSRC:%.S=%.o)
+OBJASM = $(ASMSRC:%.S=%.lo)
endif
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)
-OBJCLI = $(SRCCLI:%.c=%.o)
+OBJS = $(SRCS:%.c=%.lo)
+OBJCLI = $(SRCCLI:%.c=%.lo)
DEP = depend
.PHONY: all default fprofiled clean distclean install uninstall dox test testclean
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} ${PICFLAGS} -o $@ $<
+
+libx264.la: .depend $(OBJS) $(OBJASM)
+ ${LIBTOOL} --mode=link \
+ ${CC} -o libx264.la -rpath ${PREFIX}/lib -version-info 0 \
+ $(OBJS) $(OBJASM) ${LDFLAGS}
$(SONAME): .depend $(OBJS) $(OBJASM)
$(CC) -shared -o $@ $(OBJS) $(OBJASM) $(SOFLAGS) $(LDFLAGS)
-x264$(EXE): $(OBJCLI) libx264.a
- $(CC) -o $@ $+ $(LDFLAGS)
+x264$(EXE): $(OBJCLI) libx264.la
+ ${LIBTOOL} --mode=link $(CC) -o $@ $+ $(LDFLAGS)
-checkasm: tools/checkasm.o libx264.a
- $(CC) -o $@ $+ $(LDFLAGS)
+checkasm: tools/checkasm.lo libx264.la
+ ${LIBTOOL} --mode=link $(CC) -o $@ $+ $(LDFLAGS)
-%.o: %.asm
- $(AS) $(ASFLAGS) -o $@ $<
- -@ $(STRIP) -x $@ # delete local/anonymous symbols, so they don't show up in oprofile
+%.lo: %.asm
+ ${LIBTOOL} --mode=compile --tag=CC \
+ ./strip_fopt.sh $(AS) $(ASFLAGS) -o $@ $<
+ -@ $(STRIP) -x $(@:.lo=.o) # delete local/anonymous symbols, so they don't show up in oprofile
%.o: %.S
$(AS) $(ASFLAGS) -o $@ $<
@@ -156,21 +161,16 @@ distclean: clean
rm -f config.mak config.h x264.pc
rm -rf test/
-install: x264$(EXE) $(SONAME)
+install: x264$(EXE) libx264.la
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 ${BSD_INSTALL_LIB} libx264.la $(DESTDIR)$(libdir)
install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
- install x264$(EXE) $(DESTDIR)$(bindir)
- $(RANLIB) $(DESTDIR)$(libdir)/libx264.a
+ ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} x264$(EXE) $(DESTDIR)$(bindir)
ifeq ($(SYS),MINGW)
$(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(bindir))
-else
- $(if $(SONAME), ln -sf $(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX))
- $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir))
endif
- $(if $(IMPLIBNAME), install -m 644 $(IMPLIBNAME) $(DESTDIR)$(libdir))
uninstall:
rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(libdir)/libx264.a