Commit graph

47 commits

Author SHA1 Message Date
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
16000086e3 note that xlc support is on Darwin. 2005-02-16 08:41:20 +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
dace9b647e Merge down janitorial change from tv-derecurse branch:
Move definition of PKGSRC_COMPILER to defaults/mk.conf, to make it more
readily seen by the user.
2005-01-24 18:07:56 +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
9451157a8f Sort the compiler list in the comments. 2005-01-10 09:05:01 +00:00
jlam
28e0cb9288 Remove the trailing whitespace in the values of the toolchain variables
(CC, LD, CXX, etc.) if the default values have no arguments.  Now,
CC == "cc" and not "cc ".
2004-11-30 15:07:26 +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
jlam
c88ff0fa15 Set initial values for PKG_{CC,CPP,CXX,FC} which are used within the
${compiler}.mk files to discover the short names of the compilers.
This allows ccache.mk to properly create symlinks when CC is set
explicitly within /etc/mk.conf.
2004-11-28 21:32:47 +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
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
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
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
wiz
8ff007ed51 Re-add USE_PKGSRC_GCC, and document it should only be
used in /etc/mk.conf. Requested by Klaus Heinz.
2004-07-04 00:38:15 +00:00
wiz
592ae724f4 Retire USE_GCC2, USE_GCC3, USE_SUNPRO, USE_MIPSPRO, and USE_PKGSRC_GCC,
now that all instances of packages using it have been fixed.
2004-07-04 00:28:30 +00:00
reed
5adcc6fc9e Change date of when deprecated USE_GCC2, USE_GCC3, USE_PKGSRC_GCC,
USE_SUNPRO, USE_MIPSPRO variables would be removed. (According
to jlam@.)
mk/compiler.mk CVS:
----------------------------------------------------------------------
2004-05-12 21:49:39 +00:00
grant
fab441674d add mipspro-ucode to _COMPILERS which was missed the first time. 2004-05-09 00:04:14 +00:00
grant
9d57e1df1f correctly preserve the user-specified order of pseudo-compilers. patch
from jlam@.
2004-05-08 16:36:55 +00:00
grant
fd58cdf03c _PKGSRC_COMPILER needs to contain the real compiler first, then
pseudo-compilers such as ccache and distcc.

fixes problem where lang/gcc{,3} would be incorrectly pulled in when
it should not be.
2004-05-08 15:09:31 +00:00
grant
4f762fb0ce implement {NOT,ONLY}_FOR_COMPILER so that packages can be marked as
requiring a specific compiler (most often those which use gcc-specific
hacks^wfeatures).

this allows users to define PKGSRC_COMPILER to multiple real compilers in
order to implement a compiler preference. for example,
PKGSRC_COMPILER="sunpro gcc" will use sunpro as the default compiler,
and fall back to gcc where a package is marked NOT_FOR_COMPILER=sunpro
or ONLY_FOR_COMPILER=gcc.
2004-05-08 06:03:26 +00:00
sketch
4d692d801b Since revision 1.155 of bsd.prefs.mk, compiler.mk is required in package
Makefiles for testing CC_VERSION, not bsd.prefs.mk.  Reflect that change
in the provided example.
2004-03-31 09:38:36 +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
6bb67cd918 Garbage collect compiler.mk as it's superseded by the new compiler
selection framework in pkgsrc/mk/compiler.
2004-02-01 01:57:39 +00:00
sketch
8248226076 Ensure CPP is defined to use the Sun compiler when building packages
under USE_SUNPRO, to avoid the possibility of picking up "cpp" from a
local GCC installation.
2003-12-10 09:08:24 +00:00
grant
6b5bf9ca71 backout previous, it is no longer needed. 2003-11-12 13:13:43 +00:00
cube
c803330a12 Remove '-' from the version part of _GCC_IN_USE so that pkg_admin can deal
with the installed gcc when it has a localized version (such as our
gcc-3.3.2-nb1).
2003-10-24 12:07:14 +00:00
grant
29952c062d move the libstdc++ fake libtool archive stuff out of
!defined(COMPILER_MK) for now.

some packages include bsd.prefs.mk before defining USE_BUILDLINK2,
which resulted in the libstdc++ fake-la target being missed.

XXX the real fix is to include compiler.mk from both bsd.prefs.mk and
XXX bsd.pkg.mk, and have compiler.mk make the right decisions based on
XXX where it was included from.
2003-10-18 09:14:47 +00:00
grant
30e601d197 fix logic error introduced in last, sync comments about CC_VERSION
with reality.
2003-10-12 03:05:37 +00:00
grant
8031c4141d set CC_VERSION for non-gcc and use it in the BUILD_INFO file. 2003-10-11 03:43:14 +00:00
grant
beb87586be don't hardcode the -DHasGcc2... flags to imake, pass them only if
we're actually using gcc on Solaris.

fixes building of imake PIC code when the compiler is not gcc.
2003-10-11 02:44:17 +00:00
grant
1e3a7c9905 allow lang/gcc{,3} to be used to build themselves by only adding the
(build) dependency if the package being built is not the package which
is providing the compiler.
2003-10-06 11:14:22 +00:00
grant
e6c85cbd25 avoid F77/PKG_FC being recursively defined.
reported by krister.

XXX the Fortran gunk in bsd.pkg.mk will be moved to here later.
2003-10-06 07:11:19 +00:00
grant
5a32f4d868 sync comments with reality.
note once again that USE_GCC2/USE_GCC3 must not be defined in package
Makefiles. also note CC_VERSION and provide a usage example.
2003-09-28 09:53:56 +00:00
grant
cd5be5b371 if /usr/lib/libstdc++.la exists, create the corresponding fake libtool
archive in ${BUILDLINK_DIR}/lib so packages can find and use it.

fixes some build problems seen on Slackware Linux 9.
2003-09-28 09:48:00 +00:00
grant
fadc08de4b set CC and CXX defaults for SunPro when USE_SUNPRO is defined.
the path to cc and CC can be overridden in /etc/mk.conf or on
the command line.
2003-09-27 17:20:38 +00:00
grant
f8dc52ce38 make CC_VERSION available to packages by including bsd.prefs.mk.
it is of the form 'gcc-<version>' if gcc is being used, or empty
otherwise (for now).

requested by tron.
2003-09-24 12:22:03 +00:00
grant
ca89371599 remove redefine of _GCC_PREFIX, whitespace fix. 2003-09-24 03:01:02 +00:00
gavan
fbb3e814f9 Work out _GCC_ARCHSUBDIR correctly, using the method from
lang/gcc3/buildlink2.mk
2003-09-23 19:19:33 +00:00
wiz
dfacdb1019 Test for egcs needs to come first, since egcs -v output also
contains "gcc". From Greg A. Woods in PR 22866.
2003-09-21 16:43:47 +00:00
grant
9fc9274cae explain why including this file in pkg Makefiles is useless. 2003-09-17 19:58:08 +00:00
grant
f694e1e329 honour GCC_REQD by testing $CC -v against it, and only pull in pkgsrc
gcc if required. see the comments for how to use the variables which
influence the decision.

eliminate some spurious shell warnings while I'm here.
2003-09-17 14:37:32 +00:00
salo
308a25fb9c Sync comments with reality. 2003-09-12 22:53:18 +00:00
grant
76c54876d1 remove redundant comment about USE_GCC2 and USE_GCC3 until they are
better handled.
2003-09-12 20:10:17 +00:00
grant
b04786501a move a SunPro tweak to compiler.mk. 2003-09-12 16:07:09 +00:00
grant
ada56b5a0b tidy up handling of LDFLAGS wrt USE_GCC_SHLIB a little. 2003-09-12 15:54:40 +00:00
salo
83dbd690de Typos/punctuation/caps. 2003-09-12 13:35:28 +00:00
grant
c934b0c4e0 start of improved compiler handling, mostly derived from the existing
gcc buildlink2.mk files and splitting the non-buildlink2.mk bits out
into compiler.mk.

this allows USE_GCC2 and USE_GCC3 to work with non-buildlink2 packages
again.
2003-09-12 13:03:38 +00:00