0003-cross-compilation-AC_TRY_RUN.patch 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. From: Maarten ter Huurne <maarten@treewalker.org>
  2. Date: Sat, 13 Sep 2014 12:04:41 +0200
  3. Subject: Provide cross compilation alternatives for all AC_TRY_RUN uses
  4. Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
  5. [Ricardo: rebase on top of 4.3.1]
  6. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
  7. ---
  8. configure.ac | 30 +++++++++++++++++++-----------
  9. 1 file changed, 19 insertions(+), 11 deletions(-)
  10. diff --git a/configure.ac b/configure.ac
  11. index b8e3bec..c4b7cd4 100644
  12. --- a/configure.ac
  13. +++ b/configure.ac
  14. @@ -348,7 +348,8 @@ main()
  15. exit(0);
  16. }
  17. ], AC_NOTE(- your fifos are usable) fifo=1,
  18. -AC_NOTE(- your fifos are not usable))
  19. +AC_NOTE(- your fifos are not usable),
  20. +AC_NOTE(- skipping check because we are cross compiling; assuming fifos are usable) fifo=1)
  21. rm -f /tmp/conftest*
  22. if test -n "$fifo"; then
  23. @@ -396,7 +397,8 @@ main()
  24. exit(0);
  25. }
  26. ], AC_NOTE(- your implementation is ok),
  27. -AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1)
  28. +AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1,
  29. +AC_NOTE(- skipping check because we are cross compiling; assuming fifo implementation is ok))
  30. rm -f /tmp/conftest*
  31. fi
  32. @@ -458,7 +460,8 @@ main()
  33. exit(0);
  34. }
  35. ], AC_NOTE(- your sockets are usable) sock=1,
  36. -AC_NOTE(- your sockets are not usable))
  37. +AC_NOTE(- your sockets are not usable),
  38. +AC_NOTE(- skipping check because we are cross compiling; assuming sockets are usable) sock=1)
  39. rm -f /tmp/conftest*
  40. if test -n "$sock"; then
  41. @@ -497,7 +500,8 @@ main()
  42. }
  43. ],AC_NOTE(- you are normal),
  44. AC_NOTE(- unix domain sockets are not kept in the filesystem)
  45. -AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1)
  46. +AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1,
  47. +AC_NOTE(- skipping check because we are cross compiling; assuming sockets are normal))
  48. rm -f /tmp/conftest*
  49. fi
  50. @@ -624,7 +628,8 @@ main()
  51. exit(0);
  52. }
  53. ],AC_NOTE(- select is ok),
  54. -AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
  55. +AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN),
  56. +AC_NOTE(- skipping check because we are cross compiling; assuming select is ok))
  57. dnl
  58. dnl **** termcap or terminfo ****
  59. @@ -666,7 +671,8 @@ main()
  60. {
  61. exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
  62. }], AC_NOTE(- you use the termcap database),
  63. -AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO))
  64. +AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO),
  65. +AC_NOTE(- skipping check because we are cross compiling; assuming terminfo database is used) AC_DEFINE(TERMINFO))
  66. AC_CHECKING(ospeed)
  67. AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
  68. @@ -801,7 +807,8 @@ main()
  69. else
  70. AC_NOTE(- can't determine - assume ptys are world accessable)
  71. fi
  72. - ]
  73. + ],
  74. + AC_NOTE(- skipping check because we are cross compiling; assuming ptys are world accessable)
  75. )
  76. rm -f conftest_grp
  77. fi
  78. @@ -885,7 +892,7 @@ AC_EGREP_CPP(yes,
  79. #endif
  80. ], load=1)
  81. fi
  82. -if test -z "$load" ; then
  83. +if test -z "$load" && test "$cross_compiling" = no ; then
  84. AC_CHECKING(for kernelfile)
  85. for core in /unix /vmunix /dynix /hp-ux /xelos /dev/ksyms /kernel/unix /kernel/genunix /unicos /mach /netbsd /386bsd /dgux /bsd /stand/vmunix; do
  86. if test -f $core || test -c $core; then
  87. @@ -1078,7 +1085,7 @@ main()
  88. #endif
  89. exit(0);
  90. }
  91. -],,AC_DEFINE(SYSVSIGS))
  92. +],,AC_DEFINE(SYSVSIGS),:)
  93. fi
  94. @@ -1158,7 +1165,7 @@ main() {
  95. if (strncmp(buf, "cdedef", 6))
  96. exit(1);
  97. exit(0); /* libc version works properly. */
  98. -}], AC_DEFINE(USEBCOPY))
  99. +}], AC_DEFINE(USEBCOPY),,:)
  100. AC_TRY_RUN([
  101. #define bcopy(s,d,l) memmove(d,s,l)
  102. @@ -1173,7 +1180,8 @@ main() {
  103. if (strncmp(buf, "cdedef", 6))
  104. exit(1);
  105. exit(0); /* libc version works properly. */
  106. -}], AC_DEFINE(USEMEMMOVE))
  107. +}], AC_DEFINE(USEMEMMOVE),,
  108. + AC_NOTE(- skipping check because we are cross compiling; use memmove) AC_DEFINE(USEMEMMOVE))
  109. AC_SYS_LONG_FILE_NAMES
  110. --
  111. 1.8.4.5