From: hyc Date: Mon, 12 Jul 2010 08:20:04 +0000 (+0000) Subject: MacOSX/Darwin shared library flags X-Git-Tag: v2.4~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2340f0e27cd21d624d5f915fc42182750be6fca6;p=rtmpdump MacOSX/Darwin shared library flags git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@546 400ebc74-4327-4243-bc38-086b20814532 --- diff --git a/Makefile b/Makefile index 75628dd..fda3c74 100644 --- a/Makefile +++ b/Makefile @@ -33,10 +33,12 @@ SBINDIR=$(DESTDIR)$(sbindir) MANDIR=$(DESTDIR)$(mandir) LIBS_posix= +LIBS_darwin= LIBS_mingw=-lws2_32 -lwinmm -lgdi32 LIBS=-L librtmp -lrtmp $(CRYPTO_LIB) $(LIBS_$(SYS)) $(XLIBS) THREADLIB_posix=-lpthread +THREADLIB_darwin=-lpthread THREADLIB_mingw= THREADLIB=$(THREADLIB_$(SYS)) SLIBS=$(THREADLIB) $(LIBS) @@ -45,6 +47,7 @@ LIBRTMP=librtmp/librtmp.a INCRTMP=librtmp/rtmp_sys.h librtmp/rtmp.h librtmp/log.h librtmp/amf.h EXT_posix= +EXT_darwin= EXT_mingw=.exe EXT=$(EXT_$(SYS)) diff --git a/README b/README index 6607a1d..5689853 100644 --- a/README +++ b/README @@ -10,7 +10,11 @@ To compile type "make" with SYS=, e.g. $ make SYS=posix -for Linux, MacOSX, Unix, etc. or +for Linux, Unix, etc. or + + $ make SYS=darwin + +for MacOSX or $ make SYS=mingw diff --git a/librtmp/Makefile b/librtmp/Makefile index 6774db7..2fd5869 100644 --- a/librtmp/Makefile +++ b/librtmp/Makefile @@ -17,6 +17,7 @@ REQ_GNUTLS=gnutls REQ_OPENSSL=libssl,libcrypto LIBZ=-lz LIBS_posix= +LIBS_darwin= LIBS_mingw=-lws2_32 -lwinmm -lgdi32 LIB_GNUTLS=-lgnutls -lgcrypt $(LIBZ) LIB_OPENSSL=-lssl -lcrypto $(LIBZ) @@ -26,9 +27,16 @@ CRYPTO_REQ=$(REQ_$(CRYPTO)) CRYPTO_DEF=$(DEF_$(CRYPTO)) SO_posix=so.0 +SO_darwin=so.0 SO_mingw=dll SO_EXT=$(SO_$(SYS)) +SO_LDFLAGS_posix=-shared -Wl,-soname,$@ +SO_LDFLAGS_darwin=-bundle -flat_namespace -undefined suppress -fno-common \ + -headerpad_max_install_names +SO_LDFLAGS_mingw= +SO_LDFLAGS=$(SO_LDFLAGS_$(SYS)) + SHARED=yes SODEF_yes=-fPIC SOLIB_yes=librtmp.$(SO_EXT) @@ -40,6 +48,7 @@ SO_INST=$(SOINST_$(SHARED)) DEF=-DRTMPDUMP_VERSION=\"$(VERSION)\" $(CRYPTO_DEF) $(XDEF) OPT=-O2 CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT) $(SO_DEF) +LDFLAGS=$(XLDFLAGS) incdir=$(prefix)/include/librtmp bindir=$(prefix)/bin @@ -61,7 +70,7 @@ librtmp.a: $(OBJS) $(AR) rs $@ $? librtmp.$(SO_EXT): $(OBJS) - $(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ $^ $> $(CRYPTO_LIB) + $(CC) $(SO_LDFLAGS) $(LDFLAGS) -o $@ $^ $> $(CRYPTO_LIB) ln -sf $@ librtmp.so log.o: log.c log.h Makefile