BSDBuild-SVN | 3 Jun 11:59
Favicon

BSDBuild: r802 - in trunk: . BSDBuild

Author: vedge
Date: 2009-06-03 06:59:32 -0300 (Wed, 03 Jun 2009)
New Revision: 802

Modified:
   trunk/BSDBuild/Core.pm
   trunk/build.proj.mk
   trunk/mkconfigure.pl
Log:
add explicit --output-lua argument to mkconfigure

Modified: trunk/BSDBuild/Core.pm
===================================================================
--- trunk/BSDBuild/Core.pm	2009-06-03 09:44:33 UTC (rev 801)
+++ trunk/BSDBuild/Core.pm	2009-06-03 09:59:32 UTC (rev 802)
@@ -23,6 +23,7 @@
 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 # USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE..

+our $OutputLUA = 'configure.lua';
 our $LUA = undef;
 our $EmulOS = undef;
 our $EmulOSRel = undef;
@@ -278,7 +279,7 @@
 	foreach my $var (@_) {
 		print << "EOF";
 echo "$var=\$$var" >>Makefile.config
-echo "mdefs[\\"$var\\"] = \\"\$$var\\"" >>configure.lua
+echo "mdefs[\\"$var\\"] = \\"\$$var\\"" >>$OutputLUA
 EOF
 	}
 }
@@ -289,7 +290,7 @@
 		my $include = 'config/'.lc($var).'.h';
 		print << "EOF";
 echo "#undef $var" >$include
-echo "hdefs[\\"$var\\"] = nil" >>configure.lua
+echo "hdefs[\\"$var\\"] = nil" >>$OutputLUA
 EOF
 	}
 }
@@ -302,7 +303,7 @@
 echo "#ifndef $var" > $include
 echo "#define $var \\"\$$var\\"" >> $include
 echo "#endif" >> $include
-echo "hdefs[\\"$var\\"] = \\"\$$var\\"" >>configure.lua
+echo "hdefs[\\"$var\\"] = \\"\$$var\\"" >>$OutputLUA
 EOF
 	}
 }
@@ -758,7 +759,7 @@
     $^W = 0;

     @ISA = qw(Exporter);
-    @EXPORT = qw($LUA $EmulOS $EmulOSRel $EmulEnv %TESTS %DESCR MkExecOutput MkExecOutputUnique
MkFileOutput Which MkFail MKSave TryCompile MkCompileC MkCompileCXX MkCompileAndRunC
MkCompileAndRunCXX TryCompileFlagsC TryCompileFlagsCXX Log MkDefine MkAppend MkIf MkElif MkElse
MkEndif MkSaveMK MkSaveDefine MkSaveUndef MkPrint MkPrintN PmComment PmIf PmEndif PmIfHDefined
PmDefineBool PmDefineString PmIncludePath PmLibPath PmBuildFlag PmLink DetectHeaderC
BeginTestHeaders EndTestHeaders);
+    @EXPORT = qw($OutputLUA $LUA $EmulOS $EmulOSRel $EmulEnv %TESTS %DESCR MkExecOutput
MkExecOutputUnique MkFileOutput Which MkFail MKSave TryCompile MkCompileC MkCompileCXX
MkCompileAndRunC MkCompileAndRunCXX TryCompileFlagsC TryCompileFlagsCXX Log MkDefine MkAppend
MkIf MkElif MkElse MkEndif MkSaveMK MkSaveDefine MkSaveUndef MkPrint MkPrintN PmComment PmIf PmEndif
PmIfHDefined PmDefineBool PmDefineString PmIncludePath PmLibPath PmBuildFlag PmLink
DetectHeaderC BeginTestHeaders EndTestHeaders);
 }

 ;1

Modified: trunk/build.proj.mk
===================================================================
--- trunk/build.proj.mk	2009-06-03 09:44:33 UTC (rev 801)
+++ trunk/build.proj.mk	2009-06-03 09:59:32 UTC (rev 802)
@@ -88,10 +88,10 @@
 			rm -fR "${PROJCONFIGDIR}"; \
 		fi; \
 		echo "mkconfigure --emul-env=$$_tgtproj --emul-os=$$_tgtos \
-		    > configure.tmp"; \
+		    --output-lua=${TOP}/configure.lua > configure.tmp"; \
 		cat configure.in | \
 		    mkconfigure --emul-env=$$_tgtproj --emul-os=$$_tgtos \
-		    > configure.tmp; \
+		    --output-lua=${TOP}/configure.lua > configure.tmp; \
 		if [ $$? != 0 ]; then \
 			echo "mkconfigure failed"; \
 			rm -fR configure.tmp ${TOP}/configure.lua; \

Modified: trunk/mkconfigure.pl
===================================================================
--- trunk/mkconfigure.pl	2009-06-03 09:44:33 UTC (rev 801)
+++ trunk/mkconfigure.pl	2009-06-03 09:59:32 UTC (rev 802)
@@ -248,6 +248,11 @@
 BEGIN
 {
 	$INSTALLDIR = '%PREFIX%/share/bsdbuild';
+	
+	GetOptions("emul-os=s" =>	\$EmulOS,
+	           "emul-osrel=s" =>	\$EmulOSRel,
+	           "emul-env=s" =>	\$EmulEnv,
+	           "output-lua=s" =>	\$OutputLUA);

 	print << 'EOF';
 #!/bin/sh
@@ -262,7 +267,7 @@
 #
 EOF

-	open($LUA, '>configure.lua');
+	open($LUA, ">$OutputLUA");
 	print { $LUA } << 'EOF';
 -- Public domain
 --
@@ -279,7 +284,7 @@
 EOF

 	print << 'EOF';
-# Copyright (c) 2001-2008 Hypertriton, Inc. <http://hypertriton.com/>
+# Copyright (c) 2001-2009 Hypertriton, Inc. <http://hypertriton.com/>
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -457,11 +462,6 @@
 fi

 EOF
-	
-	GetOptions("emul-os=s" =>	\$EmulOS,
-	           "emul-osrel=s" =>	\$EmulOSRel,
-	           "emul-env=s" =>	\$EmulEnv);
-
 	if ($EmulOS || $EmulEnv) {
 		print STDERR "Emulating OS: $EmulOS\n";
 		print STDERR "Emulating OS Release: \"$EmulOSRel\"\n";

Gmane