OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.7 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../procps/procps-tinfo-linking.patch
  5. # Copyright (C) 2014 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. Fix linking in the case libtinfo is a standalone library
  17. In the case of top we get an error like this
  18. ------------------------------------------------------------------------
  19. CCLD top
  20. /bin/ld: top.o: undefined reference to symbol 'tparm'
  21. /bin/ld: note: 'tparm' is defined in DSO /lib/libtinfo.so.5 so try adding it to the linker command line
  22. /lib/libtinfo.so.5: could not read symbols: Invalid operation
  23. collect2: error: ld returned 1 exit status
  24. ------------------------------------------------------------------------
  25. Before checking for ncurses we check for libtinfo and set TINFO_LIBS which
  26. simply gets add uncondtionally because in the case libtinfo is not stand-
  27. alone the TINFO_LIBS variable will be empty.
  28. --- a/configure.ac
  29. +++ b/configure.ac
  30. @@ -128,6 +128,12 @@
  31. if test "x$with_ncurses" = xno; then
  32. AM_CONDITIONAL(WITH_NCURSES, false)
  33. else
  34. + PKG_CHECK_MODULES([TINFO], [tinfo], [], [
  35. + AC_CHECK_LIB(tinfo, tparm, [have_tinfo=yes], [have_tinfo=no])
  36. + if test "x$have_tinfo" = xyes; then
  37. + TINFO_LIBS="-ltinfo"
  38. + fi
  39. + ])
  40. PKG_CHECK_MODULES([NCURSES], [ncurses], [], [
  41. AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no])
  42. AC_CHECK_HEADERS(curses.h ncurses.h term.h, [], [have_ncurses=no], AC_INCLUDES_DEFAULT)
  43. @@ -147,6 +153,7 @@
  44. fi
  45. fi
  46. AC_SUBST([NCURSES_LIBS])
  47. +AC_SUBST([TINFO_LIBS])
  48. AC_SUBST([WATCH_NCURSES_LIBS])
  49. AC_ARG_WITH([systemd],
  50. --- a/Makefile.am
  51. +++ b/Makefile.am
  52. @@ -76,9 +76,9 @@
  53. slabtop.1 \
  54. watch.1
  55. slabtop_SOURCES = slabtop.c $(top_srcdir)/lib/strutils.c $(top_srcdir)/lib/fileutils.c
  56. -slabtop_LDADD = @NCURSES_LIBS@
  57. +slabtop_LDADD = @NCURSES_LIBS@ @TINFO_LIBS@
  58. watch_SOURCES = watch.c $(top_srcdir)/lib/strutils.c $(top_srcdir)/lib/fileutils.c
  59. -watch_LDADD = @WATCH_NCURSES_LIBS@
  60. +watch_LDADD = @WATCH_NCURSES_LIBS@ @TINFO_LIBS@
  61. endif
  62. if BUILD_SKILL
  63. --- a/top/Makefile.am
  64. +++ b/top/Makefile.am
  65. @@ -19,7 +19,7 @@
  66. dist_man_MANS = \
  67. top.1
  68. -top_LDADD = @NCURSES_LIBS@
  69. +top_LDADD = @NCURSES_LIBS@ @TINFO_LIBS@
  70. endif
  71. EXTRA_DIST =