You are specifying DSTAF_OS_NAME_LINUX but this is an AIX build, and there 
are some additional compiler options that are not needed.

To see the compile flags that STAF is using, you can update one of the 
makefiles to print out the flags.  For example, if we change the C++ 
DeviceService makefile (src/staf/services/sdg_sample/makefile.staf):

$(REL)/lib/$(LIB_STAFDEVICE): $(stafdeviceservice_objs) $(LIB_STAF_FP) 
$(MAKEFILE_NAME)
        $(SHARED_LIB_IT)
To:

$(REL)/lib/$(LIB_STAFDEVICE): $(stafdeviceservice_objs) $(LIB_STAF_FP) 
$(MAKEFILE_NAME)
        echo $(CC_COMPILE_IT)
        $(SHARED_LIB_IT)

Then when you run the build, it will display the xlC command.  For 
example, for a 32-bit AIX build:

xlC_r -c -o /tmp/bender/rel/aix/staf/retail/lib/libSTAFDeviceService.so 
-DSTAF_O
S_NAME_AIX -DSTAF_GETHOSTBYNAME_R_3PARM -DSTAF_GETHOSTBYADDR_R_5PARM 
-D_LARGE_FI
LES -O -DSTAF_SHARED_LIB_PREFIX=lib -DSTAF_SHARED_LIB_SUFFIX=.so 
-DSTAF_NATIVE_C
OMPILER -DSTAF_USE_SSL -DSTAF_USE_SSL 
-I/opt/dev/autobuild/tools/openssl-0.9.8e-
root/include -I/opt/dev/autobuild/tools/openssl-0.9.8e-root/include 
-I/tmp/bende
r/src/staf/services/sdg_sample 
-I/tmp/bender/src/staf/services/sdg_sample/unix -
I/tmp/bender/src/staf/stafif/unix -I/tmp/bender/src/staf/stafif 
/tmp/bender/obj/
aix/staf/retail/services/sdg_sample/DeviceService.o

Thanks, 
David 

David Bender 
STAF/STAX Development 
IBM Software Group, WPLC 
 
11501 Burnet Rd. 
Bldg. 903-5B002 
Austin, TX 78758-3400 
 
Phone (T/L): 1-512-286-5315 (363-5315) 
ITN: 23635315 
Email: bda...@us.ibm.com 
 





"jander...@talentex.co.uk" <jander...@talentex.co.uk> 
10/16/2009 07:49 AM

To
staf <staf-users@lists.sourceforge.net>
cc

Subject
Re: [staf-users] Compiling and linking STAF services on UNIX






Hi David,

Thank you for replying - I have been away from my STAF project for a few 
days, sorry for not getting back to before.

I realise that the developers' guide shows me how to build STAF from 
source, and I can build STAF itself. My problem is when I try to build 
my own services - I have developed several under linux and want to port 
them to our other development servers, and this is what I get:

xlC_r -c -o infauth.o -D_XOPEN_SOURCE -D_BSD_SOURCE -DSTAF_OS_NAME_LINUX 
-DSTAF_GETHOSTBYNAME_R_6PARM -DSTAF_GETHOSTBYADDR_R_8PARM  -fPIC -O2 
-DNDEBUG -DSTAF_SHARED_LIB_PREFIX=lib -DSTAF_SHARED_LIB_SUFFIX=.so 
-D_PTHREADS -DSTAF_NATIVE_COMPILER -I../../stafif/unix -I../../stafif -I 
../../include ../infauth.cpp
"/usr/vacpp/include/arpa/inet.h", line 19.17: 1540-0040 (S) The text 
"inet_addr" is unexpected.  "in_addr_t" may be undeclared or ambiguous.
"/usr/vacpp/include/arpa/inet.h", line 20.17: 1540-1118 (S) The 
declaration of "inet_makeaddr" uses the undefined class "in_addr" when 
the class must be complete.
"/usr/vacpp/include/arpa/inet.h", line 21.17: 1540-0040 (S) The text 
"inet_network" is unexpected.  "in_addr_t" may be undeclared or ambiguous.
"/usr/vacpp/include/cwchar", line 54.23: 1540-0130 (S) "::fwide" is not 
declared.
"/usr/vacpp/include/cwchar", line 54.38: 1540-0130 (S) "::fwprintf" is 
not declared.

- and so on for a long time. Since I can build STAF itself, it seems 
reasonable to assume that it must be my 'xlC_r ...' that is wrong, but 
unfortunately I can't see from the build of STAF what it should be, as 
this is not printed during build, and the makefiles are a bit difficult 
for me to interpret.

Can you see what is wrong with my compile options? Or is there a way to 
get the make (of STAF) to print out what it does in more detail?

/jan

David Bender wrote:
> The STAF Developer's Guide 
> (http://staf.sourceforge.net/current/stafdg.html) has information on how 

> to build STAF on the platforms we support.  You will need to use the 
same 
> information for building C++ STAF services.  Note that STAF is not built 

> with GCC on all Unix platforms:
> 
>  AIX
>     * xlC V5 or later
>     * GNU Make 3.78 or later
> 
>  HP-UX
>     * aCC 3.25 or later
>     * GNU Make 3.78 or later
> 
>  Other Unix Operating Systems (e.g. Linux, Solaris, FreeBSD, Mac OS X, 
> etc)
>     * GCC 2.95.2 or later
>     * GNU Make 3.78 or later
> 
> So you would need to build your C++ service using the corresponding 
> compilers (i.e xlC for AIX, aCC for HPUX).
> 
> Thanks, 
> David 
> 
> David Bender 
> STAF/STAX Development 
> IBM Software Group, WPLC 
> 
> 11501 Burnet Rd. 
> Bldg. 903-5B002 
> Austin, TX 78758-3400 
> 
> Phone (T/L): 1-512-286-5315 (363-5315) 
> ITN: 23635315 
> Email: bda...@us.ibm.com 
> 
> 
> 
> 
> 
> 
> "jander...@talentex.co.uk" <jander...@talentex.co.uk> 
> 10/12/2009 06:40 AM
> 
> To
> staf <staf-users@lists.sourceforge.net>
> cc
> 
> Subject
> [staf-users] Compiling and linking STAF services on UNIX
> 
> 
> 
> 
> 
> 
> I have been developing a number of services on Linux, and now I need to 
> port them to other UNIXes - most notably AIX (4, 5, 6), Solaris (8, 9, 
> 10) and HP-UX (11.00, ...). As I have discovered, this is not extirely 
> as simple as running make on said platforms and depending on gcc to work 

> everywhere. Is there any documentation describing what to do and what 
> not to do on the different architectures?
> 
> 
> 
------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and 
stay 
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> staf-users mailing list
> staf-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/staf-users
> 
> 


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to