Libtool related changes based on existing patches to multimedia/ffmpeg.

This commit is contained in:
César Catrián C 2006-12-28 15:27:54 +00:00 committed by Thomas Klausner
parent 52ef29f677
commit f2622a9937
5 changed files with 181 additions and 21 deletions

View file

@ -1,21 +1,85 @@
$NetBSD: patch-aa,v 1.1 2006/12/23 13:59:22 cetrox Exp $
--- configure.orig 2006-12-18 13:43:53.000000000 +0000
+++ configure
@@ -732,6 +732,16 @@ audio_oss="yes"
dv1394="no"
add_cflags "-pthread"
;;
+DragonFly)
+v4l="no"
+bktr="yes"
+audio_oss="yes"
+dv1394="no"
+make="gmake"
+CFLAGS="-pthread"
+LDFLAGS="$LDFLAGS -export-dynamic -pthread"
+LIBSUF=".a"
+;;
BSD/OS)
video4linux="no"
video4linux2="no"
--- Makefile.orig 2006-12-07 16:25:04.000000000 -0300
+++ Makefile 2006-12-28 12:05:30.000000000 -0300
@@ -52,14 +52,14 @@
OBJS = ffmpeg.o ffserver.o cmdutils.o ffplay.o
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
LDFLAGS := -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil $(LDFLAGS)
-EXTRALIBS := -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)
+EXTRALIBS := libavformat/libavformat.la libavcodec/libavcodec.la libavutil/libavutil.la $(EXTRALIBS)
ifeq ($(CONFIG_SWSCALER),yes)
LDFLAGS+=-L./libswscale
-EXTRALIBS+=-lswscale$(BUILDSUF)
+EXTRALIBS+=libswscale/libswscale.la
endif
-all: lib $(PROGS_G) $(PROGS) $(VHOOK) $(DOC)
+all: lib $(PROGS) $(VHOOK) $(DOC)
lib:
$(MAKE) -C libavutil all
@@ -72,14 +72,17 @@
$(MAKE) -C libswscale all
endif
-ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
- $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(EXTRALIBS)
-
-ffserver$(EXESUF): ffserver.o .libs
- $(CC) $(LDFLAGS) $(FFSERVERLDFLAGS) -o $@ ffserver.o $(EXTRALIBS)
-
-ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
- $(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(EXTRALIBS) $(SDL_LIBS)
+ffmpeg$(EXESUF): ffmpeg.o cmdutils.o .ffmpeglibs
+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o \
+ $(EXTRALIBS)
+
+ffserver$(EXESUF): ffserver.o .ffmpeglibs
+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(FFSERVERLDFLAGS) -o $@ \
+ ffserver.o $(EXTRALIBS)
+
+ffplay$(EXESUF): ffplay.o cmdutils.o .ffmpeglibs
+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o \
+ $(EXTRALIBS) $(SDL_LIBS)
%$(EXESUF): %_g$(EXESUF)
cp -p $< $@
@@ -88,8 +91,9 @@
version.h:
$(SRC_PATH)/version.sh $(SRC_PATH)
-output_example$(EXESUF): output_example.o .libs
- $(CC) $(LDFLAGS) -o $@ output_example.o $(EXTRALIBS)
+output_example$(EXESUF): output_example.o .ffmpeglibs
+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ output_example.o \
+ $(EXTRALIBS)
qt-faststart$(EXESUF): qt-faststart.c
$(CC) $(CFLAGS) $< -o $@
@@ -105,7 +109,7 @@
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
-videohook: .libs
+videohook: .ffmpeglibs
$(MAKE) -C vhook all
documentation:
@@ -119,7 +123,7 @@
install-progs: $(PROGS)
endif
install -d "$(bindir)"
- install -c $(INSTALLSTRIP) -m 755 $(PROGS) "$(bindir)"
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) $(PROGS) "$(bindir)"
# create the window installer
wininstaller: all install
@@ -200,7 +204,7 @@
$(DEP_LIBS): lib
-.libs: $(DEP_LIBS)
+.ffmpeglibs: lib
touch $@
clean:

View file

@ -0,0 +1,62 @@
--- common.mak.orig 2006-12-22 02:29:14.000000000 -0300
+++ common.mak 2006-12-28 12:06:59.000000000 -0300
@@ -17,8 +17,9 @@
$(LIB): $(STATIC_OBJS)
rm -f $@
- $(AR) rc $@ $^ $(EXTRAOBJS)
- $(RANLIB) $@
+ $(LIBTOOL) --mode=link $(CC) $(SHFLAGS) $(LDFLAGS) -o $(LIB:.a=.la) \
+ $(^:.o=.lo) -avoid-version -rpath $(prefix)/lib \
+ $(EXTRALIBS)
$(SLIBNAME): $(SLIBNAME_WITH_MAJOR)
ln -sf $^ $@
@@ -28,20 +29,17 @@
$(SLIB_EXTRA_CMD)
%.o: %.c
- $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
%.o: %.S
- $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
%.o: %.cpp
- g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
+ $(LIBTOOL) --mode=compile $(CXX) $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
%: %.o $(LIB)
- $(CC) $(LDFLAGS) -o $@ $^ $(EXTRALIBS)
-
-depend dep: $(SRCS)
- $(CC) -MM $(CFLAGS) $^ 1>.depend
+ $(LIBTOOL) --mode=compile $(CC) $(LDFLAGS) -o $@ $^ $(EXTRALIBS)
clean::
rm -f *.o *.d *~ *.a *.lib *.so *.so.* *.dylib *.dll \
@@ -51,16 +49,20 @@
rm -f .depend
ifeq ($(BUILD_SHARED),yes)
-INSTLIBTARGETS += install-lib-shared
+INSTLIBTARGETS += install-libt-shared
endif
ifeq ($(BUILD_STATIC),yes)
-INSTLIBTARGETS += install-lib-static
+INSTLIBTARGETS += install-libt-static
endif
install: install-libs install-headers
install-libs: $(INSTLIBTARGETS)
+install-libt-static: $(LIB)
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_DATA) $(LIB:.a=.la) \
+ $(prefix)/lib
+
install-lib-shared: $(SLIBNAME)
install -d "$(shlibdir)"
install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \

View file

@ -0,0 +1,12 @@
--- libavformat/Makefile.orig 2006-12-28 09:35:20.000000000 -0300
+++ libavformat/Makefile 2006-12-28 09:39:06.000000000 -0300
@@ -158,8 +158,7 @@
OBJS-$(CONFIG_AUDIO_MUXER) += audio.o
endif
-EXTRALIBS := -L$(BUILD_ROOT)/libavutil -lavutil$(BUILDSUF) \
- -lavcodec$(BUILDSUF) -L$(BUILD_ROOT)/libavcodec $(EXTRALIBS)
+EXTRALIBS := ../libavutil/libavutil.la ../libavcodec/libavcodec.la $(EXTRALIBS)
ifeq ($(CONFIG_AUDIO_BEOS),yes)
CPPOBJS+= beosaudio.o

View file

@ -0,0 +1,11 @@
--- libavcodec/Makefile.orig 2006-12-28 09:45:48.000000000 -0300
+++ libavcodec/Makefile 2006-12-28 09:46:13.000000000 -0300
@@ -406,7 +406,7 @@
OBJS += $(OBJS-yes)
ASM_OBJS += $(ASM_OBJS-yes)
-EXTRALIBS := -L$(BUILD_ROOT)/libavutil -lavutil$(BUILDSUF) $(EXTRALIBS)
+EXTRALIBS := ../libavutil/libavutil.la $(EXTRALIBS)
NAME=avcodec
ifeq ($(BUILD_SHARED),yes)

View file

@ -0,0 +1,11 @@
--- libswscale/Makefile.orig 2006-12-28 09:47:56.000000000 -0300
+++ libswscale/Makefile 2006-12-28 09:48:17.000000000 -0300
@@ -7,7 +7,7 @@
LIBMAJOR=$(SWSMAJOR)
endif
-EXTRALIBS := -L$(BUILD_ROOT)/libavutil -lavutil$(BUILDSUF) $(EXTRALIBS)
+EXTRALIBS := ../libavutil/libavutil.la $(EXTRALIBS)
OBJS= swscale.o rgb2rgb.o
ifeq ($(TARGET_ALTIVEC),yes)