Re: clsql-mysql for CLSQL 4.1.1 doesn't compile

Bjorn Solberg <[email protected]>
Newsgroups gmane.lisp.clsql.general
Message-ID <[email protected]>
Kevin Rosenberg writes:

> Carlos Konstanski wrote:
>> Make sure your system time is correct.  Then clear all your .fasl
>> files in ~/.fasls/.  I have seen this problem in the past, and I think
>> it has to do with ASDF using file timestamps in a way that can cause a
>> problem if an existing .fasl file has a timestamp that is "in the
>> future".

> I'm not familiar with the usage of asdf-install, but it does seem like
> some sort of recurrent loading. So, deleting dependant fasls makes
> sense.

Yes, you are correct, the date on the host was off by a couple of days,
behind some of the lisp files.  Fixing the date took care of the
problem.

I noticed that the include path for compiling db-mysql was off for my
install (MySQL installed into the "standard" location /usr/local/mysql),
the following patch fixed it for me:

diff --git a/db-mysql/Makefile b/db-mysql/Makefile
index 6891f18..f407231 100644
--- a/db-mysql/Makefile
+++ b/db-mysql/Makefile
@@ -27,8 +27,8 @@ shared_lib=$(base).so
 .PHONY: all
 all: $(shared_lib)
 
-CFLAGS=-I /usr/local/include/mysql -I /usr/include/mysql -I /sw/include/mysql -I /opt/local/include/mysql -I /opt/local/include/mysql5/mysql -I /usr/local/mysql/include
-LDFLAGS=-L/usr/local/lib64/mysql -L/usr/local/mysql/lib32 -L/usr/local/lib/mysql -L/usr/lib/mysql -L/sw/lib -L/opt/local/lib/mysql -L/opt/local/lib/mysql5/mysql -L/usr/local/mysql/lib -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -lmysqlclient -lz -lc
+CFLAGS=-I /usr/local/include/mysql -I /usr/include/mysql -I /sw/include/mysql -I /opt/local/include/mysql -I /opt/local/include/mysql5/mysql -I /usr/local/mysql/include -I /usr/local/mysql/include/mysql
+LDFLAGS=-L/usr/local/lib64/mysql -L/usr/local/mysql/lib32 -L/usr/local/lib/mysql -L/usr/lib/mysql -L/sw/lib -L/opt/local/lib/mysql -L/opt/local/lib/mysql5/mysql -L/usr/local/mysql/lib -L/usr/local/mysql/lib/mysql -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -lmysqlclient -lz -lc


A better solution is perhaps this

diff --git a/db-mysql/Makefile b/db-mysql/Makefile
index 6891f18..4c4adca 100644
--- a/db-mysql/Makefile
+++ b/db-mysql/Makefile
@@ -27,8 +27,8 @@ shared_lib=$(base).so
 .PHONY: all
 all: $(shared_lib)
 
-CFLAGS=-I /usr/local/include/mysql -I /usr/include/mysql -I /sw/include/mysql -I /opt/local/include/mysql -I /opt/local/include/mysql5/mysql -I /usr/local/mysql/include
-LDFLAGS=-L/usr/local/lib64/mysql -L/usr/local/mysql/lib32 -L/usr/local/lib/mysql -L/usr/lib/mysql -L/sw/lib -L/opt/local/lib/mysql -L/opt/local/lib/mysql5/mysql -L/usr/local/mysql/lib -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -lmysqlclient -lz -lc
+CFLAGS=`mysql_config --include`
+LDFLAGS=`mysql_config --libs | sed s/-rdynamic//`
 
 ifneq ($(OS_CYGWIN),0)
   CFLAGS=-I /cygdrive/c/Program\ Files/MySQL/MySQL\ Server\ 5.0/include


or require GNU Make and do

diff --git a/db-mysql/Makefile b/db-mysql/Makefile
index 6891f18..766b0b3 100644
--- a/db-mysql/Makefile
+++ b/db-mysql/Makefile
@@ -27,8 +27,8 @@ shared_lib=$(base).so
 .PHONY: all
 all: $(shared_lib)
 
-CFLAGS=-I /usr/local/include/mysql -I /usr/include/mysql -I /sw/include/mysql -I /opt/local/include/mysql -I /opt/local/include/mysql5/mysql -I /usr/local/mysql/include
-LDFLAGS=-L/usr/local/lib64/mysql -L/usr/local/mysql/lib32 -L/usr/local/lib/mysql -L/usr/lib/mysql -L/sw/lib -L/opt/local/lib/mysql -L/opt/local/lib/mysql5/mysql -L/usr/local/mysql/lib -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -lmysqlclient -lz -lc
+CFLAGS  := $(shell mysql_config --include)
+LDFLAGS := $(shell mysql_config --libs | sed s/-rdynamic//)
 
 ifneq ($(OS_CYGWIN),0)
   CFLAGS=-I /cygdrive/c/Program\ Files/MySQL/MySQL\ Server\ 5.0/include



Thanks for your help!

Bjorn.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.