configure 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #!/bin/sh
  2. echo '---------------------------------------------------------------------'
  3. echo 'SoftEther VPN for Unix'
  4. echo
  5. echo 'Copyright (c) Daiyuu Nobori.'
  6. echo 'Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.'
  7. echo 'Copyright (c) SoftEther Corporation.'
  8. echo 'Copyright (c) all contributors on SoftEther VPN project in GitHub.'
  9. echo
  10. echo 'License: The Apache License, Version 2.0'
  11. echo
  12. echo 'Read and understand README.TXT, LICENSE.TXT and WARNING.TXT before use.'
  13. echo '---------------------------------------------------------------------'
  14. echo
  15. echo 'Welcome to the corner-cutting configure script !'
  16. echo
  17. OS=""
  18. case "`uname -s`" in
  19. Linux)
  20. OS="linux"
  21. ;;
  22. FreeBSD)
  23. OS="freebsd"
  24. ;;
  25. SunOS)
  26. OS="solaris"
  27. ;;
  28. Darwin)
  29. OS="macos"
  30. ;;
  31. OpenBSD)
  32. OS="openbsd"
  33. ;;
  34. *)
  35. echo 'Select your operating system below:'
  36. echo ' 1: Linux'
  37. echo ' 2: FreeBSD'
  38. echo ' 3: Solaris'
  39. echo ' 4: Mac OS X'
  40. echo ' 5: OpenBSD'
  41. echo
  42. echo -n 'Which is your operating system (1 - 5) ? : '
  43. read TMP
  44. echo
  45. if test "$TMP" = "1"
  46. then
  47. OS="linux"
  48. fi
  49. if test "$TMP" = "2"
  50. then
  51. OS="freebsd"
  52. fi
  53. if test "$TMP" = "3"
  54. then
  55. OS="solaris"
  56. fi
  57. if test "$TMP" = "4"
  58. then
  59. OS="macos"
  60. fi
  61. if test "$TMP" = "5"
  62. then
  63. OS="openbsd"
  64. fi
  65. if test "$OS" = ""
  66. then
  67. echo "Wrong number."
  68. exit 1
  69. fi
  70. ;;
  71. esac
  72. CPU=""
  73. case "`uname -m`" in
  74. x86_64|amd64|aarch64|arm64|armv8*|mips64|ppc64|sparc64|alpha|ia64)
  75. CPU=64bit
  76. ;;
  77. i?86|x86pc|i86pc|armv4*|armv5*|armv6*|armv7*)
  78. CPU=32bit
  79. ;;
  80. *)
  81. echo 'Select your CPU bits below:'
  82. echo ' 1: 32-bit'
  83. echo ' 2: 64-bit'
  84. echo
  85. echo -n 'Which is the type of your CPU (1 - 2) ? : '
  86. read TMP
  87. echo
  88. if test "$TMP" = "1"
  89. then
  90. CPU="32bit"
  91. fi
  92. if test "$TMP" = "2"
  93. then
  94. CPU="64bit"
  95. fi
  96. if test "$CPU" = ""
  97. then
  98. echo "Wrong number."
  99. exit 1
  100. fi
  101. ;;
  102. esac
  103. cp src/makefiles/${OS}_${CPU}.mak Makefile
  104. echo "The Makefile is generated. Run 'make' to build SoftEther VPN."