Commit | Line | Data |
---|---|---|
d8875586 MBT |
1 | ?RCS: $Id: d_portable.U 1 2006-08-24 12:32:52Z rmanfredi $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi | |
4 | ?RCS: | |
5 | ?RCS: You may redistribute only under the terms of the Artistic Licence, | |
6 | ?RCS: as specified in the README file that comes with the distribution. | |
7 | ?RCS: You may reuse parts of this distribution only within the terms of | |
8 | ?RCS: that same Artistic Licence; a copy of which may be found at the root | |
9 | ?RCS: of the source tree for dist 4.0. | |
10 | ?RCS: | |
11 | ?RCS: $Log: d_portable.U,v $ | |
12 | ?RCS: Revision 3.0.1.2 1995/01/11 15:28:52 ram | |
13 | ?RCS: patch45: executable path stripping moved to the end in Config_sh.U | |
14 | ?RCS: | |
15 | ?RCS: Revision 3.0.1.1 1993/12/15 08:21:17 ram | |
16 | ?RCS: patch15: did not strip variables properly when needed | |
17 | ?RCS: patch15: now also strips down variables from trylist | |
18 | ?RCS: | |
19 | ?RCS: Revision 3.0 1993/08/18 12:06:48 ram | |
20 | ?RCS: Baseline for dist 3.0 netwide release. | |
21 | ?RCS: | |
22 | ?X: | |
23 | ?X: The Loc unit is wanted to get the definition of all the locating variables. | |
24 | ?X: | |
25 | ?MAKE:d_portable: cat Loc Myread Oldconfig | |
26 | ?MAKE: -pick add $@ %< | |
27 | ?S:d_portable: | |
28 | ?S: This variable conditionally defines the PORTABLE symbol, which | |
29 | ?S: indicates to the C program that it should not assume that it is | |
30 | ?S: running on the machine it was compiled on. | |
31 | ?S:. | |
32 | ?C:PORTABLE: | |
33 | ?C: This symbol, if defined, indicates to the C program that it should | |
34 | ?C: not assume that it is running on the machine it was compiled on. | |
35 | ?C: The program should be prepared to look up the host name, translate | |
36 | ?C: generic filenames, use PATH, etc. | |
37 | ?C:. | |
38 | ?H:#$d_portable PORTABLE /**/ | |
39 | ?H:. | |
40 | ?D:d_portable='' | |
41 | : decide how portable to be | |
42 | case "$d_portable" in | |
43 | "$define") dflt=y;; | |
44 | *) dflt=n;; | |
45 | esac | |
46 | $cat <<'EOH' | |
47 | ||
48 | I can set things up so that your shell scripts and binaries are more portable, | |
49 | at what may be a noticable cost in performance. In particular, if you | |
50 | ask to be portable, the following happens: | |
51 | ||
52 | 1) Shell scripts will rely on the PATH variable rather than using | |
53 | the paths derived above. | |
54 | 2) ~username interpretations will be done at run time rather than | |
55 | by Configure. | |
56 | @if PHOSTNAME | |
57 | 3) The system name will be determined at run time, if at all possible. | |
58 | @end | |
59 | ||
60 | EOH | |
61 | rp="Do you expect to run these scripts and binaries on multiple machines?" | |
62 | . ./myread | |
63 | case "$ans" in | |
64 | y*) d_portable="$define" | |
65 | ?X: | |
66 | ?X: Paths will be stripped down (/usr/bin/vi -> vi) in Config_sh.U if needed. | |
67 | ?X: | |
68 | ;; | |
69 | *) d_portable="$undef" ;; | |
70 | esac | |
71 |