Commit graph

375 commits

Author SHA1 Message Date
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
jlam
ad2a15d59b Don't have the libtool wrapper add -L<dir> where <dir> is a path in srcdir
to the cache since we do lots of custom post-processing in that case.
2003-09-19 22:49:22 +00:00
jlam
1c72177800 Add some debugging info to determine which wrapper added which lines to the
common cache.
2003-09-19 22:47:34 +00:00
jlam
2848234220 Remove spurious }. 2003-09-19 07:53:45 +00:00
jlam
78c90c14e6 Make BUILDLINK_TARGETS an add-on variable to _BLNK_TARGETS so that the
buildlink-<pkg> targets created by this file are executed before any
buildlink3.mk-provided targets.
2003-09-19 07:39:01 +00:00
jlam
4928ecfa90 Document that a buildlink3.mk file must either directly or indirectly set
the value of BUILDLINK_PREFIX.<pkg>.
2003-09-14 01:46:47 +00:00
jlam
6d1f6b01a7 Document that the correct "pop" action uses :C and not :S 2003-09-14 01:00:18 +00:00
jlam
6922b1587c Correct an error message to be more meaningful, and optimize slightly by
avoiding a call to pkg_info(1).
2003-09-13 07:43:11 +00:00
jlam
4831429fd8 There's no need to preserve mode bits when copying the x11-links tree.
This fixes problems where .buildlink assumes the mode of
${LOCALBASE}/share/x11-links, which may be read-only.
2003-09-10 12:58:38 +00:00
jlam
0f8e732621 Check that ${_PKG_DBDIR} exists before cd'ing into it. This makes
building using buildlink3 on systems that have never seen pkgsrc before
work properly.
2003-09-10 02:16:42 +00:00
jlam
81329481d9 Use pax(1) instead of "cp -R" so we preserve symlinks instead of following
them.
2003-09-09 09:15:02 +00:00
jlam
f32c4c102a Note how package views is also similar to GNU Stow, but state clearly the
main difference in philosophy between package views and these other
software management systems.
2003-09-09 09:13:20 +00:00
jlam
71ea615ef5 Document this file, and do the command length reduction by suppressing
repeated options as is done in in revision 1.3 of wrapper.sh.
2003-09-09 09:11:42 +00:00
jlam
774516b55e Reduce length of command lines executed by not appending some options that
we've already seen:

-[DILR]*|-Wl,-R*|-Wl,-*,/*
	These are all only useful the first time we see them.  All other
	instances are redundant.

-l*
	Extra libraries are suppressed if they're repeated, e.g.,
	"-lm -lm -lm -lX11 -lX11 -lm -lm" -> "-lm -lX11 -lm".

The screen output is still likely to be very verbose, but you can check
in work/.work.log to see the actual commands executed.
2003-09-08 21:10:26 +00:00
jlam
56ed400b83 Provide URL for CMU depot. 2003-09-08 10:36:02 +00:00
jlam
b6b8313c8a Instead of canonicalizing all ${DEPOTBASE}/* into ${LOCALBASE}, don't
do it for rpath specifications, e.g. -Wl,-R/dir, -Wl,-rpath,/dir, etc.
This lets the depot directory for a package, in addition to the usual
/usr/pkg/lib, to be added to the rpath of a program or shared library
of an "overwrite" package.  Now, if the package instance in the
default view is forcibly removed, then shared library references will
still resolve to the existing shared libraries in the depot directory.

In the following example, I've built jpeg as a pkgviews package, and
tiff as an "overwrite" package:

% ldd /usr/pkg/lib/libtiff.so
/usr/pkg/lib/libtiff.so:
         -ljpeg.62 => /usr/pkg/lib/libjpeg.so.62
         -lz.0 => /usr/lib/libz.so.0
         -lm.0 => /usr/lib/libm387.so.0
         -lm.0 => /usr/lib/libm.so.0
% pkg_delete -f jpeg-6b
pkg_delete: package `jpeg-6b' is required by other packages:
        tiff-3.5.7nb1
% ldd /usr/pkg/lib/libtiff.so
/usr/pkg/lib/libtiff.so:
         -ljpeg.62 => /usr/pkg/packages/jpeg-6b/lib/libjpeg.so.62
         -lz.0 => /usr/lib/libz.so.0
         -lm.0 => /usr/lib/libm387.so.0
         -lm.0 => /usr/lib/libm.so.0

The benefit here is that if the jpeg package is updated and also has
a bump in the major number of the shared lib, e.g. libjpeg.so.63.0,
then you can remove the old jpeg instance from the default view and
add the new jpeg package into the default view, and
/usr/pkg/lib/libtiff.so will _still_ resolve its libjpeg.so.62
reference.

Welcome to the power of Package Views!
2003-09-08 09:18:15 +00:00
jlam
6d54ef099c Rename BUILDLINK_PKG_DBDIR into _BLNK_PKG_DBDIR. This really is a private
implementation variable.
2003-09-08 07:30:07 +00:00
jlam
440bc402a1 Move BUILDLINK_CHECK_BUILTIN.<pkg> documentation into bsd.buildlink3.mk. 2003-09-05 11:39:02 +00:00
jlam
6a970fe50b Allow buildlink3.mk file to specify BUILDLINK_CFLAGS.<pkg> that are
automatically added to CFLAGS and CXXFLAGS.  Note that -D... and -I...
settings should go into BUILDLINK_CPPFLAGS.<pkg> instead.  BUILDLINK_CFLAGS
is reserved for stuff like "-pthread" or other compiler-specific flags.

Also note why we add BUILDLINK_CPPFLAGS.<pkg> to both CFLAGS and CXXFLAGS
(because a lot of software just uses CFLAGS and ignores any CPPFLAGS value
that we pass to it).
2003-09-04 19:38:06 +00:00
jlam
bef0ac1b69 Provide a default definition for BUILDLINK_IS_BUILTIN.<pkg> that is yes/no
depending on whether or not the <pkg> is provided in the base system.  Also
tighten the BUILDLINK_PKG_DBDIR.<pkg> definition.
2003-09-04 05:40:25 +00:00
jlam
09b844bb4c Fix typo ;; -> :; 2003-09-03 16:35:01 +00:00
jlam
841b57441b Merge pkgviews-mk branch into the HEAD by running:
cd pkgsrc/mk
	cvs update -Pd -A
	cvs update -Pd -j pkgviews-mk-base -j pkgviews-mk
2003-09-02 06:59:37 +00:00