Compare commits

..

1 Commits

Author SHA1 Message Date
(no author)
258dc9fead This commit was manufactured by cvs2svn to create branch 'src'.
git-svn-id: svn://10.0.0.236/branches/src@33658 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-03 23:10:01 +00:00
413 changed files with 18627 additions and 105210 deletions

View File

@@ -1,211 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-1999
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
LDAP_DEPTH = .
NSPR_TREE = ../nsprpub
NSS_TREE = ../security
MOD_DEPTH = ../nsprpub
CORECONFDIR = ../coreconf
ALTCORECONFDIR = ../../coreconf
DEPTH = ..
CONFIGDIR = c-sdk/config
MOD_DEPTH = c-sdk
include $(CONFIGDIR)/config.mk
include c-sdk/build.mk
ifeq ($(COMPONENT_PULL_METHOD), FTP)
COMP_PULL_ARG="USE_FTP=YES"
endif
all: FORCE
@echo
@echo The following are build targets that you can choose from:
@echo
@echo " gmake buildLdapClientSDK"
@echo " gmake clean"
@echo
@echo Allowed options:
@echo
@echo " BUILD_OPT=1 for optimized build"
@echo " USE_PTHREADS=1 for using pthreads"
@echo " USE_64=1 for building 64 bit versions"
@echo " BUILD_CLU=1 build command line utilities"
@echo " COMPS_FROM_OBJDIR=1 use components from ../dist/$(OBJDIR_NAME)"
@echo " SOLARIS_USE_FORTE6=1 use Sun Workshop 6/Forte compiler on SunOS 5.6"
@echo " VENDOR_NAME=string SDK vendor name (default $(DEFAULT_VENDOR_NAME))"
@echo " VENDOR_VERSION=# vendor specific version number * 100 (default $(DEFAULT_VENDOR_VERSION))"
@echo " HAVE_SVRCORE=1 for building with svrcore"
@echo
@echo Internal options
@echo
@echo " gmake buildAndPkgLdapSDK"
@echo " gmake PullSDKComponents"
@echo " gmake pkgLdapSDK"
@echo
@echo " HAVE_LIBNLS=1 for building/linking with LIBNLS"
@echo " HAVE_CCONF=1 for building with components"
@echo " DONT_REPULL=1 for not repulling components"
@echo " PKG_PRIVATE_HDRS=0 do not ship private headers"
@echo " PKG_PRIVATE_LIBS=0 do not ship private libraries"
@echo " PKG_DEP_LIBS=0 do not ship dependent libraries"
ifneq ($(OS_ARCH), WINNT)
@echo " COMPONENT_PULL_METHOD=FTP pull components using FTP"
endif
@echo
@echo " For internal builds, coreconf must be installed"
@echo " in $(CORECONFDIR)"
buildLdapClientSDK export: PullSDKComponents
@echo
@echo ==== Starting LDAP Client SDK ==========
@echo
ifneq ($(HAVE_CCONF), 1)
@if [ -d $(NSPR_TREE)/ ]; then \
echo "NSPR $(NSPR_VERSION) directory found"; \
else \
echo "No NSPR $(NSPR_VERSION) directory found"; \
fi
@if [ -d $(NSS_TREE)/ ]; then \
echo "NSS $(NSS_VERSION) directory found"; \
else \
echo "No NSS $(NSS_VERSION) directory found"; \
fi
else
@if [ -d $(CORECONFDIR)/ ]; then \
echo "coreconf $(CORECONFDIR) directory found"; \
else \
echo "No $(CORECONFDIR) found checking for alternate location"; \
if [ -d $(ALTCORECONFDIR)/ ]; then \
echo "found $(ALTCORECONFDIR)....copying to $(CORECONFDIR)/"; \
cp -r $(ALTCORECONFDIR) $(CORECONFDIR); \
else \
echo "No coreconf directory found"; \
exit 1; \
fi \
fi
@if [ -d $(CORECONFDIR)/ ]; then \
cd $(CORECONFDIR); \
gmake; \
else \
echo "No $(CORECONFDIR) directory found"; \
fi
endif
@if [ -d $(CONFIGDIR)/ ]; then \
cd $(CONFIGDIR); \
gmake -f Makefile.client; \
else \
echo "No $(CONFIGDIR) directory found"; \
fi
@if [ -d $(LDAP_DEPTH)/c-sdk/ldap ]; then \
cd $(LDAP_DEPTH)/c-sdk/ldap; \
$(MAKE) -f Makefile.client $(MFLAGS) export; \
$(MAKE) -f Makefile.client $(MFLAGS) install; \
else \
echo "No LDAP directory -- skipping"; \
exit 0; \
fi
pkgLdapSDK: FORCE
@echo
@echo ==== Starting LDAP Client SDK packaging ===
@echo
@if [ -d $(DIST_TREE)/ ]; then \
cd $(LDAP_DEPTH)/c-sdk/; \
$(MAKE) -f package.mk $(MFLAGS) all; \
else \
echo "No dist directory found -- can't package"; \
exit 0; \
fi
buildAndPkgLdapSDK: buildLdapClientSDK pkgLdapSDK
PullSDKComponents: FORCE
@echo
@echo ==== Starting to pull components ==========
@echo
ifneq ($(DONT_REPULL), 1)
ifeq ($(HAVE_CCONF), 1)
@if [ -d $(CORECONFDIR)/ ]; then \
echo "coreconf $(CORECONFDIR) directory found"; \
else \
echo "No $(CORECONFDIR) found checking for alternate location"; \
if [ -d $(ALTCORECONFDIR)/ ]; then \
echo "found $(ALTCORECONFDIR)....copying to $(CORECONFDIR)/"; \
cp -r $(ALTCORECONFDIR) $(CORECONFDIR); \
else \
echo "No coreconf directory found"; \
exit 1; \
fi \
fi
@if [ -d $(CORECONFDIR)/ ]; then \
cd $(CORECONFDIR); \
gmake; \
else \
echo "No $(CORECONFDIR) directory found"; \
fi
# cd $(CORECONFDIR)/dbm; \
# $(MAKE) VERSION=$(DBM_RELEASE_TAG) $(MFLAGS) $(COMP_PULL_ARG) import
cd $(CORECONFDIR)/nspr20; \
$(MAKE) RELEASE_TREE=$(NSPR_RELEASE_TREE) \
VERSION=$(NSPR_RELEASE_TAG) $(MFLAGS) $(COMP_PULL_ARG) import
cd $(CORECONFDIR)/security; \
$(MAKE) RELEASE_TREE=$(NSS_RELEASE_TREE) \
VERSION=$(NSS_RELEASE_TAG) $(MFLAGS) $(COMP_PULL_ARG) import
cd $(CORECONFDIR)/svrcore; \
$(MAKE) RELEASE_TREE=$(SVRCORE_RELEASE_TREE) \
VERSION=$(SVRCORE_RELEASE_TAG) $(MFLAGS) $(COMP_PULL_ARG) import
endif
endif
clean clobber: FORCE
@if [ -d $(LDAP_DEPTH)/c-sdk/ldap ]; then \
cd $(LDAP_DEPTH)/c-sdk/ldap; \
$(MAKE) -f Makefile.client $(MFLAGS) clean; \
else \
echo "No LDAP directory -- skipping"; \
exit 0; \
fi
@if [ -d $(CONFIGDIR) ]; then \
cd $(CONFIGDIR); \
gmake -f Makefile.client cleanconfig; \
fi
FORCE:

View File

@@ -1,58 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MOD_DEPTH = .
topsrcdir = @top_srcdir@
srcdir = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
DIRS = config ldap
DIST_GARBAGE = config.cache config.log config.status
include $(topsrcdir)/config/rules.mk
# dummy target to allow platforms without a compiler-based depend (like GCC
# has) to call "make depend" here and not fail, at the cost of actual
# dependencies on such builds possibly being incorrect. A nasty hack, but
# this build system is going away soon.
#
depend:
FORCE:

View File

@@ -1,55 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
The autoconf files here are a minimal shim to allow the LDAP C SDK to
build with autoconf. These are currently just a slightly modified
version of the existing Makefile.client-based build system, merged
with a copy of the NSPR autoconf stuff. As in the main browser tree,
I've checked in the (generated) configure script so that autoconf
isn't a prerequisite to build.
My hope is that the owners of the C SDK will be interested in
migrating to this build system, so that over time it can evolve into a
true autoconf-style build system with all the goodies that go with
that (ie configure-time feature tests for faster porting to new
platforms, cross-compilation support, etc.).
Comments to <news://news.mozilla.org/netscape.public.mozilla.directory>,
please.
Dan Mosedale
<dmose@netscape.com>

View File

@@ -1,86 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
The mozldap.spec file can be used to build an RPM package. This
spec file produces 3 packages:
mozldap - the core runtime shared libraries libssldap50.so,
libprldap50.so, and libldap50.so, along with major and minor
version symlinks (see the %files section). These files are
placed in the system LIBDIR (usually /usr/lib or /usr/lib64).
mozldap-tools - the command line tools ldapsearch, ldapmodify,
ldapdelete, ldapcmp, ldapcompare - these are placed in a
subdirectory of LIBDIR called mozldap, so as not to conflict
with the OpenLDAP versions of ldapsearch, ldapmodify, etc.
which are present in almost every linux distro in /usr/bin
(the libs don't conflict because they have different names).
This package is not required if you only need the libs for
application support (e.g. Thunderbird), but it is a good
idea if you need to test some LDAP client feature that is
not supported by the OpenLDAP tools, or want to use NSS
for crypto with ldapsearch et. al.
mozldap-devel - the include files, example code, config files,
and pkg-config .pc file. The include files are placed in a
mozldap subdirectory of the system INCDIR (usually /usr/include)
so as not to conflict with the OpenLDAP include files in
/usr/include. The example code and config files go into the
/usr/share/mozldap directory. The mozldap.pc file goes into
the usual pkg-config directory, so you can get information
about the lib and include directories when building other
applications that use mozldap, e.g.
/usr/bin/pkg-config --cflags-only-I mozldap
Build Dependencies: nspr-devel, nss-devel, and svrcore-devel
Runtime Dependencies: nspr, nss
These packages should be available for download from ftp.mozilla.org
or from your favorite RPM/yum repository. If these packages are
installed, and have the proper pkg-config installed, the rpmbuild
will automatically find them - see config/autoconf/*.m4.
This RPM uses NSS for crypto and SVRCORE for secure PIN
management, which in turn depend on NSPR. If you do not want that,
you can create a new mozldap.spec file that removes those
dependencies (edit Requires: and BuildRequires:) and removes those
from the build (e.g. use --without-nss for the configure command).
Comments to <news://news.mozilla.org/netscape.public.mozilla.directory>,
please.
- Rich Megginson <richm@stanfordalumni.org>

View File

@@ -1,41 +0,0 @@
dnl
dnl ***** BEGIN LICENSE BLOCK *****
dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
dnl
dnl The contents of this file are subject to the Mozilla Public License Version
dnl 1.1 (the "License"); you may not use this file except in compliance with
dnl the License. You may obtain a copy of the License at
dnl http://www.mozilla.org/MPL/
dnl
dnl Software distributed under the License is distributed on an "AS IS" basis,
dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
dnl for the specific language governing rights and limitations under the
dnl License.
dnl
dnl The Original Code is mozilla.org code.
dnl
dnl The Initial Developer of the Original Code is
dnl Netscape Communications Corporation.
dnl Portions created by the Initial Developer are Copyright (C) 2002
dnl the Initial Developer. All Rights Reserved.
dnl
dnl Contributor(s):
dnl Dan Mosedale <dmose@netcape.com>
dnl
dnl Alternatively, the contents of this file may be used under the terms of
dnl either of the GNU General Public License Version 2 or later (the "GPL"),
dnl or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
dnl in which case the provisions of the GPL or the LGPL are applicable instead
dnl of those above. If you wish to allow use of your version of this file only
dnl under the terms of either the GPL or the LGPL, and not to allow others to
dnl use your version of this file under the terms of the MPL, indicate your
dnl decision by deleting the provisions above and replace them with the notice
dnl and other provisions required by the GPL or the LGPL. If you do not delete
dnl the provisions above, a recipient may use your version of this file under
dnl the terms of any one of the MPL, the GPL or the LGPL.
dnl
dnl ***** END LICENSE BLOCK *****
builtin(include, config/autoconf/nspr.m4)dnl
builtin(include, config/autoconf/nss.m4)dnl
builtin(include, config/autoconf/svrcore.m4)dnl

View File

@@ -1,585 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-1999
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# some vendors may wish to override COMPVERSIONDIR from the command-line
#
ifdef USE_AUTOCONF
COMPVERSIONDIR = $(topsrcdir)
else
COMPVERSIONDIR = $(DEPTH)/directory/c-sdk
endif
DEFAULT_VENDOR_NAME=mozilla.org
DEFAULT_VENDOR_VERSION=517
ifndef VENDOR_NAME
VENDOR_NAME = $(DEFAULT_VENDOR_NAME)
endif
ifndef VENDOR_VERSION
VENDOR_VERSION = $(DEFAULT_VENDOR_VERSION)
endif
ifeq ($(OS_ARCH), WINNT)
COMPONENT_PULL_METHOD=FTP
win_srcdir:=$(subst $(topsrcdir),$(WIN_TOP_SRC),$(srcdir))
endif
# component tags for internal build only
include $(COMPVERSIONDIR)/component_versions.mk
# Ldap library
ifeq ($(OS_ARCH), WINNT)
LDAP_LIBNAME = nsldap32v$(LDAPVERS)
else
LDAP_LIBNAME = ldap$(LDAPVERS)
endif
DIR_VERSION = $(LDAPVERS_SUFFIX)
DIRSDK_VERSION = $(LDAPVERS_SUFFIX)
# PrLdap library
ifeq ($(OS_ARCH), WINNT)
PRLDAP_LIBNAME = nsldappr32v$(PRLDAPVERS)
else
PRLDAP_LIBNAME = prldap$(PRLDAPVERS)
endif
# lber library
ifeq ($(OS_ARCH), WINNT)
LBER_LIBNAME = nslber32v$(LBERVERS)
else
LBER_LIBNAME = lber$(LBERVERS)
endif
# ldif library
ifeq ($(OS_ARCH), WINNT)
LDIF_LIBNAME = nsldif32v$(LDIFVERS)
else
LDIF_LIBNAME = ldif$(LDIFVERS)
endif
# iutil library
ifeq ($(OS_ARCH), WINNT)
IUTIL_LIBNAME = nsiutil32v$(IUTILVERS)
else
IUTIL_LIBNAME = iutil$(IUTILVERS)
endif
# util library
ifeq ($(OS_ARCH), WINNT)
UTIL_LIBNAME = nsutil32v$(UTILVERS)
else
UTIL_LIBNAME = util$(UTILVERS)
endif
# ssl library
ifeq ($(OS_ARCH), WINNT)
SSLDAP_LIBNAME = nsldapssl32v$(SSLDAPVERS)
else
SSLDAP_LIBNAME = ssldap$(SSLDAPVERS)
endif
# nss library
NSS_LIBNAME = nss$(NSSVERS)
ifeq ($(NSS_DYNAMIC_SOFTOKN),1)
SOFTOKN_LIBNAME = softokn$(NSSVERS)
endif
SSL_LIBNAME = ssl$(NSSVERS)
ifeq ($(OS_ARCH), WINNT)
DYNAMICNSS = $(addsuffix .$(LIB_SUFFIX),$(SSL_LIBNAME) $(NSS_LIBNAME))
else
DYNAMICNSS = $(addprefix -l,$(SSL_LIBNAME) $(NSS_LIBNAME) $(SOFTOKN_LIBNAME))
endif
NSSLINK = $(NSS_LIBS) $(DYNAMICNSS)
HYBRID_LIBNAME = freebl_hybrid_$(NSSVERS)
PURE32_LIBNAME = freebl_pure32_$(NSSVERS)
ifneq ($(USE_64), 1)
ifeq ($(OS_ARCH), SunOS)
ifneq ($(OS_TEST),i86pc)
COPYFREEBL = 1
endif
endif
ifeq ($(OS_ARCH), HP-UX)
ifneq ($(OS_TEST),ia64)
COPYFREEBL = 1
endif
endif
endif
# svrcore library
SVRCOREVERS =
SVRCOREVERS_SUFFIX =
SVRCORE_LIBNAME = svrcore$(SVRCOREVERS)
ifeq ($(OS_ARCH), WINNT)
SVRCORE_LINK = $(SVRCORE_LIBS) $(SVRCORE_LIBNAME).$(LIB_SUFFIX)
else
SVRCORE_LINK = $(SVRCORE_LIBS) -l$(SVRCORE_LIBNAME)
endif
#
# NSPR library
#
PLCBASE=plc$(NSPR_LIBVERSION)
PLDSBASE=plds$(NSPR_LIBVERSION)
NSPRBASE=nspr$(NSPR_LIBVERSION)
ifeq ($(OS_ARCH), WINNT)
PLC_BASENAME=lib$(PLCBASE)
PLDS_BASENAME=lib$(PLDSBASE)
NSPR_BASENAME=lib$(NSPRBASE)
DYNAMICNSPR = $(PLC_BASENAME).$(LIB_SUFFIX) $(PLDS_BASENAME).$(LIB_SUFFIX) $(NSPR_BASENAME).$(LIB_SUFFIX)
else
PLC_BASENAME=$(PLCBASE)
PLDS_BASENAME=$(PLDSBASE)
NSPR_BASENAME=$(NSPRBASE)
DYNAMICNSPR = -l$(PLCBASE) -l$(PLDSBASE) -l$(NSPRBASE)
endif
# use the NSPRLINK macro in other makefiles to define the linker command line
# the mozilla client build likes to set the makefile macro directly
ifdef LIBS_ALREADY_SET
NSPRLINK = $(NSPR_LIBS)
else
NSPRLINK = $(NSPR_LIBS) $(DYNAMICNSPR)
endif
# why the redundant definitions? apparently, all of these basename/libname macros are so that
# the ldapsdk can create a package containing all of the nspr shared libs/dlls - I don't think
# we should do this anymore, we should just depend on the user installing nspr first - then we
# can get rid of all of this junk
PLC_LIBNAME=$(PLCBASE)
PLDS_LIBNAME=$(PLDSBASE)
NSPR_LIBNAME=$(NSPRBASE)
#
# NLS library
#
ifeq ($(OS_ARCH), WINNT)
NSCNV_LIBNAME =nscnv32$(NLS_LIBVERSION).$(LIB_SUFFIX)
NSJPN_LIBNAME =nsjpn32$(NLS_LIBVERSION).$(LIB_SUFFIX)
NSCCK_LIBNAME =nscck32$(NLS_LIBVERSION).$(LIB_SUFFIX)
NSSB_LIBNAME =nssb32$(NLS_LIBVERSION).$(LIB_SUFFIX)
else
NSCNV_LIBNAME =libnscnv$(NLS_LIBVERSION).$(LIB_SUFFIX)
NSJPN_LIBNAME =libnsjpn$(NLS_LIBVERSION).$(LIB_SUFFIX)
NSCCK_LIBNAME =libnscck$(NLS_LIBVERSION).$(LIB_SUFFIX)
NSSB_LIBNAME =libnssb$(NLS_LIBVERSION).$(LIB_SUFFIX)
endif
LIBNLS_INCLUDES_LOC = $(LIBNLS_RELEASE_TREE)/libnls$(NLS_LIBVERSION)/$(LIBNLS_RELDATE)/$(OBJDIR_NAME)/include
LIBNLS_LIB_LOC = $(LIBNLS_RELEASE_TREE)/libnls$(NLS_LIBVERSION)/$(LIBNLS_RELDATE)/$(OBJDIR_NAME)/lib
LIBNLS_DIR = ../../../../../dist/libnls$(NLS_LIBVERSION)
ifeq ($(COMPONENT_PULL_METHOD), FTP)
LIBNLS_INCLUDES =../../../../../dist/libnls$(NLS_LIBVERSION)/$(OBJDIR_NAME)/include
LIBNLS_LIBDIR =../../../../../dist/libnls$(NLS_LIBVERSION)/$(OBJDIR_NAME)/lib
else
LIBNLS_INCLUDES =../../../../../dist/public/libnls
LIBNLS_LIBDIR =../../../../../dist/$(OBJDIR_NAME)/libnls
endif
RM = rm -f
SED = sed
# uncomment to enable support for LDAP referrals
LDAP_REFERRALS = -DLDAP_REFERRALS
DEFNETSSL = -DNET_SSL
NOLIBLCACHE = -DNO_LIBLCACHE
NSDOMESTIC = -DNS_DOMESTIC
ifdef BUILD_OPT
LDAP_DEBUG =
else
LDAP_DEBUG = -DLDAP_DEBUG
endif
ifdef HAVE_LIBNLS
HAVELIBNLS = -DHAVE_LIBNLS
else
HAVELIBNLS =
endif
ifdef BUILD_CLU
BUILDCLU = 1
else
BUILDCLU =
endif
#
# DEFS are included in CFLAGS
#
DEFS = $(PLATFORMCFLAGS) $(LDAP_DEBUG) $(HAVELIBNLS) \
$(CLDAP) $(DEFNETSSL) $(NOLIBLCACHE) \
$(LDAP_REFERRALS) $(LDAP_DNS) $(STR_TRANSLATION) \
$(LIBLDAP_CHARSETS) $(LIBLDAP_DEF_CHARSET) \
$(NSDOMESTIC) $(LDAPSSLIO)
ifeq ($(OS_ARCH), WINNT)
DIRVER_PROG=$(COMMON_OBJDIR)/dirver.exe
else
DIRVER_PROG=$(COMMON_OBJDIR)/dirver
endif
ifeq ($(OS_ARCH), WINNT)
EXE_SUFFIX=.exe
RSC=rc
ifdef NS_USE_GCC
OFFLAG=-o #
else
OFFLAG=/Fo
endif
else
OFFLAG=-o
endif
ifeq ($(OS_ARCH), Linux)
DEFS += -DLINUX2_0 -DLINUX1_2 -DLINUX2_1
endif
ifeq ($(OS_ARCH), WINNT)
ifndef NS_USE_GCC
DLLEXPORTS_PREFIX=-DEF:
USE_DLL_EXPORTS_FILE = 1
endif
endif
ifeq ($(OS_ARCH), OS2)
USE_DLL_EXPORTS_FILE = 1
endif
ifeq ($(OS_ARCH), SunOS)
ifndef NS_USE_GCC
DLLEXPORTS_PREFIX=-Blocal -M
USE_DLL_EXPORTS_FILE = 1
# else
# use the --version-script GNU ld argument - need to add support for
# GNU (linux and solaris and ???) to genexports.pl et. al.
endif # NS_USE_GCC
endif
ifeq ($(OS_ARCH), IRIX)
DLLEXPORTS_PREFIX=-exports_file
USE_DLL_EXPORTS_FILE = 1
endif
ifeq ($(OS_ARCH), HP-UX)
DEFS += -Dhpux -D_REENTRANT
endif
ifeq ($(OS_ARCH),AIX)
DLLEXPORTS_PREFIX=-bE:
DL=-ldl
USE_DLL_EXPORTS_FILE = 1
endif
ifeq ($(OS_ARCH),OSF1)
DEFS += -DOSF1V4
DL=
endif
ifeq ($(OS_ARCH),ReliantUNIX)
DL=-ldl
USE_LD_RUN_PATH=1
USE_CCC_TO_LINK=1
CCC=$(CXX)
endif
ifeq ($(OS_ARCH),UnixWare)
DL=
endif
RPATHFLAG = ..:../lib:../../lib:../../../lib:../../../../lib
ifeq ($(OS_ARCH), SunOS)
# include $ORIGIN in run time library path (works on Solaris 8 10/01 and later)
RPATHFLAG := \$$ORIGIN/../lib:\$$ORIGIN/../../lib:$(RPATHFLAG)
# flag to pass to cc when linking to set runtime shared library search path
# this is used like this, for example: $(RPATHFLAG_PREFIX)../..
# Also, use the C++ compiler to link for 64-bit builds.
ifeq ($(USE_64), 1)
USE_CCC_TO_LINK=1
RPATHFLAG_PREFIX=-R:
else
RPATHFLAG_PREFIX=-Wl,-R,
endif
ifdef NS_USE_GCC
USE_CCC_TO_LINK=1
RPATHFLAG_PREFIX=-Wl,-R,
endif
# flag to pass to ld when linking to set runtime shared library search path
# this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
LDRPATHFLAG_PREFIX=-R
# OS network libraries
PLATFORMLIBS+=-lresolv -lsocket -lnsl -lgen -ldl -lposix4
endif
ifeq ($(OS_ARCH), OSF1)
# Use the C++ compiler to link
USE_CCC_TO_LINK=1
# flag to pass to cc when linking to set runtime shared library search path
# this is used like this, for example: $(RPATHFLAG_PREFIX)../..
RPATHFLAG_PREFIX=-Wl,-rpath,
# flag to pass to ld when linking to set runtime shared library search path
# this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
LDRPATHFLAG_PREFIX=-rpath
# allow for unresolved symbols
DLL_LDFLAGS += -expect_unresolved "*"
endif # OSF1
ifeq ($(OS_ARCH), AIX)
# Flags to set runtime shared library search path. For example:
# $(CC) $(RPATHFLAG_PREFIX)../..$(RPATHFLAG_EXTRAS)
RPATHFLAG_PREFIX=-blibpath:
RPATHFLAG_EXTRAS=:/usr/lib:/lib
# flag to pass to ld when linking to set runtime shared library search path
# this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
LDRPATHFLAG_PREFIX=-blibpath:/usr/lib:/lib:
DLL_LDFLAGS= -bM:SRE -bnoentry \
-L.:/usr/lib/threads:/usr/lpp/xlC/lib:/usr/lib:/lib
DLL_EXTRA_LIBS= -bI:/usr/lib/lowsys.exp -lC_r -lC -lpthreads -lc_r -lm \
/usr/lib/libc.a
EXE_EXTRA_LIBS= -bI:/usr/lib/syscalls.exp -lsvld -lpthreads
endif # AIX
ifeq ($(OS_ARCH), HP-UX)
# Use the C++ compiler to link
USE_CCC_TO_LINK=1
# include $ORIGIN in run time library path (works on HP-UX 11.11 with latest patches and later)
ifeq ($(OS_RELEASE), B.11.11)
RPATHFLAG := \$$ORIGIN/../lib:\$$ORIGIN/../../lib:$(RPATHFLAG)
endif
ifeq ($(OS_RELEASE), B.11.23)
RPATHFLAG := \$$ORIGIN/../lib:\$$ORIGIN/../../lib:$(RPATHFLAG)
endif
# flag to pass to cc when linking to set runtime shared library search path
# this is used like this, for example: $(RPATHFLAG_PREFIX)../..
RPATHFLAG_PREFIX=-Wl,+s,+b,
# flag to pass to ld when linking to set runtime shared library search path
# this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
LDRPATHFLAG_PREFIX=+s +b
# we need to link in the rt library to get sem_*()
PLATFORMLIBS += -lrt
PLATFORMCFLAGS=
endif # HP-UX
ifeq ($(OS_ARCH), Linux)
# Use the C++ compiler to link
USE_CCC_TO_LINK=1
# flag to pass to cc when linking to set runtime shared library search path
# this is used like this, for example: $(RPATHFLAG_PREFIX)../..
RPATHFLAG_PREFIX=-Wl,-rpath,
# flag to pass to ld when linking to set runtime shared library search path
# this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
# note, there is a trailing space
LDRPATHFLAG_PREFIX=-rpath
endif # Linux
ifeq ($(OS_ARCH), Darwin)
# Darwin doesn't use RPATH.
RPATHFLAG_PREFIX=
RPATHFLAG=
# Use the C++ compiler to link
USE_CCC_TO_LINK=1
endif # Darwin
# Use the C++ compiler to link... or not.
ifdef USE_CCC_TO_LINK
CC_FOR_LINK=$(CCC)
else
CC_FOR_LINK=$(CC)
endif
#
# XXX: does anyone know of a better way to solve the "LINK_LIB2" problem? -mcs
#
# Link to produce a console/windows exe on Windows
#
ifeq ($(OS_ARCH), WINNT)
ifdef NS_USE_GCC
LINK_EXE = $(CC_FOR_LINK) -o $@ $(LDFLAGS) $(LCFLAGS) $(DEPLIBS) \
$(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
LINK_LIB = $(AR) cr $@ $(OBJS)
LINK_DLL = $(CC_FOR_LINK) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(@:.$(DLL_SUFFIX)=.$(LIB_SUFFIX)) $(LLFLAGS) $(DLL_LDFLAGS) -o $@ $(OBJS) $(EXTRA_LIBS) $(EXTRA_DLL_LIBS)
else
DEBUG_LINK_OPT=-DEBUG
ifeq ($(BUILD_OPT), 1)
ifndef MOZ_DEBUG_SYMBOLS
DEBUG_LINK_OPT=
endif
DEBUG_LINK_OPT += -OPT:REF
endif
SUBSYSTEM=CONSOLE
ifndef MOZ_DEBUG_SYMBOLS
DEBUG_FLAGS=-PDB:NONE
endif
LINK_EXE = $(CYGWIN_WRAPPER) link $(DEBUG_LINK_OPT) -OUT:"$@" -MAP $(ALDFLAGS) $(LDFLAGS) $(ML_DEBUG) \
$(LCFLAGS) -NOLOGO $(DEBUG_FLAGS) -INCREMENTAL:NO \
-NODEFAULTLIB:MSVCRTD -SUBSYSTEM:$(SUBSYSTEM) $(DEPLIBS) \
$(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
# AR is set when doing an autoconf build
ifdef AR
LINK_LIB = $(CYGWIN_WRAPPER) $(AR) $(OBJS)
else
LINK_LIB = $(CYGWIN_WRAPPER) lib -OUT:"$@" $(OBJS)
endif
ifndef LD
LD=link
endif
LINK_DLL = $(CYGWIN_WRAPPER) $(LD) $(DEBUG_LINK_OPT) -nologo -MAP -DLL $(DEBUG_FLAGS) \
$(ML_DEBUG) -SUBSYSTEM:$(SUBSYSTEM) $(LLFLAGS) $(DLL_LDFLAGS) \
$(EXTRA_LIBS) -out:"$@" $(OBJS)
endif # NS_USE_GCC
else # WINNT
#
# UNIX link commands
#
ifeq ($(OS_ARCH),OS2)
LINK_LIB = -$(RM) $@ && $(AR) $(AR_FLAGS) $(OBJS) && $(RANLIB) $@
LINK_LIB2 = -$(RM) $@ && $(AR) $@ $(OBJS2) && $(RANLIB) $@
ifeq ($(MOZ_OS2_TOOLS),VACPP)
LINK_DLL = $(LD) $(OS_DLLFLAGS) $(DLLFLAGS) $(OBJS)
else
LINK_DLL = $(LD) $(DSO_LDOPTS) $(ALDFLAGS) $(DLL_LDFLAGS) $(DLL_EXPORT_FLAGS) \
-o $@ $(OBJS)
endif
else
LINK_LIB = $(RM) $@; $(AR) $(AR_FLAGS) $(OBJS); $(RANLIB) $@
LINK_LIB2 = $(RM) $@; $(AR) $@ $(OBJS2); $(RANLIB) $@
ifdef SONAMEFLAG_PREFIX
LINK_DLL = $(LD) $(DSO_LDOPTS) $(ALDFLAGS) $(DLL_LDFLAGS) $(DLL_EXPORT_FLAGS) \
-o $@ $(SONAMEFLAG_PREFIX)$(notdir $@) $(OBJS)
else # SONAMEFLAG_PREFIX
LINK_DLL = $(LD) $(DSO_LDOPTS) $(ALDFLAGS) $(DLL_LDFLAGS) $(DLL_EXPORT_FLAGS) \
-o $@ $(OBJS)
endif # SONAMEFLAG_PREFIX
endif #!os2
ifeq ($(OS_ARCH), OSF1)
# The linker on OSF/1 gets confused if it finds an so_locations file
# that doesn't meet its expectations, so we arrange to remove it before
# linking.
SO_FILES_TO_REMOVE=so_locations
endif
ifneq (,$(filter BeOS Darwin NetBSD,$(OS_ARCH)))
LINK_DLL = $(MKSHLIB) $(OBJS)
endif
ifeq ($(OS_ARCH), HP-UX)
# On HPUX, we need a couple of changes:
# 1) Use the C++ compiler for linking, which will pass the +eh flag on down to the
# linker so the correct exception-handling-aware libC gets used (libnshttpd.sl
# needs this).
# 2) Add a "-Wl,-E" option so the linker gets a "-E" flag. This makes symbols
# in an executable visible to shared libraries loaded at runtime.
LINK_EXE = $(CC_FOR_LINK) -Wl,-E $(ALDFLAGS) $(LDFLAGS) $(RPATHFLAG_PREFIX)$(RPATHFLAG) -o $@ $(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
ifeq ($(USE_64), 1)
ifeq ($(OS_RELEASE), B.11.23)
LINK_EXE = $(CC_FOR_LINK) -DHPUX_ACC -D__STDC_EXT__ -D_POSIX_C_SOURCE=199506L +DD64 -Wl,-E $(ALDFLAGS) $(LDFLAGS) $(RPATHFLAG_PREFIX)$(RPATHFLAG) -o $@ $(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
else
LINK_EXE = $(CC_FOR_LINK) -DHPUX_ACC -D__STDC_EXT__ -D_POSIX_C_SOURCE=199506L +DA2.0W +DS2.0 -Wl,-E $(ALDFLAGS) $(LDFLAGS) $(RPATHFLAG_PREFIX)$(RPATHFLAG) -o $@ $(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
endif
endif
else # HP-UX
# everything except HPUX
ifdef USE_LD_RUN_PATH
#does RPATH differently. instead we export RPATHFLAG as LD_RUN_PATH
#see ns/netsite/ldap/clients/tools/Makefile for an example
export LD_RUN_PATH=$(RPATHFLAG)
LINK_EXE = $(CC_FOR_LINK) $(ALDFLAGS) $(LDFLAGS) \
-o $@ $(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
LINK_EXE_NOLIBSOBJS = $(CC_FOR_LINK) $(ALDFLAGS) $(LDFLAGS) -o $@
else # USE_LD_RUN_PATH
LINK_EXE = $(CC_FOR_LINK) $(ALDFLAGS) $(LDFLAGS) \
$(RPATHFLAG_PREFIX)$(RPATHFLAG)$(RPATHFLAG_EXTRAS) \
-o $@ $(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
LINK_EXE_NOLIBSOBJS = $(CC_FOR_LINK) $(ALDFLAGS) $(LDFLAGS) \
$(RPATHFLAG_PREFIX)$(RPATHFLAG)$(RPATHFLAG_EXTRAS) -o $@
endif # USE_LD_RUN_PATH
endif # HP-UX
endif # WINNT
ifndef PERL
PERL = perl
endif
#
# shared library symbol export definitions
#
ifeq ($(OS_ARCH), WINNT)
GENEXPORTS=cmd /c $(PERL) $(LDAP_SRC)/build/genexports.pl
else
GENEXPORTS=$(PERL) $(LDAP_SRC)/build/genexports.pl
endif

View File

@@ -1,88 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-1999
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
COMPONENTS_DIR = /share/builds/components
# NSPR - Netscape Portable Runtime
NSPR_LIBVERSION = 4
NSPR_RELEASE_TAG = v4.4.1
NSPR_RELEASE_TREE = $(COMPONENTS_DIR)
# NSS - Network Security Services
NSSVERS = 3
NSS_RELEASE_TAG = NSS_3_9_3_RTM
NSS_DYNAMIC_SOFTOKN = 1
NSS_RELEASE_TREE = $(COMPONENTS_DIR)
# SVRCORE - Client/server utility library
SVRCORE_RELEASE_TAG = SVRCORE_4_0_RTM
SVRCORE_RELEASE_TREE = $(COMPONENTS_DIR)
# LDAP library
LDAPVERS = 50
LDAPVERS_SUFFIX = 5.0
# PRLDAP library
PRLDAPVERS = 50
PRLDAPVERS_SUFFIX = 5.0
# LBER library
LBERVERS = 50
LBERVERS_SUFFIX = 5.0
# ldif library
LDIFVERS = 50
LDIFVERS_SUFFIX = 5.0
# iutil library
IUTILVERS = 50
IUTILVERS_SUFFIX = 5.0
# util library
UTILVERS = 50
UTILVERS_SUFFIX = 5.0
# ssl library
SSLDAPVERS = 50
SSLDAPVERS_SUFFIX = 5.0
# libNLS - National Language Support.
NLS_LIBVERSION = 31
LIBNLS_RELDATE = v3.2
LIBNLS_RELEASE_TREE = $(COMPONENTS_DIR)

View File

@@ -1,179 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for AIX.
#
include $(MOD_DEPTH)/config/UNIX.mk
#
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
ifneq ($(USE_PTHREADS),1)
CLASSIC_NSPR = 1
endif
endif
#
# There are three implementation strategies available on AIX:
# pthreads, classic, and pthreads-user.
#
# On AIX 3.2, classic nspr is the default (and only) implementation
# strategy. On AIX 4.1 and later, the default is pthreads.
#
ifeq ($(OS_RELEASE),3.2)
CLASSIC_NSPR = 1
endif
ifeq ($(CLASSIC_NSPR),1)
PTHREADS_USER =
USE_PTHREADS =
IMPL_STRATEGY = _EMU
DEFINES += -D_PR_LOCAL_THREADS_ONLY
else
ifeq ($(PTHREADS_USER),1)
USE_PTHREADS =
IMPL_STRATEGY = _PTH_USER
else
USE_PTHREADS = 1
ifeq ($(HAVE_CCONF), 1)
IMPL_STRATEGY =
else
IMPL_STRATEGY = _PTH
endif
endif
endif
# IPv6 support part of the standard AIX 4.3 release.
ifneq (,$(filter-out 3.2 4.1 4.2,$(OS_RELEASE)))
USE_IPV6 = 1
endif
ifeq ($(CLASSIC_NSPR),1)
CC = xlC
CCC = xlC
else
CC = xlC_r
CCC = xlC_r
endif
OS_CFLAGS = -qro -qroconst
ifeq ($(USE_64),1)
OBJECT_MODE = 64
export OBJECT_MODE
COMPILER_TAG = _64
else
ifeq ($(HAVE_CCONF), 1)
COMPILER_TAG =
else
COMPILER_TAG = _32
endif
endif
CPU_ARCH = rs6000
RANLIB = ranlib
OS_CFLAGS += -DAIX -DSYSV
ifeq ($(CC),xlC_r)
OS_CFLAGS += -qarch=com
endif
ifneq ($(OS_RELEASE),3.2)
OS_CFLAGS += -DAIX_HAVE_ATOMIC_OP_H -DAIX_TIMERS
endif
ifeq (,$(filter-out 3.2 4.1,$(OS_RELEASE)))
ifndef USE_PTHREADS
OS_CFLAGS += -DAIX_RENAME_SELECT
endif
endif
ifeq (,$(filter-out 3.2 4.1,$(OS_RELEASE)))
OS_CFLAGS += -D_PR_NO_LARGE_FILES
else
OS_CFLAGS += -D_PR_HAVE_OFF64_T -D_LARGEFILE64_SOURCE
endif
ifeq ($(OS_RELEASE),4.1)
OS_CFLAGS += -DAIX4_1
else
DSO_LDOPTS = -brtl -bM:SRE -bnoentry -bexpall
MKSHLIB = $(LD) $(DSO_LDOPTS)
ifeq ($(OS_RELEASE),4.3)
OS_CFLAGS += -DAIX4_3
endif
endif
# Have the socklen_t data type
ifeq ($(OS_RELEASE),4.3)
OS_CFLAGS += -DHAVE_SOCKLEN_T
endif
ifeq (,$(filter-out 4.2 4.3,$(OS_RELEASE)))
# On these OS revisions, localtime_r() is declared if _THREAD_SAFE
# is defined.
ifneq ($(CLASSIC_NSPR),1)
OS_CFLAGS += -DHAVE_POINTER_LOCALTIME_R
endif
endif
ifeq (,$(filter-out 4.3,$(OS_RELEASE)))
# On these OS revisions, gethostbyXXX() returns result in thread
# specific storage.
ifeq ($(USE_PTHREADS),1)
OS_CFLAGS += -D_PR_HAVE_THREADSAFE_GETHOST
endif
endif
#
# Special link info for constructing AIX programs. On AIX we have to
# statically link programs that use NSPR into a single .o, rewriting the
# calls to select to call "aix". Once that is done we then can
# link that .o with a .o built in nspr which implements the system call.
#
ifneq (,$(filter-out 3.2 4.1,$(OS_RELEASE)))
AIX_LINK_OPTS = -brtl -bnso -berok
else
AIX_LINK_OPTS = -bnso -berok
#AIX_LINK_OPTS = -bnso -berok -brename:.select,.wrap_select -brename:.poll,.wrap_poll -bI:/usr/lib/syscalls.exp
endif
AIX_WRAP = $(DIST)/lib/aixwrap.o
AIX_TMP = $(OBJDIR)/_aix_tmp.o

View File

@@ -1,95 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for BSD/OS Unix.
#
include $(MOD_DEPTH)/config/UNIX.mk
ifeq (,$(filter-out 1.1 4.%,$(OS_RELEASE)))
CC = gcc -Wall -Wno-format
CCC = g++
else
CC = shlicc2
CCC = shlicc2
endif
RANLIB = ranlib
ifeq ($(USE_PTHREADS),1)
IMPL_STRATEGY = _PTH
DEFINES += -D_PR_NEED_PTHREAD_INIT
else
IMPL_STRATEGY = _EMU
DEFINES += -D_PR_LOCAL_THREADS_ONLY
endif
OS_CFLAGS = $(DSO_CFLAGS) -DBSDI -DHAVE_STRERROR -DNEED_BSDREGEX
ifeq (86,$(findstring 86,$(OS_TEST)))
CPU_ARCH = x86
endif
ifeq (sparc,$(findstring sparc,$(OS_TEST)))
CPU_ARCH = sparc
endif
ifeq ($(OS_RELEASE),2.1)
OS_CFLAGS += -D_PR_TIMESPEC_HAS_TS_SEC
endif
ifeq (,$(filter-out 1.1 2.1,$(OS_RELEASE)))
OS_CFLAGS += -D_PR_BSDI_JMPBUF_IS_ARRAY
else
OS_CFLAGS += -D_PR_SELECT_CONST_TIMEVAL -D_PR_BSDI_JMPBUF_IS_STRUCT
endif
NOSUCHFILE = /no-such-file
ifeq ($(OS_RELEASE),1.1)
OS_CFLAGS += -D_PR_STAT_HAS_ONLY_ST_ATIME -D_PR_NEED_H_ERRNO
else
OS_CFLAGS += -DHAVE_DLL -DUSE_DLFCN -D_PR_STAT_HAS_ST_ATIMESPEC
OS_LIBS = -ldl
ifeq (,$(filter-out 4.%,$(OS_RELEASE)))
MKSHLIB = $(CC) $(DSO_LDOPTS)
DSO_CFLAGS = -fPIC
DSO_LDOPTS = -shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)
else
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -r
endif
endif

View File

@@ -1,142 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
######################################################################
# Config stuff for BeOS (all architectures)
######################################################################
######################################################################
# Version-independent
######################################################################
DEFINES +=
XP_DEFINE = -DXP_BEOS
OBJ_SUFFIX = o
LIB_SUFFIX = a
DLL_SUFFIX = so
AR = ar cr $@
ifdef BUILD_OPT
DEFINES = -UDEBUG -DNDEBUG
OBJDIR_TAG = _OPT
else
DEFINES = -DDEBUG -UNDEBUG
OBJDIR_TAG = _DBG
endif
ifeq (PC,$(findstring PC,$(OS_TEST)))
CPU_ARCH = x86
CC = gcc
CCC = g++
LD = gcc
RANLIB = ranlib
DSO_LDOPTS = -nostart
PORT_FLAGS = -DHAVE_STRERROR
ifdef BUILD_OPT
OPTIMIZER = -O2
LDFLAGS += -s
else
OPTIMIZER = -gdwarf-2 -O0
endif
else
CPU_ARCH = ppc
CC = mwcc
CCC = mwcc
LD = mwld
RANLIB = ranlib
DSO_LDOPTS = -xms -export pragma \
-init _init_routine_ \
-term _term_routine_ \
-lroot -lnet \
/boot/develop/lib/ppc/glue-noinit.a \
/boot/develop/lib/ppc/init_term_dyn.o \
/boot/develop/lib/ppc/start_dyn.o
PORT_FLAGS = -DHAVE_STRERROR -D_POSIX_SOURCE
ifdef BUILD_OPT
OPTIMIZER = -O2
else
OPTIMIZER = -g -O0
endif
endif
CPU_ARCH_TAG = _$(CPU_ARCH)
OS_INCLUDES = -I- -I.
#G++INCLUDES = -I/usr/include/g++
PLATFORM_FLAGS = -DBeOS -DBEOS $(OS_INCLUDES)
OS_CFLAGS = $(DSO_CFLAGS) $(PLATFORM_FLAGS) $(PORT_FLAGS)
USE_BTHREADS = 1
MKSHLIB = $(LD) $(DSO_LDOPTS)
OBJDIR_NAME = $(OS_CONFIG)_$(CPU_ARCH)$(OBJDIR_TAG).OBJ
####################################################################
#
# One can define the makefile variable NSDISTMODE to control
# how files are published to the 'dist' directory. If not
# defined, the default is "install using relative symbolic
# links". The two possible values are "copy", which copies files
# but preserves source mtime, and "absolute_symlink", which
# installs using absolute symbolic links. The "absolute_symlink"
# option requires NFSPWD.
#
####################################################################
NSINSTALL = $(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall
ifeq ($(NSDISTMODE),copy)
# copy files, but preserve source mtime
INSTALL = $(NSINSTALL) -t
else
ifeq ($(NSDISTMODE),absolute_symlink)
# install using absolute symbolic links
INSTALL = $(NSINSTALL) -L `$(NFSPWD)`
else
# install using relative symbolic links
INSTALL = $(NSINSTALL) -R
endif
endif
define MAKE_OBJDIR
if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
endef

View File

@@ -1,67 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for Data General DG/UX
#
# Initial DG/UX port by Marc Fraioli <fraioli@dg-rtp.dg.com>
#
include $(MOD_DEPTH)/config/UNIX.mk
CC = gcc
CCC = g++
RANLIB = true
DEFINES += -D_PR_LOCAL_THREADS_ONLY
OS_CFLAGS = -DSVR4 -DSYSV -DDGUX -D_DGUX_SOURCE -D_POSIX4A_DRAFT6_SOURCE
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -G
CPU_ARCH = x86
ARCH = dgux
NOSUCHFILE = /no-such-file
ifdef BUILD_OPT
OPTIMIZER = -O2
else
# -g would produce a huge executable.
OPTIMIZER =
endif

View File

@@ -1,86 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for FreeBSD
#
include $(MOD_DEPTH)/config/UNIX.mk
CC = gcc
CCC = g++
RANLIB = ranlib
ifeq ($(OS_TEST),alpha)
CPU_ARCH = alpha
else
OS_REL_CFLAGS = -Di386
CPU_ARCH = x86
endif
CPU_ARCH_TAG = _$(CPU_ARCH)
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe $(THREAD_FLAG) -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
#
# The default implementation strategy for FreeBSD is pthreads.
#
ifeq ($(CLASSIC_NSPR),1)
IMPL_STRATEGY = _EMU
DEFINES += -D_PR_LOCAL_THREADS_ONLY
else
USE_PTHREADS = 1
IMPL_STRATEGY = _PTH
DEFINES += -D_THREAD_SAFE
THREAD_FLAG += -pthread
endif
ARCH = freebsd
MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
ifeq ($(MOZ_OBJFORMAT),elf)
DLL_SUFFIX = so
else
DLL_SUFFIX = so.1.0
endif
DSO_CFLAGS = -fPIC
DSO_LDOPTS = -Bshareable
MKSHLIB = $(LD) $(DSO_LDOPTS)
G++INCLUDES = -I/usr/include/g++

View File

@@ -1,256 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for HP-UX
#
include $(MOD_DEPTH)/config/UNIX.mk
ifeq ($(OS_TEST),ia64)
DLL_SUFFIX = so
else
DLL_SUFFIX = sl
endif
ifeq ($(NS_USE_GCC), 1)
CC = gcc
CCC = g++
OS_CFLAGS =
COMPILER_TAG = _gcc
else
CC = cc -Ae
CCC = CC -ext
ifeq ($(OS_RELEASE),B.11.23)
OS_CFLAGS = +Olit=all
else
OS_CFLAGS = +ESlit
endif
endif
RANLIB = echo
CPU_ARCH = hppa
OS_CFLAGS += $(DSO_CFLAGS) -DHPUX -D$(CPU_ARCH) -D_HPUX_SOURCE
#
# The header netdb.h on HP-UX 9 does not declare h_errno.
# On 10.10 and 10.20, netdb.h declares h_errno only if
# _XOPEN_SOURCE_EXTENDED is defined. So we need to declare
# h_errno ourselves.
#
ifeq ($(basename $(OS_RELEASE)),A.09)
OS_CFLAGS += -D_PR_NEED_H_ERRNO
endif
ifeq (,$(filter-out B.10.10 B.10.20,$(OS_RELEASE)))
OS_CFLAGS += -D_PR_NEED_H_ERRNO
endif
# Do we have localtime_r()? Does it return 'int' or 'struct tm *'?
ifeq (,$(filter-out B.10.10 B.10.20,$(OS_RELEASE)))
OS_CFLAGS += -DHAVE_INT_LOCALTIME_R
endif
ifeq (,$(filter-out B.10.30 B.11.00 B.11.23,$(OS_RELEASE)))
OS_CFLAGS += -DHAVE_POINTER_LOCALTIME_R
endif
#
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
CLASSIC_NSPR = 1
endif
#
# On HP-UX 9, the default (and only) implementation strategy is
# classic nspr.
#
# On HP-UX 10.10 and 10.20, the default implementation strategy is
# pthreads (actually DCE threads). Classic nspr is also available.
#
# On HP-UX 10.30 and 11.00, the default implementation strategy is
# pthreads. Classic nspr and pthreads-user are also available.
#
ifeq ($(basename $(OS_RELEASE)),A.09)
OS_CFLAGS += -DHPUX9
DEFAULT_IMPL_STRATEGY = _EMU
endif
ifeq ($(OS_RELEASE),B.10.01)
OS_CFLAGS += -DHPUX10
DEFAULT_IMPL_STRATEGY = _EMU
endif
ifeq ($(OS_RELEASE),B.10.10)
OS_CFLAGS += -DHPUX10 -DHPUX10_10
DEFAULT_IMPL_STRATEGY = _PTH
endif
ifeq ($(OS_RELEASE),B.10.20)
OS_CFLAGS += -DHPUX10 -DHPUX10_20
ifneq ($(NS_USE_GCC), 1)
OS_CFLAGS += +DAportable
endif
DEFAULT_IMPL_STRATEGY = _PTH
endif
#
# On 10.30 and 11.00, we use the new ANSI C++ compiler aCC.
#
ifeq ($(OS_RELEASE),B.10.30)
ifneq ($(NS_USE_GCC), 1)
CCC = /opt/aCC/bin/aCC -ext
OS_CFLAGS += +DAportable +DS1.1
endif
OS_CFLAGS += -DHPUX10 -DHPUX10_30
DEFAULT_IMPL_STRATEGY = _PTH
endif
# 11.00 is similar to 10.30.
ifeq ($(OS_RELEASE),B.11.00)
MODERN_HPUX=1
endif
ifeq ($(OS_RELEASE),B.11.11)
MODERN_HPUX=1
endif
ifeq ($(OS_RELEASE),B.11.23)
MODERN_HPUX=1
endif
ifdef MODERN_HPUX
ifneq ($(NS_USE_GCC), 1)
CCC = /opt/aCC/bin/aCC -ext
ifeq ($(USE_64),1)
OS_CFLAGS += +DA2.0W +DS2.0 +DD64
COMPILER_TAG = _64
else
OS_CFLAGS += +DAportable +DS2.0
ifeq ($(HAVE_CCONF), 1)
COMPILER_TAG =
else
COMPILER_TAG = _32
endif
endif
endif
OS_CFLAGS += -DHPUX10 -DHPUX11 -D_LARGEFILE64_SOURCE -D_PR_HAVE_OFF64_T
ifeq ($(HAVE_CCONF), 1)
DEFAULT_IMPL_STRATEGY =
else
DEFAULT_IMPL_STRATEGY = _PTH
endif
endif
# 11.23 is similar to 11.00.
ifeq ($(OS_RELEASE),B.11.23)
ifneq ($(NS_USE_GCC), 1)
CCC = /opt/aCC/bin/aCC -AP -ext
ifeq ($(USE_64),1)
OS_CFLAGS += +DD64
#COMPILER_TAG = _64
else
OS_CFLAGS += +DD32
ifeq ($(HAVE_CCONF), 1)
COMPILER_TAG =
else
COMPILER_TAG = _32
endif
endif
endif
OS_CFLAGS += -DHPUX10 -DHPUX11 -D_LARGEFILE64_SOURCE -D_PR_HAVE_OFF64_T
ifeq ($(HAVE_CCONF), 1)
DEFAULT_IMPL_STRATEGY =
else
DEFAULT_IMPL_STRATEGY = _PTH
endif
endif
ifeq ($(DEFAULT_IMPL_STRATEGY),_EMU)
CLASSIC_NSPR = 1
endif
ifeq ($(DEFAULT_IMPL_STRATEGY),_PTH)
USE_PTHREADS = 1
IMPL_STRATEGY = _PTH
ifeq ($(CLASSIC_NSPR),1)
USE_PTHREADS =
IMPL_STRATEGY = _EMU
endif
ifeq ($(PTHREADS_USER),1)
USE_PTHREADS =
IMPL_STRATEGY = _PTH_USER
endif
endif
ifeq ($(CLASSIC_NSPR),1)
DEFINES += -D_PR_LOCAL_THREADS_ONLY
endif
ifeq (,$(filter-out A.09 B.10,$(basename $(OS_RELEASE))))
DEFINES += -D_PR_NO_LARGE_FILES
endif
#
# To use the true pthread (kernel thread) library on 10.30 and
# 11.00, we should define _POSIX_C_SOURCE to be 199506L.
# The _REENTRANT macro is deprecated.
#
ifdef USE_PTHREADS
ifeq (,$(filter-out B.10.10 B.10.20,$(OS_RELEASE)))
OS_CFLAGS += -D_REENTRANT -D_PR_DCETHREADS
else
OS_CFLAGS += -D_POSIX_C_SOURCE=199506L -D_PR_HAVE_THREADSAFE_GETHOST
endif
endif
ifdef PTHREADS_USER
OS_CFLAGS += -D_POSIX_C_SOURCE=199506L
endif
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -b +h $(notdir $@)
# -fPIC or +Z generates position independent code for use in shared
# libraries.
ifeq ($(NS_USE_GCC), 1)
DSO_CFLAGS = -fPIC
else
DSO_CFLAGS = +Z
endif

View File

@@ -1,162 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for IRIX
#
include $(MOD_DEPTH)/config/UNIX.mk
#
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
ifneq ($(USE_PTHREADS),1)
CLASSIC_NSPR = 1
endif
endif
#
# On IRIX 5.x, classic nspr (user-level threads on top of sprocs)
# is the default (and only) implementation strategy.
#
# On IRIX 6.x and later, the default implementation strategy is
# pthreads. Classic nspr is also available.
#
ifeq ($(basename $(OS_RELEASE)),5)
CLASSIC_NSPR = 1
endif
ifeq ($(CLASSIC_NSPR),1)
IMPL_STRATEGY = _MxN
else
USE_PTHREADS = 1
USE_N32 = 1
IMPL_STRATEGY = _PTH
endif
ifeq ($(NS_USE_GCC), 1)
CC = gcc
COMPILER_TAG = _gcc
AS = $(CC) -x assembler-with-cpp -D_ASM -mips2
ODD_CFLAGS = -Wall -Wno-format
ifdef BUILD_OPT
OPTIMIZER = -O6
endif
else
CC = cc
CCC = CC
ODD_CFLAGS = -fullwarn -xansi
ifdef BUILD_OPT
ifneq ($(USE_N32),1)
OPTIMIZER = -O -Olimit 4000
else
OPTIMIZER = -O -OPT:Olimit=4000
endif
endif
#
# The default behavior is still -o32 generation, hence the explicit tests
# for -n32 and -64 and implicitly assuming -o32. If that changes, ...
#
ifeq ($(basename $(OS_RELEASE)),6)
ODD_CFLAGS += -multigot
SHLIB_LD_OPTS = -no_unresolved
ifeq ($(USE_N32),1)
ODD_CFLAGS += -n32 -woff 1209
COMPILER_TAG = _n32
LDOPTS += -n32
SHLIB_LD_OPTS += -n32
ifeq ($(OS_RELEASE), 6_2)
LDOPTS += -Wl,-woff,85
SHLIB_LD_OPTS += -woff 85
endif
else
ifeq ($(USE_64),1)
ODD_CFLAGS += -64
COMPILER_TAG = _64
else
ODD_CFLAGS += -32
COMPILER_TAG = _o32
endif
endif
else
ODD_CFLAGS += -xgot
endif
endif
ODD_CFLAGS += -DSVR4 -DIRIX
CPU_ARCH = mips
RANLIB = /bin/true
# For purify
# XXX: should always define _SGI_MP_SOURCE
NOMD_OS_CFLAGS = $(ODD_CFLAGS) -D_SGI_MP_SOURCE
ifeq ($(OS_RELEASE),5.3)
OS_CFLAGS += -DIRIX5_3
endif
ifneq ($(basename $(OS_RELEASE)),5)
OS_CFLAGS += -D_PR_HAVE_SGI_PRDA_PROCMASK
endif
ifeq (,$(filter-out 6.5,$(OS_RELEASE)))
ifneq ($(NS_USE_GCC), 1)
OS_CFLAGS += -mips3
endif
OS_CFLAGS += -D_PR_HAVE_GETPROTO_R -D_PR_HAVE_GETPROTO_R_POINTER
ifeq ($(USE_PTHREADS),1)
OS_CFLAGS += -D_PR_HAVE_GETHOST_R -D_PR_HAVE_GETHOST_R_POINTER
endif
endif
ifndef NO_MDUPDATE
OS_CFLAGS += $(NOMD_OS_CFLAGS) -MDupdate $(DEPENDENCIES)
else
OS_CFLAGS += $(NOMD_OS_CFLAGS)
endif
# -rdata_shared is an ld option that puts string constants and
# const data into the text segment, where they will be shared
# across processes and be read-only.
MKSHLIB = $(LD) $(SHLIB_LD_OPTS) -rdata_shared -shared -soname $(notdir $@)
DSO_LDOPTS = -elf -shared -all

View File

@@ -1,137 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
######################################################################
# Config stuff for Linux (all architectures)
######################################################################
######################################################################
# Version-independent
######################################################################
include $(MOD_DEPTH)/config/UNIX.mk
#
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
ifneq ($(USE_PTHREADS),1)
CLASSIC_NSPR = 1
endif
endif
#
# The default implementation strategy for Linux is pthreads.
#
ifeq ($(CLASSIC_NSPR),1)
IMPL_STRATEGY = _EMU
DEFINES += -D_PR_LOCAL_THREADS_ONLY
else
USE_PTHREADS = 1
ifeq ($(HAVE_CCONF), 1)
IMPL_STRATEGY = _glibc_PTH
else
IMPL_STRATEGY = _PTH
endif
DEFINES += -D_REENTRANT
endif
ifeq (86,$(findstring 86,$(OS_TEST)))
CPU_ARCH := x86
else
ifeq (,$(filter-out arm% sa110,$(OS_TEST)))
CPU_ARCH := arm
else
CPU_ARCH := $(OS_TEST)
endif
endif
CPU_ARCH_TAG = _$(CPU_ARCH)
CC = gcc
CCC = g++
RANLIB = ranlib
OS_INCLUDES =
G++INCLUDES = -I/usr/include/g++
PLATFORM_FLAGS = -ansi -Wall -pipe -DLINUX -Dlinux -D_LARGEFILE64_SOURCE
PORT_FLAGS = -D_POSIX_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -DHAVE_STRERROR
OS_CFLAGS = $(DSO_CFLAGS) $(PLATFORM_FLAGS) $(PORT_FLAGS)
######################################################################
# Version-specific stuff
######################################################################
ifeq ($(CPU_ARCH),alpha)
PLATFORM_FLAGS += -D_ALPHA_ -D__alpha -mieee
endif
ifeq ($(CPU_ARCH),x86)
PLATFORM_FLAGS += -Di386
endif
ifeq ($(CPU_ARCH),m68k)
#
# gcc on Linux/m68k either has a bug or triggers a code-sequence
# bug in the 68060 which causes gcc to crash. The simplest way to
# avoid this is to enable a minimum level of optimization.
#
ifndef BUILD_OPT
OPTIMIZER += -O
endif
PLATFORM_FLAGS += -m68020-40
endif
#
# Linux 2.x has shared libraries.
#
MKSHLIB = $(LD) $(DSO_LDOPTS) -soname $(notdir $@)
ifdef BUILD_OPT
OPTIMIZER = -O2
endif
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
######################################################################
# Other
######################################################################
DSO_CFLAGS = -fPIC
DSO_LDOPTS = -shared

View File

@@ -1,149 +0,0 @@
#! gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MOD_DEPTH = ..
# Indicate that this directory builds build tools.
INTERNAL_TOOLS = 1
include $(MOD_DEPTH)/config/config.mk
CSRCS = now.c
# This version hasn't been ported for us; the one in mozilla/config has
ifneq ($(OS_ARCH),OS2)
CSRCS += nsinstall.c
PLSRCS = nfspwd.pl
endif
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
PROG_SUFFIX = .exe
else
PROG_SUFFIX =
endif
# Temporary workaround to disable the generation of
# library build time because now.c uses the 'long long'
# data type that's not available on some platforms.
ifeq (,$(filter-out NEC NEXTSTEP QNX SCOOS UNIXWARE,$(OS_ARCH)))
DEFINES += -DOMIT_LIB_BUILD_TIME
endif
ifeq ($(OS_ARCH), IRIX)
ifeq ($(basename $(OS_RELEASE)),6)
ifeq ($(USE_N32),1)
XLDOPTS += -n32 -Wl,-woff,85
ifeq ($(OS_RELEASE), 6_2)
XLDOPTS += -Wl,-woff,85
endif
else
ifeq ($(USE_64),1)
XLDOPTS += -64
else
XLDOPTS += -32
endif
endif
endif
endif
ifeq ($(OS_ARCH), HP-UX)
ifeq ($(OS_RELEASE), B.11.23)
ifeq ($(USE_64),1)
XLDOPTS += +DD64
else
XLDOPTS += +DD32
endif
else
ifeq ($(USE_64),1)
XLDOPTS += +DA2.0W
endif
endif
endif
ifeq ($(MOZ_OS2_TOOLS),EMX)
XCFLAGS = $(OS_EXE_CFLAGS)
ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF)
XLDOPTS = -Zlinker /PM:VIO
endif
endif
ifeq ($(MOZ_OS2_TOOLS),PGCC)
XCFLAGS = $(OS_EXE_CFLAGS)
XLDOPTS = -Zlinker /PM:VIO
endif
ifeq ($(MOZ_OS2_TOOLS),VACPP)
OS_CFLAGS = $(OS_EXE_CFLAGS)
endif
include $(MOD_DEPTH)/config/rules.mk
PROGS = $(OBJDIR)/now$(PROG_SUFFIX)
ifeq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
TARGETS = $(PROGS)
else
PROGS += $(OBJDIR)/nsinstall$(PROG_SUFFIX)
TARGETS = $(PROGS) $(PLSRCS:.pl=)
endif
OUTOPTION = -o # end of the line
ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET)))
OUTOPTION = /Fe
endif
# Redefine MAKE_OBJDIR for just this directory
define MAKE_OBJDIR
if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); else true; fi
endef
export:: $(TARGETS)
$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
@$(MAKE_OBJDIR)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(LINK) $(EXEFLAGS) $<
else
$(CC) $(XCFLAGS) $< $(XLDOPTS) $(OUTOPTION)$@
endif
cleanconfig: FORCE
$(RM) -r $(OBJDIR)
FORCE:

View File

@@ -1,151 +0,0 @@
#! gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MOD_DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
# Indicate that this directory builds build tools.
INTERNAL_TOOLS = 1
# autoconf.mk must be deleted last (from the top-level directory)
# because it is included by every makefile.
DIST_GARBAGE =
include $(topsrcdir)/config/config.mk
ifndef MOZILLA_CLIENT
CSRCS = nsinstall.c
endif
CSRCS += now.c
PLSRCS = nfspwd.pl
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH)))
PROG_SUFFIX = .exe
else
PROG_SUFFIX =
endif
# Temporary workaround to disable the generation of
# library build time because now.c uses the 'long long'
# data type that's not available on some platforms.
ifeq (,$(filter-out NEC NEXTSTEP QNX SCOOS UNIXWARE,$(OS_ARCH)))
DEFINES += -DOMIT_LIB_BUILD_TIME
endif
ifeq ($(OS_ARCH), IRIX)
ifeq ($(basename $(OS_RELEASE)),6)
ifeq ($(USE_N32),1)
XLDOPTS += -n32 -Wl,-woff,85
ifeq ($(OS_RELEASE), 6_2)
XLDOPTS += -Wl,-woff,85
endif
else
ifeq ($(USE_64),1)
XLDOPTS += -64
else
XLDOPTS += -32
endif
endif
endif
endif
ifeq ($(OS_ARCH), HP-UX)
ifeq ($(OS_RELEASE), B.11.23)
ifeq ($(USE_64),1)
XLDOPTS += +DD64
else
XLDOPTS += +DD32
endif
else
ifeq ($(USE_64),1)
XLDOPTS += +DA2.0W
endif
endif
endif
ifeq ($(OS_ARCH), OpenVMS)
XLDOPTS += $(LDFLAGS)
endif
ifeq ($(MOZ_OS2_TOOLS),EMX)
XCFLAGS = $(OS_EXE_CFLAGS)
XLDOPTS = -Zomf -Zlinker -PM:VIO
endif
ifeq ($(MOZ_OS2_TOOLS),VACPP)
OS_CFLAGS = $(OS_EXE_CFLAGS)
endif
include $(topsrcdir)/config/rules.mk
PROGS = $(OBJDIR)/now$(PROG_SUFFIX)
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH)))
TARGETS = $(PROGS)
else
PROGS += $(OBJDIR)/nsinstall$(PROG_SUFFIX)
TARGETS = $(PROGS) $(PLSRCS:.pl=)
endif
OUTOPTION = -o # end of the line
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
ifndef NS_USE_GCC
OUTOPTION = -Fe
endif
endif
# Redefine MAKE_OBJDIR for just this directory
define MAKE_OBJDIR
if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); else true; fi
endef
export:: $(TARGETS)
$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
@$(MAKE_OBJDIR)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(LD) $(EXEFLAGS) $<
else
$(CC) $(XCFLAGS) $< $(XLDOPTS) $(OUTOPTION)$@
endif

View File

@@ -1,101 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for NCR SVR4 MP-RAS
#
include $(MOD_DEPTH)/config/UNIX.mk
###
NS_USE_NATIVE = 1
# NS_USE_GCC = 1
export PATH:=$(PATH):/opt/ncc/bin
###
RANLIB = true
GCC_FLAGS_EXTRA = -pipe
DEFINES += -DSVR4 -DSYSV -DHAVE_STRERROR -DNCR -D_PR_LOCAL_THREADS_ONLY
ifeq (,$(filter-out 2.03,$(OS_RELEASE)))
DEFINES += -D_PR_STAT_HAS_ST_ATIM
else
DEFINES += -D_PR_STAT_HAS_ST_ATIM_UNION
endif
ifdef NS_USE_NATIVE
CC = cc
CCC = ncc
OS_CFLAGS = -Hnocopyr
#OS_LIBS = -L/opt/ncc/lib
else
#OS_LIBS =
endif
CCC = g++
#OS_LIBS += -lsocket -lnsl -ldl -lc
MKSHLIB = $(LD) $(DSO_LDOPTS)
#DSO_LDOPTS = -G -z defs
DSO_LDOPTS = -G
CPU_ARCH = x86
ARCH = ncr
NOSUCHFILE = /no-such-file
# now take care of default GCC (rus@5/5/97)
ifdef NS_USE_GCC
# if gcc-settings are redefined already - don't touch it
#
ifeq (,$(findstring gcc, $(CC)))
CC = gcc
CCC = g++
CXX = g++
COMPILER_TAG = _gcc
# always use -fPIC - some makefiles are still broken and don't distinguish
# situation when they build shared and static libraries
CFLAGS += -fPIC -Wall $(GCC_FLAGS_EXTRA)
#OS_LIBS += -L/usr/local/lib -lstdc++ -lg++ -lgcc
endif
endif
###

View File

@@ -1,65 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for NEC Mips SYSV
#
include $(MOD_DEPTH)/config/UNIX.mk
CPU_ARCH = mips
ifdef NS_USE_GCC
CC = gcc
CCC = g++
else
CC = $(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000
CCC = g++
endif
MKSHLIB = $(LD) $(DSO_LDOPTS)
RANLIB = /bin/true
DEFINES += -D_PR_LOCAL_THREADS_ONLY
OS_CFLAGS = $(ODD_CFLAGS) -DSVR4 -D__SVR4 -DNEC -Dnec_ews -DHAVE_STRERROR
OS_LIBS = -lsocket -lnsl -ldl $(LDOPTIONS)
LDOPTIONS = -lc -L/usr/ucblib -lucb
NOSUCHFILE = /no-such-file
DSO_LDOPTS = -G

View File

@@ -1,78 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
######################################################################
# Config stuff for Sony NEWS-OS
######################################################################
######################################################################
# Version-independent
######################################################################
include $(MOD_DEPTH)/config/UNIX.mk
ARCH := sony
CPU_ARCH := mips
CC = cc
CCC = CC
RANLIB = /bin/true
OS_INCLUDES = -I/usr/include
G++INCLUDES =
#OS_LIBS = -lsocket -lnsl -lgen -lresolv
PLATFORM_FLAGS = -Xa -fullwarn -DSONY
PORT_FLAGS = -DSYSV -DSVR4 -D__svr4 -D__svr4__ -D_PR_LOCAL_THREADS_ONLY -DHAVE_SVID_GETTOD
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS)
######################################################################
# Version-specific stuff
######################################################################
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
######################################################################
# Other
######################################################################
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -G

View File

@@ -1,72 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for NEXTSTEP
#
include $(MOD_DEPTH)/config/UNIX.mk
CC = cc
CCC = cc++
RANLIB = ranlib
OS_REL_CFLAGS = -D$(shell uname -p)
CPU_ARCH := $(shell uname -p)
# "Commons" are tentative definitions in a global scope, like this:
# int x;
# The meaning of a common is ambiguous. It may be a true definition:
# int x = 0;
# or it may be a declaration of a symbol defined in another file:
# extern int x;
# Use the -fno-common option to force all commons to become true
# definitions so that the linker can catch multiply-defined symbols.
# Also, common symbols are not allowed with Rhapsody dynamic libraries.
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wall -fno-common -pipe -DNEXTSTEP -DHAVE_STRERROR -DHAVE_BSD_FLOCK -D_POSIX_SOURCE -traditional-cpp -posix
DEFINES += -D_PR_LOCAL_THREADS_ONLY
ARCH = $(CPU_ARCH)
# May override this with -bundle to create a loadable module.
#DSO_LDOPTS = -dynamiclib
#MKSHLIB = $(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS)
DLL_SUFFIX = dylib

View File

@@ -1,94 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1999-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
######################################################################
# Config stuff for Neutrino
######################################################################
include $(MOD_DEPTH)/config/UNIX.mk
#
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
ifneq ($(USE_PTHREADS),1)
CLASSIC_NSPR = 1
endif
endif
#
# The default implementation strategy for Linux is pthreads.
#
ifeq ($(CLASSIC_NSPR),1)
IMPL_STRATEGY = _EMU
DEFINES += -D_PR_LOCAL_THREADS_ONLY
else
USE_PTHREADS = 1
IMPL_STRATEGY = _PTH
DEFINES += -D_REENTRANT
endif
AR = qcc -Vgcc_ntox86 -M -a $@
CC = qcc -Vgcc_ntox86
LD = $(CC)
CCC = $(CC)
# Old Flags -DNO_REGEX -DSTRINGS_ALIGNED
OS_CFLAGS = -Wc,-Wall -Wc,-Wno-parentheses -DNTO \
-D_QNX_SOURCE -DHAVE_POINTER_LOCALTIME_R -shared
COMPILER_TAG = _qcc
MKSHLIB = qcc -Vgcc_ntox86 -shared -Wl,-h$(@:$(OBJDIR)/%.so=%.so) -M
RANLIB = ranlib
G++INCLUDES =
OS_LIBS =
EXTRA_LIBS = -lsocket
ifdef BUILD_OPT
OPTIMIZER = -O1
else
OPTIMIZER = -O1 -gstabs
endif
NOSUCHFILE = /no-such-file
GARBAGE += *.map

View File

@@ -1,91 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for NetBSD
#
include $(MOD_DEPTH)/config/UNIX.mk
CC = gcc
CCC = g++
RANLIB = ranlib
ifndef OBJECT_FMT
OBJECT_FMT := $(shell if echo __ELF__ | $${CC:-cc} -E - | grep -q __ELF__ ; then echo a.out ; else echo ELF ; fi)
endif
OS_REL_CFLAGS =
ifeq (86,$(findstring 86,$(OS_TEST)))
CPU_ARCH = x86
else
CPU_ARCH = $(OS_TEST)
endif
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DNETBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
ifeq ($(USE_PTHREADS),1)
OS_LIBS = -lc_r
# XXX probably should define _THREAD_SAFE too.
else
OS_LIBS = -lc
DEFINES += -D_PR_LOCAL_THREADS_ONLY
endif
ARCH = netbsd
ifeq ($(OBJECT_FMT),ELF)
DLL_SUFFIX = so
else
DLL_SUFFIX = so.1.0
# XXX work around a bug in the a.out ld(1).
OS_LIBS =
endif
DSO_CFLAGS = -fPIC -DPIC
DSO_LDOPTS = -shared
ifeq ($(OBJECT_FMT),ELF)
DSO_LDOPTS +=-Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
endif
ifdef LIBRUNPATH
DSO_LDOPTS += -Wl,-R$(LIBRUNPATH)
endif
MKSHLIB = $(CC) $(DSO_LDOPTS)
G++INCLUDES = -I/usr/include/g++

View File

@@ -1,179 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Configuration common to all (supported) versions of OS/2
#
# OS_CFLAGS is the command line options for the compiler when
# building the .DLL object files.
# OS_EXE_CFLAGS is the command line options for the compiler
# when building the .EXE object files; this is for the test
# programs.
# the macro OS_CFLAGS is set to OS_EXE_CFLAGS inside of the
# makefile for the pr/tests directory. ... Hack.
# Specify toolset. Default to EMX.
ifeq ($(MOZ_OS2_TOOLS),VACPP)
XP_OS2_VACPP = 1
else
ifeq ($(MOZ_OS2_TOOLS),PGCC)
XP_OS2_EMX = 1
else
MOZ_OS2_TOOLS = EMX
XP_OS2_EMX = 1
endif
endif
ifeq ($(XP_OS2_EMX),1)
MOZ_EMXTAG = $(subst .,,$(MOZ_OS2_EMX_OBJECTFORMAT))
endif
#
# On OS/2 we proudly support gbash...
#
SHELL = GBASH.EXE
CC = icc -q -DXP_OS2 -N10
CCC = icc -q -DXP_OS2 -DOS2=4 -N10
LINK = -ilink
AR = -ilib /noignorecase /nologo /Out:$(subst /,\\,$@)
RANLIB = @echo RANLIB
BSDECHO = @echo BSDECHO
NSINSTALL = nsinstall
INSTALL = $(NSINSTALL)
MAKE_OBJDIR = if test ! -d $(OBJDIR); then mkdir $(OBJDIR); fi
IMPLIB = implib -nologo -noignorecase
FILTER = cppfilt -b -p -q
RC = rc.exe
GARBAGE =
XP_DEFINE = -DXP_PC
LIB_SUFFIX = lib
DLL_SUFFIX = dll
OBJ_SUFFIX = obj
OS_CFLAGS = -W3 -Wcnd- -gm -gd+ -sd- -su4 -ge- -Mp
OS_EXE_CFLAGS = -W3 -Wcnd- -gm -gd+ -sd- -su4 -Mp
AR_EXTRA_ARGS =
ifdef BUILD_OPT
OPTIMIZER = -O+ -Oi
DEFINES = -UDEBUG -U_DEBUG -DNDEBUG
DLLFLAGS = -DLL -OUT:$@ -MAP:$(@:.dll=.map)
EXEFLAGS = -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
OBJDIR_TAG = _OPT
else
OPTIMIZER = -Ti+ -DE
DEFINES = -DDEBUG -D_DEBUG -DDEBUGPRINTS
DLLFLAGS = -DEBUG -DLL -OUT:$@ -MAP:$(@:.dll=.map)
EXEFLAGS = -DEBUG -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
OBJDIR_TAG = _DBG
LDFLAGS = -DEBUG
endif
DEFINES += -DOS2=4
DEFINES += -D_X86_
DEFINES += -D_PR_GLOBAL_THREADS_ONLY -DBSD_SELECT
# Name of the binary code directories
ifdef MOZ_LITE
OBJDIR_NAME = $(subst OS2,NAV,$(OS_CONFIG))_$(MOZ_OS2_TOOLS)$(MOZ_EMXTAG)$(OBJDIR_TAG).OBJ
else
OBJDIR_NAME = $(OS_CONFIG)_$(MOZ_OS2_TOOLS)$(MOZ_EMXTAG)$(OBJDIR_TAG).OBJ
endif
OS_DLLFLAGS = -nologo -DLL -FREE -NOE
ifdef XP_OS2_VACPP
OS_LIBS = so32dll.lib tcp32dll.lib
DEFINES += -DXP_OS2_VACPP -DTCPV40HDRS
else
CC = gcc
CCC = gcc
LINK = gcc
RC = rc.exe
FILTER = emxexp
IMPLIB = emximp -o
# Determine which object format to use. Two choices:
# a.out and omf. We default to omf.
ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT), A.OUT)
AR = ar -q $@
LIB_SUFFIX = a
else
OMF_FLAG = -Zomf
AR = emxomfar r $@
LIB_SUFFIX = lib
endif
# if we compile with GCC we can also use the high-memory flag if specified
ifeq ($(MOZ_OS2_HIGH_MEMORY),1)
HIGHMEM_LDFLAG = -Zhigh-mem
endif
OS_LIBS = -lsocket -lemxio
DEFINES += -DXP_OS2 -DXP_OS2_EMX -DOS2EMX_PLAIN_CHAR
OS_CFLAGS = $(OMF_FLAG) -Wall -Wno-unused -Zmtd
OS_EXE_CFLAGS = $(OMF_FLAG) -Wall -Wno-unused -Zmtd
OS_DLLFLAGS = $(OMF_FLAG) -Zmt -Zdll -Zcrtdll $(HIGHMEM_LDFLAG) -o $@
ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF)
EXEFLAGS += -Zlinker /DE
endif
ifdef BUILD_OPT
OPTIMIZER = -O3
DLLFLAGS = $(HIGHMEM_LDFLAG)
EXEFLAGS = $(HIGHMEM_LDFLAG) -Zmtd -o $@
else
OPTIMIZER = -g #-s
DLLFLAGS = -g $(HIGHMEM_LDFLAG) #-s
EXEFLAGS = -g $(HIGHMEM_LDFLAG) $(OMF_FLAG) -Zmtd -L$(DIST)/lib -o $@ # -s
ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF)
EXEFLAGS += -Zlinker /DE
endif
endif
AR_EXTRA_ARGS =
endif

View File

@@ -1,135 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for DEC OSF/1
#
#
# The Bourne shell (sh) on OSF1 doesn't handle "set -e" correctly,
# which we use to stop LOOP_OVER_DIRS submakes as soon as any
# submake fails. So we use the Korn shell instead.
#
SHELL = /usr/bin/ksh
include $(MOD_DEPTH)/config/UNIX.mk
#
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
ifneq ($(USE_PTHREADS),1)
CLASSIC_NSPR = 1
endif
endif
#
# Prior to OSF1 V4.0, classic nspr is the default (and only) implementation
# strategy.
#
# On OSF1 V4.0, pthreads is the default implementation strategy.
# Classic nspr is also available.
#
ifeq (,$(filter-out V2.0 V3.2,$(OS_RELEASE)))
CLASSIC_NSPR = 1
endif
ifeq ($(CLASSIC_NSPR), 1)
IMPL_STRATEGY = _EMU
DEFINES += -D_PR_LOCAL_THREADS_ONLY
else
USE_PTHREADS = 1
ifeq ($(HAVE_CCONF), 1)
IMPL_STRATEGY =
else
IMPL_STRATEGY = _PTH
endif
endif
ifeq ($(HAVE_CCONF), 1)
CC = cc $(NON_LD_FLAGS)
else
CC = cc $(NON_LD_FLAGS) -std1
endif
ifneq ($(OS_RELEASE),V2.0)
CC += -readonly_strings
endif
# The C++ compiler cxx has -readonly_strings on by default.
CCC = cxx
RANLIB = /bin/true
CPU_ARCH = alpha
ifdef BUILD_OPT
OPTIMIZER += -Olimit 4000
endif
NON_LD_FLAGS = -ieee_with_inexact
OS_CFLAGS = -DOSF1 -D_REENTRANT
ifeq ($(HAVE_CCONF), 1)
OS_CFLAGS += -DIS_64 -DOSF1V4D -DOSF1
endif
ifneq (,$(filter-out V2.0 V3.2,$(OS_RELEASE)))
OS_CFLAGS += -DOSF1_HAVE_MACHINE_BUILTINS_H
endif
ifeq (,$(filter-out V2.0 V3.2,$(OS_RELEASE)))
OS_CFLAGS += -DHAVE_INT_LOCALTIME_R
else
OS_CFLAGS += -DHAVE_POINTER_LOCALTIME_R
endif
ifeq (,$(filter-out V4.0%,$(OS_RELEASE)))
OS_CFLAGS += -DOSF1V4_MAP_PRIVATE_BUG
endif
ifeq ($(USE_PTHREADS),1)
OS_CFLAGS += -pthread
ifneq (,$(filter-out V2.0 V3.2,$(OS_RELEASE)))
OS_CFLAGS += -D_PR_HAVE_THREADSAFE_GETHOST
endif
endif
# The command to build a shared library on OSF1.
MKSHLIB = ld -shared -all -expect_unresolved "*" -soname $(notdir $@)
DSO_LDOPTS = -shared

View File

@@ -1,82 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for OpenBSD
#
include $(MOD_DEPTH)/config/UNIX.mk
CC = gcc
CCC = g++
RANLIB = ranlib
OS_REL_CFLAGS =
ifeq (86,$(findstring 86,$(OS_TEST)))
CPU_ARCH = x86
else
CPU_ARCH = $(OS_TEST)
endif
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe $(THREAD_FLAG) -DOPENBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
ifeq ($(USE_PTHREADS),1)
THREAD_FLAG += -pthread
# XXX probably should define _THREAD_SAFE too.
else
DEFINES += -D_PR_LOCAL_THREADS_ONLY
endif
ARCH = openbsd
DLL_SUFFIX = so.1.0
DSO_CFLAGS = -fPIC
DSO_LDOPTS = -Bshareable
ifeq ($(OS_TEST),alpha)
DSO_LDOPTS = -shared
endif
ifeq ($(OS_TEST),mips)
DSO_LDOPTS = -shared
endif
ifeq ($(OS_TEST),pmax)
DSO_LDOPTS = -shared
endif
MKSHLIB = $(LD) $(DSO_LDOPTS)
G++INCLUDES = -I/usr/include/g++

View File

@@ -1,54 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for Compaq OpenVMS
#
include $(MOD_DEPTH)/config/UNIX.mk
RANLIB = /bin/true
CPU_ARCH_TAG = _$(CPU_ARCH)
#
# XCFLAGS are the only CFLAGS that are used during a link operation. Defining
# OPTIMIZER in XCFLAGS means that each compilation line gets OPTIMIZER
# included twice, but at least we get OPTIMIZER included in the link
# operations; and OpenVMS needs it!
#
XCFLAGS += $(OPTIMIZER)

View File

@@ -1,61 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
######################################################################
# Config stuff for QNX.
######################################################################
include $(MOD_DEPTH)/config/UNIX.mk
CPU_ARCH = x86
ifndef NS_USE_GCC
CC = cc
CCC = cc
endif
RANLIB = true
G++INCLUDES =
OS_LIBS =
XLDOPTS = -lunix
OS_CFLAGS = -DQNX -Di386 -D_PR_LOCAL_THREADS_ONLY -D_PR_NEED_H_ERRNO
#IMPL_STRATEGY = _EMU
NOSUCHFILE = /no-such-file
GARBAGE = $(wildcard *.err)

View File

@@ -1,46 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
This part of of the tree taken from NSPR 4.1. The
NSPR config tree was tagged with:
cvs tag ldapcsdk_branch50-config
The version of NSPR this was taken from:
NSPRPUB_RELEASE_4_1 (revision: 3.23)

View File

@@ -1,87 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for Rhapsody
#
include $(MOD_DEPTH)/config/UNIX.mk
#
# The default implementation strategy for Rhapsody is pthreads.
#
ifeq ($(CLASSIC_NSPR),1)
IMPL_STRATEGY = _EMU
DEFINES += -D_PR_LOCAL_THREADS_ONLY
else
USE_PTHREADS = 1
IMPL_STRATEGY = _PTH
endif
CC = cc
CCC = c++
RANLIB = ranlib
ifeq (86,$(findstring 86,$(OS_TEST)))
OS_REL_CFLAGS = -mno-486 -Di386
CPU_ARCH = i386
else
OS_REL_CFLAGS = -Dppc
CPU_ARCH = ppc
endif
# "Commons" are tentative definitions in a global scope, like this:
# int x;
# The meaning of a common is ambiguous. It may be a true definition:
# int x = 0;
# or it may be a declaration of a symbol defined in another file:
# extern int x;
# Use the -fno-common option to force all commons to become true
# definitions so that the linker can catch multiply-defined symbols.
# Also, common symbols are not allowed with Rhapsody dynamic libraries.
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wmost -fno-common -pipe -DRHAPSODY -DHAVE_STRERROR -DHAVE_BSD_FLOCK
ARCH = rhapsody
# May override this with -bundle to create a loadable module.
DSO_LDOPTS = -dynamiclib -compatibility_version 1 -current_version 1 -all_load
MKSHLIB = $(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS)
DLL_SUFFIX = dylib
G++INCLUDES = -I/usr/include/g++

View File

@@ -1,67 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for SCO OpenServer for x86.
# SCO OpenServer 5, based on SVR3.2, is intended for small to
# medium customers.
#
include $(MOD_DEPTH)/config/UNIX.mk
CC = cc -b elf -KPIC
CCC = $(NSDEPTH)/build/hcpp CC +.cpp +w
RANLIB = /bin/true
DEFINES += -D_PR_LOCAL_THREADS_ONLY
#
# -DSCO - Changes to Netscape source (consistent with AIX, LINUX, etc..)
# -Dsco - Needed for /usr/include/X11/*
#
OS_CFLAGS = -DSYSV -D_SVID3 -DHAVE_STRERROR -D_PR_NEED_H_ERRNO -DSCO -Dsco
#OS_LIBS = -lpmapi -lsocket -lc
MKSHLIB = $(LD) $(DSO_LDOPTS)
CPU_ARCH = x86
ARCH = sco
NOSUCHFILE = /no-such-file
BSDECHO = /bin/echo
DSO_LDOPTS = -b elf -G

View File

@@ -1,112 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for SNI SINIX (aka ReliantUNIX)
#
include $(MOD_DEPTH)/config/UNIX.mk
ifeq (86,$(findstring 86,$(OS_TEST)))
CPU_ARCH = x86
else
CPU_ARCH = mips
endif
CPU_ARCH_TAG = _$(CPU_ARCH)
# use gcc -tf-
NS_USE_GCC = 1
ifeq ($(NS_USE_GCC),1)
## gcc-2.7.2 homebrewn
CC = gcc
COMPILER_TAG = _gcc
CCC = g++
AS = $(CC) -x assembler-with-cpp
ifeq ($(CPU_ARCH),mips)
LD = gld
endif
ODD_CFLAGS = -Wall -Wno-format
ifeq ($(CPU_ARCH),mips)
# The -pipe flag only seems to work on the mips version of SINIX.
ODD_CFLAGS += -pipe
endif
ifdef BUILD_OPT
OPTIMIZER = -O
#OPTIMIZER = -O6
endif
MKSHLIB = $(LD) -G -z defs -h $(@:$(OBJDIR)/%.so=%.so)
#DSO_LDOPTS = -G -Xlinker -Blargedynsym
else
## native compiler (CDS++ 1.0)
CC = /usr/bin/cc
CCC = /usr/bin/CC
AS = /usr/bin/cc
#ODD_CFLAGS = -fullwarn -xansi
ODD_CFLAGS =
ifdef BUILD_OPT
#OPTIMIZER = -Olimit 4000
OPTIMIZER = -O -F Olimit,4000
endif
MKSHLIB = $(LD) -G -z defs -h $(@:$(OBJDIR)/%.so=%.so)
#DSO_LDOPTS = -G -W l,-Blargedynsym
endif
ifeq ($(CPU_ARCH),x86)
DEFINES += -Di386
endif
ODD_CFLAGS += -DSVR4 -DSNI -DRELIANTUNIX -Dsinix -DHAVE_SVID_GETTOD
# On SINIX 5.43, need to define IP_MULTICAST in order to get the
# IP multicast macro and struct definitions in netinet/in.h.
# (SINIX 5.42 does not have IP multicast at all.)
ifeq ($(OS_RELEASE),5.43)
ODD_CFLAGS += -DIP_MULTICAST
endif
RANLIB = /bin/true
# For purify
NOMD_OS_CFLAGS = $(ODD_CFLAGS)
# we do not have -MDupdate ...
OS_CFLAGS = $(NOMD_OS_CFLAGS)
OS_LIBS = -lsocket -lnsl -lresolv -ldl -lc
NOSUCHFILE = /no-such-file
DEFINES += -D_PR_LOCAL_THREADS_ONLY

View File

@@ -1,46 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for SunOS.
# 4 and 5 are vastly different, so we use 2 different files.
#
ifeq ($(basename $(OS_RELEASE)),4.1)
include $(MOD_DEPTH)/config/SunOS4.mk
else
include $(MOD_DEPTH)/config/SunOS5.mk
endif

View File

@@ -1,72 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for SunOS4.1
#
include $(MOD_DEPTH)/config/UNIX.mk
# SunOS 4 _requires_ that shared libs have a version number.
# XXX FIXME: Version number should use NSPR_VERSION_NUMBER?
DLL_SUFFIX = so.1.0
CC = gcc
CCC = g++
COMPILER_TAG = _gcc
RANLIB = ranlib
CPU_ARCH = sparc
DEFINES += -D_PR_LOCAL_THREADS_ONLY
# Purify doesn't like -MDupdate
NOMD_OS_CFLAGS = -Wall -Wno-format -DSUNOS4
ifdef NO_MDUPDATE
OS_CFLAGS = $(DSO_CFLAGS) $(NOMD_OS_CFLAGS)
else
OS_CFLAGS = $(DSO_CFLAGS) $(NOMD_OS_CFLAGS) -MDupdate $(DEPENDENCIES)
endif
MKSHLIB = $(LD) $(DSO_LDOPTS)
NOSUCHFILE = /no-such-file
DSO_LDOPTS =
# -fPIC generates position-independent code for use in a shared library.
DSO_CFLAGS = -fPIC

View File

@@ -1,53 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# Config stuff for Solaris 8 on x86
#
SOL_CFLAGS = -D_SVID_GETTOD
include $(CORE_DEPTH)/coreconf/SunOS5.mk
CPU_ARCH = x86
ARCHFLAG =
OS_DEFINES += -Di386
ifeq ($(OS_RELEASE),5.8_i86pc)
OS_DEFINES += -DSOLARIS2_8
endif
OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc

View File

@@ -1,49 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# Config stuff for SunOS5.9
#
SOL_CFLAGS += -D_SVID_GETTOD
include $(CORE_DEPTH)/coreconf/SunOS5.mk
ifeq ($(OS_RELEASE),5.9)
OS_DEFINES += -DSOLARIS2_9
endif
OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc

View File

@@ -1,53 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# Config stuff for Solaris 9 on x86
#
SOL_CFLAGS = -D_SVID_GETTOD
include $(CORE_DEPTH)/coreconf/SunOS5.mk
CPU_ARCH = x86
ARCHFLAG =
OS_DEFINES += -Di386
ifeq ($(OS_RELEASE),5.9_i86pc)
OS_DEFINES += -DSOLARIS2_9
endif
OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc

View File

@@ -1,221 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for SunOS 5.x on sparc and x86
#
include $(MOD_DEPTH)/config/UNIX.mk
#
# XXX
# Temporary define for the Client; to be removed when binary release is used
#
ifdef MOZILLA_CLIENT
ifneq ($(USE_PTHREADS),1)
LOCAL_THREADS_ONLY = 1
endif
ifndef NS_USE_NATIVE
NS_USE_GCC = 1
endif
endif
#
# The default implementation strategy on Solaris is pthreads.
# Global threads only and local threads only are also available.
#
ifeq ($(GLOBAL_THREADS_ONLY),1)
IMPL_STRATEGY = _NATIVE
DEFINES += -D_PR_GLOBAL_THREADS_ONLY
else
ifeq ($(LOCAL_THREADS_ONLY),1)
IMPL_STRATEGY = _EMU
DEFINES += -D_PR_LOCAL_THREADS_ONLY
else
USE_PTHREADS = 1
ifeq ($(HAVE_CCONF), 1)
IMPL_STRATEGY =
else
IMPL_STRATEGY = _PTH
endif
endif
endif
ifeq ($(NS_USE_GCC), 1)
CC = gcc -Wall
CCC = g++ -Wall
ASFLAGS += -Wa,-P
COMPILER_TAG = _gcc
ifdef NO_MDUPDATE
OS_CFLAGS = $(NOMD_OS_CFLAGS)
else
OS_CFLAGS = $(NOMD_OS_CFLAGS) -MDupdate $(DEPENDENCIES)
endif
else
CC = cc -v -xstrconst
CCC = CC -Qoption cg -xstrconst
ASFLAGS += -Wa,-P
OS_CFLAGS = $(NOMD_OS_CFLAGS)
#
# If we are building for a release, we want to put all symbol
# tables in the debug executable or share library instead of
# the .o files, so that our clients can run dbx on the debug
# library without having the .o files around.
#
ifdef BUILD_NUMBER
ifndef BUILD_OPT
OS_CFLAGS += -xs
endif
endif
endif
ifeq ($(USE_64),1)
ifndef INTERNAL_TOOLS
ifneq ($(NS_USE_GCC), 1)
CC += -xarch=v9
CCC += -xarch=v9
else
CC += -m64
CCC += -m64
endif # NS_USE_GCC
endif # INTERNAL_TOOLS
COMPILER_TAG += _64
else # USE_64
ifeq ($(HAVE_CCONF), 1)
COMPILER_TAG =
else
COMPILER_TAG += _32
endif # HAVE_CCONF
endif # USE_64
RANLIB = echo
OS_DEFINES = -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS
ifeq ($(OS_TEST),i86pc)
CPU_ARCH = x86
COMPILER_TAG = _i86pc
OS_DEFINES += -Di386
# The default debug format, DWARF (-g), is not supported by gcc
# on i386-ANY-sysv4/solaris, but the stabs format is. It is
# assumed that the Solaris assembler /usr/ccs/bin/as is used.
# If your gcc uses GNU as, you do not need the -Wa,-s option.
ifndef BUILD_OPT
ifeq ($(NS_USE_GCC), 1)
OPTIMIZER = -Wa,-s -gstabs
endif
endif
else
ifeq ($(HAVE_CCONF), 1)
CPU_ARCH =
else
CPU_ARCH = sparc
endif
endif
ifeq ($(HAVE_CCONF), 1)
CPU_ARCH_TAG =
else
CPU_ARCH_TAG = _$(CPU_ARCH)
endif
ifeq (5.5,$(findstring 5.5,$(OS_RELEASE)))
OS_DEFINES += -DSOLARIS2_5
else
ifeq (,$(filter-out 5.3 5.4,$(OS_RELEASE)))
OS_DEFINES += -D_PR_NO_LARGE_FILES
else
OS_DEFINES += -D_PR_HAVE_OFF64_T
# The lfcompile64(5) man page on Solaris 2.6 says:
# For applications that do not wish to conform to the POSIX or
# X/Open specifications, the 64-bit transitional interfaces
# are available by default. No compile-time flags need to be
# set.
# But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
# The native compiler, gcc 2.8.x, and egcs don't have this problem.
#ifeq ($(NS_USE_GCC), 1)
OS_DEFINES += -D_LARGEFILE64_SOURCE
#endif
endif
endif
ifneq ($(LOCAL_THREADS_ONLY),1)
OS_DEFINES += -D_REENTRANT -DHAVE_POINTER_LOCALTIME_R
endif
# Purify doesn't like -MDupdate
NOMD_OS_CFLAGS = $(DSO_CFLAGS) $(OS_DEFINES) $(SOL_CFLAGS)
MKSHLIB = $(LD) $(DSO_LDOPTS)
# ld options:
# -G: produce a shared object
# -z defs: no unresolved symbols allowed
DSO_LDOPTS = -G -h $(notdir $@)
# -KPIC generates position independent code for use in shared libraries.
# (Similarly for -fPIC in case of gcc.)
ifeq ($(NS_USE_GCC), 1)
DSO_CFLAGS = -fPIC
else
DSO_CFLAGS = -KPIC
endif
NOSUCHFILE = /no-such-file
#
# Library of atomic functions for UltraSparc systems
#
# The nspr makefiles build ULTRASPARC_LIBRARY (which contains assembly language
# implementation of the nspr atomic functions for UltraSparc systems) in addition
# to libnspr.so. (The actual name of the library is
# lib$(ULTRASPARC_LIBRARY)$(MOD_VERSION).so
#
# The actual name of the filter-library, recorded in libnspr.so, is set to the
# value of $(ULTRASPARC_FILTER_LIBRARY).
# For an application to use the assembly-language implementation, a link should be
# made so that opening ULTRASPARC_FILTER_LIBRARY results in opening
# ULTRASPARC_LIBRARY. This indirection requires the user to explicitly set up
# library for use on UltraSparc systems, thereby helping to avoid using it by
# accident on non-UltraSparc systems.
# The directory containing the ultrasparc libraries should be in LD_LIBRARY_PATH.
#
ifeq ($(OS_TEST),sun4u)
ULTRASPARC_LIBRARY = ultrasparc
ULTRASPARC_FILTER_LIBRARY = libatomic.so
DSO_LDOPTS += -f $(ULTRASPARC_FILTER_LIBRARY)
endif

View File

@@ -1,113 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
ifeq ($(OS_ARCH), HP-UX)
ifeq ($(OS_TEST), ia64)
ifdef USE_64
64BIT_TAG=_ia64_64
else
64BIT_TAG=_ia64_32
endif
endif
endif
PR_UNIXOS = 1
XP_DEFINE = -DXP_UNIX
OBJ_SUFFIX = o
LIB_SUFFIX = a
DLL_SUFFIX = so
AR = ar cr $@
ifdef BUILD_OPT
OPTIMIZER = -O
DEFINES = -UDEBUG -DNDEBUG
ifeq ($(OS_ARCH), HP-UX)
OBJDIR_TAG = $(64BIT_TAG)_OPT
else
OBJDIR_TAG = _OPT
endif
else
OPTIMIZER = -g
DEFINES = -DDEBUG -UNDEBUG -DDEBUG_$(shell whoami)
ifeq ($(OS_ARCH), HP-UX)
OBJDIR_TAG = $(64BIT_TAG)_DBG
else
OBJDIR_TAG = _DBG
endif
endif
# Name of the binary code directories
ifdef MOZILLA_CLIENT
OBJDIR_NAME = $(OS_CONFIG)$(CPU_ARCH_TAG)$(OBJDIR_TAG).OBJ
else
OBJDIR_NAME = $(OS_CONFIG)$(CPU_ARCH_TAG)$(COMPILER_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
endif
MKDEPEND_DIR = $(DEPTH)/config/mkdepend
MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend
MKDEPENDENCIES = $(OBJDIR)/depend.mk
####################################################################
#
# One can define the makefile variable NSDISTMODE to control
# how files are published to the 'dist' directory. If not
# defined, the default is "install using relative symbolic
# links". The two possible values are "copy", which copies files
# but preserves source mtime, and "absolute_symlink", which
# installs using absolute symbolic links. The "absolute_symlink"
# option requires NFSPWD.
#
####################################################################
NSINSTALL = $(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall
ifeq ($(NSDISTMODE),copy)
# copy files, but preserve source mtime
INSTALL = $(NSINSTALL) -t
else
ifeq ($(NSDISTMODE),absolute_symlink)
# install using absolute symbolic links
INSTALL = $(NSINSTALL) -L `$(NFSPWD)`
else
# install using relative symbolic links
INSTALL = $(NSINSTALL) -R
endif
endif
define MAKE_OBJDIR
if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); else true; fi
endef

View File

@@ -1,75 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for SCO UnixWare
# UnixWare is intended for high-end enterprise customers.
# UnixWare 2.1 and 2.1.1 are based on SVR4. (2.1.2 is a maintenance
# release.)
# UnixWare 7 (codename Gemini) is based on what SCO calls SVR5.
# The somewhat odd version number 7 was chosen to suggest that
# UnixWare 2 + OpenServer 5 = UnixWare 7
#
include $(MOD_DEPTH)/config/UNIX.mk
ifeq (,$(filter-out 2.1,$(OS_RELEASE)))
CC = $(NSDEPTH)/build/hcc cc
CCC = $(NSDEPTH)/build/hcpp CC
else
CC = cc
CCC = CC
endif
RANLIB = true
DEFINES += -D_PR_LOCAL_THREADS_ONLY
OS_CFLAGS = -DSVR4 -DSYSV -DUNIXWARE
ifeq (,$(filter-out 2.1,$(OS_RELEASE)))
OS_CFLAGS += -D_PR_NO_LARGE_FILES
else
OS_CFLAGS += -D_LARGEFILE64_SOURCE -D_PR_HAVE_OFF64_T -D_PR_HAVE_SOCKADDR_LEN
endif
MKSHLIB = $(LD) $(DSO_LDOPTS)
DSO_LDOPTS = -G
CPU_ARCH = x86
ARCH = sco
NOSUCHFILE = /no-such-file

View File

@@ -1,179 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Configuration common to all versions of Windows NT
# and Windows 95.
#
#
# Client build: make sure we use the shmsdos.exe under $(MOZ_TOOLS).
# $(MOZ_TOOLS_FLIPPED) is $(MOZ_TOOLS) with all the backslashes
# flipped, so that gmake won't interpret them as escape characters.
#
ifdef PR_CLIENT_BUILD_WINDOWS
SHELL = $(MOZ_TOOLS_FLIPPED)/bin/shmsdos.exe
endif
CC = cl
CCC = cl
LINK = link
AR = lib -NOLOGO -OUT:"$@"
RANLIB = echo
BSDECHO = echo
NSINSTALL = nsinstall
INSTALL = $(NSINSTALL)
define MAKE_OBJDIR
if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
endef
RC = rc.exe
GARBAGE = $(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb
XP_DEFINE = -DXP_PC
OBJ_SUFFIX = obj
LIB_SUFFIX = lib
DLL_SUFFIX = dll
OS_CFLAGS = -W3 -nologo -GF -Gy
ifdef BUILD_OPT
OS_CFLAGS += -MD
OPTIMIZER = -O2
DEFINES = -UDEBUG -U_DEBUG -DNDEBUG
DLLFLAGS = -OUT:"$@"
OBJDIR_TAG = _OPT
# Add symbolic information for use by a profiler
ifdef MOZ_PROFILE
OPTIMIZER += -Zi
DLLFLAGS += -DEBUG
LDFLAGS += -DEBUG
endif
else
#
# Define USE_DEBUG_RTL if you want to use the debug runtime library
# (RTL) in the debug build
#
ifdef USE_DEBUG_RTL
OS_CFLAGS += -MDd
else
OS_CFLAGS += -MD
endif
OPTIMIZER = -Od -Zi
#OPTIMIZER = -Zi -Fd$(OBJDIR)/ -Od
DEFINES = -DDEBUG -D_DEBUG -UNDEBUG
DLLFLAGS = -DEBUG -OUT:"$@"
ifdef GLOWCODE
DLLFLAGS = -DEBUG -DEBUGTYPE:both -INCLUDE:_GlowCode -OUT:"$@"
endif
OBJDIR_TAG = _DBG
LDFLAGS = -DEBUG
#
# When PROFILE=1 is defined, set the compile and link options
# to build targets for use by the ms-win32 profiler
#
ifdef PROFILE
LDFLAGS += -PROFILE -MAP
DLLFLAGS += -PROFILE -MAP
endif
endif
DEFINES += -DWIN32 -D_WINDOWS
#
# On Win95, we use the TlsXXX() interface by default because that
# allows us to load the NSPR DLL dynamically at run time.
# If you want to use static thread-local storage (TLS) for better
# performance, build the NSPR library with USE_STATIC_TLS=1.
#
ifeq ($(USE_STATIC_TLS),1)
DEFINES += -D_PR_USE_STATIC_TLS
endif
#
# NSPR uses both fibers and static thread-local storage
# (i.e., __declspec(thread) variables) on NT. We need the -GT
# flag to turn off certain compiler optimizations so that fibers
# can use static TLS safely.
#
# Also, we optimize for Pentium (-G5) on NT.
#
ifeq ($(OS_TARGET),WINNT)
OS_CFLAGS += -GT
ifeq ($(CPU_ARCH),x86)
OS_CFLAGS += -G5
endif
DEFINES += -DWINNT
else
DEFINES += -DWIN95 -D_PR_GLOBAL_THREADS_ONLY
endif
ifeq ($(CPU_ARCH),x86)
DEFINES += -D_X86_
else
ifeq ($(CPU_ARCH),MIPS)
DEFINES += -D_MIPS_
else
ifeq ($(CPU_ARCH),ALPHA)
DEFINES += -D_ALPHA_=1
else
CPU_ARCH = processor_is_undefined
endif
endif
endif
# Name of the binary code directories
ifeq ($(CPU_ARCH),x86)
CPU_ARCH_TAG =
else
CPU_ARCH_TAG = $(CPU_ARCH)
endif
ifdef USE_DEBUG_RTL
OBJDIR_SUFFIX = OBJD
else
OBJDIR_SUFFIX = OBJ
endif
OBJDIR_NAME = $(OS_CONFIG)$(CPU_ARCH_TAG)$(OBJDIR_TAG).$(OBJDIR_SUFFIX)
OS_DLLFLAGS = -nologo -DLL -SUBSYSTEM:WINDOWS -PDB:NONE

View File

@@ -1,42 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for WIN95
#
include $(MOD_DEPTH)/config/WIN32.mk

View File

@@ -1,42 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Config stuff for WINNT
#
include $(MOD_DEPTH)/config/WIN32.mk

View File

@@ -1,302 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#######################################################################
# Master "Core Components" macros for getting the OS architecture #
#######################################################################
#
# Important internal static macros
#
OS_ARCH := $(subst /,_,$(shell uname -s))
OS_RELEASE := $(shell uname -r)
OS_TEST := $(shell uname -m)
#
# Tweak the default OS_ARCH and OS_RELEASE macros as needed.
#
ifeq ($(HAVE_CCONF), 1)
ifeq ($(OS_ARCH), Linux)
ifeq (2.6,$(findstring 2.6,$(OS_RELEASE)))
OS_RELEASE :=2.6
endif
ifeq (2.4,$(findstring 2.4,$(OS_RELEASE)))
OS_RELEASE :=2.4
endif
ifeq (2.2,$(findstring 2.2,$(OS_RELEASE)))
OS_RELEASE :=2.2
endif
ifeq (2.1,$(findstring 2.1,$(OS_RELEASE)))
OS_RELEASE :=2.1
endif
ifeq (2.0,$(findstring 2.0,$(OS_RELEASE)))
OS_RELEASE :=2.0
endif
endif
endif
ifeq ($(OS_ARCH),AIX)
OS_RELEASE := $(shell uname -v).$(shell uname -r)
endif
ifeq ($(OS_ARCH),BSD_386)
OS_ARCH := BSD_OS
endif
ifeq ($(OS_ARCH),dgux)
OS_ARCH := DGUX
endif
ifeq ($(OS_ARCH),IRIX64)
OS_ARCH := IRIX
endif
ifeq ($(OS_ARCH),UNIX_SV)
ifneq ($(findstring NCR,$(shell grep NCR /etc/bcheckrc | head -1 )),)
OS_ARCH := NCR
else
OS_ARCH := UNIXWARE
OS_RELEASE := $(shell uname -v)
endif
endif
ifeq ($(OS_ARCH),Mac OS)
OS_ARCH := Rhapsody
endif
ifeq ($(OS_ARCH),Darwin)
OS_ARCH := Rhapsody
endif
ifeq ($(OS_ARCH),ncr)
OS_ARCH := NCR
endif
# This is the only way to correctly determine the actual OS version on NCR boxes.
ifeq ($(OS_ARCH),NCR)
OS_RELEASE := $(shell awk '{print $$3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$$/\2.\3/')
endif
ifeq ($(OS_ARCH),UNIX_System_V)
OS_ARCH := NEC
endif
ifneq (,$(findstring POSIX_for_OpenVMS,$(OS_ARCH)))
OS_ARCH := OpenVMS
CPU_ARCH := $(shell uname -Wh)
OS_RELEASE := $(shell uname -v)
endif
ifeq ($(OS_ARCH),QNX)
ifeq ($(OS_RELEASE),6.00)
OS_ARCH := NTO
OS_RELEASE := _$(OS_TEST)$(OS_RELEASE)
else
OS_RELEASE := $(shell uname -v | sed 's/^\([0-9]\)\([0-9]*\)$$/\1.\2/')
endif
endif
ifeq ($(OS_ARCH),SCO_SV)
OS_ARCH := SCOOS
OS_RELEASE := 5.0
endif
ifeq ($(OS_ARCH),SINIX-N)
OS_ARCH := SINIX
endif
ifeq ($(OS_ARCH),SINIX-Y)
OS_ARCH := SINIX
endif
ifeq ($(OS_ARCH),SINIX-Z)
OS_ARCH := SINIX
endif
# SINIX changes name to ReliantUNIX with 5.43
ifeq ($(OS_ARCH),ReliantUNIX-N)
OS_ARCH := SINIX
endif
ifeq ($(OS_ARCH),UnixWare)
OS_ARCH := UNIXWARE
OS_RELEASE := $(shell uname -v)
endif
#
# Handle FreeBSD 2.2-STABLE and Linux 2.0.30-osfmach3
#
ifeq (,$(filter-out Linux FreeBSD,$(OS_ARCH)))
OS_RELEASE := $(shell echo "$(OS_RELEASE)" | sed 's/-.*//')
endif
#
# Distinguish between OSF1 V4.0B and V4.0D
#
ifeq ($(OS_ARCH)$(OS_RELEASE),OSF1V4.0)
OS_VERSION := $(shell uname -v)
ifeq ($(OS_VERSION),564)
OS_RELEASE := V4.0B
endif
ifeq ($(OS_VERSION),878)
OS_RELEASE := V4.0D
endif
endif
#
# Handle uname variants for OS/2.
#
ifeq ($(OS_ARCH),OS_2)
OS_ARCH := OS2
OS_RELEASE := 4.0
endif
#######################################################################
# Master "Core Components" macros for getting the OS target #
#######################################################################
#
# Note: OS_TARGET should be specified on the command line for gmake.
# When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
# The difference between the Win95 target and the WinNT target is that
# the WinNT target uses Windows NT specific features not available
# in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
# at lesser performance (the Win95 target uses threads; the WinNT target
# uses fibers).
#
# When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target
# is built. See: win16_3.11.mk for lots more about the Win16 target.
#
# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
# cross-compilation.
#
#
# The following hack allows one to build on a WIN95 machine (as if
# s/he were cross-compiling on a WINNT host for a WIN95 target).
# It also accomodates for MKS's uname.exe. If you never intend
# to do development on a WIN95 machine, you don't need this hack.
#
ifeq ($(OS_ARCH),WIN95)
OS_ARCH := WINNT
OS_TARGET := WIN95
endif
ifeq ($(OS_ARCH),Windows_95)
OS_ARCH := Windows_NT
OS_TARGET := WIN95
endif
ifeq ($(OS_ARCH),CYGWIN_95-4.0)
OS_ARCH := CYGWIN_NT-4.0
OS_TARGET := WIN95
endif
ifeq ($(OS_ARCH),OS2)
OS_ARCH := OS2
OS_TARGET := OS2
endif
#
# On WIN32, we also define the variable CPU_ARCH.
#
ifeq ($(OS_ARCH), WINNT)
ifneq ($(subst /,_,$(shell uname -s)),OS_2)
CPU_ARCH := $(shell uname -p)
else
CPU_ARCH := $(shell uname -m)
endif
ifeq ($(CPU_ARCH),I386)
CPU_ARCH = x86
endif
else
#
# If uname -s returns "Windows_NT", we assume that we are using
# the uname.exe in MKS toolkit.
#
# The -r option of MKS uname only returns the major version number.
# So we need to use its -v option to get the minor version number.
# Moreover, it doesn't have the -p option, so we need to use uname -m.
#
ifeq ($(OS_ARCH), Windows_NT)
OS_ARCH = WINNT
OS_MINOR_RELEASE := $(shell uname -v)
ifeq ($(OS_MINOR_RELEASE),00)
OS_MINOR_RELEASE = 0
endif
OS_RELEASE := $(OS_RELEASE).$(OS_MINOR_RELEASE)
CPU_ARCH := $(shell uname -m)
#
# MKS's uname -m returns "586" on a Pentium machine.
#
ifneq (,$(findstring 86,$(CPU_ARCH)))
CPU_ARCH = x86
endif
else
#
# If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
# the uname.exe in the Cygwin tools.
#
ifeq (CYGWIN_NT,$(findstring CYGWIN_NT,$(OS_ARCH)))
OS_RELEASE := $(patsubst CYGWIN_NT-%,%,$(OS_ARCH))
OS_ARCH = WINNT
CPU_ARCH := $(shell uname -m)
#
# Cygwin's uname -m returns "i686" on a Pentium Pro machine.
#
ifneq (,$(findstring 86,$(CPU_ARCH)))
CPU_ARCH = x86
endif
else
#
# Prior to the Beta 20 release, Cygwin was called GNU-Win32.
# If uname -s returns "CYGWIN32/NT", we assume that we are using
# the uname.exe in the GNU-Win32 tools.
#
ifeq ($(OS_ARCH), CYGWIN32_NT)
OS_ARCH = WINNT
CPU_ARCH := $(shell uname -m)
#
# GNU-Win32's uname -m returns "i686" on a Pentium Pro machine.
#
ifneq (,$(findstring 86,$(CPU_ARCH)))
CPU_ARCH = x86
endif
endif
endif
endif
endif
ifndef OS_TARGET
OS_TARGET := $(OS_ARCH)
endif
ifeq ($(OS_TARGET), WIN95)
OS_RELEASE := 4.0
endif
ifeq ($(OS_TARGET), WIN16)
OS_RELEASE :=
# OS_RELEASE := _3.11
endif
OS_CONFIG := $(OS_TARGET)$(OS_RELEASE)

View File

@@ -1,153 +0,0 @@
# -*- Mode: Makefile -*-
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
INCLUDED_AUTOCONF_MK = 1
USE_AUTOCONF = 1
@SHELL_OVERRIDE@
MOZILLA_CLIENT = @MOZILLA_CLIENT@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
includedir = @includedir@
libdir = @libdir@
datadir = @datadir@
dist_prefix = @dist_prefix@
dist_bindir = @dist_bindir@
dist_libdir = @dist_libdir@
DIST = $(dist_prefix)
OBJDIR_NAME = @OBJDIR_NAME@
OBJDIR = @OBJDIR@
OBJ_SUFFIX = @OBJ_SUFFIX@
LIB_SUFFIX = @LIB_SUFFIX@
LIB_PREFIX = @LIB_PREFIX@
DLL_SUFFIX = @DLL_SUFFIX@
ASM_SUFFIX = @ASM_SUFFIX@
PROG_SUFFIX = @PROG_SUFFIX@
CROSS_COMPILE = @CROSS_COMPILE@
BUILD_OPT = @MOZ_OPTIMIZE@
USE_NSS = @USE_NSS@
USE_CPLUS = @USE_CPLUS@
USE_IPV6 = @USE_IPV6@
USE_N32 = @USE_N32@
USE_64 = @USE_64@
ENABLE_STRIP = @ENABLE_STRIP@
USE_PTHREADS = @USE_PTHREADS@
USE_BTHREADS = @USE_BTHREADS@
PTHREADS_USER = @USE_USER_PTHREADS@
CLASSIC_NSPR = @USE_NSPR_THREADS@
NSPR_CFLAGS = @NSPR_CFLAGS@
NSPR_LIBS = @NSPR_LIBS@
AS = @AS@
ASFLAGS = @ASFLAGS@
CC = @CC@
CCC = @CXX@
NS_USE_GCC = @GNU_CC@
AR = @AR@
AR_FLAGS = @AR_FLAGS@
LD = @LD@
RANLIB = @RANLIB@
PERL = @PERL@
WINDRES = @WINDRES@
RC = @RC@
STRIP = @STRIP@
NSINSTALL = @NSINSTALL@
FILTER = @FILTER@
IMPLIB = @IMPLIB@
CYGWIN_WRAPPER = @CYGWIN_WRAPPER@
WIN_TOP_SRC = @WIN_TOP_SRC@
OS_CPPFLAGS = @CPPFLAGS@
OS_CFLAGS = $(OS_CPPFLAGS) @CFLAGS@ $(DSO_CFLAGS)
OS_CXXFLAGS = $(OS_CPPFLAGS) @CXXFLAGS@ $(DSO_CFLAGS)
OS_LIBS = @OS_LIBS@
OS_LDFLAGS = @LDFLAGS@
OS_DLLFLAGS = @OS_DLLFLAGS@
DLLFLAGS = @DLLFLAGS@
EXEFLAGS = @EXEFLAGS@
OPTIMIZER = @OPTIMIZER@
MKSHLIB = @MKSHLIB@
DSO_CFLAGS = @DSO_CFLAGS@
DSO_LDOPTS = @DSO_LDOPTS@
RESOLVE_LINK_SYMBOLS = @RESOLVE_LINK_SYMBOLS@
HOST_CC = @HOST_CC@
HOST_CFLAGS = @HOST_CFLAGS@
DEFINES = @DEFINES@ @DEFS@
CPU_ARCH = @CPU_ARCH@
OS_TARGET = @OS_TARGET@
OS_ARCH = @OS_ARCH@
OS_RELEASE = @OS_RELEASE@
OS_TEST = @OS_TEST@
NOSUCHFILE = @NOSUCHFILE@
MOZ_OBJFORMAT = @MOZ_OBJFORMAT@
ULTRASPARC_LIBRARY = @ULTRASPARC_LIBRARY@
ULTRASPARC_FILTER_LIBRARY = @ULTRASPARC_FILTER_LIBRARY@
OBJECT_MODE = @OBJECT_MODE@
ifdef OBJECT_MODE
export OBJECT_MODE
endif
LIBS_ALREADY_SET=@LIBS_ALREADY_SET@
# ldap-specific code (up to here, all the code came from
# mozilla/nsprpub/config/autoconf.mk.in)
#
MOZILLA_CLIENT = 1
VPATH = $(srcdir)
NEXT_ROOT = @NEXT_ROOT@
ifdef NEXT_ROOT
export NEXT_ROOT
endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,119 +0,0 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5; it is not part of GNU.
#
# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
instcmd="$mvprog"
chmodcmd=""
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
fi
# Make a temp file name in the proper directory.
dstdir=`dirname $dst`
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp
# and set any options; do chmod last to preserve setuid bits
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
# Now rename the file to the real destination.
$doit $rmcmd $dst
$doit $mvcmd $dsttmp $dst
exit 0

View File

@@ -1,180 +0,0 @@
# -*- tab-width: 4; -*-
# Configure paths for NSPR
# Public domain - Chris Seawood <cls@seawood.org> 2001-04-05
# Based upon gtk.m4 (also PD) by Owen Taylor
dnl AM_PATH_NSPR([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for system NSPR, and define NSPR_CFLAGS and NSPR_LIBS
AC_DEFUN([AM_PATH_NSPR],
[dnl
AC_ARG_WITH(nspr-prefix,
[ --with-nspr-prefix=PFX Prefix where NSPR is installed],
nspr_config_prefix="$withval",
nspr_config_prefix="")
AC_ARG_WITH(nspr-exec-prefix,
[ --with-nspr-exec-prefix=PFX
Exec prefix where NSPR is installed],
nspr_config_exec_prefix="$withval",
nspr_config_exec_prefix="")
if test -n "$nspr_config_exec_prefix"; then
nspr_config_args="$nspr_config_args --exec-prefix=$nspr_config_exec_prefix"
if test -z "$NSPR_CONFIG"; then
NSPR_CONFIG=$nspr_config_exec_prefix/bin/nspr-config
fi
fi
if test -n "$nspr_config_prefix"; then
nspr_config_args="$nspr_config_args --prefix=$nspr_config_prefix"
if test -z "$NSPR_CONFIG"; then
NSPR_CONFIG=$nspr_config_prefix/bin/nspr-config
fi
fi
if test -z "$NSPR_CONFIG" ; then
unset ac_cv_path_NSPR_CONFIG
AC_PATH_PROG(NSPR_CONFIG, nspr-config, no)
min_nspr_version=ifelse([$1], ,4.0.0,$1)
AC_MSG_CHECKING(for NSPR - version >= $min_nspr_version (skipping))
fi
no_nspr=""
if test "$NSPR_CONFIG" = "no"; then
AC_MSG_CHECKING(nspr-config not found, trying pkg-config)
AC_PATH_PROG(PKG_CONFIG, pkg-config)
if test -n "$PKG_CONFIG"; then
if $PKG_CONFIG --exists nspr; then
AC_MSG_CHECKING(using NSPR from package nspr)
NSPR_CFLAGS=`$PKG_CONFIG --cflags-only-I nspr`
NSPR_LIBS=`$PKG_CONFIG --libs-only-L nspr`
elif $PKG_CONFIG --exists mozilla-nspr; then
AC_MSG_CHECKING(using NSPR from package mozilla-nspr)
NSPR_CFLAGS=`$PKG_CONFIG --cflags-only-I mozilla-nspr`
NSPR_LIBS=`$PKG_CONFIG --libs-only-L mozilla-nspr`
else
AC_MSG_CHECKING([system NSPR not found])
no_nspr="yes"
fi
else
no_nspr="yes"
fi
else
AC_MSG_CHECKING(using NSPR from $NSPR_CONFIG)
NSPR_CFLAGS=`$NSPR_CONFIG $nspr_config_args --cflags`
NSPR_LIBS=`$NSPR_CONFIG $nspr_config_args --libs`
dnl Skip version check for now
nspr_config_major_version=`$NSPR_CONFIG $nspr_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
nspr_config_minor_version=`$NSPR_CONFIG $nspr_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
nspr_config_micro_version=`$NSPR_CONFIG $nspr_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
fi
if test -z "$no_nspr"; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
fi
AC_SUBST(NSPR_CFLAGS)
AC_SUBST(NSPR_LIBS)
])
dnl AM_PATH_INTREE_NSPR([ROOTPATH, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for in-tree NSPR, and define NSPR_CFLAGS and NSPR_LIBS
dnl First look for path/*.OBJ/include, then look for path/include
dnl Use the cut in case there is more than one path that matches *.OBJ - just
dnl take the first one
AC_DEFUN(AM_PATH_INTREE_NSPR,
[
AC_MSG_CHECKING(checking for in-tree NSPR from $1)
for nsprpath in "$1" "$1"/*.OBJ ; do
savedir=`pwd`
cd $nsprpath
abs_nsprpath=`pwd`
cd $savedir
if test -f "$abs_nsprpath/include/nspr/nspr.h" ; then
NSPR_CFLAGS="-I$abs_nsprpath/include/nspr"
elif test -f "$abs_nsprpath/include/nspr.h" ; then
NSPR_CFLAGS="-I$abs_nsprpath/include"
fi
if test -d "$abs_nsprpath/lib" ; then
NSPR_LIBS="-L$abs_nsprpath/lib"
fi
if test -n "$NSPR_CFLAGS" -a -n "$NSPR_LIBS" ; then
break
fi
done
if test -n "$NSPR_CFLAGS" -a -n "$NSPR_LIBS" ; then
AC_SUBST(NSPR_CFLAGS)
AC_SUBST(NSPR_LIBS)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
])
dnl AM_PATH_GIVEN_NSPR(no args)
dnl Test for --with-nspr=path, --with-nspr-inc=path, and --with-nspr-lib=path
dnl Makes sure the right files/dirs are in the given paths, and sets
dnl NSPR_CFLAGS and NSPR_LIBS if successful
AC_DEFUN(AM_PATH_GIVEN_NSPR,
[
# check for --with-nspr
AC_MSG_CHECKING(for --with-nspr)
AC_ARG_WITH(nspr, [ --with-nspr=PATH Netscape Portable Runtime (NSPR) directory],
[
if test "$withval" = "no" ; then
AC_MSG_RESULT(no)
no_nspr="yes"
elif test "$withval" = "yes" ; then
AC_MSG_RESULT(yes)
no_nspr="no"
elif test -e "$withval"/include/nspr.h -a -d "$withval"/lib
then
AC_MSG_RESULT([using $withval])
NSPR_CFLAGS="-I$withval/include"
NSPR_LIBS="-L$withval/lib"
else
echo
AC_MSG_ERROR([$withval not found])
fi
],
AC_MSG_RESULT(no))
# check for --with-nspr-inc
AC_MSG_CHECKING(for --with-nspr-inc)
AC_ARG_WITH(nspr-inc, [ --with-nspr-inc=PATH Netscape Portable Runtime (NSPR) include file directory],
[
if test -e "$withval"/nspr.h
then
AC_MSG_RESULT([using $withval])
NSPR_CFLAGS="-I$withval"
else
echo
AC_MSG_ERROR([$withval not found])
fi
],
AC_MSG_RESULT(no))
# check for --with-nspr-lib
AC_MSG_CHECKING(for --with-nspr-lib)
AC_ARG_WITH(nspr-lib, [ --with-nspr-lib=PATH Netscape Portable Runtime (NSPR) library directory],
[
if test -d "$withval"
then
AC_MSG_RESULT([using $withval])
NSPR_LIBS="-L$withval"
else
echo
AC_MSG_ERROR([$withval not found])
fi
],
AC_MSG_RESULT(no))
])

View File

@@ -1,179 +0,0 @@
# -*- tab-width: 4; -*-
# Configure paths for NSS
# Public domain - Chris Seawood <cls@seawood.org> 2001-04-05
# Based upon gtk.m4 (also PD) by Owen Taylor
dnl AM_PATH_NSS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for system NSS, and define NSS_CFLAGS and NSS_LIBS
AC_DEFUN(AM_PATH_NSS,
[dnl
AC_ARG_WITH(nss-prefix,
[ --with-nss-prefix=PFX Prefix where NSS is installed],
nss_config_prefix="$withval",
nss_config_prefix="")
AC_ARG_WITH(nss-exec-prefix,
[ --with-nss-exec-prefix=PFX
Exec prefix where NSS is installed],
nss_config_exec_prefix="$withval",
nss_config_exec_prefix="")
if test -n "$nss_config_exec_prefix"; then
nss_config_args="$nss_config_args --exec-prefix=$nss_config_exec_prefix"
if test -z "$NSS_CONFIG"; then
NSS_CONFIG=$nss_config_exec_prefix/bin/nss-config
fi
fi
if test -n "$nss_config_prefix"; then
nss_config_args="$nss_config_args --prefix=$nss_config_prefix"
if test -z "$NSS_CONFIG"; then
NSS_CONFIG=$nss_config_prefix/bin/nss-config
fi
fi
if test -z "$NSS_CONFIG" ; then
unset ac_cv_path_NSS_CONFIG
AC_PATH_PROG(NSS_CONFIG, nss-config, no)
min_nss_version=ifelse([$1], ,4.0.0,$1)
AC_MSG_CHECKING(for NSS - version >= $min_nss_version (skipping))
fi
no_nss=""
if test "$NSS_CONFIG" = "no"; then
AC_MSG_CHECKING(nss-config not found, trying pkg-config)
AC_PATH_PROG(PKG_CONFIG, pkg-config)
if test -n "$PKG_CONFIG"; then
if $PKG_CONFIG --exists nss; then
AC_MSG_CHECKING(using NSS from package nss)
NSS_CFLAGS=`$PKG_CONFIG --cflags-only-I nss`
NSS_LIBS=`$PKG_CONFIG --libs-only-L nss`
elif $PKG_CONFIG --exists mozilla-nss; then
AC_MSG_CHECKING(using NSS from package mozilla-nss)
NSS_CFLAGS=`$PKG_CONFIG --cflags-only-I mozilla-nss`
NSS_LIBS=`$PKG_CONFIG --libs-only-L mozilla-nss`
else
AC_MSG_ERROR([system NSS not found])
no_nss="yes"
fi
else
no_nss="yes"
fi
else
AC_MSG_CHECKING(using NSS from $NSS_CONFIG)
NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags`
NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs`
dnl Skip version check for now
nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
fi
if test -z "$no_nss"; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
fi
AC_SUBST(NSS_CFLAGS)
AC_SUBST(NSS_LIBS)
])
dnl AM_PATH_INTREE_NSS([ROOTPATH, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for in-tree NSS, and define NSS_CFLAGS and NSS_LIBS
AC_DEFUN(AM_PATH_INTREE_NSS,
[
nsslibpath=`echo $1/*.OBJ/lib | cut -f1 -d' '`
savedir=`pwd`
cd $nsslibpath
abs_nsslibpath=`pwd`
cd $savedir
nssincpath=$1/public/nss
savedir=`pwd`
cd $nssincpath
abs_nssincpath=`pwd`
cd $savedir
if test -f "$abs_nssincpath/nss.h" ; then
NSS_CFLAGS="-I$abs_nssincpath"
fi
if test -d "$abs_nsslibpath" ; then
NSS_LIBS="-L$abs_nsslibpath"
fi
if test -n "$NSS_CFLAGS" -a -n "$NSS_LIBS" ; then
AC_MSG_CHECKING(using in-tree NSS from $nssincpath $nsslibpath)
AC_SUBST(NSS_CFLAGS)
AC_SUBST(NSS_LIBS)
AC_MSG_RESULT(yes)
else
AC_MSG_CHECKING(could not find in-tree NSS in $1)
AC_MSG_RESULT(no)
fi
])
dnl AM_PATH_GIVEN_NSS(no args)
dnl Test for --with-nss=path, --with-nss-inc=path, and --with-nss-lib=path
dnl Makes sure the right files/dirs are in the given paths, and sets
dnl NSS_CFLAGS and NSS_LIBS if successful
AC_DEFUN(AM_PATH_GIVEN_NSS,
[
dnl ========================================================
dnl = Build libssldap, and use the NSS installed in dist for
dnl = the crypto.
dnl ========================================================
dnl
AC_MSG_CHECKING(for --with-nss)
AC_ARG_WITH(nss,
[[ --with-nss[=PATH] Build libssldap, using NSS for crypto - optional PATH is path to NSS package]],
[ if test "$withval" = "yes"; then
USE_NSS=1
AC_MSG_RESULT(yes)
elif test -d "$withval" -a -d "$withval/lib" -a -d "$withval/include" ; then
USE_NSS=1
AC_MSG_RESULT([using $withval])
NSS_CFLAGS="-I$withval/include"
NSS_LIBS="-L$withval/lib"
else
AC_MSG_RESULT(no)
USE_NSS=
fi],
AC_MSG_RESULT(no))
# check for --with-nss-inc
AC_MSG_CHECKING(for --with-nss-inc)
AC_ARG_WITH(nss-inc, [ --with-nss-inc=PATH Netscape Portable Runtime (NSS) include file directory],
[
if test -e "$withval"/nss.h
then
AC_MSG_RESULT([using $withval])
NSS_CFLAGS="-I$withval"
USE_NSS=1
else
echo
AC_MSG_ERROR([$withval not found])
fi
],
AC_MSG_RESULT(no))
# check for --with-nss-lib
AC_MSG_CHECKING(for --with-nss-lib)
AC_ARG_WITH(nss-lib, [ --with-nss-lib=PATH Netscape Portable Runtime (NSS) library directory],
[
if test -d "$withval"
then
AC_MSG_RESULT([using $withval])
NSS_LIBS="-L$withval"
USE_NSS=1
else
echo
AC_MSG_ERROR([$withval not found])
fi
],
AC_MSG_RESULT(no))
])

View File

@@ -1,129 +0,0 @@
# -*- tab-width: 4; -*-
# Configure paths for SVRCORE
# Public domain - Rich Megginson <richm@stanfordalumni.org> 2005-12-21
# Based upon nspr.m4 (also PD) by Chris Seawood
dnl AM_PATH_INTREE_SVRCORE([ROOTPATH, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for in-tree SVRCORE, and define SVRCORE_CFLAGS and SVRCORE_LIBS
AC_DEFUN(AM_PATH_INTREE_SVRCORE,
[
if test -n "$HAVE_SVRCORE" ; then
svrcorelibpath=`echo $1/*.OBJ/lib | cut -f1 -d' '`
savedir=`pwd`
cd $svrcorelibpath
abs_svrcorelibpath=`pwd`
cd $savedir
svrcoreincpath=$1/public/svrcore
savedir=`pwd`
cd $svrcoreincpath
abs_svrcoreincpath=`pwd`
cd $savedir
if test -f "$abs_svrcoreincpath/svrcore.h" ; then
SVRCORE_CFLAGS="-I$abs_svrcoreincpath"
fi
if test -d "$abs_svrcorelibpath" ; then
SVRCORE_LIBS="-L$abs_svrcorelibpath -lsvrcore"
fi
if test -n "$SVRCORE_CFLAGS" -a -n "$SVRCORE_LIBS" ; then
AC_MSG_CHECKING(using in-tree SVRCORE from $svrcoreincpath $svrcorelibpath)
AC_SUBST(SVRCORE_CFLAGS)
AC_SUBST(SVRCORE_LIBS)
AC_MSG_RESULT(yes)
elif test -n "$HAVE_SVRCORE" ; then
AC_MSG_CHECKING(could not find in-tree SVRCORE in $1)
AC_MSG_RESULT(no)
else
# If user didn't ask for it, don't complain (really!)
AC_MSG_RESULT(no)
fi
fi
])
dnl AM_PATH_GIVEN_SVRCORE(no args)
dnl Test for --with-svrcore=path, --with-svrcore-inc=path, and --with-svrcore-lib=path
dnl Makes sure the right files/dirs are in the given paths, and sets
dnl SVRCORE_CFLAGS and SVRCORE_LIBS if successful
AC_DEFUN(AM_PATH_GIVEN_SVRCORE,
[
AC_MSG_CHECKING(for --with-svrcore)
AC_ARG_WITH(svrcore,
[[ --with-svrcore[=PATH] Use svrcore - optional PATH is path to svrcore lib and include dirs]],
[ if test "$withval" = "yes"; then
HAVE_SVRCORE=1
AC_MSG_RESULT(yes)
elif test -n "$withval" -a -d "$withval" -a -d "$withval/lib" -a -f "$withval/include/svrcore.h" ; then
HAVE_SVRCORE=1
AC_MSG_RESULT([using $withval])
SVRCORE_CFLAGS="-I$withval/include"
SVRCORE_LIBS="-L$withval/lib"
fi], HAVE_SVRCORE=)
# check for --with-svrcore-inc
AC_ARG_WITH(svrcore-inc, [ --with-svrcore-inc=PATH svrcore include file directory],
[
if test -n "$withval" -a -e "$withval"/svrcore.h
then
AC_MSG_RESULT([using $withval])
SVRCORE_CFLAGS="-I$withval"
else
echo
AC_MSG_ERROR([$withval not found])
fi
],
)
# check for --with-svrcore-lib
AC_ARG_WITH(svrcore-lib, [ --with-svrcore-lib=PATH svrcore library directory],
[
if test -n "$withval" -a -d "$withval"
then
AC_MSG_RESULT([using $withval])
SVRCORE_LIBS="-L$withval"
else
echo
AC_MSG_ERROR([$withval not found])
fi
],
)
if test -z "$SVRCORE_CFLAGS" -o -z "$SVRCORE_LIBS" ; then
AC_MSG_RESULT(no)
else
HAVE_SVRCORE=1
fi
])
dnl AM_PATH_SVRCORE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for system SVRCORE, and define SVRCORE_CFLAGS and SVRCORE_LIBS
AC_DEFUN(AM_PATH_SVRCORE,
[dnl
if test -n "$HAVE_SVRCORE" ; then
no_svrcore=""
AC_MSG_CHECKING(Trying pkg-config svrcore)
AC_PATH_PROG(PKG_CONFIG, pkg-config)
if test -n "$PKG_CONFIG"; then
if $PKG_CONFIG --exists svrcore; then
AC_MSG_CHECKING(using SVRCORE from package svrcore)
SVRCORE_CFLAGS=`$PKG_CONFIG --cflags-only-I svrcore`
SVRCORE_LIBS=`$PKG_CONFIG --libs-only-L svrcore`
else
# AC_MSG_NOTICE([system SVRCORE not found])
no_svrcore="yes"
fi
else
no_svrcore="yes"
fi
if test -z "$no_svrcore"; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
fi
AC_SUBST(SVRCORE_CFLAGS)
AC_SUBST(SVRCORE_LIBS)
fi
])

View File

@@ -1,238 +0,0 @@
#! gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# Configuration information for building in the NSPR source module
# Define an include-at-most-once-flag
NSPR_CONFIG_MK = 1
#
# The variable definitions in this file are inputs to NSPR's
# build system. This file, if present, is included at the
# beginning of config.mk.
#
# For example:
#
# BUILD_OPT=1
# USE_PTHREADS=1
# NS_USE_GCC=
#
ifndef topsrcdir
topsrcdir=$(MOD_DEPTH)
endif
ifndef srcdir
srcdir=.
endif
ifdef USE_AUTOCONF
NFSPWD = $(MOD_DEPTH)/config/nfspwd
CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
$(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
CCCFLAGS = $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
$(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
# For purify
NOMD_CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
$(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
NOMD_CCFLAGS = $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
$(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
ifeq ($(OS_ARCH),Darwin)
ifndef NSDISTMODE
NSDISTMODE=absolute_symlink
endif
PWD := $(shell pwd)
endif
ifeq ($(NSDISTMODE),copy)
# copy files, but preserve source mtime
INSTALL = $(NSINSTALL) -t
else
ifeq ($(NSDISTMODE),absolute_symlink)
# install using absolute symbolic links
ifeq ($(OS_ARCH),Darwin)
INSTALL = $(NSINSTALL) -L $(PWD)
else
INSTALL = $(NSINSTALL) -L `$(NFSPWD)`
endif
else
# install using relative symbolic links
INSTALL = $(NSINSTALL) -R
endif
endif
ifdef BUILD_DEBUG_GC
DEFINES += -DDEBUG_GC
endif
GARBAGE += $(DEPENDENCIES) core $(wildcard core.[0-9]*)
ifdef USE_AUTOCONF
DIST_GARBAGE += Makefile
endif
DEFINES += -DFORCE_PR_LOG
ifeq ($(_PR_NO_CLOCK_TIMER),1)
DEFINES += -D_PR_NO_CLOCK_TIMER
endif
ifeq ($(USE_PTHREADS), 1)
DEFINES += -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM
endif
ifeq ($(PTHREADS_USER), 1)
DEFINES += -DPTHREADS_USER -UHAVE_CVAR_BUILT_ON_SEM
endif
ifeq ($(USE_IPV6),1)
DEFINES += -D_PR_INET6
endif
else # ! USE_AUTOCONF
ifndef NSPR_MY_CONFIG_MK
NSPR_MY_CONFIG_MK = $(MOD_DEPTH)/config/my_config.mk
endif
#
# The variable definitions in this file are used to
# override variable values set by NSPR's build system.
# This file, if present, is included at the end of config.mk.
#
# For example:
#
# DIST=/usr/local/nspr
#
ifndef NSPR_MY_OVERRIDES_MK
NSPR_MY_OVERRIDES_MK = $(MOD_DEPTH)/config/my_overrides.mk
endif
-include $(NSPR_MY_CONFIG_MK)
include $(MOD_DEPTH)/config/module.df
include $(MOD_DEPTH)/config/arch.mk
ifndef NSDEPTH
NSDEPTH = $(MOD_DEPTH)/..
endif
#
# Default command macros; can be overridden in <arch>.mk.
#
# XXX FIXME: I removed CCF and LINKEXE.
AS = $(CC)
ASFLAGS = $(CFLAGS)
PURIFY = purify $(PURIFYOPTIONS)
LINK_DLL = $(LINK) $(OS_DLLFLAGS) $(DLLFLAGS)
NFSPWD = $(MOD_DEPTH)/config/nfspwd
CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
$(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
CCCFLAGS = $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
$(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
# For purify
NOMD_CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
$(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
include $(MOD_DEPTH)/config/$(OS_TARGET).mk
# Figure out where the binary code lives.
BUILD = $(OBJDIR_NAME)
OBJDIR = $(OBJDIR_NAME)
DIST = $(NSDEPTH)/dist/$(OBJDIR_NAME)
ifeq ($(MOZ_BITS),16)
MOZ_INCL = $(NSDEPTH)/dist/public/win16
MOZ_DIST = $(NSDEPTH)/dist/WIN16D_D.OBJ
endif
VPATH = $(OBJDIR)
DEPENDENCIES = $(OBJDIR)/.md
ifdef BUILD_DEBUG_GC
DEFINES += -DDEBUG_GC
endif
GARBAGE += $(DEPENDENCIES) core $(wildcard core.[0-9]*)
####################################################################
#
# The NSPR-specific configuration
#
####################################################################
OS_CFLAGS += -DFORCE_PR_LOG
ifeq ($(_PR_NO_CLOCK_TIMER),1)
OS_CFLAGS += -D_PR_NO_CLOCK_TIMER
endif
ifeq ($(USE_PTHREADS), 1)
OS_CFLAGS += -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM
endif
ifeq ($(PTHREADS_USER), 1)
OS_CFLAGS += -DPTHREADS_USER -UHAVE_CVAR_BUILT_ON_SEM
endif
ifeq ($(USE_IPV6),1)
OS_CFLAGS += -D_PR_INET6
endif
ifdef GC_LEAK_DETECTOR
OS_CFLAGS += -DGC_LEAK_DETECTOR
endif
####################################################################
#
# Configuration for the release process
#
####################################################################
RELEASE_DIR = $(NSDEPTH)/dist/release/$(MOD_NAME)
RELEASE_INCLUDE_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/include
RELEASE_BIN_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/bin
RELEASE_LIB_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/lib
-include $(NSPR_MY_OVERRIDES_MK)
endif # USE_AUTOCONF

View File

@@ -1,75 +0,0 @@
#!/bin/sh
#
# Stupid wrapper to avoid win32 dospath/cygdrive issues
# Try not to spawn programs from within this file. If the stuff in here looks royally
# confusing, see bug: http://bugzilla.mozilla.org/show_bug.cgi?id=206643
# and look at the older versions of this file that are easier to read, but
# do basically the same thing
#
prog=$1
shift
if test -z "$prog"; then
exit 0
fi
# If $CYGDRIVE_MOUNT was not set in configure, give $mountpoint the results of mount -p
mountpoint=$CYGDRIVE_MOUNT
if test -z "$mountpoint"; then
mountpoint=`mount -p`
if test -z "$mountpoint"; then
print "Cannot determine cygwin mount points. Exiting"
exit 1
fi
fi
# Delete everything but "/cygdrive" (or other mountpoint) from mount=`mount -p`
mountpoint=${mountpoint#*/}
mountpoint=/${mountpoint%%[!A-Za-z0-9_]*}
mountpoint=${mountpoint%/}
args=""
up=""
if test "${prog}" = "-up"; then
up=1
prog=${1}
shift
fi
process=1
# Convert the mountpoint in parameters to Win32 filenames
# For instance: /cygdrive/c/foo -> c:/foo
for i in "${@}"
do
if test "${i}" = "-wrap"; then
process=1
else
if test "${i}" = "-nowrap"; then
process=
else
if test -n "${process}"; then
if test -n "${up}"; then
pathname=${i#-I[a-zA-Z]:/}
if ! test "${pathname}" = "${i}"; then
no_i=${i#-I}
driveletter=${no_i%%:*}
i=-I${mountpoint}/${driveletter}/${pathname}
fi
else
eval 'leader=${i%%'${mountpoint}'/[a-zA-Z]/*}'
if ! test "${leader}" = "${i}"; then
eval 'pathname=${i#'${leader}${mountpoint}'/[a-zA-Z]/}'
eval 'no_mountpoint=${i#'${leader}${mountpoint}'/}'
driveletter=${no_mountpoint%%/*}
i=${leader}${driveletter}:/${pathname}
fi
fi
fi
args="${args} ${i}"
fi
fi
done
exec $prog $args

View File

@@ -1,158 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* libc_r.h -- macros, defines, etc. to make using reentrant libc calls */
/* a bit easier. This was initially done for AIX pthreads, */
/* but should be usable for anyone... */
/* Most of these use locally defined space instead of static library space. */
/* Because of this, we use the _INIT_R to declare/allocate space (stack), */
/* and the plain routines to actually do it..._WARNING_: avoid allocating */
/* memory wherever possible. Memory allocation is fairly expensive, at */
/* least on AIX...use arrays instead (which allocate from the stack.) */
/* I know the names are a bit strange, but I wanted to be fairly certain */
/* that we didn't have any namespace corruption...in general, the inits are */
/* R_<name>_INIT_R(), and the actual calls are R_<name>_R(). */
#ifndef _LIBC_R_H
#define _LIBC_R_H
/************/
/* strtok */
/************/
#define R_STRTOK_INIT_R() \
char *r_strtok_r=NULL
#define R_STRTOK_R(return,source,delim) \
return=strtok_r(source,delim,&r_strtok_r)
#define R_STRTOK_NORET_R(source,delim) \
strtok_r(source,delim,&r_strtok_r)
/**************/
/* strerror */
/**************/
#define R_MAX_STRERROR_LEN_R 8192 /* Straight from limits.h */
#define R_STRERROR_INIT_R() \
char r_strerror_r[R_MAX_STRERROR_LEN_R]
#define R_STRERROR_R(val) \
strerror_r(val,r_strerror_r,R_MAX_STRERROR_LEN_R)
/*****************/
/* time things */
/*****************/
#define R_ASCTIME_INIT_R() \
char r_asctime_r[26]
#define R_ASCTIME_R(val) \
asctime_r(val,r_asctime_r)
#define R_CTIME_INIT_R() \
char r_ctime_r[26]
#define R_CTIME_R(val) \
ctime_r(val,r_ctime_r)
#define R_GMTIME_INIT_R() \
struct tm r_gmtime_r
#define R_GMTIME_R(time) \
gmtime_r(time,&r_gmtime_r)
#define R_LOCALTIME_INIT_R() \
struct tm r_localtime_r
#define R_LOCALTIME_R(val) \
localtime_r(val,&r_localtime_r)
/***********/
/* crypt */
/***********/
#include <crypt.h>
#define R_CRYPT_INIT_R() \
CRYPTD r_cryptd_r; \
bzero(&r_cryptd_r,sizeof(CRYPTD))
#define R_CRYPT_R(pass,salt) \
crypt_r(pass,salt,&r_cryptd_r)
/**************/
/* pw stuff */
/**************/
#define R_MAX_PW_LEN_R 1024
/* The following must be after the last declaration, but */
/* before the first bit of code... */
#define R_GETPWNAM_INIT_R(pw_ptr) \
struct passwd r_getpwnam_pw_r; \
char r_getpwnam_line_r[R_MAX_PW_LEN_R]; \
pw_ptr = &r_getpwnam_pw_r
#define R_GETPWNAM_R(name) \
getpwnam_r(name,&r_getpwnam_pw_r,r_getpwnam_line_r,R_MAX_PW_LEN_R)
/*******************/
/* gethost stuff */
/*******************/
#define R_GETHOSTBYADDR_INIT_R() \
struct hostent r_gethostbyaddr_r; \
struct hostent_data r_gethostbyaddr_data_r
#define R_GETHOSTBYADDR_R(addr,len,type,xptr_ent) \
bzero(&r_gethostbyaddr_r,sizeof(struct hostent)); \
bzero(&r_gethostbyaddr_data_r,sizeof(struct hostent_data)); \
xptr_ent = &r_gethostbyaddr_r; \
if (gethostbyaddr_r(addr,len,type, \
&r_gethostbyaddr_r,&r_gethostbyaddr_data_r) == -1) { \
xptr_ent = NULL; \
}
#define R_GETHOSTBYNAME_INIT_R() \
struct hostent r_gethostbyname_r; \
struct hostent_data r_gethostbyname_data_r
#define R_GETHOSTBYNAME_R(name,xptr_ent) \
bzero(&r_gethostbyname_r,sizeof(struct hostent)); \
bzero(&r_gethostbyname_data_r,sizeof(struct hostent_data)); \
xptr_ent = &r_gethostbyname_r; \
if (gethostbyname_r(name, \
&r_gethostbyname_r,&r_gethostbyname_data_r) == -1) { \
xptr_ent = NULL; \
}
#endif /* _LIBC_R_H */

View File

@@ -1,44 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# Module description file
#
# A module is also called a component or a subsystem.
MOD_NAME = nspr20
MOD_VERSION = 4

View File

@@ -1,50 +0,0 @@
#! perl
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
require "fastcwd.pl";
$_ = &fastcwd;
if (m@^/[uh]/@o || s@^/tmp_mnt/@/@o) {
print("$_\n");
} elsif ((($user, $rest) = m@^/usr/people/(\w+)/(.*)@o)
&& readlink("/u/$user") eq "/usr/people/$user") {
print("/u/$user/$rest\n");
} else {
chop($host = `hostname`);
print("/h/$host$_\n");
}

View File

@@ -1,50 +0,0 @@
#! perl
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
require "fastcwd.pl";
$_ = &fastcwd;
if (m@^/[uh]/@o || s@^/tmp_mnt/@/@o) {
print("$_\n");
} elsif ((($user, $rest) = m@^/usr/people/(\w+)/(.*)@o)
&& readlink("/u/$user") eq "/usr/people/$user") {
print("/u/$user/$rest\n");
} else {
chop($host = `hostname`);
print("/h/$host$_\n");
}

View File

@@ -1,142 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <stdio.h>
#include <stdlib.h>
#if defined(VMS)
#include <sys/timeb.h>
#elif defined(XP_UNIX) || defined(XP_OS2_EMX) || defined(XP_BEOS)
#include <sys/time.h>
#elif defined(WIN32)
#include <windows.h>
#elif defined(XP_OS2_VACPP)
#include <sys/timeb.h>
#else
#error "Architecture not supported"
#endif
int main(int argc, char **argv)
{
#if defined(OMIT_LIB_BUILD_TIME)
/*
* Some platforms don't have any 64-bit integer type
* such as 'long long'. Because we can't use NSPR's
* PR_snprintf in this program, it is difficult to
* print a static initializer for PRInt64 (a struct).
* So we print nothing. The makefiles that build the
* shared libraries will detect the empty output string
* of this program and omit the library build time
* in PRVersionDescription.
*/
#elif defined(VMS)
long long now;
struct timeb b;
ftime(&b);
now = b.time;
now *= 1000000;
now += (1000 * b.millitm);
fprintf(stdout, "%Ld", now);
#elif defined(XP_UNIX) || defined(XP_OS2_EMX) || defined(XP_BEOS)
long long now;
struct timeval tv;
#ifdef HAVE_SVID_GETTOD
gettimeofday(&tv);
#else
gettimeofday(&tv, NULL);
#endif
now = ((1000000LL) * tv.tv_sec) + (long long)tv.tv_usec;
#if defined(OSF1)
fprintf(stdout, "%ld", now);
#elif defined(BEOS) && defined(__POWERPC__)
fprintf(stdout, "%Ld", now); /* Metroworks on BeOS PPC */
#else
fprintf(stdout, "%lld", now);
#endif
#elif defined(WIN32)
__int64 now;
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
CopyMemory(&now, &ft, sizeof(now));
/*
* 116444736000000000 is the number of 100-nanosecond intervals
* between Jan. 1, 1601 and Jan. 1, 1970.
*/
#ifdef __GNUC__
now = (now - 116444736000000000LL) / 10LL;
fprintf(stdout, "%lld", now);
#else
now = (now - 116444736000000000i64) / 10i64;
fprintf(stdout, "%I64d", now);
#endif
#elif defined(XP_OS2_VACPP)
/* no long long or i64 so we use a string */
#include <string.h>
char buf[24];
char tbuf[7];
time_t now;
long mtime;
int i;
struct timeb b;
ftime(&b);
now = b.time;
_ltoa(now, buf, 10);
mtime = b.millitm * 1000;
if (mtime == 0){
++now;
strcat(buf, "000000");
} else {
_ltoa(mtime, tbuf, 10);
for (i = strlen(tbuf); i < 6; ++i)
strcat(buf, "0");
strcat(buf, tbuf);
}
fprintf(stdout, "%s", buf);
#else
#error "Architecture not supported"
#endif
return 0;
} /* main */
/* now.c */

View File

@@ -1,597 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
** Netscape portable install command.
**
** Brendan Eich, 7/20/95
*/
#include <stdio.h> /* OSF/1 requires this before grp.h, so put it first */
#include <assert.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <utime.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include <stdarg.h>
#ifdef USE_REENTRANT_LIBC
#include "libc_r.h"
#endif /* USE_REENTRANT_LIBC */
#include "pathsub.h"
#ifndef HAVE_LCHOWN
#define HAVE_LCHOWN
#endif
#if defined(AIX) || defined(BSDI) || defined(HPUX) || defined(LINUX) \
|| defined(SUNOS4) || defined(SCO) || defined(UNIXWARE) \
|| defined(RHAPSODY) || defined(NEXTSTEP) || defined(QNX) \
|| defined(BEOS) || defined(VMS) || defined(DARWIN)
#undef HAVE_LCHOWN
#endif
#define HAVE_FCHMOD
#if defined(BEOS)
#undef HAVE_FCHMOD
#endif
/*
* Does getcwd() take NULL as the first argument and malloc
* the result buffer?
*/
#if !defined(RHAPSODY) && !defined(NEXTSTEP) && !defined(VMS)
#define GETCWD_CAN_MALLOC
#endif
#ifdef NEXTSTEP
#include <bsd/libc.h>
/*
** balazs.pataki@sztaki.hu: The getcwd is broken in NEXTSTEP (returns 0),
** when called on a mounted fs. Did anyone notice this? Here's an ugly
** workaround ...
*/
#define getcwd(b,s) my_getcwd(b,s)
static char *
my_getcwd (char *buf, size_t size)
{
FILE *pwd = popen("pwd", "r");
char *result = fgets(buf, size, pwd);
if (result) {
buf[strlen(buf)-1] = '\0';
}
pclose (pwd);
return buf;
}
#endif /* NEXTSTEP */
#ifdef LINUX
#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
#if defined(SNI)
extern int fchmod(int fildes, mode_t mode);
#endif
#ifdef QNX
#define d_ino d_stat.st_ino
#endif
static void
usage(void)
{
fprintf(stderr,
"usage: %s [-C cwd] [-L linkprefix] [-m mode] [-o owner] [-g group]\n"
" %*s [-DdltR] file [file ...] directory\n",
program, (int)strlen(program), "");
exit(2);
}
static int
mkdirs(char *path, mode_t mode)
{
char *cp;
struct stat sb;
int res;
while (*path == '/' && path[1] == '/')
path++;
while ((cp = strrchr(path, '/')) && cp[1] == '\0')
*cp = '\0';
if (cp && cp != path) {
*cp = '\0';
if ((stat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&
mkdirs(path, mode) < 0) {
return -1;
}
*cp = '/';
}
res = mkdir(path, mode);
if ((res != 0) && (errno == EEXIST))
return 0;
else
return res;
}
static uid_t
touid(char *owner)
{
struct passwd *pw;
uid_t uid;
char *cp;
pw = getpwnam(owner);
if (pw)
return pw->pw_uid;
uid = strtol(owner, &cp, 0);
if (uid == 0 && cp == owner)
fail("cannot find uid for %s", owner);
return uid;
}
static gid_t
togid(char *group)
{
struct group *gr;
gid_t gid;
char *cp;
gr = getgrnam(group);
if (gr)
return gr->gr_gid;
gid = strtol(group, &cp, 0);
if (gid == 0 && cp == group)
fail("cannot find gid for %s", group);
return gid;
}
int
main(int argc, char **argv)
{
int onlydir, dodir, dolink, dorelsymlink, dotimes, opt, len, lplen, tdlen, bnlen, exists, fromfd, tofd, cc, wc;
mode_t mode = 0755;
char *linkprefix, *owner, *group, *cp, *cwd, *todir, *toname, *name, *base, *linkname, *bp, buf[BUFSIZ];
uid_t uid;
gid_t gid;
struct stat sb, tosb;
struct utimbuf utb;
program = argv[0];
cwd = linkname = linkprefix = owner = group = 0;
onlydir = dodir = dolink = dorelsymlink = dotimes = lplen = 0;
while ((opt = getopt(argc, argv, "C:DdlL:Rm:o:g:t")) != EOF) {
switch (opt) {
case 'C':
cwd = optarg;
break;
case 'D':
onlydir = 1;
break;
case 'd':
dodir = 1;
break;
case 'l':
dolink = 1;
break;
case 'L':
linkprefix = optarg;
lplen = strlen(linkprefix);
dolink = 1;
break;
case 'R':
dolink = dorelsymlink = 1;
break;
case 'm':
mode = strtoul(optarg, &cp, 8);
if (mode == 0 && cp == optarg)
usage();
break;
case 'o':
owner = optarg;
break;
case 'g':
group = optarg;
break;
case 't':
dotimes = 1;
break;
default:
usage();
}
}
argc -= optind;
argv += optind;
if (argc < 2 - onlydir)
usage();
todir = argv[argc-1];
if ((stat(todir, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&
mkdirs(todir, 0777) < 0) {
fail("cannot make directory %s", todir);
}
if (onlydir)
return 0;
if (!cwd) {
#ifdef GETCWD_CAN_MALLOC
cwd = getcwd(0, PATH_MAX);
#else
cwd = malloc(PATH_MAX + 1);
cwd = getcwd(cwd, PATH_MAX);
#endif
}
xchdir(todir);
#ifdef GETCWD_CAN_MALLOC
todir = getcwd(0, PATH_MAX);
#else
todir = malloc(PATH_MAX + 1);
todir = getcwd(todir, PATH_MAX);
#endif
tdlen = strlen(todir);
xchdir(cwd);
tdlen = strlen(todir);
uid = owner ? touid(owner) : -1;
gid = group ? togid(group) : -1;
while (--argc > 0) {
name = *argv++;
len = strlen(name);
base = xbasename(name);
bnlen = strlen(base);
toname = (char*)xmalloc(tdlen + 1 + bnlen + 1);
sprintf(toname, "%s/%s", todir, base);
exists = (lstat(toname, &tosb) == 0);
if (dodir) {
/* -d means create a directory, always */
if (exists && !S_ISDIR(tosb.st_mode)) {
(void) unlink(toname);
exists = 0;
}
if (!exists && mkdir(toname, mode) < 0)
fail("cannot make directory %s", toname);
if ((owner || group) && chown(toname, uid, gid) < 0)
fail("cannot change owner of %s", toname);
} else if (dolink) {
if (*name == '/') {
/* source is absolute pathname, link to it directly */
linkname = 0;
} else {
if (linkprefix) {
/* -L implies -l and prefixes names with a $cwd arg. */
len += lplen + 1;
linkname = (char*)xmalloc(len + 1);
sprintf(linkname, "%s/%s", linkprefix, name);
} else if (dorelsymlink) {
/* Symlink the relative path from todir to source name. */
linkname = (char*)xmalloc(PATH_MAX);
if (*todir == '/') {
/* todir is absolute: skip over common prefix. */
lplen = relatepaths(todir, cwd, linkname);
strcpy(linkname + lplen, name);
} else {
/* todir is named by a relative path: reverse it. */
reversepath(todir, name, len, linkname);
xchdir(cwd);
}
len = strlen(linkname);
}
name = linkname;
}
/* Check for a pre-existing symlink with identical content. */
if (exists &&
(!S_ISLNK(tosb.st_mode) ||
readlink(toname, buf, sizeof buf) != len ||
strncmp(buf, name, len) != 0)) {
(void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname);
exists = 0;
}
if (!exists && symlink(name, toname) < 0)
fail("cannot make symbolic link %s", toname);
#ifdef HAVE_LCHOWN
if ((owner || group) && lchown(toname, uid, gid) < 0)
fail("cannot change owner of %s", toname);
#endif
if (linkname) {
free(linkname);
linkname = 0;
}
} else {
/* Copy from name to toname, which might be the same file. */
fromfd = open(name, O_RDONLY);
if (fromfd < 0 || fstat(fromfd, &sb) < 0)
fail("cannot access %s", name);
if (exists && (!S_ISREG(tosb.st_mode) || access(toname, W_OK) < 0))
(void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname);
tofd = open(toname, O_CREAT | O_WRONLY, 0666);
if (tofd < 0)
fail("cannot create %s", toname);
bp = buf;
while ((cc = read(fromfd, bp, sizeof buf)) > 0) {
while ((wc = write(tofd, bp, cc)) > 0) {
if ((cc -= wc) == 0)
break;
bp += wc;
}
if (wc < 0)
fail("cannot write to %s", toname);
}
if (cc < 0)
fail("cannot read from %s", name);
if (ftruncate(tofd, sb.st_size) < 0)
fail("cannot truncate %s", toname);
if (dotimes) {
utb.actime = sb.st_atime;
utb.modtime = sb.st_mtime;
if (utime(toname, &utb) < 0)
fail("cannot set times of %s", toname);
}
#ifdef HAVE_FCHMOD
if (fchmod(tofd, mode) < 0)
#else
if (chmod(toname, mode) < 0)
#endif
fail("cannot change mode of %s", toname);
if ((owner || group) && fchown(tofd, uid, gid) < 0)
fail("cannot change owner of %s", toname);
/* Must check for delayed (NFS) write errors on close. */
if (close(tofd) < 0)
fail("cannot write to %s", toname);
close(fromfd);
}
free(toname);
}
free(cwd);
free(todir);
return 0;
}
/*
** Pathname subroutines.
**
** Brendan Eich, 8/29/95
*/
char *program;
void
fail(char *format, ...)
{
int error;
va_list ap;
#ifdef USE_REENTRANT_LIBC
R_STRERROR_INIT_R();
#endif
error = errno;
fprintf(stderr, "%s: ", program);
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
if (error)
#ifdef USE_REENTRANT_LIBC
R_STRERROR_R(errno);
fprintf(stderr, ": %s", r_strerror_r);
#else
fprintf(stderr, ": %s", strerror(errno));
#endif
putc('\n', stderr);
exit(1);
}
char *
getcomponent(char *path, char *name)
{
if (*path == '\0')
return 0;
if (*path == '/') {
*name++ = '/';
} else {
do {
*name++ = *path++;
} while (*path != '/' && *path != '\0');
}
*name = '\0';
while (*path == '/')
path++;
return path;
}
#ifdef UNIXWARE_READDIR_BUFFER_TOO_SMALL
/* Sigh. The static buffer in Unixware's readdir is too small. */
struct dirent * readdir(DIR *d)
{
static struct dirent *buf = NULL;
#define MAX_PATH_LEN 1024
if(buf == NULL)
buf = (struct dirent *) malloc(sizeof(struct dirent) + MAX_PATH_LEN)
;
return(readdir_r(d, buf));
}
#endif
char *
ino2name(ino_t ino, char *dir)
{
DIR *dp;
struct dirent *ep;
char *name;
dp = opendir("..");
if (!dp)
fail("cannot read parent directory");
for (;;) {
if (!(ep = readdir(dp)))
fail("cannot find current directory");
if (ep->d_ino == ino)
break;
}
name = xstrdup(ep->d_name);
closedir(dp);
return name;
}
void *
xmalloc(size_t size)
{
void *p = malloc(size);
if (!p)
fail("cannot allocate %u bytes", size);
return p;
}
char *
xstrdup(char *s)
{
return strcpy((char*)xmalloc(strlen(s) + 1), s);
}
char *
xbasename(char *path)
{
char *cp;
while ((cp = strrchr(path, '/')) && cp[1] == '\0')
*cp = '\0';
if (!cp) return path;
return cp + 1;
}
void
xchdir(char *dir)
{
if (chdir(dir) < 0)
fail("cannot change directory to %s", dir);
}
int
relatepaths(char *from, char *to, char *outpath)
{
char *cp, *cp2;
int len;
char buf[NAME_MAX];
assert(*from == '/' && *to == '/');
for (cp = to, cp2 = from; *cp == *cp2; cp++, cp2++)
if (*cp == '\0')
break;
while (cp[-1] != '/')
cp--, cp2--;
if (cp - 1 == to) {
/* closest common ancestor is /, so use full pathname */
len = strlen(strcpy(outpath, to));
if (outpath[len] != '/') {
outpath[len++] = '/';
outpath[len] = '\0';
}
} else {
len = 0;
while ((cp2 = getcomponent(cp2, buf)) != 0) {
strcpy(outpath + len, "../");
len += 3;
}
while ((cp = getcomponent(cp, buf)) != 0) {
sprintf(outpath + len, "%s/", buf);
len += strlen(outpath + len);
}
}
return len;
}
void
reversepath(char *inpath, char *name, int len, char *outpath)
{
char *cp, *cp2;
char buf[NAME_MAX];
struct stat sb;
cp = strcpy(outpath + PATH_MAX - (len + 1), name);
cp2 = inpath;
while ((cp2 = getcomponent(cp2, buf)) != 0) {
if (strcmp(buf, ".") == 0)
continue;
if (strcmp(buf, "..") == 0) {
if (stat(".", &sb) < 0)
fail("cannot stat current directory");
name = ino2name(sb.st_ino, "..");
len = strlen(name);
cp -= len + 1;
strcpy(cp, name);
cp[len] = '/';
free(name);
xchdir("..");
} else {
cp -= 3;
strncpy(cp, "../", 3);
xchdir(buf);
}
}
strcpy(outpath, cp);
}

View File

@@ -1,78 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef pathsub_h___
#define pathsub_h___
/*
** Pathname subroutines.
**
** Brendan Eich, 8/29/95
*/
#include <limits.h>
#include <sys/types.h>
#if SUNOS4
#include "../pr/include/md/sunos4.h"
#endif
#ifndef PATH_MAX
#define PATH_MAX 1024
#endif
/*
* Just prevent stupidity
*/
#undef NAME_MAX
#define NAME_MAX 256
extern char *program;
extern void fail(char *format, ...);
extern char *getcomponent(char *path, char *name);
extern char *ino2name(ino_t ino, char *dir);
extern void *xmalloc(size_t size);
extern char *xstrdup(char *s);
extern char *xbasename(char *path);
extern void xchdir(char *dir);
/* Relate absolute pathnames from and to returning the result in outpath. */
extern int relatepaths(char *from, char *to, char *outpath);
/* XXX changes current working directory -- caveat emptor */
extern void reversepath(char *inpath, char *name, int len, char *outpath);
#endif /* pathsub_h___ */

View File

@@ -1,45 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* A dummy header file that is a dependency for all the object files.
* Used to force a full recompilation of NSPR in Mozilla's Tinderbox
* depend builds. See comments in rules.mk.
*/
#error "Do not include this header file."

View File

@@ -1,38 +0,0 @@
REM
REM ***** BEGIN LICENSE BLOCK *****
REM Version: MPL 1.1/GPL 2.0/LGPL 2.1
REM
REM The contents of this file are subject to the Mozilla Public License Version
REM 1.1 (the "License"); you may not use this file except in compliance with
REM the License. You may obtain a copy of the License at
REM http://www.mozilla.org/MPL/
REM
REM Software distributed under the License is distributed on an "AS IS" basis,
REM WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
REM for the specific language governing rights and limitations under the
REM License.
REM
REM The Original Code is mozilla.org code.
REM
REM The Initial Developer of the Original Code is
REM Netscape Communications Corporation.
REM Portions created by the Initial Developer are Copyright (C) 1998
REM the Initial Developer. All Rights Reserved.
REM
REM Contributor(s):
REM
REM Alternatively, the contents of this file may be used under the terms of
REM either of the GNU General Public License Version 2 or later (the "GPL"),
REM or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
REM in which case the provisions of the GPL or the LGPL are applicable instead
REM of those above. If you wish to allow use of your version of this file only
REM under the terms of either the GPL or the LGPL, and not to allow others to
REM use your version of this file under the terms of the MPL, indicate your
REM decision by deleting the provisions above and replace them with the notice
REM and other provisions required by the GPL or the LGPL. If you do not delete
REM the provisions above, a recipient may use your version of this file under
REM the terms of any one of the MPL, the GPL or the LGPL.
REM
REM ***** END LICENSE BLOCK *****
mkdir %1

View File

@@ -1,495 +0,0 @@
#! gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
################################################################################
# We have a 4 pass build process:
#
# Pass 1. export - Create generated headers and stubs. Publish public headers to
# dist/<arch>/include.
#
# Pass 2. libs - Create libraries. Publish libraries to dist/<arch>/lib.
#
# Pass 3. all - Create programs.
#
# Pass 4. install - Publish programs to dist/<arch>/bin.
#
# Parameters to this makefile (set these before including):
#
# a)
# TARGETS -- the target to create
# (defaults to $LIBRARY $PROGRAM)
# b)
# DIRS -- subdirectories for make to recurse on
# (the 'all' rule builds $TARGETS $DIRS)
# c)
# CSRCS -- .c files to compile
# (used to define $OBJS)
# d)
# PROGRAM -- the target program name to create from $OBJS
# ($OBJDIR automatically prepended to it)
# e)
# LIBRARY -- the target library name to create from $OBJS
# ($OBJDIR automatically prepended to it)
#
################################################################################
ifndef topsrcdir
topsrcdir=$(MOD_DEPTH)
endif
ifndef srcdir
srcdir=.
endif
ifndef NSPR_CONFIG_MK
include $(topsrcdir)/config/config.mk
endif
ifdef USE_AUTOCONF
ifdef CROSS_COMPILE
ifdef INTERNAL_TOOLS
CC=$(HOST_CC)
CCC=$(HOST_CXX)
CFLAGS=$(HOST_CFLAGS)
CXXFLAGS=$(HOST_CXXFLAGS)
endif
endif
endif
#
# This makefile contains rules for building the following kinds of
# libraries:
# - LIBRARY: a static (archival) library
# - SHARED_LIBRARY: a shared (dynamic link) library
# - IMPORT_LIBRARY: an import library, used only on Windows and OS/2
#
# The names of these libraries can be generated by simply specifying
# LIBRARY_NAME and LIBRARY_VERSION.
#
ifdef LIBRARY_NAME
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
#
# Win95, Win16, and OS/2 require library names conforming to the 8.3 rule.
# other platforms do not.
#
ifeq (,$(filter-out WIN95 WIN16 OS2,$(OS_TARGET)))
LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
else
LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
endif
ifeq ($(OS_ARCH),OS2)
DEF_FILE := $(SHARED_LIBRARY:.dll=.def)
endif
else
LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_shr.a
else
ifdef MKSHLIB
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
endif
endif
endif
endif
ifndef TARGETS
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
else
TARGETS = $(LIBRARY) $(SHARED_LIBRARY)
endif
endif
#
# OBJS is the list of object files. It can be constructed by
# specifying CSRCS (list of C source files) and ASFILES (list
# of assembly language source files).
#
ifndef OBJS
OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX))) \
$(addprefix $(OBJDIR)/,$(ASFILES:.$(ASM_SUFFIX)=.$(OBJ_SUFFIX)))
endif
ifeq ($(OS_TARGET), WIN16)
comma := ,
empty :=
space := $(empty) $(empty)
W16OBJS = $(subst $(space),$(comma)$(space),$(strip $(OBJS)))
W16TEMP =$(OS_LIBS) $(EXTRA_LIBS)
ifeq ($(strip $(W16TEMP)),)
W16LIBS =
else
W16LIBS = library $(subst $(space),$(comma)$(space),$(strip $(W16TEMP)))
endif
W16DEF = $(notdir $(basename $(SHARED_LIBRARY))).DEF
endif
ifeq ($(OS_ARCH), WINNT)
ifneq ($(OS_TARGET), WIN16)
OBJS += $(RES)
endif
endif
ALL_TRASH = $(TARGETS) $(OBJS) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \
$(NOSUCHFILE) $(DEF_FILE)\
so_locations
ifdef DIRS
LOOP_OVER_DIRS = \
@for d in $(DIRS); do \
if test -d $$d; then \
set -e; \
echo "cd $$d; $(MAKE) $@"; \
$(MAKE) -C $$d $@; \
set +e; \
else \
echo "Skipping non-directory $$d..."; \
fi; \
done
endif
################################################################################
all:: export
export::
+$(LOOP_OVER_DIRS)
libs:: export
install:: export
clean::
rm -rf $(OBJS) so_locations $(NOSUCHFILE) $(GARBAGE)
+$(LOOP_OVER_DIRS)
clobber::
rm -rf $(OBJS) $(TARGETS) $(filter-out . ..,$(OBJDIR)) $(GARBAGE) so_locations $(NOSUCHFILE)
+$(LOOP_OVER_DIRS)
realclean clobber_all::
rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH)
+$(LOOP_OVER_DIRS)
distclean::
rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH) $(DIST_GARBAGE)
+$(LOOP_OVER_DIRS)
real_install:: $(RELEASE_BINS) $(RELEASE_HEADERS) $(RELEASE_LIBS)
ifdef RELEASE_BINS
$(NSINSTALL) -t -m 0755 $(RELEASE_BINS) $(DESTDIR)$(bindir)
endif
ifdef RELEASE_HEADERS
$(NSINSTALL) -t -m 0644 $(RELEASE_HEADERS) $(DESTDIR)$(includedir)
endif
ifdef RELEASE_LIBS
$(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)
endif
+$(LOOP_OVER_DIRS)
release:: export
ifdef RELEASE_BINS
@echo "Copying executable programs and scripts to release directory"
@if test -z "$(BUILD_NUMBER)"; then \
echo "BUILD_NUMBER must be defined"; \
false; \
else \
true; \
fi
@if test ! -d $(RELEASE_BIN_DIR); then \
rm -rf $(RELEASE_BIN_DIR); \
$(NSINSTALL) -D $(RELEASE_BIN_DIR);\
else \
true; \
fi
cp $(RELEASE_BINS) $(RELEASE_BIN_DIR)
endif
ifdef RELEASE_LIBS
@echo "Copying libraries to release directory"
@if test -z "$(BUILD_NUMBER)"; then \
echo "BUILD_NUMBER must be defined"; \
false; \
else \
true; \
fi
@if test ! -d $(RELEASE_LIB_DIR); then \
rm -rf $(RELEASE_LIB_DIR); \
$(NSINSTALL) -D $(RELEASE_LIB_DIR);\
else \
true; \
fi
cp $(RELEASE_LIBS) $(RELEASE_LIB_DIR)
endif
ifdef RELEASE_HEADERS
@echo "Copying header files to release directory"
@if test -z "$(BUILD_NUMBER)"; then \
echo "BUILD_NUMBER must be defined"; \
false; \
else \
true; \
fi
@if test ! -d $(RELEASE_HEADERS_DEST); then \
rm -rf $(RELEASE_HEADERS_DEST); \
$(NSINSTALL) -D $(RELEASE_HEADERS_DEST);\
else \
true; \
fi
cp $(RELEASE_HEADERS) $(RELEASE_HEADERS_DEST)
endif
+$(LOOP_OVER_DIRS)
alltags:
rm -f TAGS tags
find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs etags -a
find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs ctags -a
$(NFSPWD):
cd $(@D); $(MAKE) $(@F)
$(PROGRAM): $(OBJS)
@$(MAKE_OBJDIR)
ifeq ($(OS_ARCH)_$(NS_USE_GCC),WINNT_)
$(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
else
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(CC) $(OBJS) -Fe$@ $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
else
$(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS)
endif
endif
$(LIBRARY): $(OBJS)
@$(MAKE_OBJDIR)
rm -f $@
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(AR) $(subst /,\\,$(OBJS)) $(AR_EXTRA_ARGS)
else
ifdef USE_AUTOCONF
$(AR) $(AR_FLAGS) $(OBJS) $(AR_EXTRA_ARGS)
else
$(AR) $(OBJS) $(AR_EXTRA_ARGS)
endif # USE_AUTOCONF
endif
$(RANLIB) $@
ifeq ($(OS_TARGET), WIN16)
$(IMPORT_LIBRARY): $(SHARED_LIBRARY)
wlib $(OS_LIB_FLAGS) $@ +$(SHARED_LIBRARY)
endif
ifeq ($(OS_TARGET), OS2)
$(DEF_FILE): $(LIBRARY)
rm -f $@
echo LIBRARY $(notdir $(basename $(SHARED_LIBRARY))) INITINSTANCE TERMINSTANCE > $@
echo PROTMODE >> $@
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
echo EXPORTS >> $@
$(FILTER) $(LIBRARY) >> $@
$(IMPORT_LIBRARY): $(DEF_FILE)
rm -f $@
$(IMPLIB) $@ $(DEF_FILE)
endif
$(SHARED_LIBRARY): $(OBJS) $(DEF_FILE)
@$(MAKE_OBJDIR)
rm -f $@
ifdef USE_AUTOCONF
$(MKSHLIB) $(OBJS) $(EXTRA_LIBS) $(OS_LIBS) $(DEF_FILE)
else
ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms
nm -B -C -g $(OBJS) \
| awk '/ [T,D] / {print $$3}' \
| sed -e 's/^\.//' \
| sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms
$(LD) $(XCFLAGS) -o $@ $(OBJS) -bE:$(OBJDIR)/lib$(LIBRARY_NAME)_syms \
-bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS)
else # AIX 4.1
ifeq ($(OS_ARCH), WINNT)
ifeq ($(OS_TARGET), WIN16)
echo system windows dll initinstance >w16link
echo option map >>w16link
echo option oneautodata >>w16link
echo option heapsize=32K >>w16link
echo option $(OS_DLL_OPTION) >>w16link
echo debug $(DEBUGTYPE) all >>w16link
echo name $@ >>w16link
echo file >>w16link
echo $(W16OBJS) >>w16link
echo $(W16IMPORTS) >>w16link
echo $(W16LIBS) >>w16link
echo $(W16_EXPORTS) >>w16link
echo libfile libentry >>w16link
$(LINK) @w16link.
rm w16link
else # WIN16
$(LINK_DLL) -MAP $(DLLBASE) $(OS_LIBS) $(EXTRA_LIBS) $(OBJS)
endif # WINNT
else
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE)
else # !os2 vacpp
$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS) $(DEF_FILE)
endif # OS2 vacpp
endif # WINNT
endif # AIX 4.1
endif # USE_AUTOCONF
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
$(RES): $(RESNAME)
@$(MAKE_OBJDIR)
ifeq ($(OS_TARGET),OS2)
$(RC) -DOS2 -r $(RESNAME) $(RES)
else
# The resource compiler does not understand the -U option.
ifdef NS_USE_GCC
$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
else
$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$(RES) $(RESNAME)
endif
endif
@echo $(RES) finished
endif
$(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
@$(MAKE_OBJDIR)
ifeq ($(OS_ARCH)_$(NS_USE_GCC), WINNT_)
$(CCC) -Fo$@ -c $(CCCFLAGS) $<
else
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(CCC) -Fo$@ -c $(CCCFLAGS) $<
else
$(CCC) -o $@ -c $(CCCFLAGS) $<
endif
endif
WCCFLAGS1 = $(subst /,\\,$(CFLAGS))
WCCFLAGS2 = $(subst -I,-i=,$(WCCFLAGS1))
WCCFLAGS3 = $(subst -D,-d,$(WCCFLAGS2))
$(OBJDIR)/%.$(OBJ_SUFFIX): %.c
@$(MAKE_OBJDIR)
ifeq ($(OS_ARCH)_$(NS_USE_GCC), WINNT_)
ifeq ($(OS_TARGET), WIN16)
# $(MOD_DEPTH)/config/w16opt $(WCCFLAGS3)
echo $(WCCFLAGS3) >w16wccf
$(CC) -zq -fo$(OBJDIR)\\$*.$(OBJ_SUFFIX) @w16wccf $*.c
rm w16wccf
else
$(CC) -Fo$@ -c $(CFLAGS) $<
endif
else
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(CC) -Fo$@ -c $(CFLAGS) $<
else
$(CC) -o $@ -c $(CFLAGS) $<
endif
endif
$(OBJDIR)/%.$(OBJ_SUFFIX): %.s
@$(MAKE_OBJDIR)
$(AS) -o $@ $(ASFLAGS) -c $<
%.i: %.c
$(CC) -C -E $(CFLAGS) $< > $*.i
%: %.pl
rm -f $@; cp $< $@; chmod +x $@
#
# HACK ALERT
#
# The only purpose of this rule is to pass Mozilla's Tinderbox depend
# builds (http://tinderbox.mozilla.org/showbuilds.cgi). Mozilla's
# Tinderbox builds NSPR continuously as part of the Mozilla client.
# Because NSPR's make depend is not implemented, whenever we change
# an NSPR header file, the depend build does not recompile the NSPR
# files that depend on the header.
#
# This rule makes all the objects depend on a dummy header file.
# Touch this dummy header file to force the depend build to recompile
# everything.
#
# This rule should be removed when make depend is implemented.
#
DUMMY_DEPEND_H = $(topsrcdir)/config/prdepend.h
$(filter $(OBJDIR)/%.$(OBJ_SUFFIX),$(OBJS)): $(OBJDIR)/%.$(OBJ_SUFFIX): $(DUMMY_DEPEND_H)
# END OF HACK
################################################################################
# Special gmake rules.
################################################################################
#
# Re-define the list of default suffixes, so gmake won't have to churn through
# hundreds of built-in suffix rules for stuff we don't need.
#
.SUFFIXES:
.SUFFIXES: .a .$(OBJ_SUFFIX) .c .cpp .s .h .i .pl
#
# Fake targets. Always run these rules, even if a file/directory with that
# name already exists.
#
.PHONY: all alltags clean export install libs realclean release
#
# List the target pattern of an implicit rule as a dependency of the
# special target .PRECIOUS to preserve intermediate files made by
# implicit rules whose target patterns match that file's name.
# (See GNU Make documentation, Edition 0.51, May 1996, Sec. 10.4,
# p. 107.)
#
.PRECIOUS: $(OBJDIR)/%.$(OBJ_SUFFIX)

View File

@@ -1,119 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# win16_3.11.mk -- Make configuration for Win16
#
# This file configures gmake to build the Win16 variant of
# NSPR 2.0. This file has the function of two files commonly
# used on other platforms, for example: winnt.mk and
# winnt4.0.mk. ... The packaging is easier and there is only
# one variant of the Win16 target.
#
# Win16 is built using the Watcom C/C++ version 11.0
# compiler. You gotta set up the compiler first. Follow the
# directions in the manual (Ha! ... really, its not a
# problem). The Watcom compiler depends on a few environment
# variables; these environment variables define where the
# compiler components are installed; they must be set before
# running the make.
#
# Notes:
# OS_CFLAGS is the command line options for the compiler when
# building the .DLL object files.
# OS_EXE_CFLAGS is the command line options for the compiler
# when building the .EXE object files; this is for the test
# programs.
# the macro OS_CFLAGS is set to OS_EXE_CFLAGS inside of the
# makefile for the pr/tests directory. ... Hack.
#
# USE_WATCOM_DEBUG_DATA environment variable causes the
# watcom compiler flag to be set to -hw (otherwise
# it is set to -hc (codeview debug data)) for debug builds.
#
# -- configuration -----------------------------------------
CC = wcc
CCC = wcl
LINK = wlink
AR = wlib -q $@
RC = wrc.exe /r /dWIN16=1 /bt=windows
RANLIB = echo
BSDECHO = echo
NSINSTALL = nsinstall
INSTALL = $(NSINSTALL)
MAKE_OBJDIR = mkdir $(OBJDIR)
XP_DEFINE = -DXP_PC
OBJ_SUFFIX = obj
LIB_SUFFIX = lib
DLL_SUFFIX = dll
ifdef BUILD_OPT
OBJDIR_TAG = _O
OPTIMIZER = -oneatx -oh -oi -ei -3 -fpi87 -fp3 -s
else
ifdef USE_WATCOM_DEBUG_DATA
OPTIMIZER = -d2 -hw -s -DDEBUG
DEBUGTYPE = watcom
else
OPTIMIZER = -d2 -hc -s -DDEBUG
DEBUGTYPE = codeview
endif
OBJDIR_TAG = _D
endif
# XXX FIXME: I doubt we use this. It is redundant with
# SHARED_LIBRARY.
ifdef DLL
DLL := $(addprefix $(OBJDIR)/, $(DLL))
endif
CPU_ARCH = x86
OS_CFLAGS = -ml -3 -bd -zc -zu -bt=windows -d_X86_ -dWIN16 -d_WINDLL
OS_EXE_CFLAGS = -ml -3 -bt=windows -d_X86_ -dWIN16
OS_LIB_FLAGS = -c -iro -n
# Name of the binary code directories
OBJDIR_NAME = $(OS_CONFIG)$(OBJDIR_TAG).OBJ
OS_DLL_OPTION = CASEEXACT
OS_DLLFLAGS =
OS_LIBS =
W16_EXPORTS = #

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,97 +0,0 @@
#!gmake
# -*- Mode: Makefile -*-
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
ifndef MOZ_SRC_FLIPPED
$(error MOZ_SRC_FLIPPED is not set)
endif
ifndef MOZ_TOP
MOZ_TOP=mozilla
endif
MOZ_DIST_FLIPPED = $(MOZ_SRC_FLIPPED)/mozilla/dist
ifdef MOZ_DEBUG
MOZ_OBJDIR = WIN32_D.OBJ
else
MOZ_OBJDIR = WIN32_O.OBJ
endif
LDAP_CONFIGURE := ../configure \
--with-mozilla \
--with-dist-prefix=$(MOZ_DIST_FLIPPED) \
--with-dist-bindir=$(MOZ_DIST_FLIPPED)/$(MOZ_OBJDIR)/bin \
--with-dist-libdir=$(MOZ_DIST_FLIPPED)/$(MOZ_OBJDIR)/lib \
--without-nss
ifeq (,$(MOZ_DEBUG)$(MOZ_TRACE_MALLOC))
LDAP_CONFIGURE := $(LDAP_CONFIGURE) --enable-optimize --disable-debug
endif
define MAKE_OBJDIR
if test ! -d $(@D) ; then rm -rf $(@D) ; nsinstall -D $(@D) ; fi
endef
all:: build_all
# Argh. nmake keeps the cwd from cmd to cmd and gmake does not
# Furthermore, shmsdos doesn't support '&&' so there's a chance the
# 'cd' could fail and configure would be run in the wrong dir
#
$(MOZ_OBJDIR)/config.status: configure configure.in
@$(MAKE_OBJDIR)
cd $(MOZ_OBJDIR)/ ; \
sh $(LDAP_CONFIGURE)
build_all: $(MOZ_OBJDIR)/config.status check_old
$(MAKE) -C $(MOZ_OBJDIR)
clobber_all: $(MOZ_OBJDIR)/config.status check_old
$(MAKE) -C $(MOZ_OBJDIR) clobber_all
distclean: check_old
rm -rf WIN32_D.OBJ WIN32_O.OBJ
check_old:
@if test -f Makefile; then $(MAKE) distclean; fi

View File

@@ -1,78 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-1999
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
NSPR_TREE = ..
MOD_DEPTH = ..
include $(NSPR_TREE)/config/rules.mk
include ../build.mk
SRCDIRS = include libraries
ifeq ($(BUILDCLU), 1)
SRCDIRS += clients/tools
endif
all export:: FORCE
@for i in $(SRCDIRS); do \
echo " cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) export"; \
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) export ); \
done
libs install:: FORCE
@for i in $(SRCDIRS); do \
echo "cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) install"; \
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) install ); \
done
clean clobber:: FORCE
@for i in $(SRCDIRS); do \
echo "cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) clean"; \
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) clean ); \
done
cd clients/tools; $(MAKE) -f Makefile.client $(MFLAGS) clean
realclean clobber_all:: FORCE
@for i in $(SRCDIRS); do \
echo "cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) realclean"; \
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) realclean ); \
done
FORCE:

View File

@@ -1,61 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MOD_DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
SRCDIRS = include libraries
ifeq ($(BUILDCLU), 1)
SRCDIRS += clients/tools
endif
DIRS = $(SRCDIRS)
include $(topsrcdir)/config/rules.mk
# dummy target to allow platforms without a compiler-based depend (like GCC
# has) to call "make depend" here and not fail, at the cost of actual
# dependencies on such builds possibly being incorrect. A nasty hack, but
# this build system is going away soon.
#
depend:
FORCE:

View File

@@ -1,98 +0,0 @@
#!/bin\sh
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# compver.sh - a script to check if the correct component version is
# available. If it is not available, it uses the nsftp.sh script to
# download the component version. The component release is assumed
# to be under /share/builds/components on a UNIX box.
#
COMP_ROOT=$1
COMP_VERSION=$2
COMP_VERSION_FILE=${COMP_ROOT}/Version
COMPOBJDIR=$3
MCOM_ROOT=$4
MODULE=$5 # Module which needs this component
COMP_RELEASE=$6 # Component release dir
COMP_NAME=$7 # component name (e.g. ldapsdk, rouge)
COMP_SUBDIRS=$8 # subdirs to ftp over
TEST_FILE=$9 # to test if ftp was successful
if test -r ${COMP_VERSION_FILE}; then \
CUR_VERSION=`cat ${COMP_VERSION_FILE}`; \
if test "${CUR_VERSION}" = "${COMP_VERSION}"; then \
if test -d ${COMP_ROOT}/${COMPOBJDIR}; then \
exit 0; \
fi; \
fi; \
fi
echo "************************ WARNING *************************"
echo "The MODULE ${MODULE} needs ${COMP_NAME} client libraries."
echo "The ${COMP_NAME} client libraries are missing. "
echo ""
echo "Attempting to download..."
rm -rf ${COMP_ROOT}/${COMPOBJDIR} ${COMP_VERSION_FILE}
mkdir -p ${COMP_ROOT}/${COMPOBJDIR}
sh ../../build/nsftp.sh ${COMP_NAME}/${COMP_VERSION}/${COMPOBJDIR} ${COMP_ROOT}/${COMPOBJDIR}
for d in ${COMP_SUBDIRS}; do \
mkdir -p ${COMP_ROOT}/${COMPOBJDIR}/${d}; \
sh ../../build/nsftp.sh ${COMP_NAME}/${COMP_VERSION}/${COMPOBJDIR}/${d} ${COMP_ROOT}/${COMPOBJDIR}/${d}
done
if test -f ${TEST_FILE}; then \
echo "${COMP_VERSION}" > ${COMP_VERSION_FILE}; \
echo "************************ SUCCESS! ************************"; \
else \
echo ""; \
echo "Attempt to ftp over ${COMP_NAME} failed!!!"; \
echo "Please ftp over (${COMP_SUBDIRS}) subdirectories under:"; \
echo " ${COMP_RELEASE}"; \
echo "and put them under:"; \
echo " ${COMP_ROOT}/${COMPOBJDIR}"; \
echo "Also, execute the following command: "; \
echo " echo \"${COMP_VERSION}\" > ${COMP_VERSION_FILE}"; \
echo "Note: Above directories are w.r.t. the MODULE ${MODULE}"; \
echo "**********************************************************"; \
exit 1; \
fi

View File

@@ -1,272 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1997-2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# genexports.pl: create up-to-date export and .def files
#
# created 31 August 1997 by Mark Smith <mcs@netscape.com>
$type = $ARGV[0];
$tmplfile = $ARGV[1];
$expfile = $ARGV[2];
$buildtype = $ARGV[3];
$suppress_license_from_expfile = 1;
if ( $type ne "Win16" && $type ne "Win16Rev" && $type ne "Win32" &&
$type ne "WinBC" && $type ne "AIX" && $type ne "IRIX" &&
$type ne "MacOS" && $type ne "SOLARIS" && $type ne "SunOS" &&
$type ne "OS2" ) {
usage();
}
if ( $tmplfile eq "" || $expfile eq "" ) {
usage();
}
if ( $tmplfile ne "Standard" ) {
open( TMPL, $tmplfile );
while(<TMPL>) {
$line = $_;
&process_line( $type, $expfile, $line, $ARGV[3+1], $ARGV[3+2],
$ARGV[3+3] );
}
} else {
$suppress_license_from_expfile = 0;
if ( substr( $type, 0, 3 ) eq "Win" ) {
&windows_std( $type, $expfile, $ARGV[3+1], $ARGV[3+2], $ARGV[3+3] );
} elsif ( $type eq "SOLARIS" || $type eq "SunOS" ) {
&solaris_std( $type, $expfile, $ARGV[3+1], $ARGV[3+2], $ARGV[3+3] );
} else {
# Simple standard template just includes exports; this works for all others.
&simple_std( $type, $expfile, $ARGV[3+1], $ARGV[3+2], $ARGV[3+3] );
}
}
# process_line( type, expfile, line, arg1, arg2, arg3 )
sub
process_line {
local( $type, $expfile, $line, $arg1, $arg2, $arg3 ) = @_;
if ( $line eq "\$EXPORTS\n" ) {
&print_exports( $type, $expfile );
} else {
$line =~ s/\$1/$arg1/;
$line =~ s/\$2/$arg2/;
$line =~ s/\$3/$arg3/;
print $line;
}
}
# usage()
sub
usage {
print STDERR "usage: genexports.pl TYPE TMPLFILE|Standard EXPFILE BUILDTYPE [ARG1 [[ARG2] [ARG3]]] > OUTFILE\n";
print STDERR " where TYPE is Win16, Win16Rev, Win32, WinBC, AIX, IRIX, MacOS, or SOLARIS.\n";
print STDERR " and where BUILDTYPE is matched against last field in export file.\n";
exit 1;
}
# print_exports( type, exports-file )
sub
print_exports {
local( $type, $expfile ) = @_;
local $skipping_license = 0;
open( EXP, $expfile );
&print_comment( $type, "\n" );
&print_comment( $type, "exports list (generated by genexports.pl)\n" );
&print_comment( $type, "\n" );
while( <EXP> ) {
$line = $_;
if ( substr( $line, 0, 1 ) eq "#" ) {
if ( $suppress_license_from_expfile ) {
if ( $line =~ /.*BEGIN LICENSE BLOCK.*/ ) {
$skipping_license = 1;
next;
} elsif ( $line =~ /.*END LICENSE BLOCK.*/ ) {
$skipping_license = 0;
next;
}
}
if ( !$skipping_license ) {
$line = substr( $line, 1 );
$_ = $line;
if ( /^[0-9]+[\t ]/ && $type ne "OS2" ) {
&print_comment( $type, "" );
&print_export( $type, $line );
} else {
&print_comment( $type, $line );
}
}
} elsif ( length( $line ) eq 1 && substr( $line, 0, 1 ) eq "\n" ) {
print "\n";
} else {
&print_export( $type, $line );
}
}
&print_comment( $type, "\n" );
&print_comment( $type, "end of generated exports list.\n" );
}
# print_comment( type, s )
sub
print_comment {
# do not print comments for OS2
if ( $type ne "OS2" ) {
local( $type, $s ) = @_;
if ( $type eq "AIX" ) {
$prefix = "* ";
} elsif ( substr( $type, 0, 3 ) ne "Win" ) {
$prefix = "# ";
} else {
$prefix = "; ";
}
print $prefix,$s
}
}
# print_export( type, expline )
sub
print_export {
local( $type, $expline ) = @_;
# strip trailing newline
$expline =~ s/\n$//;
# split into pieces
# lines look like: ORDINAL SYMBOL [SYMTYPE] [BUILDTYPE]
# where SYMTYPE is "P" (for Pascal), "C", or "G" (for globals).
# P is the default.
($ordinal,$symbol,$symtype,$bldtype) = split( /[ \t]+/, $expline, 4 );
$upcase_symbol = $symbol;
$upcase_symbol =~ tr/a-z/A-Z/;
if ( $symtype eq "" ) {
$symtype = "P";
}
if ( $bldtype ne "" && $bldtype ne $buildtype ) {
return;
}
# finally, print out an appropriate export line
if ( $type eq "Win32" ) {
if ( $symtype ne "G" ) {
print "\t$symbol\t\t\@$ordinal\n";
}
} elsif ( $type eq "OS2" ) {
if ( $symtype ne "G" ) {
print "\t_$symbol\t\t\@$ordinal\n";
}
} elsif ( $type eq "Win16" ) {
if ( $symtype eq "C" ) {
print "\t_$symbol\t\t\@$ordinal\n";
} elsif ( $symtype eq "P" ) {
print "\t_$symbol=$upcase_symbol\t\t\@$ordinal\n";
}
} elsif ( $type eq "Win16Rev" ) {
if ( $symtype ne "G" ) {
print "\t$upcase_symbol=_$symbol\t\t\@$ordinal\n";
}
} elsif ( $type eq "WinBC" ) {
if ( $symtype ne "G" ) {
print "\t_$symbol=$symbol\t\t\@$ordinal\n";
}
} elsif ( $type eq "MacOS" ) {
if ( $symtype ne "G" ) {
print "$symbol\n";
}
} elsif ( $type eq "AIX" || $type eq "IRIX" ) {
print "$symbol\n";
} elsif ( $type eq "SOLARIS" || $type eq "SunOS") {
print "\t$symbol;\n";
} else {
print STDERR "print_export: unknown type <$type>\n";
exit 1;
}
}
# windows_std( type, expfile, arg1, arg2, arg3 )
sub
windows_std {
local( $type, $expfile, $arg1, $arg2, $arg3 ) = @_;
process_line( $type, $expfile, "LIBRARY\tNSLIB\$1\n" );
if ( substr( $type, 0, 5 ) eq "Win16" ) {
process_line( $type, $expfile, "CODE\tPRELOAD MOVEABLE DISCARDABLE\n" );
process_line( $type, $expfile, "DATA\tPRELOAD MOVEABLE SINGLE\n" );
}
process_line( $type, $expfile, "VERSION\t\$2\n" );
process_line( $type, $expfile, "HEAPSIZE\t4096\n" );
process_line( $type, $expfile, "EXPORTS\n" );
process_line( $type, $expfile, "\$EXPORTS\n" );
}
# solaris_std( type, expfile, arg1, arg2, arg3 )
sub
solaris_std {
local( $type, $expfile, $arg1, $arg2, $arg3 ) = @_;
process_line( $type, $expfile, "{\n" );
process_line( $type, $expfile, "global:\n" );
process_line( $type, $expfile, "\$EXPORTS\n" );
process_line( $type, $expfile, "\n" );
process_line( $type, $expfile, "local:\n" );
process_line( $type, $expfile, "\t*;\n" );
process_line( $type, $expfile, "};\n" );
}
# simple_std( type, expfile, arg1, arg2, arg3 )
sub
simple_std {
local( $type, $expfile, $arg1, $arg2, $arg3 ) = @_;
process_line( $type, $expfile, "\$EXPORTS\n" );
}

View File

@@ -1,40 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org LDAP SDK autoconf glue.
#
# The Initial Developer of the Original Code is
# Netscape Commmunications Corp.
# Portions created by the Initial Developer are Copyright (C) 2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Dan Mosedale <dmose@mozilla.org>
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DIST = $(DEPTH)/dist
VPATH = $(srcdir)

View File

@@ -1,76 +0,0 @@
#!/bin/sh
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1996-2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# FTP script for downloading /share/builds/components stuff.
#
# syntax:
# nsftp <srcdir-relative to /share/builds/components> <destdir>
#
# Example
#
# nsftp ldapsdk/19961108 c:\3.0\ns\components\ldapsdk
#
SERVER=ftp-rel
USER=ftpman
PASSWD=ftpman
TMPFILE=tmp.foo
SRC=$1
DEST=$2
if [ -z "$3" ]; then
FILENAME=*
else
FILENAME=$3
fi
echo ${USER} contents of ${SRC} to ${DEST}
cd ${DEST}
ftp -n ${SERVER} << -=EOF=-
user ${USER} ${PASSWD}
binary
hash
prompt
cd ${SRC}
mget ${FILENAME}
quit
-=EOF=-

View File

@@ -1,60 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
# replace.pl: perform simple string substitution on a file
# the first line in the input (template) file is also discarded.
#
# usage: perl replace.pl KEYWORD=VALUE... < TMPLFILE > OUTFILE
#
# created 17 October 2001 by Mark Smith <mcs@netscape.com>
use File::Basename;
push @INC, dirname($0);
require replace;
%keywords = {};
foreach $str (@ARGV) {
($key,$val) = split( "=", $str, 2 );
$keywords{$key} = $val;
}
replace::GenerateHeader(*STDIN, *STDOUT, \%keywords);
exit 0;

View File

@@ -1,77 +0,0 @@
#!perl -w
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
package replace;
require 5.004;
use strict;
require Exporter;
use vars qw(@ISA @EXPORT);
@ISA = qw(Exporter);
@EXPORT = qw(
GenerateHeader
);
sub GenerateHeader ($$\%) {
my($template, $header, $keywords) = @_;
local(*TEMPLATE) = $template;
local(*HEADER) = $header;
my($first_line) = 1;
my($orig, $replace);
while(<TEMPLATE>) {
my $line = $_;
while(($orig, $replace) = each %$keywords) {
$line =~ s/{{$orig}}/$replace/g;
}
# the first line is a comment specific to the template file, which we
# don't want to transfer over
#
if ( ! $first_line ) {
print HEADER $line;
} else {
$first_line = 0;
}
}
}

View File

@@ -1,387 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-1999
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
NS_DEPTH = ../../../..
DEPTH = ../../../../..
LDAP_SRC = ../..
NSCP_DISTDIR = ../../../../../dist
NSPR_TREE = ../../..
MOD_DEPTH = ../../..
include $(NSPR_TREE)/config/rules.mk
include ../../../build.mk
INSTALLDIR = $(NSCP_DISTDIR)/$(OBJDIR_NAME)/bin
HEADERDIR = $(DEPTH)/dist/$(OBJDIR_NAME)
INCLUDES += -I$(HEADERDIR)/include \
-I../../../../../dist/include/obsolete \
-I../../../../../dist/include \
-I../../../../../dist/public/security \
-I../../../../../dist/public/nss \
-I$(NSCP_DISTDIR)/public/ldap \
-I../../../ldap/include \
ifeq ($(HAVE_CCONF), 1)
COMPS_FROM_OBJDIR=1
endif
#
# The "arg pin" feature depends on the server core library.
#
ifeq ($(HAVE_SVRCORE), 1)
LDAP_TOOL_ARGPIN=1
endif
ifeq ($(LDAP_TOOL_ARGPIN),1)
INCLUDES += -I../../../../../dist/public/svrcore
DEFS+=-DLDAP_TOOL_ARGPIN -DLDAP_TOOL_PKCS11
SVRCORE_LINK=-l$(SVRCORE_LIBNAME)
endif
ifdef HAVE_LIBNLS
INCLUDES += -I$(LIBNLS_INCLUDES)
endif
ifeq ($(OS_ARCH), WINNT)
DEFS += -DXP_WIN -DXP_WIN32
endif
DEFINES += $(DEFS)
CXXSRCS = convutf8.cpp
OBJDEST = $(OBJDIR_NAME)
BINDIR = $(OBJDIR_NAME)/bin
LIBDIR = $(OBJDIR_NAME)/lib
ifeq ($(OS_ARCH), WINNT)
LDAPDELETE_OBJ = $(addprefix $(OBJDEST)/, ldapdelete.obj)
LDAPMODIFY_OBJ = $(addprefix $(OBJDEST)/, ldapmodify.obj)
LDAPSEARCH_OBJ = $(addprefix $(OBJDEST)/, ldapsearch.obj)
LDAPCOMPARE_OBJ = $(addprefix $(OBJDEST)/, ldapcompare.obj)
LDAPCMP_OBJ = $(addprefix $(OBJDEST)/, ldapcmp.obj)
LDAPTOOLCOMMON_OBJ = $(addprefix $(OBJDEST)/, common.obj) \
$(addprefix $(OBJDEST)/, convutf8.obj) \
$(addprefix $(OBJDEST)/, fileurl.obj)
ifeq ($(LDAP_TOOL_ARGPIN),1)
LDAPTOOLCOMMON_OBJ += $(addprefix $(OBJDEST)/, argpin.obj) \
$(addprefix $(OBJDEST)/, ntuserpin.obj)
endif
else
LDAPDELETE_OBJ = $(addprefix $(OBJDEST)/, ldapdelete.o)
LDAPMODIFY_OBJ = $(addprefix $(OBJDEST)/, ldapmodify.o)
LDAPSEARCH_OBJ = $(addprefix $(OBJDEST)/, ldapsearch.o)
LDAPCOMPARE_OBJ = $(addprefix $(OBJDEST)/, ldapcompare.o)
LDAPCMP_OBJ = $(addprefix $(OBJDEST)/, ldapcmp.o)
LDAPTOOLCOMMON_OBJ = $(addprefix $(OBJDEST)/, common.o) \
$(addprefix $(OBJDEST)/, convutf8.o) \
$(addprefix $(OBJDEST)/, fileurl.o)
ifeq ($(LDAP_TOOL_ARGPIN),1)
LDAPTOOLCOMMON_OBJ += $(addprefix $(OBJDEST)/, argpin.o) \
$(addprefix $(OBJDEST)/, ntuserpin.o)
endif
endif
CLIENT_OBJS = $(LDAPDELETE_OBJ) $(LDAPMODIFY_OBJ) \
$(LDAPSEARCH_OBJ) $(LDAPCOMPARE_OBJ) $(LDAPCMP_OBJ) $(LDAPTOOLCOMMON_OBJ)
LDAPDELETE = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapdelete))
LDAPMODIFY = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapmodify))
LDAPSEARCH = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapsearch))
LDAPCOMPARE = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapcompare))
LDAPCMP = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapcmp))
BINS= $(LDAPDELETE) $(LDAPMODIFY) $(LDAPSEARCH) $(LDAPCOMPARE) $(LDAPCMP)
ifeq ($(OS_ARCH), WINNT)
LDTOOLS_LIBS += $(LIBNSPR)
else
LDTOOLS_LIBS += $(DYNAMICNSPR)
endif
ifeq ($(NSS_DYNAMIC_SOFTOKN),1)
LDAPTOOLS_NSS_LINK=-l$(SSL_LIBNAME) -l$(NSS_LIBNAME) -l$(SOFTOKN_LIBNAME)
else
LDAPTOOLS_NSS_LINK=-l$(SSL_LIBNAME) -l$(NSS_LIBNAME)
endif
ifeq ($(OS_ARCH), SunOS)
EXTRA_LIBS = -L$(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib -l$(LDAP_LIBNAME) \
-l$(LDIF_LIBNAME) -l$(SSLDAP_LIBNAME) -l$(PRLDAP_LIBNAME) \
-L$(NSCP_DISTDIR)/lib $(SVRCORE_LINK) \
$(LDAPTOOLS_NSS_LINK) \
-lthread -lposix4 -lsocket -lnls \
-ldl -lresolv -lgen
EXTRA_LIBS += -L$(NSCP_DISTDIR)/lib $(DYNAMICNSPR)
endif
ifeq ($(OS_ARCH), WINNT)
EXTRA_LIBS =wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
rpcrt4.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib
EXTRA_LIBS += $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(LBER_LIBNAME).lib
EXTRA_LIBS += $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(LDAP_LIBNAME).lib
EXTRA_LIBS += $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(LDIF_LIBNAME).lib
EXTRA_LIBS += $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(PLC_BASENAME).lib
EXTRA_LIBS += $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(PLDS_BASENAME).lib
EXTRA_LIBS += $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(NSPR_BASENAME).lib
EXTRA_LIBS += $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(UTIL_LIBNAME).lib
ifeq ($(LDAP_TOOL_ARGPIN),1)
EXTRA_LIBS += $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(SVRCORE_LIBNAME).lib
endif
EXTRA_LIBS += $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(SSLDAP_LIBNAME).lib
EXTRA_LIBS += $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(PRLDAP_LIBNAME).lib
EXTRA_LIBS += $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(NSS_LIBNAME).lib
ifeq ($(NSS_DYNAMIC_SOFTOKN),1)
EXTRA_LIBS += $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(SOFTOKN_LIBNAME).lib
endif
EXTRA_LIBS += $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(SSL_LIBNAME).lib
endif
ifeq ($(OS_ARCH), OSF1)
EXTRA_LIBS = -L$(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib -l$(LDAP_LIBNAME) \
-l$(LDIF_LIBNAME) -l$(SSLDAP_LIBNAME) -l$(PRLDAP_LIBNAME) \
-L$(NSCP_DISTDIR)/lib $(SVRCORE_LINK) \
$(LDAPTOOLS_NSS_LINK) \
-lcxx -lpthread -lrt -lmach -lexc
EXTRA_LIBS += -L$(NSCP_DISTDIR)/lib $(DYNAMICNSPR)
endif
ifeq ($(OS_ARCH), Linux)
EXTRA_LIBS = -L$(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib -l$(LDAP_LIBNAME) \
-l$(LDIF_LIBNAME) -l$(SSLDAP_LIBNAME) -l$(PRLDAP_LIBNAME) \
-L$(NSCP_DISTDIR)/lib $(SVRCORE_LINK) \
$(LDAPTOOLS_NSS_LINK) \
-l$(LBER_LIBNAME) \
-ldl -lresolv -lpthread
EXTRA_LIBS += -L$(NSCP_DISTDIR)/lib $(DYNAMICNSPR)
endif
ifeq ($(OS_ARCH), HP-UX)
EXTRA_LIBS = -ldld -lm -lpthread -lrt \
-L$(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib -l$(LDAP_LIBNAME) \
-l$(LDIF_LIBNAME) -l$(SSLDAP_LIBNAME) -l$(PRLDAP_LIBNAME) \
-L$(NSCP_DISTDIR)/lib $(SVRCORE_LINK) \
$(LDAPTOOLS_NSS_LINK) -l$(LBER_LIBNAME)
EXTRA_LIBS += -L$(NSCP_DISTDIR)/lib $(DYNAMICNSPR)
endif
ifeq ($(OS_ARCH), AIX)
EXTRA_LIBS = -L$(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib -l$(LDAP_LIBNAME) \
-l$(LDIF_LIBNAME) -l$(SSLDAP_LIBNAME) -l$(PRLDAP_LIBNAME) \
-L$(NSCP_DISTDIR)/lib $(SVRCORE_LINK) \
$(LDAPTOOLS_NSS_LINK) \
-ldl -brtl -lpthreads -lc_r -lm
ifndef HAVE_LIBNLS
EXTRA_LIBS += -liconv
endif
EXTRA_LIBS += -L$(NSCP_DISTDIR)/lib $(DYNAMICNSPR)
endif
ifdef HAVE_LIBNLS
ifeq ($(OS_ARCH), WINNT)
EXTRA_LIBS += $(LIBNLS_LIBDIR)/$(NSCNV_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSJPN_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSCCK_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSSB_LIBNAME)
else
ifeq ($(OS_ARCH), SunOS)
ifdef SOLARIS_USE_FORTE6
SOLARIS_CXX_LIB=Crun
else
ifeq ($(OS_RELEASE),5.6)
SOLARIS_CXX_LIB=C
else
SOLARIS_CXX_LIB=Crun
endif
endif
EXTRA_LIBS += $(LIBNLS_LIBDIR)/$(NSCNV_LIBNAME) -l$(SOLARIS_CXX_LIB) \
$(LIBNLS_LIBDIR)/$(NSJPN_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSCCK_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSSB_LIBNAME)
else
endif
EXTRA_LIBS += $(LIBNLS_LIBDIR)/$(NSCNV_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSJPN_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSCCK_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSSB_LIBNAME)
endif
endif
LDTOOLS_LIBS += $(EXTRA_LIBS)
LIBLOCATION = $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib
###########################################################################
all:: $(OBJDEST) linklibnls libdir $(BINS)
libdir: linklibnls
ifeq ($(OS_ARCH), WINNT)
$(NSINSTALL) $(LIBLOCATION)/$(LDAP_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(LIBLOCATION)/$(PRLDAP_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(LIBLOCATION)/$(SSLDAP_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
else
$(NSINSTALL) $(LIBLOCATION)/lib$(LDAP_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(LIBLOCATION)/lib$(PRLDAP_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(LIBLOCATION)/lib$(SSLDAP_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
endif
ifeq ($(COMPS_FROM_OBJDIR), 1)
ifeq ($(OS_ARCH), WINNT)
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(PLC_BASENAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(PLDS_BASENAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(NSPR_BASENAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(SSL_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(NSS_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
ifeq ($(NSS_DYNAMIC_SOFTOKN),1)
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/$(SOFTOKN_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
endif
else
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/lib$(PLC_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/lib$(PLDS_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/lib$(NSPR_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/lib$(SSL_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/lib$(NSS_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
ifeq ($(NSS_DYNAMIC_SOFTOKN),1)
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/lib$(SOFTOKN_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
endif
endif
ifeq ($(COPYFREEBL), 1)
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/lib$(HYBRID_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib/lib$(PURE32_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
endif
else
ifeq ($(OS_ARCH), WINNT)
$(NSINSTALL) $(NSCP_DISTDIR)/lib/$(PLC_BASENAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/lib/$(PLDS_BASENAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/lib/$(NSPR_BASENAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/lib/$(SSL_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/lib/$(NSS_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
ifeq ($(NSS_DYNAMIC_SOFTOKN),1)
$(NSINSTALL) $(NSCP_DISTDIR)/lib/$(SOFTOKN_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
endif
else
$(NSINSTALL) $(NSCP_DISTDIR)/lib/lib$(PLC_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/lib/lib$(PLDS_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/lib/lib$(NSPR_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/lib/lib$(SSL_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/lib/lib$(NSS_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
ifeq ($(NSS_DYNAMIC_SOFTOKN),1)
$(NSINSTALL) $(NSCP_DISTDIR)/lib/lib$(SOFTOKN_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
endif
endif
ifeq ($(COPYFREEBL), 1)
$(NSINSTALL) $(NSCP_DISTDIR)/lib/lib$(HYBRID_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
$(NSINSTALL) $(NSCP_DISTDIR)/lib/lib$(PURE32_LIBNAME).$(DLL_SUFFIX) $(LIBDIR)
endif
endif
linklibnls: FORCE
ifneq ($(COMPONENT_PULL_METHOD), FTP)
ifeq ($(HAVE_LIBNLS), 1)
$(RM) -f $(LIBNLS_INCLUDES)
$(RM) -f $(LIBNLS_LIBDIR)
ln -s $(LIBNLS_INCLUDES_LOC) $(LIBNLS_INCLUDES)
ln -s $(LIBNLS_LIB_LOC) $(LIBNLS_LIBDIR)
endif
else
ifeq ($(HAVE_LIBNLS), 1)
@echo "Pulling libnls......"
# The following shell script recalculates $(NLS_INCLUDE), $(NLS_LIBPATH) and
# $(NLS_VERSION_FILE)
sh ../../build/compver.sh $(LIBNLS_DIR) $(LIBNLS_RELDATE) \
$(OBJDIR_NAME) ../../../../dist ldapsdk \
$(LIBNLS_RELEASE_TREE)/libnls$(NLS_LIBVERSION)/$(LIBNLS_RELDATE)/$(OBJDIR_NAME) \
libnls$(NLS_LIBVERSION) \
"include lib conv$(NLS_LIBVERSION) locale$(NLS_LIBVERSION)" \
../../../../../dist/libnls$(NLS_LIBVERSION)/$(OBJDIR_NAME)/locale$(NLS_LIBVERSION)/index.txt
endif
endif
$(LDAPTOOLCOMMON_OBJ):
$(LDAPTOOLCPPCOMMON_OBJ):
$(LDAPCOMPARE): $(LDAPCOMPARE_OBJ) $(LDAPTOOLCOMMON_OBJ) \
$(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
$(LINK_EXE) $(LDAPCOMPARE_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS)
$(LDAPDELETE): $(LDAPDELETE_OBJ) $(LDAPTOOLCOMMON_OBJ) \
$(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
$(LINK_EXE) $(LDAPDELETE_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS)
$(LDAPMODIFY): $(LDAPMODIFY_OBJ) $(LDAPTOOLCOMMON_OBJ) \
$(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
$(LINK_EXE) $(LDAPMODIFY_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS)
$(LDAPSEARCH): $(LDAPSEARCH_OBJ) $(LDAPTOOLCOMMON_OBJ) \
$(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
$(LINK_EXE) $(LDAPSEARCH_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS)
$(LDAPCMP): $(LDAPCMP_OBJ) $(LDAPTOOLCOMMON_OBJ) \
$(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
$(LINK_EXE) $(LDAPCMP_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS)
$(OBJDEST):
$(NSINSTALL) -D $(OBJDEST)
$(NSINSTALL) -D $(BINDIR)
$(NSINSTALL) -D $(LIBDIR)
clean::
$(RM) -rf $(OBJDEST)
install:: $(OBJDEST) libdir $(BINS)
$(NSINSTALL) $(LDAPDELETE) $(INSTALLDIR)
$(NSINSTALL) $(LDAPSEARCH) $(INSTALLDIR)
$(NSINSTALL) $(LDAPMODIFY) $(INSTALLDIR)
$(NSINSTALL) $(LDAPCOMPARE) $(INSTALLDIR)
$(NSINSTALL) $(LDAPCMP) $(INSTALLDIR)
#
# Simple, local dependencies
#
LDAPTOOL_COMMON_DEPS = ldaptool.h Makefile.client
$(LDAPTOOLCOMMON_OBJ): $(LDAPTOOL_COMMON_DEPS)
$(LDAPDELETE_OBJ): $(LDAPTOOL_COMMON_DEPS)
$(LDAPMODIFY_OBJ): $(LDAPTOOL_COMMON_DEPS) fileurl.h
$(LDAPSEARCH_OBJ): $(LDAPTOOL_COMMON_DEPS) fileurl.h
$(LDAPCOMPARE_OBJ): $(LDAPTOOL_COMMON_DEPS)
$(LDAPCMP_OBJ): $(LDAPTOOL_COMMON_DEPS)
FORCE:

View File

@@ -1,307 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-1999
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MOD_DEPTH = ../../..
srcdir = @srcdir@
topsrcdir = @top_srcdir@
NSPR_LIBS = @NSPR_LIBS@
NSPR_CFLAGS = @NSPR_CFLAGS@
NSS_LIBS = @NSS_LIBS@
NSS_CFLAGS = @NSS_CFLAGS@
SVRCORE_LIBS = @SVRCORE_LIBS@
SVRCORE_CFLAGS = @SVRCORE_CFLAGS@
include $(MOD_DEPTH)/config/autoconf.mk
include $(topsrcdir)/build.mk
INSTALLDIR = $(DIST)/$(OBJDIR_NAME)/bin
INCLUDES += $(NSS_CFLAGS) \
$(NSPR_CFLAGS) \
-I$(DIST)/public/ldap \
-I$(topsrcdir)/ldap/include
#ifeq ($(HAVE_CCONF), 1)
#COMPS_FROM_OBJDIR=1
#endif
#
# The "arg pin" feature depends on the server core library.
#
ifeq ($(HAVE_SVRCORE), 1)
LDAP_TOOL_ARGPIN=1
endif
ifeq ($(LDAP_TOOL_ARGPIN),1)
INCLUDES += $(SVRCORE_CFLAGS)
DEFS+=-DLDAP_TOOL_ARGPIN -DLDAP_TOOL_PKCS11
endif
ifdef HAVE_LIBNLS
INCLUDES += -I$(LIBNLS_INCLUDES)
endif
ifeq ($(OS_ARCH), WINNT)
DEFS += -DXP_WIN -DXP_WIN32
endif
DEFINES += $(DEFS)
CXXSRCS = convutf8.cpp
OBJDEST = $(OBJDIR_NAME)
BINDIR = $(OBJDIR_NAME)/bin
LIBDIR = $(OBJDIR_NAME)/lib
ifeq ($(OS_ARCH), WINNT)
LDAPDELETE_OBJ = $(addprefix $(OBJDEST)/, ldapdelete.obj)
LDAPMODIFY_OBJ = $(addprefix $(OBJDEST)/, ldapmodify.obj)
LDAPSEARCH_OBJ = $(addprefix $(OBJDEST)/, ldapsearch.obj)
LDAPCOMPARE_OBJ = $(addprefix $(OBJDEST)/, ldapcompare.obj)
LDAPCMP_OBJ = $(addprefix $(OBJDEST)/, ldapcmp.obj)
LDAPTOOLCOMMON_OBJ = $(addprefix $(OBJDEST)/, common.obj) \
$(addprefix $(OBJDEST)/, convutf8.obj) \
$(addprefix $(OBJDEST)/, fileurl.obj)
ifeq ($(LDAP_TOOL_ARGPIN),1)
LDAPTOOLCOMMON_OBJ += $(addprefix $(OBJDEST)/, argpin.obj) \
$(addprefix $(OBJDEST)/, ntuserpin.obj)
endif
else
LDAPDELETE_OBJ = $(addprefix $(OBJDEST)/, ldapdelete.o)
LDAPMODIFY_OBJ = $(addprefix $(OBJDEST)/, ldapmodify.o)
LDAPSEARCH_OBJ = $(addprefix $(OBJDEST)/, ldapsearch.o)
LDAPCOMPARE_OBJ = $(addprefix $(OBJDEST)/, ldapcompare.o)
LDAPCMP_OBJ = $(addprefix $(OBJDEST)/, ldapcmp.o)
ifeq ($(OS_ARCH), HP-UX)
LDAPTOOLCOMMON_OBJ = $(addprefix $(OBJDEST)/, common.o) \
$(addprefix $(OBJDEST)/, fileurl.o)
else
LDAPTOOLCOMMON_OBJ = $(addprefix $(OBJDEST)/, common.o) \
$(addprefix $(OBJDEST)/, convutf8.o) \
$(addprefix $(OBJDEST)/, fileurl.o)
endif
ifeq ($(LDAP_TOOL_ARGPIN),1)
LDAPTOOLCOMMON_OBJ += $(addprefix $(OBJDEST)/, argpin.o) \
$(addprefix $(OBJDEST)/, ntuserpin.o)
endif
endif
ifeq ($(OS_ARCH), HP-UX)
LDAPTOOLCPPCOMMON_OBJ = $(addprefix $(OBJDEST)/, convutf8.o)
endif
CLIENT_OBJS= $(LDAPDELETE_OBJ) $(LDAPMODIFY_OBJ) \
$(LDAPSEARCH_OBJ) $(LDAPCOMPARE_OBJ) $(LDAPCMP_OBJ) $(LDAPTOOLCOMMON_OBJ)
# For 'clean' target:
TARGETS=$(BINDIR) $(LIBDIR) $(CLIENT_OBJS)
LDAPDELETE = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapdelete))
LDAPMODIFY = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapmodify))
LDAPSEARCH = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapsearch))
LDAPCOMPARE = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapcompare))
LDAPCMP = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapcmp))
BINS= $(LDAPDELETE) $(LDAPMODIFY) $(LDAPSEARCH) $(LDAPCOMPARE) $(LDAPCMP)
LDAPTOOLS_NSS_LINK=$(NSSLINK)
# set common libs for all platforms
ifeq ($(OS_ARCH), WINNT)
EXTRA_LIBS = $(DIST)/$(OBJDIR_NAME)/lib/$(SSLDAP_LIBNAME).lib
EXTRA_LIBS += $(DIST)/$(OBJDIR_NAME)/lib/$(PRLDAP_LIBNAME).lib
EXTRA_LIBS += $(DIST)/$(OBJDIR_NAME)/lib/$(LDAP_LIBNAME).lib
EXTRA_LIBS += $(DIST)/$(OBJDIR_NAME)/lib/$(LBER_LIBNAME).lib
EXTRA_LIBS += $(DIST)/$(OBJDIR_NAME)/lib/$(LDIF_LIBNAME).lib
EXTRA_LIBS += $(DIST)/$(OBJDIR_NAME)/lib/$(UTIL_LIBNAME).lib
EXTRA_LIBS += $(SVRCORE_LINK)
EXTRA_LIBS += $(NSSLINK)
EXTRA_LIBS += $(NSPRLINK)
else
# ordering appears to be important, at least on some platforms with some
# linkers
EXTRA_LIBS = -L$(DIST)/$(OBJDIR_NAME)/lib -l$(SSLDAP_LIBNAME) \
-l$(PRLDAP_LIBNAME) -l$(LDAP_LIBNAME) -l$(LDIF_LIBNAME) \
-L$(DIST)/lib $(SVRCORE_LINK) $(LDAPTOOLS_NSS_LINK) $(NSPRLINK)
endif
# set platform specific libs
ifeq ($(OS_ARCH), SunOS)
PLATFORMLIBS=-lthread -lposix4 -lsocket -lnls \
-ldl -lresolv -lgen
endif
ifeq ($(OS_ARCH), WINNT)
PLATFORMLIBS =wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
rpcrt4.lib uuid.lib winmm.lib
endif
ifeq ($(OS_ARCH), OSF1)
PLATFORMLIBS = -lcxx -lpthread -lrt -lmach -lexc
endif
ifeq ($(OS_ARCH), Linux)
PLATFORMLIBS=-ldl -lresolv -lpthread
endif
ifeq ($(OS_ARCH), HP-UX)
PLATFORMLIBS = -ldld -lm -lpthread -lrt
endif
ifeq ($(OS_ARCH), AIX)
PLATFORMLIBS=-ldl -brtl -lpthreads -lc_r -lm
endif
ifeq ($(OS_ARCH), Darwin)
PLATFORMLIBS=-liconv
endif
ifdef HAVE_LIBNLS
ifeq ($(OS_ARCH), WINNT)
EXTRA_LIBS += $(LIBNLS_LIBDIR)/$(NSCNV_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSJPN_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSCCK_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSSB_LIBNAME)
else
ifeq ($(OS_ARCH), SunOS)
ifdef SOLARIS_USE_FORTE6
SOLARIS_CXX_LIB=Crun
else
ifeq ($(OS_RELEASE),5.6)
SOLARIS_CXX_LIB=C
else
SOLARIS_CXX_LIB=Crun
endif
endif
EXTRA_LIBS += $(LIBNLS_LIBDIR)/$(NSCNV_LIBNAME) -l$(SOLARIS_CXX_LIB) \
$(LIBNLS_LIBDIR)/$(NSJPN_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSCCK_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSSB_LIBNAME)
else
endif
EXTRA_LIBS += $(LIBNLS_LIBDIR)/$(NSCNV_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSJPN_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSCCK_LIBNAME) \
$(LIBNLS_LIBDIR)/$(NSSB_LIBNAME)
endif
endif
include $(topsrcdir)/config/rules.mk
###########################################################################
all:: $(OBJDEST) linklibnls libdir $(BINS)
libdir: linklibnls
linklibnls: FORCE
ifneq ($(COMPONENT_PULL_METHOD), FTP)
ifeq ($(HAVE_LIBNLS), 1)
$(RM) -f $(LIBNLS_INCLUDES)
$(RM) -f $(LIBNLS_LIBDIR)
ln -s $(LIBNLS_INCLUDES_LOC) $(LIBNLS_INCLUDES)
ln -s $(LIBNLS_LIB_LOC) $(LIBNLS_LIBDIR)
endif
else
ifeq ($(HAVE_LIBNLS), 1)
@echo "Pulling libnls......"
# The following shell script recalculates $(NLS_INCLUDE), $(NLS_LIBPATH) and
# $(NLS_VERSION_FILE)
sh ../../build/compver.sh $(LIBNLS_DIR) $(LIBNLS_RELDATE) \
$(OBJDIR_NAME) ../../../../dist ldapsdk \
$(LIBNLS_RELEASE_TREE)/libnls$(NLS_LIBVERSION)/$(LIBNLS_RELDATE)/$(OBJDIR_NAME) \
libnls$(NLS_LIBVERSION) \
"include lib conv$(NLS_LIBVERSION) locale$(NLS_LIBVERSION)" \
../../../../../dist/libnls$(NLS_LIBVERSION)/$(OBJDIR_NAME)/locale$(NLS_LIBVERSION)/index.txt
endif
endif
$(LDAPTOOLCOMMON_OBJ):
ifeq ($(OS_ARCH), HP-UX)
$(LDAPTOOLCPPCOMMON_OBJ): convutf8.cpp
else
$(LDAPTOOLCPPCOMMON_OBJ):
endif
$(LDAPCOMPARE): $(LDAPCOMPARE_OBJ) $(LDAPTOOLCOMMON_OBJ) \
$(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
$(LINK_EXE)
$(LDAPDELETE): $(LDAPDELETE_OBJ) $(LDAPTOOLCOMMON_OBJ) \
$(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
$(LINK_EXE)
$(LDAPMODIFY): $(LDAPMODIFY_OBJ) $(LDAPTOOLCOMMON_OBJ) \
$(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
$(LINK_EXE)
$(LDAPSEARCH): $(LDAPSEARCH_OBJ) $(LDAPTOOLCOMMON_OBJ) \
$(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
$(LINK_EXE)
$(LDAPCMP): $(LDAPCMP_OBJ) $(LDAPTOOLCOMMON_OBJ) \
$(LDAPTOOLCPPCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
$(LINK_EXE)
$(OBJDEST): FORCE
$(NSINSTALL) -D $(OBJDEST)
$(NSINSTALL) -D $(BINDIR)
$(NSINSTALL) -D $(LIBDIR)
export:: $(OBJDEST) libdir $(BINS)
$(NSINSTALL) $(LDAPDELETE) $(INSTALLDIR)
$(NSINSTALL) $(LDAPSEARCH) $(INSTALLDIR)
$(NSINSTALL) $(LDAPMODIFY) $(INSTALLDIR)
$(NSINSTALL) $(LDAPCOMPARE) $(INSTALLDIR)
$(NSINSTALL) $(LDAPCMP) $(INSTALLDIR)
#
# Simple, local dependencies
#
LDAPTOOL_COMMON_DEPS = ldaptool.h Makefile
$(LDAPTOOLCOMMON_OBJ): $(LDAPTOOL_COMMON_DEPS)
$(LDAPDELETE_OBJ): $(LDAPTOOL_COMMON_DEPS)
$(LDAPMODIFY_OBJ): $(LDAPTOOL_COMMON_DEPS) fileurl.h
$(LDAPSEARCH_OBJ): $(LDAPTOOL_COMMON_DEPS) fileurl.h
$(LDAPCOMPARE_OBJ): $(LDAPTOOL_COMMON_DEPS)
$(LDAPCMP_OBJ): $(LDAPTOOL_COMMON_DEPS)
FORCE:

View File

@@ -1,96 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1996-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
Summary of options used by the LDAP tools
Updated 1-April-2003 by Mark Smith <mcs@netscape.com>
Only single letter options in the sets [0-9], [A-Z], and [a-z] are
listed.
The "raw" lists are taken from the calls to getopt() and
ldaptool_process_args().
The "sorted" lists are just that -- sorted versions of the raw list.
The "all" lists include options from common.c as well as the tool-specific
options.
The "avail" lists included options that are available for use.
common.c (supported by all of the tools):
raw: gnvEMRHZ0d:D:f:h:I:j:K:N:O:P:p:Q:W:w:V:X:m:i:k:y:Y:J:
sorted: 0 DEHIJKMNOPQRVWXYZ dfghijkmnpvwy
avail: 2 [4-9] (not used by any of the tools)
ldapcmp.c:
raw: Bb:l:s:z:
sorted: B blsz
all: 0 BDEHIJKMNOPQRVWXYZ bdfghijklmnpsvwyz
avail: [12] [4-9] ACFGLSTU aceoqrtux
ldapcompare.c:
raw: cq
sorted: cq
all: 0 DEHIJKMNOPQRVWXYZ cdfghijkmnpqvwy
avail: [12] [4-9] ABCFGLSTU abelorstuxz
ldapdelete.c (deprecated)
raw: c
sorted: c
all: 0 DEHIJKMNOPQRVWXYZ cdfghijkmnpvwy
avail: [12] [4-9] ABCFGLSTU abeloqrstuxz
ldapmodify.c
raw: aAbcFe:B:q
sorted: ABF abceq
all: 0 ABDEFHIJKMNOPQRVWXYZ abcdefghijkmnpqvwy
avail: [12] [4-9] CGLSTU lorstuxz
ldapmodrdn.c (deprecated)
raw: cr
sorted: cr
all: 0 DEHIJKMNOPQRVWXYZ cdfghijklmnprvwy
avail: [12] [4-9] ABCFGLSTU abeloqstuxz
ldapsearch.c
raw: ABLTU1eortuxa:b:F:G:l:S:s:z:C:
sorted: 1 ABCFGLSTU abeorstuxz
all: 01 ABCDEFGHIJKLMNOPQRSTUVWXYZ abdefghijklmnoprstuvwxyz
avail: 2 [4-9] cq

View File

@@ -1,164 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/******************************************************
*
* argpin.c - Returns pin for token specified in a
* command line paramenter.
*
******************************************************/
#include <stdio.h>
#include <string.h>
#include "argpin.h"
struct SVRCOREArgPinObj
{
SVRCOREPinObj base;
char *tokenName;
char *password;
SVRCOREPinObj *alt;
};
static const struct SVRCOREPinMethods vtable;
/* XXXceb these are two hacks to fix a problem with the debug builds
* of svrcore. With the optimizer turned off, there is a situation
* in user.c, where these two functions need to be available for the
* linker (they are imported, and no lib exports them, since they are
* declared static on XP_UNIX platforms) The short term hack solution
* is to define them here. Yeah, it is ugly but, it will need to be
* here, until a new version of svrcore is done.
*/
/*ARGSUSED*/
void echoOff(int fd)
{
}
/*ARGSUSED*/
void echoOn(int fd)
{
}
/* ------------------------------------------------------------ */
SVRCOREError
SVRCORE_CreateArgPinObj(SVRCOREArgPinObj **out, const char * tokenName, const char *password, SVRCOREPinObj *pinObj)
{
SVRCOREError err = 0;
SVRCOREArgPinObj *obj = 0;
do {
obj = (SVRCOREArgPinObj*)malloc(sizeof (SVRCOREArgPinObj));
if (!obj) { err = 1; break; }
obj->base.methods = &vtable;
obj->tokenName=NULL;
obj->password=NULL;
obj->alt=pinObj;
if ( tokenName == NULL) {
PK11SlotInfo *slot = PK11_GetInternalKeySlot();
obj->tokenName = strdup(PK11_GetTokenName(slot));
PK11_FreeSlot(slot);
}
else
{
obj->tokenName = strdup(tokenName);
}
if (obj->tokenName == NULL) { err = 1; break; }
obj->password = strdup(password);
if (obj->password == NULL) { err = 1; break; }
} while(0);
if (err)
{
SVRCORE_DestroyArgPinObj(obj);
obj = 0;
}
*out = obj;
return err;
}
void
SVRCORE_DestroyArgPinObj(SVRCOREArgPinObj *obj)
{
if (obj->tokenName) free(obj->tokenName);
if (obj->password)
{
memset(obj->password, 0, strlen(obj->password));
free(obj->password);
}
if (obj) free(obj);
}
static void destroyObject(SVRCOREPinObj *obj)
{
SVRCORE_DestroyArgPinObj((SVRCOREArgPinObj*)obj);
}
static char *getPin(SVRCOREPinObj *obj, const char *tokenName, PRBool retry)
{
SVRCOREArgPinObj *p = (SVRCOREArgPinObj*)obj;
if (tokenName == NULL) return NULL;
/* On first attempt, return the password if the token name
* matches.
*/
if (!retry && strcmp(p->tokenName, tokenName) == 0)
{
return strdup(p->password);
}
if (p->alt != NULL) return SVRCORE_GetPin(p->alt, tokenName, retry);
return (NULL);
}
/*
* VTable
*/
static const SVRCOREPinMethods vtable =
{ 0, 0, destroyObject, getPin };

View File

@@ -1,51 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __ARGPIN_H__
#define __ARGPIN_H__
#include <svrcore.h>
typedef struct SVRCOREArgPinObj SVRCOREArgPinObj;
SVRCOREError
SVRCORE_CreateArgPinObj(SVRCOREArgPinObj **out, const char * tokenName, const char *password, SVRCOREPinObj *pinObj);
void
SVRCORE_DestroyArgPinObj(SVRCOREArgPinObj *obj);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,810 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifdef _WIN32
#define VC_EXTRALEAN
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <tchar.h>
#include <winnls.h>
static char *win_char_converter(const char *instr, int bFromUTF8);
#else
#include <locale.h>
#endif
#include "ldaptool.h"
#ifndef HAVE_LIBNLS
#ifndef _WIN32
#include <iconv.h>
#include <langinfo.h> /* for nl_langinfo() */
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Alternative names for the UTF-8 character set. Both of these (_A and _B)
* are accepted as meaning UTF-8 on all platforms.
*/
#define LDAPTOOL_CHARSET_UTF8_A "utf8"
#define LDAPTOOL_CHARSET_UTF8_B "UTF-8"
/*
* OS name for UTF-8.
*/
#if defined(_HPUX_SOURCE)
#define LDAPTOOL_CHARSET_UTF8_OSNAME LDAPTOOL_CHARSET_UTF8_A /* HP/UX */
#else
#define LDAPTOOL_CHARSET_UTF8_OSNAME LDAPTOOL_CHARSET_UTF8_B /* all others */
#endif
/* OS name for the default character set */
#if defined(_HPUX_SOURCE)
#define LDAPTOOL_CHARSET_DEFAULT "roma8" /* HP/UX */
#elif defined(__GLIBC__)
#define LDAPTOOL_CHARSET_DEFAULT "US-ASCII" /* glibc (Linux) */
#elif defined(_WIN32)
#define LDAPTOOL_CHARSET_DEFAULT "windows-1252" /* Windows */
#define LDAPTOOL_CHARSET_WINANSI "ANSI" /* synonym */
#else
#define LDAPTOOL_CHARSET_DEFAULT "646" /* all others */
#endif
/* Type used for the src parameter to iconv() (the 2nd parameter) */
#if defined(_HPUX_SOURCE) || defined(__GLIBC__)
#define LDAPTOOL_ICONV_SRC_TYPE char ** /* HP/UX and glibc (Linux) */
#else
#define LDAPTOOL_ICONV_SRC_TYPE const char ** /* all others */
#endif
#if defined(SOLARIS)
/*
* On some versions of Solaris, the inbytesleft parameter can't be NULL
* even in calls to iconv() where inbuf itself is NULL
*/
#define LDAPTOOL_ICONV_NO_NULL_INBYTESLEFT 1
#endif
static char *convert_to_utf8( const char *src_charset, const char *src );
static const char *GetCurrentCharset(void);
/* Version that uses OS functions */
char *
ldaptool_local2UTF8( const char *src, const char *desc )
{
static const char *src_charset = NULL;
char *utf8;
if ( src == NULL ) { /* trivial case # 1 */
utf8 = NULL;
} else if ( *src == '\0' ) { /* trivial case # 2 */
utf8 = strdup( "" );
} else {
/* Determine the source charset if not already done */
if ( NULL == src_charset ) {
if ( NULL != ldaptool_charset
&& 0 != strcmp( ldaptool_charset, "" )) {
src_charset = ldaptool_charset;
} else {
src_charset = GetCurrentCharset();
}
}
if ( NULL != src_charset &&
( 0 == strcasecmp( LDAPTOOL_CHARSET_UTF8_A, src_charset ) ||
0 == strcasecmp( LDAPTOOL_CHARSET_UTF8_B, src_charset ))) {
/* no conversion needs to be done */
return strdup( src );
}
utf8 = convert_to_utf8( src_charset, src ); /* the real deal */
if ( NULL == utf8 ) {
utf8 = strdup( src ); /* fallback: no conversion */
fprintf( stderr, "%s: warning: no conversion of %s to "
LDAPTOOL_CHARSET_UTF8_OSNAME "\n",
ldaptool_progname, desc );
}
}
return utf8;
}
#ifdef _WIN32
/*
* Try to convert src to a UTF-8.
* Returns a malloc'd string or NULL upon error (with messages logged).
* src should not be NULL.
*/
static char *
convert_to_utf8( const char *src_charset, const char *src )
{
if (NULL != src_charset
&& 0 != strcasecmp( LDAPTOOL_CHARSET_DEFAULT, src_charset )
&& 0 != strcasecmp( LDAPTOOL_CHARSET_WINANSI, src_charset )) {
fprintf( stderr, "%s: conversion from %s to %s is not supported\n",
ldaptool_progname, src_charset,
LDAPTOOL_CHARSET_UTF8_OSNAME );
return NULL;
}
return win_char_converter( src, FALSE );
}
/* returns a malloc'd string */
static const char *
GetCurrentCharset(void)
{
/* Our concept of "locale" is very simple on Windows.... */
return strdup( LDAPTOOL_CHARSET_DEFAULT );
}
#else /* _WIN32 */
/*
* Try to convert src to a UTF-8.
* Returns a malloc'd string or NULL upon error (with messages logged).
* src should not be NULL.
*/
static char *
convert_to_utf8( const char *src_charset, const char *src )
{
iconv_t convdesc;
char *outbuf, *curoutbuf;
size_t inbytesleft, outbytesleft;
#ifdef LDAPTOOL_ICONV_NO_NULL_INBYTESLEFT
#define LDAPTOOL_ICONV_UNUSED_INBYTESLEFT &inbytesleft
#else
#define LDAPTOOL_ICONV_UNUSED_INBYTESLEFT NULL
#endif
/* Get a converter */
convdesc = iconv_open( LDAPTOOL_CHARSET_UTF8_OSNAME, src_charset );
if ( (iconv_t)-1 == convdesc ) {
if ( errno == EINVAL ) {
fprintf( stderr, "%s: conversion from %s to %s is not supported\n",
ldaptool_progname, src_charset,
LDAPTOOL_CHARSET_UTF8_OSNAME );
} else {
perror( src_charset );
}
return NULL;
}
/* Allocate room for the UTF-8 equivalent (maximum expansion = 6 times) */
/* XXX is that correct? */
inbytesleft = strlen( src );
outbytesleft = 6 * inbytesleft + 1;
if ( NULL == ( outbuf = (char *)malloc( outbytesleft ))) {
perror( "convert_to_utf8 - malloc" );
iconv_close( convdesc );
return NULL;
}
curoutbuf = outbuf;
/*
* Three steps for a good conversion:
* 1) Insert the initial shift sequence if any.
* 2) Convert our characters.
* 3) Insert the closing shift sequence, if any.
*/
if ( (size_t)-1 == iconv( convdesc,
( LDAPTOOL_ICONV_SRC_TYPE )0, LDAPTOOL_ICONV_UNUSED_INBYTESLEFT,
&curoutbuf, &outbytesleft ) /* initial shift seq. */
|| (size_t)-1 == iconv( convdesc,
( LDAPTOOL_ICONV_SRC_TYPE ) &src, &inbytesleft,
&curoutbuf, &outbytesleft ) /* convert our chars. */
|| (size_t)-1 == iconv( convdesc,
( LDAPTOOL_ICONV_SRC_TYPE )0, LDAPTOOL_ICONV_UNUSED_INBYTESLEFT,
&curoutbuf, &outbytesleft )) { /* closing shift seq. */
perror( "convert_to_utf8 - iconv" );
iconv_close( convdesc );
free( outbuf );
return NULL;
}
iconv_close( convdesc );
*curoutbuf = '\0'; /* zero-terminate the resulting string */
return outbuf;
}
/* returns a malloc'd string */
static const char *
GetCurrentCharset(void)
{
static char *locale = NULL;
const char *charset;
if ( NULL == locale ) {
locale = setlocale(LC_CTYPE, ""); /* need to call this once */
}
charset = nl_langinfo( CODESET );
if ( NULL == charset || '\0' == *charset ) {
charset = LDAPTOOL_CHARSET_DEFAULT;
}
return strdup( charset );
}
#endif /* else _WIN32 */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* !HAVE_LIBNLS */
#ifdef _WIN32
/* returns a malloc'd string */
static char *
win_char_converter(const char *instr, int bFromUTF8)
{
char *outstr = NULL;
int inlen, wclen, outlen;
LPWSTR wcstr;
if (instr == NULL)
return NULL;
if ((inlen = strlen(instr)) <= 0)
return NULL;
/* output never becomes longer than input, XXXmcs: really true?
** thus we don't have to ask for the length
*/
wcstr = (LPWSTR) malloc( sizeof( WCHAR ) * (inlen+1) );
if (!wcstr)
return NULL;
wclen = MultiByteToWideChar(bFromUTF8 ? CP_UTF8 : CP_ACP, 0, instr,
inlen, wcstr, inlen);
outlen = WideCharToMultiByte(bFromUTF8 ? CP_ACP : CP_UTF8, 0, wcstr,
wclen, NULL, 0, NULL, NULL);
if (outlen > 0) {
outstr = (char *) malloc(outlen + 2);
outlen = WideCharToMultiByte(bFromUTF8 ? CP_ACP : CP_UTF8, 0, wcstr,
wclen, outstr, outlen, NULL, NULL);
if (outlen > 0)
*(outstr+outlen) = _T('\0');
else
return NULL;
}
free( wcstr );
return outstr;
}
#endif /* _WIN32 */
#ifdef HAVE_LIBNLS
#define NSPR20
static int charsetset = 0;
#ifndef _WIN32
char * GetNormalizedLocaleName(void);
#include "unistring.h"
#include "nlsenc.h"
extern NLS_StaticConverterRegistry _STATICLINK_NSJPN_;
extern NLS_StaticConverterRegistry _STATICLINK_NSCCK_;
extern NLS_StaticConverterRegistry _STATICLINK_NSSB_;
/* returns a malloc'd string */
static char *
GetNormalizedLocaleName(void)
{
#ifdef _HPUX_SOURCE
int len;
char *locale;
locale = setlocale(LC_CTYPE, "");
if (locale && *locale) {
len = strlen(locale);
} else {
locale = "C";
len = 1;
}
if ((!strncmp(locale, "/\x03:", 3)) &&
(!strcmp(&locale[len - 2], ";/"))) {
locale += 3;
len -= 5;
}
locale = strdup(locale);
if (locale) {
locale[len] = 0;
}
return locale;
#else
char *locale;
locale = setlocale(LC_CTYPE, "");
if (locale && *locale) {
return strdup(locale);
}
return strdup("C");
#endif
}
#if defined(IRIX)
const char *CHARCONVTABLE[] =
{
"! This table maps the host's locale names to LIBNLS charsets",
"!",
"C: ISO_8859-1:1987",
"cs: ISO_8859-2:1987",
"da: ISO_8859-1:1987",
"de: ISO_8859-1:1987",
"de_AT: ISO_8859-1:1987",
"de_CH: ISO_8859-1:1987",
"en: ISO_8859-1:1987",
"en_AU: ISO_8859-1:1987",
"en_CA: ISO_8859-1:1987",
"en_TH: ISO_8859-1:1987",
"en_US: ISO_8859-1:1987",
"es: ISO_8859-1:1987",
"fi: ISO_8859-1:1987",
"fr: ISO_8859-1:1987",
"fr_BE: ISO_8859-1:1987",
"fr_CA: ISO_8859-1:1987",
"fr_CH: ISO_8859-1:1987",
"is: ISO_8859-1:1987",
"it: ISO_8859-1:1987",
"it_CH: ISO_8859-1:1987",
"ja_JP.EUC: Extended_UNIX_Code_Packed_Format_for_Japanese",
"ko_KR.euc: EUC-KR",
"nl: ISO_8859-1:1987",
"nl_BE: ISO_8859-1:1987",
"no: ISO_8859-1:1987",
"pl: ISO_8859-2:1987",
"pt: ISO_8859-1:1987",
"sh: ISO_8859-2:1987",
"sk: ISO_8859-2:1987",
"sv: ISO_8859-1:1987",
"zh_CN.ugb: GB2312",
"zh_TW.ucns: cns11643_1",
NULL
};
#elif defined(SOLARIS)
const char *CHARCONVTABLE[] =
{
"! This table maps the host's locale names to LIBNLS charsets",
"!",
"C: ISO_8859-1:1987",
"ja: Extended_UNIX_Code_Packed_Format_for_Japanese",
"ja_JP.EUC: Extended_UNIX_Code_Packed_Format_for_Japanese",
"ja_JP.PCK: Shift_JIS",
"en: ISO_8859-1:1987",
"en_AU: ISO_8859-1:1987",
"en_CA: ISO_8859-1:1987",
"en_UK: ISO_8859-1:1987",
"en_US: ISO_8859-1:1987",
"es: ISO_8859-1:1987",
"es_AR: ISO_8859-1:1987",
"es_BO: ISO_8859-1:1987",
"es_CL: ISO_8859-1:1987",
"es_CO: ISO_8859-1:1987",
"es_CR: ISO_8859-1:1987",
"es_EC: ISO_8859-1:1987",
"es_GT: ISO_8859-1:1987",
"es_MX: ISO_8859-1:1987",
"es_NI: ISO_8859-1:1987",
"es_PA: ISO_8859-1:1987",
"es_PE: ISO_8859-1:1987",
"es_PY: ISO_8859-1:1987",
"es_SV: ISO_8859-1:1987",
"es_UY: ISO_8859-1:1987",
"es_VE: ISO_8859-1:1987",
"fr: ISO_8859-1:1987",
"fr_BE: ISO_8859-1:1987",
"fr_CA: ISO_8859-1:1987",
"fr_CH: ISO_8859-1:1987",
"de: ISO_8859-1:1987",
"de_AT: ISO_8859-1:1987",
"de_CH: ISO_8859-1:1987",
"nl: ISO_8859-1:1987",
"nl_BE: ISO_8859-1:1987",
"it: ISO_8859-1:1987",
"sv: ISO_8859-1:1987",
"no: ISO_8859-1:1987",
"da: ISO_8859-1:1987",
"iso_8859_1: ISO_8859-1:1987",
"japanese: Extended_UNIX_Code_Packed_Format_for_Japanese",
"ko: EUC-KR",
"zh: GB2312",
"zh_TW: cns11643_1",
NULL
};
#elif defined(OSF1)
const char *CHARCONVTABLE[] =
{
"! This table maps the host's locale names to LIBNLS charsets",
"!",
"C: ISO_8859-1:1987",
"cs_CZ.ISO8859-2: ISO_8859-2:1987",
"cs_CZ: ISO_8859-2:1987",
"da_DK.ISO8859-1: ISO_8859-1:1987",
"de_CH.ISO8859-1: ISO_8859-1:1987",
"de_DE.ISO8859-1: ISO_8859-1:1987",
"en_GB.ISO8859-1: ISO_8859-1:1987",
"en_US.ISO8859-1: ISO_8859-1:1987",
"es_ES.ISO8859-1: ISO_8859-1:1987",
"fi_FI.ISO8859-1: ISO_8859-1:1987",
"fr_BE.ISO8859-1: ISO_8859-1:1987",
"fr_CA.ISO8859-1: ISO_8859-1:1987",
"fr_CH.ISO8859-1: ISO_8859-1:1987",
"fr_FR.ISO8859-1: ISO_8859-1:1987",
"hu_HU.ISO8859-2: ISO_8859-2:1987",
"hu_HU: ISO_8859-2:1987",
"is_IS.ISO8859-1: ISO_8859-1:1987",
"it_IT.ISO8859-1: ISO_8859-1:1987",
"ja_JP.SJIS: Shift_JIS",
"ja_JP.eucJP: Extended_UNIX_Code_Packed_Format_for_Japanese",
"ja_JP: Extended_UNIX_Code_Packed_Format_for_Japanese",
"ko_KR.eucKR: EUC-KR",
"ko_KR: EUC-KR",
"nl_BE.ISO8859-1: ISO_8859-1:1987",
"nl_NL.ISO8859-1: ISO_8859-1:1987",
"no_NO.ISO8859-1: ISO_8859-1:1987",
"pl_PL.ISO8859-2: ISO_8859-2:1987",
"pl_PL: ISO_8859-2:1987",
"pt_PT.ISO8859-1: ISO_8859-1:1987",
"sk_SK.ISO8859-2: ISO_8859-2:1987",
"sk_SK: ISO_8859-2:1987",
"sv_SE.ISO8859-1: ISO_8859-1:1987",
"zh_CN: GB2312",
"zh_HK.big5: Big5",
"zh_HK.eucTW: cns11643_1",
"zh_TW.big5: Big5",
"zh_TW.big5@chuyin: Big5",
"zh_TW.big5@radical: Big5",
"zh_TW.big5@stroke: Big5",
"zh_TW.eucTW: cns11643_1",
"zh_TW.eucTW@chuyin: cns11643_1",
"zh_TW.eucTW@radical: cns11643_1",
"zh_TW.eucTW@stroke: cns11643_1",
"zh_TW: cns11643_1",
NULL
};
#elif defined(HPUX)
const char *CHARCONVTABLE[] =
{
"! This table maps the host's locale names to LIBNLS charsets",
"!",
"C: ISO_8859-1:1987",
"ja_JP: Extended_UNIX_Code_Packed_Format_for_Japanese",
"ja_JP.SJIS: Shift_JIS",
"ja_JP.eucJP: Extended_UNIX_Code_Packed_Format_for_Japanese",
"es_ES: ISO_8859-1:1987",
"es_ES.iso88591: ISO_8859-1:1987",
"sv_SE: ISO_8859-1:1987",
"sv_SE.iso88591: ISO_8859-1:1987",
"da_DK: ISO_8859-1:1987",
"da_DK.iso88591: ISO_8859-1:1987",
"nl_NL: ISO_8859-1:1987",
"nl_NL.iso88591: ISO_8859-1:1987",
"en: ISO_8859-1:1987",
"en_GB: ISO_8859-1:1987",
"en_GB.iso88591: ISO_8859-1:1987",
"en_US: ISO_8859-1:1987",
"en_US.iso88591: ISO_8859-1:1987",
"fi_FI: ISO_8859-1:1987",
"fi_FI.iso88591: ISO_8859-1:1987",
"fr_CA: ISO_8859-1:1987",
"fr_CA.iso88591: ISO_8859-1:1987",
"fr_FR: ISO_8859-1:1987",
"fr_FR.iso88591: ISO_8859-1:1987",
"de_DE: ISO_8859-1:1987",
"de_DE.iso88591: ISO_8859-1:1987",
"is_IS: ISO_8859-1:1987",
"is_IS.iso88591: ISO_8859-1:1987",
"it_IT: ISO_8859-1:1987",
"it_IT.iso88591: ISO_8859-1:1987",
"no_NO: ISO_8859-1:1987",
"no_NO.iso88591: ISO_8859-1:1987",
"pt_PT: ISO_8859-1:1987",
"pt_PT.iso88591: ISO_8859-1:1987",
"hu_HU: ISO_8859-2:1987",
"hu_HU.iso88592: ISO_8859-2:1987",
"cs_CZ: ISO_8859-2:1987",
"cs_CZ.iso88592: ISO_8859-2:1987",
"pl_PL: ISO_8859-2:1987",
"pl_PL.iso88592: ISO_8859-2:1987",
"ro_RO: ISO_8859-2:1987",
"ro_RO.iso88592: ISO_8859-2:1987",
"hr_HR: ISO_8859-2:1987",
"hr_HR.iso88592: ISO_8859-2:1987",
"sk_SK: ISO_8859-2:1987",
"sk_SK.iso88592: ISO_8859-2:1987",
"sl_SI: ISO_8859-2:1987",
"sl_SI.iso88592: ISO_8859-2:1987",
"american.iso88591: ISO_8859-1:1987",
"bulgarian: ISO_8859-2:1987",
"c-french.iso88591: ISO_8859-1:1987",
"chinese-s: GB2312",
"chinese-t.big5: Big5",
"czech: ISO_8859-2:1987",
"danish.iso88591: ISO_8859-1:1987",
"dutch.iso88591: ISO_8859-1:1987",
"english.iso88591: ISO_8859-1:1987",
"finnish.iso88591: ISO_8859-1:1987",
"french.iso88591: ISO_8859-1:1987",
"german.iso88591: ISO_8859-1:1987",
"hungarian: ISO_8859-2:1987",
"icelandic.iso88591: ISO_8859-1:1987",
"italian.iso88591: ISO_8859-1:1987",
"japanese.euc: Extended_UNIX_Code_Packed_Format_for_Japanese",
"japanese: Shift_JIS",
"katakana: Shift_JIS",
"korean: EUC-KR",
"norwegian.iso88591: ISO_8859-1:1987",
"polish: ISO_8859-2:1987",
"portuguese.iso88591: ISO_8859-1:1987",
"rumanian: ISO_8859-2:1987",
"serbocroatian: ISO_8859-2:1987",
"slovene: ISO_8859-2:1987",
"spanish.iso88591: ISO_8859-1:1987",
"swedish.iso88591: ISO_8859-1:1987",
NULL
};
#elif defined(AIX)
const char *CHARCONVTABLE[] =
{
"! This table maps the host's locale names to LIBNLS charsets",
"!",
"C: ISO_8859-1:1987",
"En_JP.IBM-932: Shift_JIS",
"En_JP: Shift_JIS",
"Ja_JP.IBM-932: Shift_JIS",
"Ja_JP: Shift_JIS",
"da_DK.ISO8859-1: ISO_8859-1:1987",
"da_DK: ISO_8859-1:1987",
"de_CH.ISO8859-1: ISO_8859-1:1987",
"de_CH: ISO_8859-1:1987",
"de_DE.ISO8859-1: ISO_8859-1:1987",
"de_DE: ISO_8859-1:1987",
"en_GB.ISO8859-1: ISO_8859-1:1987",
"en_GB: ISO_8859-1:1987",
"en_JP.IBM-eucJP: Extended_UNIX_Code_Packed_Format_for_Japanese",
"en_JP: Extended_UNIX_Code_Packed_Format_for_Japanese",
"en_KR.IBM-eucKR: EUC-KR",
"en_KR: EUC-KR",
"en_TW.IBM-eucTW: cns11643_1",
"en_TW: cns11643_1",
"en_US.ISO8859-1: ISO_8859-1:1987",
"en_US: ISO_8859-1:1987",
"es_ES.ISO8859-1: ISO_8859-1:1987",
"es_ES: ISO_8859-1:1987",
"fi_FI.ISO8859-1: ISO_8859-1:1987",
"fi_FI: ISO_8859-1:1987",
"fr_BE.ISO8859-1: ISO_8859-1:1987",
"fr_BE: ISO_8859-1:1987",
"fr_CA.ISO8859-1: ISO_8859-1:1987",
"fr_CA: ISO_8859-1:1987",
"fr_CH.ISO8859-1: ISO_8859-1:1987",
"fr_CH: ISO_8859-1:1987",
"fr_FR.ISO8859-1: ISO_8859-1:1987",
"fr_FR: ISO_8859-1:1987",
"is_IS.ISO8859-1: ISO_8859-1:1987",
"is_IS: ISO_8859-1:1987",
"it_IT.ISO8859-1: ISO_8859-1:1987",
"it_IT: ISO_8859-1:1987",
"ja_JP.IBM-eucJP: Extended_UNIX_Code_Packed_Format_for_Japanese",
"ja_JP: Extended_UNIX_Code_Packed_Format_for_Japanese",
"ko_KR.IBM-eucKR: EUC-KR",
"ko_KR: EUC-KR",
"nl_BE.ISO8859-1: ISO_8859-1:1987",
"nl_BE: ISO_8859-1:1987",
"nl_NL.ISO8859-1: ISO_8859-1:1987",
"nl_NL: ISO_8859-1:1987",
"no_NO.ISO8859-1: ISO_8859-1:1987",
"no_NO: ISO_8859-1:1987",
"pt_PT.ISO8859-1: ISO_8859-1:1987",
"pt_PT: ISO_8859-1:1987",
"sv_SE.ISO8859-1: ISO_8859-1:1987",
"sv_SE: ISO_8859-1:1987",
"zh_TW.IBM-eucTW: cns11643_1",
"zh_TW: cns11643_1",
NULL
};
#else // sunos by default
const char *CHARCONVTABLE[] =
{
"! This table maps the host's locale names to LIBNLS charsets",
"!",
"C: ISO_8859-1:1987",
"de: ISO_8859-1:1987",
"en_US: ISO_8859-1:1987",
"es: ISO_8859-1:1987",
"fr: ISO_8859-1:1987",
"iso_8859_1: ISO_8859-1:1987",
"it: ISO_8859-1:1987",
"ja: Extended_UNIX_Code_Packed_Format_for_Japanese",
"ja_JP.EUC: Extended_UNIX_Code_Packed_Format_for_Japanese",
"japanese: Extended_UNIX_Code_Packed_Format_for_Japanese",
"ko: EUC-KR",
"sv: ISO_8859-1:1987",
"zh: GB2312",
"zh_TW: cns11643_1",
NULL
};
#endif
#define BSZ 256
char *
GetCharsetFromLocale(char *locale)
{
char *tmpcharset = NULL;
char buf[BSZ];
char *p;
const char *line;
int i=0;
line = CHARCONVTABLE[i];
while (line != NULL)
{
if (*line == 0)
{
break;
}
strcpy(buf, line);
line = CHARCONVTABLE[++i];
if (!*buf || *buf == '!')
{
continue;
}
p = strchr(buf, ':');
if (p == NULL)
{
tmpcharset = NULL;
break;
}
*p = 0;
if (strcmp(buf, locale) == 0) {
while (*++p == ' ' || *p == '\t')
;
if (isalpha(*p)) {
tmpcharset = strdup(p);
} else
tmpcharset = NULL;
break;
}
}
return tmpcharset;
}
#endif /* !_WIN32 */
/* version that uses libNLS */
char *
ldaptool_local2UTF8( const char *src, const char *desc )
{
char *utf8;
#ifndef _WIN32
char *locale, *newcharset;
size_t outLen, resultLen;
NLS_ErrorCode err;
if (src == NULL)
{
return NULL;
}
else if (*src == 0)
{
utf8 = strdup(src);
return utf8;
}
if( (ldaptool_charset != NULL) && (!strcmp( ldaptool_charset, "" ))
&& (!charsetset) )
{
locale = GetNormalizedLocaleName();
ldaptool_charset = GetCharsetFromLocale(locale);
free( locale );
charsetset = 1;
}
else
if( (ldaptool_charset != NULL) && strcmp( ldaptool_charset, "" )
&& (!charsetset) )
{
newcharset = GetCharsetFromLocale( ldaptool_charset );
free( ldaptool_charset );
ldaptool_charset = newcharset;
charsetset = 1;
}
if (ldaptool_charset == NULL) {
return strdup(src);
}
if (NLS_EncInitialize(NULL, ldaptool_convdir) != NLS_SUCCESS ||
NLS_RegisterStaticLibrary(_STATICLINK_NSJPN_) != NLS_SUCCESS ||
NLS_RegisterStaticLibrary(_STATICLINK_NSCCK_) != NLS_SUCCESS ||
NLS_RegisterStaticLibrary(_STATICLINK_NSSB_) != NLS_SUCCESS) {
return strdup(src);
}
outLen = NLS_GetResultBufferSize( (byte *) src,
strlen( src ) * sizeof(char),
ldaptool_charset,
NLS_ENCODING_UTF_8 );
utf8 = (char *) malloc( outLen/sizeof(UniChar) );
if( utf8 == NULL )
return strdup(src);
err = NLS_ConvertBuffer( ldaptool_charset,
NLS_ENCODING_UTF_8,
(byte*)src,
strlen(src) * sizeof(char),
(byte*)utf8,
outLen,
&resultLen );
NLS_EncTerminate();
#else
utf8 = win_char_converter(src, FALSE);
if( utf8 == NULL )
utf8 = strdup(src);
#endif
return utf8;
}
#endif /* HAVE_LIBNLS */

View File

@@ -1,218 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1996-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# LDIF examples, taken from the specification which was found at:
# http://www.ietf.org/internet-drafts/draft-good-ldap-ldif-03.txt
# Example 1: An simple LDAP file with two entries
version: 1
dn: cn=Barbara Jensen, ou=Product Development, dc=airius, dc=com
objectclass: top
objectclass: person
objectclass: organizationalPerson
cn: Barbara Jensen
cn: Barbara J Jensen
cn: Babs Jensen
sn: Jensen
uid: bjensen
telephonenumber: +1 408 555 1212
description: A big sailing fan.
dn: cn=Bjorn Jensen, ou=Accounting, dc=airius, dc=com
objectclass: top
objectclass: person
objectclass: organizationalPerson
cn: Bjorn Jensen
sn: Jensen
telephonenumber: +1 408 555 1212
# Example 2: A file containing an entry with a folded attribute value
version: 1
dn:cn=Barbara Jensen, ou=Product Development, dc=airius, dc=com
objectclass:top
objectclass:person
objectclass:organizationalPerson
cn:Barbara Jensen
cn:Barbara J Jensen
cn:Babs Jensen
sn:Jensen
uid:bjensen
telephonenumber:+1 408 555 1212
description:Babs is a big sailing fan, and travels extensively in search of
perfect sailing conditions.
title:Product Manager, Rod and Reel Division
# Example 3: A file containing a base-64-encoded value
version: 1
dn: cn=Gern Jensen, ou=Product Testing, dc=airius, dc=com
objectclass: top
objectclass: person
objectclass: organizationalPerson
cn: Gern Jensen
cn: Gern O Jensen
sn: Jensen
uid: gernj
telephonenumber: +1 408 555 1212
description:: V2hhdCBhIGNhcmVmdWwgcmVhZGVyIHlvdSBhcmUhICBUaGlzIHZhbHVlIGlzIGJ
hc2UtNjQtZW5jb2RlZCBiZWNhdXNlIGl0IGhhcyBhIGNvbnRyb2wgY2hhcmFjdGVyIGluIGl0ICh
hIENSKS4NICBCeSB0aGUgd2F5LCB5b3Ugc2hvdWxkIHJlYWxseSBnZXQgb3V0IG1vcmUu
# Example 4: A file containing an entries with UTF-8-encoded attribute
# values, including language tags. Comments indicate the contents
# of UTF-8-encoded attributes and distinguished names.
version: 1
dn:: b3U95Za25qWt6YOoLG89QWlyaXVz
# dn:: ou=<JapaneseOU>,o=Airius
objectclass: top
objectclass: organizationalUnit
ou:: 5Za25qWt6YOo
# ou:: <JapaneseOU>
ou;lang-ja:: 5Za25qWt6YOo
# ou;lang-ja:: <JapaneseOU>
ou;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2
# ou;lang-ja:: <JapaneseOU_in_phonetic_representation>
ou;lang-en: Sales
description: Japanese office
dn:: dWlkPXJvZ2FzYXdhcmEsb3U95Za25qWt6YOoLG89QWlyaXVz
# dn:: uid=<uid>,ou=<JapaneseOU>,o=Airius
userpassword: {SHA}O3HSv1MusyL4kTjP+HKI5uxuNoM=
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
uid: rogasawara
mail: rogasawara@airius.co.jp
givenname;lang-ja:: 44Ot44OJ44OL44O8
# givenname;lang-ja:: <JapaneseGivenname>
sn;lang-ja:: 5bCP56yg5Y6f
# sn;lang-ja:: <JapaneseSn>
cn;lang-ja:: 5bCP56yg5Y6fIOODreODieODi+ODvA==
# cn;lang-ja:: <JapaneseCn>
title;lang-ja:: 5Za25qWt6YOoIOmDqOmVtw==
# title;lang-ja:: <JapaneseTitle>
preferredlanguage: ja
givenname:: 44Ot44OJ44OL44O8
# givenname:: <JapaneseGivenname>
sn:: 5bCP56yg5Y6f
# sn:: <JapaneseSn>
cn:: 5bCP56yg5Y6fIOODreODieODi+ODvA==
# cn:: <JapaneseCn>
title:: 5Za25qWt6YOoIOmDqOmVtw==
# title:: <JapaneseTitle>
givenname;lang-ja;phonetic:: 44KN44Gp44Gr44O8
# givenname;lang-ja;phonetic:: <JapaneseGivenname_in_phonetic_representation_kana>
sn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJ
# sn;lang-ja;phonetic:: <JapaneseSn_in_phonetic_representation_kana>
cn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJIOOCjeOBqeOBq+ODvA==
# cn;lang-ja;phonetic:: <JapaneseCn_in_phonetic_representation_kana>
title;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2IOOBtuOBoeOCh+OBhg==
# title;lang-ja;phonetic:: <JapaneseTitle_in_phonetic_representation_kana>
givenname;lang-en: Rodney
sn;lang-en: Ogasawara
cn;lang-en: Rodney Ogasawara
title;lang-en: Sales, Director
# Example 5: A file containing a reference to an external file
version: 1
dn: cn=Horatio Jensen, ou=Product Testing, dc=airius, dc=com
objectclass: top
objectclass: person
objectclass: organizationalPerson
cn: Horatio Jensen
cn: Horatio N Jensen
sn: Jensen
uid: hjensen
telephonenumber: +1 408 555 1212
# XXXmcs: In the spec, the following line reads:
# jpegphoto:< file:///usr/local/directory/photos/hjensen.jpg
# I changed the file URL to point to a more generic directory.
jpegphoto:< file:///tmp/hjensen.jpg
# Example 6: A file containing a series of change records and comments
version: 1
# Add a new entry
dn: cn=Fiona Jensen, ou=Marketing, dc=airius, dc=com
changetype: add
objectclass: top
objectclass: person
objectclass: organizationalPerson
cn: Fiona Jensen
sn: Jensen
uid: fiona
telephonenumber: +1 408 555 1212
# XXXmcs: In the spec, the following line reads:
# jpegphoto:< file:///usr/local/directory/photos/fiona.jpg
# I changed the file URL to point to a more generic directory.
jpegphoto:< file:///tmp/fiona.jpg
# Delete an existing entry
dn: cn=Robert Jensen, ou=Marketing, dc=airius, dc=com
changetype: delete
# Modify an entry's relative distinguished name
dn: cn=Paul Jensen, ou=Product Development, dc=airius, dc=com
changetype: modrdn
newrdn: cn=Paula Jensen
deleteoldrdn: 1
# Rename an entry and move all of its children to a new location in
# the directory tree (only implemented by LDAPv3 servers).
dn: ou=PD Accountants, ou=Product Development, dc=airius, dc=com
changetype: modrdn
newrdn: ou=Product Development Accountants
deleteoldrdn: 0
newsuperior: ou=Accounting, dc=airius, dc=com
# Modify an entry: add an additional value to the postaladdress attribute,
# completely delete the description attribute, replace the telephonenumber
# attribute with two values, and delete a specific value from the
# facsimiletelephonenumber attribute
dn: cn=Paula Jensen, ou=Product Development, dc=airius, dc=com
changetype: modify
add: postaladdress
postaladdress: 123 Anystreet $ Sunnyvale, CA $ 94086
-
delete: description
-
replace: telephonenumber
telephonenumber: +1 408 555 1234
telephonenumber: +1 408 555 5678
-
delete: facsimiletelephonenumber
facsimiletelephonenumber: +1 408 555 9876
-

View File

@@ -1,508 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* LDAP tools fileurl.c -- functions for handling file URLs.
* Used by ldapmodify.
*/
#include "ldaptool.h"
#include "fileurl.h"
#include <ctype.h> /* for isalpha() */
static int str_starts_with( const char *s, char *prefix );
static void hex_unescape( char *s );
static int unhex( char c );
static void strcpy_escaped_and_convert( char *s1, char *s2 );
static int berval_from_file( const char *path, struct berval *bvp,
int reporterrs );
/*
* Convert a file URL to a local path.
*
* If successful, LDAPTOOL_FILEURL_SUCCESS is returned and *localpathp is
* set point to an allocated string. If not, an different LDAPTOOL_FILEURL_
* error code is returned.
*
* See RFCs 1738 and 2396 for a specification for file URLs... but
* Netscape Navigator seems to be a bit more lenient in what it will
* accept, especially on Windows).
*
* This function parses file URLs of these three forms:
*
* file:///path
* file:/path
* file://localhost/path
* file://host/path (rejected with a ...NONLOCAL error)
*
* On Windows, we convert leading drive letters of the form C| to C:
* and if a drive letter is present we strip off the slash that precedes
* path. Otherwise, the leading slash is returned.
*
*/
int
ldaptool_fileurl2path( const char *fileurl, char **localpathp )
{
const char *path;
char *pathcopy;
/*
* Make sure this is a file URL we can handle.
*/
if ( !str_starts_with( fileurl, "file:" )) {
return( LDAPTOOL_FILEURL_NOTAFILEURL );
}
path = fileurl + 5; /* skip past "file:" scheme prefix */
if ( *path != '/' ) {
return( LDAPTOOL_FILEURL_MISSINGPATH );
}
++path; /* skip past '/' at end of "file:/" */
if ( *path == '/' ) {
++path; /* remainder is now host/path or /path */
if ( *path != '/' ) {
/*
* Make sure it is for the local host.
*/
if ( str_starts_with( path, "localhost/" )) {
path += 9;
} else {
return( LDAPTOOL_FILEURL_NONLOCAL );
}
}
} else { /* URL is of the form file:/path */
--path;
}
/*
* The remainder is now of the form /path. On Windows, skip past the
* leading slash if a drive letter is present.
*/
#ifdef _WINDOWS
if ( isalpha( path[1] ) && ( path[2] == '|' || path[2] == ':' )) {
++path;
}
#endif /* _WINDOWS */
/*
* Duplicate the path so we can safely alter it.
* Unescape any %HH sequences.
*/
if (( pathcopy = strdup( path )) == NULL ) {
return( LDAPTOOL_FILEURL_NOMEMORY );
}
hex_unescape( pathcopy );
#ifdef _WINDOWS
/*
* Convert forward slashes to backslashes for Windows. Also,
* if we see a drive letter / vertical bar combination (e.g., c|)
* at the beginning of the path, replace the '|' with a ':'.
*/
{
char *p;
for ( p = pathcopy; *p != '\0'; ++p ) {
if ( *p == '/' ) {
*p = '\\';
}
}
}
if ( isalpha( pathcopy[0] ) && pathcopy[1] == '|' ) {
pathcopy[1] = ':';
}
#endif /* _WINDOWS */
*localpathp = pathcopy;
return( LDAPTOOL_FILEURL_SUCCESS );
}
/*
* Convert a local path to a file URL.
*
* If successful, LDAPTOOL_FILEURL_SUCCESS is returned and *urlp is
* set point to an allocated string. If not, an different LDAPTOOL_FILEURL_
* error code is returned. At present, the only possible error is
* LDAPTOOL_FILEURL_NOMEMORY.
*
* This function produces file URLs of the form file:path.
*
* On Windows, we convert leading drive letters to C|.
*
*/
int
ldaptool_path2fileurl( char *path, char **urlp )
{
char *p, *url, *prefix ="file:";
if ( NULL == path ) {
path = "/";
}
/*
* Allocate space for the URL, taking into account that path may
* expand during the hex escaping process.
*/
if (( url = malloc( strlen( prefix ) + 3 * strlen( path ) + 1 )) == NULL ) {
return( LDAPTOOL_FILEURL_NOMEMORY );
}
strcpy( url, prefix );
p = url + strlen( prefix );
#ifdef _WINDOWS
/*
* On Windows, convert leading drive letters (e.g., C:) to the correct URL
* syntax (e.g., C|).
*/
if ( isalpha( path[0] ) && path[1] == ':' ) {
*p++ = path[0];
*p++ = '|';
path += 2;
*p = '\0';
}
#endif /* _WINDOWS */
/*
* Append the path, encoding any URL-special characters using the %HH
* convention.
* On Windows, convert backwards slashes in the path to forward ones.
*/
strcpy_escaped_and_convert( p, path );
*urlp = url;
return( LDAPTOOL_FILEURL_SUCCESS );
}
/*
* Populate *bvp from "value" of length "vlen."
*
* If recognize_url_syntax is non-zero, :<fileurl is recognized.
* If always_try_file is recognized and no file URL was found, an
* attempt is made to stat and read the value as if it were the name
* of a file.
*
* If reporterrs is non-zero, specific error messages are printed to
* stderr.
*
* If successful, LDAPTOOL_FILEURL_SUCCESS is returned and bvp->bv_len
* and bvp->bv_val are set (the latter is set to malloc'd memory).
* Upon failure, a different LDAPTOOL_FILEURL_ error code is returned.
*/
int
ldaptool_berval_from_ldif_value( const char *value, int vlen,
struct berval *bvp, int recognize_url_syntax, int always_try_file,
int reporterrs )
{
int rc = LDAPTOOL_FILEURL_SUCCESS; /* optimistic */
const char *url = NULL;
struct stat fstats;
/* recognize "attr :< url" syntax if LDIF version is >= 1 */
if ( recognize_url_syntax && *value == '<' ) {
for ( url = value + 1; isspace( *url ); ++url ) {
; /* NULL */
}
if (strlen(url) < 6 || strncasecmp(url, "file:/", 6) != 0) {
/*
* We only support file:/ URLs for now.
*/
url = NULL;
}
}
if ( NULL != url ) {
char *path;
rc = ldaptool_fileurl2path( url, &path );
switch( rc ) {
case LDAPTOOL_FILEURL_NOTAFILEURL:
if ( reporterrs ) fprintf( stderr, "%s: unsupported URL \"%s\";"
" use a file:/ URL instead.\n", ldaptool_progname, url );
break;
case LDAPTOOL_FILEURL_MISSINGPATH:
if ( reporterrs ) fprintf( stderr,
"%s: unable to process URL \"%s\" --"
" missing path.\n", ldaptool_progname, url );
break;
case LDAPTOOL_FILEURL_NONLOCAL:
if ( reporterrs ) fprintf( stderr,
"%s: unable to process URL \"%s\" -- only"
" local file:/ URLs are supported.\n",
ldaptool_progname, url );
break;
case LDAPTOOL_FILEURL_NOMEMORY:
if ( reporterrs ) perror( "ldaptool_fileurl2path" );
break;
case LDAPTOOL_FILEURL_SUCCESS:
if ( stat( path, &fstats ) != 0 ) {
if ( reporterrs ) perror( path );
} else if ( fstats.st_mode & S_IFDIR ) {
if ( reporterrs ) fprintf( stderr,
"%s: %s is a directory, not a file\n",
ldaptool_progname, path );
rc = LDAPTOOL_FILEURL_FILEIOERROR;
} else {
rc = berval_from_file( path, bvp, reporterrs );
}
free( path );
break;
default:
if ( reporterrs ) fprintf( stderr,
"%s: unable to process URL \"%s\""
" -- unknown error\n", ldaptool_progname, url );
}
} else if ( always_try_file && (stat( value, &fstats ) == 0) &&
!(fstats.st_mode & S_IFDIR)) { /* get value from file */
rc = berval_from_file( value, bvp, reporterrs );
} else { /* use value as-is */
bvp->bv_len = vlen;
if (( bvp->bv_val = (char *)malloc( vlen + 1 )) == NULL ) {
if ( reporterrs ) perror( "malloc" );
rc = LDAPTOOL_FILEURL_NOMEMORY;
} else {
SAFEMEMCPY( bvp->bv_val, value, vlen );
bvp->bv_val[ vlen ] = '\0';
}
}
return( rc );
}
/*
* Map an LDAPTOOL_FILEURL_ error code to an LDAP error code (crude).
*/
int
ldaptool_fileurlerr2ldaperr( int lderr )
{
int rc;
switch( lderr ) {
case LDAPTOOL_FILEURL_SUCCESS:
rc = LDAP_SUCCESS;
break;
case LDAPTOOL_FILEURL_NOMEMORY:
rc = LDAP_NO_MEMORY;
break;
default:
rc = LDAP_PARAM_ERROR;
}
return( rc );
}
/*
* Populate *bvp with the contents of the file named by "path".
*
* If reporterrs is non-zero, specific error messages are printed to
* stderr.
*
* If successful, LDAPTOOL_FILEURL_SUCCESS is returned and bvp->bv_len
* and bvp->bv_val are set (the latter is set to malloc'd memory).
* Upon failure, a different LDAPTOOL_FILEURL_ error code is returned.
*/
static int
berval_from_file( const char *path, struct berval *bvp, int reporterrs )
{
FILE *fp;
long rlen;
#if defined( XP_WIN32 )
char mode[20] = "r+b";
#else
char mode[20] = "r";
#endif
if (( fp = ldaptool_open_file( path, mode )) == NULL ) {
if ( reporterrs ) perror( path );
return( LDAPTOOL_FILEURL_FILEIOERROR );
}
if ( fseek( fp, 0L, SEEK_END ) != 0 ) {
if ( reporterrs ) perror( path );
fclose( fp );
return( LDAPTOOL_FILEURL_FILEIOERROR );
}
bvp->bv_len = ftell( fp );
if (( bvp->bv_val = (char *)malloc( bvp->bv_len + 1 )) == NULL ) {
if ( reporterrs ) perror( "malloc" );
fclose( fp );
return( LDAPTOOL_FILEURL_NOMEMORY );
}
if ( fseek( fp, 0L, SEEK_SET ) != 0 ) {
if ( reporterrs ) perror( path );
fclose( fp );
return( LDAPTOOL_FILEURL_FILEIOERROR );
}
rlen = fread( bvp->bv_val, 1, bvp->bv_len, fp );
fclose( fp );
if ( rlen != (long)bvp->bv_len ) {
if ( reporterrs ) perror( path );
free( bvp->bv_val );
return( LDAPTOOL_FILEURL_FILEIOERROR );
}
bvp->bv_val[ bvp->bv_len ] = '\0';
return( LDAPTOOL_FILEURL_SUCCESS );
}
/*
* Return a non-zero value if the string s begins with prefix and zero if not.
*/
static int
str_starts_with( const char *s, char *prefix )
{
size_t prefix_len;
if ( s == NULL || prefix == NULL ) {
return( 0 );
}
prefix_len = strlen( prefix );
if ( strlen( s ) < prefix_len ) {
return( 0 );
}
return( strncmp( s, prefix, prefix_len ) == 0 );
}
/*
* Remove URL hex escapes from s... done in place. The basic concept for
* this routine is borrowed from the WWW library HTUnEscape() routine.
*
* A similar function called nsldapi_hex_unescape can be found in
* ../../libraries/libldap/unescape.c
*/
static void
hex_unescape( char *s )
{
char *p;
for ( p = s; *s != '\0'; ++s ) {
if ( *s == '%' ) {
if ( *++s != '\0' ) {
*p = unhex( *s ) << 4;
}
if ( *++s != '\0' ) {
*p++ += unhex( *s );
}
} else {
*p++ = *s;
}
}
*p = '\0';
}
/*
* Return the integer equivalent of one hex digit (in c).
*
* A similar function can be found in ../../libraries/libldap/unescape.c
*/
static int
unhex( char c )
{
return( c >= '0' && c <= '9' ? c - '0'
: c >= 'A' && c <= 'F' ? c - 'A' + 10
: c - 'a' + 10 );
}
#define HREF_CHAR_ACCEPTABLE( c ) (( c >= '-' && c <= '9' ) || \
( c >= '@' && c <= 'Z' ) || \
( c == '_' ) || \
( c >= 'a' && c <= 'z' ))
/*
* Like strcat(), except if any URL-special characters are found in s2
* they are escaped using the %HH convention and backslash characters are
* converted to forward slashes on Windows.
*
* Maximum space needed in s1 is 3 * strlen( s2 ) + 1.
*
* A similar function that does not convert the slashes called
* strcat_escaped() can be found in ../../libraries/libldap/tmplout.c
*/
static void
strcpy_escaped_and_convert( char *s1, char *s2 )
{
char *p, *q;
char *hexdig = "0123456789ABCDEF";
p = s1 + strlen( s1 );
for ( q = s2; *q != '\0'; ++q ) {
#ifdef _WINDOWS
if ( *q == '\\' ) {
*p++ = '/';
} else
#endif /* _WINDOWS */
if ( HREF_CHAR_ACCEPTABLE( *q )) {
*p++ = *q;
} else {
*p++ = '%';
*p++ = hexdig[ 0x0F & ((*(unsigned char*)q) >> 4) ];
*p++ = hexdig[ 0x0F & *q ];
}
}
*p = '\0';
}

View File

@@ -1,99 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* LDAP tools fileurl.h -- defines for file URL functions.
* Used by ldapmodify.
*/
/*
* ldaptool_fileurl2path() convert a file URL to a local path.
*
* If successful, LDAPTOOL_FILEURL_SUCCESS is returned and *localpathp is
* set point to an allocated string. If not, a different LDAPTOOL_FILEURL_
* error code is returned.
*/
int ldaptool_fileurl2path( const char *fileurl, char **localpathp );
/*
* Convert a local path to a file URL.
*
* If successful, LDAPTOOL_FILEURL_SUCCESS is returned and *urlp is
* set point to an allocated string. If not, a different LDAPTOOL_FILEURL_
* error code is returned. At present, the only possible error is
* LDAPTOOL_FILEURL_NOMEMORY.
*
*/
int ldaptool_path2fileurl( char *path, char **urlp );
/*
* Populate *bvp from "value" of length "vlen."
*
* If recognize_url_syntax is non-zero, :<fileurl is recognized.
* If always_try_file is recognized and no file URL was found, an
* attempt is made to stat and read the value as if it were the name
* of a file.
*
* If reporterrs is non-zero, specific error messages are printed to
* stderr.
*
* If successful, LDAPTOOL_FILEURL_SUCCESS is returned and bvp->bv_len
* and bvp->bv_val are set (the latter is set to malloc'd memory).
* Upon failure, a different LDAPTOOL_FILEURL_ error code is returned.
*/
int ldaptool_berval_from_ldif_value( const char *value, int vlen,
struct berval *bvp, int recognize_url_syntax, int always_try_file,
int reporterrs );
/*
* Map an LDAPTOOL_FILEURL_ error code to an LDAP error code (crude).
*/
int ldaptool_fileurlerr2ldaperr( int lderr );
/*
* Possible return codes for the functions declared in this file:
*/
#define LDAPTOOL_FILEURL_SUCCESS 0
#define LDAPTOOL_FILEURL_NOTAFILEURL 1
#define LDAPTOOL_FILEURL_MISSINGPATH 2
#define LDAPTOOL_FILEURL_NONLOCAL 3
#define LDAPTOOL_FILEURL_NOMEMORY 4
#define LDAPTOOL_FILEURL_FILEIOERROR 5

View File

@@ -1,617 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* tool to compare the contents of two LDAP directory subtrees */
#include "ldaptool.h"
typedef struct attr {
char *name;
char **vals;
struct attr *next;
} ATTR; /* used for comparing two entries */
static void options_callback( int option, char *optarg );
static int docompare( LDAP *ld1, LDAP *ld2, char *base );
static int cmp2(LDAP *ld1, LDAP *ld2, LDAPMessage *e1, int findonly );
static void notfound(char *base, int dbaseno);
static ATTR* get_attrs( LDAP *ld, LDAPMessage *e );
static char* cmp_attrs( ATTR *a1, ATTR *a2 );
static void attr_free(ATTR *at);
#if 0 /* these functions are not used */
static void print_entry( LDAP *ld, LDAPMessage *entry, int attrsonly );
static void print_dn( LDAP *ld, LDAPMessage *entry );
static void write_ldif_value( char *type, char *value, unsigned long vallen );
#endif /* 0 */
static void
usage( void )
{
fprintf( stderr,
"usage: %s -b basedn [options] [attributes...]\nwhere:\n",
ldaptool_progname );
fprintf( stderr, " basedn\tbase dn for search\n" );
fprintf( stderr, "\t\t(if the environment variable LDAP_BASEDN is set,\n" );
fprintf( stderr, "\t\tthen the -b flag is not required)\n" );
fprintf( stderr, "options:\n" );
fprintf( stderr, " -s scope\tone of base, one, or sub (default is sub)\n" );
ldaptool_common_usage( 1 );
exit( LDAP_PARAM_ERROR );
}
static char *base = NULL;
static int allow_binary, vals2tmp, ldif, scope, deref, differ=0;
static int attrsonly, timelimit, sizelimit;
#if 0 /* these statics are referenced only by unused functions */
static char *sep = LDAPTOOL_DEFSEP;
static char **sortattr = NULL;
static int *skipsortattr = NULL;
static int includeufn;
#endif /* 0 */
int
main( int argc, char **argv )
{
int rc, optind;
LDAP *ld1, *ld2;
#ifdef notdef
#ifdef HPUX11
#ifndef __LP64__
_main( argc, argv);
#endif /* __LP64_ */
#endif /* HPUX11 */
#endif
deref = LDAP_DEREF_NEVER;
allow_binary = vals2tmp = attrsonly = 0;
ldif = 1;
sizelimit = timelimit = 0;
scope = LDAP_SCOPE_SUBTREE;
optind = ldaptool_process_args( argc, argv, "Bb:l:s:z:", 1,
options_callback );
if ( optind == -1 ) {
usage();
}
if ( base == NULL ) {
if (( base = getenv( "LDAP_BASEDN" )) == NULL ) {
usage();
}
}
ld1 = ldaptool_ldap_init( 0 );
ldap_set_option( ld1, LDAP_OPT_DEREF, &deref );
ldap_set_option( ld1, LDAP_OPT_TIMELIMIT, &timelimit );
ldap_set_option( ld1, LDAP_OPT_SIZELIMIT, &sizelimit );
ldaptool_bind( ld1 );
ld2 = ldaptool_ldap_init( 1 );
ldap_set_option( ld2, LDAP_OPT_DEREF, &deref );
ldap_set_option( ld2, LDAP_OPT_TIMELIMIT, &timelimit );
ldap_set_option( ld2, LDAP_OPT_SIZELIMIT, &sizelimit );
ldaptool_bind( ld2 );
if ( ldaptool_verbose ) {
printf( "Connections to servers established. Beginning comparison.\n" );
}
rc = docompare( ld1, ld2, base );
ldaptool_cleanup( ld1 );
ldaptool_cleanup( ld2 );
if ( ldaptool_verbose && !rc ) {
if ( !differ ) {
printf( "compare completed: no differences found\n" );
} else {
printf( "compare completed: ****differences were found****\n" );
}
}
return( rc );
}
static void
options_callback( int option, char *optarg )
{
switch( option ) {
case 'B': /* allow binary values to be printed, even if -o used */
++allow_binary;
break;
case 's': /* search scope */
if ( strncasecmp( optarg, "base", 4 ) == 0 ) {
scope = LDAP_SCOPE_BASE;
} else if ( strncasecmp( optarg, "one", 3 ) == 0 ) {
scope = LDAP_SCOPE_ONELEVEL;
} else if ( strncasecmp( optarg, "sub", 3 ) == 0 ) {
scope = LDAP_SCOPE_SUBTREE;
} else {
fprintf( stderr, "scope should be base, one, or sub\n" );
usage();
}
break;
case 'b': /* searchbase */
base = strdup( optarg );
break;
case 'l': /* time limit */
timelimit = atoi( optarg );
break;
case 'z': /* size limit */
sizelimit = atoi( optarg );
break;
default:
usage();
break;
}
}
/*
* Returns an LDAP error code.
*/
static int
docompare( LDAP *ld1, LDAP *ld2, char *base )
{
int rc, msgid;
LDAPMessage *res, *e;
LDAPControl *ctrls[2], **serverctrls;
if ( ldaptool_verbose ) {
printf( "Base: %s\n\n", base );
}
if ( ldaptool_not ) {
return( LDAP_SUCCESS );
}
if (( ctrls[0] = ldaptool_create_manage_dsait_control()) != NULL ) {
ctrls[1] = NULL;
serverctrls = ctrls;
} else {
serverctrls = NULL;
}
if ( ldap_search_ext( ld1, base, scope, "objectClass=*", NULL,
0, serverctrls, NULL, NULL, -1, &msgid ) != LDAP_SUCCESS ) {
return( ldaptool_print_lderror( ld1, "ldap_search",
LDAPTOOL_CHECK4SSL_IF_APPROP ));
}
/* XXXmcs: this code should be modified to display referrals and references */
while ( (rc = ldap_result( ld1, LDAP_RES_ANY, 0, NULL, &res )) ==
LDAP_RES_SEARCH_ENTRY ) {
e = ldap_first_entry( ld1, res );
rc = cmp2( ld1, ld2, e , 0);
ldap_msgfree( res );
}
if ( rc == -1 ) {
return( ldaptool_print_lderror( ld1, "ldap_result",
LDAPTOOL_CHECK4SSL_IF_APPROP ));
}
if (( rc = ldap_result2error( ld1, res, 0 )) != LDAP_SUCCESS ) {
(void)ldaptool_print_lderror( ld1, "ldap_search",
LDAPTOOL_CHECK4SSL_IF_APPROP );
}
ldap_msgfree( res );
if ( ldap_search_ext( ld2, base, scope, "objectClass=*", NULL,
0, serverctrls, NULL, NULL, -1, &msgid ) == -1 ) {
return( ldaptool_print_lderror( ld2, "ldap_search",
LDAPTOOL_CHECK4SSL_IF_APPROP ));
}
/* XXXmcs: this code should be modified to display referrals and references */
while ( (rc = ldap_result( ld2, LDAP_RES_ANY, 0, NULL, &res )) ==
LDAP_RES_SEARCH_ENTRY ) {
e = ldap_first_entry( ld2, res );
rc = cmp2( ld2, ld1, e , 1);
ldap_msgfree( res );
}
if ( rc == -1 ) {
return( ldaptool_print_lderror( ld2, "ldap_result",
LDAPTOOL_CHECK4SSL_IF_APPROP ));
}
if (( rc = ldap_result2error( ld1, res, 0 )) != LDAP_SUCCESS ) {
(void)ldaptool_print_lderror( ld1, "ldap_search",
LDAPTOOL_CHECK4SSL_IF_APPROP );
}
ldap_msgfree( res );
return( rc );
}
/*
* Returns an LDAP error code.
*/
static int
cmp2( LDAP *ld1, LDAP *ld2, LDAPMessage *e1, int findonly)
{
LDAPMessage *e2, *res;
char *dn, *attrcmp;
int found=0, rc;
ATTR *a1, *a2;
dn = ldap_get_dn( ld1, e1 );
if ( ldaptool_verbose ) {
if ( findonly ) {
printf( "Checking that %s exists on both servers\n", dn );
} else {
printf("Comparing entry %s on both servers\n", dn );
}
}
if ( ldap_search( ld2, dn, LDAP_SCOPE_BASE, "objectClass=*", NULL, 0 ) == -1 ) {
return( ldaptool_print_lderror( ld2, "ldap_search",
LDAPTOOL_CHECK4SSL_IF_APPROP ));
}
/* XXXmcs: this code should be modified to display referrals and references */
while ( (rc = ldap_result( ld2, LDAP_RES_ANY, 0, NULL, &res )) ==
LDAP_RES_SEARCH_ENTRY ) {
e2 = ldap_first_entry( ld1, res );
found = 1;
if ( !findonly ) {
a1 = get_attrs( ld1, e1 );
a2 = get_attrs( ld2, e2 );
attrcmp = cmp_attrs( a1, a2 );
if ( strcmp( attrcmp, "") != 0 ) {
printf("\n%s%s\n", dn, attrcmp);
}
}
ldap_msgfree( res );
}
if ( !found ) {
notfound( dn, findonly );
differ = 1;
}
if ( rc == -1 ) {
return( ldaptool_print_lderror( ld2, "ldap_result",
LDAPTOOL_CHECK4SSL_IF_APPROP ));
}
ldap_msgfree( res );
ldap_memfree( dn );
return(rc);
}
static ATTR*
get_attrs( LDAP *ld, LDAPMessage *e )
{
char *a;
ATTR *head, *tail, *tmp;
BerElement *ber;
head=tail=tmp=NULL;
for ( a = ldap_first_attribute( ld, e, &ber ); a != NULL;
a = ldap_next_attribute( ld, e, ber ) ) {
tmp = (ATTR*)malloc(sizeof(ATTR));
if(head == NULL)
head = tail = tmp;
else {
tail->next = tmp;
tail = tmp;
}
tmp->name = a;
tmp->vals = ldap_get_values( ld, e, a );
tmp->next = NULL;
}
if ( ber != NULL ) {
ber_free( ber, 0 );
}
/* used for debugging
tmp=head;
while(tmp!= NULL) {
printf("\n%s :", tmp->name);
for(i=0; tmp->vals[i] != NULL; i++)
printf("\n\t%d %s", i, tmp->vals[i]);
tmp = tmp->next;
}
*/
return(head);
}
static char*
cmp_attrs( ATTR *a1, ATTR *a2 )
{
static char result[5000];
char res[1000], partial[1000], *name = "";
ATTR *head1, *head2, *tmp, *prev, *start;
int i, j, found;
head1 = a1;
head2 = a2;
tmp = a2;
prev = NULL;
strcpy(result, "");
while(head1 != NULL) {
name = head1->name;
if(head2 == NULL) {
while(head1 != NULL) {
sprintf(partial, "\ndifferent: %s(*)", head1->name);
strcat(result, partial);
for(i=0; head1->vals[i] != NULL; i++) {
sprintf(partial,"\n\t1: %s", head1->vals[i]);
strcat(result, partial);
}
tmp = head1;
head1 = head1->next;
attr_free(tmp);
}
differ = 1;
break;
}
name = head1->name;
start = tmp;
while(tmp != NULL) {
if(!strcmp(name, tmp->name)) { /* attr found */
strcpy(res, "");
for(i=0; (head1->vals[i]) != NULL; i++) {
found = 0;
for(j=0; (tmp->vals[j]) != NULL; j++)
if(!strcmp(head1->vals[i], tmp->vals[j])) {
found = 1;
tmp->vals[j][0] = 7;
break;
}
if(!found) {
sprintf(partial, "\n\t1: %s", head1->vals[i]);
strcat(res, partial);
}
}
for(j=0; tmp->vals[j] != NULL; j++)
if(tmp->vals[j][0] != 7){
sprintf(partial, "\n\t2: %s", tmp->vals[j]);
strcat(res, partial);
}
if(strcmp(res, "")) {
sprintf(partial, "\ndifferent: %s%s", name, res);
differ = 1;
strcat(result, partial);
}
if(prev == NULL) { /* tmp = head2 */
head2 = head2->next;
attr_free(tmp);
tmp = head2;
}
else {
prev->next = tmp->next;
attr_free(tmp);
tmp = prev->next;
if(tmp == NULL) {
tmp = head2;
prev = NULL;
}
}
break;
}
else { /* attr not found */
if(prev == NULL)
prev = head2;
else
prev = tmp;
tmp = tmp->next;
if(tmp == NULL) { /* end of list */
tmp = head2;
prev = NULL;
}
if(tmp == start) { /* attr !exist in 2 */
sprintf(partial, "\ndifferent: %s(*)", name);
differ = 1;
strcat(result, partial);
for(i=0; head1->vals[i] != NULL; i++) {
sprintf(partial, "\n\t1: %s", head1->vals[i]);
strcat(result, partial);
}
break;
}
}
}
start = head1;
head1 = head1->next;
attr_free(start);
}
while(head2 != NULL) {
sprintf(partial, "\ndifferent: %s(*)", head2->name);
differ = 1;
strcat(result, partial);
for(i=0; head2->vals[i] != NULL; i++) {
sprintf(partial, "\n\t2: %s", head2->vals[i]);
strcat(result, partial);
}
tmp = head2;
head2 = head2->next;
attr_free(tmp);
}
return(result);
}
static void
attr_free(ATTR *at)
{
ldap_memfree(at->name);
ldap_value_free(at->vals);
free(at);
}
static void
notfound(char *base, int dbaseno)
{
printf("%donly: %s\n", dbaseno+1, base);
}
#if 0 /* these function is not used */
/* used for debugging */
static void
print_dn( LDAP *ld, LDAPMessage *entry )
{
char *dn, *ufn;
dn = ldap_get_dn( ld, entry );
if ( ldif ) {
write_ldif_value( "dn", dn, strlen( dn ));
} else {
printf( "%s\n", dn );
}
if ( includeufn ) {
ufn = ldap_dn2ufn( dn );
if ( ldif ) {
write_ldif_value( "ufn", ufn, strlen( ufn ));
} else {
printf( "%s\n", ufn );
}
free( ufn );
}
ldap_memfree( dn );
}
static void
print_entry( ld, entry, attrsonly )
LDAP *ld;
LDAPMessage *entry;
int attrsonly;
{
char *a, *dn, *ufn, tmpfname[ 256 ];
int i, notascii;
BerElement *ber;
struct berval **bvals;
FILE *tmpfp;
#if defined( XP_WIN32 )
char mode[20] = "w+b";
#else
char mode[20] = "w";
#endif
dn = ldap_get_dn( ld, entry );
if ( ldif ) {
write_ldif_value( "dn", dn, strlen( dn ));
} else {
printf( "%s\n", dn );
}
if ( includeufn ) {
ufn = ldap_dn2ufn( dn );
if ( ldif ) {
write_ldif_value( "ufn", ufn, strlen( ufn ));
} else {
printf( "%s\n", ufn );
}
free( ufn );
}
ldap_memfree( dn );
for ( a = ldap_first_attribute( ld, entry, &ber ); a != NULL;
a = ldap_next_attribute( ld, entry, ber ) ) {
if ( ldap_charray_inlist(sortattr, a) && /* in the list*/
skipsortattr[ldap_charray_position(sortattr, a)] ) {/* and skip it*/
continue; /* so skip it! */
}
if ( attrsonly ) {
if ( ldif ) {
write_ldif_value( a, "", 0 );
} else {
printf( "%s\n", a );
}
} else if (( bvals = ldap_get_values_len( ld, entry, a )) != NULL ) {
for ( i = 0; bvals[i] != NULL; i++ ) {
if ( vals2tmp ) {
sprintf( tmpfname, "%s/ldapcmp-%s-XXXXXX",
ldaptool_get_tmp_dir(), a );
tmpfp = NULL;
if ( LDAPTOOL_MKTEMP( tmpfname ) == NULL ) {
perror( tmpfname );
} else if (( tmpfp = ldaptool_open_file( tmpfname, mode)) == NULL ) {
perror( tmpfname );
} else if ( fwrite( bvals[ i ]->bv_val,
bvals[ i ]->bv_len, 1, tmpfp ) == 0 ) {
perror( tmpfname );
} else if ( ldif ) {
write_ldif_value( a, tmpfname, strlen( tmpfname ));
} else {
printf( "%s%s%s\n", a, sep, tmpfname );
}
if ( tmpfp != NULL ) {
fclose( tmpfp );
}
} else {
notascii = 0;
if ( !ldif && !allow_binary ) {
notascii = !ldaptool_berval_is_ascii( bvals[ i ] );
}
if ( ldif ) {
write_ldif_value( a, bvals[ i ]->bv_val,
bvals[ i ]->bv_len );
} else {
printf( "%s%s%s\n", a, sep,
notascii ? "NOT ASCII" : bvals[ i ]->bv_val );
}
}
}
ber_bvecfree( bvals );
}
}
if ( ber != NULL ) {
ber_free( ber, 0 );
}
}
static void
write_ldif_value( char *type, char *value, unsigned long vallen )
{
char *ldif;
/* ldif_type_and_value() fails only if malloc() fails. */
if (( ldif = ldif_type_and_value( type, value, (int)vallen )) == NULL ) {
exit( LDAP_NO_MEMORY );
}
fputs( ldif, stdout );
free( ldif );
}
#endif /* 0 */

View File

@@ -1,231 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* ldapdelete.c - simple program to delete an entry using LDAP */
#include "ldaptool.h"
#include "fileurl.h"
static int contoper = 0;
static LDAP *ld;
static int ldapcompare_quiet = 0;
static int docompare( LDAP *ld, const char *dn, const char *attrtype,
const struct berval *bvalue, LDAPControl **serverctrls );
static void options_callback( int option, char *optarg );
static int typeval2berval( char *typeval, char **typep, struct berval *bvp );
static void
usage( int rc )
{
fprintf( stderr, "usage: %s [options] attributetype:value [dn...]\n",
ldaptool_progname );
fprintf( stderr, " %s [options] attributetype::base64value [dn...]\n",
ldaptool_progname );
fprintf( stderr, " %s [options] attributetype:<fileurl [dn...]\n",
ldaptool_progname );
fprintf( stderr, "options:\n" );
ldaptool_common_usage( 0 );
fprintf( stderr, " -c\t\tcontinuous mode (do not stop on errors)\n" );
fprintf( stderr, " -f file\tread DNs to compare against from file\n" );
fprintf( stderr, " -q\t\tbe quiet when comparing entries\n" );
exit( rc );
}
int
main( int argc, char **argv )
{
char buf[ 4096 ], *typeval = NULL, *type = NULL;
struct berval bv;
int rc, optind;
LDAPControl *ldctrl;
#ifdef notdef
#ifdef HPUX11
#ifndef __LP64__
_main( argc, argv);
#endif /* __LP64_ */
#endif /* HPUX11 */
#endif
optind = ldaptool_process_args( argc, argv, "cq", 0, options_callback );
if ( ldaptool_fp == NULL && optind >= argc ) {
ldaptool_fp = stdin;
}
ld = ldaptool_ldap_init( 0 );
ldaptool_bind( ld );
if (( ldctrl = ldaptool_create_manage_dsait_control()) != NULL ) {
ldaptool_add_control_to_array( ldctrl, ldaptool_request_ctrls);
}
if ((ldctrl = ldaptool_create_proxyauth_control(ld)) !=NULL) {
ldaptool_add_control_to_array( ldctrl, ldaptool_request_ctrls);
}
if ( optind >= argc ) {
usage( LDAP_PARAM_ERROR );
}
typeval = ldaptool_local2UTF8( argv[optind], "type and value" );
if (( rc = typeval2berval( typeval, &type, &bv )) != LDAP_SUCCESS ) {
fprintf( stderr, "%s: unable to parse \"%s\"\n",
ldaptool_progname, argv[optind] );
usage( rc );
free( typeval );
}
++optind;
rc = 0;
if ( ldaptool_fp == NULL ) {
for ( ; optind < argc &&
( contoper || !LDAPTOOL_RESULT_IS_AN_ERROR( rc ) );
++optind ) {
char *conv;
conv = ldaptool_local2UTF8( argv[ optind ], "DN" );
rc = docompare( ld, conv, type, &bv, ldaptool_request_ctrls );
if ( conv != NULL ) {
free( conv );
}
}
} else {
while (( contoper || !LDAPTOOL_RESULT_IS_AN_ERROR( rc )) &&
fgets(buf, sizeof(buf), ldaptool_fp) != NULL) {
buf[ strlen( buf ) - 1 ] = '\0'; /* remove trailing newline */
if ( *buf != '\0' ) {
rc = docompare( ld, buf, type, &bv, ldaptool_request_ctrls );
}
}
}
ldaptool_reset_control_array( ldaptool_request_ctrls );
ldaptool_cleanup( ld );
if ( typeval != NULL ) free( typeval );
if ( bv.bv_val != NULL ) free( bv.bv_val );
return( rc );
}
/*ARGSUSED1*/
static void
options_callback( int option, char *optarg )
{
switch( option ) {
case 'c': /* continuous operation mode */
++contoper;
break;
case 'q': /* quiet mode */
++ldapcompare_quiet;
break;
default:
usage( LDAP_PARAM_ERROR );
}
}
static int
docompare( LDAP *ld, const char *dn, const char *attrtype,
const struct berval *bvalue, LDAPControl **serverctrls )
{
int rc;
if ( !ldapcompare_quiet ) {
char *valuestr, tmpbuf[256];
if ( ldaptool_berval_is_ascii( bvalue )) {
valuestr = bvalue->bv_val;
} else {
#ifdef HAVE_SNPRINTF
snprintf( tmpbuf, sizeof(tmpbuf), "NOT ASCII (%ld bytes)",
bvalue->bv_len );
#else
sprintf( tmpbuf, "NOT ASCII (%ld bytes)",
bvalue->bv_len );
#endif
valuestr = tmpbuf;
}
printf( "%scomparing type: \"%s\" value: \"%s\" in entry \"%s\"\n",
ldaptool_not ? "!" : "", attrtype, valuestr, dn );
}
if ( ldaptool_not ) {
rc = LDAP_COMPARE_TRUE;
} else {
rc = ldaptool_compare_ext_s( ld, dn, attrtype, bvalue,
serverctrls, NULL, "ldap_compare" );
if ( !ldapcompare_quiet ) {
if ( rc == LDAP_COMPARE_TRUE ) {
puts( "compare TRUE" );
} else if ( rc == LDAP_COMPARE_FALSE ) {
puts( "compare FALSE" );
}
}
}
return( rc );
}
/*
* Parse an ldapcompare type:value or type::value argument.
*
* The *typep is set to point into the typeval string.
* bvp->bv_val is created from malloc'd memory.
*
* This function returns an LDAP error code (LDAP_SUCCESS if all goes well).
*/
static int
typeval2berval( char *typeval, char **typep, struct berval *bvp )
{
char *value;
int vlen, rc;
if ( ldif_parse_line( typeval, typep, &value, &vlen ) != 0 ) {
return( LDAP_PARAM_ERROR );
}
rc = ldaptool_berval_from_ldif_value( value, vlen, bvp,
1 /* recognize file URLs */, 0 /* always try file */,
1 /* report errors */ );
return( ldaptool_fileurlerr2ldaperr( rc ));
}

View File

@@ -1,158 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* ldapdelete.c - simple program to delete an entry using LDAP */
#include "ldaptool.h"
static int contoper;
static LDAP *ld;
static int dodelete( LDAP *ld, char *dn, LDAPControl **serverctrls );
static void options_callback( int option, char *optarg );
static void
usage( void )
{
fprintf( stderr, "usage: %s [options] [dn...]\n", ldaptool_progname );
fprintf( stderr, "options:\n" );
ldaptool_common_usage( 0 );
fprintf( stderr, " -c\t\tcontinuous mode (do not stop on errors)\n" );
fprintf( stderr, " -f file\tread DNs to delete from file (default: standard input)\n" );
exit( LDAP_PARAM_ERROR );
}
int
main( int argc, char **argv )
{
char buf[ 4096 ];
int rc = 0;
int deref, optind;
LDAPControl *ldctrl;
#ifdef notdef
#ifdef HPUX11
#ifndef __LP64__
_main( argc, argv);
#endif /* __LP64_ */
#endif /* HPUX11 */
#endif
contoper = 0;
optind = ldaptool_process_args( argc, argv, "c", 0, options_callback );
if ( optind == -1 ) {
usage();
}
if ( ldaptool_fp == NULL && optind >= argc ) {
ldaptool_fp = stdin;
}
ld = ldaptool_ldap_init( 0 );
deref = LDAP_DEREF_NEVER; /* prudent, but probably unnecessary */
ldap_set_option( ld, LDAP_OPT_DEREF, &deref );
ldaptool_bind( ld );
if (( ldctrl = ldaptool_create_manage_dsait_control()) != NULL ) {
ldaptool_add_control_to_array( ldctrl, ldaptool_request_ctrls);
}
if ((ldctrl = ldaptool_create_proxyauth_control(ld)) !=NULL) {
ldaptool_add_control_to_array( ldctrl, ldaptool_request_ctrls);
}
if ( ldaptool_fp == NULL ) {
for ( ; optind < argc; ++optind ) {
char *conv;
conv = ldaptool_local2UTF8( argv[ optind ], "DN" );
rc = dodelete( ld, conv, ldaptool_request_ctrls );
if( conv != NULL )
free( conv );
}
} else {
while ((rc == 0 || contoper) &&
fgets(buf, sizeof(buf), ldaptool_fp) != NULL) {
buf[ strlen( buf ) - 1 ] = '\0'; /* remove trailing newline */
if ( *buf != '\0' ) {
rc = dodelete( ld, buf, ldaptool_request_ctrls );
}
}
}
ldaptool_reset_control_array( ldaptool_request_ctrls );
ldaptool_cleanup( ld );
return( rc );
}
/*ARGSUSED1*/
static void
options_callback( int option, char *optarg )
{
switch( option ) {
case 'c': /* continuous operation mode */
++contoper;
break;
default:
usage();
}
}
static int
dodelete( LDAP *ld, char *dn, LDAPControl **serverctrls )
{
int rc;
if ( ldaptool_verbose ) {
printf( "%sdeleting entry %s\n", ldaptool_not ? "!" : "", dn );
}
if ( ldaptool_not ) {
rc = LDAP_SUCCESS;
} else if (( rc = ldaptool_delete_ext_s( ld, dn, serverctrls, NULL,
"ldap_delete" )) == LDAP_SUCCESS && ldaptool_verbose ) {
printf( "entry removed\n" );
}
return( rc );
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,187 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* ldapmodrdn.c - generic program to modify an entry's RDN using LDAP */
#include "ldaptool.h"
static int domodrdn( LDAP *ld, char *dn, char *rdn, int remove,
LDAPControl **serverctrls);
static void options_callback( int option, char *optarg );
static int contoper, remove_oldrdn;
static LDAP *ld;
static void
usage( void )
{
fprintf( stderr, "usage: %s [options] [dn rdn]\n", ldaptool_progname );
fprintf( stderr, "options:\n" );
ldaptool_common_usage( 0 );
fprintf( stderr, " -c\t\tcontinuous mode (do not stop on errors)\n" );
fprintf( stderr, " -r\t\tremove old RDN\n" );
fprintf( stderr, " -f file\tread changes from file\n" );
exit( LDAP_PARAM_ERROR );
}
main( argc, argv )
int argc;
char **argv;
{
char *entrydn, *rdn, buf[ 4096 ];
int rc, havedn, deref, optind;
LDAPControl *ctrls[2], **serverctrls;
contoper = remove_oldrdn = 0;
optind = ldaptool_process_args( argc, argv, "cr", 0, options_callback );
if ( optind == -1 ) {
usage();
}
if ( ldaptool_fp == NULL ) {
ldaptool_fp = stdin;
}
havedn = 0;
if (argc - optind == 2) {
if (( rdn = strdup( argv[argc - 1] )) == NULL ) {
perror( "strdup" );
exit( LDAP_NO_MEMORY );
}
if (( entrydn = strdup( argv[argc - 2] )) == NULL ) {
perror( "strdup" );
exit( LDAP_NO_MEMORY );
}
++havedn;
} else if ( argc - optind != 0 ) {
fprintf( stderr, "%s: invalid number of arguments, only two allowed\n",
ldaptool_progname );
usage();
}
ld = ldaptool_ldap_init( 0 );
if ( !ldaptool_not ) {
deref = LDAP_DEREF_NEVER; /* this seems prudent */
ldap_set_option( ld, LDAP_OPT_DEREF, &deref );
}
ldaptool_bind( ld );
if (( ctrls[0] = ldaptool_create_manage_dsait_control()) != NULL ) {
ctrls[1] = NULL;
serverctrls = ctrls;
} else {
serverctrls = NULL;
}
rc = 0;
if (havedn) {
rc = domodrdn(ld, entrydn, rdn, remove_oldrdn, serverctrls);
} else while ((rc == 0 || contoper) &&
fgets(buf, sizeof(buf), ldaptool_fp) != NULL) {
if ( *buf != '\0' && *buf != '\n' ) { /* skip blank lines */
buf[ strlen( buf ) - 1 ] = '\0'; /* remove nl */
if ( havedn ) { /* have DN, get RDN */
if (( rdn = strdup( buf )) == NULL ) {
perror( "strdup" );
exit( LDAP_NO_MEMORY );
}
rc = domodrdn(ld, entrydn, rdn, remove_oldrdn, serverctrls);
havedn = 0;
} else if ( !havedn ) { /* don't have DN yet */
if (( entrydn = strdup( buf )) == NULL ) {
perror( "strdup" );
exit( LDAP_NO_MEMORY );
}
++havedn;
}
}
}
ldaptool_cleanup( ld );
exit( rc );
}
static void
options_callback( int option, char *optarg )
{
switch( option ) {
case 'c': /* continuous operation mode */
++contoper;
break;
case 'r': /* remove old RDN */
++remove_oldrdn;
break;
default:
usage();
}
}
static int
domodrdn( LDAP *ld, char *dn, char *rdn, int remove_oldrdn,
LDAPControl **serverctrls )
{
int i;
if ( ldaptool_verbose ) {
printf( "modrdn %s:\n\t%s\n", dn, rdn );
if (remove_oldrdn)
printf("removing old RDN\n");
else
printf("keeping old RDN\n");
}
if ( !ldaptool_not ) {
if (( i = ldaptool_rename_s( ld, dn, rdn, NULL, remove_oldrdn,
serverctrls, NULL, "ldap_rename" )) == LDAP_SUCCESS
&& ldaptool_verbose ) {
printf( "modrdn complete\n" );
}
} else {
i = LDAP_SUCCESS;
}
return( i );
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,204 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _LDAPTOOL_H
#define _LDAPTOOL_H
/* XXX:mhein The following is a workaround for the redefinition of */
/* const problem on OSF. Fix to be provided by NSS */
/* This is a pretty benign workaround for us which */
/* should not cause problems in the future even if */
/* we forget to take it out :-) */
#ifdef OSF1V4D
#ifndef __STDC__
# define __STDC__
#endif /* __STDC__ */
#endif /* OSF1V4D */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#ifdef AIX
#include <strings.h>
#endif
#ifdef SCOOS
#include <sys/types.h>
#endif
#ifdef _WINDOWS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
extern int getopt (int argc, char *const *argv, const char *optstring);
#include <io.h> /* for _mktemp() */
#define LDAPTOOL_MKTEMP( p ) _mktemp( p )
#else
#include <sys/file.h>
#include <sys/stat.h>
#include <unistd.h>
#define LDAPTOOL_MKTEMP( p ) mktemp( p )
#endif
#ifdef LINUX
#include <getopt.h> /* not always included from unistd.h */
#endif
#include <ctype.h>
#ifndef SCOOS
#include <sys/types.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>
#if defined(NET_SSL)
#include <ssl.h>
#endif
#include <portable.h>
#include <ldap.h>
#ifndef NO_LIBLCACHE
#include <lcache.h>
#endif
#include <ldaplog.h>
#include <ldif.h>
#if defined(NET_SSL)
#include <ldap_ssl.h>
#endif
#include <ldappr.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* shared macros, structures, etc.
*/
#define LDAPTOOL_RESULT_IS_AN_ERROR( rc ) \
( (rc) != LDAP_SUCCESS && (rc) != LDAP_COMPARE_TRUE \
&& (rc) != LDAP_COMPARE_FALSE )
#define LDAPTOOL_DEFSEP "=" /* used by ldapcmp and ldapsearch */
#define LDAPTOOL_DEFHOST "localhost"
#define LDAPTOOL_DEFSSLSTRENGTH LDAPSSL_AUTH_CERT
#define LDAPTOOL_DEFCERTDBPATH "."
#define LDAPTOOL_DEFKEYDBPATH "."
#define LDAPTOOL_DEFREFHOPLIMIT 5
#define LDAPTOOL_SAFEREALLOC( ptr, size ) ( ptr == NULL ? malloc( size ) : \
realloc( ptr, size ))
/* this defines the max number of control requests for the tools */
#define CONTROL_REQUESTS 50
/*
* globals (defined in common.c)
*/
extern char *ldaptool_host;
extern char *ldaptool_host2;
extern int ldaptool_port;
extern int ldaptool_port2;
extern int ldaptool_verbose;
extern int ldaptool_not;
extern char *ldaptool_progname;
extern FILE *ldaptool_fp;
extern char *ldaptool_charset;
extern char *ldaptool_convdir;
extern LDAPControl *ldaptool_request_ctrls[];
/*
* function prototypes
*/
void ldaptool_common_usage( int two_hosts );
int ldaptool_process_args( int argc, char **argv, char *extra_opts,
int two_hosts, void (*extra_opt_callback)( int option, char *optarg ));
LDAP *ldaptool_ldap_init( int second_host );
void ldaptool_bind( LDAP *ld );
void ldaptool_cleanup( LDAP *ld );
int ldaptool_print_lderror( LDAP *ld, char *msg, int check4ssl );
#define LDAPTOOL_CHECK4SSL_NEVER 0
#define LDAPTOOL_CHECK4SSL_ALWAYS 1
#define LDAPTOOL_CHECK4SSL_IF_APPROP 2 /* if appropriate */
LDAPControl *ldaptool_create_manage_dsait_control( void );
void ldaptool_print_referrals( char **refs );
int ldaptool_print_extended_response( LDAP *ld, LDAPMessage *res, char *msg );
LDAPControl *ldaptool_create_proxyauth_control( LDAP *ld );
void ldaptool_add_control_to_array( LDAPControl *ctrl, LDAPControl **array);
void ldaptool_reset_control_array( LDAPControl **array );
char *ldaptool_get_tmp_dir( void );
char *ldaptool_local2UTF8( const char *s, const char *desc );
int ldaptool_berval_is_ascii( const struct berval *bvp );
int ldaptool_sasl_bind_s( LDAP *ld, const char *dn, const char *mechanism,
const struct berval *cred, LDAPControl **serverctrls,
LDAPControl **clientctrls, struct berval **servercredp, char *msg );
int ldaptool_simple_bind_s( LDAP *ld, const char *dn, const char *passwd,
LDAPControl **serverctrls, LDAPControl **clientctrls, char *msg );
int ldaptool_add_ext_s( LDAP *ld, const char *dn, LDAPMod **attrs,
LDAPControl **serverctrls, LDAPControl **clientctrls, char *msg );
int ldaptool_modify_ext_s( LDAP *ld, const char *dn, LDAPMod **mods,
LDAPControl **serverctrls, LDAPControl **clientctrls, char *msg );
int ldaptool_delete_ext_s( LDAP *ld, const char *dn, LDAPControl **serverctrls,
LDAPControl **clientctrls, char *msg );
int ldaptool_rename_s( LDAP *ld, const char *dn, const char *newrdn,
const char *newparent, int deleteoldrdn, LDAPControl **serverctrls,
LDAPControl **clientctrls, char *msg );
int ldaptool_compare_ext_s( LDAP *ld, const char *dn, const char *attrtype,
const struct berval *bvalue, LDAPControl **serverctrls,
LDAPControl **clientctrls, char *msg );
int ldaptool_boolean_str2value ( const char *s, int strict );
int ldaptool_parse_ctrl_arg ( char *ctrl_arg, char sep, char **ctrl_oid,
int *ctrl_criticality, char **ctrl_value, int *vlen);
FILE *ldaptool_open_file ( const char *filename, const char * mode);
#ifdef __cplusplus
}
#endif
#endif /* LDAPTOOL_H */

View File

@@ -1,130 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/******************************************************
*
* ntuserpin.c - Prompts for the key
* database passphrase.
*
******************************************************/
#if defined( _WIN32 ) && defined ( NET_SSL )
#include <conio.h>
#include "ntuserpin.h"
#undef Debug
#undef OFF
#undef LITTLE_ENDIAN
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
static int i=0;
static int cbRemotePassword = 0;
static const char nt_retryWarning[] =
"Warning: You entered an incorrect PIN.\nIncorrect PIN may result in disabling the token";
static const char prompt[] = "Enter PIN for";
#define SZ_LOCAL_PWD 1024
static char loclpwd[SZ_LOCAL_PWD] = "";
struct SVRCORENTUserPinObj
{
SVRCOREPinObj base;
};
static const struct SVRCOREPinMethods vtable;
/* ------------------------------------------------------------ */
SVRCOREError
SVRCORE_CreateNTUserPinObj(SVRCORENTUserPinObj **out)
{
SVRCOREError err = 0;
SVRCORENTUserPinObj *obj = 0;
do {
obj = (SVRCORENTUserPinObj*)malloc(sizeof (SVRCORENTUserPinObj));
if (!obj) { err = 1; break; }
obj->base.methods = &vtable;
} while(0);
if (err)
{
SVRCORE_DestroyNTUserPinObj(obj);
obj = 0;
}
*out = obj;
return err;
}
void
SVRCORE_DestroyNTUserPinObj(SVRCORENTUserPinObj *obj)
{
if (obj) free(obj);
}
static void destroyObject(SVRCOREPinObj *obj)
{
SVRCORE_DestroyNTUserPinObj((SVRCORENTUserPinObj*)obj);
}
static char *getPin(SVRCOREPinObj *obj, const char *tokenName, PRBool retry)
{
char *pwd;
int ch;
if (retry)
printf("%s\n",nt_retryWarning);
printf("%s %s:", prompt, tokenName);
pwd = &loclpwd[0];
do
{
ch = _getch();
*pwd++ = (char )ch;
} while( ch != '\r' && (pwd < &loclpwd[SZ_LOCAL_PWD - 1]));
*(pwd-1)='\0';
printf("\n");
/* test for zero length password. if zero length, return null */
if ('\0' == loclpwd[0])
return NULL;
return &loclpwd[0];
}
/*
* VTable
*/
static const SVRCOREPinMethods vtable =
{ 0, 0, destroyObject, getPin };
#endif /* defined( _WIN32 ) && defined ( NET_SSL ) */

View File

@@ -1,58 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/******************************************************
*
* ntuserpin.h - Prompts for the key
* database passphrase.
*
******************************************************/
#ifndef _NTUSERPIN_H_
#define _NTUSERPIN_H_
#include "svrcore.h"
typedef struct SVRCORENTUserPinObj SVRCORENTUserPinObj;
SVRCOREError
SVRCORE_CreateNTUserPinObj(SVRCORENTUserPinObj **out);
void
SVRCORE_SetNTUserPinInteractive(SVRCORENTUserPinObj *obj, PRBool interactive);
void
SVRCORE_DestroyNTUserPinObj(SVRCORENTUserPinObj *obj);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,298 +0,0 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-1999
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# UNIX Makefile for Directory SDK examples
#
# SSL examples are not built by default. Use 'make ssl' to build them.
# NSPR examples are not built by default. Use 'make nspr' to build them.
#
###############################################################################
# If you are not building on Solaris, you will need to comment out the
# Solaris section and uncomment the appropriate section for your platform.
#
# Chances are you will need to do a little bit of work in order to get the
# examples to compile. If you are not compiling on Solaris, use the
# Solaris builds as a model for the libraries you need etc. Chances are
# they are the most up-to-date
#
# For Solaris (32 bit)
EXTRACFLAGS=
EXTRALDFLAGS=-lsocket -lnsl
EXTRANSPRLDFLAGS=-mt
SLDAPLIB=ldap50 -lssldap50 -lssl3 -lnss3
LDAPLIB=ldap50
LDAPPRLIB=prldap50
NSPRLIB=nspr4
CC=cc
# For Solaris (64 bit)
#EXTRACFLAGS=
#EXTRALDFLAGS=-lsocket -lnsl
#EXTRANSPRLDFLAGS=-mt
#SLDAPLIB=ldap50 -lssldap50 -lssl3 -lnss3
#LDAPLIB=ldap50
#LDAPPRLIB=prldap50
#NSPRLIB=nspr4
#CC=cc -xarch=v9
# For HP/UX (32 bit)
#EXTRACFLAGS=-Dhpux -D_HPUX_SOURCE -D_REENTRANT -Aa
#EXTRALDFLAGS=-Wl,+s+b
#SLDAPLIB=ldap50 -lssldap50 -lssl3 -lnss3
#LDAPLIB=ldap50
#LDAPPRLIB=prldap50
#NSPRLIB=nspr4
#CC=cc
# For HP/UX (64 bit)
#EXTRACFLAGS=-DHPUX11 -DIS_64 +e +DA2.0W +DChpux +DS2.0
#EXTRACFLAGS+=-D_LARGEFILE64_SOURCE -D_PR_HAVE_OFF64_T
#EXTRALDFLAGS=-lpthread +DA2.0W +DS2.0
#SLDAPLIB=ldap50 -lssldap50 -lssl3 -lnss3
#LDAPLIB=ldap50
#LDAPPRLIB=prldap50
#NSPRLIB=nspr4
#CC=/opt/ansic/bin/cc
# For IRIX
#EXTRACFLAGS=
#EXTRALDFLAGS=
#SLDAPLIB=ldap50 -lssldap50 -lssl3 -lnss3
#LDAPLIB=ldap50
#LDAPPRLIB=prldap50
#NSPRLIB=nspr4
#CC=cc
# For AIX
#EXTRACFLAGS=
#EXTRALDFLAGS=-brtl
#SLDAPLIB=ldap50 -lssldap50 -lssl3 -lnss3
#LDAPLIB=ldap50
#LDAPPRLIB=prldap50
#NSPRLIB=nspr4
#CC=cc
# For Digital UNIX 4.0
#EXTRACFLAGS=
#EXTRALDFLAGS=-taso -rpath ../lib
#SLDAPLIB=ldap50 -lssldap50 -lssl3 -lnss3
#LDAPLIB=ldap50
#LDAPPRLIB=prldap50
#NSPRLIB=nspr4
#CC=cc
# For Linux 2.2
#EXTRACFLAGS=
#EXTRALDFLAGS=-lpthread
#LDAPLIB=ldapssl50
#LDAPLIB=ldap50
#LDAPPRLIB=prldap50
#NSPRLIB=nspr4
#CC=gcc
###############################################################################
# You should not need to change anything below here....
INTERNAL_LIBLDAP_HEADERS=$(wildcard ../libraries/libldap/*.h)
ifeq (,$(findstring h, $(INTERNAL_LIBLDAP_HEADERS)))
IN_SRC_TREE=0
else
IN_SRC_TREE=1
endif
ifneq ($(IN_SRC_TREE),1)
# we are not in the C SDK source tree... so must be in a binary distribution
INCDIR=../include
LIBDIR=../lib
NSPRINCDIR=../include
NSPRLIBDIR=../lib
else
# we are in the C SDK source tree... paths to headers and libs are different
NS_DEPTH = ../../..
LDAP_SRC = ..
NSCP_DISTDIR = ../../../../dist
NSPR_TREE = ../..
MOD_DEPTH = ../..
ifeq ($(HAVE_CCONF), 1)
COMPS_FROM_OBJDIR=1
endif
include $(NSPR_TREE)/config/config.mk
ifeq ($(COMPS_FROM_OBJDIR),1)
NSPR_DISTDIR=$(NSCP_DISTDIR)/$(OBJDIR_NAME)
else
NSPR_DISTDIR=$(NSCP_DISTDIR)
endif
INCDIR=$(NSCP_DISTDIR)/public/ldap
LIBDIR=$(NSCP_DISTDIR)/$(OBJDIR_NAME)/lib
NSPRINCDIR=$(NSPR_DISTDIR)/include
NSPRLIBDIR=$(NSPR_DISTDIR)/lib
endif
LIBS=-L$(LIBDIR) -l$(LDAPLIB) $(EXTRALDFLAGS)
NSPRLIBS=$(EXTRANSPRLDFLAGS) -L$(NSPRLIBDIR) -l$(NSPRLIB) -l$(LDAPPRLIB)
SLIBS=-L$(LIBDIR) $(NSPRLIBS) -l$(SLDAPLIB) $(EXTRALDFLAGS)
OPTFLAGS=-g
CFLAGS=$(OPTFLAGS) -I$(INCDIR) -I$(NSPRINCDIR) $(EXTRACFLAGS)
NSPRCFLAGS=-I$(NSPRINCDIR)
PROGS=search asearch csearch psearch rdentry getattrs srvrsort modattrs add del compare modrdn ppolicy getfilt crtfilt
SSLPROGS=ssnoauth ssearch
NSPRPROGS=nsprio
ALLPROGS= $(PROGS) $(SSLPROGS) $(NSPRPROGS)
standard: $(PROGS)
ssl: $(SSLPROGS)
nspr: $(NSPRPROGS)
all: $(ALLPROGS)
purify: $(PROGS)
make clean; make CC="purify $(CC)"
search: search.o
$(CC) -o search search.o $(LIBS)
search.o: examples.h
csearch: csearch.o
$(CC) -o csearch csearch.o $(LIBS)
csearch.o: examples.h
psearch: psearch.o
$(CC) -o psearch psearch.o $(LIBS)
psearch.o: examples.h
ssearch: ssearch.o
$(CC) -o ssearch ssearch.o $(SLIBS)
ssearch.o: examples.h
ssnoauth: ssnoauth.o
$(CC) -o ssnoauth ssnoauth.o $(SLIBS)
ssnoauth.o: examples.h
rdentry: rdentry.o
$(CC) -o rdentry rdentry.o $(LIBS)
rdentry.o: examples.h
getattrs: getattrs.o
$(CC) -o getattrs getattrs.o $(LIBS)
getattrs.o: examples.h
srvrsort: srvrsort.o
$(CC) -o srvrsort srvrsort.o $(LIBS)
srvrsort.o: examples.h
modattrs: modattrs.o
$(CC) -o modattrs modattrs.o $(LIBS)
modattrs.o: examples.h
asearch: asearch.o
$(CC) -o asearch asearch.o $(LIBS)
asearch.o: examples.h
add: add.o
$(CC) -o add add.o $(LIBS)
add.o: examples.h
del: del.o
$(CC) -o del del.o $(LIBS)
del.o: examples.h
compare: compare.o
$(CC) -o compare compare.o $(LIBS)
compare.o: examples.h
modrdn: modrdn.o
$(CC) -o modrdn modrdn.o $(LIBS)
modrdn.o: examples.h
ppolicy: ppolicy.o
$(CC) -o ppolicy ppolicy.o $(LIBS)
ppolicy.o: examples.h
getfilt: getfilt.o
$(CC) -o getfilt getfilt.o $(LIBS)
getfilt.o: examples.h
crtfilt: crtfilt.o
$(CC) -o crtfilt crtfilt.o $(LIBS)
crtfilt.o: examples.h
nsprio: nsprio.o
$(CC) -o nsprio nsprio.o $(LIBS) $(NSPRLIBS)
nsprio.o: examples.h
runall: $(PROGS)
@for i in $(PROGS); do \
echo "-------------------------------------------------"; \
echo "Executing $$i example..."; \
./$$i; \
echo "$$i example done."; \
done
clean:
/bin/rm -f $(ALLPROGS) *.o a.out core

View File

@@ -1,169 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-1999
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
Directory SDK Examples
----------------------
This directory contains some sample LDAP code to help you understand
how to use the Directory SDK. These examples are designed to work against
the sample data contained in the Netscape Directory Server 4.x
distribution. If you want to run these samples, you will need to have
a working LDAP server running, and the sample "example.com" data
loaded.
-------------------
Synchronous samples
-------------------
These samples use the synchronous LDAP calls. These calls are more
straightforward to use, and it's suggested you look at these examples
first. These calls will block the calling process until all results
have been returned, so they are probably not appropriate for use in a
client with a graphical user interface which relies an an event loop.
However, they're fine for command-line clients and CGI programs.
search.c
--------
Shows how to use ldap_search_s() to search for all entries which have
an attribute value which exactly matches what you're searching for. In
this example, all entries with the surname (last name) "Jensen" are
retrieved and displayed.
csearch.c
---------
Like search.c, but enables an in-memory cache.
ssnoauth.c
----------
Like search.c, but the search is done over SSL.
ssearch.c
---------
Like ssnoauth.c, but with certificate based authentication thrown in.
srvrsort.c
----------
Shows how to use server side sorting in conjunction with the
ldap_search_ext_s() function.
rdentry.c
---------
Shows how to use ldap_search_s() to retrieve a particular entry from the
directory. In this example, the entry:
uid=bjensen,ou=People,dc=example,dc=com
is retrieved and displayed.
getattrs.c
----------
Just like read.c, but retrieves specific attributes from an entry.
compare.c
---------
Show how to use ldap_compare_s(), which allows you to test if a particular
value is contained in an attribute of an entry.
modattrs.c
----------
Shows how to use ldap_modify_s() to replace and add to values in an attribute.
modrdn.c
--------
Shows how to use ldap_modrdn2_s() to change the relative distinguished name
(rdn) of an entry.
getfilt.c
---------
Shows how to use the ldap_getfilter family of routines, which help generate
LDAP filters based on an arbitrary search string provided by a user.
crtfilt.c
---------
Shows how to use the ldap_create_filter() function to generate LDAP filters.
---------------------
Asynchronous examples
---------------------
These examples use the asynchronous LDAP calls. The general idea is that
you begin an operation, and then periodically poll to see if any results
have been returned.
asearch.c
---------
Initiates a search for entries, and polls for results, printing them as
they arrive.
nsprio.c
--------
Like asearch.c but using the prldap routines to incorporate NSPR.
add.c
------
Add an entry to the directory.
del.c
------
Delete an entry from the directory.
psearch.c
---------
Shows how to use the Persistent Search LDAPv3 protocol extension to
monitor a directory server for changes.
ppolicy.c
---------
Attempt to bind to the directory, and report back any password expiration
information received. This demonstrates how clients can process password
policy information that is optionally returned by Netscape Directory Server
3.0 and later.
-------------------
Additional examples
-------------------
The Macintosh or Windows versions of the Directory SDK also include
sample project files. A sample CodeWarrior project file is included
in the macintosh directory.
Sample Visual C++ makefiles for a Windows application (winldap) are
included in the windows directory. The Win32 version of the makefile
is named winldap.mak; the Win16 version of the makefile is named LDAP16.MAK.
If you want to fix up the additional examples and recontribute them back
to mozilla they will gladly be accepted :-)

View File

@@ -1,190 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* Add a new entry to the directory.
*
* Instead of calling the synchronous ldap_add_s() routine, we call
* the asynchronous routine ldap_add() and poll for results using
* ldap_result().
*
* Since it is an error to attempt to add an entry which already exists,
* you cannot run this example program twice in a row. You can use the
* adel.c example program to delete the entry which this example adds.
*
*/
#include "examples.h"
static void do_other_work();
unsigned long global_counter = 0;
static void free_mods( LDAPMod **mods );
#define NMODS 5
int
main( int argc, char **argv )
{
LDAP *ld;
LDAPMessage *result;
char *dn;
int i;
int rc;
int msgid;
int finished;
struct timeval zerotime;
LDAPMod **mods;
char *objectclass_values[] = { "top", "person", "organizationalPerson",
"inetOrgPerson", NULL };
char *cn_values[] = { "William B Jensen", "William Jensen", "Bill Jensen",
NULL };
char *sn_values[] = { "Jensen", NULL };
char *givenname_values[] = { "William", "Bill", NULL };
char *telephonenumber_values[] = { "+1 415 555 1212", NULL };
zerotime.tv_sec = zerotime.tv_usec = 0L;
/* Specify the DN we're adding */
dn = "cn=William B Jensen, " PEOPLE_BASE; /* see examples.h */
/* get a handle to an LDAP connection */
if ( (ld = ldap_init( MY_HOST, MY_PORT )) == NULL ) {
perror( "ldap_init" );
return( 1 );
}
/* authenticate to the directory as the Directory Manager */
if ( ldap_simple_bind_s( ld, MGR_DN, MGR_PW ) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_simple_bind_s" );
return( 1 );
}
/* Construct the array of values to add */
mods = ( LDAPMod ** ) malloc(( NMODS + 1 ) * sizeof( LDAPMod * ));
if ( mods == NULL ) {
fprintf( stderr, "Cannot allocate memory for mods array\n" );
}
for ( i = 0; i < NMODS; i++ ) {
if (( mods[ i ] = ( LDAPMod * ) malloc( sizeof( LDAPMod ))) == NULL ) {
fprintf( stderr, "Cannot allocate memory for mods element\n" );
exit( 1 );
}
}
mods[ 0 ]->mod_op = 0;
mods[ 0 ]->mod_type = "objectclass";
mods[ 0 ]->mod_values = objectclass_values;
mods[ 1 ]->mod_op = 0;
mods[ 1 ]->mod_type = "cn";
mods[ 1 ]->mod_values = cn_values;
mods[ 2 ]->mod_op = 0;
mods[ 2 ]->mod_type = "sn";
mods[ 2 ]->mod_values = sn_values;
mods[ 3 ]->mod_op = 0;
mods[ 3 ]->mod_type = "givenname";
mods[ 3 ]->mod_values = givenname_values;
mods[ 4 ]->mod_op = 0;
mods[ 4 ]->mod_type = "telephonenumber";
mods[ 4 ]->mod_values = telephonenumber_values;
mods[ 5 ] = NULL;
/* Initiate the add operation */
if (( msgid = ldap_add( ld, dn, mods )) < 0 ) {
ldap_perror( ld, "ldap_add" );
free_mods( mods );
return( 1 );
}
/* Poll for the result */
finished = 0;
while ( !finished ) {
rc = ldap_result( ld, msgid, LDAP_MSG_ONE, &zerotime, &result );
switch ( rc ) {
case -1:
/* some error occurred */
ldap_perror( ld, "ldap_result" );
free_mods( mods );
return( 1 );
case 0:
/* Timeout was exceeded. No entries are ready for retrieval */
break;
default:
/* Should be finished here */
finished = 1;
if (( rc = ldap_result2error( ld, result, 0 )) == LDAP_SUCCESS ) {
printf( "Entry added successfully. I counted to %ld "
"while waiting.\n", global_counter );
} else {
printf( "Error while adding entry: %s\n",
ldap_err2string( rc ));
}
ldap_msgfree( result );
}
do_other_work();
}
ldap_unbind( ld );
free_mods( mods );
return 0;
}
/*
* Free a mods array.
*/
static void
free_mods( LDAPMod **mods )
{
int i;
for ( i = 0; i < NMODS; i++ ) {
free( mods[ i ] );
}
free( mods );
}
/*
* Perform other work while polling for results. This doesn't do anything
* useful, but it could.
*/
static void
do_other_work()
{
global_counter++;
}

View File

@@ -1,166 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* Search the directory for all people whose surname (last name) is
* "Jensen". Since the "sn" attribute is a caseignorestring (cis), case
* is not significant when searching.
*
* Instead of calling the synchronous ldap_search_s() routine, we call
* the asynchronous routine ldap_search() and poll for results using
* ldap_result().
*
*/
#include "examples.h"
static void do_other_work();
unsigned long global_counter = 0;
int
main( int argc, char **argv )
{
LDAP *ld;
LDAPMessage *result, *e;
BerElement *ber;
char *a, *dn;
char **vals;
int i;
int rc;
int finished;
int msgid;
int num_entries = 0;
struct timeval zerotime;
zerotime.tv_sec = zerotime.tv_usec = 0L;
/* get a handle to an LDAP connection */
if ( (ld = ldap_init( MY_HOST, MY_PORT )) == NULL ) {
perror( "ldap_init" );
return( 1 );
}
/* authenticate to the directory as nobody */
if ( ldap_simple_bind_s( ld, NULL, NULL ) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_simple_bind_s" );
return( 1 );
}
/* search for all entries with surname of Jensen */
if (( msgid = ldap_search( ld, MY_SEARCHBASE, LDAP_SCOPE_SUBTREE,
MY_FILTER, NULL, 0 )) < 0 ) {
ldap_perror( ld, "ldap_search" );
return( 1 );
}
/* Loop, polling for results until finished */
finished = 0;
while ( !finished ) {
/*
* Poll for results. We call ldap_result with the "all" argument
* set to LDAP_MSG_ONE. This causes ldap_result() to return exactly one
* entry if at least one entry is available. This allows us to
* display the entries as they are received.
*/
result = NULL;
rc = ldap_result( ld, msgid, LDAP_MSG_ONE, &zerotime, &result );
switch ( rc ) {
case -1:
/* some error occurred */
ldap_perror( ld, "ldap_result" );
return( 1 );
case 0:
/* Timeout was exceeded. No entries are ready for retrieval. */
if ( result != NULL ) {
ldap_msgfree( result );
}
break;
default:
/*
* Either an entry is ready for retrieval, or all entries have
* been retrieved.
*/
if (( e = ldap_first_entry( ld, result )) == NULL ) {
/* All done */
finished = 1;
if ( result != NULL ) {
ldap_msgfree( result );
}
continue;
}
/* for each entry print out name + all attrs and values */
num_entries++;
if (( dn = ldap_get_dn( ld, e )) != NULL ) {
printf( "dn: %s\n", dn );
ldap_memfree( dn );
}
for ( a = ldap_first_attribute( ld, e, &ber );
a != NULL; a = ldap_next_attribute( ld, e, ber ) ) {
if (( vals = ldap_get_values( ld, e, a )) != NULL ) {
for ( i = 0; vals[ i ] != NULL; i++ ) {
printf( "%s: %s\n", a, vals[ i ] );
}
ldap_value_free( vals );
}
ldap_memfree( a );
}
if ( ber != NULL ) {
ber_free( ber, 0 );
}
printf( "\n" );
ldap_msgfree( result );
}
/* Do other work here while you are waiting... */
do_other_work();
}
/* All done. Print a summary. */
printf( "%d entries retrieved. I counted to %ld "
"while I was waiting.\n", num_entries,
global_counter );
ldap_unbind( ld );
return( 0 );
}
/*
* Perform other work while polling for results. This doesn't do anything
* useful, but it could.
*/
static void
do_other_work()
{
global_counter++;
}

View File

@@ -1,99 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* Use ldap_compare() to compare values agains values contained in entry
* ENTRYDN (defined in examples.h)
* We test to see if (1) the value "person" is one of the values in the
* objectclass attribute (it is), and if (2) the value "xyzzy" is in the
* objectlass attribute (it isn't, or at least, it shouldn't be).
*
*/
#include "examples.h"
int
main( int main, char **argv )
{
LDAP *ld;
int rc;
/* get a handle to an LDAP connection */
if ( (ld = ldap_init( MY_HOST, MY_PORT )) == NULL ) {
perror( "ldap_init" );
return( 1 );
}
/* authenticate to the directory as nobody */
if ( ldap_simple_bind_s( ld, NULL, NULL ) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_simple_bind_s" );
return( 1 );
}
/* compare the value "person" against the objectclass attribute */
rc = ldap_compare_s( ld, ENTRYDN, "objectclass", "person" );
switch ( rc ) {
case LDAP_COMPARE_TRUE:
printf( "The value \"person\" is contained in the objectclass "
"attribute.\n" );
break;
case LDAP_COMPARE_FALSE:
printf( "The value \"person\" is not contained in the objectclass "
"attribute.\n" );
break;
default:
ldap_perror( ld, "ldap_compare_s" );
}
/* compare the value "xyzzy" against the objectclass attribute */
rc = ldap_compare_s( ld, ENTRYDN, "objectclass", "xyzzy" );
switch ( rc ) {
case LDAP_COMPARE_TRUE:
printf( "The value \"xyzzy\" is contained in the objectclass "
"attribute.\n" );
break;
case LDAP_COMPARE_FALSE:
printf( "The value \"xyzzy\" is not contained in the objectclass "
"attribute.\n" );
break;
default:
ldap_perror( ld, "ldap_compare_s" );
}
ldap_unbind( ld );
return( 0 );
}

Some files were not shown because too many files have changed in this diff Show More