Fix symlink for errcodes.h so it works in VPATH builds from tarballs.
authorTom Lane <[email protected]>
Wed, 22 Jun 2011 17:08:08 +0000 (13:08 -0400)
committerTom Lane <[email protected]>
Wed, 22 Jun 2011 17:08:08 +0000 (13:08 -0400)
backend/Makefile was treating errcodes.h as a header always generated
during build, but actually it's a header provided in tarballs.  Hence,
must use the absolute-symlink recipe, not the relative-symlink one.
Per bug #6072 from Hartmut Raschick.

src/backend/Makefile

index e156bb48aa75ac9bdc4e895b3a8d77548a8c064b..ec82d8d344ed77c8df328ecec69f1dfd3444d971 100644 (file)
@@ -174,8 +174,9 @@ $(top_builddir)/src/include/catalog/schemapg.h: catalog/schemapg.h
      $(LN_S) "$$prereqdir/$(notdir $<)" .
 
 $(top_builddir)/src/include/utils/errcodes.h: utils/errcodes.h
-   cd '$(dir $@)' && rm -f $(notdir $@) && \
-       $(LN_S) "../../../$(subdir)/utils/errcodes.h" .
+   prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \
+     cd '$(dir $@)' && rm -f $(notdir $@) && \
+     $(LN_S) "$$prereqdir/$(notdir $<)" .
 
 $(top_builddir)/src/include/utils/fmgroids.h: utils/fmgroids.h
    prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \