[GRASS5] 5.3: shared libs and test in configure

Here an example that the test

  if test "$SRCDIR" = "$DSTDIR" ; then
    { echo "configure: error: *** Build directory should not be the same as source \

can fail:

SRCDIR: /hardmnt/thuille1/ssi/cvsgrass_exp
DSTDIR: /ssi0/ssi/neteler/cvsgrass_exp

The situation is that I have changed into the source code
/ssi0/ssi/neteler/cvsgrass_exp/ directory via soft-link:

cd /ssi0/ssi/neteler/cvsgrass_exp/

thuille:cvsgrass_exp[304.48] pwd
/ssi0/ssi/neteler/cvsgrass_exp

thuille:cvsgrass_exp[305.49] /bin/pwd
/hardmnt/thuille1/ssi/cvsgrass_exp

Personally I enjoy that it fails as I can launch 'make' as
usual :slight_smile:

Markus

Markus Neteler wrote:

Here an example that the test

  if test "$SRCDIR" = "$DSTDIR" ; then
    { echo "configure: error: *** Build directory should not be the same as source \

can fail:

SRCDIR: /hardmnt/thuille1/ssi/cvsgrass_exp
DSTDIR: /ssi0/ssi/neteler/cvsgrass_exp

The situation is that I have changed into the source code
/ssi0/ssi/neteler/cvsgrass_exp/ directory via soft-link:

cd /ssi0/ssi/neteler/cvsgrass_exp/

thuille:cvsgrass_exp[304.48] pwd
/ssi0/ssi/neteler/cvsgrass_exp

thuille:cvsgrass_exp[305.49] /bin/pwd
/hardmnt/thuille1/ssi/cvsgrass_exp

Right. I appear to have been distracted by the fact that one of the
three cases uses $pwd (which will be set to "/bin/pwd"); however, the
other two just use "pwd" which will be the shell's built-in:

  AC_PATH_PROG(pwd, pwd, pwd)
  
  AC_MSG_CHECKING(for source directory)
  
  if test -z "$srcdir" ; then
    SRCDIR=`pwd`
  else
    SRCDIR=`(cd "$srcdir" ; $pwd)`
  fi
  
  AC_MSG_RESULT("$SRCDIR")
  
  AC_MSG_CHECKING(for build directory)
  
  DSTDIR=`pwd`
  
  AC_MSG_RESULT("$DSTDIR")

For the $SRCDIR = $DSTDIR check to work correctly, we need to use $pwd
in all three cases. I'll fix this.

--
Glynn Clements <glynn.clements@virgin.net>