From 8cdb52cb9598c2b029851f7ca97310a81e1bc6ad Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 20 Apr 2005 03:10:12 +0000 Subject: [PATCH] Compute reltopdir at autoconf time instead of at configure time. This has the happy side effect of stopping autoreconf from creating directories named "$ac_config_fragdir" all over the source tree. * aclocal.m4 (fileexists, K5_TOPDIR): New macros. (V5_SET_TOPDIR): Don't test for AC_LOCALDIR any more. Use K5_TOPDIR computed at autoconf time, but still verify that the contents are what we expect. Don't use shell variables in the argument to AC_CONFIG_AUX_DIR. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17184 dc483132-0cff-0310-8789-dd5450dbe970 --- src/ChangeLog | 8 ++++++++ src/aclocal.m4 | 45 +++++++++++++++++++++------------------------ 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index edd4b714c..d0573ef07 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2005-04-19 Ken Raeburn + + * aclocal.m4 (fileexists, K5_TOPDIR): New macros. + (V5_SET_TOPDIR): Don't test for AC_LOCALDIR any more. Use + K5_TOPDIR computed at autoconf time, but still verify that the + contents are what we expect. Don't use shell variables in the + argument to AC_CONFIG_AUX_DIR. + 2005-03-25 Ken Raeburn * configure.in: Don't check for getpwnam_r and getpwuid_r in the diff --git a/src/aclocal.m4 b/src/aclocal.m4 index afa8ed068..f0cedca41 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -1,5 +1,5 @@ AC_PREREQ(2.52) -AC_COPYRIGHT([Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +AC_COPYRIGHT([Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Massachusetts Institute of Technology. ]) dnl @@ -7,37 +7,34 @@ dnl Figure out the top of the source and build trees. We depend on localdir dnl being a relative pathname; we could make it general later, but for now dnl this is good enough. dnl +dnl esyscmd([test -r aclocal.m4 && echo YES]) +define([fileexists],[dnl +pushdef([x],esyscmd([if test -r $1; then echo YES;else echo NO; fi]))dnl +dnl Strip out newline. +ifelse(x,[YES +],[YES],x,[NO +],[NO],UNKNOWN)[]popdef([x])]) +define([K5_TOPDIR],dnl +ifelse(fileexists(./aclocal.m4),YES,[.],[dnl +ifelse(fileexists(../aclocal.m4),YES,[..],[dnl +ifelse(fileexists(../../aclocal.m4),YES,[../..],[dnl +ifelse(fileexists(../../../aclocal.m4),YES,[../../..],[dnl +ifelse(fileexists(../../../../aclocal.m4),YES,[../../../..],[dnl +errprint(__file__:__line__: Cannot find path to aclocal.m4[ +])m4exit(1)UNKNOWN])])])])])) +dnl AC_DEFUN(V5_SET_TOPDIR,[dnl -ifdef([AC_LOCALDIR], [dnl AC_LOCALDIR exists in 2.13, but not newer autoconfs. -ac_reltopdir=AC_LOCALDIR -case "$ac_reltopdir" in -/*) - echo "Configure script built with absolute localdir pathname" - exit 1 - ;; -"") - ac_reltopdir=. - ;; -esac -],[ -ac_reltopdir= -for x in . .. ../.. ../../.. ../../../..; do - if test "x$ac_reltopdir" = "x" -a -r "$srcdir/$x/aclocal.m4" ; then - ac_reltopdir=$x - fi -done -if test "x$ac_reltopdir" = "x"; then - echo "Configure could not determine the relative topdir" - exit 1 +ac_reltopdir="K5_TOPDIR" +if test ! -r "$srcdir/K5_TOPDIR/aclocal.m4"; then + AC_MSG_ERROR([Configure could not determine the relative topdir]) fi -]) ac_topdir=$srcdir/$ac_reltopdir ac_config_fragdir=$ac_reltopdir/config krb5_pre_in=$ac_config_fragdir/pre.in krb5_post_in=$ac_config_fragdir/post.in # echo "Looking for $srcdir/$ac_config_fragdir" if test -d "$srcdir/$ac_config_fragdir"; then - AC_CONFIG_AUX_DIR($ac_config_fragdir) + AC_CONFIG_AUX_DIR(K5_TOPDIR/config) else AC_MSG_ERROR([can not find config/ directory in $ac_reltopdir]) fi -- 2.26.2