2nd attempt at OS/X shared/mdynamicnopic fix by ("Steven M. Schultz" <sms at 2BSD dot COM>)

Originally committed as revision 2475 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2003-11-03 20:04:10 +00:00
parent 3d0ef6dd52
commit 75388c749b
2 changed files with 21 additions and 8 deletions

23
configure vendored
View File

@ -424,6 +424,7 @@ if test $mmx = "default"; then
fi fi
#Darwin CC versions #Darwin CC versions
needmdynamicnopic="no"
if test $targetos = Darwin; then if test $targetos = Darwin; then
if test -n "`$cc -v 2>&1 | grep xlc`"; then if test -n "`$cc -v 2>&1 | grep xlc`"; then
CFLAGS="-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto" CFLAGS="-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
@ -433,14 +434,17 @@ if test $targetos = Darwin; then
*2.95*) *2.95*)
CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer" CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer"
;; ;;
*3.1*) *3.*)
CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare" CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
;; if test "$lshared" = no; then
*3.3*) needmdynamicnopic="yes"
CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL -Wno-sign-compare" fi
;; ;;
*) *)
CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic" CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer"
if test "$lshared" = no; then
needmdynamicnopic="yes"
fi
;; ;;
esac esac
fi fi
@ -916,7 +920,16 @@ echo "CC=$cc" >> config.mak
echo "AR=$ar" >> config.mak echo "AR=$ar" >> config.mak
echo "RANLIB=$ranlib" >> config.mak echo "RANLIB=$ranlib" >> config.mak
echo "STRIP=$strip" >> config.mak echo "STRIP=$strip" >> config.mak
# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
# shared modules on OS/X (vhook/Makefile).
SHCFLAGS=$CFLAGS
if test "$needmdynamicnopic" = yes; then
CFLAGS="$CFLAGS -mdynamic-no-pic"
fi
echo "OPTFLAGS=$CFLAGS" >> config.mak echo "OPTFLAGS=$CFLAGS" >> config.mak
echo "SHCFLAGS=$SHCFLAGS">>config.mak
echo "LDFLAGS=$LDFLAGS" >> config.mak echo "LDFLAGS=$LDFLAGS" >> config.mak
echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
echo "SHFLAGS=$SHFLAGS" >> config.mak echo "SHFLAGS=$SHFLAGS" >> config.mak

View File

@ -2,10 +2,10 @@ include ../config.mak
VPATH=$(SRC_PATH)/vhook VPATH=$(SRC_PATH)/vhook
CFLAGS=-fPIC $(OPTFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H CFLAGS=-fPIC $(SHCFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H
ifeq ($(CONFIG_DARWIN),yes) ifeq ($(CONFIG_DARWIN),yes)
SHFLAGS+=-bundle -flat_namespace -undefined suppress SHFLAGS+=-flat_namespace -undefined suppress
endif endif
HOOKS=null.so fish.so ppm.so HOOKS=null.so fish.so ppm.so
@ -26,7 +26,7 @@ depend: $(SRCS)
$(CC) -MM $(CFLAGS) $^ 1>.depend $(CC) -MM $(CFLAGS) $^ 1>.depend
install: install:
install -s -m 755 $(HOOKS) $(INSTDIR) install -m 755 $(HOOKS) $(INSTDIR)
imlib2.so: imlib2.o imlib2.so: imlib2.o
$(CC) -g -o $@ $(SHFLAGS) $< -lImlib2 $(CC) -g -o $@ $(SHFLAGS) $< -lImlib2