Commit graph

118 commits

Author SHA1 Message Date
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