[PATCH app,driver,libs 0/43] Replace deprecated Automake INCLUDES variable

Gaetan Nadon gaetan.nadon at videotron.ca
Fri Mar 19 11:42:17 PDT 2010


Rather than posting 43 patches, I'll summarize the changes and include
the diffs here.

Automake produces a warning about the INCLUDES variable being
deprecated. There were only 43 out of 240 modules still using it. It has
been replaced with AM_CPPFLAGS. In some modules, both INCLUDES and
AM_CPPFLAGS were used. 

Further more, there isn't a good separation between pre-processor and
compiler flags. The lint tool only accepts pre-processor flags, so the
lint target had to be reworked. Separation is also required to allow
user to override with CFLAGS and CPPFLAGS on the configure invocation.

In addition of replacing/merging INCLUDES and AM_CPPFLAGS, compiler and
pre-processor flags have been regrouped in AM_CFLAGS and AM_CPPFLAGS
respectively. The order of -I has been preserved the INCLUDES variable
taking precedence over AM_CPPFLAGS. Attention has been given so as not
alter the final gcc command emitted. One exception is that Automake does
not pass pre-processor flags when linking a library which were
previously lumped together with C flags. 

For apps and drivers, a couple of patches cover all cases:


        ****************************   app-bdftopcf   *************
        ~/xorg/src ~/xorg/src
        diff --git a/Makefile.am b/Makefile.am
        index 7b616ed..b8e112d 100644
        --- a/Makefile.am
        +++ b/Makefile.am
        @@ -21,8 +21,9 @@
         
         bin_PROGRAMS = bdftopcf
         
        -bdftopcf_CFLAGS = $(CWARNFLAGS) @BDFTOPCF_CFLAGS@
        -bdftopcf_LDADD  = @BDFTOPCF_LIBS@
        +bdftopcf_CPPFLAGS = $(BDFTOPCF_CFLAGS)
        +bdftopcf_CFLAGS = $(CWARNFLAGS)
        +bdftopcf_LDADD  = $(BDFTOPCF_LIBS)
         
         bdftopcf_SOURCES = bdftopcf.c
         
        @@ -71,8 +72,8 @@ ChangeLog:
         dist-hook: ChangeLog INSTALL
         
         if LINT
        -ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
        -                $(AM_CPPFLAGS) $(CPPFLAGS) $(bdftopcf_CFLAGS)
        +ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) \
        +                $(AM_CPPFLAGS) $(CPPFLAGS) $(bdftopcf_CPPFLAGS)
         
         lint:
         	$(LINT) $(ALL_LINT_FLAGS) $(bdftopcf_SOURCES)
        ~/xorg/src
        
        ****************************   app-iceauth   *************
        ~/xorg/src ~/xorg/src
        diff --git a/Makefile.am b/Makefile.am
        index 84e3b23..d23af30 100644
        --- a/Makefile.am
        +++ b/Makefile.am
        @@ -21,7 +21,8 @@
         
         bin_PROGRAMS = iceauth
         
        -AM_CFLAGS = $(CWARNFLAGS) $(ICEAUTH_CFLAGS)
        +AM_CPPFLAGS = $(ICEAUTH_CFLAGS)
        +AM_CFLAGS = $(CWARNFLAGS)
         iceauth_LDADD = $(ICEAUTH_LIBS)
         
         iceauth_SOURCES =	\
        @@ -77,8 +78,8 @@ SUFFIXES = .$(APP_MAN_SUFFIX) .man
         	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
         
         if LINT
        -ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
        -                $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
        +ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) \
        +                $(AM_CPPFLAGS) $(CPPFLAGS)
         lint:
         	$(LINT) $(ALL_LINT_FLAGS) $(iceauth_SOURCES)
         endif LINT
        ~/xorg/src


For lib patches that are different than the one above.
This one has per-target flags mixed-in.


        ****************************   lib-libXvMC   *************
        ~/xorg/src ~/xorg/src
        diff --git a/src/Makefile.am b/src/Makefile.am
        index 741e7c5..9551ca1 100644
        --- a/src/Makefile.am
        +++ b/src/Makefile.am
        @@ -7,28 +7,34 @@ libXvMC_la_SOURCES = \
         libXvMCW_la_SOURCES = \
         	XvMCWrapper.c
         
        -AM_CFLAGS = $(CWARNFLAGS) @XVMC_CFLAGS@
        -AM_CPPFLAGS = -I$(top_srcdir)/include @MALLOC_ZERO_CFLAGS@
        +AM_CPPFLAGS = 			\
        +	-I$(top_srcdir)/include \
        +	$(MALLOC_ZERO_CFLAGS)	\
        +	$(XVMC_CFLAGS)
         
        -libXvMC_la_LIBADD = @XVMC_LIBS@
        +AM_CFLAGS = $(CWARNFLAGS)
        +
        +libXvMC_la_LIBADD = $(XVMC_LIBS)
        +libXvMC_la_CPPFLAGS = $(AM_CPPFLAGS)
         libXvMC_la_CFLAGS = $(AM_CFLAGS)
         
        -libXvMCW_la_LIBADD = @XVMC_LIBS@
        -libXvMCW_la_CFLAGS =				\
        -	$(AM_CFLAGS)				\
        -	-DXVMC_CONFIGDIR=$(sysconfdir)/X11		\
        +libXvMCW_la_LIBADD = $(XVMC_LIBS)
        +libXvMCW_la_CPPFLAGS =				\
        +	$(AM_CPPFLAGS)				\
        +	-DXVMC_CONFIGDIR=$(sysconfdir)/X11	\
         	-DXVMC_SOVERSION=\".1.0\"		\
         	-DXV_SOVERSION=\".1.0\"
        +libXvMCW_la_CFLAGS = $(AM_CFLAGS)
         
         libXvMC_la_LDFLAGS = -version-number 1:0:0 -no-undefined
         libXvMCW_la_LDFLAGS = -version-number 1:0:0 -no-undefined
         
         
         if LINT
        -ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
        +ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) \
                         $(AM_CPPFLAGS) $(CPPFLAGS)
         
         lint:
        -	$(LINT) $(ALL_LINT_FLAGS) $(libXvMC_la_SOURCES) $(XVMC_LIBS)
        -	$(LINT) $(ALL_LINT_FLAGS) $(libXvMCW_la_CFLAGS) $(libXvMCW_la_SOURCES) $(XVMC_LIBS)
        +	$(LINT) $(ALL_LINT_FLAGS) $(libXvMC_la_CPPFLAGS)  $(libXvMC_la_SOURCES) $(XVMC_LIBS)
        +	$(LINT) $(ALL_LINT_FLAGS) $(libXvMCW_la_CPPFLAGS) $(libXvMCW_la_SOURCES) $(XVMC_LIBS)
         endif LINT
        ~/xorg/src


Another example:

        ****************************   lib-libXt   *************
        ~/xorg/src ~/xorg/src
        diff --git a/src/Makefile.am b/src/Makefile.am
        index a43fb22..84dc195 100644
        --- a/src/Makefile.am
        +++ b/src/Makefile.am
        @@ -6,11 +6,18 @@ CLEANFILES = $(BUILT_SOURCES)
         SRCH_DEFINES = -DXFILESEARCHPATHDEFAULT=\"$(XFILESEARCHPATHDEFAULT)\"
         ERRORDB_DEFINES = -DERRORDB=\"$(libdir)/X11/XtErrorDB\"
         
        -AM_CFLAGS = $(CWARNFLAGS) $(XT_CFLAGS) $(SRCH_DEFINES) $(ERRORDB_DEFINES) \
        +AM_CPPFLAGS = 				\
        +	-I$(top_srcdir)/include/	\
        +	-I$(top_srcdir)/include/X11	\
        +	-I$(top_builddir)/include	\
        +	-I$(top_builddir)/include/X11	\
        +	$(XT_CFLAGS) 			\
        +	$(SRCH_DEFINES) 		\
        +	$(ERRORDB_DEFINES) 		\
         	$(XTMALLOC_ZERO_CFLAGS)
         
        -INCLUDES = -I$(top_srcdir)/include/ -I$(top_srcdir)/include/X11 \
        -	   -I$(top_builddir)/include -I$(top_builddir)/include/X11
        +AM_CFLAGS =		\
        +	$(CWARNFLAGS)
         
         nodist_libXt_la_SOURCES = StringDefs.c
         
        ~/xorg/src










-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100319/7efaffed/attachment.htm>


More information about the xorg-devel mailing list