pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk * Move pkgsrc/mk/compiler/bsd.compiler.mk to pkgsrc...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a02db6b7a24d
branches:  trunk
changeset: 468981:a02db6b7a24d
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Feb 18 13:32:38 2004 +0000

description:
* Move pkgsrc/mk/compiler/bsd.compiler.mk to pkgsrc/mk/compiler.mk.
  Package Makefiles may now directly include compiler.mk.

* Don't include compiler.mk within bsd.prefs.mk any longer.  It was only
  included for the purposes of defining CC_VERSION.  Packages that want
  to test the value of CC_VERSION should now first include
  "../../mk/compiler.mk".  Any GCC_REQD statements in package Makefiles
  should be set before compiler.mk is included.

* Simpllfy pkgsrc/mk/compiler/*.mk files as a result of not needing to
  be included indirectly by bsd.prefs.mk.  We remove the special handling
  associated with detecting whether the file was included from within
  bsd.prefs.mk.  These files are now much more straightforward to write
  and understand.

* G/C the BSD_PREFS_MK stack mechanism as the only users (compiler/*)
  no longer need it.

* Ensure that directories are prepended to the PATH only from within
  bsd.pkg.mk.

diffstat:

 mk/bsd.pkg.mk                   |   19 +-
 mk/bsd.prefs.mk                 |   16 +--
 mk/buildlink2/bsd.buildlink2.mk |    3 +-
 mk/buildlink3/bsd.buildlink3.mk |    7 +-
 mk/compiler.mk                  |  115 ++++++++++++++++++
 mk/compiler/bsd.compiler.mk     |  113 -----------------
 mk/compiler/ccache.mk           |   69 ++++------
 mk/compiler/distcc.mk           |   69 ++++------
 mk/compiler/gcc.mk              |  255 +++++++++++++++++++--------------------
 mk/compiler/mipspro-ucode.mk    |   22 +--
 mk/compiler/mipspro.mk          |   51 +++----
 mk/compiler/sunpro.mk           |   51 +++----
 mk/tools.mk                     |    4 +-
 13 files changed, 362 insertions(+), 432 deletions(-)

diffs (truncated from 1288 to 300 lines):

diff -r 49278c8ee598 -r a02db6b7a24d mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Wed Feb 18 12:03:07 2004 +0000
+++ b/mk/bsd.pkg.mk     Wed Feb 18 13:32:38 2004 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1409 2004/02/17 12:16:39 jlam Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1410 2004/02/18 13:32:38 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -1352,15 +1352,10 @@
 SCRIPTS_ENV+=  BATCH=yes
 .endif
 
-# Initialize a variable used by Makefiles to check whether to prepend
-# to the PATH.
-#
-PREPEND_PATH?= # empty
-
 # Get the proper dependencies and set the PATH to use the compiler
 # named in PKGSRC_COMPILER.
 #
-.include "../../mk/compiler/bsd.compiler.mk"
+.include "../../mk/compiler.mk"
 
 .if !empty(USE_BUILDLINK2:M[nN][oO]) && !empty(USE_BUILDLINK3:M[nN][oO])
 NO_BUILDLINK=          # defined
@@ -1375,8 +1370,16 @@
 
 .include "../../mk/tools.mk"
 
+_PREPENDED_TO_PATH?=   # empty
+.for _dir_ in ${PREPEND_PATH}
+.  if empty(_PREPENDED_TO_PATH:M${_dir_})
+_PREPENDED_TO_PATH+=   ${_dir_}
+PATH:=                 ${_dir_}:${PATH}
+.  endif
+.endfor
+
 PATH_ENV+=     PATH=${PATH:Q}
-PATH_ENV+=     PREPEND_PATH=${PREPEND_PATH:Q}
+PATH_ENV+=     _PREPENDED_TO_PATH=${_PREPENDED_TO_PATH:Q}
 
 .MAIN: all
 
diff -r 49278c8ee598 -r a02db6b7a24d mk/bsd.prefs.mk
--- a/mk/bsd.prefs.mk   Wed Feb 18 12:03:07 2004 +0000
+++ b/mk/bsd.prefs.mk   Wed Feb 18 13:32:38 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.154 2004/02/14 11:28:28 jlam Exp $
+# $NetBSD: bsd.prefs.mk,v 1.155 2004/02/18 13:32:38 jlam Exp $
 #
 # Make file, included to get the site preferences, if any.  Should
 # only be included by package Makefiles before any .if defined()
@@ -6,11 +6,6 @@
 # to make sure any variables defined in /etc/mk.conf, $MAKECONF, or
 # the system defaults (sys.mk and bsd.own.mk) are used.
 
-# If empty(BSD_PREFS_MK), then we are _not_ being included from within
-# bsd.prefs.mk.
-#
-BSD_PREFS_MK:= ${BSD_PREFS_MK}+
-
 # Do not recursively include mk.conf, redefine OPSYS, include bsd.own.mk, etc.
 .ifndef BSD_PKG_MK
 
@@ -488,13 +483,4 @@
 #
 WRKLOG?=               ${WRKDIR}/.work.log
 
-# Include bsd.compiler.mk for CC_VERSION.
-.if exists(${.CURDIR}/../../mk/compiler/bsd.compiler.mk)
-.  include "../../mk/compiler/bsd.compiler.mk"
-.elif exists(${.CURDIR}/../mk/compiler/bsd.compiler.mk)
-.  include "../mk/compiler/bsd.compiler.mk"
-.endif
-
 .endif # BSD_PKG_MK
-
-BSD_PREFS_MK:= ${BSD_PREFS_MK:S/+$//}
diff -r 49278c8ee598 -r a02db6b7a24d mk/buildlink2/bsd.buildlink2.mk
--- a/mk/buildlink2/bsd.buildlink2.mk   Wed Feb 18 12:03:07 2004 +0000
+++ b/mk/buildlink2/bsd.buildlink2.mk   Wed Feb 18 13:32:38 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink2.mk,v 1.117 2004/02/17 16:56:47 jlam Exp $
+# $NetBSD: bsd.buildlink2.mk,v 1.118 2004/02/18 13:32:38 jlam Exp $
 #
 # An example package buildlink2.mk file:
 #
@@ -127,7 +127,6 @@
 #
 .if empty(PREPEND_PATH:M${BUILDLINK_DIR}/bin)
 PREPEND_PATH+= ${BUILDLINK_DIR}/bin
-PATH:=         ${BUILDLINK_DIR}/bin:${PATH}
 .endif
 
 .for _pkg_ in ${BUILDLINK_PACKAGES}
diff -r 49278c8ee598 -r a02db6b7a24d mk/buildlink3/bsd.buildlink3.mk
--- a/mk/buildlink3/bsd.buildlink3.mk   Wed Feb 18 12:03:07 2004 +0000
+++ b/mk/buildlink3/bsd.buildlink3.mk   Wed Feb 18 13:32:38 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink3.mk,v 1.91 2004/02/18 05:23:37 jlam Exp $
+# $NetBSD: bsd.buildlink3.mk,v 1.92 2004/02/18 13:32:38 jlam Exp $
 #
 # An example package buildlink3.mk file:
 #
@@ -56,11 +56,6 @@
 #
 .if empty(PREPEND_PATH:M${BUILDLINK_DIR}/bin)
 PREPEND_PATH+= ${BUILDLINK_DIR}/bin
-.  if defined(_OPSYS_DEFAULT_PATH)
-PATH:=         ${BUILDLINK_DIR}/bin:${_OPSYS_DEFAULT_PATH}
-.  else
-PATH:=         ${BUILDLINK_DIR}/bin:${PATH}
-.  endif
 .endif
 
 # BUILDLINK_DEPENDS contains the list of packages for which we add
diff -r 49278c8ee598 -r a02db6b7a24d mk/compiler.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/compiler.mk    Wed Feb 18 13:32:38 2004 +0000
@@ -0,0 +1,115 @@
+# $NetBSD: compiler.mk,v 1.26 2004/02/18 13:32:38 jlam Exp $
+#
+# This Makefile fragment implements handling for supported C/C++/Fortran
+# compilers.
+#
+# The following variables are used by this file:
+#
+# PKGSRC_COMPILER
+#      A list of values specifying the chain of compilers to be used by
+#      pkgsrc to build packages.
+#
+#      Valid values are:
+#              distcc          distributed C/C++ (chainable)
+#              ccache          compiler cache (chainable)
+#              gcc             GNU
+#              mipspro         Silicon Graphics, Inc. MIPSpro (n32/n64)
+#              mipspro-ucode   Silicon Graphics, Inc. MIPSpro (o32)
+#              sunpro          Sun Microsystems, Inc. WorkShip/Forte/Sun
+#                              ONE Studio
+#
+#      The default is "gcc".  You can use ccache and/or distcc with an
+#      appropriate PKGSRC_COMPILER setting, e.g. "ccache distcc gcc".
+#      The chain should always end in a real compiler.  This should only
+#      be set in /etc/mk.conf.
+#
+# GCC_REQD
+#      A list of version numbers used to determine the minimum
+#      version of GCC required by a package.  This value should only
+#      be appended to by a package Makefile.
+#
+#      NOTE: Be conservative when setting GCC_REQD, as lang/gcc3 is
+#      known not to build on some platforms, e.g. Darwin.  If gcc3 is
+#      required, set GCC_REQD=3.0 so that we do not try to pull in
+#      lang/gcc3 unnecessarily and have it fail.
+#
+# USE_PKGSRC_GCC
+#      Force using the appropriate version of GCC from pkgsrc based on
+#      GCC_REQD instead of the native compiler.
+#
+# USE_GCC_SHLIB
+#      Indicates that a package uses GCC shared libraries, so we
+#      register a runtime dependency on the compiler package.
+#
+# USE_LANGUAGES
+#      Lists the languages used in the source code of the package,
+#      and is used to determine the correct compilers to install.
+#      Valid values are: c, c++, fortran, java, objc.  The default
+#      is "c".
+#
+# The following variables are defined, and available for testing in
+# package Makefiles:
+#
+# CC_VERSION
+#      The compiler and version being used, e.g.,
+#
+#      .include "../../mk/bsd.prefs.mk"
+#
+#      .if !empty(CC_VERSION:Mgcc-3*)
+#      ...
+#      .endif
+#
+# The following variables are deprecated:
+#
+# USE_GCC2, USE_GCC3, USE_SUNPRO, USE_MIPSPRO
+
+.if !defined(BSD_COMPILER_MK)
+BSD_COMPILER_MK=       defined
+
+.include "../../mk/bsd.prefs.mk"
+
+# XXX Add this gross and completely inaccurate hack.  Packages that
+# XXX set USE_GCC_SHLIB should be adjusted to set USE_LANGUAGES
+# XXX correctly (most likely by saying it needs either "c++" or
+# XXX "c c++").  This is here for now so that ~85 packages won't
+# XXX suddenly break.
+#
+.if defined(USE_GCC_SHLIB)
+USE_LANGUAGES?=        c c++
+.endif
+
+# By default, assume that the package requires a C compiler.
+USE_LANGUAGES?=        c
+
+# Support some deprecated variables for a while.  They'll be removed
+# after the pkgsrc-2004Q1 branch is cut.
+#
+.if defined(USE_GCC2)
+GCC_REQD+=             2.8.0
+PKGSRC_COMPILER?=      gcc
+.elif defined(USE_GCC3)
+GCC_REQD+=             3.0
+PKGSRC_COMPILER?=      gcc
+.elif defined(USE_PKGSRC_GCC)
+_USE_PKGSRC_GCC=       yes
+PKGSRC_COMPILER?=      gcc
+.elif defined(USE_SUNPRO)
+PKGSRC_COMPILER?=      sunpro
+.elif defined(USE_MIPSPRO)
+PKGSRC_COMPILER?=      mipspro
+.else
+PKGSRC_COMPILER?=      gcc
+.endif
+
+_PKGSRC_COMPILER=      # empty
+.for _compiler_ in ${PKGSRC_COMPILER}
+.  if empty(_PKGSRC_COMPILER:M${_compiler_})
+_PKGSRC_COMPILER:=     ${_compiler_} ${_PKGSRC_COMPILER}
+.  endif
+.endfor
+
+.for _compiler_ in ${_PKGSRC_COMPILER}
+.  include "../../mk/compiler/${_compiler_}.mk"
+.endfor
+
+.endif # BSD_COMPILER_MK
diff -r 49278c8ee598 -r a02db6b7a24d mk/compiler/bsd.compiler.mk
--- a/mk/compiler/bsd.compiler.mk       Wed Feb 18 12:03:07 2004 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-# $NetBSD: bsd.compiler.mk,v 1.10 2004/02/18 11:18:43 jlam Exp $
-#
-# This Makefile fragment implements handling for supported C/C++/Fortran
-# compilers.
-#
-# The following variables are used and should all be defined either
-# in or before the first inclusion of bsd.prefs.mk:
-#
-# PKGSRC_COMPILER
-#      A list of values specifying the chain of compilers to be used by
-#      pkgsrc to build packages.
-#
-#      Valid values are:
-#              distcc          distributed C/C++ (chainable)
-#              ccache          compiler cache (chainable)
-#              gcc             GNU
-#              mipspro         Silicon Graphics, Inc. MIPSpro (n32/n64)
-#              mipspro-ucode   Silicon Graphics, Inc. MIPSpro (o32)
-#              sunpro          Sun Microsystems, Inc. WorkShip/Forte/Sun
-#                              ONE Studio
-#
-#      The default is "gcc".  You can use ccache and/or distcc with an
-#      appropriate PKGSRC_COMPILER setting, e.g. "ccache distcc gcc".
-#      The chain should always end in a real compiler.  This should only
-#      be set in /etc/mk.conf.
-#
-# GCC_REQD
-#      A list of version numbers used to determine the minimum
-#      version of GCC required by a package.  This value should only
-#      be appended to by a package Makefile.
-#
-#      NOTE: Be conservative when setting GCC_REQD, as lang/gcc3 is
-#      known not to build on some platforms, e.g. Darwin.  If gcc3 is
-#      required, set GCC_REQD=3.0 so that we do not try to pull in
-#      lang/gcc3 unnecessarily and have it fail.
-#
-# USE_PKGSRC_GCC
-#      Force using the appropriate version of GCC from pkgsrc based on
-#      GCC_REQD instead of the native compiler.
-#
-# USE_GCC_SHLIB
-#      Indicates that a package uses GCC shared libraries, so we
-#      register a runtime dependency on the compiler package.
-#
-# USE_LANGUAGES
-#      Lists the languages used in the source code of the package,
-#      and is used to determine the correct compilers to install.
-#      Valid values are: c, c++, fortran, java, objc.  The default
-#      is "c".
-#
-# The following variables are defined, and available for testing in
-# package Makefiles:
-#
-# CC_VERSION
-#      The compiler and version being used, e.g.,
-#
-#      .include "../../mk/bsd.prefs.mk"
-#
-#      .if !empty(CC_VERSION:Mgcc-3*)
-#      ...



Home | Main Index | Thread Index | Old Index