Allow --enable-thread-safety with --disable-shared libraries by passing
authorBruce Momjian <bruce@momjian.us>
Thu, 16 Dec 2004 18:13:07 +0000 (18:13 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 16 Dec 2004 18:13:07 +0000 (18:13 +0000)
PTHREAD_LIBS to all libpq-usage builds.

src/Makefile.global.in

index 4edd8ca7c10f60d13e6b107acf07a168229a5355..a74833ba6aa7f917a85e6ade9f189fd0f1e71e92 100644 (file)
@@ -1,5 +1,5 @@
 # -*-makefile-*-
-# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.206 2004/12/16 17:48:29 momjian Exp $
+# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.207 2004/12/16 18:13:07 momjian Exp $
 
 #------------------------------------------------------------------------------
 # All PostgreSQL makefiles include this file and use the variables it sets,
@@ -308,11 +308,17 @@ endif
 
 libpq = -L$(libpq_builddir) -lpq
 
+# If doing static linking, shared library dependency can't be
+# used so we specify pthread libs for every usage of libpq
+ifeq ($(enable_shared), no)
+libpq += $(PTHREAD_LIBS)
+else
 # AIX libraries do not remember their required libs so we have to force
 # thread dependent libraires in the link
 ifeq ($(PORTNAME), aix)
 libpq += $(PTHREAD_LIBS)
 endif
+endif
 
 submake-libpq:
        $(MAKE) -C $(libpq_builddir) all