Changeset 815


Ignore:
Timestamp:
Nov 4, 2010, 1:57:51 AM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

configure.cmd: Added recognition of -prefix and other options that allow to set hard-coded library paths returned by QLibraryInfo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.cmd

    r803 r815  
    347347    G.QT_INSTALL_EXAMPLES = ""
    348348    G.QT_INSTALL_DEMOS = ""
    349     G.QT_HOST_PREFIX = ""
     349    G.QT_INSTALL_SYSCONFFILE = ""
    350350
    351351    G.QT_LIBINFIX = ""
     
    421421    --------------------------------------------------------------------------*/
    422422
    423     /* @todo */
    424423    if (aArgs \= "") then do
    425         call SayErr
    426         call SayErr "Sorry, command line arguments are not yet processed."
    427         call SayErr "Please run the script again without the arguments."
    428         call SayErr
    429         call Done 1
     424        call TokenizeString aArgs, 'G.Args'
     425        i = 1
     426        do while i <= G.Args.0
     427            a = G.Args.i
     428            if (StartsWith(a, '-')) then do
     429                a = strip(a, 'L', '-')
     430                opt = ''
     431                typ = 'P' /* path */
     432                select
     433                    when (a == "prefix") then
     434                        opt = 'G.QT_INSTALL_PREFIX'
     435                    when (a == "datadir") then
     436                        opt = 'G.QT_INSTALL_DATA'
     437                    when (a == "libdir") then
     438                        opt = 'G.QT_INSTALL_LIBS'
     439                    when (a == "headerdir") then
     440                        opt = 'G.QT_INSTALL_HEADERS'
     441                    when (a == "bindir") then
     442                        opt = 'G.QT_INSTALL_BINS'
     443                    when (a == "plugindir") then
     444                        opt = 'G.QT_INSTALL_PLUGINS'
     445                    when (a == "demosdir") then
     446                        opt = 'G.QT_INSTALL_DEMOS'
     447                    when (a == "examplesdir") then
     448                        opt = 'G.QT_INSTALL_EXAMPLES'
     449                    when (a == "docdir") then
     450                        opt = 'G.QT_INSTALL_DOCS'
     451                    when (a == "translationdir") then
     452                        opt = 'G.QT_INSTALL_TRANSLATIONS'
     453                    when (a == "sysconfdir" | a == "settingsdir") then
     454                        opt = 'G.QT_INSTALL_SETTINGS'
     455                    when (a == "sysconffile") then
     456                        opt = 'G.QT_INSTALL_SYSCONFFILE'
     457                    otherwise typ = ''
     458                end
     459                if (typ == '') then do
     460                    call SayErr "ERROR: Invalid option '"G.Args.i"'."
     461                    call Done 1
     462                end
     463                if (typ == 'P') then do
     464                    if (i == G.Args.0) then do
     465                        call SayErr "ERROR: Option '"G.Args.i"' needs a path value."
     466                        call Done 1
     467                    end
     468                    i = i + 1
     469                    interpret opt "= translate(G.Args."i", '\', '/')"
     470                end
     471            end
     472            else do
     473                call SayErr "ERROR: Invalid argument '"G.Args.i"'."
     474                call Done 1
     475            end
     476            i = i + 1
     477        end
    430478    end
    431479
     
    687735    if (G.QT_INSTALL_DEMOS == "") then
    688736        G.QT_INSTALL_DEMOS = "demos"
     737    /* sysconffile is left empty */
    689738
    690739    /*--------------------------------------------------------------------------
     
    777826'#define QT_CONFIGURE_EXAMPLES_PATH "'CPPPath(G.QT_INSTALL_EXAMPLES)'"'G.EOL||,
    778827'#define QT_CONFIGURE_DEMOS_PATH "'CPPPath(G.QT_INSTALL_DEMOS)'"'G.EOL
     828
     829    if (G.QT_INSTALL_SYSCONFFILE \== '') then
     830        config_cpp_str = config_cpp_str||,
     831'#define QT_CONFIGURE_QT_SYSCONF_FILE "'CPPPath(G.QT_INSTALL_SYSCONFFILE)'"'G.EOL
    779832
    780833    today = date('S')
     
    29412994
    29422995/**
     2996 *  Returns a list of all words from the string as a stem.
     2997 *  Delimiters are spaces, tabs and new line characters.
     2998 *  Words containg spaces must be enclosed with double
     2999 *  quotes. Double quote symbols that need to be a part
     3000 *  of the word, must be doubled.
     3001 *
     3002 *  @param string   the string to tokenize
     3003 *  @param stem
     3004 *      the name of the stem. The stem must be global
     3005 *      (i.e. its name must start with 'G.!'), for example,
     3006 *      'G.!wordlist'.
     3007 *  @param leave_ws
     3008 *      1 means whitespace chars are considered as a part of words they follow.
     3009 *      Leading whitespace (if any) is always a part of the first word (if any).
     3010 *
     3011 *  @version 1.1
     3012 */
     3013TokenizeString: procedure expose (Globals)
     3014
     3015    parse arg string, stem, leave_ws
     3016    leave_ws = (leave_ws == 1)
     3017
     3018    delims  = '20090D0A'x
     3019    quote   = '22'x /* " */
     3020
     3021    num = 0
     3022    token = ''
     3023
     3024    len = length(string)
     3025    last_state = '' /* D - in delim, Q - in quotes, W - in word */
     3026    seen_QW = 0
     3027
     3028    do i = 1 to len
     3029        c = substr(string, i, 1)
     3030        /* determine a new state */
     3031        if (c == quote) then do
     3032            if (last_state == 'Q') then do
     3033                /* detect two double quotes in a row */
     3034                if (substr(string, i + 1, 1) == quote) then i = i + 1
     3035                else state = 'W'
     3036            end
     3037            else state = 'Q'
     3038        end
     3039        else if (verify(c, delims) == 0 & last_state \== 'Q') then do
     3040            state = 'D'
     3041        end
     3042        else do
     3043            if (last_state == 'Q') then state = 'Q'
     3044            else state = 'W'
     3045        end
     3046        /* process state transitions */
     3047        if ((last_state == 'Q' | state == 'Q') & state \== last_state) then c = ''
     3048        else if (state == 'D' & \leave_ws) then c = ''
     3049        if (last_state == 'D' & state \== 'D' & seen_QW) then do
     3050            /* flush the token */
     3051            num = num + 1
     3052            call value stem'.'num, token
     3053            token = ''
     3054        end
     3055        token = token||c
     3056        last_state = state
     3057        seen_QW = (seen_QW | state \== 'D')
     3058    end
     3059
     3060    /* flush the last token if any */
     3061    if (token \== '' | seen_QW) then do
     3062        num = num + 1
     3063        call value stem'.'num, token
     3064    end
     3065
     3066    call value stem'.0', num
     3067
     3068    return
     3069
     3070/**
    29433071 * Initializes a new "at exit" slot and returns its ID.
    29443072 */
Note: See TracChangeset for help on using the changeset viewer.