View Single Post
  #471  
Old 12-30-2018, 06:01 AM
j_cool j_cool is offline
Senior Member
 
Join Date: Feb 2016
Posts: 515
j_cool is on a distinguished road
Default

Re: Customized rtmpdump binaries with patch file


Quote:
Originally Posted by supersonic80 View Post
The next one is the instruction I have, I only made some changes to make it work:
1. I had to remove the line 40 of rtmpdump.c, otherwise it would not compile.
2. I added -static after -lz on line 14 of Makefile to make rtmpdump "self-sufficient".

Instruction:
# Suppose the current user is IEUser (replace by your username)

# Install MinGW
https://osdn.net/projects/mingw/down...get-setup.exe/

# Run and select to install
mingw-developer-toolkit-bin
mingw32-base-bin
mingw32-gcc-g++-bin
msys-base-bin

# Download and unpack
https://www.zlib.net/zlib1211.zip
https://www.openssl.org/source/openssl-1.0.2q.tar.gz
https://github.com/sstativa/rtmpdump...ive/master.zip

# Open cmd.exe and start
c:\MinGW\msys\1.0\msys.bat

# Next should be run in msys window

# Compile openssl
cd /c/Users/IEUser/Downloads/openssl-1.0.2q
./config
make

# Compile zlib
cd /c/Users/IEUser/Downloads/zlib-1.2.11
make -f win32/Makefile.gcc

# Compile rtmdump-ksv
cd /c/Users/IEUser/Downloads/rtmpdump-ksv-master

make SYS=mingw INC="-I/c/Users/IEUser/Downloads/openssl-1.0.2q/include -I/c/Users/IEUser/Downloads/zlib-1.2.11 -L/c/Users/IEUser/Downloads/openssl-1.0.2q -L/c/Users/IEUser/Downloads/zlib-1.2.11" LDFLAGS="-L/c/Users/IEUser/Downloads/openssl-1.0.2q -L/c/Users/IEUser/Downloads/zlib-1.2.11"

I tried to compile rtmpdump and didn't work, this is how:

removed line 40 of rtmpdump.c ( #define off_t off64_t )

added -static after -lz on line 14 of Makefile ( LIBZ=-lz -static )

renamed Users/IEUser/Downloads to supersonic


STEPS TAKEN:

Code:
# Open cmd.exe and start
c:\MinGW\msys\1.0\msys.bat

# Next should be run in msys window
# Compile openssl
cd /c/supersonic/openssl-1.0.2q
./config
make

# Compile zlib
cd /c/supersonic/zlib-1.2.11
make -f win32/Makefile.gcc

# Compile rtmdump-ksv
cd /c/supersonic/rtmpdump-ksv-master
make SYS=mingw INC="-I/c/supersonic/openssl-1.0.2q/include -I/c/supersonic/zlib-1.2.11 -L/c/supersonic/openssl-1.0.2q -L/c/supersonic/zlib-1.2.11" LDFLAGS="-L/c/supersonic/openssl-1.0.2q -L/c/supersonic/zlib-1.2.11"
Reply With Quote

ERRORS:

Code:
J@PC /c/supersonic/openssl-1.0.2q
$ ./config

Configured for mingw.


J@PC /c/supersonic/openssl-1.0.2q
$ make
making all in crypto...
make[1]: Entering directory `/c/supersonic/openssl-1.0.2q/crypto'
making all in crypto/objects...
make[2]: Entering directory `/c/supersonic/openssl-1.0.2q/crypto/objects'
ar  r ../../libcrypto.a o_names.o obj_dat.o obj_lib.o obj_err.o obj_xref.o
C:\MinGW\bin\ar.exe: could not create temporary file whilst writing archive: no more archived files
make[2]: *** [lib] Error 1
make[2]: Leaving directory `/c/supersonic/openssl-1.0.2q/crypto/objects'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/c/supersonic/openssl-1.0.2q/crypto'
make: *** [build_crypto] Error 1


J@PC /c/supersonic/zlib-1.2.11
$ make -f win32/Makefile.gcc
gcc  -o minigzip_d.exe minigzip.o libz.dll.a
strip minigzip_d.exe


J@PC /c/supersonic/rtmpdump-ksv-master
$ make SYS=mingw INC="-I/c/supersonic/openssl-1.0.2q/include -I/c/supersonic/zlib-1.2.11 -L/c/supersonic/openssl-1.0.2q
 -L/c/supersonic/zlib-1.2.11" LDFLAGS="-L/c/supersonic/openssl-1.0.2q -L/c/supersonic/zlib-1.2.11"
make[1]: Entering directory `/c/supersonic/rtmpdump-ksv-master/librtmp'
gcc -shared -Wl,--out-implib,librtmp.dll.a -L/c/supersonic/openssl-1.0.2q -L/c/supersonic/zlib-1.2.11 -o librtmp-1.dll rtmp.o log.o amf.o hashswf.o parseurl.o  -lssl -lcrypto -lz -lws2_32 -lwinmm -lgdi32
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: cannot find -lssl
collect2.exe: error: ld returned 1 exit status
make[1]: *** [librtmp-1.dll] Error 1
make[1]: Leaving directory `/c/supersonic/rtmpdump-ksv-master/librtmp'
make: *** [librtmp/librtmp.a] Error 2
Reply With Quote