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
5 Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
6 [Ricardo: rebase on top of 4.3.1]
7 Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
9 configure.ac | 23 +++++++++++++++++++----
10 1 file changed, 19 insertions(+), 4 deletions(-)
12 diff --git a/configure.ac b/configure.ac
13 index c4b7cd4..9cf7cee 100644
16 @@ -85,7 +85,7 @@ AC_ARG_ENABLE(socket-dir,
18 dnl **** special unix variants ****
20 -if test -n "$ISC"; then
21 +if test "$cross_compiling" = no && test -n "$ISC" ; then
22 AC_DEFINE(ISC) LIBS="$LIBS -linet"
25 @@ -96,10 +96,11 @@ dnl AC_DEFINE(OSF1) # this disables MIPS again....
29 -if test -f /sysV68 ; then
30 +if test "$cross_compiling" = no && test -f /sysV68 ; then
34 +if test "$cross_compiling" = no ; then
36 if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then
38 @@ -123,6 +124,7 @@ AC_DEFINE(USE_WAIT2) LIBS="$LIBS -lbsd" ; CC="$CC -I/usr/include/bsd"
45 AC_CHECKING(for Ultrix)
46 @@ -132,7 +134,7 @@ AC_EGREP_CPP(yes,
50 -if test -f /usr/lib/libpyr.a ; then
51 +if test "$cross_compiling" = no && test -f /usr/lib/libpyr.a ; then
54 AC_CHECKING(Pyramid OSX)
55 @@ -679,17 +681,21 @@ AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
57 dnl **** PTY specific things ****
59 +if test "$cross_compiling" = no ; then
60 AC_CHECKING(for /dev/ptc)
61 if test -r /dev/ptc; then
62 AC_DEFINE(HAVE_DEV_PTC)
66 +if test "$cross_compiling" = no ; then
67 AC_CHECKING(for SVR4 ptys)
69 if test -c /dev/ptmx ; then
70 AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
77 @@ -699,6 +705,7 @@ AC_CHECK_FUNCS(openpty,,
78 [AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])])
81 +if test "$cross_compiling" = no ; then
82 AC_CHECKING(for ptyranges)
83 if test -d /dev/ptym ; then
85 @@ -722,6 +729,7 @@ p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\
86 AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
87 AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
91 dnl **** pty mode/group handling ****
93 @@ -869,14 +877,16 @@ fi
97 +if test "$cross_compiling" = no ; then
98 AC_CHECKING(for libutil(s))
99 test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
100 test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
103 AC_CHECKING(getloadavg)
104 AC_TRY_LINK(,[getloadavg((double *)0, 0);],
105 AC_DEFINE(LOADAV_GETLOADAVG) load=1,
106 -if test -f /usr/lib/libkvm.a ; then
107 +if test "$cross_compiling" = no && test -f /usr/lib/libkvm.a ; then
110 AC_CHECKING(getloadavg with -lkvm)
111 @@ -1094,13 +1104,18 @@ dnl **** libraries ****
114 AC_CHECKING(for crypt and sec libraries)
115 +if test "$cross_compiling" = no ; then
116 test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d"
121 AC_TRY_LINK(,,,LIBS="$oldlibs")
122 +if test "$cross_compiling" = no ; then
123 test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec"
124 test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow"
129 AC_CHECKING(IRIX sun library)