Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1304 LIBS = STAF

open
nobody
None
5
2014-08-10
2009-11-02
asystejs
No

Most of the nested makefile.staf files use
LIBS = STAF
instead of
LIBS = $(LIB_STAF)

Every attempt at linking fails because it sets -lSTAF when the name is realy libSTAF or libSTAF.so

Discussion

  • Sharon Lucas
    Sharon Lucas
    2009-11-02

    We build STAF every day for all supported platforms using the make files that are checked into CVS (and provided in the STAFxxx-src.zip/tar files), so I'm not sure what the problem is that you're experiencing. What are the exact steps that you are using to build STAF?

     
  • Charles Rankin
    Charles Rankin
    2009-11-02

    Note, unless you are doing very specific things when building on unix, you don't want to put the prefix or suffix. It is the compilers/linkers responsibility to figure out the appropriate prefixes/suffixes.

     
  • asystejs
    asystejs
    2009-11-02

    The steps are

    export BUILD_TYPE=release
    export OS_NAME=nsk
    export PROJECTS='staf conprov_tcp'
    export CC_NAME=cpp
    export STAF_USE_SSL=
    export STAF_USE_IPV6=

    make

    ---------------------------------

    I had to change all occurances of
    LIBS = STAF
    to
    LIBS = $(LIB_STAF)

     
  • asystejs
    asystejs
    2009-11-02

    Unfortunately this isn't Unix, its a Posix environment running under Nonstop Kernel.

    If I don't set a lib prefix or suffix then both the main executable
    and the staf lib end up being named STAF and the the OS loader resolves
    the libnme STAF in the liblist to the main exeecutable named STAF and fails the process creation

     
  • Charles Rankin
    Charles Rankin
    2009-11-02

    Could you post the contents of your build/makefile.nsk and build/makefile.cpp

     
  • Sharon Lucas
    Sharon Lucas
    2009-11-02

    Did you create a build/makefile.nsk file in the source tree? What are its contents?

    Are you setting the OS_SHARED_LIB_PREFIX and OS_SHARED_LIB_SUFFIX variables in your makefile.nsk file? You probably shouldn't be as the defaults are lib for the prefix and dll for the suffix as set in the master makefile.

     
  • asystejs
    asystejs
    2009-11-02

     
    Attachments
  • asystejs
    asystejs
    2009-11-02

     
    Attachments
  • asystejs
    asystejs
    2009-11-03

    When the env vars DLL/LIB_STAF/LIB_STAF_FP are created via

    DLL = $(OS_SHARED_LIB_PREFIX)Name$(OS_SHARED_LIB_SUFFIX)
    LIB_STAF = $(subst Name,STAF,$(DLL))
    LIB_STAF_FP = $(REL)/lib/$(LIB_STAF)

    if the prefix and suffix are empty

    LIBS = STAF is equivalent to LIBS = $(LIB_STAF)

    Using $(LIB_STAF) everywhere enables the ability to set a name prefix/suffix
    on a platform where the explicit name is required.

     
  • Sharon Lucas
    Sharon Lucas
    2009-11-04

    In your build/makefile.nsk, why are you setting OS_SHARED_LIB_PREFIX and OS_SHARED_LIB_SUFFIX ? The STAF master makefile already defaults them to lib and .so, respectively.

    In your build/makefile.cpp file:
    - Why did you comment out how CC_SHAREDLIBNAMEFLAGS should be set and provide your own setting?
    - Why did you comment out the line after comment "We must link with a shread library via the corresponding definition side-deck" and why did you comment out the last line that assigns MOVE_SIDE_DECK ?

     
  • Charles Rankin
    Charles Rankin
    2009-11-04

    Your attached makefiles seem largely ok. The only thing that I noticed is that in makefile.nsk you set OS_SHARED_LIB_PREFIX to the empty string. Yet, in makefile.cpp in the definition of CC_SHAREDLIBNAMEFLAGS you have the prefix set to "lib". They should be the same.

    I'm still a bit at a loss as to why you would need to specify -llibSTAF.so instead of just -lSTAF, as the compiler/linker should be doing the proper conversion for you (as welll as searching all -L directories). Perhaps go into the master makefile and in the definition of LINK_IT and SHARED_LIB_IT, remove the "@" in front of the @$(CC_LINK_IT) and @$(CC_SHARED_LIB_IT) lines. That should dump out the actual commands getting sent to the compiler/linker which may shed some light on things.

    And lastly, can you provide a link to some online documentation about the compiler and OS you are using. I'm not very familar with NSK and don't have a clue if it's "cpp" is based of some other existing compiler, or if it's something specifically designed for NSK.

     
  • asystejs
    asystejs
    2009-11-09

    >In your build/makefile.cpp file:
    >- Why did you comment out how CC_SHAREDLIBNAMEFLAGS should be set and
    >provide your own setting?

    I put it back to

    CC_SHAREDLIBNAMEFLAGS = -DSTAF_SHARED_LIB_PREFIX=$(OS_SHARED_LIB_PREFIX) \ -DSTAF_SHARED_LIB_SUFFIX=$(OS_SHARED_LIB_SUFFIX)

    nothing changed.

    >- Why did you comment out the line after comment "We must link with a
    > shared library via the corresponding definition side-deck" and why did you
    > comment out the last line that assigns MOVE_SIDE_DECK ?

    I dont remember commenting it out but if its un-commented I get

    #We must link with a shared library via the corresponding definition side-deck.
    ALL_LIB_LIST = $(foreach lib, $(ALL_LIB_LIST_RAW),$(REL)/lib/$(OS_SHARED_LIB_PREFIX)$(lib).x)

    *** Linking shared library STAF.so ***
    c89: error: Invalid input file extension"/home/jshepherd/STAF333/rel/nsk/staf/re
    lease/lib/lib".
    c89: error: Invalid input file extension"rld.x".

     
  • Sharon Lucas
    Sharon Lucas
    2010-01-06

    Could you respond to the comments made by crnkin_wok on 2009-11-04 13:27? Thanks.

     
  • asystejs
    asystejs
    2010-01-06

    Leaving the prefix/suffix alone does work ok.

    If you want the prefix/suffix to be something else you are hosed because of the
    dependence on the linker expanding the short form of the name.