You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2007/10/29 21:14:18 UTC
svn commit: r589837 - in /harmony/enhanced/jdktools/trunk:
make/properties.xml
modules/jpda/src/main/native/jdwp/unix/transport/dt_socket/SocketTransport_pd.h
modules/samsa/src/main/native/samsa/samsa.c
Author: hindessm
Date: Mon Oct 29 13:14:17 2007
New Revision: 589837
URL: http://svn.apache.org/viewvc?rev=589837&view=rev
Log:
Minor fixes for FreeBSD. The federation build completes now.
Modified:
harmony/enhanced/jdktools/trunk/make/properties.xml
harmony/enhanced/jdktools/trunk/modules/jpda/src/main/native/jdwp/unix/transport/dt_socket/SocketTransport_pd.h
harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c
Modified: harmony/enhanced/jdktools/trunk/make/properties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/make/properties.xml?rev=589837&r1=589836&r2=589837&view=diff
==============================================================================
--- harmony/enhanced/jdktools/trunk/make/properties.xml (original)
+++ harmony/enhanced/jdktools/trunk/make/properties.xml Mon Oct 29 13:14:17 2007
@@ -191,6 +191,12 @@
<condition property="make.command" value="nmake.exe">
<isset property="is.windows"/>
</condition>
+ <condition property="make.command" value="gmake">
+ <or>
+ <isset property="is.aix"/>
+ <isset property="is.freebsd"/>
+ </or>
+ </condition>
<property name="make.command" value="make" />
<property name="png.home" value="/usr" />
Modified: harmony/enhanced/jdktools/trunk/modules/jpda/src/main/native/jdwp/unix/transport/dt_socket/SocketTransport_pd.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/jpda/src/main/native/jdwp/unix/transport/dt_socket/SocketTransport_pd.h?rev=589837&r1=589836&r2=589837&view=diff
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/jpda/src/main/native/jdwp/unix/transport/dt_socket/SocketTransport_pd.h (original)
+++ harmony/enhanced/jdktools/trunk/modules/jpda/src/main/native/jdwp/unix/transport/dt_socket/SocketTransport_pd.h Mon Oct 29 13:14:17 2007
@@ -39,9 +39,11 @@
#include <errno.h>
#include <netdb.h>
#include <stdlib.h>
+#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/time.h>
+#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include <pthread.h>
Modified: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c?rev=589837&r1=589836&r2=589837&view=diff
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c (original)
+++ harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c Mon Oct 29 13:14:17 2007
@@ -24,20 +24,14 @@
#if defined(WIN32)
#include <windows.h>
#endif
+#if defined(FREEBSD)
+#include <dlfcn.h>
+#endif
#define TOOL_JAR "tools.jar"
#define CLASS_PREFIX "org.apache.harmony.tools."
#define CLASS_POSTFIX ".Main"
-#if defined(LINUX)
-#define PATH_SEPARATOR_CHAR '/'
-#define PATH_SEPARATOR "/"
-#define EXE_POSTFIX "/jre/bin/java"
-#define WEXE_POSTFIX "/jre/bin/javaw"
-#define LIB_POSTFIX "/lib/"
-#define CLASSPATH_SEP ":"
-#endif
-
#if defined(WIN32)
#define PATH_SEPARATOR_CHAR '\\'
#define PATH_SEPARATOR "\\"
@@ -45,6 +39,13 @@
#define WEXE_POSTFIX "\\jre\\bin\\javaw.exe"
#define LIB_POSTFIX "\\lib\\"
#define CLASSPATH_SEP ";"
+#else
+#define PATH_SEPARATOR_CHAR '/'
+#define PATH_SEPARATOR "/"
+#define EXE_POSTFIX "/jre/bin/java"
+#define WEXE_POSTFIX "/jre/bin/javaw"
+#define LIB_POSTFIX "/lib/"
+#define CLASSPATH_SEP ":"
#endif
typedef struct ToolData {
@@ -371,9 +372,7 @@
}
return temp;
- #endif
-
- #if defined(LINUX)
+ #elif defined(LINUX) || defined(FREEBSD)
/*
* if we found a slash (and someone didn't do something
@@ -385,6 +384,8 @@
else {
return strdup(name);
}
+ #else
+ #error Need to define basename-type function
#endif
}
@@ -417,19 +418,28 @@
char *last = NULL;
-#if defined(LINUX)
+#if defined(LINUX)
char buffer[PATH_MAX + 1];
int size = readlink ("/proc/self/exe", buffer, sizeof(buffer)-1);
buffer[size+1] = '\0';
-#endif
+#elif defined(FREEBSD)
+ Dl_info info;
+ char buffer[PATH_MAX + 1];
+ if (dladdr( (const void*)&main, &info) == 0) {
+ return NULL;
+ }
+ strncpy(buffer, info.dli_fname, PATH_MAX+1);
+ buffer[PATH_MAX+1] = '\0';
-#if defined(WIN32)
+#elif defined(WIN32)
char buffer[512];
DWORD dwRet = GetModuleFileName(NULL, buffer, 512);
// FIXME - handle this right - it could be that 512 isn't enough
+#else
+#error Need to implement executable name code
#endif
last = strrchr(buffer, PATH_SEPARATOR_CHAR);