Commit graph

29 commits

Author SHA1 Message Date
martti
2cc4216d5e Remove trailing spaces. 2006-12-15 12:46:23 +00:00
rillig
701b7f3fd7 Added the user-settable variable CCACHE_DIR, so that the cache can be
outside of WRKDIR. I don't see a reason for having the cache inside a
directory that will go away on "make clean", but I left the default
value as is.
2006-10-14 08:59:08 +00:00
jlam
7d1f4cca8e "BUILD_ENV" was misnamed. It's actually the environment that is passed
to all internal recursive make processes.  As such, rename it to
"PKGSRC_MAKE_ENV".

XXX Note, some of the usage of this variable in package Makefiles seems
XXX incorrect.  They probably want "MAKE_ENV", which is the environment
XXX passed to the make process when running "make" within ${WRKSRC}.
2006-07-21 14:27:56 +00:00
tv
4284bdc494 Merge down deferred EVAL_PREFIX handling from tv-derecurse branch.
Also move its definition later in bsd.pkg.mk, so that it actually works
for compiler/*.mk (which is why those files originally had to provide
"defaults" for their variables -- they never did get evaluated).
2005-01-24 18:20:57 +00:00
jlam
1fc74ae68e Correct my name to what I legally use. 2005-01-12 22:56:41 +00:00
jlam
c39637ec68 Put a TNF copyright on files that I authored. 2005-01-12 18:36:11 +00:00
jlam
27f0c5d4c2 _ALIASES.<wrappee> should be cumulative. 2005-01-10 19:38:53 +00:00
jlam
f563b96808 Whitespace nits. 2005-01-10 08:59:07 +00:00
jlam
eb9034727a Modify the way that the toolchain variables, e.g. CC, CPP, CXX, LD, etc.,
are handled.  The idea now is to simply remove the paths in the values
of these variables, leaving behind only the basename plus any arguments,
e.g.:

	CC= /usr/local/bin/gcc       becomes   CC= gcc
	CPP= /usr/local/bin/gcc -E   becomes   CPP= gcc -E

The wrapper scripts are generated for every unique executable mentioned
by the toolchain variables, so for the example above, only a "gcc"
wrapper script is generated for ${CC} and ${CPP}.  PKG_{CC,CPP,CXX,etc.}
are the paths to the executables wrapped by the wrapper scripts.

Note that it's now possible to set "CC" to something more than just the
path to the compiler, e.g.

	CC= cc -ffast-math -funroll-loops -fomit-frame-pointer

and the full value of ${CC} will be passed through via CONFIGURE_ENV
and MAKE_ENV.
2004-11-30 14:50:37 +00:00
tv
069c8dffba For some reason EVAL_PREFIX is not properly using the _DEFAULT values, so
re-add the ?= assignments.  (Will be fixed properly later.)
2004-11-17 17:18:33 +00:00
tv
f1b2b2d6a7 Don't check _*PREFIX/bin for the requested compiler hook program. If
PKGSRC_COMPILER requested it, assume that it's available, so that
compilation will (properly) fail if the hook program is somehow not
correctly installed.
2004-11-17 17:14:43 +00:00
tv
e186c85bad devel/patch is needed by some platforms in order to build ccache, so don't
cache that one either.
2004-10-09 03:48:31 +00:00
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