pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk + Teach buildlink3.mk to cause GNU configure script...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/90e025c3eb41
branches:  trunk
changeset: 539242:90e025c3eb41
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sun Mar 02 07:05:28 2008 +0000

description:
+ Teach buildlink3.mk to cause GNU configure script to not find any other
  terminal library other than the one we specify.

+ Also look for "termlib" as some systems have that.  Note that we need to
  make the library search more sophisticated to work correctly on more
  exotic platforms.

diffstat:

 mk/termcap.buildlink3.mk |  21 ++++++++++++++++++---
 mk/termcap.builtin.mk    |  19 ++++++++++++++-----
 2 files changed, 32 insertions(+), 8 deletions(-)

diffs (97 lines):

diff -r 6551dbc31e17 -r 90e025c3eb41 mk/termcap.buildlink3.mk
--- a/mk/termcap.buildlink3.mk  Sun Mar 02 07:02:01 2008 +0000
+++ b/mk/termcap.buildlink3.mk  Sun Mar 02 07:05:28 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: termcap.buildlink3.mk,v 1.1 2008/02/29 22:41:13 jlam Exp $
+# $NetBSD: termcap.buildlink3.mk,v 1.2 2008/03/02 07:05:28 jlam Exp $
 #
 # This Makefile fragment is meant to be included by packages that require
 # a termcap implementation that supports the basic termcap functions:
@@ -16,6 +16,11 @@
 
 .if !empty(TERMCAP_BUILDLINK3_MK:M+)
 
+# _TERMCAP_TYPES is an exhaustive list of all of the termcap implementations
+#      that may be found.
+#
+_TERMCAP_TYPES?=       curses termcap termlib tinfo
+
 CHECK_BUILTIN.termcap:=        yes
 .  include "termcap.builtin.mk"
 CHECK_BUILTIN.termcap:=        no
@@ -29,14 +34,24 @@
 .  else
 TERMCAP_TYPE=  curses
 .  endif
+BUILD_DEFS+=   TERMCAP_TYPE
 
-BUILD_DEFS+=   TERMCAP_TYPE
+# Most GNU configure scripts will try finding every termcap implementation,
+# so prevent them from finding any except for the one we decide upon.
+#
+.for _tcap_ in ${_TERMCAP_TYPES:Ntermcap}
+.  if empty(TERMCAP_TYPE:M${_tcap_})
+BUILDLINK_TRANSFORM+=          rm:-l${_tcap_}
+.  endif
+.endfor
+BUILDLINK_TRANSFORM+=          l:termcap:${BUILDLINK_LIBNAME.termcap}
 
 .endif # TERMCAP_BUILDLINK3_MK
 
 .if ${TERMCAP_TYPE} == "none"
 PKG_FAIL_REASON=       "No usable termcap library found on the system."
-.elif (${TERMCAP_TYPE} == "termcap") || \
+.elif (${TERMCAP_TYPE} == "termlib") || \
+      (${TERMCAP_TYPE} == "termcap") || \
       (${TERMCAP_TYPE} == "tinfo")
 BUILDLINK_PACKAGES:=           ${BUILDLINK_PACKAGES:Ntermcap}
 BUILDLINK_PACKAGES+=           termcap
diff -r 6551dbc31e17 -r 90e025c3eb41 mk/termcap.builtin.mk
--- a/mk/termcap.builtin.mk     Sun Mar 02 07:02:01 2008 +0000
+++ b/mk/termcap.builtin.mk     Sun Mar 02 07:05:28 2008 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: termcap.builtin.mk,v 1.1 2008/02/29 22:41:13 jlam Exp $
+# $NetBSD: termcap.builtin.mk,v 1.2 2008/03/02 07:05:28 jlam Exp $
 
 BUILTIN_PKG:=  termcap
 
-BUILTIN_FIND_LIBS:=    termcap tinfo curses
+BUILTIN_FIND_LIBS:=    curses termcap termlib tinfo
 
 .include "buildlink3/bsd.builtin.mk"
 
@@ -12,9 +12,10 @@
 ###
 .if !defined(IS_BUILTIN.termcap)
 IS_BUILTIN.termcap=    no
-.  if !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) || \
-      !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS]) || \
-      !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS])
+.  if !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS]) || \
+      !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS]) || \
+      !empty(BUILTIN_LIB_FOUND.termlib:M[yY][eE][sS]) || \
+      !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS])
 IS_BUILTIN.termcap=    yes
 .  endif
 .endif
@@ -36,12 +37,20 @@
 # Define BUILTIN_LIBNAME.termcap to be the base name of the built-in
 # termcap library.
 #
+# XXX This needs to be more sophisticated.  We will want to do what
+# XXX most packages do: test for tgetent() in the following libraries
+# XXX in order: c, curses, termcap, termlib.  Since we can't test for
+# XXX symbols in libraries, we'll need to be clever with looking at
+# XXX headers.
+#
 .if !empty(BUILTIN_LIB_FOUND.termcap:M[yY][eE][sS])
 BUILTIN_LIBNAME.termcap=       termcap
 .elif !empty(BUILTIN_LIB_FOUND.tinfo:M[yY][eE][sS])
 BUILTIN_LIBNAME.termcap=       tinfo
 .elif !empty(BUILTIN_LIB_FOUND.curses:M[yY][eE][sS])
 BUILTIN_LIBNAME.termcap=       curses
+.elif !empty(BUILTIN_LIB_FOUND.termlib:M[yY][eE][sS])
+BUILTIN_LIBNAME.termcap=       termlib
 .endif
 
 ###



Home | Main Index | Thread Index | Old Index