Bug 214728

Summary: Cleaning up obsolete macros in the build
Product: [Retired] 389 Reporter: Noriko Hosoi <nhosoi>
Component: UnknownAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0.2CC: nkinder, rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 16:36:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 152373, 240316, 427409    
Attachments:
Description Flags
email discussion
none
cvs diffs
none
cvs diffs (makefiles containing NS_DS)
none
cvs diffs (source code containing NET_SSL)
none
cvs diffs (makefiles containing NET_SSL)
none
cvs diffs (source code containing UPGRADEDB)
none
cvs diff (makefiles congaining UPGRADEDB)
none
cvs diffs (source code containing NSPR20)
none
cvs diffs (makefiles containing NSPR20)
none
cvs diffs (source code containing LDAPDB_THREAD_SAFE)
none
cvs diff (makefile containing LDAPDB_THREAD_SAFE)
none
cvs diffs (source code containing CLIENT_AUTH)
none
cvs diff (makefile containing CLIENT_AUTH)
none
cvs diffs (source code containing MCC_HTTPD)
none
cvs diff (makefile containing MCC_HTTPD)
none
cvs diffs (source code containing NS_DOMESTIC)
none
cvs diffs (makefile containing NS_DOMESTIC)
none
cvs diffs (source code containing CYRUS_SASL and BUILD_GSSAPI)
none
cvs commit messages none

Description Noriko Hosoi 2006-11-09 01:05:50 UTC
Description of problem:
There are obsolete macros defined in Makefiles.

Comment 1 Noriko Hosoi 2006-11-09 01:05:50 UTC
Created attachment 140734 [details]
email discussion

Comment 2 Noriko Hosoi 2006-11-09 01:12:50 UTC
Created attachment 140735 [details]
cvs diffs

Files:
./include/nt/regparms.h
./ldap/clients/dsgw/dsgwutil.c
./ldap/servers/slapd/errormap.c
./ldap/servers/slapd/prerrstrs.h
./ldap/servers/slapd/secerrstrs.h
./ldap/servers/slapd/sslerrstrs.h
./lib/libsi18n/makstrdb.c

Changes:
1) eliminating a macro NS_DS
2) updating *errstrs.h (from NSS) based upon NSS_3_11_3_RTM.

Note: the following 2 files are not used in the server any more.
./include/nt/regparms.h
./ldap/clients/dsgw/dsgwutil.c

Comment 3 Noriko Hosoi 2006-11-09 01:35:43 UTC
Created attachment 140736 [details]
cvs diffs (makefiles containing NS_DS)

Files:
./Makefile.am
./nsconfig.mk
./ldap/servers/slapd/ntwdog/Makefile
./ldap/servers/slapd/ntperfdll/Makefile
./ldap/cm/newinstnt/Makefile

Changes:
eliminating NS_DS

Comment 4 Noriko Hosoi 2006-11-09 02:11:26 UTC
Created attachment 140738 [details]
cvs diffs (source code containing NET_SSL)

Files:
./httpd/src/ntnsapi.c
./ldap/admin/lib/dsalib_pw.c
./ldap/clients/dsgw/dsgw.h
./ldap/include/proto-ntutil.h
./ldap/libraries/libutil/ntstubs.c
./ldap/servers/plugins/pwdstorage/pwdstorage.h
./ldap/servers/plugins/pwdstorage/sha_pwd.c
./ldap/servers/plugins/pwdstorage/ssha_pwd.c
./ldap/servers/slapd/daemon.c
./ldap/servers/slapd/globals.c
./ldap/servers/slapd/libglobs.c
./ldap/servers/slapd/localhost.c
./ldap/servers/slapd/main.c
./ldap/servers/slapd/ntuserpin.c
./ldap/servers/slapd/plugin_internal_op.c
./ldap/servers/slapd/pw.c
./ldap/servers/slapd/result.c
./ldap/servers/slapd/slap.h
./ldap/servers/slapd/ssl.c
./lib/base/file.cpp

Changes:
eliminating NET_SSL macro

Comment 5 Noriko Hosoi 2006-11-09 02:13:41 UTC
Created attachment 140739 [details]
cvs diffs (makefiles containing NET_SSL)

Files:
Makefile.am
ldap/nsldap.mk
nsconfig.mk

Changes:
eliminating NET_SSL from makefiles

Comment 6 Noriko Hosoi 2006-11-09 18:50:11 UTC
Created attachment 140806 [details]
cvs diffs (source code containing UPGRADEDB)

Files:
./ldap/admin/src/create_instance.c
./ldap/servers/slapd/back-ldbm/dblayer.c
./ldap/servers/slapd/back-ldbm/import.c
./ldap/servers/slapd/back-ldbm/import.h
./ldap/servers/slapd/back-ldbm/import-threads.c
./ldap/servers/slapd/back-ldbm/init.c
./ldap/servers/slapd/back-ldbm/ldif2ldbm.c
./ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
./ldap/servers/slapd/back-ldbm/upgrade.c
./ldap/servers/slapd/main.c
./ldap/servers/slapd/pblock.c
./ldap/servers/slapd/protect_db.c
./ldap/servers/slapd/protect_db.h
./ldap/servers/slapd/slap.h
./ldap/servers/slapd/slapi-private.h
./ldap/servers/slapd/task.c

Changes:
eliminating macro UPGRADEDB from the source codes.

Comment 7 Noriko Hosoi 2006-11-09 18:56:42 UTC
Created attachment 140808 [details]
cvs diff (makefiles congaining UPGRADEDB)

File:
ldap/nsldap.mk

Changes:
eliminating macro UPGRADEDB from makefiles.

Comment 8 Noriko Hosoi 2006-11-09 19:32:30 UTC
Created attachment 140812 [details]
cvs diffs (source code containing NSPR20)

Files:
./include/libaccess/usrcache.h
./ldap/servers/slapd/detach.c
./ldap/servers/slapd/slapi2nspr.c
./lib/ldaputil/ldapdb.c
./lib/base/systhr.cpp
./lib/libaccess/aclerror.cpp
./lib/libaccess/authdb.cpp
./lib/libaccess/utest/ustubs.cpp

Changes:
eliminating macro NSPR20 from source codes.

Comment 9 Noriko Hosoi 2006-11-09 19:35:20 UTC
Created attachment 140814 [details]
cvs diffs (makefiles containing NSPR20)

Files:
please take a look at the diff file.

Changes:
eliminating macro NSPR20 from makefiles

Comment 10 Noriko Hosoi 2006-11-09 19:42:52 UTC
Created attachment 140816 [details]
cvs diffs (source code containing LDAPDB_THREAD_SAFE)

Files:
./include/ldaputil/ldapdb.h
./lib/ldaputil/ldapdb.c

Changes:
eliminating macro LDAPDB_THREAD_SAFE from source codes.

Comment 11 Noriko Hosoi 2006-11-09 19:44:50 UTC
Created attachment 140818 [details]
cvs diff (makefile containing LDAPDB_THREAD_SAFE)

File:
./lib/ldaputil/Makefile

Changes:
eliminating macro LDAPDB_THREAD_SAFE from makefiles

Comment 12 Noriko Hosoi 2006-11-09 21:27:48 UTC
Created attachment 140836 [details]
cvs diffs (source code containing CLIENT_AUTH)

Files:
./include/libaccess/nsautherr.h
./include/libaccess/nsauth.h

Changes:
eliminating macro CLIENT_AUTH from source codes.

Comment 13 Noriko Hosoi 2006-11-09 21:29:13 UTC
Created attachment 140837 [details]
cvs diff (makefile containing CLIENT_AUTH)

File:
./nsconfig.mk

Changes:
eliminating macro CLIENT_AUTH from nsconfig.mk.

Comment 14 Noriko Hosoi 2006-11-09 21:50:42 UTC
Created attachment 140841 [details]
cvs diffs (source code containing MCC_HTTPD)

Files:
./include/base/systems.h
./ldap/clients/dsgw/Versiongw.c
./lib/base/system.cpp

Changes:
eliminating macro MCC_HTTPD from the source codes.

Comment 15 Noriko Hosoi 2006-11-09 21:54:11 UTC
Created attachment 140843 [details]
cvs diff (makefile containing MCC_HTTPD)

File:
./nsconfig.mk

Changes:
eliminating macro MCC_HTTPD from makefiles

Comment 16 Noriko Hosoi 2006-11-09 22:40:20 UTC
Created attachment 140850 [details]
cvs diffs (source code containing NS_DOMESTIC)

Files:
./ldap/servers/slapd/ssl.c

Changes:
eliminating NS_DOMESTIC from the source code.

Comment 17 Noriko Hosoi 2006-11-09 22:41:45 UTC
Created attachment 140851 [details]
cvs diffs (makefile containing NS_DOMESTIC)

Files:
./nsconfig.mk

Changes:
eliminating NS_DOMESTIC from nsconfig.mk

Comment 18 Noriko Hosoi 2006-11-09 22:52:48 UTC
SPAPI:
I searched the macro from the source root containing all the dependent
platforms, and only nsconfig.mk in ldapserver, adminutil, and setuputil passes
it for nothing.  So, I think it's safe to remove it.
$ find . -name "*.[ch]" | xargs egrep SPAPI20
$ find . -name "*.cpp" | xargs egrep SPAPI20
$ find . -name "*.cc" | xargs egrep SPAPI20
$ find . -name "*.C" | xargs egrep SPAPI20
$ find . -name "*.java" | xargs egrep SPAPI20
$ find . -name "*.properties" | xargs egrep SPAPI20
$ find . -name "*.xml" | xargs egrep SPAPI20
$ find . -name "*.html" | xargs egrep SPAPI20
$ find . -name "*.mk" | xargs egrep SPAPI20
./adminserver/nsconfig.mk:MCC_SERVER += -DSPAPI20 -DBUILD_NUM=$(GET_BUILD_NUM)
./ldapserver/nsconfig.mk:MCC_SERVER += -DSPAPI20 -DBUILD_NUM=$(GET_BUILD_NUM)
./setuputil/nsconfig.mk:MCC_SERVER += -DSPAPI20 -DBUILD_NUM=$(GET_BUILD_NUM)

Comment 19 Noriko Hosoi 2006-11-09 22:53:58 UTC
(In reply to comment #18)
> SPAPI:
> I searched the macro from the source root containing all the dependent
> platforms, and only nsconfig.mk in ldapserver, adminutil, and setuputil passes
> it for nothing.  So, I think it's safe to remove it.

That is, we could remove it from adminutil and setuputil's nsconfig.mk, as well.

Comment 20 Noriko Hosoi 2006-11-09 23:00:47 UTC
(In reply to comment #18)
> SPAPI:
> I searched the macro from the source root containing all the dependent
> platforms, 

Oops.  "s/platforms/components/"

Comment 21 Noriko Hosoi 2006-11-09 23:03:57 UTC
SERVER_BUILD:
I searched the macro from the source root containing all the dependent
components, and only NSS secinit.c refers the macro.  And nsconfig.mk in
adminutil, adminserver, ldapserver, and setuputil as well as config/*.mk in
ldapsearch define the macro, which is not used in the build.  So, I think it's
safe to remove it from ldapserver, adminutil, adminserver, and setuputil.

$ find . -name "*.[ch]" | xargs egrep SERVER_BUILD
./mozilla/security/nss/lib/util/secinit.c:#if !defined(SERVER_BUILD)
$ find . -name "*.cpp" | xargs egrep SERVER_BUILD
$ find . -name "*.cc" | xargs egrep SERVER_BUILD
$ find . -name "*.C" | xargs egrep SERVER_BUILD
$ find . -name "*.xml" | xargs egrep SERVER_BUILD
$ find . -name "*.html" | xargs egrep SERVER_BUILD
$ find . -name "*.java" | xargs egrep SERVER_BUILD
$ find . -name "*.properties" | xargs egrep SERVER_BUILD
$ find . -name "Makefile" | xargs egrep SERVER_BUILD
$ find . -name "*.mk" | xargs egrep SERVER_BUILD
./adminutil/nsconfig.mk:NSDEFS=SERVER_BUILD=1 XCFLAGS=$(MCL_CFLAGS)
USE_PTHREADS=$(USE_PTHREADS) \
./adminutil/nsconfig.mk:NSPR_DEFINES = -DSERVER_BUILD
USE_PTHREADS=$(USE_PTHREADS) \
./adminserver/nsconfig.mk:NSDEFS=SERVER_BUILD=1 XCFLAGS=$(MCL_CFLAGS)
USE_PTHREADS=$(USE_PTHREADS) \
./adminserver/nsconfig.mk:NSPR_DEFINES = -DSERVER_BUILD
./ldapserver/config/Linux2.4.mk:ifdef SERVER_BUILD
./ldapserver/config/Linux2.6.mk:ifdef SERVER_BUILD
./ldapserver/config/WINNT5.0.mk:ifeq ($(SERVER_BUILD), 1)
./ldapserver/config/WINNT5.0.mk:OS_CFLAGS += -DSERVER_BUILD
./ldapserver/config/WINNT5.0.mk:OS_DEFS= SERVER_BUILD=$(SERVER_BUILD)
NSPR_VERSION=$(VERSION) NS_PRODUCT=$(NS_PRODUCT)
./ldapserver/config/SunOS5.mk:ifeq ($(SERVER_BUILD),1)
./ldapserver/config/HP-UX.mk:ifdef SERVER_BUILD
./ldapserver/config/config.mk:ifndef SERVER_BUILD
./ldapserver/config/config.mk:DEFINES += -DSERVER_BUILD
./ldapserver/nsconfig.mk:NSDEFS=SERVER_BUILD=1 XCFLAGS=$(MCL_CFLAGS)
USE_PTHREADS=$(USE_PTHREADS) \
./ldapserver/nsconfig.mk:NSPR_DEFINES = -DSERVER_BUILD
./setuputil/nsconfig.mk:NSDEFS=SERVER_BUILD=1 XCFLAGS=$(MCL_CFLAGS)
USE_PTHREADS=$(USE_PTHREADS) \
./setuputil/nsconfig.mk:NSPR_DEFINES = -DSERVER_BUILD


Comment 22 Nathan Kinder 2006-11-09 23:59:17 UTC
The changes look good!  We should also remove CYRUS_SASL and BUILD_GSSAPI.  We
also need to remove these defines from Makefile.am and regenerate the build
files using autogen.sh.

Comment 23 Noriko Hosoi 2006-11-10 00:26:31 UTC
Created attachment 140856 [details]
cvs diffs (source code containing CYRUS_SASL and BUILD_GSSAPI)

(In reply to comment #22)
> The changes look good!  We should also remove CYRUS_SASL and BUILD_GSSAPI. 
We
> also need to remove these defines from Makefile.am and regenerate the build
> files using autogen.sh.

Good point!  I'm cleaning them up, too.

Files:
./ldap/servers/slapd/saslbind.c 
./ldap/servers/slapd/sasl_io.c

Changes:
eliminating macro CYRUS_SASL and BUILD_GSSAPI from the source codes.

Comment 24 Noriko Hosoi 2006-11-10 00:38:34 UTC
(In reply to comment #22)
> The changes look good!  We should also remove CYRUS_SASL and BUILD_GSSAPI.  We
> also need to remove these defines from Makefile.am and regenerate the build
> files using autogen.sh.

Right...  This is the diff for the Makefile.am...
Index: Makefile.am
===================================================================
RCS file: /cvs/dirsec/ldapserver/Makefile.am,v
retrieving revision 1.10
diff -t -w -U4 -r1.10 Makefile.am
--- Makefile.am 3 Nov 2006 22:33:15 -0000       1.10
+++ Makefile.am 10 Nov 2006 00:29:49 -0000
@@ -6,12 +6,9 @@
 #------------------------
 BUILDNUM := $(shell perl $(srcdir)/buildnum.pl)
 PLATFORM_DEFINES = @platform_defs@
 DEBUG_DEFINES = @debug_defs@
-DS_DEFINES = -DNS_DS -DNET_SSL -DLDAP_DEBUG -DLDAP_DONT_USE_SMARTHEAP \
-        -DUPGRADEDB -DNSPR20 -DLDAPDB_THREAD_SAFE -DCLIENT_AUTH \
-        -DMCC_HTTPD -DNS_DOMESTIC -DSPAPI20 -DSERVER_BUILD \
-        -DBUILD_NUM=$(BUILDNUM)
+DS_DEFINES = -DLDAP_DEBUG -DLDAP_DONT_USE_SMARTHEAP -DBUILD_NUM=$(BUILDNUM)
 DS_INCLUDES = -I$(srcdir)/ldap/include -I$(srcdir)/ldap/servers/slapd
-I$(srcdir)/include -I.
 AM_CPPFLAGS = $(PLATFORM_DEFINES) $(DEBUG_DEFINES) $(DS_DEFINES) $(DS_INCLUDES)
PLUGIN_CPPFLAGS = $(AM_CPPFLAGS) @ldapsdk_inc@ @nss_inc@ @nspr_inc@

And Makefile.in generated by autogen.sh is going to be checked in, as well.

Comment 25 Nathan Kinder 2006-11-10 00:42:08 UTC
The new changes look good!

Comment 26 Noriko Hosoi 2006-11-10 01:56:55 UTC
Created attachment 140858 [details]
cvs commit messages

Reviewed by Nathan.  (Thank you soooooo much!)

Checked in into HEAD.

Comment 27 Noriko Hosoi 2007-11-29 22:32:44 UTC
Checked source tree:
$ pwd
/share/dev4/ds/ds80/builds/20071129.1/earthquake_rhel4/ldapserver

$ find . -name "*.[ch]" | xargs egrep "\<NS_DS\>" 
$ find . -name "*.[ch]" | xargs egrep "\<NET_SSL\>"
./ldap/servers/slapd/daemon.c:  /* Previously there was a ton of code #defined
on NET_SSL.
./ldap/servers/slapd/tools/ldaptool.h:#if defined(NET_SSL)
./ldap/servers/slapd/tools/ldaptool.h:#if defined(NET_SSL)
$ find . -name "*.[ch]" | xargs egrep "\<UPGRADEDB\>"
$ find . -name "*.[ch]" | xargs egrep "\<NSPR20\>"
./ldap/servers/slapd/slapi2nspr.c: * slapi2nspr.c - expose a subset of the
NSPR20/21 API to SLAPI plugin writers
$ find . -name "*.[ch]" | xargs egrep "\<LDAPDB_THREAD_SAFE\>"
$ find . -name "*.[ch]" | xargs egrep "\<CLIENT_AUTH\>"
$ find . -name "*.[ch]" | xargs egrep "\<MCC_HTTPD\>"
$ find . -name "*.[ch]" | xargs egrep "\<NS_DOMESTIC\>"
$ find . -name "*.[ch]" | xargs egrep "\<SPAPI20\>"
$ find . -name "*.[ch]" | xargs egrep "\<CYRUS_SASL\>"
$ find . -name "*.[ch]" | xargs egrep "\<BUILD_GSSAPI\>"

tools/libtool.h is only used by ldclt.  We'd better clean it up, but it's harmless.

Verified.