diff options
| author | Dan Nicolaescu | 2010-04-26 22:24:53 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-04-26 22:24:53 -0700 |
| commit | ed6281b066a0c183b3bdd8473dd412ca72cb173e (patch) | |
| tree | 908f94a409e601f755b0c6da347612db9a48ad00 | |
| parent | aaa36002bef7223e1dce0b0431d54f728ef589ba (diff) | |
| download | emacs-ed6281b066a0c183b3bdd8473dd412ca72cb173e.tar.gz emacs-ed6281b066a0c183b3bdd8473dd412ca72cb173e.zip | |
Reduce CPP usage.
* Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE, C_SWITCH_X_SITE): Remove
definitions and undefs. Inline definitions in the only user.
(ALL_CFLAGS): Substitute C_SWITCH_X_SYSTEM using autoconf.
* Makefile.in (C_SWITCH_X_SYSTEM): Define using autoconf.
* Makefile.in (C_SWITCH_X_SYSTEM): Define using autoconf.
* configure.in (C_SWITCH_X_SYSTEM): Define using autoconf, not cpp.
| -rw-r--r-- | ChangeLog | 1 | ||||
| -rw-r--r-- | configure.in | 8 | ||||
| -rw-r--r-- | lwlib/ChangeLog | 4 | ||||
| -rw-r--r-- | lwlib/Makefile.in | 1 | ||||
| -rw-r--r-- | oldXMenu/ChangeLog | 4 | ||||
| -rw-r--r-- | oldXMenu/Makefile.in | 1 | ||||
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/Makefile.in | 38 |
8 files changed, 23 insertions, 37 deletions
| @@ -5,6 +5,7 @@ | |||
| 5 | (unexec): Define unconditionally, all platforms define | 5 | (unexec): Define unconditionally, all platforms define |
| 6 | UNEXEC. AC_SUBST it. | 6 | UNEXEC. AC_SUBST it. |
| 7 | (UNEXEC_SRC): Remove, unused. | 7 | (UNEXEC_SRC): Remove, unused. |
| 8 | (C_SWITCH_X_SYSTEM): Define using autoconf, not cpp. | ||
| 8 | 9 | ||
| 9 | 2010-04-27 Glenn Morris <rgm@gnu.org> | 10 | 2010-04-27 Glenn Morris <rgm@gnu.org> |
| 10 | 11 | ||
diff --git a/configure.in b/configure.in index 04da6d4632b..d4806195f18 100644 --- a/configure.in +++ b/configure.in | |||
| @@ -2260,6 +2260,7 @@ AC_SUBST(LIBGPM) | |||
| 2260 | dnl Check for malloc/malloc.h on darwin | 2260 | dnl Check for malloc/malloc.h on darwin |
| 2261 | AC_CHECK_HEADER(malloc/malloc.h, [AC_DEFINE(HAVE_MALLOC_MALLOC_H, 1, [Define to 1 if you have the <malloc/malloc.h> header file.])]) | 2261 | AC_CHECK_HEADER(malloc/malloc.h, [AC_DEFINE(HAVE_MALLOC_MALLOC_H, 1, [Define to 1 if you have the <malloc/malloc.h> header file.])]) |
| 2262 | 2262 | ||
| 2263 | C_SWITCH_X_SYSTEM= | ||
| 2263 | ### Use NeXTstep API to implement GUI. | 2264 | ### Use NeXTstep API to implement GUI. |
| 2264 | if test "${HAVE_NS}" = "yes"; then | 2265 | if test "${HAVE_NS}" = "yes"; then |
| 2265 | AC_DEFINE(HAVE_NS, 1, [Define to 1 if you are using the NeXTstep API, either GNUstep or Cocoa on Mac OS X.]) | 2266 | AC_DEFINE(HAVE_NS, 1, [Define to 1 if you are using the NeXTstep API, either GNUstep or Cocoa on Mac OS X.]) |
| @@ -2269,6 +2270,9 @@ if test "${HAVE_NS}" = "yes"; then | |||
| 2269 | fi | 2270 | fi |
| 2270 | if test "${NS_IMPL_GNUSTEP}" = "yes"; then | 2271 | if test "${NS_IMPL_GNUSTEP}" = "yes"; then |
| 2271 | AC_DEFINE(NS_IMPL_GNUSTEP, 1, [Define to 1 if you are using NS windowing under GNUstep.]) | 2272 | AC_DEFINE(NS_IMPL_GNUSTEP, 1, [Define to 1 if you are using NS windowing under GNUstep.]) |
| 2273 | # See also .m.o rule in Makefile.in */ | ||
| 2274 | # FIXME: are all these flags really needed? Document here why. */ | ||
| 2275 | C_SWITCH_X_SYSTEM="-D_REENTRANT -fPIC -fno-strict-aliasing" | ||
| 2272 | GNU_OBJC_CFLAGS="-fgnu-runtime -Wno-import -fconstant-string-class=NSConstantString -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN -DGSDIAGNOSE" | 2276 | GNU_OBJC_CFLAGS="-fgnu-runtime -Wno-import -fconstant-string-class=NSConstantString -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN -DGSDIAGNOSE" |
| 2273 | fi | 2277 | fi |
| 2274 | if test "${NS_HAVE_NSINTEGER}" = "yes"; then | 2278 | if test "${NS_HAVE_NSINTEGER}" = "yes"; then |
| @@ -2763,6 +2767,7 @@ AC_SUBST(unexec) | |||
| 2763 | AC_SUBST(LD_SWITCH_X_SITE) | 2767 | AC_SUBST(LD_SWITCH_X_SITE) |
| 2764 | AC_SUBST(LD_SWITCH_X_SITE_AUX) | 2768 | AC_SUBST(LD_SWITCH_X_SITE_AUX) |
| 2765 | AC_SUBST(C_SWITCH_X_SITE) | 2769 | AC_SUBST(C_SWITCH_X_SITE) |
| 2770 | AC_SUBST(C_SWITCH_X_SYSTEM) | ||
| 2766 | AC_SUBST(CFLAGS) | 2771 | AC_SUBST(CFLAGS) |
| 2767 | AC_SUBST(X_TOOLKIT_TYPE) | 2772 | AC_SUBST(X_TOOLKIT_TYPE) |
| 2768 | AC_SUBST(machfile) | 2773 | AC_SUBST(machfile) |
| @@ -2933,9 +2938,6 @@ AH_BOTTOM([ | |||
| 2933 | parallel this exactly since GNUstep is multi-OS. */ | 2938 | parallel this exactly since GNUstep is multi-OS. */ |
| 2934 | #ifdef HAVE_NS | 2939 | #ifdef HAVE_NS |
| 2935 | # ifdef NS_IMPL_GNUSTEP | 2940 | # ifdef NS_IMPL_GNUSTEP |
| 2936 | /* See also .m.o rule in Makefile.in */ | ||
| 2937 | /* FIXME: are all these flags really needed? Document here why. */ | ||
| 2938 | # define C_SWITCH_X_SYSTEM -D_REENTRANT -fPIC -fno-strict-aliasing | ||
| 2939 | /* GNUstep needs a bit more pure memory. Of the existing knobs, | 2941 | /* GNUstep needs a bit more pure memory. Of the existing knobs, |
| 2940 | SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */ | 2942 | SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */ |
| 2941 | # define SYSTEM_PURESIZE_EXTRA 30000 | 2943 | # define SYSTEM_PURESIZE_EXTRA 30000 |
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 52728552eac..ec764072cf1 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2010-04-27 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * Makefile.in (C_SWITCH_X_SYSTEM): Define using autoconf. | ||
| 4 | |||
| 1 | 2010-04-21 Jan Djärv <jan.h.d@swipnet.se> | 5 | 2010-04-21 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 6 | ||
| 3 | * xlwmenu.c (expose_cb): | 7 | * xlwmenu.c (expose_cb): |
diff --git a/lwlib/Makefile.in b/lwlib/Makefile.in index c79292ea59c..468d1edc50b 100644 --- a/lwlib/Makefile.in +++ b/lwlib/Makefile.in | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | srcdir=@srcdir@ | 26 | srcdir=@srcdir@ |
| 27 | VPATH=@srcdir@ | 27 | VPATH=@srcdir@ |
| 28 | C_SWITCH_X_SITE=@C_SWITCH_X_SITE@ | 28 | C_SWITCH_X_SITE=@C_SWITCH_X_SITE@ |
| 29 | C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@ | ||
| 29 | C_SWITCH_SYSTEM=@c_switch_system@ | 30 | C_SWITCH_SYSTEM=@c_switch_system@ |
| 30 | C_SWITCH_MACHINE=@c_switch_machine@ | 31 | C_SWITCH_MACHINE=@c_switch_machine@ |
| 31 | 32 | ||
diff --git a/oldXMenu/ChangeLog b/oldXMenu/ChangeLog index 48e7a30020e..49569e5f79b 100644 --- a/oldXMenu/ChangeLog +++ b/oldXMenu/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2010-04-27 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * Makefile.in (C_SWITCH_X_SYSTEM): Define using autoconf. | ||
| 4 | |||
| 1 | 2010-04-23 Dan Nicolaescu <dann@ics.uci.edu> | 5 | 2010-04-23 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 6 | ||
| 3 | * Makefile.in (ALL_CFLAGS): Remove C_SWITCH_X_MACHINE, unused. | 7 | * Makefile.in (ALL_CFLAGS): Remove C_SWITCH_X_MACHINE, unused. |
diff --git a/oldXMenu/Makefile.in b/oldXMenu/Makefile.in index b729f34ee93..52c6fe97428 100644 --- a/oldXMenu/Makefile.in +++ b/oldXMenu/Makefile.in | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | srcdir=@srcdir@ | 46 | srcdir=@srcdir@ |
| 47 | VPATH=@srcdir@ | 47 | VPATH=@srcdir@ |
| 48 | C_SWITCH_X_SITE=@C_SWITCH_X_SITE@ | 48 | C_SWITCH_X_SITE=@C_SWITCH_X_SITE@ |
| 49 | C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@ | ||
| 49 | C_SWITCH_SYSTEM=@c_switch_system@ | 50 | C_SWITCH_SYSTEM=@c_switch_system@ |
| 50 | C_SWITCH_MACHINE=@c_switch_machine@ | 51 | C_SWITCH_MACHINE=@c_switch_machine@ |
| 51 | 52 | ||
diff --git a/src/ChangeLog b/src/ChangeLog index dbcb185deb8..53d11c87a63 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | Reduce CPP usage. | 3 | Reduce CPP usage. |
| 4 | * Makefile.in (LIB_X11_LIB): Remove, inline in the only user. | 4 | * Makefile.in (LIB_X11_LIB): Remove, inline in the only user. |
| 5 | (obj): Use autoconf for unexec instead of cpp. | 5 | (obj): Use autoconf for unexec instead of cpp. |
| 6 | (C_SWITCH_SYSTEM, C_SWITCH_MACHINE, C_SWITCH_X_SITE): Remove | ||
| 7 | definitions and undefs. Inline definitions in the only user. | ||
| 8 | (ALL_CFLAGS): Substitute C_SWITCH_X_SYSTEM using autoconf. | ||
| 6 | 9 | ||
| 7 | 2010-04-27 Glenn Morris <rgm@gnu.org> | 10 | 2010-04-27 Glenn Morris <rgm@gnu.org> |
| 8 | 11 | ||
diff --git a/src/Makefile.in b/src/Makefile.in index 45a3031a0f2..e1933a37388 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -77,11 +77,6 @@ LIBGIF=@LIBGIF@ | |||
| 77 | LIBXPM=@LIBXPM@ | 77 | LIBXPM=@LIBXPM@ |
| 78 | XFT_LIBS=@XFT_LIBS@ | 78 | XFT_LIBS=@XFT_LIBS@ |
| 79 | 79 | ||
| 80 | C_SWITCH_SYSTEM=@c_switch_system@ | ||
| 81 | C_SWITCH_MACHINE=@c_switch_machine@ | ||
| 82 | |||
| 83 | C_SWITCH_X_SITE=@C_SWITCH_X_SITE@ | ||
| 84 | |||
| 85 | DBUS_CFLAGS = @DBUS_CFLAGS@ | 80 | DBUS_CFLAGS = @DBUS_CFLAGS@ |
| 86 | DBUS_LIBS = @DBUS_LIBS@ | 81 | DBUS_LIBS = @DBUS_LIBS@ |
| 87 | DBUS_OBJ = @DBUS_OBJ@ | 82 | DBUS_OBJ = @DBUS_OBJ@ |
| @@ -130,11 +125,6 @@ SHELL=/bin/sh | |||
| 130 | DEPFLAGS = -MMD -MF deps/$*.d | 125 | DEPFLAGS = -MMD -MF deps/$*.d |
| 131 | #endif | 126 | #endif |
| 132 | 127 | ||
| 133 | /* Undefine until the user can be moved in the non-cpp section. */ | ||
| 134 | #undef C_SWITCH_SYSTEM | ||
| 135 | #undef C_SWITCH_MACHINE | ||
| 136 | #undef C_SWITCH_X_SITE | ||
| 137 | |||
| 138 | /* Do not let the file name mktime.c get messed up. */ | 128 | /* Do not let the file name mktime.c get messed up. */ |
| 139 | #ifdef mktime | 129 | #ifdef mktime |
| 140 | #undef mktime | 130 | #undef mktime |
| @@ -196,18 +186,10 @@ DEPFLAGS = -MMD -MF deps/$*.d | |||
| 196 | #endif | 186 | #endif |
| 197 | 187 | ||
| 198 | /* These macros are for switches specifically related to X Windows. */ | 188 | /* These macros are for switches specifically related to X Windows. */ |
| 199 | #ifndef C_SWITCH_X_SYSTEM | ||
| 200 | #define C_SWITCH_X_SYSTEM | ||
| 201 | #endif | ||
| 202 | |||
| 203 | #ifndef LD_SWITCH_X_SITE | 189 | #ifndef LD_SWITCH_X_SITE |
| 204 | #define LD_SWITCH_X_SITE | 190 | #define LD_SWITCH_X_SITE |
| 205 | #endif | 191 | #endif |
| 206 | 192 | ||
| 207 | #ifndef LD_SWITCH_X_DEFAULT | ||
| 208 | #define LD_SWITCH_X_DEFAULT | ||
| 209 | #endif | ||
| 210 | |||
| 211 | STARTFILES = START_FILES | 193 | STARTFILES = START_FILES |
| 212 | 194 | ||
| 213 | 195 | ||
| @@ -231,13 +213,9 @@ shared=no | |||
| 231 | -DHAVE_CONFIG_H is needed for some other files to take advantage of | 213 | -DHAVE_CONFIG_H is needed for some other files to take advantage of |
| 232 | the information in ``config.h''. */ | 214 | the information in ``config.h''. */ |
| 233 | 215 | ||
| 234 | #undef C_SWITCH_MACHINE | ||
| 235 | #undef C_SWITCH_SYSTEM | ||
| 236 | #undef C_SWITCH_X_SITE | ||
| 237 | |||
| 238 | /* C_SWITCH_X_SITE must come before C_SWITCH_X_SYSTEM | 216 | /* C_SWITCH_X_SITE must come before C_SWITCH_X_SYSTEM |
| 239 | since it may have -I options that should override those two. */ | 217 | since it may have -I options that should override those two. */ |
| 240 | ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) C_SWITCH_X_SYSTEM ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@ ${DEPFLAGS} | 218 | ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} @c_switch_machine@ @c_switch_system@ @C_SWITCH_X_SITE@ @C_SWITCH_X_SYSTEM@ ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@ ${DEPFLAGS} |
| 241 | ALL_OBJC_CFLAGS=$(ALL_CFLAGS) @GNU_OBJC_CFLAGS@ | 219 | ALL_OBJC_CFLAGS=$(ALL_CFLAGS) @GNU_OBJC_CFLAGS@ |
| 242 | 220 | ||
| 243 | .SUFFIXES: .m | 221 | .SUFFIXES: .m |
| @@ -311,9 +289,7 @@ LIBXT=$(LIBW) $(LIBXSM) | |||
| 311 | #endif /* not USE_X_TOOLKIT */ | 289 | #endif /* not USE_X_TOOLKIT */ |
| 312 | 290 | ||
| 313 | #ifdef HAVE_X11 | 291 | #ifdef HAVE_X11 |
| 314 | /* LD_SWITCH_X_DEFAULT comes after everything else that specifies | 292 | X11_LDFLAGS = LD_SWITCH_X_SITE |
| 315 | options for where to find X libraries, but before those libraries. */ | ||
| 316 | X11_LDFLAGS = LD_SWITCH_X_SITE LD_SWITCH_X_DEFAULT | ||
| 317 | LIBX= $(LIBXMENU) $(X11_LDFLAGS) $(LIBXT) $(LIBTIFF) $(LIBJPEG) $(LIBPNG) $(LIBGIF) $(LIBXPM) -lX11 $(XFT_LIBS) | 293 | LIBX= $(LIBXMENU) $(X11_LDFLAGS) $(LIBXT) $(LIBTIFF) $(LIBJPEG) $(LIBPNG) $(LIBGIF) $(LIBXPM) -lX11 $(XFT_LIBS) |
| 318 | #else /* not HAVE_X11 */ | 294 | #else /* not HAVE_X11 */ |
| 319 | LIBX= $(LIBXMENU) LD_SWITCH_X_SITE | 295 | LIBX= $(LIBXMENU) LD_SWITCH_X_SITE |
| @@ -840,17 +816,12 @@ stamp-oldxmenu: ${OLDXMENU} ../src/$(OLDXMENU) | |||
| 840 | /* Supply an ordering for parallel make. */ | 816 | /* Supply an ordering for parallel make. */ |
| 841 | ../src/$(OLDXMENU): ${OLDXMENU} | 817 | ../src/$(OLDXMENU): ${OLDXMENU} |
| 842 | 818 | ||
| 843 | /* Encode the values of these two macros in Make variables, | ||
| 844 | so we can use $(...) to substitute their values within "...". */ | ||
| 845 | C_SWITCH_X_SYSTEM_1 = C_SWITCH_X_SYSTEM | ||
| 846 | |||
| 847 | #ifdef USE_X_TOOLKIT | 819 | #ifdef USE_X_TOOLKIT |
| 848 | $(OLDXMENU): really-lwlib | 820 | $(OLDXMENU): really-lwlib |
| 849 | 821 | ||
| 850 | really-lwlib: | 822 | really-lwlib: |
| 851 | cd ${lwlibdir}; ${MAKE} ${MFLAGS} \ | 823 | cd ${lwlibdir}; ${MAKE} ${MFLAGS} \ |
| 852 | CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \ | 824 | CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' |
| 853 | "C_SWITCH_X_SYSTEM=$(C_SWITCH_X_SYSTEM_1)" | ||
| 854 | @true /* make -t should not create really-lwlib. */ | 825 | @true /* make -t should not create really-lwlib. */ |
| 855 | .PHONY: really-lwlib | 826 | .PHONY: really-lwlib |
| 856 | #else /* not USE_X_TOOLKIT */ | 827 | #else /* not USE_X_TOOLKIT */ |
| @@ -858,8 +829,7 @@ $(OLDXMENU): really-oldXMenu | |||
| 858 | 829 | ||
| 859 | really-oldXMenu: | 830 | really-oldXMenu: |
| 860 | cd ${oldXMenudir}; ${MAKE} ${MFLAGS} \ | 831 | cd ${oldXMenudir}; ${MAKE} ${MFLAGS} \ |
| 861 | CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \ | 832 | CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' |
| 862 | "C_SWITCH_X_SYSTEM=$(C_SWITCH_X_SYSTEM_1)" | ||
| 863 | @true /* make -t should not create really-oldXMenu. */ | 833 | @true /* make -t should not create really-oldXMenu. */ |
| 864 | .PHONY: really-oldXMenu | 834 | .PHONY: really-oldXMenu |
| 865 | #endif /* not USE_X_TOOLKIT */ | 835 | #endif /* not USE_X_TOOLKIT */ |