HP-UX version/release numbers, how ? - HP UX

This is a discussion on HP-UX version/release numbers, how ? - HP UX ; hello world, I'm looking for predefined constant(s) which would give me the version and release numbers of HP-UX during compiler runs, i.e. sth universal and unique like "__hpux" I could put into an #ifdef. As a workaround I've tried to ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: HP-UX version/release numbers, how ?

  1. HP-UX version/release numbers, how ?

    hello world,

    I'm looking for predefined constant(s) which would give
    me the version and release numbers of HP-UX during compiler runs,
    i.e. sth universal and unique like "__hpux" I could put into an #ifdef.

    As a workaround I've tried to use "-D..." settings during make & compile,
    but unfortunately HP's "uname" implementation is braindead (IMHO).
    So when I'm running under 11.00
    `uname -v` gives me B.11.00 (would have expected just "11")
    and
    `uname -r` gives me some nonsense (would have expected just "00").

    I know that e.g. AIX predefines -D_AIX41 for everything higher than Version 4.1
    and -D_AIX43 for everything higher than Version 4.3, and so forth.
    Is there an equivalent on HP-UX ?


  2. Re: HP-UX version/release numbers, how ?

    Michael Kraemer wrote:
    > I'm looking for predefined constant(s) which would give
    > me the version and release numbers of HP-UX during compiler runs,


    The HP-UX user space architect doesn't want this. He says you are
    suppose to use the feature test macros, not OS versions.

    > but unfortunately HP's "uname" implementation is braindead (IMHO).


    The proper way to use uname(1) is:
    $ echo $(uname -r | sed -e 's/..//' -e 's/\.//')

  3. Re: HP-UX version/release numbers, how ?

    Dennis Handly schrieb:
    > Michael Kraemer wrote:
    >
    >> I'm looking for predefined constant(s) which would give
    >> me the version and release numbers of HP-UX during compiler runs,

    >
    >
    > The HP-UX user space architect doesn't want this. He says you are
    > suppose to use the feature test macros, not OS versions.


    OK, then how do I test (on the #ifdef level) the existence of
    e.g. dlopen() and friends, w/o including dlfcn.h ?
    These do not exist in earlier versions ( 9, 10.x ?).

    >> but unfortunately HP's "uname" implementation is braindead (IMHO).

    >
    > The proper way to use uname(1) is:
    > $ echo $(uname -r | sed -e 's/..//' -e 's/\.//')


    OK, I'll give it a try.
    Meanwhile, I have found a section in the FAQ,
    with a test on certain flags defined in .
    Is this safe enough ? Looks a bit dodgy to me.

    thanks anyway.




  4. Re: HP-UX version/release numbers, how ?

    On Thu, 17 Jan 2008, Michael Kraemer wrote:

    > Date: Thu, 17 Jan 2008 16:10:07 +0000 (UTC)
    > From: Michael Kraemer
    > Newsgroups: comp.sys.hp.hpux
    > Subject: HP-UX version/release numbers, how ?
    >
    > hello world,
    >
    > I'm looking for predefined constant(s) which would give
    > me the version and release numbers of HP-UX during compiler runs,
    > i.e. sth universal and unique like "__hpux" I could put into an #ifdef.
    >
    > As a workaround I've tried to use "-D..." settings during make & compile,
    > but unfortunately HP's "uname" implementation is braindead (IMHO).
    > So when I'm running under 11.00
    > `uname -v` gives me B.11.00 (would have expected just "11")
    > and
    > `uname -r` gives me some nonsense (would have expected just "00").
    >
    > I know that e.g. AIX predefines -D_AIX41 for everything higher than Version 4.1
    > and -D_AIX43 for everything higher than Version 4.3, and so forth.
    > Is there an equivalent on HP-UX ?
    >
    >


    For gcc on just about every platform I compile upon, i create a script
    I call predefined, which takes a single argument, the compiler you use,
    and it will show you what is predefined on that particular platform:

    predefined gcc

    The file contains the following single line:

    $1 -E -dM - < /dev/null

    HTH
    Rob Sciuk
    ---- Posted via Pronews.com - Premium Corporate Usenet News Provider ----
    http://www.pronews.com offers corporate packages that have access to 100,000+ newsgroups

  5. Re: HP-UX version/release numbers, how ?

    spam@controlq.com schrieb:

    >
    > For gcc on just about every platform I compile upon, i create a script
    > I call predefined, which takes a single argument, the compiler you use,
    > and it will show you what is predefined on that particular platform:
    >
    > predefined gcc
    >
    > The file contains the following single line:
    >
    > $1 -E -dM - < /dev/null
    >
    > HTH
    > Rob Sciuk


    Unfortunately this is not quite what I was looking for.
    Apart from the fact that I use native compilers wherever possible,
    your example gives a lot of #defines, but not the OS version.
    And it does not give me the opportunity to put a simple
    #if defined(__hpux) && ( OSVERSION < 1000 )
    into the source code.


  6. Re: HP-UX version/release numbers, how ?

    Michael Kraemer wrote:
    > then how do I test (on the #ifdef level) the existence of
    > e.g. dlopen() and friends, w/o including dlfcn.h?
    > These do not exist in earlier versions (9, 10.x?).


    Every version of supported HP-UX provides dlopen(3), possibly with
    patches. So I'm not sure even a OS version check would work for 11.00
    or 11.11?

    So you would have to check externally for or dlopen in libdld.sl.


    On Thu, 17 Jan 2008, Michael Kraemer wrote:
    >The file contains the following single line:

    $1 -E -dM - < /dev/null

    The "-E -dM" option on an empty file is supported on IPF with A.06.15.

  7. Re: HP-UX version/release numbers, how ?

    Dennis Handly wrote:
    > So you would have to check externally for or dlopen in
    > libdld.sl.


    Sounds like a task for the wonderful/infernal autotools.

    rick jones
    --
    No need to believe in either side, or any side. There is no cause.
    There's only yourself. The belief is in your own precision. - Jobert
    these opinions are mine, all mine; HP might not want them anyway...
    feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...

  8. Re: HP-UX version/release numbers, how ?

    Thank you rick,

    I am sure any people can open a hardware case to HP at ITRC website,
    if he know the server's part number & serial number! Canyou help to
    clarify the following items?

    1. Is it correct that I need SS_Update password generator for removing
    my server's serial number?
    2. Who can supply this software?
    3. Can I call HP to remove the server's serial number?

    On Jan 25, 9:31*pm, Rick Jones wrote:
    > Dennis Handly wrote:
    > > So you would have to check externally for or dlopen in
    > > libdld.sl.

    >
    > Sounds like a task for the wonderful/infernal autotools.
    >
    > rick jones
    > --
    > No need to believe in either side, or any side. There is no cause.
    > There's only yourself. The belief is in your own precision. *- Jobert
    > these opinions are mine, all mine; HP might not want them anyway...
    > feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...



  9. Re: HP-UX version/release numbers, how ?

    Dennis Handly schrieb:
    > Michael Kraemer wrote:
    >
    >> then how do I test (on the #ifdef level) the existence of
    >> e.g. dlopen() and friends, w/o including dlfcn.h?
    >> These do not exist in earlier versions (9, 10.x?).

    >
    >
    > Every version of supported HP-UX provides dlopen(3), possibly with
    > patches.


    I'm not restricted to "supported" versions, I want
    my stuff to work on older versions too.

    > So I'm not sure even a OS version check would work for 11.00
    > or 11.11


    ???
    11.00 definitely *has* dlopen(), no matter if HP has declared
    this version obsolete in the mean time.
    9.x does not have it, don't know about 10.20.

    > So you would have to check externally for or dlopen in libdld.sl.


    This would not be compatible with my requirement that the check
    should be on the #ifdef level.

    Moreover, version query is a general issue, not restricted to dlopen.
    For the time being I will go with the trick mentioned in the FAQ.

    >
    > On Thu, 17 Jan 2008, Michael Kraemer wrote:
    > >The file contains the following single line:

    > $1 -E -dM - < /dev/null
    >
    > The "-E -dM" option on an empty file is supported on IPF with A.06.15.


    Thanks, but so what. I have little use for mechanisms which work
    only for a particular version or hardware platform.


  10. Re: HP-UX version/release numbers, how ?

    Rick Jones schrieb:
    > Dennis Handly wrote:
    >
    >>So you would have to check externally for or dlopen in
    >>libdld.sl.

    >
    >
    > Sounds like a task for the wonderful/infernal autotools.


    certainly you forgot a smiley.
    No thanks, I want to keep my own stuff clean.



+ Reply to Thread