Commit graph

275 commits

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