You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pi...@apache.org on 2006/09/16 09:56:21 UTC

svn commit: r446827 - in /webservices/axis2/trunk/c: ./ axiom/ util/ util/include/platforms/unix/ util/src/ util/src/platforms/unix/ xml_schema/samples/

Author: pini
Date: Sat Sep 16 00:56:20 2006
New Revision: 446827

URL: http://svn.apache.org/viewvc?view=rev&rev=446827
Log:
Applied the patch in jira AXIS2C-287.

Modified:
    webservices/axis2/trunk/c/axiom/configure.ac
    webservices/axis2/trunk/c/axis2c_build.sh
    webservices/axis2/trunk/c/build.sh
    webservices/axis2/trunk/c/build_all.sh
    webservices/axis2/trunk/c/configure.ac
    webservices/axis2/trunk/c/util/configure.ac
    webservices/axis2/trunk/c/util/include/platforms/unix/axis2_unix.h
    webservices/axis2/trunk/c/util/src/dll_desc.c
    webservices/axis2/trunk/c/util/src/platforms/unix/uuid_gen_unix.c
    webservices/axis2/trunk/c/xml_schema/samples/Makefile.am

Modified: webservices/axis2/trunk/c/axiom/configure.ac
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/configure.ac?view=diff&rev=446827&r1=446826&r2=446827
==============================================================================
--- webservices/axis2/trunk/c/axiom/configure.ac (original)
+++ webservices/axis2/trunk/c/axiom/configure.ac Sat Sep 16 00:56:20 2006
@@ -31,10 +31,19 @@
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([stdio.h stdlib.h string.h])
+AC_CHECK_HEADERS([sys/socket.h])
 AC_CHECK_HEADERS([linux/if.h],[],[],
 [
-#include <sys/socket.h>
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
 ])
+
+dnl This is a check to see if we are running MacOS X
+dnl It may be better to do a Darwin check
+AC_CHECK_HEADER([sys/appleapiopts.h],
+               [AC_DEFINE([IS_MACOSX],[1],[Define to 1 if compiling on MacOS X])],
+               [])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST

Modified: webservices/axis2/trunk/c/axis2c_build.sh
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axis2c_build.sh?view=diff&rev=446827&r1=446826&r2=446827
==============================================================================
--- webservices/axis2/trunk/c/axis2c_build.sh (original)
+++ webservices/axis2/trunk/c/axis2c_build.sh Sat Sep 16 00:56:20 2006
@@ -6,7 +6,12 @@
     AXIS2C_DEPLOY=$1
 fi
 
-export LD_LIBRARY_PATH=${AXIS2C_DEPLOY}/lib
+if [ `uname -s` = Darwin ]
+then
+    export DYLD_LIBRARY_PATH=${AXIS2C_DEPLOY}/lib
+else
+    export LD_LIBRARY_PATH=${AXIS2C_DEPLOY}/lib
+fi
 cd util
 
 ./configure --prefix=${AXIS2C_DEPLOY}

Modified: webservices/axis2/trunk/c/build.sh
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/build.sh?view=diff&rev=446827&r1=446826&r2=446827
==============================================================================
--- webservices/axis2/trunk/c/build.sh (original)
+++ webservices/axis2/trunk/c/build.sh Sat Sep 16 00:56:20 2006
@@ -1,8 +1,12 @@
 #!/bin/bash
 ./autogen.sh
-AXIS2C_HOME=`pwd`/deploy
-AXIS2C=`pwd`
+AXIS2C_HOME=${AXIS2C_HOME:=`pwd`/deploy}
+AXIS2C=${AXIS2C:=`pwd`}
+
 export AXIS2C_HOME AXIS2C
+
+echo "AXIS2C_HOME = ${AXIS2C_HOME}"
+echo "AXIS2       = ${AXIS2C}"
 
 ./configure --prefix=${AXIS2C_HOME} --enable-tests=no --enable-trace=yes  --enable-diclient=no --enable-static=no --enable-openssl=no --with-axis2_util=${AXIS2C}/util/include --with-axiom=${AXIS2C}/axiom/include 
 

Modified: webservices/axis2/trunk/c/build_all.sh
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/build_all.sh?view=diff&rev=446827&r1=446826&r2=446827
==============================================================================
--- webservices/axis2/trunk/c/build_all.sh (original)
+++ webservices/axis2/trunk/c/build_all.sh Sat Sep 16 00:56:20 2006
@@ -2,7 +2,12 @@
 AXIS2C_HOME=`pwd`/deploy
 AXIS2C=`pwd`
 export AXIS2C_HOME AXIS2C
-export LD_LIBRARY_PATH=${AXIS2C_HOME}/lib
+if [ `uname -s` = Darwin ]
+then
+  export DYLD_LIBRARY_PATH=${AXIS2C_HOME}/lib
+else
+  export LD_LIBRARY_PATH=${AXIS2C_HOME}/lib
+fi
 
 cd util
 sh build.sh

Modified: webservices/axis2/trunk/c/configure.ac
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/configure.ac?view=diff&rev=446827&r1=446826&r2=446827
==============================================================================
--- webservices/axis2/trunk/c/configure.ac (original)
+++ webservices/axis2/trunk/c/configure.ac Sat Sep 16 00:56:20 2006
@@ -32,10 +32,33 @@
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([stdio.h stdlib.h string.h])
+AC_CHECK_HEADERS([sys/socket.h])
+AC_CHECK_HEADERS([net/if.h], [], [],
+[#include <stdio.h>
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+])
 AC_CHECK_HEADERS([linux/if.h],[],[],
 [
-#include <sys/socket.h>
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
 ])
+AC_CHECK_HEADERS([net/if_types.h])
+AC_CHECK_HEADERS([net/if_dl.h])
+
+dnl This is a check to see if we are running MacOS X
+dnl It may be better to do a Darwin check
+AC_CHECK_HEADERS([sys/appleapiopts.h])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST

Modified: webservices/axis2/trunk/c/util/configure.ac
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/configure.ac?view=diff&rev=446827&r1=446826&r2=446827
==============================================================================
--- webservices/axis2/trunk/c/util/configure.ac (original)
+++ webservices/axis2/trunk/c/util/configure.ac Sat Sep 16 00:56:20 2006
@@ -31,13 +31,44 @@
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([stdio.h stdlib.h string.h])
+AC_CHECK_HEADERS([sys/socket.h])
+AC_CHECK_HEADERS([net/if.h], [], [],
+[#include <stdio.h>
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+])
 AC_CHECK_HEADERS([linux/if.h],[],[],
 [
-#include <sys/socket.h>
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
 ])
+AC_CHECK_HEADERS([net/if_types.h net/if_dl.h])
+
+dnl This is a check to see if we are running MacOS X
+dnl It may be better to do a Darwin check
+AC_CHECK_HEADER([sys/appleapiopts.h],
+               [AC_DEFINE([IS_MACOSX],[1],[Define to 1 if compiling on MacOS X])],
+               [])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
+AC_CHECK_TYPES([struct lifreq])
+AC_CHECK_TYPES([struct sockaddr_dl], [], [],
+[
+#if HAVE_NET_IF_DL_H
+# include <net/if_dl.h>
+#endif
+])
 
 dnl Checks for library functions.
 AC_FUNC_MALLOC

Modified: webservices/axis2/trunk/c/util/include/platforms/unix/axis2_unix.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/platforms/unix/axis2_unix.h?view=diff&rev=446827&r1=446826&r2=446827
==============================================================================
--- webservices/axis2/trunk/c/util/include/platforms/unix/axis2_unix.h (original)
+++ webservices/axis2/trunk/c/util/include/platforms/unix/axis2_unix.h Sat Sep 16 00:56:20 2006
@@ -18,6 +18,10 @@
 #ifndef AXIS2_UNIX_H
 #define AXIS2_UNIX_H
 
+#ifdef IS_MACOSX
+    #include <config.h>
+#endif
+
 /**
   * @file axis2_unix.h
   * @brief axis2 unix platform specific interface

Modified: webservices/axis2/trunk/c/util/src/dll_desc.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/dll_desc.c?view=diff&rev=446827&r1=446826&r2=446827
==============================================================================
--- webservices/axis2/trunk/c/util/src/dll_desc.c (original)
+++ webservices/axis2/trunk/c/util/src/dll_desc.c Sat Sep 16 00:56:20 2006
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #include <axis2_dll_desc.h>
 #include <axis2_class_loader.h>
 

Modified: webservices/axis2/trunk/c/util/src/platforms/unix/uuid_gen_unix.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/platforms/unix/uuid_gen_unix.c?view=diff&rev=446827&r1=446826&r2=446827
==============================================================================
--- webservices/axis2/trunk/c/util/src/platforms/unix/uuid_gen_unix.c (original)
+++ webservices/axis2/trunk/c/util/src/platforms/unix/uuid_gen_unix.c Sat Sep 16 00:56:20 2006
@@ -28,13 +28,19 @@
 #include <sys/time.h>
 
 #ifdef HAVE_LINUX_IF_H
-#include <linux/if.h>
-#else 
-#if 1  /* this should be HAVE_NET_IF_H && SMELLS_LIKE_SOLARIS */
-#include <sys/sockio.h>
-#include <net/if.h>
-#include <net/if_arp.h>
-#endif
+# include <linux/if.h>
+#else
+# ifdef HAVE_NET_IF_H
+#  include <sys/sockio.h>
+#  include <net/if.h>
+#  include <net/if_arp.h>
+# endif
+# ifdef HAVE_NET_IF_TYPES_H
+#  include <net/if_types.h>
+# endif
+# ifdef HAVE_NET_IF_DL_H
+#  include <net/if_dl.h>
+# endif
 #endif
 
 #include <platforms/unix/axis2_uuid_gen_unix.h>
@@ -196,7 +202,8 @@
    return uuid_str;   
 }
 
-#ifdef HAVE_LINUX_IF_H
+#ifdef HAVE_LINUX_IF_H   // Linux
+
 char * AXIS2_CALL
 axis2_uuid_get_mac_addr()
 {
@@ -225,6 +232,8 @@
 }
 
 #else 
+# ifdef HAVE_STRUCT_LIFREQ  // Solaris-ish 
+  
 /* code modified from that posted on:
  * http://forum.sun.com/jive/thread.jspa?threadID=84804&tstart=30
  */
@@ -290,4 +299,61 @@
    return NULL;
 }
 
+# else    // Darwin
+
+#ifndef max
+# define        max(a,b)        ((a) > (b) ? (a) : (b))
+#endif /* !max */
+
+char * AXIS2_CALL
+axis2_uuid_get_mac_addr()
+{
+    struct ifconf ifc;
+    struct ifreq *ifr;
+    int sockfd;
+    char buffer[512], *cp, *cplim;
+
+    sockfd = socket(AF_INET, SOCK_DGRAM, 0);
+    if (sockfd < 0) {
+        perror("socket failed");
+        return NULL;
+    }
+
+    ifc.ifc_len = 512;
+    ifc.ifc_buf = buffer;
+
+    if (ioctl(sockfd, SIOCGIFCONF, (char *)&ifc) < 0)
+    {
+        perror("ioctl error");
+        close(sockfd);
+        return NULL;
+    }
+
+    ifr = ifc.ifc_req;
+
+    cplim = buffer + ifc.ifc_len;
+
+    char * macaddr = NULL;
+
+    for (cp=buffer; cp < cplim && macaddr == NULL; )
+    {
+        ifr = (struct ifreq *)cp;
+        if (ifr->ifr_addr.sa_family == AF_LINK)
+        {
+            struct sockaddr_dl *sdl = (struct sockaddr_dl *)&ifr->ifr_addr;
+
+            /* just take the ethernet adapters */
+            if (sdl->sdl_type == IFT_ETHER)
+            {
+                macaddr = (char *)ether_ntoa(LLADDR(sdl));
+            }
+        }
+        cp += sizeof(ifr->ifr_name) + max(sizeof(ifr->ifr_addr), ifr->ifr_addr.sa_len);
+
+    }
+
+    close(sockfd);
+    return macaddr;
+}
+# endif
 #endif

Modified: webservices/axis2/trunk/c/xml_schema/samples/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/samples/Makefile.am?view=diff&rev=446827&r1=446826&r2=446827
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/samples/Makefile.am (original)
+++ webservices/axis2/trunk/c/xml_schema/samples/Makefile.am Sat Sep 16 00:56:20 2006
@@ -7,7 +7,7 @@
 test_schema_LDADD   =   \
 			$(top_builddir)/src/libaxis2_xml_schema.la \
 			-laxis2_axiom \
-			-laxis2_parser
+			-laxis2_parser 
 
 INCLUDES = -I$(top_builddir)/include \
 		@UTILINC@ 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org