diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-04-20 14:48:39 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-04-20 14:48:39 +0300 |
commit | 0f081a2643ba0a7f7a5dcfb6a5977d9da1d2b6db (patch) | |
tree | b62e9404cd5dfdfa471ec1202e183f9ca92187e5 /src/pp-setup | |
parent | 0983c9ab7a6ea5b3592a297e029a935cc0e4bebc (diff) | |
download | grecs-0f081a2643ba0a7f7a5dcfb6a5977d9da1d2b6db.tar.gz grecs-0f081a2643ba0a7f7a5dcfb6a5977d9da1d2b6db.tar.bz2 |
Diverge from Wydawca gconf/ subdirectory into a separate project
Diffstat (limited to 'src/pp-setup')
-rw-r--r-- | src/pp-setup | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/src/pp-setup b/src/pp-setup new file mode 100644 index 0000000..bf4fb7d --- /dev/null +++ b/src/pp-setup | |||
@@ -0,0 +1,106 @@ | |||
1 | divert(-1) dnl -*- m4 -*- | ||
2 | # This file is part of grecs - Gray's Extensible Configuration System | ||
3 | # Copyright (C) 2007, 2009 Sergey Poznyakoff | ||
4 | # | ||
5 | # Grex is free software; you can redistribute it and/or modify | ||
6 | # it under the terms of the GNU General Public License as published by | ||
7 | # the Free Software Foundation; either version 3, or (at your option) | ||
8 | # any later version. | ||
9 | # | ||
10 | # Grex is distributed in the hope that it will be useful, | ||
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | # GNU General Public License for more details. | ||
14 | # | ||
15 | # You should have received a copy of the GNU General Public License | ||
16 | # along with Grex. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | changecom(/*,*/) | ||
19 | |||
20 | /* ------------------------------ | ||
21 | * Simulate --prefix-builtins. | ||
22 | * Borrowed from Autoconf | ||
23 | * ------------------------------- */ | ||
24 | |||
25 | define(`m4_define', defn(`define')) | ||
26 | define(`m4_defn', defn(`defn')) | ||
27 | define(`m4_undefine', defn(`undefine')) | ||
28 | |||
29 | m4_undefine(`define') | ||
30 | m4_undefine(`defn') | ||
31 | m4_undefine(`undefine') | ||
32 | |||
33 | /* m4_copy(SRC, DST) | ||
34 | * ----------------- | ||
35 | * Define DST as the definition of SRC. | ||
36 | * What's the difference between: | ||
37 | * 1. m4_copy(`from', `to') | ||
38 | * 2. m4_define(`to', `from($@)') | ||
39 | * Well, obviously 1 is more expensive in space. Maybe 2 is more expensive | ||
40 | * in time, but because of the space cost of 1, it's not that obvious. | ||
41 | * Nevertheless, one huge difference is the handling of `$0'. If `from' | ||
42 | * uses `$0', then with 1, `to''s `$0' is `to', while it is `from' in 2. | ||
43 | * The user will certainly prefer to see `to'. | ||
44 | */ | ||
45 | m4_define(`m4_copy', | ||
46 | `m4_define(`$2', m4_defn(`$1'))') | ||
47 | |||
48 | /* m4_rename(SRC, DST) | ||
49 | * ------------------- | ||
50 | * Rename the macro SRC as DST. | ||
51 | */ | ||
52 | m4_define(`m4_rename', | ||
53 | `m4_copy(`$1', `$2')m4_undefine(`$1')') | ||
54 | |||
55 | /* m4_rename_m4(MACRO-NAME) | ||
56 | * ------------------------ | ||
57 | * Rename MACRO-NAME as m4_MACRO-NAME. | ||
58 | */ | ||
59 | m4_define(`m4_rename_m4', | ||
60 | `m4_rename(`$1', `m4_$1')') | ||
61 | |||
62 | /* Some m4 internals have names colliding with tokens we might use. | ||
63 | * Rename them a` la `m4 --prefix-builtins'. | ||
64 | */ | ||
65 | m4_rename_m4(`builtin') | ||
66 | m4_rename_m4(`changecom') | ||
67 | m4_rename_m4(`changequote') | ||
68 | m4_rename_m4(`debugfile') | ||
69 | m4_rename_m4(`debugmode') | ||
70 | m4_rename_m4(`decr') | ||
71 | m4_rename_m4(`divert') | ||
72 | m4_rename_m4(`divnum') | ||
73 | m4_rename_m4(`dumpdef') | ||
74 | m4_rename_m4(`errprint') | ||
75 | m4_rename_m4(`esyscmd') | ||
76 | m4_rename_m4(`eval') | ||
77 | m4_rename_m4(`format') | ||
78 | m4_rename_m4(`ifdef') | ||
79 | m4_rename_m4(`ifelse') | ||
80 | m4_rename_m4(`include') | ||
81 | m4_rename_m4(`incr') | ||
82 | m4_rename_m4(`index') | ||
83 | m4_rename_m4(`indir') | ||
84 | m4_rename_m4(`len') | ||
85 | m4_rename(`m4exit', `m4_exit') | ||
86 | m4_rename(`m4wrap', `m4_wrap') | ||
87 | m4_rename_m4(`maketemp') | ||
88 | m4_rename_m4(`patsubst') | ||
89 | m4_rename_m4(`popdef') | ||
90 | m4_rename_m4(`pushdef') | ||
91 | m4_rename_m4(`regexp') | ||
92 | m4_rename_m4(`shift') | ||
93 | m4_rename_m4(`sinclude') | ||
94 | m4_rename_m4(`substr') | ||
95 | m4_rename_m4(`symbols') | ||
96 | m4_rename_m4(`syscmd') | ||
97 | m4_rename_m4(`sysval') | ||
98 | m4_rename_m4(`traceoff') | ||
99 | m4_rename_m4(`traceon') | ||
100 | m4_rename_m4(`translit') | ||
101 | m4_rename_m4(`undivert') | ||
102 | m4_rename_m4(`dnl') | ||
103 | m4_rename_m4(`__line__') | ||
104 | m4_rename_m4(`__file__') | ||
105 | |||
106 | m4_divert(0)m4_dnl | ||