diff scripts/pkg/pkg.m @ 7111:9c73ef1819c7

[project @ 2007-11-06 22:47:35 by jwe]
author jwe
date Tue, 06 Nov 2007 22:47:35 +0000
parents 66c6cab344f7
children 10b8361ff085
line wrap: on
line diff
--- a/scripts/pkg/pkg.m	Tue Nov 06 22:36:22 2007 +0000
+++ b/scripts/pkg/pkg.m	Tue Nov 06 22:47:35 2007 +0000
@@ -1019,12 +1019,21 @@
     src = fullfile (packdir, "src");
     ## configure
     if (exist (fullfile (src, "configure"), "file"))
+      flags = "";
+      if (isempty (getenv ("CC")))
+        flags = strcat (flags, " CC=\"", octave_config_info ("CC"), "\"");
+      endif
+      if (isempty (getenv ("CXX")))
+        flags = strcat (flags, " CXX=\"", octave_config_info ("CXX"), "\"");
+      endif
+      if (isempty (getenv ("AR")))
+        flags = strcat (flags, " AR=\"", octave_config_info ("AR"), "\"");
+      endif
+      if (isempty (getenv ("RANLIB")))
+        flags = strcat (flags, " RANLIB=\"", octave_config_info ("RANLIB"), "\"");
+      endif
       [status, output] = shell (strcat ("cd ", src, "; ./configure --prefix=\"",
-					 desc.dir, "\"",
-					 " CC=", octave_config_info ("CC"),
-					 " CXX=", octave_config_info ("CXX"),
-					 " AR=", octave_config_info ("AR"),
-					 " RANLIB=", octave_config_info ("RANLIB")));
+                                        desc.dir, "\"", flags));
       if (status != 0)
 	rm_rf (desc.dir);
 	error ("the configure script returned the following error: %s", output);