Applied changes to make it compile on darwin
authorPhilip Gladstone <philipjsg@users.sourceforge.net>
Sat, 23 Nov 2002 01:29:25 +0000 (01:29 +0000)
committerPhilip Gladstone <philipjsg@users.sourceforge.net>
Sat, 23 Nov 2002 01:29:25 +0000 (01:29 +0000)
Originally committed as revision 1270 to svn://svn.ffmpeg.org/ffmpeg/trunk

Makefile
configure
vhook/Makefile
vhook/fish.c
vhook/imlib2.c

index b70e22bd729f8d01d0ef308be760f3b142078110..c28de12e8bfae32d63a90a8ece23c7475c2a4777 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -48,8 +48,10 @@ ifeq ($(BUILD_VHOOK),yes)
 VHOOK=videohook
 INSTALLVHOOK=install-vhook
 CLEANVHOOK=clean-vhook
+ifneq ($(CONFIG_DARWIN),yes)
 LDFLAGS += -rdynamic
 endif
+endif
 
 OBJS = ffmpeg.o ffserver.o
 SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
index b41fd4d2c15eeebcb3a0861de58f4c39be597ffd..1378b5c801f04db0488725d063a94d39d24bdf2c 100755 (executable)
--- a/configure
+++ b/configure
@@ -114,6 +114,7 @@ CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer -mdynamic-no-pic"
 SHFLAGS="-dynamiclib"
 extralibs=""
 darwin="yes"
+strip="strip -x"
 ;;
 CYGWIN*)
 v4l="no"
@@ -145,7 +146,7 @@ int main( void ) { return (int) dlopen("foo", 0); }
 EOF
 
 if $cc -o $TMPO $TMPC -ldl 2> /dev/null  ; then
-vhook=yes
+vhook=yes
 fi
 
 cat > $TMPC << EOF
@@ -421,7 +422,7 @@ echo "  --disable-v4l            disable video4linux grabbing [default=no]"
 echo "  --disable-network        disable network support [default=no]"
 echo "  --disable-zlib           disable zlib [default=no]"
 echo "  --disable-simple_idct    disable simple IDCT routines [default=no]"
-echo "  --disable-vhook          disable video hooking support"
+echo "  --disable-vhook          disable video hooking support"
 echo "  --enable-gprof           enable profiling with gprof [$gprof]"
 echo "  --disable-mpegaudio-hp   faster (but less accurate)"
 echo "                           mpegaudio decoding [default=no]"
@@ -451,10 +452,10 @@ echo "mp3lame enabled  $mp3lame"
 echo "vorbis enabled   $vorbis"
 echo "a52 support      $a52"
 echo "a52 dlopened     $a52bin"
-echo "Video hooking    $vhook"
+echo "Video hooking    $vhook"
 
 if test "$vhook" = "yes" ; then
-echo "Imlib2 support   $imlib2"
+echo "Imlib2 support   $imlib2"
 fi
 
 echo "Creating config.mak and config.h"
index 5f198058f066a46d8646d564a16c8beabb51ef82..296127daeca2d94c658c5d27540a27b4f17f5304 100644 (file)
@@ -2,6 +2,11 @@ include ../config.mak
 
 CFLAGS=-fPIC $(OPTFLAGS) -g -Wall -I.. -I../libav -I../libavcodec -DHAVE_AV_CONFIG_H
 
+ifeq ($(CONFIG_DARWIN),yes)
+LDFLAGS+=-bundle -flat_namespace -undefined suppress
+else
+LDFLAGS+=-shared
+endif
 HOOKS=null.so fish.so
 
 ifeq ($(HAVE_IMLIB2),yes)
@@ -14,11 +19,11 @@ install:
        install -s -m 755 $(HOOKS) $(INSTDIR)
 
 imlib2.so: imlib2.o
-       $(CC) -g -o $@ -shared $< -lImlib2
+       $(CC) -g -o $@ $(LDFLAGS) $< -lImlib2
        rm $<
 
 %.so: %.o
-       $(CC) -g -o $@ -shared $<
+       $(CC) -g -o $@ $(LDFLAGS) $<
 
 %.html: %.texi
        texi2html -monolithic -number $<
index c25ba607191ee35bbf0b6d164b108ee049be7c14..b966b9b120333032c3eeaa2ab02d62c5a44d85dd 100644 (file)
@@ -35,7 +35,7 @@
  */
 #include <stdlib.h>
 #include <fcntl.h>
-#include <getopt.h>
+#include <unistd.h>
 #include <stdarg.h>
 #include <string.h>
 #include <sys/time.h>
index 3e11d9c1b260cec3409a8aea24213fa290e1aadf..fcc09e17f36f8cc6006edc26e8bbef001420db4e 100644 (file)
@@ -45,7 +45,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
-#include <getopt.h>
 #include <stdarg.h>
 #include <string.h>
 #include <unistd.h>