On 06/22/14 03:53, Nikos Mavrogiannopoulos wrote:
> Hello,
>   I'd like to override the default version string in order to print (in
> addition to the default information), some other data, e.g., the
> versions of the used libraries and features enabled.
>
> I've currently tried to do that using a method similar to [0] for usage,
> by un-defining the version from the .def file, and adding a custom flag
> version. That unfortunately conflicts with autoconf's VERSION
> definition, so it requires some special re-arrangement of headers, such
> as moving the generated header over config.h.

or undef-ing before sourcing the option header?

> The issues with this approach are that (1) optionPrintVersion() starts
> with the name of the program but no version string (as the version
> directive was removed), and it does exit after printing the version, so
> the additional data can only precede the copyright string which is
> pretty impractical. Is there a better way to achieve that functionality?

After line 177 in optcode.tlib:

     (set! tmp-text (string-append version-text "\n" tmp-text))

add this:

     (if (exist? "full-version") (set! tmp-text (get "full-version")))

and add this to your .def file:

     full-version = <<- _EOVer_
                whatever you like
                _EOVer_;

that is probably the easiest way.  Let me know if it suits your need.
Otherwise, we have to go through the assembly of the text and define
a new permutation based on some other indicator, like:

    (if (exist? "gnuly-correct-version")
        (set! tmp-text (....)) )

That would _probably_ be the best solution, but it takes a bit of effort:

> IF (not (exist? "copyright"))
>
> =]
> #define zCopyright      NULL
> #define zLicenseDescrip NULL[=
> ELSE  =][=
>   CASE (define cright-owner (get "copyright.owner" (get "copyright.author")))
>        (get "copyright.type")   =][=
>
>     = note                      =][=
>       (set! tmp-text (get  "copyright.text"))
>       (define ext-text tmp-text)            =][=
>
>     ~~* .                       =][=
>       (define ext-text
>          (license-description (get "copyright.type")
>             prog-name "" cright-owner ) )
>
>       (set! tmp-text
>          (license-info (get "copyright.type")
>             prog-name "" cright-owner (get "copyright.date") ) )
>                                 =][=
>
>     *                           =][=
>       (set! tmp-text (sprintf
>               "Copyright (C) %s %s, all rights reserved"
>               (get "copyright.date") cright-owner  ))
>       (define ext-text tmp-text)  =][=
>
>   ESAC                          =][=
>
> (set! tmp-text (string-append version-text "\n" tmp-text)) ;;; line 177
> (if (not omit-nls-code)
>     (put-xget "pzCopyright" tmp-text))
>
> (string-append "\n#define zCopyright      ("
>     (string-table-add-ref opt-strs tmp-text)
>     ")\n#define zLicenseDescrip ("
>
>     (if (= tmp-text ext-text)
>         "zCopyright"
>         (begin
>            (set! ext-text (string-append (shell (string-append
>              "${CLexe} --fill -I0 -W75 <<_EOF_\n" ext-text "\n_EOF_" )) "\n" 
> ))
>
>            (if (not omit-nls-code)
>                (put-xget "pzCopyNotice" ext-text))
>            (string-table-add-ref opt-strs ext-text)
>     )   )
>     ")\n" )                     =][=
>
> ENDIF "copyright"               =][=

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Autogen-users mailing list
Autogen-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/autogen-users

Reply via email to