# AIX make defaults to building *every* target of the first rule. Start with
# a single-target, empty rule to make the other targets non-default.
-# (We don't support AIX anymore, but if someone tries to build on AIX anyway,
-# at least they'll get the instructions to run 'configure' first.)
all:
all check install installdirs installcheck installcheck-parallel uninstall clean distclean maintainer-clean dist distcheck world check-world install-world installcheck-world:
# If LDLIBRARY exists and has a shlib extension, use it verbatim.
ldlibrary=`echo "${python_ldlibrary}" | sed -e 's/\.so$//' -e 's/\.dll$//' -e 's/\.dylib$//' -e 's/\.sl$//'`
+if test "$PORTNAME" = "aix"; then
+ # On AIX, '.a' should also be believed to be a shlib.
+ ldlibrary=`echo "${ldlibrary}" | sed -e 's/\.a$//'`
+fi
+
if test -e "${python_libdir}/${python_ldlibrary}" -a x"${python_ldlibrary}" != x"${ldlibrary}"
then
ldlibrary=`echo "${ldlibrary}" | sed "s/^lib//"`
# --with-template not given
case $host_os in
+ aix*) template=aix ;;
cygwin*|msys*) template=cygwin ;;
darwin*) template=darwin ;;
dragonfly*) template=netbsd ;;
# If LDLIBRARY exists and has a shlib extension, use it verbatim.
ldlibrary=`echo "${python_ldlibrary}" | sed -e 's/\.so$//' -e 's/\.dll$//' -e 's/\.dylib$//' -e 's/\.sl$//'`
+if test "$PORTNAME" = "aix"; then
+ # On AIX, '.a' should also be believed to be a shlib.
+ ldlibrary=`echo "${ldlibrary}" | sed -e 's/\.a$//'`
+fi
+
if test -e "${python_libdir}/${python_ldlibrary}" -a x"${python_ldlibrary}" != x"${ldlibrary}"
then
ldlibrary=`echo "${ldlibrary}" | sed "s/^lib//"`
fi
-# Note: We can test for libldap_r only after we know PTHREAD_LIBS
+# Note: We can test for libldap_r only after we know PTHREAD_LIBS;
+# also, on AIX, we may need to have openssl in LIBS for this step.
if test "$with_ldap" = yes ; then
_LIBS="$LIBS"
if test "$PORTNAME" != "win32"; then
# --with-template not given
case $host_os in
+ aix*) template=aix ;;
cygwin*|msys*) template=cygwin ;;
darwin*) template=darwin ;;
dragonfly*) template=netbsd ;;
AC_CHECK_LIB(zstd, ZSTD_compress, [], [AC_MSG_ERROR([library 'zstd' is required for ZSTD support])])
fi
-# Note: We can test for libldap_r only after we know PTHREAD_LIBS
+# Note: We can test for libldap_r only after we know PTHREAD_LIBS;
+# also, on AIX, we may need to have openssl in LIBS for this step.
if test "$with_ldap" = yes ; then
_LIBS="$LIBS"
if test "$PORTNAME" != "win32"; then
<para>
<productname>PostgreSQL</productname> can be expected to work on current
versions of these operating systems: Linux, Windows,
- FreeBSD, OpenBSD, NetBSD, DragonFlyBSD, macOS, Solaris, and illumos.
+ FreeBSD, OpenBSD, NetBSD, DragonFlyBSD, macOS, AIX, Solaris, and illumos.
Other Unix-like systems may also work but are not currently
being tested. In most cases, all CPU architectures supported by
a given operating system will work. Look in
Historical versions of <productname>PostgreSQL</productname> or POSTGRES
also ran on CPU architectures including Alpha, Itanium, M32R, M68K,
M88K, NS32K, PA-RISC, SuperH, and VAX,
- and operating systems including 4.3BSD, AIX, BEOS,
+ and operating systems including 4.3BSD, BEOS,
BSD/OS, DG/UX, Dynix, HP-UX, IRIX, NeXTSTEP, QNX, SCO, SINIX, Sprite, SunOS,
Tru64 UNIX, and ULTRIX.
</para>
installation issues.
</para>
+ <sect2 id="installation-notes-aix">
+ <title>AIX</title>
+
+ <indexterm zone="installation-notes-aix">
+ <primary>AIX</primary>
+ <secondary>installation on</secondary>
+ </indexterm>
+
+ <para>
+ You must use GCC
+ to build <productname>PostgreSQL</productname>
+ on <productname>AIX</productname>.
+ The native IBM compiler <command>xlc</command> is not supported.
+ </para>
+
+ <para>
+ Also, only 64-bit builds are supported. While the make-based build
+ system will automatically create 64-bit executables and libraries,
+ the meson build system requires you to
+ set <varname>OBJECT_MODE</varname> before building:
+<programlisting>
+export OBJECT_MODE=64
+meson setup ...
+</programlisting>
+ Failure to do that will usually manifest as complaints
+ from <application>ar</application> about files having the wrong
+ object file mode.
+ </para>
+
+ <para>
+ <productname>AIX</productname> versions before 7.2 are no longer
+ tested nor supported by the <productname>PostgreSQL</productname>
+ community.
+ </para>
+ </sect2>
+
<sect2 id="installation-notes-cygwin">
<title>Cygwin</title>
<variablelist>
+ <varlistentry>
+ <term><systemitem class="osname">AIX</systemitem>
+ <indexterm><primary>AIX</primary><secondary>IPC configuration</secondary></indexterm>
+ </term>
+ <listitem>
+ <para>
+ It should not be necessary to do
+ any special configuration for such parameters as
+ <varname>SHMMAX</varname>, as it appears this is configured to
+ allow all memory to be used as shared memory. That is the
+ sort of configuration commonly used for other databases such
+ as <application>DB/2</application>.</para>
+
+ <para> It might, however, be necessary to modify the global
+ <command>ulimit</command> information in
+ <filename>/etc/security/limits</filename>, as the default hard
+ limits for file sizes (<varname>fsize</varname>) and numbers of
+ files (<varname>nofiles</varname>) might be too low.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
<varlistentry>
<term><systemitem class="osname">FreeBSD</systemitem>
<indexterm><primary>FreeBSD</primary><secondary>IPC configuration</secondary></indexterm>
# that purpose.
portname = host_system
-if host_system == 'cygwin'
+if host_system == 'aix'
+ sema_kind = 'unnamed_posix'
+ library_path_var = 'LIBPATH'
+ export_file_format = 'aix'
+ export_fmt = '-Wl,-bE:@0@'
+ mod_link_args_fmt = ['-Wl,-bI:@0@']
+ mod_link_with_dir = 'libdir'
+ mod_link_with_name = '@0@.imp'
+
+ # We force 64-bit builds, because AIX doesn't play very nice with dynamic
+ # library loading in 32-bit mode: there's not enough address space.
+ cppflags += '-maix64'
+ ldflags += '-maix64'
+ # Note: it's also necessary to tell programs like 'ar' to work in 64-bit
+ # mode. Since meson, in its infinite wisdom, doesn't allow us either
+ # to pass '-X64' to ar or to set the OBJECT_MODE environment variable
+ # from here, we have to tell the user to set OBJECT_MODE.
+
+ # M:SRE sets a flag indicating that an object is a shared library.
+ ldflags_sl += '-Wl,-bM:SRE'
+ # -brtllib indicates binaries should use runtime-loaded shared libraries.
+ ldflags_be += '-Wl,-brtllib'
+
+ # On AIX, shared libraries are wrapped in static libraries and can have
+ # the same extension '.a'. Therefore we must refrain from trying to build
+ # static libraries alongside shared ones, or meson will complain about
+ # duplicate targets. Note however that we leave dlsuffix with its default
+ # value of '.so'; this results in using '.so' for loadable modules, which
+ # is fine.
+ build_static_lib = false
+
+elif host_system == 'cygwin'
sema_kind = 'unnamed_posix'
cppflags += '-D_GNU_SOURCE'
dlsuffix = '.dll'
override CPPFLAGS += -DSO_MAJOR_VERSION=$(SO_MAJOR_VERSION)
endif
+ifeq ($(PORTNAME), aix)
+ LINK.shared = $(COMPILER)
+ ifdef SO_MAJOR_VERSION
+ shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+ endif
+ haslibarule = yes
+ # $(exports_file) is also usable as an import file
+ exports_file = lib$(NAME).exp
+ BUILD.exports = ( echo '\#! $(shlib)'; $(AWK) '/^[^\#]/ {printf "%s\n",$$1}' $< ) > $@
+ ifneq (,$(SHLIB_EXPORTS))
+ LINK.shared += -Wl,-bE:$(exports_file)
+ endif
+endif
+
ifeq ($(PORTNAME), darwin)
ifdef soname
# linkable library
touch $@
endif #haslibarule
+# AIX wraps shared libraries inside a static library, which can be used both
+# for static and shared linking
+ifeq ($(PORTNAME), aix)
+$(stlib): $(shlib)
+ rm -f $(stlib)
+ $(AR) $(AROPT) $(stlib) $(shlib)
+endif # aix
+
ifeq (,$(filter cygwin win32,$(PORTNAME)))
# Normal case
endif
# Make sure we have a link to a name without any version numbers
ifneq ($(shlib), $(shlib_bare))
+# except on AIX, where that's not a thing
+ifneq ($(PORTNAME), aix)
rm -f $(shlib_bare)
$(LN_S) $(shlib) $(shlib_bare)
+endif # aix
endif # shlib_bare
endif # shlib_major
install-lib-shared: $(shlib) installdirs-lib
ifdef soname
+# we don't install $(shlib) on AIX
+# (see http://archives.postgresql.org/message-id/52EF20B2E3209443BC37736D00C3C1380A6E79FE@EXADV1.host.magwien.gv.at)
+ifneq ($(PORTNAME), aix)
$(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/$(shlib)'
ifneq ($(PORTNAME), cygwin)
ifneq ($(PORTNAME), win32)
endif
endif # not win32
endif # not cygwin
+endif # not aix
ifneq (,$(findstring $(PORTNAME),win32 cygwin))
$(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)'
endif
##########################################################################
-all: submake-libpgport submake-catalog-headers submake-utils-headers postgres
+all: submake-libpgport submake-catalog-headers submake-utils-headers postgres $(POSTGRES_IMP)
ifneq ($(PORTNAME), cygwin)
ifneq ($(PORTNAME), win32)
+ifneq ($(PORTNAME), aix)
postgres: $(OBJS)
$(CC) $(CFLAGS) $(call expand_subsys,$^) $(LDFLAGS) $(LIBS) -o $@
endif
endif
+endif
ifeq ($(PORTNAME), cygwin)
endif # win32
+ifeq ($(PORTNAME), aix)
+
+postgres: $(POSTGRES_IMP)
+ $(CC) $(CFLAGS) $(call expand_subsys,$(OBJS)) $(LDFLAGS) -Wl,-bE:$(top_builddir)/src/backend/$(POSTGRES_IMP) $(LIBS) -Wl,-brtllib -o $@
+
+# Linking to a single .o with -r is a lot faster than building a .a or passing
+# all objects to MKLDEXPORT.
+#
+# It looks alluring to use $(CC) -r instead of ld -r, but that doesn't
+# trivially work with gcc, due to gcc specific static libraries linked in with
+# -r.
+$(POSTGRES_IMP): $(OBJS)
+ ld -b64 -r -o SUBSYS.o $(call expand_subsys,$^)
+ $(MKLDEXPORT) SUBSYS.o . > $@
+ @rm -f SUBSYS.o
+
+endif # aix
+
$(top_builddir)/src/port/libpgport_srv.a: | submake-libpgport
$(call install_llvm_module,postgres,$(call expand_subsys, $(filter-out $(top_builddir)/src/timezone/objfiles.txt, $(SUBDIROBJS))))
endif
-install-bin: postgres installdirs
+install-bin: postgres $(POSTGRES_IMP) installdirs
$(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postgres$(X)'
+ifeq ($(MAKE_EXPORTS), true)
+ $(INSTALL_DATA) $(POSTGRES_IMP) '$(DESTDIR)$(pkglibdir)/$(POSTGRES_IMP)'
+ $(INSTALL_PROGRAM) $(MKLDEXPORT) '$(DESTDIR)$(pgxsdir)/$(MKLDEXPORT_DIR)/mkldexport.sh'
+endif
.PHONY: install-bin
$(MKDIR_P) '$(DESTDIR)$(libdir)'
endif
endif
+ifeq ($(MAKE_EXPORTS), true)
+ $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'
+ $(MKDIR_P) '$(DESTDIR)$(pgxsdir)/$(MKLDEXPORT_DIR)'
+endif
##########################################################################
uninstall:
rm -f '$(DESTDIR)$(bindir)/postgres$(X)'
+ifeq ($(MAKE_EXPORTS), true)
+ rm -f '$(DESTDIR)$(pkglibdir)/$(POSTGRES_IMP)'
+ rm -f '$(DESTDIR)$(pgxsdir)/$(MKLDEXPORT_DIR)/mkldexport.sh'
+endif
ifeq ($(PORTNAME), cygwin)
ifeq ($(MAKE_DLL), true)
rm -f '$(DESTDIR)$(libdir)/libpostgres.a'
##########################################################################
clean:
- rm -f $(LOCALOBJS) postgres$(X)
+ rm -f $(LOCALOBJS) postgres$(X) $(POSTGRES_IMP)
ifeq ($(PORTNAME), cygwin)
rm -f postgres.dll libpostgres.a
endif
# be restricted to b_pch=true.
backend_link_with += postgres_lib
+elif host_system == 'aix'
+ # The '.' argument leads mkldexport.sh to emit "#! .", which refers to the
+ # main executable, allowing extension libraries to resolve their undefined
+ # symbols to symbols in the postgres binary.
+ postgres_imp = custom_target('postgres.imp',
+ command: [files('port/aix/mkldexport.sh'), '@INPUT@', '.'],
+ input: postgres_lib,
+ output: 'postgres.imp',
+ capture: true,
+ install: true,
+ install_dir: dir_lib_pkg,
+ build_by_default: false,
+ )
+ # -Wl,-bE:exportfile indicates these symbols are exported by postgres binary
+ backend_link_args += '-Wl,-bE:@0@'.format(postgres_imp.full_path())
+ backend_link_depends += postgres_imp
+ install_data(
+ 'port/aix/mkldexport.sh',
+ install_dir: dir_pgxs / 'src/backend/port/aix')
endif
backend_input = []
--- /dev/null
+#!/bin/sh
+#
+# mkldexport
+# create an AIX exports file from an object file
+#
+# src/backend/port/aix/mkldexport.sh
+#
+# Usage:
+# mkldexport objectfile [location]
+# where
+# objectfile is the current location of the object file.
+# location is the eventual (installed) location of the
+# object file (if different from the current
+# working directory).
+#
+# On AIX, executables do not automatically expose their symbols to shared
+# modules. Extensions therefore cannot call functions in the main Postgres
+# binary unless those symbols are explicitly exported. Unlike other platforms,
+# AIX executables are not default symbol providers; each shared module must
+# link against an export list that defines which symbols it can use.
+#
+# The mkldexport.sh script fixes AIX's symbol export issue by generating an
+# explicit export list. It uses nm to gather all symbols from the Postgres
+# object files, then writes them into the export file. When invoked with ".",
+# it outputs #! ., which tells AIX the list applies to the main executable.
+# This way, extension modules can link against that list and resolve their
+# undefined symbols directly from the Postgres binary.
+#
+
+# Search for the nm command binary.
+if [ -x /usr/ucb/nm ]
+then NM=/usr/ucb/nm
+elif [ -x /usr/bin/nm ]
+then NM=/usr/bin/nm
+elif [ -x /usr/ccs/bin/nm ]
+then NM=/usr/ccs/bin/nm
+elif [ -x /usr/usg/bin/nm ]
+then NM=/usr/usg/bin/nm
+else echo "Fatal error: cannot find `nm' ... please check your installation."
+ exit 1
+fi
+
+# instruct nm to process 64-bit objects
+export OBJECT_MODE=64
+
+CMDNAME=`basename $0`
+if [ -z "$1" ]; then
+ echo "Usage: $CMDNAME object [location]"
+ exit 1
+fi
+OBJNAME=`basename $1`
+if [ "`basename $OBJNAME`" != "`basename $OBJNAME .o`" ]; then
+ OBJNAME=`basename $OBJNAME .o`.so
+fi
+if [ -z "$2" ]; then
+ echo '#!'
+else
+ if [ "$2" = "." ]; then
+ # for the base executable (AIX 4.2 and up)
+ echo '#! .'
+ else
+ echo '#!' $2
+ fi
+fi
+$NM -BCg $1 | \
+ egrep ' [TDB] ' | \
+ sed -e 's/.* //' | \
+ egrep -v '\$' | \
+ sed -e 's/^[.]//' | \
+ sort | \
+ uniq
/* Wrong object type or state */
case ENOTDIR: /* Not a directory */
case EISDIR: /* Is a directory */
+#if defined(ENOTEMPTY) && (ENOTEMPTY != EEXIST) /* same code on AIX */
case ENOTEMPTY: /* Directory not empty */
+#endif
edata->sqlerrcode = ERRCODE_WRONG_OBJECT_TYPE;
break;
#define PS_USE_SETPROCTITLE_FAST
#elif defined(HAVE_SETPROCTITLE)
#define PS_USE_SETPROCTITLE
-#elif defined(__linux__) || defined(__sun) || defined(__darwin__) || defined(__GNU__)
+#elif defined(__linux__) || defined(_AIX) || defined(__sun) || defined(__darwin__) || defined(__GNU__)
#define PS_USE_CLOBBER_ARGV
#elif defined(WIN32)
#define PS_USE_WIN32
/* Different systems want the buffer padded differently */
-#if defined(__linux__) || defined(__darwin__) || defined(__GNU__)
+#if defined(_AIX) || defined(__linux__) || defined(__darwin__) || defined(__GNU__)
#define PS_PADDING '\0'
#else
#define PS_PADDING ' '
--- /dev/null
+/*
+ * src/include/port/aix.h
+ */
+#include <stddef.h> /* for size_t */
+#include <sys/types.h> /* for uid_t and gid_t */
+#include <wchar.h> /* for wchar_t and locale_t */
+
+/* AIX has getpeereid(), but fails to declare it as of 7.3 */
+extern int getpeereid(int socket, uid_t *euid, gid_t *egid);
+
+/* AIX has wcstombs_l(), but fails to declare it as of 7.3 */
+extern size_t wcstombs_l(char *dest, const wchar_t *src, size_t n,
+ locale_t loc);
+
+/*
+ * AIX doesn't seem to have ever modernized pam_appl.h to include
+ * "const" in the declaration of PAM conversation procs. We can avoid
+ * a compile error by setting _PAM_LEGACY_NONCONST; that doesn't do
+ * anything in AIX's system headers, but it makes us omit the "const"
+ * in our own code. (Compare solaris.h.)
+ */
+#define _PAM_LEGACY_NONCONST 1
c_args: ecpg_compat_c_args,
dependencies: [frontend_shlib_code, thread_dep],
link_with: [ecpglib_so, ecpg_pgtypes_so],
- soversion: host_system != 'windows' ? '3' : '',
+ soversion: host_system not in ['aix', 'windows'] ? '3' : '',
darwin_versions: ['3', '3.' + pg_version_major.to_string()],
version: '3.' + pg_version_major.to_string(),
link_args: export_fmt.format(export_file.full_path()),
c_pch: pch_postgres_fe_h,
dependencies: [frontend_shlib_code, libpq, thread_dep],
link_with: ecpg_pgtypes_so,
- soversion: host_system != 'windows' ? '6' : '',
+ soversion: host_system not in ['aix', 'windows'] ? '6' : '',
darwin_versions: ['6', '6.' + pg_version_major.to_string()],
version: '6.' + pg_version_major.to_string(),
link_args: export_fmt.format(export_file.full_path()),
c_pch: pch_postgres_fe_h,
dependencies: frontend_shlib_code,
version: '3.' + pg_version_major.to_string(),
- soversion: host_system != 'windows' ? '3' : '',
+ soversion: host_system not in ['aix', 'windows'] ? '3' : '',
darwin_versions: ['3', '3.' + pg_version_major.to_string()],
link_args: export_fmt.format(export_file.full_path()),
link_depends: export_file,
# expect them to honor this coding rule.
libpq-refs-stamp: $(shlib)
ifneq ($(enable_coverage), yes)
+ifeq (,$(filter aix,$(PORTNAME)))
$(PERL) $(srcdir)/libpq_check.pl --input_file $< --nm='$(NM)'
+endif
endif
touch $@
# libpq_st, and {pgport,common}_shlib for libpq_sh
#
# We could try to avoid building the source files twice, but it probably adds
-# more complexity than its worth (reusing object files requires also linking
-# to the library on windows or breaks precompiled headers).
+# more complexity than its worth (AIX doesn't support link_whole yet, reusing
+# object files requires also linking to the library on windows or breaks
+# precompiled headers).
if build_static_lib
libpq_st = static_library('libpq',
libpq_sources,
c_args: libpq_c_args + libpq_so_c_args,
c_pch: pch_postgres_fe_h,
version: '5.' + pg_version_major.to_string(),
- soversion: host_system != 'windows' ? '5' : '',
+ soversion: host_system not in ['aix', 'windows'] ? '5' : '',
darwin_versions: ['5', '5.' + pg_version_major.to_string()],
dependencies: [frontend_shlib_code, libpq_deps],
link_depends: export_file,
--- /dev/null
+# MAKE_EXPORTS is required for svr4 loaders that want a file of
+# symbol names to tell them what to export/import.
+MAKE_EXPORTS= true
+
+# -blibpath must contain ALL directories where we should look for libraries
+libpath := $(shell echo $(subst -L,:,$(filter -L/%,$(LDFLAGS))) | sed -e's/ //g'):/opt/freeware/lib:/usr/lib:/lib
+
+# when building with gcc, need to make sure that libgcc can be found
+ifeq ($(GCC), yes)
+libpath := $(libpath):$(dir $(shell gcc -print-libgcc-file-name))
+endif
+
+rpath = -Wl,-blibpath:'$(rpathdir)$(libpath)'
+
+LDFLAGS_SL += -Wl,-bnoentry -Wl,-H512 -Wl,-bM:SRE
+
+# gcc needs to know it's building a shared lib, otherwise it'll not emit
+# correct code / link to the right support libraries
+ifeq ($(GCC), yes)
+LDFLAGS_SL += -shared
+endif
+
+# instruct ar to process 64-bit objects
+AROPT := -X64 $(AROPT)
+
+# env var name to use in place of LD_LIBRARY_PATH
+ld_library_path_var = LIBPATH
+
+
+POSTGRES_IMP= postgres.imp
+
+ifdef PGXS
+BE_DLLLIBS= -Wl,-bI:$(pkglibdir)/$(POSTGRES_IMP)
+else
+BE_DLLLIBS= -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP)
+endif
+
+MKLDEXPORT_DIR=src/backend/port/aix
+MKLDEXPORT=$(top_srcdir)/$(MKLDEXPORT_DIR)/mkldexport.sh
+
+%$(DLSUFFIX): %.o
+ $(CC) $(CFLAGS) $*.o $(LDFLAGS) $(LDFLAGS_SL) -o $@ $(BE_DLLLIBS)
from libpgport are linked first. This avoids having applications
dependent on symbols that are _used_ by libpq, but not intended to be
exported by libpq. libpq's libpgport usage changes over time, so such a
-dependency is a problem. Windows, Linux, and macOS use an export
+dependency is a problem. Windows, Linux, AIX, and macOS use an export
list to control the symbols exported by libpq.
return "ENOTCONN";
case ENOTDIR:
return "ENOTDIR";
+#if defined(ENOTEMPTY) && (ENOTEMPTY != EEXIST) /* same code on AIX */
case ENOTEMPTY:
return "ENOTEMPTY";
+#endif
case ENOTSOCK:
return "ENOTSOCK";
#ifdef ENOTSUP
--- /dev/null
+# src/template/aix
+
+# Prefer unnamed POSIX semaphores if available, unless user overrides choice
+if test x"$PREFERRED_SEMAPHORES" = x"" ; then
+ PREFERRED_SEMAPHORES=UNNAMED_POSIX
+fi
+
+# Extra CFLAGS for code that will go into a shared library
+CFLAGS_SL=""
+
+if test "$GCC" = yes; then
+ # We force 64-bit builds, because AIX doesn't play very nice with dynamic
+ # library loading in 32-bit mode: there's not enough address space.
+ CPPFLAGS="$CPPFLAGS -maix64"
+
+ # For large binaries/libraries, there will be TOC overflows in AIX. To
+ # avoid this, pass -bbigtoc linker option to enlarge TOC access range.
+ LDFLAGS="$LDFLAGS -maix64 -Wl,-bbigtoc"
+fi
# GNU make uses a make file named "GNUmakefile" in preference to "Makefile"
# if it exists. Postgres is shipped with a "GNUmakefile".
+
+# AIX make defaults to building *every* target of the first rule. Start with
+# a single-target, empty rule to make the other targets non-default.
+all:
+
all install clean check installcheck:
@echo "You must use GNU make to use Postgres. It may be installed"
@echo "on your system with the name 'gmake'."
'input:s' => \$input,
'output:s' => \$output) or die "wrong arguments";
-if (not( $format eq 'darwin'
+if (not( $format eq 'aix'
+ or $format eq 'darwin'
or $format eq 'gnu'
or $format eq 'win'))
{
- die "$0: $format is not yet handled (only darwin, gnu, win are)\n";
+ die "$0: $format is not yet handled (only aix, darwin, gnu, win are)\n";
}
open(my $input_handle, '<', $input)
or die "$0: could not open output file '$output': $!\n";
-if ($format eq 'gnu')
+if ($format eq 'aix')
+{
+ print $output_handle "#!\n";
+}
+elsif ($format eq 'gnu')
{
print $output_handle "{
global:
}
elsif (/^(\S+)\s+(\S+)/)
{
- if ($format eq 'darwin')
+ if ($format eq 'aix')
+ {
+ print $output_handle "$1\n";
+ }
+ elsif ($format eq 'darwin')
{
print $output_handle "_$1\n";
}
# These files are platform-specific, and c.h will include the
# one that's relevant for our current platform anyway.
+ test "$f" = src/include/port/aix.h && continue
test "$f" = src/include/port/cygwin.h && continue
test "$f" = src/include/port/darwin.h && continue
test "$f" = src/include/port/freebsd.h && continue