From 2140b647f169e236dbe652106245e240ce2aa865 Mon Sep 17 00:00:00 2001 From: Amit Khandekar Date: Thu, 22 Dec 2011 10:17:17 +0530 Subject: Fix for Bug id:3425212: Failed to build on Ubuntu 11.10 Ubuntu 11 no longer has the libpthread.so in the usual locations like /lib or /usr/lib. We have hardcoded -lpthread linker option used in gtm module. The fix is to instead use PTHREAD_CFLAGS macro that is defined in src/Makefile.global. This macro has the correct pthread options already. In this particular issue, the -pthread (not -lpthread) option was the one that was needed to resolve the compile errors. The backend postgres executable also needs this option in case of XC, because it uses functions from src/interfaces/libpq/fe-secure.c which in turn uses pthread calls. --- src/backend/Makefile | 4 ++++ src/gtm/main/Makefile | 4 ++++ src/gtm/proxy/Makefile | 4 ++++ 3 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/backend/Makefile b/src/backend/Makefile index 905ba06414..ecca4cf36d 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -17,6 +17,10 @@ subdir = src/backend top_builddir = ../.. include $(top_builddir)/src/Makefile.global +ifneq ($(PORTNAME), win32) +override CFLAGS += $(PTHREAD_CFLAGS) +endif + SUBDIRS = access bootstrap catalog parser commands executor foreign lib libpq \ pgxc main nodes optimizer port postmaster regex replication rewrite \ storage tcop tsearch utils $(top_builddir)/src/timezone $(top_builddir)/src/interfaces/libpq diff --git a/src/gtm/main/Makefile b/src/gtm/main/Makefile index dec85372ee..506685cc75 100644 --- a/src/gtm/main/Makefile +++ b/src/gtm/main/Makefile @@ -3,6 +3,10 @@ top_builddir=../../.. include $(top_builddir)/src/Makefile.global +ifneq ($(PORTNAME), win32) +override CFLAGS += $(PTHREAD_CFLAGS) +endif + OBJS=main.o gtm_thread.o gtm_txn.o gtm_seq.o gtm_snap.o gtm_time.o gtm_standby.o gtm_opt.o OTHERS= ../libpq/libpqcomm.a ../path/libgtmpath.a ../recovery/libgtmrecovery.a ../client/libgtmclient.a ../common/libgtm.a ../../port/libpgport.a diff --git a/src/gtm/proxy/Makefile b/src/gtm/proxy/Makefile index b2faab35eb..7d319a609d 100644 --- a/src/gtm/proxy/Makefile +++ b/src/gtm/proxy/Makefile @@ -3,6 +3,10 @@ top_builddir=../../.. include $(top_builddir)/src/Makefile.global +ifneq ($(PORTNAME), win32) +override CFLAGS += $(PTHREAD_CFLAGS) +endif + OBJS=proxy_main.o proxy_thread.o proxy_utils.o gtm_proxy_opt.o OTHERS= ../libpq/libpqcomm.a ../path/libgtmpath.a ../recovery/libgtmrecovery.a ../client/libgtmclient.a ../common/libgtm.a -- cgit v1.2.3