Commit graph

354 commits

Author SHA1 Message Date
gavan
5d1e177d2f gcc2 does not support -std=c99. If c99 is needed, require
at least gcc 3.0.
2007-01-08 19:29:45 +00:00
martti
2cc4216d5e Remove trailing spaces. 2006-12-15 12:46:23 +00:00
joerg
2284bed722 Don't force strict C99 mode by default, but the relaxed GNU-C99 mode. 2006-12-06 16:18:19 +00:00
jschauma
721b60b433 Instead of setting compiler flags in each package if it uses C99,
allow USE_LANGUAGES+=c99 and let gcc and mipspro do the right thing.
May need to be reviewed/added for other compilers.
ok rillig@
2006-12-02 22:32:59 +00:00
rillig
4b4898f8a7 Added header comments. 2006-10-22 00:14:17 +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
schwarz
ff389f044d CPP on IRIX 5 with IDO cc is /usr/lib/cpp 2006-08-06 18:59:41 +00:00
rillig
5092ccdc95 Whenever f2c is mentioned in USE_LANGUAGES, a C compiler is also needed,
so automatically add it to USE_LANGUAGES. Fixes PR 34079.
2006-07-25 10:20:03 +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
markd
5c5f253ff0 On Solaris set _COMPILER_ABI_FLAG.64 to be consistent with the sunpro
settings.
2006-07-06 11:48:03 +00:00
markd
42e8e95800 Set _COMPILER_ABI_FLAG.64 correctly for non sparc (ie amd64). 2006-07-06 11:46:33 +00:00
shannonjr
0faa421404 Change _GCC_DIST_VERSION from 3.4.5 to 3.4.6 to reflect update to
lang/gcc34.
2006-04-05 12:31:24 +00:00
shannonjr
b9b7e90faa Bump '_GCC_DIST_VERSION' to '3.4.5' to match lang/gcc34 2006-02-10 11:26:41 +00:00
schwarz
a315454cc6 added missing header lines. 2005-10-30 10:33:23 +00:00
schwarz
7e79f31cbf added support for the SGI IDO (IRIX Development Option) cc used by IRIX 5.3.
changes approved by jschauma and recht.
2005-10-16 19:44:44 +00:00
grant
aa28d4e53a some packages expect "-Wl," immediately before flags to be passed to
the linker, set _COMPILER_RPATH_FLAG accordingly. "-Wl," is removed by
the sunpro compiler wrapper where necessary.

fix comment for _LINKER_RPATH_FLAG while here.

this fixes, among other things, apache modules built with apxs.
2005-07-21 01:36:25 +00:00
shannonjr
671529f3f6 Updated _GCC_DIST_VERSION from 3.4.3 to 3.4.4 to reflect recent update
to lang/gcc34.
2005-05-31 10:51:36 +00:00
rillig
e251db98e2 The sunpro wrapper now creates aliases for gcc and g++, too. This is needed
because the <sys.mk> Makefile fragment sets CC?=gcc.
2005-05-17 19:06:21 +00:00
tv
fe3c1321bf USE_BUILDLINK3 is no longer optional (and cannot be turned off). Per mail
to tech-pkg:

=====

* USE_BUILDLINK3=YES will be unconditional.  (In fact, USE_BUILDLINK3 will
  be ignored altogether by mk/; but see below.)

* NO_BUILDLINK and NO_WRAPPER will be ignored by mk/.  If a build happens,
  these phases will happen.

* The existing NO_BUILD will imply the previous NO_BUILDLINK and NO_WRAPPER.
  If no build happens, those phases are not needed.

* NO_TOOLS will be ignored by mk/.  The tools phase, which provides much
  more than just the C compiler, will always happen regardless of package.
  This will make metapackage builds only slightly slower, in trade for far
  less user error.
2005-03-24 17:46:00 +00:00
grant
733a152138 override the GNU configure test for __attribute__. the test commonly
uses a nested function, which icc does not support.
2005-02-16 10:48:40 +00:00
grant
9fd9fe5331 add support for icc, the Intel C++ Compiler (Linux).
icc is a high performance compiler suite for Linux/i386 and ia64, and
is free for non-commercial use. see:

	http://www.intel.com/software/products/compilers/clin/

for more information.

tested with icc version 8.0 and 8.1 on Slackware 10/i386.
2005-02-15 07:43:43 +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
tv
49fe383c7d Re-add direct symlink logic, optional under GCC_USE_SYMLINKS=yes. Saves
one fork/exec step on platforms where gcc is compiled with hardcoded gcc-lib
pathnames.  This applies to most platforms, but the default currently
remains not to use symlinks so as to avoid unexpected gotchas for users.
2005-01-21 21:59:14 +00:00
grant
7240d7d5bd add my copyright/license. 2005-01-12 22:58:29 +00:00
jlam
1fc74ae68e Correct my name to what I legally use. 2005-01-12 22:56:41 +00:00
jlam
d6dfee8415 Use ${AWK} instead of a bare "awk". 2005-01-12 18:42:42 +00:00
jlam
ffd5ad15de Rearrange how LANGUAGES.<compiler> is set so that we can more flexibly
detect when only parts of a compiler toolchain are present, e.g. the
SunPro C compiler is installed, but not the Fortran-77 compiler.
2005-01-12 18:37:52 +00:00
jlam
c39637ec68 Put a TNF copyright on files that I authored. 2005-01-12 18:36:11 +00:00
jlam
d9168be817 Whitespace. 2005-01-12 17:40:48 +00:00
jlam
61c4d07ad0 Even more whitespace. 2005-01-12 17:40:01 +00:00
jlam
44a745628d Whitespace. 2005-01-12 17:39:34 +00:00
jlam
5f768fe677 Prepend the CCC compiler dir to the PATH so that they're found by the
wrapper scripts.
2005-01-12 17:39:18 +00:00
jlam
9e296c8b45 Backout part of previous commit that was unrelated. 2005-01-12 17:30:34 +00:00
jlam
9d72ec1985 Remove explicit overrides for CC and CXX that prevented using the
definitions supplied in /etc/mk.conf.  It should now be possible to
pass optimization flags directly using CC and CXX when using CCC and
xlC compilers.
2005-01-12 17:27:50 +00:00
jlam
a81bf92f7d Remove explicit overrides for CC and CXX that prevented using the
definitions supplied in /etc/mk.conf.  It should now be possible to
pass optimization flags directly using CC and CXX when using SunPro
and MIPSpro compilers.
2005-01-12 16:41:14 +00:00
jlam
b6b853727d Nuke USE_FORTRAN and bring the f2c handling within the mk/compiler
framework.  The list of changes include:

  * Modify compiler.mk so that "c" is always prepended to USE_LANGUAGES,
    so we no longer need to say it in package Makefiles.  Packages
    should now append to USE_LANGUAGES instead of setting it.

  * Create mk/compiler/f2c.mk which implements another pseudo-compiler
    "f2c" that may be used with any C compiler backend, e.g.

	PKGSRC_COMPILER= f2c ccache gcc

  * Teach the various "real" compiler files, e.g., sunpro.mk, mipspro.mk,
    etc., to use f2c if the native Fortran compiler isn't present.

Packages that use Fortran should now simply include the line:

	USE_LANGUAGES+=	fortran

in the package Makefile.
2005-01-12 15:31:58 +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
grant
e71f192b37 CFLAGS+=-ma because most packages expect alloca to be available and
this makes it so with xlc.
2004-11-27 15:28:34 +00:00
jlam
b72e03c8a5 Use CCPATH instead of referring to the C compiler by its full path in
multiple places.
2004-11-23 05:32:22 +00:00
jlam
539fa6a01b Whitespace changes. 2004-11-23 05:24:28 +00:00
dmcmahill
1efd592495 add {CC,CXX,FC,F77}PATH variables which give the complete path and
name of the {CC,CXX,FC,F77} compilers.  These will be used by pkgs
which need to know which compiler and where it is at run time.

Approved by jlam@
2004-11-23 00:46:26 +00:00
wiz
43de7f8bc0 Now that no package uses USE_GCC_SHLIB any longer, remove support
for it from compiler.mk.

Move the variable of the same name used by compiler/gcc.mk and
the gcc* buildlink3 files into private namespace (_USE_GCC_SHLIB).
2004-11-22 22:24:46 +00:00
grant
4321a9c877 quieten spurious broken pipe output from cc. 2004-11-20 05:54:36 +00:00
grant
919cb8bddb add framework support for Tru64 and the Compaq C compiler.
patches provided by Tobias Nygren <tnn at netilium dot org> with
minor changes by me.
2004-11-20 04:37:08 +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
shannonjr
7ce1b962f3 Update _GCC_DIST_VERSION to 3.4.3 2004-11-10 12:04:59 +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
grant
2644aa2b45 call the C compiler as 'xlc' so libtool mostly DTRT. 2004-10-06 13:56:46 +00:00
grant
b761a1f885 add initial support for IBM's XL C/C++ compiler. tested with version
6.0 on Mac OS X 10.3.5.

to use XL C, set PKGSRC_COMPILER=xlc in mk.conf. XLCBASE defaults to
/opt/ibmcmp/vacpp/6.0 (the default installation location on OS X),
this can be overridden in mk.conf too.

this is a work in progress - some simple packages can be built, but
there are still lots of issues that need to be worked through.
2004-10-06 09:49:53 +00:00
jlam
3621e208c1 Teach gcc.mk about gcc34 so that setting GCC_REQD=3.4 in /etc/mk.conf will
make pkgsrc do the right thing.
2004-09-23 15:25:54 +00:00
jlam
b2e3986dd7 Support the ABI flags on MIPS platforms. 2004-09-23 13:49:21 +00:00
jlam
1d55af8fb2 Initial commit of a new wrapper script framework that encapsulates
the non-buildlink-related code and moves it out of mk/buildlink3 into
mk/wrapper.  The buildlink3 code is modified to simply hook its
transformations into the wrapper script framework.

The wrapper script framework has some new features:

* Support automatically passing "ABI" flags to the compiler and linker
  depending on the value of ${ABI}.  Currently supports the SunPro
  compiler with ${ABI} == 64 and the MIPSPro compiler with ${ABI} as
  any of 32, n32, o32, and 64.

* making UnixWare GCC accept -rpath options and silently converting
  them into an appropriate LD_RUN_PATH

* Add cmd-sink-interix-gcc and cmd-sink-interix-ld that errors out
  when it sees -fpic/-fPIC and -shared/-Bshareable, respectively
  (requested by <tv>).

* Much improved debugging output.  It's possible to output the wrapper
  work log in-line with normal output by setting WRAPPER_LOG to
  "stderr".

Important differences in behaviour from the old buildlink3 code include:

* Only move the -l options to the end of the command line, leaving the
  -L options in-place.

* Extend the autodetection of the libtool mode to detect "compile" and
  "uninstall".

* Fix problem noted in both PR pkg/24760 and PR pkg/25500, where
  -L/usr/lib/* was being mangled improperly.

* Remove the top-level "buildlink" target; instead, make buildlinking
  occur as part of the "wrapper" target.

* mangle and sub-mangle are only meant to transform directories in
  -I, -L, and rpath options, so remove the lines in
  buildlink3/gen-transform.sh that transformed bare directories.

* Add the ability for the libtool wrapper to be called just to unwrap
  an existing libtool archive by running:

	libtool --mode=unwrap -o libfoo.la

  The old --fix-la syntax no longer works.


20040818
========
* Initial release of a new wrapper script framework that encapsulates
  the non-buildlink-related code and moves it out of mk/buildlink3.
  These features include:

   * making MIPSpro accept GCC options
   * making MIPSpro "ucode" accept GCC options
   * making SunPro accept GCC options
   * making "ld" accept -Wl,* options and silently removing the "-Wl,"
   * (NEW) making UnixWare GCC accept -rpath options and silently
     converting them into an appropriate LD_RUN_PATH

  One major benefit of this is that the buildlink3 code is now much
  tighter and easier to understand since it concerns itself solely
  with buildlink-related details.  I haven't yet optimized the wrapper
  cache, so the new wrapper scripts may take slightly longer to execute
  than the old buildlink3 wrapper scripts, but I'll be improving this
  over time.


20040821
========
* Move the inclusion of $cmd_sink outside of the main loop in wrapper.sh
  so that the $cmd_sink script can be used to globally scan and process
  the arguments.  Move the LD_RUN_PATH code to a cmd-sink-unixware-gcc
  script.  Garbage-collect the now unused export_vars-related code.

* Add cmd-sink-aix-xlc for AIX xlc that munges -Wl,-R* into an
  appropriate -blibpath option.

* Add cmd-sink-interix-gcc and cmd-sink-interix-ld that errors out
  when it sees -fpic/-fPIC and -shared/-Bshareable, respectively
  (requested by <tv>).

* Move the code that converts full paths to shared libraries into the
  "-Ldir -llib" equivalents from the buildlink3 code into wrapper/logic.
  Remove the same from bsd.buildlink3.mk and gen-transform.sh.

* Move the code that checks for absolute rpaths from the buildlink3
  code into wrapper/arg-source.  Remove the same from bsd.buildlink3.mk
  and gen-transform.sh.

* Only move the -l options to the end of the command line, leaving the
  -L options in-place.

* Add more debugging code.


20040824
========
* Fix quoting problems after arguments are transformed.  Remove the
  hack that was inserted that magically made almost everything work
  because we do it the right way now.

* Move the inclusion of $logic outside of the main loop in wrapper.sh
  so that the $logic script doesn't have to worry about underflowing
  the argument buffer.

* Encapsulate the loop in wrapper.sh that fills the argument buffer
  entirely within the arg-source script.

* Move from the logic script into the arg-source script the
  transformations that merge or split arguments.

* Fix bug where skipargs was effectively being ignored if it was more
  than 1.

* Handle the whitespace in transformations in the logic script that
  turn one library option into multiple library options, e.g.
  "-lreadline" -> "-ledit -ltermcap".

* Allow you to specify an environment variable WRAPPER_SKIP_TRANSFORM
  for whether you wish to skip the transformation step in the logic
  script.  This is intended for testing purposes.

* Added check_prog() and init_lib() functions to the shell code library
  to make it more reusable outside of the wrapper framework.

* Allow the msg_log() function to output to "stdout" or "stderr".  If
  you want to have all of the logging appear on the screen, then you
  can now set WRAPPER_LOG=stderr.

* Make some of the script components not overridable on a per-wrapper
  basis.

* Add a gen-transform.sh script that generates transformation sedfiles.
  The "transform" script is used to transform arguments, while the
  "untransform" script is used to unwrap files.  Move the no-rpath
  logic from buildlink3/gen-transform.sh into wrapper/gen-transform.sh
  since it's not buildlink3-specific.

* Check for a non-empty blibpath before adding the option in
  cmd-sink-aix-xlc.

* Extend the autodetection of the libtool mode to detect "compile" and
  "uninstall".

* Add a cmd-sink-libtool script that doesn't pass linker options to
  libtool unless we're in "link" mode.

* Set _USE_RPATH to "yes" for UnixWare so that the wrappers will see the
  rpath options and convert them to a LD_RUN_PATH definition.

* Add more debugging code.


20040826
========
* Rewrite buildlink3/gen-transform.sh to produce more precise sed commands.
  Drop some unused commands from the mini-language, and add a few more
  that are more restrictive in their scope.

* Fix problem where repeated options weren't properly handled by some
  of sed commands.  It's not enough that they're "global replace",
  since some patterns match separator characters before and after each
  option.  We must repeat those patterns twice to catch all instances
  correctly.

* Fix problem noted in both PR pkg/24760 and PR pkg/25500, where
  -L/usr/lib/* was being mangled improperly.

* Remove the top-level "buildlink" target; instead, make buildlinking
  occur as part of the "wrapper" target.

* Add more debugging code.


20040828
========
* Added a head_queue function to shell-lib that returns the head of the
  named queue without popping it off the front of the queue.

* Strip consecutive, repeated library options from the command line when
  we read it in the logic script.

* Be more careful about not underflowing the argument buffer.


20040906
========
* shell-lib was moved into pkgsrc/mk/scripts; correct references to that
  file in the wrapper code.

* Use opt-sub instead of sub-mangle when protecting -I/usr/include/*
  and -L/usr/lib/* from buildlink transformations.  This avoids adding
  lines that look like "-I-I..." in the transformation sedfiles.

* mangle and sub-mangle are only meant to transform directories in
  -I, -L, and rpath options, so remove the lines in
  buildlink3/gen-transform.sh that transformed bare directories.

* Fix bug in strip-slashdot where the "." wasn't backquoted and thus
  matched all characters instead of only the "." character.

* Change the libtool wrapper to use a modified buildcmd script that
  doesn't rearrange any of the arguments.  This should fix spurious
  problems where libtool doesn't understand how to parse the command
  line when the -l options are moved to the end of the argument list.

* Fix bug in the logic script where the $cachearg and $cachedarg
  weren't being properly set at all times, which caused the cache to
  contain the wrong transformed argument.


20040907
========
* Support automatically passing "ABI" flags to the compiler and linker
  depending on the value of ${ABI}.  Currently supports the SunPro
  compiler with ${ABI} == 64 and the MIPSPro compiler with ${ABI} as
  any of 32, n32, o32, and 64.

* Move back the code that splits absolute paths to shared libraries
  from arg-source back into logic.  This allows us to correctly skip
  splitting those paths based on the previous option.  Also add a
  sanity check that the library name in the split argument doesn't
  contain a "/" since shell globs are not as precise as REs.

* Don't transform the path given after --dynamic-linker (used by GNU
  ld for ELF linkage).

* Add the ability for the libtool wrapper to be called just to unwrap
  an existing libtool archive by running:

	libtool --mode=unwrap -o libfoo.la


20040914
========
* Add a loop in libtool-fix-la to ensure that all of the options listed
  in the dependency_libs lines of *.lai files are processed.  This fixes
  a buildlink3 leakage bug.

* Merge the gen-transform.sh scripts between buildlink3 and wrapper and
  place them all in wrapper.  This makes sense since the commands simply
  allow for many types of transformations, which buildlink3 takes
  advantage of, but there is nothing inherently buildlink-ish about
  those commands.

* Don't directly manipulate SUBST_SED.unwrap.  Instead, create the
  value of SUBST_SED.unwrap by combining several other variables
  (currently just _UNWRAP_SED) to ensure that the correct ordering is
  preserved.

* Correct some confusing debugging messages.
2004-09-21 15:01:38 +00:00
jlam
ca70938428 Replace RPATH_FLAG with LINKER_RPATH_FLAG and COMPILER_RPATH_FLAG,
which are the full option names used to set rpath directives for the
linker and the compiler, respectively.  In places were we are invoking
the linker, use "${LINKER_RPATH_FLAG} <path>", where the space is
inserted in case the flag is a word, e.g. -rpath.  The default values
of *_RPATH_FLAG are set by the compiler/*.mk files, depending on the
compiler that you use.  They may be overridden on a ${OPSYS}-specific
basis by setting _OPSYS_LINKER_RPATH_FLAG and _OPSYS_COMPILER_RPATH_FLAG,
respectively.  Garbage-collect _OPSYS_RPATH_NAME and _COMPILER_LD_FLAG.
2004-08-27 06:29:06 +00:00
wiz
d4e8b44315 Retire buildlink2, now that all packages using it have been converted to
buildlink3.
2004-07-06 22:49:16 +00:00
grant
f45f23ce98 gcc 3.3.4 is in pkgsrc now. 2004-07-03 11:25:49 +00:00
jschauma
f152a8f656 We really need to pass the ABI flags to both CFLAGS and LDFLAGS, since
some packages (for example ntp4) have configure scripts that try to be
clever and insert their own if they don't find any.  This would be wrong
on a system that relies on /etc/compiler.defaults to choose the correct
ABI.
2004-06-10 20:34:08 +00:00
jlam
6bb0a14e5a Check that MABIFLAG is defined before checking that it's non-empty. This
avoids breakage if MABIFLAG isn't defined.
2004-05-17 05:33:08 +00:00
jschauma
6f7a52cca0 Allow use of 32bit gcc compiled from pkgsrc on 64bit Irix for a default
ABI of 64.
2004-05-17 03:12:46 +00:00
jschauma
10bc0c9d01 If ABI is set, LDFLAGS also needs the proper flag. 2004-05-12 21:31:50 +00:00
jschauma
b02a7b431a Finally set _COMPILER_LD_FLAG.
(Not having this set caused various rpath related problems, as the compiler
was passed ' -rpath,/path' instead of '-Wl,-rpath,/path', leading to
a rpath of ",path", which of course wouldn't work.)
2004-05-06 14:25:02 +00:00
jschauma
44f433156b gcc can use -mabi=${ABI}, if ABI is set (for example on Irix).
(Includes ugly hack for ABI-inconsistency.  See also PR pkg/22571.)
2004-05-05 03:05:41 +00:00
danw
04e1556286 /usr/bin/cpp on darwin is a wrapper script that forces the
-traditional flag; you need to use "gcc -E" to get sane behavior.
Override sys.mk's definition of CPP in defs.Darwin.mk, and don't
re-override CPP in gcc.mk if ${OPSYS} == Darwin.
2004-05-04 00:11:23 +00:00
jlam
29df39d6b5 GCC has this annoying behaviour where it advocates in a multi-line
banner the use of "#include" over "#import" when including headers.
This generates a _huge_ number of warnings when building practically all
Objective-C code where it is convention to use "#import".  Suppress
the warning if we're building Objective-C code using GCC by passing
-Wno-import to the compiler.
2004-03-30 21:39:24 +00:00
jlam
a9d431f730 Also accept DISTCC_VERBOSE in /etc/mk.conf to allow for easier debugging. 2004-03-17 06:07:06 +00:00
jlam
250b02f294 Allow DISTCC_HOSTS and DISTCC_SSH to be set in /etc/mk.conf to modify the
behaviour of distcc when used in the compiler framework.
2004-03-17 05:23:05 +00:00
jlam
fc5641ff84 Don't save the value of _NEED_NEWER_GCC as it gets a bad value on 1.5.3.
XXX This should be removed after pkgsrc/bootstrap is up and running.
2004-03-13 20:02:52 +00:00
jlam
9014a4ee8f Provide a way to forcibly use the native GCC by setting USE_NATIVE_GCC in
a package Makefile.  Also modify pkg_admin checks to drop stderr so that
errors aren't so verbose.
2004-03-13 19:08:37 +00:00
jlam
bd781e9285 Note what _CC contains. 2004-03-13 17:52:24 +00:00
jlam
a9cc44f9bd Add support for Objective C, and set USE_GCC_SHLIB whenever we're using
C++, Fortran, or Objective C, as we must link against shared libraries.
2004-03-12 06:09:12 +00:00
dmcmahill
c2df7b0cb4 set F77 as well as FC.
was:
1% make show-var PKG_STAGE=configure VARNAME=FC
g77
2% make show-var PKG_STAGE=configure VARNAME=F77
/usr/pkgsrc-current/math/scilab/work/.gcc/bin/g77
is:
3% make show-var PKG_STAGE=configure VARNAME=FC
g77
4% make show-var PKG_STAGE=configure VARNAME=F77
g77

fixes some buildlink spillover noted in the scilab package.
2004-03-10 05:13:38 +00:00
wiz
2c8703a248 Update _GCC_DIST_VERSION to 3.3.3; noted by Ben Secrest on tech-pkg. 2004-03-05 14:36:34 +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
8132b7353c Provide a much more complete list of version number patterns <= 2.95.3. 2004-02-20 07:18:19 +00:00
jlam
75bd3d729a If for some reason, _GCC_REQD doesn't match any of the version pattern
lists, then just assume that we need gcc3.  The rest of the code in the
file assumes that we either need gcc2 or gcc3, so this provides a
fall-through, default value.
2004-02-20 07:10:06 +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
455aa176d8 Initial support for the MIPSpro ucode compilers found on IRIX 5.3. The
ucode compilers only support building the "o32" ABI.
2004-02-18 11:18:42 +00:00
jlam
78080df597 Allow overriding CC_VERSION_STRING and CC_VERSION. 2004-02-18 11:13:54 +00:00
jlam
f9efcd5148 Create wrappers for the compilers for every language supported by the
compiler set.  This will cause the libtool configuration found in several
packages to use the correct C++ compiler even though the package doesn't
use C++.  This was causing bugs when CXXFLAGS contained flags not
understood by the system gcc-2.95.3.
2004-02-15 13:34:33 +00:00
jlam
ae51b23ccf Remove CPP setting for now until I find a better way to wrap these. This
backs out the changes in rev. 1.24 of mk/compiler.mk, but I will restore
the behaviour elsewhere.
2004-02-12 21:37:08 +00:00
jlam
cbea8f59e4 Prevent non-zero exit status when calling the compiler to print out the
version string.
2004-02-12 11:50:46 +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
e17f6d7638 Give a better pseudo CC_VERSION for the SunPro C compiler. 2004-02-10 00:37:53 +00:00
jlam
cb345dd94c Apparently, GCC isn't the only compiler that tries to be clever by checking
with what path it was invoked.  Copy the driver script trick from gcc.mk
into mipspro.mk and sunpro.mk.
2004-02-09 05:50:03 +00:00
jlam
dc8414a9a5 Update comment to reflect reality. 2004-02-09 05:45:57 +00:00
jlam
548aca7853 Reorder some lines so that a default definition for some variables is
present in global context.
2004-02-09 05:22:43 +00:00
jlam
2fd59f45ed Don't have recursive variable definitions. 2004-02-09 01:29:29 +00:00
jlam
27c20963da Use TOOLS_SHELL since we're creating the shell script at override-tools
time.
2004-02-09 00:37:32 +00:00
jlam
3125014a8f Make those scripts executable. 2004-02-08 03:34:20 +00:00
jlam
f57168db2f Use a two-line "exec" shell script instead of a symlink to the real GCC.
This should fix problems with not finding "cc1" or other GCC subprograms.
2004-02-08 03:29:16 +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
eae918c163 I missed changing a defined(_NEED_GCC3) into a yes/no check. 2004-02-06 20:15:49 +00:00
jlam
3737a66b9d Whitespace nit. 2004-02-06 19:16:37 +00:00
jlam
c49973f61a If we're passing through MAKEFLAGS variables whose values may contain
spaces, use the :Q modifier instead of double-quoting the value.  This
fixes breakage when executing the just-in-time su targetes.
2004-02-06 18:45:02 +00:00
jlam
e54ce0c467 Remove a debugging statement. 2004-02-06 04:38: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
352e29f3c1 Get the version string out of the MIPSpro compiler in the right way. 2004-02-05 22:05:42 +00:00
jlam
4cd560ed49 Note that the variables (USE_LANGUAGES, GCC_REQD, PKGSRC_COMPILER) should
be defined in or before the first inclusion of bsd.prefs.mk.
2004-02-05 21:26:16 +00:00
jlam
5add53c2b4 GCC_REQD should be appended to, not set. 2004-02-05 04:12:28 +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
1b5d9d2251 Don't compute the CC_VERSION unless ${CC} exists. 2004-02-05 01:57:38 +00:00
jlam
e14bd051b8 _CC is really meant to be evaluated from the value of CC _as found_ in
that particular location, so set it using :=
2004-02-05 01:50:55 +00:00
jlam
998d6a0b9c _GCC_PREFIX and _GCC_SUBPREFIX are expected to end in "/" if we're using
the pkgsrc gcc.
2004-02-05 01:42:05 +00:00
jlam
4f87d407ea Reset the values of _GCC_PREFIX and _GCC_SUBPREFIX from the value of
_GCC_ARCHDIR, since _GCC_ARCHDIR is something that GCC actually tells us
and can be relied upon to accurately give the installed location of GCC.
2004-02-05 01:28:20 +00:00
jlam
fa2f433053 Missing a " 2004-02-04 23:25:13 +00:00
jlam
2727a4aeb9 case branches are separated by ;; 2004-02-04 23:24:36 +00:00
jlam
3e017ffa31 Try to avoid "/" as the _GCC_SUBPREFIX. 2004-02-04 23:10:19 +00:00
jlam
1769209623 Make it more apparent where certain "not_found" values are being set for
debugging purposes.
2004-02-04 22:33:18 +00:00
jlam
79cd30027c Avoid a non-zero exit value in a != variable definition. 2004-02-04 00:32:16 +00:00
jlam
095af71baa Define _GCC_PKG unconditionally since its value is determined by another
global variable, and so that we can reuse it in other places in gcc.mk.
2004-02-04 00:27:24 +00:00
jlam
dbbec50a86 Try to be smarter about detecting whether a cc in the PATH is actually
GCC.  If it's found under ${LOCALBASE}, then assume that it came from a
package and proactively require at least that version of GCC so that the
correct package dependencies are added.
2004-02-04 00:11:07 +00:00
jlam
55f66ddd70 Reorder checks when setting _GCC_SUBPREFIX so that we always search for
the installed package first if _USE_PKGSRC_GCC is "yes".
2004-02-03 22:35:05 +00:00
jlam
69e47a8c52 Remove not_found checks now that we pre-filter them out when setting
LDFLAGS.
2004-02-03 22:32:22 +00:00
jlam
5bc1349574 Do previous in a different way to avoid make errors. 2004-02-03 22:31:33 +00:00
jlam
49df0ac7ed Don't add to LDFLAGS if the directories are "not_found". 2004-02-03 21:56:40 +00:00
jlam
7c469d9583 ":H", not ":T", is the correct make variable modifier to get everything
except the final component of a path.
2004-02-03 21:51:45 +00:00
jlam
9a4609c2b9 Reorder sections a bit so that related sections are together. 2004-02-03 21:48:14 +00:00
jlam
2a172b2e99 Whitespace nit. 2004-02-03 21:30:26 +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
0c2dd883d9 Check whether _NEED_GCC[23] is yes/no rather than just defined, since
that's the way that its set.  Also, remove _IGNORE_GCC3C and just overload
_IGNORE_GCC to note that we're building the GCC C compiler and that if
we're building something that it depends on, then avoid a dependency loop.
2004-02-03 05:14:03 +00:00
jlam
fa20e41206 Move the _COMPILER_LD_FLAG setting to somehere global as it applies to all
GCCs.
2004-02-03 04:09:27 +00:00
jlam
c09381462f Avoid using "type" to find the absolute path to the compiler. We find it
ourselves now using some make variable magic.
2004-02-03 03:47:45 +00:00
jlam
2c7a49cf63 duh... s/CCACHE/DISTCC/ 2004-02-02 12:47:19 +00:00
jlam
148b4f7b03 Whitespace fixes. 2004-02-02 12:45:08 +00:00
jlam
a8fa1078e7 If we can't find the package using pkg_info, then use a simple heuristic
to figure out _GCC_SUBPREFIX.
2004-02-02 12:44:22 +00:00
jlam
67d464d225 G/C _GCC_ARCHSUBDIR. All references to it from gcc*/buildlink*.mk files
have been removed.
2004-02-02 12:27:12 +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
441289a9c0 Initialize a variable before use. 2004-02-02 11:03:08 +00:00
jlam
bcd3f42ec9 s/:/./ to fix Makefile breakage. 2004-02-02 11:02:18 +00:00
jlam
5ff8c17cd4 Whitespace fixes. 2004-02-02 10:55:26 +00:00
jlam
8a60ac36a0 If USE_GCC_SHLIB is defined, then pretend we need both C and C++ compilers.
This is, of course, wrong.  Excerpted from the file itself:

# 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.
2004-02-02 10:53:08 +00:00
jlam
81ef5c536b If we need a GCC C++ or Fortran compiler, then define USE_GCC_SHLIBS as
all of those programs will link against either libstdc++.so or libg2c.so.
2004-02-02 10:49:26 +00:00
jlam
5193f72834 Rename _GCC{2,3}_REQD to _NEED_GCC{2,3} which more clearly expresses what
that variable is used for.
2004-02-02 10:34:00 +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
5535ccfda7 Fix a broken conditional. 2004-02-01 14:36:23 +00:00
jlam
23a4907c06 Use the gcc3-* packages instead of gcc3. The former are newer, and using
them, we can more finely express which compilers we want.
2004-02-01 14:11:01 +00:00
jlam
ddb89b95fc Use _GCC_REQD where we want the strictest value (GCC_REQD can be a list). 2004-02-01 12:16:10 +00:00
jlam
30b81c9123 Instead of silently failing to include missing files, be loud and give the
error ASAP.
2004-02-01 11:14:04 +00:00
jlam
fed59fb254 Actually, it does matter what _GCC_PKG is set to as it's re-used later as
the value of CC_VERSION for the builtin compiler.
2004-02-01 07:54:33 +00:00
jlam
a462d55c1d Allow PKGSRC_COMPILER to take precedence over any deprecated variables. 2004-02-01 01:36:22 +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
0cf6261dd8 Note that PKGSRC_COMPILER should end in a real compiler. 2004-02-01 01:31:58 +00:00
jlam
dfbb9b9071 Prepend the path to the compiler to PATH even if we're using the builtin
compiler.  This makes ccache and distcc call the correct compiler from
examining the PATH.
2004-02-01 01:23:37 +00:00
jlam
9653a340c2 Prepend ${MIPSPROBASE}/bin to the PATH so that the correct compilers are
found by ccache and distcc.
2004-02-01 01:03:22 +00:00
jlam
c2227604d1 Spell MIPSPROBASE correctly. 2004-02-01 01:02:37 +00:00
jlam
bd07d88193 We're included by bsd.prefs.mk, so no need to include bsd.prefs.mk for
anything.
2004-02-01 00:59:51 +00:00
jlam
8e23220a85 Prepend /opt/SUNWspro/bin to the PATH so that the compiler can be found by
ccache and distcc.
2004-02-01 00:57:26 +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