autogen.sh 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/sh
  2. #
  3. # Create configure and makefile stuff...
  4. #
  5. # Check environment
  6. if [ -n "$WSL_DISTRO_NAME" ]; then
  7. # we found a non-blank WSL environment distro name
  8. current_path="$(pwd)"
  9. pattern="/mnt/?"
  10. if [ "$(echo "$current_path" | grep -E "^$pattern")" ]; then
  11. # if we are in WSL and shared Windows file system, 'ln' does not work.
  12. no_links=true
  13. else
  14. no_links=
  15. fi
  16. fi
  17. # Git hooks should come before autoreconf.
  18. if [ -d .git ]; then
  19. if [ ! -d .git/hooks ]; then
  20. mkdir .git/hooks || exit $?
  21. fi
  22. if [ -n "$no_links" ]; then
  23. echo "Linux ln does not work on shared Windows file system in WSL."
  24. if [ ! -e .git/hooks/pre-commit ]; then
  25. echo "The pre-commit.sh file will not be copied to .git/hooks/pre-commit"
  26. # shell scripts do not work on Windows; TODO create equivalent batch file
  27. # cp ./pre-commit.sh .git/hooks/pre-commit || exit $?
  28. fi
  29. if [ ! -e .git/hooks/pre-push ]; then
  30. echo "The pre-push.sh file will not be copied to .git/hooks/pre-commit"
  31. # shell scripts do not work on Windows; TODO create equivalent batch file
  32. # cp ./pre-push.sh .git/hooks/pre-push || exit $?
  33. fi
  34. else
  35. if [ ! -e .git/hooks/pre-commit ]; then
  36. ln -s ../../pre-commit.sh .git/hooks/pre-commit || exit $?
  37. fi
  38. if [ ! -e .git/hooks/pre-push ]; then
  39. ln -s ../../pre-push.sh .git/hooks/pre-push || exit $?
  40. fi
  41. fi
  42. fi
  43. # if and as needed, create empty dummy versions of various files, mostly
  44. # associated with fips/self-test and asynccrypt:
  45. for dir in \
  46. ./wolfssl/wolfcrypt/port/intel \
  47. ./wolfssl/wolfcrypt/port/cavium
  48. do
  49. if [ ! -e "$dir" ]; then
  50. mkdir "$dir" || exit $?
  51. fi
  52. done
  53. for file in \
  54. ./wolfssl/options.h \
  55. ./wolfcrypt/src/fips.c \
  56. ./wolfcrypt/src/fips_test.c \
  57. ./wolfcrypt/src/wolfcrypt_first.c \
  58. ./wolfcrypt/src/wolfcrypt_last.c \
  59. ./wolfssl/wolfcrypt/fips.h \
  60. ./wolfcrypt/src/selftest.c \
  61. ./wolfcrypt/src/async.c \
  62. ./wolfssl/wolfcrypt/async.h \
  63. ./wolfcrypt/src/port/intel/quickassist.c \
  64. ./wolfcrypt/src/port/intel/quickassist_mem.c \
  65. ./wolfcrypt/src/port/cavium/cavium_nitrox.c \
  66. ./wolfssl/wolfcrypt/port/intel/quickassist.h \
  67. ./wolfssl/wolfcrypt/port/intel/quickassist_mem.h \
  68. ./wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h
  69. do
  70. if [ ! -e "$file" ]; then
  71. > "$file" || exit $?
  72. fi
  73. done
  74. # If this is a source checkout then call autoreconf with error as well
  75. if [ -e .git ]; then
  76. export WARNINGS="all,error"
  77. else
  78. export WARNINGS="all"
  79. fi
  80. autoreconf --install --force