Add ifdefs for using autoconf. Designed with cross-compiling as a secondary objective. unlabeled-1.1.2
authorcls%seawood.org
Tue, 22 Jun 1999 08:12:40 +0000
branchunlabeled-1.1.2
changeset 664 60c21900c2247f15c6805c866ab9ef970f00a58b
parent 481 fd6a58d95d5ce917c764263034a442702384b5c2
child 671 3759696b5234d54b324bfea4fb1cb76370d5f380
push idunknown
push userunknown
push dateunknown
Add ifdefs for using autoconf. Designed with cross-compiling as a secondary objective.
configure.in
lib/prstreams/tests/testprstrm/Makefile.in
pr/src/bthreads/Makefile.in
pr/src/cplus/Makefile.in
pr/src/cplus/tests/Makefile.in
pr/src/md/beos/Makefile.in
new file mode 100644
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,246 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.12)
+AC_INIT(config/libc_r.h)
+
+d=`pwd`
+if test "${srcdir}" = "$d" || test "${srcdir}" = "."  ; then
+   echo "Do not build in the srcdir as it will override Makefiles used by non-autoconf build."
+   exit 1;
+fi
+
+AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
+AC_CANONICAL_SYSTEM
+
+dnl Set this define to make fixes w/o breaking anything else.
+AC_DEFINE(USE_AUTOCONF)
+
+dnl Always set this for mozilla.
+AC_DEFINE(MOZILLA_CLIENT)
+
+dnl ========================================================
+dnl =
+dnl = Dont change the following two lines.  Doing so breaks:
+dnl =
+dnl = CFLAGS="-foo" ./configure
+dnl =
+dnl ========================================================
+CFLAGS="${CFLAGS=}"
+CXXFLAGS="${CXXFLAGS=}"
+HOSTCFLAGS="${HOSTCFLAGS=}"
+HOSTCXXFLAGS="${HOSTCXXFLAGS=}"
+
+AC_ARG_ENABLE(pthreads,
+    [  --enable-pthreads           Use system pthreads library as thread subsystem],
+    USE_PTHREADS=1,
+    USE_PTHREADS=)
+
+AC_ARG_ENABLE(bthreads,
+    [  --enable-bthreads           Use system bthreads library as thread subsystem],
+    USE_BTHREADS=1,
+    USE_BTHREADS=)
+
+AC_ARG_ENABLE(cplus,
+    [  --enable-cplus              Use cplus for whatever reason],
+    USE_CPLUS=1,
+    USE_CPLUS=)
+
+AC_ARG_ENABLE(ipv6,
+    [  --enable-ipv6               Compile ipv6 support],
+    USE_IPV6=1,
+    USE_IPV6=)
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_CPP
+AC_PROG_CXXCPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PATH_PROGS(PERL, perl5 perl, :)
+
+if test "$cross_compiling" = "no"; then
+    if test "$HOSTCC" = ""; then
+	HOSTCC=$CC
+    fi
+    if test "$HOSTCXX" = ""; then
+	HOSTCXX=$CXX
+    fi
+    if test "$HOSTCFLAGS" = ""; then
+	HOSTCFLAGS=$CFLAGS
+    fi
+    if test "$HOSTCXXFLAGS" = ""; then
+	HOSTCXXFLAGS=$CXXFLAGS
+    fi
+else
+# do some stuff
+    echo "Cross compiling"
+fi
+
+echo "Using $host $build $target"
+case "$host" in
+*-linux*)
+    HOSTCFLAGS="$HOSTCFLAGS -DXP_UNIX"
+    HOSTCXXFLAGS="$HOSTCXXFLAGS -DXP_UNIX"
+    ;;
+
+esac
+
+case "$target" in
+*-linux*)
+    MDCPUCFG_H=_linux.cfg
+    PR_MD_CSRCS=linux.c
+    PR_MD_ASFILES=
+    if test "$USE_PTHREADS" = 1 ; then
+	CFLAGS="$CFLAGS -D_REENTRANT"
+    else
+	CFLAGS="$CFLAGS -D_PR_LOCAL_THREADS_ONLY"
+    fi
+    ;;
+
+*-mingw*)
+    MDCPUCFG_H=_winnt.cfg
+    ;;
+esac
+
+dnl Replace `main' with a function in -lC:
+AC_CHECK_LIB(C, main)
+dnl Replace `main' with a function in -lC_r:
+AC_CHECK_LIB(C_r, main)
+dnl Replace `main' with a function in -lc:
+AC_CHECK_LIB(c, main)
+dnl Replace `main' with a function in -lc_r:
+AC_CHECK_LIB(c_r, main)
+dnl Replace `main' with a function in -ldce:
+AC_CHECK_LIB(dce, main)
+dnl Replace `main' with a function in -ldl:
+AC_CHECK_LIB(dl, main)
+dnl Replace `main' with a function in -ldld:
+AC_CHECK_LIB(dld, main)
+dnl Replace `main' with a function in -lgen:
+AC_CHECK_LIB(gen, main)
+dnl Replace `main' with a function in -lip6:
+AC_CHECK_LIB(ip6, main)
+dnl Replace `main' with a function in -ll:
+AC_CHECK_LIB(l, main)
+dnl Replace `main' with a function in -lm:
+AC_CHECK_LIB(m, main)
+dnl Replace `main' with a function in -lnsl:
+AC_CHECK_LIB(nsl, main)
+dnl Replace `main' with a function in -lposix4:
+AC_CHECK_LIB(posix4, main)
+dnl Replace `main' with a function in -lprstrms:
+AC_CHECK_LIB(prstrms, main)
+dnl Replace `main' with a function in -lprstrms_shr:
+AC_CHECK_LIB(prstrms_shr, main)
+dnl Replace `main' with a function in -lpthread:
+AC_CHECK_LIB(pthread, main)
+dnl Replace `main' with a function in -lpthreads:
+AC_CHECK_LIB(pthreads, main)
+dnl Replace `main' with a function in -lresolv:
+AC_CHECK_LIB(resolv, main)
+dnl Replace `main' with a function in -lrt:
+AC_CHECK_LIB(rt, main)
+dnl Replace `main' with a function in -lsocket:
+AC_CHECK_LIB(socket, main)
+dnl Replace `main' with a function in -lsvld:
+AC_CHECK_LIB(svld, main)
+dnl Replace `main' with a function in -lthread:
+AC_CHECK_LIB(thread, main)
+dnl Replace `main' with a function in -lvms_jackets:
+AC_CHECK_LIB(vms_jackets, main)
+
+dnl Checks for header files.
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_UID_T
+AC_TYPE_MODE_T
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_STRUCT_ST_BLKSIZE
+AC_STRUCT_ST_BLOCKS
+AC_STRUCT_ST_RDEV
+AC_HEADER_TIME
+AC_STRUCT_TM
+
+dnl Checks for library functions.
+AC_PROG_GCC_TRADITIONAL
+AC_FUNC_MEMCMP
+AC_FUNC_MMAP
+dnl AC_FUNC_SETVBUF_REVERSED
+AC_FUNC_STRCOLL
+AC_FUNC_STRFTIME
+AC_FUNC_UTIME_NULL
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
+
+AC_SUBST(CC)
+AC_SUBST(CXX)
+AC_SUBST(CFLAGS)
+AC_SUBST(CXXFLAGS)
+AC_SUBST(HOSTCC)
+AC_SUBST(HOSTCXX)
+AC_SUBST(HOSTCFLAGS)
+AC_SUBST(HOSTCXXFLAGS)
+
+AC_SUBST(MDCPUCFG_H)
+AC_SUBST(USE_PTHREADS)
+AC_SUBST(USE_BTHREADS)
+AC_SUBST(USE_CPLUS)
+AC_SUBST(USE_IPV6)
+AC_SUBST(PR_MD_CSRCS)
+AC_SUBST(PR_MD_ASFILES)
+
+AC_SUBST(DEFS)
+
+AC_OUTPUT(
+Makefile 
+config/Makefile
+config/autoconf.mk
+lib/Makefile 
+lib/ds/Makefile 
+lib/libc/Makefile 
+lib/libc/include/Makefile 
+lib/libc/src/Makefile 
+lib/msgc/Makefile 
+lib/msgc/include/Makefile 
+lib/msgc/src/Makefile 
+lib/msgc/tests/Makefile
+lib/prstreams/Makefile 
+lib/tests/Makefile 
+pr/Makefile 
+pr/include/Makefile 
+pr/include/md/Makefile 
+pr/include/obsolete/Makefile 
+pr/include/private/Makefile 
+pr/src/Makefile 
+pr/src/bthreads/Makefile 
+pr/src/cplus/Makefile 
+pr/src/cplus/tests/Makefile 
+pr/src/io/Makefile 
+pr/src/linking/Makefile 
+pr/src/malloc/Makefile 
+pr/src/md/Makefile 
+pr/src/md/beos/Makefile 
+pr/src/md/os2/Makefile 
+pr/src/md/unix/Makefile 
+pr/src/md/windows/Makefile 
+pr/src/memory/Makefile 
+pr/src/misc/Makefile 
+pr/src/pthreads/Makefile 
+pr/src/threads/Makefile 
+pr/src/threads/combined/Makefile 
+pr/tests/Makefile 
+pr/tests/dll/Makefile 
+pr/tests/w16gui/Makefile 
+tools/Makefile 
+)
+
+dnl lib/prstreams/tests/testprstrm/Makefile 
+dnl lib/tests/windows/makefile 
+
new file mode 100644
--- /dev/null
+++ b/lib/prstreams/tests/testprstrm/Makefile.in
@@ -0,0 +1,219 @@
+#
+# The contents of this file are subject to the Netscape Public License
+# Version 1.1 (the "NPL"); you may not use this file except in
+# compliance with the NPL.  You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+# 
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+# 
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation.  Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation.  All Rights
+# Reserved.
+#
+
+#! gmake
+
+MOD_DEPTH	= ../../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+
+include $(MOD_DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/config.mk
+
+ifeq ($(OS_TARGET), WIN16)
+OS_CFLAGS = $(OS_EXE_CFLAGS)
+endif
+
+CXXSRCS =           \
+	testprstrm.cpp    \
+	$(NULL)
+
+OBJS = $(addprefix $(OBJDIR)/,$(CXXSRCS:.cpp=.$(OBJ_SUFFIX)))
+
+ifeq ($(OS_ARCH), WINNT)
+PROG_SUFFIX = .exe
+else
+PROG_SUFFIX =
+endif
+
+PROGS = $(addprefix $(OBJDIR)/, $(CXXSRCS:.cpp=$(PROG_SUFFIX)))
+
+TARGETS = $(PROGS) $(OBJS)
+
+INCLUDES = -I$(DIST)/include
+
+# Setting the variables LDOPTS and LIBPR.  We first initialize
+# them to the default values, then adjust them for some platforms.
+LDOPTS = -L$(DIST)/lib
+LIBPR = -lnspr$(MOD_VERSION)
+LIBPRSTRMS = -lprstrms$(MOD_VERSION)
+
+ifeq ($(OS_ARCH), WINNT)
+ifeq ($(OS_TARGET), WIN16)
+  LIBPR = $(DIST)/lib/nspr$(MOD_VERSION).lib
+  LIBPRSTRMS = $(DIST)/lib/prstrms$(MOD_VERSION).lib
+else
+  LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
+  ifeq ($(OS_TARGET), WIN95)
+    LIBPR = $(DIST)/lib/nspr$(MOD_VERSION).$(LIB_SUFFIX)
+    LIBPRSTRMS = $(DIST)/lib/prstrms$(MOD_VERSION).$(LIB_SUFFIX)
+  else
+    LIBPR = $(DIST)/lib/libnspr$(MOD_VERSION).$(LIB_SUFFIX)
+    LIBPRSTRMS = $(DIST)/lib/libprstrms$(MOD_VERSION).$(LIB_SUFFIX)
+  endif
+endif
+endif
+
+ifneq ($(OS_ARCH), WINNT)
+PWD = $(shell pwd)
+endif
+
+ifeq ($(OS_ARCH), IRIX)
+LDOPTS += -rpath $(PWD)/$(DIST)/lib
+endif
+
+ifeq ($(OS_ARCH), OSF1)
+LDOPTS += -rpath $(PWD)/$(DIST)/lib
+endif
+
+ifeq ($(OS_ARCH), HP-UX)
+LDOPTS += -Wl,+s,+b,$(PWD)/$(DIST)/lib
+endif
+
+# AIX
+ifeq ($(OS_ARCH),AIX)
+LDOPTS += -blibpath:$(PWD)/$(DIST)/lib:/usr/lib:/lib
+ifeq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
+LIBPR = -lnspr$(MOD_VERSION)_shr
+LIBPRSTRMS = -lprstrms$(MOD_VERSION)_shr
+else
+LDOPTS += -brtl
+EXTRA_LIBS = -ldl
+endif
+endif
+
+# Solaris
+ifeq ($(OS_ARCH), SunOS)
+ifneq ($(OS_RELEASE), 4.1.3_U1)
+ifdef NS_USE_GCC
+LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(DIST)/lib
+else
+LDOPTS += -R $(PWD)/$(DIST)/lib
+# CC on SunOS 5.4 and 5.5.x need to link with -lthread or -lpthread
+# (or use the -mt switch) even though we already linked with these
+# system libraries when we built libnspr.so.
+ifdef USE_PTHREADS
+EXTRA_LIBS = -lpthread
+else
+EXTRA_LIBS = -lthread
+endif # USE_PTHREADS
+endif # NS_USE_GCC
+endif # 4.1.3_U1
+endif # SunOS
+
+ifeq ($(OS_ARCH), NCR)
+# XXX: We see some strange problems when we link with libnspr.so.
+# So for now we use static libraries on NCR.  The shared library
+# stuff below is commented out.
+LIBPR = $(DIST)/lib/libnspr$(MOD_VERSION).a
+LIBPRSTRMS = $(DIST)/lib/libprstrms$(MOD_VERSION).a
+EXTRA_LIBS = -lsocket -lnsl -ldl
+
+# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
+# implicitly by $(CC)) again even though we already linked with these
+# system libraries when we built libnspr.so.
+#EXTRA_LIBS = -lsocket -lnsl
+# This hardcodes in the executable programs the directory to find
+# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
+# option for ld on other platforms.
+#export LD_RUN_PATH = $(PWD)/$(DIST)/lib
+endif
+
+ifeq ($(OS_ARCH), SCOOS)
+# SCO Unix needs to link against -lsocket again even though we
+# already linked with these system libraries when we built libnspr.so.
+EXTRA_LIBS = -lsocket
+# This hardcodes in the executable programs the directory to find
+# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath
+# option for ld on other platforms.
+export LD_RUN_PATH = $(PWD)/$(DIST)/lib
+endif
+
+ifeq ($(OS_ARCH), UNIXWARE)
+export LD_RUN_PATH = $(PWD)/$(DIST)/lib
+endif
+
+#####################################################
+#
+# The rules
+#
+#####################################################
+
+include $(topsrcdir)/config/rules.mk
+
+AIX_PRE_4_2 = 0
+ifeq ($(OS_ARCH),AIX)
+ifneq ($(OS_RELEASE),4.2)
+ifneq ($(USE_PTHREADS), 1)
+#AIX_PRE_4_2 = 1
+endif
+endif
+endif
+
+ifeq ($(AIX_PRE_4_2),1)
+
+# AIX releases prior to 4.2 need a special two-step linking hack
+# in order to both override the system select() and be able to 
+# get at the original system select().
+#
+# We use a pattern rule in ns/nspr20/config/rules.mk to generate
+# the .$(OBJ_SUFFIX) file from the .c source file, then do the
+# two-step linking hack below.
+
+$(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX)
+	@$(MAKE_OBJDIR)
+	rm -f $@ $(AIX_TMP)
+	$(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(DIST)/lib/libnspr$(MOD_VERSION).a
+	$(CC) -o $@ $(AIX_TMP) $(AIX_WRAP)
+	rm -f $(AIX_TMP)
+
+else
+
+# All platforms that are not AIX pre-4.2.
+
+$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
+	@$(MAKE_OBJDIR)
+ifeq ($(OS_ARCH), WINNT)
+ifeq ($(OS_TARGET),WIN16)
+	echo system windows >w16link
+	echo option map >>w16link
+	echo option stack=10K >>w16link
+	echo option heapsize=32K >>w16link
+	echo debug $(DEBUGTYPE) all >>w16link
+	echo name $@  >>w16link
+	echo file >>w16link
+	echo $<  >>w16link
+	echo library  >>w16link
+	echo $(LIBPR),	     >>w16link
+	echo $(LIBPRSTRMS),		 >>w16link
+	echo winsock.lib     >>w16link
+	wlink @w16link.
+else
+	link $(LDOPTS) $< $(LIBPR) $(LIBPRSTRMS) wsock32.lib -out:$@
+endif
+else
+	$(CCC) $(XCFLAGS) $< $(LDOPTS) $(LIBPR) $(LIBPRSTRMS) $(EXTRA_LIBS) -o $@
+endif
+
+endif
+
+export:: $(TARGETS)
+install:: export
+clean::
+	rm -f $(TARGETS)
new file mode 100644
--- /dev/null
+++ b/pr/src/bthreads/Makefile.in
@@ -0,0 +1,36 @@
+#
+# The contents of this file are subject to the Mozilla Public License
+# Version 1.1 (the "MPL"); you may not use this file except in
+# compliance with the MPL.  You may obtain a copy of the MPL at
+# http://www.mozilla.org/MPL/
+# 
+# Software distributed under the MPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the MPL
+# for the specific language governing rights and limitations under the
+# MPL.
+#
+
+#! gmake
+
+MOD_DEPTH	= ../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+
+include $(MOD_DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/config.mk
+
+include bsrcs.mk
+CSRCS += $(BTCSRCS)
+
+TARGETS	= $(OBJS)
+
+INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private
+
+include $(topsrcdir)/config/rules.mk
+
+export:: $(TARGETS)
+
+install:: export
+
new file mode 100644
--- /dev/null
+++ b/pr/src/cplus/Makefile.in
@@ -0,0 +1,54 @@
+#
+# The contents of this file are subject to the Netscape Public License
+# Version 1.1 (the "NPL"); you may not use this file except in
+# compliance with the NPL.  You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+# 
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+# 
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation.  Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation.  All Rights
+# Reserved.
+#
+
+#! gmake
+
+MOD_DEPTH	= ../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+
+include $(MOD_DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/config.mk
+
+CXXSRCS =           \
+	rcbase.cpp      \
+	rccv.cpp		\
+	rcfileio.cpp    \
+	rcinrval.cpp	\
+	rcio.cpp	    \
+	rclock.cpp	    \
+	rcnetdb.cpp	    \
+	rcnetio.cpp	    \
+	rcthread.cpp	\
+	rctime.cpp      \
+	$(NULL)
+
+OBJS = $(addprefix $(OBJDIR)/,$(CXXSRCS:.cpp=.$(OBJ_SUFFIX)))
+
+TARGETS	= $(OBJS)
+
+INCLUDES = -I$(DIST)/include
+
+include $(topsrcdir)/config/rules.mk
+
+HEADERS = *.h
+
+export:: $(TARGETS)
+
+install:: export
new file mode 100644
--- /dev/null
+++ b/pr/src/cplus/tests/Makefile.in
@@ -0,0 +1,255 @@
+#
+# The contents of this file are subject to the Netscape Public License
+# Version 1.1 (the "NPL"); you may not use this file except in
+# compliance with the NPL.  You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+# 
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+# 
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation.  Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation.  All Rights
+# Reserved.
+#
+
+#! gmake
+
+MOD_DEPTH	= ../../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+
+include $(MOD_DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/config.mk
+
+ifeq ($(OS_TARGET), WIN16)
+OS_CFLAGS = $(OS_EXE_CFLAGS)
+endif
+
+CXXSRCS =           \
+	ranfile.cpp     \
+	thread.cpp      \
+	interval.cpp    \
+	time.cpp        \
+	fileio.cpp      \
+	switch.cpp      \
+	tpd.cpp         \
+	$(NULL)
+
+OBJS = $(addprefix $(OBJDIR)/,$(CXXSRCS:.cpp=.$(OBJ_SUFFIX)))
+
+ifeq ($(OS_ARCH), WINNT)
+PROG_SUFFIX = .exe
+else
+PROG_SUFFIX =
+endif
+
+PROGS = $(addprefix $(OBJDIR)/, $(CXXSRCS:.cpp=$(PROG_SUFFIX)))
+
+TARGETS = $(PROGS) $(OBJS)
+
+INCLUDES = -I.. -I$(DIST)/include
+
+# Setting the variables LDOPTS and LIBPR.  We first initialize
+# them to the default values, then adjust them for some platforms.
+LDOPTS = -L$(DIST)/lib
+LIBPR = -lnspr$(MOD_VERSION)
+LIBPL = -lplc$(MOD_VERSION)
+
+ifeq ($(OS_ARCH), IRIX)
+    LDOPTS += -rpath $(PWD)/$(DIST)/lib -rdata_shared
+    # For 6.x machines, include this flag
+    ifeq ($(basename $(OS_RELEASE)),6)
+        ifeq ($(USE_N32),1)
+            LDOPTS += -n32
+        else
+            LDOPTS += -32
+        endif
+
+        ifeq ($(USE_PTHREADS), 1)
+            ifeq ($(OS_RELEASE), 6.2)
+                LDOPTS += -Wl,-woff,85
+            endif
+        endif
+    endif
+endif
+
+# Solaris
+ifeq ($(OS_ARCH), SunOS)
+    ifneq ($(OS_RELEASE), 4.1.3_U1)
+        ifdef NS_USE_GCC
+            LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(DIST)/lib
+        else
+            LDOPTS += -R $(PWD)/$(DIST)/lib
+        endif
+    endif
+
+    ifneq ($(LOCAL_THREADS_ONLY),1)
+# SunOS 5.4 and 5.5 need to link with -lthread or -lpthread,
+# even though we already linked with these system libraries
+# when we built libnspr.so.
+        ifeq ($(OS_RELEASE), 5.4)
+            EXTRA_LIBS = -lthread
+        endif
+
+        ifeq ($(OS_RELEASE), 5.5)
+            ifdef USE_PTHREADS
+                EXTRA_LIBS = -lpthread
+            else
+                EXTRA_LIBS = -lthread
+            endif
+        endif
+    endif # LOCAL_THREADS_ONLY
+endif # SunOS
+
+ifeq ($(OS_ARCH), WINNT)
+ifeq ($(OS_TARGET), WIN16)
+  LIBPR = $(DIST)/lib/nspr$(MOD_VERSION).lib
+  LIBPL = $(DIST)/lib/plc$(MOD_VERSION).lib
+else
+  LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
+  LIBPR = $(DIST)/lib/libnspr$(MOD_VERSION).$(LIB_SUFFIX)
+  LIBPL = $(DIST)/lib/libplc$(MOD_VERSION).$(LIB_SUFFIX)
+endif
+endif
+
+ifneq ($(OS_ARCH), WINNT)
+PWD = $(shell pwd)
+endif
+
+ifeq ($(OS_ARCH), OSF1)
+LDOPTS += -rpath $(PWD)/$(DIST)/lib
+endif
+
+ifeq ($(OS_ARCH), HP-UX)
+    LDOPTS += -Wl,+s,+b,$(PWD)/$(DIST)/lib
+endif
+
+# AIX
+ifeq ($(OS_ARCH),AIX)
+    LDOPTS += -blibpath:$(PWD)/$(DIST)/lib:/usr/lib:/lib
+    ifeq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
+        LIBPR = -lnspr$(MOD_VERSION)_shr
+        LIBPLC = -lplc$(MOD_VERSION)_shr
+    else
+        LDOPTS += -brtl
+        EXTRA_LIBS = -ldl
+    endif
+endif
+
+ifeq ($(OS_ARCH), Linux)
+    ifeq ($(OS_RELEASE), 1.2)
+        EXTRA_LIBS = -ldl
+    else
+        LDOPTS += -Xlinker -rpath $(PWD)/$(DIST)/lib
+        ifeq ($(USE_PTHREADS),1)
+            EXTRA_LIBS = -lpthread
+        endif
+    endif
+endif
+
+ifeq ($(OS_ARCH), NCR)
+# XXX: We see some strange problems when we link with libnspr.so.
+# So for now we use static libraries on NCR.  The shared library
+# stuff below is commented out.
+LIBPR = $(DIST)/lib/libnspr$(MOD_VERSION).a
+LIBPL = $(DIST)/lib/libplc$(MOD_VERSION).a
+EXTRA_LIBS = -lsocket -lnsl -ldl
+
+# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
+# implicitly by $(CC)) again even though we already linked with these
+# system libraries when we built libnspr.so.
+#EXTRA_LIBS = -lsocket -lnsl
+# This hardcodes in the executable programs the directory to find
+# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
+# option for ld on other platforms.
+#export LD_RUN_PATH = $(PWD)/$(DIST)/lib
+endif
+
+ifeq ($(OS_ARCH), SCO_SV)
+# SCO Unix needs to link against -lsocket again even though we
+# already linked with these system libraries when we built libnspr.so.
+EXTRA_LIBS = -lsocket
+# This hardcodes in the executable programs the directory to find
+# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath
+# option for ld on other platforms.
+export LD_RUN_PATH = $(PWD)/$(DIST)/lib
+endif
+
+ifeq ($(OS_ARCH), UNIXWARE)
+export LD_RUN_PATH = $(PWD)/$(DIST)/lib
+endif
+
+#####################################################
+#
+# The rules
+#
+#####################################################
+
+include $(topsrcdir)/config/rules.mk
+
+AIX_PRE_4_2 = 0
+ifeq ($(OS_ARCH),AIX)
+ifneq ($(OS_RELEASE),4.2)
+ifneq ($(USE_PTHREADS), 1)
+#AIX_PRE_4_2 = 1
+endif
+endif
+endif
+
+ifeq ($(AIX_PRE_4_2),1)
+
+# AIX releases prior to 4.2 need a special two-step linking hack
+# in order to both override the system select() and be able to 
+# get at the original system select().
+#
+# We use a pattern rule in ns/nspr20/config/rules.mk to generate
+# the .$(OBJ_SUFFIX) file from the .c source file, then do the
+# two-step linking hack below.
+
+$(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX)
+	@$(MAKE_OBJDIR)
+	rm -f $@ $(AIX_TMP)
+	$(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(DIST)/lib/libnspr$(MOD_VERSION).a
+	$(CC) -o $@ $(AIX_TMP) $(AIX_WRAP)
+	rm -f $(AIX_TMP)
+
+else
+
+# All platforms that are not AIX pre-4.2.
+
+$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
+	@$(MAKE_OBJDIR)
+ifeq ($(OS_ARCH), WINNT)
+ifeq ($(OS_TARGET),WIN16)
+	echo system windows         >w16link
+	echo option map             >>w16link
+	echo option stack=10K       >>w16link
+	echo option heapsize=32K    >>w16link
+	echo debug $(DEBUGTYPE) all >>w16link
+	echo name $@                >>w16link
+	echo file                   >>w16link
+	echo $<                     >>w16link
+	echo library                >>w16link
+	echo $(LIBPR),	            >>w16link
+	echo $(LIBPL),	            >>w16link
+	echo winsock.lib            >>w16link
+	wlink @w16link.
+else
+	link $(LDOPTS) $< $(LIBPR) $(LIBPL) wsock32.lib -out:$@
+endif
+else
+	$(CCC) $(XCFLAGS) $< $(LDOPTS) $(LIBPR) $(LIBPL) $(EXTRA_LIBS) -o $@
+endif
+
+endif
+
+export:: $(TARGETS)
+install:: export
+clean::
+	rm -f $(TARGETS)
+
new file mode 100644
--- /dev/null
+++ b/pr/src/md/beos/Makefile.in
@@ -0,0 +1,33 @@
+#
+# The contents of this file are subject to the Mozilla Public License
+# Version 1.1 (the "MPL"); you may not use this file except in
+# compliance with the MPL.  You may obtain a copy of the MPL at
+# http://www.mozilla.org/MPL/
+# 
+# Software distributed under the MPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the MPL
+# for the specific language governing rights and limitations under the
+# MPL.
+#
+
+MOD_DEPTH	= ../../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+
+include $(MOD_DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/config.mk
+
+include bsrcs.mk
+CSRCS += $(MDCSRCS)
+
+TARGETS		= $(OBJS)
+
+INCLUDES = -I$(DIST)/include -I$(MOD_DEPTH)/pr/include -I$(MOD_DEPTH)/pr/include/private
+
+include $(topsrcdir)/config/rules.mk
+
+export:: $(TARGETS)
+
+install:: export