ifeq ($(enable_shared), no)
libpq += $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt, $(LIBS)) \
$(LDAP_LIBS_FE) $(PTHREAD_LIBS)
-else
-# On AIX even shared libraries do not remember their required libs,
-# so again add in what libpq depends on.
-ifeq ($(PORTNAME), aix)
-libpq += $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt, $(LIBS)) \
- $(LDAP_LIBS_FE) $(PTHREAD_LIBS)
-endif
endif
# This macro is for use by client executables (not libraries) that use libpq.
soname = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
ifeq ($(PORTNAME), aix)
- shlib = lib$(NAME)$(DLSUFFIX)
-# SHLIB_LINK += -lc
+ shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+ haslibarule = yes
endif
ifeq ($(PORTNAME), darwin)
else # PORTNAME == aix
# AIX case
-$(shlib): lib$(NAME).a
+$(shlib) lib$(NAME).a: $(OBJS)
+ $(LINK.static) lib$(NAME).a $^
+ $(RANLIB) lib$(NAME).a
$(MKLDEXPORT) lib$(NAME).a > lib$(NAME)$(EXPSUFF)
- $(COMPILER) $(LDFLAGS_NO_L) $(LDFLAGS_SL) -o $@ $< -Wl,-bE:lib$(NAME)$(EXPSUFF) $(SHLIB_LINK)
+ $(COMPILER) $(LDFLAGS_NO_L) $(LDFLAGS_SL) -o $(shlib) lib$(NAME).a -Wl,-bE:lib$(NAME)$(EXPSUFF) $(SHLIB_LINK)
+ rm -f lib$(NAME).a
+ $(AR) $(AROPT) lib$(NAME).a $(shlib)
endif # PORTNAME == aix
ifeq ($(enable_shared), yes)
install-lib-shared: $(shlib)
+ifneq ($(PORTNAME), aix) # we don't install $(shlib) on AIX
$(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/$(shlib)'
ifneq ($(PORTNAME), cygwin)
ifneq ($(PORTNAME), win32)
endif
endif # not win32
endif # not cygwin
+endif # not aix
endif # enable_shared
-I$(libpq_srcdir) $(CPPFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)
-override LDFLAGS := -L../../ecpglib -L../../pgtypeslib -L../../../libpq $(LDFLAGS)
-override LIBS := -lpgtypes -lecpg -lpq $(LIBS) $(PTHREAD_LIBS)
+override LDFLAGS := -L../../ecpglib -L../../pgtypeslib $(LDFLAGS)
+override LIBS := -lecpg -lpgtypes $(libpq) $(LIBS) $(PTHREAD_LIBS)
ECPG = ../../preproc/ecpg -I$(srcdir)/../../include
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/$(subdir)/../Makefile.regress
-# special informix compatiblity switches
+# special informix compatibility switches
ECPG += -C INFORMIX
ECPG_NOIND = $(ECPG) -r no_indicator
-override LDFLAGS += -L../../compatlib
-override LIBS += $(LIBS) -lecpg_compat
+
+override LDFLAGS := -L../../compatlib $(LDFLAGS)
+override LIBS := -lecpg_compat $(LIBS)
TESTS = test_informix test_informix.c \
test_informix2 test_informix2.c \
# Set up shared library paths, needed by psql and pg_encoding
# (if you run multibyte). LD_LIBRARY_PATH covers many platforms.
# DYLD_LIBRARY_PATH works on Darwin, and maybe other Mach-based systems.
+ # LIBPATH is for AIX.
# Feel free to account for others as well.
# ----------
fi
export DYLD_LIBRARY_PATH
+ if [ -n "$LIBPATH" ]; then
+ LIBPATH="$libdir:$LIBPATH"
+ else
+ LIBPATH=$libdir
+ fi
+ export LIBPATH
+
# ----------
# Windows needs shared libraries in PATH. (Only those linked into
# executables, not dlopen'ed ones)
RANLIB= touch
AROPT = crs
+# -blibpath must contain ALL directories where we should look for libraries
+libpath := $(shell echo $(subst -L,:,$(filter -L/%,$(LDFLAGS))) | sed -e's/ //g'):/usr/lib:/lib
+
+ifeq ($(host_os), aix3.2.5)
+ rpath = -L$(rpathdir)
+else
+ rpath = -Wl,-blibpath:$(rpathdir)$(libpath)
+endif
+
DLSUFFIX = .so
ifeq ($(host_os), aix3.2.5)
ifneq ($(GCC), yes)
* Set up shared library paths to include the temp install.
*
* LD_LIBRARY_PATH covers many platforms. DYLD_LIBRARY_PATH works on
- * Darwin, and maybe other Mach-based systems. Windows needs shared
- * libraries in PATH. (Only those linked into executables, not
- * dlopen'ed ones) Feel free to account for others as well.
+ * Darwin, and maybe other Mach-based systems. LIBPATH is for AIX.
+ * Windows needs shared libraries in PATH (only those linked into
+ * executables, not dlopen'ed ones).
+ * Feel free to account for others as well.
*/
add_to_path("LD_LIBRARY_PATH", ':', libdir);
add_to_path("DYLD_LIBRARY_PATH", ':', libdir);
+ add_to_path("LIBPATH", ':', libdir);
#if defined(WIN32) || defined(__CYGWIN__)
add_to_path("PATH", ';', libdir);
#endif