0004-cross-compilation-ignore-host-fs.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. From: Maarten ter Huurne <maarten@treewalker.org>
  2. Date: Sun, 14 Sep 2014 07:10:59 +0200
  3. Subject: When cross-compiling, skip checks that look in the host file system
  4. Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
  5. [Ricardo: rebase on top of 4.3.1]
  6. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
  7. ---
  8. configure.ac | 23 +++++++++++++++++++----
  9. 1 file changed, 19 insertions(+), 4 deletions(-)
  10. diff --git a/configure.ac b/configure.ac
  11. index c4b7cd4..9cf7cee 100644
  12. --- a/configure.ac
  13. +++ b/configure.ac
  14. @@ -85,7 +85,7 @@ AC_ARG_ENABLE(socket-dir,
  15. dnl
  16. dnl **** special unix variants ****
  17. dnl
  18. -if test -n "$ISC"; then
  19. +if test "$cross_compiling" = no && test -n "$ISC" ; then
  20. AC_DEFINE(ISC) LIBS="$LIBS -linet"
  21. fi
  22. @@ -96,10 +96,11 @@ dnl AC_DEFINE(OSF1) # this disables MIPS again....
  23. dnl fi
  24. dnl fi
  25. -if test -f /sysV68 ; then
  26. +if test "$cross_compiling" = no && test -f /sysV68 ; then
  27. AC_DEFINE(sysV68)
  28. fi
  29. +if test "$cross_compiling" = no ; then
  30. AC_CHECKING(for MIPS)
  31. if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then
  32. oldlibs="$LIBS"
  33. @@ -123,6 +124,7 @@ AC_DEFINE(USE_WAIT2) LIBS="$LIBS -lbsd" ; CC="$CC -I/usr/include/bsd"
  34. ))
  35. fi
  36. fi
  37. +fi
  38. AC_CHECKING(for Ultrix)
  39. @@ -132,7 +134,7 @@ AC_EGREP_CPP(yes,
  40. #endif
  41. ], ULTRIX=1)
  42. -if test -f /usr/lib/libpyr.a ; then
  43. +if test "$cross_compiling" = no && test -f /usr/lib/libpyr.a ; then
  44. oldlibs="$LIBS"
  45. LIBS="$LIBS -lpyr"
  46. AC_CHECKING(Pyramid OSX)
  47. @@ -679,17 +681,21 @@ AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
  48. dnl
  49. dnl **** PTY specific things ****
  50. dnl
  51. +if test "$cross_compiling" = no ; then
  52. AC_CHECKING(for /dev/ptc)
  53. if test -r /dev/ptc; then
  54. AC_DEFINE(HAVE_DEV_PTC)
  55. fi
  56. +fi
  57. +if test "$cross_compiling" = no ; then
  58. AC_CHECKING(for SVR4 ptys)
  59. sysvr4ptys=
  60. if test -c /dev/ptmx ; then
  61. AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
  62. sysvr4ptys=1])
  63. fi
  64. +fi
  65. AC_CHECK_FUNCS(getpt)
  66. @@ -699,6 +705,7 @@ AC_CHECK_FUNCS(openpty,,
  67. [AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])])
  68. fi
  69. +if test "$cross_compiling" = no ; then
  70. AC_CHECKING(for ptyranges)
  71. if test -d /dev/ptym ; then
  72. pdir='/dev/ptym'
  73. @@ -722,6 +729,7 @@ p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\
  74. AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
  75. AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
  76. fi
  77. +fi
  78. dnl **** pty mode/group handling ****
  79. dnl
  80. @@ -869,14 +877,16 @@ fi
  81. dnl
  82. dnl **** loadav ****
  83. dnl
  84. +if test "$cross_compiling" = no ; then
  85. AC_CHECKING(for libutil(s))
  86. test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
  87. test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
  88. +fi
  89. AC_CHECKING(getloadavg)
  90. AC_TRY_LINK(,[getloadavg((double *)0, 0);],
  91. AC_DEFINE(LOADAV_GETLOADAVG) load=1,
  92. -if test -f /usr/lib/libkvm.a ; then
  93. +if test "$cross_compiling" = no && test -f /usr/lib/libkvm.a ; then
  94. olibs="$LIBS"
  95. LIBS="$LIBS -lkvm"
  96. AC_CHECKING(getloadavg with -lkvm)
  97. @@ -1094,13 +1104,18 @@ dnl **** libraries ****
  98. dnl
  99. AC_CHECKING(for crypt and sec libraries)
  100. +if test "$cross_compiling" = no ; then
  101. test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d"
  102. +fi
  103. oldlibs="$LIBS"
  104. LIBS="$LIBS -lcrypt"
  105. AC_CHECKING(crypt)
  106. AC_TRY_LINK(,,,LIBS="$oldlibs")
  107. +if test "$cross_compiling" = no ; then
  108. test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec"
  109. test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow"
  110. +fi
  111. +
  112. oldlibs="$LIBS"
  113. LIBS="$LIBS -lsun"
  114. AC_CHECKING(IRIX sun library)
  115. --
  116. 1.8.4.5