diff options
-rw-r--r-- | databases/myodbc/Makefile | 8 | ||||
-rw-r--r-- | databases/myodbc/files/patch-info.c | 34 | ||||
-rw-r--r-- | databases/mysql-connector-odbc/Makefile | 8 | ||||
-rw-r--r-- | databases/mysql-connector-odbc/files/patch-info.c | 34 |
4 files changed, 84 insertions, 0 deletions
diff --git a/databases/myodbc/Makefile b/databases/myodbc/Makefile index 3995532fb655..7ec968d8cee5 100644 --- a/databases/myodbc/Makefile +++ b/databases/myodbc/Makefile @@ -35,6 +35,14 @@ LIB_DEPENDS+= iodbc.3:${PORTSDIR}/databases/libiodbc CONFIGURE_ARGS+= --with-odbc-ini=${LOCALBASE}/etc/libiodbc/odbc.ini .endif +# Allow a new value of ODBCVER to be set at build-time +.if defined(ODBCVER) +post-patch: + cd ${WRKSRC}; \ + ${MV} myodbc.h myodbc.h.orig; \ + ${SED} -e "s/ODBCVER 0x0250/ODBCVER ${ODBCVER}/" < myodbc.h.orig > myodbc.h +.endif + # XXX untested .if defined(STATIC) CONFIGURE_ARGS+= --enable-shared=no \ diff --git a/databases/myodbc/files/patch-info.c b/databases/myodbc/files/patch-info.c new file mode 100644 index 000000000000..8ab380fab4d7 --- /dev/null +++ b/databases/myodbc/files/patch-info.c @@ -0,0 +1,34 @@ +--- info.c.orig Thu Sep 20 02:04:08 2001 ++++ info.c Tue Feb 5 10:57:03 2002 +@@ -171,11 +171,13 @@ + *pcbInfoValue=(SQLSMALLINT) (strmake((char*) rgbInfoValue,"Y",cbInfoValueMax) + - (char*) rgbInfoValue); + break; ++#if (ODBCVER < 0x0300) + #ifdef SQL_MAX_IDENTIFIER_LEN + case SQL_MAX_IDENTIFIER_LEN: + *((SQLUSMALLINT*) rgbInfoValue)=NAME_LEN; + break; + #endif ++#endif + case SQL_CONCAT_NULL_BEHAVIOR: + *((SQLSMALLINT*) rgbInfoValue)=SQL_CB_NULL; + *pcbInfoValue=sizeof(SQLSMALLINT); +@@ -188,7 +190,7 @@ + #ifdef SQL_CURSOR_SENSITIVITY + case SQL_CURSOR_SENSITIVITY: + *((SQLUINTEGER*) rgbInfoValue)=SQL_UNSPECIFIED; +- break ++ break; + #endif + case SQL_DEFAULT_TXN_ISOLATION: + *((long*) rgbInfoValue)= DEFAULT_TXN_ISOLATION; +@@ -411,7 +413,7 @@ + *pcbInfoValue=sizeof(long); + break; + #if (ODBCVER >= 0x0300) +- case SQL_MAX_IDENTIFIER_LENGTH: ++ case SQL_MAX_IDENTIFIER_LEN: + *((long*) rgbInfoValue)=NAME_LEN; + *pcbInfoValue=sizeof(long); + break; diff --git a/databases/mysql-connector-odbc/Makefile b/databases/mysql-connector-odbc/Makefile index 3995532fb655..7ec968d8cee5 100644 --- a/databases/mysql-connector-odbc/Makefile +++ b/databases/mysql-connector-odbc/Makefile @@ -35,6 +35,14 @@ LIB_DEPENDS+= iodbc.3:${PORTSDIR}/databases/libiodbc CONFIGURE_ARGS+= --with-odbc-ini=${LOCALBASE}/etc/libiodbc/odbc.ini .endif +# Allow a new value of ODBCVER to be set at build-time +.if defined(ODBCVER) +post-patch: + cd ${WRKSRC}; \ + ${MV} myodbc.h myodbc.h.orig; \ + ${SED} -e "s/ODBCVER 0x0250/ODBCVER ${ODBCVER}/" < myodbc.h.orig > myodbc.h +.endif + # XXX untested .if defined(STATIC) CONFIGURE_ARGS+= --enable-shared=no \ diff --git a/databases/mysql-connector-odbc/files/patch-info.c b/databases/mysql-connector-odbc/files/patch-info.c new file mode 100644 index 000000000000..8ab380fab4d7 --- /dev/null +++ b/databases/mysql-connector-odbc/files/patch-info.c @@ -0,0 +1,34 @@ +--- info.c.orig Thu Sep 20 02:04:08 2001 ++++ info.c Tue Feb 5 10:57:03 2002 +@@ -171,11 +171,13 @@ + *pcbInfoValue=(SQLSMALLINT) (strmake((char*) rgbInfoValue,"Y",cbInfoValueMax) + - (char*) rgbInfoValue); + break; ++#if (ODBCVER < 0x0300) + #ifdef SQL_MAX_IDENTIFIER_LEN + case SQL_MAX_IDENTIFIER_LEN: + *((SQLUSMALLINT*) rgbInfoValue)=NAME_LEN; + break; + #endif ++#endif + case SQL_CONCAT_NULL_BEHAVIOR: + *((SQLSMALLINT*) rgbInfoValue)=SQL_CB_NULL; + *pcbInfoValue=sizeof(SQLSMALLINT); +@@ -188,7 +190,7 @@ + #ifdef SQL_CURSOR_SENSITIVITY + case SQL_CURSOR_SENSITIVITY: + *((SQLUINTEGER*) rgbInfoValue)=SQL_UNSPECIFIED; +- break ++ break; + #endif + case SQL_DEFAULT_TXN_ISOLATION: + *((long*) rgbInfoValue)= DEFAULT_TXN_ISOLATION; +@@ -411,7 +413,7 @@ + *pcbInfoValue=sizeof(long); + break; + #if (ODBCVER >= 0x0300) +- case SQL_MAX_IDENTIFIER_LENGTH: ++ case SQL_MAX_IDENTIFIER_LEN: + *((long*) rgbInfoValue)=NAME_LEN; + *pcbInfoValue=sizeof(long); + break; |