diff options
author | jlam <jlam@pkgsrc.org> | 2005-05-02 21:10:02 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2005-05-02 21:10:02 +0000 |
commit | 955fbd97165b7a7b4ff38b2d86d5cf68b0468c1c (patch) | |
tree | 9fb4cd26df4c1607040ac076b155620123e3b91b /mk | |
parent | f6b7d2a42379f7ae3c8aa9b200ba0c589f01254a (diff) | |
download | pkgsrc-955fbd97165b7a7b4ff38b2d86d5cf68b0468c1c.tar.gz |
* 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 (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 8 | ||||
-rw-r--r-- | mk/bsd.prefs.mk | 8 | ||||
-rw-r--r-- | mk/platform/Linux.mk | 3 | ||||
-rw-r--r-- | mk/tools/defaults.mk | 4 | ||||
-rw-r--r-- | mk/tools/imake.mk | 97 | ||||
-rw-r--r-- | mk/tools/make.mk | 27 | ||||
-rw-r--r-- | mk/tools/replace.mk | 4 |
7 files changed, 139 insertions, 12 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 6a9ce74b344..aa48d8dbadd 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -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 @@ BUILD_DEFS+= _PLIST_IGNORE_FILES _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= ${_IMAKE_MAKE} 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 @@ do-configure: ${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 @@ _PLIST_AWK_SCRIPT+= ${_PLIST_AWK_STRIP_MANZ} # 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 --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk index 15f28b2c478..0744a9c8ae9 100644 --- a/mk/bsd.prefs.mk +++ b/mk/bsd.prefs.mk @@ -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 @@ _XPKGWEDGE_REQD= 1.9 # 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 --git a/mk/platform/Linux.mk b/mk/platform/Linux.mk index 342cad3eb41..acf32f12095 100644 --- a/mk/platform/Linux.mk +++ b/mk/platform/Linux.mk @@ -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_MISCMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}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 --git a/mk/tools/defaults.mk b/mk/tools/defaults.mk index b1c34c47f14..b2677546fb6 100644 --- a/mk/tools/defaults.mk +++ b/mk/tools/defaults.mk @@ -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.gzip= GZIP_CMD _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.true= TRUE _TOOLS_VARNAME.tsort= TSORT _TOOLS_VARNAME.wc= WC _TOOLS_VARNAME.xargs= XARGS +_TOOLS_VARNAME.xmkmf= XMKMF_CMD _TOOLS_VARNAME.yacc= YACC ###################################################################### diff --git a/mk/tools/imake.mk b/mk/tools/imake.mk new file mode 100644 index 00000000000..7c0d5ea171e --- /dev/null +++ b/mk/tools/imake.mk @@ -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 --git a/mk/tools/make.mk b/mk/tools/make.mk index b122334aa84..ff0b6990ffd 100644 --- a/mk/tools/make.mk +++ b/mk/tools/make.mk @@ -1,8 +1,25 @@ -# $NetBSD: make.mk,v 1.3 2005/04/26 15:32:05 jlam Exp $ - -# 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. +# $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. # + +# 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 --git a/mk/tools/replace.mk b/mk/tools/replace.mk index 8ccb423db5c..091a4092bb7 100644 --- a/mk/tools/replace.mk +++ b/mk/tools/replace.mk @@ -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+= ${USE_GNU_TOOLS:S/^awk$/gawk/:S/^make$/gmake/:S/^sed$/gsed/} USE_TOOLS+= tbl .endif +.include "../../mk/tools/imake.mk" + ###################################################################### # Create _USE_TOOLS, a sanitized version of USE_TOOLS that removes the |