From 23c3fd58d65309e2ee6cc5ada9c3dee37110c70d Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Tue, 23 Dec 2014 05:01:38 -0800 Subject: [PATCH 1/2] Install shared libraries in bin/ and lib/ with MinGW/cygwin Those libraries can be found by scanning for SO_MAJOR_VERSION in their respective Makefiles. --- src/Makefile.shlib | 11 ++++++++++- src/interfaces/libpq/Makefile | 9 --------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 674fe7e..c3af1fe 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib @@ -486,6 +486,9 @@ endif endif # not win32 endif # not cygwin endif # not aix +ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' +endif else # no soname $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' endif @@ -494,7 +497,10 @@ endif installdirs-lib: ifdef soname $(MKDIR_P) '$(DESTDIR)$(libdir)' '$(DESTDIR)$(pkgconfigdir)' -else +ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(MKDIR_P) '$(DESTDIR)$(bindir)' +endif +else # no soname $(MKDIR_P) '$(DESTDIR)$(pkglibdir)' endif @@ -511,6 +517,9 @@ ifdef soname '$(DESTDIR)$(libdir)/$(shlib_major)' \ '$(DESTDIR)$(libdir)/$(shlib)' \ '$(DESTDIR)$(pkgconfigdir)/lib$(NAME).pc' +ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + rm -f '$(DESTDIR)$(bindir)/$(shlib)' +endif else # no soname rm -f '$(DESTDIR)$(pkglibdir)/$(shlib)' endif # no soname diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile index 18d9b85..5f0042e 100644 --- a/src/interfaces/libpq/Makefile +++ b/src/interfaces/libpq/Makefile @@ -125,18 +125,12 @@ install: all installdirs install-lib $(INSTALL_DATA) $(srcdir)/libpq-int.h '$(DESTDIR)$(includedir_internal)' $(INSTALL_DATA) $(srcdir)/pqexpbuffer.h '$(DESTDIR)$(includedir_internal)' $(INSTALL_DATA) $(srcdir)/pg_service.conf.sample '$(DESTDIR)$(datadir)/pg_service.conf.sample' -ifneq (,$(findstring $(PORTNAME), win32 cygwin)) - $(INSTALL_SHLIB) $(shlib) '$(DESTDIR)$(bindir)/$(shlib)' -endif installcheck: $(MAKE) -C test $@ installdirs: installdirs-lib $(MKDIR_P) '$(DESTDIR)$(includedir)' '$(DESTDIR)$(includedir_internal)' '$(DESTDIR)$(datadir)' -ifneq (,$(findstring $(PORTNAME), win32 cygwin)) - $(MKDIR_P) '$(DESTDIR)$(bindir)' -endif uninstall: uninstall-lib rm -f '$(DESTDIR)$(includedir)/libpq-fe.h' @@ -144,9 +138,6 @@ uninstall: uninstall-lib rm -f '$(DESTDIR)$(includedir_internal)/libpq-int.h' rm -f '$(DESTDIR)$(includedir_internal)/pqexpbuffer.h' rm -f '$(DESTDIR)$(datadir)/pg_service.conf.sample' -ifneq (,$(findstring $(PORTNAME), win32 cygwin)) - rm -f '$(DESTDIR)$(bindir)/$(shlib)' -endif clean distclean: clean-lib $(MAKE) -C test $@ -- 2.2.1