OSDN Git Service

Fix symlink for errcodes.h so it works in VPATH builds from tarballs.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 22 Jun 2011 17:08:08 +0000 (13:08 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
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 e156bb4..ec82d8d 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` && \