Index: /trunk/configure.cmd
===================================================================
--- /trunk/configure.cmd	(revision 814)
+++ /trunk/configure.cmd	(revision 815)
@@ -347,5 +347,5 @@
     G.QT_INSTALL_EXAMPLES = ""
     G.QT_INSTALL_DEMOS = ""
-    G.QT_HOST_PREFIX = ""
+    G.QT_INSTALL_SYSCONFFILE = ""
 
     G.QT_LIBINFIX = ""
@@ -421,11 +421,59 @@
     --------------------------------------------------------------------------*/
 
-    /* @todo */
     if (aArgs \= "") then do
-        call SayErr
-        call SayErr "Sorry, command line arguments are not yet processed."
-        call SayErr "Please run the script again without the arguments."
-        call SayErr
-        call Done 1
+        call TokenizeString aArgs, 'G.Args'
+        i = 1
+        do while i <= G.Args.0
+            a = G.Args.i
+            if (StartsWith(a, '-')) then do
+                a = strip(a, 'L', '-')
+                opt = ''
+                typ = 'P' /* path */
+                select
+                    when (a == "prefix") then
+                        opt = 'G.QT_INSTALL_PREFIX'
+                    when (a == "datadir") then
+                        opt = 'G.QT_INSTALL_DATA'
+                    when (a == "libdir") then
+                        opt = 'G.QT_INSTALL_LIBS'
+                    when (a == "headerdir") then
+                        opt = 'G.QT_INSTALL_HEADERS'
+                    when (a == "bindir") then
+                        opt = 'G.QT_INSTALL_BINS'
+                    when (a == "plugindir") then
+                        opt = 'G.QT_INSTALL_PLUGINS'
+                    when (a == "demosdir") then
+                        opt = 'G.QT_INSTALL_DEMOS'
+                    when (a == "examplesdir") then
+                        opt = 'G.QT_INSTALL_EXAMPLES'
+                    when (a == "docdir") then
+                        opt = 'G.QT_INSTALL_DOCS'
+                    when (a == "translationdir") then
+                        opt = 'G.QT_INSTALL_TRANSLATIONS'
+                    when (a == "sysconfdir" | a == "settingsdir") then
+                        opt = 'G.QT_INSTALL_SETTINGS'
+                    when (a == "sysconffile") then
+                        opt = 'G.QT_INSTALL_SYSCONFFILE'
+                    otherwise typ = ''
+                end
+                if (typ == '') then do
+                    call SayErr "ERROR: Invalid option '"G.Args.i"'."
+                    call Done 1
+                end
+                if (typ == 'P') then do
+                    if (i == G.Args.0) then do
+                        call SayErr "ERROR: Option '"G.Args.i"' needs a path value."
+                        call Done 1
+                    end
+                    i = i + 1
+                    interpret opt "= translate(G.Args."i", '\', '/')"
+                end
+            end
+            else do
+                call SayErr "ERROR: Invalid argument '"G.Args.i"'."
+                call Done 1
+            end
+            i = i + 1
+        end
     end
 
@@ -687,4 +735,5 @@
     if (G.QT_INSTALL_DEMOS == "") then
         G.QT_INSTALL_DEMOS = "demos"
+    /* sysconffile is left empty */
 
     /*--------------------------------------------------------------------------
@@ -777,4 +826,8 @@
 '#define QT_CONFIGURE_EXAMPLES_PATH "'CPPPath(G.QT_INSTALL_EXAMPLES)'"'G.EOL||,
 '#define QT_CONFIGURE_DEMOS_PATH "'CPPPath(G.QT_INSTALL_DEMOS)'"'G.EOL
+
+    if (G.QT_INSTALL_SYSCONFFILE \== '') then
+        config_cpp_str = config_cpp_str||,
+'#define QT_CONFIGURE_QT_SYSCONF_FILE "'CPPPath(G.QT_INSTALL_SYSCONFFILE)'"'G.EOL
 
     today = date('S')
@@ -2941,4 +2994,79 @@
 
 /**
+ *  Returns a list of all words from the string as a stem.
+ *  Delimiters are spaces, tabs and new line characters.
+ *  Words containg spaces must be enclosed with double
+ *  quotes. Double quote symbols that need to be a part
+ *  of the word, must be doubled.
+ *
+ *  @param string   the string to tokenize
+ *  @param stem
+ *      the name of the stem. The stem must be global
+ *      (i.e. its name must start with 'G.!'), for example,
+ *      'G.!wordlist'.
+ *  @param leave_ws
+ *      1 means whitespace chars are considered as a part of words they follow.
+ *      Leading whitespace (if any) is always a part of the first word (if any).
+ *
+ *  @version 1.1
+ */
+TokenizeString: procedure expose (Globals)
+
+    parse arg string, stem, leave_ws
+    leave_ws = (leave_ws == 1)
+
+    delims  = '20090D0A'x
+    quote   = '22'x /* " */
+
+    num = 0
+    token = ''
+
+    len = length(string)
+    last_state = '' /* D - in delim, Q - in quotes, W - in word */
+    seen_QW = 0
+
+    do i = 1 to len
+        c = substr(string, i, 1)
+        /* determine a new state */
+        if (c == quote) then do
+            if (last_state == 'Q') then do
+                /* detect two double quotes in a row */
+                if (substr(string, i + 1, 1) == quote) then i = i + 1
+                else state = 'W'
+            end
+            else state = 'Q'
+        end
+        else if (verify(c, delims) == 0 & last_state \== 'Q') then do
+            state = 'D'
+        end
+        else do
+            if (last_state == 'Q') then state = 'Q'
+            else state = 'W'
+        end
+        /* process state transitions */
+        if ((last_state == 'Q' | state == 'Q') & state \== last_state) then c = ''
+        else if (state == 'D' & \leave_ws) then c = ''
+        if (last_state == 'D' & state \== 'D' & seen_QW) then do
+            /* flush the token */
+            num = num + 1
+            call value stem'.'num, token
+            token = ''
+        end
+        token = token||c
+        last_state = state
+        seen_QW = (seen_QW | state \== 'D')
+    end
+
+    /* flush the last token if any */
+    if (token \== '' | seen_QW) then do
+        num = num + 1
+        call value stem'.'num, token
+    end
+
+    call value stem'.0', num
+
+    return
+
+/**
  * Initializes a new "at exit" slot and returns its ID.
  */
