From 1ae9a130d9c20436b46a0d59e5d3f89aedd0aba8 Mon Sep 17 00:00:00 2001 From: glarkin Date: Mon, 9 Nov 2009 22:28:39 +0000 Subject: - Fix linker errors after recent SQLite3 update. Certain non-public SQLite3 functions were used by cvstrac, and they were recently made intern, causing the linker errors. See: http://osdir.com/ml/sqlite-users/2009-07/msg00300.html Reported by: pointyhat (pav) --- devel/cvstrac/files/patch-Makefile | 6 +- devel/cvstrac/files/patch-cgi.c | 38 +++++++++++++ devel/cvstrac/files/patch-db.c | 110 ++++++++++++++++++++++++++++++++++--- devel/cvstrac/files/patch-format.c | 32 +++++++++++ devel/cvstrac/files/patch-main.mk | 11 ++++ devel/cvstrac/files/patch-search.c | 32 +++++++++++ devel/cvstrac/files/patch-view.c | 20 +++++++ 7 files changed, 237 insertions(+), 12 deletions(-) create mode 100644 devel/cvstrac/files/patch-cgi.c create mode 100644 devel/cvstrac/files/patch-format.c create mode 100644 devel/cvstrac/files/patch-main.mk create mode 100644 devel/cvstrac/files/patch-search.c create mode 100644 devel/cvstrac/files/patch-view.c diff --git a/devel/cvstrac/files/patch-Makefile b/devel/cvstrac/files/patch-Makefile index 1e40f2f7ab18..b216efed9f03 100644 --- a/devel/cvstrac/files/patch-Makefile +++ b/devel/cvstrac/files/patch-Makefile @@ -1,5 +1,5 @@ ---- Makefile.orig Thu May 8 10:58:17 2003 -+++ Makefile Thu May 8 10:58:32 2003 +--- ./Makefile.orig 2009-11-09 17:15:57.000000000 -0500 ++++ ./Makefile 2009-11-09 17:15:57.000000000 -0500 @@ -0,0 +1,34 @@ +#!/usr/bin/make +# @@ -21,7 +21,7 @@ +# will run on the target platform. This is usually the same +# as BCC, unless you are cross-compiling. +# -+TCC = gcc -g -O0 -Wall -I$(LOCALBASE)/include -lm ++TCC = gcc -g -O0 -Wall -I$(LOCALBASE)/include + +#### Extra arguments for linking against SQLite +# diff --git a/devel/cvstrac/files/patch-cgi.c b/devel/cvstrac/files/patch-cgi.c new file mode 100644 index 000000000000..27fbed390ab8 --- /dev/null +++ b/devel/cvstrac/files/patch-cgi.c @@ -0,0 +1,38 @@ +--- ./cgi.c.orig 2006-12-13 19:45:51.000000000 -0500 ++++ ./cgi.c 2009-11-09 17:15:57.000000000 -0500 +@@ -57,13 +57,6 @@ + #endif /* INTERFACE */ + + /* +-** Provide a reliable implementation of a caseless string comparison +-** function. +-*/ +-#define stricmp sqlite3StrICmp +-extern int sqlite3StrICmp(const char*, const char*); +- +-/* + ** The body of the HTTP reply text is stored here. + */ + static int nAllocTxt = 0; /* Amount of space allocated for HTTP reply text */ +@@ -669,17 +662,17 @@ + nArg = tokenize_line(zLine, sizeof(azArg)/sizeof(azArg[0]), azArg); + for(i=0; i. If the or the is missing, return 0. + */ +-extern int sqlite3StrNICmp(const char *, const char*, int); + static int is_html(const char *z){ + int i; +- if( sqlite3StrNICmp(z, "", 6) ) return 0; ++ if( sqlite3_strnicmp(z, "", 6) ) return 0; + for(i=6; z[i]; i++){ +- if( z[i]=='<' && sqlite3StrNICmp(&z[i],"",7)==0 ) return i+7; ++ if( z[i]=='<' && sqlite3_strnicmp(&z[i],"",7)==0 ) return i+7; + } + return 0; + } diff --git a/devel/cvstrac/files/patch-main.mk b/devel/cvstrac/files/patch-main.mk new file mode 100644 index 000000000000..357032f56e42 --- /dev/null +++ b/devel/cvstrac/files/patch-main.mk @@ -0,0 +1,11 @@ +--- ./main.mk.orig 2009-11-09 17:16:12.000000000 -0500 ++++ ./main.mk 2009-11-09 17:16:19.000000000 -0500 +@@ -115,7 +115,7 @@ + $(BCC) -o maketestdb $(SRCDIR)/maketestdb.c $(LIBSQLITE) + + $(APPNAME): headers $(OBJ) +- $(TCC) -o $(APPNAME) $(OBJ) $(LIBSQLITE) ++ $(TCC) -o $(APPNAME) $(OBJ) $(LIBSQLITE) -lm + + index.html: $(SRCDIR)/webpage.html $(SRCDIR)/VERSION + sed -f $(SRCDIR)/VERSION $(SRCDIR)/webpage.html >index.html diff --git a/devel/cvstrac/files/patch-search.c b/devel/cvstrac/files/patch-search.c new file mode 100644 index 000000000000..138142dfe34d --- /dev/null +++ b/devel/cvstrac/files/patch-search.c @@ -0,0 +1,32 @@ +--- ./search.c.orig 2006-12-13 19:27:25.000000000 -0500 ++++ ./search.c 2009-11-09 17:15:57.000000000 -0500 +@@ -29,11 +29,6 @@ + + + /* +-** We'll use this routine in several places. +-*/ +-extern int sqlite3StrNICmp(const char*,const char*,int); +- +-/* + ** Search for a keyword in text. Return a matching score: + ** + ** 0 No sign of the word was found in the text +@@ -54,7 +49,7 @@ + } + if( n<=0 ) n = strlen(zWord); + for(i=0; zText[i]; i++){ +- if( (zText[i]==c1 || zText[i]==c2) && sqlite3StrNICmp(zWord,&zText[i],n)==0){ ++ if( (zText[i]==c1 || zText[i]==c2) && sqlite3_strnicmp(zWord,&zText[i],n)==0){ + int score = 6; + if( (i==0 || !isalnum(zText[i-1])) + && (zText[i+n]==0 || !isalnum(zText[i+n])) ){ +@@ -282,7 +277,7 @@ + int n; + if( tolower(c)!=tolower(azKey[k][0]) ) continue; + n = keySize[k]; +- if( sqlite3StrNICmp(&zAll[j],azKey[k],n)==0 ){ ++ if( sqlite3_strnicmp(&zAll[j],azKey[k],n)==0 ){ + strcpy(z,""); + z += 3; + while( n ){ diff --git a/devel/cvstrac/files/patch-view.c b/devel/cvstrac/files/patch-view.c new file mode 100644 index 000000000000..5c039d1299c3 --- /dev/null +++ b/devel/cvstrac/files/patch-view.c @@ -0,0 +1,20 @@ +--- ./view.c.orig 2007-01-27 18:29:39.000000000 -0500 ++++ ./view.c 2009-11-09 17:15:57.000000000 -0500 +@@ -219,8 +219,6 @@ + ** pointer to an error message string (obtained from malloc) if + ** there is a problem. + */ +-extern int sqlite3StrNICmp(const char*,const char*,int); +-extern int sqlite3StrICmp(const char*,const char*); + char *verify_sql_statement(char *zSql){ + int i; + +@@ -228,7 +226,7 @@ + ** the first token is "SELECT" and that there are no unquoted semicolons. + */ + for(i=0; isspace(zSql[i]); i++){} +- if( sqlite3StrNICmp(&zSql[i],"select",6)!=0 ){ ++ if( sqlite3_strnicmp(&zSql[i],"select",6)!=0 ){ + return mprintf("The SQL must be a SELECT statement"); + } + for(i=0; zSql[i]; i++){ -- cgit