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.

158 lines
3.4 KiB

  1. diff -urN a/configure b/configure
  2. --- a/configure 2018-09-28 01:38:31.000000000 +0900
  3. +++ b/configure 2019-05-22 15:17:05.722101952 +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. fgetlncheck() {
  55. cat << EOF > conftest.c
  56. @@ -162,18 +117,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. @@ -241,53 +197,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='-lncurses'
  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="$libs -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. - libs="$libs -lutil"
  126. - ;;
  127. - "xDragonFly")
  128. - cflags="$cflags -D__dead=__dead2 -DLOGIN_NAME_MAX=MAXLOGNAME"
  129. - libs="$libs -lutil"
  130. - ;;
  131. -esac
  132. +# OpenWrt
  133. +libs='-lncurses -lpcre'
  134. +cflags="$cflags -D_GNU_SOURCE -D__dead=\"__attribute__((__noreturn__))\" -Dst_mtimespec=st_mtim"
  135. cat << EOF > config.h
  136. /* This file generated automatically by configure. */
  137. @@ -370,6 +282,15 @@
  138. echo "no"
  139. fi
  140. +printf "checking for futimens... "
  141. +futimenscheck
  142. +if [ $? -eq 0 ] ; then
  143. + echo "#define HAVE_FUTIMENS" >> config.h
  144. + echo "yes"
  145. +else
  146. + echo "no"
  147. +fi
  148. +
  149. printf "creating Makefile... "
  150. cat << EOF > Makefile
  151. # This Makefile automatically generated by configure.