Commit | Line | Data |
---|---|---|
9b04e79a | 1 | ?RCS: $Id: Config_h.U 1 2006-08-24 12:32:52Z rmanfredi $ |
8bffa491 | 2 | ?RCS: |
9b04e79a | 3 | ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi |
2f125bce | 4 | ?RCS: |
8bffa491 JH |
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 | |
9b04e79a | 9 | ?RCS: of the source tree for dist 4.0. |
8bffa491 JH |
10 | ?RCS: |
11 | ?RCS: $Log: Config_h.U,v $ | |
12 | ?RCS: Revision 3.0.1.5 1997/02/28 14:57:43 ram | |
13 | ?RCS: patch61: added support for src.U | |
14 | ?RCS: | |
15 | ?RCS: Revision 3.0.1.4 1995/09/25 09:10:49 ram | |
16 | ?RCS: patch59: commented the purpose of the #un-def directive | |
17 | ?RCS: | |
18 | ?RCS: Revision 3.0.1.3 1995/01/30 14:25:39 ram | |
19 | ?RCS: patch49: typo fixes in leading config.h comment (WED) | |
20 | ?RCS: | |
21 | ?RCS: Revision 3.0.1.2 1993/08/24 12:13:20 ram | |
22 | ?RCS: patch3: added TOP as a local shell temporary variable | |
23 | ?RCS: | |
24 | ?RCS: Revision 3.0.1.1 1993/08/19 06:42:20 ram | |
25 | ?RCS: patch1: leading config.sh searching was not aborting properly | |
26 | ?RCS: | |
27 | ?RCS: Revision 3.0 1993/08/18 12:04:47 ram | |
28 | ?RCS: Baseline for dist 3.0 netwide release. | |
29 | ?RCS: | |
2f125bce | 30 | ?X: |
8bffa491 JH |
31 | ?X: This file ends up producing the config_h.SH script, which is run to produce |
32 | ?X: the config.h file. The file ./.Config_h below contains all the ?H: lines | |
33 | ?X: extracted out of all the units. Metaconfig itself adds the !GROK!THIS!. | |
34 | ?X: Note that this code isn't included into Configure, but must be shipped with. | |
35 | ?X: | |
36 | ?X: For those who wish to know why the file is config_h.SH instead of the more | |
37 | ?X: natural config.h.SH, well... it is to support systems like MS-DOG. Only one | |
38 | ?X: 'dot' is allowed within the file name, as it is part of the "extension" of | |
39 | ?X: the file. MS-DOG will not let you have two 'dots' because that would mean | |
40 | ?X: two "extensions". | |
2f125bce | 41 | ?X: |
8bffa491 JH |
42 | ?MAKE:Config_h: Id End Config_sh Obsol_h myuname cf_time cf_by package src |
43 | ?MAKE: -pick c_h_weed $@ %< | |
44 | ?MAKE: -pick c_h_weed $@ ./Config_h | |
45 | ?MAKE: -pick c_h_weed $@ ./Obsol_h | |
ff429c2d | 46 | ?T:PERL_CONFIG_SH TOP |
9b04e79a MB |
47 | ?LINT:unclosed !GROK!THIS! |
48 | ?LINT:extern CONFIG_H CONFIG_SH | |
49 | ?LINT:change CONFIG_H CONFIG_SH | |
50 | ?X:?LINT:nocomment | |
2f125bce | 51 | : Set up for generating config_h.SH |
8bffa491 | 52 | case "$CONFIG_SH" in |
9b04e79a | 53 | '') CONFIG_SH=config.sh;; |
8bffa491 JH |
54 | esac |
55 | case "$CONFIG_H" in | |
9b04e79a | 56 | '') CONFIG_H=config.h;; |
8bffa491 | 57 | esac |
ff429c2d | 58 | case $PERL_CONFIG_SH in |
8bffa491 JH |
59 | '') |
60 | if test -f $CONFIG_SH; then TOP=.; | |
61 | elif test -f ../$CONFIG_SH; then TOP=..; | |
62 | elif test -f ../../$CONFIG_SH; then TOP=../..; | |
63 | elif test -f ../../../$CONFIG_SH; then TOP=../../..; | |
64 | elif test -f ../../../../$CONFIG_SH; then TOP=../../../..; | |
65 | else | |
66 | echo "Can't find $CONFIG_SH."; exit 1 | |
67 | fi | |
68 | . $TOP/$CONFIG_SH | |
69 | ;; | |
70 | esac | |
71 | ?X: Make sure we are in the directory where the .SH file is located. | |
72 | case "$0" in | |
73 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; | |
74 | esac | |
75 | echo "Extracting $CONFIG_H (with variable substitutions)" | |
76 | ?X: | |
77 | ?X: Since we unconditionally translate leading #undef into /*#define, we're | |
78 | ?X: stuck when we really want to have a #undef in $CONFIG_H. That's why there | |
79 | ?X: is provision here for #un-def, which is translated back into #undef after | |
80 | ?X: all original #undef have been processed. | |
81 | ?X: | |
2f125bce MB |
82 | ?X: Previously, we changed all |
83 | ?X: #undef FOO /**/ | |
8bffa491 | 84 | ?X: into |
2f125bce | 85 | ?X: /*#define FOO /**/ |
8bffa491 JH |
86 | ?X: The xlc compiler (available on IBM's AIX) complains that this is |
87 | ?X: an illegal attempt to write a nested comment, and warns against it. | |
88 | ?X: There's apparently no way to shut the compiler up, either. | |
89 | ?X: This sed command from Hallvard B Furuseth <h.b.furuseth@usit.uio.no> | |
90 | ?X: changes it to | |
2f125bce | 91 | ?X: /*#define FOO / **/ |
8bffa491 JH |
92 | sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-def!#undef!' |
93 | /* | |
94 | * This file was produced by running the config_h.SH script, which | |
95 | * gets its values from $CONFIG_SH, which is generally produced by | |
96 | * running Configure. | |
97 | * | |
98 | * Feel free to modify any of this as the need arises. Note, however, | |
99 | * that running config_h.SH again will wipe out any changes you've made. | |
100 | * For a more permanent change edit $CONFIG_SH and rerun config_h.SH. | |
101 | * | |
9b04e79a | 102 | * \$Id: Config_h.U 1 2006-08-24 12:32:52Z rmanfredi $ |
8bffa491 JH |
103 | */ |
104 | ||
105 | /* | |
106 | * Package name : $package | |
107 | * Source directory : $src | |
108 | * Configuration time: $cf_time | |
109 | * Configured by : $cf_by | |
110 | * Target system : $myuname | |
111 | */ | |
112 | ||
113 | #ifndef _config_h_ | |
114 | #define _config_h_ | |
115 |