You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

174 lines
3.6 KiB

  1. --- a/configure
  2. +++ b/configure
  3. @@ -3,66 +3,7 @@
  4. # This configure script written by Brian Callahan <bcallah@openbsd.org>
  5. # and released into the Public Domain.
  6. -cccheck() {
  7. - if [ ! -z "$CC" ] ; then
  8. -cat << EOF > conftest.c
  9. -int main(void){return 0;}
  10. -EOF
  11. - $CC -o conftest conftest.c > /dev/null 2>&1
  12. - if [ $? -eq 0 ] ; then
  13. - ./conftest
  14. - if [ $? -eq 0 ] ; then
  15. - rm -f conftest conftest.c
  16. - cc="$CC"
  17. - return 0
  18. - else
  19. - echo "could not build working executables"
  20. - echo "Please ensure your C compiler is a native compiler"
  21. - exit 1
  22. - fi
  23. - else
  24. - rm -f conftest conftest.c
  25. - fi
  26. - fi
  27. -
  28. - for compiler in cc clang pcc xlc gcc ; do
  29. -cat << EOF > conftest.c
  30. -int main(void){return 0;}
  31. -EOF
  32. -
  33. - $compiler -o conftest conftest.c > /dev/null 2>&1
  34. -
  35. - if [ $? -eq 0 ] ; then
  36. - ./conftest
  37. - if [ $? -eq 0 ] ; then
  38. - rm -f conftest conftest.c
  39. - cc="$compiler"
  40. - return 0
  41. - else
  42. - echo "could not build working executables"
  43. - echo "Please ensure your C compiler is a native compiler"
  44. - exit 1
  45. - fi
  46. - else
  47. - rm -f conftest conftest.c
  48. - fi
  49. - done
  50. - return 1
  51. -}
  52. -
  53. -defaultcflagscheck() {
  54. - cat << EOF > conftest.c
  55. -int main(void){return 0;}
  56. -EOF
  57. - $cc $cflags -g -O2 -o conftest.o -c conftest.c > /dev/null 2>&1
  58. - if [ $? -eq 0 ] ; then
  59. - rm -f conftest conftest.o conftest.c
  60. - return 1
  61. - else
  62. - rm -f conftest conftest.o conftest.c
  63. - return 0
  64. - fi
  65. -}
  66. +cc="$CC"
  67. fparselncheck() {
  68. cat << EOF > conftest.c
  69. @@ -229,20 +170,6 @@
  70. fi
  71. }
  72. -wflagcheck() {
  73. - cat << EOF > conftest.c
  74. -int main(void){return 0;}
  75. -EOF
  76. - $cc $cflags -w -o conftest conftest.c > /dev/null 2>&1
  77. - if [ $? -eq 0 ] ; then
  78. - rm -f conftest conftest.o conftest.c
  79. - return 1
  80. - else
  81. - rm -f conftest conftest.o conftest.c
  82. - return 0
  83. - fi
  84. -}
  85. -
  86. # Option variables
  87. if [ ! -z "$PREFIX" ] ; then
  88. prefix="$PREFIX"
  89. @@ -327,79 +254,9 @@
  90. ldflags="${ldflags}-static"
  91. fi
  92. -printf "checking for C compiler... "
  93. -cccheck
  94. -if [ $? -ne 0 ] ; then
  95. - echo "not found"
  96. - echo "Please install a C compiler and re-run configure."
  97. - exit 1
  98. -else
  99. - echo "$cc"
  100. -fi
  101. -
  102. -if [ "x$cflags" = "x-DREGEX" ] ; then
  103. - printf "checking if the compiler accepts -g -O2... "
  104. - defaultcflagscheck
  105. - if [ $? -eq 0 ] ; then
  106. - echo "no"
  107. - else
  108. - cflags="-g -O2 $cflags"
  109. - echo "yes"
  110. - fi
  111. -fi
  112. -
  113. -printf "checking for -w compiler flag... "
  114. -wflagcheck
  115. -if [ $? -eq 0 ] ; then
  116. - echo "no"
  117. -else
  118. - cflags="$cflags -w"
  119. - echo "yes"
  120. -fi
  121. -
  122. -printf "checking for OS... "
  123. -
  124. -if [ $terminfo -eq 0 ] ; then
  125. - libs="-lncursesw"
  126. -else
  127. - libs=""
  128. -fi
  129. -
  130. -os=`uname -s`
  131. -echo "$os"
  132. -
  133. -case "x$os" in
  134. - "xLinux"|"xCYGWIN"*)
  135. - cflags="$cflags -D_GNU_SOURCE -D__dead=\"__attribute__((__noreturn__))\" -Dst_mtimespec=st_mtim"
  136. - ;;
  137. - "xDarwin")
  138. - cflags="$cflags -DMSG_NOSIGNAL=SO_NOSIGPIPE -DLOGIN_NAME_MAX=MAXLOGNAME"
  139. - if [ $terminfo -eq 0 ] ; then
  140. - libs="-lncurses -lutil"
  141. - else
  142. - libs="-lutil"
  143. - fi
  144. - ;;
  145. - "xFreeBSD")
  146. - cflags="$cflags -D__dead=__dead2 -DLOGIN_NAME_MAX=MAXLOGNAME"
  147. - libs="$libs -lutil"
  148. - ;;
  149. - "xOpenBSD")
  150. - libs="$libs -lutil"
  151. - ;;
  152. - "xNetBSD")
  153. - cflags="$cflags -D_OPENBSD_SOURCE"
  154. - if [ $terminfo -eq 0 ] ; then
  155. - libs="-lcurses -lutil"
  156. - else
  157. - libs="-lutil"
  158. - fi
  159. - ;;
  160. - "xDragonFly")
  161. - cflags="$cflags -D__dead=__dead2 -DLOGIN_NAME_MAX=MAXLOGNAME"
  162. - libs="$libs -lutil"
  163. - ;;
  164. -esac
  165. +# OpenWrt
  166. +libs='-lncurses -lpcreposix'
  167. +cflags="$cflags -D_GNU_SOURCE -D__dead=\"__attribute__((__noreturn__))\" -Dst_mtimespec=st_mtim"
  168. cat << EOF > config.h
  169. /* This file generated automatically by configure. */