[gobject-introspection] Makefile.introspection: pass *FLAGS to scanner



commit 92d9c387687cf71f7113df54f0297fb0633c9afc
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Jan 23 23:33:11 2014 -0500

    Makefile.introspection: pass *FLAGS to scanner
    
    automake provides a few mechanisms for setting the various user-defined
    variables CFLAGS, CPPFLAGS, LDFLAGS that g-ir-scanner passes through to
    the C compiler.
    
     - can be set in the environment
    
     - can be given as a commandline option to configure:
    
         ./configure LDFLAGS=-L/usr/local/lib
    
     - can be given as a commandline option to make:
    
         make LDFLAGS=-L/usr/local/lib
    
    Currently, g-ir-scanner only checks for the variables in the
    environment, whereas the correct value to use will always be the value
    that is available from the Makefile, eg: $(LDFLAGS).
    
    We could pass these variables as new arguments to the scanner, but the
    easiest thing to do is promote them to the environment where the scanner
    can see them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722887

 Makefile.introspection |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/Makefile.introspection b/Makefile.introspection
index b458166..973d9d3 100644
--- a/Makefile.introspection
+++ b/Makefile.introspection
@@ -84,6 +84,8 @@ _gir_silent_compiler = $(_gir_silent_compiler_$(V))
 _gir_silent_compiler_ = $(_gir_silent_compiler_$(_gir_verbosity))
 _gir_silent_compiler_0 = @echo "  GICOMP   $(1)";
 
+_gir_default_scanner_env = CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+
 #
 # Creates a GIR by scanning C headers/sources
 # $(1) - Name of the gir file (output)
@@ -131,7 +133,7 @@ $(if $(or $(findstring --header-only,$($(_gir_name)_SCANNERFLAGS)),
 # needs to be added manually.
 $(1): $$($(_gir_name)_FILES)
        @ $(MKDIR_P) $(dir $(1))
-       $(_gir_silent_scanner_prefix) $(INTROSPECTION_SCANNER_ENV) $(INTROSPECTION_SCANNER) 
$(_gir_silent_scanner_opts) \
+       $(_gir_silent_scanner_prefix) $(_gir_default_scanner_env) $(INTROSPECTION_SCANNER_ENV) 
$(INTROSPECTION_SCANNER) $(_gir_silent_scanner_opts) \
        $(INTROSPECTION_SCANNER_ARGS) \
          --namespace=$(_gir_namespace) \
          --nsversion=$(_gir_version) \


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