Mercurial > hg > xemacs-beta
annotate lib-src/config.values.sh @ 5290:e6508b64ee08
More permission consistency.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Mon, 14 Jun 2010 19:03:57 +0900 |
parents | 3580ae2ce979 |
children | b9167d522a9a |
rev | line source |
---|---|
434 | 1 : #-*- Perl -*- |
2 eval 'exec perl -w -S $0 ${1+"$@"}' # Portability kludge | |
3 if 0; | |
4 | |
428 | 5 # config.values.sh --- create config.values.in from ../configure |
6 | |
5290
e6508b64ee08
More permission consistency.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
2651
diff
changeset
|
7 # Copyright (C) 1997, 1999 Martin Buchholz |
e6508b64ee08
More permission consistency.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
2651
diff
changeset
|
8 |
428 | 9 # Author: Martin Buchholz |
10 # Maintainer: Martin Buchholz | |
11 # Keywords: configure elisp report-xemacs-bugs | |
12 | |
13 # This file is part of XEmacs. | |
14 | |
15 # XEmacs is free software; you can redistribute it and/or modify it | |
16 # under the terms of the GNU General Public License as published by | |
17 # the Free Software Foundation; either version 2, or (at your option) | |
18 # any later version. | |
19 | |
20 # XEmacs is distributed in the hope that it will be useful, but | |
21 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
23 # General Public License for more details. | |
24 | |
25 # You should have received a copy of the GNU General Public License | |
26 # along with XEmacs; see the file COPYING. If not, write to | |
27 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
28 # Boston, MA 02111-1307, USA. | |
29 | |
30 ### Commentary: | |
31 | |
32 ## Extract all the @foo@ configuration symbols from ../configure | |
33 ## to make them available to elisp later (see util/config.el) | |
34 ## Primarily useful for creating ridiculously verbose bug reports. | |
35 ## | |
543 | 36 ## See lisp/config.el, ../configure.in, |
428 | 37 ## and the Autoconf documentation on AC_OUTPUT, for more details. |
38 ## | |
39 ## This script needs only to be run occasionally (before a Net release) | |
40 ## by an XEmacs Maintainer (consider yourself so blessed, if you are | |
41 ## actually reading this commentary). | |
42 ## | |
434 | 43 |
44 if (! -r "./configure") { | |
45 chdir ".." or die "Can't chdir: $!"; | |
46 if (! -r "./configure") { | |
47 die "Can't find configure!"; | |
48 } | |
49 } | |
428 | 50 |
434 | 51 sub FileContents { |
52 local $/ = undef; # Slurp mode | |
53 open (FILE, "< $_[0]") or die "$_[0]: $!"; | |
54 my $contents = <FILE>; | |
55 close FILE or die "$_[0]: $!"; | |
56 return $contents; | |
57 } | |
58 | |
59 my $configure_contents = FileContents "./configure"; | |
60 my $cvi_contents = FileContents "lib-src/config.values.in"; | |
61 | |
62 my $new_cvi_contents = | |
63 ";;; Do not edit this file! | |
428 | 64 ;;; This file was automatically generated, by the config.values.sh script, |
65 ;;; from configure, which was itself automatically generated from configure.in. | |
66 ;;; | |
543 | 67 ;;; See lisp/config.el for details on how this file is used. |
428 | 68 ;;; |
69 ;;; You are trapped in a twisty maze of strange-looking files, all autogenerated... | |
70 | |
71 ;;; configure is created, from configure.in, by autoconf | |
72 ;;; config.values.in is created, from configure, by config.values.sh | |
73 ;;; config.values is created, from config.values.in, by configure | |
543 | 74 ;;; config.values is read by lisp/config.el, |
428 | 75 ;;; to create the (Lisp object) config-value-hash-table |
76 | |
77 ;;; Variables defined in configure by AC_SUBST follow: | |
78 ;;; (These are used in Makefiles) | |
79 | |
434 | 80 "; |
428 | 81 |
434 | 82 my %done; |
83 for my $var (sort { $a cmp $b } | |
84 $configure_contents =~ | |
2651 | 85 /^s\,\@([A-Za-z0-9_]+)\@\,\$[A-Za-z0-9_]+\,;t t/mg) { |
434 | 86 $new_cvi_contents .= "$var \"\@$var\@\"\n" unless exists $done{$var}; |
87 $done{$var} = 1; | |
88 } | |
89 | |
90 $new_cvi_contents .= " | |
428 | 91 ;;; Variables defined in configure by AC_DEFINE and AC_DEFINE_UNQUOTED follow: |
92 ;;; (These are used in C code) | |
93 | |
434 | 94 "; |
95 | |
96 if ($cvi_contents ne $new_cvi_contents) { | |
97 unlink "lib-src/config.values.in"; | |
98 open (CVI, "> lib-src/config.values.in") | |
99 or die "lib-src/config.values.in: $!"; | |
100 print CVI $new_cvi_contents; | |
101 close CVI | |
102 or die "lib-src/config.values.in: $!"; | |
103 } |