1 ?RCS: $Id: src.U,v 3.0.1.1 1997/02/28 16:23:54 ram Exp $
3 ?RCS: Copyright (c) 1996, Cygnus Support
4 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
6 ?RCS: You may redistribute only under the terms of the Artistic Licence,
7 ?RCS: as specified in the README file that comes with the distribution.
8 ?RCS: You may reuse parts of this distribution only within the terms of
9 ?RCS: that same Artistic Licence; a copy of which may be found at the root
10 ?RCS: of the source tree for dist 3.0.
12 ?RCS: Original Author: Tom Tromey <tromey@cygnus.com>
15 ?RCS: Revision 3.0.1.1 1997/02/28 16:23:54 ram
16 ?RCS: patch61: created
18 ?MAKE:src +rsrc: Options package contains
19 ?MAKE: -pick add $@ %<
22 ?S: This variable holds the path to the package source. It is up to
23 ?S: the Makefile to use this variable and set VPATH accordingly to
24 ?S: find the sources remotely.
27 ?S: This variable holds a potentially relative path to the package
28 ?S: source. The contents are correct for the configuration environment,
29 ?S: i.e. there might be an extra .. prepended to get out of the UU dir.
30 ?S: Configure units should use this, not the src variable.
32 : Find the path to the source tree
35 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
39 *) src=`cd ../$src && pwd` ;;
53 ?X: Now check whether we have found the right source tree (i.e. the one for the
54 ?X: package we're abount to configure). The original unit from Tom Tromey forced
55 ?X: the user to pick a unique file from his distribution, and we were merely
56 ?X: checking the existence of that file. I prefer to rely on Configure (which
57 ?X: we know *is* present since this unit is part of it!) and look for the
58 ?X: definition of the package variable, making sure it's the same as ours.
59 ?X: If it matches, we know we found the right source tree. -- RAM, 15/03/96
61 if test -f $rsrc/Configure && \
62 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
64 : found it, so we are ok.
66 ?X: Otherwise try "." and up to 4 parent directories...
67 ?X: Note that we prepend a ".." to get out of the configuration environment.
69 for src in . .. ../.. ../../.. ../../../..; do
70 if test -f ../$src/Configure && \
71 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
82 Sorry, I can't seem to locate the source dir for $package. Please start
83 Configure with an explicit path -- i.e. /some/path/Configure.
88 ?X: Don't echo anything if the sources are in . -- they should know already ;-)
89 ?X: In that case, rsrc is ../. since we lookup from within UU
93 echo "Sources for $package found in \"$src\"." >&4