| @@ -1,105 +1,105 @@ | | | @@ -1,105 +1,105 @@ |
1 | $NetBSD: patch-ab,v 1.9 2008/12/18 16:19:07 bjs Exp $ | | 1 | $NetBSD: patch-ab,v 1.10 2009/02/03 08:44:15 obache Exp $ |
2 | | | 2 | |
3 | --- Makefile.orig 2008-12-12 16:45:07.000000000 -0500 | | 3 | --- Makefile.orig 2008-12-17 21:45:13.000000000 +0000 |
4 | +++ Makefile | | 4 | +++ Makefile |
5 | @@ -40,9 +40,9 @@ endif | | 5 | @@ -40,9 +40,9 @@ endif |
6 | ifdef ARCH_X86 | | 6 | ifdef ARCH_X86 |
7 | ASFLAGS += -Icommon/x86/ | | 7 | ASFLAGS += -Icommon/x86/ |
8 | SRCS += common/x86/mc-c.c common/x86/predict-c.c | | 8 | SRCS += common/x86/mc-c.c common/x86/predict-c.c |
9 | -OBJASM = $(ASMSRC:%.asm=%.o) | | 9 | -OBJASM = $(ASMSRC:%.asm=%.o) |
10 | +OBJASM = $(ASMSRC:%.asm=%.lo) | | 10 | +OBJASM = $(ASMSRC:%.asm=%.lo) |
11 | $(OBJASM): common/x86/x86inc.asm common/x86/x86util.asm | | 11 | $(OBJASM): common/x86/x86inc.asm common/x86/x86util.asm |
12 | -checkasm: tools/checkasm-a.o | | 12 | -checkasm: tools/checkasm-a.o |
13 | +checkasm: tools/checkasm-a.lo | | 13 | +checkasm: tools/checkasm-a.lo |
14 | endif | | 14 | endif |
15 | endif | | 15 | endif |
16 | | | 16 | |
17 | @@ -52,44 +52,49 @@ ALTIVECSRC += common/ppc/mc.c common/ppc | | 17 | @@ -52,44 +52,49 @@ ALTIVECSRC += common/ppc/mc.c common/ppc |
18 | common/ppc/quant.c common/ppc/deblock.c \ | | 18 | common/ppc/quant.c common/ppc/deblock.c \ |
19 | common/ppc/predict.c | | 19 | common/ppc/predict.c |
20 | SRCS += $(ALTIVECSRC) | | 20 | SRCS += $(ALTIVECSRC) |
21 | -$(ALTIVECSRC:%.c=%.o): CFLAGS += $(ALTIVECFLAGS) | | 21 | -$(ALTIVECSRC:%.c=%.o): CFLAGS += $(ALTIVECFLAGS) |
22 | +$(ALTIVECSRC:%.c=%.lo): CFLAGS += $(ALTIVECFLAGS) | | 22 | +$(ALTIVECSRC:%.c=%.lo): CFLAGS += $(ALTIVECFLAGS) |
23 | endif | | 23 | endif |
24 | | | 24 | |
25 | # VIS optims | | 25 | # VIS optims |
26 | ifeq ($(ARCH),UltraSparc) | | 26 | ifeq ($(ARCH),UltraSparc) |
27 | ASMSRC += common/sparc/pixel.asm | | 27 | ASMSRC += common/sparc/pixel.asm |
28 | -OBJASM = $(ASMSRC:%.asm=%.o) | | 28 | -OBJASM = $(ASMSRC:%.asm=%.o) |
29 | +OBJASM = $(ASMSRC:%.asm=%.lo) | | 29 | +OBJASM = $(ASMSRC:%.asm=%.lo) |
30 | endif | | 30 | endif |
31 | | | 31 | |
32 | ifneq ($(HAVE_GETOPT_LONG),1) | | 32 | ifneq ($(HAVE_GETOPT_LONG),1) |
33 | SRCS += extras/getopt.c | | 33 | SRCS += extras/getopt.c |
34 | endif | | 34 | endif |
35 | | | 35 | |
36 | -OBJS = $(SRCS:%.c=%.o) | | 36 | -OBJS = $(SRCS:%.c=%.o) |
37 | -OBJCLI = $(SRCCLI:%.c=%.o) | | 37 | -OBJCLI = $(SRCCLI:%.c=%.o) |
38 | +OBJS = $(SRCS:%.c=%.lo) | | 38 | +OBJS = $(SRCS:%.c=%.lo) |
39 | +OBJCLI = $(SRCCLI:%.c=%.lo) | | 39 | +OBJCLI = $(SRCCLI:%.c=%.lo) |
40 | DEP = depend | | 40 | DEP = depend |
41 | | | 41 | |
42 | .PHONY: all default fprofiled clean distclean install uninstall dox test testclean | | 42 | .PHONY: all default fprofiled clean distclean install uninstall dox test testclean |
43 | | | 43 | |
44 | default: $(DEP) x264$(EXE) | | 44 | default: $(DEP) x264$(EXE) |
45 | | | 45 | |
46 | -libx264.a: .depend $(OBJS) $(OBJASM) | | 46 | -libx264.a: .depend $(OBJS) $(OBJASM) |
47 | - ar rc libx264.a $(OBJS) $(OBJASM) | | 47 | - ar rc libx264.a $(OBJS) $(OBJASM) |
48 | - ranlib libx264.a | | 48 | - ranlib libx264.a |
49 | +%.lo: %.c | | 49 | +%.lo: %.c |
50 | + ${LIBTOOL} --mode=compile ${CC} -c ${CFLAGS} ${PICFLAGS} -o $@ $< | | 50 | + ${LIBTOOL} --mode=compile ${CC} -c ${CFLAGS} ${PICFLAGS} -o $@ $< |
51 | + | | 51 | + |
52 | +libx264.la: .depend $(OBJS) $(OBJASM) | | 52 | +libx264.la: .depend $(OBJS) $(OBJASM) |
53 | + ${LIBTOOL} --mode=link \ | | 53 | + ${LIBTOOL} --mode=link \ |
54 | + ${CC} -o libx264.la -rpath ${PREFIX}/lib -version-info 0 \ | | 54 | + ${CC} -o libx264.la -rpath ${PREFIX}/lib -version-info 0 \ |
55 | + $(OBJS) $(OBJASM) ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} | | 55 | + $(OBJS) $(OBJASM) ${LDFLAGS} |
56 | | | 56 | |
57 | $(SONAME): .depend $(OBJS) $(OBJASM) | | 57 | $(SONAME): .depend $(OBJS) $(OBJASM) |
58 | $(CC) -shared -o $@ $(OBJS) $(OBJASM) $(SOFLAGS) $(LDFLAGS) | | 58 | $(CC) -shared -o $@ $(OBJS) $(OBJASM) $(SOFLAGS) $(LDFLAGS) |
59 | | | 59 | |
60 | -x264$(EXE): $(OBJCLI) libx264.a | | 60 | -x264$(EXE): $(OBJCLI) libx264.a |
61 | - $(CC) -o $@ $+ $(LDFLAGS) | | 61 | - $(CC) -o $@ $+ $(LDFLAGS) |
62 | +x264$(EXE): $(OBJCLI) libx264.la | | 62 | +x264$(EXE): $(OBJCLI) libx264.la |
63 | + ${LIBTOOL} --mode=link $(CC) -o $@ $+ $(LDFLAGS) | | 63 | + ${LIBTOOL} --mode=link $(CC) -o $@ $+ $(LDFLAGS) |
64 | | | 64 | |
65 | -checkasm: tools/checkasm.o libx264.a | | 65 | -checkasm: tools/checkasm.o libx264.a |
66 | - $(CC) -o $@ $+ $(LDFLAGS) | | 66 | - $(CC) -o $@ $+ $(LDFLAGS) |
67 | +checkasm: tools/checkasm.lo libx264.la | | 67 | +checkasm: tools/checkasm.lo libx264.la |
68 | + ${LIBTOOL} --mode=link $(CC) -o $@ $+ $(LDFLAGS) | | 68 | + ${LIBTOOL} --mode=link $(CC) -o $@ $+ $(LDFLAGS) |
69 | | | 69 | |
70 | -%.o: %.asm | | 70 | -%.o: %.asm |
71 | - $(AS) $(ASFLAGS) -o $@ $< | | 71 | - $(AS) $(ASFLAGS) -o $@ $< |
72 | +%.lo: %.asm | | 72 | +%.lo: %.asm |
73 | + ${LIBTOOL} --mode=compile --tag=CC \ | | 73 | + ${LIBTOOL} --mode=compile --tag=CC \ |
74 | + ./strip_fopt.sh $(AS) $(ASFLAGS) -o $@ $< | | 74 | + ./strip_fopt.sh $(AS) $(ASFLAGS) -o $@ $< |
75 | # delete local/anonymous symbols, so they don't show up in oprofile | | 75 | # delete local/anonymous symbols, so they don't show up in oprofile |
76 | - -@ strip -x $@ | | 76 | - -@ strip -x $@ |
77 | + -@ strip -x $(@:.lo=.o) | | 77 | + -@ strip -x $(@:.lo=.o) |
78 | | | 78 | |
79 | .depend: config.mak | | 79 | .depend: config.mak |
80 | rm -f .depend | | 80 | rm -f .depend |
81 | @@ -144,21 +149,16 @@ distclean: clean | | 81 | @@ -144,21 +149,16 @@ distclean: clean |
82 | rm -f config.mak config.h x264.pc | | 82 | rm -f config.mak config.h x264.pc |
83 | rm -rf test/ | | 83 | rm -rf test/ |
84 | | | 84 | |
85 | -install: x264$(EXE) $(SONAME) | | 85 | -install: x264$(EXE) $(SONAME) |
86 | +install: x264$(EXE) libx264.la | | 86 | +install: x264$(EXE) libx264.la |
87 | install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir) | | 87 | install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir) |
88 | install -d $(DESTDIR)$(libdir) $(DESTDIR)$(libdir)/pkgconfig | | 88 | install -d $(DESTDIR)$(libdir) $(DESTDIR)$(libdir)/pkgconfig |
89 | install -m 644 x264.h $(DESTDIR)$(includedir) | | 89 | install -m 644 x264.h $(DESTDIR)$(includedir) |
90 | - install -m 644 libx264.a $(DESTDIR)$(libdir) | | 90 | - install -m 644 libx264.a $(DESTDIR)$(libdir) |
91 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} libx264.la $(DESTDIR)$(libdir) | | 91 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} libx264.la $(DESTDIR)$(libdir) |
92 | install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig | | 92 | install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig |
93 | - install x264$(EXE) $(DESTDIR)$(bindir) | | 93 | - install x264$(EXE) $(DESTDIR)$(bindir) |
94 | - ranlib $(DESTDIR)$(libdir)/libx264.a | | 94 | - ranlib $(DESTDIR)$(libdir)/libx264.a |
95 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} x264$(EXE) $(DESTDIR)$(bindir) | | 95 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} x264$(EXE) $(DESTDIR)$(bindir) |
96 | ifeq ($(SYS),MINGW) | | 96 | ifeq ($(SYS),MINGW) |
97 | $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(bindir)) | | 97 | $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(bindir)) |
98 | -else | | 98 | -else |
99 | - $(if $(SONAME), ln -sf $(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX)) | | 99 | - $(if $(SONAME), ln -sf $(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX)) |
100 | - $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir)) | | 100 | - $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir)) |
101 | endif | | 101 | endif |
102 | - $(if $(IMPLIBNAME), install -m 644 $(IMPLIBNAME) $(DESTDIR)$(libdir)) | | 102 | - $(if $(IMPLIBNAME), install -m 644 $(IMPLIBNAME) $(DESTDIR)$(libdir)) |
103 | | | 103 | |
104 | uninstall: | | 104 | uninstall: |
105 | rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(libdir)/libx264.a | | 105 | rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(libdir)/libx264.a |