aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2010-05-10 20:00:32 -0700
committerGlenn Morris2010-05-10 20:00:32 -0700
commitd3b23034e8730133e23d6b51905b181f12bfb253 (patch)
tree2925f56cccf07cf4bcd69cb0f8c34a73ad7db58a
parentacddf8aec716be7810edc29e1a7eeb396fc755c3 (diff)
downloademacs-d3b23034e8730133e23d6b51905b181f12bfb253.tar.gz
emacs-d3b23034e8730133e23d6b51905b181f12bfb253.zip
Do not preprocess lib-src/Makefile.in
* configure.in: Generate lib-src/Makefile directly, do not run cpp. * config.bat: Do not run cpp on lib-src/Makefile.in. * lib-src/Makefile.in: Convert comments to makefile format. * admin/notes/cpp: lib-src/Makefile not preprocessed.
-rw-r--r--admin/notes/cpp6
-rw-r--r--config.bat8
-rw-r--r--configure.in18
-rw-r--r--lib-src/ChangeLog2
-rw-r--r--lib-src/Makefile.in68
5 files changed, 39 insertions, 63 deletions
diff --git a/admin/notes/cpp b/admin/notes/cpp
index 275001369d9..73b4b3d64ff 100644
--- a/admin/notes/cpp
+++ b/admin/notes/cpp
@@ -1,11 +1,7 @@
1ttn 2003-04-09 1ttn 2003-04-09
2 2
3we use a C preprocesor not only in the normal compilation of .c files 3we use a C preprocesor not only in the normal compilation of .c files
4into object files, but also for creating 4into object files, but also for creating src/Makefile.
5
6 src/Makefile
7 lib-src/Makefile
8
9(delimited by comment "start of cpp stuff"). some cpp implementations 5(delimited by comment "start of cpp stuff"). some cpp implementations
10insert whitespace in between tokens. 6insert whitespace in between tokens.
11 7
diff --git a/config.bat b/config.bat
index e2e57bb5ef9..0482d4f15f0 100644
--- a/config.bat
+++ b/config.bat
@@ -221,16 +221,12 @@ cd ..
221rem ---------------------------------------------------------------------- 221rem ----------------------------------------------------------------------
222Echo Configuring the library source directory... 222Echo Configuring the library source directory...
223cd lib-src 223cd lib-src
224rem Create "makefile" from "makefile.in".
225sed -e "1,/== start of cpp stuff ==/s@^##*[ ].*$@@" <Makefile.in >junk.c
226gcc -E -traditional -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[ ]*$/d" >makefile.new
227If "%DJGPP_VER%" == "2" goto libsrc-v2 224If "%DJGPP_VER%" == "2" goto libsrc-v2
228sed -f ../msdos/sed3.inp <makefile.new >Makefile 225sed -f ../msdos/sed3.inp <Makefile.in >Makefile
229Goto libsrc2 226Goto libsrc2
230:libsrc-v2 227:libsrc-v2
231sed -f ../msdos/sed3v2.inp <makefile.new >Makefile 228sed -f ../msdos/sed3v2.inp <Makefile.in >Makefile
232:libsrc2 229:libsrc2
233rm -f makefile.new junk.c
234if "%X11%" == "" goto libsrc2a 230if "%X11%" == "" goto libsrc2a
235mv Makefile makefile.tmp 231mv Makefile makefile.tmp
236sed -f ../msdos/sed3x.inp <makefile.tmp >Makefile 232sed -f ../msdos/sed3x.inp <makefile.tmp >Makefile
diff --git a/configure.in b/configure.in
index c99167f205f..d634262a0fc 100644
--- a/configure.in
+++ b/configure.in
@@ -3595,7 +3595,7 @@ AC_EGREP_CPP(yes..yes,
3595 CPP_NEED_TRADITIONAL=no, 3595 CPP_NEED_TRADITIONAL=no,
3596 CPP_NEED_TRADITIONAL=yes) 3596 CPP_NEED_TRADITIONAL=yes)
3597 3597
3598AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \ 3598AC_OUTPUT(Makefile lib-src/Makefile oldXMenu/Makefile \
3599 doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \ 3599 doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \
3600 doc/lispref/Makefile src/Makefile.c:src/Makefile.in \ 3600 doc/lispref/Makefile src/Makefile.c:src/Makefile.in \
3601 lwlib/Makefile lisp/Makefile leim/Makefile, [ 3601 lwlib/Makefile lisp/Makefile leim/Makefile, [
@@ -3619,22 +3619,6 @@ if test "x$GCC" = xyes && test "x$CPP_NEED_TRADITIONAL" = xyes; then
3619 CPPFLAGS="$CPPFLAGS -traditional" 3619 CPPFLAGS="$CPPFLAGS -traditional"
3620fi 3620fi
3621 3621
3622echo creating lib-src/Makefile
3623( cd lib-src
3624 rm -f junk.c junk1.c junk2.c
3625 sed -e '/start of cpp stuff/q' \
3626 < Makefile.c > junk1.c
3627 sed -e '1,/start of cpp stuff/d'\
3628 -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
3629 < Makefile.c > junk.c
3630 $CPP -P $cpp_undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
3631 sed -e 's/^ / /' -e '/^#/d' -e '/^[ ]*$/d' > junk2.c
3632 cat junk1.c junk2.c > Makefile.new
3633 rm -f junk.c junk1.c junk2.c
3634 chmod 444 Makefile.new
3635 mv -f Makefile.new Makefile
3636)
3637
3638echo creating src/Makefile 3622echo creating src/Makefile
3639( cd src 3623( cd src
3640 rm -f junk.c junk1.c junk2.c 3624 rm -f junk.c junk1.c junk2.c
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 6f3879fb266..c9a054b9e23 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,5 +1,7 @@
12010-05-11 Glenn Morris <rgm@gnu.org> 12010-05-11 Glenn Morris <rgm@gnu.org>
2 2
3 * Makefile.in: Convert comments to makefile format.
4
3 * Makefile.in (LIBS_SYSTEM) [MSDOS]: Do not reset. 5 * Makefile.in (LIBS_SYSTEM) [MSDOS]: Do not reset.
4 (config.h) [MSDOS]: Do not include. 6 (config.h) [MSDOS]: Do not include.
5 7
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index 683a97393db..a2773aa916d 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -31,6 +31,7 @@ EMACSOPT = -batch --no-site-file --multibyte
31CC=@CC@ 31CC=@CC@
32CFLAGS=@CFLAGS@ 32CFLAGS=@CFLAGS@
33version=@version@ 33version=@version@
34## Used in $archlibdir.
34configuration=@configuration@ 35configuration=@configuration@
35EXEEXT=@EXEEXT@ 36EXEEXT=@EXEEXT@
36C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ 37C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
@@ -127,8 +128,8 @@ EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
127# Specify additional -D flags for movemail. Options: 128# Specify additional -D flags for movemail. Options:
128# -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking). 129# -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking).
129# See the comments about locking in movemail.c. Normally the values 130# See the comments about locking in movemail.c. Normally the values
130# in ../src/[ms]/*.h should be correct and you should not need to do anything. 131# set by configure should be correct and you should not need to do anything.
131# If neither flag is set, blessmail is used. 132# If neither flag is set, you need to use blessmail.
132MOVE_FLAGS= 133MOVE_FLAGS=
133 134
134## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail. 135## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail.
@@ -164,18 +165,15 @@ ALL_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src
164LINK_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS} 165LINK_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
165CPP_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS} 166CPP_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
166 167
167# ========================== start of cpp stuff =======================
168/* From here on, comments must be done in C syntax. */
169
170LOADLIBES=$(LIBS_SYSTEM) 168LOADLIBES=$(LIBS_SYSTEM)
171 169
172 170
173.SUFFIXES: .m 171.SUFFIXES: .m
174 172
175/* This is the default compilation command. 173## This is the default compilation command.
176 But we should never rely on it, because some make version 174## But we should never rely on it, because some make version failed to
177 failed to find it for getopt.o. 175## find it for getopt.o.
178 Using an explicit command made it work. */ 176## Using an explicit command made it work.
179.c.o: 177.c.o:
180 ${CC} -c ${CPP_CFLAGS} $< 178 ${CC} -c ${CPP_CFLAGS} $<
181 179
@@ -184,11 +182,10 @@ LOADLIBES=$(LIBS_SYSTEM)
184 182
185all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} 183all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
186 184
187/* These targets copy the scripts into the build directory 185## These targets copy the scripts into the build directory so that
188so that they can be run from there in an uninstalled Emacs. 186## they can be run from there in an uninstalled Emacs.
189The "-" is prepended because some versions of cp barf when 187## The "-" is prepended because some versions of cp barf when srcdir
190srcdir is the current directory, and thus the file will be 188## is the current directory, and thus the file will be copied into itself.
191copied into itself. */
192rcs2log: $(srcdir)/rcs2log 189rcs2log: $(srcdir)/rcs2log
193 -cp -p $(srcdir)/rcs2log rcs2log 190 -cp -p $(srcdir)/rcs2log rcs2log
194 191
@@ -201,16 +198,15 @@ grep-changelog: $(srcdir)/grep-changelog
201vcdiff: $(srcdir)/vcdiff 198vcdiff: $(srcdir)/vcdiff
202 -cp -p $(srcdir)/vcdiff vcdiff 199 -cp -p $(srcdir)/vcdiff vcdiff
203 200
204/* Only used if we need blessmail, but no harm in always defining. 201## Only used if we need blessmail, but no harm in always defining.
205 This makes the actual blessmail executable. */ 202## This makes the actual blessmail executable.
206blessmail: 203blessmail:
207 $(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el 204 $(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el
208 chmod +x blessmail 205 chmod +x blessmail
209 206
210/* This checks if we need to run blessmail. */ 207## This checks if we need to run blessmail.
208## Do not charge ahead and do it! Let the installer decide.
211need-blessmail: blessmail 209need-blessmail: blessmail
212/* Don\'t charge ahead and do it! Let the installer decide.
213 ./blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT} */
214 @if [ `wc -l <blessmail` != 2 ] ; then \ 210 @if [ `wc -l <blessmail` != 2 ] ; then \
215 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \ 211 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
216 echo Assuming $$dir is really the mail spool directory, you should; \ 212 echo Assuming $$dir is really the mail spool directory, you should; \
@@ -219,11 +215,14 @@ need-blessmail: blessmail
219 echo Do that after running make install.; \ 215 echo Do that after running make install.; \
220 fi 216 fi
221 217
222/* This is the target invoked by the top-level Makefile. */ 218## This is the target invoked by the top-level Makefile.
223maybe-blessmail: $(BLESSMAIL_TARGET) 219maybe-blessmail: $(BLESSMAIL_TARGET)
224 220
225/* Install the internal utilities. Until they are installed, we can 221## Install the internal utilities. Until they are installed, we can
226 just run them directly from lib-src. */ 222## just run them directly from lib-src.
223## If the chown/chmod commands fail, that is not a big deal.
224## update-game-score will detect at runtime that it is not setuid,
225## and handle things accordingly.
227$(DESTDIR)${archlibdir}: all 226$(DESTDIR)${archlibdir}: all
228 @echo 227 @echo
229 @echo "Installing utilities run internally by Emacs." 228 @echo "Installing utilities run internally by Emacs."
@@ -236,9 +235,6 @@ $(DESTDIR)${archlibdir}: all
236 umask 022; $(top_srcdir)/mkinstalldirs $(DESTDIR)${gamedir}; \ 235 umask 022; $(top_srcdir)/mkinstalldirs $(DESTDIR)${gamedir}; \
237 touch $(DESTDIR)${gamedir}/snake-scores; \ 236 touch $(DESTDIR)${gamedir}/snake-scores; \
238 touch $(DESTDIR)${gamedir}/tetris-scores 237 touch $(DESTDIR)${gamedir}/tetris-scores
239/* If the following commands fail, that is not a big deal.
240 update-game-score will detect at runtime that it is not setuid,
241 and handle things accordingly. */
242 -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \ 238 -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \
243 chown ${gameuser} $(DESTDIR)${gamedir}; \ 239 chown ${gameuser} $(DESTDIR)${gamedir}; \
244 chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \ 240 chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
@@ -289,7 +285,7 @@ maintainer-clean: distclean
289extraclean: maintainer-clean 285extraclean: maintainer-clean
290 -rm -f *~ \#* 286 -rm -f *~ \#*
291 287
292/* Test the contents of the directory. */ 288## Test the contents of the directory.
293check: 289check:
294 @echo "We don't have any tests for GNU Emacs yet." 290 @echo "We don't have any tests for GNU Emacs yet."
295 291
@@ -297,16 +293,16 @@ tags: TAGS
297TAGS: etags${EXEEXT} 293TAGS: etags${EXEEXT}
298 etags *.[ch] 294 etags *.[ch]
299 295
300/* This verifies that the non-ASCII characters in the file \`testfile\' 296## This verifies that the non-ASCII characters in the file \`testfile\'
301 have not been clobbered by whatever means were used to copy and 297## have not been clobbered by whatever means were used to copy and
302 distribute Emacs. If they were clobbered, all the .elc files were 298## distribute Emacs. If they were clobbered, all the .elc files were
303 clobbered too. */ 299## clobbered too.
304test-distrib${EXEEXT}: ${srcdir}/test-distrib.c 300test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
305 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c 301 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
306 ./test-distrib ${srcdir}/testfile 302 ./test-distrib ${srcdir}/testfile
307 303
308/* We need the following in order to create a <getopt.h> when the system 304## We need the following in order to create a <getopt.h> when the system
309 does not have one that works with the given compiler. */ 305## does not have one that works with the given compiler.
310GETOPT_H = @GETOPT_H@ 306GETOPT_H = @GETOPT_H@
311getopt.h: getopt_.h 307getopt.h: getopt_.h
312 cp $(srcdir)/getopt_.h $@-t 308 cp $(srcdir)/getopt_.h $@-t
@@ -331,8 +327,8 @@ etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
331ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h 327ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
332 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse 328 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
333 329
334/* We depend on etags to assure that parallel makes don\'t write two 330## We depend on etags to assure that parallel makes do not write two
335 etags.o files on top of each other. */ 331## etags.o files on top of each other.
336ctags${EXEEXT}: etags${EXEEXT} 332ctags${EXEEXT}: etags${EXEEXT}
337 $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags 333 $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
338 334
@@ -355,7 +351,7 @@ b2m${EXEEXT}: ${srcdir}/b2m.c ../src/config.h $(GETOPTDEPS)
355movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS) 351movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS)
356 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MOVE) -o movemail 352 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MOVE) -o movemail
357 353
358/* We need to define emacs to get the right version of something (what?). */ 354## We need to define emacs to get the right version of something (what?).
359movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H) 355movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H)
360 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c 356 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c
361 357
@@ -379,3 +375,5 @@ update-game-score${EXEEXT}: update-game-score.o $(GETOPTDEPS)
379update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h $(GETOPT_H) 375update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h $(GETOPT_H)
380 $(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \ 376 $(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \
381 -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" 377 -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\""
378
379## Makefile ends here.