Commit graph

162 commits

Author SHA1 Message Date
rillig
96a2636f64 Added option handlers for all of -fPIC, -fpic, -KPIC, -kPIC,
-xcode=pic13 and -xcode=pic32, as suggested in PR 35555.

This also fixes and old bug where -fPIC (32 bit) had been translated to
-kpic (13 bit), but apparently that doesn't make a big difference in
practice.
2007-02-07 18:25:29 +00:00
rillig
fdd5258a69 Added a new variable wrapper_type to the wrappers, so that the
transformations can decide whether they happen in a C or a C++ compiler.
Now the wrappers don't depend on the basename of the executed compiler
wrapper anymore.

Fixes PR 35555.
2007-02-06 20:33:50 +00:00
rillig
f705bc4de8 Some more gcc options I've found on Solaris. 2007-02-06 20:26:51 +00:00
rillig
8bae16fa25 More gcc options. 2007-02-06 19:35:41 +00:00
rillig
6cd528c1df The sunpro C++ compiler needs its own cache, since cc and CC transform
-Wall to different arguments.
2007-01-17 13:20:56 +00:00
rillig
a440d183a7 The sunpro wrapper needs to distinguish whether cc or CC is called in
some cases.

XXX: There should be more support in the infrastructure for this case.
2007-01-17 13:19:47 +00:00
rillig
faba91bc57 Options to subprocesses like the assember must pass the transformations.
They are _not_ GCC warnings, although they start with -W.
2007-01-14 18:56:25 +00:00
rillig
78860dce69 Fixed a syntax error. 2007-01-08 14:01:41 +00:00
rillig
91f388696d MIPSpro knows the -c99, -M and -MDupdate options. 2007-01-08 12:09:47 +00:00
rillig
65c174f9e0 Added some more flags that gcc definitely knows, to reduce the number of
warnings.
2007-01-06 02:20:10 +00:00
rillig
dfc54f4c6a Bugfix: Only regular files can be unwrapped. 2007-01-04 00:57:29 +00:00
rillig
37ab58e7c0 Added an "eval" to make the <*> line look like the [*] line, in terms of
the quoting level. It had contained too many backslashes before, which
has led to confusion, at least for me.
2007-01-02 17:13:59 +00:00
rillig
5aceb423df Some of the SunPro compilers (cc, c89) cannot handle the -O0 and -O1
options. Some others (c99, CC) can. To avoid linker errors about
"illegal option -- 1", these options are converted to -xO0 and -xO1,
which work.

Committed during the freeze to avoid breakage of packages. The code that
passed the -O0 and -O1 options through is relatively new, so there may
not have shown packages that break because of this.
2006-12-18 00:21:31 +00:00
martti
e2610fb8c8 Remove trailing tabs. 2006-12-15 13:15:06 +00:00
martti
2cc4216d5e Remove trailing spaces. 2006-12-15 12:46:23 +00:00
dmcmahill
725c4c50a3 Add a --wrappee-name command line option to simply return the name of
the wrapped command and exit.  This will be used by libtool which needs
to figure out the true command name.  Yeah, it is ugly behaviour from
libtool, but I'm not going to rewrite libtool.

Change ok-ed by jlam.
2006-12-14 22:25:19 +00:00
rillig
af345e7eb3 Converted to using the functions from wrapper-subr.sh. 2006-12-10 03:14:59 +00:00
rillig
7bd351d3ea + -M 2006-12-10 00:18:17 +00:00
rillig
c0db9bdc6f Added a small program to test a single transformation plug-in. 2006-12-09 12:42:43 +00:00
rillig
ec0abe202c Since the wrapper transformations are usually quite hard to follow and
may lead to failure for some packages, a note to the user is printed
when a wrapped command fails, including the "real" command line of the
wrapped command.

This change arose from the implicit addition of the -std=c99, -std=gnu99
or -c99 options, which made some packages fail with obscure error
messages. This change helps users get to the real cause more quickly.
2006-12-09 12:11:28 +00:00
rillig
7bf0660e71 + -fno-implicit-templates
+ -MM
2006-12-09 12:06:55 +00:00
rillig
697899fc00 The SunPro C++ compiler knows the -template=* option. 2006-12-08 05:35:55 +00:00
rillig
7a051744ac + -Wcast-align 2006-12-07 00:32:36 +00:00
rillig
fdc2194469 SunPro knows the -mt option for enabling multi-threaded options. 2006-12-05 22:29:27 +00:00
rillig
4304993eda Added -pipe and -Wno-implicit-int to the list of known gcc options. 2006-12-01 21:10:18 +00:00
rillig
1815e3e939 Converted the MIPSpro wrappers to use the transform_* functions. 2006-11-30 13:00:16 +00:00
rillig
aac372bd8c The function transform_pass_with_warning() also gets its debugging
output.
2006-11-30 12:59:56 +00:00
rillig
7ec0b5c018 Adjusted the indentation and the order of checks to match the other
files.
2006-11-30 12:49:57 +00:00
rillig
cb46105231 Made the code simpler by converting it to the new transform_* functions.
A warning is printed whenever unknown options are passed.
2006-11-30 12:34:30 +00:00
rillig
7034ce594b Added handlers for the standard options.
A warning is printed for all options that are not explicitly handled.

Reindentation to align with the other files.
2006-11-30 12:18:32 +00:00
rillig
210a609939 Removed the transform_to_nocache() function, since it is unused.
When discarding arguments, split_arg is set to yes, so that no empty
arguments are added to the resulting command line. A more informative
debugging message is also printed in that case.

Added a debugging message to transform_to(), for consistency with the
other functions.
2006-11-30 12:11:48 +00:00
rillig
d20919c301 Converted to use the new transform_* functions from wrapper-subr.sh. 2006-11-30 11:51:39 +00:00
rillig
d997c2fb01 Added transform_to_and_split(), which removes the need for the
compiler-specific transformations to access the split_arg variable
directly.
2006-11-30 11:40:24 +00:00
rillig
87d17f2abb Minor reformatting. I'm still not sure what the ideal indentation and
source code layout is. But at least, this file looks to me as if even
newbies could see where to change it to fit their needs.
2006-11-30 11:34:23 +00:00
rillig
91dbddf79f Reformatted the file to look more beautiful.
Reordered the compiler options to catch the standard ones first.
2006-11-30 10:01:29 +00:00
rillig
4b93d3ead2 The -E option should be passed to SunPro without a warning. 2006-11-29 17:36:15 +00:00
rillig
0d6ef4486f Removed the separate files for the cache header and footer. This makes
the code a lot more readable.
2006-11-26 14:42:17 +00:00
rillig
ba242d18aa Found some more known options for gcc. 2006-11-26 14:39:52 +00:00
rillig
1bffa7c999 Merged the transformations from the Solaris-specific gcc part into the
generic one. That way, the unknown options are reported properly on all
platforms.
2006-11-26 13:02:53 +00:00
rillig
6a7a034b39 Converted this file to use the shell functions provided in
wrapper-subr.sh.
2006-11-26 13:00:26 +00:00
rillig
9257944253 Oops, unknown options should be _passed_ to the real compiler, not
_discarded_.
2006-11-26 10:00:04 +00:00
rillig
2e410b3409 Added a transformation file for gcc to check for unknown options. 2006-11-26 09:56:46 +00:00
rillig
414d0506c0 Renamed transform_pass_unknown to transform_pass_with_warning and added
transform_discard_with_warning.
2006-11-26 09:55:52 +00:00
rillig
627712c574 transform_pass_unknown writes its warning into the wrapper log file,
instead of doing nothing at all. (Before, I had not known where to write
these warnings, so it had been commented out.)
2006-11-26 09:13:44 +00:00
rillig
2681aeb95a Moved the definition of append_extra_args a bit to make the code a
little more understandable.

Eliminated the otherwise unused variable original_cmd.
2006-11-26 08:42:42 +00:00
rillig
9ba5e8c4e3 Fixed indentation of the debugging messages and the missing newline at
the end of the file.
2006-11-14 13:40:20 +00:00
rillig
c9f593bcde Converted the SunPro wrapper to use the functions from wrapper-subr.sh.
Added some code to check for unknown options.

Reindented the file so that the compiler options are better visible.
They had been hidden by the massive block comments before. Also, every
option has got its own line so that one only needs to read the first
column to find the relevant code.
2006-11-11 07:50:28 +00:00
rillig
b11cdc1a44 Added wrapper-subr.sh, which provides shell functions that are useful to
make the wrapper code less frightening. For example, instead of

    arg="${arg#-Wl,}"
    $debug_log $wrapperlog "   (transform-sunpro-cc) to: $arg"
    addtocache=yes

one can simply write

    transform_to "${arg-Wl,}"

The functions that are currently implemented are: transform_to,
transform_discard, transform_to_nocache, transform_discard,
transform_pass and transform_pass_unknown.
2006-11-11 07:44:46 +00:00
rillig
46aab65a30 Made the SunPro compiler understand gcc's -MM option for generating
Makefile dependencies.
2006-11-11 07:00:57 +00:00
rillig
0f6d0af411 The Tru64 linker does not know -h ${soname}, only -soname ${soname}.
Patch provided by Hrvoje Habjanic in http://mail-index.netbsd.org/pkgsrc-users/2006/11/02/0003.html
2006-11-03 07:28:53 +00:00