diff --git a/src/nls-global.mk b/src/nls-global.mk
index f21bd5e..5a2778d 100644
--- a/src/nls-global.mk
+++ b/src/nls-global.mk
@@ -141,6 +141,10 @@ init-po: po/$(CATALOG_NAME).pot
 
 # For performance reasons, only calculate these when the user actually
 # requested update-po or a specific file.
+ifdef PGXS
+ALL_LANGUAGES := $(shell find . -name '*.po' -print | sed 's,^.*/\([^/]*\).po$$,\1,' | LC_ALL=C sort -u)
+all_compendia := $(shell find . -name '*.po' -print | LC_ALL=C sort)
+else
 ifneq (,$(filter update-po %.po.new,$(MAKECMDGOALS)))
 ALL_LANGUAGES := $(shell find $(top_srcdir) -name '*.po' -print | sed 's,^.*/\([^/]*\).po$$,\1,' | LC_ALL=C sort -u)
 all_compendia := $(shell find $(top_srcdir) -name '*.po' -print | LC_ALL=C sort)
@@ -149,6 +153,7 @@ ALL_LANGUAGES = $(AVAIL_LANGUAGES)
 all_compendia = FORCE
 FORCE:
 endif
+endif
 
 ifdef WANTED_LANGUAGES
 ALL_LANGUAGES := $(filter $(WANTED_LANGUAGES), $(ALL_LANGUAGES))
