From c0af384013d9c10a4c624cbbf885262597b4dbf0 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 29 Jan 2006 18:32:55 +0000 Subject: [PATCH] Simplify LDFLAGS handling for MinGW. Originally committed as revision 4907 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/Makefile | 11 +++++++---- libavformat/Makefile | 11 +++++++---- libavutil/Makefile | 11 +++++++---- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 6c9e53645f..b12dff0327 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -9,6 +9,11 @@ VPATH=$(SRC_PATH)/libavcodec # NOTE: -I.. is needed to include config.h CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)/libavutil -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE $(AMR_CFLAGS) +#FIXME: This should be in configure/config.mak +ifeq ($(CONFIG_WIN32),yes) + LDFLAGS=-Wl,--output-def,$(@:.dll=.def) +endif + OBJS= bitstream.o utils.o mem.o allcodecs.o \ mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\ mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.o dsputil.o \ @@ -421,11 +426,9 @@ $(SLIBNAME): $(OBJS) ifeq ($(CONFIG_PP),yes) $(MAKE) -C libpostproc endif -ifeq ($(CONFIG_WIN32),yes) - $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) - -lib /machine:i386 /def:$(@:.dll=.def) -else $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) +ifeq ($(CONFIG_WIN32),yes) + -lib /machine:i386 /def:$(@:.dll=.def) endif dsputil.o: dsputil.c dsputil.h diff --git a/libavformat/Makefile b/libavformat/Makefile index bae7342c3b..92a1e686e8 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -8,6 +8,11 @@ VPATH=$(SRC_PATH)/libavformat CFLAGS=$(OPTFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavutil -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE +#FIXME: This should be in configure/config.mak +ifeq ($(CONFIG_WIN32),yes) + LDFLAGS=-Wl,--output-def,$(@:.dll=.def) +endif + OBJS= utils.o cutils.o os_support.o allformats.o PPOBJS= @@ -106,11 +111,9 @@ $(LIB): $(OBJS) $(PPOBJS) $(RANLIB) $@ $(SLIBNAME): $(OBJS) -ifeq ($(CONFIG_WIN32),yes) - $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS) - -lib /machine:i386 /def:$(@:.dll=.def) -else $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS) +ifeq ($(CONFIG_WIN32),yes) + -lib /machine:i386 /def:$(@:.dll=.def) endif depend: $(SRCS) diff --git a/libavutil/Makefile b/libavutil/Makefile index 54dd347fbf..9d02aab4ef 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -8,6 +8,11 @@ VPATH=$(SRC_PATH)/libavutil # NOTE: -I.. is needed to include config.h CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE +#FIXME: This should be in configure/config.mak +ifeq ($(CONFIG_WIN32),yes) + LDFLAGS=-Wl,--output-def,$(@:.dll=.def) +endif + OBJS= mathematics.o \ integer.o \ rational.o \ @@ -34,11 +39,9 @@ $(LIB): $(OBJS) $(RANLIB) $@ $(SLIBNAME): $(OBJS) -ifeq ($(CONFIG_WIN32),yes) - $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) - -lib /machine:i386 /def:$(@:.dll=.def) -else $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) +ifeq ($(CONFIG_WIN32),yes) + -lib /machine:i386 /def:$(@:.dll=.def) endif %.o: %.c