ncurses_tinfo.patch 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. diff -u tlf-1.2.4.5/macros/ax_with_curses.m4 tlf/macros/ax_with_curses.m4
  2. --- tlf-1.2.4.5/macros/ax_with_curses.m4 2016-11-19 10:22:20.000000000 +0100
  3. +++ tlf/macros/ax_with_curses.m4 2016-12-13 08:03:02.855327396 +0100
  4. @@ -12,7 +12,9 @@
  5. # present, along with the associated header file. The NcursesW
  6. # (wide-character) library is searched for first, followed by Ncurses,
  7. # then the system-default plain Curses. The first library found is the
  8. -# one returned.
  9. +# one returned. Finding libraries will first be attempted by using
  10. +# pkg-config, and should the pkg-config files not be available, will
  11. +# fallback to combinations of known flags itself.
  12. #
  13. # The following options are understood: --with-ncursesw, --with-ncurses,
  14. # --without-ncursesw, --without-ncurses. The "--with" options force the
  15. @@ -52,23 +54,29 @@
  16. #
  17. # (These preprocessor symbols are discussed later in this document.)
  18. #
  19. -# The following output variable is defined by this macro; it is precious
  20. -# and may be overridden on the ./configure command line:
  21. +# The following output variables are defined by this macro; they are
  22. +# precious and may be overridden on the ./configure command line:
  23. #
  24. -# CURSES_LIB - library to add to xxx_LDADD
  25. +# CURSES_LIBS - library to add to xxx_LDADD
  26. +# CURSES_CFLAGS - include paths to add to xxx_CPPFLAGS
  27. #
  28. -# The library listed in CURSES_LIB is NOT added to LIBS by default. You
  29. -# need to add CURSES_LIB to the appropriate xxx_LDADD line in your
  30. -# Makefile.am. For example:
  31. -#
  32. -# prog_LDADD = @CURSES_LIB@
  33. -#
  34. -# If CURSES_LIB is set on the configure command line (such as by running
  35. -# "./configure CURSES_LIB=-lmycurses"), then the only header searched for
  36. -# is <curses.h>. The user may use the CPPFLAGS precious variable to
  37. -# override the standard #include search path. If the user needs to
  38. -# specify an alternative path for a library (such as for a non-standard
  39. -# NcurseW), the user should use the LDFLAGS variable.
  40. +# In previous versions of this macro, the flags CURSES_LIB and
  41. +# CURSES_CPPFLAGS were defined. These have been renamed, in keeping with
  42. +# AX_WITH_CURSES's close bigger brother, PKG_CHECK_MODULES, which should
  43. +# eventually supersede the use of AX_WITH_CURSES. Neither the library
  44. +# listed in CURSES_LIBS, nor the flags in CURSES_CFLAGS are added to LIBS,
  45. +# respectively CPPFLAGS, by default. You need to add both to the
  46. +# appropriate xxx_LDADD/xxx_CPPFLAGS line in your Makefile.am. For
  47. +# example:
  48. +#
  49. +# prog_LDADD = @CURSES_LIBS@
  50. +# prog_CPPFLAGS = @CURSES_CFLAGS@
  51. +#
  52. +# If CURSES_LIBS is set on the configure command line (such as by running
  53. +# "./configure CURSES_LIBS=-lmycurses"), then the only header searched for
  54. +# is <curses.h>. If the user needs to specify an alternative path for a
  55. +# library (such as for a non-standard NcurseW), the user should use the
  56. +# LDFLAGS variable.
  57. #
  58. # The following shell variables may be defined by this macro:
  59. #
  60. @@ -182,11 +190,66 @@
  61. # modified version of the Autoconf Macro, you may extend this special
  62. # exception to the GPL to apply to your modified version as well.
  63. -#serial 15
  64. +#serial 17
  65. +
  66. +# internal function to factorize common code that is used by both ncurses
  67. +# and ncursesw
  68. +AC_DEFUN([_FIND_CURSES_FLAGS], [
  69. + AC_MSG_CHECKING([for $1 via pkg-config])
  70. +
  71. + AX_REQUIRE_DEFINED([PKG_CHECK_EXISTS])
  72. + _PKG_CONFIG([_ax_cv_$1_libs], [libs], [$1])
  73. + _PKG_CONFIG([_ax_cv_$1_cppflags], [cflags], [$1])
  74. +
  75. + AS_IF([test "x$pkg_failed" = "xyes" || test "x$pkg_failed" = "xuntried"],[
  76. + AC_MSG_RESULT([no])
  77. + # No suitable .pc file found, have to find flags via fallback
  78. + AC_CACHE_CHECK([for $1 via fallback], [ax_cv_$1], [
  79. + AS_ECHO()
  80. + pkg_cv__ax_cv_$1_libs="-l$1"
  81. + pkg_cv__ax_cv_$1_cppflags="-D_GNU_SOURCE $CURSES_CFLAGS"
  82. + LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs"
  83. + CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags"
  84. +
  85. + AC_MSG_CHECKING([for initscr() with $pkg_cv__ax_cv_$1_libs])
  86. + AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
  87. + [
  88. + AC_MSG_RESULT([yes])
  89. + AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_libs])
  90. + AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[
  91. + ax_cv_$1=yes
  92. + ],[
  93. + AC_MSG_RESULT([no])
  94. + m4_if(
  95. + [$1],[ncursesw],[pkg_cv__ax_cv_$1_libs="$pkg_cv__ax_cv_$1_libs -ltinfow"],
  96. + [$1],[ncurses],[pkg_cv__ax_cv_$1_libs="$pkg_cv__ax_cv_$1_libs -ltinfo"]
  97. + )
  98. + LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs"
  99. +
  100. + AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_libs])
  101. + AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[
  102. + ax_cv_$1=yes
  103. + ],[
  104. + ax_cv_$1=no
  105. + ])
  106. + ])
  107. + ],[
  108. + ax_cv_$1=no
  109. + ])
  110. + ])
  111. + ],[
  112. + AC_MSG_RESULT([yes])
  113. + # Found .pc file, using its information
  114. + LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs"
  115. + CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags"
  116. + ax_cv_$1=yes
  117. + ])
  118. +])
  119. AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES])
  120. AC_DEFUN([AX_WITH_CURSES], [
  121. - AC_ARG_VAR([CURSES_LIB], [linker library for Curses, e.g. -lcurses])
  122. + AC_ARG_VAR([CURSES_LIBS], [linker library for Curses, e.g. -lcurses])
  123. + AC_ARG_VAR([CURSES_CFLAGS], [preprocessor flags for Curses, e.g. -I/usr/include/ncursesw])
  124. AC_ARG_WITH([ncurses], [AS_HELP_STRING([--with-ncurses],
  125. [force the use of Ncurses or NcursesW])],
  126. [], [with_ncurses=check])
  127. @@ -195,20 +258,17 @@
  128. [], [with_ncursesw=check])
  129. ax_saved_LIBS=$LIBS
  130. + ax_saved_CPPFLAGS=$CPPFLAGS
  131. +
  132. AS_IF([test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes],
  133. [ax_with_plaincurses=no], [ax_with_plaincurses=check])
  134. ax_cv_curses_which=no
  135. # Test for NcursesW
  136. + AS_IF([test "x$CURSES_LIBS" = x && test "x$with_ncursesw" != xno], [
  137. + _FIND_CURSES_FLAGS([ncursesw])
  138. - AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncursesw" != xno], [
  139. - LIBS="$ax_saved_LIBS -lncursesw"
  140. -
  141. - AC_CACHE_CHECK([for NcursesW wide-character library], [ax_cv_ncursesw], [
  142. - AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
  143. - [ax_cv_ncursesw=yes], [ax_cv_ncursesw=no])
  144. - ])
  145. AS_IF([test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes], [
  146. AC_MSG_ERROR([--with-ncursesw specified but could not find NcursesW library])
  147. ])
  148. @@ -216,7 +276,8 @@
  149. AS_IF([test "x$ax_cv_ncursesw" = xyes], [
  150. ax_cv_curses=yes
  151. ax_cv_curses_which=ncursesw
  152. - CURSES_LIB="-lncursesw"
  153. + CURSES_LIBS="$pkg_cv__ax_cv_ncursesw_libs"
  154. + CURSES_CFLAGS="$pkg_cv__ax_cv_ncursesw_cppflags"
  155. AC_DEFINE([HAVE_NCURSESW], [1], [Define to 1 if the NcursesW library is present])
  156. AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
  157. @@ -318,16 +379,13 @@
  158. ])
  159. ])
  160. ])
  161. + unset pkg_cv__ax_cv_ncursesw_libs
  162. + unset pkg_cv__ax_cv_ncursesw_cppflags
  163. # Test for Ncurses
  164. + AS_IF([test "x$CURSES_LIBS" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [
  165. + _FIND_CURSES_FLAGS([ncurses])
  166. - AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [
  167. - LIBS="$ax_saved_LIBS -lncurses"
  168. -
  169. - AC_CACHE_CHECK([for Ncurses library], [ax_cv_ncurses], [
  170. - AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
  171. - [ax_cv_ncurses=yes], [ax_cv_ncurses=no])
  172. - ])
  173. AS_IF([test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes], [
  174. AC_MSG_ERROR([--with-ncurses specified but could not find Ncurses library])
  175. ])
  176. @@ -335,7 +393,8 @@
  177. AS_IF([test "x$ax_cv_ncurses" = xyes], [
  178. ax_cv_curses=yes
  179. ax_cv_curses_which=ncurses
  180. - CURSES_LIB="-lncurses"
  181. + CURSES_LIBS="$pkg_cv__ax_cv_ncurses_libs"
  182. + CURSES_CFLAGS="$pkg_cv__ax_cv_ncurses_cppflags"
  183. AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if the Ncurses library is present])
  184. AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
  185. @@ -390,12 +449,13 @@
  186. ])
  187. ])
  188. ])
  189. + unset pkg_cv__ax_cv_ncurses_libs
  190. + unset pkg_cv__ax_cv_ncurses_cppflags
  191. - # Test for plain Curses (or if CURSES_LIB was set by user)
  192. -
  193. + # Test for plain Curses (or if CURSES_LIBS was set by user)
  194. AS_IF([test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno], [
  195. - AS_IF([test "x$CURSES_LIB" != x], [
  196. - LIBS="$ax_saved_LIBS $CURSES_LIB"
  197. + AS_IF([test "x$CURSES_LIBS" != x], [
  198. + LIBS="$ax_saved_LIBS $CURSES_LIBS"
  199. ], [
  200. LIBS="$ax_saved_LIBS -lcurses"
  201. ])
  202. @@ -408,8 +468,8 @@
  203. AS_IF([test "x$ax_cv_plaincurses" = xyes], [
  204. ax_cv_curses=yes
  205. ax_cv_curses_which=plaincurses
  206. - AS_IF([test "x$CURSES_LIB" = x], [
  207. - CURSES_LIB="-lcurses"
  208. + AS_IF([test "x$CURSES_LIBS" = x], [
  209. + CURSES_LIBS="-lcurses"
  210. ])
  211. AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
  212. @@ -515,4 +575,8 @@
  213. AS_IF([test "x$ax_cv_curses_obsolete" != xyes], [ax_cv_curses_obsolete=no])
  214. LIBS=$ax_saved_LIBS
  215. + CPPFLAGS=$ax_saved_CPPFLAGS
  216. +
  217. + unset ax_saved_LIBS
  218. + unset ax_saved_CPPFLAGS
  219. ])dnl
  220. diff -u tlf-1.2.4.5/macros/ax_with_curses_extra.m4 tlf/macros/ax_with_curses_extra.m4
  221. --- tlf-1.2.4.5/macros/ax_with_curses_extra.m4 2016-11-19 10:22:20.000000000 +0100
  222. +++ tlf/macros/ax_with_curses_extra.m4 2016-12-13 08:06:03.887433760 +0100
  223. @@ -41,18 +41,22 @@
  224. # The following output variables may be defined by these macros; these are
  225. # precious and may be overridden on the ./configure command line:
  226. #
  227. -# PANEL_LIB - library to add to xxx_LDADD before CURSES_LIB
  228. -# MENU_LIB - library to add to xxx_LDADD before CURSES_LIB
  229. -# FORM_LIB - library to add to xxx_LDADD before CURSES_LIB
  230. -#
  231. -# These libraries are NOT added to LIBS by default. You need to add them
  232. -# to the appropriate xxx_LDADD line in your Makefile.am in front of the
  233. -# equivalent CURSES_LIB incantation. For example:
  234. +# PANEL_LIBS - library to add to xxx_LDADD before CURSES_LIBS
  235. +# MENU_LIBS - library to add to xxx_LDADD before CURSES_LIBS
  236. +# FORM_LIBS - library to add to xxx_LDADD before CURSES_LIBS
  237. +#
  238. +# In previous versions of this macro, the flags PANEL_LIB, MENU_LIB and
  239. +# FORM_LIB were defined. These have been renamed, in keeping with the
  240. +# variable scheme of PKG_CHECK_MODULES, which should eventually supersede
  241. +# the use of AX_WITH_CURSES and AX_WITH_CURSES_* macros. These libraries
  242. +# are NOT added to LIBS by default. You need to add them to the
  243. +# appropriate xxx_LDADD line in your Makefile.am in front of the
  244. +# equivalent CURSES_LIBS incantation. For example:
  245. #
  246. -# prog_LDADD = @PANEL_LIB@ @CURSES_LIB@
  247. +# prog_LDADD = @PANEL_LIBS@ @CURSES_LIBS@
  248. #
  249. -# If one of the xxx_LIB variables is set on the configure command line
  250. -# (such as by running "./configure PANEL_LIB=-lmypanel"), then the header
  251. +# If one of the xxx_LIBS variables is set on the configure command line
  252. +# (such as by running "./configure PANEL_LIBS=-lmypanel"), then the header
  253. # file searched must NOT contain a subpath. In this case, in other words,
  254. # only <panel.h> would be searched for. The user may use the CPPFLAGS
  255. # precious variable to override the standard #include search path.
  256. @@ -144,7 +148,7 @@
  257. # modified version of the Autoconf Macro, you may extend this special
  258. # exception to the GPL to apply to your modified version as well.
  259. -#serial 2
  260. +#serial 4
  261. AC_DEFUN([_AX_WITH_CURSES_CHECKEXTRA], [
  262. dnl Parameter 1 is the variable name component, using uppercase letters only
  263. @@ -159,8 +163,11 @@
  264. AS_VAR_PUSHDEF([_AX_WITH_CURSES_CHECKEXTRA_have_header_var], [HAVE_[]m4_toupper($4)])dnl
  265. ax_saved_LIBS=$LIBS
  266. + ax_saved_CPPFLAGS=$CPPFLAGS
  267. +
  268. AC_CACHE_CHECK([for Curses $2 library with $4], [_AX_WITH_CURSES_CHECKEXTRA_header_var], [
  269. - LIBS="$ax_saved_LIBS $5 $CURSES_LIB"
  270. + LIBS="$ax_saved_LIBS $5 $CURSES_LIBS"
  271. + CPPFLAGS="$ax_saved_CPPFLAGS $CURSES_CFLAGS"
  272. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  273. @%:@include <$4>
  274. ]], [$3])],
  275. @@ -169,14 +176,18 @@
  276. ])
  277. AS_IF([test "x$[]_AX_WITH_CURSES_CHECKEXTRA_header_var" = xyes], [
  278. _AX_WITH_CURSES_CHECKEXTRA_cv_var=yes
  279. - AS_LITERAL_IF([$5], [$1_LIB="$5"])
  280. + AS_LITERAL_IF([$5], [$1_LIBS="$5"])
  281. AC_DEFINE([_AX_WITH_CURSES_CHECKEXTRA_have_var], [1], [Define to 1 if the Curses $2 library is present])
  282. AC_DEFINE([_AX_WITH_CURSES_CHECKEXTRA_have_header_var], [1], [Define to 1 if <$4> is present])
  283. ], [
  284. AS_IF([test "x$[]_AX_WITH_CURSES_CHECKEXTRA_cv_var" = xyes], [],
  285. [_AX_WITH_CURSES_CHECKEXTRA_cv_var=no])
  286. ])
  287. +
  288. LIBS=$ax_saved_LIBS
  289. + CPPFLAGS=$ax_saved_CPPFLAGS
  290. + unset ax_saved_LIBS
  291. + unset ax_saved_CPPFLAGS
  292. AS_VAR_POPDEF([_AX_WITH_CURSES_CHECKEXTRA_have_header_var])dnl
  293. AS_VAR_POPDEF([_AX_WITH_CURSES_CHECKEXTRA_header_var])dnl
  294. @@ -194,16 +205,18 @@
  295. dnl Parameter 7 is the plain Curses library command line
  296. AC_REQUIRE([AX_WITH_CURSES])
  297. - AC_ARG_VAR([$1_LIB], [linker library for Curses $2, e.g. $7])
  298. + AC_ARG_VAR([$1_LIBS], [linker library for Curses $2, e.g. $7])
  299. - AS_IF([test "x$[]$1_LIB" != x], [
  300. - _AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [$4], [$[]$1_LIB])
  301. + AS_IF([test "x$[]$1_LIBS" != x], [
  302. + _AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [$4], [$[]$1_LIBS])
  303. ], [
  304. AS_IF([test "x$ax_cv_curses_which" = xncursesw], [
  305. _AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [ncursesw/$4], [$5])
  306. ], [test "x$ax_cv_curses_which" = xncurses], [
  307. - _AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [ncurses/$4], [$6])
  308. _AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [$4], [$6])
  309. + AS_IF([test x$[]ax_cv_[]m4_tolower($1) != "xyes"], [
  310. + _AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [ncurses/$4], [$6])
  311. + ])
  312. ], [test "x$ax_cv_curses_which" = xplaincurses], [
  313. _AX_WITH_CURSES_CHECKEXTRA([$1], [$2], [$3], [$4], [$7])
  314. ])
  315. diff -u tlf-1.2.4.5/src/Makefile.am tlf/src/Makefile.am
  316. --- tlf-1.2.4.5/src/Makefile.am 2016-11-19 10:22:20.000000000 +0100
  317. +++ tlf/src/Makefile.am 2016-12-13 08:12:33.146327500 +0100
  318. @@ -1,5 +1,5 @@
  319. AM_CPPFLAGS = @GLIB_CFLAGS@ -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\"
  320. -AM_CFLAGS = @AM_CFLAGS@ @PTHREAD_CFLAGS@ @HAMLIB_CFLAGS@
  321. +AM_CFLAGS = @AM_CFLAGS@ @PTHREAD_CFLAGS@ @HAMLIB_CFLAGS@ @CURSES_CFLAGS@
  322. bin_PROGRAMS = tlf
  323. @@ -33,8 +33,9 @@
  324. write_keyer.c writecabrillo.c writeparas.c \
  325. zone_nr.c
  326. -tlf_LDADD = @LIBM_LIB@ @PTHREAD_LIBS@ @GLIB_LIBS@ @PANEL_LIB@ @CURSES_LIB@ @HAMLIB_LIBS@ \
  327. - @LIBXMLRPC_LIB@ @LIBXMLRPC_CLIENT_LIB@ @LIBXMLRPC_UTIL_LIB@
  328. +tlf_LDADD = @LIBM_LIB@ @PTHREAD_LIBS@ @GLIB_LIBS@ @PANEL_LIBS@ @CURSES_LIBS@ \
  329. + @HAMLIB_LIBS@ @LIBXMLRPC_LIB@ @LIBXMLRPC_CLIENT_LIB@ \
  330. + @LIBXMLRPC_UTIL_LIB@
  331. noinst_HEADERS = \
  332. addarea.h addcall.h addmult.h addpfx.h addspot.h audio.h autocq.h \