Changeset 381 for trunk/mkspecs


Ignore:
Timestamp:
Dec 5, 2009, 12:23:42 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

emxexpw.cmd: Added -desc and -vendor options to make it possible to customize the respective fields of the DESCRIPTION statement.

File:
1 edited

Legend:

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

    r102 r381  
    3535G.!eol          = '0D0A'x
    3636
    37 G.!DefaultTemplate.1 =,
    38     'LIBRARY ' /* <-- ${name} goes here */
    39 G.!DefaultTemplate.2 =,
    40     ' INITINSTANCE TERMINSTANCE' G.!eol||,
    41     'DATA MULTIPLE NONSHARED' G.!eol||,
    42     'EXPORTS'
     37G.!DefaultTemplate =,
     38    "LIBRARY ${name} INITINSTANCE TERMINSTANCE"G.!eol||,
     39    "DESCRIPTION '@#${vendor}:${version}#@ ${desc}'"G.!eol||,
     40    "DATA MULTIPLE NONSHARED"G.!eol||,
     41    "EXPORTS"
    4342    /* <-- ${exports} go here */
    4443
     
    5958Opt.!LibName         = ''
    6059Opt.!LibVersion      = ''
     60Opt.!LibDesc         = ''
     61Opt.!LibVendor       = ''
    6162Opt.!DefTemplate     = ''
    6263Opt.!DefMap          = ''
     
    157158        /* write stuff before ${exports} */
    158159        if (Opt.!DefTemplate = '') then do
    159             call lineout Opt.!DefFile,,
    160                 G.!DefaultTemplate.1||Opt.!LibName||G.!DefaultTemplate.2
     160            call lineout Opt.!DefFile, ReplaceMacros(G.!DefaultTemplate)
    161161            have_exports_macro = 1
    162162        end
     
    252252        /* write stuff before ${exports} */
    253253        if (Opt.!DefTemplate == '') then do
    254             call lineout Opt.!DefFile,,
    255                 G.!DefaultTemplate.1||Opt.!LibName||G.!DefaultTemplate.2
     254            call lineout Opt.!DefFile, ReplaceMacros(G.!DefaultTemplate)
    256255            have_exports_macro = 1
    257256        end
     
    278277
    279278    return
     279
     280/**
     281 *  Replaces all known ${} macros in the given string and returns it.
     282 */
     283ReplaceMacros: procedure expose (Globals)
     284
     285    parse arg str
     286
     287    str = Replace(str, '${name}', Opt.!LibName)
     288    str = Replace(str, '${version}', Opt.!LibVersion)
     289    str = Replace(str, '${desc}', Opt.!LibDesc)
     290    str = Replace(str, '${vendor}', Opt.!LibVendor)
     291
     292    return str
    280293
    281294/**
     
    312325            epos = pos('${exports}', str)
    313326            if (epos == 0) then do
    314                 str = Replace(str, '${name}', Opt.!LibName)
    315                 str = Replace(str, '${version}', Opt.!LibVersion)
     327                str = ReplaceMacros(str)
    316328                call lineout Opt.!DefFile, str
    317329            end
     
    330342    do while lines(Opt.!DefTemplate)
    331343        str = linein(Opt.!DefTemplate)
    332         str = Replace(str, '${name}', Opt.!LibName)
    333         str = Replace(str, '${version}', Opt.!LibVersion)
     344        str = ReplaceMacros(str)
    334345        call lineout Opt.!DefFile, str
    335346    end
     
    628639                    Opt.!LibVersion = G.!opts.i
    629640                end
     641                when (o == 'desc') then do
     642                    i = i + 1
     643                    Opt.!LibDesc = G.!opts.i
     644                end
     645                when (o == 'vendor') then do
     646                    i = i + 1
     647                    Opt.!LibVendor = G.!opts.i
     648                end
    630649                when (o == 'template') then do
    631650                    i = i + 1
     
    678697    say
    679698    say '   -def <file>             : Output DEF file [required]'
    680     say '   -name <string>          : Library name [default: DEF file w/o extension]'
     699    say '   -name <string>          : Library name [default: DEF file name w/o ext]'
    681700    say '   -version <string>       : Library version [default: none]'
     701    say '   -desc <string>          : Library description [default: none]'
     702    say '   -vendor <string>        : Library vendor [default: none]'
    682703    say '   -template <file>        : DEF file template [default: none]'
    683704    say '   -map <file>             : Input/output map file [default: none]'
     
    706727    say
    707728    say '-  ${name} is replaced with the library name;'
    708     say '-  ${version} is replaced with the library version;'
     729    say '-  ${version} is replaced with the library version string;'
     730    say '-  ${desc} is replaced with the library description string;'
     731    say '-  ${vendor} is replaced with the library vendor string;'
    709732    say '-  ${exports} is replaced with the list of exported entries.'
    710733
Note: See TracChangeset for help on using the changeset viewer.