[valadoc] doclets/gtkdoclet: Use LD_LIBRARY_PATH. Take in consideration existing environment variables



commit 933a1cfa4ae3ac757062c2b0f8a936abb8152cca
Author: Luca Bruno <lethalman88 gmail com>
Date:   Tue May 4 21:54:35 2010 +0200

    doclets/gtkdoclet: Use LD_LIBRARY_PATH. Take in consideration existing environment variables

 src/doclets/gtkdoc/doclet.vala |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/doclets/gtkdoc/doclet.vala b/src/doclets/gtkdoc/doclet.vala
index e145aba..c79da12 100644
--- a/src/doclets/gtkdoc/doclet.vala
+++ b/src/doclets/gtkdoc/doclet.vala
@@ -247,11 +247,15 @@ public class Gtkdoc.Director : Valadoc.Doclet, Object {
 							  "--types", "%s.types".printf (settings.pkg_name),
 							  "--output-dir", settings.path };
 
-			string[] env = { "CFLAGS=%s".printf (cflags),
-							 "LDFLAGS=%s %s".printf (libs, library) };
-
+			string[] env = { "CFLAGS=%s %s".printf (cflags,
+													Environment.get_variable ("CFLAGS") ?? ""),
+							 "LDFLAGS=%s %s %s".printf (libs, library,
+														Environment.get_variable ("LDFLAGS") ?? ""),
+							 "LD_LIBRARY_PATH=%s:%s".printf (Path.get_dirname (library),
+															 Environment.get_variable ("LD_LIBRARY_PATH") ?? "")};
 			foreach (var evar in Environment.list_variables()) {
-				env += "%s=%s".printf (evar, Environment.get_variable(evar));
+				if (evar != "CFLAGS" && evar != "LDFLAGS" && evar != "LD_LIBRARY_PATH")
+					env += "%s=%s".printf (evar, Environment.get_variable(evar));
 			}
 
 			Process.spawn_sync (settings.path, args, env, SpawnFlags.SEARCH_PATH, null, null, null);



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