Allow out-of-tree builds on mingw and cygwin
authorPeter Eisentraut <peter_e@gmx.net>
Mon, 5 Jan 2009 09:27:20 +0000 (09:27 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Mon, 5 Jan 2009 09:27:20 +0000 (09:27 +0000)
Author: Richard Evans <richard.evans@blueallegro.net>

src/Makefile.shlib
src/bin/pgevent/Makefile
src/interfaces/libpq/Makefile
src/makefiles/Makefile.win32

index 6aeaab4ddd67d426acb3f7276651894a76c11e91..a75d8b06ba1331bf590b7b8ae1df6bdf1139657d 100644 (file)
@@ -406,15 +406,16 @@ else # PORTNAME == cygwin || PORTNAME == win32
 
 # Cygwin or Win32 case
 
-DLL_DEFFILE = lib$(NAME)dll.def
-
 # If SHLIB_EXPORTS is set, the rules below will build a .def file from
 # that.  Else we build a temporary one here.
 ifeq (,$(SHLIB_EXPORTS))
+DLL_DEFFILE = lib$(NAME)dll.def
 exports_file = $(DLL_DEFFILE)
 
 $(exports_file): $(OBJS)
        $(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $@ $^
+else
+DLL_DEFFILE = $(srcdir)/lib$(NAME)dll.def
 endif
 
 $(shlib): $(OBJS) $(DLL_DEFFILE)
index 3512e6e642d8e165978f25258573664c96363798..6b61b93bdc98e52dc10bab179fb9cd59222356ee 100644 (file)
@@ -21,11 +21,11 @@ all: $(NAME)
 
 install: all install-lib
 
-pgevent.dll: $(OBJS) pgevent.def
-       $(DLLWRAP) --def pgevent.def -o $(NAME) $(OBJS)
+pgevent.dll: pgevent.def $(OBJS)
+       $(DLLWRAP) --def $< -o $(NAME) $(OBJS)
 
 pgmsgevent.o: pgmsgevent.rc win32ver.rc
-       $(WINDRES) pgmsgevent.rc -o pgmsgevent.o --include-dir=$(top_builddir)/src/include
+       $(WINDRES) $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(top_srcdir)/src/include --include-dir=$(srcdir)
 
 all-lib: $(NAME)
 
index 7512a016d7560403e32cebfa856d8b55f36f6ab6..3b9df766e59be721306b09a50a18802a175008bb 100644 (file)
@@ -19,7 +19,7 @@ NAME= pq
 SO_MAJOR_VERSION= 5
 SO_MINOR_VERSION= 2
 
-override CPPFLAGS :=  -DFRONTEND -DUNSAFE_STAT_OK -I$(srcdir) $(CPPFLAGS) -I$(top_builddir)/src/port
+override CPPFLAGS :=  -DFRONTEND -DUNSAFE_STAT_OK -I$(srcdir) $(CPPFLAGS) -I$(top_builddir)/src/port -I$(top_srcdir)/src/port
 ifneq ($(PORTNAME), win32)
 override CFLAGS += $(PTHREAD_CFLAGS)
 endif
index cda1c155ef2d8b45327347fa337567118333b9b9..3605b0b63592e35b77dadc4e2cd8a538aca4d40f 100644 (file)
@@ -67,4 +67,4 @@ win32ver.rc: $(top_srcdir)/src/port/win32ver.rc
        sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' $< >$@
 
 win32ver.o: win32ver.rc
-       $(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include
+       $(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(srcdir)