This commit was manufactured by cvs2svn to create tag 'pwd'.
git-svn-id: svn://10.0.0.236/tags/pwd@105972 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
5d3df9f2ef
commit
7c28cbdd07
@ -1,196 +0,0 @@
|
|||||||
#
|
|
||||||
# The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
|
|
||||||
LDAP_DEPTH = .
|
|
||||||
NSPR_TREE = ../nsprpub
|
|
||||||
NSS_TREE = ../security
|
|
||||||
MOD_DEPTH = ../nsprpub
|
|
||||||
CORECONFDIR = ../coreconf
|
|
||||||
ALTCORECONFDIR = ../../coreconf
|
|
||||||
NSPR_VERSION = 4.1.2
|
|
||||||
NSS_VERSION = 3.3.1
|
|
||||||
DEPTH = ..
|
|
||||||
CONFIGDIR = c-sdk/config
|
|
||||||
MOD_DEPTH = c-sdk
|
|
||||||
|
|
||||||
include $(CONFIGDIR)/config.mk
|
|
||||||
include c-sdk/build.mk
|
|
||||||
|
|
||||||
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 " VENDOR_NAME=string SDK vendor name (default $(DEFAULT_VENDOR_NAME))"
|
|
||||||
@echo " VENDOR_VERSION=# vendor specific version number * 100 (default $(DEFAULT_VENDOR_VERSION))"
|
|
||||||
@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 " HAVE_SVRCORE=1 for building with svrcore"
|
|
||||||
@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"
|
|
||||||
|
|
||||||
@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; \
|
|
||||||
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
|
|
||||||
ifeq ($(OS_ARCH), WINNT)
|
|
||||||
# cd $(CORECONFDIR)/dbm; \
|
|
||||||
# $(MAKE) VERSION=$(DBM_RELEASE_TAG) $(MFLAGS) USE_FTP=YES import
|
|
||||||
cd $(CORECONFDIR)/nspr20; \
|
|
||||||
$(MAKE) VERSION=$(NSPR_RELEASE_TAG) $(MFLAGS) USE_FTP=YES import
|
|
||||||
cd $(CORECONFDIR)/security; \
|
|
||||||
$(MAKE) VERSION=$(NSS_RELEASE_TAG) $(MFLAGS) USE_FTP=YES import
|
|
||||||
cd $(CORECONFDIR)/svrcore; \
|
|
||||||
$(MAKE) VERSION=$(SVRCORE_RELEASE_TAG) $(MFLAGS) USE_FTP=YES import
|
|
||||||
else
|
|
||||||
# cd $(CORECONFDIR)/dbm; \
|
|
||||||
# $(MAKE) VERSION=$(DBM_RELEASE_TAG) $(MFLAGS) import
|
|
||||||
cd $(CORECONFDIR)/nspr20; \
|
|
||||||
$(MAKE) VERSION=$(NSPR_RELEASE_TAG) $(MFLAGS) import
|
|
||||||
cd $(CORECONFDIR)/security; \
|
|
||||||
$(MAKE) VERSION=$(NSS_RELEASE_TAG) $(MFLAGS) import
|
|
||||||
cd $(CORECONFDIR)/svrcore; \
|
|
||||||
$(MAKE) VERSION=$(SVRCORE_RELEASE_TAG) $(MFLAGS) import
|
|
||||||
endif
|
|
||||||
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 cleanconfig; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
FORCE:
|
|
||||||
@ -1,489 +0,0 @@
|
|||||||
#
|
|
||||||
# The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
|
|
||||||
DEFAULT_VENDOR_NAME=mozilla.org
|
|
||||||
DEFAULT_VENDOR_VERSION=500
|
|
||||||
|
|
||||||
ifndef VENDOR_NAME
|
|
||||||
VENDOR_NAME = $(DEFAULT_VENDOR_NAME)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef VENDOR_VERSION
|
|
||||||
VENDOR_VERSION = $(DEFAULT_VENDOR_VERSION)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
ifdef HAVE_CCONF
|
|
||||||
# component tags for internal build only
|
|
||||||
NSPR_RELEASE_TAG=v4.1.2
|
|
||||||
NSS_RELEASE_TAG =NSS_3_3_1_RTM
|
|
||||||
SVRCORE_RELEASE_TAG=SVRCORE_3_3_RTM
|
|
||||||
# NSPR, NSS, and SVRCORE already had existing Solaris 5.8 symbolic
|
|
||||||
# link to a Solaris 5.6 version. Hence, the new respun components
|
|
||||||
# were put in in a forte6 directory in each of the component
|
|
||||||
# respectively. For Solaris 5.8 only we have to pick up the components
|
|
||||||
# from the forte6 directory. As we move forward with new components,
|
|
||||||
# we can take the mess below out
|
|
||||||
# Michael.....
|
|
||||||
ifeq ($(OS_ARCH), SunOS)
|
|
||||||
ifneq ($(USE_64), 1)
|
|
||||||
OS_VERS := $(shell uname -r)
|
|
||||||
ifeq ($(OS_VERS),5.8)
|
|
||||||
ifneq ($(OS_TEST),i86pc)
|
|
||||||
NSPR_RELEASE_TAG=v4.1.2/forte6
|
|
||||||
NSS_RELEASE_TAG =NSS_3_3_1_RTM/forte6
|
|
||||||
SVRCORE_RELEASE_TAG=SVRCORE_3_3_RTM/forte6
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Ldap library
|
|
||||||
LDAPVERS = 50
|
|
||||||
LDAPVERS_SUFFIX = 5.0
|
|
||||||
ifeq ($(OS_ARCH), WINNT)
|
|
||||||
LDAP_LIBNAME = nsldap32v$(LDAPVERS)
|
|
||||||
else
|
|
||||||
LDAP_LIBNAME = ldap$(LDAPVERS)
|
|
||||||
endif
|
|
||||||
DIR_VERSION = $(LDAPVERS_SUFFIX)
|
|
||||||
DIRSDK_VERSION = $(LDAPVERS_SUFFIX)
|
|
||||||
|
|
||||||
# PrLdap library
|
|
||||||
PRLDAPVERS = 50
|
|
||||||
PRLDAPVERS_SUFFIX= 5.0
|
|
||||||
ifeq ($(OS_ARCH), WINNT)
|
|
||||||
PRLDAP_LIBNAME = nsldappr32v$(PRLDAPVERS)
|
|
||||||
else
|
|
||||||
PRLDAP_LIBNAME = prldap$(PRLDAPVERS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# lber library
|
|
||||||
LBERVERS = 50
|
|
||||||
LBERVERS_SUFFIX = 5.0
|
|
||||||
ifeq ($(OS_ARCH), WINNT)
|
|
||||||
LBER_LIBNAME = nslber32v$(LBERVERS)
|
|
||||||
else
|
|
||||||
LBER_LIBNAME = lber$(LBERVERS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# ldif library
|
|
||||||
LDIFVERS = 50
|
|
||||||
LDIFVERS_SUFFIX = 5.0
|
|
||||||
ifeq ($(OS_ARCH), WINNT)
|
|
||||||
LDIF_LIBNAME = nsldif32v$(LDIFVERS)
|
|
||||||
else
|
|
||||||
LDIF_LIBNAME = ldif$(LDIFVERS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# iutil library
|
|
||||||
IUTILVERS = 50
|
|
||||||
IUTILVERS_SUFFIX = 5.0
|
|
||||||
ifeq ($(OS_ARCH), WINNT)
|
|
||||||
IUTIL_LIBNAME = nsiutil32v$(IUTILVERS)
|
|
||||||
else
|
|
||||||
IUTIL_LIBNAME = iutil$(IUTILVERS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# util library
|
|
||||||
UTILVERS = 50
|
|
||||||
UTILVERS_SUFFIX = 5.0
|
|
||||||
ifeq ($(OS_ARCH), WINNT)
|
|
||||||
UTIL_LIBNAME = nsutil32v$(UTILVERS)
|
|
||||||
else
|
|
||||||
UTIL_LIBNAME = util$(UTILVERS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# ssl library
|
|
||||||
SSLDAPVERS = 50
|
|
||||||
SSLDAPVERS_SUFFIX = 5.0
|
|
||||||
ifeq ($(OS_ARCH), WINNT)
|
|
||||||
SSLDAP_LIBNAME = nsldapssl32v$(SSLDAPVERS)
|
|
||||||
else
|
|
||||||
SSLDAP_LIBNAME = ssldap$(SSLDAPVERS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# nss library
|
|
||||||
NSSVERS = 3
|
|
||||||
NSS_LIBNAME = nss$(NSSVERS)
|
|
||||||
SSL_LIBNAME = ssl$(NSSVERS)
|
|
||||||
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)
|
|
||||||
COPYFREEBL = 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# svrcore library
|
|
||||||
SVRCOREVERS =
|
|
||||||
SVRCOREVERS_SUFFIX =
|
|
||||||
SVRCORE_LIBNAME = svrcore$(SVRCOREVERS)
|
|
||||||
|
|
||||||
#
|
|
||||||
# NSPR library
|
|
||||||
#
|
|
||||||
|
|
||||||
NSPR_LIBVERSION=4
|
|
||||||
ifeq ($(OS_TARGET), WIN95)
|
|
||||||
PLC_BASENAME=plc$(NSPR_LIBVERSION)
|
|
||||||
PLDS_BASENAME=plds$(NSPR_LIBVERSION)
|
|
||||||
NSPR_BASENAME=nspr$(NSPR_LIBVERSION)
|
|
||||||
else
|
|
||||||
PLC_BASENAME=libplc$(NSPR_LIBVERSION)
|
|
||||||
PLDS_BASENAME=libplds$(NSPR_LIBVERSION)
|
|
||||||
NSPR_BASENAME=libnspr$(NSPR_LIBVERSION)
|
|
||||||
endif
|
|
||||||
|
|
||||||
PLCBASE=plc$(NSPR_LIBVERSION)
|
|
||||||
PLDSBASE=plds$(NSPR_LIBVERSION)
|
|
||||||
NSPRBASE=nspr$(NSPR_LIBVERSION)
|
|
||||||
|
|
||||||
DYNAMICNSPR = -l$(PLCBASE) -l$(PLDSBASE) -l$(NSPRBASE)
|
|
||||||
|
|
||||||
PLC_LIBNAME=plc$(NSPR_LIBVERSION)
|
|
||||||
PLDS_LIBNAME=plds$(NSPR_LIBVERSION)
|
|
||||||
NSPR_LIBNAME=nspr$(NSPR_LIBVERSION)
|
|
||||||
|
|
||||||
#
|
|
||||||
# NLS library
|
|
||||||
#
|
|
||||||
NLS_LIBVERSION =31
|
|
||||||
LIBNLS_RELDATE=v3.2
|
|
||||||
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
|
|
||||||
|
|
||||||
ifdef RELEASE_TREE
|
|
||||||
LIBNLS_INCLUDES_LOC = $(RELEASE_TREE)/libnls$(NLS_LIBVERSION)/v3.2/$(OBJDIR_NAME)/include
|
|
||||||
LIBNLS_LIB_LOC = $(RELEASE_TREE)/libnls$(NLS_LIBVERSION)/v3.2/$(OBJDIR_NAME)/lib
|
|
||||||
else
|
|
||||||
LIBNLS_INCLUDES_LOC = /share/builds/components/libnls$(NLS_LIBVERSION)/v3.2/$(OBJDIR_NAME)/include
|
|
||||||
LIBNLS_LIB_LOC = /share/builds/components/libnls$(NLS_LIBVERSION)/v3.2/$(OBJDIR_NAME)/lib
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), SunOS)
|
|
||||||
ifneq ($(USE_64), 1)
|
|
||||||
OS_VERS := $(shell uname -r)
|
|
||||||
ifeq ($(OS_VERS),5.8)
|
|
||||||
ifneq ($(OS_TEST),i86pc)
|
|
||||||
LIBNLS_INCLUDES_LOC = /share/builds/components/libnls$(NLS_LIBVERSION)/v3.2/forte6/$(OBJDIR_NAME)/include
|
|
||||||
LIBNLS_LIB_LOC = /share/builds/components/libnls$(NLS_LIBVERSION)/v3.2/forte6/$(OBJDIR_NAME)/lib
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
|
||||||
LIBNLS_DIR = ../../../../../dist/libnls$(NLS_LIBVERSION)
|
|
||||||
ifeq ($(OS_ARCH), WINNT)
|
|
||||||
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
|
|
||||||
OFFLAG=/Fo
|
|
||||||
else
|
|
||||||
OFFLAG=-o
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), Linux)
|
|
||||||
DEFS += -DLINUX2_0 -DLINUX1_2 -DLINUX2_1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), WINNT)
|
|
||||||
DLLEXPORTS_PREFIX=/DEF:
|
|
||||||
USE_DLL_EXPORTS_FILE = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), SunOS)
|
|
||||||
DLLEXPORTS_PREFIX=-Blocal -M
|
|
||||||
USE_DLL_EXPORTS_FILE = 1
|
|
||||||
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
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),UnixWare)
|
|
||||||
DL=
|
|
||||||
endif
|
|
||||||
|
|
||||||
RPATHFLAG = ..:../lib:../../lib:../../../lib:../../../../lib
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), SunOS)
|
|
||||||
# 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,-R,
|
|
||||||
|
|
||||||
# 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)
|
|
||||||
# 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)
|
|
||||||
# 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)
|
|
||||||
# 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
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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)
|
|
||||||
|
|
||||||
DEBUG_LINK_OPT=/DEBUG:FULL
|
|
||||||
ifeq ($(BUILD_OPT), 1)
|
|
||||||
DEBUG_LINK_OPT=
|
|
||||||
endif
|
|
||||||
|
|
||||||
SUBSYSTEM=CONSOLE
|
|
||||||
LINK_EXE = link $(DEBUG_LINK_OPT) -OUT:"$@" /MAP $(ALDFLAGS) $(LDFLAGS) $(ML_DEBUG) \
|
|
||||||
$(LCFLAGS) /NOLOGO /PDB:NONE /DEBUGTYPE:BOTH /INCREMENTAL:NO \
|
|
||||||
/NODEFAULTLIB:MSVCRTD /SUBSYSTEM:$(SUBSYSTEM) $(DEPLIBS) \
|
|
||||||
$(EXTRA_LIBS) $(PLATFORMLIBS) $(OBJS)
|
|
||||||
LINK_LIB = lib -OUT:"$@" $(OBJS)
|
|
||||||
LINK_DLL = link $(DEBUG_LINK_OPT) /nologo /MAP /DLL /PDB:NONE /DEBUGTYPE:BOTH \
|
|
||||||
$(ML_DEBUG) /SUBSYSTEM:$(SUBSYSTEM) $(LLFLAGS) $(DLL_LDFLAGS) \
|
|
||||||
$(EXTRA_LIBS) /out:"$@" $(OBJS)
|
|
||||||
else # WINNT
|
|
||||||
#
|
|
||||||
# UNIX link commands
|
|
||||||
#
|
|
||||||
LINK_LIB = $(RM) $@; $(AR) $(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) $(ALDFLAGS) $(DLL_LDFLAGS) $(DLL_EXPORT_FLAGS) \
|
|
||||||
-o $@ $(OBJS)
|
|
||||||
endif # SONAMEFLAG_PREFIX
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
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 = $(CCC) -Wl,-E $(ALDFLAGS) $(LDFLAGS) $(RPATHFLAG_PREFIX)$(RPATHFLAG) -o $@ $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
|
|
||||||
|
|
||||||
ifeq ($(USE_64), 1)
|
|
||||||
LINK_EXE = $(CCC) -DHPUX_ACC -D__STDC_EXT__ -D_POSIX_C_SOURCE=199506L +DA2.0W +DS2.0 -Wl,-E $(ALDFLAGS) $(LDFLAGS) $(RPATHFLAG_PREFIX)$(RPATHFLAG) -o $@ $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
else # HP-UX
|
|
||||||
# everything except HPUX
|
|
||||||
ifeq ($(OS_ARCH), ReliantUNIX)
|
|
||||||
# Use the C++ compiler for linking if at least ONE object is C++
|
|
||||||
export LD_RUN_PATH=$(RPATHFLAG)
|
|
||||||
LINK_EXE = $(CXX) $(ALDFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
|
|
||||||
|
|
||||||
else # ReliantUNIX
|
|
||||||
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) $(ALDFLAGS) $(LDFLAGS) \
|
|
||||||
-o $@ $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
|
|
||||||
LINK_EXE_NOLIBSOBJS = $(CC) $(ALDFLAGS) $(LDFLAGS) -o $@
|
|
||||||
else # USE_LD_RUN_PATH
|
|
||||||
LINK_EXE = $(CC) $(ALDFLAGS) $(LDFLAGS) \
|
|
||||||
$(RPATHFLAG_PREFIX)$(RPATHFLAG)$(RPATHFLAG_EXTRAS) \
|
|
||||||
-o $@ $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
|
|
||||||
LINK_EXE_NOLIBSOBJS = $(CC) $(ALDFLAGS) $(LDFLAGS) \
|
|
||||||
$(RPATHFLAG_PREFIX)$(RPATHFLAG)$(RPATHFLAG_EXTRAS) -o $@
|
|
||||||
endif # USE_LD_RUN_PATH
|
|
||||||
endif # ReliantUNIX
|
|
||||||
endif # HP-UX
|
|
||||||
endif # WINNT
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), OSF1)
|
|
||||||
LINK_EXE = $(CCC) $(ALDFLAGS) $(LDFLAGS) $(RPATHFLAG_PREFIX)$(RPATHFLAG) \
|
|
||||||
-o $@ $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), SunOS)
|
|
||||||
ifeq ($(USE_64), 1)
|
|
||||||
LINK_EXE = $(CCC) $(ALDFLAGS) $(LDFLAGS) -R:$(RPATHFLAG)\
|
|
||||||
-o $@ $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
PERL = perl
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
|
|
||||||
@ -1,175 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
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
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,138 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
|
||||||
# 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
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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++
|
|
||||||
@ -1,211 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# Config stuff for HP-UX
|
|
||||||
#
|
|
||||||
|
|
||||||
include $(MOD_DEPTH)/config/UNIX.mk
|
|
||||||
|
|
||||||
DLL_SUFFIX = sl
|
|
||||||
|
|
||||||
ifeq ($(NS_USE_GCC), 1)
|
|
||||||
CC = gcc
|
|
||||||
CCC = g++
|
|
||||||
OS_CFLAGS =
|
|
||||||
COMPILER_TAG = _gcc
|
|
||||||
else
|
|
||||||
CC = cc -Ae
|
|
||||||
CCC = CC -ext
|
|
||||||
OS_CFLAGS = +ESlit
|
|
||||||
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,$(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)
|
|
||||||
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
|
|
||||||
|
|
||||||
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
|
|
||||||
@ -1,158 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,133 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
######################################################################
|
|
||||||
# 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
|
|
||||||
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
|
|
||||||
@ -1,137 +0,0 @@
|
|||||||
#! gmake
|
|
||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
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 ($(USE_64),1)
|
|
||||||
XLDOPTS += +DA2.0W
|
|
||||||
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:
|
|
||||||
@ -1,129 +0,0 @@
|
|||||||
#! gmake
|
|
||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
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 = nsprincl.mk nsprincl.sh
|
|
||||||
|
|
||||||
include $(topsrcdir)/config/config.mk
|
|
||||||
|
|
||||||
CSRCS = nsinstall.c now.c
|
|
||||||
|
|
||||||
PLSRCS = nfspwd.pl
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), WINNT)
|
|
||||||
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 ($(USE_64),1)
|
|
||||||
XLDOPTS += +DA2.0W
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef XP_OS2_EMX
|
|
||||||
XCFLAGS = $(OS_EXE_CFLAGS)
|
|
||||||
XLDOPTS = -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 ($(OS_ARCH),WINNT)
|
|
||||||
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
|
|
||||||
@ -1,97 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
###
|
|
||||||
|
|
||||||
@ -1,61 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
######################################################################
|
|
||||||
# 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
|
|
||||||
@ -1,68 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,90 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1999-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
######################################################################
|
|
||||||
# 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
|
|
||||||
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
endif
|
|
||||||
|
|
||||||
DSO_CFLAGS = -fPIC -DPIC
|
|
||||||
DSO_LDOPTS = -x -shared
|
|
||||||
|
|
||||||
ifdef LIBRUNPATH
|
|
||||||
DSO_LDOPTS += -R$(LIBRUNPATH)
|
|
||||||
endif
|
|
||||||
|
|
||||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
|
||||||
|
|
||||||
G++INCLUDES = -I/usr/include/g++
|
|
||||||
@ -1,170 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
|
|
||||||
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 -o $@
|
|
||||||
ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF)
|
|
||||||
EXEFLAGS += -Zlinker /DE
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef BUILD_OPT
|
|
||||||
OPTIMIZER = -O3
|
|
||||||
DLLFLAGS =
|
|
||||||
EXEFLAGS = -Zmtd -o $@
|
|
||||||
else
|
|
||||||
OPTIMIZER = -g #-s
|
|
||||||
DLLFLAGS = -g #-s
|
|
||||||
EXEFLAGS = -g $(OMF_FLAG) -Zmtd -L$(DIST)/lib -o $@ # -s
|
|
||||||
ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF)
|
|
||||||
EXEFLAGS += -Zlinker /DE
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
AR_EXTRA_ARGS =
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,131 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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++
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# Config stuff for Compaq OpenVMS
|
|
||||||
#
|
|
||||||
|
|
||||||
include $(MOD_DEPTH)/config/UNIX.mk
|
|
||||||
|
|
||||||
ifdef INTERNAL_TOOLS
|
|
||||||
CC = c89
|
|
||||||
CCC = cxx
|
|
||||||
OPTIMIZER = -O
|
|
||||||
else
|
|
||||||
CC = ccc
|
|
||||||
CCC = ccc
|
|
||||||
endif
|
|
||||||
|
|
||||||
RANLIB = /bin/true
|
|
||||||
|
|
||||||
CPU_ARCH_TAG = _$(CPU_ARCH)
|
|
||||||
|
|
||||||
OS_CFLAGS = -DVMS -DVMS_AS_IS -Wc,names=\(short,as\) \
|
|
||||||
-DGENERIC_PTHREAD_REDEFINES
|
|
||||||
OS_CXXFLAGS = -DVMS -DVMS_AS_IS -Wc,names=\(short,as\) \
|
|
||||||
-DGENERIC_PTHREAD_REDEFINES
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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)
|
|
||||||
|
|
||||||
# The command to build a shared library in POSIX on OpenVMS.
|
|
||||||
MKSHLIB = vmsld $(OPTIMIZER)
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
######################################################################
|
|
||||||
# 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)
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
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)
|
|
||||||
@ -1,83 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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++
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,108 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,68 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,214 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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 -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
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
COMPILER_TAG = _64
|
|
||||||
else
|
|
||||||
ifeq ($(HAVE_CCONF), 1)
|
|
||||||
COMPILER_TAG =
|
|
||||||
else
|
|
||||||
COMPILER_TAG = _32
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
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
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
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
|
|
||||||
OBJDIR_TAG = _OPT
|
|
||||||
else
|
|
||||||
OPTIMIZER = -g
|
|
||||||
DEFINES = -DDEBUG -UNDEBUG -DDEBUG_$(shell whoami)
|
|
||||||
OBJDIR_TAG = _DBG
|
|
||||||
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
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,175 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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 -DEBUGTYPE:CV
|
|
||||||
LDFLAGS += -DEBUG -DEBUGTYPE:CV
|
|
||||||
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 -DEBUGTYPE:CV -OUT:"$@"
|
|
||||||
ifdef GLOWCODE
|
|
||||||
DLLFLAGS = -DEBUG -DEBUGTYPE:both -INCLUDE:_GlowCode -OUT:"$@"
|
|
||||||
endif
|
|
||||||
|
|
||||||
OBJDIR_TAG = _DBG
|
|
||||||
LDFLAGS = -DEBUG -DEBUGTYPE:CV
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# Config stuff for WIN95
|
|
||||||
#
|
|
||||||
|
|
||||||
include $(MOD_DEPTH)/config/WIN32.mk
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# Config stuff for WINNT
|
|
||||||
#
|
|
||||||
|
|
||||||
include $(MOD_DEPTH)/config/WIN32.mk
|
|
||||||
@ -1,295 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#######################################################################
|
|
||||||
# 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.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)
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
|
|
||||||
USE_AUTOCONF = 1
|
|
||||||
MOZILLA_CLIENT = @MOZILLA_CLIENT@
|
|
||||||
DIST = @prefix@
|
|
||||||
OBJDIR_NAME = .
|
|
||||||
OBJDIR = .
|
|
||||||
OBJ_SUFFIX = @OBJ_SUFFIX@
|
|
||||||
LIB_SUFFIX = @LIB_SUFFIX@
|
|
||||||
DLL_SUFFIX = @DLL_SUFFIX@
|
|
||||||
MOD_VERSION = @NSPR_VERSION@
|
|
||||||
MOD_NAME = @NSPR_MODNAME@
|
|
||||||
|
|
||||||
USE_CPLUS = @USE_CPLUS@
|
|
||||||
USE_IPV6 = @USE_IPV6@
|
|
||||||
USE_N32 = @USE_N32@
|
|
||||||
USE_64 = @USE_64@
|
|
||||||
|
|
||||||
USE_PTHREADS = @USE_PTHREADS@
|
|
||||||
USE_BTHREADS = @USE_BTHREADS@
|
|
||||||
PTHREADS_USER = @USE_USER_PTHREADS@
|
|
||||||
CLASSIC_NSPR = @USE_NSPR_THREADS@
|
|
||||||
|
|
||||||
AS = @AS@
|
|
||||||
ASFLAGS = @ASFLAGS@
|
|
||||||
CC = @CC@
|
|
||||||
CCC = @CXX@
|
|
||||||
AR = @AR@
|
|
||||||
AR_FLAGS = @AR_FLAGS@
|
|
||||||
LD = @LD@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
PERL = @PERL@
|
|
||||||
DLLTOOL = @DLLTOOL@
|
|
||||||
WINDRES = @WINDRES@
|
|
||||||
RC = $(WINDRES)
|
|
||||||
|
|
||||||
OS_CFLAGS = @CFLAGS@ $(DSO_CFLAGS)
|
|
||||||
OS_CXXFLAGS = @CXXFLAGS@ $(DSO_CFLAGS)
|
|
||||||
OS_LIBS = @OS_LIBS@
|
|
||||||
OS_LDFLAGS = @LDFLAGS@
|
|
||||||
|
|
||||||
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@
|
|
||||||
|
|
||||||
MDCPUCFG_H = @MDCPUCFG_H@
|
|
||||||
MOZ_TARGET = @MOZ_TARGET@
|
|
||||||
PR_MD_CSRCS = @PR_MD_CSRCS@
|
|
||||||
PR_MD_ASFILES = @PR_MD_ASFILES@
|
|
||||||
PR_MD_ARCH_DIR = @PR_MD_ARCH_DIR@
|
|
||||||
|
|
||||||
OS_TARGET = @OS_TARGET@
|
|
||||||
OS_ARCH = @OS_ARCH@
|
|
||||||
OS_RELEASE = @OS_RELEASE@
|
|
||||||
OS_TEST = @OS_TEST@
|
|
||||||
|
|
||||||
NOSUCHFILE = @NOSUCHFILE@
|
|
||||||
AIX_LINK_OPTS = @AIX_LINK_OPTS@
|
|
||||||
MOZ_OBJFORMAT = @MOZ_OBJFORMAT@
|
|
||||||
ULTRASPARC_LIBRARY = @ULTRASPARC_LIBRARY@
|
|
||||||
ULTRASPARC_FILTER_LIBRARY = @ULTRASPARC_FILTER_LIBRARY@
|
|
||||||
@ -1,233 +0,0 @@
|
|||||||
#! gmake
|
|
||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
# 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)
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
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
|
|
||||||
#
|
|
||||||
####################################################################
|
|
||||||
|
|
||||||
MDIST = /share/builds/components
|
|
||||||
ifeq ($(OS_ARCH),WINNT)
|
|
||||||
MDIST = //helium/dist
|
|
||||||
MDIST_DOS = $(subst /,\\,$(MDIST))
|
|
||||||
endif
|
|
||||||
|
|
||||||
# RELEASE_DIR is ns/dist/<module name>
|
|
||||||
|
|
||||||
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
|
|
||||||
@ -1,155 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*
|
|
||||||
* Alternatively, the contents of this file may be used under the
|
|
||||||
* terms of the GNU General Public License Version 2 or later (the
|
|
||||||
* "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
* instead of those above. If you wish to allow use of your
|
|
||||||
* version of this file only under the terms of the GPL and not to
|
|
||||||
* allow others to use your version of this file under the MPL,
|
|
||||||
* indicate your decision by deleting the provisions above and
|
|
||||||
* replace them with the notice and other provisions required by
|
|
||||||
* the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
* may use your version of this file under either the MPL or the
|
|
||||||
* GPL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* 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 */
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# Module description file
|
|
||||||
#
|
|
||||||
# A module is also called a component or a subsystem.
|
|
||||||
|
|
||||||
MOD_NAME = nspr20
|
|
||||||
MOD_VERSION = 4
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
#! perl
|
|
||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
#! perl
|
|
||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
@ -1,129 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*
|
|
||||||
* Alternatively, the contents of this file may be used under the
|
|
||||||
* terms of the GNU General Public License Version 2 or later (the
|
|
||||||
* "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
* instead of those above. If you wish to allow use of your
|
|
||||||
* version of this file only under the terms of the GPL and not to
|
|
||||||
* allow others to use your version of this file under the MPL,
|
|
||||||
* indicate your decision by deleting the provisions above and
|
|
||||||
* replace them with the notice and other provisions required by
|
|
||||||
* the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
* may use your version of this file under either the MPL or the
|
|
||||||
* GPL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#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) || 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;
|
|
||||||
struct timeb b;
|
|
||||||
ftime(&b);
|
|
||||||
now = b.time;
|
|
||||||
now *= 1000000;
|
|
||||||
now += (1000 * b.millitm);
|
|
||||||
fprintf(stdout, "%I64d", now);
|
|
||||||
|
|
||||||
#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 */
|
|
||||||
@ -1,592 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*
|
|
||||||
* Alternatively, the contents of this file may be used under the
|
|
||||||
* terms of the GNU General Public License Version 2 or later (the
|
|
||||||
* "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
* instead of those above. If you wish to allow use of your
|
|
||||||
* version of this file only under the terms of the GPL and not to
|
|
||||||
* allow others to use your version of this file under the MPL,
|
|
||||||
* indicate your decision by deleting the provisions above and
|
|
||||||
* replace them with the notice and other provisions required by
|
|
||||||
* the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
* may use your version of this file under either the MPL or the
|
|
||||||
* GPL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
** 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"
|
|
||||||
|
|
||||||
#define HAVE_LCHOWN
|
|
||||||
|
|
||||||
#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)
|
|
||||||
#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);
|
|
||||||
}
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
# Include in Makefiles to define NSPR variables
|
|
||||||
|
|
||||||
NSPR_VERSION = @NSPR_VERSION@
|
|
||||||
NSPR_LIB = -lnspr@NSPR_VERSION@
|
|
||||||
NSPR_EXTRA_LIBS = @EXTRA_LIBS@
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
# Include in shell scripts to define NSPR variables
|
|
||||||
|
|
||||||
NSPR_VERSION=@NSPR_VERSION@
|
|
||||||
NSPR_LIB=-lnspr$NSPR_VERSION
|
|
||||||
NSPR_EXTRA_LIBS="@EXTRA_LIBS@"
|
|
||||||
@ -1,75 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*
|
|
||||||
* Alternatively, the contents of this file may be used under the
|
|
||||||
* terms of the GNU General Public License Version 2 or later (the
|
|
||||||
* "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
* instead of those above. If you wish to allow use of your
|
|
||||||
* version of this file only under the terms of the GPL and not to
|
|
||||||
* allow others to use your version of this file under the MPL,
|
|
||||||
* indicate your decision by deleting the provisions above and
|
|
||||||
* replace them with the notice and other provisions required by
|
|
||||||
* the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
* may use your version of this file under either the MPL or the
|
|
||||||
* GPL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#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___ */
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 2000 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*
|
|
||||||
* Alternatively, the contents of this file may be used under the
|
|
||||||
* terms of the GNU General Public License Version 2 or later (the
|
|
||||||
* "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
* instead of those above. If you wish to allow use of your
|
|
||||||
* version of this file only under the terms of the GPL and not to
|
|
||||||
* allow others to use your version of this file under the MPL,
|
|
||||||
* indicate your decision by deleting the provisions above and
|
|
||||||
* replace them with the notice and other provisions required by
|
|
||||||
* the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
* may use your version of this file under either the MPL or the
|
|
||||||
* GPL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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."
|
|
||||||
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
REM
|
|
||||||
REM The contents of this file are subject to the Netscape Public License
|
|
||||||
REM Version 1.1 (the "NPL"); you may not use this file except in
|
|
||||||
REM compliance with the NPL. You may obtain a copy of the NPL at
|
|
||||||
REM http://www.mozilla.org/NPL/
|
|
||||||
REM
|
|
||||||
REM Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
||||||
REM WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
||||||
REM for the specific language governing rights and limitations under the
|
|
||||||
REM NPL.
|
|
||||||
REM
|
|
||||||
REM The Initial Developer of this code under the NPL is Netscape
|
|
||||||
REM Communications Corporation. Portions created by Netscape are
|
|
||||||
REM Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
||||||
REM Reserved.
|
|
||||||
REM
|
|
||||||
|
|
||||||
mkdir %1
|
|
||||||
@ -1,480 +0,0 @@
|
|||||||
#! gmake
|
|
||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# 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
|
|
||||||
|
|
||||||
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:.s=.$(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) \
|
|
||||||
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 libs install
|
|
||||||
|
|
||||||
export::
|
|
||||||
+$(LOOP_OVER_DIRS)
|
|
||||||
|
|
||||||
libs::
|
|
||||||
+$(LOOP_OVER_DIRS)
|
|
||||||
|
|
||||||
install::
|
|
||||||
+$(LOOP_OVER_DIRS)
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
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),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)
|
|
||||||
$(IMPORT_LIBRARY): $(SHARED_LIBRARY)
|
|
||||||
$(IMPLIB) $@ $(SHARED_LIBRARY).def
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(SHARED_LIBRARY): $(OBJS)
|
|
||||||
@$(MAKE_OBJDIR)
|
|
||||||
rm -f $@
|
|
||||||
ifdef USE_AUTOCONF
|
|
||||||
$(MKSHLIB) $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
|
|
||||||
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 ($(OS_ARCH),OS2)
|
|
||||||
# append ( >> ) doesn't seem to be working under OS/2 gmake. Run through OS/2 shell instead.
|
|
||||||
@cmd /C "echo LIBRARY $(notdir $(basename $(SHARED_LIBRARY))) INITINSTANCE TERMINSTANCE >$@.def"
|
|
||||||
@cmd /C "echo PROTMODE >>$@.def"
|
|
||||||
@cmd /C "echo CODE LOADONCALL MOVEABLE DISCARDABLE >>$@.def"
|
|
||||||
@cmd /C "echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >>$@.def"
|
|
||||||
@cmd /C "echo EXPORTS >>$@.def"
|
|
||||||
@cmd /C "$(FILTER) $(LIBRARY) | grep -v _DLL_InitTerm >>$@.def"
|
|
||||||
$(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $@.def
|
|
||||||
else # OS2
|
|
||||||
ifeq ($(OS_TARGET), OpenVMS)
|
|
||||||
@if test ! -f $(OBJDIR)/VMSuni.opt; then \
|
|
||||||
echo "Creating universal symbol option file $(OBJDIR)/VMSuni.opt";\
|
|
||||||
create_opt_uni $(OBJS); \
|
|
||||||
mv VMSuni.opt $(OBJDIR); \
|
|
||||||
fi
|
|
||||||
$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS) $(OBJDIR)/VMSuni.opt
|
|
||||||
@echo "`translate $@`" > $(@:.$(DLL_SUFFIX)=.vms)
|
|
||||||
else # OpenVMS
|
|
||||||
$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
|
|
||||||
endif # OpenVMS
|
|
||||||
endif # OS2
|
|
||||||
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.
|
|
||||||
$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$(RES) $(RESNAME)
|
|
||||||
endif
|
|
||||||
@echo $(RES) finished
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
|
|
||||||
@$(MAKE_OBJDIR)
|
|
||||||
ifeq ($(OS_ARCH), 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), 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)
|
|
||||||
@ -1,115 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the
|
|
||||||
# terms of the GNU General Public License Version 2 or later (the
|
|
||||||
# "GPL"), in which case the provisions of the GPL are applicable
|
|
||||||
# instead of those above. If you wish to allow use of your
|
|
||||||
# version of this file only under the terms of the GPL and not to
|
|
||||||
# allow others to use your version of this file under the MPL,
|
|
||||||
# indicate your decision by deleting the provisions above and
|
|
||||||
# replace them with the notice and other provisions required by
|
|
||||||
# the GPL. If you do not delete the provisions above, a recipient
|
|
||||||
# may use your version of this file under either the MPL or the
|
|
||||||
# GPL.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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 = #
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
#
|
|
||||||
# The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
|
|
||||||
DEPTH = ../../..
|
|
||||||
NSPR_TREE = ..
|
|
||||||
MOD_DEPTH = ..
|
|
||||||
|
|
||||||
include $(NSPR_TREE)/config/rules.mk
|
|
||||||
include ../build.mk
|
|
||||||
|
|
||||||
SRCDIRS = build 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:
|
|
||||||
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
DEPTH = ../../..
|
|
||||||
srcdir = @srcdir@
|
|
||||||
ldaptopsrcdir = @top_srcdir@
|
|
||||||
|
|
||||||
SRCDIRS = build include libraries
|
|
||||||
|
|
||||||
include build/autoconf.mk
|
|
||||||
include $(NSPR_TREE)/config/rules.mk
|
|
||||||
|
|
||||||
all export:: FORCE
|
|
||||||
@for i in $(SRCDIRS); do \
|
|
||||||
echo " cd $$i; $(MAKE) $(MFLAGS) export"; \
|
|
||||||
( cd $$i; $(MAKE) $(MFLAGS) export ); \
|
|
||||||
done
|
|
||||||
|
|
||||||
libs install:: FORCE
|
|
||||||
@for i in $(SRCDIRS); do \
|
|
||||||
echo "cd $$i; $(MAKE) $(MFLAGS) install"; \
|
|
||||||
( cd $$i; $(MAKE) $(MFLAGS) install ); \
|
|
||||||
done
|
|
||||||
|
|
||||||
clean clobber:: FORCE
|
|
||||||
@for i in $(SRCDIRS); do \
|
|
||||||
echo "cd $$i; $(MAKE) $(MFLAGS) clean"; \
|
|
||||||
( cd $$i; $(MAKE) $(MFLAGS) clean ); \
|
|
||||||
done
|
|
||||||
|
|
||||||
realclean clobber_all:: FORCE
|
|
||||||
@for i in $(SRCDIRS); do \
|
|
||||||
echo "cd $$i; $(MAKE) $(MFLAGS) realclean"; \
|
|
||||||
( cd $$i; $(MAKE) $(MFLAGS) realclean ); \
|
|
||||||
done
|
|
||||||
|
|
||||||
FORCE:
|
|
||||||
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
The autoconf files here are the barest shim to allow the LDAP C SDK to
|
|
||||||
build with autoconf, including in a --objdir. These are really just a
|
|
||||||
wrapper around the existing (NSPR-based) build-system; they propagate
|
|
||||||
very little information from the autconf command line or environment.
|
|
||||||
The Makefile.in files are all just slightly edited forks of the
|
|
||||||
Makefile.client files. These files are:
|
|
||||||
|
|
||||||
Makefile.in
|
|
||||||
configure
|
|
||||||
configure.in
|
|
||||||
build/Makefile.in
|
|
||||||
build/autoconf.mk.in
|
|
||||||
build/my_overrides.mk
|
|
||||||
include/Makefile.in
|
|
||||||
libraries/Makefile.in
|
|
||||||
libraries/liblber/Makefile.in
|
|
||||||
libraries/libldap/Makefile.in
|
|
||||||
|
|
||||||
Note that as in the main browser tree, I've checked in the (generated)
|
|
||||||
configure script so that autoconf isn't a prerequisite to build.
|
|
||||||
|
|
||||||
At some point after the most current LDAP SDK code lands in Mozilla,
|
|
||||||
then perhaps it will be worth spending some time creating a more
|
|
||||||
correctly autoconfified build process that isn't just a shim and
|
|
||||||
doesn't depend on NSPR.
|
|
||||||
|
|
||||||
Comments to <news://news.mozilla.org/netscape.public.mozilla.directory>,
|
|
||||||
please.
|
|
||||||
|
|
||||||
Dan Mosedale
|
|
||||||
<dmose@mozilla.org>
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
#
|
|
||||||
# The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
|
|
||||||
DEPTH = ../../../..
|
|
||||||
MOD_DEPTH = ../..
|
|
||||||
NSPR_TREE = ../..
|
|
||||||
CSRCS = dirver.c
|
|
||||||
|
|
||||||
include $(NSPR_TREE)/config/rules.mk
|
|
||||||
include ../../build.mk
|
|
||||||
|
|
||||||
TARGETS = $(OBJDIR)/dirver$(EXE_SUFFIX)
|
|
||||||
|
|
||||||
GARBAGE += $(TARGETS)
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), WINNT)
|
|
||||||
$(OBJS) = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.o))
|
|
||||||
$(TARGETS): $(OBJS)
|
|
||||||
@$(MAKE_OBJDIR)
|
|
||||||
$(LINK_EXE)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), OS2)
|
|
||||||
$(OBJS) = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.o))
|
|
||||||
|
|
||||||
$(TARGETS): $(OBJS)
|
|
||||||
@$(MAKE_OBJDIR)
|
|
||||||
$(LINK_EXE) -OUT:$@ $(OBJS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
export:: $(TARGETS)
|
|
||||||
$(INSTALL) -m 555 $(TARGETS) ../$(DIST)/bin
|
|
||||||
|
|
||||||
install:: export
|
|
||||||
|
|
||||||
clean::
|
|
||||||
rm -rf $(OBJDIR_NAME)
|
|
||||||
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
DEPTH = ../../../..
|
|
||||||
srcdir = @srcdir@
|
|
||||||
ldaptopsrcdir = @top_srcdir@
|
|
||||||
|
|
||||||
CSRCS = dirver.c
|
|
||||||
|
|
||||||
include autoconf.mk
|
|
||||||
include $(NSPR_TREE)/config/rules.mk
|
|
||||||
|
|
||||||
TARGETS = $(OBJDIR)/dirver$(BIN_SUFFIX)
|
|
||||||
|
|
||||||
GARBAGE += $(TARGETS)
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), OS2)
|
|
||||||
$(OBJS) = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.o))
|
|
||||||
|
|
||||||
$(TARGETS): $(OBJS)
|
|
||||||
@$(MAKE_OBJDIR)
|
|
||||||
$(LINK_EXE) -OUT:$@ $(OBJS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
export:: $(TARGETS)
|
|
||||||
$(INSTALL) -m 555 $(TARGETS) $(DIST)/bin
|
|
||||||
|
|
||||||
install:: export
|
|
||||||
|
|
||||||
clean::
|
|
||||||
rm -rf $(OBJDIR_NAME)
|
|
||||||
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 2000, Netscape Communications Corp. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s): Dan Mosedale <dmose@mozilla.org>
|
|
||||||
#
|
|
||||||
|
|
||||||
# this is used to override DIST and VPATH
|
|
||||||
#
|
|
||||||
NSPR_MY_OVERRIDES_MK = $(ldaptopsrcdir)/build/my_overrides.mk
|
|
||||||
|
|
||||||
# common to all the ldap sdk makefiles
|
|
||||||
#
|
|
||||||
NSPR_TREE = $(ldaptopsrcdir)/../../../nsprpub
|
|
||||||
topsrcdir = $(ldaptopsrcdir)/../../../nsprpub
|
|
||||||
|
|
||||||
# various stuff from the ldap sdk documentation
|
|
||||||
#
|
|
||||||
MOZILLA_CLIENT = 1
|
|
||||||
NO_MDUPDATE = 1
|
|
||||||
MOZ_LDAP_SDK = 1
|
|
||||||
MOZ_LI =
|
|
||||||
MOZ_LITE =
|
|
||||||
MOZ_MEDIUM =
|
|
||||||
NO_SECURITY =
|
|
||||||
|
|
||||||
# we have to cope if nspr was built using autoconf (which we only know is
|
|
||||||
# is true if our configure was passed --enable-nspr-autoconf -- which
|
|
||||||
# the top-level configure does automagically, as appropriate).
|
|
||||||
#
|
|
||||||
NSPR_USE_AUTOCONF = @NSPR_USE_AUTOCONF@
|
|
||||||
|
|
||||||
ifeq ($(NSPR_USE_AUTOCONF), 1)
|
|
||||||
|
|
||||||
MOD_DEPTH = $(DEPTH)
|
|
||||||
include $(DEPTH)/nsprpub/config/autoconf.mk
|
|
||||||
VPATH = $(srcdir)
|
|
||||||
DIST = $(DEPTH)/dist
|
|
||||||
|
|
||||||
else
|
|
||||||
MOD_DEPTH = $(NSPR_TREE)
|
|
||||||
|
|
||||||
endif
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
#!/bin\sh
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,236 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
|
||||||
/
|
|
||||||
/ Name: Netscape File Version Generator
|
|
||||||
/ Platforms: WIN32
|
|
||||||
/ ......................................................................
|
|
||||||
/ This program generates an ascii format of the 64-bit FILEVERSION
|
|
||||||
/ resource identifier used by Windows executable binaries.
|
|
||||||
/
|
|
||||||
/ Usage Syntax:
|
|
||||||
/ fversion <major.minor.patch> [mm/dd/yyyy] [outfile]
|
|
||||||
/ If date is not specified, the current GMT date is used. yyyy must be
|
|
||||||
/ greater than 1980
|
|
||||||
/
|
|
||||||
/ Usage Example:
|
|
||||||
/ fversion 3.0.0
|
|
||||||
/ fversion 6.5.4 1/30/2001
|
|
||||||
/ fversion 6.5.4 1/30/2001 fileversion.h
|
|
||||||
/
|
|
||||||
/ see http://ntsbuild/sd/30ver.htm for specification
|
|
||||||
/ ......................................................................
|
|
||||||
/ Revision History:
|
|
||||||
/ 01-30-97 Initial Version, Andy Hakim (ahakim@netscape.com)
|
|
||||||
/ --------------------------------------------------------------------------*/
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
#ifdef macintosh
|
|
||||||
#include <console.h>
|
|
||||||
#endif
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
unsigned _CalcVersion(unsigned nMajor, unsigned nMinor, unsigned nPatch)
|
|
||||||
{
|
|
||||||
unsigned nVersion;
|
|
||||||
nVersion = nMajor;
|
|
||||||
nVersion <<= 5;
|
|
||||||
nVersion += nMinor;
|
|
||||||
nVersion <<= 7;
|
|
||||||
nVersion += nPatch;
|
|
||||||
nVersion &= 0xFFFF;
|
|
||||||
return(nVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void _GetVersions(char *szVer, unsigned *nMajor, unsigned *nMinor,
|
|
||||||
unsigned *nPatch)
|
|
||||||
{
|
|
||||||
char szVersion[128];
|
|
||||||
unsigned nReturn = 0;
|
|
||||||
char *szToken;
|
|
||||||
*nMajor = 0;
|
|
||||||
*nMinor = 0;
|
|
||||||
*nPatch = 0;
|
|
||||||
|
|
||||||
strcpy(szVersion, szVer);
|
|
||||||
if(szToken = strtok(szVersion, ".\n"))
|
|
||||||
{
|
|
||||||
*nMajor = atoi(szToken);
|
|
||||||
if(szToken = strtok(NULL, ".\n"))
|
|
||||||
{
|
|
||||||
*nMinor = atoi(szToken);
|
|
||||||
if(szToken = strtok(NULL, ".\n"))
|
|
||||||
{
|
|
||||||
*nPatch = atoi(szToken);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
unsigned _CalcBuildDate(unsigned nYear, unsigned nMonth, unsigned nDay)
|
|
||||||
{
|
|
||||||
unsigned nBuildDate = 0;
|
|
||||||
|
|
||||||
if(nYear < 1900) /* they really mean 1900 + nYear */
|
|
||||||
nYear += 1900;
|
|
||||||
|
|
||||||
nYear -= 1980;
|
|
||||||
nBuildDate = nYear;
|
|
||||||
/*
|
|
||||||
nBuildDate <<= 5;
|
|
||||||
*/
|
|
||||||
nBuildDate <<= 4;
|
|
||||||
nBuildDate += nMonth;
|
|
||||||
/* nBuildDate <<= 4; */
|
|
||||||
nBuildDate <<= 5;
|
|
||||||
nBuildDate += nDay;
|
|
||||||
nBuildDate &= 0xFFFF;
|
|
||||||
return(nBuildDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
unsigned _GenBuildDate(char *szBuildDate)
|
|
||||||
{
|
|
||||||
unsigned nReturn = 0;
|
|
||||||
char *szToken;
|
|
||||||
unsigned nYear = 0;
|
|
||||||
unsigned nMonth = 0;
|
|
||||||
unsigned nDay = 0;
|
|
||||||
|
|
||||||
if((szBuildDate) && (strchr(szBuildDate, '\\') || strchr(szBuildDate, '/')) && (szToken = strtok(szBuildDate, "\\/")))
|
|
||||||
{
|
|
||||||
nMonth = atoi(szToken);
|
|
||||||
nMonth--; /* use months in the range [0..11], as in struct tm */
|
|
||||||
if(szToken = strtok(NULL, "\\/"))
|
|
||||||
{
|
|
||||||
nDay = atoi(szToken);
|
|
||||||
if(szToken = strtok(NULL, "\\/"))
|
|
||||||
{
|
|
||||||
nYear = atoi(szToken);
|
|
||||||
if(nYear < 70) { /* handle 2 digit years like (20)00 */
|
|
||||||
nYear += 100;
|
|
||||||
}
|
|
||||||
else if (nYear < 100) {
|
|
||||||
}
|
|
||||||
else if (nYear > 1900){
|
|
||||||
nYear -= 1900;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
struct tm *newtime;
|
|
||||||
time_t ltime;
|
|
||||||
|
|
||||||
time( <ime );
|
|
||||||
|
|
||||||
/* Obtain coordinated universal time: */
|
|
||||||
newtime = gmtime( <ime );
|
|
||||||
nYear = newtime->tm_year;
|
|
||||||
nMonth = newtime->tm_mon;
|
|
||||||
nDay = newtime->tm_mday;
|
|
||||||
}
|
|
||||||
|
|
||||||
nReturn = _CalcBuildDate(nYear, nMonth, nDay);
|
|
||||||
return(nReturn);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void ShowHelp(char *szFilename)
|
|
||||||
{
|
|
||||||
fprintf(stdout, "%s: Generates ascii format #define for FILEVERSION\n", szFilename);
|
|
||||||
fprintf(stdout, " resource identifier used by Windows executable binaries.\n");
|
|
||||||
fprintf(stdout, "\n");
|
|
||||||
fprintf(stdout, "Usage: %s <major.minor.patch> [mm/dd/yy] [outfile]\n", szFilename);
|
|
||||||
fprintf(stdout, "\n");
|
|
||||||
fprintf(stdout, "Examples:\n");
|
|
||||||
fprintf(stdout, "%s 3.0.0\n", szFilename);
|
|
||||||
fprintf(stdout, "%s 6.5.2 1/30/2001\n", szFilename);
|
|
||||||
fprintf(stdout, "%s 6.5.2 1/30/2001 fileversion.h\n", szFilename);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
main(int nArgc, char **lpArgv)
|
|
||||||
{
|
|
||||||
int nReturn = 0;
|
|
||||||
unsigned nVersion = 0;
|
|
||||||
unsigned nBuildDate = 0;
|
|
||||||
|
|
||||||
#ifdef macintosh
|
|
||||||
nArgc = ccommand( &lpArgv );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(nArgc < 2)
|
|
||||||
{
|
|
||||||
ShowHelp(lpArgv[0]);
|
|
||||||
nReturn = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
char *szVersion = NULL;
|
|
||||||
char *szDate = NULL;
|
|
||||||
char *szOutput = NULL;
|
|
||||||
FILE *f = stdout;
|
|
||||||
unsigned nMajor = 0;
|
|
||||||
unsigned nMinor = 0;
|
|
||||||
unsigned nPatch = 0;
|
|
||||||
|
|
||||||
szVersion = (char *)lpArgv[1];
|
|
||||||
szDate = (char *)lpArgv[2];
|
|
||||||
szOutput = (char *)lpArgv[3];
|
|
||||||
_GetVersions( szVersion, &nMajor, &nMinor, &nPatch );
|
|
||||||
nVersion = _CalcVersion(nMajor, nMinor, nPatch);
|
|
||||||
nBuildDate = _GenBuildDate(szDate);
|
|
||||||
|
|
||||||
if(nArgc >= 4) {
|
|
||||||
if (( f = fopen(szOutput, "w")) == NULL ) {
|
|
||||||
perror( szOutput );
|
|
||||||
exit( 1 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(f, "#define VI_PRODUCTVERSION %u.%u\n", nMajor, nMinor);
|
|
||||||
fprintf(f, "#define PRODUCTTEXT \"%s\"\n", szVersion );
|
|
||||||
fprintf(f, "#define VI_FILEVERSION %u, 0, 0,%u\n",
|
|
||||||
nVersion, nBuildDate);
|
|
||||||
fprintf(f, "#define VI_FileVersion \"%s Build %u\\0\"\n",
|
|
||||||
szVersion, nBuildDate);
|
|
||||||
|
|
||||||
if(nArgc >= 4)
|
|
||||||
fclose(f);
|
|
||||||
nReturn = (nVersion && !nBuildDate);
|
|
||||||
}
|
|
||||||
return(nReturn);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,211 +0,0 @@
|
|||||||
|
|
||||||
#
|
|
||||||
# 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];
|
|
||||||
|
|
||||||
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" ) {
|
|
||||||
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 {
|
|
||||||
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 ) = @_;
|
|
||||||
|
|
||||||
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 "#" ) {
|
|
||||||
$line = substr( $line, 1 );
|
|
||||||
$_ = $line;
|
|
||||||
if ( /^[0-9]+[\t ]/ ) {
|
|
||||||
&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 {
|
|
||||||
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 "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" );
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 2000, Netscape Communications Corp. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s): Dan Mosedale <dmose@mozilla.org>
|
|
||||||
#
|
|
||||||
|
|
||||||
DIST = $(DEPTH)/dist
|
|
||||||
VPATH = $(srcdir)
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# 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=-
|
|
||||||
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
#
|
|
||||||
# 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>
|
|
||||||
|
|
||||||
@keywords = ();
|
|
||||||
@values = ();
|
|
||||||
|
|
||||||
$count = 0;
|
|
||||||
foreach $str (@ARGV) {
|
|
||||||
($key,$val) = split( "=", $str, 2 );
|
|
||||||
push (@keywords, $key);
|
|
||||||
push (@values, $val);
|
|
||||||
++$count;
|
|
||||||
}
|
|
||||||
|
|
||||||
$first_line = 1;
|
|
||||||
|
|
||||||
while(<STDIN>) {
|
|
||||||
$line = $_;
|
|
||||||
$count = 0;
|
|
||||||
foreach $str (@keywords) {
|
|
||||||
$line =~ s/{{$str}}/$values[$count]/g;
|
|
||||||
++$count;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! $first_line ) {
|
|
||||||
print $line;
|
|
||||||
} else {
|
|
||||||
$first_line = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
@ -1,467 +0,0 @@
|
|||||||
#
|
|
||||||
# GNU Makefile for LDAP client tools.
|
|
||||||
#
|
|
||||||
|
|
||||||
LDAP_SRC = ../..
|
|
||||||
MCOM_ROOT = ../../../..
|
|
||||||
|
|
||||||
NOSTDCLEAN=true # don't let nsconfig.mk define target clean
|
|
||||||
NOSTDSTRIP=true # don't let nsconfig.mk define target strip
|
|
||||||
NSPR20=true # probably should be defined somewhere else (not sure where)
|
|
||||||
|
|
||||||
OBJDEST = $(OBJDIR)/clients/tools/obj
|
|
||||||
BINDIR = $(OBJDIR)/clients/bin
|
|
||||||
|
|
||||||
include $(MCOM_ROOT)/c-sdk/nsdefs.mk
|
|
||||||
include $(MCOM_ROOT)/c-sdk/nsconfig.mk
|
|
||||||
|
|
||||||
include $(LDAP_SRC)/nsldap.mk
|
|
||||||
ifndef LDAP_USE_OLD_DB
|
|
||||||
include $(MCOM_ROOT)/c-sdk/ns_usedb.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
# NLS Library
|
|
||||||
|
|
||||||
NLS_COMP_NAME = libnls
|
|
||||||
NLS_VERS_NUM = 31
|
|
||||||
NLS_COMP_DIR = $(NLS_COMP_NAME)$(NLS_VERS_NUM)
|
|
||||||
NLS_ROOT = $(MCOM_ROOT)/../components/$(NLS_COMP_DIR)
|
|
||||||
|
|
||||||
NLS_LIBPATH = $(NLS_ROOT)/$(NLSOBJDIR)/lib
|
|
||||||
NLS_INCLUDE = $(NLS_ROOT)/$(NLSOBJDIR)/include
|
|
||||||
NLS_LOCALE = $(NLS_ROOT)/$(NLSOBJDIR)/locale$(NLS_VERS_NUM)
|
|
||||||
NLS_CONV = $(NLS_ROOT)/$(NLSOBJDIR)/conv$(NLS_VERS_NUM)
|
|
||||||
NLS_VERSION_FILE = $(NLS_ROOT)/Version
|
|
||||||
|
|
||||||
|
|
||||||
NLS_RELDATE=v3.2
|
|
||||||
|
|
||||||
NLS_VERSION = $(NLS_RELDATE)
|
|
||||||
|
|
||||||
ifeq ($(ARCH), WINNT)
|
|
||||||
ifeq ($(OS_TARGET), WIN95)
|
|
||||||
ifeq ($(DEBUG), full)
|
|
||||||
NLSOBJDIR = WIN954.0_DBG.OBJ
|
|
||||||
else
|
|
||||||
ifeq ($(DEBUG), fulld)
|
|
||||||
NLSOBJDIR = WIN954.0_DBG.OBJD
|
|
||||||
else
|
|
||||||
NLSOBJDIR = WIN954.0_OPT.OBJ
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
ifeq ($(DEBUG), full)
|
|
||||||
NLSOBJDIR = WINNT4.0_DBG.OBJ
|
|
||||||
else
|
|
||||||
ifeq ($(DEBUG), fulld)
|
|
||||||
NLSOBJDIR = WINNT4.0_DBG.OBJD
|
|
||||||
else
|
|
||||||
NLSOBJDIR = WINNT4.0_OPT.OBJ
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
NLS_RELEASE = $(COMPONENTS_DIR)/libnls$(NLS_VERS_NUM)/$(NLS_VERSION)/$(NLSOBJDIR)
|
|
||||||
# NLS_LIBNAMES = brk32$(NLS_VERS_NUM) cnv32$(NLS_VERS_NUM) col32$(NLS_VERS_NUM) fmt32$(NLS_VERS_NUM) res32$(NLS_VERS_NUM) uni32$(NLS_VERS_NUM)
|
|
||||||
NLS_LIBNAMES = cnv32$(NLS_VERS_NUM)
|
|
||||||
NLS_CONV_LIBNAMES = jpn32$(NLS_VERS_NUM) cck32$(NLS_VERS_NUM) sb32$(NLS_VERS_NUM)
|
|
||||||
NLS_LIBS = $(addsuffix .lib, $(addprefix ns, $(NLS_LIBNAMES)))
|
|
||||||
NLS_CONV_LIBS = $(addsuffix .lib, $(addprefix ns, $(NLS_CONV_LIBNAMES)))
|
|
||||||
NLSDLL_NAMES = $(addsuffix .dll, $(addprefix ns, $(NLS_LIBNAMES)))
|
|
||||||
NLS_CONVDLL_NAMES = $(addsuffix .dll, $(addprefix ns, $(NLS_CONV_LIBNAMES)))
|
|
||||||
LIBNLS = $(addprefix $(NLS_LIBPATH)/, $(NLS_LIBS))
|
|
||||||
LIBNLS_CONV = $(addprefix $(NLS_LIBPATH)/, $(NLS_CONV_LIBS))
|
|
||||||
NLSOBJNAME = $(NLS_LIBNAMES)
|
|
||||||
else
|
|
||||||
ifeq ($(ARCH), HPUX)
|
|
||||||
ifeq ($(NSOS_RELEASE), B.11.00)
|
|
||||||
NLSOBJDIR = $(NSOBJDIR_NAME)
|
|
||||||
NLS_RELEASE = $(COMPONENTS_DIR)/libnls$(NLS_VERS_NUM)/$(NLS_VERSION)/$(NLSOBJDIR)
|
|
||||||
else
|
|
||||||
NLSOBJDIR = $(NSOBJDIR_NAME)
|
|
||||||
NLS_RELEASE = $(COMPONENTS_DIR)/libnls$(NLS_VERS_NUM)/$(NLS_VERSION)/$(NLSOBJDIR)
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
# Here is a hack to replace _PTH with n32, this must be done before
|
|
||||||
# the _PTH substitustion
|
|
||||||
|
|
||||||
ifeq ($(ARCH),IRIX)
|
|
||||||
ifeq ($(USE_N32),1)
|
|
||||||
NLSOBJDIR = $(NSOBJDIR_NAME2_NOTAG)
|
|
||||||
else
|
|
||||||
NLSOBJDIR = $(NSOBJDIR_NAME_NOTAG)
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
NLSOBJDIR = $(NSOBJDIR_NAME_NOTAG)
|
|
||||||
|
|
||||||
ifeq ($(ARCH), OSF1)
|
|
||||||
NLSOBJDIR = $(NSOBJDIR_NAME)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# NLS Does not has PTH version, so here is the hack which treat non PTH
|
|
||||||
# version as PTH version
|
|
||||||
ifeq ($(USE_PTHREADS), 1)
|
|
||||||
NLS_RELEASE = $(COMPONENTS_DIR)/libnls$(NLS_VERS_NUM)/$(NLS_VERSION)/$(NLSOBJDIR)
|
|
||||||
else
|
|
||||||
NLS_RELEASE = $(COMPONENTS_DIR)/libnls$(NLS_VERS_NUM)/$(NLS_VERSION)/$(NLSOBJDIR)
|
|
||||||
endif
|
|
||||||
endif # HPUX
|
|
||||||
NLS_LIBNAMES = cnv$(NLS_VERS_NUM)
|
|
||||||
NLS_CONV_LIBNAMES = jpn$(NLS_VERS_NUM) cck$(NLS_VERS_NUM) sb$(NLS_VERS_NUM)
|
|
||||||
NLS_SOLIB_NAMES = $(addsuffix $(DLL_PRESUF), $(addprefix libns, $(NLS_LIBNAMES)))
|
|
||||||
NLS_CONV_SOLIB_NAMES = $(addsuffix $(DLL_PRESUF), $(addprefix libns, $(NLS_CONV_LIBNAMES)))
|
|
||||||
NLS_LIBS = $(addsuffix .a, $(NLS_SOLIB_NAMES))
|
|
||||||
NLS_CONV_LIBS = $(addsuffix .a, $(NLS_CONV_SOLIB_NAMES))
|
|
||||||
NLS_SOLIBS = $(addsuffix .$(DLL_SUFFIX), $(NLS_SOLIB_NAMES))
|
|
||||||
NLS_CONV_SOLIBS = $(addsuffix .$(DLL_SUFFIX), $(NLS_CONV_SOLIB_NAMES))
|
|
||||||
NLSOBJNAME = $(NLS_SOLIBS)
|
|
||||||
LIBNLS = $(addprefix $(NLS_LIBPATH)/, $(NLS_SOLIBS))
|
|
||||||
|
|
||||||
ifeq ($(ARCH), OSF1)
|
|
||||||
NLSLINK = -L$(NLS_LIBPATH) $(addprefix -l, $(addsuffix $(DLL_PRESUF), $(addprefix ns, $(NLS_LIBNAMES)))) -lcxx
|
|
||||||
NLSLINK_STATIC = $(addprefix $(NLS_LIBPATH)/, $(NLS_LIBS)) -lcxx
|
|
||||||
NLSLINK_CONV_STATIC = $(addprefix $(NLS_LIBPATH)/, $(NLS_CONV_LIBS))
|
|
||||||
else
|
|
||||||
ifeq ($(ARCH),HPUX)
|
|
||||||
#linking with libC is *BAD* on HPUX11
|
|
||||||
NLSLINK = -L$(NLS_LIBPATH) $(addprefix -l, $(addsuffix $(DLL_PRESUF), $(addprefix ns, $(NLS_LIBNAMES))))
|
|
||||||
NLSLINK_STATIC = $(addprefix $(NLS_LIBPATH)/, $(NLS_LIBS))
|
|
||||||
NLSLINK_CONV_STATIC = $(addprefix $(NLS_LIBPATH)/, $(NLS_CONV_LIBS))
|
|
||||||
else
|
|
||||||
ifeq ($(ARCH),Linux)
|
|
||||||
NLSLINK = -L$(NLS_LIBPATH) $(addprefix -l, $(addsuffix $(DLL_PRESUF), $(addprefix ns, $(NLS_LIBNAMES)))) -lresolv -lpthread
|
|
||||||
NLSLINK_STATIC = $(addprefix $(NLS_LIBPATH)/, $(NLS_LIBS)) -lresolv -lpthread
|
|
||||||
else
|
|
||||||
ifeq ($(ARCH),IRIX)
|
|
||||||
NLSLINK = -L$(NLS_LIBPATH) $(addprefix -l, $(addsuffix $(DLL_PRESUF), $(addprefix ns, $(NLS_LIBNAMES)))) -lpthread
|
|
||||||
NLSLINK_STATIC = $(addprefix $(NLS_LIBPATH)/, $(NLS_LIBS)) -lpthread
|
|
||||||
else
|
|
||||||
NLSLINK = -L$(NLS_LIBPATH) $(addprefix -l, $(addsuffix $(DLL_PRESUF), $(addprefix ns, $(NLS_LIBNAMES)))) -lC
|
|
||||||
NLSLINK_STATIC = $(addprefix $(NLS_LIBPATH)/, $(NLS_LIBS)) -lC
|
|
||||||
endif # Irix
|
|
||||||
endif # Linux
|
|
||||||
NLSLINK_CONV_STATIC = $(addprefix $(NLS_LIBPATH)/, $(NLS_CONV_LIBS))
|
|
||||||
endif # HPUX
|
|
||||||
endif # OSF1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH), SOLARIS)
|
|
||||||
NLSLINK += -lw
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(LIBNLS): $(NLS_VERSION_FILE) nls_version_check
|
|
||||||
|
|
||||||
$(NLS_VERSION_FILE):
|
|
||||||
mkdir -p $(NLS_ROOT); \
|
|
||||||
cd $(NLS_ROOT); echo "garbage" > Version
|
|
||||||
|
|
||||||
ifneq ($(ARCH), WINNT)
|
|
||||||
ifndef FORCE_FTP
|
|
||||||
nls_version_check:
|
|
||||||
@if [ `cat $(NLS_VERSION_FILE)` != "$(NLS_VERSION)" -o ! -d $(NLS_ROOT)/$(NLSOBJDIR) ]; then \
|
|
||||||
if [ -d $(NLS_RELEASE) ]; then \
|
|
||||||
if [ "$(RELEASE_TREE)" != "" ]; then \
|
|
||||||
(cd $(NLS_ROOT); \
|
|
||||||
\rm -rf $(NLSOBJDIR) $(NLS_VERSION_FILE); \
|
|
||||||
ln -s $(RELEASE_TREE)/libnls31/$(NLSOBJDIR) $(NLSOBJDIR)); \
|
|
||||||
echo "$(NLS_VERSION)" > $(NLS_VERSION_FILE); \
|
|
||||||
else \
|
|
||||||
(cd $(NLS_ROOT); \
|
|
||||||
\rm -rf $(NLSOBJDIR) $(NLS_VERSION_FILE); \
|
|
||||||
ln -s $(NLS_RELEASE) $(NLSOBJDIR)); \
|
|
||||||
echo "$(NLS_VERSION)" > $(NLS_VERSION_FILE); \
|
|
||||||
fi; \
|
|
||||||
else \
|
|
||||||
echo "************************** ERROR *************************"; \
|
|
||||||
echo "LIBNLS client libraries are missing. Make sure your machine"; \
|
|
||||||
echo "has access to $(NLS_RELEASE)"; \
|
|
||||||
echo "**********************************************************"; \
|
|
||||||
exit 1; \
|
|
||||||
fi; \
|
|
||||||
fi; \
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
nls_version_check:
|
|
||||||
# The following shell script recalculates $(NLS_INCLUDE), $(NLS_LIBPATH) and
|
|
||||||
# $(NLS_VERSION_FILE)
|
|
||||||
sh $(MCOM_ROOT)/c-sdk/compver.sh $(NLS_ROOT) $(NLS_VERSION) \
|
|
||||||
$(NLSOBJDIR) $(MCOM_ROOT) $(MODULE) $(NLS_RELEASE) libnls$(NLS_VERS_NUM) \
|
|
||||||
"' include lib conv$(NLS_VERS_NUM) locale$(NLS_VERS_NUM) '" $(NLS_ROOT)/$(NLSOBJDIR)/locale$(NLS_VERS_NUM)/index.txt
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
|
|
||||||
nls_version_check:
|
|
||||||
# The following shell script recalculates $(NLS_INCLUDE), $(NLS_LIBPATH) and
|
|
||||||
# $(NLS_VERSION_FILE)
|
|
||||||
sh $(MCOM_ROOT)/c-sdk/compver.sh $(NLS_ROOT) $(NLS_VERSION) \
|
|
||||||
$(NLSOBJDIR) $(MCOM_ROOT) ldapsdk $(NLS_RELEASE) \
|
|
||||||
libnls$(NLS_VERS_NUM) \
|
|
||||||
"' include lib conv$(NLS_VERS_NUM) locale$(NLS_VERS_NUM) '" \
|
|
||||||
$(NLS_ROOT)/$(NLSOBJDIR)/locale$(NLS_VERS_NUM)/index.txt
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH), HPUX)
|
|
||||||
ifeq ($(NSOS_RELEASE), B.11.00)
|
|
||||||
EXTRA_LIBS += -lrt
|
|
||||||
CXX=aCC -DHPUX_ACC -D__STDC_EXT__ -D_POSIX_C_SOURCE=199506L
|
|
||||||
LINK_EXE_NOLIBSOBJS_NOCXX = $(CXX) -Wl,-E $(ALDFLAGS) $(LDFLAGS) \
|
|
||||||
$(RPATHFLAG_PREFIX)$(RPATHFLAG) -o $@
|
|
||||||
LINK_EXE_NOCXX = $(CXX) -Wl,-E $(ALDFLAGS) $(LDFLAGS) \
|
|
||||||
$(RPATHFLAG_PREFIX)$(RPATHFLAG) -o $@ $(OBJS) $(EXTRA_LIBS)
|
|
||||||
endif
|
|
||||||
ifeq ($(NSOS_RELEASE), B.11.00_64)
|
|
||||||
EXTRA_LIBS += -lrt
|
|
||||||
CXX=aCC -DHPUX_ACC -D__STDC_EXT__ -D_POSIX_C_SOURCE=199506L +DA2.0W +DS2.0
|
|
||||||
LINK_EXE_NOLIBSOBJS_NOCXX = $(CXX) -Wl,-E $(ALDFLAGS) $(LDFLAGS) \
|
|
||||||
$(RPATHFLAG_PREFIX)$(RPATHFLAG) -o $@
|
|
||||||
LINK_EXE_NOCXX = $(CXX) -Wl,-E $(ALDFLAGS) $(LDFLAGS) \
|
|
||||||
$(RPATHFLAG_PREFIX)$(RPATHFLAG) -o $@ $(OBJS) $(EXTRA_LIBS)
|
|
||||||
endif
|
|
||||||
ifeq ($(NSOS_RELEASE), B.10.10)
|
|
||||||
CC= CC +a1
|
|
||||||
# CXX=CC -D__STDC_EXT__
|
|
||||||
# $(subst "+e", "",$(CFLAGS))
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH),Linux)
|
|
||||||
CXX = egcs
|
|
||||||
LINK_EXE = $(CXX) $(ALDFLAGS) $(LDFLAGS) \
|
|
||||||
$(RPATHFLAG_PREFIX)$(RPATHFLAG)$(RPATHFLAG_EXTRAS) \
|
|
||||||
-o $@ $(OBJS) $(EXTRA_LIBS)
|
|
||||||
LINK_EXE_NOLIBSOBJS = $(CXX) $(ALDFLAGS) $(LDFLAGS) \
|
|
||||||
$(RPATHFLAG_PREFIX)$(RPATHFLAG)$(RPATHFLAG_EXTRAS) -o $@
|
|
||||||
|
|
||||||
else
|
|
||||||
ifeq ($(ARCH), OSF1)
|
|
||||||
ifdef USE_LD_RUN_PATH
|
|
||||||
#does RPATH differently. instead we export RPATHFLAG as LD_RUN_PATH
|
|
||||||
#see ns/c-sdk/ldap/clients/tools/Makefile for an example
|
|
||||||
export LD_RUN_PATH=$(RPATHFLAG)
|
|
||||||
LINK_EXE = $(CXX) $(ALDFLAGS) $(LDFLAGS) \
|
|
||||||
-o $@ $(OBJS) $(EXTRA_LIBS)
|
|
||||||
LINK_EXE_NOLIBSOBJS = $(CXX) $(ALDFLAGS) $(LDFLAGS) -o $@
|
|
||||||
else # USE_LD_RUN_PATH
|
|
||||||
LINK_EXE = $(CXX) $(ALDFLAGS) $(LDFLAGS) \
|
|
||||||
$(RPATHFLAG_PREFIX)$(RPATHFLAG)$(RPATHFLAG_EXTRAS) \
|
|
||||||
-o $@ $(OBJS) $(EXTRA_LIBS)
|
|
||||||
LINK_EXE_NOLIBSOBJS = $(CXX) $(ALDFLAGS) $(LDFLAGS) \
|
|
||||||
$(RPATHFLAG_PREFIX)$(RPATHFLAG)$(RPATHFLAG_EXTRAS) -o $@
|
|
||||||
endif # USE_LD_RUN_PATH
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
MCOM_INCLUDE += -I$(NLS_INCLUDE)
|
|
||||||
|
|
||||||
INCLUDES += $(SSLINCLUDE) $(NO_LIBLCACHE)
|
|
||||||
DEFS += $(SSL)
|
|
||||||
|
|
||||||
ALDFLAGS += $(SSLLIBFLAG)
|
|
||||||
|
|
||||||
ifeq ($(ARCH), WINNT)
|
|
||||||
SUBSYSTEM=console
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(ARCH), WINNT)
|
|
||||||
# Run-time search path for shared libraries: in admin server 3.x installations,
|
|
||||||
# the ldap tools get installed under NSHOME/userdb/ldap/tools and the LDAP SDK
|
|
||||||
# libraries (libldap and liblcache) get installed under NSHOME/lib, so the
|
|
||||||
# correct library search path is ../../../lib. We also want to search
|
|
||||||
# NSHOME/bin/slapd, where more recent versions of the SDK so's may be.
|
|
||||||
RPATHFLAG=..:../lib:../../lib:../../../lib:../../../../lib
|
|
||||||
ifdef USE_LD_RUN_PATH
|
|
||||||
LD_RUN_PATH=$(RPATHFLAG)
|
|
||||||
export LD_RUN_PATH
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# svrcore is used by ntpinobj, and pinarg handling
|
|
||||||
LIBSVRCORE_DEP= $(NSCP_DISTDIR)/lib/svrcore.$(LIB_SUFFIX)
|
|
||||||
ifeq ($(ARCH), WINNT)
|
|
||||||
LIBSVRCORE= $(NSCP_DISTDIR)/lib/svrcore.$(LIB_SUFFIX)
|
|
||||||
else
|
|
||||||
LIBSVRCORE = -lsvrcore
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(INCLUDE_SSL),1)
|
|
||||||
# libsec and friends are already in libldap, so don't link with them here
|
|
||||||
LDTOOLS_LIBS_DEP = $(LDAP_SDK_LIBLDAP_DLL_DEP) $(EXTRA_LIBS_DEP)
|
|
||||||
LDTOOLS_LIBS = $(LDAP_SDK_LIBLDAP_DLL)
|
|
||||||
ifneq ($(LDAP_NO_LIBLCACHE),1)
|
|
||||||
LDTOOLS_LIBS_DEP += $(LDAP_LIBLDIF_DEP)
|
|
||||||
LDTOOLS_LIBS += $(LDAP_LIBLDIF) $(LDAP_SDK_LIBLCACHE_DLL)
|
|
||||||
else
|
|
||||||
LDTOOLS_LIBS_DEP += $(LDAP_LIBLDIF_DEP)
|
|
||||||
LDTOOLS_LIBS += $(LDAP_LIBLDIF)
|
|
||||||
endif
|
|
||||||
|
|
||||||
LDTOOLS_LIBS += $(EXTRA_LIBS) $(EXTRA_MALLOC_LIBS) $(LDAP_SDK_LIBLDAP_DLL) $(LIBSVRCORE)
|
|
||||||
|
|
||||||
# XXXceb The linker on NT is auto optimizing. We still need to have libsec around for svrcore
|
|
||||||
# Do Not Mess with the link order. This was not straightforward, and "optimizing" the text
|
|
||||||
# will break the builds.
|
|
||||||
ifeq ($(ARCH), WINNT)
|
|
||||||
LDTOOLS_LIBS += $(LIBSEC)
|
|
||||||
endif
|
|
||||||
ifeq ($(ARCH), SOLARIS)
|
|
||||||
LDTOOLS_LIBS += $(LIBSEC) $(LIBDB)
|
|
||||||
endif
|
|
||||||
ifeq ($(ARCH), HPUX)
|
|
||||||
LDTOOLS_LIBS += $(LIBSEC)
|
|
||||||
endif
|
|
||||||
ifeq ($(ARCH), IRIX)
|
|
||||||
LDTOOLS_LIBS += $(LIBSEC) $(LIBDB)
|
|
||||||
endif
|
|
||||||
ifeq ($(ARCH), AIX)
|
|
||||||
LDTOOLS_LIBS += $(LIBSEC) $(LIBDB)
|
|
||||||
endif
|
|
||||||
ifeq ($(ARCH), WINNT)
|
|
||||||
LDTOOLS_LIBS += $(LIBNSPR)
|
|
||||||
else
|
|
||||||
LDTOOLS_LIBS += $(DYNAMICNSPR)
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
# SSL is not included in the LDAP shared library...
|
|
||||||
# need to link with libsec and friends explicitly
|
|
||||||
LDTOOLS_LIBS_DEP = $(LDAP_SDK_LIBS_DEP) $(LDAP_LIBLDIF_DEP) \
|
|
||||||
$(EXTRA_LIBS_DEP)
|
|
||||||
LDTOOLS_LIBS_DEP += $(LDAP_LIBLDIF_DEP)
|
|
||||||
ifeq ($(ARCH), OSF1)
|
|
||||||
LDTOOLS_LIBS = $(LDAP_SDK_LIBSSLDAP_LIB) $(LDAP_SDK_LIBLDAP_DLL) $(LDAP_SDK_LIBPRLDAP_DLL)
|
|
||||||
else
|
|
||||||
LDTOOLS_LIBS = $(LDAP_SDK_LIBSSLDAP_LIB) $(LDAP_SDK_LIBPRLDAP_DLL) $(LDAP_SDK_LIBLDAP_DLL)
|
|
||||||
endif
|
|
||||||
ifneq ($(LDAP_NO_LIBLCACHE),1)
|
|
||||||
LDTOOLS_LIBS += $(LDAP_SDK_LIBLCACHE_DLL)
|
|
||||||
endif
|
|
||||||
LDTOOLS_LIBS += $(LIBSVRCORE) $(LIBSEC) $(LIBDB) $(EXTRA_LIBS)\
|
|
||||||
$(EXTRA_MALLOC_LIBS) $(LDAP_LIBLDIF)
|
|
||||||
|
|
||||||
ifneq ($(LDAP_NO_LIBLCACHE),1)
|
|
||||||
ifndef LDAP_USE_OLD_DB
|
|
||||||
LDTOOLS_LIBS_DEP+=$(DB_LIB_DEP)
|
|
||||||
LDTOOLS_LIBS+=$(DB_LIB)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(LDAP_NO_LIBLCACHE),1)
|
|
||||||
CFLAGS+=-DNO_LIBLCACHE
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH), WINNT)
|
|
||||||
LDTOOLS_LIBS += $(LIBNSPR)
|
|
||||||
else
|
|
||||||
LDTOOLS_LIBS += $(DYNAMICNSPR)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# INCLUDE_SSL
|
|
||||||
endif
|
|
||||||
|
|
||||||
LDTOOLS_LIBS_DEP += $(LIBNLS)
|
|
||||||
ifeq ($(ARCH), WINNT)
|
|
||||||
LDTOOLS_LIBS += $(LIBNLS) $(LIBNLS_CONV)
|
|
||||||
else
|
|
||||||
LDTOOLS_LIBS += $(NLSLINK_STATIC) $(NLSLINK_CONV_STATIC)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#LDTOOLS_LIBS += $(LIBSVRCORE)
|
|
||||||
|
|
||||||
ifeq ($(ARCH), AIX)
|
|
||||||
LDTOOLS_LIBS += $(EXE_EXTRA_LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH), WINNT)
|
|
||||||
ALDFLAGS += -FORCE:MULTIPLE /NODEFAULTLIB:MSVCRTD
|
|
||||||
endif
|
|
||||||
|
|
||||||
#ifeq ($(ARCH), HPUX)
|
|
||||||
#CC=CC +a1
|
|
||||||
#LINK_EXE = $(LINK_EXE_NOCXX)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH),IRIX)
|
|
||||||
ifeq ($(USE_N32),1)
|
|
||||||
CXX=CC
|
|
||||||
LDFLAGS += -n32 -mips3
|
|
||||||
CC=cc
|
|
||||||
LINK_EXE = $(CXX) $(ALDFLAGS) $(LDFLAGS) \
|
|
||||||
-o $@ $(OBJS) $(EXTRA_LIBS)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH), SOLARIS)
|
|
||||||
ifeq ($(USE_64), 1)
|
|
||||||
LINK_EXE += -xarch=v9 -L/usr/lib/sparcv9 -lCrun
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
LINK_EXE += -$(LIBPATH)../$(MCOM_ROOT)/dist/$(NC_BUILD_FLAVOR)/lib
|
|
||||||
|
|
||||||
LDAPDELETE_OBJ = $(addprefix $(OBJDEST)/, ldapdelete.o)
|
|
||||||
LDAPMODIFY_OBJ = $(addprefix $(OBJDEST)/, ldapmodify.o fileurl.o)
|
|
||||||
LDAPMODRDN_OBJ = $(addprefix $(OBJDEST)/, ldapmodrdn.o)
|
|
||||||
LDAPSEARCH_OBJ = $(addprefix $(OBJDEST)/, ldapsearch.o fileurl.o)
|
|
||||||
LDAPCMP_OBJ = $(addprefix $(OBJDEST)/, ldapcmp.o)
|
|
||||||
LDAPTOOLCOMMON_OBJ = $(addprefix $(OBJDEST)/, common.o convutf8.o argpin.o ntuserpin.o)
|
|
||||||
|
|
||||||
CLIENT_OBJS = $(LDAPDELETE_OBJ) $(LDAPMODIFY_OBJ) $(LDAPMODRDN_OBJ) \
|
|
||||||
$(LDAPSEARCH_OBJ) $(LDAPCMP_OBJ) $(LDAPTOOLCOMMON_OBJ)
|
|
||||||
|
|
||||||
LDAPDELETE = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapdelete))
|
|
||||||
LDAPMODIFY = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapmodify))
|
|
||||||
LDAPMODRDN = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapmodrdn))
|
|
||||||
LDAPSEARCH = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapsearch))
|
|
||||||
LDAPADD = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapadd))
|
|
||||||
LDAPCMP = $(addsuffix $(EXE_SUFFIX), $(addprefix $(BINDIR)/, ldapcmp))
|
|
||||||
|
|
||||||
BINS= $(LDAPDELETE) $(LDAPMODIFY) $(LDAPSEARCH) $(LDAPCMP)
|
|
||||||
|
|
||||||
all: $(OBJDEST) $(BINDIR) $(BINS)
|
|
||||||
cmp: $(LDAPCMP)
|
|
||||||
|
|
||||||
$(LDAPTOOLCOMMON_OBJ): $(LIBNLS)
|
|
||||||
|
|
||||||
$(LDAPDELETE): $(LDAPDELETE_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
|
|
||||||
$(LINK_EXE) $(LDAPDELETE_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDTOOLS_LIBS)
|
|
||||||
|
|
||||||
$(LDAPMODIFY): $(LDAPMODIFY_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
|
|
||||||
$(LINK_EXE) $(LDAPMODIFY_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDTOOLS_LIBS)
|
|
||||||
|
|
||||||
$(LDAPMODRDN): $(LDAPMODRDN_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
|
|
||||||
$(LINK_EXE) $(LDAPMODRDN_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDTOOLS_LIBS)
|
|
||||||
|
|
||||||
$(LDAPSEARCH): $(LDAPSEARCH_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
|
|
||||||
$(LINK_EXE) $(LDAPSEARCH_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDTOOLS_LIBS)
|
|
||||||
|
|
||||||
$(LDAPADD): $(LDAPMODIFY) $(LDTOOLS_LIBS_DEP)
|
|
||||||
$(RM) $(LDAPADD)
|
|
||||||
$(HARDLN) $(LDAPMODIFY) $(LDAPADD)
|
|
||||||
|
|
||||||
$(LDAPCMP): $(LDAPCMP_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDTOOLS_LIBS_DEP)
|
|
||||||
$(LINK_EXE) $(LDAPCMP_OBJ) $(LDAPTOOLCOMMON_OBJ) $(LDTOOLS_LIBS)
|
|
||||||
|
|
||||||
clientSDK: all
|
|
||||||
|
|
||||||
$(OBJDEST):
|
|
||||||
$(MKDIR) $(OBJDEST)
|
|
||||||
|
|
||||||
$(BINDIR):
|
|
||||||
$(MKDIR) $(BINDIR)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
$(RM) $(CLIENT_OBJS)
|
|
||||||
$(RM) $(BINS)
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
$(LDAPMODRDN_OBJ): $(LDAPTOOL_COMMON_DEPS)
|
|
||||||
$(LDAPSEARCH_OBJ): $(LDAPTOOL_COMMON_DEPS) fileurl.h
|
|
||||||
$(LDAPCMP_OBJ): $(LDAPTOOL_COMMON_DEPS)
|
|
||||||
@ -1,363 +0,0 @@
|
|||||||
#
|
|
||||||
# The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
|
|
||||||
NS_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
|
|
||||||
CFLAGS+=-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)
|
|
||||||
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)
|
|
||||||
|
|
||||||
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 ($(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) \
|
|
||||||
-l$(SSL_LIBNAME) -l$(NSS_LIBNAME) \
|
|
||||||
-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
|
|
||||||
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) \
|
|
||||||
-l$(SSL_LIBNAME) -l$(NSS_LIBNAME) \
|
|
||||||
-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) \
|
|
||||||
-l$(SSL_LIBNAME) -l$(NSS_LIBNAME) \
|
|
||||||
-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) \
|
|
||||||
-l$(SSL_LIBNAME) -l$(NSS_LIBNAME) -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) \
|
|
||||||
-l$(SSL_LIBNAME) -l$(NSS_LIBNAME) \
|
|
||||||
-ldl -brtl -lpthreads -lc_r -lm
|
|
||||||
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)
|
|
||||||
OS_VERS := $(shell uname -r)
|
|
||||||
ifeq ($(OS_VERS),5.6)
|
|
||||||
EXTRA_LIBS += $(LIBNLS_LIBDIR)/$(NSCNV_LIBNAME) -lC \
|
|
||||||
$(LIBNLS_LIBDIR)/$(NSJPN_LIBNAME) \
|
|
||||||
$(LIBNLS_LIBDIR)/$(NSCCK_LIBNAME) \
|
|
||||||
$(LIBNLS_LIBDIR)/$(NSSB_LIBNAME)
|
|
||||||
else
|
|
||||||
EXTRA_LIBS += $(LIBNLS_LIBDIR)/$(NSCNV_LIBNAME) -lCrun \
|
|
||||||
$(LIBNLS_LIBDIR)/$(NSJPN_LIBNAME) \
|
|
||||||
$(LIBNLS_LIBDIR)/$(NSCCK_LIBNAME) \
|
|
||||||
$(LIBNLS_LIBDIR)/$(NSSB_LIBNAME)
|
|
||||||
endif
|
|
||||||
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:: $(BINS) $(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)
|
|
||||||
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)
|
|
||||||
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)
|
|
||||||
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)
|
|
||||||
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 ($(OS_ARCH), WINNT)
|
|
||||||
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 \
|
|
||||||
/share/builds/components/libnls$(NLS_LIBVERSION)/v3.2/$(OBJDIR_NAME) \
|
|
||||||
libnls$(NLS_LIBVERSION) \
|
|
||||||
"include lib conv$(NLS_LIBVERSION) locale$(NLS_LIBVERSION)" \
|
|
||||||
../../../../../dist/libnls31/$(OBJDIR_NAME)/locale$(NLS_LIBVERSION)/index.txt
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(LDAPTOOLCOMMON_OBJ):
|
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), HP-UX)
|
|
||||||
$(LDAPTOOLCPPCOMMON_OBJ): convutf8.cpp
|
|
||||||
ifneq ($(USE_64), 1)
|
|
||||||
/opt/aCC/bin/aCC -ext -DHPUX_ACC -D__STDC_EXT__ -D_POSIX_C_SOURCE=199506L -c -DHPUX11 -DHPUX11_00 +DAportable +DS1.1 -D_LARGEFILE64_SOURCE -D_PR_HAVE_OFF64_T -DNO_NODELOCK -DNO_LIBLCACHE -DXP_UNIX -DHPUX -DMCC_HTTPD -DNS_DOMESTIC -DNET_SSL -DCLIENT_AUTH -DNSPR20 -D_PR_NTHREAD -D_PR_USECPU -D_REENTRANT -DNS_DS -DSPAPI20 -DBUILD_NUM=\"01.081.1519\" -DCPU_hppa -DOS_hpux -D_NO_THREADS_ -Dhpux -Dhpux -D_HPUX_SOURCE -D_REENTRANT -Aa -DLDAP_REFERRALS -DLDAP_LDBM -DLDAP_LDIF -DLDBM_USE_DBBTREE -DSLAPD_PASSWD_SHA1 -D__DBINTERFACE_PRIVATE -DNO_LIBLCACHE -DNS_DIRECTORY -DNET_SSL -DUSE_NSPR_MT -O $(INCLUDES) convutf8.cpp -o $(OBJDIR_NAME)/convutf8.o
|
|
||||||
else
|
|
||||||
/opt/aCC/bin/aCC -DHPUX_ACC -D__STDC_EXT__ -D_POSIX_C_SOURCE=199506L +DA2.0W +DS2.0 -c -DHPUX11 -DHPUX11_00 -DIS_64 +e +DA2.0W +DS2.0 -D_LARGEFILE64_SOURCE -D_PR_HAVE_OFF64_T -DNO_NODELOCK -DNO_LIBLCACHE -DXP_UNIX -DHPUX -DMCC_DEBUG -g -DMCC_HTTPD -DNS_DOMESTIC -DNET_SSL -DCLIENT_AUTH -DNSPR20 -D_PR_NTHREAD -D_PR_USECPU -D_REENTRANT -DNS_DS -DSPAPI20 -DBUILD_NUM=\"01.081.1617\" -DCPU_hppa -DOS_hpux -D_NO_THREADS_ -Dhpux -Dhpux -D_HPUX_SOURCE -D_REENTRANT -Aa -DLDAP_DEBUG -DLDAP_REFERRALS -DLDAP_LDBM -DLDAP_LDIF -DLDBM_USE_DBBTREE -DSLAPD_PASSWD_SHA1 -D__DBINTERFACE_PRIVATE -DNO_LIBLCACHE -DNS_DIRECTORY -DNET_SSL -DUSE_NSPR_MT $(INCLUDES) -g convutf8.cpp -o $(OBJDIR_NAME)/convutf8.o
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
$(LDAPTOOLCPPCOMMON_OBJ):
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(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
|
|
||||||
$(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:
|
|
||||||
@ -1,59 +0,0 @@
|
|||||||
Summary of options used by the LDAP tools
|
|
||||||
|
|
||||||
Updated 5-May-2000 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: nvEMRHZ0d:D:f:h:I:j:K:N:O:P:p:Q:W:w:V:X:m:i:k:y:Y:
|
|
||||||
sorted: 0 DEHIKMNOPQRVWXYZ dfhikmnpvwy
|
|
||||||
avail: [2-9] J g (not used by any of the tools)
|
|
||||||
|
|
||||||
ldapcmp.c:
|
|
||||||
raw: Bb:l:s:z:
|
|
||||||
sorted: B blsz
|
|
||||||
all: 0 BDHIKMNOPQRVWXYZ bdfhiklmnpsvwyz
|
|
||||||
avail: [1-9] ACFGJLSTU acegjoqrtu
|
|
||||||
|
|
||||||
ldapcompare.c:
|
|
||||||
raw: cq
|
|
||||||
sorted: cq
|
|
||||||
all: 0 DEHIKMNOPQRVWXYZ cdfhikmnpqvwy
|
|
||||||
avail: [1-9] ABCFJLSTU abegjlorstuxz
|
|
||||||
|
|
||||||
ldapdelete.c (deprecated)
|
|
||||||
raw: c
|
|
||||||
sorted: c
|
|
||||||
all: 0 DHIKMNOPQRVWXYZ cdfhikmnpvwy
|
|
||||||
avail: [1-9] ABCFGJLSTU abegjloqrstuxz
|
|
||||||
|
|
||||||
ldapmodify.c
|
|
||||||
raw: aAbcFe:B:q
|
|
||||||
sorted: ABF abceq
|
|
||||||
all: 0 ABDFHIKMNOPQRVWXYZ abcdefhikmnpqvwy
|
|
||||||
avail: [1-9] CGJLSTU gjlorstuxz
|
|
||||||
|
|
||||||
ldapmodrdn.c (deprecated)
|
|
||||||
raw: cr
|
|
||||||
sorted: cr
|
|
||||||
all: 0 DHIKMNOPQRVWXYZ cdfhikmnprvwy
|
|
||||||
avail: [1-9] ABCFGJLSTU abegjloqstuxz
|
|
||||||
|
|
||||||
ldapsearch.c
|
|
||||||
raw: ABLTU1eotuxa:b:F:G:l:S:s:z:C:
|
|
||||||
sorted: 1 ABCFGLSTU abeostuxz
|
|
||||||
all: 01 ABCDFGHIKLMNOPQRSTUVWXYZ abdefhikmnopstuvwxyz
|
|
||||||
avail: [2-9] J cgjlqr
|
|
||||||
@ -1,147 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/******************************************************
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
void echoOff(int fd)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
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 };
|
|
||||||
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
#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
@ -1,598 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#ifndef HAVE_LIBNLS
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern char *ldaptool_charset;
|
|
||||||
char *ldaptool_convdir = NULL;
|
|
||||||
static int charsetset = 0;
|
|
||||||
char *ldaptool_local2UTF8( const char *src );
|
|
||||||
|
|
||||||
char *
|
|
||||||
ldaptool_local2UTF8( const char *src )
|
|
||||||
{
|
|
||||||
char *utf8;
|
|
||||||
|
|
||||||
charsetset = 0;
|
|
||||||
|
|
||||||
if (src == NULL)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
utf8 = strdup(src);
|
|
||||||
|
|
||||||
return ( utf8 );
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* HAVE_LIBNLS */
|
|
||||||
|
|
||||||
#define NSPR20
|
|
||||||
|
|
||||||
#ifdef XP_WIN32
|
|
||||||
#define VC_EXTRALEAN
|
|
||||||
#include <afxwin.h>
|
|
||||||
#include <winnls.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern char *ldaptool_charset;
|
|
||||||
static int charsetset = 0;
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
char *ldaptool_convdir = NULL;
|
|
||||||
char *ldaptool_local2UTF8( const char * );
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef XP_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_;
|
|
||||||
|
|
||||||
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 (strlen(buf) == 0 || buf[0] == '!')
|
|
||||||
{
|
|
||||||
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 /* Not defined XP_WIN32 */
|
|
||||||
|
|
||||||
#ifdef XP_WIN32
|
|
||||||
char *_convertor(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,
|
|
||||||
** 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
|
|
||||||
|
|
||||||
char *
|
|
||||||
ldaptool_local2UTF8( const char *src )
|
|
||||||
{
|
|
||||||
char *utf8;
|
|
||||||
#ifndef XP_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 = _convertor(src, FALSE);
|
|
||||||
if( utf8 == NULL )
|
|
||||||
utf8 = strdup(src);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return utf8;
|
|
||||||
}
|
|
||||||
#endif /* HAVE_LIBNLS */
|
|
||||||
|
|
||||||
#ifndef HAVE_LIBNLS
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@ -1,181 +0,0 @@
|
|||||||
# 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
|
|
||||||
-
|
|
||||||
@ -1,488 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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 */
|
|
||||||
struct stat fstats;
|
|
||||||
|
|
||||||
/* recognize "attr :< url" syntax if LDIF version is >= 1 */
|
|
||||||
if ( recognize_url_syntax && *value == '<' ) {
|
|
||||||
const char *url;
|
|
||||||
char *path;
|
|
||||||
|
|
||||||
for ( url = value + 1; isspace( *url ); ++url ) {
|
|
||||||
; /* NULL */
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* We only support file:// URLs for now.
|
|
||||||
*/
|
|
||||||
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 {
|
|
||||||
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;
|
|
||||||
int eof;
|
|
||||||
#if defined( XP_WIN32 )
|
|
||||||
char mode[20] = "r+b";
|
|
||||||
#else
|
|
||||||
char mode[20] = "r";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (( fp = fopen( 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 );
|
|
||||||
eof = feof( 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';
|
|
||||||
}
|
|
||||||
@ -1,84 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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
|
|
||||||
@ -1,603 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* 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);
|
|
||||||
ATTR* get_attrs( LDAP *ld, LDAPMessage *e );
|
|
||||||
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 int 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:", 0,
|
|
||||||
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 ) {
|
|
||||||
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 ) {
|
|
||||||
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, msgid;
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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 ( mktemp( tmpfname ) == NULL ) {
|
|
||||||
perror( tmpfname );
|
|
||||||
} else if (( tmpfp = fopen( 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 int
|
|
||||||
write_ldif_value( char *type, char *value, unsigned long vallen )
|
|
||||||
{
|
|
||||||
char *ldif;
|
|
||||||
|
|
||||||
if (( ldif = ldif_type_and_value( type, value, (int)vallen )) == NULL ) {
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
fputs( ldif, stdout );
|
|
||||||
free( ldif );
|
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
#endif /* 0 */
|
|
||||||
@ -1,215 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* 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] );
|
|
||||||
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 ] );
|
|
||||||
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 );
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
options_callback( int option, char *optarg )
|
|
||||||
{
|
|
||||||
switch( option ) {
|
|
||||||
case 'c': /* continuous operation mode */
|
|
||||||
++contoper;
|
|
||||||
break;
|
|
||||||
case 'q': /* continuous operation 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 ));
|
|
||||||
}
|
|
||||||
@ -1,142 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* 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, 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 ] );
|
|
||||||
rc = dodelete( ld, conv, ldaptool_request_ctrls );
|
|
||||||
if( conv != NULL )
|
|
||||||
free( conv );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
rc = 0;
|
|
||||||
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 );
|
|
||||||
}
|
|
||||||
|
|
||||||
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
@ -1,172 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* 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
@ -1,179 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
#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);
|
|
||||||
#else
|
|
||||||
#include <sys/file.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <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_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 * );
|
|
||||||
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);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* LDAPTOOL_H */
|
|
||||||
@ -1,115 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/******************************************************
|
|
||||||
*
|
|
||||||
* 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 ) */
|
|
||||||
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/******************************************************
|
|
||||||
*
|
|
||||||
* 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
798
mozilla/directory/c-sdk/ldap/configure
vendored
798
mozilla/directory/c-sdk/ldap/configure
vendored
@ -1,798 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
|
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
|
||||||
# Generated automatically using autoconf version 2.13
|
|
||||||
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This configure script is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy, distribute and modify it.
|
|
||||||
|
|
||||||
# Defaults:
|
|
||||||
ac_help=
|
|
||||||
ac_default_prefix=/usr/local
|
|
||||||
# Any additions from configure.in:
|
|
||||||
ac_help="$ac_help
|
|
||||||
--enable-nspr-autoconf Enable building with an autoconf'ed NSPR tree"
|
|
||||||
|
|
||||||
# Initialize some variables set by options.
|
|
||||||
# The variables have the same names as the options, with
|
|
||||||
# dashes changed to underlines.
|
|
||||||
build=NONE
|
|
||||||
cache_file=./config.cache
|
|
||||||
exec_prefix=NONE
|
|
||||||
host=NONE
|
|
||||||
no_create=
|
|
||||||
nonopt=NONE
|
|
||||||
no_recursion=
|
|
||||||
prefix=NONE
|
|
||||||
program_prefix=NONE
|
|
||||||
program_suffix=NONE
|
|
||||||
program_transform_name=s,x,x,
|
|
||||||
silent=
|
|
||||||
site=
|
|
||||||
srcdir=
|
|
||||||
target=NONE
|
|
||||||
verbose=
|
|
||||||
x_includes=NONE
|
|
||||||
x_libraries=NONE
|
|
||||||
bindir='${exec_prefix}/bin'
|
|
||||||
sbindir='${exec_prefix}/sbin'
|
|
||||||
libexecdir='${exec_prefix}/libexec'
|
|
||||||
datadir='${prefix}/share'
|
|
||||||
sysconfdir='${prefix}/etc'
|
|
||||||
sharedstatedir='${prefix}/com'
|
|
||||||
localstatedir='${prefix}/var'
|
|
||||||
libdir='${exec_prefix}/lib'
|
|
||||||
includedir='${prefix}/include'
|
|
||||||
oldincludedir='/usr/include'
|
|
||||||
infodir='${prefix}/info'
|
|
||||||
mandir='${prefix}/man'
|
|
||||||
|
|
||||||
# Initialize some other variables.
|
|
||||||
subdirs=
|
|
||||||
MFLAGS= MAKEFLAGS=
|
|
||||||
SHELL=${CONFIG_SHELL-/bin/sh}
|
|
||||||
# Maximum number of lines to put in a shell here document.
|
|
||||||
ac_max_here_lines=12
|
|
||||||
|
|
||||||
ac_prev=
|
|
||||||
for ac_option
|
|
||||||
do
|
|
||||||
|
|
||||||
# If the previous option needs an argument, assign it.
|
|
||||||
if test -n "$ac_prev"; then
|
|
||||||
eval "$ac_prev=\$ac_option"
|
|
||||||
ac_prev=
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$ac_option" in
|
|
||||||
-*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
|
||||||
*) ac_optarg= ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Accept the important Cygnus configure options, so we can diagnose typos.
|
|
||||||
|
|
||||||
case "$ac_option" in
|
|
||||||
|
|
||||||
-bindir | --bindir | --bindi | --bind | --bin | --bi)
|
|
||||||
ac_prev=bindir ;;
|
|
||||||
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
|
|
||||||
bindir="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-build | --build | --buil | --bui | --bu)
|
|
||||||
ac_prev=build ;;
|
|
||||||
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
|
|
||||||
build="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-cache-file | --cache-file | --cache-fil | --cache-fi \
|
|
||||||
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
|
|
||||||
ac_prev=cache_file ;;
|
|
||||||
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
|
|
||||||
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
|
|
||||||
cache_file="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-datadir | --datadir | --datadi | --datad | --data | --dat | --da)
|
|
||||||
ac_prev=datadir ;;
|
|
||||||
-datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
|
|
||||||
| --da=*)
|
|
||||||
datadir="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-disable-* | --disable-*)
|
|
||||||
ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
|
|
||||||
# Reject names that are not valid shell variable names.
|
|
||||||
if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
|
|
||||||
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
|
|
||||||
fi
|
|
||||||
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
|
|
||||||
eval "enable_${ac_feature}=no" ;;
|
|
||||||
|
|
||||||
-enable-* | --enable-*)
|
|
||||||
ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
|
|
||||||
# Reject names that are not valid shell variable names.
|
|
||||||
if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
|
|
||||||
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
|
|
||||||
fi
|
|
||||||
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
|
|
||||||
case "$ac_option" in
|
|
||||||
*=*) ;;
|
|
||||||
*) ac_optarg=yes ;;
|
|
||||||
esac
|
|
||||||
eval "enable_${ac_feature}='$ac_optarg'" ;;
|
|
||||||
|
|
||||||
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
|
|
||||||
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
|
|
||||||
| --exec | --exe | --ex)
|
|
||||||
ac_prev=exec_prefix ;;
|
|
||||||
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
|
|
||||||
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
|
|
||||||
| --exec=* | --exe=* | --ex=*)
|
|
||||||
exec_prefix="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-gas | --gas | --ga | --g)
|
|
||||||
# Obsolete; use --with-gas.
|
|
||||||
with_gas=yes ;;
|
|
||||||
|
|
||||||
-help | --help | --hel | --he)
|
|
||||||
# Omit some internal or obsolete options to make the list less imposing.
|
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
|
||||||
cat << EOF
|
|
||||||
Usage: configure [options] [host]
|
|
||||||
Options: [defaults in brackets after descriptions]
|
|
||||||
Configuration:
|
|
||||||
--cache-file=FILE cache test results in FILE
|
|
||||||
--help print this message
|
|
||||||
--no-create do not create output files
|
|
||||||
--quiet, --silent do not print \`checking...' messages
|
|
||||||
--version print the version of autoconf that created configure
|
|
||||||
Directory and file names:
|
|
||||||
--prefix=PREFIX install architecture-independent files in PREFIX
|
|
||||||
[$ac_default_prefix]
|
|
||||||
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
|
|
||||||
[same as prefix]
|
|
||||||
--bindir=DIR user executables in DIR [EPREFIX/bin]
|
|
||||||
--sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
|
|
||||||
--libexecdir=DIR program executables in DIR [EPREFIX/libexec]
|
|
||||||
--datadir=DIR read-only architecture-independent data in DIR
|
|
||||||
[PREFIX/share]
|
|
||||||
--sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
|
|
||||||
--sharedstatedir=DIR modifiable architecture-independent data in DIR
|
|
||||||
[PREFIX/com]
|
|
||||||
--localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
|
|
||||||
--libdir=DIR object code libraries in DIR [EPREFIX/lib]
|
|
||||||
--includedir=DIR C header files in DIR [PREFIX/include]
|
|
||||||
--oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
|
|
||||||
--infodir=DIR info documentation in DIR [PREFIX/info]
|
|
||||||
--mandir=DIR man documentation in DIR [PREFIX/man]
|
|
||||||
--srcdir=DIR find the sources in DIR [configure dir or ..]
|
|
||||||
--program-prefix=PREFIX prepend PREFIX to installed program names
|
|
||||||
--program-suffix=SUFFIX append SUFFIX to installed program names
|
|
||||||
--program-transform-name=PROGRAM
|
|
||||||
run sed PROGRAM on installed program names
|
|
||||||
EOF
|
|
||||||
cat << EOF
|
|
||||||
Host type:
|
|
||||||
--build=BUILD configure for building on BUILD [BUILD=HOST]
|
|
||||||
--host=HOST configure for HOST [guessed]
|
|
||||||
--target=TARGET configure for TARGET [TARGET=HOST]
|
|
||||||
Features and packages:
|
|
||||||
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
|
|
||||||
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
|
|
||||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
|
||||||
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
|
|
||||||
--x-includes=DIR X include files are in DIR
|
|
||||||
--x-libraries=DIR X library files are in DIR
|
|
||||||
EOF
|
|
||||||
if test -n "$ac_help"; then
|
|
||||||
echo "--enable and --with options recognized:$ac_help"
|
|
||||||
fi
|
|
||||||
exit 0 ;;
|
|
||||||
|
|
||||||
-host | --host | --hos | --ho)
|
|
||||||
ac_prev=host ;;
|
|
||||||
-host=* | --host=* | --hos=* | --ho=*)
|
|
||||||
host="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-includedir | --includedir | --includedi | --included | --include \
|
|
||||||
| --includ | --inclu | --incl | --inc)
|
|
||||||
ac_prev=includedir ;;
|
|
||||||
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
|
|
||||||
| --includ=* | --inclu=* | --incl=* | --inc=*)
|
|
||||||
includedir="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-infodir | --infodir | --infodi | --infod | --info | --inf)
|
|
||||||
ac_prev=infodir ;;
|
|
||||||
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
|
|
||||||
infodir="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-libdir | --libdir | --libdi | --libd)
|
|
||||||
ac_prev=libdir ;;
|
|
||||||
-libdir=* | --libdir=* | --libdi=* | --libd=*)
|
|
||||||
libdir="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
|
|
||||||
| --libexe | --libex | --libe)
|
|
||||||
ac_prev=libexecdir ;;
|
|
||||||
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
|
|
||||||
| --libexe=* | --libex=* | --libe=*)
|
|
||||||
libexecdir="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-localstatedir | --localstatedir | --localstatedi | --localstated \
|
|
||||||
| --localstate | --localstat | --localsta | --localst \
|
|
||||||
| --locals | --local | --loca | --loc | --lo)
|
|
||||||
ac_prev=localstatedir ;;
|
|
||||||
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
|
|
||||||
| --localstate=* | --localstat=* | --localsta=* | --localst=* \
|
|
||||||
| --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
|
|
||||||
localstatedir="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
|
|
||||||
ac_prev=mandir ;;
|
|
||||||
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
|
|
||||||
mandir="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-nfp | --nfp | --nf)
|
|
||||||
# Obsolete; use --without-fp.
|
|
||||||
with_fp=no ;;
|
|
||||||
|
|
||||||
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
|
|
||||||
| --no-cr | --no-c)
|
|
||||||
no_create=yes ;;
|
|
||||||
|
|
||||||
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
|
|
||||||
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
|
|
||||||
no_recursion=yes ;;
|
|
||||||
|
|
||||||
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
|
|
||||||
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
|
|
||||||
| --oldin | --oldi | --old | --ol | --o)
|
|
||||||
ac_prev=oldincludedir ;;
|
|
||||||
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
|
|
||||||
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
|
|
||||||
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
|
|
||||||
oldincludedir="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
|
|
||||||
ac_prev=prefix ;;
|
|
||||||
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
|
|
||||||
prefix="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-program-prefix | --program-prefix | --program-prefi | --program-pref \
|
|
||||||
| --program-pre | --program-pr | --program-p)
|
|
||||||
ac_prev=program_prefix ;;
|
|
||||||
-program-prefix=* | --program-prefix=* | --program-prefi=* \
|
|
||||||
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
|
|
||||||
program_prefix="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-program-suffix | --program-suffix | --program-suffi | --program-suff \
|
|
||||||
| --program-suf | --program-su | --program-s)
|
|
||||||
ac_prev=program_suffix ;;
|
|
||||||
-program-suffix=* | --program-suffix=* | --program-suffi=* \
|
|
||||||
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
|
|
||||||
program_suffix="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-program-transform-name | --program-transform-name \
|
|
||||||
| --program-transform-nam | --program-transform-na \
|
|
||||||
| --program-transform-n | --program-transform- \
|
|
||||||
| --program-transform | --program-transfor \
|
|
||||||
| --program-transfo | --program-transf \
|
|
||||||
| --program-trans | --program-tran \
|
|
||||||
| --progr-tra | --program-tr | --program-t)
|
|
||||||
ac_prev=program_transform_name ;;
|
|
||||||
-program-transform-name=* | --program-transform-name=* \
|
|
||||||
| --program-transform-nam=* | --program-transform-na=* \
|
|
||||||
| --program-transform-n=* | --program-transform-=* \
|
|
||||||
| --program-transform=* | --program-transfor=* \
|
|
||||||
| --program-transfo=* | --program-transf=* \
|
|
||||||
| --program-trans=* | --program-tran=* \
|
|
||||||
| --progr-tra=* | --program-tr=* | --program-t=*)
|
|
||||||
program_transform_name="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
|
|
||||||
| -silent | --silent | --silen | --sile | --sil)
|
|
||||||
silent=yes ;;
|
|
||||||
|
|
||||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
|
||||||
ac_prev=sbindir ;;
|
|
||||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
|
||||||
| --sbi=* | --sb=*)
|
|
||||||
sbindir="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-sharedstatedir | --sharedstatedir | --sharedstatedi \
|
|
||||||
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
|
|
||||||
| --sharedst | --shareds | --shared | --share | --shar \
|
|
||||||
| --sha | --sh)
|
|
||||||
ac_prev=sharedstatedir ;;
|
|
||||||
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
|
|
||||||
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
|
|
||||||
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
|
|
||||||
| --sha=* | --sh=*)
|
|
||||||
sharedstatedir="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-site | --site | --sit)
|
|
||||||
ac_prev=site ;;
|
|
||||||
-site=* | --site=* | --sit=*)
|
|
||||||
site="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
|
|
||||||
ac_prev=srcdir ;;
|
|
||||||
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
|
|
||||||
srcdir="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
|
|
||||||
| --syscon | --sysco | --sysc | --sys | --sy)
|
|
||||||
ac_prev=sysconfdir ;;
|
|
||||||
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
|
|
||||||
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
|
|
||||||
sysconfdir="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-target | --target | --targe | --targ | --tar | --ta | --t)
|
|
||||||
ac_prev=target ;;
|
|
||||||
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
|
|
||||||
target="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-v | -verbose | --verbose | --verbos | --verbo | --verb)
|
|
||||||
verbose=yes ;;
|
|
||||||
|
|
||||||
-version | --version | --versio | --versi | --vers)
|
|
||||||
echo "configure generated by autoconf version 2.13"
|
|
||||||
exit 0 ;;
|
|
||||||
|
|
||||||
-with-* | --with-*)
|
|
||||||
ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
|
|
||||||
# Reject names that are not valid shell variable names.
|
|
||||||
if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
|
|
||||||
{ echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
|
|
||||||
fi
|
|
||||||
ac_package=`echo $ac_package| sed 's/-/_/g'`
|
|
||||||
case "$ac_option" in
|
|
||||||
*=*) ;;
|
|
||||||
*) ac_optarg=yes ;;
|
|
||||||
esac
|
|
||||||
eval "with_${ac_package}='$ac_optarg'" ;;
|
|
||||||
|
|
||||||
-without-* | --without-*)
|
|
||||||
ac_package=`echo $ac_option|sed -e 's/-*without-//'`
|
|
||||||
# Reject names that are not valid shell variable names.
|
|
||||||
if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
|
|
||||||
{ echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
|
|
||||||
fi
|
|
||||||
ac_package=`echo $ac_package| sed 's/-/_/g'`
|
|
||||||
eval "with_${ac_package}=no" ;;
|
|
||||||
|
|
||||||
--x)
|
|
||||||
# Obsolete; use --with-x.
|
|
||||||
with_x=yes ;;
|
|
||||||
|
|
||||||
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
|
|
||||||
| --x-incl | --x-inc | --x-in | --x-i)
|
|
||||||
ac_prev=x_includes ;;
|
|
||||||
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
|
|
||||||
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
|
|
||||||
x_includes="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-x-libraries | --x-libraries | --x-librarie | --x-librari \
|
|
||||||
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
|
|
||||||
ac_prev=x_libraries ;;
|
|
||||||
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
|
|
||||||
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
|
|
||||||
x_libraries="$ac_optarg" ;;
|
|
||||||
|
|
||||||
-*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
|
|
||||||
echo "configure: warning: $ac_option: invalid host type" 1>&2
|
|
||||||
fi
|
|
||||||
if test "x$nonopt" != xNONE; then
|
|
||||||
{ echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
|
|
||||||
fi
|
|
||||||
nonopt="$ac_option"
|
|
||||||
;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if test -n "$ac_prev"; then
|
|
||||||
{ echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
|
|
||||||
fi
|
|
||||||
|
|
||||||
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
|
|
||||||
|
|
||||||
# File descriptor usage:
|
|
||||||
# 0 standard input
|
|
||||||
# 1 file creation
|
|
||||||
# 2 errors and warnings
|
|
||||||
# 3 some systems may open it to /dev/tty
|
|
||||||
# 4 used on the Kubota Titan
|
|
||||||
# 6 checking for... messages and results
|
|
||||||
# 5 compiler messages saved in config.log
|
|
||||||
if test "$silent" = yes; then
|
|
||||||
exec 6>/dev/null
|
|
||||||
else
|
|
||||||
exec 6>&1
|
|
||||||
fi
|
|
||||||
exec 5>./config.log
|
|
||||||
|
|
||||||
echo "\
|
|
||||||
This file contains any messages produced by compilers while
|
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
|
||||||
" 1>&5
|
|
||||||
|
|
||||||
# Strip out --no-create and --no-recursion so they do not pile up.
|
|
||||||
# Also quote any args containing shell metacharacters.
|
|
||||||
ac_configure_args=
|
|
||||||
for ac_arg
|
|
||||||
do
|
|
||||||
case "$ac_arg" in
|
|
||||||
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
|
|
||||||
| --no-cr | --no-c) ;;
|
|
||||||
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
|
|
||||||
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
|
|
||||||
*" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
|
|
||||||
ac_configure_args="$ac_configure_args '$ac_arg'" ;;
|
|
||||||
*) ac_configure_args="$ac_configure_args $ac_arg" ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# NLS nuisances.
|
|
||||||
# Only set these to C if already set. These must not be set unconditionally
|
|
||||||
# because not all systems understand e.g. LANG=C (notably SCO).
|
|
||||||
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
|
|
||||||
# Non-C LC_CTYPE values break the ctype check.
|
|
||||||
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
|
|
||||||
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
|
|
||||||
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
|
|
||||||
if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
|
|
||||||
|
|
||||||
# confdefs.h avoids OS command line length limits that DEFS can exceed.
|
|
||||||
rm -rf conftest* confdefs.h
|
|
||||||
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
|
|
||||||
echo > confdefs.h
|
|
||||||
|
|
||||||
# A filename unique to this package, relative to the directory that
|
|
||||||
# configure is in, which we can look for to find out if srcdir is correct.
|
|
||||||
ac_unique_file=build/dirver.c
|
|
||||||
|
|
||||||
# Find the source files, if location was not specified.
|
|
||||||
if test -z "$srcdir"; then
|
|
||||||
ac_srcdir_defaulted=yes
|
|
||||||
# Try the directory containing this script, then its parent.
|
|
||||||
ac_prog=$0
|
|
||||||
ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
|
|
||||||
test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
|
|
||||||
srcdir=$ac_confdir
|
|
||||||
if test ! -r $srcdir/$ac_unique_file; then
|
|
||||||
srcdir=..
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
ac_srcdir_defaulted=no
|
|
||||||
fi
|
|
||||||
if test ! -r $srcdir/$ac_unique_file; then
|
|
||||||
if test "$ac_srcdir_defaulted" = yes; then
|
|
||||||
{ echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
|
|
||||||
else
|
|
||||||
{ echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
|
|
||||||
|
|
||||||
# Prefer explicitly selected file to automatically selected ones.
|
|
||||||
if test -z "$CONFIG_SITE"; then
|
|
||||||
if test "x$prefix" != xNONE; then
|
|
||||||
CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
|
|
||||||
else
|
|
||||||
CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
for ac_site_file in $CONFIG_SITE; do
|
|
||||||
if test -r "$ac_site_file"; then
|
|
||||||
echo "loading site script $ac_site_file"
|
|
||||||
. "$ac_site_file"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if test -r "$cache_file"; then
|
|
||||||
echo "loading cache $cache_file"
|
|
||||||
. $cache_file
|
|
||||||
else
|
|
||||||
echo "creating cache $cache_file"
|
|
||||||
> $cache_file
|
|
||||||
fi
|
|
||||||
|
|
||||||
ac_ext=c
|
|
||||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
|
||||||
ac_cpp='$CPP $CPPFLAGS'
|
|
||||||
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
|
||||||
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
||||||
cross_compiling=$ac_cv_prog_cc_cross
|
|
||||||
|
|
||||||
ac_exeext=
|
|
||||||
ac_objext=o
|
|
||||||
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
|
|
||||||
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
|
|
||||||
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
|
|
||||||
ac_n= ac_c='
|
|
||||||
' ac_t=' '
|
|
||||||
else
|
|
||||||
ac_n=-n ac_c= ac_t=
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
ac_n= ac_c='\c' ac_t=
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check whether --enable-nspr-autoconf or --disable-nspr-autoconf was given.
|
|
||||||
if test "${enable_nspr_autoconf+set}" = set; then
|
|
||||||
enableval="$enable_nspr_autoconf"
|
|
||||||
NSPR_USE_AUTOCONF=1
|
|
||||||
else
|
|
||||||
NSPR_USE_AUTOCONF=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MAKEFILES="
|
|
||||||
Makefile
|
|
||||||
build/Makefile
|
|
||||||
build/autoconf.mk
|
|
||||||
include/Makefile
|
|
||||||
libraries/Makefile
|
|
||||||
libraries/libldap/Makefile
|
|
||||||
libraries/liblber/Makefile
|
|
||||||
"
|
|
||||||
trap '' 1 2 15
|
|
||||||
cat > confcache <<\EOF
|
|
||||||
# This file is a shell script that caches the results of configure
|
|
||||||
# tests run on this system so they can be shared between configure
|
|
||||||
# scripts and configure runs. It is not useful on other systems.
|
|
||||||
# If it contains results you don't want to keep, you may remove or edit it.
|
|
||||||
#
|
|
||||||
# By default, configure uses ./config.cache as the cache file,
|
|
||||||
# creating it if it does not exist already. You can give configure
|
|
||||||
# the --cache-file=FILE option to use a different cache file; that is
|
|
||||||
# what configure does when it calls configure scripts in
|
|
||||||
# subdirectories, so they share the cache.
|
|
||||||
# Giving --cache-file=/dev/null disables caching, for debugging configure.
|
|
||||||
# config.status only pays attention to the cache file if you give it the
|
|
||||||
# --recheck option to rerun configure.
|
|
||||||
#
|
|
||||||
EOF
|
|
||||||
# The following way of writing the cache mishandles newlines in values,
|
|
||||||
# but we know of no workaround that is simple, portable, and efficient.
|
|
||||||
# So, don't put newlines in cache variables' values.
|
|
||||||
# Ultrix sh set writes to stderr and can't be redirected directly,
|
|
||||||
# and sets the high bit in the cache file unless we assign to the vars.
|
|
||||||
(set) 2>&1 |
|
|
||||||
case `(ac_space=' '; set | grep ac_space) 2>&1` in
|
|
||||||
*ac_space=\ *)
|
|
||||||
# `set' does not quote correctly, so add quotes (double-quote substitution
|
|
||||||
# turns \\\\ into \\, and sed turns \\ into \).
|
|
||||||
sed -n \
|
|
||||||
-e "s/'/'\\\\''/g" \
|
|
||||||
-e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
# `set' quotes correctly as required by POSIX, so do not add quotes.
|
|
||||||
sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
|
|
||||||
;;
|
|
||||||
esac >> confcache
|
|
||||||
if cmp -s $cache_file confcache; then
|
|
||||||
:
|
|
||||||
else
|
|
||||||
if test -w $cache_file; then
|
|
||||||
echo "updating cache $cache_file"
|
|
||||||
cat confcache > $cache_file
|
|
||||||
else
|
|
||||||
echo "not updating unwritable cache $cache_file"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
rm -f confcache
|
|
||||||
|
|
||||||
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
|
|
||||||
|
|
||||||
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
|
||||||
# Let make expand exec_prefix.
|
|
||||||
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
|
||||||
|
|
||||||
# Any assignment to VPATH causes Sun make to only execute
|
|
||||||
# the first set of double-colon rules, so remove it if not needed.
|
|
||||||
# If there is a colon in the path, we need to keep it.
|
|
||||||
if test "x$srcdir" = x.; then
|
|
||||||
ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
|
|
||||||
fi
|
|
||||||
|
|
||||||
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
|
|
||||||
|
|
||||||
# Transform confdefs.h into DEFS.
|
|
||||||
# Protect against shell expansion while executing Makefile rules.
|
|
||||||
# Protect against Makefile macro expansion.
|
|
||||||
cat > conftest.defs <<\EOF
|
|
||||||
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
|
|
||||||
s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
|
|
||||||
s%\[%\\&%g
|
|
||||||
s%\]%\\&%g
|
|
||||||
s%\$%$$%g
|
|
||||||
EOF
|
|
||||||
DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
|
|
||||||
rm -f conftest.defs
|
|
||||||
|
|
||||||
|
|
||||||
# Without the "./", some shells look in PATH for config.status.
|
|
||||||
: ${CONFIG_STATUS=./config.status}
|
|
||||||
|
|
||||||
echo creating $CONFIG_STATUS
|
|
||||||
rm -f $CONFIG_STATUS
|
|
||||||
cat > $CONFIG_STATUS <<EOF
|
|
||||||
#! /bin/sh
|
|
||||||
# Generated automatically by configure.
|
|
||||||
# Run this file to recreate the current configuration.
|
|
||||||
# This directory was configured as follows,
|
|
||||||
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
|
|
||||||
#
|
|
||||||
# $0 $ac_configure_args
|
|
||||||
#
|
|
||||||
# Compiler output produced by configure, useful for debugging
|
|
||||||
# configure, is in ./config.log if it exists.
|
|
||||||
|
|
||||||
ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
|
|
||||||
for ac_option
|
|
||||||
do
|
|
||||||
case "\$ac_option" in
|
|
||||||
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
|
|
||||||
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
|
|
||||||
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
|
|
||||||
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
|
|
||||||
echo "$CONFIG_STATUS generated by autoconf version 2.13"
|
|
||||||
exit 0 ;;
|
|
||||||
-help | --help | --hel | --he | --h)
|
|
||||||
echo "\$ac_cs_usage"; exit 0 ;;
|
|
||||||
*) echo "\$ac_cs_usage"; exit 1 ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
ac_given_srcdir=$srcdir
|
|
||||||
|
|
||||||
trap 'rm -fr `echo "$MAKEFILES" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
|
|
||||||
EOF
|
|
||||||
cat >> $CONFIG_STATUS <<EOF
|
|
||||||
|
|
||||||
# Protect against being on the right side of a sed subst in config.status.
|
|
||||||
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
|
|
||||||
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
|
|
||||||
$ac_vpsub
|
|
||||||
$extrasub
|
|
||||||
s%@SHELL@%$SHELL%g
|
|
||||||
s%@CFLAGS@%$CFLAGS%g
|
|
||||||
s%@CPPFLAGS@%$CPPFLAGS%g
|
|
||||||
s%@CXXFLAGS@%$CXXFLAGS%g
|
|
||||||
s%@FFLAGS@%$FFLAGS%g
|
|
||||||
s%@DEFS@%$DEFS%g
|
|
||||||
s%@LDFLAGS@%$LDFLAGS%g
|
|
||||||
s%@LIBS@%$LIBS%g
|
|
||||||
s%@exec_prefix@%$exec_prefix%g
|
|
||||||
s%@prefix@%$prefix%g
|
|
||||||
s%@program_transform_name@%$program_transform_name%g
|
|
||||||
s%@bindir@%$bindir%g
|
|
||||||
s%@sbindir@%$sbindir%g
|
|
||||||
s%@libexecdir@%$libexecdir%g
|
|
||||||
s%@datadir@%$datadir%g
|
|
||||||
s%@sysconfdir@%$sysconfdir%g
|
|
||||||
s%@sharedstatedir@%$sharedstatedir%g
|
|
||||||
s%@localstatedir@%$localstatedir%g
|
|
||||||
s%@libdir@%$libdir%g
|
|
||||||
s%@includedir@%$includedir%g
|
|
||||||
s%@oldincludedir@%$oldincludedir%g
|
|
||||||
s%@infodir@%$infodir%g
|
|
||||||
s%@mandir@%$mandir%g
|
|
||||||
s%@NSPR_USE_AUTOCONF@%$NSPR_USE_AUTOCONF%g
|
|
||||||
|
|
||||||
CEOF
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat >> $CONFIG_STATUS <<\EOF
|
|
||||||
|
|
||||||
# Split the substitutions into bite-sized pieces for seds with
|
|
||||||
# small command number limits, like on Digital OSF/1 and HP-UX.
|
|
||||||
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
|
|
||||||
ac_file=1 # Number of current file.
|
|
||||||
ac_beg=1 # First line for current file.
|
|
||||||
ac_end=$ac_max_sed_cmds # Line after last line for current file.
|
|
||||||
ac_more_lines=:
|
|
||||||
ac_sed_cmds=""
|
|
||||||
while $ac_more_lines; do
|
|
||||||
if test $ac_beg -gt 1; then
|
|
||||||
sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
|
|
||||||
else
|
|
||||||
sed "${ac_end}q" conftest.subs > conftest.s$ac_file
|
|
||||||
fi
|
|
||||||
if test ! -s conftest.s$ac_file; then
|
|
||||||
ac_more_lines=false
|
|
||||||
rm -f conftest.s$ac_file
|
|
||||||
else
|
|
||||||
if test -z "$ac_sed_cmds"; then
|
|
||||||
ac_sed_cmds="sed -f conftest.s$ac_file"
|
|
||||||
else
|
|
||||||
ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
|
|
||||||
fi
|
|
||||||
ac_file=`expr $ac_file + 1`
|
|
||||||
ac_beg=$ac_end
|
|
||||||
ac_end=`expr $ac_end + $ac_max_sed_cmds`
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if test -z "$ac_sed_cmds"; then
|
|
||||||
ac_sed_cmds=cat
|
|
||||||
fi
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat >> $CONFIG_STATUS <<EOF
|
|
||||||
|
|
||||||
CONFIG_FILES=\${CONFIG_FILES-"$MAKEFILES"}
|
|
||||||
EOF
|
|
||||||
cat >> $CONFIG_STATUS <<\EOF
|
|
||||||
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
|
|
||||||
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
|
|
||||||
case "$ac_file" in
|
|
||||||
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
|
|
||||||
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
|
|
||||||
*) ac_file_in="${ac_file}.in" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
|
|
||||||
|
|
||||||
# Remove last slash and all that follows it. Not all systems have dirname.
|
|
||||||
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
|
|
||||||
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
|
|
||||||
# The file is in a subdirectory.
|
|
||||||
test ! -d "$ac_dir" && mkdir "$ac_dir"
|
|
||||||
ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
|
|
||||||
# A "../" for each directory in $ac_dir_suffix.
|
|
||||||
ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
|
|
||||||
else
|
|
||||||
ac_dir_suffix= ac_dots=
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$ac_given_srcdir" in
|
|
||||||
.) srcdir=.
|
|
||||||
if test -z "$ac_dots"; then top_srcdir=.
|
|
||||||
else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
|
|
||||||
/*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
|
|
||||||
*) # Relative path.
|
|
||||||
srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
|
|
||||||
top_srcdir="$ac_dots$ac_given_srcdir" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
echo creating "$ac_file"
|
|
||||||
rm -f "$ac_file"
|
|
||||||
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
|
|
||||||
case "$ac_file" in
|
|
||||||
*Makefile*) ac_comsub="1i\\
|
|
||||||
# $configure_input" ;;
|
|
||||||
*) ac_comsub= ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
|
|
||||||
sed -e "$ac_comsub
|
|
||||||
s%@configure_input@%$configure_input%g
|
|
||||||
s%@srcdir@%$srcdir%g
|
|
||||||
s%@top_srcdir@%$top_srcdir%g
|
|
||||||
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
|
|
||||||
fi; done
|
|
||||||
rm -f conftest.s*
|
|
||||||
|
|
||||||
EOF
|
|
||||||
cat >> $CONFIG_STATUS <<EOF
|
|
||||||
|
|
||||||
EOF
|
|
||||||
cat >> $CONFIG_STATUS <<\EOF
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
EOF
|
|
||||||
chmod +x $CONFIG_STATUS
|
|
||||||
rm -fr confdefs* $ac_clean_files
|
|
||||||
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
|
|
||||||
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
dnl
|
|
||||||
dnl The contents of this file are subject to the Mozilla Public
|
|
||||||
dnl License Version 1.1 (the "License"); you may not use this file
|
|
||||||
dnl except in compliance with the License. You may obtain a copy of
|
|
||||||
dnl the License at http://www.mozilla.org/MPL/
|
|
||||||
dnl
|
|
||||||
dnl Software distributed under the License is distributed on an "AS
|
|
||||||
dnl IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
||||||
dnl implied. See the License for the specific language governing
|
|
||||||
dnl rights and limitations under the License.
|
|
||||||
dnl
|
|
||||||
dnl The Original Code is mozilla.org LDAP SDK autoconf glue.
|
|
||||||
dnl
|
|
||||||
dnl The Initial Developer of the Original Code is Netscape
|
|
||||||
dnl Communications Corp. Portions created by Netscape are
|
|
||||||
dnl Copyright (C) 2000, Netscape Communications Corp. All
|
|
||||||
dnl Rights Reserved.
|
|
||||||
dnl
|
|
||||||
dnl Contributor(s): Dan Mosedale <dmose@mozilla.org>
|
|
||||||
dnl
|
|
||||||
|
|
||||||
dnl Process this file with autoconf to produce a configure script.
|
|
||||||
AC_INIT(build/dirver.c)
|
|
||||||
dnl Checks for programs.
|
|
||||||
dnl Checks for libraries.
|
|
||||||
dnl Checks for header files.
|
|
||||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
||||||
dnl Checks for library functions.
|
|
||||||
|
|
||||||
dnl If the nsprpub whose configuration system we're using has been built with
|
|
||||||
dnl --enable-nspr-autoconf, we need to cope with that here.
|
|
||||||
dnl
|
|
||||||
AC_ARG_ENABLE(nspr-autoconf,
|
|
||||||
[ --enable-nspr-autoconf Enable building with an autoconf'ed NSPR tree],
|
|
||||||
NSPR_USE_AUTOCONF=1, NSPR_USE_AUTOCONF=0)
|
|
||||||
|
|
||||||
AC_SUBST(NSPR_USE_AUTOCONF)
|
|
||||||
|
|
||||||
dnl Generate output files
|
|
||||||
dnl
|
|
||||||
MAKEFILES="
|
|
||||||
Makefile
|
|
||||||
build/Makefile
|
|
||||||
build/autoconf.mk
|
|
||||||
include/Makefile
|
|
||||||
libraries/Makefile
|
|
||||||
libraries/libldap/Makefile
|
|
||||||
libraries/liblber/Makefile
|
|
||||||
"
|
|
||||||
AC_OUTPUT([$MAKEFILES])
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
=================================================================
|
|
||||||
iPlanet LDAP SDK for C, version 5.0
|
|
||||||
=================================================================
|
|
||||||
|
|
||||||
Documentation for this release of the LDAP SDK for C is located
|
|
||||||
at the following URL:
|
|
||||||
|
|
||||||
http://docs.iplanet.com/docs/manuals/directory.html#SDKC
|
|
||||||
|
|
||||||
The documentation set includes the "Release Notes" (in HTML
|
|
||||||
format) and the "Netscape LDAP SDK for C Programmer's Guide."
|
|
||||||
The Programmer's Guide is available in PDF and HTML formats.
|
|
||||||
|
|
||||||
Please note that the LDAP SDK for C library is most of the time
|
|
||||||
ahead of our official documentation. For example, we currently
|
|
||||||
don't have a 5.0 branded version of the documentation, however,
|
|
||||||
using the latest 4.1 version should be sufficient.
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
The enclosed file[s] Exhibit A is licensed to you (either an individual
|
|
||||||
or a single entity, not including affiliates) pursuant to the terms
|
|
||||||
and conditions of the "Netscape ONE SDK END-USER LICENSE AGREEMENT"
|
|
||||||
between you and Netscape (the "Agreement"). Any use, copying,
|
|
||||||
distribution or other disposition of the file[s] in Exhibit A is governed
|
|
||||||
by the Agreement. For purposes of the Agreement, the file[s] in Exhibit A
|
|
||||||
is considered to be a "Redistributable Element," as defined in the
|
|
||||||
Agreement, and any distribution of the file[s] in Exhibit A shall be
|
|
||||||
subject to the same restrictions governing "Redistributable Element."
|
|
||||||
|
|
||||||
|
|
||||||
Exhibit A
|
|
||||||
|
|
||||||
The following files of the Netscape Directory SDK are redistributable:
|
|
||||||
|
|
||||||
lib/nsldap32v50.dll, lib/nsldap32v50.dll, (MS Windows 95/98 & NT)
|
|
||||||
lib/nsldappr32v50.dll, lib/nsldapssl32v50.dll, (MS Windows 95/98 & NT)
|
|
||||||
lib/nsldapssl32v50.lib,lib/nsldappr32v50.lib (MS Windows 95/98 & NT)
|
|
||||||
lib/libnspr3.dll, lib/libplc3.dll, (Windows NT)
|
|
||||||
lib/libplds3.dll (Windows NT)
|
|
||||||
lib/nsiutil32v50.lib (Windows NT)
|
|
||||||
lib/nsldif32v50.lib (Windows NT)
|
|
||||||
lib/nsldif32v50.lib (Windows NT)
|
|
||||||
lib/nss.dll, lib/ssl.dll (MS Windows 95/98 & NT)
|
|
||||||
lib/nspr3.dll, lib/plc3.dll, lib/plds3.dll (MS Windows 95/98)
|
|
||||||
lib/plc3.so, lib/libplds3.so, lib/libnspr3.so, (UNIX)
|
|
||||||
lib/libldapssl50.so (UNIX)
|
|
||||||
lib/libldap50.so (UNIX)
|
|
||||||
lib/libfreebl_hybrid_3.so (UNIX)
|
|
||||||
lib/libfreebl_pure32_3.so (UNIX)
|
|
||||||
lib/libiutil50.so (UNIX)
|
|
||||||
lib/libfreebl_hybrid_3.sl (HPUX)
|
|
||||||
lib/libfreebl_pure32_3.sl (HPUX)
|
|
||||||
lib/plc3.sl, lib/libplds3.sl, lib/libnspr3.sl, (HPUX)
|
|
||||||
lib/libldapssl50.sl (HPUX)
|
|
||||||
lib/libiutil50.sl (HPUX)
|
|
||||||
|
|
||||||
For purposes of this Agreement, format of Files shall have an operating
|
|
||||||
system-generic file specification format to specify multiple files. The
|
|
||||||
following are examples of this format:
|
|
||||||
|
|
||||||
"lib/*.class" (all files in the subdirectory "lib/" ending in .class )
|
|
||||||
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 KiB |
@ -1,500 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<TITLE>Release Notes for Netscape LDAP SDK for C, version 4.1</TITLE>
|
|
||||||
|
|
||||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
|
||||||
<META NAME="GENERATOR" CONTENT="By hand, m'man">
|
|
||||||
<META NAME="Author" CONTENT="Kelly Rich">
|
|
||||||
</HEAD>
|
|
||||||
|
|
||||||
<BODY BGCOLOR="#ffffff" VLINK="#ff0000">
|
|
||||||
|
|
||||||
<P><CENTER><IMG SRC="release.gif" NOSAVE BORDER="0" HEIGHT="32"
|
|
||||||
WIDTH="468" NATURALSIZEFLAG="0" ALIGN="BOTTOM"></CENTER></P>
|
|
||||||
|
|
||||||
<H1><CENTER>N<FONT SIZE="+2">ETSCAPE </FONT>D<FONT SIZE="+2">IRECTORY
|
|
||||||
</FONT>S<FONT SIZE="+2">ERVER</FONT></CENTER></H1>
|
|
||||||
|
|
||||||
<H2><CENTER>LDAP SDK for C, version 4.1</CENTER></H2>
|
|
||||||
|
|
||||||
<P><CENTER>Last updated November 15, 2000</CENTER></P>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<!-- Contents -->
|
|
||||||
<table width=100% cellpadding="0" cellspacing="0">
|
|
||||||
<tr>
|
|
||||||
<td width="3%"> </td> <!-- Left Margin -->
|
|
||||||
<td width="93%"> <!-- Content -->
|
|
||||||
|
|
||||||
<h2>
|
|
||||||
<font size=+3>C</font>ONTENTS</h2>
|
|
||||||
|
|
||||||
<p>These release notes include:</p>
|
|
||||||
|
|
||||||
<UL>
|
|
||||||
<LI><A HREF="#platforms">Supported Platforms</A>
|
|
||||||
<LI><A HREF="#install">Installing the SDK</a>
|
|
||||||
<LI><A HREF="#new">New Features and Enhancements</A>
|
|
||||||
<ul>
|
|
||||||
<LI><A HREF="#connect_timeout">LDAP_X_OPT_CONNECT_TIMEOUT</A>
|
|
||||||
<LI><A HREF="#errmsg">LDAP library/API Version Mismatch Error Messages</A>
|
|
||||||
<LI><A HREF="#64bit">64 Bit Safe Changes</A>
|
|
||||||
<LI><A HREF="#parseurl">ldap_url_parse() with Space-Separated Lists of Hosts</A>
|
|
||||||
</ul>
|
|
||||||
<LI><A HREF="#problems">Known Problems</A>
|
|
||||||
<li><a href="#info">More Information</a>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<HR ALIGN=LEFT SIZE="12">
|
|
||||||
<H2><A NAME="platforms"></A><font size=+3>S</font>UPPORTED
|
|
||||||
<font size=+3>P</font>LATFORMS</H2>
|
|
||||||
|
|
||||||
<P>The LDAP SDK for C, version 4.1 provides support for the following platforms:</P>
|
|
||||||
|
|
||||||
<UL>
|
|
||||||
<LI>SunOS 5.6 (32-bit)
|
|
||||||
<li>SunOS 5.8 (64-bit)
|
|
||||||
<LI>AIX 4.3.2
|
|
||||||
<LI>Digital Tru64 (Digital Unix 4.0d)
|
|
||||||
<LI>HP-UX 11.0 (both 32-bit and 64-bit)
|
|
||||||
<LI>Linux 2.2 (for x86) (glibc 2.0)
|
|
||||||
<LI>Windows NT 4.0 sp6
|
|
||||||
<li>Windows 95, Windows 98
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<HR ALIGN=LEFT SIZE="12">
|
|
||||||
<H2><A NAME="install"></A><font size="+3">I</font>NSTALLING THE <FONT SIZE="+3">S</FONT>DK</H2>
|
|
||||||
|
|
||||||
<p>Follow these instructions to install the Netscape LDAP SDK for C:</p>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>For UNIX systems (Solaris, AIX, Digital Tru64, HP/UX, Linux)
|
|
||||||
<ol>
|
|
||||||
<li>Save the appropriate UNIX file to disk.
|
|
||||||
<li>Uncompress the gzip file by typing:
|
|
||||||
<pre> gunzip <filename>.tar.gz</pre>
|
|
||||||
<li>Unpack the resulting tar file by typing:
|
|
||||||
<pre> tar xvof <filename>.tar</pre>
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
<li>For Win32 systems (Windows NT and Windows 95)
|
|
||||||
<ol>
|
|
||||||
<li>Save the file named <tt>dk41x32s.exe</tt> to disk.
|
|
||||||
<li>Install the SDK by double-clicking the file in File Manager or Windows Explorer.
|
|
||||||
</ol>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>Note that you should install this version of the LDAP SDK for C into a different directory than any other installed version of this software.</p>
|
|
||||||
|
|
||||||
<!-- New Features-->
|
|
||||||
<!-- Note: The following enhancements have NOT been added to the LDAP SDK for C manual. -->
|
|
||||||
<P>
|
|
||||||
<HR ALIGN=LEFT SIZE="12">
|
|
||||||
<H2><A NAME="new"></A><font size="+3">N</font>EW <font size="+3">F</font>EATURES AND <font size="+3">E</font>NHANCEMENTS</H2>
|
|
||||||
|
|
||||||
<p>This section of enhancements details the changes that were made to both versions 4.0 and 4.1 of the LDAP SDK for C.</p>
|
|
||||||
|
|
||||||
<p>The following set of modifications were made to the LDAP SDK for C, version 4.1:</p>
|
|
||||||
|
|
||||||
<UL>
|
|
||||||
<LI>The LDAP SDK for C library names were changed to indicate the new version of the SDK. For example, the new Solaris version of the SDK library is <tt>libldapssl41.so</tt>. For information on how to build and link applications that uses this SDK, see the make files for the SDK examples.
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<LI>Various changes were made to the LDAP SDK for C to align it with the LDAPv3, described in RFC 2251. You can find this RFC at the following URL:
|
|
||||||
|
|
||||||
<BLOCKQUOTE><A HREF="http://www.ietf.org/rfc/rfc2251.txt?number=2251">
|
|
||||||
http://www.ietf.org/rfc/rfc2251.txt?number=2251</A>
|
|
||||||
</BLOCKQUOTE>
|
|
||||||
|
|
||||||
<LI>Non-blocking connect functionality has been added. For more information, please see
|
|
||||||
<A HREF="#connect_timeout">LDAP_X_OPT_CONNECT_TIMEOUT</A>.
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<LI>A new extended I/O function callback scheme was added to the SDK. The <tt>ldap_x_ext_io_fns</tt> struct has been added to hold extended I/O function pointers. The <tt>ldap.h</tt> file outlines the new callbacks.
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<LI>Netscape Portable Runtime library (NSPR) support was added. The library, <tt>libldappr</tt> was added to provide a simple way for an application that is using NSPR to tie <tt>libldap</tt> into their environment. The <tt>ldappr.h</tt> file outlines the new interface. The library <tt>libldapr</tt> is statically linked in the version of the SDK that is available from both Mozilla and iPlanet's web sites.
|
|
||||||
|
|
||||||
<p>The new example <tt>nsprio.c</tt> shows how to use the new interfaces. Note that before you can compile the example, you will need to rework the makefile to include NSPR v3.5.1. You can checkout the NSPR 3.5.1 source from <a href="http://www.mozilla.org">www.mozilla.org</a> with the following CVS command:
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
cvs co -r NSPRPUB_RELEASE_3_5_1 mozilla/nsprpub
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<p>Make sure to set your <tt>CVSROOT</tt> environment variable as described on <A HREF="http://www.mozilla.org/cvs.html">http://www.mozilla.org/cvs.html</A> before running the cvs checkout command. For information on NSPR and its API, see <A HREF="http://www.mozilla.org/docs/refList/refNSPR/">http://www.mozilla.org/docs/refList/refNSPR/</A>.<p>
|
|
||||||
|
|
||||||
<li>The <tt>ldap_search*()</tt> line of functions was modified as follows:
|
|
||||||
<ul>
|
|
||||||
<LI>The <tt>ldap_search*()</tt> line of functions now return <tt>LDAP_PARAM_ERROR</tt> if a <tt>sizelimit</tt> smaller than -1 is passed to the function call.</li>
|
|
||||||
|
|
||||||
<LI>The <tt>ldap_search*()</tt> line of functions now set <tt>*result</tt> to <tt>NULL</tt> in all error situations.</LI>
|
|
||||||
</ul>
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<li>The <tt>ldapmodify</tt> utility was modified as follows:
|
|
||||||
<ul>
|
|
||||||
<LI>The <tt>-A</tt> option was added, which causes the tool to display non-ASCII values in conjunction with the <tt>-v</tt> option.</li>
|
|
||||||
|
|
||||||
<LI>The <tt>-B</tt> and <tt>-q</tt> options were added, which provide support for the bulk import feature available in the iPlanet Directory Server, version 5.0.</li>
|
|
||||||
|
|
||||||
<!-- 4.0 enhancements -->
|
|
||||||
<LI>Support for the <tt>version</tt> directive was added.
|
|
||||||
<LI>Support for <tt>changetype</tt> with <tt>moddn</tt> was added.
|
|
||||||
<LI>Improved the LDIF output to provide better support for file URLs.
|
|
||||||
</ul>
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<li>The <tt>ldapsearch</tt> utility was modified as follows:
|
|
||||||
<ul>
|
|
||||||
<LI>The <tt>-e</tt> option was added, which minimizes base-64 encoding of values. <br>
|
|
||||||
By default, <tt>ldapsearch</tt> will always produce ASCII values and any non-ASCII values (such as UTF-8 characters) as base-64 encoded characters. The new <tt>-e</tt> option causes <tt>ldapsearch</tt> to return as much real data as is possible. With <tt>-e</tt>, only values or DNs that contain an '<tt>\r</tt>', an '<tt>\n</tt>', or that start with ':', ' ', or '<tt><</tt>' are base-64 encoded. Note that the <tt>-e</tt> option may cause <tt>ldapsearch</tt> to produce LDIF that does not conform to RFC 2849, found at (<A HREF="ftp://ftp.isi.edu/in-notes/rfc2849.txt">ftp://ftp.isi.edu/in-notes/rfc2849.txt</A>).</LI>
|
|
||||||
|
|
||||||
<LI>The <tt>-U</tt> option was added, which operates in conjunction with the <tt>-t</tt> option (which causes <tt>ldapsearch</tt> to produce file URLs).</li>
|
|
||||||
|
|
||||||
<LI>To conform with RFC 2849, <tt>ldapsearch</tt> now outputs a "<tt>version: 1</tt>" line at the start of all LDIF. A new <tt>-1</tt> (minus 1) option has been added to <tt>ldapsearch</tt> to suppress this line.</li>
|
|
||||||
|
|
||||||
<LI>The <tt>ldapsearch</tt> utility has been modified to support a zero length filter, represented as either "" or <tt>NULL</tt>. The zero-length filter "" is now an alias for "<tt>(objectclass=*)</tt>".</li>
|
|
||||||
</ul>
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<LI>The following new examples have been added to the SDK:
|
|
||||||
<UL>
|
|
||||||
<LI>csearch -- search with ldap_memcache</LI>
|
|
||||||
<LI>ssnoauth -- search over SSL</LI>
|
|
||||||
<LI>ssearch -- search over SSL with cert based authentication</LI>
|
|
||||||
<LI>nsprio -- example usage of the extended IO callbacks</LI>
|
|
||||||
<LI>psearch -- uses persistent search</LI>
|
|
||||||
<LI>srvsort -- shows server-side sorting</LI> <!-- Added in 4.0-->
|
|
||||||
<LI>ppolicy -- shows use of password policies</LI> <!-- Added in 4.0-->
|
|
||||||
<LI>crtfilt -- demonstrates the use of <tt>ldap_create_filter()</tt></LI> <!-- Added in 4.0-->
|
|
||||||
</UL>
|
|
||||||
<p>
|
|
||||||
</ul>
|
|
||||||
<!-- End of 4.1 enhancements -->
|
|
||||||
|
|
||||||
<!-- Start of of 4.0 enhancements -->
|
|
||||||
<p>The following set of modifications were made to the LDAP SDK for C, version 4.0:</p>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>The <tt>ldap.h</tt> header file was modified as follows:
|
|
||||||
<UL>
|
|
||||||
<LI>Support was added for discovery of API version information at run-time with the <tt>LDAP_OPT_API_INFO</tt> option and <tt>LDAPAPIInfo</tt> structure.
|
|
||||||
|
|
||||||
<LI>Support was added for the discovery of API extensions at run-time with the <tt>LDAP_OPT_API_FEATURE_INFO</tt> and <tt>LDAPAPIFeatureInfo</tt> structures.
|
|
||||||
|
|
||||||
<LI>The following macros were added to support the discovery of API version information at compile-time: <tt>LDAP_VENDOR_VERSION</tt>, <tt>LDAP_VENDOR_NAME</tt>, and <tt>LDAP_API_VERSION</tt>.
|
|
||||||
|
|
||||||
<LI>A set pf <tt>LDAP_API_FEATURE_*</tt> macros were added to support the discovery of API extensions at compile-time.
|
|
||||||
|
|
||||||
<LI>The <tt>LDAP_OPT_PRIVATE_EXTENSION_BASE</tt> macro was added.
|
|
||||||
|
|
||||||
<LI>The <tt>ldap_unbind_ext()</tt> function was added.
|
|
||||||
|
|
||||||
<LI>The <tt>ldap_mods_u</tt> name was added to the <tt>mod_vals</tt> union.
|
|
||||||
|
|
||||||
<li>A number of function parameters were modified to be declared with <tt>const</tt>.
|
|
||||||
</ul>
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<li>The <tt>ldap_get_option()</tt> function was modified as follows:
|
|
||||||
<ul>
|
|
||||||
<LI>Support for the <tt>LDAP_OPT_HOST_NAME</tt> option was added.
|
|
||||||
|
|
||||||
<LI>The function now returns a duplicate copy of data when <tt>LDAP_OPT_SERVER_CONTROLS</tt>, <tt>LDAP_OPT_CLIENT_CONTROLS</tt>, or <tt>LDAP_OPT_ERROR_STRING</tt> are retrieved.
|
|
||||||
|
|
||||||
<LI>The <tt>LDAP_OPT_MATCHED_DN</tt> option was added.
|
|
||||||
|
|
||||||
<LI>Support for <tt>LDAP_OPT_ERROR_NUMBER</tt> and <tt>LDAP_OPT_ERROR_STRING</tt> were added.
|
|
||||||
</ul>
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<li>The <tt>lber.h</tt> header file was modified as follows:
|
|
||||||
<ul>
|
|
||||||
<LI>Support was added for the <tt>LBER_USE_DER</tt> option.
|
|
||||||
|
|
||||||
<LI>Several internal datatypes were changed to provide support for <tt>liblber</tt>. In the header file, see the definition for <tt>_LP64</tt> for details.
|
|
||||||
|
|
||||||
<li>The typedef <tt>BerValue</tt> was added to the <tt>berval</tt> struct, as follows:
|
|
||||||
<BLOCKQUOTE>
|
|
||||||
<PRE>
|
|
||||||
typedef struct berval {
|
|
||||||
unsigned long bv_len;
|
|
||||||
char *bv_val;
|
|
||||||
} BerValue;
|
|
||||||
</PRE>
|
|
||||||
</BLOCKQUOTE>
|
|
||||||
</ul>
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<LI>Support was added for receiving unsolicited LDAPv3 notification messages.
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<LI>The header files <tt>disptmpl.h</tt> and <tt>srchpref.h</tt> are now shipped with the SDK.
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<LI>When using SSL client authentication with the command-line utilities, you are no longer required to provide the Cert DB password with the <tt>-W</tt> option on the command line. If you do not specify the <tt>-W</tt> option, the command-line utility will prompt you for your Cert DB password.
|
|
||||||
|
|
||||||
<p>Alternatively, you can provide a path to a PIN file that contains your Cert DB password. The format of a PIN file is the same as the PIN file that you would use for a 4.1 Netscape Directory Server. That is, if your Cert DB password is <tt>secret12</tt>, then you would enter the following line into your PIN file:
|
|
||||||
|
|
||||||
<BLOCKQUOTE>
|
|
||||||
<PRE>Internal (Software) Token:secret12</PRE>
|
|
||||||
</BLOCKQUOTE>
|
|
||||||
|
|
||||||
<P>You would then point to this file using the <tt>-I</tt> option on the command line utility. For example:</P>
|
|
||||||
|
|
||||||
<BLOCKQUOTE>
|
|
||||||
<PRE>-I /h/bjensen/.netscape/my_pin_file</PRE>
|
|
||||||
</BLOCKQUOTE>
|
|
||||||
|
|
||||||
<P>The use of either the PIN file or interactive prompting for your password means that your Cert DB password is not exposed through process examination (that is, by using the <tt>ps</tt> command on Unix).</P>
|
|
||||||
</ul>
|
|
||||||
<!-- End of Enhancements -->
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<HR ALIGN=LEFT SIZE="12">
|
|
||||||
<H2><A NAME="connect_timeout"></A>LDAP_X_OPT_CONNECT_TIMEOUT</H2>
|
|
||||||
|
|
||||||
<P>The LDAP SDK for C, v4.1 provides a new option that allows you to control the TCP/IP timeout. Normally connection attempts will block for a period of time when the connection is for a host that is not reachable. <tt>LDAP_X_OPT_CONNECT_TIMEOUT</tt> allows you to control the amount of time for which a connection attempt will block in the event that the host is not reachable. You can tell the SDK to return immediately, return after an amount of time that you specify, or to block indefinitely.</P>
|
|
||||||
|
|
||||||
<P>The timeout value is set on a per-session handle basis and you can control the default timeout that is used by all session handles. Use <tt>ldap_set_option()</tt> to set the timeout value. Use <tt>ldap_get_option()</tt> to return the timeout value that is set for the current session handle.</P>
|
|
||||||
|
|
||||||
<H3>Timeout Values</H3>
|
|
||||||
|
|
||||||
<P>To support this option, the following special values are now available:</P>
|
|
||||||
<UL>
|
|
||||||
<LI><P><tt>LDAP_X_IO_TIMEOUT_NO_WAIT</tt> -- The connection attempt returns immediately even if the server is reachable.</P>
|
|
||||||
|
|
||||||
<LI><P><tt>LDAP_X_IO_TIMEOUT_NO_TIMEOUT</tt> -- The connection attempt will block until the host responds, or for the duration of the platform's connection timeout. Depending on the platform, the default connection timeout can be anywhere from 20 seconds to 3 minutes or longer. This value is the default.</P>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<P>In addition, you can specify a timeout value in milliseconds.</P>
|
|
||||||
|
|
||||||
<H3>Setting the Timeout Value</H3>
|
|
||||||
<P>The following code fragment sets the timeout value for the session handle to 10 seconds.</P>
|
|
||||||
|
|
||||||
<PRE>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "ldap.h"
|
|
||||||
|
|
||||||
#define HOST "mydirectory.siroe.com"
|
|
||||||
#define PORT 389
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
LDAP *ld;
|
|
||||||
LDAPMessage *result;
|
|
||||||
int rc, version;
|
|
||||||
|
|
||||||
/* timeout is specified in milliseconds. 10000 = 10 seconds. */
|
|
||||||
int timeout = 10000;
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
if ( ( ld = ldap_init( HOST, PORT ) ) == NULL ) {
|
|
||||||
perror( "ldap_init" );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ldap_set_option( ld, LDAP_X_OPT_CONNECT_TIMEOUT, &timeout ) != LDAP_SUCCESS ) {
|
|
||||||
rc = ldap_get_lderrno( ld, NULL, NULL);
|
|
||||||
fprintf( stderr, "ldap_set_option: %s\n", ldap_err2string( rc ) );
|
|
||||||
ldap_unbind( ld );
|
|
||||||
return (rc);
|
|
||||||
}
|
|
||||||
|
|
||||||
...
|
|
||||||
</PRE>
|
|
||||||
|
|
||||||
<P>You can also control the default timeout for all LDAP session handles by setting the <t>LDAP *</tt> value to <tt>NULL</tt> using <tt>ldap_set_option()</tt>. For example:</P>
|
|
||||||
|
|
||||||
<PRE>
|
|
||||||
int timeout = LDAP_X_IO_TIMEOUT_WAIT;
|
|
||||||
|
|
||||||
ldap_set_option( NULL, LDAP_X_OPT_CONNECT_TIMEOUT, &timeout );
|
|
||||||
|
|
||||||
/* the default timeout is now set for all new ldap connections that
|
|
||||||
are created after this call to ldap_set_option. */
|
|
||||||
</PRE>
|
|
||||||
|
|
||||||
<H3>Retrieving the Timeout Value</H3>
|
|
||||||
|
|
||||||
<P>The following code fragment retrieves the timeout value for the current session handle.</P>
|
|
||||||
|
|
||||||
<PRE>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "ldap.h"
|
|
||||||
|
|
||||||
#define HOST "mydirectory.siroe.com"
|
|
||||||
#define PORT 389
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
LDAP *ld;
|
|
||||||
LDAPMessage *result;
|
|
||||||
int rc, version, timeout;
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
if ( ( ld = ldap_init( HOST, PORT ) ) == NULL ) {
|
|
||||||
perror( "ldap_init" );
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ldap_get_option( ld, LDAP_X_OPT_CONNECT_TIMEOUT, &timeout ) != LDAP_SUCCESS ) {
|
|
||||||
rc = ldap_get_lderrno( ld, NULL, NULL);
|
|
||||||
fprintf( stderr, "ldap_set_option: %s\n", ldap_err2string( rc ) );
|
|
||||||
ldap_unbind( ld );
|
|
||||||
return (rc);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch( timeout ) {
|
|
||||||
case LDAP_X_IO_TIMEOUT_NO_WAIT:
|
|
||||||
printf("The connection is set to not block\n");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LDAP_X_IO_TIMEOUT_NO_TIMEOUT:
|
|
||||||
printf("The connection is set to block indefinitely\n");
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
printf("The connection timeout is set to %d seconds", (timeout/1000) );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
...
|
|
||||||
</PRE>
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<HR ALIGN=LEFT SIZE="12">
|
|
||||||
<H2><A NAME="errmsg"></A>LDAP library/API Version Mismatch Error Messages</H2>
|
|
||||||
|
|
||||||
<p>This feature was added to version 4.0 of the LDAP SDK for C.</p>
|
|
||||||
|
|
||||||
<P>Various macros and structures have been added to the SDK to allow for compile-time and run-time discovery of the API version. Their intended use is to allow you to ensure that you are compiling and running with the correct version of the LDAP SDK for C. These features are in line with the latest LDAP SDK for C API Internet Draft.</P>
|
|
||||||
|
|
||||||
<P>As a result of these changes, the command line tools bundled with the LDAP SDK for C now check to ensure that they are running with the correct version of the library. If your library path variable (LD_LIBRARY_PATH on most Unix systems and the PATH variable on Windows NT) is set so that an old version of the LDAP SDK for C library is in use, then the command line tools can return one of the following error messages:</P>
|
|
||||||
|
|
||||||
<PRE>ldapsearch: unable to retrieve LDAP library version information;
|
|
||||||
this program requires an LDAP library that implements revision
|
|
||||||
2003 or greater of the LDAP API.
|
|
||||||
|
|
||||||
ldapsearch: this program requires an LDAP library that implements revision
|
|
||||||
2003 or greater of the LDAP API; running with revision 2002.
|
|
||||||
|
|
||||||
ldapsearch: this program requires Netscape Communications Corp.'s LDAP
|
|
||||||
library version 3.20 or greater; running with version 3.00.</PRE>
|
|
||||||
|
|
||||||
<P>By default, the tools will exit if they see a mismatch in versions. To override the version mismatch, you can use <tt>-0</tt> option (zero, not 'o') with the tools, but results may vary.</P>
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<HR ALIGN=LEFT SIZE="12">
|
|
||||||
<H2><A NAME="64bit"></A>64-Bit Safe Changes</H2>
|
|
||||||
|
|
||||||
<p>This feature was added to version 4.0 of the LDAP SDK for C.</p>
|
|
||||||
|
|
||||||
<P>Internal data types for <tt>liblber</tt> have been upgraded so that the data types are 64-bit safe. This is done in the following section of code in <tt>lber.h</tt>:</P>
|
|
||||||
|
|
||||||
<BLOCKQUOTE><PRE>
|
|
||||||
/*
|
|
||||||
* Implementation-specific integer data types. If living in an LP64
|
|
||||||
* environment (where sizeof(long) is 64 bits), we use unsigned ints;
|
|
||||||
* otherwise we use unsigned longs. The goal is to always use 32-bit
|
|
||||||
* quantities and to also be backwards compatible with previous SDK
|
|
||||||
* versions which used unsigned longs.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(_LP64)
|
|
||||||
typedef unsigned int ber_len_t;
|
|
||||||
typedef int ber_signed_len_t;
|
|
||||||
typedef unsigned int ber_tag_t;
|
|
||||||
typedef int ber_int_t;
|
|
||||||
#else
|
|
||||||
typedef unsigned long ber_len_t;
|
|
||||||
typedef long ber_signed_len_t;
|
|
||||||
typedef unsigned long ber_tag_t;
|
|
||||||
typedef long ber_int_t;
|
|
||||||
#endif
|
|
||||||
</PRE></BLOCKQUOTE>
|
|
||||||
|
|
||||||
<P>This change makes <tt>liblber</tt> consistent between environments where <tt>int</tt> data types are 32 bits and those where they are 64 bits. However, this change may cause some compilers, especially c++ compilers where strong type checking is enforced, to emit warnings or errors when you recompile old code.</P>
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<HR ALIGN=LEFT SIZE="12">
|
|
||||||
<H2><A NAME="parseurl"></A>ldap_url_parse() with Space-Separated Lists of Hosts</H2>
|
|
||||||
|
|
||||||
<p>This feature was added to version 4.0 of the LDAP SDK for C.</p>
|
|
||||||
|
|
||||||
<P>You can now pass <tt>ldap_url_parse()</tt> a string that uses the following format:</P>
|
|
||||||
|
|
||||||
<pre>ldap://host1:port1 host2:port2 host2:port3 ... hostn:portn/<basedn></pre>
|
|
||||||
|
|
||||||
<P>Using this formatting, <tt>ldap_url_parse()</tt> will return results that are acceptable to <tt>ldap_init()</tt>. For example:</P>
|
|
||||||
|
|
||||||
<BLOCKQUOTE><PRE>
|
|
||||||
LDAP *ld;
|
|
||||||
LDAPURLDesc *ludpp;
|
|
||||||
int res;
|
|
||||||
|
|
||||||
char *url = "ldap://phonebook.example.com:2389 directory.example.com:389/o=example.com";
|
|
||||||
|
|
||||||
res = ldap_url_parse(url, &ludpp);
|
|
||||||
ld = ldap_init(ludpp->host, ludpp->port);
|
|
||||||
</PRE></BLOCKQUOTE>
|
|
||||||
|
|
||||||
<P>This input causes <TT>ldap_init()</TT> to try to connect to each host and port in the URL string until it finds a host with which it can connect.</P>
|
|
||||||
|
|
||||||
<P>Note that <TT>ludpp->port</TT> is set to the port identified on the last host in the URL string. If <TT>ludpp->port</TT> is used as shown here, then the last port identified on the URL string becomes the default port for any hosts for which a port is not explicitly set. Using the example above, suppose the URL string contained the following:</P>
|
|
||||||
|
|
||||||
<PRE>
|
|
||||||
ldap://phonebook.example.com phonebook2.example.com phonebook3.example.com:2389/o=example.com
|
|
||||||
</PRE>
|
|
||||||
|
|
||||||
<P>Here, <TT>ldap_init()</TT> would use port 2389 for all the hosts that it tries. If the last host in the string does not identify a port, then <TT>ludpp->port</TT> is set to zero (0). Setting the port to 0 tells <TT>ldap_init()</TT> to use the default port, which is 389 for <TT>ldap://</TT> urls and 636 for <TT>ldaps://</TT> urls.</P>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<hr ALIGN=LEFT SIZE="12">
|
|
||||||
<H2><a name="problems"></a><font size="+3">K</font>NOWN
|
|
||||||
<font size="+3">P</font>ROBLEMS</H2>
|
|
||||||
|
|
||||||
<P>The following is a known bug in this release of the LDAP SDK for C:</P>
|
|
||||||
|
|
||||||
<UL>
|
|
||||||
<LI>The IO Connect Timeout feature does not work on Windows NT with SSL. That is, the Windows NT connection always blocks for the Windows NT TCP/IP timeout value (approximately 50 seconds) in the event that the host is not reachable. This is because the PR_Connect() function in the Windows NT version of NSPR does not timeout, and so a timeout value cannot be set for it. This problem will be resolved in a future release when a fixed version of NSPR becomes available. (42900)</LI>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<HR ALIGN=LEFT SIZE="12">
|
|
||||||
<h2><a NAME="info"></a><font size=+3>M</font>ORE
|
|
||||||
<font size=+3>I</font>NFORMATION</h2>
|
|
||||||
|
|
||||||
<p>Netscape and iPlanet provide binary releases of this SDK. However, note that this SDK is also available in source code form as part of the Mozilla.org open source project. Refer to the following site for more information on how you can get the source code and contribute to the further development of this SDK: </p>
|
|
||||||
|
|
||||||
<blockquore><pre>http://www.mozilla.org/directory</pre></blockquote>
|
|
||||||
|
|
||||||
<h3>Product Documentation</h3>
|
|
||||||
|
|
||||||
<p>The <cite>LDAP SDK for C Programmer's Guide, version 4.1</cite> is available in HTML and PDF formats. You can access this manual at the following site: <a href="http://docs.iplanet.com/docs/manuals/directory.html#SDK">http://docs.iplanet.com/docs/manuals/directory.html#SDK</a>.</p>
|
|
||||||
|
|
||||||
<p>Installation instructions and release notes for all iPlanet and Netscape servers are posted at <a href="http://docs.iplanet.com/docs/manuals/index.html">http://docs.iplanet.com/docs/manuals/index.html</a>.</p>
|
|
||||||
|
|
||||||
<H3>Reporting Problems with the LDAP SDK for C</H3>
|
|
||||||
|
|
||||||
<P>Please submit problem reports to the netscape.public.mozilla.directory newsgroup and/or mailing list. For information on locating this and other Mozilla newsgroups and mailing lists, please see <A HREF="http://www.mozilla.org/community.html">http://www.mozilla.org/community.html</A>
|
|
||||||
</P>
|
|
||||||
|
|
||||||
<p> </p>
|
|
||||||
</td> <!-- End Content -->
|
|
||||||
<td width="4%"> </td> <!-- Right Margin -->
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<h5>Copyright 2000 © Sun Microsystems, Inc. Some preexisting portions Copyright © 2000 Netscape Communications Corp. All Rights Reserved.</h5>
|
|
||||||
|
|
||||||
</BODY>
|
|
||||||
</HTML>
|
|
||||||
@ -1,245 +0,0 @@
|
|||||||
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
||||||
<meta name="Author" content="Michael Hein">
|
|
||||||
<meta name="GENERATOR" content="Mozilla/4.76 [en] (X11; U; SunOS 5.7 sun4u) [Netscape]">
|
|
||||||
<title>Release notes for LDAP C SDK 5.x</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<h1>
|
|
||||||
Release Notes for LDAP C SDK 5.x</h1>
|
|
||||||
<i>Michael Hein <a href="mailto:mhein@netscape.com">mhein@sun.com</a></i>
|
|
||||||
<br>
|
|
||||||
<p><font size=+1><a href="#LDAP C SDK 5.0">LDAP C SDK 5.0 (3/28/2001)</a></font>
|
|
||||||
<br><font size=+1><a href="#LDAP C SDK 5.1">LDAP C SDK 5.01 (06/13/2001)</a></font>
|
|
||||||
<br><font size=+1><a href="#LDAP C SDK 5.2">LDAP C SDK 5.02 (07/03/2001)</a></font>
|
|
||||||
<br><font size=+1><a href="#LDAP C SDK 5.3">LDAP C SDK 5.03 (08/02/2001)</a></font>
|
|
||||||
<br><font size=+1><a href="#LDAP C SDK 5.04 (08/15/2001)">LDAP C SDK 5.04
|
|
||||||
(08/15/2001)</a></font>
|
|
||||||
<br><font size=+1><a href="#LDAP C SDK 5.05 (10/04/2001)">LDAP C SDK 5.05
|
|
||||||
(10/04/2001)</a></font>
|
|
||||||
<br>
|
|
||||||
<p><a NAME="LDAP C SDK 5.0"></a><b><font size=+2>LDAP C SDK 5.0 (3/28/2001)
|
|
||||||
(Available on www.iplanet.com)</font></b>
|
|
||||||
<h2>
|
|
||||||
Bugs/enhancements fixed in this release:</h2>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
Migrated to NSS 3.2 and NSPR 4.1</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Build system rewritten to accommodate move to mozilla</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
530135 - simple filters are truncated</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
520548 - only print info if -vv is used</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
529868 - support "version 2" proxied auth control</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Various bugs reported through Mozilla.org fixed in this release</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p><br><a NAME="LDAP C SDK 5.1"></a><b><font size=+2>LDAP C SDK 5.01 (06/13/2001)</font></b>
|
|
||||||
<h2>
|
|
||||||
Bugs/enhancements fixed in this release:</h2>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
540490 - ber_scanf leaks memory on encoding errors</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
don't link libldap with NSPR libraries</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
543857 - broken command line utilities because of ber_scanf() changes</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
394822 - command line tools should support password policy</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
539148 - Unix ldapmodify cannot parse NT replica dump</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
526153 - -Z option is not checked in case of SSL client auth</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Added files in coreconf as needed for Linux 7.1 build</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
(added to tip of ldapcsdk_branch_50 branch)</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Took out libdbm module as we are no longer dependent on it (NSS includes
|
|
||||||
it) as we don't build static ldap library versions anymore</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
546204 - HP-UX command line utilities not working</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
added SunOS5.8_i86pc.mk, SunOS5.9.mk, SunOS5.9_i86pc.mk, and updated SunOS5.mk
|
|
||||||
for Solaris x86 support</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
misc changes for i86 support</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p><br><a NAME="LDAP C SDK 5.2"></a><b><font size=+2>LDAP C SDK 5.02 (07/03/2001)</font></b>
|
|
||||||
<h2>
|
|
||||||
Bugs/enhancements fixed in this release:</h2>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
header file reorg. The ldap.h header file has now been split up into
|
|
||||||
4 separate files (ldap-standard.h, ldap-extension.h, ldap-deprecated.h,
|
|
||||||
and ldap-to-be-deprecated.h) and a new file, ldap-platform.h has been added
|
|
||||||
to the distribution. As per LDAP C API draft, user is only required
|
|
||||||
to ldap.h and the files list above are included automatically.</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
ltest builds once again (Solaris only).</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Use IPv6 (if available) when NSPR I/O is used via libprldap.</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Change the cmd line utilities to always use NSPR I/O via libprldap.</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Add support for IPv6 addresses (in square brackets) to the ldap_init()
|
|
||||||
call and libldap's LDAP URL parser.</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Export ldap-platform.h and ldappr.h (shipped as public headers).</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Add top-level COMPS_FROM_OBJDIR=1 gmake option for use in the non-coreconf
|
|
||||||
case.</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Remove outdated build instructions.</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Add support for building examples within a source tree.</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
nsprio now takes an optional hostport argument.</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
add check for ld_mutex != NULL in LDAP_MUTEX_LOCK/UNLOCK macros This fixes
|
|
||||||
a crash that can occur when using libprldap.</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
73830 - Calling ldap_init() with a NULL hostname results in core.
|
|
||||||
The crash occurred because the host pointer ("localhost") was being freed
|
|
||||||
twice. Now we ensure that the host is set to NULL by ldap_x_hostlist_next()
|
|
||||||
in the special case when NULL was passed into ldap_x_hostlist_first(),
|
|
||||||
which is more consistent to the caller and eliminates the double free problem.</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
nsprio build fixes</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
build static libldap50.a library and include in distribution (Note this
|
|
||||||
is the ldap library only. We do not ship the ssl enable library as
|
|
||||||
a static library. When you use this library you will have to link
|
|
||||||
with the static liblber library as well)</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Cannot use the __declspec (thread) semantics for thread local storage if
|
|
||||||
one want to use LoadLibrary to dynamically load DLL at runtime. This
|
|
||||||
issue was found on NT only and cause PerLdap to fail.</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p><br><a NAME="LDAP C SDK 5.3"></a><b><font size=+2>LDAP C SDK 5.03 (08/02/2001)</font></b>
|
|
||||||
<h2>
|
|
||||||
Bugs/enhancements fixed in this release:</h2>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
345002 - Implement persistent search (345002)</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
550410 - "-s" scope implementation</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
550409 - fix for false success report in verbose mode</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Include liblber functions in Linux libldap build</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
BER speedup changes (via writev)</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
Update components to NSS 3.3, NSPR 4.12, and SVRCORE 3.3</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
553151 - Abnormal behavior of get_get_next_buffer() under extreme conditions</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
package up additional header files for internal product builds</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
<p><a NAME="LDAP C SDK 5.04 (08/15/2001)"></a><b><font size=+2>LDAP C SDK
|
|
||||||
5.04 (08/15/2001)</font></b>
|
|
||||||
<h2>
|
|
||||||
Bugs/enhancements fixed in this release:</h2>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
555890 - ldapsearch is broken on NT/Linux/OSF</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
added the new packaging script for www.iplanet.com</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p><br><a NAME="LDAP C SDK 5.05 (10/04/2001)"></a>
|
|
||||||
<br><b><font size=+2>LDAP C SDK 5.05 (10/04/2001) (This release is targeted
|
|
||||||
for www.iplanet.com)</font></b>
|
|
||||||
<h2>
|
|
||||||
Bugs/enhancements fixed in this release:</h2>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
new option to command line utilities to alllow for -w - to prompt for the
|
|
||||||
simple bind password from the command line</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
new option to command line utilities to allow for -j to read the simple
|
|
||||||
bind password from a specified file name</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
misc. ber changes to io.c</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
take out -lC in tools/clients/Makefile.client since we are now picking
|
|
||||||
up clean forte6 components</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
558135 - smart referrals with three contiguous slashes don't work</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
allow for the setting of controls via command line interface</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
bump to forte6.2 component for Solaris 5.8 (This change only applies to
|
|
||||||
the NSS component)</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
559670 - use of select() cause problems with > 1024 connections in iDS
|
|
||||||
chaining code</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
support sun4m architecture</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -1,282 +0,0 @@
|
|||||||
# The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
#
|
|
||||||
# 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 Netscape are
|
|
||||||
# Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
# Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
@ -1,132 +0,0 @@
|
|||||||
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 :-)
|
|
||||||
|
|
||||||
@ -1,175 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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++;
|
|
||||||
}
|
|
||||||
@ -1,151 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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++;
|
|
||||||
}
|
|
||||||
@ -1,84 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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 );
|
|
||||||
}
|
|
||||||
@ -1,170 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Demonstrate use of the create filter function.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "examples.h"
|
|
||||||
|
|
||||||
#define FILT_BUFSIZ 4096
|
|
||||||
|
|
||||||
struct filt_words {
|
|
||||||
char **f_words;
|
|
||||||
char *f_internal;
|
|
||||||
};
|
|
||||||
|
|
||||||
static int get_string_input( const char *prompt, const char *defaultval,
|
|
||||||
char *resultbuf );
|
|
||||||
static struct filt_words *val2words( const char *value, const char *delims );
|
|
||||||
static void freewords( struct filt_words *words );
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
main( int argc, char **argv )
|
|
||||||
{
|
|
||||||
int rc;
|
|
||||||
char patbuf[ FILT_BUFSIZ ];
|
|
||||||
char attrbuf[ FILT_BUFSIZ ], valuebuf[ FILT_BUFSIZ ];
|
|
||||||
char filtbuf[ FILT_BUFSIZ ];
|
|
||||||
struct filt_words *fwords;
|
|
||||||
|
|
||||||
patbuf[0] = attrbuf[0] = valuebuf[0] = '\0';
|
|
||||||
|
|
||||||
while ( 1 ) {
|
|
||||||
if ( get_string_input( "Enter a filter pattern: [%s] ", patbuf,
|
|
||||||
patbuf ) != 0 ) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( get_string_input( "Enter an attribute type: [%s] ", attrbuf,
|
|
||||||
attrbuf ) != 0 ) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( get_string_input( "Enter a value: [%s] ", valuebuf,
|
|
||||||
valuebuf ) != 0 ) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
fwords = val2words( valuebuf, " " );
|
|
||||||
rc = ldap_create_filter( filtbuf, sizeof( filtbuf ), patbuf,
|
|
||||||
NULL, NULL, attrbuf, valuebuf, fwords->f_words );
|
|
||||||
freewords( fwords );
|
|
||||||
|
|
||||||
if ( rc != LDAP_SUCCESS ) {
|
|
||||||
fprintf( stderr, "ldap_create_filter: failed (%d - %s)\n", rc,
|
|
||||||
ldap_err2string( rc ));
|
|
||||||
} else {
|
|
||||||
printf( "Resulting filter: %s\n", filtbuf );
|
|
||||||
}
|
|
||||||
putchar( '\n' );
|
|
||||||
}
|
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Prompt the user for a string. The entered string is placed in resultbuf.
|
|
||||||
* If a zero-length string is entered, i.e., if they just hit return, the
|
|
||||||
* contents of defaultval are copied to resultbuf.
|
|
||||||
* Returns 0 if all goes well and -1 if error or end of file.
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
get_string_input( const char *prompt, const char *defaultval, char *resultbuf )
|
|
||||||
{
|
|
||||||
char inbuf[ FILT_BUFSIZ ];
|
|
||||||
|
|
||||||
inbuf[0] = '\0';
|
|
||||||
printf( prompt, defaultval );
|
|
||||||
if ( fgets( inbuf, sizeof( inbuf ), stdin ) == NULL ) {
|
|
||||||
return( -1 );
|
|
||||||
}
|
|
||||||
inbuf[ strlen( inbuf ) - 1 ] = '\0'; /* strip trailing newline */
|
|
||||||
if ( inbuf[ 0 ] == '\0' ) { /* use default value */
|
|
||||||
if ( defaultval != resultbuf ) {
|
|
||||||
strcpy( resultbuf, defaultval );
|
|
||||||
}
|
|
||||||
} else { /* use newly entered value */
|
|
||||||
strcpy( resultbuf, inbuf );
|
|
||||||
}
|
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static struct filt_words *
|
|
||||||
val2words( const char *value, const char *delims )
|
|
||||||
{
|
|
||||||
struct filt_words *fw;
|
|
||||||
char *word;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (( fw = calloc( 1, sizeof( struct filt_words ))) == NULL ||
|
|
||||||
( fw->f_internal = strdup( value )) == NULL ) {
|
|
||||||
perror( "calloc OR strdup" );
|
|
||||||
exit( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
word = strtok( fw->f_internal, delims );
|
|
||||||
i = 0;
|
|
||||||
|
|
||||||
while ( word != NULL ) {
|
|
||||||
if ( fw->f_words == NULL ) {
|
|
||||||
fw->f_words = (char **)malloc( (i + 2 ) * sizeof( char * ));
|
|
||||||
} else {
|
|
||||||
fw->f_words = (char **)realloc( fw->f_words,
|
|
||||||
(i + 2 ) * sizeof( char * ));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( fw->f_words == NULL ) {
|
|
||||||
perror( "malloc OR realloc" );
|
|
||||||
exit( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
fw->f_words[ i ] = word;
|
|
||||||
fw->f_words[ ++i ] = NULL;
|
|
||||||
word = strtok( NULL, delims );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( i > 0 ) {
|
|
||||||
fw->f_words[ i ] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return( fw );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
freewords( struct filt_words *words )
|
|
||||||
{
|
|
||||||
if ( words != NULL ) {
|
|
||||||
if ( words->f_words != NULL ) {
|
|
||||||
free( words->f_words );
|
|
||||||
}
|
|
||||||
if ( words->f_internal != NULL ) {
|
|
||||||
free( words->f_internal );
|
|
||||||
}
|
|
||||||
free( words );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,136 +0,0 @@
|
|||||||
/*
|
|
||||||
* The contents of this file are subject to the Netscape 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/NPL/
|
|
||||||
*
|
|
||||||
* 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 Netscape are
|
|
||||||
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enable the in-memory cache and then search the directory 10 times
|
|
||||||
* for all people whose surname (last name) is "Jensen". Since the
|
|
||||||
* "sn" attribute is a caseignorestring (cis), case is not significant
|
|
||||||
* when searching.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "examples.h"
|
|
||||||
|
|
||||||
LDAP *ld;
|
|
||||||
LDAPMessage *result, *e;
|
|
||||||
BerElement *ber;
|
|
||||||
char *a, *dn;
|
|
||||||
char **vals;
|
|
||||||
int i, j;
|
|
||||||
LDAPMemCache *cacheHandle;
|
|
||||||
int memCache;
|
|
||||||
|
|
||||||
int mySearch();
|
|
||||||
|
|
||||||
int
|
|
||||||
main( int argc, char **argv )
|
|
||||||
{
|
|
||||||
/* get a handle to an LDAP connection */
|
|
||||||
if ( (ld = ldap_init( MY_HOST, MY_PORT )) == NULL ) {
|
|
||||||
perror( "ldap_init" );
|
|
||||||
return( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
memCache=ldap_memcache_init( 1800, 1024L * 1024, NULL, NULL, &cacheHandle );
|
|
||||||
|
|
||||||
switch ( memCache )
|
|
||||||
{
|
|
||||||
case LDAP_SUCCESS :
|
|
||||||
printf("LDAP_SUCCESS\n");
|
|
||||||
printf("LDAP_SUCCESS = %d\n", LDAP_SUCCESS);
|
|
||||||
printf("memCache = %d\n", memCache);
|
|
||||||
break;
|
|
||||||
case LDAP_PARAM_ERROR:
|
|
||||||
printf("LDAP_PARAM_ERROR\n");
|
|
||||||
break;
|
|
||||||
case LDAP_NO_MEMORY:
|
|
||||||
printf("LDAP_NO_MEMORY\n");
|
|
||||||
break;
|
|
||||||
case LDAP_SIZELIMIT_EXCEEDED:
|
|
||||||
printf("LDAP_SIZELIMITE_EXCEEDED\n");
|
|
||||||
break;
|
|
||||||
default :
|
|
||||||
printf("Unknown Error = %d\n", memCache);
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* authenticate to the directory as nobody */
|
|
||||||
if ( ldap_simple_bind_s( ld, NULL, NULL ) != LDAP_SUCCESS ) {
|
|
||||||
ldap_perror( ld, "ldap_simple_bind_s" );
|
|
||||||
ldap_unbind( ld );
|
|
||||||
return( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
ldap_memcache_set( ld, cacheHandle );
|
|
||||||
|
|
||||||
|
|
||||||
for ( j = 0; j < 10; ++j ) {
|
|
||||||
#ifdef _WINDOWS
|
|
||||||
Sleep( 1000 );
|
|
||||||
#else
|
|
||||||
sleep( 1 );
|
|
||||||
#endif
|
|
||||||
mySearch();
|
|
||||||
}
|
|
||||||
|
|
||||||
ldap_memcache_destroy( cacheHandle );
|
|
||||||
ldap_unbind( ld );
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int mySearch()
|
|
||||||
{
|
|
||||||
/* search for all entries with surname of Jensen */
|
|
||||||
if ( ldap_search_s( ld, MY_SEARCHBASE, LDAP_SCOPE_SUBTREE,
|
|
||||||
MY_FILTER, NULL, 0, &result ) != LDAP_SUCCESS ) {
|
|
||||||
ldap_perror( ld, "ldap_search_s" );
|
|
||||||
if ( result == NULL ) {
|
|
||||||
ldap_unbind( ld );
|
|
||||||
return( 1 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* for each entry print out name + all attrs and values */
|
|
||||||
for ( e = ldap_first_entry( ld, result ); e != NULL;
|
|
||||||
e = ldap_next_entry( ld, e ) ) {
|
|
||||||
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 );
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user