[glib] build: fix dtrace-related warnings



commit fd5b1939bddf4b935c7e8dea21496483d15c4ece
Author: Dan Winship <danw gnome org>
Date:   Thu Feb 7 10:02:55 2013 -0500

    build: fix dtrace-related warnings
    
    Fix the warnings when compiling and linking the probes files by
    calling dtrace with all the -W flags removed from CFLAGS (since dtrace
    generates bad C code), and with CC set to "libtool --mode=compile ..."
    (so that it will output a proper .lo file and libtool won't warn when
    linking it into the .la).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693335

 glib/Makefile.am    |   15 ++++++++++-----
 gobject/Makefile.am |   15 ++++++++++-----
 2 files changed, 20 insertions(+), 10 deletions(-)
---
diff --git a/glib/Makefile.am b/glib/Makefile.am
index 12463fa..1330755 100644
--- a/glib/Makefile.am
+++ b/glib/Makefile.am
@@ -360,14 +360,19 @@ libglib_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
 INSTALL_PROGS=
 
 if ENABLE_DTRACE
-glib_probes.h: glib_probes.d Makefile
+DTCOMPILE = $(patsubst -W%,,$(LTCOMPILE))
+DTCFLAGS = $(patsubst -W%,,$(CFLAGS))
+
+glib_probes.h: glib_probes.d
        $(AM_V_GEN) $(DTRACE) -C -h -s $< -o $  tmp
        @$(SED) -e "s,define STAP_HAS_SEMAPHORES 1,undef STAP_HAS_SEMAPHORES," < $  tmp > $@ && rm -f $  tmp
-glib_probes.o: glib_probes.d Makefile
-       $(AM_V_GEN) $(DTRACE) -G -s $< -o $@
-BUILT_SOURCES += glib_probes.h glib_probes.o
+
+glib_probes.lo: glib_probes.d
+       $(AM_V_GEN) env CC="$(DTCOMPILE)" CFLAGS="$(DTCFLAGS)" $(DTRACE) -G -s $< -o $@
+
+BUILT_SOURCES += glib_probes.h glib_probes.lo
 CLEANFILES += glib_probes.h glib_probes.h.tmp
-libglib_2_0_la_LIBADD += glib_probes.o
+libglib_2_0_la_LIBADD += glib_probes.lo
 endif
 
 if ENABLE_SYSTEMTAP
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index f899e47..1509616 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -109,14 +109,19 @@ gobject_c_sources = \
        gvaluetypes.c
 
 if ENABLE_DTRACE
-gobject_probes.h: gobject_probes.d Makefile
+DTCOMPILE = $(patsubst -W%,,$(LTCOMPILE))
+DTCFLAGS = $(patsubst -W%,,$(CFLAGS))
+
+gobject_probes.h: gobject_probes.d
        $(AM_V_GEN) $(DTRACE) -C -h -s $< -o $  tmp
        @$(SED) -e "s,define STAP_HAS_SEMAPHORES 1,undef STAP_HAS_SEMAPHORES," < $  tmp > $@ && rm -f $  tmp
-gobject_probes.o: gobject_probes.d Makefile
-       $(AM_V_GEN) $(DTRACE) -G -s $< -o $@
-BUILT_SOURCES += gobject_probes.h gobject_probes.o
+
+gobject_probes.lo: gobject_probes.d
+       $(AM_V_GEN) env CC="$(DTCOMPILE)" CFLAGS="$(DTCFLAGS)" $(DTRACE) -G -s $< -o $@
+
+BUILT_SOURCES += gobject_probes.h gobject_probes.lo
 CLEANFILES += gobject_probes.h
-libgobject_2_0_la_LIBADD += gobject_probes.o
+libgobject_2_0_la_LIBADD += gobject_probes.lo
 endif
 
 if ENABLE_SYSTEMTAP


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]