Fix 190539 - Speed optimizations for OS/2.

Changes merged from ldapcsdk_50_client_branch.
This commit is contained in:
mcs%netscape.com 2003-04-01 18:11:26 +00:00
Родитель 9ec47562dc
Коммит 00da1b62fe
6 изменённых файлов: 85 добавлений и 62 удалений

Просмотреть файл

@ -240,6 +240,10 @@ USE_DLL_EXPORTS_FILE = 1
endif
endif
ifeq ($(OS_ARCH), OS2)
USE_DLL_EXPORTS_FILE = 1
endif
ifeq ($(OS_ARCH), SunOS)
DLLEXPORTS_PREFIX=-Blocal -M
USE_DLL_EXPORTS_FILE = 1

Просмотреть файл

@ -115,6 +115,10 @@ SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
endif
ifeq ($(OS_ARCH),OS2)
DEF_FILE := $(SHARED_LIBRARY:.dll=.def)
endif
else
LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
@ -169,7 +173,7 @@ endif
endif
ALL_TRASH = $(TARGETS) $(OBJS) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \
$(NOSUCHFILE) \
$(NOSUCHFILE) $(DEF_FILE)\
so_locations
ifdef DIRS
@ -316,15 +320,25 @@ $(IMPORT_LIBRARY): $(SHARED_LIBRARY)
endif
ifeq ($(OS_TARGET), OS2)
$(IMPORT_LIBRARY): $(SHARED_LIBRARY)
$(IMPLIB) $@ $(SHARED_LIBRARY).def
$(DEF_FILE): $(LIBRARY)
rm -f $@
echo LIBRARY $(notdir $(basename $(SHARED_LIBRARY))) INITINSTANCE TERMINSTANCE > $@
echo PROTMODE >> $@
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
echo EXPORTS >> $@
$(FILTER) $(LIBRARY) >> $@
$(IMPORT_LIBRARY): $(DEF_FILE)
rm -f $@
$(IMPLIB) $@ $(DEF_FILE)
endif
$(SHARED_LIBRARY): $(OBJS)
$(SHARED_LIBRARY): $(OBJS) $(DEF_FILE)
@$(MAKE_OBJDIR)
rm -f $@
ifdef USE_AUTOCONF
$(MKSHLIB) $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
$(MKSHLIB) $(OBJS) $(EXTRA_LIBS) $(OS_LIBS) $(DEF_FILE)
else
ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms
@ -356,16 +370,6 @@ 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";\
@ -375,9 +379,12 @@ ifeq ($(OS_TARGET), OpenVMS)
$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS) $(OBJDIR)/VMSuni.opt
@echo "`translate $@`" > $(@:.$(DLL_SUFFIX)=.vms)
else # OpenVMS
$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE)
else # !os2 vacpp
$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS) $(DEF_FILE)
endif # OS2 vacpp
endif # OpenVMS
endif # OS2
endif # WINNT
endif # AIX 4.1
endif # USE_AUTOCONF

Просмотреть файл

@ -1773,8 +1773,8 @@ mips-sony-newsos*)
LD='-ilink'
MKSHLIB='$(LD) $(DSO_LDOPTS)'
IMPLIB='implib -nologo -noignorecase'
FILTER='cppfilt -q -B -P'
_OPTIMIZE_FLAGS='/O+ /Gl+ /Gx+ /qtune=pentium /qarch=pentium'
FILTER='cppfilt -q -B -P -o'
_OPTIMIZE_FLAGS='/O+ /Gl+ /G5 /qarch=pentium'
_DEBUG_FLAGS='/Ti+ '
LDFLAGS='/NOL /M /L'
DLLFLAGS='/O:$@ /DLL /INC:_dllentry /MAP:$(@:.dll=.map) /L /NOL'

Просмотреть файл

@ -11,7 +11,8 @@ $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" ) {
$type ne "MacOS" && $type ne "SOLARIS" && $type ne "SunOS" &&
$type ne "OS2" ) {
usage();
}
@ -78,7 +79,7 @@ print_exports {
if ( substr( $line, 0, 1 ) eq "#" ) {
$line = substr( $line, 1 );
$_ = $line;
if ( /^[0-9]+[\t ]/ ) {
if ( /^[0-9]+[\t ]/ && $type ne "OS2" ) {
&print_comment( $type, "" );
&print_export( $type, $line );
} else {
@ -98,17 +99,20 @@ print_exports {
# print_comment( type, s )
sub
print_comment {
local( $type, $s ) = @_;
# do not print comments for OS2
if ( $type ne "OS2" ) {
local( $type, $s ) = @_;
if ( $type eq "AIX" ) {
$prefix = "* ";
} elsif ( substr( $type, 0, 3 ) ne "Win" ) {
$prefix = "# ";
} else {
$prefix = "; ";
if ( $type eq "AIX" ) {
$prefix = "* ";
} elsif ( substr( $type, 0, 3 ) ne "Win" ) {
$prefix = "# ";
} else {
$prefix = "; ";
}
print $prefix,$s
}
print $prefix,$s
}
@ -136,7 +140,7 @@ print_export {
}
# finally, print out an appropriate export line
if ( $type eq "Win32" ) {
if ( $type eq "Win32" || $type eq "OS2" ) {
if ( $symtype ne "G" ) {
print "\t$symbol\t\t\@$ordinal\n";
}

Просмотреть файл

@ -146,9 +146,14 @@ endif
# variable definitions for exported symbols
ifeq ($(OS_ARCH), WINNT)
LDAP_EXPORT_DEFS= $(srcdir)/../msdos/winsock/nsldap32.def
else
ifeq ($(OS_ARCH), OS2)
LDAP_EXPORT_DEFS= $(OBJDIR_NAME)/libldap.def
else
LDAP_EXPORT_DEFS= $(OBJDIR_NAME)/libldap.exp
endif
GARBAGE += $(LDAP_EXPORT_DEFS)
endif
LDAP_EXPORT_FLAGS=$(addprefix $(DLLEXPORTS_PREFIX), $(LDAP_EXPORT_DEFS))
@ -232,9 +237,18 @@ ifeq ($(USE_DLL_EXPORTS_FILE), 1)
$(LDAP_EXPORT_DEFS):: $(srcdir)/../libldap.ex
ifeq ($(OS_ARCH), WINNT)
$(GENEXPORTS) Win32 Standard $< $(GENEXPARGS) > $@
else
ifeq ($(OS_ARCH), OS2)
echo LIBRARY $(LDAP_LIBNAME) INITINSTANCE TERMINSTANCE > $@
echo PROTMODE >> $@
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
echo EXPORTS >> $@
$(GENEXPORTS) $(OS_ARCH) Standard $< $(GENEXPARGS) >> $@
else
$(GENEXPORTS) $(OS_ARCH) Standard $< $(GENEXPARGS) > $@
endif
endif
endif # USE_DLL_EXPORTS_FILE
versiont.c: Makefile.client Version.c
@ -253,18 +267,7 @@ ltest:: $(LIBLDAP) test.o
$(LIBDIR):
$(MKDIR) $(LIBDIR)
ifeq ($(OS_ARCH),OS2)
DEF_FILE = $(LDAP_LIBNAME).def
$(DEF_FILE):
echo LIBRARY $(LDAP_LIBNAME) INITINSTANCE TERMINSTANCE > $@
echo PROTMODE >> $@
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
echo EXPORTS >> $@
$(FILTER) $(OBJS) >> $@
endif
$(LIBLDAP): $(OBJS) $(LIBDIR) $(LDAP_EXPORT_DEFS) $(DEF_FILE)
$(LIBLDAP): $(OBJS) $(LIBDIR) $(LDAP_EXPORT_DEFS)
@echo ======= making $(LIBLDAP)
ifdef SO_FILES_TO_REMOVE
-$(RM) $(SO_FILES_TO_REMOVE)
@ -275,13 +278,13 @@ else
ifeq ($(OS_ARCH),OS2)
# create import library for OS/2
rm -f $@
$(IMPLIB) $@ $(DEF_FILE)
$(IMPLIB) $@ $(LDAP_EXPORT_DEFS)
else
$(LINK_LIB) $(EXTRA_LIBS)
endif
endif
$(DLLLDAP): $(OBJS) $(LIBDIR) $(LDAP_EXPORT_DEFS) $(DEF_FILE)
$(DLLLDAP): $(OBJS) $(LIBDIR) $(LDAP_EXPORT_DEFS)
@echo ======= making $(DLLLDAP)
ifdef SO_FILES_TO_REMOVE
-$(RM) $(SO_FILES_TO_REMOVE)
@ -295,7 +298,7 @@ ifeq ($(OS_ARCH), OpenVMS)
fi
@touch no-such-file.vms; rm -f no-such-file.vms $(SUB_LOBJS)
endif
$(LINK_DLL) $(LDAP_EXPORT_FLAGS) $(EXTRA_LIBS) $(DEF_FILE)
$(LINK_DLL) $(LDAP_EXPORT_FLAGS) $(EXTRA_LIBS)
veryclean:: clean

Просмотреть файл

@ -79,9 +79,14 @@ endif
# variable definitions for exported symbols
ifeq ($(OS_ARCH), WINNT)
PRLDAP_EXPORT_DEFS= $(srcdir)/../msdos/winsock/nsldappr32.def
else
ifeq ($(OS_ARCH), OS2)
PRLDAP_EXPORT_DEFS= $(OBJDIR_NAME)/libprldap.def
else
PRLDAP_EXPORT_DEFS= $(OBJDIR_NAME)/libprldap.exp
endif
GARBAGE += $(LDAP_EXPORT_DEFS)
endif
PRLDAP_EXPORT_FLAGS=$(addprefix $(DLLEXPORTS_PREFIX), $(PRLDAP_EXPORT_DEFS))
@ -153,13 +158,24 @@ OBJDEST = $(OBJDIR_NAME)
###########################################################################
ifeq ($(USE_DLL_EXPORTS_FILE), 1)
# recursive gmake rule to create exported symbols file
$(OBJDIR_NAME)/libprldap.exp:: libprldap.ex
$(PRLDAP_EXPORT_DEFS):: libprldap.ex
ifeq ($(OS_ARCH), WINNT)
$(GENEXPORTS) Win32 Standard $< $(GENEXPARGS) > $@
else
ifeq ($(OS_ARCH), OS2)
echo LIBRARY $(PRLDAP_LIBNAME) INITINSTANCE TERMINSTANCE > $@
echo PROTMODE >> $@
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
echo EXPORTS >> $@
$(GENEXPORTS) $(OS_ARCH) Standard $< $(GENEXPARGS) >> $@
else
$(GENEXPORTS) $(OS_ARCH) Standard $< $(GENEXPARGS) > $@
endif
endif
endif # USE_DLL_EXPORTS_FILE
versiont.c: Makefile.client Version.c
@$(RM) $@
@ -174,18 +190,7 @@ export:: $(OBJDEST) $(LIBDIR) $(OBJS) $(DLLPRLDAP)
$(LIBDIR):
$(MKDIR) $(LIBDIR)
ifeq ($(OS_ARCH),OS2)
DEF_FILE = $(PRLDAP_LIBNAME).def
$(DEF_FILE):
echo LIBRARY $(PRLDAP_LIBNAME) INITINSTANCE TERMINSTANCE > $@
echo PROTMODE >> $@
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
echo EXPORTS >> $@
$(FILTER) $(OBJS) >> $@
endif
$(LIBPRLDAP): $(OBJS) $(LIBDIR) $(PRLDAP_EXPORT_DEFS) $(DEF_FILE)
$(LIBPRLDAP): $(OBJS) $(LIBDIR) $(PRLDAP_EXPORT_DEFS)
@echo ======= making $(LIBPRLDAP)
ifdef SO_FILES_TO_REMOVE
-$(RM) $(SO_FILES_TO_REMOVE)
@ -193,12 +198,12 @@ endif
ifeq ($(OS_ARCH),OS2)
# create import library for OS/2
rm -f $@
$(IMPLIB) $@ $(DEF_FILE)
$(IMPLIB) $@ $(PRLDAP_EXPORT_DEFS)
else
$(LINK_LIB) $(EXTRA_LIBS)
endif
$(DLLPRLDAP): $(OBJS) $(LIBDIR) $(PRLDAP_EXPORT_DEFS) $(DEF_FILE)
$(DLLPRLDAP): $(OBJS) $(LIBDIR) $(PRLDAP_EXPORT_DEFS)
@echo ======= making $(DLLPRLDAP)
ifdef SO_FILES_TO_REMOVE
-$(RM) $(SO_FILES_TO_REMOVE)
@ -209,7 +214,7 @@ ifeq ($(OS_ARCH), OpenVMS)
create_opt_uni $(OBJS); \
fi
endif
$(LINK_DLL) $(PRLDAP_EXPORT_FLAGS) $(EXTRA_LIBS) $(DEF_FILE)
$(LINK_DLL) $(PRLDAP_EXPORT_FLAGS) $(EXTRA_LIBS)
veryclean:: clean