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>
7 configure.in | 23 +++++++++++++++++++----
8 1 file changed, 19 insertions(+), 4 deletions(-)
10 diff --git a/configure.in b/configure.in
11 index d53a079..79aa56d 100644
14 @@ -84,7 +84,7 @@ AC_ARG_ENABLE(socket-dir,
16 dnl **** special unix variants ****
18 -if test -n "$ISC"; then
19 +if test "$cross_compiling" = no && test -n "$ISC" ; then
20 AC_DEFINE(ISC) LIBS="$LIBS -linet"
23 @@ -95,10 +95,11 @@ dnl AC_DEFINE(OSF1) # this disables MIPS again....
27 -if test -f /sysV68 ; then
28 +if test "$cross_compiling" = no && test -f /sysV68 ; then
32 +if test "$cross_compiling" = no ; then
34 if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then
36 @@ -122,6 +123,7 @@ AC_DEFINE(USE_WAIT2) LIBS="$LIBS -lbsd" ; CC="$CC -I/usr/include/bsd"
43 AC_CHECKING(for Ultrix)
44 @@ -131,7 +133,7 @@ AC_EGREP_CPP(yes,
48 -if test -f /usr/lib/libpyr.a ; then
49 +if test "$cross_compiling" = no && test -f /usr/lib/libpyr.a ; then
52 AC_CHECKING(Pyramid OSX)
53 @@ -678,17 +680,21 @@ AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
55 dnl **** PTY specific things ****
57 +if test "$cross_compiling" = no ; then
58 AC_CHECKING(for /dev/ptc)
59 if test -r /dev/ptc; then
60 AC_DEFINE(HAVE_DEV_PTC)
64 +if test "$cross_compiling" = no ; then
65 AC_CHECKING(for SVR4 ptys)
67 if test -c /dev/ptmx ; then
68 AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
75 @@ -698,6 +704,7 @@ AC_CHECK_FUNCS(openpty,,
76 [AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])])
79 +if test "$cross_compiling" = no ; then
80 AC_CHECKING(for ptyranges)
81 if test -d /dev/ptym ; then
83 @@ -721,6 +728,7 @@ p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\
84 AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
85 AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
89 dnl **** pty mode/group handling ****
91 @@ -868,14 +876,16 @@ fi
95 +if test "$cross_compiling" = no ; then
96 AC_CHECKING(for libutil(s))
97 test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
98 test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
101 AC_CHECKING(getloadavg)
102 AC_TRY_LINK(,[getloadavg((double *)0, 0);],
103 AC_DEFINE(LOADAV_GETLOADAVG) load=1,
104 -if test -f /usr/lib/libkvm.a ; then
105 +if test "$cross_compiling" = no && test -f /usr/lib/libkvm.a ; then
108 AC_CHECKING(getloadavg with -lkvm)
109 @@ -1093,13 +1103,18 @@ dnl **** libraries ****
112 AC_CHECKING(for crypt and sec libraries)
113 +if test "$cross_compiling" = no ; then
114 test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d"
119 AC_TRY_LINK(,,,LIBS="$oldlibs")
120 +if test "$cross_compiling" = no ; then
121 test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec"
122 test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow"
127 AC_CHECKING(IRIX sun library)