aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-05-03 16:07:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-05-03 16:07:52 +0000
commitf13cb7e524b157adef3a6571b13ba16cc93eddd8 (patch)
tree8105c498e552169e9c698099f9184b33df73b95d
parentb95ff0c54232a50fa1e52628a729dbe85218833c (diff)
downloadpostgresql-f13cb7e524b157adef3a6571b13ba16cc93eddd8.tar.gz
postgresql-f13cb7e524b157adef3a6571b13ba16cc93eddd8.zip
Fixes to make ecpg work on Cygwin, from Jason Tishler <Jason.Tishler@dothill.com>.
-rw-r--r--src/interfaces/ecpg/include/sqlca.h10
-rw-r--r--src/interfaces/ecpg/test/Makefile5
-rw-r--r--src/makefiles/Makefile.win6
3 files changed, 17 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/include/sqlca.h b/src/interfaces/ecpg/include/sqlca.h
index 319a5bc59f1..3f7e307da76 100644
--- a/src/interfaces/ecpg/include/sqlca.h
+++ b/src/interfaces/ecpg/include/sqlca.h
@@ -1,6 +1,14 @@
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
+#ifndef DLLIMPORT
+#ifdef __CYGWIN__
+#define DLLIMPORT __declspec (dllimport)
+#else
+#define DLLIMPORT
+#endif /* __CYGWIN__ */
+#endif /* DLLIMPORT */
+
#define SQLERRMC_LEN 70
#ifdef __cplusplus
@@ -45,7 +53,7 @@ extern "C"
char sqlext[8];
};
- extern struct sqlca sqlca;
+ extern DLLIMPORT struct sqlca sqlca;
#ifdef __cplusplus
diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile
index 3ac9b8d41ba..65a2c5b3a70 100644
--- a/src/interfaces/ecpg/test/Makefile
+++ b/src/interfaces/ecpg/test/Makefile
@@ -1,7 +1,8 @@
all: test1 test2 test3 test4 perftest dyntest dyntest2 test_notice test_code100 test_init
#LDFLAGS=-g -I /usr/local/pgsql/include -L/usr/local/pgsql/lib -lecpg -lpq
-LDFLAGS=-g -I ../include -I /usr/include/postgresql -L /usr/lib -lecpg -lpq
+LDFLAGS=-g -I ../include
+LDLIBS=-L ../lib -lecpg -L ../../libpq -lpq
#ECPG=/usr/local/pgsql/bin/ecpg -I../include
ECPG=../preproc/ecpg -I../include
@@ -24,4 +25,4 @@ test_text: test_text.c
$(ECPG) $?
clean:
- rm -f test1 test2 test3 test4 perftest *.c log dyntest dyntest2 test_notice test_code100 test_init test_text
+ rm -f test1 test2 test3 test4 perftest *.c log dyntest dyntest2 test_notice test_code100 test_init test_text *.exe
diff --git a/src/makefiles/Makefile.win b/src/makefiles/Makefile.win
index ce57e383ba4..8ebda2c08d2 100644
--- a/src/makefiles/Makefile.win
+++ b/src/makefiles/Makefile.win
@@ -1,4 +1,4 @@
-# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.10 2001/04/04 21:15:56 tgl Exp $
+# $Header: /cvsroot/pgsql/src/makefiles/Attic/Makefile.win,v 1.11 2001/05/03 16:07:52 tgl Exp $
LDFLAGS+= -g
DLLTOOL= dlltool
DLLWRAP= dllwrap
@@ -23,3 +23,7 @@ CFLAGS_SL =
ifeq ($(findstring backend,$(subdir)), backend)
override CPPFLAGS+= -DBUILDING_DLL=1
endif
+
+ifeq ($(findstring ecpg/lib,$(subdir)), ecpg/lib)
+override CPPFLAGS+= -DBUILDING_DLL=1
+endif