Changeset 505


Ignore:
Timestamp:
Feb 3, 2010, 3:18:16 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

emxexpw.cmd: Added ${bldlevel} macro that expands to an extended BLDLEVEL string composed of the version, description and vendor strings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mkspecs/os2-g++/emxexpw.cmd

    r381 r505  
    3737G.!DefaultTemplate =,
    3838    "LIBRARY ${name} INITINSTANCE TERMINSTANCE"G.!eol||,
    39     "DESCRIPTION '@#${vendor}:${version}#@ ${desc}'"G.!eol||,
     39    "DESCRIPTION '${bldlevel}'"G.!eol||,
    4040    "DATA MULTIPLE NONSHARED"G.!eol||,
    4141    "EXPORTS"
     
    5757Opt.!DefFile         = ''
    5858Opt.!LibName         = ''
    59 Opt.!LibVersion      = ''
     59Opt.!LibVersion      = '0'
    6060Opt.!LibDesc         = ''
    61 Opt.!LibVendor       = ''
     61Opt.!LibVendor       = 'unknown'
     62Opt.!LibBldLevel     = ''
    6263Opt.!DefTemplate     = ''
    6364Opt.!DefMap          = ''
     
    289290    str = Replace(str, '${desc}', Opt.!LibDesc)
    290291    str = Replace(str, '${vendor}', Opt.!LibVendor)
     292    str = Replace(str, '${bldlevel}', Opt.!LibBldLevel)
    291293
    292294    return str
     
    599601    parse arg options
    600602
     603    printbldlevel = 0
     604
    601605    call TokenizeString options, 'G.!opts'
    602606
     
    658662                    Opt.!Quiet = 1
    659663                end
     664                when (o == 'printbldlevel') then do
     665                    printbldlevel = 1
     666                end
    660667                otherwise
    661668                    call Error "E_InvalidOption", o
     
    675682    drop G.!opts.0
    676683
     684    /* compose the BLDLEVEL string using the extended syntax */
     685
     686    parse var Opt.!LibVersion rev1'.'rev2'.'ver3'.'feature
     687    if (\datatype(rev1, 'N')) then do
     688        feature = Opt.!LibVersion
     689        rev1 = 0
     690        rev2 = 0
     691        ver3 = ''
     692    end
     693    else if (\datatype(rev2, 'N')) then do
     694        feature = substr(Opt.!LibVersion, length(rev1) + 2)
     695        rev2 = 0
     696        ver3 = ''
     697    end
     698    else if (\datatype(ver3, 'N')) then do
     699        feature = substr(Opt.!LibVersion, length(rev1) + length(rev2) + 3)
     700        ver3 = ''
     701    end
     702
     703    timestamp = right(date('N'), 11, ' ') time('N')
     704
     705    Opt.!LibBldLevel = '@#'Opt.!LibVendor':'rev1'.'rev2'#@##1## '||,
     706                       timestamp'    :'feature':::'ver3'::@@'Opt.!LibDesc
     707
     708    if (printbldlevel) then do
     709        /* this is a magic option that causes BldLevel to be printed and exits */
     710        say Opt.!LibBldLevel
     711        call Done 0
     712    end
     713
    677714    return
    678715
     
    698735    say '   -def <file>             : Output DEF file [required]'
    699736    say '   -name <string>          : Library name [default: DEF file name w/o ext]'
    700     say '   -version <string>       : Library version [default: none]'
     737    say '   -version <string>       : Library version [default: 0]'
    701738    say '   -desc <string>          : Library description [default: none]'
    702     say '   -vendor <string>        : Library vendor [default: none]'
     739    say '   -vendor <string>        : Library vendor [default: "unknown"]'
    703740    say '   -template <file>        : DEF file template [default: none]'
    704741    say '   -map <file>             : Input/output map file [default: none]'
     
    731768    say '-  ${vendor} is replaced with the library vendor string;'
    732769    say '-  ${exports} is replaced with the list of exported entries.'
     770    say
     771    say 'In addition to the above, there is also the ${bldlevel} macro that is'
     772    say 'replaced with a string in the format expected by the BLDLEVEL utility'
     773    say 'composed of the values passed with -version, -desc and -vendor options.'
     774    say 'This macro is typically used with the DESCRIPTION statement in the .DEF'
     775    say 'template. Note that for this macro to work correctly, the version must'
     776    say 'be specified in the following format: "X.Y[.Z[.Extra]]" where X, Y and Z'
     777    say 'are integer numbers and Extra is an arbitrary string.'
     778    say
    733779
    734780    call Done 0
Note: See TracChangeset for help on using the changeset viewer.