Skip site navigation (1) Skip section navigation (2)

src/backend/Makefile CDPATH Patch

From: Jason Tishler <Jason(dot)Tishler(at)dothill(dot)com>
To: Pgsql-Patches <pgsql-patches(at)postgresql(dot)org>
Subject: src/backend/Makefile CDPATH Patch
Date: 2001-04-23 19:11:33
Message-ID: 20010423151133.R169@dothill.com (view raw or flat)
Thread:
Lists: pgsql-patches
The attached patch solves an annoying build failure when /bin/sh is a
symlink to /bin/bash and CDPATH is set.  The problem manifests itself as
the following error:

    $ cd src/backend
    $ make ../../src/include/parser/parse.h
    prereqdir=`cd parser/ && pwd` && \
      cd ../../src/include/parser/ && rm -f parse.h && \
      ln -s $prereqdir/parse.h .
    ln: ./parser: File exists
    make: *** [../../src/include/parser/parse.h] Error 1
    make: *** Deleting file `../../src/include/parser/parse.h'

The above is due to the following:

    $ export CDPATH=.:/home/jt:/home/jt/src:/home/jt/lib
    $ echo `cd parser/ && pwd`
    /home/jt/src/pgsql/src/backend/parser /home/jt/src/pgsql/src/backend/parser

Hence, prereqdir is actually getting set to two directory names instead
of one which causes ln to fail.

If CDPATH is not set (or set differently) or /bin/sh is not /bin/bash,
then we get the expected behavior:

    $ unset CDPATH
    $ echo `cd parser/ && pwd`
    /home/jt/src/pgsql/src/backend/parser

The the solution used in the patch is as follows:

    $ export CDPATH=.:/home/jt:/home/jt/src:/home/jt/lib
    $ echo `cd parser/ >/dev/null && pwd`
    /home/jt/src/pgsql/src/backend/parser

Note that there are many solutions -- I just chose the one that perturbed
the Makefile the least.

Jason

-- 
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corp.               Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason(dot)Tishler(at)dothill(dot)com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2001-04-23 19:25:38
Subject: Re: src/backend/Makefile CDPATH Patch
Previous:From: Jason TishlerDate: 2001-04-23 18:56:23
Subject: Re: [PATCHES] Cygwin PostgreSQL ESQL Patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group