kewlbear / FFmpeg-iOS-build-script

Shell scripts to build FFmpeg for iOS and tvOS
3.03k stars 899 forks source link

--enable-openssl issue #129

Closed L1onKing closed 6 years ago

L1onKing commented 6 years ago

Hello! Big thanks for your amazing work with the script, you're making our lives easier :)

But I happened to have an issue when I'm trying to build ffmpeg with 'openssl' library. I need it for https support.

I added "--enable-openssl" into CONFIGURE-FLAGS in build-ffmpeg.sh and when I'm launching the script I'm getting such output:

building arm64... ERROR: openssl not found

If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "config.log" produced by configure as this will help solve the problem.

Weirdly enough, I HAVE openssl installed. Here it is:

MBP-Mojo:FFmpeg-iOS-build-script-master user$ which openssl /opt/local/bin/openssl

That's the end of config.log file of ffmpeg: END /var/folders/xt/7v6bxk2n19zft1y3yzymdc580000gq/T//ffconf.hqzx0Gvn/test.c gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I$(SRC_PATH)/compat/dispatch_semaphore -DPIC -std=c11 -Werror=partial-availability -fomit-frame-pointer -fPIC -pthread -c -o /var/folders/xt/7v6bxk2n19zft1y3yzymdc580000gq/T//ffconf.hqzx0Gvn/test.o /var/folders/xt/7v6bxk2n19zft1y3yzymdc580000gq/T//ffconf.hqzx0Gvn/test.c /var/folders/xt/7v6bxk2n19zft1y3yzymdc580000gq/T//ffconf.hqzx0Gvn/test.c:1:10: fatal error: 'openssl/ssl.h' file not found

include <openssl/ssl.h>

     ^~~~~~~~~~~~~~~

1 error generated. ERROR: openssl not found

Does anybody know how to deal with this issue? I would be greatly appreciated for any help on that case. Thanks in advance!

kewlbear commented 6 years ago

Your installed OpenSSL is for macOS. You should build OpenSSL for iOS.

L1onKing commented 6 years ago

Oh! That's an excellent point. Let me check it and I'll come back again with feedback. Thank you!

L1onKing commented 6 years ago

I've built openssl succesfully, now I have include files and libs. Could you explain how I can refer ffmpeg to exact this library? Thanks.

L1onKing commented 6 years ago

I found your answers on the same case (sorry, I should check closed issues first).

I modified build-ffmpeg.sh in the next way:

1) add --enable-openssl into CONFIGURE_FLAGS

CONFIGURE_FLAGS="--enable-cross-compile --disable-debug --disable-programs \ --disable-doc --enable-pic --enable-protocol=https --enable-openssl"

2) And added CFLAGS and LDFLAGS here CXXFLAGS="$CFLAGS" LDFLAGS="$CFLAGS" //those are lines from the script

//this is where my code starts CFLAGS="$CFLAGS -I/Users/user/Documents/FFMPEG-build/FFmpeg-iOS-build-script-master/openssl/include" LDFLAGS="$LDFLAGS -L/Users/user/Documents/FFMPEG-build/FFmpeg-iOS-build-script-master/openssl/lib" //this is where it ends

And it worked! I think that I might provided not efficient and beautiful way to do this, but it works. Thanks again for your help!

kewlbear commented 6 years ago

Glad I could help!