with_gnu_ld
LD
LDFLAGS_SL
+LDFLAGS_EX
ELF_SYS
EGREP
GREP
LIBS
CPPFLAGS
CPP
+LDFLAGS_EX
LDFLAGS_SL
DOCBOOKSTYLE'
CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
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
location of DocBook stylesheets
+
# Check whether --with-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
# If compiler will take -Wl,--as-needed (or various platform-specific
# spellings thereof) then add that to LDFLAGS. This is much easier than
# 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
# libreadline; therefore we postpone testing it until we know what library
# dependencies readline has. The test code will try to link with $LIBS.
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 Developers, please strive to achieve this order:
dnl
CPPFLAGS="$CPPFLAGS $INCLUDES"
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
AC_SUBST(LD)
# If compiler will take -Wl,--as-needed (or various platform-specific
# spellings thereof) then add that to LDFLAGS. This is much easier than
# 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
# libreadline; therefore we postpone testing it until we know what library
# 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">
<title><![%standalone-include[<productname>PostgreSQL</>]]>
<term><envar>LDFLAGS</envar></term>
<listitem>
<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>
</listitem>
</varlistentry>
<term><envar>LDFLAGS_SL</envar></term>
<listitem>
<para>
- linker options for shared library linking
+ additional options for linking shared libraries only
</para>
</listitem>
</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">
<refmeta>
</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>
<term><option>--ldflags_sl</option></>
<listitem>
<para>
Print the value of the <varname>LDFLAGS_SL</varname> variable that was used for building
<productname>PostgreSQL</>. This shows linker switches
- used for building shared libraries.
+ used for building shared libraries only.
</para>
</listitem>
</varlistentry>
<title>Notes</title>
<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
installed in the same location as the client headers, which could
be queried with the option <option>--includedir</option>. To make your
<option>--cc</option>, <option>--cppflags</option>,
<option>--cflags</option>, <option>--cflags_sl</option>,
<option>--ldflags</option>, <option>--ldflags_sl</option>,
- and <option>--libs</option> are new in <productname>PostgreSQL</> 8.1.
- The option <option>--htmldir</option> is new in <productname>PostgreSQL</> 8.4.
+ and <option>--libs</option> were added in <productname>PostgreSQL</> 8.1.
+ 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>
# -*-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,
with_gnu_ld = @with_gnu_ld@
ld_R_works = @ld_R_works@
LDFLAGS = @LDFLAGS@
+LDFLAGS_EX = @LDFLAGS_EX@
LDFLAGS_SL = @LDFLAGS_SL@
LDREL = -r
LDOUT = -o
LIBS := -lpgport $(LIBS)
# add location of libpgport.a to LDFLAGS
ifdef PGXS
-override LDFLAGS := -L$(libdir) $(LDFLAGS)
+ LDFLAGS += -L$(libdir)
else
-override LDFLAGS := -L$(top_builddir)/src/port $(LDFLAGS)
+ LDFLAGS += -L$(top_builddir)/src/port
endif
# to make ws2_32.lib the last library, and always link with shfolder,
# Copyright (c) 1998, Regents of the University of California
#
# 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 $
#
#-------------------------------------------------------------------------
-# Insert -L from LDFLAGS after any -L already present in SHLIB_LINK
-SHLIB_LINK := $(filter -L%, $(SHLIB_LINK)) $(filter -L%, $(LDFLAGS)) $(filter-out -L%, $(SHLIB_LINK))
-
-# Need a -L-free version of LDFLAGS to use in combination with SHLIB_LINK
-LDFLAGS_NO_L = $(filter-out -L%, $(LDFLAGS))
+# Automatically append LDFLAGS and LDFLAGS_SL to SHLIB_LINK
+SHLIB_LINK += $(LDFLAGS) $(LDFLAGS_SL)
ifdef SO_MAJOR_VERSION
# Default library naming convention used by the majority of platforms
ifndef soname
# additional flags for backend modules
-SHLIB_LINK := $(BE_DLLLIBS) $(SHLIB_LINK)
+SHLIB_LINK += $(BE_DLLLIBS)
endif
# For each platform we support shared libraries on, set shlib to the
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
endif
ifeq ($(with_gnu_ld), yes)
- LINK.shared = $(CC) $(LDFLAGS_NO_L) -shared
+ LINK.shared = $(CC) -shared
ifdef soname
LINK.shared += -Wl,-h -Wl,$(soname)
endif
else
- # can't use the CC-syntax rpath pattern here
- rpath =
LINK.shared = $(LD) -b
ifdef soname
LINK.shared += +h $(soname)
endif
+ # can't use the CC-syntax rpath pattern here, so instead:
+ rpath =
ifeq ($(enable_rpath), yes)
LINK.shared += +b '$(rpathdir)'
endif
# ld can find the same libraries gcc does. Make sure it goes after any
# -L switches provided explicitly.
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
- # 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)
SHLIB_LINK += `$(CC) $(LDFLAGS) -print-libgcc-file-name`
endif
haslibarule = yes
endif
-ifeq ($(enable_rpath), yes)
-SHLIB_LINK += $(rpath)
-endif
-
##
# Normal case
$(shlib): $(OBJS)
- $(LINK.shared) $(LDFLAGS_SL) $(OBJS) $(SHLIB_LINK) -o $@
+ $(LINK.shared) -o $@ $(OBJS) $(SHLIB_LINK)
ifdef shlib_major
# If we're using major and minor versions, then make a symlink to major-version-only.
ifneq ($(shlib), $(shlib_major))
$(LINK.static) $(stlib) $^
$(RANLIB) $(stlib)
$(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)
$(AR) $(AROPT) $(stlib) $(shlib)
endif
$(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)
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib $@
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# 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 $
#
#-------------------------------------------------------------------------
ifneq ($(PORTNAME), aix)
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
postgres: $(OBJS) postgres.def libpostgres.a
$(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
- $(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
postgres.def: $(OBJS)
postgres: $(OBJS) postgres.def libpostgres.a $(WIN32RES)
$(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
- $(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
postgres.def: $(OBJS)
ifeq ($(PORTNAME), aix)
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)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(call expand_subsys,$^)
# The postgres.o target is needed by the rule in Makefile.global that
# creates the exports file when MAKE_EXPORTS = true.
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
# are up to date. It saves the time of doing all the submakes.
.PHONY: quick
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
# be converted to Method 2.
#
# 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 $
#
#-------------------------------------------------------------------------
# IPC test program
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:
rm -f ipc_test ipc_test.o tas_cpp.s
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# 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 $
#
#-------------------------------------------------------------------------
all: submake-libpgport initdb
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
# exposes us to risks of version skew if we link to a shared library.
#
# 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 $
#
#-------------------------------------------------------------------------
override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\""
override CPPFLAGS += -DVAL_CFLAGS_SL="\"$(CFLAGS_SL)\""
override CPPFLAGS += -DVAL_LDFLAGS="\"$(STD_LDFLAGS)\""
+override CPPFLAGS += -DVAL_LDFLAGS_EX="\"$(LDFLAGS_EX)\""
override CPPFLAGS += -DVAL_LDFLAGS_SL="\"$(LDFLAGS_SL)\""
override CPPFLAGS += -DVAL_LIBS="\"$(LIBS)\""
all: submake-libpgport pg_config
pg_config: $(OBJS)
- $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -o $@$(X)
+ $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
install: all installdirs
$(INSTALL_SCRIPT) pg_config$(X) '$(DESTDIR)$(bindir)/pg_config$(X)'
*
* 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 $
*
*-------------------------------------------------------------------------
*/
}
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
show_ldflags_sl(bool all)
{
#ifdef VAL_LDFLAGS_SL
{"--cflags", show_cflags},
{"--cflags_sl", show_cflags_sl},
{"--ldflags", show_ldflags},
+ {"--ldflags_ex", show_ldflags_ex},
{"--ldflags_sl", show_ldflags_sl},
{"--libs", show_libs},
{"--version", show_version},
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(_(" --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(_(" --libs show LIBS value used when PostgreSQL was built\n"));
printf(_(" --version show the PostgreSQL version\n"));
#
# 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 $
#
#-------------------------------------------------------------------------
all: submake-libpgport pg_controldata
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
rm -f $@ && $(LN_S) $< .
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# 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 $
#
#-------------------------------------------------------------------------
all: submake-libpq submake-libpgport pg_ctl
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_PROGRAM) pg_ctl$(X) '$(DESTDIR)$(bindir)/pg_ctl$(X)'
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# 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 $
#
#-------------------------------------------------------------------------
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
- $(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
- $(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
- $(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_PROGRAM) pg_dump$(X) '$(DESTDIR)$(bindir)'/pg_dump$(X)
#
# 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 $
#
#-------------------------------------------------------------------------
all: submake-libpgport pg_resetxlog
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
rm -f $@ && $(LN_S) $< .
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# 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 $
#
#-------------------------------------------------------------------------
all: submake-libpq submake-libpgport psql
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
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# 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 $
#
#-------------------------------------------------------------------------
all: submake-libpq $(PROGRAMS)
%: %.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
createlang: createlang.o common.o print.o mbprint.o
#
# 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 $
#
#-------------------------------------------------------------------------
all: submake-libpgport ecpg
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
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
top_builddir = ../../../..
all: pg_regress$(X)
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:
$(MAKE) -C $(dir $@) $(notdir $@)
ECPG = ../../preproc/ecpg --regression -I$(srcdir)/../../include
%: %.c
- $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
+ $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
%.c: %.pgc ../regression.h
$(ECPG) -o $@ -I$(srcdir) $<
%.exp: %.o
$(MKLDEXPORT) $^ >$@
+# Rule for building a shared library from a single .o file
%$(DLSUFFIX): %.o %.exp
$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -o $@ $*.o -Wl,-bE:$*.exp $(SHLIB_LINK)
CFLAGS_SL =
endif
+# Rule for building a shared library from a single .o file
%.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
DLLWRAP= dllwrap
ifdef PGXS
DLSUFFIX = .dll
CFLAGS_SL =
-%.dll: %.o
- $(DLLTOOL) --export-all --output-def $*.def $<
- $(DLLWRAP) -o $@ --def $*.def $< $(SHLIB_LINK)
- rm -f $*.def
-
ifneq (,$(findstring backend,$(subdir)))
ifeq (,$(findstring conversion_procs,$(subdir)))
ifeq (,$(findstring snowball,$(subdir)))
ifneq (,$(findstring src/pl/plpython,$(subdir)))
override CPPFLAGS+= -DUSE_DL_IMPORT
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
-AWK= awk
DLSUFFIX = .so
-CFLAGS_SL =
ifdef PGXS
-BE_DLLLIBS= -bundle_loader $(bindir)/postgres
+ BE_DLLLIBS = -bundle_loader $(bindir)/postgres
else
-BE_DLLLIBS= -bundle_loader $(top_builddir)/src/backend/postgres
+ BE_DLLLIBS = -bundle_loader $(top_builddir)/src/backend/postgres
endif
-# Rule for building shared libs (currently used only for regression test
-# shlib ... should go away, since this is not really enough knowledge)
+# Rule for building a shared library from a single .o file
%.so: %.o
- $(CC) $(CFLAGS) -bundle -o $@ $< $(BE_DLLLIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -bundle -o $@ $< $(BE_DLLLIBS)
DLSUFFIX = .so
CFLAGS_SL = -fpic
+# Rule for building a shared library from a single .o file
%.so: %.o
- $(CC) -shared -o $@ $<
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
sqlmansect = 5
endif
+# Rule for building a shared library from a single .o file
%.so: %.o
ifdef ELF_SYSTEM
- $(CC) $(CFLAGS) -shared -o $@ $<
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
else
$(LD) $(LDREL) $(LDOUT) $<.obj -x $<
@echo building shared object $@
ifeq ($(with_gnu_ld), yes)
# XXX what to put here?
else
- LDFLAGS += -Wl,-z
+ LDFLAGS_EX += -Wl,-z
endif
# set up appropriate options for shared library builds
CFLAGS_SL = +Z
endif
-# Rule for building shared libs (currently used only for regression test
-# shlib ... should go away, since this is not really enough knowledge)
+# Rule for building a shared library from a single .o file
%$(DLSUFFIX): %.o
ifeq ($(GCC), 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
$(LD) -b -o $@ $< `$(CC) $(LDFLAGS) -print-libgcc-file-name`
endif
else
ifeq ($(with_gnu_ld), yes)
- $(CC) $(LDFLAGS) -shared -o $@ $<
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
else
$(LD) -b -o $@ $<
endif
# PIC is default
CFLAGS_SL =
-%.so: %.o
- $(CC) $(CFLAGS) -shared -o $@ $<
-
override CPPFLAGS += -U_NO_XOPEN4
ifneq ($(GCC), yes)
-CFLAGS += -woff 1164,1171,1185,1195,1552
+ CFLAGS += -woff 1164,1171,1185,1195,1552
endif
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
CFLAGS_SL = -fpic
endif
+# Rule for building a shared library from a single .o file
%.so: %.o
- $(CC) $(CFLAGS) -shared -o $@ $<
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
endif
+# Rule for building a shared library from a single .o file
%.so: %.o
ifdef ELF_SYSTEM
- $(CC) $(CFLAGS) -shared -o $@ $<
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
else
$(LD) $(LDREL) $(LDOUT) $<.obj -x $<
@echo building shared object $@
endif
+# Rule for building a shared library from a single .o file
%.so: %.o
ifdef ELF_SYSTEM
- $(CC) $(CFLAGS) -shared -o $@ $<
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
else
$(LD) $(LDREL) $(LDOUT) $<.obj -x $<
@echo building shared object $@
CFLAGS_SL =
rpath = -rpath '$(rpathdir)'
+# Rule for building a shared library from a single .o file
%.so: %.o
$(LD) -shared -expect_unresolved '*' -o $@ $<
CFLAGS_SL = -K PIC
endif
+# Rule for building a shared library from a single .o file
%.so: %.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
CFLAGS_SL = -KPIC
endif
+# Rule for building a shared library from a single .o file
%.so: %.o
ifeq ($(GCC), yes)
- $(CC) $(CFLAGS) -shared -o $@ $<
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
else
- $(CC) $(CFLAGS) -G -o $@ $<
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -G -o $@ $<
endif
sqlmansect = 5sql
CFLAGS_SL = -PIC
endif
+# Rule for building a shared library from a single .o file
%.so: %.o
$(LD) -assert pure-text -Bdynamic -o $@ $<
DLSUFFIX = .so
CFLAGS_SL =
+# Rule for building a shared library from a single .o file
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
# "-G 0" works for both DEC cc and GNU cc.
CFLAGS_SL = -G 0
+# Rule for building a shared library from a single .c file
%.so: %.c
- $(CC) -c -G 0 $(CPPFLAGS) $(CFLAGS) -o $@ $<
+ $(CC) -c -G 0 $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -o $@ $<
DLSUFFIX = .so
CFLAGS_SL = -K PIC
+# Rule for building a shared library from a single .o file
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
endif
endif
+# Unixware needs threads for everything that uses libpq
+CFLAGS += $(PTHREAD_CFLAGS)
+
DLSUFFIX = .so
ifeq ($(GCC), yes)
CFLAGS_SL = -fpic
SO_FLAGS = -G
endif
+# Rule for building a shared library from a single .o file
%.so: %.o
- $(CC) $(SO_FLAGS) -o $@ $<
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) $(SO_FLAGS) -o $@ $<
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
override CPPFLAGS+="-I$(top_srcdir)/src/include/port/win32"
DLSUFFIX = .dll
CFLAGS_SL =
-%.dll: %.o
- $(DLLTOOL) --export-all --output-def $*.def $<
- $(DLLWRAP) -o $@ --def $*.def $< $(SHLIB_LINK)
- rm -f $*.def
-
ifneq (,$(findstring backend,$(subdir)))
ifeq (,$(findstring conversion_procs,$(subdir)))
ifeq (,$(findstring snowball,$(subdir)))
win32ver.o: win32ver.rc
$(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
-# $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
# extension modules. You only need to set a few variables and include
ifdef MODULES
override CFLAGS += $(CFLAGS_SL)
-SHLIB_LINK += $(BE_DLLLIBS)
endif
ifdef MODULEDIR
ifdef PROGRAM
$(PROGRAM): $(OBJS)
- $(CC) $(CFLAGS) $(OBJS) $(PG_LIBS) $(LDFLAGS) $(LIBS) -o $@
+ $(CC) $(CFLAGS) $(OBJS) $(PG_LIBS) $(LIBS) $(LDFLAGS) $(LDFLAGS_EX) -o $@
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"
-# This is required to link pg_dump because it finds pg_toupper() in
-# libpq and pgport
-LDFLAGS="-Wl,--allow-multiple-definition -Wl,--enable-auto-import"
+# --allow-multiple-definition is required to link pg_dump because it finds
+# pg_toupper() in both libpq and pgport
# --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
-# libpq and pgport
+# --allow-multiple-definition is required to link pg_dump because it finds
+# pg_toupper() in both libpq and pgport
LDFLAGS="-Wl,--allow-multiple-definition"
-
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
# 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 $
#
#-------------------------------------------------------------------------
all: submake-libpgport pg_regress$(X)
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
pg_regress.o: pg_regress.c $(top_builddir)/src/port/pg_config_paths.h
#
# 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 $
#
#-------------------------------------------------------------------------
thread_test: thread_test.o
# 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:
rm -f thread_test$(X) thread_test.o
# Makefile for the timezone library
# 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 $
#
#-------------------------------------------------------------------------
endif
zic: $(ZICOBJS)
- $(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@$(X)
+ $(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
install: all installdirs
ifeq (,$(with_system_tzdata))
#
# 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 $
#
#-------------------------------------------------------------------------
all: submake-libpq submake-libpgport findoidjoins
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:
rm -f findoidjoins$(X) $(OBJS)
#
# 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 $
#
#-------------------------------------------------------------------------
all: submake-libpq submake-libpgport test_fsync
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:
rm -f test_fsync$(X) $(OBJS)
#
# 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 $
#
#-------------------------------------------------------------------------
all: test_ifaddrs
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:
rm -f test_ifaddrs$(X) $(OBJS)