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.

153 lines
3.4 KiB

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