Issue 551 - configure fails when CDPATH is set
Summary: configure fails when CDPATH is set
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-05-31 10:09 UTC by andreas.ley@rz.uni-karlsruhe.de
Modified: 2014-08-01 21:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description andreas.ley@rz.uni-karlsruhe.de 2000-05-31 10:09:23 UTC
Full_Name: Andreas Ley
Version: 1.2.10
OS: IRIX 6.2
URL: 
Submission from: (NULL) (129.13.64.65)


If the environment variable CDPATH is set, some operating systems print the
directory they changed to after executing a cd command.

openldap's configure script contains expressions like `cd $dir && pwd`
which in fact gives the directory twice, garbling some sed commands later.

One should change aclocal.m4 like this:

*** aclocal.m4.orig     Tue Jul 20 02:20:54 1999
--- aclocal.m4  Wed May 31 11:06:00 2000
***************
*** 35,41 ****
  VERSION=[$2]
  AC_SUBST(VERSION)
  dnl test to see if srcdir already configured
! if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status;
then
    AC_MSG_ERROR([source directory already configured; run "make distclean"
there first])
  fi
  ifelse([$3],,
--- 35,41 ----
  VERSION=[$2]
  AC_SUBST(VERSION)
  dnl test to see if srcdir already configured
! if test "`cd $srcdir >/dev/null && pwd`" != "`pwd`" && test -f
$srcdir/config.status; then
    AC_MSG_ERROR([source directory already configured; run "make distclean"
there first])
  fi
  ifelse([$3],,
***************
*** 44,50 ****
  AC_REQUIRE([AM_SANITY_CHECK])
  AC_REQUIRE([AC_ARG_PROGRAM])
  dnl FIXME This is truly gross.
! missing_dir=`cd $ac_aux_dir && pwd`
  AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
  AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
--- 44,50 ----
  AC_REQUIRE([AM_SANITY_CHECK])
  AC_REQUIRE([AC_ARG_PROGRAM])
  dnl FIXME This is truly gross.
! missing_dir=`cd $ac_aux_dir >/dev/null && pwd`
  AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
  AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)

or use a construct like ltconfig:

if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi

Comment 1 Kurt Zeilenga 2000-05-31 10:16:39 UTC
moved from Incoming to Software Bugs
Comment 2 Kurt Zeilenga 2000-05-31 12:50:10 UTC
I've forwarded your bug report to bug-autoconf@gnu.org as
the problem is down deep in autoconf, the tool that generates
our configure scripts.

At 10:09 AM 5/31/00 GMT, Andreas.Ley@rz.uni-karlsruhe.de wrote:
>Full_Name: Andreas Ley
>Version: 1.2.10
>OS: IRIX 6.2
>URL: 
>Submission from: (NULL) (129.13.64.65)
>
>
>If the environment variable CDPATH is set, some operating systems print the
>directory they changed to after executing a cd command.
>
>openldap's configure script contains expressions like `cd $dir && pwd`
>which in fact gives the directory twice, garbling some sed commands later.
>
>One should change aclocal.m4 like this:
>
>*** aclocal.m4.orig     Tue Jul 20 02:20:54 1999
>--- aclocal.m4  Wed May 31 11:06:00 2000
>***************
>*** 35,41 ****
>  VERSION=[$2]
>  AC_SUBST(VERSION)
>  dnl test to see if srcdir already configured
>! if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status;
>then
>    AC_MSG_ERROR([source directory already configured; run "make distclean"
>there first])
>  fi
>  ifelse([$3],,
>--- 35,41 ----
>  VERSION=[$2]
>  AC_SUBST(VERSION)
>  dnl test to see if srcdir already configured
>! if test "`cd $srcdir >/dev/null && pwd`" != "`pwd`" && test -f
>$srcdir/config.status; then
>    AC_MSG_ERROR([source directory already configured; run "make distclean"
>there first])
>  fi
>  ifelse([$3],,
>***************
>*** 44,50 ****
>  AC_REQUIRE([AM_SANITY_CHECK])
>  AC_REQUIRE([AC_ARG_PROGRAM])
>  dnl FIXME This is truly gross.
>! missing_dir=`cd $ac_aux_dir && pwd`
>  AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
>  AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
>  AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
>--- 44,50 ----
>  AC_REQUIRE([AM_SANITY_CHECK])
>  AC_REQUIRE([AC_ARG_PROGRAM])
>  dnl FIXME This is truly gross.
>! missing_dir=`cd $ac_aux_dir >/dev/null && pwd`
>  AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
>  AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
>  AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
>
>or use a construct like ltconfig:
>
>if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
>
>
>
>
Comment 3 Kurt Zeilenga 2000-06-01 18:14:25 UTC
env CDPATH=: ./configure 

is the workaround
Comment 4 Kurt Zeilenga 2000-06-01 18:15:29 UTC
changed notes
changed state Open to Suspended
Comment 5 Akim Demaille 2000-06-05 09:13:21 UTC
| Seems CDPATH interfers with configure scripts generated
| with autoconf 1.3.4.  Just checked 'configure' used

1.3.4 is libtoolish, not Autoconf.

| by autoconf-current (CVS repo) itself, seems likely it
| would suffer from same problem.

Actually, please do try the CVS Autoconf since it addresses this issue.

| The submitter suggests a simple patch which I have yet to
| test.
| 
| >Date: Wed, 31 May 2000 10:09:24 GMT
| >From: Andreas.Ley@rz.uni-karlsruhe.de
| >To: openldap-its@OpenLDAP.org
| >Subject: configure fails when CDPATH is set  (ITS#551)
| >Comment: OpenLDAP "openldap-bugs" Mailing List <http://www.OpenLDAP.org/>
| >List-Archive: <http://www.OpenLDAP.org/lists/openldap-bugs>
| >
| >Full_Name: Andreas Ley
| >Version: 1.2.10
| >OS: IRIX 6.2
| >URL: 
| >Submission from: (NULL) (129.13.64.65)
| >
| >
| >If the environment variable CDPATH is set, some operating systems print the
| >directory they changed to after executing a cd command.
| >
| >openldap's configure script contains expressions like `cd $dir && pwd`
| >which in fact gives the directory twice, garbling some sed commands later.
| >
| >One should change aclocal.m4 like this:
| >
| >*** aclocal.m4.orig     Tue Jul 20 02:20:54 1999
| >--- aclocal.m4  Wed May 31 11:06:00 2000
| >***************
| >*** 35,41 ****
| >  VERSION=[$2]
| >  AC_SUBST(VERSION)
| >  dnl test to see if srcdir already configured
| >! if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status;
| >then
| >    AC_MSG_ERROR([source directory already configured; run "make distclean"
| >there first])
| >  fi
| >  ifelse([$3],,
| >--- 35,41 ----
| >  VERSION=[$2]
| >  AC_SUBST(VERSION)
| >  dnl test to see if srcdir already configured
| >! if test "`cd $srcdir >/dev/null && pwd`" != "`pwd`" && test -f
| >$srcdir/config.status; then

Alexandre once told me this is not portable, but I don't recall why.
ISTR he once did something like this on EGCS, and someone complained,
but more details would be welcome :)

| >    AC_MSG_ERROR([source directory already configured; run "make distclean"
| >there first])
| >  fi
| >  ifelse([$3],,
| >***************
| >*** 44,50 ****
| >  AC_REQUIRE([AM_SANITY_CHECK])
| >  AC_REQUIRE([AC_ARG_PROGRAM])
| >  dnl FIXME This is truly gross.
| >! missing_dir=`cd $ac_aux_dir && pwd`
| >  AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
| >  AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
| >  AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
| >--- 44,50 ----
| >  AC_REQUIRE([AM_SANITY_CHECK])
| >  AC_REQUIRE([AC_ARG_PROGRAM])
| >  dnl FIXME This is truly gross.
| >! missing_dir=`cd $ac_aux_dir >/dev/null && pwd`
| >  AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
| >  AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
| >  AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
| >
| >or use a construct like ltconfig:
| >
| >if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
| >
| >
| >
| >
| 
| 
Comment 6 Kurt Zeilenga 2000-06-05 13:37:00 UTC
Thanks for the response.   The autoconf version we're using
is 2.13.1.  We haven't upgraded to CVS Autoconf yet due
to compatibility issues regarding our macro use.  We'll try
to get this done before our next major release.  For now,
we are recommending our users unset CDPATH to avoid this problem:
  env CDPATH=: ./configure

Kurt


Comment 7 Akim Demaille 2000-06-05 13:44:36 UTC
>>>>> "Kurt" == Kurt D Zeilenga <Kurt@OpenLDAP.org> writes:

Kurt> Thanks for the response.  The autoconf version we're using is
Kurt> 2.13.1.  

Hm, that's a bizarre version.  What is the date of the latest
ChangeLog entry?

Kurt> We haven't upgraded to CVS Autoconf yet due to compatibility
Kurt> issues regarding our macro use.  

CVS Autoconf should not be a problem, but you are right: waiting at
least for a snapshot is safer.

Kurt> We'll try to get this done before our next major release.  For
Kurt> now, we are recommending our users unset CDPATH to avoid this
Kurt> problem: env CDPATH=: ./configure

Tell them to `unset CDPATH' instead, but your solution is OK.
Comment 8 Kurt Zeilenga 2000-06-05 14:06:40 UTC
At 03:44 PM 6/5/00 +0200, Akim Demaille wrote:
>Kurt> Thanks for the response.  The autoconf version we're using is
>Kurt> 2.13.1.  
>
>Hm, that's a bizarre version.

We're also using automake 1.4a (aclocal only) and libtool 1.3.4.
This combination has proven to work well together.  We're still
sorting out what new combination to change to.  This tool chain
always seems to require a bizarre version or two.

>What is the date of the latest ChangeLog entry?

1999-10-05  Ben Elliston  <bje@cygnus.com>


>Kurt> We haven't upgraded to CVS Autoconf yet due to compatibility
>Kurt> issues regarding our macro use.  
>
>CVS Autoconf should not be a problem, but you are right: waiting at
>least for a snapshot is safer.

I had problems with CVS Autoconf (HEAD) as of a few days ago.
Changes to AC_DEFINE and autoheader break our multiple header
construction (which is kind of kludgy but works under 2.13).  Also,
the new AC_CHECK_TYPE breaks a few of our macros.  All of this
should be easy to update, but more work than I want at the moment.

>Kurt> We'll try to get this done before our next major release.  For
>Kurt> now, we are recommending our users unset CDPATH to avoid this
>Kurt> problem: env CDPATH=: ./configure
>
>Tell them to `unset CDPATH' instead, but your solution is OK.

In some shells, you need to use unsetenv, not unset.  However,
under most shells, env CDPATH=: ./configure works.
Comment 9 Akim Demaille 2000-06-05 14:16:09 UTC
>>>>> "Kurt" == Kurt D Zeilenga <Kurt@OpenLDAP.org> writes:

Kurt> I had problems with CVS Autoconf (HEAD) as of a few days ago.
Kurt> Changes to AC_DEFINE and autoheader break our multiple header
Kurt> construction (which is kind of kludgy but works under 2.13).
Kurt> Also, the new AC_CHECK_TYPE breaks a few of our macros.  All of
Kurt> this should be easy to update, but more work than I want at the
Kurt> moment.

Could you give some details about these issues? (autoheader and
AC_CHECK_TYPE). 


Kurt> In some shells, you need to use unsetenv, not unset.  However,
Kurt> under most shells, env CDPATH=: ./configure works.

Hm, I see.  I thought unset was also used in the C family.  Pff.
Sorry :)
Comment 10 Alexandre Oliva 2000-06-06 03:32:23 UTC
On Jun  5, 2000, Akim Demaille <akim@epita.fr> wrote:

> | >! if test "`cd $srcdir >/dev/null && pwd`" != "`pwd`"

> Alexandre once told me this is not portable, but I don't recall why.

Some really obscure system would fail to process this command.
Unfortunately, I don't remember the details any more :-(

-- 
Alexandre Oliva    Enjoy Guaraná, see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

Comment 11 Kurt Zeilenga 2000-06-08 16:26:16 UTC
changed notes
changed state Suspended to Closed
Comment 12 OpenLDAP project 2014-08-01 21:06:54 UTC
released with 1.2.11