summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/mercury-extras/files/mercury-extras-10.04.1-iodbc.patch')
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-10.04.1-iodbc.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/dev-lang/mercury-extras/files/mercury-extras-10.04.1-iodbc.patch b/dev-lang/mercury-extras/files/mercury-extras-10.04.1-iodbc.patch
new file mode 100644
index 000000000000..df25b5bc9528
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-10.04.1-iodbc.patch
@@ -0,0 +1,69 @@
+diff -urN mercury-extras-10.04.1.orig/odbc/Mmakefile mercury-extras-10.04.1/odbc/Mmakefile
+--- mercury-extras-10.04.1.orig/odbc/Mmakefile 2006-04-03 18:19:54.000000000 +1200
++++ mercury-extras-10.04.1/odbc/Mmakefile 2010-09-06 19:44:01.000000000 +1200
+@@ -12,7 +12,7 @@
+ # The driver manager.
+ # Legal values for MODBC_DRIVER are MODBC_IODBC, MODBC_UNIX, and MODBC_MS.
+ # Feel free to add more (and handle them in odbc.m).
+-MODBC_DRIVER=MODBC_UNIX
++MODBC_DRIVER=MODBC_IODBC
+
+ # The database.
+ # Legal values for MODBC_DB are MODBC_MYSQL and MODBC_SQL_SERVER.
+@@ -41,17 +41,20 @@
+ # The following are for Debian.
+
+ # for unixODBC
+- MLLIBS=-lodbc -lpthread -lltdl -ldl
+-
++ MLLIBS=`iodbc-config --libs`
++ ODBC_CFLAGS=`iodbc-config --cflags`
+ # for iODBC
+ # MLLIBS=-liodbc l-pthread -ldl
+ # note: on a DEC Alpha using OSF1 remove the -ldl.
+ endif
+
+-MAIN_TARGET=odbc_test
++MAIN_TARGET=libodbc
+
+ .PHONY: depend
+-depend: odbc_test.depend
++depend: odbc.depend
++
++.PHONY: install
++install: libodbc.install
+
+ .PHONY: check
+ check:
+@@ -62,7 +65,7 @@
+ # `--no-ansi' is needed because the ODBC header files include C++-style
+ # "//" comments. `--no-ansi' allows recognition of C++-style "//" comments,
+ # presuming you have gcc version 2.7.1 or greater.
+-MGNUCFLAGS=--no-ansi -D$(MODBC_DRIVER) -D$(MODBC_DB) -I$(ODBC_INCL_DIR)
++MGNUCFLAGS=--no-ansi -D$(MODBC_DRIVER) -D$(MODBC_DB) $(ODBC_CFLAGS)
+
+ #-----------------------------------------------------------------------------#
+ #-----------------------------------------------------------------------------#
+diff -urN mercury-extras-10.04.1.orig/odbc/odbc.m mercury-extras-10.04.1/odbc/odbc.m
+--- mercury-extras-10.04.1.orig/odbc/odbc.m 2006-08-31 23:09:50.000000000 +1200
++++ mercury-extras-10.04.1/odbc/odbc.m 2010-09-06 19:44:01.000000000 +1200
+@@ -2000,8 +2000,8 @@
+ ** Arbitrary size, only needs to hold a
+ ** descriptive string like ""SQL Server"".
+ */
+- String new_dsn;
+- String new_desc;
++ LPSTR new_dsn;
++ LPSTR new_desc;
+ SWORD dsn_len;
+ SWORD desc_len;
+ SQLRETURN rc;
+@@ -2335,7 +2335,7 @@
+ SQLSMALLINT msg_len;
+ UCHAR message[SQL_MAX_MESSAGE_LENGTH];
+ UCHAR sql_state[SQL_SQLSTATE_SIZE + 1];
+- String mercury_message;
++ LPSTR mercury_message;
+ MR_Word new_message;
+
+ MR_ASSERT_IMPLY(connection_handle == SQL_NULL_HDBC,