Building PostgreSQL in external directory is broken? - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Building PostgreSQL in external directory is broken?
Date
Msg-id CAPpHfduUg5X2por5M4O7-Mkc64h6ZwHWoc0WwuaevtkAZDtCfg@mail.gmail.com
Whole thread Raw
Responses Re: Building PostgreSQL in external directory is broken?
Re: Building PostgreSQL in external directory is broken?
List pgsql-hackers
Hackers,

I usually build the PostgreSQL from the sources directory.  But I've
heard a complaint that PostgreSQL can't be built in the external
directory.

Assuming postgres sources located in postgresql directory, the
following sequence of commands

mkdir -p pgbld
cd pgbld
../postgresql/configure --disable-debug --disable-cassert --enable-tap-tests
make -j4

results in an error

.../src/pgbld/../postgresql/src/include/utils/elog.h:73:10: fatal
error: utils/errcodes.h: No such file or directory
   73 | #include "utils/errcodes.h"

      |          ^~~~~~~~~~~~~~~~~~

I've discovered this a bit.  It appears that Makefile generates
src/backend/utils/errcodes.h in the build directory, but symlinks
src/include/utils/errcodes.h to the sources directory.  That is
src/include/utils/errcodes.h appears to be a broken symlink.  I've
written a short patch to fix that.

It seems strange to me that I'm the first one discovering this.  Am I
missing something?

------
Regards,
Alexander Korotkov

Attachment

pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: CREATE TABLE ( .. STORAGE ..)
Next
From: Dilip Kumar
Date:
Subject: Re: Handle infinite recursion in logical replication setup