aboutsummaryrefslogtreecommitdiff
path: root/install-win32/nsitran.pl
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2007-03-07 07:08:49 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2007-03-07 07:08:49 +0000
commit0039dd40464ea8544022abb32e220224ab71d6e5 (patch)
treed58e23208cccfbd533be63864442bc86352d34d3 /install-win32/nsitran.pl
parentForgot to svn add buildinstaller before last commit. (diff)
downloadopenvpn-0039dd40464ea8544022abb32e220224ab71d6e5.tar.xz
Cleaned up Windows build scripts.
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1763 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to '')
-rw-r--r--install-win32/nsitran.pl13
1 files changed, 12 insertions, 1 deletions
diff --git a/install-win32/nsitran.pl b/install-win32/nsitran.pl
index 7c04e40..49512b4 100644
--- a/install-win32/nsitran.pl
+++ b/install-win32/nsitran.pl
@@ -1,5 +1,16 @@
+# This is a simple language translator. It translates
+# the NSIS format of version.nsi to either C, sh, or Javascript.
+
($mode) = @ARGV;
+$comment = "This file was automatically generated by nsitran.pl";
+
+print "// $comment\n" if ($mode eq "c");
+print "# $comment\n" if ($mode eq "sh");
+print "// $comment\n" if ($mode eq "js");
+
+print "\n";
+
while (<STDIN>) {
chomp;
if (/^\s*$/) {
@@ -10,7 +21,7 @@ while (<STDIN>) {
print "//$1\n" if ($mode eq "js");
} elsif (/^!define\s+(\w+)\s+(.+)$/) {
print "#define $1 $2\n" if ($mode eq "c");
- print "export $1=$2\n" if ($mode eq "sh");
+ print "[ -z \"\$$1\" ] && export $1=$2\n[ \"\$$1\" = \"null\" ] && unset $1\n" if ($mode eq "sh");
print "var $1=$2;\n" if ($mode eq "js");
}
}