Mercurial > hg > xemacs-beta
annotate src/make-src-depend @ 613:023b83f4e54b
[xemacs-hg @ 2001-06-10 10:42:16 by ben]
------ signal-code changes ------
data.c, device-tty.c, emacs.c, floatfns.c, linuxplay.c, nas.c,
process-unix.c, signal.c, sunplay.c, sysdep.c, syssignal.h:
use EMACS_SIGNAL everywhere instead of playing preprocessing
games with signal().
s\windowsnt.h, s\mingw32.h, syssignal.h:
Remove mswindows signal code from s+m headers and move to
syssignal.h as one of the five ways of signal handling,
instead of playing preprocessing games.
fileio.c, sysdep.c:
Rename sys_do_signal to qxe_reliable_signal.
signal.c, process-unix.c, profile.c:
Create set_timeout_signal(); use instead of just EMACS_SIGNAL
to establish a signal handler on a timeout signal; this does
special things under Cygwin.
nt.c:
Eliminate term_ntproc(), which is blank; used as a SIGABRT
handler, which was wrong anyway.
nt.c, win32.c:
Move signal code from nt.c to win32.c, since Cygwin needs it
too when dealing with timeout signals.
s\cygwin32.h:
Define CYGWIN_BROKEN_SIGNALS.
------ other changes ------
s\mingw32.h:
Fix problems with NOT_C_CODE being in the wrong place and
excluding defines needed when building Makefile.in.in.
filelock.c, mule-canna.c, mule-ccl.c, mule-ccl.h, ralloc.c,
unexalpha.c, unexapollo.c, unexcw.c, unexelfsgi.c, unexnt.c,
unexsni.c, s\aix3-1.h, s\bsd4-1.h, s\bsd4-2.h, s\bsd4-3.h, s\cxux.h,
s\cygwin32.h, s\dgux.h, s\dgux5-4r2.h, s\dgux5-4r3.h, s\dgux5-4r4.h,
s\ewsux5r4.h, s\gnu.h, s\hpux.h, s\iris3-5.h, s\iris3-6.h,
s\irix3-3.h, s\linux.h, s\mingw32.h, s\newsos5.h, s\nextstep.h,
s\ptx.h, s\riscix1-1.h, s\riscix1-2.h, s\rtu.h, s\sco4.h, s\sco5.h,
s\template.h, s\ultrix.h, s\umax.h, s\umips.h, s\unipl5-0.h,
s\unipl5-2.h, s\usg5-0.h, s\usg5-2-2.h, s\usg5-2.h, s\usg5-3.h,
s\usg5-4.h, s\windowsnt.h, s\xenix.h:
Rename 'GNU Emacs' to XEmacs in the copyright and comments.
nas.c:
Stylistic cleanup. Avoid preprocessing games with names such
as play_sound_file.
------ signal-code changes ------
data.c, device-tty.c, emacs.c, floatfns.c, linuxplay.c, nas.c,
process-unix.c, signal.c, sunplay.c, sysdep.c, syssignal.h:
use EMACS_SIGNAL everywhere instead of playing preprocessing
games with signal().
s\windowsnt.h, s\mingw32.h, syssignal.h:
Remove mswindows signal code from s+m headers and move to
syssignal.h as one of the five ways of signal handling,
instead of playing preprocessing games.
fileio.c, sysdep.c:
Rename sys_do_signal to qxe_reliable_signal.
signal.c, process-unix.c, profile.c:
Create set_timeout_signal(); use instead of just EMACS_SIGNAL
to establish a signal handler on a timeout signal; this does
special things under Cygwin.
nt.c:
Eliminate term_ntproc(), which is blank; used as a SIGABRT
handler, which was wrong anyway.
nt.c, win32.c:
Move signal code from nt.c to win32.c, since Cygwin needs it
too when dealing with timeout signals.
s\cygwin32.h:
Define CYGWIN_BROKEN_SIGNALS.
------ other changes ------
s\mingw32.h:
Fix problems with NOT_C_CODE being in the wrong place and
excluding defines needed when building Makefile.in.in.
filelock.c, mule-canna.c, mule-ccl.c, mule-ccl.h, ralloc.c,
unexalpha.c, unexapollo.c, unexcw.c, unexelfsgi.c, unexnt.c,
unexsni.c, s\aix3-1.h, s\bsd4-1.h, s\bsd4-2.h, s\bsd4-3.h, s\cxux.h,
s\cygwin32.h, s\dgux.h, s\dgux5-4r2.h, s\dgux5-4r3.h, s\dgux5-4r4.h,
s\ewsux5r4.h, s\gnu.h, s\hpux.h, s\iris3-5.h, s\iris3-6.h,
s\irix3-3.h, s\linux.h, s\mingw32.h, s\newsos5.h, s\nextstep.h,
s\ptx.h, s\riscix1-1.h, s\riscix1-2.h, s\rtu.h, s\sco4.h, s\sco5.h,
s\template.h, s\ultrix.h, s\umax.h, s\umips.h, s\unipl5-0.h,
s\unipl5-2.h, s\usg5-0.h, s\usg5-2-2.h, s\usg5-2.h, s\usg5-3.h,
s\usg5-4.h, s\windowsnt.h, s\xenix.h:
Rename 'GNU Emacs' to XEmacs in the copyright and comments.
nas.c:
Stylistic cleanup. Avoid preprocessing games with names such
as play_sound_file.
xemacs-faq.texi:
Update sections on Windows and MacOS availability.
alist.el, apropos.el, autoload.el, bytecomp.el, cl-compat.el, cl-extra.el, cl-macs.el, cl-seq.el, cl.el, cmdloop.el, cus-edit.el, derived.el, gpm.el, itimer.el, lisp-mode.el, shadow.el, version.el, wid-browse.el:
Rename 'GNU Emacs' to XEmacs in the copyright. Fix other
references to GNU Emacs that should be XEmacs or just Emacs.
files.el:
Fix warning.
simple.el:
transpose-line-up/down will now move the region up or down by
a line if active.
cvtmail.c, fakemail.c, gnuserv.c, gnuserv.h, gnuslib.c, make-msgfile.c, make-path.c, pop.c, pop.h, profile.c, tcp.c:
Rename 'GNU Emacs' to XEmacs in the copyright.
Fix comments in similar ways.
digest-doc.c, sorted-doc.c:
Fix program and author name to reflect XEmacs.
| author | ben |
|---|---|
| date | Sun, 10 Jun 2001 10:42:39 +0000 |
| parents | 0784d089fdc9 |
| children | f99d3d25df86 |
| rev | line source |
|---|---|
| 428 | 1 : #-*- Perl -*- |
| 2 # Copyright (C) 1998 Free Software Foundation, Inc. | |
| 3 | |
| 4 # This file is part of XEmacs. | |
| 5 # | |
| 6 # XEmacs is free software; you can redistribute it and/or modify it | |
| 7 # under the terms of the GNU General Public License as published by the | |
| 8 # Free Software Foundation; either version 2, or (at your option) any | |
| 9 # later version. | |
| 10 # | |
| 11 # XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 # for more details. | |
| 15 # | |
| 16 # You should have received a copy of the GNU General Public License | |
| 17 # along with XEmacs; see the file COPYING. If not, write to | |
| 18 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
| 19 # Boston, MA 02111-1307, USA. | |
| 20 | |
| 21 # Author: Martin Buchholz | |
| 22 eval 'exec perl -w -S $0 ${1+"$@"}' | |
| 23 if 0; | |
| 24 | |
| 25 use strict; | |
| 26 my ($myName, $srcdir, %exists, %uses, %generated_header); | |
| 27 | |
| 28 ($myName = $0) =~ s@.*/@@; my $usage =" | |
| 29 Usage: $myName | |
| 30 | |
| 31 Generates Makefile dependencies for the XEmacs src directory. | |
| 32 The dependencies are written to stdout.\n"; | |
| 33 | |
| 34 die $usage if @ARGV; | |
| 35 | |
| 36 ($srcdir = $0) =~ s@[^/]+$@@; | |
| 37 $srcdir = "." if $srcdir eq ""; | |
| 38 chdir $srcdir or die "$srcdir: $!"; | |
| 39 | |
| 40 opendir SRCDIR, "." or die "$srcdir: $!"; | |
| 41 for (grep (/\.[ch]$/, readdir (SRCDIR))) { $exists{$_} = 1; } | |
| 42 closedir SRCDIR; | |
| 43 | |
| 44 for (qw (config.h sheap-adjust.h paths.h Emacs.ad.h)) { | |
| 45 $generated_header{$_} = 1; | |
| 46 } | |
| 47 | |
| 442 | 48 # Although this is not technically true, it ought to be true, |
| 49 # and makes the generated Makefile smaller. | |
| 50 $uses{'lisp.h'}{'config.h'} = 1; | |
| 51 | |
| 428 | 52 for my $file (keys %exists) { |
| 53 open (FILE, $file) or die "$file: $!"; | |
| 54 undef $/; $_ = <FILE>; | |
| 55 RemoveComments ($_); | |
| 56 s/[ \t]+//g; | |
| 57 # Find include dependencies | |
| 58 for (/^\#include([^\n]+)/gm) { | |
| 462 | 59 if (m@^\"([A-Za-z0-9._-]+\.[ch])\"@) { |
| 428 | 60 $uses{$file}{$1} = 1 if exists $exists{$1}; |
| 442 | 61 } elsif (m@<([A-Za-z0-9._-]+\.h)>@) { |
| 428 | 62 $uses{$file}{$1} = 1 if exists $generated_header{$1}; |
| 442 | 63 } elsif (m@\"../lwlib/([A-Za-z0-9._-]+\.h)\"@) { |
| 428 | 64 $uses{$file}{"\$(LWLIB_SRCDIR)/lwlib.h"} = 1; |
| 65 } | |
| 66 } | |
| 67 } | |
| 68 | |
| 69 # Make transitive closure of %uses | |
| 70 while (1) { | |
| 71 my $changedP = 0; | |
| 72 for my $x (keys %uses) { | |
| 73 for my $y (keys %{$uses{$x}}) { | |
| 74 for my $z (keys %{$uses{$y}}) { | |
| 75 if (! exists $uses{$x}{$z}) { | |
| 76 $uses{$x}{$z} = 1; | |
| 77 $changedP = 1; | |
| 78 } | |
| 79 } | |
| 80 } | |
| 81 } | |
| 82 last if !$changedP; | |
| 83 } | |
| 84 | |
| 85 # Print file header | |
| 86 print | |
| 442 | 87 "## This file is automatically generated by \`$myName'. Do not modify. |
| 428 | 88 |
| 442 | 89 #if defined(USE_UNION_TYPE) |
| 428 | 90 LISP_UNION_H=lisp-union.h |
| 91 #else | |
| 92 LISP_UNION_H=lisp-disunion.h | |
| 93 #endif | |
| 94 "; | |
| 95 | |
| 452 | 96 my @LISP_H = ('lisp.h', sort keys %{$uses{'lisp.h'}}); |
| 442 | 97 print "LISP_H=@{[grep (!/lisp-(dis)?union\.h/, @LISP_H)]} \$(LISP_UNION_H)\n"; |
| 428 | 98 |
| 99 sub PrintDeps { | |
| 100 my $file = shift; | |
| 101 my $ofile = $file; $ofile =~ s/c$/o/; print "$ofile: "; | |
| 102 if (exists $uses{$file}{'lisp.h'}) { | |
| 103 delete @{%{$uses{$file}}}{@LISP_H}; | |
| 104 $uses{$file}{'$(LISP_H)'} = 1; | |
| 105 } | |
| 106 print "@{[sort keys %{$uses{$file}}]}\n"; | |
| 107 } | |
| 108 | |
| 109 sub PrintPatternDeps { | |
| 110 my ($pattern, $CPP_SYMBOL) = @_; | |
| 442 | 111 print "#if defined($CPP_SYMBOL)\n"; |
| 428 | 112 for my $file (sort grep (/$pattern/ && /\.c$/, keys %uses)) { |
| 113 PrintDeps($file); | |
| 114 delete $uses{$file}; | |
| 115 } | |
| 116 print "#endif\n"; | |
| 117 } | |
| 118 | |
| 442 | 119 PrintPatternDeps ('-msw\\.', "HAVE_MS_WINDOWS"); |
| 120 PrintPatternDeps ('-x\\.', "HAVE_X_WINDOWS"); | |
| 121 PrintPatternDeps ('-tty\\.', "HAVE_TTY"); | |
| 462 | 122 PrintPatternDeps ('-gtk\\.', "HAVE_GTK"); |
| 442 | 123 PrintPatternDeps ('^database', "HAVE_DATABASE"); |
| 124 PrintPatternDeps ('^mule', "MULE"); | |
| 428 | 125 PrintPatternDeps ('^(?:External|extw-)', "EXTERNAL_WIDGET"); |
| 126 | |
| 127 for my $file (sort grep (/\.c$/, keys %uses)) { PrintDeps($file); } | |
| 128 | |
| 442 | 129 # Surprisingly robust regexp to remove comments from arbitrary C code |
| 428 | 130 sub RemoveComments { |
| 131 $_[0] =~ | |
| 132 s{ ( | |
| 133 [^\"\'/]+ | | |
| 134 (?:\"[^\"\\]*(?:\\.[^\"\\]*)*\" [^\"\'/]*)+ | | |
| 135 (?:\'[^\'\\]*(?:\\.[^\'\\]*)*\' [^\"\'/]*)+ | |
| 136 ) | |
| 137 | / (?: | |
| 138 \*[^*]*\*+(?:[^/*][^*]*\*+)*/ | |
| 139 | | |
| 140 /[^\n]* | |
| 141 ) | |
| 142 }{defined $1 ? $1 : ""}gsxeo; | |
| 143 } |
