comparison src/Makefile.in @ 108129:e272dbe64cda

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.
author Dan Nicolaescu <dann@ics.uci.edu>
date Mon, 26 Apr 2010 22:24:53 -0700
parents 1e7aaadc50e8
children d5c67777ae39
comparison
equal deleted inserted replaced
108128:1e7aaadc50e8 108129:e272dbe64cda
75 LIBPNG=@LIBPNG@ 75 LIBPNG=@LIBPNG@
76 LIBGIF=@LIBGIF@ 76 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@
88 83
89 GCONF_CFLAGS = @GCONF_CFLAGS@ 84 GCONF_CFLAGS = @GCONF_CFLAGS@
127 #include "config.h" 122 #include "config.h"
128 123
129 #ifdef AUTO_DEPEND 124 #ifdef AUTO_DEPEND
130 DEPFLAGS = -MMD -MF deps/$*.d 125 DEPFLAGS = -MMD -MF deps/$*.d
131 #endif 126 #endif
132
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 127
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
141 #endif 131 #endif
194 #ifndef LD_SWITCH_MACHINE 184 #ifndef LD_SWITCH_MACHINE
195 #define LD_SWITCH_MACHINE 185 #define LD_SWITCH_MACHINE
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
206
207 #ifndef LD_SWITCH_X_DEFAULT
208 #define LD_SWITCH_X_DEFAULT
209 #endif 191 #endif
210 192
211 STARTFILES = START_FILES 193 STARTFILES = START_FILES
212 194
213 195
229 for use in Emacs. 211 for use in Emacs.
230 212
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
244 .c.o: 222 .c.o:
245 #ifdef AUTO_DEPEND 223 #ifdef AUTO_DEPEND
309 287
310 LIBXT=$(LIBW) $(LIBXSM) 288 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
320 #endif /* not HAVE_X11 */ 296 #endif /* not HAVE_X11 */
321 #endif /* not HAVE_X_WINDOWS */ 297 #endif /* not HAVE_X_WINDOWS */
838 stamp-oldxmenu: ${OLDXMENU} ../src/$(OLDXMENU) 814 stamp-oldxmenu: ${OLDXMENU} ../src/$(OLDXMENU)
839 touch stamp-oldxmenu 815 touch stamp-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 */
857 $(OLDXMENU): really-oldXMenu 828 $(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 */
866 #else /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! USE_GTK) */ 836 #else /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! USE_GTK) */
867 837