Commit graph

17 commits

Author SHA1 Message Date
jlam
911e6a0991 Allow setting CCACHE_DIR in the environment or in /etc/mk.conf. 2004-02-22 12:31:10 +00:00
jlam
2db74558c6 Use BUILD_ENV instead of just {CONFIGURE,MAKE}_ENV to pass CCACHE_HASHCC
to ccache.  This now correctly passes CCACHE_HASHCC to ccache if the
package has a custom do-build target that invokes ${CC} directly.
2004-02-21 12:31:38 +00:00
jlam
c40ee95964 * 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.
2004-02-18 13:32:38 +00:00
jlam
3d0294d0d4 Generate a more informative string "CC_VERSION_STRING" that is passed to
ccache as the compiler information to hash.
2004-02-12 08:54:48 +00:00
jlam
2fd59f45ed Don't have recursive variable definitions. 2004-02-09 01:29:29 +00:00
jlam
3f0c4ee09a * Let CC/CXX/CPP/FC always point to the compiler used in the actual
building of software.  For packages that use either buildlink2 or
  buildlink3, this would be the wrapper script in ${BUILDLINK_DIR}.

* Garbage-collect _BLNK_WRAP_SETENV.* as those are not needed after
  the above changes.  Configure and make processes will automatically
  find the right compilers in the PATH.

* PKGLIBTOOL and PKGSHLIBTOOL are no longer needed since LIBTOOL and
  SHLIBTOOL point to the correct libtools regardless of any
  USE_BUILDLINK[23] definitions.
2004-02-08 02:59:14 +00:00
jlam
7c268604ca Symlink the compiler into ${WRKDIR} so that there's a consistent path to
the compiler and that it's behind .tools/bin and .buildlink/bin, regardless
of whether or not we're using gcc3-c or not, or whether it's been installed
yet in the process of satisfying dependencies, etc.
2004-02-07 02:58:10 +00:00
jlam
d72bb0e381 Hiding the PATH from certain phases of the build only accidentally worked
due to a type on gcc.mk that causes the ${_GCC_PREFIX}/bin to always be
prepended to the PATH.  The problem that was hiding was "make" resolving
to ${TOOLS_DIR}/bin/make if the package used GNU make, which broke
building since the package Makefile is a BSD Makefile and we passed
PATH to some phases of the build.  Fix this by expanding MAKE to the
full path to ${MAKE} in bsd.prefs.mk.  We also garbage collect the now
useless checks for PHASES_AFTER_BUILDLINK that cluttered the PREPEND_PATH
code.
2004-02-06 04:37:02 +00:00
jlam
bed8d4d73e We only prepend a directory to the PATH if we haven't already done so
(by checking PREPEND_PATH) and only for those phases of the build that
care about the PATH (buildlink or later).  We also pass the PATH to
those same phases of the build so that executing ${CC} will work correctly
from custom {pre,do,post}-* targets that occur at buildlink time or
later.
2004-02-06 03:04:50 +00:00
jlam
fee0a809ce Simpilfy the test for whether we're inside bsd.prefs.mk. 2004-02-05 03:39:17 +00:00
jlam
c2d20bedad Allow bsd.compiler.mk to be included by both bsd.prefs.mk and bsd.pkg.mk.
Any additions to DEPENDS/BUILD_DEPENDS or inclusions of buildlink[23].mk
files are deferred till bsd.compiler.mk is included by bsd.pkg.mk.  We
allow bsd.compiler.mk to be included by bsd.prefs.mk solely for the purpose
of setting CC_VERSION properly for use by package Makefiles.

There is the surprising behaviour that CC_VERSION won't necessarily have
the correct value at all times until after "make extract" has been
completed (dependencies are installed before "make extract"), so package
Makefile writers should keep that in mind.  Just to note that this is
_existing_ behaviour that's preserved by these changes.
2004-02-05 03:35:20 +00:00
jlam
5a6dccc212 Fix a pervasive cut-and-paste bug: change a = back into a +=. Noted by
David Brownlee in private email.
2004-02-03 20:38:39 +00:00
jlam
6f3185696f Only prepend the compiler package location to the PATH if we actually
request a compiler that's supported by the named compiler package.
2004-02-02 11:04:17 +00:00
jlam
5ff8c17cd4 Whitespace fixes. 2004-02-02 10:55:26 +00:00
jlam
ebbc2d9184 Support a new variable in package Makefiles:
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".

Packages that don't need any compilers and set this variable to an
empty value, e.g. "USE_LANGUAGES=".

This can probably be combined in some smart way with setting
USE_GCC_SHLIBS and USE_FORTRAN automatically.
2004-02-02 10:03:46 +00:00
jlam
706af1242e Match names for the C and C++ compilers with the ones we're masquerading.
This should allow ccache to work with SunPro and MIPSpro compilers.
2004-02-01 01:33:06 +00:00
jlam
ff13724574 New compiler specification framework, based on mk/compiler.mk. The
changes from the old compiler.mk are:

  * Split apart the compiler-specific logic into separate files.  This
    should make supporting other compilers a bit easier.

  * Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23],
    USE_SUNPRO, etc.  It's all replaced with a new PKGSRC_COMPILER
    variable.

  * Clean up the GCC handling so that it's all controlled by a single
    variable GCC_REQD.  The following behaviour is expected:

    (a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on
        the system.
    (b) If there is no GCC, then the appropriate GCC corresponding to
        GCC_REQD is installed and used.
    (c) If there is a GCC, if it satisfies GCC_REQD, then use it;
        otherwise install and use the appropriate GCC package.
    (d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3
        is installed and used.
    (e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is
        still used instead of installing lang/gcc.

New features include:

  * PKGSRC_COMPILER takes a list of values specifying the chain of
    compilers to call when building packages.  Valid values are:

	distcc          distributed C/C++ (chainable)
	ccache          compiler cache (chainable)
	gcc             GNU
	mipspro         Silicon Graphics, Inc. MIPSpro
	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".

  * Change GCC_REQD to hold a list of values that we scan through to
    find the highest version of GCC required by the build.  Package
    Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 00:31:00 +00:00