Fix build on 4.x.

Submitted by:	kris@ via email.
This commit is contained in:
Vanilla I. Shu 2006-06-09 02:44:50 +00:00
parent 9ed3800b4b
commit 0305da6e87
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=164870
4 changed files with 80 additions and 6 deletions

View file

@ -17,8 +17,7 @@ GNU_CONFIGURE= yes
USE_GMAKE= yes
USE_AUTOTOOLS= libtool:15
INSTALLS_SHLIB= yes
CONFIGURE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
PTHREAD_LIBS="${PTHREAD_LIBS}"
CONFIGURE_ENV= CPPFLAGS="${PTHREAD_CFLAGS}"
OPTIONS= MYSQL "Add MySQL support" on \
SQLITE " Add Sqlite support" on
@ -28,8 +27,8 @@ OPTIONS= MYSQL "Add MySQL support" on \
.if defined(WITH_MYSQL)
USE_MYSQL= yes
CONFIGURE_ARGS+= --with-mysql=${PREFIX}
CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include/mysql" \
LDFLAGS="-L${LOCALBASE}/lib/mysql"
CONFIGURE_ENV+= CPPFLAGS+="-I${LOCALBASE}/include/mysql" \
LDFLAGS+="-L${LOCALBASE}/lib/mysql"
.else
CONFIGURE_ARGS+= --without-mysql
.endif
@ -41,4 +40,7 @@ CONFIGURE_ARGS+= --with-sqlite=${PREFIX}
CONFIGURE_ARGS+= --without-sqlite
.endif
post-patch:
${REINPLACE_CMD} 's,%%PTHREAD_LIBS%%,${PTHREAD_LIBS},g' ${WRKSRC}/configure
.include <bsd.port.post.mk>

View file

@ -1,5 +1,36 @@
--- configure.orig Fri Feb 17 12:20:06 2006
+++ configure Fri Feb 17 12:21:32 2006
--- configure.orig Fri Mar 17 01:22:59 2006
+++ configure Fri Jun 9 10:08:08 2006
@@ -18909,10 +18909,10 @@
# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+LIBTOOL_DEPS=" /usr/local/share/libtool/ltmain.sh"
# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+LIBTOOL='$(SHELL) /usr/local/bin/libtool'
# Prevent multiple expansion
@@ -18947,7 +18947,7 @@
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
+LIBS="%%PTHREAD_LIBS%% $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -19010,7 +19010,7 @@
#define HAVE_LIBPTHREAD 1
_ACEOF
- LIBS="-lpthread $LIBS"
+ LIBS="%%PTHREAD_LIBS%% $LIBS"
else
{ { echo "$as_me:$LINENO: error: POSIX thread library is required" >&5
@@ -19185,7 +19185,7 @@
_ACEOF
@ -9,3 +40,12 @@
DB_CPPFLAGS="$DB_CPPFLAGS -I$with_mysql/include"
DB_LDFLAGS="$DB_LDFLAGS -L$with_mysql/lib/ -lmysqlclient"
else
@@ -20268,7 +20268,7 @@
# If the compiler is gcc, tune warnings and make the char type unsigned
if test "x$GCC" = "xyes"; then
- CFLAGS="$CFLAGS -Wall -Wunused -Wno-unused-label -funsigned-char";
+ #CFLAGS="$CFLAGS -Wall -Wunused -Wno-unused-label -funsigned-char";
# does this compiler support -Wno-pointer-sign ?
svd_CFLAGS="$CFLAGS"
CFLAGS="-Wno-pointer-sign $CFLAGS"

View file

@ -0,0 +1,13 @@
--- src/db/ConnectionPool.c.orig Fri Jun 9 10:11:12 2006
+++ src/db/ConnectionPool.c Fri Jun 9 10:11:19 2006
@@ -319,8 +319,9 @@
static int fillPool(T P) {
int i;
- P->error= NULL;
Connection_T con;
+
+ P->error= NULL;
for(i= 0; i < P->initialConnections; i++) {
if(! (con= Connection_new(P, &P->error))) {
if(i>0) {

View file

@ -0,0 +1,19 @@
--- test/pool.c.orig Fri Jun 9 10:12:00 2006
+++ test/pool.c Fri Jun 9 10:12:17 2006
@@ -270,7 +270,6 @@
int main(void) {
URL_T url;
char buf[BSIZE];
- ZBDEBUG= TRUE;
char *help= "Please enter a valid database connection URL and press ENTER\n"
"E.g. sqlite:///tmp/sqlite.db?synchronous=off&show_datatypes=off\n"
"E.g. mysql://localhost:3306/test?user=root&password=root\n"
@@ -278,6 +277,8 @@
printf("============> Start Connection Pool Tests\n\n");
printf("This test will create and drop a table called zild_t in the database\n");
printf("%s", help);
+
+ ZBDEBUG= TRUE;
while(fgets(buf, BSIZE, stdin)) {
if(*buf == '.')
break;