Commit graph

288 commits

Author SHA1 Message Date
martti
5867247b54 Remove trailing spaces. 2007-05-28 11:07:00 +00:00
rillig
a5f2e60928 When a wrapped compiler or linker command fails, the transformed command
line is no longer printed by default. To get that behavior back, you can
set the variable WRAPPER_DEBUG to "yes".

This avoids some noise during the build. The old behavior was mostly
useful on Solaris and IRIX, where a -std=c99 or -c99 option had been
added to the compiler's arguments by the wrapper. This caused
diagnostics that were hard to understand, since the user did not specify
these flags and there was no sign that they had been added.
2007-05-19 17:25:56 +00:00
tnn
c7d09b8f3c Back out previous. The packages that incorrectly assume that ld
--version-script works are few enough to warrant fixing each one of them
instead. Silenty dropping the flag makes it impossible to detect whether or
not --version-script is supported. Pointed out by joerg@
2007-05-06 10:05:38 +00:00
tnn
417f311e41 --version-script is GNU ld specific, remove from command line. 2007-04-29 13:16:48 +00:00
tnn
305f2d4288 Correct comment about -g3 flag. 2007-04-28 21:32:30 +00:00
tnn
5246b02f93 Handle linker optimization flag. 2007-04-22 18:56:22 +00:00
tnn
89d0487fe0 fix typo 2007-04-21 14:53:19 +00:00
tnn
cf0d723c6f add workaround for ld(1) run path problems and document those 2007-04-21 01:29:25 +00:00
tnn
146da1286c Teach pkgsrc about HP-UX. 2007-04-14 14:17:49 +00:00
tnn
2df0aa35f6 Add OSF1 wrapper quirks to always enable posix sockets and iso C++ iostreams.
Fixes PR 31444. Fixes PR 31447. Both problems reported by Rumi Szabolcs.
2007-04-12 14:51:10 +00:00
rillig
f98d016454 + -march=* 2007-04-10 03:44:34 +00:00
tron
aef83eee53 Remove special treatment of "DynaLoader.a" completely. It's not necessary
with current libtool version and breaks the build under Darwin 8.x and
NetBSD 4.0_BETA2.
2007-04-09 22:33:26 +00:00
rillig
b422be0f7a wrapper_type can be IMAKE, too. 2007-03-15 22:09:29 +00:00
rillig
1ceda05973 Added the flags to control diagnostics. 2007-03-07 22:02:34 +00:00
rillig
ca73e90164 Fixed the documentation of the opt:*:* transformation. 2007-03-07 12:40:54 +00:00
rillig
215797f36f The compiler option -Wl,foo,bar,baz is split into -Wl,foo -Wl,bar
-Wl,baz before processing the resulting options again.

Fixes PR 32203.
2007-02-23 00:31:29 +00:00
rillig
7cdc72c444 Changed the default warning message to include the word "unknown", since
otherwise it doesn't sound like a warning.
2007-02-22 14:54:32 +00:00
rillig
6699eeb63a More documentation. 2007-02-22 07:15:54 +00:00
rillig
1b99f46aad gcc understands -Wno-unused-parameter. 2007-02-21 19:29:56 +00:00
rillig
4d2476efa1 Changed the failure into a warning when options such as "-I -L" appear
next to each other.
2007-02-21 12:27:36 +00:00
rillig
a0dd1a37e7 The options -I, -L and -R must not be followed directly by another
option. Instead of just merging them, the wrapper fails. Let's see which
packages get broken by that and then fix them.

I've also heard rumours that a plain -L is used as an alias to -nostdlib
in some compilers. This would have been handled wrong up to now, since
it definitely wasn't intended to be merged with the following argument.
2007-02-21 09:43:26 +00:00
rillig
f1bc7a1210 Mapping command line options to the ABI is not as simple as I thought:
-32 does _not_ belong to ABI 32. Instead, the mapping is:

	ABI	Options
	(undef)	-o32 -32
	32	-n32
	64	-64

While here, allowing -OPT:* to pass through to the compiler, since it
will understand it.

This should fix PR 35729.
2007-02-20 16:12:41 +00:00
rillig
5495a908a1 The ABI for which the code should be generated can be queried from the
wrapper_abi variable. This is used in the MIPSpro wrapper to reject any
package that tries to compile a file for the wrong ABI. This is not just
a warning because such a package most likely has more severe problems.

The gcc -Wall option seems to be similar to the MIPSpro -fullwarn
option, so map them.
2007-02-19 14:50:33 +00:00
rillig
b157602e03 The argument -64 means to use the 64-bit ABI for Sun C and MIPSpro. 2007-02-19 14:43:05 +00:00
rillig
ecb69be79f The mipspro compiler knows -32, -n32 and -64, of course. 2007-02-18 23:59:57 +00:00
rillig
ea5e7c8c6d Documented WRAPPER_REORDER_CMDS. 2007-02-18 23:49:44 +00:00
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
rillig
2d8b4b8afb Removed some code duplication, which results in 120 lines less code. 2006-11-02 23:25:00 +00:00
rillig
f00e3cc513 -E is an alias for --export-dynamic, which the Solaris linker does not
understand, too.
2006-10-26 07:01:46 +00:00
rillig
e9bd6f8cff The "scan" program does not modify "$@". 2006-10-21 11:43:42 +00:00
rillig
69155cdc3e Fixed the "inconsistent update" problem when using the pkgsrc wrapper
cache together with MAKE_FLAGS=-j. The cache file is now regenerated
into a temporary file and then renamed (atomically) to the "real" cache
file.

Fixed some code that would fail when run in "set -e" mode. If you want to
test the "set -e" mode, just uncomment the line in wrapper.sh.
2006-10-21 11:42:25 +00:00
rillig
517fa1fce8 When CPP is defined as "cc -E" on Solaris with sunpro, the cc wrapper
had been overwritten with the cpp wrapper, and the latter didn't define
the necessary transformation rules. Fixed that.
2006-10-21 10:01:23 +00:00
rillig
a9df3d8786 When $debug_log is set to ":" and at the same time $IFS is ":", the
command line

    $debug_log $arguments

tries to execute the empty command. This results in error messages of
the form

    cc[50]: : cannot execute   (IRIX)
    bash: : command not found  (Bash)
    : permission denied        (NetBSD /bin/sh)

Setting IFS to the original value as soon as possible fixes these bugs.

Fixes PR 34135.
2006-09-17 22:52:45 +00:00
rillig
6dbf373945 Fixed the "unknown command" error messages for debug_log, which is a
variable, not a shell function.
2006-09-17 18:46:00 +00:00
jlam
5aa00032dc From the second point in Krister's mail to tech-pkg:
http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html

   2. Too much is logged in the .wrapper.log

       The wrappers log quite a lot of detailed information by
       default, with the result that my .work.log file is 176236028
       bytes {for ghc}.

       The wrapper functionality is mature, so this detailed
       information is seldom needed, and you can in general determine
       what happened by looking at the input/output-lines (i.e.
       those lines marked as "[*]" and "<.>" in the .work.log).
       I would therefore like to change the default behavior to
       only log the input/output-lines.

Flip the switch for WRAPPER_DEBUG from "yes" to "no" by default so
that the detailed and rather verbose "push", "pop", "transform", etc.
messages are not printed.  While here, also make WRAPPER_DEBUG a
pkgsrc-private variable by prepending with an underscore.
2006-07-31 14:53:45 +00:00
jlam
50086541bd Use 'debug_log' instead of 'msg_log' so that these wrapper internals aren't
exposed unless WRAPPER_DEBUG is set to "yes".
2006-07-31 14:43:48 +00:00
jlam
6a569e5eb8 After auditing all the packages the ensure that they never invoke the
compiler toolchain until the configure stage, move the "wrapper" stage
back to between "patch" and "configure".

This makes "make extract NO_DEPENDS=" work again for all packages.
2006-07-27 13:47:29 +00:00
jlam
77b719dae8 Modify the barrier so that we always invoke the recursive make process
when passing through the barrier.  This ensures the PATH (passed via
PKGSRC_MAKE_ENV) is correctly set for all phases after the barrier.

This fixes a bug in "interactive" pkgsrc use, where if you have no
work directory and type "make build && make install", then the "install"
step does not have a PATH set to include all the wrapper and tools
directories.
2006-07-22 16:31:35 +00:00
jlam
4011c5cff2 Rearrange sequence so that "wrapper" occurs between "tools" and
"extract".  This allows all user-definable targets (pre-*, do-*,
post-*) to have access to the wrapper scripts.
2006-07-21 14:21:28 +00:00
jlam
356f5e8af5 Rename <phase>_COOKIE variables to _COOKIE.<phase>. These are private
variables so there are no user-visible changes.  This change just makes
it a little easier to write for loops.
2006-07-07 21:24:27 +00:00
jlam
a8fcae3925 The cookie files are indirectly made using *-cookie targets, so verify
that they are never being created more than once by inserting a check
into the *-cookie targets.
2006-07-06 22:29:52 +00:00
jlam
7dd0cd6b98 Never skip the wrapper step, even if NO_BUILD is set. There are packages
that invoke the compiler in either the configure or install steps that
we still need to guard against.
2006-07-06 18:19:45 +00:00
jlam
b8d23232b8 Flatten out recursive makes into a single re-invocation of make by
introducing the concept of a "barrier".  We separate the user-invokable
targets into ones that must happen before the barrier, and ones that
must happen after the barrier.  The ones that happen after the barrier
are run in a sub-make process.  In this case, the targets that must
be run after the barrier are from the "wrapper" step and beyond.  We
rewrite the various "flow" targets, e.g. wrapper, configure, build,
etc., so that they of the right form to use the barrier target.

This now completely removes the concept of PKG_PHASE from pkgsrc.  It
is replaced with the concept of "before" and "after" the barrier, and
this state can be checked by testing for the existence of the barrier
cookie file.  Because we've removed most of the recursive makes, there
is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove
them for now.

As part of this commit, put back the logic that conditionalized the
sources for the various cookie files.  Because the sources are all
"phony" targets, they were always run, regardless of whether or not
the cookie file already existed.  Now, if a cookie file exists, then
that entire phase associated with that cookie file is skipped.

Lastly, fix a thinko in configure/bsd.configure.mk where setting
NO_CONFIGURE in a package Makefile would manage to skip the "wrapper"
step altogether.  Fix this by correctly noting "wrapper" and not
"patch" as the preceding step to "configure".
2006-07-05 22:21:02 +00:00
jlam
990d0b5377 Make the check-vulnerable target more self-sufficient, by moving some
of the logic from fetch/fetch.mk into flavor/pkg/check.mk, so that
check-vulnerable can be used as a source target.

Make check-vulnerable a source target for every phase of the build
workflow, which ensures that it is always run if the user starts a
new phase from the command line.

Fix the cookie-generation targets so that they don't append, only
overwrite to the cookie file.  This works around potential problems
due to recursive makes.

Move the cookie checks so that they surround the corresponding phase
target.  The presence of the cookie should now inform the make process
to avoid doing any processing of phases that occur before the phase
corresponding to the cookie.
2006-07-05 09:08:35 +00:00
jlam
e31200b87c Refactor configure, build, test and wrapper phases out of bsd.pkg.mk
and into their own directories.  Also do some cleanups with build/_build
and pkginstall -- we get rid of _build and simply run pkginstall as
part of the "build" target.

Introduce a new mechanism to handle varying directory depths under
${WRKSRC} in which we find files to override, e.g. configure, config.*,
libtool, etc.  OVERRIDE_DIRDEPTH is a package-settable variable that
specifies how far under ${WRKSRC} the various targets should look,
and it defaults to "2".  We preserve the
meaning of the various *_OVERRIDE variables, so if they are defined,
then their values supersede the OVERRIDE_DIRDEPTH mechanism.

devel/tla will need to specially set OVERRIDE_DIRDEPTH to 3 (see log
for revision 1.1857 for bsd.pkg.mk -- to be done in a separate commit.
2006-07-05 06:09:15 +00:00
jlam
bb74d3bb13 Teach the tools framework about the following new tools:
itools, intltool, diff3, sdiff, msgmerge

* Adding USE_TOOLS+=itools to a package Makefile will cause the
  tool-directory versions of imake, makedepend, mkdirhier and xmkmf
  to point to the ones from the devel/nbitools package.

  This change will remove the need for nbitools/buildlink3.mk, which
  currently does a bit of hackery to force the "right" imake tools to
  be used by packages that need it.

* Adding USE_TOOLS+=intltool to a package Makefile will cause the
  local versions of intltool-* inside ${WRKSRC} to be replaced by
  copies from the textproc/intltool package.  If "intltool" is not
  specified as a tool, then we create "broken" intltool-* tools in
  the tools directory to help highlight hidden dependencies on the
  intltool package.

  In addition, modify the tools framework so that if "perl" is not
  specified as a tool, then we create a "broken" perl tool in the
  tools directory for the same reason as for "intltool".

  These two changes together will remove the need for
  intltools/buildlink3.mk and should also catch all cases where the
  sources' intltools may have been silently used because perl was
  found on the system.

* Adding USE_TOOLS+=diff3, USE_TOOLS+=sdiff, or USE_TOOLS+=msgmerge
  to a package Makefile will cause the corresponding tool to be pulled
  into the tools directory.

  These are convenience tools to help simplify dependencies for some
  packages.
2006-07-05 04:32:10 +00:00
rillig
66e0bd88f8 Fixed an obvious typo: .if !target$(${_WRAP_EMPTY_FILE}) contains a
dollar character before the opening parenthesis. This should really have
been detected by bmake, but somehow the parser seems to be tolerant with
respect to syntax errors.
2006-07-02 09:45:23 +00:00
rillig
87276c331b The gcc equivalent of SunPro's -mt option is -threads. 2006-06-08 06:29:44 +00:00
rillig
b11d1504d0 Replaced jlam's initial sketch with one in which the parts are arranged
in a much simpler way, which hopefully makes the wrapper framework less
frightening to the pkgsrc developers. Added some additional notes.
2006-02-02 23:08:31 +00:00
wiz
921b38d138 Remove superfluous quotes around SUBST_MESSAGE. 2006-01-16 23:35:29 +00:00
rillig
999f8b6e04 Applied all quoting fixes found by "pkglint --autofix". 2005-12-05 22:07:07 +00:00
rillig
567d9fb684 The SunPro compiler does not understand the gcc-specific -pipe option,
but interprets it as -p -i -p -e:, and so discards the following
argument. Fixed by simply discarding that argument.
2005-11-28 13:43:24 +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
tv
3d41114d3f Make WRAPPER_SHELL configurable. 2005-10-10 12:33:29 +00:00
grant
7b498027a9 preserve -Qoption arg if the 2nd next arg isn't -R. 2005-08-21 02:39:52 +00:00
grant
7bdc3361fc strip leading "-Qoption ld" from -R args for sunpro C++ compiler, to
avoid duplicate "-Qoption ld" args when the -R args is later stripped.

thanks to jlam@ for the hint.
2005-08-20 14:37:53 +00:00
grant
fff581f880 add -xnolibmopt after -fast to disable the use of libsunmath (until it
can be sanely statically linked).
2005-08-20 02:11:15 +00:00
grant
9f4fe6c27d pass through -f flags that sunpro understands verbatim, drop other -f*
flags.
2005-08-18 05:04:49 +00:00
grant
0744c46196 drop -Wl,--export-dynamic, as Solaris ld(1) default behaviour is to
export all dynamic symbols.
2005-08-18 05:02:53 +00:00
grant
6cd103ed89 transform -Wl,-soname to -h for sunpro 2005-08-13 06:37:18 +00:00
jlam
ca47ca0ada Hardcode a workaround for perl's DynaLoader.a which is definitely a
PIC code archive, but libtool isn't smart enough to realize it.  Munge
the name within cmd-sink-libtool into something that will make libtool
recognize it as a PIC code archive.  We unmunge it in arg-pp-main so
non-libtool wrappers see the right thing.  This let's us use libtool
to link applications with an embedded Perl interpreter.

I feel so dirty...
2005-08-05 19:46:41 +00:00
grant
b1f57c9784 icc 9.0 wants the same options as 8.1. 2005-07-26 07:36:54 +00:00
grant
89cfcef364 fix typo in comment. 2005-07-23 04:48:12 +00:00
grant
a457387735 ensure gcc options are always passed to imake when using gcc on
Solaris.

fixes PR pkg/29608.
2005-07-23 04:45:30 +00:00
rillig
6474b33a62 Added the gcc option -fpermissive to the list of options that are ignored
by the SunPro compiler.
2005-07-06 14:29:04 +00:00
grant
597263b97a update copyright year 2005-07-06 03:35:28 +00:00
grant
ec6f7fe9a7 add cmd-sink for sunpro C++ which links shared libraries with the
standard C++ runtime libraries.

we need to explicitly do this because ${CXX} only links against the
C++ runtime libraries when building an executable, not a shared
object. this results in executables linked against libraries linked by
${CXX} unable to resolve C++ symbols at runtime.

fixes packages which link shared libraries using ${CXX}, including
graphics/glu, databases/db4, and packages which use shared libraries
provided by these packages.
2005-07-06 03:31:24 +00:00
grant
14b4d18530 ignore more gcc-specific arguments:
-fomit-frame-pointer
	-fwriteable-strings
	-traditional
2005-07-05 08:45:25 +00:00
grant
669abfdb53 sunpro needs the -mt -lpthread arguments for POSIX threads according
to cc(1). modify the -pthread transform accordingly.
2005-07-04 09:48:31 +00:00
jlam
fe40930572 Forgot the strip the comma when removing "-Wl," from the the next
argument during argument merging.
2005-06-09 17:06:21 +00:00
jlam
532553f653 Properly turn:
-Wl,-rpath -Wl,/dir1:/dir2:/dir3
into:
	-Wl,-rpath,/dir1 -Wl,-rpath,/dir2 -Wl,-rpath,/dir3

Do the same for -Wl,-R and -Wl,-rpath-link.  This makes the wrapper
scripts pass the test in regress/buildlink-transform/rpath-merge.mk
and fixes PR pkg/27702.
2005-06-08 05:54:17 +00:00
jlam
ce74a9adee Update comment to reflect implementation. 2005-06-08 05:02:50 +00:00
jlam
53c57e3bf6 Remove part of comment that is no longer true. 2005-06-08 04:54:27 +00:00
rillig
50085b3e47 Made sure the :sh operator does not result in an empty string. Rewrote the
variable substitution for the find(1) command to be more readable.
2005-05-20 22:40:36 +00:00
jlam
262ed77f43 Change instances where we stored shell command in a make variable into
variables that use the :sh modifier.  This still causes expansion to only
happen when referenced, and has the advantage of being :Q-safe.

Bring back the changes from revision 1.19 of mk/subst.mk now that the
problem noted above has been fixed.  This passes the buildlink-unwrap
regression test.
2005-05-20 21:36:05 +00:00
jlam
06697c97a8 Add missing required argument to msg_log. 2005-05-16 17:54:51 +00:00
jlam
0dbd0c0762 Rename MAKE_VARS to MAKEVARS so that it more closely resembles
"MAKEFLAGS".  Both "MAKEVARS" and "MAKEFLAGS" affect the package-level
make process, not the software's own make process.
2005-05-11 22:08:18 +00:00
jlam
03e9337879 Teach bsd.pkg.mk to create a phase-specific "makevars.mk" file that
caches variable definitions that were computed by make.  These variables
are specified by listing them in MAKE_VARS, e.g.,

	.if !defined(FOO)
	FOO!=	very_time_consuming_command
	.endif
	MAKE_VARS+=	FOO

bsd.pkg.mk will include only the one generated during the most recent
phase.  A particular phase's makevars.mk file consists of variable
definitions that are a superset of all of the ones produced in previous
phases of the build.

The caching is useful because bsd.pkg.mk invokes make recursively,
which in the example above has the potential to run the very time-consuming
command each time unless we cause FOO to be defined for the sub-make
processes.  We don't cache via MAKE_FLAGS because MAKE_FLAGS isn't
consistently applied to every invocation of make, and also because
MAKE_FLAGS can overflow the maximum length of a make variable very
quickly if we add many values to it.

One important and desirable property of variables cached via MAKE_VARS
is that they only apply to the current package, and not to any
dependencies whose builds may have been triggered by the current
package.

The makevars.mk files are generated by new targets fetch-vars,
extract-vars, patch-vars, etc., and these targets are built during
the corresponding real-* target to ensure that they are being invoked
with PKG_PHASE set to the proper value.

Also, remove the variables cache file that bsd.wrapper.mk was generating
since the new makevars.mk files provide the same functionality at a
higher level.  Change all WRAPPER_VARS definitions that were used by
the old wrapper-phase cache file into MAKE_VARS definitions.
2005-05-09 05:06:55 +00:00
tv
91b28b7d9a In line with the unconditional inclusion in bsd.pkg.mk, bsd.buildlink3.mk
must always bee included too.
2005-04-07 16:56:00 +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
6f23238a15 fix previous to work with pkgsrc bmake, and add a comment explaining
why it must be done this way.
2005-03-08 00:52:31 +00:00
agc
8fb629087b Also echo the wrapper stages if PKG_VERBOSE is defined, not just when
PKG_DEBUG_LEVEL > 1.
2005-03-06 22:27:12 +00:00
grant
fab0a1b153 add wrappers to transform arguments for AIX's ld(1), notably, if we
are dynamically linking, the -brtl flag must be passed to the linker
so that the runtime linker is used.

tested on AIX 4.3 and 5.1 by garbled@.
2005-02-19 04:19:59 +00:00
grant
892028f6a6 drop -fexceptions which icc doesn't understand. 2005-02-16 23:58:29 +00:00
grant
8910a7722d Always link against the Intel provided C++ runtime library. 2005-02-16 11:24:44 +00:00
grant
94c992087d properly detect icc 8.1, which needs a different argument to
statically link the Intel provided libraries.
2005-02-16 10:59:03 +00:00
grant
ffa50e5ca6 it's 2005, not 2004. 2005-02-15 09:42:23 +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
jlam
e9eb68750b The libtool wrapper should always do the compiler wrapper transformations,
so move the setting for _WRAP_ARG_PP.LIBTOOL out of conditional areas of
bsd.wrapper.mk and set it globally in bsd.buildlink3.mk with the rest of
the libtool wrapper variables.
2005-02-15 03:18:50 +00:00
jlam
993d395028 Add some more debugging annotations for the work log to note split args
and skipped args.
2005-02-14 21:43:11 +00:00
jlam
9a48aa99f1 Move some Darwin-specific code from arg-pp-main into arg-pp-darwin-gcc. 2005-02-14 21:33:36 +00:00
jlam
a4719cbfa5 Teach the libtool wrapper about the same types of transformations that
the compiler wrapper already knows to do.  This should protect
"-install_name ..." from wrapper transformations within the libtool
wrapper on Darwin and fixes PR pkg/29215.

Software that properly use libtool don't pass an explicit "-install_name
..." because libtool always generates its own such argument when
building the (Darwin) shared library.  However, not every piece of
software, including the ones like lang/tcl that pkgsrc converted to
use libtool, will use libtool in the documented fashion.  Longer term,
those packages should be fixed properly, but we will still need the
libtool wrapper to avoid transforming arguments that the compiler
wrapper itself doesn't transform, e.g. for MIPSpro and -LANG:*.
2005-02-14 21:33:08 +00:00
jlam
a2a889c638 Fix so that we preserve /usr/lib/foo.so on the command line. 2005-01-26 05:03:11 +00:00
cube
07b9c2fded Set argmatch=yes when we transform /some/where/libfoo.so into
-L/some/where -lfoo so that the arguments we push on the stack are actually
used in logic.

Should solve the issue build bash with option 'static' enabled reported on
netbsd-users.

OK'd by jlam@.
2005-01-25 23:27:34 +00:00
tv
443bb330bc Disallow -rdynamic (was being attempted by shells/scsh). 2005-01-24 21:21:45 +00:00
jlam
5977984da2 Split out the argument pre-processing logic into its own script
arg-pp-main, and allow for wrapper-specific hooks to extend the
pre-processing through _WRAP_ARG_PP.<wrappee>.  Move the Darwin
GCC-related preprocessing into arg-pp-darwin-gcc, and create a
arg-pp-mipspro-cc that understands -LANG:<feature> and -LIST:<feature>
so that they're not confused with the usual -Ldir options.
2005-01-18 17:25:13 +00:00
jlam
1cdb69ea24 Teach the wrapper scripts about HP-UX *.sl shared libraries. They
work the same way as ELF *.so shared libraries from pkgsrc's point of
view -- just the extension is different.
2005-01-18 05:24:47 +00:00
jlam
03469252ea Really skip the transformations for imake. This shows the danger in
having variables that take a "yes" value to turn off behavior.
2005-01-11 18:08:20 +00:00
jlam
bde2c8d1b9 Fix error in previous that turned off all transformations in all
wrappers.  "Oops".  We now do transformations by default, and turn
them off explicitly for wrappers that don't want them, e.g. IMAKE.
2005-01-10 17:16:35 +00:00
jlam
fe94a16933 Avoid the silly optimization in the make logic and push it into the
shell script instead.  We can't avoid invoking sed at least once since
we need to protect the arguments against shell expansion, but we avoid
invoking sed for transformations unless there actually are transformations
to perform.  The code is simpler, more straightforward, and logically
correct now.

This fixes problems with using a non-GCC compiler with packages that
haven't been converted to use buildlink3, noted in PR pkg/28896.
2005-01-10 03:40:25 +00:00