aeacfb1d9f428635f438b142d634609a61c650ec
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / screen / 0004-cross-compilation-ignore-host-fs.patch
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
5 Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
6 ---
7  configure.in | 23 +++++++++++++++++++----
8  1 file changed, 19 insertions(+), 4 deletions(-)
9
10 diff --git a/configure.in b/configure.in
11 index d53a079..79aa56d 100644
12 --- a/configure.in
13 +++ b/configure.in
14 @@ -84,7 +84,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  
23 @@ -95,10 +95,11 @@ dnl AC_DEFINE(OSF1) # this disables MIPS again....
24  dnl fi
25  dnl fi
26  
27 -if test -f /sysV68 ; then
28 +if test "$cross_compiling" = no && test -f /sysV68 ; then
29  AC_DEFINE(sysV68)
30  fi
31  
32 +if test "$cross_compiling" = no ; then
33  AC_CHECKING(for MIPS)
34  if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then
35  oldlibs="$LIBS"
36 @@ -122,6 +123,7 @@ AC_DEFINE(USE_WAIT2) LIBS="$LIBS -lbsd" ; CC="$CC -I/usr/include/bsd"
37  ))
38  fi
39  fi
40 +fi
41  
42  
43  AC_CHECKING(for Ultrix)
44 @@ -131,7 +133,7 @@ AC_EGREP_CPP(yes,
45  #endif
46  ], ULTRIX=1)
47  
48 -if test -f /usr/lib/libpyr.a ; then
49 +if test "$cross_compiling" = no && test -f /usr/lib/libpyr.a ; then
50  oldlibs="$LIBS"
51  LIBS="$LIBS -lpyr"
52  AC_CHECKING(Pyramid OSX)
53 @@ -678,17 +680,21 @@ AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
54  dnl
55  dnl    ****  PTY specific things  ****
56  dnl
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)
61  fi
62 +fi
63  
64 +if test "$cross_compiling" = no ; then
65  AC_CHECKING(for SVR4 ptys)
66  sysvr4ptys=
67  if test -c /dev/ptmx ; then
68  AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
69  sysvr4ptys=1])
70  fi
71 +fi
72  
73  AC_CHECK_FUNCS(getpt)
74  
75 @@ -698,6 +704,7 @@ AC_CHECK_FUNCS(openpty,,
76  [AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])])
77  fi
78  
79 +if test "$cross_compiling" = no ; then
80  AC_CHECKING(for ptyranges)
81  if test -d /dev/ptym ; then
82  pdir='/dev/ptym'
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")
86  fi
87 +fi
88  
89  dnl    ****  pty mode/group handling ****
90  dnl
91 @@ -868,14 +876,16 @@ fi
92  dnl
93  dnl    ****  loadav  ****
94  dnl
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"
99 +fi
100  
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
106  olibs="$LIBS"
107  LIBS="$LIBS -lkvm"
108  AC_CHECKING(getloadavg with -lkvm)
109 @@ -1093,13 +1103,18 @@ dnl    ****  libraries  ****
110  dnl
111  
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"
115 +fi
116  oldlibs="$LIBS"
117  LIBS="$LIBS -lcrypt"
118  AC_CHECKING(crypt)
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"
123 +fi
124 +
125  oldlibs="$LIBS"
126  LIBS="$LIBS -lsun"
127  AC_CHECKING(IRIX sun library)
128 -- 
129 1.8.4.5
130