diff options
author | wiz <wiz@pkgsrc.org> | 2004-07-06 22:49:16 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2004-07-06 22:49:16 +0000 |
commit | d4e8b4431573754155afe43df938cd3f257e4ebc (patch) | |
tree | 8ddd6f5fbca3030a00649cceea94d5dd34d4b845 | |
parent | 4237d54a346f23a3809e46440e393d61648b69bd (diff) | |
download | pkgsrc-d4e8b4431573754155afe43df938cd3f257e4ebc.tar.gz |
Retire buildlink2, now that all packages using it have been converted to
buildlink3.
-rw-r--r-- | mk/apache.mk | 8 | ||||
-rw-r--r-- | mk/bsd.pkg.defaults.mk | 8 | ||||
-rw-r--r-- | mk/bsd.pkg.mk | 16 | ||||
-rw-r--r-- | mk/bsd.prefs.mk | 5 | ||||
-rw-r--r-- | mk/buildlink2/NOTES | 35 | ||||
-rw-r--r-- | mk/buildlink2/README | 46 | ||||
-rw-r--r-- | mk/buildlink2/bsd.buildlink2.mk | 911 | ||||
-rw-r--r-- | mk/buildlink2/buildlink2.txt | 91 | ||||
-rw-r--r-- | mk/buildlink2/fake-la | 109 | ||||
-rw-r--r-- | mk/buildlink2/gen-transform.sh | 163 | ||||
-rw-r--r-- | mk/buildlink2/ld-logic | 8 | ||||
-rw-r--r-- | mk/buildlink2/ld-post-cache | 6 | ||||
-rw-r--r-- | mk/buildlink2/libtool-do-install | 17 | ||||
-rw-r--r-- | mk/buildlink2/libtool-fix-la | 199 | ||||
-rw-r--r-- | mk/buildlink2/libtool-logic | 43 | ||||
-rw-r--r-- | mk/buildlink2/libtool-post-cache | 6 | ||||
-rw-r--r-- | mk/buildlink2/libtool.sh | 100 | ||||
-rw-r--r-- | mk/buildlink2/logic | 75 | ||||
-rw-r--r-- | mk/buildlink2/post-cache | 4 | ||||
-rw-r--r-- | mk/buildlink2/pre-cache | 9 | ||||
-rw-r--r-- | mk/buildlink2/private-pre-cache | 3 | ||||
-rw-r--r-- | mk/buildlink2/wrapper.sh | 55 | ||||
-rw-r--r-- | mk/compiler/gcc.mk | 8 | ||||
-rw-r--r-- | mk/pthread.buildlink2.mk | 223 | ||||
-rwxr-xr-x | mk/scripts/genreadme.awk | 4 |
25 files changed, 16 insertions, 2136 deletions
diff --git a/mk/apache.mk b/mk/apache.mk index bac28430e50..2ae9f53bf1f 100644 --- a/mk/apache.mk +++ b/mk/apache.mk @@ -1,4 +1,4 @@ -# $NetBSD: apache.mk,v 1.5 2003/12/11 13:51:28 grant Exp $ +# $NetBSD: apache.mk,v 1.6 2004/07/06 22:49:16 wiz Exp $ # # This Makefile fragment handles Apache dependencies and make variables, # and is meant to be included by packages that require Apache either at @@ -133,8 +133,6 @@ _APACHE_DEPENDENCY?= ${BUILDLINK_DEPENDS.${_PKG_APACHE}}:${_APACHE_PKGSRCDIR} .if defined(_APACHE_PKGSRCDIR) . if defined(USE_BUILDLINK3) && empty(USE_BUILDLINK3:M[nN][oO]) . include "${_APACHE_BL_SRCDIR}/buildlink3.mk" -. elif defined(USE_BUILDLINK2) && empty(USE_BUILDLINK2:M[nN][oO]) -. include "${_APACHE_BL_SRCDIR}/buildlink2.mk" . else DEPENDS+= ${_APACHE_DEPENDENCY} . endif @@ -146,8 +144,6 @@ DEPENDS+= ${_APACHE_DEPENDENCY} .if defined(_APACHE_PKGSRCDIR) . if defined(USE_BUILDLINK3) && empty(USE_BUILDLINK3:M[nN][oO]) . include "${_APACHE_BL_SRCDIR}/buildlink3.mk" -. elif defined(USE_BUILDLINK2) && empty(USE_BUILDLINK2:M[nN][oO]) -. include "${_APACHE_BL_SRCDIR}/buildlink2.mk" . else BUILD_DEPENDS+= ${_APACHE_DEPENDENCY} . endif @@ -157,8 +153,6 @@ BUILD_DEPENDS+= ${_APACHE_DEPENDENCY} . if defined(USE_APR) && !empty(USE_APR:M[yY][eE][sS]) . if defined(USE_BUILDLINK3) && empty(USE_BUILDLINK3:M[nN][oO]) . include "../../devel/apr/buildlink3.mk" -. elif defined(USE_BUILDLINK2) && empty(USE_BUILDLINK2:M[nN][oO]) -. include "../../devel/apr/buildlink2.mk" . endif . endif .endif diff --git a/mk/bsd.pkg.defaults.mk b/mk/bsd.pkg.defaults.mk index f3378ebee32..1a360727b42 100644 --- a/mk/bsd.pkg.defaults.mk +++ b/mk/bsd.pkg.defaults.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.defaults.mk,v 1.255 2004/07/06 11:32:49 abs Exp $ +# $NetBSD: bsd.pkg.defaults.mk,v 1.256 2004/07/06 22:49:16 wiz Exp $ # # A file providing defaults for pkgsrc and the packages collection. @@ -1500,9 +1500,9 @@ MPLAYER_USE_MEDIALIB?= NO # Default: NO #MOTIF_TYPE?= openmotif -# Used by motif.buildlink2.mk to choose which Motif-2.0-compatible +# Used by motif.buildlink3.mk to choose which Motif-2.0-compatible # installation to use. This value is also automatically set by -# motif.buildlink2.mk to whichever Motif-2.0 installation represented by +# motif.buildlink3.mk to whichever Motif-2.0 installation represented by # the possible values below is already installed, but defaults to # ${MOTIF_TYPE_DEFAULT}. This value is ignored if MOTIFBASE is # explicitly set. @@ -1510,7 +1510,7 @@ MPLAYER_USE_MEDIALIB?= NO # Default: ${MOTIF_TYPE_DEFAULT} #MOTIF_TYPE_DEFAULT?= openmotif -# Used by motif.buildlink2.mk as the final default value for MOTIF_TYPE. +# Used by motif.buildlink3.mk as the final default value for MOTIF_TYPE. # Possible: openmotif, lesstif, dt (Irix and Solaris only) # Default: openmotif, or dt (Irix and Solaris only) diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 752c05f7c5a..c3593451277 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1474 2004/07/06 11:28:55 abs Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1475 2004/07/06 22:49:16 wiz Exp $ # # This file is in the public domain. # @@ -141,14 +141,10 @@ PKG_FAIL_REASON+= "PLIST_TYPE must be \`\`dynamic'' or \`\`static''." PKG_FAIL_REASON+= "PLIST_TYPE must be \`\`static'' for \`\`overwrite'' packages." .endif -.if empty(USE_BUILDLINK2:M[nN][oO]) && empty(USE_BUILDLINK3:M[nN][oO]) -PKG_FAIL_REASON+= "Please undefine USE_BUILDLINK2 or USE_BUILDLINK3." -.endif - .if !empty(USE_BUILDLINK3:M[nN][oO]) # # Set the default BUILDLINK_DIR, BUILDLINK_X11_DIR so that if no -# buildlink2.mk files are included, then they still point to where headers +# buildlink3.mk files are included, then they still point to where headers # and libraries for installed packages and X11R6 may be found. # BUILDLINK_DIR?= ${LOCALBASE} @@ -170,7 +166,7 @@ PLIST_SUBST+= IMAKE_MAN_SOURCE_PATH=${IMAKE_MAN_SOURCE_PATH} \ IMAKE_FILEMAN_SUFFIX=${IMAKE_FILEMAN_SUFFIX} \ IMAKE_MISCMAN_SUFFIX=${IMAKE_MISCMAN_SUFFIX} \ IMAKE_MANNEWSUFFIX=${IMAKE_MANNEWSUFFIX} -. if empty(USE_BUILDLINK2:M[nN][oO]) || empty(USE_BUILDLINK3:M[nN][oO]) +. if empty(USE_BUILDLINK3:M[nN][oO]) MAKE_FLAGS+= CC="${CC}" CXX="${CXX}" . endif .endif @@ -443,7 +439,7 @@ DISTINFO_FILE?= ${.CURDIR}/distinfo X11_LDFLAGS+= -Wl,${RPATH_FLAG}${X11BASE}/lib${ABI} X11_LDFLAGS+= -L${X11BASE}/lib${ABI} .endif -.if !empty(USE_BUILDLINK2:M[nN][oO]) && !empty(USE_BUILDLINK3:M[nN][oO]) +.if !empty(USE_BUILDLINK3:M[nN][oO]) LDFLAGS+= -Wl,${RPATH_FLAG}${LOCALBASE}/lib LDFLAGS+= -L${LOCALBASE}/lib . if defined(USE_X11) @@ -1166,14 +1162,12 @@ USE_LANGUAGES?= # empty .include "../../mk/tools.mk" -.if !empty(USE_BUILDLINK2:M[nN][oO]) && !empty(USE_BUILDLINK3:M[nN][oO]) +.if !empty(USE_BUILDLINK3:M[nN][oO]) NO_BUILDLINK= # defined .endif .if !defined(NO_BUILDLINK) . if empty(USE_BUILDLINK3:M[nN][oO]) . include "../../mk/buildlink3/bsd.buildlink3.mk" -. elif empty(USE_BUILDLINK2:M[nN][oO]) -. include "../../mk/buildlink2/bsd.buildlink2.mk" . endif .endif diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk index 3c205738038..f1afe829d53 100644 --- a/mk/bsd.prefs.mk +++ b/mk/bsd.prefs.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prefs.mk,v 1.161 2004/07/02 16:27:48 wiz Exp $ +# $NetBSD: bsd.prefs.mk,v 1.162 2004/07/06 22:49:16 wiz Exp $ # # Make file, included to get the site preferences, if any. Should # only be included by package Makefiles before any .if defined() @@ -438,7 +438,6 @@ LINKFARM?= ${LINKFARM_CMD} # PKG_BEST_EXISTS?= ${PKG_ADMIN} -b -d ${_PKG_DBDIR} -S lsbest -USE_BUILDLINK2?= no # default to not using buildlink2 USE_BUILDLINK3?= no # default to not using buildlink3 .if ${PKG_INSTALLATION_TYPE} == "pkgviews" USE_BUILDLINK3= yes # pkgviews requires buildlink3 @@ -493,7 +492,7 @@ WRKDIR_BASENAME?= work WRKDIR?= ${BUILD_DIR}/${WRKDIR_BASENAME} # There are many uses for a common log file, so define one that may be -# picked up and used by tools.mk, bsd.buildlink2.mk, etc. +# picked up and used by tools.mk, bsd.buildlink3.mk, etc. # WRKLOG?= ${WRKDIR}/.work.log diff --git a/mk/buildlink2/NOTES b/mk/buildlink2/NOTES deleted file mode 100644 index 915220ea896..00000000000 --- a/mk/buildlink2/NOTES +++ /dev/null @@ -1,35 +0,0 @@ -$NetBSD: NOTES,v 1.14 2003/09/02 06:59:50 jlam Exp $ - - Caching - ======= - -The caching problems seem to be related to correct manipulation of -variables containing values with escaped metacharacters by the shell. The -current code only does partial caching, which doesn't cache "special" -arguments that contain escaped metacharacters or other oddly quoted values. -On certain platforms listed in _BLNK_CACHE_ALL in bsd.buildlink2.mk, we do -full caching, which has enormous speed benefits since it avoids an extra -sed invocation per "special" argument. - -The test process for buildlink2 consists of building and installing: - - shells/tcsh tests handling of specially-quoted arguments - devel/gettext-lib same as above, but uses libtool - x11/xearth tests imake wrapper - -Full caching can be tested be adding ${MACHINE_PLATFORM} to _BLNK_CACHE_ALL -and performing the tests above, but only building the packages is needed. - -Platform Working? Full caching? --------- -------- ------------- -FreeBSD 4.7 -IRIX 6.5 (jschauma) Yes! Yes! -Linux -Darwin 5.5 (schmonz) Yes! No -Darwin 6.2 (grant) Yes! Yes! -NetBSD 1.5.x (gendalia) -NetBSD 1.6 (jlam) Yes! Yes! -OpenBSD (cjep) -Solaris 7 -Solaris 8 (grant) Yes! Yes! -Solaris 9 (salo) Yes! Yes! diff --git a/mk/buildlink2/README b/mk/buildlink2/README deleted file mode 100644 index bbdf38a4561..00000000000 --- a/mk/buildlink2/README +++ /dev/null @@ -1,46 +0,0 @@ -$NetBSD: README,v 1.5 2002/12/26 17:08:56 jlam Exp $ - -For more general information about the use of buildlink2, see the file -buildlink2.txt in this directory. - - 0 buildlink2 Wrapper Script System - ================================== - -The purpose of the buildlink2 wrapper script system is to replace calls to -compiler tool with scripts that tranlate any arguments into their buildlink -equivalents, then invoke the actual compiler tools with the translated -arguments. The pkgsrc/mk/buildlink2 directory contains bits of the wrapper -script system for the buildlink2 framework. The wrapper script system is -composed of three parts: the main wrapper script, the "cache", and the -"logic" script. - - 0.1 Main wrapper script - ======================= - -The main wrapper script for a compiler tool (cc, ld, as, etc.) is -generated from wrapper.sh, except for the libtool wrapper script which is -generated from libtool.sh. The wrapper scripts share a common set of logic -files that translate arguments into their buildlink equivalents. - - 0.2 Cache - ========= - -The cache is a giant Bourne shell "case" statement that stores -pre-translated arguments from previous wrapper invocations. This allows -speedy translation of already-seen arguments without having to run the -utilities needed to perform a translation from scratch. There are two -caches: the common cache and a wrapper-specific cache. The common cache -is used by all wrapper scripts. The wrapper-specific cache is read before -the common cache and contains wrapper-specific argument translation that -shouldn't be used by other wrapper scripts. - - 0.3 Logic script - ================ - -The logic script contains a large "case" statement that handles the -actual translation of an argument into its buildlink equivalent. The logic -script also invokes a wrapper-specific logic script which may contain extra -commands that perform further translation of an argument after the main -translation has been performed by the logic script. Finally, the logic -script may save the translations results into a cache file if requested by -the wrapper script. diff --git a/mk/buildlink2/bsd.buildlink2.mk b/mk/buildlink2/bsd.buildlink2.mk deleted file mode 100644 index ec5b684dc93..00000000000 --- a/mk/buildlink2/bsd.buildlink2.mk +++ /dev/null @@ -1,911 +0,0 @@ -# $NetBSD: bsd.buildlink2.mk,v 1.125 2004/04/30 04:22:02 reed Exp $ -# -# An example package buildlink2.mk file: -# -# -------------8<-------------8<-------------8<-------------8<------------- -# BUILDLINK_PACKAGES+= foo -# BUILDLINK_PKGBASE.foo= foo-lib -# BUILDLINK_DEPENDS.foo?= foo-lib>=1.0 -# BUILDLINK_RECOMMENDED.foo?= foo-lib>=1.0nb1 -# BUILDLINK_PKGSRCDIR.foo?= ../../category/foo-lib -# -# EVAL_PREFIX+= BUILDLINK_PREFIX.foo=foo-lib -# BUILDLINK_PREFIX.foo_DEFAULT= ${LOCALBASE} -# BUILDLINK_FILES.foo= include/foo.h -# BUILDLINK_FILES.foo+= include/bar.h -# BUILDLINK_FILES.foo+= lib/libfoo.* -# -# # We want "-lbar" to eventually resolve to "-lfoo". -# BUILDLINK_TRANSFORM+= l:bar:foo -# -# BUILDLINK_TARGETS+= foo-buildlink -# -# foo-buildlink: _BUILDLINK_USE -# -------------8<-------------8<-------------8<-------------8<------------- -# -# Another example package buildlink2.mk file: -# -# -------------8<-------------8<-------------8<-------------8<------------- -# BUILDLINK_PACKAGES+= baz -# BUILDLINK_PKGBASE.baz= baz-devel -# BUILDLINK_DEPENDS.baz?= baz-devel>=1.0 -# BUILDLINK_PKGSRCDIR.baz?= ../../category/baz-devel -# -# EVAL_PREFIX+= BUILDLINK_PREFIX.foo=foo-lib -# BUILDLINK_PREFIX.baz_DEFAULT= ${LOCALBASE} -# BUILDLINK_FILES_CMD.baz= \ -# ${BUILDLINK_PLIST_CMD.baz} | ${GREP} "^\(include\|lib\)" -# -# BUILDLINK_TARGETS+= baz-buildlink -# -# baz-buildlink: _BUILDLINK_USE -# -------------8<-------------8<-------------8<-------------8<------------- -# -# The different variables that may be set in a buildlink2.mk file are -# described below. -# -# The variable name convention used in this Makefile are: -# -# BUILDLINK_* public buildlink-related variables usable in other Makefiles -# _BLNK_* private buildlink-related variables to this Makefile - -ECHO_BUILDLINK_MSG?= ${TRUE} - -BUILDLINK_DIR= ${WRKDIR}/.buildlink -BUILDLINK_X11_DIR= ${BUILDLINK_DIR:H}/.buildlink-x11 -CONFIGURE_ENV+= BUILDLINK_DIR="${BUILDLINK_DIR}" -MAKE_ENV+= BUILDLINK_DIR="${BUILDLINK_DIR}" -CONFIGURE_ENV+= BUILDLINK_X11_DIR="${BUILDLINK_X11_DIR}" -MAKE_ENV+= BUILDLINK_X11_DIR="${BUILDLINK_X11_DIR}" -_BLNK_CPPFLAGS= -I${LOCALBASE}/include -_BLNK_LDFLAGS= -L${LOCALBASE}/lib -.if ${_USE_RPATH} == "yes" -_BLNK_LDFLAGS+= -Wl,${_OPSYS_RPATH_NAME}${LOCALBASE}/lib -.endif -_BLNK_OPSYS= ${OPSYS} - -BUILDLINK_SHELL?= ${SH} - -# The configure process usually tests for outlandish or missing things -# that we don't want polluting the argument cache. -# -CONFIGURE_ENV+= BUILDLINK_UPDATE_CACHE=no - -# The caching code, which greatly speeds up the build process, doesn't -# work completely correctly on certain platforms. -# -_BLNK_PARTIAL_CACHE_ONLY= Darwin-5.*-* - -_BLNK_FULL_CACHING?= YES -.for _pattern_ in ${_BLNK_PARTIAL_CACHE_ONLY} -. if !empty(MACHINE_PLATFORM:M${_pattern_}) -_BLNK_FULL_CACHING= NO -. endif -.endfor -.if !empty(_BLNK_FULL_CACHING:M[yY][eE][sS]) -CONFIGURE_ENV+= BUILDLINK_CACHE_ALL=yes -MAKE_ENV+= BUILDLINK_CACHE_ALL=yes -.endif - -.if defined(USE_X11) -USE_X11_LINKS?= YES -X11_TYPE?= native -. if empty(USE_X11_LINKS:M[nN][oO]) && \ - !empty(X11_TYPE:Mnative) -BUILD_DEPENDS+= x11-links>=0.23:../../pkgtools/x11-links -_BLNK_X11_DIR= ${LOCALBASE}/share/x11-links -. elif empty(USE_X11_LINKS:M[nN][oO]) && \ - !empty(X11_TYPE:MXFree86) -DEPENDS+= XFree86-libs>=4.4.0:../../x11/XFree86-libs -_BLNK_X11_DIR= ${LOCALBASE}/X11R6 -. endif # X11_TYPE=XFree86 -_BLNK_CPPFLAGS+= -I${X11BASE}/include -_BLNK_LDFLAGS+= -L${X11BASE}/lib -. if ${_USE_RPATH} == "yes" -_BLNK_LDFLAGS+= -Wl,${_OPSYS_RPATH_NAME}${X11BASE}/lib -. endif -.endif - -CONFIGURE_ENV+= BUILDLINK_CPPFLAGS="${_BLNK_CPPFLAGS}" -MAKE_ENV+= BUILDLINK_CPPFLAGS="${_BLNK_CPPFLAGS}" -CONFIGURE_ENV+= BUILDLINK_LDFLAGS="${_BLNK_LDFLAGS}" -MAKE_ENV+= BUILDLINK_LDFLAGS="${_BLNK_LDFLAGS}" - -.for FLAG in ${_BLNK_CPPFLAGS} -. if empty(CFLAGS:M${FLAG}) -CFLAGS+= ${FLAG} -. endif -. if empty(CXXFLAGS:M${FLAG}) -CXXFLAGS+= ${FLAG} -. endif -. if empty(CPPFLAGS:M${FLAG}) -CPPFLAGS+= ${FLAG} -. endif -.endfor -.for FLAG in ${_BLNK_LDFLAGS} -. if empty(LDFLAGS:M${FLAG:C/:/\:/}) -LDFLAGS+= ${FLAG} -. endif -.endfor - -# Prepend ${BUILDLINK_DIR}/bin to the PATH so that the wrappers are found -# first when searching for executables. -# -PREPEND_PATH+= ${BUILDLINK_DIR}/bin - -.for _pkg_ in ${BUILDLINK_PACKAGES} -# -# Add the proper dependency on each package pulled in by buildlink2.mk -# files. BUILDLINK_DEPMETHOD.<pkg> contains a list of either "full" or -# "build", and if any of that list if "full" then we use a full dependency -# on <pkg>, otherwise we use a build dependency on <pkg>. By default, -# we use a full dependency. -# -. if !defined(BUILDLINK_DEPMETHOD.${_pkg_}) -BUILDLINK_DEPMETHOD.${_pkg_}= full -. endif -. if !empty(BUILDLINK_DEPMETHOD.${_pkg_}:Mfull) -_BUILDLINK_DEPMETHOD.${_pkg_}= DEPENDS -_BUILDLINK_RECMETHOD.${_pkg_}= RECOMMENDED -. elif !empty(BUILDLINK_DEPMETHOD.${_pkg_}:Mbuild) -_BUILDLINK_DEPMETHOD.${_pkg_}= BUILD_DEPENDS -. endif -. if defined(BUILDLINK_DEPENDS.${_pkg_}) && \ - defined(BUILDLINK_PKGSRCDIR.${_pkg_}) -. for _depends_ in ${BUILDLINK_DEPENDS.${_pkg_}} -${_BUILDLINK_DEPMETHOD.${_pkg_}}+= \ - ${_depends_}:${BUILDLINK_PKGSRCDIR.${_pkg_}} -. endfor -. endif -. if defined(BUILDLINK_RECOMMENDED.${_pkg_}) && \ - defined(_BUILDLINK_RECMETHOD.${_pkg_}) && \ - defined(BUILDLINK_PKGSRCDIR.${_pkg_}) -. for _rec_ in ${BUILDLINK_RECOMMENDED.${_pkg_}} -${_BUILDLINK_RECMETHOD.${_pkg_}}+= \ - ${_rec_}:${BUILDLINK_PKGSRCDIR.${_pkg_}} -. endfor -. endif -# -# BUILDLINK_PLIST_CMD.<pkg> is a sequence of shell commands that extracts -# a list of all of the files installed by <pkg>. This list is relative to -# ${BUILDLINK_PREFIX.<pkg>}. -# -BUILDLINK_PLIST_CMD.${_pkg_}= \ - ${PKG_INFO} -f ${BUILDLINK_PKGBASE.${_pkg_}} | \ - ${SED} -n '/File:/s/^[ ]*File:[ ]*//p' -.endfor - -# Create the buildlink include and lib directories so that the Darwin -# compiler/linker won't complain verbosely (on stdout, even!) when -# those directories are passed as sub-arguments of -I and -L. -# -do-buildlink: buildlink-directories -buildlink-directories: - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${BUILDLINK_DIR} -.if defined(USE_X11) - ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${BUILDLINK_X11_DIR} - ${_PKG_SILENT}${_PKG_DEBUG}${LN} -sf ${BUILDLINK_DIR} ${BUILDLINK_X11_DIR} -. if empty(USE_X11_LINKS:M[nN][oO]) - ${_PKG_SILENT}${_PKG_DEBUG}cd ${_BLNK_X11_DIR} && ${PAX} -rw . ${BUILDLINK_X11_DIR} -. endif -.endif - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${BUILDLINK_DIR}/include - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${BUILDLINK_DIR}/lib - -# Create the buildlink wrappers before any of the other buildlink targets -# are run, as the wrapper may need to be used in some of those targets. -# -do-buildlink: buildlink-wrappers buildlink-${_BLNK_OPSYS}-wrappers - -# Add each of the *-buildlink targets as a prerequisite for the -# buildlink target. This ensures that the symlinks are created -# before any configure scripts or build commands are called. -# -.for _target_ in ${BUILDLINK_PRE_TARGETS} ${BUILDLINK_TARGETS} -do-buildlink: ${_target_} -.endfor - -# _LT_ARCHIVE_TRANSFORM creates $${dest} from $${file}, where $${file} is -# a libtool archive (*.la). It allows libtool to properly interact with -# buildlink at link time by linking against the libraries pointed to by -# symlinks in ${BUILDLINK_DIR}. -# -_LT_ARCHIVE_TRANSFORM_SED= \ - -e "s|$/usr\(/lib/[^ ]*\.la\)|${BUILDLINK_DIR}\1|g" \ - -e "s|${LOCALBASE}\(/lib/[^ ]*\.la\)|${BUILDLINK_DIR}\1|g" \ - -e "s|${X11BASE}\(/lib/[^ ]*\.la\)|${BUILDLINK_DIR}\1|g" - -_LT_ARCHIVE_TRANSFORM= \ - ${SED} ${_LT_ARCHIVE_TRANSFORM_SED} $${file} > $${dest} - -# _BUILDLINK_USE is a macro target that symlinks package files into a new -# hierarchy under ${BUILDLINK_DIR}. -# -# The variables required to be defined to use this target are listed -# below. <pkg> refers to the name of the package and should be used -# consistently. -# -# The target that uses this macro target should perform no other actions -# and be named "<pkg>-buildlink". -# -# BUILDLINK_PREFIX.<pkg> installation prefix of the package: -# ${LOCALBASE} or ${X11PREFIX} -# -# BUILDLINK_FILES.<pkg> files relative to ${BUILDLINK_PREFIX.<pkg>} -# to be symlinked into ${BUILDLINK_DIR} -# -# BUILDLINK_FILES_CMD.<pkg> shell pipeline that outputs to stdout a list -# of files relative to ${BUILDLINK_PREFIX.<pkg>}; -# the shell variable $${pkg_prefix} may be used -# and is the subdirectory (ending in /) of -# ${BUILDLINK_PREFIX.<pkg>} to which the PLIST -# is relative, e.g. if `pkg_info -qp foo' returns -# "/usr/pkg/java/kaffe", then $${pkg_prefix} is -# "java/kaffe/". -# -# BUILDLINK_TARGETS targets to be invoked during buildlink; -# the targets should be appended to this variable -# using += -# -# The variables that may optionally be defined: -# -# BUILDLINK_TRANSFORM.<pkgname> sed arguments used to transform the name of -# the source filename into a destination -# filename -# -_BUILDLINK_USE: .USE - ${_PKG_SILENT}${_PKG_DEBUG} \ - cookie=${BUILDLINK_DIR}/.${.TARGET:S/-buildlink//}_buildlink_done; \ - if [ ! -f $${cookie} ]; then \ - ${ECHO_BUILDLINK_MSG} "Linking ${.TARGET:S/-buildlink//} files into ${BUILDLINK_DIR}."; \ - ${MKDIR} ${BUILDLINK_DIR}; \ - case "${BUILDLINK_PREFIX.${.TARGET:S/-buildlink//}}" in \ - ${X11BASE}) \ - buildlink_dir="${BUILDLINK_X11_DIR}"; \ - ;; \ - *) \ - buildlink_dir="${BUILDLINK_DIR}"; \ - ;; \ - esac; \ - pkg_prefix=; \ - if [ -n "${BUILDLINK_PKGBASE.${.TARGET:S/-buildlink//}}" ]; then \ - pkg_prefix=`${PKG_INFO} -qp ${BUILDLINK_PKGBASE.${.TARGET:S/-buildlink//}} | ${AWK} '{ sub("${BUILDLINK_PREFIX.${.TARGET:S/-buildlink//}}", "", $$2); sub("/", "", $$2); print $$2; exit }'`/; \ - fi; \ - rel_files_cmd=; \ - if [ -n "${BUILDLINK_FILES_CMD.${.TARGET:S/-buildlink//}:Q}" ]; then \ - rel_files_cmd=`${BUILDLINK_FILES_CMD.${.TARGET:S/-buildlink//}}`; \ - fi; \ - cd ${BUILDLINK_PREFIX.${.TARGET:S/-buildlink//}}; \ - rel_files="${BUILDLINK_FILES.${.TARGET:S/-buildlink//}}"; \ - for rel_file in $${rel_files_cmd} $${rel_files}; do \ - file="${BUILDLINK_PREFIX.${.TARGET:S/-buildlink//}}/$${rel_file}"; \ - if [ -z "${BUILDLINK_TRANSFORM.${.TARGET:S/-buildlink//}:Q}" ]; then \ - dest="$${buildlink_dir}/$${rel_file}"; \ - else \ - dest=`${ECHO} $${buildlink_dir}/$${rel_file} | ${SED} ${BUILDLINK_TRANSFORM.${.TARGET:S/-buildlink//}}`; \ - fi; \ - if [ -f $${file} ]; then \ - dir=`${DIRNAME} $${dest}`; \ - if [ ! -d $${dir} ]; then \ - ${MKDIR} $${dir}; \ - fi; \ - ${RM} -f $${dest}; \ - case $${file} in \ - *.la) \ - ${_LT_ARCHIVE_TRANSFORM}; \ - ;; \ - *) \ - ${LN} -sf $${file} $${dest}; \ - ;; \ - esac; \ - if [ -z "${BUILDLINK_TRANSFORM.${.TARGET:S/-buildlink//}:Q}" ]; then \ - ${ECHO} $${file} >> $${cookie}; \ - else \ - ${ECHO} "$${file} -> $${dest}" >> $${cookie}; \ - fi; \ - else \ - ${ECHO} "$${file}: not found" >> $${cookie}; \ - fi; \ - done; \ - ${TOUCH} ${TOUCH_FLAGS} $${cookie}; \ - fi - -# Create _BLNK_PROTECT and _BLNK_UNPROTECT variables to protect key -# directories from any argument filtering, as they may be subdirectories -# of ${LOCALBASE}, /usr/pkg, or /usr/local. -# -_BLNK_PROTECT= # empty -_BLNK_UNPROTECT= # empty -_BLNK_PROTECT_DIRS= # empty -_BLNK_UNPROTECT_DIRS= # empty - -_BLNK_MANGLE_DIR.BUILDLINK_X11_DIR= _bUiLdLiNk_x11_dIr_ -_BLNK_MANGLE_DIR.BUILDLINK_DIR= _bUiLdLiNk_dIr_ -_BLNK_MANGLE_DIR.ZOULARISBASE= _zOuLaRiSbAsE_ -_BLNK_MANGLE_DIR.WRKDIR= _wRkDiR_ - -_BLNK_PROTECT_DIRS+= BUILDLINK_X11_DIR -_BLNK_PROTECT_DIRS+= BUILDLINK_DIR -.if defined(ZOULARISBASE) && (${ZOULARISBASE} != ${LOCALBASE}) -_BLNK_PROTECT_DIRS+= ZOULARISBASE -.endif -_BLNK_PROTECT_DIRS+= WRKDIR -_BLNK_UNPROTECT_DIRS+= WRKDIR -.if defined(ZOULARISBASE) && (${ZOULARISBASE} != ${LOCALBASE}) -_BLNK_UNPROTECT_DIRS+= ZOULARISBASE -.endif -_BLNK_UNPROTECT_DIRS+= BUILDLINK_DIR -_BLNK_UNPROTECT_DIRS+= BUILDLINK_X11_DIR - -.for _dir_ in ${_BLNK_PROTECT_DIRS} -_BLNK_PROTECT+= s:${${_dir_}}:${_BLNK_MANGLE_DIR.${_dir_}} -.endfor -.for _dir_ in ${_BLNK_UNPROTECT_DIRS} -_BLNK_UNPROTECT+= s:${_BLNK_MANGLE_DIR.${_dir_}}:${${_dir_}} -.endfor - -_BLNK_TRANSFORM+= ${_BLNK_PROTECT} -# -# Change references to ${DEPOTBASE}/<pkg> into ${LOCALBASE} so that -# "overwrite" packages think headers and libraries for "pkgviews" packages -# are just found in the default view. -# -_BLNK_TRANSFORM+= depot:${DEPOTBASE}:${LOCALBASE} -# -# Convert direct paths to shared libraries into "-Ldir -llib" equivalents. -# -_BLNK_TRANSFORM+= p:${X11BASE} -_BLNK_TRANSFORM+= p:${LOCALBASE} -_BLNK_TRANSFORM+= p:/usr/lib -# -# Convert direct paths to static libraries in ${LOCALBASE} or ${X11BASE} -# into references into ${BUILDLINK_DIR}. -# -_BLNK_TRANSFORM+= static:${X11BASE}:${_BLNK_MANGLE_DIR.BUILDLINK_X11_DIR} -_BLNK_TRANSFORM+= static:${LOCALBASE}:${_BLNK_MANGLE_DIR.BUILDLINK_DIR} -# -# Transform references into ${X11BASE} into ${BUILDLINK_X11_DIR} but if -# the package doesn't use X11, then just remove these references altogether. -# -.if defined(USE_X11) -_BLNK_TRANSFORM+= I:${X11BASE}:${_BLNK_MANGLE_DIR.BUILDLINK_X11_DIR} -_BLNK_TRANSFORM+= L:${X11BASE}:${_BLNK_MANGLE_DIR.BUILDLINK_X11_DIR} -.else -_BLNK_TRANSFORM+= r:${X11BASE} -.endif -# -# Transform references into ${LOCALBASE} into ${BUILDLINK_DIR}. -# -_BLNK_TRANSFORM+= ${BUILDLINK_TRANSFORM} -_BLNK_TRANSFORM+= I:${LOCALBASE}:${_BLNK_MANGLE_DIR.BUILDLINK_DIR} -_BLNK_TRANSFORM+= L:${LOCALBASE}:${_BLNK_MANGLE_DIR.BUILDLINK_DIR} -.for _localbase_ in /usr/pkg /usr/local -. if ${LOCALBASE} != ${_localbase_} -_BLNK_TRANSFORM+= r:${_localbase_} -. endif -.endfor -# -# Explicitly remove "-I/usr/include" and "-L/usr/lib" as they're redundant. -# -_BLNK_TRANSFORM+= S:-I/usr/include: -_BLNK_TRANSFORM+= S:-L/usr/lib: -# -# Remove -Wl,-R* and *-rpath* if _USE_RPATH != "yes" -# Transform -Wl,-R* and *-rpath* if Sun compilers are used. -# -.if defined(_USE_RPATH) && empty(_USE_RPATH:M[yY][eE][sS]) -_BLNK_TRANSFORM+= no-rpath -.elif !empty(PKGSRC_COMPILER:Msunpro) -_BLNK_TRANSFORM+= sanitize-rpath -.endif -_BLNK_TRANSFORM+= ${_BLNK_UNPROTECT} - -_BLNK_TRANSFORM_SED+= -f ${_BLNK_TRANSFORM_SEDFILE} -_BLNK_UNTRANSFORM_SED+= -f ${_BLNK_UNTRANSFORM_SEDFILE} - -REPLACE_BUILDLINK_PATTERNS?= # empty -_REPLACE_BUILDLINK_PATTERNS= ${REPLACE_BUILDLINK_PATTERNS} -_REPLACE_BUILDLINK_PATTERNS+= *-config -_REPLACE_BUILDLINK_PATTERNS+= *Conf.sh -_REPLACE_BUILDLINK_PATTERNS+= *.pc -_REPLACE_BUILDLINK_PATTERNS_FIND= \ - \( ${_REPLACE_BUILDLINK_PATTERNS:S/$/!/:S/^/-o -name !/:S/!/"/g:S/-o//1} \) - -REPLACE_BUILDLINK?= # empty -_REPLACE_BUILDLINK= \ - ${REPLACE_BUILDLINK} \ - `${FIND} . ${_REPLACE_BUILDLINK_PATTERNS_FIND} -print | ${SED} -e 's|^\./||' | ${SORT} -u` - -# When "unbuildlinkifying" a file, we must remove references to the -# buildlink directories and change any -llib to the proper replacement -# libraries (-lreadline -> -ledit, etc.). Redundant -Idir and -Ldir -# options are removed to optimize the resulting file. Also, prefer the -# .la files in ${LOCALBASE}/lib over the ones in ${DEPOTBASE}/*/lib when -# creating new .la files. This makes "overwrite" packages look and feel -# more like they would without the pkgviews integration. -# -LIBTOOL_ARCHIVE_UNTRANSFORM_SED?= # empty -_LIBTOOL_ARCHIVE_UNTRANSFORM_SED+= ${LIBTOOL_ARCHIVE_UNTRANSFORM_SED} -REPLACE_BUILDLINK_SED?= # empty -_REPLACE_BUILDLINK_SED= ${REPLACE_BUILDLINK_SED} -_REPLACE_BUILDLINK_SED+= ${_LIBTOOL_ARCHIVE_UNTRANSFORM_SED} - -SUBST_CLASSES+= unbuildlink -SUBST_STAGE.unbuildlink= post-build -SUBST_MESSAGE.unbuildlink= \ - "Fixing buildlink references in files-to-be-installed." -SUBST_FILES.unbuildlink= ${_REPLACE_BUILDLINK} -SUBST_SED.unbuildlink= ${_REPLACE_BUILDLINK_SED} -SUBST_SED.unbuildlink+= ${_BLNK_UNTRANSFORM_SED} - -.if !defined(USE_LIBTOOL) -BUILDLINK_FAKE_LA= ${TRUE} -.else -# -# Create a fake libtool archive $$lafile that uses the shared libraries -# named in $$libpattern. -# -BUILDLINK_FAKE_LA= \ - if [ ! -f $$lafile ]; then \ - case ${OBJECT_FMT} in \ - Mach-O) _lib=`${LS} -1 $$libpattern 2>/dev/null | ${HEAD} -1` ;; \ - *) _lib=`${LS} -1r $$libpattern 2>/dev/null | ${HEAD} -1` ;; \ - esac; \ - if [ -n "$$_lib" ]; then \ - ${ECHO_BUILDLINK_MSG} "Creating libtool archive: $$lafile"; \ - ${_BLNK_FAKE_LA} $$_lib > $$lafile; \ - fi; \ - fi -.endif - -# Generate wrapper scripts for the compiler tools that sanitize the -# argument list by converting references to ${LOCALBASE} and ${X11BASE} -# into references to ${BUILDLINK_DIR} and ${BUILDLINK_X11_DIR}. These -# wrapper scripts are to be used instead of the actual compiler tools when -# building software. -# -# BUILDLINK_CC, BUILDLINK_LD, etc. are the full paths to the wrapper -# scripts. -# -# ALIASES.CC, ALIASES.LD, etc. are the other names by which each wrapper -# may be invoked. -# -_BLNK_WRAPPEES+= AS -_BLNK_WRAPPEES+= CC -_BLNK_WRAPPEES+= CPP -_BLNK_WRAPPEES+= CXX -_BLNK_WRAPPEES+= LD -_BLNK_WRAPPEES+= FC -_BLNK_WRAPPEES+= LIBTOOL SHLIBTOOL -.if defined(USE_LIBTOOL) -_LIBTOOL= ${BUILDLINK_LIBTOOL} -_SHLIBTOOL= ${BUILDLINK_SHLIBTOOL} -.endif -.if defined(USE_X11) -IMAKE?= ${X11BASE}/bin/imake -_BLNK_WRAPPEES+= IMAKE -.endif -_ALIASES.AS= as -_ALIASES.CC= cc gcc -_ALIASES.CXX= c++ g++ CC -_ALIASES.CPP= cpp -_ALIASES.FC= f77 g77 -_ALIASES.LD= ld - -# _BLNK_WRAP_*.<wrappee> variables represent "template methods" of the - -# wrapper script that may be customized per wrapper: -# -# _BLNK_WRAP_{*CACHE*,*LOGIC*}.<wrappee> are parts of the wrapper script -# system as described in pkgsrc/mk/buildlink2/README. The files not -# ending in "-trans" represent pieces of the wrapper script that may -# be used to form a wrapper that doesn't translate its arguments, -# and conversely for the files ending in "-trans". By default, all -# wrappers use the "-trans" scripts. -# -# _BLNK_WRAP_ENV.<wrappee> consists of shell commands to export a shell -# environment for the wrappee. -# -# _BLNK_WRAP_SANITIZE_PATH.<wrappee> sets the PATH for calling executables -# from within the wrapper. By default, it removes the buildlink -# directory from the PATH so that sub-invocations of compiler tools -# will use the wrappees instead of the wrappers. -# -_BLNK_SANITIZED_PATH!= ${ECHO} ${PATH} | ${SED} \ - -e "s|:${BUILDLINK_DIR}[^:]*||" -e "s|${BUILDLINK_DIR}[^:]*:||" -_BLNK_WRAP_SANITIZE_PATH= PATH="${_BLNK_SANITIZED_PATH}" -_BLNK_EMPTY_FILE?= ${BUILDLINK_DIR}/bin/.empty -_BLNK_WRAP_ENV?= ${BUILDLINK_WRAPPER_ENV} -_BLNK_WRAP_PRIVATE_PRE_CACHE= ${BUILDLINK_DIR}/bin/.private-pre-cache -_BLNK_WRAP_PRE_CACHE= ${BUILDLINK_DIR}/bin/.pre-cache -_BLNK_WRAP_CACHE_ADD= ${BUILDLINK_DIR}/bin/.cache-add -_BLNK_WRAP_CACHE= ${BUILDLINK_DIR}/bin/.cache -_BLNK_WRAP_CACHE_ADD_TRANSFORM= ${BUILDLINK_DIR}/bin/.cache-add-trans -_BLNK_WRAP_CACHE_TRANSFORM= ${BUILDLINK_DIR}/bin/.cache-trans -_BLNK_WRAP_POST_CACHE= ${BUILDLINK_DIR}/bin/.post-cache -_BLNK_WRAP_LOGIC= ${BUILDLINK_DIR}/bin/.logic -_BLNK_WRAP_LOGIC_TRANSFORM= ${BUILDLINK_DIR}/bin/.logic-trans -_BLNK_WRAP_LOG= ${WRKLOG} -_BLNK_LIBTOOL_DO_INSTALL= ${BUILDLINK_DIR}/bin/.libtool-do-install -_BLNK_LIBTOOL_FIX_LA= ${BUILDLINK_DIR}/bin/.libtool-fix-la -_BLNK_FAKE_LA= ${BUILDLINK_DIR}/bin/.fake-la -_BLNK_GEN_TRANSFORM= ${BUILDLINK_DIR}/bin/.gen-transform -_BLNK_TRANSFORM_SEDFILE= ${BUILDLINK_DIR}/bin/.transform.sed -_BLNK_UNTRANSFORM_SEDFILE= ${BUILDLINK_DIR}/bin/.untransform.sed - -.for _wrappee_ in ${_BLNK_WRAPPEES} -# -# _BLNK_WRAPPER_SH.<wrappee> points to the main wrapper script used to -# generate the wrapper for the wrappee. -# -_BLNK_WRAPPER_SH.${_wrappee_}= ${.CURDIR}/../../mk/buildlink2/wrapper.sh -_BLNK_WRAP_SANITIZE_PATH.${_wrappee_}= ${_BLNK_WRAP_SANITIZE_PATH} -_BLNK_WRAP_ENV.${_wrappee_}= ${_BLNK_WRAP_ENV} -_BLNK_WRAP_PRIVATE_PRE_CACHE.${_wrappee_}= ${_BLNK_EMPTY_FILE} -_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}= ${_BLNK_EMPTY_FILE} -_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}= ${_BLNK_EMPTY_FILE} -_BLNK_WRAP_PRIVATE_POST_CACHE.${_wrappee_}= ${_BLNK_EMPTY_FILE} -_BLNK_WRAP_CACHE_ADD.${_wrappee_}= ${_BLNK_WRAP_CACHE_ADD_TRANSFORM} -_BLNK_WRAP_CACHE.${_wrappee_}= ${_BLNK_WRAP_CACHE_TRANSFORM} -_BLNK_WRAP_LOGIC.${_wrappee_}= ${_BLNK_WRAP_LOGIC_TRANSFORM} -_BLNK_WRAP_POST_LOGIC.${_wrappee_}= ${_BLNK_EMPTY_FILE} -.endfor - -# Don't sanitize the PATH because we want libtool to invoke the wrapper -# scripts, too. -# -_BLNK_WRAPPER_SH.LIBTOOL= ${.CURDIR}/../../mk/buildlink2/libtool.sh -_BLNK_WRAP_SANITIZE_PATH.LIBTOOL= # empty -# -_BLNK_WRAPPER_SH.SHLIBTOOL= ${.CURDIR}/../../mk/buildlink2/libtool.sh -_BLNK_WRAP_SANITIZE_PATH.SHLIBTOOL= # empty - -# We need to "unbuildlinkify" any libtool archives. -_BLNK_WRAP_LT_UNTRANSFORM_SED= ${_REPLACE_BUILDLINK_SED} - -_BLNK_WRAP_PRIVATE_PRE_CACHE.LD= ${_BLNK_WRAP_PRIVATE_PRE_CACHE} -_BLNK_WRAP_PRIVATE_CACHE_ADD.LD= ${BUILDLINK_DIR}/bin/.ld-cache-add -_BLNK_WRAP_PRIVATE_CACHE.LD= ${BUILDLINK_DIR}/bin/.ld-cache -_BLNK_WRAP_PRIVATE_POST_CACHE.LD= ${BUILDLINK_DIR}/bin/.ld-post-cache -_BLNK_WRAP_POST_LOGIC.LD= ${BUILDLINK_DIR}/bin/.ld-logic - -_BLNK_WRAP_PRIVATE_PRE_CACHE.LIBTOOL= ${_BLNK_WRAP_PRIVATE_PRE_CACHE} -_BLNK_WRAP_PRIVATE_CACHE_ADD.LIBTOOL= ${BUILDLINK_DIR}/bin/.libtool-cache-add -_BLNK_WRAP_PRIVATE_CACHE.LIBTOOL= ${BUILDLINK_DIR}/bin/.libtool-cache -_BLNK_WRAP_PRIVATE_POST_CACHE.LIBTOOL= ${BUILDLINK_DIR}/bin/.libtool-post-cache -_BLNK_WRAP_POST_LOGIC.LIBTOOL= ${BUILDLINK_DIR}/bin/.libtool-logic - -# shlibtool shares cache information with libtool. -_BLNK_WRAP_PRIVATE_PRE_CACHE.SHLIBTOOL= ${_BLNK_WRAP_PRIVATE_PRE_CACHE.LIBTOOL} -_BLNK_WRAP_PRIVATE_CACHE_ADD.SHLIBTOOL= ${_BLNK_WRAP_PRIVATE_CACHE_ADD.LIBTOOL} -_BLNK_WRAP_PRIVATE_CACHE.SHLIBTOOL= ${_BLNK_WRAP_PRIVATE_CACHE.LIBTOOL} -_BLNK_WRAP_PRIVATE_POST_CACHE.SHLIBTOOL= ${_BLNK_WRAP_PRIVATE_POST_CACHE.LIBTOOL} -_BLNK_WRAP_POST_LOGIC.SHLIBTOOL= ${_BLNK_WRAP_POST_LOGIC.LIBTOOL} - -# Don't transform the arguments for imake, which uses the C preprocessor -# to generate Makefiles, so that imake will find its config files. -# -.if defined(USE_X11) -_BLNK_WRAP_CACHE_ADD.IMAKE= ${_BLNK_WRAP_CACHE_ADD} -_BLNK_WRAP_CACHE.IMAKE= ${_BLNK_WRAP_CACHE} -_BLNK_WRAP_LOGIC.IMAKE= ${_BLNK_WRAP_LOGIC} -.endif - -buildlink-wrappers: ${_BLNK_LIBTOOL_DO_INSTALL} -buildlink-wrappers: ${_BLNK_LIBTOOL_FIX_LA} -buildlink-wrappers: ${_BLNK_FAKE_LA} - -.for _wrappee_ in ${_BLNK_WRAPPEES} -. if defined(PKG_${_wrappee_}) -_BLNK_PKG_${_wrappee_}= ${PKG_${_wrappee_}} -. else -_BLNK_PKG_${_wrappee_}= ${${_wrappee_}} -. endif - -BUILDLINK_${_wrappee_}= \ - ${BUILDLINK_DIR}/bin/${_BLNK_PKG_${_wrappee_}:T:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//} -${_wrappee_}:= ${BUILDLINK_${_wrappee_}:T} - -_BLNK_WRAPPER_TRANSFORM_SED.${_wrappee_}= \ - -e "s|@BUILDLINK_DIR@|${BUILDLINK_DIR}|g" \ - -e "s|@BUILDLINK_X11_DIR@|${BUILDLINK_X11_DIR}|g" \ - -e "s|@BUILDLINK_SHELL@|${BUILDLINK_SHELL}|g" \ - -e "s|@WRKDIR@|${WRKDIR}|g" \ - -e "s|@WRKSRC@|${WRKSRC}|g" \ - -e "s|@CAT@|${CAT:Q}|g" \ - -e "s|@ECHO@|${ECHO:Q}|g" \ - -e "s|@SED@|${SED:Q}|g" \ - -e "s|@TEST@|${TEST:Q}|g" \ - -e "s|@TOUCH@|${TOUCH:Q}|g" \ - -e "s|@_BLNK_LIBTOOL_DO_INSTALL@|${_BLNK_LIBTOOL_DO_INSTALL:Q}|g" \ - -e "s|@_BLNK_LIBTOOL_FIX_LA@|${_BLNK_LIBTOOL_FIX_LA:Q}|g" \ - -e "s|@_BLNK_WRAP_LOG@|${_BLNK_WRAP_LOG:Q}|g" \ - -e "s|@_BLNK_WRAP_PRIVATE_PRE_CACHE@|${_BLNK_WRAP_PRIVATE_PRE_CACHE.${_wrappee_}:Q}|g" \ - -e "s|@_BLNK_WRAP_PRIVATE_CACHE_ADD@|${_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}:Q}|g" \ - -e "s|@_BLNK_WRAP_PRIVATE_CACHE@|${_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}:Q}|g" \ - -e "s|@_BLNK_WRAP_PRIVATE_POST_CACHE@|${_BLNK_WRAP_PRIVATE_POST_CACHE.${_wrappee_}:Q}|g" \ - -e "s|@_BLNK_WRAP_PRE_CACHE@|${_BLNK_WRAP_PRE_CACHE:Q}|g" \ - -e "s|@_BLNK_WRAP_CACHE_ADD@|${_BLNK_WRAP_CACHE_ADD.${_wrappee_}:Q}|g" \ - -e "s|@_BLNK_WRAP_CACHE@|${_BLNK_WRAP_CACHE.${_wrappee_}:Q}|g" \ - -e "s|@_BLNK_WRAP_POST_CACHE@|${_BLNK_WRAP_POST_CACHE:Q}|g" \ - -e "s|@_BLNK_WRAP_LOGIC@|${_BLNK_WRAP_LOGIC.${_wrappee_}:Q}|g" \ - -e "s|@_BLNK_WRAP_POST_LOGIC@|${_BLNK_WRAP_POST_LOGIC.${_wrappee_}:Q}|g" \ - -e "s|@_BLNK_WRAP_ENV@|${_BLNK_WRAP_ENV.${_wrappee_}:Q}|g" \ - -e "s|@_BLNK_WRAP_SANITIZE_PATH@|${_BLNK_WRAP_SANITIZE_PATH.${_wrappee_}:Q}|g" - -_BLNK_WRAPPEE_COOKIE.${_wrappee_}= \ - ${BUILDLINK_DIR}/.buildlink_wrapper_${_wrappee_}_done - -buildlink-wrappers: ${_BLNK_WRAPPEE_COOKIE.${_wrappee_}} -${_BLNK_WRAPPEE_COOKIE.${_wrappee_}}: \ - ${_BLNK_WRAPPER_SH.${_wrappee_}} \ - ${_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}} \ - ${_BLNK_WRAP_CACHE.${_wrappee_}} \ - ${_BLNK_WRAP_LOGIC.${_wrappee_}} \ - ${_BLNK_WRAP_POST_LOGIC.${_wrappee_}} - ${_PKG_SILENT}${_PKG_DEBUG}${ECHO_BUILDLINK_MSG} \ - "Creating wrapper: ${BUILDLINK_${_wrappee_}}" - ${_PKG_SILENT}${_PKG_DEBUG} \ - wrappee="${_BLNK_PKG_${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}"; \ - gen=yes; \ - case $${wrappee} in \ - /*) absdir=; \ - ;; \ - *) OLDIFS="$$IFS"; \ - IFS=":"; \ - for dir in $${PATH}; do \ - case $${dir} in \ - *${BUILDLINK_DIR}*) \ - ;; \ - *) if [ -f $${dir}/$${wrappee} ] || \ - [ -h $${dir}/$${wrappee} ] && \ - [ -x $${dir}/$${wrappee} ]; then \ - absdir=$${dir}/; \ - wrappee=$${absdir}$${wrappee}; \ - break; \ - fi; \ - ;; \ - esac; \ - done; \ - IFS="$$OLDIFS"; \ - if [ ! -x "$${wrappee}" ]; then \ - gen=no; \ - ${ECHO_BUILDLINK_MSG} "Warning: unable to create \"$${wrappee}\" wrapper script"; \ - fi; \ - ;; \ - esac; \ - case $$gen in \ - yes) \ - ${MKDIR} ${BUILDLINK_${_wrappee_}:H}; \ - ${CAT} ${_BLNK_WRAPPER_SH.${_wrappee_}} | \ - ${SED} ${_BLNK_WRAPPER_TRANSFORM_SED.${_wrappee_}} \ - -e "s|@WRAPPEE@|$${absdir}${_BLNK_PKG_${_wrappee_}:Q}|g" \ - > ${BUILDLINK_${_wrappee_}}; \ - ${CHMOD} +x ${BUILDLINK_${_wrappee_}}; \ - ;; \ - esac -. for _alias_ in ${_ALIASES.${_wrappee_}:S/^/${BUILDLINK_DIR}\/bin\//} - ${_PKG_SILENT}${_PKG_DEBUG} \ - if [ ! -x ${_alias_} -a -x ${BUILDLINK_${_wrappee_}} ]; then \ - ${ECHO_BUILDLINK_MSG} "Linking wrapper: ${_alias_}"; \ - ${LN} -f ${BUILDLINK_${_wrappee_}} ${_alias_}; \ - fi -. endfor - ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${.TARGET} -.endfor # _wrappee_ - -# Allow BUILDLINK_ENV to override shell environment settings in -# ${CONFIGURE_ENV} and in ${MAKE_ENV} for the configure and build processes, -# respectively. -# -CONFIGURE_ENV+= ${BUILDLINK_ENV} -MAKE_ENV+= ${BUILDLINK_ENV} - -# OS-specific overrides for buildlink2 wrappers -# -.if !empty(PKGSRC_COMPILER:Msunpro) -_BLNK_WRAPPEES.SunOS?= CC CXX -CC.SunOS?= ${CC} -CXX.SunOS?= ${CXX} -.endif - -buildlink-${_BLNK_OPSYS}-wrappers: buildlink-wrappers -.for _wrappee_ in ${_BLNK_WRAPPEES.${_BLNK_OPSYS}} - ${_PKG_SILENT}${_PKG_DEBUG} \ - if [ -x "${${_wrappee_}.${_BLNK_OPSYS}}" ]; then \ - wrapper="${BUILDLINK_DIR}/bin/${${_wrappee_}.${_BLNK_OPSYS}:T}"; \ - ${ECHO_BUILDLINK_MSG} \ - "Creating ${_BLNK_OPSYS} wrapper: $${wrapper}"; \ - ${RM} -f $${wrapper}; \ - ${CAT} ${_BLNK_WRAPPER_SH.${_wrappee_}} | \ - ${SED} ${_BLNK_WRAPPER_TRANSFORM_SED.${_wrappee_}} \ - -e "s|@WRAPPEE@|${${_wrappee_}.${_BLNK_OPSYS}}|g" \ - > $${wrapper}; \ - ${CHMOD} +x $${wrapper}; \ - for file in ${_ALIASES.${_wrappee_}:S/^/${BUILDLINK_DIR}\/bin\//}; do \ - if [ "$${file}" != "$${wrappee}" ]; then \ - ${TOUCH} $${file}; \ - fi; \ - done; \ - fi -.endfor - -${_BLNK_EMPTY_FILE}: - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET} - -${_BLNK_WRAP_PRIVATE_PRE_CACHE}: \ - ${.CURDIR}/../../mk/buildlink2/private-pre-cache - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} - -.for _wrappee_ in ${_BLNK_WRAPPEES} -. if !target(${_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}}) -${_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}}: - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET} -. endif -. if !target(${_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}}) -${_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}}: \ - ${_BLNK_WRAP_PRIVATE_PRE_CACHE.${_wrappee_}} \ - ${_BLNK_WRAP_PRIVATE_CACHE_ADD.${_wrappee_}} \ - ${_BLNK_WRAP_PRIVATE_POST_CACHE.${_wrappee_}} - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} > ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} -. endif -.endfor - -${_BLNK_WRAP_PRIVATE_POST_CACHE.LD}: \ - ${.CURDIR}/../../mk/buildlink2/ld-post-cache - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} - -${_BLNK_WRAP_PRIVATE_POST_CACHE.LIBTOOL}: \ - ${.CURDIR}/../../mk/buildlink2/libtool-post-cache - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} - -${_BLNK_WRAP_PRE_CACHE}: ${.CURDIR}/../../mk/buildlink2/pre-cache - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} - -${_BLNK_WRAP_CACHE_ADD}: - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET} - -${_BLNK_WRAP_CACHE}: \ - ${_BLNK_WRAP_PRE_CACHE} \ - ${_BLNK_WRAP_CACHE_ADD} \ - ${_BLNK_WRAP_POST_CACHE} - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} > ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} - -${_BLNK_WRAP_CACHE_ADD_TRANSFORM}: - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET} - -${_BLNK_WRAP_CACHE_TRANSFORM}: \ - ${_BLNK_WRAP_PRE_CACHE} \ - ${_BLNK_WRAP_CACHE_ADD_TRANSFORM} \ - ${_BLNK_WRAP_POST_CACHE} - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} > ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} - -${_BLNK_WRAP_POST_CACHE}: ${.CURDIR}/../../mk/buildlink2/post-cache - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} - -${_BLNK_WRAP_LOGIC}: ${.CURDIR}/../../mk/buildlink2/logic - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${SED} \ - -e "s|@LOCALBASE@|${LOCALBASE}|g" \ - -e "s|@X11BASE@|${X11BASE}|g" \ - -e 's|@_BLNK_TRANSFORM_SED@||g' \ - ${.ALLSRC} > ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} - -${_BLNK_WRAP_LOGIC_TRANSFORM}: \ - ${.CURDIR}/../../mk/buildlink2/logic \ - ${_BLNK_TRANSFORM_SEDFILE} - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${SED} \ - -e "s|@LOCALBASE@|${LOCALBASE}|g" \ - -e "s|@X11BASE@|${X11BASE}|g" \ - -e 's|@_BLNK_TRANSFORM_SED@|${_BLNK_TRANSFORM_SED:Q}|g' \ - ${.CURDIR}/../../mk/buildlink2/logic > ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} - -${_BLNK_WRAP_POST_LOGIC.LD}: ${.CURDIR}/../../mk/buildlink2/ld-logic - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} - -${_BLNK_WRAP_POST_LOGIC.LIBTOOL}: ${.CURDIR}/../../mk/buildlink2/libtool-logic - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} - -${_BLNK_LIBTOOL_DO_INSTALL}: ${.CURDIR}/../../mk/buildlink2/libtool-do-install - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${CP} -f ${.ALLSRC} ${.TARGET} - -${_BLNK_LIBTOOL_FIX_LA}: \ - ${.CURDIR}/../../mk/buildlink2/libtool-fix-la \ - ${_BLNK_UNTRANSFORM_SEDFILE} - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${SED} \ - -e "s|@WRKSRC@|${WRKSRC}|g" \ - -e "s|@BASENAME@|${BASENAME:Q}|g" \ - -e "s|@CP@|${CP:Q}|g" \ - -e "s|@DIRNAME@|${DIRNAME:Q}|g" \ - -e "s|@EGREP@|${EGREP:Q}|g" \ - -e "s|@MV@|${MV:Q}|g" \ - -e "s|@RM@|${RM:Q}|g" \ - -e "s|@SED@|${SED:Q}|g" \ - -e "s|@TOUCH@|${TOUCH:Q}|g" \ - -e 's|@_BLNK_WRAP_LT_UNTRANSFORM_SED@|${_BLNK_WRAP_LT_UNTRANSFORM_SED:Q}|g' \ - -e 's|@_BLNK_UNTRANSFORM_SED@|${_BLNK_UNTRANSFORM_SED:Q}|g' \ - ${.CURDIR}/../../mk/buildlink2/libtool-fix-la > ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} - -.if ${OBJECT_FMT} == "a.out" -_RESET_LD_SO_CACHE?= ${LDCONFIG} -.else -_RESET_LD_SO_CACHE?= ${TRUE} -.endif - -${_BLNK_FAKE_LA}: ${.CURDIR}/../../mk/buildlink2/fake-la - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${SED} \ - -e "s|@BUILDLINK_DIR@|${BUILDLINK_DIR}|g" \ - -e "s|@BUILDLINK_X11_DIR@|${BUILDLINK_X11_DIR}|g" \ - -e "s|@BUILDLINK_SHELL@|${BUILDLINK_SHELL}|g" \ - -e "s|@AR@|${AR:Q}|g" \ - -e "s|@AWK@|${AWK:Q}|g" \ - -e "s|@BASENAME@|${BASENAME:Q}|g" \ - -e "s|@CC@|${BUILDLINK_CC:Q}|g" \ - -e "s|@LDFLAGS@|${LDFLAGS:N-l*:Q}|g" \ - -e "s|@CP@|${CP:Q}|g" \ - -e "s|@DIRNAME@|${DIRNAME:Q}|g" \ - -e "s|@ECHO@|${ECHO:Q}|g" \ - -e "s|@EGREP@|${EGREP:Q}|g" \ - -e "s|@RESET_LD_SO_CACHE@|${_RESET_LD_SO_CACHE:Q}|g" \ - -e "s|@LIBTOOL@|${BUILDLINK_LIBTOOL:Q}|g" \ - -e "s|@MKDIR@|${MKDIR:Q}|g" \ - -e "s|@MV@|${MV:Q}|g" \ - -e "s|@PATH@|${PATH:Q}|g" \ - -e "s|@RM@|${RM:Q}|g" \ - -e "s|@SED@|${SED:Q}|g" \ - -e "s|@TEST@|${TEST:Q}|g" \ - ${.ALLSRC} > ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} - -${_BLNK_GEN_TRANSFORM}: ${.CURDIR}/../../mk/buildlink2/gen-transform.sh - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${SED} \ - -e "s|@_BLNK_TRANSFORM_SEDFILE@|${_BLNK_TRANSFORM_SEDFILE:Q}|g" \ - -e "s|@_BLNK_UNTRANSFORM_SEDFILE@|${_BLNK_UNTRANSFORM_SEDFILE:Q}|g" \ - -e "s|@_COMPILER_LD_FLAG@|${_COMPILER_LD_FLAG:Q}|g" \ - -e "s|@_OPSYS_RPATH_NAME@|${_OPSYS_RPATH_NAME:Q}|g" \ - -e "s|@BUILDLINK_SHELL@|${BUILDLINK_SHELL:Q}|g" \ - -e "s|@CAT@|${CAT:Q}|g" \ - ${.ALLSRC} > ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}.tmp - ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET} - -${_BLNK_TRANSFORM_SEDFILE} ${_BLNK_UNTRANSFORM_SEDFILE}: ${_BLNK_GEN_TRANSFORM} - ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} - ${_PKG_SILENT}${_PKG_DEBUG}${_BLNK_GEN_TRANSFORM} \ - ${_BLNK_TRANSFORM} - -_BLNK_CHECK_PATTERNS+= -e "-I${LOCALBASE}/[a-rt-z]" -_BLNK_CHECK_PATTERNS+= -e "-L${LOCALBASE}/[a-rt-z]" -_BLNK_CHECK_PATTERNS+= -e "-I${X11BASE}/" -_BLNK_CHECK_PATTERNS+= -e "-L${X11BASE}/" - -buildlink-check: - @if [ -f ${_BLNK_WRAP_LOG} ]; then \ - ${GREP} ${_BLNK_CHECK_PATTERNS} ${_BLNK_WRAP_LOG} || ${TRUE}; \ - fi diff --git a/mk/buildlink2/buildlink2.txt b/mk/buildlink2/buildlink2.txt deleted file mode 100644 index 02372db738b..00000000000 --- a/mk/buildlink2/buildlink2.txt +++ /dev/null @@ -1,91 +0,0 @@ -$NetBSD: buildlink2.txt,v 1.9 2002/12/27 20:34:53 schmonz Exp $ - -The buildlink2 framework is a departure from the original buildlink -framework, which tried to do its work up-front before the configure -process and fix things up after the build process. Over time, the -buildlink framework grew overly complex to deal with software that stored -build-time information in the installed files, e.g. GNOME packages. The -new framework actually does its work as the software is being configured -and built through a series of wrapper scripts that are used in place of the -normal compiler tools. We still symlink libraries and headers into -${BUILDLINK_DIR} to normalize the environment in which the software is -built, but now we tell the configure process the actual installed locations -of the libraries and headers we are using, and the compiler wrappers will -munge them into references into ${BUILDLINK_DIR}. - -To-do list: - - (*) Write regression test targets to make sure _BLNK_TRANSFORM_SED - is doing what it's supposed to do. - - (*) Since buildlink2 is a layer of abstraction atop the toolchain, - it's a logical place to deal with the vagaries of unusual - toolchains. For example, on Darwin we could reliably pass - the "-no-cpp-precomp" switch to every compiler invocation - by emitting it from the compiler wrapper. Likewise, the - use of _USE_RPATH in bsd.pkg.mk might be better handled in - the linker wrapper. More: _STRIPFLAG_CC, _STRIPFLAG_INSTALL, - compiler optimization flags. - -Here are some FAQs and answers regarding buildlink2: - -Q1: Why is the buildlink2 framework better than the old one? -A1: There are several reasons: - - (1) The new framework makes it simpler to buildinkify a package because - we just convert dependencies into including the equivalent - buildlink2.mk files and define USE_BUILDLINK2. We don't need - to lie about where libraries or headers we use are installed. - - (2) All packages using the new framework are strongly buildlinked; it - is not possible to create weakly buildlinked packages. This - deprecates the need for x11.buildlink.mk. - - (3) We no longer care if the configure or build processes add - -I${PREFIX}/include or -L${PREFIX}/lib to the compiler or linker - lines. We _want_ them to do so (and we actually add them - ourselves) since they are munged into references to - ${BUILDLINK_DIR) by the wrapper scripts. - - (4) We no longer need to create and use config script wrappers. - - (5) buildlink2.mk files now simply create the <pkg>-buildlink target - and can discard the REPLACE_BUILDLINK and *CONFIG_WRAPPER* lines. - - (6) We no longer mess around with configure scripts or Makefiles before - the build process, so we don't accidentally trigger rebuilds of - those files if the software uses GNU autoconf/automake. - - (7) We no longer mess around with libtool archives after the build - process, so we don't accidentally trigger rebuilds of those files - during the install process. - -Q2: How does this affect packages that use the old buildlink framework? -A2: The buildlink and buildlink2 frameworks can coexist within pkgsrc, but - packages that use the new framework must use it exclusively, i.e. a - package Makefile can't include both buildlink.mk and buildlink2.mk - files. Packages that use the old framework can continue to do so, but - it is encouraged that they convert to the new buildlink2 framework for - the benefits listed earlier. - -Q3: Can I make strongly buildlinked packages that use imake? -A3: Yes. Packages that use imake to drive the configuration and build - processes can now be strongly buildlinked as well. - -Q4: How do I use compilers other than the system-supplied cc? I currently - set CC=/my/special/c-compiler in /etc/mk.conf. -A4: It should Just Work. The wrapper scripts automatically handle this - situation. The software is told to use CC=cc, which points to the - special compiler wrapper script in ${BUILDLINK_DIR}/bin/cc, but the - wrapper itself will call the CC that you explicitly set. - -Q5: So what's bad about the new buildlink2 framework? -A5: The full build now takes longer than it used to. Since we are using - wrapper scripts in place of the compilers, we bear the cost of the extra - shell processes invoked as a result. - -Q6: What happened to x11.buildlink.mk? -A6: x11.buildlink.mk is now deprecated, as it's all handled directly by - the buildlink2.mk framework. However, in converting packages to use - buildlink2, if it uses x11.buildlink.mk, then you will need to define - USE_X11 if USE_X11BASE is not already defined. diff --git a/mk/buildlink2/fake-la b/mk/buildlink2/fake-la deleted file mode 100644 index 621de37e188..00000000000 --- a/mk/buildlink2/fake-la +++ /dev/null @@ -1,109 +0,0 @@ -#!@BUILDLINK_SHELL@ -# -# $NetBSD: fake-la,v 1.13 2004/07/06 20:47:15 heinz Exp $ - -AR="@AR@" -AWK="@AWK@" -BASENAME="@BASENAME@" -CC="@CC@" -CP="@CP@" -DIRNAME="@DIRNAME@" -ECHO="@ECHO@" -LIBTOOL="@LIBTOOL@ --quiet" -MKDIR="@MKDIR@" -MV="@MV@" -RM="@RM@" -SED="@SED@" -TEST="@TEST@" - -BUILDLINK_DIR="@BUILDLINK_DIR@" - -reallib="$1" -realdir=`${DIRNAME} $reallib` -libname=`${BASENAME} $reallib` -tmpdir=${BUILDLINK_DIR}/.tmp - -case $libname in - *.so) - # no version in name which happens e.g. for libpthread.so on Linux - # Suse 8.1, Slackware 8.1 and others, but there, the library is a link - # to a library with a version in it - libbase=`${ECHO} $libname | ${SED} -e "s/\.so$//"` - if ${TEST} -h $reallib; then - liblinked=`ls -l $reallib | ${AWK} '{print $NF}'` - version=`${ECHO} $liblinked | ${SED} -e "s/.*\.so\.//;s/\./:/g"` - else - # bail out - ${ECHO} "could not determine version of $reallib" - exit 1 - fi - ;; - - *.so.[0-9]*) - libbase=`${ECHO} $libname | ${SED} -e "s/\.so\.[0-9.]*$//"` - version=`${ECHO} $libname | ${SED} -e "s/.*\.so\.//;s/\./:/g"` - ;; - - *[0-9].dylib) - libbase=`${ECHO} $libname | ${SED} -e "s/\.[0-9.]*\.dylib$//"` - version=`${ECHO} $libname | ${SED} -e "s/^[^.]*\.\([0-9]*\.[0-9]*\)\.dylib/\1/;s/\./:/g"` - ;; - *.a) - libbase=`${ECHO} $libname | ${SED} -e "s/\.a$//"` - ltlib="$realdir/$libbase.la" - # If there's already a libtool .la file, use it. - if ${TEST} -f "$ltlib" ; then - current=`${SED} -n -e'/^current=[[:digit:]]/{ s/^current=//; p; };' "$ltlib"` - rev=`${SED} -n -e'/^revision=[[:digit:]]/{ s/^revision=//; p; };' "$ltlib"` - current=$(($current + 0)) - rev=$(($rev + 0)) - version="$current.$rev" - else - # Try looking inside the archive - sublibname=`${AR} t "$reallib" | ${AWK} ' /.*\.so\..*/ { print $1 ; exit } '` - case $sublibname in - *.so.*) - version=`${ECHO} "$sublibname" | ${SED} -e "s/.*\.so\.//;s/\./:/g"` - ;; - *) - version="0" - ;; - esac - fi - ;; - *) - # bail out - ${ECHO} "$0: unknown library type for $libname" - exit 1 - ;; -esac - -if ${TEST} ! -f $tmpdir/inst/$libbase.la; then - PATH="@PATH@"; export PATH - ${MKDIR} $tmpdir/inst - cd $tmpdir - ${ECHO} "static int i;" > nonempty.c # create a nonempty input file - ${LIBTOOL} --mode=compile ${CC} -c nonempty.c - ${LIBTOOL} --mode=link ${CC} @LDFLAGS@ -o $libbase.la nonempty.lo -rpath $tmpdir/inst -version-info $version - ${LIBTOOL} --mode=install ${CP} $libbase.la $tmpdir/inst >/dev/null - - # Reset the ld.so cache as "libtool --mode=install" may have executed - # ldconfig to add "$tmpdir/inst" to the cache. - # - @RESET_LD_SO_CACHE@ >/dev/null 2>&1 - -fi - -dlname=`${SED} -n -e"/^dlname='/{ s/^dlname='//; s/'$//; p; };" "$tmpdir/inst/$libbase.la"` -library_names=`${SED} -n -e"/^library_names='/{ s/^library_names='//; s/'$//; p; };" "$tmpdir/inst/$libbase.la"` -old_library=`${SED} -n -e"/^old_library='/{ s/^old_library='//; s/'$//; p; };" "$tmpdir/inst/$libbase.la"` - -for file in $dlname $library_names $old_library -do - if ${TEST} ! -r $realdir/$file - then - removal_pattern="$removal_pattern -e s,$file\([^.0-9]\),\1,g" - fi -done - -${SED} -e "s,$tmpdir/inst,$realdir,g" $removal_pattern $tmpdir/inst/$libbase.la diff --git a/mk/buildlink2/gen-transform.sh b/mk/buildlink2/gen-transform.sh deleted file mode 100644 index d4afb3b8175..00000000000 --- a/mk/buildlink2/gen-transform.sh +++ /dev/null @@ -1,163 +0,0 @@ -#!@BUILDLINK_SHELL@ -# -# $NetBSD: gen-transform.sh,v 1.13 2003/09/02 06:59:51 jlam Exp $ - -transform="@_BLNK_TRANSFORM_SEDFILE@" -untransform="@_BLNK_UNTRANSFORM_SEDFILE@" - -# Mini-language for translating wrapper arguments into their buildlink -# equivalents: -# -# I:src:dst translates "-Isrc" into "-Idst" -# L:src:dst translates "-Lsrc" into "-Ldst" -# l:foo:bar translates "-lfoo" into "-lbar" -# p:path translates "path/*/libfoo.so" into -# "-Lpath/* -lfoo" -# r:dir removes "dir" and "dir/*" -# S:foo:bar translates word "foo" into "bar" -# s:foo:bar translates "foo" into "bar" -# static:src:dst translates "src/libfoo.a" into "dst/libfoo.a" -# no-rpath removes "-R*", "-Wl,-R", and "-Wl,-rpath,*" -# sanitize-rpath translates "-Wl,-R", and "-Wl,-rpath,*" -# to whatever is appropriate - -gen() { - action=$1; shift - case "$action" in - transform) sedfile="$transform" ;; - untransform) sedfile="$untransform" ;; - esac - save_IFS="${IFS}"; IFS=":" - set -- $1 - IFS="${save_IFS}" - case "$1" in - I|L) - case "$action" in - transform) - @CAT@ >> $sedfile << EOF -s|-$1$2[ ]$|-$1$3 |g -s|-$1$2$|-$1$3|g -s|-$1$2/|-$1$3/|g -EOF - ;; - untransform) - @CAT@ >> $sedfile << EOF -s|-$1$3[ ]$|-$1$2 |g -s|-$1$3$|-$1$2|g -s|-$1$3/|-$1$2/|g -EOF - ;; - esac - ;; - l) - case "$action" in - transform|untransform) - @CAT@ >> $sedfile << EOF -s|-$1$2[ ]|-$1$3 |g -s|-$1$2$|-$1$3|g -s|-$1$2/|-$1$3/|g -EOF - ;; - esac - ;; - static) - case "$action" in - transform) - @CAT@ >> $sedfile << EOF -s|$2\(/[^ "':;]*/lib[^ /"':;]*\.a\)[ ]|$3\1 |g -s|$2\(/[^ "':;]*/lib[^ /"':;]*\.a\)$|$3\1|g -EOF - ;; - untransform) - @CAT@ >> $sedfile << EOF -s|$3\(/[^ "':;]*/lib[^ /"':;]*\.a\)[ ]|$2\1 |g -s|$3\(/[^ "':;]*/lib[^ /"':;]*\.a\)$|$2\1|g -EOF - ;; - esac - ;; - p) - case "$action" in - transform|untransform) - @CAT@ >> $sedfile << EOF -s|\($2/[^ "':;]*\)/lib\([^ /"':;]*\)\.so|-L\1 -l\2|g -s|\($2\)/lib\([^ /"':;]*\)\.so|-L\1 -l\2|g -EOF - ;; - esac - ;; - _r) - case "$action" in - transform|untransform) - @CAT@ >> $sedfile << EOF -s|$2[ ]| |g -s|$2$||g -s|$2/[^ "':;]*||g -EOF - ;; - esac - ;; - r) - gen $action _r:-I$2 - gen $action _r:-L$2 - gen $action _r:-Wl,-R$2 - gen $action _r:-Wl,-rpath,$2 - gen $action _r:-R$2 - ;; - S) - case "$action" in - transform|untransform) - @CAT@ >> $sedfile << EOF -s|$2[ ]|$3 |g -s|$2$|$3|g -EOF - ;; - esac - ;; - s) - case "$action" in - transform|untransform) - @CAT@ >> $sedfile << EOF -s|$2|$3|g -EOF - ;; - esac - ;; - no-rpath) - case "$action" in - transform|untransform) - @CAT@ >> $sedfile << EOF -s|-Wl,-R[^ "':;]*||g -s|-Wl,-rpath,[^ "':;]*||g -s|-R[^ "':;]*||g -EOF - ;; - esac - ;; - sanitize-rpath) - case "$action" in - transform|untransform) - @CAT@ >> $sedfile << EOF -s|-Wl,-R\([^ "':;]*\)|@_COMPILER_LD_FLAG@@_OPSYS_RPATH_NAME@\1|g -s|-Wl,-rpath,\([^ "':;]*\)|@_COMPILER_LD_FLAG@@_OPSYS_RPATH_NAME@\1|g -EOF - ;; - esac - ;; - depot) - case "$action" in - transform|untransform) - @CAT@ >> $sedfile << EOF -s|$2/[^/ \`"':;]*\(/[^ \`"':;]\)|$3\1|g -s|$2/[^/ \`"':;]*$|$3|g -EOF - ;; - esac - ;; - esac -} - -for arg do - gen transform "$arg" - gen untransform "$arg" -done diff --git a/mk/buildlink2/ld-logic b/mk/buildlink2/ld-logic deleted file mode 100644 index f2edf7a6135..00000000000 --- a/mk/buildlink2/ld-logic +++ /dev/null @@ -1,8 +0,0 @@ -# $NetBSD: ld-logic,v 1.3 2002/12/26 17:08:56 jlam Exp $ - -case $arg in --Wl,*) - arg=`$echo "X$arg" | $Xsed -e "s|^-Wl,||g" -e "s|,| |g"` - addtoprivatecache=yes - ;; -esac diff --git a/mk/buildlink2/ld-post-cache b/mk/buildlink2/ld-post-cache deleted file mode 100644 index 356befab748..00000000000 --- a/mk/buildlink2/ld-post-cache +++ /dev/null @@ -1,6 +0,0 @@ -# $NetBSD: ld-post-cache,v 1.1 2002/12/26 17:08:56 jlam Exp $ - --Wl,*) - skipcache=yes - ;; -esac diff --git a/mk/buildlink2/libtool-do-install b/mk/buildlink2/libtool-do-install deleted file mode 100644 index 66384509755..00000000000 --- a/mk/buildlink2/libtool-do-install +++ /dev/null @@ -1,17 +0,0 @@ -# $NetBSD: libtool-do-install,v 1.1 2002/12/26 17:08:56 jlam Exp $ - -cmd="$cmd $arg" -while $test $# -gt 0; do - arg="$1"; shift - case $arg in - *[\`\"\$\\]*) - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - ;; - esac - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - cmd="$cmd $arg" -done diff --git a/mk/buildlink2/libtool-fix-la b/mk/buildlink2/libtool-fix-la deleted file mode 100644 index 1fd4cb909a0..00000000000 --- a/mk/buildlink2/libtool-fix-la +++ /dev/null @@ -1,199 +0,0 @@ -# $NetBSD: libtool-fix-la,v 1.22 2003/09/02 06:59:51 jlam Exp $ -# -# For *.la files, in the "relink_command" line, we make the following -# replacements: -# -# "libfoo.la" -> "-L./.libs libfoo.la" -# "dirpath/libfoo.la" -> "-Ldirpath/.libs libfoo.la" -# -# This allows the libraries to be found within ${WRKSRC} during relinking. -# We rely on the proper rpath settings to be set by libtool. -# -# For the *.lai files, in the "dependency_libs" line, we remove redundant -# -Ldir and -llib options. - -labase=`@BASENAME@ $lafile .la` -ladir=`@DIRNAME@ $lafile` -latimestamp=${ladir}/.${labase}.la.timestamp -laifile=${ladir}/.libs/${labase}.lai -if $test -f $lafile; then - . ${ladir}/${labase}.la - - deps= - for i in ${dependency_libs}; do - case "$i" in - -L*) - case "$deps" in - *"$i "*) ;; - *"$i") ;; - *) deps="${deps} $i" ;; - esac - ;; - *.la) - fixla=0 - ltlibsdir=`@DIRNAME@ $i`/.libs - case "$ltlibsdir" in - /*) - # fix if an absolute path in ${WRKSRC} - case "$ltlibsdir" in - @WRKSRC@/*) fixla=1 ;; - esac - ;; - *) - # fix all relative paths - fixla=1 - ;; - esac - if $test $fixla -gt 0; then - case "$deps" in - *"-L$ltlibsdir "*) ;; - *"-L$ltlibsdir") ;; - *) deps="$deps -L$ltlibsdir" ;; - esac - fi - deps="${deps} $i" - ;; - *) - deps="${deps} $i" - ;; - esac - done - - relink= - for i in ${relink_command}; do - case "$i" in - -I*|-D*) - ;; - -L*) - case "$relink" in - *"$i "*) ;; - *"$i") ;; - *) relink="${relink} $i" ;; - esac - ;; - $lafile) - relink="${relink} $i" - ;; - *.la) - fixla=0 - ltlibsdir=`@DIRNAME@ $i`/.libs - case "$ltlibsdir" in - /*) - # fix if an absolute path in ${WRKSRC} - case "$ltlibsdir" in - @WRKSRC@/*) fixla=1 ;; - esac - ;; - *) - # fix all relative paths - fixla=1 - ;; - esac - if $test $fixla -gt 0; then - case "$relink" in - *"-L$ltlibsdir "*) ;; - *"-L$ltlibsdir") ;; - *) relink="$relink -L$ltlibsdir" ;; - esac - fi - relink="${relink} $i" - ;; - *) - relink="${relink} $i" - ;; - esac - done - if $test -z "$deps" && $test -z "$relink" || \ - @EGREP@ "^#.*modified by buildlink2" $lafile >/dev/null 2>&1; then - : - else - @MV@ -f $lafile ${lafile}.blsav - if $test -n "$deps"; then - ( - $cat ${lafile}.blsav | @SED@ -e '/^dependency_libs=/,$d' - $echo "dependency_libs='$deps'" - $cat ${lafile}.blsav | @SED@ -e '1,/^dependency_libs=/d' - ) > ${lafile}.tmp - else - $cat ${lafile}.blsav > ${lafile}.tmp - fi - if $test -n "$relink"; then - ( - $cat ${lafile}.tmp | @SED@ -e '/^relink_command=/,$d' - $echo "relink_command='$relink'" - $cat ${lafile}.tmp | @SED@ -e '1,/^relink_command=/d' - ) > $lafile - else - $cat ${lafile}.tmp > $lafile - fi - $echo >> $lafile - $echo "# This file has been modified by buildlink2." >> $lafile - @RM@ ${lafile}.tmp - $echo "==> Fixed $lafile" >> $wrapperlog - fi - if $test -z "$laifile" || $test ! -f "$laifile" || \ - @EGREP@ "^#.*modified by buildlink2" $laifile >/dev/null 2>&1; then - : - else - @SED@ @_BLNK_WRAP_LT_UNTRANSFORM_SED@ \ - @_BLNK_UNTRANSFORM_SED@ \ - $laifile > ${laifile}.tmp - . ${laifile}.tmp - L=; l=; lexist=; prev= - for i in ${dependency_libs}; do - case "$i" in - $prev) - ;; - -R*) - # skip all -R* options... rpath info shouldn't - # go into the dependency_libs line. - ;; - -L*) - case "$i" in - -L${BUILDLINK_DIR}|-L${BUILDLINK_DIR}/*) - ;; - -L${BUILDLINK_X11_DIR}|-L${BUILDLINK_X11_DIR}/*) - ;; - -L@WRKSRC@|-L@WRKSRC@/*) - ;; - *) - case "$L" in - *"$i "*) ;; - *"$i") ;; - *) L="$L $i" ;; - esac - ;; - esac - ;; - -l*) - lexist=1 - l="$l $i" - ;; - *) - l="$l $i" - ;; - esac - prev="$i" - done - if $test -z "$lexist"; then - L= - fi - deps="$L$l" - @MV@ -f $laifile ${laifile}.blsav - ( - $cat ${laifile}.tmp | @SED@ -e '/^dependency_libs=/,$d' - $echo "dependency_libs='$deps'" - $cat ${laifile}.tmp | @SED@ -e '1,/^dependency_libs=/d' - $echo - $echo "# This file has been modified by buildlink2." - ) > ${laifile} - @RM@ -f ${laifile}.tmp - $echo "==> Fixed $laifile" >> $wrapperlog - if $test "$libdir" != "${BUILDLINK_DIR}/.tmp/inst" && \ - @EGREP@ "${BUILDLINK_X11_DIR}|${BUILDLINK_DIR}" $laifile >/dev/null 2>&1; then - $echo "==> [buildlink2] Error: buildlink2 leakage into $laifile" >> $wrapperlog - $echo "==> [buildlink2] Error: buildlink2 leakage into $laifile" 1>&2 - wrapper_result=1 - fi - fi -fi diff --git a/mk/buildlink2/libtool-logic b/mk/buildlink2/libtool-logic deleted file mode 100644 index 6813218eba3..00000000000 --- a/mk/buildlink2/libtool-logic +++ /dev/null @@ -1,43 +0,0 @@ -# $NetBSD: libtool-logic,v 1.5 2003/01/07 07:34:39 jlam Exp $ - -case $arg in --L.|-L./*|-L..*|-L${WRKSRC}*) - case $fixlibpath in - yes) - case $arg in - */.libs) - # ignore -L.../.libs - ;; - *) - $echo "*** [buildlink2] Warning: libtool detected $arg" >> $wrapperlog - $echo "*** [buildlink2] Warning: libtool detected $arg" 1>&2 - lpath=`$echo "X$arg" | $Xsed -e "s/^-L//"` - case "$rellpath" in - *"$lpath "*) ;; - *"$lpath"*) ;; - *) rellpath="$rellpath $lpath" ;; - esac - ;; - esac - ;; - esac - ;; --l*) - case $fixlibpath in - yes) - lib=`$echo "X$arg" | $Xsed -e "s/^-l//"` - for dir in $rellpath; do - la="$dir/lib$lib.la" - if $test -f "$la"; then - $echo "*** [buildlink2] Warning: libtool replaced $arg with $la" >> $wrapperlog - $echo "*** [buildlink2] Warning: libtool replaced $arg with $la" 1>&2 - arg="$la" - cachesettings='skipcache=yes' - break - fi - done - ;; - esac - addtoprivatecache=yes - ;; -esac diff --git a/mk/buildlink2/libtool-post-cache b/mk/buildlink2/libtool-post-cache deleted file mode 100644 index e77f9366e5b..00000000000 --- a/mk/buildlink2/libtool-post-cache +++ /dev/null @@ -1,6 +0,0 @@ -# $NetBSD: libtool-post-cache,v 1.1 2002/12/26 17:17:32 jlam Exp $ - --L.|-L./*|-L..*|-L${WRKSRC}*|-l*) - skipcache=yes - ;; -esac diff --git a/mk/buildlink2/libtool.sh b/mk/buildlink2/libtool.sh deleted file mode 100644 index 706684905a9..00000000000 --- a/mk/buildlink2/libtool.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!@BUILDLINK_SHELL@ -# -# $NetBSD: libtool.sh,v 1.11 2004/02/05 08:27:18 jlam Exp $ - -Xsed='@SED@ -e 1s/^X//' -sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' - -private_pre_cache="@_BLNK_WRAP_PRIVATE_PRE_CACHE@" -private_cache_add="@_BLNK_WRAP_PRIVATE_CACHE_ADD@" -private_cache="@_BLNK_WRAP_PRIVATE_CACHE@" -private_post_cache="@_BLNK_WRAP_PRIVATE_POST_CACHE@" -pre_cache="@_BLNK_WRAP_PRE_CACHE@" -cache_add="@_BLNK_WRAP_CACHE_ADD@" -cache="@_BLNK_WRAP_CACHE@" -post_cache="@_BLNK_WRAP_POST_CACHE@" -logic="@_BLNK_WRAP_LOGIC@" -post_logic="@_BLNK_WRAP_POST_LOGIC@" - -wrapperlog="${BUILDLINK_WRAPPER_LOG-@_BLNK_WRAP_LOG@}" - -libtool_fix_la="@_BLNK_LIBTOOL_FIX_LA@" -libtool_do_install="@_BLNK_LIBTOOL_DO_INSTALL@" -fixlibpath=${BUILDLINK_FIX_IMPROPER_LIBTOOL_LIBPATH-yes} - -updatecache=${BUILDLINK_UPDATE_CACHE-yes} -cacheall=${BUILDLINK_CACHE_ALL-no} - -cat="@CAT@" -echo="@ECHO@" -test="@TEST@" - -BUILDLINK_DIR="@BUILDLINK_DIR@" -BUILDLINK_X11_DIR="@BUILDLINK_X11_DIR@" -WRKDIR="@WRKDIR@" -WRKSRC="@WRKSRC@" - -original_cmd="$0 $@" -$echo [*] $original_cmd >> $wrapperlog - -cmd="@WRAPPEE@" -lafile= -case "$1" in -*install|*cp|*install-sh|*install.sh) - arg="$1"; shift - . $libtool_do_install - ;; -*) - while $test $# -gt 0; do - arg="$1"; shift - case $arg in - --fix-la) - case "$1" in - *.la) - lafile="$1" - . $libtool_fix_la - exit - ;; - esac - ;; - --mode|--mode=install) - if $test "$arg" = "--mode=install" || \ - $test "$arg" = "--mode" -a "$1" = "install"; then - . $libtool_do_install - break - fi - ;; - -o) - case "$1" in - *.la) lafile="$1" ;; - esac - ;; - *) - cachehit=no - skipcache=no - . $private_cache - case $skipcache,$cachehit in - no,no) . $cache ;; - esac - case $cachehit in - no) . $logic ;; - esac - ;; - esac - cmd="$cmd $arg" - done - ;; -esac - -@_BLNK_WRAP_ENV@ -@_BLNK_WRAP_SANITIZE_PATH@ - -$echo "<.>" $cmd >> $wrapperlog -eval $cmd -wrapper_result=$? - -if $test -n "$lafile" && $test -f "$lafile"; then - . $libtool_fix_la -fi - -exit ${wrapper_result} diff --git a/mk/buildlink2/logic b/mk/buildlink2/logic deleted file mode 100644 index 3f60a3cf705..00000000000 --- a/mk/buildlink2/logic +++ /dev/null @@ -1,75 +0,0 @@ -# $NetBSD: logic,v 1.2 2003/01/10 09:41:53 jlam Exp $ - -quotedarg=no -addtocache=no -addtoprivatecache=no -cachesettings='arg="$cachearg"; cachehit=yes' - -# $qarg contains a correctly-quoted $arg -case $arg in -*[\`\"\$\\]*) - qarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - quotedarg=yes - ;; -*) - qarg="$arg" - ;; -esac -case $qarg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg="\"$qarg\"" - quotedarg=yes - ;; -esac -searcharg="$qarg" - -case $arg in --D*) - arg="$qarg" - addtocache=yes - ;; --[ILRl]*|-Wl,*|/usr/lib/lib*|@LOCALBASE@/*/lib*|@X11BASE@/*/lib*) - arg=`$echo "X$qarg" | $Xsed @_BLNK_TRANSFORM_SED@` - addtocache=yes - ;; -*) - arg="$qarg" - addtocache=no - ;; -esac - -. $post_logic - -case $updatecache,$addtocache,$cacheall,$quotedarg in -yes,yes,yes,*|yes,yes,no,no) - case $arg in - *[\`\"\$\\]*) - cachearg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - ;; - *) - cachearg="$arg" - ;; - esac - case $addtoprivatecache in - yes) - pre_cachefile=$private_pre_cache - cachefile_add=$private_cache_add - cachefile=$private_cache - post_cachefile=$private_post_cache - ;; - *) - pre_cachefile=$pre_cache - cachefile_add=$cache_add - cachefile=$cache - post_cachefile=$post_cache - ;; - esac - $cat >> $cachefile_add << EOF -$searcharg) - cachearg="$cachearg" - $cachesettings - ;; -EOF - $cat $pre_cachefile $cachefile_add $post_cachefile > $cachefile - ;; -esac diff --git a/mk/buildlink2/post-cache b/mk/buildlink2/post-cache deleted file mode 100644 index 2c8370b4d72..00000000000 --- a/mk/buildlink2/post-cache +++ /dev/null @@ -1,4 +0,0 @@ -# $NetBSD: post-cache,v 1.9 2002/12/26 17:08:57 jlam Exp $ - -*) ;; -esac diff --git a/mk/buildlink2/pre-cache b/mk/buildlink2/pre-cache deleted file mode 100644 index 553dbcbf71c..00000000000 --- a/mk/buildlink2/pre-cache +++ /dev/null @@ -1,9 +0,0 @@ -# $NetBSD: pre-cache,v 1.7 2002/12/26 17:08:57 jlam Exp $ - -case $arg in --[IL]${WRKDIR}*|-[IL]${BUILDLINK_DIR}*|-[IL]${BUILDLINK_X11_DIR}*) - cachehit=yes - ;; --[IL].|-[IL]./*|-[IL]..*) - cachehit=yes - ;; diff --git a/mk/buildlink2/private-pre-cache b/mk/buildlink2/private-pre-cache deleted file mode 100644 index 1f0f65a08d3..00000000000 --- a/mk/buildlink2/private-pre-cache +++ /dev/null @@ -1,3 +0,0 @@ -# $NetBSD: private-pre-cache,v 1.1 2002/12/26 17:08:57 jlam Exp $ - -case $arg in diff --git a/mk/buildlink2/wrapper.sh b/mk/buildlink2/wrapper.sh deleted file mode 100644 index 9a0f7aa3875..00000000000 --- a/mk/buildlink2/wrapper.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!@BUILDLINK_SHELL@ -# -# $NetBSD: wrapper.sh,v 1.10 2004/02/05 08:27:18 jlam Exp $ - -Xsed='@SED@ -e 1s/^X//' -sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' - -private_pre_cache="@_BLNK_WRAP_PRIVATE_PRE_CACHE@" -private_cache_add="@_BLNK_WRAP_PRIVATE_CACHE_ADD@" -private_cache="@_BLNK_WRAP_PRIVATE_CACHE@" -private_post_cache="@_BLNK_WRAP_PRIVATE_POST_CACHE@" -pre_cache="@_BLNK_WRAP_PRE_CACHE@" -cache_add="@_BLNK_WRAP_CACHE_ADD@" -cache="@_BLNK_WRAP_CACHE@" -post_cache="@_BLNK_WRAP_POST_CACHE@" -logic="@_BLNK_WRAP_LOGIC@" -post_logic="@_BLNK_WRAP_POST_LOGIC@" - -wrapperlog="${BUILDLINK_WRAPPER_LOG-@_BLNK_WRAP_LOG@}" - -updatecache=${BUILDLINK_UPDATE_CACHE-yes} -cacheall=${BUILDLINK_CACHE_ALL-no} - -cat="@CAT@" -echo="@ECHO@" -test="@TEST@" - -BUILDLINK_DIR="@BUILDLINK_DIR@" -BUILDLINK_X11_DIR="@BUILDLINK_X11_DIR@" -WRKDIR="@WRKDIR@" -WRKSRC="@WRKSRC@" - -original_cmd="$0 $@" -$echo [*] $original_cmd >> $wrapperlog - -cmd="@WRAPPEE@" -while $test $# -gt 0; do - arg="$1"; shift - cachehit=no - skipcache=no - . $private_cache - case $skipcache,$cachehit in - no,no) . $cache ;; - esac - case $cachehit in - no) . $logic ;; - esac - cmd="$cmd $arg" -done - -@_BLNK_WRAP_ENV@ -@_BLNK_WRAP_SANITIZE_PATH@ - -$echo "<.>" $cmd >> $wrapperlog -eval exec $cmd diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk index 34f3779310f..fa359e4c9e9 100644 --- a/mk/compiler/gcc.mk +++ b/mk/compiler/gcc.mk @@ -1,4 +1,4 @@ -# $NetBSD: gcc.mk,v 1.68 2004/07/03 11:25:49 grant Exp $ +# $NetBSD: gcc.mk,v 1.69 2004/07/06 22:49:18 wiz Exp $ .if !defined(COMPILER_GCC_MK) COMPILER_GCC_MK= defined @@ -363,11 +363,7 @@ PREPEND_PATH+= ${_GCC_DIR}/bin # Add the dependency on GCC. .if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) -. if empty(USE_BUILDLINK2:M[nN][oO]) -. for _dir_ in ${_GCC_PKGSRCDIR} -. include "${_dir_}/buildlink2.mk" -. endfor -. elif !empty(USE_BUILDLINK3:M[yY][eE][sS]) +. if !empty(USE_BUILDLINK3:M[yY][eE][sS]) . for _dir_ in ${_GCC_PKGSRCDIR} . include "${_dir_}/buildlink3.mk" . endfor diff --git a/mk/pthread.buildlink2.mk b/mk/pthread.buildlink2.mk deleted file mode 100644 index 31487e9524f..00000000000 --- a/mk/pthread.buildlink2.mk +++ /dev/null @@ -1,223 +0,0 @@ -# $NetBSD: pthread.buildlink2.mk,v 1.17 2004/06/12 03:19:52 grant Exp $ -# -# The pthreads strategy for pkgsrc is to "bless" a particular pthread -# package as the Official Pthread Replacement (OPR). A package that uses -# pthreads may do one of the following: -# -# (1) Simply include pthread.buildlink2.mk. This will make the package -# use the native pthread library if it's available, or else the OPR -# package. The value of PTHREAD_TYPE may be checked to be either -# "native", or the name of the OPR package, or "none", e.g. -# -# # -# # package Makefile stuff... -# # -# .include "../../mk/pthread.buildlink2.mk" -# -# .if defined(PTHREAD_TYPE) && ${PTHREAD_TYPE} == "none" -# CONFIGURE_ARGS+= --without-pthreads -# .endif -# -# .include "../../mk/bsd.pkg.mk" -# -# Note that it's only safe to check and use the value of PTHREAD_TYPE -# after all other buildlink2.mk files have been included. -# -# (2) Add "native" to PTHREAD_OPTS prior to including -# pthread.buildlink2.mk. This is like case (1), but we only check for -# the native pthread library, e.g., -# -# PTHREAD_OPTS+= native -# # -# # package Makefile stuff... -# # -# .include "../../mk/pthread.buildlink2.mk" -# -# .if defined(PTHREAD_TYPE) && ${PTHREAD_TYPE} == "none" -# CONFIGURE_ARGS+= --without-pthreads -# .endif -# -# .include "../../mk/bsd.pkg.mk" -# -# (3) Add "require" to PTHREAD_OPTS prior to including -# pthread.buildlink2.mk. This will make the package use the native -# pthread library or else use the OPR package, and will otherwise set -# PKG_SKIP_REASON if neither can be used, e.g., -# -# PTHREAD_OPTS+= require -# # -# # package Makefile stuff... -# # -# .include "../../mk/pthread.buildlink2.mk" -# .include "../../mk/bsd.pkg.mk" -# -# (4) Add both "require" and "native" to PTHREAD_OPTS prior to including -# pthread.buildlink2.mk. This is like case (3), but we only check for -# the native pthread library, e.g., -# -# PTHREAD_OPTS+= require native -# # -# # more package Makefile stuff... -# # -# .include "../../mk/pthread.buildlink2.mk" -# .include "../../mk/bsd.pkg.mk" -# -# The case where a package must use either the native pthread library or -# some pthread package aside from the OPR is a special case of (2), e.g., -# if the required pthread package is "ptl2", then: -# -# PTHREAD_OPTS+= native -# # -# # more package Makefile stuff... -# # -# .include "../../mk/pthread.buildlink2.mk" -# -# .if defined(PTHREAD_TYPE) && ${PTHREAD_TYPE} == "none" -# . include "../../devel/ptl2/buildlink2.mk" -# .endif -# -# .include "../../mk/bsd.pkg.mk" -# -# A package Makefile may add the word "optional" to PTHREAD_OPTS, which -# will override the effects of any instance of the word "require". This -# should _only_ be used by those packages that can be built with or -# without pthreads _independently_ of whether any of its dependencies need -# pthreads. Currently, this only only www/mozilla, which uses its own -# threading library if native pthreads is unavailable, despite that it -# uses GTK+, which _does_ need pthreads. -# -########################################################################### -# -# PTHREAD_OPTS represents whether this package requires pthreads, and also -# whether it needs to be native. It may include the word "require" -# to denote that a pthreads implementation is required, and may also -# include the word "native" to denote that only native pthreads are -# acceptable. -# -# _PKG_PTHREAD is the fall-back package pthread implementation use by -# pthread.buildlink2.mk. -# -# _PKG_PTHREAD_COMPAT_PATTERNS matches the ONLY_FOR_PLATFORMS from the -# Makefile for ${_PKG_PTHREAD}. It's used to see if ${_PKG_PTHREADS} -# can actually be used to replace a native pthreads. -# -_PKG_PTHREAD?= pth -_PKG_PTHREAD_DEPENDS?= pth>=2.0.0 -_PKG_PTHREAD_PKGSRCDIR?= ../../devel/${_PKG_PTHREAD} -_PKG_PTHREAD_BUILDLINK2_MK?= ${_PKG_PTHREAD_PKGSRCDIR}/buildlink2.mk -_PKG_PTHREAD_COMPAT_PATTERNS= *-*-* - -.include "../../mk/bsd.prefs.mk" - -PTHREAD_OPTS?= # empty -# -# We check for a native pthreads implementation by checking for the presence -# of /usr/include/pthread.h (we might want to make this check stricter). -# -.undef PTHREAD_TYPE -PREFER_NATIVE_PTHREADS?= YES -.if ${_OPSYS_PTHREAD_AUTO} == "yes" -PTHREAD_TYPE= automatic -.elif exists(/usr/include/pthread.h) && ${PREFER_NATIVE_PTHREADS} == "YES" -PTHREAD_TYPE= native -.else -. if !empty(PTHREAD_OPTS:Mnative) -PTHREAD_TYPE= none -. if !empty(PTHREAD_OPTS:Mrequire) && empty(PTHREAD_OPTS:Moptional) -PKG_SKIP_REASON= "${PKGNAME} requires a native pthreads implementation." -. endif -. else -PTHREAD_TYPE= none -. for _pattern_ in ${_PKG_PTHREAD_COMPAT_PATTERNS} -. if !empty(MACHINE_PLATFORM:M${_pattern_}) -PTHREAD_TYPE= ${_PKG_PTHREAD} -. endif -. endfor -. if ${PTHREAD_TYPE} == "none" && \ - !empty(PTHREAD_OPTS:Mrequire) && empty(PTHREAD_OPTS:Moptional) -PKG_SKIP_REASON= "${PKGNAME} requires a working pthreads implementation." -. endif -. endif -.endif - -.if !defined(PTHREAD_BUILDLINK2_MK) -PTHREAD_BUILDLINK2_MK= # defined - -.if ${PTHREAD_TYPE} == "native" -# -# Link the native pthread libraries and headers into ${BUILDLINK_DIR}. -# -BUILDLINK_PREFIX.pthread= /usr -BUILDLINK_FILES.pthread= include/pthread.h -BUILDLINK_FILES.pthread+= lib/libpthread.* - -BUILDLINK_TARGETS+= pthread-buildlink -BUILDLINK_TARGETS+= pthread-buildlink-la - -# only pass -pthread on platforms known to support it. -. if ${OPSYS} == "FreeBSD" || ${OPSYS} == "Linux" || \ - ${OPSYS} == "NetBSD" -BUILDLINK_CFLAGS.pthread= -pthread -. else -BUILDLINK_CFLAGS.pthread= # empty -. endif - -# handle systems which have pthreads functions in libc_r such as -# FreeBSD 5.x, or fall back to libc if we don't find libc_r. -# -. if exists(/usr/lib/libpthread.so) || exists(/lib/libpthread.so) -BUILDLINK_LDFLAGS.pthread= -lpthread -LIBTOOL_ARCHIVE_UNTRANSFORM_SED+= \ - -e "s|${BUILDLINK_PREFIX.pthread}/lib/libpthread.la|-lpthread|g" \ - -e "s|${LOCALBASE}/lib/libpthread.la|-lpthread|g" -. else -. if exists(/usr/lib/libc_r.so) -BUILDLINK_LDFLAGS.pthread= -lc_r -LIBTOOL_ARCHIVE_UNTRANSFORM_SED+= \ - -e "s|${BUILDLINK_PREFIX.pthread}/lib/libpthread.la|-lc_r|g" \ - -e "s|${LOCALBASE}/lib/libpthread.la|-lc_r|g" -. else -BUILDLINK_LDFLAGS.pthread= # empty -LIBTOOL_ARCHIVE_UNTRANSFORM_SED+= \ - -e "s|${BUILDLINK_PREFIX.pthread}/lib/libpthread.la||g" \ - -e "s|${LOCALBASE}/lib/libpthread.la||g" -. endif -. endif - -pthread-buildlink: _BUILDLINK_USE - -pthread-buildlink-la: - ${_PKG_SILENT}${_PKG_DEBUG} \ - lafile="${BUILDLINK_DIR}/lib/libpthread.la"; \ - libpattern="${BUILDLINK_PREFIX.pthread}/lib/libpthread.*"; \ - ${BUILDLINK_FAKE_LA} - -.elif ${PTHREAD_TYPE} == "${_PKG_PTHREAD}" -. if exists(${_PKG_PTHREAD_BUILDLINK2_MK}) -. if !empty(_PKG_PTHREAD_DEPENDS) -BUILDLINK_DEPENDS.${_PKG_PTHREAD}= ${_PKG_PTHREAD_DEPENDS} -. endif -BUILDLINK_PREFIX.pthread= ${BUILDLINK_PREFIX.${_PKG_PTHREAD}} -BUILDLINK_CFLAGS.pthread= ${BUILDLINK_CFLAGS.${_PKG_PTHREAD}} -BUILDLINK_LDFLAGS.pthread= -lpthread -. include "${_PKG_PTHREAD_BUILDLINK2_MK}" -. else -PKG_SKIP_REASON= "${PKGNAME} needs pthreads, but ${_PKG_PTHREAD_BUILDLINK2_MK} is missing." -. endif - -.elif ${PTHREAD_TYPE} == "automatic" -BUILDLINK_PREFIX.pthread= /usr - -.endif - -# Define user-visible PTHREAD_CFLAGS and PTHREAD_LDFLAGS as compiler -# options used to compile/link pthreaded code. -# -PTHREAD_CFLAGS= ${BUILDLINK_CFLAGS.pthread} -PTHREAD_LDFLAGS=${BUILDLINK_LDFLAGS.pthread} - -PTHREADBASE= ${BUILDLINK_PREFIX.pthread} -CONFIGURE_ENV+= PTHREADBASE=${PTHREADBASE} -MAKE_ENV+= PTHREADBASE=${PTHREADBASE} - -.endif # PTHREAD_BUILDLINK2_MK diff --git a/mk/scripts/genreadme.awk b/mk/scripts/genreadme.awk index f6e2fbba953..a653f592511 100755 --- a/mk/scripts/genreadme.awk +++ b/mk/scripts/genreadme.awk @@ -1,5 +1,5 @@ #!/usr/bin/awk -f -# $NetBSD: genreadme.awk,v 1.11 2003/09/11 03:00:21 dmcmahill Exp $ +# $NetBSD: genreadme.awk,v 1.12 2004/07/06 22:49:18 wiz Exp $ # # Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. # All rights reserved. @@ -452,7 +452,7 @@ END { printf("Does not exist. This is probably ") > "/dev/stderr"; printf("due to an incorrect DEPENDS line.\n") > "/dev/stderr"; printf("Try running: grep %s */*/Makefile\n", fulldir2pkgdir(pkgdir)) > "/dev/stderr"; - printf("or: grep %s */*/buildlink2.mk\n", fulldir2pkgdir(pkgdir)) > "/dev/stderr"; + printf("or: grep %s */*/buildlink3.mk\n", fulldir2pkgdir(pkgdir)) > "/dev/stderr"; printf("to find the problem\n", pkgdir) > "/dev/stderr"; printf("**** ------- ****\n") > "/dev/stderr"; } else { |