openwrt-packages/utils/screen/patches/040-PATCH-2-4-Provide-cross...

138 lines
4.1 KiB
Diff

From abba47ce4206506c49858d944e904fff86ae65cc Mon Sep 17 00:00:00 2001
From: Jussi Kukkonen <jussi.kukkonen@intel.com>
Date: Sat, 24 Feb 2018 15:14:48 +0100
Subject: [PATCH] [PATCH 2/4] Provide cross compile alternatives for AC_TRY_RUN
Modified from patch by Maarten ter Huurne.
Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
configure.ac | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/src/configure.ac b/src/configure.ac
index a8208ea..74be368 100644
--- a/configure.ac
+++ b/configure.ac
@@ -348,7 +348,8 @@ main()
exit(0);
}
], AC_NOTE(- your fifos are usable) fifo=1,
-AC_NOTE(- your fifos are not usable))
+AC_NOTE(- your fifos are not usable),
+AC_NOTE(- skipping check because we are cross compiling; assuming fifos are usable) fifo=1)
rm -f /tmp/conftest*
if test -n "$fifo"; then
@@ -396,7 +397,8 @@ main()
exit(0);
}
], AC_NOTE(- your implementation is ok),
-AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1)
+AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1,
+AC_NOTE(- skipping check because we are cross compiling; assuming fifo implementation is ok))
rm -f /tmp/conftest*
fi
@@ -458,7 +460,8 @@ main()
exit(0);
}
], AC_NOTE(- your sockets are usable) sock=1,
-AC_NOTE(- your sockets are not usable))
+AC_NOTE(- your sockets are not usable),
+AC_NOTE(- skipping check because we are cross compiling; assuming sockets are usable) sock=1)
rm -f /tmp/conftest*
if test -n "$sock"; then
@@ -497,7 +500,8 @@ main()
}
],AC_NOTE(- you are normal),
AC_NOTE(- unix domain sockets are not kept in the filesystem)
-AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1)
+AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1,
+AC_NOTE(- skipping check because we are cross compiling; assuming sockets are normal))
rm -f /tmp/conftest*
fi
@@ -598,7 +602,8 @@ main()
exit(0);
}
],AC_NOTE(- select is ok),
-AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
+AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN),
+AC_NOTE(- skipping check because we are cross compiling; assuming select is ok))
dnl
dnl **** termcap or terminfo ****
@@ -640,7 +645,8 @@ main()
{
exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
}], AC_NOTE(- you use the termcap database),
-AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO))
+AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO),
+AC_NOTE(- skipping check because we are cross compiling; assuming terminfo database is used) AC_DEFINE(TERMINFO))
AC_CHECKING(ospeed)
AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
@@ -775,7 +781,8 @@ main()
else
AC_NOTE(- can't determine - assume ptys are world accessable)
fi
- ]
+ ],
+ AC_NOTE(- skipping check because we are cross compiling; assuming ptys are world accessable)
)
rm -f conftest_grp
fi
@@ -859,7 +866,7 @@ AC_EGREP_CPP(YES_IS_DEFINED,
#endif
], load=1)
fi
-if test -z "$load" ; then
+if test -z "$load" && test "$cross_compiling" = no ; then
AC_CHECKING(for kernelfile)
for core in /unix /vmunix /dynix /hp-ux /xelos /dev/ksyms /kernel/unix /kernel/genunix /unicos /mach /netbsd /386bsd /dgux /bsd /stand/vmunix; do
if test -f $core || test -c $core; then
@@ -1052,7 +1059,7 @@ main()
#endif
exit(0);
}
-],,AC_DEFINE(SYSVSIGS))
+],,AC_DEFINE(SYSVSIGS),:)
fi
@@ -1132,7 +1139,7 @@ main() {
if (strncmp(buf, "cdedef", 6))
exit(1);
exit(0); /* libc version works properly. */
-}], AC_DEFINE(USEBCOPY))
+}], AC_DEFINE(USEBCOPY),,:)
AC_TRY_RUN([
#define bcopy(s,d,l) memmove(d,s,l)
@@ -1147,7 +1154,8 @@ main() {
if (strncmp(buf, "cdedef", 6))
exit(1);
exit(0); /* libc version works properly. */
-}], AC_DEFINE(USEMEMMOVE))
+}], AC_DEFINE(USEMEMMOVE),,
+ AC_NOTE(- skipping check because we are cross compiling; use memmove) AC_DEFINE(USEMEMMOVE))
AC_TRY_RUN([
@@ -1163,7 +1171,7 @@ main() {
if (strncmp(buf, "cdedef", 6))
exit(1);
exit(0); /* libc version works properly. */
-}], AC_DEFINE(USEMEMCPY))
+}], AC_DEFINE(USEMEMCPY),,:)
AC_SYS_LONG_FILE_NAMES
--
2.17.1