Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | From d0b20e4cacc60ad62a2150ce07388cb5a25c2040 Mon Sep 17 00:00:00 2001 |
| 2 | From: Jussi Kukkonen <jussi.kukkonen@intel.com> |
| 3 | Date: Fri, 7 Aug 2015 11:09:01 +0300 |
| 4 | Subject: [PATCH 3/4] Skip host file system checks when cross-compiling |
| 5 | |
| 6 | Modified from patch by Maarten ter Huurne. |
| 7 | |
| 8 | Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223] |
| 9 | |
| 10 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> |
| 11 | --- |
| 12 | configure.ac | 23 +++++++++++++++++++---- |
| 13 | 1 file changed, 19 insertions(+), 4 deletions(-) |
| 14 | |
| 15 | diff --git a/configure.ac b/configure.ac |
| 16 | index ce89f56..dc928ae 100644 |
| 17 | --- a/configure.ac |
| 18 | +++ b/configure.ac |
| 19 | @@ -85,7 +85,7 @@ AC_ARG_ENABLE(socket-dir, |
| 20 | dnl |
| 21 | dnl **** special unix variants **** |
| 22 | dnl |
| 23 | -if test -n "$ISC"; then |
| 24 | +if test "$cross_compiling" = no && test -n "$ISC" ; then |
| 25 | AC_DEFINE(ISC) LIBS="$LIBS -linet" |
| 26 | fi |
| 27 | |
| 28 | @@ -96,10 +96,11 @@ dnl AC_DEFINE(OSF1) # this disables MIPS again.... |
| 29 | dnl fi |
| 30 | dnl fi |
| 31 | |
| 32 | -if test -f /sysV68 ; then |
| 33 | +if test "$cross_compiling" = no && test -f /sysV68 ; then |
| 34 | AC_DEFINE(sysV68) |
| 35 | fi |
| 36 | |
| 37 | +if test "$cross_compiling" = no ; then |
| 38 | AC_CHECKING(for MIPS) |
| 39 | if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then |
| 40 | oldlibs="$LIBS" |
| 41 | @@ -123,6 +124,7 @@ AC_DEFINE(USE_WAIT2) LIBS="$LIBS -lbsd" ; CC="$CC -I/usr/include/bsd" |
| 42 | )) |
| 43 | fi |
| 44 | fi |
| 45 | +fi |
| 46 | |
| 47 | |
| 48 | AC_CHECKING(for Ultrix) |
| 49 | @@ -132,7 +134,7 @@ AC_EGREP_CPP(yes, |
| 50 | #endif |
| 51 | ], ULTRIX=1) |
| 52 | |
| 53 | -if test -f /usr/lib/libpyr.a ; then |
| 54 | +if test "$cross_compiling" = no && test -f /usr/lib/libpyr.a ; then |
| 55 | oldlibs="$LIBS" |
| 56 | LIBS="$LIBS -lpyr" |
| 57 | AC_CHECKING(Pyramid OSX) |
| 58 | @@ -679,17 +681,21 @@ AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED)) |
| 59 | dnl |
| 60 | dnl **** PTY specific things **** |
| 61 | dnl |
| 62 | +if test "$cross_compiling" = no ; then |
| 63 | AC_CHECKING(for /dev/ptc) |
| 64 | if test -r /dev/ptc; then |
| 65 | AC_DEFINE(HAVE_DEV_PTC) |
| 66 | fi |
| 67 | +fi |
| 68 | |
| 69 | +if test "$cross_compiling" = no ; then |
| 70 | AC_CHECKING(for SVR4 ptys) |
| 71 | sysvr4ptys= |
| 72 | if test -c /dev/ptmx ; then |
| 73 | AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS) |
| 74 | sysvr4ptys=1]) |
| 75 | fi |
| 76 | +fi |
| 77 | |
| 78 | AC_CHECK_FUNCS(getpt) |
| 79 | |
| 80 | @@ -699,6 +705,7 @@ AC_CHECK_FUNCS(openpty,, |
| 81 | [AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])]) |
| 82 | fi |
| 83 | |
| 84 | +if test "$cross_compiling" = no ; then |
| 85 | AC_CHECKING(for ptyranges) |
| 86 | if test -d /dev/ptym ; then |
| 87 | pdir='/dev/ptym' |
| 88 | @@ -722,6 +729,7 @@ p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\ |
| 89 | AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0") |
| 90 | AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1") |
| 91 | fi |
| 92 | +fi |
| 93 | |
| 94 | dnl **** pty mode/group handling **** |
| 95 | dnl |
| 96 | @@ -869,14 +877,16 @@ fi |
| 97 | dnl |
| 98 | dnl **** loadav **** |
| 99 | dnl |
| 100 | +if test "$cross_compiling" = no ; then |
| 101 | AC_CHECKING(for libutil(s)) |
| 102 | test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils" |
| 103 | test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil" |
| 104 | +fi |
| 105 | |
| 106 | AC_CHECKING(getloadavg) |
| 107 | AC_TRY_LINK(,[getloadavg((double *)0, 0);], |
| 108 | AC_DEFINE(LOADAV_GETLOADAVG) load=1, |
| 109 | -if test -f /usr/lib/libkvm.a ; then |
| 110 | +if test "$cross_compiling" = no && test -f /usr/lib/libkvm.a ; then |
| 111 | olibs="$LIBS" |
| 112 | LIBS="$LIBS -lkvm" |
| 113 | AC_CHECKING(getloadavg with -lkvm) |
| 114 | @@ -1094,13 +1104,18 @@ dnl **** libraries **** |
| 115 | dnl |
| 116 | |
| 117 | AC_CHECKING(for crypt and sec libraries) |
| 118 | +if test "$cross_compiling" = no ; then |
| 119 | test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d" |
| 120 | +fi |
| 121 | oldlibs="$LIBS" |
| 122 | LIBS="$LIBS -lcrypt" |
| 123 | AC_CHECKING(crypt) |
| 124 | AC_TRY_LINK(,,,LIBS="$oldlibs") |
| 125 | +if test "$cross_compiling" = no ; then |
| 126 | test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec" |
| 127 | test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow" |
| 128 | +fi |
| 129 | + |
| 130 | oldlibs="$LIBS" |
| 131 | LIBS="$LIBS -lsun" |
| 132 | AC_CHECKING(IRIX sun library) |
| 133 | -- |
| 134 | 2.1.4 |
| 135 | |