Bugzilla Bug 261649: more changes for GNU/k*BSD and GNU/Hurd support.
authorwtchang%redhat.com
Sat, 24 Dec 2005 15:03:31 +0000
changeset 3521 caf60d9d640f8c27874747efe149d8b387f84d63
parent 3520 6d99ad4c70def2cb35fedcab65fd643c4f16704c
child 3532 12b112517986422eeeb146b14a6bb589cad22ddf
push idunknown
push userunknown
push dateunknown
bugs261649
Bugzilla Bug 261649: more changes for GNU/k*BSD and GNU/Hurd support. The patch is contributed by Robert Millan <rmh@aybabtu.com>. r=wtc. Modified files: nsinstall.c _pth.h pr/src/linking/Makefile.in prlink.c pr/tests/Makefile.in
config/nsinstall.c
pr/include/md/_pth.h
pr/src/linking/Makefile.in
pr/src/linking/prlink.c
pr/tests/Makefile.in
--- a/config/nsinstall.c
+++ b/config/nsinstall.c
@@ -93,17 +93,17 @@ my_getcwd (char *buf, size_t size)
     if (result) {
         buf[strlen(buf)-1] = '\0';
     }
     pclose (pwd);
     return buf;
 }
 #endif /* NEXTSTEP */
 
-#ifdef LINUX
+#if defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) 
 #include <getopt.h>
 #endif
 
 #if defined(SCO) || defined(UNIXWARE) || defined(SNI) || defined(NCR) || defined(NEC) || defined(NEXTSTEP)
 #if !defined(S_ISLNK) && defined(S_IFLNK)
 #define S_ISLNK(a)	(((a) & S_IFMT) == S_IFLNK)
 #endif
 #endif
--- a/pr/include/md/_pth.h
+++ b/pr/include/md/_pth.h
@@ -195,17 +195,18 @@
 #else
 #define PT_TRYLOCK_SUCCESS 0
 #define PT_TRYLOCK_BUSY    EBUSY
 #endif
 
 /*
  * These platforms don't have sigtimedwait()
  */
-#if (defined(AIX) && !defined(AIX4_3_PLUS)) || defined(LINUX) \
+#if (defined(AIX) && !defined(AIX4_3_PLUS)) \
+	|| defined(LINUX) || defined(__GNU__)|| defined(__GLIBC__) \
 	|| defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
 	|| defined(BSDI) || defined(VMS) || defined(UNIXWARE) \
 	|| defined(DARWIN)
 #define PT_NO_SIGTIMEDWAIT
 #endif
 
 /*
  * These platforms don't have pthread_kill()
--- a/pr/src/linking/Makefile.in
+++ b/pr/src/linking/Makefile.in
@@ -58,17 +58,17 @@ CSRCS =           \
 	prlink.c   \
 	$(NULL)
 
 TARGETS	= $(OBJS)
 
 INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
 
 # For Dl_info and dladdr.
-ifeq (,$(filter-out Linux GNU GNU_kFreeBSD GNU_kNetBSD,$(OS_TARGET)))
+ifeq (,$(filter-out Linux GNU GNU_%,$(OS_TARGET)))
 DEFINES    += -D_GNU_SOURCE
 endif
 
 # On Mac OS X use flat #includes.
 ifeq ($(OS_TARGET),MacOSX)
 INCLUDES    += -I$(MACOS_SDK_DIR)/Developer/Headers/FlatCarbon
 endif
 
--- a/pr/src/linking/prlink.c
+++ b/pr/src/linking/prlink.c
@@ -1384,17 +1384,17 @@ PR_LoadStaticLibrary(const char *name, c
     PR_ExitMonitor(pr_linker_lock);
     return result;
 }
 
 PR_IMPLEMENT(char *)
 PR_GetLibraryFilePathname(const char *name, PRFuncPtr addr)
 {
 #if defined(SOLARIS) || defined(FREEBSD) \
-        || defined(LINUX) || defined(__GLIBC__)
+        || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__)
     Dl_info dli;
     char *result;
 
     if (dladdr((void *)addr, &dli) == 0) {
         PR_SetError(PR_LIBRARY_NOT_LOADED_ERROR, _MD_ERRNO());
         DLLErrorInternal(_MD_ERRNO());
         return NULL;
     }
--- a/pr/tests/Makefile.in
+++ b/pr/tests/Makefile.in
@@ -371,17 +371,17 @@ ifeq ($(OS_ARCH), NEWS-OS)
 # libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
 # option for ld on other platforms.
 #export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
     LIBNSPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
     LIBPLC = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).a
     EXTRA_LIBS = -lsocket -lnsl -lgen -lresolv
 endif
 
-ifeq (,$(filter-out Linux GNU GNU_kFreeBSD GNU_kNetBSD,$(OS_ARCH)))
+ifeq (,$(filter-out Linux GNU GNU_%,$(OS_ARCH)))
     LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR)
     ifeq ($(USE_PTHREADS),1)
         EXTRA_LIBS = -lpthread
     endif
 endif
 
 ifeq ($(OS_ARCH), SCOOS)
 # SCO Unix needs to link against -lsocket again even though we