From 62a0bd7ecde92194c62ad9e89b6ccff6b090d756 Mon Sep 17 00:00:00 2001 From: "mccabe%netscape.com" Date: Fri, 23 Apr 1999 09:10:09 +0000 Subject: [PATCH] Removed the XPTDIR environment variable requirement; the xpt typelib directory is now constructed by adding 'components' to the executable directory. This adds an -lraptorbase requirement to linking against xptinfo. git-svn-id: svn://10.0.0.236/trunk@28826 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js/src/xpconnect/tests/Makefile.in | 1 + mozilla/xpcom/libxpt/xptcall/tests/Makefile.in | 1 + .../libxpt/xptinfo/src/nsInterfaceInfoManager.cpp | 15 +++++++++++++++ mozilla/xpcom/libxpt/xptinfo/tests/Makefile.in | 1 + mozilla/xpcom/reflect/xptcall/tests/Makefile.in | 1 + .../xptinfo/src/nsInterfaceInfoManager.cpp | 15 +++++++++++++++ mozilla/xpcom/reflect/xptinfo/tests/Makefile.in | 1 + 7 files changed, 35 insertions(+) diff --git a/mozilla/js/src/xpconnect/tests/Makefile.in b/mozilla/js/src/xpconnect/tests/Makefile.in index d0bf7c855e2..e78ca1955b4 100644 --- a/mozilla/js/src/xpconnect/tests/Makefile.in +++ b/mozilla/js/src/xpconnect/tests/Makefile.in @@ -46,6 +46,7 @@ LIBS = \ -lxptcall \ -lxptcmd \ -lreg \ + -lraptorbase \ -l$(MOZ_LIB_UTIL_PREFIX)util \ $(NSPR_LIBS) \ $(NULL) diff --git a/mozilla/xpcom/libxpt/xptcall/tests/Makefile.in b/mozilla/xpcom/libxpt/xptcall/tests/Makefile.in index 8c2349d01e8..b86a8cc0f5d 100644 --- a/mozilla/xpcom/libxpt/xptcall/tests/Makefile.in +++ b/mozilla/xpcom/libxpt/xptcall/tests/Makefile.in @@ -41,6 +41,7 @@ LIBS = \ -lxptcmd \ -lxptinfo \ -lreg \ + -lraptorbase \ -l$(MOZ_LIB_UTIL_PREFIX)util \ $(NSPR_LIBS) \ $(NULL) diff --git a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfoManager.cpp b/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfoManager.cpp index 25b3899d38d..a294578766f 100644 --- a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfoManager.cpp +++ b/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfoManager.cpp @@ -25,6 +25,8 @@ #endif #include "nscore.h" +#include "nsSpecialSystemDirectory.h" + #include "nsISupports.h" #include "nsIInterfaceInfoManager.h" #include "nsIInterfaceInfo.h" @@ -307,8 +309,21 @@ nsInterfaceInfoManager::initInterfaceTables() return NS_ERROR_FAILURE; } + // this code stolen from SetupRegistry; it might bear further + // examination, as the code there doesn't look quite done. + nsSpecialSystemDirectory + sysdir(nsSpecialSystemDirectory::OS_CurrentProcessDirectory); + sysdir += "components"; + const char *xptdirname = sysdir.GetCString(); // native path + if (xptdirname != NULL) { + fprintf(stderr, "nsInterfaceInfoManager: Using xpt dir: %s\n", xptdirname); + } + +#if 0 // First, find the xpt directory from the env. XXX Temporary hack. char *xptdirname = PR_GetEnv("XPTDIR"); +#endif + PRDir *xptdir; if (xptdirname == NULL || (xptdir = PR_OpenDir(xptdirname)) == NULL) return NS_ERROR_FAILURE; diff --git a/mozilla/xpcom/libxpt/xptinfo/tests/Makefile.in b/mozilla/xpcom/libxpt/xptinfo/tests/Makefile.in index aade388046a..6c9234370bd 100644 --- a/mozilla/xpcom/libxpt/xptinfo/tests/Makefile.in +++ b/mozilla/xpcom/libxpt/xptinfo/tests/Makefile.in @@ -37,6 +37,7 @@ LIBS = \ -lxpt \ -lxpcom \ -lreg \ + -lraptorbase \ $(NSPR_LIBS) \ $(NULL) diff --git a/mozilla/xpcom/reflect/xptcall/tests/Makefile.in b/mozilla/xpcom/reflect/xptcall/tests/Makefile.in index 8c2349d01e8..b86a8cc0f5d 100644 --- a/mozilla/xpcom/reflect/xptcall/tests/Makefile.in +++ b/mozilla/xpcom/reflect/xptcall/tests/Makefile.in @@ -41,6 +41,7 @@ LIBS = \ -lxptcmd \ -lxptinfo \ -lreg \ + -lraptorbase \ -l$(MOZ_LIB_UTIL_PREFIX)util \ $(NSPR_LIBS) \ $(NULL) diff --git a/mozilla/xpcom/reflect/xptinfo/src/nsInterfaceInfoManager.cpp b/mozilla/xpcom/reflect/xptinfo/src/nsInterfaceInfoManager.cpp index 25b3899d38d..a294578766f 100644 --- a/mozilla/xpcom/reflect/xptinfo/src/nsInterfaceInfoManager.cpp +++ b/mozilla/xpcom/reflect/xptinfo/src/nsInterfaceInfoManager.cpp @@ -25,6 +25,8 @@ #endif #include "nscore.h" +#include "nsSpecialSystemDirectory.h" + #include "nsISupports.h" #include "nsIInterfaceInfoManager.h" #include "nsIInterfaceInfo.h" @@ -307,8 +309,21 @@ nsInterfaceInfoManager::initInterfaceTables() return NS_ERROR_FAILURE; } + // this code stolen from SetupRegistry; it might bear further + // examination, as the code there doesn't look quite done. + nsSpecialSystemDirectory + sysdir(nsSpecialSystemDirectory::OS_CurrentProcessDirectory); + sysdir += "components"; + const char *xptdirname = sysdir.GetCString(); // native path + if (xptdirname != NULL) { + fprintf(stderr, "nsInterfaceInfoManager: Using xpt dir: %s\n", xptdirname); + } + +#if 0 // First, find the xpt directory from the env. XXX Temporary hack. char *xptdirname = PR_GetEnv("XPTDIR"); +#endif + PRDir *xptdir; if (xptdirname == NULL || (xptdir = PR_OpenDir(xptdirname)) == NULL) return NS_ERROR_FAILURE; diff --git a/mozilla/xpcom/reflect/xptinfo/tests/Makefile.in b/mozilla/xpcom/reflect/xptinfo/tests/Makefile.in index aade388046a..6c9234370bd 100644 --- a/mozilla/xpcom/reflect/xptinfo/tests/Makefile.in +++ b/mozilla/xpcom/reflect/xptinfo/tests/Makefile.in @@ -37,6 +37,7 @@ LIBS = \ -lxpt \ -lxpcom \ -lreg \ + -lraptorbase \ $(NSPR_LIBS) \ $(NULL)