summaryrefslogtreecommitdiff
path: root/sys-apps/gawk/files/gawk-4.1.3-bsd_configure_readline.patch
blob: 3bd267efd179c63c0bd986c8110f02cc89f9eb95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
http://git.savannah.gnu.org/cgit/gawk.git/commit/?id=ac0ef52fe407b89c7968b927c7b2b513cc13963a

--- gawk-4.1.3/configure	2015-05-19 15:38:35.000000000 +0200
+++ gawk-4.1.3/configure	2015-05-19 15:38:35.000000000 +0200
@@ -10825,7 +10825,46 @@
 
         if test $_found_readline = yes ; then
 	   case $host_os in
-	   *bsd* )	_combo="$_combo -ltermcap"
+	   *bsd* )	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5
+$as_echo_n "checking for tgetent in -ltermcap... " >&6; }
+if ${ac_cv_lib_termcap_tgetent+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltermcap  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char tgetent ();
+int
+main ()
+{
+return tgetent ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_termcap_tgetent=yes
+else
+  ac_cv_lib_termcap_tgetent=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termcap_tgetent" >&5
+$as_echo "$ac_cv_lib_termcap_tgetent" >&6; }
+if test "x$ac_cv_lib_termcap_tgetent" = xyes; then :
+  _combo="$_combo -ltermcap"
+fi
+
 	  	 ;;
 	   esac
 
--- gawk-4.1.3/m4/readline.m4	2015-04-05 12:19:19.000000000 +0200
+++ gawk-4.1.3/m4/readline.m4	2015-04-05 12:19:19.000000000 +0200
@@ -92,7 +92,7 @@
 
         if test $_found_readline = yes ; then
 	   case $host_os in
-	   *bsd* )	_combo="$_combo -ltermcap"
+	   *bsd* )	AC_CHECK_LIB(termcap, tgetent, _combo="$_combo -ltermcap")
 	  	 ;;
 	   esac
            AC_DEFINE(HAVE_LIBREADLINE,1,