nichot20

cross compile openSSL

Oct 18th, 2011
160
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/bash
  2. # Cross compile OPENssl
  3.  
  4. export PATH="$PATH:/mnt/store-0/tims/ffmpeg-toolchain/mingw-w64-x86_64/bin"
  5.  
  6. #set up compiler prefixes
  7. . gcc-prefix.sh
  8. setup_gnu_toolchain
  9.  
  10. cd /mnt/store-0/tims/ffmpeg-win/ffmpeg-libs/openssl-1.0.0e
  11.  
  12. echo "make distclean/clean..."
  13. make distclean
  14. make clean
  15.  
  16. echo "configuring..."
  17. ./config \
  18. --prefix=/mnt/store-0/tims/ffmpeg-win/local-build \
  19. no-shared \
  20. mingw64 \
  21.  
  22. configure_ok=$?
  23. if [ $configure_ok = 0 ] ; then
  24.   echo "make..."
  25.   make
  26. else
  27.   echo "Config error....exiting"
  28.   exit $configure_ok
  29. fi
  30.  
  31. make_ok=$?
  32.  
  33. # now install
  34. if [ $make_ok = 0 ] ; then
  35.   echo "installing..."
  36.   make install
  37. fi
  38.  
  39. exit 0
  40.  
  41. #notes
  42. had to comment out Line 872 in Configure otherwise it dies on changing the target to mingw
  43. This is a known issue.
  44.  
  45. =================================
  46. gcc-prefix.sh
  47. =================================
  48. CROSS=x86_64-w64-mingw32-
  49. #link_with_cc=gcc
  50.  
  51. setup_gnu_toolchain() {
  52.     # vpx
  53.     export CC=${CC:-${CROSS}gcc}
  54.     export AR=${AR:-${CROSS}ar}
  55.     export LD=${LD:-${CROSS}${link_with_cc:-ld}}
  56.     export AS=${AS:-${CROSS}as}
  57.     export STRIP=${STRIP:-${CROSS}strip}
  58.     export NM=${NM:-${CROSS}nm}
  59.     export AS_SFX=.s
  60.     # various incl xvid
  61.     export CXX=${CXX:-${CROSS}g++}
  62.     export CPP=${CPP:-${CROSS}cpp}
  63.     export RANLIB=${RANLIB:-${CROSS}ranlib}
  64. }
RAW Paste Data