From: Greg Hudson Date: Fri, 4 Nov 2011 18:39:35 +0000 (+0000) Subject: Get rid of fake-install X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bc47e3eeb7a046a80faf9ba9ea4ccedf111e33a7;p=krb5.git Get rid of fake-install Instead, use $(BUILDTOP)/plugins as the plugin base for tests. For each real plugin module, create a link in the parent directory if we're doing a shared-library build--so built KDB modules can be found in plugins/kdb, preauth modules in plugins/preauth, etc.. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25436 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/Makefile.in b/src/Makefile.in index acd27baf0..5b2d525ce 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -80,27 +80,12 @@ install-headers-prerecurse: install-headers-mkdirs # install:: # $(MAKE) $(MFLAGS) install.man -fake-install: runenv.py - $(RM) -r $(FAKEPREFIX) - @for i in $(INSTALLMKDIRS); do \ - $(srcdir)/config/mkinstalldirs util/fakedest$$i; \ - done - (w=`pwd`; cd util && $(MAKE) install DESTDIR="$$w/util/fakedest") - (w=`pwd`; cd lib && $(MAKE) install DESTDIR="$$w/util/fakedest") - (w=`pwd`; cd plugins/kdb/db2 && $(MAKE) install DESTDIR="$$w/util/fakedest") - if test -r plugins/preauth/pkinit/Makefile; then \ - (w=`pwd`; cd plugins/preauth/pkinit && $(MAKE) install DESTDIR="$$w/util/fakedest"); \ - fi - -# (w=`pwd`; cd plugins/locate/python && $(MAKE) install DESTDIR="$$w/util/fakedest") - TAGS: $(SRCS) etags $(SRCS) clean-:: clean-windows clean-unix:: $(RM) *.o core krb5-config - $(RM) -r util/fakedest mostlyclean: clean @@ -589,12 +574,12 @@ krb5-config: $(srcdir)/krb5-config.in config.status # $(PURE) or $(LDFLAGS) in case someone changes config/shlib.conf check-unix:: krb5-config $(SHELL) $(srcdir)/t_krbconf -check-prerecurse: fake-install +check-prerecurse: runenv.py # Create a test realm and spawn a shell in an environment pointing to it. # If CROSSNUM is set, create that many fully connected test realms and # point the shell at the first one. -testrealm: fake-install +testrealm: runenv.py PYTHONPATH=$(top_srcdir)/util $(PYTHON) $(srcdir)/util/testrealm.py \ $(CROSSNUM) diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 68ef439d7..7e635c831 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -1163,7 +1163,7 @@ else esac OBJLISTS="OBJS.SH" PLUGIN='$(LIBBASE)$(DYNOBJEXT)' - PLUGINLINK= + PLUGINLINK='../$(PLUGIN)' PLUGININST=install-plugin KDB5_PLUGIN_DEPLIBS= KDB5_PLUGIN_LIBS= diff --git a/src/config/libnover.in b/src/config/libnover.in index 458bccc3a..4214aedf8 100644 --- a/src/config/libnover.in +++ b/src/config/libnover.in @@ -91,10 +91,19 @@ libkrb5_$(LIBBASE)$(PFLIBEXT): $(PFOBJLISTS) set -x; objlist=`$(PARSE_OBJLISTS) $(PFOBJLISTS)` && $(AR) cq $@ $$objlist $(RANLIB) $@ +# For static builds, we make a symlink in the main library directory, +# allowing the plugin library to be a dependency of the core libraries +# which use it. $(TOPLIBD)/libkrb5_$(LIBBASE)$(STLIBEXT): $(RM) $@ (cd $(TOPLIBD) && $(LN_S) $(RELDIR)/libkrb5_$(LIBBASE)$(STLIBEXT) .) +# For shared builds, we make a symlink in the parent directory, allowing +# tests to point plugin_base_dir at $(BUILDTOP)/plugins. +../$(LIBBASE)$(DYNOBJEXT): + $(RM) $@ + (cd .. && $(LN_S) `basename $(mydir)`/$(LIBBASE)$(DYNOBJEXT) .) + all-liblinks: all-libs $(PLUGINLINK) all-libs: $(PLUGIN) @@ -102,6 +111,9 @@ clean-libs: $(RM) $(LIBBASE)$(DYNOBJEXT) $(RM) binutils.versions osf1.exports darwin.exports hpux10.exports +clean-liblinks: + $(RM) $(PLUGINLINK) + install-libs: $(PLUGININST) install-static: $(RM) $(DESTDIR)$(KRB5_LIBDIR)/libkrb5_$(LIBBASE)$(STLIBEXT) diff --git a/src/config/pre.in b/src/config/pre.in index 060aa8987..c40895ef9 100644 --- a/src/config/pre.in +++ b/src/config/pre.in @@ -142,10 +142,6 @@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ CONFIG_RELTOPDIR = @CONFIG_RELTOPDIR@ -FAKEDEST=$(BUILDTOP)/util/fakedest -FAKEPREFIX=$(FAKEDEST)/$(prefix) -FAKELIBDIR=$(FAKEPREFIX)/lib - # DEFS set by configure # DEFINES set by local Makefile.in # LOCALINCLUDES set by local Makefile.in diff --git a/src/config/shlib.conf b/src/config/shlib.conf index dd21126e1..3555a3e39 100644 --- a/src/config/shlib.conf +++ b/src/config/shlib.conf @@ -97,7 +97,7 @@ alpha*-dec-osf*) # _RLD_ROOT hack needed to repoint "root" directory for purposes # of searching for shared libs, since RPATHs take precedence over # LD_LIBRARY_PATH. - RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`$${LD_LIBRARY_PATH+:$$LD_LIBRARY_PATH}; export LD_LIBRARY_PATH; _RLD_ROOT=$(FAKEDEST):$${_RLD_ROOT+$$_RLD_ROOT}$${_RLD_ROOT-/}; export _RLD_ROOT;' + RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`$${LD_LIBRARY_PATH+:$$LD_LIBRARY_PATH}; export LD_LIBRARY_PATH; _RLD_ROOT=$${_RLD_ROOT+$$_RLD_ROOT}$${_RLD_ROOT-/}; export _RLD_ROOT;' RUN_VARS='LD_LIBRARY_PATH _RLD_ROOT' ;; @@ -189,7 +189,7 @@ mips-sgi-irix6.3) # This is a Kludge; see below RUN_ENV= for i in N32 64 ''; do RUN_ENV="${RUN_ENV+ $RUN_ENV}LD_LIBRARY${i}_PATH=$add\$\${LD_LIBRARY${i}_PATH+:\$\$LD_LIBRARY${i}_PATH}; export LD_LIBRARY${i}_PATH;" - RUN_ENV="${RUN_ENV} _RLD${i}_ROOT=\$(FAKEDEST):\$\${_RLD${i}_ROOT+\$\${_RLD${i}_ROOT}}\$\${_RLD${i}_ROOT-/}; export _RLD${i}_ROOT;" + RUN_ENV="${RUN_ENV} _RLD${i}_ROOT=\$\${_RLD${i}_ROOT+\$\${_RLD${i}_ROOT}}\$\${_RLD${i}_ROOT-/}; export _RLD${i}_ROOT;" RUN_VARS="$RUN_VARS LD_LIBRARY${i}_PATH _RLD${i}_ROOT" done ;; @@ -238,7 +238,7 @@ mips-sgi-irix*) RUN_ENV= for i in N32 64 ''; do RUN_ENV="${RUN_ENV+ $RUN_ENV}LD_LIBRARY${i}_PATH=$add\$\${LD_LIBRARY${i}_PATH+:\$\$LD_LIBRARY${i}_PATH}; export LD_LIBRARY${i}_PATH;" - RUN_ENV="${RUN_ENV} _RLD${i}_ROOT=\$(FAKEDEST):\$\${_RLD${i}_ROOT+\$\${_RLD${i}_ROOT}}\$\${_RLD${i}_ROOT-/}; export _RLD${i}_ROOT;" + RUN_ENV="${RUN_ENV} _RLD${i}_ROOT=\$\${_RLD${i}_ROOT+\$\${_RLD${i}_ROOT}}\$\${_RLD${i}_ROOT-/}; export _RLD${i}_ROOT;" RUN_VARS="$RUN_VARS LD_LIBRARY${i}_PATH _RLD${i}_ROOT" done ;; diff --git a/src/kadmin/testing/scripts/env-setup.shin b/src/kadmin/testing/scripts/env-setup.shin index 9511cec1d..bee5b5482 100755 --- a/src/kadmin/testing/scripts/env-setup.shin +++ b/src/kadmin/testing/scripts/env-setup.shin @@ -26,8 +26,6 @@ PROG_LIBPATH=-L@RBUILD@/lib BUILDTOP=@RBUILD@ # XXX kludge! PROG_RPATH=@RBUILD@/lib -# XXX more kludge! -FAKEDEST=@RBUILD@/util/fakedest # This converts $(TOPLIBD) to $TOPLIBD cat > /tmp/env_setup$$ <<\EOF @KRB5_RUN_ENV@ diff --git a/src/kadmin/testing/scripts/init_db b/src/kadmin/testing/scripts/init_db index 2ff820818..5cf749109 100755 --- a/src/kadmin/testing/scripts/init_db +++ b/src/kadmin/testing/scripts/init_db @@ -27,7 +27,7 @@ IROOT=$TOP/.. ADMIN=$TOP/dbutil BIN=$IROOT/bin ETC=$IROOT/etc -MODDIR=$TOP/../util/fakedest$libdir/krb5/plugins/kdb +MODDIR=$TOP/../plugins/kdb SBIN=$TOP/keytab:$TOP/server DUMMY=${REALM=SECURE-TEST.OV.COM}; export REALM diff --git a/src/kadmin/testing/scripts/start_servers b/src/kadmin/testing/scripts/start_servers index 80cf8d6f4..f32861884 100755 --- a/src/kadmin/testing/scripts/start_servers +++ b/src/kadmin/testing/scripts/start_servers @@ -39,7 +39,7 @@ if [ $local = 0 ]; then sed -e "s/__REALM__/$REALM/g" -e "s#__K5ROOT__#$K5ROOT#g" \ -e "s/__KDCHOST__/$hostname/g" \ -e "s/__LOCALHOST__/$localname/g" \ - -e "s#__MODDIR__#$TOP/../util/fakedest$libdir/db-modules#g"\ + -e "s#__MODDIR__#$TOP/../plugins/kdb#g"\ < $STESTDIR/proto/krb5.conf.proto > $K5ROOT/krb5.conf # Using /usr/ucb/rsh and getting rid of "-k $REALM" until we get diff --git a/src/plugins/authdata/greet/Makefile.in b/src/plugins/authdata/greet/Makefile.in index 6e3c0282e..ce70925cf 100644 --- a/src/plugins/authdata/greet/Makefile.in +++ b/src/plugins/authdata/greet/Makefile.in @@ -25,7 +25,7 @@ STLIBOBJS= greet_auth.o SRCS= greet_auth.c -all-unix:: all-liblinks +all-unix:: all-libs install-unix:: install-libs clean-unix:: clean-libs clean-libobjs diff --git a/src/plugins/authdata/greet_client/Makefile.in b/src/plugins/authdata/greet_client/Makefile.in index 82b10ff07..74e4bf42a 100644 --- a/src/plugins/authdata/greet_client/Makefile.in +++ b/src/plugins/authdata/greet_client/Makefile.in @@ -24,7 +24,7 @@ STLIBOBJS= greet.o SRCS= greet.c -all-unix:: all-liblinks +all-unix:: all-libs install-unix:: install-libs clean-unix:: clean-libs clean-libobjs diff --git a/src/plugins/authdata/greet_server/Makefile.in b/src/plugins/authdata/greet_server/Makefile.in index 54ffe67dc..40b1856bb 100644 --- a/src/plugins/authdata/greet_server/Makefile.in +++ b/src/plugins/authdata/greet_server/Makefile.in @@ -24,7 +24,7 @@ STLIBOBJS= greet_auth.o SRCS= greet_auth.c -all-unix:: all-liblinks +all-unix:: all-libs install-unix:: install-libs clean-unix:: clean-libs clean-libobjs diff --git a/src/plugins/kadm5_hook/test/Makefile.in b/src/plugins/kadm5_hook/test/Makefile.in index 0b2a2ef31..17ca24204 100644 --- a/src/plugins/kadm5_hook/test/Makefile.in +++ b/src/plugins/kadm5_hook/test/Makefile.in @@ -26,7 +26,7 @@ STLIBOBJS=main.o SRCS= $(srcdir)/main.c -all-unix:: all-liblinks +all-unix:: all-libs install-unix:: clean-unix:: clean-libs clean-libobjs diff --git a/src/plugins/kdb/db2/Makefile.in b/src/plugins/kdb/db2/Makefile.in index 182d80208..ef1955942 100644 --- a/src/plugins/kdb/db2/Makefile.in +++ b/src/plugins/kdb/db2/Makefile.in @@ -70,7 +70,7 @@ STLIBOBJS= \ all-unix:: all-liblinks install-unix:: install-libs -clean-unix:: clean-libs clean-libobjs +clean-unix:: clean-liblinks clean-libs clean-libobjs $(DB_DEPS) $(DBOBJLISTS-k5) $(DBSHOBJLISTS): all-recurse diff --git a/src/plugins/kdb/hdb/Makefile.in b/src/plugins/kdb/hdb/Makefile.in index 03e1e9902..12ec6fd6a 100644 --- a/src/plugins/kdb/hdb/Makefile.in +++ b/src/plugins/kdb/hdb/Makefile.in @@ -41,7 +41,7 @@ STLIBOBJS= \ all-unix:: all-liblinks install-unix:: install-libs -clean-unix:: clean-libs clean-libobjs +clean-unix:: clean-liblinks clean-libs clean-libobjs $(DB_DEPS) $(DBOBJLISTS-k5) $(DBSHOBJLISTS): all-recurse diff --git a/src/plugins/kdb/ldap/Makefile.in b/src/plugins/kdb/ldap/Makefile.in index dffb60f47..8c2121305 100644 --- a/src/plugins/kdb/ldap/Makefile.in +++ b/src/plugins/kdb/ldap/Makefile.in @@ -36,7 +36,7 @@ STLIBOBJS= ldap_exp.o all-unix:: all-liblinks install-unix:: install-libs -clean-unix:: clean-libs clean-libobjs +clean-unix:: clean-liblinks clean-libs clean-libobjs @libnover_frag@ @libobj_frag@ diff --git a/src/plugins/locate/python/Makefile.in b/src/plugins/locate/python/Makefile.in index 4ac0232e9..5b5484026 100644 --- a/src/plugins/locate/python/Makefile.in +++ b/src/plugins/locate/python/Makefile.in @@ -21,7 +21,7 @@ STLIBOBJS= py-locate.o all-unix:: all-liblinks install-unix:: install-libs -clean-unix:: clean-libs clean-libobjs +clean-unix:: clean-liblinks clean-libs clean-libobjs @libnover_frag@ @libobj_frag@ diff --git a/src/plugins/preauth/pkinit/Makefile.in b/src/plugins/preauth/pkinit/Makefile.in index 05a67946f..1acb83e89 100644 --- a/src/plugins/preauth/pkinit/Makefile.in +++ b/src/plugins/preauth/pkinit/Makefile.in @@ -50,7 +50,7 @@ SRCS= \ all-unix:: all-liblinks install-unix:: install-libs -clean-unix:: clean-libs clean-libobjs +clean-unix:: clean-liblinks clean-libs clean-libobjs clean:: $(RM) lib$(LIBBASE)$(SO_EXT) diff --git a/src/plugins/preauth/securid_sam2/Makefile.in b/src/plugins/preauth/securid_sam2/Makefile.in index 642897c9e..860b473eb 100644 --- a/src/plugins/preauth/securid_sam2/Makefile.in +++ b/src/plugins/preauth/securid_sam2/Makefile.in @@ -28,7 +28,7 @@ STLIBOBJS=securid_sam2_main.o securid2.o SRCS= $(srcdir)/securid_sam2_main.c $(srcdir)/securid2.c 2 -all-unix:: all-liblinks +all-unix:: all-libs install-unix:: install-libs clean-unix:: clean-libs clean-libobjs diff --git a/src/tests/Makefile.in b/src/tests/Makefile.in index 01d70fb25..6ce8f0f16 100644 --- a/src/tests/Makefile.in +++ b/src/tests/Makefile.in @@ -30,7 +30,7 @@ kdc.conf: Makefile krb5.conf: Makefile cat $(top_srcdir)/config-files/krb5.conf > krb5.new echo "[dbmodules]" >> krb5.new - echo " db_module_dir = `pwd`/../util/fakedest$(KRB5_DB_MODULE_DIR)" >> krb5.new + echo " db_module_dir = `pwd`/../plugins/kdb" >> krb5.new mv krb5.new krb5.conf kdb_check: kdc.conf krb5.conf diff --git a/src/tests/dejagnu/Makefile.in b/src/tests/dejagnu/Makefile.in index ffdfbd617..6794a91d6 100644 --- a/src/tests/dejagnu/Makefile.in +++ b/src/tests/dejagnu/Makefile.in @@ -40,7 +40,5 @@ runenv.vals: Makefile site.exp: runenv.vals Makefile echo "set runvarlist [list `cat runenv.vals | tr '\n' ' '`]" | \ sed -e 's%=\.%='`pwd`'/.%g' > site.exp - echo "set KRB5_DB_MODULE_DIR {$(KRB5_DB_MODULE_DIR)}" >> site.exp - echo "set MODULE_DIR {$(MODULE_DIR)}" >> site.exp echo "set PRIOCNTL_HACK @PRIOCNTL_HACK@" >> site.exp diff --git a/src/tests/dejagnu/config/default.exp b/src/tests/dejagnu/config/default.exp index 796ea3716..8ab4b7902 100644 --- a/src/tests/dejagnu/config/default.exp +++ b/src/tests/dejagnu/config/default.exp @@ -911,8 +911,6 @@ proc setup_krb5_conf { {type client} } { global allow_weak_crypto global mode global portbase - global KRB5_DB_MODULE_DIR - global MODULE_DIR global srcdir set pkinit_certs [findfile "[pwd]/$srcdir/pkinit-certs" "[pwd]/$srcdir/pkinit-certs" "$srcdir/pkinit-certs"] @@ -944,7 +942,7 @@ proc setup_krb5_conf { {type client} } { if { $mode == "tcp" } { puts $conffile " udp_preference_limit = 1" } - puts $conffile " plugin_base_dir = $tmppwd/../../../util/fakedest$MODULE_DIR" + puts $conffile " plugin_base_dir = $tmppwd/../../../plugins" puts $conffile "" puts $conffile "\[realms\]" puts $conffile " $REALMNAME = \{" @@ -973,7 +971,7 @@ proc setup_krb5_conf { {type client} } { puts $conffile " default = FILE:$tmppwd/others.log" puts $conffile "" puts $conffile "\[dbmodules\]" - puts $conffile " db_module_dir = $tmppwd/../../../util/fakedest$KRB5_DB_MODULE_DIR" + puts $conffile " db_module_dir = $tmppwd/../../../plugins/kdb" puts $conffile " foo_db2 = {" puts $conffile " db_library = db2" puts $conffile " database_name = $tmppwd/$type-db" diff --git a/src/tests/dejagnu/krb-standalone/standalone.exp b/src/tests/dejagnu/krb-standalone/standalone.exp index 03a5d52e0..5b5970fba 100644 --- a/src/tests/dejagnu/krb-standalone/standalone.exp +++ b/src/tests/dejagnu/krb-standalone/standalone.exp @@ -139,7 +139,6 @@ proc doit { } { global portbase global mode global tmppwd - global MODULE_DIR setup_kerberos_env kdc @@ -235,7 +234,7 @@ proc doit { } { } # If we have anonymous then test it - if [file exists "$tmppwd/../../../util/fakedest$MODULE_DIR/preauth/pkinit.so" ] { + if [file exists "$tmppwd/../../../plugins/preauth/pkinit.so" ] { kinit_anonymous "WELLKNOWN/ANONYMOUS" } diff --git a/src/tests/mkeystash_compat/Makefile.in b/src/tests/mkeystash_compat/Makefile.in index 5c53d9e8a..30a8255a4 100644 --- a/src/tests/mkeystash_compat/Makefile.in +++ b/src/tests/mkeystash_compat/Makefile.in @@ -32,7 +32,7 @@ kdc.conf: Makefile krb5.conf: Makefile cat $(top_srcdir)/config-files/krb5.conf > krb5.new echo "[dbmodules]" >> krb5.new - echo " db_module_dir = $(BUILDTOP)/util/fakedest$(KRB5_DB_MODULE_DIR)" >> krb5.new + echo " db_module_dir = $(BUILDTOP)/plugins/kdb" >> krb5.new mv krb5.new krb5.conf # Verify that the mkey stash code is backward compat with old/non-keytab stashfile format diff --git a/src/util/Makefile.in b/src/util/Makefile.in index c791c0626..f45bc7082 100644 --- a/src/util/Makefile.in +++ b/src/util/Makefile.in @@ -19,9 +19,6 @@ MAYBE_VERTO_k5 = verto k5ev all-recurse: -clean-unix:: - $(RM) -r $(FAKEPREFIX) - NO_OUTDIR=1 install:: diff --git a/src/util/k5test.py b/src/util/k5test.py index 503085a31..09a66a90a 100644 --- a/src/util/k5test.py +++ b/src/util/k5test.py @@ -86,7 +86,7 @@ keyword arguments: - $testdir: The realm storage directory (absolute path) - $buildtop: The root of the build directory - $srctop: The root of the source directory - - $plugins: The plugin directory under $buildtop/util/fakedest + - $plugins: The plugin directory in the build tree - $hostname: The FQDN of the host - $port0: The first listener port (portbase) - ... @@ -171,7 +171,7 @@ Scripts may use the following functions and variables: * srctop: The top of the source directory (absolute path). -* plugins: The plugin directory under /util/fakedest. +* plugins: The plugin directory in the build tree (absolute path). * hostname: This machine's fully-qualified domain name. @@ -418,16 +418,6 @@ def _find_srctop(): return os.path.abspath(root) -def _find_plugins(): - global buildtop - fakeroot = os.path.join(buildtop, 'util', 'fakedest') - if not os.path.exists(fakeroot): - fail('You must run "make fake-install" in %s first.' % buildtop) - for dir, subdirs, files in os.walk(fakeroot): - if os.path.basename(dir) == 'plugins' and 'kdb' in subdirs: - return dir - fail('Cannot locate plugins; run "make fake-install" at %s.' % buildtop) - # Return the local hostname as it will be canonicalized by # krb5_sname_to_principal. We can't simply use socket.getfqdn() # because it explicitly prefers results containing periods and @@ -1145,7 +1135,7 @@ _outfile = open('testlog', 'w') _cmd_index = 1 buildtop = _find_buildtop() srctop = _find_srctop() -plugins = _find_plugins() +plugins = os.path.join(buildtop, 'plugins') _runenv = _import_runenv() hostname = _get_hostname() null_input = open(os.devnull, 'r')