Submitted by ian.lincoln.mid... on December 7, 2009 - 07:38
I'm trying to install WSO2 WSF/C on Mac OS X for use in a perl script and running into a problem making platforms/unix
The problem and then my workaround are described below. In a nutshell the mac osx/FreeBSD section of code is not getting compiled because HAVE_GETIFADDRS is not defined.
uuid_gen_unix.c compiles with the modification below. I'm now working on digest.c ....
and digest failed because (as far as I can tell) ...
The minimal required version of openssl is now 0.9.8 while Mac OS 10.5 ships 0.9.7 something. Download and compile openssl 0.9.8k yourself and pass the compile switch --with-openssl-dir=DIR to specify the correct directory. (see the end of the post for the details)
System Mac OS X 10.5.8 (Leopard)
Xcode 3.1.4 (the Leopard SDK)
Source code distribution...
http://dist.wso2.org/products/wsf/c/2.0.0/wso2-wsf-c-src-2.0.0.zip
configured with
WSFC_HOME=/opt/wso2/wsf_c
./configure --prefix=${WSFC_HOME}
First Error message...
make all-recursive
Making all in src
Making all in platforms/unix
/bin/sh ../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -D_GNU_SOURCE -Wno-long-double -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c -o uuid_gen_unix.lo uuid_gen_unix.c
gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -D_GNU_SOURCE -Wno-long-double -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c uuid_gen_unix.c -fno-common -DPIC -o .libs/uuid_gen_unix.o
uuid_gen_unix.c: In function axutil_uuid_get_mac_addr:
uuid_gen_unix.c:330: error: SIOCGARP undeclared (first use in this function)
uuid_gen_unix.c:330: error: (Each undeclared identifier is reported only once
uuid_gen_unix.c:330: error: for each function it appears in.)
make[7]: *** [uuid_gen_unix.lo] Error 1
make[6]: *** [all-recursive] Error 1
Looking at the code it seems as if this something is not set quite right.
This is the else statement the begins axutil_uuid_get_mac_addr() compiling which generates the error above...
# else /* Solaris-ish */
/* code modified from that posted on:
* http://forum.sun.com/jive/thread.jspa?threadID=84804&tstart=30
*/
char *AXIS2_CALL
axutil_uuid_get_mac_addr()
{
But this is the if part of that else statement (so above it compiles the solarish version instead of the MacOSX version below).
#ifdef HAVE_GETIFADDRS /* NetBSD, MacOSX, etc... */
#ifndef max
# define max(a,b) ((a) > (b) ? (a) : (b))
#endif /* !max */
char *AXIS2_CALL
axutil_uuid_get_mac_addr(
)
{
Adding a define just before that to force the NetBSD, MacOSX version and see what happens.
# define HAVE_GETIFADDRS /* Ian Hope Springs Eternal 12-6-2009 */
and the error is....
Making all in src
Making all in platforms/unix
/bin/sh ../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -D_GNU_SOURCE -Wno-long-double -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c -o uuid_gen_unix.lo uuid_gen_unix.c
gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -D_GNU_SOURCE -Wno-long-double -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c uuid_gen_unix.c -fno-common -DPIC -o .libs/uuid_gen_unix.o
uuid_gen_unix.c: In function axutil_uuid_get_mac_addr:
uuid_gen_unix.c:284: error: dereferencing pointer to incomplete type
uuid_gen_unix.c:286: error: dereferencing pointer to incomplete type
uuid_gen_unix.c:286: error: dereferencing pointer to incomplete type
uuid_gen_unix.c:288: error: dereferencing pointer to incomplete type
Sorry Long explantion in a plea for help building this for the Mac and getting out of this quagmire....
And I solved that problem. It was my fault I did not define HAVE_GETIFADDRS soone enough, moving it here before the $ifdef HAVE_GETIFADDRS and the compile finishes.
# define HAVE_GETIFADDRS /* Ian Hope Springs Eternal 12-6-2009 */
#ifdef HAVE_GETIFADDRS
#include <ifaddrs.h>
#endif
Next Problem which I have not looked at yet...
digest.c: In function ‘openssl_sha256’:
digest.c:73: error: ‘SHA256_CTX’ undeclared (first use in this function)
digest.c:73: error: (Each undeclared identifier is reported only once
digest.c:73: error: for each function it appears in.)
digest.c:73: error: syntax error before ‘c’
digest.c:74: error: ‘SHA256_DIGEST_LENGTH’ undeclared (first use in this function)
digest.c:77: error: ‘c’ undeclared (first use in this function)
digest.c:74: warning: unused variable ‘md’
make[6]: *** [digest.lo] Error 1
Found the new openssl here.
http://www.openssl.org/source/
4179422 Nov 5 17:20:01 2009 openssl-0.9.8l.tar.gz (MD5) (SHA1) (PGP sign) [LATEST]
Straight up install with
$ ./config
$ make
$ make test
$ make install
And a straight up hack of digest.c to point to the new header files installed to /usr/local/ssl
#include </usr/local/ssl/include/openssl/sha.h>
#include </usr/local/ssl/include/openssl/md5.h>
/*
12-9-2009 Ian Adding after installing openssl-0.9.8.l from http://www.openssl.org/source/
#include <openssl/sha.h>
#include <openssl/md5.h>
*/
It made and installed without complaining.
I sure hope it works!
Ian
Thanks for posting this Ian. Very helpful!
hey guys i can't get it to
HAVE_GETIFADDRS
error on MAC OS X 10.6