pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk * Push the imake- and xmkmf-handling into the new t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9fc2726c5907
branches:  trunk
changeset: 493312:9fc2726c5907
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Mon May 02 21:10:02 2005 +0000

description:
* Push the imake- and xmkmf-handling into the new tools framework.

* Get rid of an explicit check for ${_IMAKE_MAKE} == ${GMAKE} in
  bsd.pkg.mk to check for whether we need to depend on gmake or not.
  Instead, we now note in Linux.mk that packages that need imake will
  also need to use gmake by setting _IMAKE_TOOLS+=gmake.

* Push the definition of MAKE_PROGRAM from bsd.pkg.mk into make.mk where
  it's closer to related code.

diffstat:

 mk/bsd.pkg.mk        |   8 ++-
 mk/bsd.prefs.mk      |   8 +++-
 mk/platform/Linux.mk |   3 +-
 mk/tools/defaults.mk |   4 +-
 mk/tools/imake.mk    |  97 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 mk/tools/make.mk     |  27 +++++++++++--
 mk/tools/replace.mk  |   4 +-
 7 files changed, 139 insertions(+), 12 deletions(-)

diffs (268 lines):

diff -r 69dc6d62f218 -r 9fc2726c5907 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Mon May 02 21:05:38 2005 +0000
+++ b/mk/bsd.pkg.mk     Mon May 02 21:10:02 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1621 2005/05/02 05:45:15 jlam Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1622 2005/05/02 21:10:02 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -375,6 +375,7 @@
 _USE_GMAKE=            yes
 .endif
 
+.if empty(_USE_NEW_TOOLS:M[yY][eE][sS])
 .if defined(_USE_GMAKE)
 MAKE_PROGRAM=          ${GMAKE}
 .elif defined(USE_IMAKE)
@@ -386,6 +387,7 @@
 MAKE_PROGRAM=          ${MAKE}
 .endif
 CONFIGURE_ENV+=                MAKE="${MAKE_PROGRAM:T}"
+.endif
 
 # Automatically increase process limit where necessary for building.
 _ULIMIT_CMD=
@@ -2135,7 +2137,7 @@
            ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
 .    endfor
 .  endif
-.  if defined(USE_IMAKE)
+.  if defined(USE_IMAKE) || !empty(USE_TOOLS:Mimake)
 .    for DIR in ${CONFIGURE_DIRS}
        ${_PKG_SILENT}${_PKG_DEBUG}cd ${DIR} && ${SETENV} ${SCRIPTS_ENV} XPROJECTROOT=${X11BASE} ${XMKMF}
 .    endfor
@@ -4995,7 +4997,7 @@
 # Deal with MANINSTALL and man entries
 _PLIST_AWK_SCRIPT+=    ${_PLIST_AWK_MANINSTALL}
 # Deal with "imake installed" catman pages
-.if defined(USE_IMAKE) && ${_PREFORMATTED_MAN_DIR} == "man"
+.if defined(USE_IMAKE) || !empty(USE_TOOLS:Mimake) && ${_PREFORMATTED_MAN_DIR} == "man"
 _PLIST_AWK_SCRIPT+=    ${_PLIST_AWK_IMAKE_MAN}
 .endif
 # Add '.gz' suffixes on man entries if needed
diff -r 69dc6d62f218 -r 9fc2726c5907 mk/bsd.prefs.mk
--- a/mk/bsd.prefs.mk   Mon May 02 21:05:38 2005 +0000
+++ b/mk/bsd.prefs.mk   Mon May 02 21:10:02 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.187 2005/05/02 05:16:21 jlam Exp $
+# $NetBSD: bsd.prefs.mk,v 1.188 2005/05/02 21:10:02 jlam Exp $
 #
 # Make file, included to get the site preferences, if any.  Should
 # only be included by package Makefiles before any .if defined()
@@ -393,14 +393,20 @@
 # The check for the existence of ${X11BASE}/lib/X11/config/xpkgwedge.def
 # is to catch users of xpkgwedge<1.0.
 #
+.if empty(_USE_NEW_TOOLS:M[yY][eE][sS])
 XMKMF?=                        ${XMKMF_CMD} ${XMKMF_FLAGS} -a
 XMKMF_FLAGS?=          # empty
+.endif
 .if !empty(USE_XPKGWEDGE:M[Yy][Ee][Ss]) 
 X11PREFIX=             ${LOCALBASE}
+.  if empty(_USE_NEW_TOOLS:M[yY][eE][sS])
 XMKMF_CMD?=            ${X11PREFIX}/bin/pkgxmkmf
+.  endif
 .else
 X11PREFIX=             ${X11BASE}
+.  if empty(_USE_NEW_TOOLS:M[yY][eE][sS])
 XMKMF_CMD?=            ${X11PREFIX}/bin/xmkmf
+.  endif
 .endif
 
 DEPOT_SUBDIR?=         packages
diff -r 69dc6d62f218 -r 9fc2726c5907 mk/platform/Linux.mk
--- a/mk/platform/Linux.mk      Mon May 02 21:05:38 2005 +0000
+++ b/mk/platform/Linux.mk      Mon May 02 21:10:02 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Linux.mk,v 1.10 2005/03/18 18:16:35 tv Exp $
+# $NetBSD: Linux.mk,v 1.11 2005/05/02 21:10:02 jlam Exp $
 #
 # Variable definitions for the Linux operating system.
 
@@ -165,6 +165,7 @@
 IMAKE_MANNEWSUFFIX=    ${IMAKE_MAN_SUFFIX}
 
 _DO_SHLIB_CHECKS=      no      # on installation, fixup PLIST for shared libs
+_IMAKE_TOOLS=          gmake   # extra tools required when we use imake
 _IMAKE_MAKE=           ${GMAKE}        # program which gets invoked by imake
 .if exists(/usr/include/netinet6) || exists(/usr/include/linux/in6.h)
 _OPSYS_HAS_INET6=      yes     # IPv6 is standard
diff -r 69dc6d62f218 -r 9fc2726c5907 mk/tools/defaults.mk
--- a/mk/tools/defaults.mk      Mon May 02 21:05:38 2005 +0000
+++ b/mk/tools/defaults.mk      Mon May 02 21:10:02 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: defaults.mk,v 1.3 2005/05/02 04:42:08 jlam Exp $
+# $NetBSD: defaults.mk,v 1.4 2005/05/02 21:10:03 jlam Exp $
 
 .if !defined(TOOLS_DEFAULTS_MK)
 TOOLS_DEFAULTS_MK=     defined
@@ -47,6 +47,7 @@
 _TOOLS_VARNAME.head=           HEAD
 _TOOLS_VARNAME.hostname=       HOSTNAME_CMD
 _TOOLS_VARNAME.id=             ID
+_TOOLS_VARNAME.imake=          IMAKE
 _TOOLS_VARNAME.ldconfig=       LDCONFIG
 _TOOLS_VARNAME.lex=            LEX
 _TOOLS_VARNAME.ln=             LN
@@ -75,6 +76,7 @@
 _TOOLS_VARNAME.tsort=          TSORT
 _TOOLS_VARNAME.wc=             WC
 _TOOLS_VARNAME.xargs=          XARGS
+_TOOLS_VARNAME.xmkmf=          XMKMF_CMD
 _TOOLS_VARNAME.yacc=           YACC
 
 ######################################################################
diff -r 69dc6d62f218 -r 9fc2726c5907 mk/tools/imake.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/tools/imake.mk Mon May 02 21:10:02 2005 +0000
@@ -0,0 +1,97 @@
+# $NetBSD: imake.mk,v 1.1 2005/05/02 21:10:03 jlam Exp $
+#
+# This Makefile fragment handles packages that need imake and xmkmf
+# to build X11-related packages.  The correct imake and xmkmf tools
+# are placed under ${TOOLS_DIRS}/bin, so that they may be invoked by
+# their bare names.  The tools are chosen based on which type of X11
+# distribution pkgsrc will be using, e.g. X11_TYPE.
+#
+# Variables defined by this file are:
+#
+#      IMAKE           path to imake tool + any imake-specific args
+#      XMKMF_CMD       path to xmkmf tool + any xmkmf-specific args
+#      XMKMF           command to create all Makefiles from Imakefiles,
+#                      usually "xmkmf -a".
+#
+# Optional variables that may be defined by the package are:
+#
+#      IMAKEOPTS       Options to pass to imake
+#      XMKMF_FLAGS     Options to pass to xmkmf
+#
+# If they are non-empty, then a wrapper script will be created instead
+# of a symlink for the corresponding tool.
+#
+# A platform/${OPSYS}.mk file may note that additional tools are
+# required when using imake by setting _IMAKE_TOOLS to the appropriate
+# value, e.g. _IMAKE_TOOLS+=gmake to use GNU make to build packages
+# that use imake.
+#
+# This file is included by mk/tools/replace.mk and follows the same
+# rules as for other replacement tools.
+#
+
+# Continue to allow USE_IMAKE until packages have been taught to use the
+# new syntax.
+#
+.if defined(USE_IMAKE)
+USE_TOOLS+=    imake
+.endif
+
+# Skip the processing at the end of replace.mk.  If we need to use
+# imake, then we always want the clause below to trigger.
+#
+_TOOLS_USE_PKGSRC.imake=       yes
+
+.if !defined(TOOLS_IGNORE.imake) && !empty(USE_TOOLS:Mimake)
+.  if !empty(PKGPATH:Mx11/imake) || !empty(PKGPATH:Mx11/xorg-imake)
+MAKEFLAGS+=                    TOOLS_IGNORE.imake=
+.  else
+#
+# If we're using xpkgwedge, then we need to invoke the special xmkmf
+# script that will find imake config files in both ${PREFIX} and in
+# ${X11BASE}.
+#
+.    if !empty(USE_XPKGWEDGE:M[yY][eE][sS])
+TOOLS_REAL_CMD.xmkmf?=         ${X11PREFIX}/bin/pkgxmkmf
+.    endif
+#
+# Depending on which X11_TYPE we're using, depend on the correct package
+# to pull in imake and xmkmf.
+#
+.    if defined(X11_TYPE) && (${X11_TYPE} == "XFree86")
+TOOLS_DEPENDS.imake?=          imake>=4.4.0:../../x11/imake
+TOOLS_REAL_CMD.imake?=         ${X11PREFIX}/${X11ROOT_PREFIX}/bin/imake
+TOOLS_REAL_CMD.xmkmf?=         ${X11PREFIX}/${X11ROOT_PREFIX}/bin/xmkmf
+.    elif defined(X11_TYPE) && (${X11_TYPE} == "xorg")
+TOOLS_DEPENDS.imake?=          xorg-imake>=6.8:../../x11/xorg-imake
+TOOLS_REAL_CMD.imake?=         ${X11PREFIX}/${X11ROOT_PREFIX}/bin/imake
+TOOLS_REAL_CMD.xmkmf?=         ${X11PREFIX}/${X11ROOT_PREFIX}/bin/xmkmf
+.    else # ${X11_TYPE} == "native"
+TOOLS_REAL_CMD.imake?=         ${X11BASE}/bin/imake
+TOOLS_REAL_CMD.xmkmf?=         ${X11BASE}/bin/xmkmf
+.    endif
+TOOLS_ARGS.imake?=             ${IMAKEOPTS}
+TOOLS_ARGS.xmkmf?=             ${XMKMF_FLAGS}
+#
+# Add any extra tools that may be required when using imake, e.g. gmake.
+#
+USE_TOOLS+=                    ${_IMAKE_TOOLS:Nimake}
+#
+# Define IMAKE and XMKMF_CMD and create wrappers/symlinks corresponding
+# to imake and xmkmf.
+#
+.    if !empty(TOOLS_ARGS.imake)
+TOOLS_WRAP+=                   imake
+.    else
+TOOLS_SYMLINK+=                        imake
+.    endif
+.    if !empty(TOOLS_ARGS.xmkmf)
+TOOLS_WRAP+=                   xmkmf
+.    else
+TOOLS_SYMLINK+=                        xmkmf
+.    endif
+${_TOOLS_VARNAME.imake}=       ${TOOLS_REAL_CMD.imake} ${TOOLS_ARGS.imake}
+${_TOOLS_VARNAME.xmkmf}=       ${TOOLS_REAL_CMD.xmkmf} ${TOOLS_ARGS.xmkmf}
+XMKMF=                         ${${_TOOLS_VARNAME.xmkmf}} -a
+.  endif
+.endif
diff -r 69dc6d62f218 -r 9fc2726c5907 mk/tools/make.mk
--- a/mk/tools/make.mk  Mon May 02 21:05:38 2005 +0000
+++ b/mk/tools/make.mk  Mon May 02 21:10:02 2005 +0000
@@ -1,8 +1,25 @@
-# $NetBSD: make.mk,v 1.3 2005/04/26 15:32:05 jlam Exp $
+# $NetBSD: make.mk,v 1.4 2005/05/02 21:10:03 jlam Exp $
+#
+# This Makefile fragment creates a tool called "make" under ${TOOLS_DIR}
+# that corresponds to the make program used to build the package.
+# This lets a bare "make" invoke the correct program if called from
+# within a makefile or script.  It also sets MAKE_PROGRAM to the path
+# of that make program.  Lastly, pass ${MAKE_PROGRAM} to GNU configure
+# scripts in the MAKE variable so that the scripts will embed the
+# correct correct path to the make program used to build the package
+# into the generated Makefiles.
+#
 
-# Always provide a symlink from ${TOOLS_DIR}/bin/make to the "make"
-# used to build the package.  This lets a bare "make" invoke the
-# correct program if called from within a makefile or script.
-#
+# Define MAKE_PROGRAM to be the "make" used to build the package.
+.if !empty(_USE_TOOLS:Mgmake)
+MAKE_PROGRAM=          ${GMAKE}
+.elif !empty(_USE_TOOLS:Mimake) && defined(_IMAKE_MAKE)
+MAKE_PROGRAM=          ${_IMAKE_MAKE}
+.else
+MAKE_PROGRAM=          ${MAKE}
+.endif
+
 TOOLS_SYMLINK+=                make
 TOOLS_REAL_CMD.make=   ${MAKE_PROGRAM}
+
+CONFIGURE_ENV+=                MAKE=${MAKE_PROGRAM:T:Q}
diff -r 69dc6d62f218 -r 9fc2726c5907 mk/tools/replace.mk
--- a/mk/tools/replace.mk       Mon May 02 21:05:38 2005 +0000
+++ b/mk/tools/replace.mk       Mon May 02 21:10:02 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.56 2005/05/02 06:36:29 jlam Exp $
+# $NetBSD: replace.mk,v 1.57 2005/05/02 21:10:03 jlam Exp $
 #
 # This Makefile fragment handles "replacements" of system-supplied
 # tools with pkgsrc versions.  The replacements are placed under
@@ -38,6 +38,8 @@
 USE_TOOLS+=    tbl
 .endif
 
+.include "../../mk/tools/imake.mk"
+
 ######################################################################
 
 # Create _USE_TOOLS, a sanitized version of USE_TOOLS that removes the



Home | Main Index | Thread Index | Old Index