Fix Javaconnect build bustage on Win32. r=tor, a=mkaply. Not part of default build.

This commit is contained in:
pedemont%us.ibm.com 2005-06-08 16:41:19 +00:00
Родитель fdbe109b8c
Коммит eea43f64b5
5 изменённых файлов: 56 добавлений и 32 удалений

Просмотреть файл

@ -4519,18 +4519,23 @@ if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
if test -n "${JAVA_BIN_PATH}"; then
dnl Look for javac and jar in the specified path.
AC_PATH_PROG(JAVAC, javac, :, $JAVA_BIN_PATH)
AC_PATH_PROG(JAR, jar, :, $JAVA_BIN_PATH)
if test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
AC_MSG_ERROR([The programs javac and jar were not found in given path $JAVA_BIN_PATH.])
fi
_JAVA_PATH=$JAVA_BIN_PATH
else
dnl No path specified, so look for javac and jar are in $JAVA_HOME & $PATH.
AC_PATH_PROG(JAVAC, javac, :, [$JAVA_HOME/bin:$PATH])
AC_PATH_PROG(JAR, jar, :, [$JAVA_HOME/bin:$PATH])
if test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
AC_MSG_ERROR([The programs javac and jar were not found. Set \$JAVA_HOME or use --with-java-bin-path={java-bin-dir}.])
fi
_JAVA_PATH=$JAVA_HOME/bin:$PATH
fi
case "$host_os" in
mingw*|cygwin*|msvc*|mks*)
JAVA_PATH=`cygpath -u $_JAVA_PATH`
;;
*)
JAVA_PATH=$_JAVA_PATH
;;
esac
AC_PATH_PROG(JAVAC, javac, :, $JAVA_PATH)
AC_PATH_PROG(JAR, jar, :, $JAVA_PATH)
if test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
AC_MSG_ERROR([The programs javac and jar were not found. Set \$JAVA_HOME or use --with-java-bin-path={java-bin-dir}.])
fi
fi

Просмотреть файл

@ -68,6 +68,14 @@ ifdef MOZ_DEBUG
JAVAC_FLAGS = -g
endif
ifeq ($(OS_ARCH),WINNT)
RUN =
OUTPUT_DIR = $(shell cygpath -w $(CURDIR)/_javagen/org/mozilla/xpcom)
else
RUN = $(DIST)/bin/run-mozilla.sh
OUTPUT_DIR = $(CURDIR)/_javagen/org/mozilla/xpcom
endif
_javagen/org/mozilla/xpcom/.iface_done:
@if test ! -d _javagen/org/mozilla/xpcom; then \
touch .done; \
@ -79,13 +87,15 @@ _javagen/org/mozilla/xpcom/.iface_done:
@$(INSTALL) -m 644 $(addprefix ../,$(GEN_JAVA_SRCS)) \
_javagen/org/mozilla/xpcom
@echo Generating Java interface files
$(DIST)/bin/run-mozilla.sh $(DIST)/bin/GenerateJavaInterfaces$(BIN_SUFFIX) \
-d $(CURDIR)/_javagen/org/mozilla/xpcom
$(RUN) $(DIST)/bin/GenerateJavaInterfaces$(BIN_SUFFIX) -d $(OUTPUT_DIR)
@touch $@
# Use find and xargs for passing list of Java files to JAVAC. This avoids the
# "argument list too long" error on Windows when using *.java
org/mozilla/xpcom/.class_done: _javagen/org/mozilla/xpcom/.iface_done
@echo Compiling Java interface classes
@$(JAVAC) $(JAVAC_FLAGS) -classpath . -d . _javagen/org/mozilla/xpcom/*.java
find _javagen -name *.java | xargs $(JAVAC) $(JAVAC_FLAGS) -classpath . -d . \
-sourcepath _javagen
@touch $@
$(JARFILE): org/mozilla/xpcom/.class_done Makefile

Просмотреть файл

@ -186,7 +186,7 @@ nsJavaXPTCStub::ReleaseWeakRef()
{
// if this is a child
if (mMaster)
return mMaster->ReleaseWeakRef();
mMaster->ReleaseWeakRef();
--mWeakRefCnt;

Просмотреть файл

@ -228,11 +228,12 @@ TestParams::TestSimpleTypeArrayInOut(PRUint32 aCount, PRInt16** aArray)
printf("-> TestSimpleTypeArrayInOut()\n");
printf("in:\n");
for (PRUint32 i = 0; i < aCount; i++) {
PRUint32 i;
for (i = 0; i < aCount; i++) {
printf("[%d] %d\n", i, aArray[0][i]);
}
for (PRUint32 i = 0; i < aCount/2; i++) {
for (i = 0; i < aCount/2; i++) {
PRUint32 index = aCount - 1 - i;
PRUint16 temp = aArray[0][index];
aArray[0][index] = aArray[0][i];
@ -248,11 +249,12 @@ TestParams::TestCharStrTypeArrayInOut(PRUint32 aCount, char*** aArray)
printf("-> TestCharStrTypeArrayInOut()\n");
printf("in:\n");
for (PRUint32 i = 0; i < aCount; i++) {
PRUint32 i;
for (i = 0; i < aCount; i++) {
printf("[%d] %s\n", i, aArray[0][i]);
}
for (PRUint32 i = 0; i < aCount/2; i++) {
for (i = 0; i < aCount/2; i++) {
PRUint32 index = aCount - 1 - i;
char* temp = aArray[0][index];
aArray[0][index] = aArray[0][i];
@ -268,12 +270,13 @@ TestParams::TestWCharStrTypeArrayInOut(PRUint32 aCount, PRUnichar*** aArray)
printf("-> TestWCharStrTypeArrayInOut()\n");
printf("in:\n");
for (PRUint32 i = 0; i < aCount; i++) {
PRUint32 i;
for (i = 0; i < aCount; i++) {
nsAutoString tmp(aArray[0][i]);
printf("[%d] %s\n", i, NS_LossyConvertUCS2toASCII(tmp).get());
}
for (PRUint32 i = 0; i < aCount/2; i++) {
for (i = 0; i < aCount/2; i++) {
PRUint32 index = aCount - 1 - i;
PRUnichar* temp = aArray[0][index];
aArray[0][index] = aArray[0][i];
@ -289,13 +292,14 @@ TestParams::TestIIDTypeArrayInOut(PRUint32 aCount, nsIID*** aArray)
printf("-> TestIIDTypeArrayInOut()\n");
printf("in:\n");
for (PRUint32 i = 0; i < aCount; i++) {
PRUint32 i;
for (i = 0; i < aCount; i++) {
char* iid = aArray[0][i]->ToString();
printf("[%d] %s\n", i, iid);
PR_Free(iid);
}
for (PRUint32 i = 0; i < aCount/2; i++) {
for (i = 0; i < aCount/2; i++) {
PRUint32 index = aCount - 1 - i;
nsID* temp = aArray[0][index];
aArray[0][index] = aArray[0][i];
@ -311,13 +315,14 @@ TestParams::TestIfaceTypeArrayInOut(PRUint32 aCount, nsILocalFile*** aArray)
printf("-> TestIfaceTypeArrayInOut()\n");
printf("in:\n");
for (PRUint32 i = 0; i < aCount; i++) {
PRUint32 i;
for (i = 0; i < aCount; i++) {
nsAutoString path;
aArray[0][i]->GetPath(path);
printf("[%d] %s\n", i, NS_LossyConvertUCS2toASCII(path).get());
}
for (PRUint32 i = 0; i < aCount/2; i++) {
for (i = 0; i < aCount/2; i++) {
PRUint32 index = aCount - 1 - i;
nsILocalFile* temp = aArray[0][index];
aArray[0][index] = aArray[0][i];

Просмотреть файл

@ -48,6 +48,10 @@
#include "nsIWeakReference.h"
#include <stdio.h>
#ifdef WIN32
#define snprintf _snprintf
#endif
#define WRITE_NOSCRIPT_METHODS
@ -191,8 +195,8 @@ public:
#ifdef WRITE_NOSCRIPT_METHODS
size = NS_ARRAY_LENGTH(kNoscriptMethodIfaces);
mNoscriptMethodsTable.Init(size);
for (PRUint32 i = 0; i < size; i++) {
mNoscriptMethodsTable.Put(nsDependentCString(kNoscriptMethodIfaces[i]));
for (PRUint32 j = 0; j < size; j++) {
mNoscriptMethodsTable.Put(nsDependentCString(kNoscriptMethodIfaces[j]));
}
#endif
}
@ -640,17 +644,17 @@ public:
NS_ENSURE_SUCCESS(rv, rv);
// write parameters
for (PRUint8 i = 0; i < paramCount; i++) {
const nsXPTParamInfo &paramInfo = aMethodInfo->GetParam(i);
for (PRUint8 j = 0; j < paramCount; j++) {
const nsXPTParamInfo &paramInfo = aMethodInfo->GetParam(j);
if (paramInfo.IsRetval())
continue;
if (i != 0) {
if (j != 0) {
rv = out->Write(kParamSeparator, sizeof(kParamSeparator) - 1, &count);
NS_ENSURE_SUCCESS(rv, rv);
}
rv = WriteParam(out, aIInfo, aMethodIndex, &paramInfo, i + 1);
rv = WriteParam(out, aIInfo, aMethodIndex, &paramInfo, j + 1);
NS_ENSURE_SUCCESS(rv, rv);
}
@ -826,8 +830,8 @@ int main(int argc, char** argv)
}
// see if given path exists
output_dir = new nsLocalFile();
rv = output_dir->InitWithNativePath(nsDependentCString(argv[++i]));
rv = NS_NewNativeLocalFile(nsDependentCString(argv[++i]), PR_TRUE,
getter_AddRefs(output_dir));
PRBool val;
if (NS_FAILED(rv) || NS_FAILED(output_dir->Exists(&val)) || !val ||
NS_FAILED(output_dir->IsDirectory(&val)) || !val)