summaryrefslogtreecommitdiff
path: root/mcon/U/src.U
diff options
context:
space:
mode:
Diffstat (limited to 'mcon/U/src.U')
-rw-r--r--mcon/U/src.U67
1 files changed, 31 insertions, 36 deletions
diff --git a/mcon/U/src.U b/mcon/U/src.U
index 5bd4155..e939a4c 100644
--- a/mcon/U/src.U
+++ b/mcon/U/src.U
@@ -1,13 +1,13 @@
-?RCS: $Id: src.U,v 3.0.1.1 1997/02/28 16:23:54 ram Exp $
+?RCS: $Id$
?RCS:
?RCS: Copyright (c) 1996, Cygnus Support
-?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS:
?RCS: You may redistribute only under the terms of the Artistic Licence,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic Licence; a copy of which may be found at the root
-?RCS: of the source tree for dist 3.0.
+?RCS: of the source tree for dist 4.0.
?RCS:
?RCS: Original Author: Tom Tromey <tromey@cygnus.com>
?RCS:
@@ -15,32 +15,35 @@
?RCS: Revision 3.0.1.1 1997/02/28 16:23:54 ram
?RCS: patch61: created
?RCS:
-?MAKE:src +rsrc: Options Myread package contains
+?MAKE:src +rsrc: Options package contains
?MAKE: -pick add $@ %<
?Y:TOP
?S:src (srcdir):
-?S: This variable holds the path to the package source. It is up to
-?S: the Makefile to use this variable and set VPATH accordingly to
-?S: find the sources remotely.
+?S: This variable holds the (possibly relative) path of the package source.
+?S: It is up to the Makefile to use this variable and set VPATH accordingly
+?S: to find the sources remotely. Use $pkgsrc to have an absolute path.
?S:.
?S:rsrc (relsrcdir):
-?S: This variable holds the relative path to the package source.
-?S: The contents are correct for the configuration environment,
-?S: i.e. there is an extra .. either appended or prepended.
+?S: This variable holds a potentially relative path to the package
+?S: source. The contents are correct for the configuration environment,
+?S: i.e. there might be an extra .. prepended to get out of the UU dir.
?S: Configure units should use this, not the src variable.
?S:.
-?LINT:change package
: Find the path to the source tree
case "$src" in
-'') src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
+'') case "$0" in
+ */*)
+ src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
+ ;;
+ *) src='.';;
+ esac;;
esac
case "$src" in
-'')
- src=.
- rsrc=..
+'') src=/
+ rsrc=/
;;
-/*) rsrc="$src/..";;
-*) rsrc="../$src";;
+/*) rsrc="$src";;
+*) rsrc="../$src";;
esac
?X:
?X: Now check whether we have found the right source tree (i.e. the one for the
@@ -52,7 +55,7 @@ esac
?X: If it matches, we know we found the right source tree. -- RAM, 15/03/96
?X:
if test -f $rsrc/Configure && \
- $contains "^package=$package" $rsrc/Configure >/dev/null 2>&1
+ $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
then
: found it, so we are ok.
else
@@ -61,7 +64,7 @@ else
rsrc=''
for src in . .. ../.. ../../.. ../../../..; do
if test -f ../$src/Configure && \
- $contains "^package=$package" ../$src/Configure >/dev/null 2>&1
+ $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
then
rsrc=../$src
break
@@ -70,28 +73,20 @@ else
fi
case "$rsrc" in
'')
-?X: It's too early to use Getfile.U (would stack too much units before this)
- echo " "
- dflt=
- rp="Directory where sources for $package are located?"
- . ./myread
- src="$ans"
- rsrc="$src"
- if test -f $rsrc/Configure && \
- $contains "^package=$package" $rsrc/Configure >/dev/null 2>&1
- then
- echo "Ok, I've found them under $src"
- else
- echo "Sorry, I can't seem to be able to locate $package sources." >&4
- exit 1
- fi
+ cat <<EOM >&4
+
+Sorry, I can't seem to locate the source dir for $package. Please start
+Configure with an explicit path -- i.e. /some/path/Configure.
+
+EOM
+ exit 1
;;
?X: Don't echo anything if the sources are in . -- they should know already ;-)
?X: In that case, rsrc is ../. since we lookup from within UU
-../.) ;;
+../.) rsrc='..';;
*)
echo " "
- echo "Sources for $package found in $src" >&4
+ echo "Sources for $package found in \"$src\"." >&4
;;
esac