Commit graph

371 commits

Author SHA1 Message Date
dmcmahill
d7098ab8a2 add some quoting to deal with the case where a file in a package
has a space in the filename.  Without the quoting the buildlink
stage fails completely with errors.  ok'ed by Johnny Lam.
2004-08-13 00:48:05 +00:00
jlam
ec2830a96a Reorder the transformations in _BLNK_TRANSFORM so that commands to
remove rpath options come first.  This fixes problems we may encounter
if ${_OPSYS_RPATH_NAME} is something surprising, like "-L".  On Darwin,
this was causing -L/usr/lib to be stripped out of "-Wl,-L/usr/lib",
which left a bare "-Wl," on the command line.
2004-08-10 15:16:29 +00:00
jlam
dda95b6721 In the rpath transformations, also handle -Wl,@_OPSYS_RPATH_NAME@... in
case ${_OPSYS_RPATH_NAME} is something surprising, like "-L".
2004-08-10 15:13:25 +00:00
jlam
08ffe1eca5 Update documentation for the current state of buildlink3. 2004-07-30 20:52:44 +00:00
xtraeme
9f3bfb4a8f Enable X11_TYPE=xorg now that we have the X.org packages on pkgsrc. 2004-07-29 05:09:29 +00:00
grant
1d8168af4e explicitly don't transform "-Wl,*", fixing a bug that meant we were
throwing away all -W arguments that weren't -Wl,-R.

fixes building of a number of packages on Solaris.
2004-07-10 12:55:08 +00:00
wiz
36ccfca825 Handle --execute the same way as --install (not modifying the arguments).
Needed to convert inputmethods/xcin to bl3. Idea from jlam.
2004-07-04 09:52:04 +00:00
grant
4b6f21b903 transform --export-dynamic to -G and strip -fstrict-prototypes. 2004-07-04 08:30:46 +00:00
grant
ca57d6e396 update the cache for -static 2004-07-03 20:53:59 +00:00
grant
456c546037 fix typo and slight botch up in last 2004-07-03 20:53:47 +00:00
salo
61d3b15bc9 Convert -static to -Bstatic. 2004-07-03 20:39:26 +00:00
xtraeme
d8d555b461 Remove references about BUILDLINK_UPDATE_CACHE in the configure stage,
you could build packages faster right now (yay), I'm using this way
around +2 months ago without any problem.

Ok'ed by jlam@.
2004-06-22 23:23:36 +00:00
grant
9bc788ad87 strip -fno-gnu-keywords argument to SunPro, and munge -pthread into
-lpthread. ok'd by jlam.

addresses PR pkg/24966 from Charlie Allom.
2004-06-13 08:50:15 +00:00
tv
b04b3d3ba0 A couple packages (including the new boost) use "libfoo.so" as a directory
name -- this seems to be common among Jam-using packages.  So, make sure
to do the -L -l transform only if at the end of a word.  This unfortunately
doubles the number of regexes needed to match (one with $_sep, one with $).

While here, though, the expressions for .so, .so.X, .so.X.Y, and .so.X.Y.Z
can all be collapsed into only one set with the use of \(\.[0-9]\)*, so we
actually end up with *less* regexes than before.  :)
2004-06-04 19:21:23 +00:00
jschauma
8196789a05 Append ${ABI} to some lib-dirs. This is a no-op on systems that do not
use ABI, but allows IRIX and particularly IRIX64 to find the correct libraries
especially when linking against X11 libs.  Tested over several months and
multiple bulk-builds.
2004-06-04 15:00:14 +00:00
seb
00cc0486ea Garbage collect BUILDLINK_PKGBASE.<pkg> from buildlink3: it is not anymore
used since revision 1.139 of mk/buildlink3/bsd.buildlink3.mk.
2004-05-17 21:32:33 +00:00
jlam
9dc812c039 libtool archives don't start with '-', so don't match those, which are
probably options to the compiler.
2004-05-17 10:37:57 +00:00
grant
f8cbf47c3e remove a word which shouldn't be there. 2004-05-08 23:46:20 +00:00
minskim
228608ef83 Define BLNK_RECMETHOD.${_pkg_} not only for full dependency but also
for build dependency.  Also fix a related pasto.  This fixes a
malformed conditional error that occurs when a package in build
dependency has BUILDLINK_RECOMMENDED.*.

OK'ed by jmmv@.
2004-04-26 16:27:36 +00:00
jlam
419a7941e9 Don't treat ${BUILDLINK_DIR} like a local directory in the "${WRKSRC} ==
${WRKDIR}" case when converting references to local libtool archives into
the full paths.
2004-04-24 22:04:46 +00:00
minskim
a6b771c787 Create links to .pc files in BUILDLINK_DIR when building a pkgviews
package.  OK'ed by jmmv@.
2004-04-24 15:49:42 +00:00
snj
961fd1293d When substituting the location of a libtool archive, check to make sure
that the new one actually exists.  Fixes PR pkg/25054.
2004-04-22 22:28:19 +00:00
snj
34fe1cb3c3 Symlink *.idl into ${BUILDLINK_DIR}. This is needed for various gnome
packages.
2004-04-18 22:33:06 +00:00
jmmv
ed73278ee0 Let -D flags be passed through the transformation script, so that they
can be easily suppressed/modified from package Makefiles; this is needed
to fix some programs to build against GTK+ 2.4 without having to patch
the sources.
2004-04-15 09:31:48 +00:00
tv
237bbc5d95 Revert the uberdependencies introduced when originally intending to
fix a bug in the way gnome-libs's dependencies work.  This should be
fixed by a mechanism that takes into account exactly how the API
dependencies are structured.

fixes PR pkg/25088 -- and reopens PR pkg/24799
2004-04-12 19:37:03 +00:00
xtraeme
b15072fe03 err BUILDLINK_UPDATE_CACHE should be no for now... sorry I had this change
in my local tree.
2004-04-06 04:39:00 +00:00
xtraeme
703534638e Ensure USE_BUILTIN.<pkg> is defined before checking its value, fixes
last problems seen when using X11_TYPE=XFree86.
2004-04-05 17:00:12 +00:00
jlam
c7be0d97cf Be robust against the possibility that buildlibdir isn't defined. 2004-04-01 21:21:13 +00:00
jlam
ce7bf9c372 Move the check for USE_X11 after bsd.builtin.mk included since that file
may indirectly set USE_X11.  This should fix using some of the builtin
X11 software to build non-X11 packages.
2004-03-31 07:12:31 +00:00
jlam
a87ac65a40 There is no "heimdal-libs" package. 2004-03-30 20:29:54 +00:00
jlam
7783b66d89 Extend the capabilities of buildlink3's libtool wrapper a bit compared
to the stock libtool: you can now copy or symlink an uninstalled
libtool archive file somewhere else than its build directory, and you
can still link against it.  This allows us to more easily bolt libtool
build machinery onto packages that have unusual(ly crappy) build
systems that rely on installing libraries to some common build directory
after they're built.

We do this by adding a "buildlibdir" variable to the uninstalled
libtool archive that points to the build directory of the archive.
Whenever we link against this archive, we rewrite the path to archive
on the libtool command line so that it points to the true archive.
This allows the real libtool to find the files under $buildlibdir/.libs.
2004-03-30 17:25:19 +00:00
jlam
474598e164 Allow setting BUILDLINK_WRAPPER_LOG in /etc/mk.conf and using that as the
log file used by all of the wrapper scripts.
2004-03-29 06:05:10 +00:00
jlam
a0923cb1cf Handle "-Xlinker" being equivalent to "-Wl," when passing arguments
to the linker.  This fixes a bug building Emacs on Linux.
2004-03-29 06:02:53 +00:00
jlam
82cd68d38a Look at the list of run-time dependencies for the package (gleaned
from BUILDLINK_PACKAGES, which is built up by including buildlink[23].mk
files in the package's Makefile), and for each dependency, if it's
already installed, then automatically include the buildlink[23].mk
file for that dependency.

This means that for any package, the dependencies are taken to be the
union of the dependency information as laid out in /usr/pkgsrc and
the dependency information of installed packages stored in /var/db/pkg.

This handle situations where an installed package has _more_ dependencies
than the package as it exists in pkgsrc.  This can occur, e.g., if
you build databases/gnome-libs with BDB_DEFAULT=db4, and then you
decide that you'd rather build other packages using the native Berkeley
DB, so you remove that setting from your environment.  You'd still
like for your packages that depend on gnome-libs to also depend on
db4, but the pkgsrc Makefiles no longer reflect that dependency.
2004-03-29 05:42:58 +00:00
jlam
020b3ec3e2 Make the list of files "buildlinked" be unique for cleanliness' sake. 2004-03-29 05:27:42 +00:00
jlam
d1b4206bba Instead of saving all of the buildlink3 variables into the command-line
environment, it creates a Makefile fragment that is included within
bsd.buildlink3.mk that contains all of the buildlink3 variable
definitions that we want to pass to make(1) invocations on the same
package Makefile.  Change the make variables that are only relevant
for the current package to use BUILDLINK_VARS instead of MAKEFLAGS.
This avoids overflowing the command line with lots of extra arguments.
2004-03-29 05:21:17 +00:00
xtraeme
18a3083bd9 Enable X11_TYPE=XFree86. 2004-03-28 22:25:35 +00:00
jlam
e237ad11d0 Ensure that ${LOCALBASE}/lib is always in the runtime library search path,
even for packages that have no dependencies.
2004-03-26 08:53:01 +00:00
jlam
aa26ea0b16 Move the code that includes the package builtin.mk files into a separate
file, bsd.builtin.mk.  Document the requirements and the recommended
structure of a builtin.mk file in the comments at the top of
bsd.builtin.mk.
2004-03-21 00:03:32 +00:00
jlam
725855d095 Don't match "bin/libtool" and symlink into the buildlink directory if
libtool/buildlink3.mk is included by a package Makefile, as that symlink
overwrites the libtool wrapper script.  This fixes pkg/24851.
2004-03-19 20:27:44 +00:00
danw
bf0551245e add another darwin linker option that needs to be protected from
path munging
2004-03-19 00:04:42 +00:00
jlam
27336df716 Back out part of previous that was an unrelated change accidentally
committed.
2004-03-18 09:22:34 +00:00
jlam
7db11b582a Fix serious bug where BUILDLINK_PACKAGES wasn't being ordered properly
by moving the inclusion of buildlink3.mk files outside of the protected
region.  This bug would be seen by users that have set PREFER_PKGSRC
or PREFER_NATIVE to non-default values.

BUILDLINK_PACKAGES should be ordered so that for any package in the
list, that package doesn't depend on any packages to the left of it
in the list.  This ordering property is used to check for builtin
packages in the correct order.  The problem was that including a
buildlink3.mk file for <pkg> correctly ensured that <pkg> was removed
from BUILDLINK_PACKAGES and appended to the end.  However, since the
inclusion of any other buildlink3.mk files within that buildlink3.mk
was in a region that was protected against multiple inclusion, those
dependencies weren't also moved to the end of BUILDLINK_PACKAGES.
2004-03-18 09:12:08 +00:00
jlam
59bdf89739 If the ${PKGBASE} of a package doesn't match the token passed to
BUILDLINK_PACKAGES, then set BUILDLINK_PKGBASE.<pkg> explicitly so that
we can map from <pkg> to BUILDLINK_PKGBASE.<pkg>.
2004-03-16 18:23:26 +00:00
jlam
fb92616cec Be more permissive in finding libraries to symlink into the buildlink
directory as libraries may be found outside of ${PREFIX}/lib.  We now
match anything that looks like "/lib[^/]*$".
2004-03-16 16:19:37 +00:00
jlam
dbe375ec88 Some of the builtin.mk files append more values to BUILDLINK_PACKAGES, so
make a separate loop to set the default value of USE_BUILTIN.<pkg>.
2004-03-16 02:03:31 +00:00
jlam
62bd2cd672 Add -L${X11BASE}/lib for the benefit of any *-config scripts on
use-xpkgwedge systems.  Not needed when building within pkgsrc, but useful
if you want to link outside 3rd-party software against pkgsrc-controlled
libraries.
2004-03-15 17:55:31 +00:00
jlam
8a2b888017 Back out previous and remove an extra ")" that was causing "malformed
conditional" problems.
2004-03-14 20:27:17 +00:00
jlam
e506d614ce Apparently, some pre-conditions aren't true, so set a default USE_BUILTIN
value before checking it.
2004-03-14 19:04:01 +00:00
jlam
86bb0a15b8 Don't bother checking whether a package is actually built-in or not
in the fall-through code for setting a default value for USE_BUILTIN.<pkg>.
This provides ensures that USE_BUILTIN.<pkg> is always set for every
package listed in BUILDLINK_PACKAGES.  Back out previous as it's now
unneeded.
2004-03-14 18:57:04 +00:00
jmmv
14aa52924a Fix a 'malformed conditional' error. 2004-03-14 12:15:19 +00:00
uebayasi
ac4027935c Indent. 2004-03-13 03:41:13 +00:00
jlam
277b3e1dbb During the "extract" phase (which is when "install-depends" is invoked),
add all of the direct _and_ indirect dependencies to the DEPENDS list.
This causes "install-depends" to check that every dependency, whether
it be direct or indirect, is up-to-date.  This fixes PR 24721 by Jeremy
Reed.
2004-03-13 03:33:31 +00:00
jlam
9eac3f73f0 Ensure that _BLNK_DEPENDS is a subset of _BLNK_PACKAGES. Also rearrange
some code to more easily allow other having different dependency lists for
different phases.
2004-03-12 18:45:20 +00:00
jlam
056d15bbf0 Move a code snippet for easier readability. 2004-03-12 18:03:53 +00:00
jlam
76bf003824 Put comments in order that make sense. 2004-03-12 15:45:43 +00:00
jlam
12d273cd9d Check that a variable is defined before using it.
BUILDLINK_PKGSRCDIR.<pkg> may not be defined since <pkg> may refer to a
dummy package, e.g. "db-native" as set by bdb.buildlink3.mk.
2004-03-11 08:36:41 +00:00
jlam
f755e633c2 X11_TYPE is a user-settable variable that can take the values:
native		use the native, non-pkgsrc-managed X11R6
	XFree86		use x11/XFree86-libs (not yet implemented)
	xlibs		use freedesktop.org xlibs (not yet implemented)

It is used to set the X11 implementation used to build X11 packages.
2004-03-11 06:32:58 +00:00
jlam
c1302f2da6 We can garbage collect USE_X11_LINKS which was used solely to avoid
build loops, which are now handled in a more general way using
IGNORE_PKG.<pkg>.
2004-03-11 05:15:23 +00:00
jlam
088bbd1c66 Avoid build loops by ensuring that a package can never inadvertantly be
a dependency for itself.  This is done by setting IGNORE_PKG.<pkg> if
<pkg> is the current package and then appropriately checking its value.
2004-03-11 05:13:31 +00:00
jlam
a06db92674 Instead of doing a special step to copy the contents of
/usr/pkg/share/x11-links into the buildlink directory, just rely on the
regular buildlink3 infrastructure to do it for us.  This simplifies the
handling of X11 in buildlink3.  The only caveat is that "x11-links"
should appear at the head of BUILDLINK_PACKAGES, and this detail is
handled by x11-links/buildlink3.mk.
2004-03-11 00:54:51 +00:00
jlam
de9a48935b Along with BUILDLINK_INCDIRS.<pkg> and BUILDLINK_LIBDIRS.<pkg>, also have
BUILDLINK_RPATHDIRS.<pkg> which is a list of directories relative to
BUILDLINK_PREFIX.<pkg> to add to the library runtime search path.  For
packages that are a full dependency, this defaults to
BUILDLINK_LIBDIRS.<pkg>, but for packages that are a build dependency,
this defaults to an empty list (on the theory that a build dependency
doesn't have any shared libraries required by the package at runtime).
2004-03-11 00:26:29 +00:00
jlam
463209639c The libtool archive filter was incorrectly eating the closing quote on
the dependency_libs line if it ended in a "-Ldir" option.  Fix by not
eating shell word separators [ \`\"':;,].  This should fix PR 24639 by
Matthias Scheler.
2004-03-10 19:42:27 +00:00
jlam
9d61fef853 Get rid of BUILDLINK_USE_BUILTIN and BUILDLINK_IS_BUILTIN, as they're
renamed to {USE,IS}_BUILTIN and are handled separately by the builtin.mk
files.

Create a new variable PREFER.<pkg> that lets <pkg>/builtin.mk determine
what the preference is in a simple way.
2004-03-10 17:49:26 +00:00
jlam
6d89d6f410 Do previous in a different way by providing a default value for
USE_BUILTIN.<pkg> before it is checked.  _BLNK_PACKAGES isn't strictly
a superset of _BLNK_DEPENDS due to the special x11-links handling
which should eventually be removed altogether.
2004-03-06 14:38:01 +00:00
xtraeme
19638ed9ef Make sure USE_BUILTIN.<pkg> is defined before checking its value. jlam@
seems dead again... so I'll commit this.
2004-03-06 09:46:05 +00:00
jlam
9ff0e10340 Reorder location and setting of BUILDLINK_PACKAGES to match template
buildlink3.mk file in revision 1.101 of bsd.buildlink3.mk.
2004-03-05 19:25:06 +00:00
jlam
07634a03fa Update template bsd.buildlink3.mk file to work with to-be-committed
changes to the buildlink3 framework.  The changes ensure that
BUILDLINK_PACKAGES orders packages so that for any element in the
list, the packages to the right do not depend on any packages to the
left of that element.
2004-03-05 19:09:56 +00:00
jlam
1a98a9895b sjg recommends escaping the bare left curly brace in the make variable
modifer expression.
2004-02-23 09:15:33 +00:00
jlam
00b950724b Back out previous because that brace is not supposed to be there. 2004-02-23 08:58:22 +00:00
dogcow
48adda54db add a missing } to the end of the line; fixes PR/24525. 2004-02-23 08:18:59 +00:00
jlam
65af2d1fe6 According to the documentation on version numbering of shared libraries at:
http://fink.sourceforge.net/doc/porting/shared.php

It's okay to link against a name like "libqt.2.3.0.dylib" using
"-lqt.2.3.0", which means we never need to do anything more than just
strip the trailing ".dylib" from shared library names when converting from
a full path to "-L... -l...".  This should fix PR 24402.
2004-02-19 18:39:27 +00:00
jlam
3d05ef90b1 Use the mipspro-ucode bits if we're using the mipspro-ucode compiler. 2004-02-19 13:17:13 +00:00
jlam
b4081e6300 Resolve ${LOCALBASE} to its phyiscal path and mangle it back into
${LOCALBASE}.  Some packages' configure scripts resolve all paths to
physical paths, and since buildlink3 suppresses references outside of
${LOCALBASE}, it can break the build of those packages.

This should fix the problem noted by Nathan Williams in the thread
titled "x11/tk build failure" at:

	http://mail-index.netbsd.org/tech-pkg/2004/02/17/0004.html
2004-02-19 12:50:47 +00:00
jlam
2a766c79fa Don't spew files in the package directory if the BUILDLINK_DEPENDS.<pkg>
uses {} to list several "or" dependencies.
2004-02-19 07:41:44 +00:00
jlam
5c40aefbbe Output a more informative/desriptive error than:
cd: cd BUILDLINK_PREFIX.foo_not_found

We now say that the package wasn't installed at the time that we were
trying to buildlink its files.
2004-02-18 19:16:52 +00:00
jlam
3bc670ced3 Remove some checks for PREPEND_PATH as we don't need them. 2004-02-18 14:23:42 +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
990623913c Typo in comment. 2004-02-18 11:10:35 +00:00
jlam
192e73f9e3 Typo in comment. 2004-02-18 05:23:37 +00:00
jlam
bedc09eef8 Require x11-links-0.23 for the correct set of links with XFree86-4.3.x. 2004-02-17 16:56:47 +00:00
jlam
350ca28970 Fix the glob pattern to match >= dependencies correctly. 2004-02-17 16:07:37 +00:00
jlam
50e37dd0bd Do "dependency reduction" where dependency lists of the form "foo>=0.2
foo>=0.3 foo>=0.4" are collapsed into a single "foo>=0.4" dependency.
2004-02-17 14:49:17 +00:00
jlam
bad42f1f3f +less obfuscated errors 2004-02-17 08:59:44 +00:00
grant
1c81e8e6a1 also ignore -pedantic, SunPro doesn't need to be told ;-) 2004-02-16 22:22:38 +00:00
jlam
e95593a479 Symlink any *.pc files into ${BUILDLINK_DIR} for dependencies and force
pkg-config to only look in ${BUILDLINK_DIR}/lib/pkgconfig for *.pc files.
This will correctly hide the presence of software from configure scripts
that query pkg-config for that information.

Idea suggested by Julio M. Merino Vidal.
2004-02-16 21:01:17 +00:00
jlam
2a3f166b38 Add some TODO items for me. 2004-02-16 20:50:50 +00:00
grant
0e24610e47 ignore -ansi, SunPro doesn't need to be told to support ANSI C. 2004-02-16 12:18:15 +00:00
jlam
bacf725a9d Move section that checks for PREFER_PKGSRC a little higher so that it
actually has some effect.
2004-02-16 03:08:52 +00:00
jlam
d48d056fe7 Whitespace nits. 2004-02-15 14:50:11 +00:00
jlam
d859a79bb1 Aside from everything under ${PREFIX}/include, grab all *.h files for
symlinking into ${BUILDLINK_DIR} for a more complete set of headers.
2004-02-15 14:37:00 +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
5dfc302c34 Change "-I dir" to "-Idir" (same for -L/-R) so that the .transform.sed
script will understand these commands.
2004-02-13 16:49:53 +00:00
jlam
4beeebf425 Move a test from the reorderlibs script out to the wrapper scripts for
efficiency reasons.
2004-02-12 20:29:34 +00:00
jlam
bf3e309dc8 Add missing "$" that was causing the reorderlibs script to create a
variable with an exponentially increasing size.  Fixes infinite loop when
building security/cyrus-saslauthd.
2004-02-12 20:20:35 +00:00
jlam
64a361223d Skip the common cache for more options that are only sunpro-cc related. 2004-02-12 10:16:27 +00:00
jlam
c1fa249663 Modify the "no-rpath" to not need a "/" to start the rpath. Also modify
the "r" command to allow paths ending in "/".  This should fix PR 24352.
2004-02-12 08:28:58 +00:00
jlam
09ed136483 Darwin's special GCC also uses -dylib_file and -dylib_install_name in
similar ways to -install_name, and all need the subsequent argument to be
protected from /path/shlib -> -L/path -lshlib transformations.
2004-02-09 04:35:12 +00:00
jlam
46728682bf Don't generate wrapper scripts if we can't find the wrappee. 2004-02-09 03:05:59 +00:00
jlam
8396978738 We need the full path to the libtool that needs to be invoked when we
use LIBTOOL_OVERRIDE.  In the buildlink[23] case, that is supposed to be
the one in ${BUILDLINK_DIR}.  Create new private variables _LIBTOOL and
_SHLIBTOOL to hold these paths.
2004-02-09 01:30:59 +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
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
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
9a9cc4b6d2 Touch up the grammar a bit in the last commit. 2004-02-05 08:50:38 +00:00
seb
9429c9246f Mention that some buildlink3 variables are not defined at all times.
Approved by jlam@.
2004-02-05 07:49:48 +00:00
jlam
317cc72791 Make PREFER_PKGSRC just yes/no or a list of packages. This makes it
simpler to understand.
2004-02-05 07:17:14 +00:00
jlam
e7133cac25 Rename BUILDLINK_PREFER_PKGSRC to PREFER_PKGSRC so that we can use its
value outside of buildlink-related files.
2004-02-05 07:06:15 +00:00
jlam
07a9d8dfb2 Support a new global variable:
BUILDLINK_PREFER_PKGSRC
	This variable determines whether or not to prefer the pkgsrc
	versions of software that is also present in the base system.

	This variable is multi-state:
		defined, or "yes"	always prefer the pkgsrc versions
		not defined, or "no"	only use the pkgsrc versions if
					needed by dependency requirements

	This can also take a list of packages for which to prefer the
	pkgsrc-installed software.  The package names may be found by
	consulting the value added to BUILDLINK_PACKAGES in the
	buildlink[23].mk files for that package.
2004-02-05 06:58:02 +00:00
jlam
adb77485ab Fix an error that crept in between revisions 1.25 and 1.26 where some /'s
were inadvertantly added when replacing the awk script with a sed script.
2004-02-05 00:00:05 +00:00
jlam
154fd6b9b3 Make it more apparent where certain "not_found" values are set for
debugging purposes.
2004-02-04 22:31:54 +00:00
jlam
eedd099369 Fix harmless for-loop-break bug. 2004-02-04 22:27:41 +00:00
jlam
09eca416bc Instead of tedious validating every platform for full caching compliance,
just assume they do unless they're known _not_ to work.  So far, only
Darwin-5.* suffers from this problem, apparently because they use some
bizarre version of zsh for /bin/sh.
2004-02-04 01:13:04 +00:00
jlam
e9559de07c Only create wrapper scripts for compilers that we require support for as
noted in USE_LANGUAGES.
2004-02-02 10:26:42 +00:00
grant
f2b6f2f963 transform -f{pic,PIC} -> -Kpic and -shared -> -G to fix building of
packages which pass these gcc-specific flags.

also ignore -Werror; if a package passes -Werror, it's expecting that
the compiler is gcc, which in this case it is not. SunPro often emits
warnings on code which gcc doesn't, so transforming this flag to
-errwarn is counterproductive.
2004-02-02 01:36:14 +00:00
jlam
83dc2192c8 USE_{SUNPRO,MIPSPRO} are deprecated... check PKGSRC_COMPILER instead.
Also remove unneeded section on OS-specific wrappers that's handled
automatically nowadays by pkgsrc/bl3.
2004-02-01 12:04:13 +00:00
jlam
3dad364543 How'd that -lb get there? 2004-02-01 00:41:25 +00:00
recht
a8f44897b9 Bump the x11-links dependency to 0.20 to get the extensions/extutil.h
header.
2004-01-31 22:00:51 +00:00
jlam
da09d28be6 Use the stack in a smarter way. Take an argument (perhaps marshalling
several arguments together) from the command line and push it onto the
stack.  Pop the top off the stack, process, and push replacement
arguments onto the stack.  Repeat the last step until no more processing
is done, and we have our final argument to be passed on through to the
rest of the wrapper script.
2004-01-30 13:44:52 +00:00
jlam
d66744b96d Remove debugging line that I accidentally left there. 2004-01-30 11:29:56 +00:00
jlam
e2c107a7e9 Teach buildlink3 how to reorder libraries on the command line. You
specify library orderings with:

	BUILDLINK_TRANSFORM+=	reorder:l:crypt:crypto

The wrapper scripts then reorder the libraries so that -lcrypt will
always come before -lcrypto.  If there are lots of reorder:l:...
commands, then the algorithm looks a bit like a topological sort.
2004-01-30 10:56:11 +00:00
jlam
dde5c9a30c Revert the changes in revision 1.2 to do duplicate directory suppression.
We just let the rest of the wrapper scripts do it now that we can't
overflow a fixed-sized circular buffer.
2004-01-29 07:19:00 +00:00
jlam
b45e649a08 Use a stack instead of the broken implementation of a circular list for the
argument buffer.
2004-01-29 07:14:30 +00:00
jlam
876f47a810 Reorder arguments so that all of the -l options come after the -L options
which come after everything else.  This ensure that all libraries come
after all -L/dir options so that the Sun linker won't act stupidly.
2004-01-29 06:06:41 +00:00
jlam
1ba170e917 Commit the buildlink3 developer's guide and the pkgviews user's guide until
they're polished enough to be included into Packages.txt.
2004-01-29 06:03:15 +00:00
jlam
e8eafe236e Abstract out the filter commmand used to list headers and libraries in
the package +CONTENTS file into a variable BUILDLINK_CONTENTS_FILTER.<pkg>.
2004-01-27 12:19:03 +00:00
jlam
2c5e5ce5d0 Move all of the stuff relating to _BLNK_ADD_TO.* into the same if.endif
block.
2004-01-27 08:42:13 +00:00
jlam
955f55be09 Add a missing "empty". Thanks seb! 2004-01-27 08:39:24 +00:00
jlam
5b7a8cf9b1 Also break up -R*:* into separate -R options. 2004-01-27 08:23:45 +00:00
jlam
aab2374faf Restore changes in 1.57 that were backed out in 1.60. The _BLNK_ADD_TO.*
variables are no longer saved using MAKEFLAGS since the saved values aren't
correct for recursively invoked make targets that bsd.pkg.mk uses
internally for information-gathering, e.g. show-var, run-depends-list.
Instead of saving the values, we now just don't compute them during phases
of the build that don't care about the dependency information, e.g. when
not in extract, install, or package.
2004-01-27 02:32:56 +00:00
seb
1df8873c30 Revert changes in revision 1.57:
_BLNK_ADD_TO.* never get redefined for dependent packages (recursive
make invocation in install-depends target) causing an endless loop.
2004-01-26 22:19:16 +00:00
jlam
2d58c835eb Use -S instead of '-s ""' to check for package matches with a null suffix.
This option is available as of pkg_install>=20030918 which is required in
pkgsrc.  Noted by Klaus Heinz.
2004-01-25 18:44:31 +00:00
jlam
66b2e171eb The new standard for modifying BUILDLINK_DEPENDS.<pkg> is to append to the
value instead of overriding.  The reason is so that the most restrictive
<pkg> dependency will always be a part of the dependency list.
2004-01-25 16:46:21 +00:00
jlam
8e850d0459 Instead of directly manipulating DEPENDS, BUILD_DEPENDS, and RECOMMENDED,
create _BLNK_ADD_TO.<depmethod> for each of depencdency methods above from
the BUILDLINK_DEPEND.<pkg> and BUILDLINK_RECOMMENDED.<pkg> lists and save
the created values so they don't need to constantly be recomputed.
2004-01-25 13:26:43 +00:00
jlam
93ad14ffc4 Suppress duplicate dependencies in the DEPENDS and BUILD_DEPENDS list
added by buildlink3.mk files if the dependencies are _exactly_ the same.
2004-01-25 13:09:46 +00:00
jlam
0b36d85a83 Fix code that assumed that BUILDLINK_DEPENDS.<pkg> was a unique value by
modifying it to accept a list.
2004-01-25 12:43:24 +00:00
jlam
dfe9bb1980 Most of this file only applies if we're in some phase after buildlink, so
enforce that using PHASES_AFTER_BUILDLINK.

Also, transform the physical path to ${WRKDIR} into the value ${WRKDIR} in
the wrapper scripts.  This allows ${WRKDIR} to be a path that traverses a
symlink.  In particular, it allows users to set WRKOBJDIR to point to a
symlink.
2004-01-21 18:18:13 +00:00
jlam
ab10d9f748 Put more debugging information in .work.log: first output the command the
wrapper script will transform, then output the transformed command.
Prefix the original command with [*] and the transformed command with <.>
to ease scanning of .work.log.
2004-01-21 13:52:56 +00:00
jlam
4ea5e626c5 Add a new command "sub-rpath" that does the same thing as "rpath" but only
protects subdirectories of the named paths in rpath options to the linker.
Use sub-rpath to protect /usr/lib/* in rpath options to the linker.
2004-01-21 08:04:29 +00:00
jlam
008a41b7ec Rename 'submangle' to 'sub-mangle' 2004-01-21 07:54:50 +00:00
jlam
f50372de35 Allow -L/usr/lib/* as NetBSD-current actually has shared libraries there,
and we should allow these to pass untouched through the wrapper scripts.
2004-01-21 07:37:32 +00:00
snj
e0220ad330 s/it's/its/ 2004-01-20 22:15:21 +00:00
jlam
a011748fab * Create two new package-settable variables: BUILDLINK_PASSTHRU_DIRS is
an extra list of paths denoting entire directory trees that will be
  unchanged by the wrapper scripts in options passed to the toolchain.
  BUILDLINK_PASSTHRU_RPATHDIRS is the same as BUILDLINK_PASSTHRU_DIRS
  but the the listed paths are only unchanged if used in an rpath option.

* Garbage-collect _BLNK_BUILTIN_DIRS, which is superseded by
  _BLNK_PASSTHRU_DIRS.

* Ensure that the correct set of directories is passed to the linker
  for the runtime library search path in the pkgviews case.

* Allow -I/usr/include/* to be unchanged by the wrapper scripts.  This
  allows building LKMs in pkgsrc, which need -I/usr/include/sys, using
  the buildlink3 wrapper scripts.
2004-01-19 12:34:54 +00:00
jlam
f2cc6a8c86 * Make the mangle and depot commands a bit more conservative in finding
instances of directory paths to mangle.  We now check that the path
  is either a word by itself, or else part of likely compiler/linker
  options (-[ILR]).

* Add a new "submangle" command that does the same thing as mangle but
  restricts itself to only the directory tree below the named src
  directory.
2004-01-19 10:09:36 +00:00
jlam
7134e52155 Create a word separator $_sep variable and use throughout. 2004-01-19 05:11:44 +00:00
jlam
badf8f805b Be even less aggressive and just remove relative paths that start with "."
in abs-rpath.
2004-01-17 22:16:12 +00:00
jlam
5628114122 Fix overly aggressive substitution pattern in abs-rpath to allow things
like "-Wl,-R${exec_prefix}/lib".  This fixes any breakage in *-config
scripts where the above example was being stripped out.
2004-01-17 17:33:49 +00:00
jlam
528000b1ee Also merge -Wl,-R -Wl,/path/to/dir into a single argument so that we can
look it up in the cache.
2004-01-15 09:59:29 +00:00
rh
8c4d9ffa48 Add *RECOMMENDED variables as discussed on tech-pkg@ to allow for a more
fine-grained distinction between required versions of pre-requisites
(DEPENDS) and versions that are recommended for security or library ABI
consistency reasons (RECOMMENDED).

  The contents of ${RECOMMENDED} are added to DEPENDS unless
IGNORE_RECOMMENDED is set to YES, in which case a warning will be printed
and IGNORE_RECOMMENDED will be added to BUILD_DEFS.

  Add a corresponding BUILDLINK_RECOMMENDED.<pkg> variable for use with
buildlink2 and buildlink3.
2004-01-14 06:57:45 +00:00
jlam
231aa68659 Add a new command "abs-rpath" to the gen-transform.sh script that removes
rpath options that try to add relative paths to the runtime library search
path.  This basically partly cleans up after lazy programmers.
2004-01-13 07:52:37 +00:00
jlam
e7d55f00e4 Use egrep instead of relying on GNU grep features. Fixes populating the
buildlink directory on Solaris, which doesn't use GNU grep.
2004-01-11 06:50:58 +00:00
jlam
5fdd19eb4c Back out the changes in revision 1.41 which were much more complex than
they needed to be.  Now, when we're emitting untransform rules, we:

(1) change everything back from ${BUILDLINK_DIR} and ${BUILDLINK_X11_DIR}
    back into ${LOCALBASE} and ${X11BASE},
(2) protect ${LOCALBASE} and ${X11BASE} from changes,
(3) nuke all other compiler/linker options that have absolute paths that
    we haven't blessed, and
(4) unmangle all of the protected directory names back into the right
    names.

This should correctly fix the problem where "gtk-config --cflags" didn't
emit any directories for glib headers.
2004-01-11 04:02:52 +00:00
grant
39b4d82767 "for arg; do" -> "for arg do", as the latter is more portable. fixes
buildlink3's wrappers on Solaris.
2004-01-11 03:30:20 +00:00
jlam
6ebd792812 If BUILDLINK_PREFIX.<pkg> is "/usr" and BUILDLINK_{INCDIRS,LIBDIRS}.<pkg>
lists values other "include" or "lib", then protect those directories from
being eaten by the wrapper scripts.  This allows -I/usr/include/krb5 to be
passed safely through to the real compiler when heimdal/buildlink3.mk is
included.
2004-01-10 22:22:50 +00:00
jlam
c38d28f188 Only match the first result of "pkg_info -qp" in case there are weird
+CONTENT files out there with multiple @cwd lines.
2004-01-10 10:52:09 +00:00
jlam
eee6ee1140 Don't stop if the file listed in BUILDLINK_FILES.<pkg> doesn't exist. 2004-01-10 06:15:39 +00:00
jlam
17709ff9af Add bits to make buildlink3 use the MIPSpro compiler if USE_MIPSPRO is
defined.
2004-01-07 20:45:59 +00:00
jlam
8a4b69c91d Make the wrapper exit with error code 2 to signify a buffer overflow to
avoid infinite loops.
2004-01-07 17:40:36 +00:00
jlam
7d7b693291 Suppress duplicates when splitting -Wl,-R/dir1:/dir2:... into separate
arguments.  This avoids overfilling the circular buffer (length 5) used
by the buildlink3 wrappers.
2004-01-07 17:31:02 +00:00
jlam
6990004f97 Be more precise about when rules are emitted in the tranform and
untransform cases.  This should fix the problem noted on tech-pkg@:
"Re: graphics/gdk-pixbuf can't find <gdk/gdk.h> build problem" where the
CFLAGS for glib were being eaten by the unbuildlink step.
2004-01-07 07:11:34 +00:00
jlam
dfa2eafdc6 Remove "$" at the end of rules in the [IL] commands that mistakenly crept
in when creating this file based on the one in buildlink2.  This should
fix the problem noted on tech-pkg@: "Re: graphics/gdk-pixbuf can't find
<gdk/gdk.h> build problem" where the CFLAGS for glib were being eaten by
the unbuildlink step.
2004-01-07 07:10:05 +00:00
jlam
88902e37a3 whitespace 2004-01-07 06:47:29 +00:00
jlam
60b56192f8 Back out revision 1.6 which was wrong. It failed to match
-I/usr/pkg/include given I:/usr/pkg:...
2004-01-06 21:39:07 +00:00
jlam
393f40e76a Allow l:foo: to remove -lfoo. Also remove an incorrect rule in the "l"
case.
2004-01-06 19:08:59 +00:00
jlam
839def8376 Reduce the number of lines emitted by the I and L rules. 2004-01-06 18:43:10 +00:00
jlam
9c46ce5946 Missing trailing $ to only match whole words. 2004-01-06 18:10:06 +00:00
jlam
44d8a8971f Add FreeBSD to _BLNK_CACHE_ALL (matches bsd.buildlink2.mk). 2004-01-06 09:45:31 +00:00
jlam
3a61d3a908 Try to convert GCC's optimization flags to SunPro optimization flags.
From Jonathan Perkin in private email.
2004-01-06 08:48:29 +00:00
jlam
fe15b75845 Fix bug where "!empty" was missing from a .if test. 2004-01-06 04:29:33 +00:00
jlam
636660df39 Do the right thing for pkgviews if we do binary package upgrades of
package dependencies by inserting the right default view directories into
the run-time library search path as well.
2004-01-05 21:50:13 +00:00
jlam
d279e6f535 Use S/+$// instead of C/\+$// to save a backslash. Very highly
recommended by seb :)
2004-01-05 11:05:44 +00:00
jlam
6236fdd401 When checking the value of yes/no variables using the the
!empty(...:M[yY][eE][sS]) construct, always use !empty(...) instead of
empty(...) just for some consistency.
2004-01-05 07:01:43 +00:00
jlam
048ceab425 Of course I really meant buildlink*3*.mk. 2004-01-05 05:59:29 +00:00
jlam
4b39019c6c We don't need to escape "+" if we're using the :M variable operator. 2004-01-04 23:30:04 +00:00
jlam
c705b8fe80 Rearrange some of the lines in the buildlink3.mk example so that it's a bit
shorter to write.
2004-01-04 22:01:18 +00:00
jlam
b840f07908 BUG FIXES:
* Don't add any dependencies (via BUILDLINK_DEPENDS) unless
  buildlink3.mk files add them.  This fixes case where the software
  existed both in the base system and in /usr/pkg, we used only the
  built-in software, but we still recorded a dependency on the one in
  /usr/pkg.

* Re-structure the code that populates ${BUILDLINK_DIR} so that we
  don't bump into ARG_MAX limits in the shell.  This should fix the
  problem present in the buildlink2 framework noted in:

	http://mail-index.netbsd.org/tech-pkg/2004/01/03/0005.html

CHANGES:

* Define a new yes/no variable BUILDLINK_USE_BUILTIN.<pkg> that
  determines if we should use the built-in software or not.  This
  should probably replace the various USE_NCURSES, USE_GNU_READLINE,
  USE_GNU_GETTEXT, etc. variables with something whose naming is a
  bit more consistent and is integrated directly into the buildlink3
  framework.

* Garbage-collect "$$pkg_prefix", which was used exclusively in
  BUILDLINK_FILES_CMD.<pkg>.  It no longer exists in the
  buildlink3/pkgviews world.  Packages _should_ _no_ _longer_
  directly set the PREFIX variable in the package Makefile.  As a
  consequence, the various Java VM packages will need some changes
  when they're converted to use buildlink3.
2004-01-04 20:57:31 +00:00
jlam
24f7929dc2 Extend the "l" command by allowing changing "-lfoo" into "-lbar -lbaz" by
saying "l:foo:bar:baz".
2004-01-03 20:23:51 +00:00
veego
aacddadd1d Update for the latest x11-links 0.19. 2003-12-19 19:22:28 +00:00
jlam
29055be6b7 Do as buildlink2 and _append_ extra flags instead of prepending them.
Prepending caused everything in ${BUILDLINK_DIR} to be found first, which
was bad when you built something like MesaLib where the X11R6 headers
conflict with the ones provided in the source.
2003-11-26 12:52:30 +00:00
jlam
087d9e1669 If we're linking a shared library by "cc -shared -o /srcdir/shlib", we
need to protect the full path after "-o" from being transformed from
"/srcdir/shlib" to "-L/srcdir -lshlib".  This fixes building
graphics/freetype2, which uses lots of full paths to sources and objects.
2003-11-25 14:44:39 +00:00
jlam
35657e5e7f libtool.sh should also supply a definition for "$expr", used by the
buffer script.
2003-11-25 14:43:23 +00:00
jlam
f2379fe5a0 Don't be fooled into thinking that the "-c" in "install -c" means to
interpret the libtool mode as "compile".
2003-11-23 06:06:02 +00:00
tron
ef247410ff Bump minimum required version of "x11-links" package. 2003-10-18 18:24:56 +00:00
veego
4d271b3397 Update pkgtools/x11-links to 0.16.
Changes include supporting XFree86-4.3.99.14 aka XFree86-current.
Added some new library versions and some freetype2 include files.
And bump the required version number in the bsd.buildlink mk's.
2003-10-13 15:55:11 +00:00
jlam
9118eddb47 Change the way in which arguments are processed by the wrappers. We
know read the arguments by first placing them in a buffer and taking
the argument in the first non-empty buffer as the argument to process.
The buffer is there to allow "splitting" an argument into multiple
arguments (currently up to five arguments), e.g. "-Wl,-R/path1:/path2"
is split into "-Wl,-R/path1" and "-Wl,-R/path2".  Each split argument
is placed into a buffer.  Using a buffer lets us read and process all
of the arguments in a single pass despite "pushing" more arguments
onto the front of the argument array.
2003-10-09 12:15:15 +00:00
jlam
52539db8bd It's "skipargs", not "skip". 2003-10-09 08:19:47 +00:00
jlam
ec20dd29fa Use sed instead of requiring gawk (for gensub) for portability. 2003-10-08 09:11:33 +00:00
jlam
eb469bd90b Revert previous change as gsub() doesn't quite work like gensub() with
respect to \1, \2, etc. subexpression replacement.
2003-10-07 10:59:41 +00:00
jlam
827195bab5 Simplify by using gsub() instead of gensub() in awk script. 2003-10-06 10:51:04 +00:00
jlam
12a8599501 Add some documentation. 2003-10-04 10:20:09 +00:00
jlam
8ecc105e86 Darwin's special GCC uses "-install_name /path/shlib" to indicate
the final installed location for the named shared library, and we
need to protect the full path from "/path/shlib" -> "-L/path -lshlib"
transformation.
2003-10-03 19:40:55 +00:00
jlam
197d02376d Factor out some more commonly used bits of the wrapper system into
their own files: buildcmd and quotearg, which are used to build up the
command line and to quote arguments.  Also add the ability to skip
processing the next few arguments and add them directly to the command
line.  Now, either the marshall script or the cache scripts can
request skipping the N arguments by setting skipargs=N.
2003-10-03 19:39:19 +00:00
jlam
0995d71967 Set the final form of the template buildlink3.mk file, after I've had a
strong cup of coffee.  This now works the way it was intended: the
buildlink3.mk file sets a variable that can be checked within itself to
see whether it's already been included or not.
2003-09-30 10:17:30 +00:00
jlam
c094c5fc84 Set the final form of the template buildlink3.mk file as a guideline for
buildlink3.mk writers.
2003-09-30 00:32:57 +00:00
jlam
9e14aa4f47 Update the template buildlink3.mk file so that it may be used for
non-recursive dependencies.  We now use the check:

.if !defined(BUILDLINK_PACKAGES) || empty(BUILDLINK_PACKAGES:Mfoo)
...
.endif

to replace the FOO_BUILDLINK3_MK guards.
2003-09-28 12:51:46 +00:00
jlam
d3196f084c Create _BLNK_{DEPENDS,PACKAGES} that are "uniq"ed versions of
BUILDLINK_{DEPENDS,PACKAGES} and use them throughout bsd.buildlink3.mk.
A lot of processing iterates over these variables and assumes that there
are no repeated items in those lists.
2003-09-28 12:36:52 +00:00
jlam
baf8baf9b8 Rearrange order of the targets for the various helper scripts for the
wrappers, and ensure that they're only defined once.  Also add some more
targets to create the sunpro-* helper scripts.
2003-09-28 10:38:03 +00:00
jlam
c267c3f898 Do a better job of hiding unwanted libtool archives in a mixed
buildlink2/buildlink3 world.  We "buildlink" libtool archives into
${BUILDLINK_DIR} and instruct libtool to find those *.la files before
any other ones.
2003-09-23 19:48:22 +00:00
jlam
887c0518a1 Fix buildlinking of files if BUILDLINK_TRANSFORM.<pkg> is specified. 2003-09-22 19:49:10 +00:00