summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odk/config/cfgWin.js138
-rwxr-xr-x[-rw-r--r--]odk/config/configure.pl60
-rw-r--r--odk/config/setsdkenv_unix.sh.in24
-rw-r--r--[-rwxr-xr-x]odk/config/setsdkenv_windows.template28
-rw-r--r--odk/docs/install.html22
-rw-r--r--odk/settings/std.mk2
6 files changed, 270 insertions, 4 deletions
diff --git a/odk/config/cfgWin.js b/odk/config/cfgWin.js
index 99dca7f3bc3a..070210325379 100644
--- a/odk/config/cfgWin.js
+++ b/odk/config/cfgWin.js
@@ -57,6 +57,8 @@ var oo_sdk_ure_home=office_home + "\\URE";
var oo_sdk_make_home=getMakeHome();
var oo_sdk_zip_home=getZipHome();
+var oo_sdk_cat_home=getCatHome();
+var oo_sdk_sed_home=getSedHome();
var oo_sdk_manifest_used="";
var oo_sdk_windowssdk="";
var oo_sdk_cpp_home=getCppHome();
@@ -317,6 +319,110 @@ function getZipHome()
}
}
+function getCatHome()
+{
+ var sSuggestedHome = WshSysEnv("OO_SDK_CAT_HOME");
+
+ while(true)
+ {
+ stdout.Write("\n Enter a cat (2.0 or higher) tools directory [" +
+ sSuggestedHome + "]:");
+ var sHome = stdin.ReadLine();
+ if (sHome.length == 0)
+ {
+ //No user input, use default.
+ if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
+ {
+ stdout.WriteLine("\n Error: Could not find directory \"" +
+ sSuggestedHome + "\". cat is required, please " +
+ "specify a cat tools directory." +
+ "\nYou can get cat from " +
+ "http://sourceforge.net/projects/unxutils/files/latest/download");
+ sSuggestedHome = "";
+ continue;
+ }
+ sHome = sSuggestedHome;
+ }
+ else
+ {
+ //validate the user input
+ if ( ! aFileSystemObject.FolderExists(sHome))
+ {
+ stdout.WriteLine("\n Error: The directory \"" + sHome +
+ "\" does not exist. cat is required, please " +
+ "specify a cat tools directory." +
+ "\nYou can get cat from " +
+ "http://sourceforge.net/projects/unxutils/files/latest/download");
+ continue;
+ }
+ }
+ //Check for the make executable
+ var sCatPath = sHome + "\\cat.exe";
+ if (! aFileSystemObject.FileExists(sCatPath))
+ {
+ stdout.WriteLine("\n Error: Could not find \"" + sCatPath +
+ "\". cat is required, please specify a cat tools " +
+ "directory." +
+ "\nYou can get cat from " +
+ "http://sourceforge.net/projects/unxutils/files/latest/download");
+ continue;
+ }
+ return sHome;
+ }
+}
+
+function getSedHome()
+{
+ var sSuggestedHome = WshSysEnv("OO_SDK_SED_HOME");
+
+ while(true)
+ {
+ stdout.Write("\n Enter a sed (3.02 or higher) tools directory [" +
+ sSuggestedHome + "]:");
+ var sHome = stdin.ReadLine();
+ if (sHome.length == 0)
+ {
+ //No user input, use default.
+ if ( ! aFileSystemObject.FolderExists(sSuggestedHome))
+ {
+ stdout.WriteLine("\n Error: Could not find directory \"" +
+ sSuggestedHome + "\". sed is required, please " +
+ "specify a sed tools directory." +
+ "\nYou can get sed from " +
+ "http://sourceforge.net/projects/unxutils/files/latest/download");
+ sSuggestedHome = "";
+ continue;
+ }
+ sHome = sSuggestedHome;
+ }
+ else
+ {
+ //validate the user input
+ if ( ! aFileSystemObject.FolderExists(sHome))
+ {
+ stdout.WriteLine("\n Error: The directory \"" + sHome +
+ "\" does not exist. sed is required, please " +
+ "specify a sed tools directory." +
+ "\nYou can get sed from " +
+ "http://sourceforge.net/projects/unxutils/files/latest/download");
+ continue;
+ }
+ }
+ //Check for the make executable
+ var sSedPath = sHome + "\\sed.exe";
+ if (! aFileSystemObject.FileExists(sSedPath))
+ {
+ stdout.WriteLine("\n Error: Could not find \"" + sSedPath +
+ "\". sed is required, please specify a sed tools " +
+ "directory." +
+ "\nYou can get sed from " +
+ "http://sourceforge.net/projects/unxutils/files/latest/download");
+ continue;
+ }
+ return sHome;
+ }
+}
+
function getCppHome()
{
var sSuggestedHome = WshSysEnv("OO_SDK_CPP_HOME");
@@ -760,6 +866,14 @@ function writeBatFile(fdir, file)
"REM Example: set OO_SDK_ZIP_HOME=D:\\infozip\\bin\n" +
"set OO_SDK_ZIP_HOME=" + oo_sdk_zip_home +
"\n\n" +
+ "REM Directory of the cat tool.\n" +
+ "REM Example: set OO_SDK_CAT_HOME=C:\\UnxUtils\\usr\\local\\wbin\n" +
+ "set OO_SDK_CAT_HOME=" + oo_sdk_cat_home +
+ "\n\n" +
+ "REM Directory of the sed tool.\n" +
+ "REM Example: set OO_SDK_SED_HOME=C:\\UnxUtils\\usr\\local\\wbin\n" +
+ "set OO_SDK_SED_HOME=" + oo_sdk_sed_home +
+ "\n\n" +
"REM Directory of the C++ compiler.\n" +
"REM Example:set OO_SDK_CPP_HOME=C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\bin\n" +
"set OO_SDK_CPP_HOME=" + oo_sdk_cpp_home +
@@ -809,6 +923,18 @@ function writeBatFile(fdir, file)
" goto :error\n" +
" )\n" +
"\n" +
+ "REM Check installation path for the cat tool.\n" +
+ "if not defined OO_SDK_CAT_HOME (\n" +
+ " echo Error: the variable OO_SDK_CAT_HOME is missing!\n" +
+ " goto :error\n" +
+ " )\n" +
+ "\n" +
+ "REM Check installation path for the sed tool.\n" +
+ "if not defined OO_SDK_SED_HOME (\n" +
+ " echo Error: the variable OO_SDK_SED_HOME is missing!\n" +
+ " goto :error\n" +
+ " )\n" +
+ "\n" +
"REM Set library path. \n" +
"set LIB=%OO_SDK_HOME%\\lib;%LIB%\n" +
"if defined CPP_WINDOWS_SDK (\n" +
@@ -856,8 +982,14 @@ function writeBatFile(fdir, file)
"REM Add directory of the command make to the path, if necessary.\n" +
"if defined OO_SDK_MAKE_HOME set PATH=%OO_SDK_MAKE_HOME%;%PATH%\n" +
"\n" +
- "REM Add directory of the zip tool to the path, if necessary.\n" +
- "if defined OO_SDK_ZIP_HOME set PATH=%OO_SDK_ZIP_HOME%;%PATH%\n" +
+ "REM Add directory of the zip tool to the path, if necessary.\n" +
+ "if defined OO_SDK_ZIP_HOME set PATH=%OO_SDK_ZIP_HOME%;%PATH%\n" +
+ "\n" +
+ "REM Add directory of the cat tool to the path, if necessary.\n" +
+ "if defined OO_SDK_CAT_HOME set PATH=%OO_SDK_CAT_HOME%;%PATH%\n" +
+ "\n" +
+ "REM Add directory of the sed tool to the path, if necessary.\n" +
+ "if defined OO_SDK_SED_HOME set PATH=%OO_SDK_SED_HOME%;%PATH%\n" +
"\n" +
"REM Add directory of the C++ compiler to the path, if necessary.\n" +
"if defined OO_SDK_CPP_HOME set PATH=%OO_SDK_CPP_HOME%;%PATH%\n" +
@@ -889,6 +1021,8 @@ function writeBatFile(fdir, file)
"echo * URE = %OO_SDK_URE_HOME%\n" +
"echo * Make = %OO_SDK_MAKE_HOME%\n" +
"echo * Zip = %OO_SDK_ZIP_HOME%\n" +
+ "echo * cat = %OO_SDK_CAT_HOME%\n" +
+ "echo * sed = %OO_SDK_SED_HOME%\n" +
"echo * C++ Compiler = %OO_SDK_CPP_HOME%\n" +
"echo * C# and VB.NET compilers = %OO_SDK_CLI_HOME%\n" +
"echo * Java = %OO_SDK_JAVA_HOME%\n" +
diff --git a/odk/config/configure.pl b/odk/config/configure.pl
index 9a460c89066b..04bfb4bfb076 100644..100755
--- a/odk/config/configure.pl
+++ b/odk/config/configure.pl
@@ -64,6 +64,16 @@ $main::OO_SDK_ZIP_HOME = "";
$main::OO_SDK_ZIP_HOME_SUGGESTION = searchprog("zip");
$main::zipVersion = "2.3";
+$main::OO_SDK_CAT_HOME = "";
+$main::OO_SDK_CAT_HOME_SUGGESTION = searchprog("cat");
+# TODO cat version
+# $main::catVersion = "";
+
+$main::OO_SDK_SED_HOME = "";
+$main::OO_SDK_SED_HOME_SUGGESTION = searchprog("sed");
+# TODO sed version
+# $main::sedVersion = "";
+
$main::OO_SDK_CPP_HOME = "";
$main::cppName = "gcc";
$main::cppVersion = "4.0.1";
@@ -305,6 +315,54 @@ while ( (!$main::correctVersion) &&
}
}
+# prepare cat path
+$main::correctVersion = 0;
+while ( (!$main::correctVersion) &&
+ ((! -d "$main::OO_SDK_CAT_HOME" ) ||
+ ((-d "$main::OO_SDK_CAT_HOME") && (! -e "$main::OO_SDK_CAT_HOME/cat"))) )
+{
+ print " Enter cat tool directory [$main::OO_SDK_CAT_HOME_SUGGESTION]: ";
+ $main::OO_SDK_CAT_HOME = readStdIn();
+ chop($main::OO_SDK_CAT_HOME);
+ if ( $main::OO_SDK_CAT_HOME eq "" )
+ {
+ $main::OO_SDK_CAT_HOME = $main::OO_SDK_CAT_HOME_SUGGESTION;
+ }
+ if ( (! -d "$main::OO_SDK_CAT_HOME") ||
+ ((-d "$main::OO_SDK_CAT_HOME") && (! -e "$main::OO_SDK_CAT_HOME/cat")) )
+ {
+ $main::OO_SDK_CAT_HOME = "";
+ print " Error: cat tool is required, please specify a cat tool directory.\n";
+ }
+ # else ...
+ # TODO check version
+ # NOTE: only Linux cat understands --version
+}
+
+# prepare sed path
+$main::correctVersion = 0;
+while ( (!$main::correctVersion) &&
+ ((! -d "$main::OO_SDK_SED_HOME" ) ||
+ ((-d "$main::OO_SDK_SED_HOME") && (! -e "$main::OO_SDK_SED_HOME/sed"))) )
+{
+ print " Enter sed tool directory [$main::OO_SDK_SED_HOME_SUGGESTION]: ";
+ $main::OO_SDK_SED_HOME = readStdIn();
+ chop($main::OO_SDK_SED_HOME);
+ if ( $main::OO_SDK_SED_HOME eq "" )
+ {
+ $main::OO_SDK_SED_HOME = $main::OO_SDK_SED_HOME_SUGGESTION;
+ }
+ if ( (! -d "$main::OO_SDK_SED_HOME") ||
+ ((-d "$main::OO_SDK_SED_HOME") && (! -e "$main::OO_SDK_SED_HOME/sed")) )
+ {
+ $main::OO_SDK_SED_HOME = "";
+ print " Error: sed tool is required, please specify a sed tool directory.\n";
+ }
+ # else ...
+ # TODO check version
+ # NOTE: only Linux sed understands --version
+}
+
# prepare C++ compiler path
$main::correctVersion = 0;
while ( (!$main::correctVersion) &&
@@ -789,6 +847,8 @@ sub prepareScriptFile()
$_ =~ s#\@OO_SDK_URE_HOME\@#$main::OO_SDK_URE_HOME#go;
$_ =~ s#\@OO_SDK_MAKE_HOME\@#$main::OO_SDK_MAKE_HOME#go;
$_ =~ s#\@OO_SDK_ZIP_HOME\@#$main::OO_SDK_ZIP_HOME#go;
+ $_ =~ s#\@OO_SDK_CAT_HOME\@#$main::OO_SDK_CAT_HOME#go;
+ $_ =~ s#\@OO_SDK_SED_HOME\@#$main::OO_SDK_SED_HOME#go;
$_ =~ s#\@OO_SDK_CPP_HOME\@#$main::OO_SDK_CPP_HOME#go;
$_ =~ s#\@OO_SDK_CC_55_OR_HIGHER\@#$main::OO_SDK_CC_55_OR_HIGHER#go;
$_ =~ s#\@OO_SDK_JAVA_HOME\@#$main::OO_SDK_JAVA_HOME#go;
diff --git a/odk/config/setsdkenv_unix.sh.in b/odk/config/setsdkenv_unix.sh.in
index b0dc53664f79..bffab3d0b2d4 100644
--- a/odk/config/setsdkenv_unix.sh.in
+++ b/odk/config/setsdkenv_unix.sh.in
@@ -46,6 +46,14 @@ OO_SDK_MAKE_HOME=@OO_SDK_MAKE_HOME@
# Example: OO_SDK_ZIP_HOME=/usr/bin
OO_SDK_ZIP_HOME=@OO_SDK_ZIP_HOME@
+# Directory of the cat command.
+# Example: OO_SDK_CAT_HOME=/usr/bin
+OO_SDK_CAT_HOME=@OO_SDK_CAT_HOME@
+
+# Directory of the sed command.
+# Example: OO_SDK_SED_HOME=/usr/bin
+OO_SDK_SED_HOME=@OO_SDK_SED_HOME@
+
# Directory of the C++ compiler.
# Example: OO_SDK_CPP_HOME=/usr/bin
OO_SDK_CPP_HOME=@OO_SDK_CPP_HOME@
@@ -234,6 +242,20 @@ then
export OO_SDK_ZIP_HOME
fi
+# Add directory of the sed tool to the path, if necessary.
+if [ -n "${OO_SDK_SED_HOME}" ]
+then
+ PATH=${OO_SDK_SED_HOME}:${PATH}
+ export OO_SDK_SED_HOME
+fi
+
+# Add directory of the cat tool to the path, if necessary.
+if [ -n "${OO_SDK_CAT_HOME}" ]
+then
+ PATH=${OO_SDK_CAT_HOME}:${PATH}
+ export OO_SDK_CAT_HOME
+fi
+
# Add directory of the C++ tools to the path, if necessary.
if [ -n "${OO_SDK_CPP_HOME}" ]
then
@@ -301,6 +323,8 @@ echo " * Office = $OFFICE_HOME"
echo " * URE = $OO_SDK_URE_HOME"
echo " * Make = $OO_SDK_MAKE_HOME"
echo " * Zip = $OO_SDK_ZIP_HOME"
+echo " * cat = $OO_SDK_CAT_HOME"
+echo " * sed = $OO_SDK_SED_HOME"
echo " * C++ Compiler = $OO_SDK_CPP_HOME"
echo " * Java = $OO_SDK_JAVA_HOME"
echo " * SDK Output directory = $OO_SDK_OUT"
diff --git a/odk/config/setsdkenv_windows.template b/odk/config/setsdkenv_windows.template
index 8b1eb594e658..ce55568b24fc 100755..100644
--- a/odk/config/setsdkenv_windows.template
+++ b/odk/config/setsdkenv_windows.template
@@ -44,6 +44,14 @@ REM Directory of the zip tool.
REM Example: set OO_SDK_ZIP_HOME=D:\infozip\bin
set OO_SDK_ZIP_HOME=
+REM Directory of the cat tool.
+REM Example: set OO_SDK_CAT_HOME=C:\UnxUtils\usr\local\wbin\
+set OO_SDK_CAT_HOME=
+
+REM Directory of the sed tool.
+REM Example: set OO_SDK_SED_HOME=C:\UnxUtils\usr\local\wbin\
+set OO_SDK_SED_HOME=
+
REM Directory of the C++ compiler.
REM Example:set OO_SDK_CPP_HOME=C:\Program Files\Microsoft Visual Studio 9.0\VC\bin
REM Example:set CPP_WINDOWS_SDK=C:\Program Files\\Microsoft SDKs\Windows\v6.0A\
@@ -94,6 +102,18 @@ if not defined OO_SDK_ZIP_HOME (
goto :error
)
+REM Check installation path for the cat tool.
+if not defined OO_SDK_CAT_HOME (
+ echo Error: the variable OO_SDK_CAT_HOME is missing!
+ goto :error
+ )
+
+REM Check installation path for the sed tool.
+if not defined OO_SDK_SED_HOME (
+ echo Error: the variable OO_SDK_SED_HOME is missing!
+ goto :error
+ )
+
REM Set library path.
set LIB=%OO_SDK_HOME%\lib;%LIB%
if defined CPP_WINDOWS_SDK (
@@ -144,6 +164,12 @@ if defined OO_SDK_MAKE_HOME set PATH=%OO_SDK_MAKE_HOME%;%PATH%
REM Add directory of the zip tool to the path, if necessary.
if defined OO_SDK_ZIP_HOME set PATH=%OO_SDK_ZIP_HOME%;%PATH%
+REM Add directory of the cat tool to the path, if necessary.
+if defined OO_SDK_CAT_HOME set PATH=%OO_SDK_CAT_HOME%;%PATH%
+
+REM Add directory of the sed tool to the path, if necessary.
+if defined OO_SDK_SED_HOME set PATH=%OO_SDK_SED_HOME%;%PATH%
+
REM Add directory of the C++ compiler to the path, if necessary.
if defined OO_SDK_CPP_HOME set PATH=%OO_SDK_CPP_HOME%;%PATH%
@@ -170,6 +196,8 @@ echo * Office = %OFFICE_HOME%
echo * URE = %OO_SDK_URE_HOME%
echo * Make = %OO_SDK_MAKE_HOME%
echo * Zip = %OO_SDK_ZIP_HOME%
+echo * cat = %OO_SDK_CAT_HOME%
+echo * sed = %OO_SDK_SED_HOME%
echo * C++ Compiler = %OO_SDK_CPP_HOME%
echo * C# and VB.NET compilers = %OO_SDK_CLI_HOME%
echo * Java = %OO_SDK_JAVA_HOME%
diff --git a/odk/docs/install.html b/odk/docs/install.html
index efc82d2a8aa7..80cbdff0f6df 100644
--- a/odk/docs/install.html
+++ b/odk/docs/install.html
@@ -131,6 +131,16 @@
If you do not have these already, you can download them from <a target="_blank" href="http://www.info-zip.org" title="link to www.ubfi-zip.org (online)">http://www.info-zip.org</a>. Note: The cygwin zip.exe does not work for the build under
the 4NT shell. You have to use the native w32 version.</td>
</tr>
+ <tr valign="middle">
+ <td colspan="2"><img class="line" src="images/sdk_line-1.gif"></td>
+ </tr>
+ <tr valign="top">
+ <td><b>cat and sed tools<b></td>
+ <td class="content80">The cat and set tools are used to create some extensions.
+ <p><b>Note for Windows users</b>: If you do not have these already, you can download them from
+ <a target="_blank" href="http://sourceforge.net/projects/unxutils/files/latest/downloadg" title="link to UnxUtils (online)">http://sourceforge.net/projects/unxutils/files/latest/download</a>.</p>
+ </td>
+ </tr>
<tr valign="middle">
<td colspan="2"><img class="line" src="images/sdk_line-1.gif"/></td>
</tr>
@@ -138,8 +148,8 @@
<td colspan="2">
<p>The SDK provides an implicit configuration mechanism, which
configures the SDK build environment to your personal needs the first
- time you use the SDK environment. This configuration step creates one
- new setsdkenv_XXX script in the user's home directory:</p>
+ time you use the SDK environment. This configuration step creates a
+ new setsdkenv_XXX script in the user's home directory:</p>
<ul>
<li><b>$HOME/$OO_SDK_NAME/setsdkenv_unix.sh</b>&nbsp;&nbsp;-&gt; for Unix</li>
<li><b>C:\Documents and Settings\&lt;username&gt;\Application Data\%OO_SDK_NAME%\setsdkenv_windows.bat</b>&nbsp;&nbsp;-&gt; for Windows2000/XP or later</li>
@@ -222,6 +232,14 @@
<td class="cell20"><b>OO_SDK_ZIP_HOME</b></td>
<td class="cell80">Path to the 'zip' tool.</td>
</tr>
+ <tr>
+ <td class="cell20"><b>OO_SDK_CAT_HOME</b></td>
+ <td class="cell80">Path to the 'cat' tool.</td>
+ </tr>
+ <tr>
+ <td class="cell20"><b>OO_SDK_SED_HOME</b></td>
+ <td class="cell80">Path to the 'sed' tool.</td>
+ </tr>
<tr>
<td class="cell20"><b>OO_SDK_OUTPUT_DIR</b></td>
<td class="cell80">Path to an existing directory where the example output
diff --git a/odk/settings/std.mk b/odk/settings/std.mk
index d8c5f51028c4..84c986c48612 100644
--- a/odk/settings/std.mk
+++ b/odk/settings/std.mk
@@ -65,6 +65,8 @@ SDK_JAVA="$(OO_SDK_JAVA_HOME)/$(JAVABIN)/java" $(JAVA_OPTIONS)
SDK_JAVAC="$(OO_SDK_JAVA_HOME)/$(JAVABIN)/javac"
SDK_JAR="$(OO_SDK_JAVA_HOME)/$(JAVABIN)/jar"
SDK_ZIP="$(OO_SDK_ZIP_HOME)/zip"
+SDK_CAT="$(OO_SDK_CAT_HOME)/cat"
+SDK_SED="$(OO_SDK_SED_HOME)/sed"
IDLC="$(OO_SDK_HOME)/bin/idlc"
CPPUMAKER="$(OO_SDK_HOME)/bin/cppumaker"
JAVAMAKER="$(OO_SDK_HOME)/bin/javamaker"