Commit 291a9577 authored by Tom Lane's avatar Tom Lane

Split the LDFLAGS make variable into two parts: LDFLAGS is now used for

linking both executables and shared libraries, and we add on LDFLAGS_EX when
linking executables or LDFLAGS_SL when linking shared libraries.  This
provides a significantly cleaner way of dealing with link-time switches than
the former behavior.  Also, make sure that the various platform-specific
%.so: %.o rules incorporate LDFLAGS and LDFLAGS_SL; most of them missed that
before.  (I did not add these variables for the platforms that invoke $(LD)
directly, however.  It's not clear if we can do that safely, since for the
most part we assume these variables use CC command-line syntax.)

Per gripe from Aaron Swenson and subsequent investigation.
parent eb81b650
...@@ -704,6 +704,7 @@ ld_R_works ...@@ -704,6 +704,7 @@ ld_R_works
with_gnu_ld with_gnu_ld
LD LD
LDFLAGS_SL LDFLAGS_SL
LDFLAGS_EX
ELF_SYS ELF_SYS
EGREP EGREP
GREP GREP
...@@ -856,6 +857,7 @@ LDFLAGS ...@@ -856,6 +857,7 @@ LDFLAGS
LIBS LIBS
CPPFLAGS CPPFLAGS
CPP CPP
LDFLAGS_EX
LDFLAGS_SL LDFLAGS_SL
DOCBOOKSTYLE' DOCBOOKSTYLE'
...@@ -1551,7 +1553,8 @@ Some influential environment variables: ...@@ -1551,7 +1553,8 @@ Some influential environment variables:
CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir> you have headers in a nonstandard directory <include dir>
CPP C preprocessor CPP C preprocessor
LDFLAGS_SL linker flags for shared library linking LDFLAGS_EX extra linker flags for linking executables only
LDFLAGS_SL extra linker flags for linking shared libraries only
DOCBOOKSTYLE DOCBOOKSTYLE
location of DocBook stylesheets location of DocBook stylesheets
...@@ -5788,6 +5791,7 @@ LDFLAGS="$LDFLAGS $LIBDIRS" ...@@ -5788,6 +5791,7 @@ LDFLAGS="$LDFLAGS $LIBDIRS"
# Check whether --with-gnu-ld was given. # Check whether --with-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then if test "${with_gnu_ld+set}" = set; then
withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
...@@ -28826,7 +28830,6 @@ fi ...@@ -28826,7 +28830,6 @@ fi
# If compiler will take -Wl,--as-needed (or various platform-specific # If compiler will take -Wl,--as-needed (or various platform-specific
# spellings thereof) then add that to LDFLAGS. This is much easier than # spellings thereof) then add that to LDFLAGS. This is much easier than
# trying to filter LIBS to the minimum for each executable. # trying to filter LIBS to the minimum for each executable.
# (Note that shared library links won't use this switch, though.)
# On (at least) some Red-Hat-derived systems, this switch breaks linking to # On (at least) some Red-Hat-derived systems, this switch breaks linking to
# libreadline; therefore we postpone testing it until we know what library # libreadline; therefore we postpone testing it until we know what library
# dependencies readline has. The test code will try to link with $LIBS. # dependencies readline has. The test code will try to link with $LIBS.
......
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
dnl $PostgreSQL: pgsql/configure.in,v 1.630 2010/06/04 07:28:30 scrappy Exp $ dnl $PostgreSQL: pgsql/configure.in,v 1.631 2010/07/05 18:54:37 tgl Exp $
dnl dnl
dnl Developers, please strive to achieve this order: dnl Developers, please strive to achieve this order:
dnl dnl
...@@ -785,7 +785,8 @@ AC_SUBST(ELF_SYS) ...@@ -785,7 +785,8 @@ AC_SUBST(ELF_SYS)
CPPFLAGS="$CPPFLAGS $INCLUDES" CPPFLAGS="$CPPFLAGS $INCLUDES"
LDFLAGS="$LDFLAGS $LIBDIRS" LDFLAGS="$LDFLAGS $LIBDIRS"
AC_ARG_VAR(LDFLAGS_SL, [linker flags for shared library linking]) AC_ARG_VAR(LDFLAGS_EX, [extra linker flags for linking executables only])
AC_ARG_VAR(LDFLAGS_SL, [extra linker flags for linking shared libraries only])
PGAC_PROG_LD PGAC_PROG_LD
AC_SUBST(LD) AC_SUBST(LD)
...@@ -1770,7 +1771,6 @@ fi ...@@ -1770,7 +1771,6 @@ fi
# If compiler will take -Wl,--as-needed (or various platform-specific # If compiler will take -Wl,--as-needed (or various platform-specific
# spellings thereof) then add that to LDFLAGS. This is much easier than # spellings thereof) then add that to LDFLAGS. This is much easier than
# trying to filter LIBS to the minimum for each executable. # trying to filter LIBS to the minimum for each executable.
# (Note that shared library links won't use this switch, though.)
# On (at least) some Red-Hat-derived systems, this switch breaks linking to # On (at least) some Red-Hat-derived systems, this switch breaks linking to
# libreadline; therefore we postpone testing it until we know what library # libreadline; therefore we postpone testing it until we know what library
# dependencies readline has. The test code will try to link with $LIBS. # dependencies readline has. The test code will try to link with $LIBS.
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.347 2010/06/29 22:29:13 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.348 2010/07/05 18:54:37 tgl Exp $ -->
<chapter id="installation"> <chapter id="installation">
<title><![%standalone-include[<productname>PostgreSQL</>]]> <title><![%standalone-include[<productname>PostgreSQL</>]]>
...@@ -1468,7 +1468,16 @@ su - postgres ...@@ -1468,7 +1468,16 @@ su - postgres
<term><envar>LDFLAGS</envar></term> <term><envar>LDFLAGS</envar></term>
<listitem> <listitem>
<para> <para>
options to pass to the link editor options to use when linking either executables or shared libraries
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><envar>LDFLAGS_EX</envar></term>
<listitem>
<para>
additional options for linking executables only
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -1477,7 +1486,7 @@ su - postgres ...@@ -1477,7 +1486,7 @@ su - postgres
<term><envar>LDFLAGS_SL</envar></term> <term><envar>LDFLAGS_SL</envar></term>
<listitem> <listitem>
<para> <para>
linker options for shared library linking additional options for linking shared libraries only
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_config-ref.sgml,v 1.29 2010/04/03 07:23:01 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_config-ref.sgml,v 1.30 2010/07/05 18:54:37 tgl Exp $ -->
<refentry id="app-pgconfig"> <refentry id="app-pgconfig">
<refmeta> <refmeta>
...@@ -232,13 +232,24 @@ ...@@ -232,13 +232,24 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><option>--ldflags_ex</option></>
<listitem>
<para>
Print the value of the <varname>LDFLAGS_EX</varname> variable that was used for building
<productname>PostgreSQL</>. This shows linker switches
used for building executables only.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><option>--ldflags_sl</option></> <term><option>--ldflags_sl</option></>
<listitem> <listitem>
<para> <para>
Print the value of the <varname>LDFLAGS_SL</varname> variable that was used for building Print the value of the <varname>LDFLAGS_SL</varname> variable that was used for building
<productname>PostgreSQL</>. This shows linker switches <productname>PostgreSQL</>. This shows linker switches
used for building shared libraries. used for building shared libraries only.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -275,7 +286,7 @@ ...@@ -275,7 +286,7 @@
<title>Notes</title> <title>Notes</title>
<para> <para>
The option <option>--includedir-server</option> was new in The option <option>--includedir-server</option> was added in
<productname>PostgreSQL</> 7.2. In prior releases, the server include files were <productname>PostgreSQL</> 7.2. In prior releases, the server include files were
installed in the same location as the client headers, which could installed in the same location as the client headers, which could
be queried with the option <option>--includedir</option>. To make your be queried with the option <option>--includedir</option>. To make your
...@@ -290,8 +301,9 @@ ...@@ -290,8 +301,9 @@
<option>--cc</option>, <option>--cppflags</option>, <option>--cc</option>, <option>--cppflags</option>,
<option>--cflags</option>, <option>--cflags_sl</option>, <option>--cflags</option>, <option>--cflags_sl</option>,
<option>--ldflags</option>, <option>--ldflags_sl</option>, <option>--ldflags</option>, <option>--ldflags_sl</option>,
and <option>--libs</option> are new in <productname>PostgreSQL</> 8.1. and <option>--libs</option> were added in <productname>PostgreSQL</> 8.1.
The option <option>--htmldir</option> is new in <productname>PostgreSQL</> 8.4. The option <option>--htmldir</option> was added in <productname>PostgreSQL</> 8.4.
The option <option>--ldflags_ex</option> was added in <productname>PostgreSQL</> 9.0.
</para> </para>
<para> <para>
......
# -*-makefile-*- # -*-makefile-*-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.262 2010/05/13 11:49:47 petere Exp $ # $PostgreSQL: pgsql/src/Makefile.global.in,v 1.263 2010/07/05 18:54:37 tgl Exp $
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets, # All PostgreSQL makefiles include this file and use the variables it sets,
...@@ -236,6 +236,7 @@ LD = @LD@ ...@@ -236,6 +236,7 @@ LD = @LD@
with_gnu_ld = @with_gnu_ld@ with_gnu_ld = @with_gnu_ld@
ld_R_works = @ld_R_works@ ld_R_works = @ld_R_works@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LDFLAGS_EX = @LDFLAGS_EX@
LDFLAGS_SL = @LDFLAGS_SL@ LDFLAGS_SL = @LDFLAGS_SL@
LDREL = -r LDREL = -r
LDOUT = -o LDOUT = -o
...@@ -455,9 +456,9 @@ LIBOBJS = @LIBOBJS@ ...@@ -455,9 +456,9 @@ LIBOBJS = @LIBOBJS@
LIBS := -lpgport $(LIBS) LIBS := -lpgport $(LIBS)
# add location of libpgport.a to LDFLAGS # add location of libpgport.a to LDFLAGS
ifdef PGXS ifdef PGXS
override LDFLAGS := -L$(libdir) $(LDFLAGS) LDFLAGS += -L$(libdir)
else else
override LDFLAGS := -L$(top_builddir)/src/port $(LDFLAGS) LDFLAGS += -L$(top_builddir)/src/port
endif endif
# to make ws2_32.lib the last library, and always link with shfolder, # to make ws2_32.lib the last library, and always link with shfolder,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# Copyright (c) 1998, Regents of the University of California # Copyright (c) 1998, Regents of the University of California
# #
# IDENTIFICATION # IDENTIFICATION
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.123 2009/08/28 20:26:18 petere Exp $ # $PostgreSQL: pgsql/src/Makefile.shlib,v 1.124 2010/07/05 18:54:37 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -78,11 +78,8 @@ LINK.static = $(AR) $(AROPT) ...@@ -78,11 +78,8 @@ LINK.static = $(AR) $(AROPT)
# Insert -L from LDFLAGS after any -L already present in SHLIB_LINK # Automatically append LDFLAGS and LDFLAGS_SL to SHLIB_LINK
SHLIB_LINK := $(filter -L%, $(SHLIB_LINK)) $(filter -L%, $(LDFLAGS)) $(filter-out -L%, $(SHLIB_LINK)) SHLIB_LINK += $(LDFLAGS) $(LDFLAGS_SL)
# Need a -L-free version of LDFLAGS to use in combination with SHLIB_LINK
LDFLAGS_NO_L = $(filter-out -L%, $(LDFLAGS))
ifdef SO_MAJOR_VERSION ifdef SO_MAJOR_VERSION
# Default library naming convention used by the majority of platforms # Default library naming convention used by the majority of platforms
...@@ -104,7 +101,7 @@ stlib = lib$(NAME).a ...@@ -104,7 +101,7 @@ stlib = lib$(NAME).a
ifndef soname ifndef soname
# additional flags for backend modules # additional flags for backend modules
SHLIB_LINK := $(BE_DLLLIBS) $(SHLIB_LINK) SHLIB_LINK += $(BE_DLLLIBS)
endif endif
# For each platform we support shared libraries on, set shlib to the # For each platform we support shared libraries on, set shlib to the
...@@ -208,17 +205,17 @@ ifeq ($(PORTNAME), hpux) ...@@ -208,17 +205,17 @@ ifeq ($(PORTNAME), hpux)
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
endif endif
ifeq ($(with_gnu_ld), yes) ifeq ($(with_gnu_ld), yes)
LINK.shared = $(CC) $(LDFLAGS_NO_L) -shared LINK.shared = $(CC) -shared
ifdef soname ifdef soname
LINK.shared += -Wl,-h -Wl,$(soname) LINK.shared += -Wl,-h -Wl,$(soname)
endif endif
else else
# can't use the CC-syntax rpath pattern here
rpath =
LINK.shared = $(LD) -b LINK.shared = $(LD) -b
ifdef soname ifdef soname
LINK.shared += +h $(soname) LINK.shared += +h $(soname)
endif endif
# can't use the CC-syntax rpath pattern here, so instead:
rpath =
ifeq ($(enable_rpath), yes) ifeq ($(enable_rpath), yes)
LINK.shared += +b '$(rpathdir)' LINK.shared += +b '$(rpathdir)'
endif endif
...@@ -227,10 +224,10 @@ ifeq ($(PORTNAME), hpux) ...@@ -227,10 +224,10 @@ ifeq ($(PORTNAME), hpux)
# ld can find the same libraries gcc does. Make sure it goes after any # ld can find the same libraries gcc does. Make sure it goes after any
# -L switches provided explicitly. # -L switches provided explicitly.
ifeq ($(GCC), yes) ifeq ($(GCC), yes)
SHLIB_LINK := $(filter -L%, $(SHLIB_LINK)) -L/usr/local/lib $(filter-out -L%, $(SHLIB_LINK)) SHLIB_LINK += -L/usr/local/lib
endif endif
endif endif
# do this last so above filtering doesn't pull out -L switches in LDFLAGS # And we need to link with libgcc, too
ifeq ($(GCC), yes) ifeq ($(GCC), yes)
SHLIB_LINK += `$(CC) $(LDFLAGS) -print-libgcc-file-name` SHLIB_LINK += `$(CC) $(LDFLAGS) -print-libgcc-file-name`
endif endif
...@@ -327,10 +324,6 @@ ifeq ($(PORTNAME), win32) ...@@ -327,10 +324,6 @@ ifeq ($(PORTNAME), win32)
haslibarule = yes haslibarule = yes
endif endif
ifeq ($(enable_rpath), yes)
SHLIB_LINK += $(rpath)
endif
## ##
...@@ -362,7 +355,7 @@ ifneq ($(PORTNAME), aix) ...@@ -362,7 +355,7 @@ ifneq ($(PORTNAME), aix)
# Normal case # Normal case
$(shlib): $(OBJS) $(shlib): $(OBJS)
$(LINK.shared) $(LDFLAGS_SL) $(OBJS) $(SHLIB_LINK) -o $@ $(LINK.shared) -o $@ $(OBJS) $(SHLIB_LINK)
ifdef shlib_major ifdef shlib_major
# If we're using major and minor versions, then make a symlink to major-version-only. # If we're using major and minor versions, then make a symlink to major-version-only.
ifneq ($(shlib), $(shlib_major)) ifneq ($(shlib), $(shlib_major))
...@@ -396,7 +389,7 @@ $(shlib) $(stlib): $(OBJS) ...@@ -396,7 +389,7 @@ $(shlib) $(stlib): $(OBJS)
$(LINK.static) $(stlib) $^ $(LINK.static) $(stlib) $^
$(RANLIB) $(stlib) $(RANLIB) $(stlib)
$(MKLDEXPORT) $(stlib) >$(exports_file) $(MKLDEXPORT) $(stlib) >$(exports_file)
$(COMPILER) $(LDFLAGS_NO_L) $(LDFLAGS_SL) -o $(shlib) $(stlib) -Wl,-bE:$(exports_file) $(SHLIB_LINK) $(COMPILER) -o $(shlib) $(stlib) -Wl,-bE:$(exports_file) $(SHLIB_LINK)
rm -f $(stlib) rm -f $(stlib)
$(AR) $(AROPT) $(stlib) $(shlib) $(AR) $(AROPT) $(stlib) $(shlib)
...@@ -419,7 +412,7 @@ DLL_DEFFILE = lib$(NAME)dll.def ...@@ -419,7 +412,7 @@ DLL_DEFFILE = lib$(NAME)dll.def
endif endif
$(shlib): $(OBJS) $(DLL_DEFFILE) $(shlib): $(OBJS) $(DLL_DEFFILE)
$(DLLWRAP) $(LDFLAGS_SL) -o $@ --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(DLL_DEFFILE) $(OBJS) $(SHLIB_LINK) $(DLLWRAP) -o $@ --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(DLL_DEFFILE) $(OBJS) $(SHLIB_LINK)
$(stlib): $(shlib) $(DLL_DEFFILE) $(stlib): $(shlib) $(DLL_DEFFILE)
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib $@ $(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib $@
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/backend/Makefile,v 1.144 2010/05/12 23:48:36 momjian Exp $ # $PostgreSQL: pgsql/src/backend/Makefile,v 1.145 2010/07/05 18:54:37 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -52,7 +52,7 @@ ifneq ($(PORTNAME), win32) ...@@ -52,7 +52,7 @@ ifneq ($(PORTNAME), win32)
ifneq ($(PORTNAME), aix) ifneq ($(PORTNAME), aix)
postgres: $(OBJS) postgres: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $(call expand_subsys,$^) $(LIBS) -o $@ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) $(call expand_subsys,$^) $(LIBS) -o $@
endif endif
endif endif
...@@ -62,9 +62,9 @@ ifeq ($(PORTNAME), cygwin) ...@@ -62,9 +62,9 @@ ifeq ($(PORTNAME), cygwin)
postgres: $(OBJS) postgres.def libpostgres.a postgres: $(OBJS) postgres.def libpostgres.a
$(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def $(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(call expand_subsys,$(OBJS)) $(LIBS) $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(call expand_subsys,$(OBJS)) $(LIBS)
$(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def $(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
$(CC) $(CFLAGS) $(LDFLAGS) -Wl,--stack,$(WIN32_STACK_RLIMIT) -o $@$(X) $@.exp $(call expand_subsys,$(OBJS)) $(LIBS) $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) -Wl,--stack,$(WIN32_STACK_RLIMIT) -o $@$(X) $@.exp $(call expand_subsys,$(OBJS)) $(LIBS)
rm -f $@.exp $@.base rm -f $@.exp $@.base
postgres.def: $(OBJS) postgres.def: $(OBJS)
...@@ -80,9 +80,9 @@ LIBS += -lsecur32 ...@@ -80,9 +80,9 @@ LIBS += -lsecur32
postgres: $(OBJS) postgres.def libpostgres.a $(WIN32RES) postgres: $(OBJS) postgres.def libpostgres.a $(WIN32RES)
$(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def $(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(call expand_subsys,$(OBJS)) $(WIN32RES) $(LIBS) $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(call expand_subsys,$(OBJS)) $(WIN32RES) $(LIBS)
$(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def $(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
$(CC) $(CFLAGS) $(LDFLAGS) -Wl,--stack=$(WIN32_STACK_RLIMIT) -o $@$(X) $@.exp $(call expand_subsys,$(OBJS)) $(WIN32RES) $(LIBS) $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) -Wl,--stack=$(WIN32_STACK_RLIMIT) -o $@$(X) $@.exp $(call expand_subsys,$(OBJS)) $(WIN32RES) $(LIBS)
rm -f $@.exp $@.base rm -f $@.exp $@.base
postgres.def: $(OBJS) postgres.def: $(OBJS)
...@@ -96,7 +96,7 @@ endif # win32 ...@@ -96,7 +96,7 @@ endif # win32
ifeq ($(PORTNAME), aix) ifeq ($(PORTNAME), aix)
postgres: $(POSTGRES_IMP) postgres: $(POSTGRES_IMP)
$(CC) $(CFLAGS) $(LDFLAGS) $(call expand_subsys,$(OBJS)) -Wl,-bE:$(top_builddir)/src/backend/$(POSTGRES_IMP) $(LIBS) -o $@ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $(call expand_subsys,$(OBJS)) -Wl,-bE:$(top_builddir)/src/backend/$(POSTGRES_IMP) $(LIBS) -o $@
$(POSTGRES_IMP): $(OBJS) $(POSTGRES_IMP): $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(call expand_subsys,$^) $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(call expand_subsys,$^)
...@@ -128,7 +128,7 @@ catalog/schemapg.h: submake-schemapg ...@@ -128,7 +128,7 @@ catalog/schemapg.h: submake-schemapg
# The postgres.o target is needed by the rule in Makefile.global that # The postgres.o target is needed by the rule in Makefile.global that
# creates the exports file when MAKE_EXPORTS = true. # creates the exports file when MAKE_EXPORTS = true.
postgres.o: $(OBJS) postgres.o: $(OBJS)
$(CC) $(LDREL) $(LDFLAGS) $(call expand_subsys,$^) $(LIBS) -o $@ $(CC) $(LDREL) $(LDFLAGS) $(LDFLAGS_EX) $(call expand_subsys,$^) $(LIBS) -o $@
# The following targets are specified in make commands that appear in # The following targets are specified in make commands that appear in
...@@ -306,4 +306,4 @@ maintainer-clean: distclean ...@@ -306,4 +306,4 @@ maintainer-clean: distclean
# are up to date. It saves the time of doing all the submakes. # are up to date. It saves the time of doing all the submakes.
.PHONY: quick .PHONY: quick
quick: $(OBJS) quick: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $(call expand_subsys,$^) $(LIBS) -o postgres $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) $(call expand_subsys,$^) $(LIBS) -o postgres
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# be converted to Method 2. # be converted to Method 2.
# #
# IDENTIFICATION # IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/port/Makefile,v 1.27 2008/10/29 16:06:46 petere Exp $ # $PostgreSQL: pgsql/src/backend/port/Makefile,v 1.28 2010/07/05 18:54:37 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -44,7 +44,7 @@ endif ...@@ -44,7 +44,7 @@ endif
# IPC test program # IPC test program
ipc_test: ipc_test.o pg_sema.o pg_shmem.o ipc_test: ipc_test.o pg_sema.o pg_shmem.o
$(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(LIBS) -o $@ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) $^ $(LIBS) -o $@
distclean clean: distclean clean:
rm -f ipc_test ipc_test.o tas_cpp.s rm -f ipc_test ipc_test.o tas_cpp.s
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/bin/initdb/Makefile,v 1.60 2010/05/12 11:33:09 momjian Exp $ # $PostgreSQL: pgsql/src/bin/initdb/Makefile,v 1.61 2010/07/05 18:54:37 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -23,7 +23,7 @@ OBJS= initdb.o encnames.o pqsignal.o $(WIN32RES) ...@@ -23,7 +23,7 @@ OBJS= initdb.o encnames.o pqsignal.o $(WIN32RES)
all: submake-libpgport initdb all: submake-libpgport initdb
initdb: $(OBJS) initdb: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
# We used to pull in all of libpq to get encnames and pqsignal, but that # We used to pull in all of libpq to get encnames and pqsignal, but that
# exposes us to risks of version skew if we link to a shared library. # exposes us to risks of version skew if we link to a shared library.
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 1998-2010, PostgreSQL Global Development Group # Copyright (c) 1998-2010, PostgreSQL Global Development Group
# #
# $PostgreSQL: pgsql/src/bin/pg_config/Makefile,v 1.24 2010/05/12 11:33:09 momjian Exp $ # $PostgreSQL: pgsql/src/bin/pg_config/Makefile,v 1.25 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -27,13 +27,14 @@ override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\"" ...@@ -27,13 +27,14 @@ override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""
override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\"" override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\""
override CPPFLAGS += -DVAL_CFLAGS_SL="\"$(CFLAGS_SL)\"" override CPPFLAGS += -DVAL_CFLAGS_SL="\"$(CFLAGS_SL)\""
override CPPFLAGS += -DVAL_LDFLAGS="\"$(STD_LDFLAGS)\"" override CPPFLAGS += -DVAL_LDFLAGS="\"$(STD_LDFLAGS)\""
override CPPFLAGS += -DVAL_LDFLAGS_EX="\"$(LDFLAGS_EX)\""
override CPPFLAGS += -DVAL_LDFLAGS_SL="\"$(LDFLAGS_SL)\"" override CPPFLAGS += -DVAL_LDFLAGS_SL="\"$(LDFLAGS_SL)\""
override CPPFLAGS += -DVAL_LIBS="\"$(LIBS)\"" override CPPFLAGS += -DVAL_LIBS="\"$(LIBS)\""
all: submake-libpgport pg_config all: submake-libpgport pg_config
pg_config: $(OBJS) pg_config: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
install: all installdirs install: all installdirs
$(INSTALL_SCRIPT) pg_config$(X) '$(DESTDIR)$(bindir)/pg_config$(X)' $(INSTALL_SCRIPT) pg_config$(X) '$(DESTDIR)$(bindir)/pg_config$(X)'
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* *
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.32 2010/01/02 16:57:58 momjian Exp $ * $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.33 2010/07/05 18:54:38 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -326,6 +326,22 @@ show_ldflags(bool all) ...@@ -326,6 +326,22 @@ show_ldflags(bool all)
#endif #endif
} }
static void
show_ldflags_ex(bool all)
{
#ifdef VAL_LDFLAGS_EX
if (all)
printf("LDFLAGS_EX = ");
printf("%s\n", VAL_LDFLAGS_EX);
#else
if (!all)
{
fprintf(stderr, _("not recorded\n"));
exit(1);
}
#endif
}
static void static void
show_ldflags_sl(bool all) show_ldflags_sl(bool all)
{ {
...@@ -398,6 +414,7 @@ static const InfoItem info_items[] = { ...@@ -398,6 +414,7 @@ static const InfoItem info_items[] = {
{"--cflags", show_cflags}, {"--cflags", show_cflags},
{"--cflags_sl", show_cflags_sl}, {"--cflags_sl", show_cflags_sl},
{"--ldflags", show_ldflags}, {"--ldflags", show_ldflags},
{"--ldflags_ex", show_ldflags_ex},
{"--ldflags_sl", show_ldflags_sl}, {"--ldflags_sl", show_ldflags_sl},
{"--libs", show_libs}, {"--libs", show_libs},
{"--version", show_version}, {"--version", show_version},
...@@ -433,6 +450,7 @@ help(void) ...@@ -433,6 +450,7 @@ help(void)
printf(_(" --cflags show CFLAGS value used when PostgreSQL was built\n")); printf(_(" --cflags show CFLAGS value used when PostgreSQL was built\n"));
printf(_(" --cflags_sl show CFLAGS_SL value used when PostgreSQL was built\n")); printf(_(" --cflags_sl show CFLAGS_SL value used when PostgreSQL was built\n"));
printf(_(" --ldflags show LDFLAGS value used when PostgreSQL was built\n")); printf(_(" --ldflags show LDFLAGS value used when PostgreSQL was built\n"));
printf(_(" --ldflags_ex show LDFLAGS_EX value used when PostgreSQL was built\n"));
printf(_(" --ldflags_sl show LDFLAGS_SL value used when PostgreSQL was built\n")); printf(_(" --ldflags_sl show LDFLAGS_SL value used when PostgreSQL was built\n"));
printf(_(" --libs show LIBS value used when PostgreSQL was built\n")); printf(_(" --libs show LIBS value used when PostgreSQL was built\n"));
printf(_(" --version show the PostgreSQL version\n")); printf(_(" --version show the PostgreSQL version\n"));
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 1998-2010, PostgreSQL Global Development Group # Copyright (c) 1998-2010, PostgreSQL Global Development Group
# #
# $PostgreSQL: pgsql/src/bin/pg_controldata/Makefile,v 1.21 2010/05/12 11:33:09 momjian Exp $ # $PostgreSQL: pgsql/src/bin/pg_controldata/Makefile,v 1.22 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -20,7 +20,7 @@ OBJS= pg_controldata.o pg_crc.o $(WIN32RES) ...@@ -20,7 +20,7 @@ OBJS= pg_controldata.o pg_crc.o $(WIN32RES)
all: submake-libpgport pg_controldata all: submake-libpgport pg_controldata
pg_controldata: $(OBJS) pg_controldata: $(OBJS)
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c
rm -f $@ && $(LN_S) $< . rm -f $@ && $(LN_S) $< .
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.29 2010/05/12 11:33:09 momjian Exp $ # $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.30 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -23,7 +23,7 @@ OBJS= pg_ctl.o $(WIN32RES) ...@@ -23,7 +23,7 @@ OBJS= pg_ctl.o $(WIN32RES)
all: submake-libpq submake-libpgport pg_ctl all: submake-libpq submake-libpgport pg_ctl
pg_ctl: $(OBJS) $(libpq_builddir)/libpq.a pg_ctl: $(OBJS) $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
install: all installdirs install: all installdirs
$(INSTALL_PROGRAM) pg_ctl$(X) '$(DESTDIR)$(bindir)/pg_ctl$(X)' $(INSTALL_PROGRAM) pg_ctl$(X) '$(DESTDIR)$(bindir)/pg_ctl$(X)'
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.70 2010/05/12 11:33:09 momjian Exp $ # $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.71 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -30,13 +30,13 @@ kwlookup.c: % : $(top_srcdir)/src/backend/parser/% ...@@ -30,13 +30,13 @@ kwlookup.c: % : $(top_srcdir)/src/backend/parser/%
all: submake-libpq submake-libpgport pg_dump pg_restore pg_dumpall all: submake-libpq submake-libpgport pg_dump pg_restore pg_dumpall
pg_dump: pg_dump.o common.o pg_dump_sort.o $(OBJS) $(KEYWRDOBJS) $(libpq_builddir)/libpq.a pg_dump: pg_dump.o common.o pg_dump_sort.o $(OBJS) $(KEYWRDOBJS) $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) pg_dump.o common.o pg_dump_sort.o $(KEYWRDOBJS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) pg_dump.o common.o pg_dump_sort.o $(KEYWRDOBJS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
pg_restore: pg_restore.o $(OBJS) $(KEYWRDOBJS) $(libpq_builddir)/libpq.a pg_restore: pg_restore.o $(OBJS) $(KEYWRDOBJS) $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) pg_restore.o $(KEYWRDOBJS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) pg_restore.o $(KEYWRDOBJS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
pg_dumpall: pg_dumpall.o dumputils.o $(KEYWRDOBJS) $(libpq_builddir)/libpq.a pg_dumpall: pg_dumpall.o dumputils.o $(KEYWRDOBJS) $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) pg_dumpall.o dumputils.o $(KEYWRDOBJS) $(WIN32RES) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) pg_dumpall.o dumputils.o $(KEYWRDOBJS) $(WIN32RES) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
install: all installdirs install: all installdirs
$(INSTALL_PROGRAM) pg_dump$(X) '$(DESTDIR)$(bindir)'/pg_dump$(X) $(INSTALL_PROGRAM) pg_dump$(X) '$(DESTDIR)$(bindir)'/pg_dump$(X)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 1998-2010, PostgreSQL Global Development Group # Copyright (c) 1998-2010, PostgreSQL Global Development Group
# #
# $PostgreSQL: pgsql/src/bin/pg_resetxlog/Makefile,v 1.23 2010/05/12 11:33:10 momjian Exp $ # $PostgreSQL: pgsql/src/bin/pg_resetxlog/Makefile,v 1.24 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -20,7 +20,7 @@ OBJS= pg_resetxlog.o pg_crc.o $(WIN32RES) ...@@ -20,7 +20,7 @@ OBJS= pg_resetxlog.o pg_crc.o $(WIN32RES)
all: submake-libpgport pg_resetxlog all: submake-libpgport pg_resetxlog
pg_resetxlog: $(OBJS) pg_resetxlog: $(OBJS)
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c
rm -f $@ && $(LN_S) $< . rm -f $@ && $(LN_S) $< .
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.69 2010/05/12 11:33:10 momjian Exp $ # $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.70 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -32,7 +32,7 @@ FLEXFLAGS = -Cfe ...@@ -32,7 +32,7 @@ FLEXFLAGS = -Cfe
all: submake-libpq submake-libpgport psql all: submake-libpq submake-libpgport psql
psql: $(OBJS) $(libpq_builddir)/libpq.a psql: $(OBJS) $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
help.o: sql_help.h help.o: sql_help.h
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/bin/scripts/Makefile,v 1.45 2010/05/12 11:33:10 momjian Exp $ # $PostgreSQL: pgsql/src/bin/scripts/Makefile,v 1.46 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -23,7 +23,7 @@ override CPPFLAGS := -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psq ...@@ -23,7 +23,7 @@ override CPPFLAGS := -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psq
all: submake-libpq $(PROGRAMS) all: submake-libpq $(PROGRAMS)
%: %.o $(WIN32RES) %: %.o $(WIN32RES)
$(CC) $(CFLAGS) $^ $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $^ $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
createdb: createdb.o common.o dumputils.o kwlookup.o keywords.o createdb: createdb.o common.o dumputils.o kwlookup.o keywords.o
createlang: createlang.o common.o print.o mbprint.o createlang: createlang.o common.o print.o mbprint.o
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 1998-2010, PostgreSQL Global Development Group # Copyright (c) 1998-2010, PostgreSQL Global Development Group
# #
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.149 2010/05/12 11:33:10 momjian Exp $ # $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.150 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -33,7 +33,7 @@ OBJS= preproc.o type.o ecpg.o output.o parser.o \ ...@@ -33,7 +33,7 @@ OBJS= preproc.o type.o ecpg.o output.o parser.o \
all: submake-libpgport ecpg all: submake-libpgport ecpg
ecpg: $(OBJS) ecpg: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) $(PTHREAD_LIBS) -o $@$(X) $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $^ $(LIBS) $(PTHREAD_LIBS) -o $@$(X)
# pgc is compiled as part of preproc # pgc is compiled as part of preproc
preproc.o: pgc.c preproc.o: pgc.c
......
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.78 2009/12/19 02:38:51 alvherre Exp $ # $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.79 2010/07/05 18:54:38 tgl Exp $
subdir = src/interfaces/ecpg/test subdir = src/interfaces/ecpg/test
top_builddir = ../../../.. top_builddir = ../../../..
...@@ -54,7 +54,7 @@ clean distclean maintainer-clean: ...@@ -54,7 +54,7 @@ clean distclean maintainer-clean:
all: pg_regress$(X) all: pg_regress$(X)
pg_regress$(X): pg_regress_ecpg.o $(top_builddir)/src/test/regress/pg_regress.o pg_regress$(X): pg_regress_ecpg.o $(top_builddir)/src/test/regress/pg_regress.o
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $^ $(LIBS) -o $@
$(top_builddir)/src/test/regress/pg_regress.o: $(top_builddir)/src/test/regress/pg_regress.o:
$(MAKE) -C $(dir $@) $(notdir $@) $(MAKE) -C $(dir $@) $(notdir $@)
......
...@@ -8,7 +8,7 @@ override LIBS := -lecpg -lpgtypes $(filter -l%, $(libpq)) $(LIBS) $(PTHREAD_LIBS ...@@ -8,7 +8,7 @@ override LIBS := -lecpg -lpgtypes $(filter -l%, $(libpq)) $(LIBS) $(PTHREAD_LIBS
ECPG = ../../preproc/ecpg --regression -I$(srcdir)/../../include ECPG = ../../preproc/ecpg --regression -I$(srcdir)/../../include
%: %.c %: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@ $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
%.c: %.pgc ../regression.h %.c: %.pgc ../regression.h
$(ECPG) -o $@ -I$(srcdir) $< $(ECPG) -o $@ -I$(srcdir) $<
......
...@@ -37,5 +37,6 @@ MKLDEXPORT=$(top_srcdir)/src/backend/port/aix/mkldexport.sh ...@@ -37,5 +37,6 @@ MKLDEXPORT=$(top_srcdir)/src/backend/port/aix/mkldexport.sh
%.exp: %.o %.exp: %.o
$(MKLDEXPORT) $^ >$@ $(MKLDEXPORT) $^ >$@
# Rule for building a shared library from a single .o file
%$(DLSUFFIX): %.o %.exp %$(DLSUFFIX): %.o %.exp
$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -o $@ $*.o -Wl,-bE:$*.exp $(SHLIB_LINK) $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -o $@ $*.o -Wl,-bE:$*.exp $(SHLIB_LINK)
...@@ -20,5 +20,6 @@ else ...@@ -20,5 +20,6 @@ else
CFLAGS_SL = CFLAGS_SL =
endif endif
# Rule for building a shared library from a single .o file
%.so: %.o %.so: %.o
$(CC) $(CFLAGS) -shared -o $@ $< $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
# $PostgreSQL: pgsql/src/makefiles/Makefile.cygwin,v 1.13 2010/01/20 09:30:07 heikki Exp $ # $PostgreSQL: pgsql/src/makefiles/Makefile.cygwin,v 1.14 2010/07/05 18:54:38 tgl Exp $
DLLTOOL= dlltool DLLTOOL= dlltool
DLLWRAP= dllwrap DLLWRAP= dllwrap
ifdef PGXS ifdef PGXS
...@@ -15,11 +15,6 @@ AROPT = crs ...@@ -15,11 +15,6 @@ AROPT = crs
DLSUFFIX = .dll DLSUFFIX = .dll
CFLAGS_SL = CFLAGS_SL =
%.dll: %.o
$(DLLTOOL) --export-all --output-def $*.def $<
$(DLLWRAP) -o $@ --def $*.def $< $(SHLIB_LINK)
rm -f $*.def
ifneq (,$(findstring backend,$(subdir))) ifneq (,$(findstring backend,$(subdir)))
ifeq (,$(findstring conversion_procs,$(subdir))) ifeq (,$(findstring conversion_procs,$(subdir)))
ifeq (,$(findstring snowball,$(subdir))) ifeq (,$(findstring snowball,$(subdir)))
...@@ -42,3 +37,9 @@ endif ...@@ -42,3 +37,9 @@ endif
ifneq (,$(findstring src/pl/plpython,$(subdir))) ifneq (,$(findstring src/pl/plpython,$(subdir)))
override CPPFLAGS+= -DUSE_DL_IMPORT override CPPFLAGS+= -DUSE_DL_IMPORT
endif endif
# Rule for building a shared library from a single .o file
%.dll: %.o
$(DLLTOOL) --export-all --output-def $*.def $<
$(DLLWRAP) -o $@ --def $*.def $< $(SHLIB_LINK)
rm -f $*.def
AROPT = crs AROPT = crs
AWK= awk
DLSUFFIX = .so DLSUFFIX = .so
CFLAGS_SL =
ifdef PGXS ifdef PGXS
BE_DLLLIBS= -bundle_loader $(bindir)/postgres BE_DLLLIBS = -bundle_loader $(bindir)/postgres
else else
BE_DLLLIBS= -bundle_loader $(top_builddir)/src/backend/postgres BE_DLLLIBS = -bundle_loader $(top_builddir)/src/backend/postgres
endif endif
# Rule for building shared libs (currently used only for regression test # Rule for building a shared library from a single .o file
# shlib ... should go away, since this is not really enough knowledge)
%.so: %.o %.so: %.o
$(CC) $(CFLAGS) -bundle -o $@ $< $(BE_DLLLIBS) $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -bundle -o $@ $< $(BE_DLLLIBS)
...@@ -2,7 +2,8 @@ AROPT = crs ...@@ -2,7 +2,8 @@ AROPT = crs
DLSUFFIX = .so DLSUFFIX = .so
CFLAGS_SL = -fpic CFLAGS_SL = -fpic
# Rule for building a shared library from a single .o file
%.so: %.o %.so: %.o
$(CC) -shared -o $@ $< $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
sqlmansect = 5 sqlmansect = 5
...@@ -14,9 +14,10 @@ allow_nonpic_in_shlib = yes ...@@ -14,9 +14,10 @@ allow_nonpic_in_shlib = yes
endif endif
# Rule for building a shared library from a single .o file
%.so: %.o %.so: %.o
ifdef ELF_SYSTEM ifdef ELF_SYSTEM
$(CC) $(CFLAGS) -shared -o $@ $< $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
else else
$(LD) $(LDREL) $(LDOUT) $<.obj -x $< $(LD) $(LDREL) $(LDOUT) $<.obj -x $<
@echo building shared object $@ @echo building shared object $@
......
...@@ -22,7 +22,7 @@ endif ...@@ -22,7 +22,7 @@ endif
ifeq ($(with_gnu_ld), yes) ifeq ($(with_gnu_ld), yes)
# XXX what to put here? # XXX what to put here?
else else
LDFLAGS += -Wl,-z LDFLAGS_EX += -Wl,-z
endif endif
# set up appropriate options for shared library builds # set up appropriate options for shared library builds
...@@ -43,18 +43,17 @@ else ...@@ -43,18 +43,17 @@ else
CFLAGS_SL = +Z CFLAGS_SL = +Z
endif endif
# Rule for building shared libs (currently used only for regression test # Rule for building a shared library from a single .o file
# shlib ... should go away, since this is not really enough knowledge)
%$(DLSUFFIX): %.o %$(DLSUFFIX): %.o
ifeq ($(GCC), yes) ifeq ($(GCC), yes)
ifeq ($(with_gnu_ld), yes) ifeq ($(with_gnu_ld), yes)
$(CC) $(LDFLAGS) -shared -o $@ $< `$(CC) $(LDFLAGS) -print-libgcc-file-name` $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $< `$(CC) $(LDFLAGS) -print-libgcc-file-name`
else else
$(LD) -b -o $@ $< `$(CC) $(LDFLAGS) -print-libgcc-file-name` $(LD) -b -o $@ $< `$(CC) $(LDFLAGS) -print-libgcc-file-name`
endif endif
else else
ifeq ($(with_gnu_ld), yes) ifeq ($(with_gnu_ld), yes)
$(CC) $(LDFLAGS) -shared -o $@ $< $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
else else
$(LD) -b -o $@ $< $(LD) -b -o $@ $<
endif endif
......
...@@ -5,14 +5,15 @@ DLSUFFIX = .so ...@@ -5,14 +5,15 @@ DLSUFFIX = .so
# PIC is default # PIC is default
CFLAGS_SL = CFLAGS_SL =
%.so: %.o
$(CC) $(CFLAGS) -shared -o $@ $<
override CPPFLAGS += -U_NO_XOPEN4 override CPPFLAGS += -U_NO_XOPEN4
ifneq ($(GCC), yes) ifneq ($(GCC), yes)
CFLAGS += -woff 1164,1171,1185,1195,1552 CFLAGS += -woff 1164,1171,1185,1195,1552
endif endif
LDFLAGS += -Wl,-woff,15 -Wl,-woff,84 LDFLAGS += -Wl,-woff,15 -Wl,-woff,84
# Rule for building a shared library from a single .o file
%.so: %.o
$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
sqlmansect = 5sql sqlmansect = 5sql
...@@ -12,5 +12,6 @@ else ...@@ -12,5 +12,6 @@ else
CFLAGS_SL = -fpic CFLAGS_SL = -fpic
endif endif
# Rule for building a shared library from a single .o file
%.so: %.o %.so: %.o
$(CC) $(CFLAGS) -shared -o $@ $< $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
...@@ -16,9 +16,10 @@ CFLAGS_SL = -fpic -DPIC ...@@ -16,9 +16,10 @@ CFLAGS_SL = -fpic -DPIC
endif endif
# Rule for building a shared library from a single .o file
%.so: %.o %.so: %.o
ifdef ELF_SYSTEM ifdef ELF_SYSTEM
$(CC) $(CFLAGS) -shared -o $@ $< $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
else else
$(LD) $(LDREL) $(LDOUT) $<.obj -x $< $(LD) $(LDREL) $(LDOUT) $<.obj -x $<
@echo building shared object $@ @echo building shared object $@
......
...@@ -14,9 +14,10 @@ CFLAGS_SL = -fpic -DPIC ...@@ -14,9 +14,10 @@ CFLAGS_SL = -fpic -DPIC
endif endif
# Rule for building a shared library from a single .o file
%.so: %.o %.so: %.o
ifdef ELF_SYSTEM ifdef ELF_SYSTEM
$(CC) $(CFLAGS) -shared -o $@ $< $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
else else
$(LD) $(LDREL) $(LDOUT) $<.obj -x $< $(LD) $(LDREL) $(LDOUT) $<.obj -x $<
@echo building shared object $@ @echo building shared object $@
......
...@@ -3,6 +3,7 @@ DLSUFFIX = .so ...@@ -3,6 +3,7 @@ DLSUFFIX = .so
CFLAGS_SL = CFLAGS_SL =
rpath = -rpath '$(rpathdir)' rpath = -rpath '$(rpathdir)'
# Rule for building a shared library from a single .o file
%.so: %.o %.so: %.o
$(LD) -shared -expect_unresolved '*' -o $@ $< $(LD) -shared -expect_unresolved '*' -o $@ $<
......
...@@ -8,5 +8,6 @@ else ...@@ -8,5 +8,6 @@ else
CFLAGS_SL = -K PIC CFLAGS_SL = -K PIC
endif endif
# Rule for building a shared library from a single .o file
%.so: %.o %.so: %.o
$(LD) -G -Bdynamic -o $@ $< $(LD) -G -Bdynamic -o $@ $<
# $PostgreSQL: pgsql/src/makefiles/Makefile.solaris,v 1.14 2008/09/01 08:50:10 petere Exp $ # $PostgreSQL: pgsql/src/makefiles/Makefile.solaris,v 1.15 2010/07/05 18:54:38 tgl Exp $
AROPT = crs AROPT = crs
...@@ -16,11 +16,12 @@ else ...@@ -16,11 +16,12 @@ else
CFLAGS_SL = -KPIC CFLAGS_SL = -KPIC
endif endif
# Rule for building a shared library from a single .o file
%.so: %.o %.so: %.o
ifeq ($(GCC), yes) ifeq ($(GCC), yes)
$(CC) $(CFLAGS) -shared -o $@ $< $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
else else
$(CC) $(CFLAGS) -G -o $@ $< $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -G -o $@ $<
endif endif
sqlmansect = 5sql sqlmansect = 5sql
...@@ -7,5 +7,6 @@ else ...@@ -7,5 +7,6 @@ else
CFLAGS_SL = -PIC CFLAGS_SL = -PIC
endif endif
# Rule for building a shared library from a single .o file
%.so: %.o %.so: %.o
$(LD) -assert pure-text -Bdynamic -o $@ $< $(LD) -assert pure-text -Bdynamic -o $@ $<
...@@ -8,6 +8,7 @@ LDFLAGS += -LD-Blargedynsym ...@@ -8,6 +8,7 @@ LDFLAGS += -LD-Blargedynsym
DLSUFFIX = .so DLSUFFIX = .so
CFLAGS_SL = CFLAGS_SL =
# Rule for building a shared library from a single .o file
%.so: %.o %.so: %.o
$(LD) -G -Bdynamic -o $@ $< $(LD) -G -Bdynamic -o $@ $<
......
...@@ -6,5 +6,6 @@ DLSUFFIX = .so ...@@ -6,5 +6,6 @@ DLSUFFIX = .so
# "-G 0" works for both DEC cc and GNU cc. # "-G 0" works for both DEC cc and GNU cc.
CFLAGS_SL = -G 0 CFLAGS_SL = -G 0
# Rule for building a shared library from a single .c file
%.so: %.c %.so: %.c
$(CC) -c -G 0 $(CPPFLAGS) $(CFLAGS) -o $@ $< $(CC) -c -G 0 $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -o $@ $<
...@@ -3,6 +3,7 @@ export_dynamic = -Wl,-Bexport ...@@ -3,6 +3,7 @@ export_dynamic = -Wl,-Bexport
DLSUFFIX = .so DLSUFFIX = .so
CFLAGS_SL = -K PIC CFLAGS_SL = -K PIC
# Rule for building a shared library from a single .o file
%.so: %.o %.so: %.o
$(LD) -G -Bdynamic -o $@ $< $(LD) -G -Bdynamic -o $@ $<
......
...@@ -13,6 +13,9 @@ else ...@@ -13,6 +13,9 @@ else
endif endif
endif endif
# Unixware needs threads for everything that uses libpq
CFLAGS += $(PTHREAD_CFLAGS)
DLSUFFIX = .so DLSUFFIX = .so
ifeq ($(GCC), yes) ifeq ($(GCC), yes)
CFLAGS_SL = -fpic CFLAGS_SL = -fpic
...@@ -25,10 +28,8 @@ else ...@@ -25,10 +28,8 @@ else
SO_FLAGS = -G SO_FLAGS = -G
endif endif
# Rule for building a shared library from a single .o file
%.so: %.o %.so: %.o
$(CC) $(SO_FLAGS) -o $@ $< $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) $(SO_FLAGS) -o $@ $<
sqlmansect = 5sql sqlmansect = 5sql
# Unixware needs threads for everything that uses libpq
CFLAGS += $(PTHREAD_CFLAGS)
# $PostgreSQL: pgsql/src/makefiles/Makefile.win32,v 1.15 2010/01/20 09:30:07 heikki Exp $ # $PostgreSQL: pgsql/src/makefiles/Makefile.win32,v 1.16 2010/07/05 18:54:38 tgl Exp $
# Use replacement include files for those missing on Win32 # Use replacement include files for those missing on Win32
override CPPFLAGS+="-I$(top_srcdir)/src/include/port/win32" override CPPFLAGS+="-I$(top_srcdir)/src/include/port/win32"
...@@ -13,11 +13,6 @@ AROPT = crs ...@@ -13,11 +13,6 @@ AROPT = crs
DLSUFFIX = .dll DLSUFFIX = .dll
CFLAGS_SL = CFLAGS_SL =
%.dll: %.o
$(DLLTOOL) --export-all --output-def $*.def $<
$(DLLWRAP) -o $@ --def $*.def $< $(SHLIB_LINK)
rm -f $*.def
ifneq (,$(findstring backend,$(subdir))) ifneq (,$(findstring backend,$(subdir)))
ifeq (,$(findstring conversion_procs,$(subdir))) ifeq (,$(findstring conversion_procs,$(subdir)))
ifeq (,$(findstring snowball,$(subdir))) ifeq (,$(findstring snowball,$(subdir)))
...@@ -70,3 +65,9 @@ win32ver.rc: $(top_srcdir)/src/port/win32ver.rc ...@@ -70,3 +65,9 @@ win32ver.rc: $(top_srcdir)/src/port/win32ver.rc
win32ver.o: win32ver.rc win32ver.o: win32ver.rc
$(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(srcdir) $(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(srcdir)
# Rule for building a shared library from a single .o file
%.dll: %.o
$(DLLTOOL) --export-all --output-def $*.def $<
$(DLLWRAP) -o $@ --def $*.def $< $(SHLIB_LINK)
rm -f $*.def
# PGXS: PostgreSQL extensions makefile # PGXS: PostgreSQL extensions makefile
# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.19 2010/01/05 03:56:52 tgl Exp $ # $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.20 2010/07/05 18:54:38 tgl Exp $
# This file contains generic rules to build many kinds of simple # This file contains generic rules to build many kinds of simple
# extension modules. You only need to set a few variables and include # extension modules. You only need to set a few variables and include
...@@ -68,7 +68,6 @@ override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) ...@@ -68,7 +68,6 @@ override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
ifdef MODULES ifdef MODULES
override CFLAGS += $(CFLAGS_SL) override CFLAGS += $(CFLAGS_SL)
SHLIB_LINK += $(BE_DLLLIBS)
endif endif
ifdef MODULEDIR ifdef MODULEDIR
...@@ -287,5 +286,5 @@ endif ...@@ -287,5 +286,5 @@ endif
ifdef PROGRAM ifdef PROGRAM
$(PROGRAM): $(OBJS) $(PROGRAM): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(PG_LIBS) $(LDFLAGS) $(LIBS) -o $@ $(CC) $(CFLAGS) $(OBJS) $(PG_LIBS) $(LIBS) $(LDFLAGS) $(LDFLAGS_EX) -o $@
endif endif
# $PostgreSQL: pgsql/src/template/cygwin,v 1.7 2006/03/11 04:38:40 momjian Exp $ # $PostgreSQL: pgsql/src/template/cygwin,v 1.8 2010/07/05 18:54:38 tgl Exp $
SRCH_LIB="/usr/local/lib" SRCH_LIB="/usr/local/lib"
# This is required to link pg_dump because it finds pg_toupper() in # --allow-multiple-definition is required to link pg_dump because it finds
# libpq and pgport # pg_toupper() in both libpq and pgport
LDFLAGS="-Wl,--allow-multiple-definition -Wl,--enable-auto-import"
# --enable-auto-import gets rid of a diagnostics linker message # --enable-auto-import gets rid of a diagnostics linker message
LDFLAGS_SL="-Wl,--enable-auto-import" LDFLAGS="-Wl,--allow-multiple-definition -Wl,--enable-auto-import"
# This is required to link pg_dump because it finds pg_toupper() in # --allow-multiple-definition is required to link pg_dump because it finds
# libpq and pgport # pg_toupper() in both libpq and pgport
LDFLAGS="-Wl,--allow-multiple-definition" LDFLAGS="-Wl,--allow-multiple-definition"
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.82 2010/01/02 16:58:13 momjian Exp $ # $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.83 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -53,7 +53,7 @@ EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \ ...@@ -53,7 +53,7 @@ EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
all: submake-libpgport pg_regress$(X) all: submake-libpgport pg_regress$(X)
pg_regress$(X): pg_regress.o pg_regress_main.o pg_regress$(X): pg_regress.o pg_regress_main.o
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@ $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
# dependencies ensure that path changes propagate # dependencies ensure that path changes propagate
pg_regress.o: pg_regress.c $(top_builddir)/src/port/pg_config_paths.h pg_regress.o: pg_regress.c $(top_builddir)/src/port/pg_config_paths.h
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 2003-2010, PostgreSQL Global Development Group # Copyright (c) 2003-2010, PostgreSQL Global Development Group
# #
# $PostgreSQL: pgsql/src/test/thread/Makefile,v 1.6 2010/01/02 16:58:16 momjian Exp $ # $PostgreSQL: pgsql/src/test/thread/Makefile,v 1.7 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -18,7 +18,7 @@ all: thread_test ...@@ -18,7 +18,7 @@ all: thread_test
thread_test: thread_test.o thread_test: thread_test.o
# no need for $LIBS, might not be compiled yet # no need for $LIBS, might not be compiled yet
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(PTHREAD_LIBS) -o $@ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $^ $(PTHREAD_LIBS) -o $@
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f thread_test$(X) thread_test.o rm -f thread_test$(X) thread_test.o
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Makefile for the timezone library # Makefile for the timezone library
# IDENTIFICATION # IDENTIFICATION
# $PostgreSQL: pgsql/src/timezone/Makefile,v 1.32 2009/08/26 22:24:43 petere Exp $ # $PostgreSQL: pgsql/src/timezone/Makefile,v 1.33 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -47,7 +47,7 @@ ZIC= ./zic ...@@ -47,7 +47,7 @@ ZIC= ./zic
endif endif
zic: $(ZICOBJS) zic: $(ZICOBJS)
$(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
install: all installdirs install: all installdirs
ifeq (,$(with_system_tzdata)) ifeq (,$(with_system_tzdata))
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 2003-2010, PostgreSQL Global Development Group # Copyright (c) 2003-2010, PostgreSQL Global Development Group
# #
# $PostgreSQL: pgsql/src/tools/findoidjoins/Makefile,v 1.7 2010/01/02 16:58:16 momjian Exp $ # $PostgreSQL: pgsql/src/tools/findoidjoins/Makefile,v 1.8 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -19,7 +19,7 @@ OBJS= findoidjoins.o ...@@ -19,7 +19,7 @@ OBJS= findoidjoins.o
all: submake-libpq submake-libpgport findoidjoins all: submake-libpq submake-libpgport findoidjoins
findoidjoins: findoidjoins.o $(libpq_builddir)/libpq.a findoidjoins: findoidjoins.o $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) findoidjoins.o $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) findoidjoins.o $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f findoidjoins$(X) $(OBJS) rm -f findoidjoins$(X) $(OBJS)
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 2003-2010, PostgreSQL Global Development Group # Copyright (c) 2003-2010, PostgreSQL Global Development Group
# #
# $PostgreSQL: pgsql/src/tools/fsync/Makefile,v 1.8 2010/01/02 16:58:16 momjian Exp $ # $PostgreSQL: pgsql/src/tools/fsync/Makefile,v 1.9 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -19,7 +19,7 @@ OBJS= test_fsync.o ...@@ -19,7 +19,7 @@ OBJS= test_fsync.o
all: submake-libpq submake-libpgport test_fsync all: submake-libpq submake-libpgport test_fsync
test_fsync: test_fsync.o $(libpq_builddir)/libpq.a test_fsync: test_fsync.o $(libpq_builddir)/libpq.a
$(CC) $(CFLAGS) test_fsync.o $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) test_fsync.o $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f test_fsync$(X) $(OBJS) rm -f test_fsync$(X) $(OBJS)
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 2003-2010, PostgreSQL Global Development Group # Copyright (c) 2003-2010, PostgreSQL Global Development Group
# #
# $PostgreSQL: pgsql/src/tools/ifaddrs/Makefile,v 1.2 2010/01/02 16:58:16 momjian Exp $ # $PostgreSQL: pgsql/src/tools/ifaddrs/Makefile,v 1.3 2010/07/05 18:54:38 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -21,7 +21,7 @@ OBJS = test_ifaddrs.o ...@@ -21,7 +21,7 @@ OBJS = test_ifaddrs.o
all: test_ifaddrs all: test_ifaddrs
test_ifaddrs: test_ifaddrs.o $(libpq_backend_dir)/ip.o test_ifaddrs: test_ifaddrs.o $(libpq_backend_dir)/ip.o
$(CC) $(CFLAGS) test_ifaddrs.o $(libpq_backend_dir)/ip.o $(LDFLAGS) $(LIBS) -o $@$(X) $(CC) $(CFLAGS) test_ifaddrs.o $(libpq_backend_dir)/ip.o $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f test_ifaddrs$(X) $(OBJS) rm -f test_ifaddrs$(X) $(OBJS)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment