Re: [rtmpdump] Compiling RTMPdump on Max OS X
On Wed, Jul 21, 2010 at 1:53 AM, Scott D. Davilla <davilla@xbmc.org> wrote:
in librtmp/Makefile, change
SO_darwin=so.0
and
SO_LDFLAGS_darwin=-bundle -flat_namespace -undefined suppress -fno-common \ -headerpad_max_install_names $(XLDFLAGS)
to
SO_darwin=dylib
and
SO_LDFLAGS_darwin=-dynamiclib -twolevel_namespace $(XLDFLAGS)
This will build a dylib. The Makefile will also have to be fixed as it assume .so.0 naming and dylibs also don't need the symlink.
I made the suggested changes to librtmp/Makefile, but I do not understand what changes I need to make to ./Makefile. I was able to successfully compile with just the changes to librtmp/Makefile. However, when I try to execute rtmpdump, I received the error "Referenced from: ./rtmpdump Reason:image not found". I presume this is because I didn't make the appropriate changes to ./Makefile. Could you be more descriptive? Once I am able to successfully compile, should I submit a patch of the working changes? $ make SYS=darwin gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o rtmp.o rtmp.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o log.o log.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o amf.o amf.c In file included from amf.c:33: bytes.h:74:2: warning: #warning "Float word order not defined, assuming the same as byte order!" gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o hashswf.o hashswf.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o parseurl.o parseurl.c ar rs librtmp.a rtmp.o log.o amf.o hashswf.o parseurl.o ar: creating archive librtmp.a gcc -dynamiclib -twolevel_namespace -o librtmp.dylib rtmp.o log.o amf.o hashswf.o parseurl.o -lssl -lcrypto -lz ln -sf librtmp.dylib librtmp.so gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpdump.o rtmpdump.c gcc -Wall -o rtmpdump rtmpdump.o -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpgw.o rtmpgw.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o thread.o thread.c gcc -Wall -o rtmpgw rtmpgw.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpsrv.o rtmpsrv.c gcc -Wall -o rtmpsrv rtmpsrv.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpsuck.o rtmpsuck.c gcc -Wall -o rtmpsuck rtmpsuck.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz $ ./rtmpdump dyld: Library not loaded: librtmp.dylib Referenced from: ./rtmpdump Reason: image not found Trace/BPT trap
On Wed, Jul 21, 2010 at 11:54 AM, Nickolaus Padgett <nick.padgett@gmail.com> wrote:
I made the suggested changes to librtmp/Makefile, but I do not understand what changes I need to make to ./Makefile. I was able to successfully compile with just the changes to librtmp/Makefile. However, when I try to execute rtmpdump, I received the error "Referenced from: ./rtmpdump Reason:image not found". I presume this is because I didn't make the appropriate changes to ./Makefile. Could you be more descriptive? Once I am able to successfully compile, should I submit a patch of the working changes?
$ make SYS=darwin gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o rtmp.o rtmp.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o log.o log.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o amf.o amf.c In file included from amf.c:33: bytes.h:74:2: warning: #warning "Float word order not defined, assuming the same as byte order!" gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o hashswf.o hashswf.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o parseurl.o parseurl.c ar rs librtmp.a rtmp.o log.o amf.o hashswf.o parseurl.o ar: creating archive librtmp.a gcc -dynamiclib -twolevel_namespace -o librtmp.dylib rtmp.o log.o amf.o hashswf.o parseurl.o -lssl -lcrypto -lz ln -sf librtmp.dylib librtmp.so gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpdump.o rtmpdump.c gcc -Wall -o rtmpdump rtmpdump.o -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpgw.o rtmpgw.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o thread.o thread.c gcc -Wall -o rtmpgw rtmpgw.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpsrv.o rtmpsrv.c gcc -Wall -o rtmpsrv rtmpsrv.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpsuck.o rtmpsuck.c gcc -Wall -o rtmpsuck rtmpsuck.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz $ ./rtmpdump dyld: Library not loaded: librtmp.dylib Referenced from: ./rtmpdump Reason: image not found Trace/BPT trap
I found librtmp.dylib in ./librtmp. I copied it into the directory I was trying to run rtmpdump in and it appears to work. Should I install librtmp.dylib in /usr/local/lib?
On Wed, Jul 21, 2010 at 12:28 PM, Nickolaus Padgett <nick.padgett@gmail.com> wrote:
On Wed, Jul 21, 2010 at 11:54 AM, Nickolaus Padgett <nick.padgett@gmail.com> wrote:
I made the suggested changes to librtmp/Makefile, but I do not understand what changes I need to make to ./Makefile. I was able to successfully compile with just the changes to librtmp/Makefile. However, when I try to execute rtmpdump, I received the error "Referenced from: ./rtmpdump Reason:image not found". I presume this is because I didn't make the appropriate changes to ./Makefile. Could you be more descriptive? Once I am able to successfully compile, should I submit a patch of the working changes?
$ make SYS=darwin gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o rtmp.o rtmp.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o log.o log.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o amf.o amf.c In file included from amf.c:33: bytes.h:74:2: warning: #warning "Float word order not defined, assuming the same as byte order!" gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o hashswf.o hashswf.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o parseurl.o parseurl.c ar rs librtmp.a rtmp.o log.o amf.o hashswf.o parseurl.o ar: creating archive librtmp.a gcc -dynamiclib -twolevel_namespace -o librtmp.dylib rtmp.o log.o amf.o hashswf.o parseurl.o -lssl -lcrypto -lz ln -sf librtmp.dylib librtmp.so gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpdump.o rtmpdump.c gcc -Wall -o rtmpdump rtmpdump.o -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpgw.o rtmpgw.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o thread.o thread.c gcc -Wall -o rtmpgw rtmpgw.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpsrv.o rtmpsrv.c gcc -Wall -o rtmpsrv rtmpsrv.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpsuck.o rtmpsuck.c gcc -Wall -o rtmpsuck rtmpsuck.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz $ ./rtmpdump dyld: Library not loaded: librtmp.dylib Referenced from: ./rtmpdump Reason: image not found Trace/BPT trap
I found librtmp.dylib in ./librtmp. I copied it into the directory I was trying to run rtmpdump in and it appears to work. Should I install librtmp.dylib in /usr/local/lib?
Attached is a patch that I needed in order to compile on Mac OS X.
Nickolaus Padgett wrote:
On Wed, Jul 21, 2010 at 12:28 PM, Nickolaus Padgett <nick.padgett@gmail.com> wrote:
On Wed, Jul 21, 2010 at 11:54 AM, Nickolaus Padgett <nick.padgett@gmail.com> wrote:
I made the suggested changes to librtmp/Makefile, but I do not understand what changes I need to make to ./Makefile. I was able to successfully compile with just the changes to librtmp/Makefile. However, when I try to execute rtmpdump, I received the error "Referenced from: ./rtmpdump Reason:image not found". I presume this is because I didn't make the appropriate changes to ./Makefile. Could you be more descriptive? Once I am able to successfully compile, should I submit a patch of the working changes?
Attached is a patch that I needed in order to compile on Mac OS X.
This is all fine with me; the XBMC guys were the ones who wanted it built as a bundle. The Debian guys were the ones who wanted the programs to use the dynamic library. IMO they don't know what they're talking about but it was easier to agree and shut them up than explain to them why they're wrong. Ultimately I don't care how anyone else builds this stuff. Installation is a packaging issue and not my concern. I run it out of my build directory; it never gets installed on any of my boxes.
On Thu, Jul 22, 2010 at 6:29 PM, Howard Chu <hyc@highlandsun.com> wrote:
Attached is a patch that I needed in order to compile on Mac OS X.
This is all fine with me; the XBMC guys were the ones who wanted it built as a bundle.
The Debian guys were the ones who wanted the programs to use the dynamic library. IMO they don't know what they're talking about but it was easier to agree and shut them up than explain to them why they're wrong.
Ultimately I don't care how anyone else builds this stuff. Installation is a packaging issue and not my concern. I run it out of my build directory; it never gets installed on any of my boxes.
I've run into more issues with compiling on a Mac. When running a "sudo make SYS=darwin install", I receive the error "No rule to make target `install_dylib', needed by `install'. Stop.". In order to successfully install I have to apply the patch, run "sudo make SYS=darwin install", revert the changes to ./librtmp/Makefile, and the rerun "sudo make SYS=darwin install". Most recent error: $ sudo make SYS=darwin install gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpdump.o rtmpdump.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o rtmp.o rtmp.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o log.o log.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o amf.o amf.c In file included from amf.c:33: bytes.h:74:2: warning: #warning "Float word order not defined, assuming the same as byte order!" gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o hashswf.o hashswf.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o parseurl.o parseurl.c ar rs librtmp.a rtmp.o log.o amf.o hashswf.o parseurl.o ar: creating archive librtmp.a gcc -dynamiclib -twolevel_namespace -o librtmp.dylib rtmp.o log.o amf.o hashswf.o parseurl.o -lssl -lcrypto -lz ln -sf librtmp.dylib librtmp.so gcc -Wall -o rtmpdump rtmpdump.o -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpgw.o rtmpgw.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o thread.o thread.c gcc -Wall -o rtmpgw rtmpgw.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpsrv.o rtmpsrv.c gcc -Wall -o rtmpsrv rtmpsrv.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpsuck.o rtmpsuck.c gcc -Wall -o rtmpsuck rtmpsuck.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz mkdir -p /usr/local/bin /usr/local/sbin /usr/local/man/man1 /usr/local/man/man8 cp rtmpdump /usr/local/bin cp rtmpgw rtmpsrv rtmpsuck /usr/local/sbin cp rtmpdump.1 /usr/local/man/man1 cp rtmpgw.8 /usr/local/man/man8 sed -e "s;@prefix@;/usr/local;" -e "s;@VERSION@;v2.3;" \ -e "s;@CRYPTO_REQ@;libssl,libcrypto;" librtmp.pc.in > librtmp.pc mkdir -p /usr/local/include/librtmp /usr/local/lib/pkgconfig /usr/local/man/man3 cp amf.h http.h log.h rtmp.h /usr/local/include/librtmp cp librtmp.a /usr/local/lib cp librtmp.pc /usr/local/lib/pkgconfig cp librtmp.3 /usr/local/man/man3 make[1]: *** No rule to make target `install_dylib', needed by `install'. Stop. make: *** [install] Error 2 To successfully install: $ make clean rm -f *.o rtmpdump rtmpgw rtmpsrv rtmpsuck rm -f *.o *.a *.so *.so.0 $ sudo make SYS=darwin install gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpdump.o rtmpdump.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o rtmp.o rtmp.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o log.o log.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o amf.o amf.c In file included from amf.c:33: bytes.h:74:2: warning: #warning "Float word order not defined, assuming the same as byte order!" gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o hashswf.o hashswf.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o parseurl.o parseurl.c ar rs librtmp.a rtmp.o log.o amf.o hashswf.o parseurl.o ar: creating archive librtmp.a gcc -dynamiclib -twolevel_namespace -o librtmp.dylib rtmp.o log.o amf.o hashswf.o parseurl.o -lssl -lcrypto -lz ln -sf librtmp.dylib librtmp.so gcc -Wall -o rtmpdump rtmpdump.o -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpgw.o rtmpgw.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o thread.o thread.c gcc -Wall -o rtmpgw rtmpgw.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpsrv.o rtmpsrv.c gcc -Wall -o rtmpsrv rtmpsrv.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -O2 -c -o rtmpsuck.o rtmpsuck.c gcc -Wall -o rtmpsuck rtmpsuck.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz mkdir -p /usr/local/bin /usr/local/sbin /usr/local/man/man1 /usr/local/man/man8 cp rtmpdump /usr/local/bin cp rtmpgw rtmpsrv rtmpsuck /usr/local/sbin cp rtmpdump.1 /usr/local/man/man1 cp rtmpgw.8 /usr/local/man/man8 sed -e "s;@prefix@;/usr/local;" -e "s;@VERSION@;v2.3;" \ -e "s;@CRYPTO_REQ@;libssl,libcrypto;" librtmp.pc.in > librtmp.pc mkdir -p /usr/local/include/librtmp /usr/local/lib/pkgconfig /usr/local/man/man3 cp amf.h http.h log.h rtmp.h /usr/local/include/librtmp cp librtmp.a /usr/local/lib cp librtmp.pc /usr/local/lib/pkgconfig cp librtmp.3 /usr/local/man/man3 make[1]: *** No rule to make target `install_dylib', needed by `install'. Stop. make: *** [install] Error 2 $ sudo make SYS=darwin install gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o rtmp.o rtmp.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o log.o log.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o amf.o amf.c In file included from amf.c:33: bytes.h:74:2: warning: #warning "Float word order not defined, assuming the same as byte order!" gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o hashswf.o hashswf.c gcc -Wall -DRTMPDUMP_VERSION=\"v2.3\" -DUSE_OPENSSL -O2 -fPIC -c -o parseurl.o parseurl.c ar rs librtmp.a rtmp.o log.o amf.o hashswf.o parseurl.o gcc -bundle -flat_namespace -undefined suppress -fno-common -headerpad_max_install_names -o librtmp.so.0 rtmp.o log.o amf.o hashswf.o parseurl.o -lssl -lcrypto -lz ln -sf librtmp.so.0 librtmp.so gcc -Wall -o rtmpdump rtmpdump.o -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -o rtmpgw rtmpgw.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -o rtmpsrv rtmpsrv.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz gcc -Wall -o rtmpsuck rtmpsuck.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz mkdir -p /usr/local/bin /usr/local/sbin /usr/local/man/man1 /usr/local/man/man8 cp rtmpdump /usr/local/bin cp rtmpgw rtmpsrv rtmpsuck /usr/local/sbin cp rtmpdump.1 /usr/local/man/man1 cp rtmpgw.8 /usr/local/man/man8 sed -e "s;@prefix@;/usr/local;" -e "s;@VERSION@;v2.3;" \ -e "s;@CRYPTO_REQ@;libssl,libcrypto;" librtmp.pc.in > librtmp.pc mkdir -p /usr/local/include/librtmp /usr/local/lib/pkgconfig /usr/local/man/man3 cp amf.h http.h log.h rtmp.h /usr/local/include/librtmp cp librtmp.a /usr/local/lib cp librtmp.pc /usr/local/lib/pkgconfig cp librtmp.3 /usr/local/man/man3 cp librtmp.so.0 /usr/local/lib cd /usr/local/lib; ln -sf librtmp.so.0 librtmp.so
participants (2)
-
Howard Chu -
Nickolaus Padgett