summaryrefslogtreecommitdiff
path: root/multimedia/x264-devel/patches/patch-ab
blob: d34bb509eb1bb0bc672d85bd650f3d20841f0ffc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
$NetBSD: patch-ab,v 1.8 2008/07/10 13:40:40 joerg Exp $

--- Makefile.orig	2008-07-10 15:34:13.000000000 +0200
+++ 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 ./strip_fopt.sh $(AS) $(ASFLAGS) -o $@ $<
 # delete local/anonymous symbols, so they don't show up in oprofile
 	-@ strip -x $@
 
@@ -150,15 +152,14 @@ distclean: clean
 	$(MAKE) -C gtk distclean
 
 install: x264 $(SONAME)
-	install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir)
-	install -d $(DESTDIR)$(libdir) $(DESTDIR)$(libdir)/pkgconfig
+	install -d $(DESTDIR)$(bindir)
+	install -d $(DESTDIR)$(includedir)
+	install -d $(DESTDIR)$(libdir)
+	install -d $(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