[Ffmpeg-devel] OpenBSD support

Jacob Meuser jakemsr
Mon May 16 02:44:12 CEST 2005


On Mon, May 09, 2005 at 03:23:37AM -0700, Jacob Meuser wrote:

first, thank you Michael for applying the patches.

> +CFLAGS="$CFLAGS \$(PIC)"

this does what it needs to, but has some negative side effects.

the issue I was addressing with is that, for shared libraries on
OpenBSD, all objects in the library need to be compiled for PIC.

the CFLAGS setting above does that, but then when the same
CFLAGs are used in tests later in configure, they all fail
because the shell tries to expand $(PIC).  also, that CFLAG
setting make _all_ objects PIC, which is not needed for
executables.

so, I propose the attached diff, which adds yet another configure/
config.mak variable, LIBOBJFLAGS.

-- 
<jakemsr at jakemsr.com>
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/configure,v
retrieving revision 1.180
diff -u -r1.180 configure
--- configure	13 May 2005 20:57:27 -0000	1.180
+++ configure	16 May 2005 00:35:03 -0000
@@ -193,6 +193,7 @@
 need_inet_aton="no"
 ffserver="yes"
 ffplay="yes"
+LIBOBJFLAGS=""
 LDFLAGS=-Wl,--warn-common
 FFSLDFLAGS=-Wl,-E
 LIBPREF="lib"
@@ -269,7 +270,7 @@
 audio_oss="yes"
 dv1394="no"
 make="gmake"
-CFLAGS="$CFLAGS \$(PIC)"
+LIBOBJFLAGS="\$(PIC)"
 LDFLAGS="$LDFLAGS -export-dynamic -pthread"
 extralibs="$extralibs -lossaudio"
 ;;
@@ -1206,6 +1207,7 @@
 echo "LDFLAGS=$LDFLAGS" >> config.mak
 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
 echo "SHFLAGS=$SHFLAGS" >> config.mak
+echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
 echo "BUILDSUF=$BUILDSUF" >> config.mak
 echo "LIBPREF=$LIBPREF" >> config.mak
 echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
Index: libavcodec/Makefile
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/Makefile,v
retrieving revision 1.186
diff -u -r1.186 Makefile
--- libavcodec/Makefile	10 May 2005 21:02:20 -0000	1.186
+++ libavcodec/Makefile	16 May 2005 00:35:03 -0000
@@ -389,10 +389,10 @@
 	$(MAKE) -C libpostproc
 
 %.o: %.c
-	$(CC) $(CFLAGS) -c -o $@ $< 
+	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< 
 
 %.o: %.S
-	$(CC) $(CFLAGS) -c -o $@ $<
+	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
 
 depend: $(SRCS)
 	$(CC) -MM $(CFLAGS) $^ 1>.depend
Index: libavcodec/libpostproc/Makefile
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/libpostproc/Makefile,v
retrieving revision 1.21
diff -u -r1.21 Makefile
--- libavcodec/libpostproc/Makefile	23 Mar 2005 14:10:22 -0000	1.21
+++ libavcodec/libpostproc/Makefile	16 May 2005 00:35:03 -0000
@@ -20,7 +20,7 @@
 # .PHONY: all clean
 
 .c.o:
-	$(CC) -c $(CFLAGS) -I$(SRC_PATH)/libavcodec -I../.. -o $@ $<
+	$(CC) -c $(CFLAGS) $(LIBOBJFLAGS) -I$(SRC_PATH)/libavcodec -I../.. -o $@ $<
 
 all:    $(SWSLIB) $(PPLIB) $(SPPLIB)
 
Index: libavformat/Makefile
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/Makefile,v
retrieving revision 1.89
diff -u -r1.89 Makefile
--- libavformat/Makefile	11 May 2005 22:47:26 -0000	1.89
+++ libavformat/Makefile	16 May 2005 00:35:03 -0000
@@ -128,7 +128,7 @@
                 "$(prefix)/include/ffmpeg"
 
 %.o: %.c
-	$(CC) $(CFLAGS) -c -o $@ $< 
+	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< 
 
 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
 %.o: %.cpp



More information about the ffmpeg-devel mailing list