<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jun 25, 2009, at 23:43, Scott Hickey wrote:</div><blockquote type="cite"><div>I would like to get a mysql client working with the current version of<br>PLT-Scheme.<br></div></blockquote><div><br></div>I am using DrScheme version 4.2.0.2-svn27may2009 [3m], and the interface to MySQL5 is working on my Mac. I can try Ubuntu Jaunty tomorrow, but last I checked, that worked too. The <font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">setup</span></font> script mentioned below probably needs tweaking for Linux.</div><div><br></div><div><blockquote type="cite"><div>I tried used the code mentioned in a post a few months back at<br><a href="http://knauth.org/plt/mysql/">http://knauth.org/plt/mysql/</a><br><br>(require (lib "mysqlclient.ss" "mysqlclient"))<br>load-extension: couldn't open "/usr/local/plt/lib/plt/collects/<br>mysqlclient/compiled/native/i386-linux/3m/mysqlclient_ss.so" (/usr/<br>local/plt/lib/plt/collects/mysqlclient/compiled/native/i386-linux/3m/<br>mysqlclient_ss.so: undefined symbol: mysql_field_count)<br></div></blockquote><div><br></div></div>After I build DrScheme from SVN (through <font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">make install</span></font>), I do the following:<div><br></div><div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">cd ~/test/plt/projects/mysqlclient</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">./setup svn</span></font></div><br></div><div>The <font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">mysqlclient</span></font> directory looks like this:</div><div><br></div><div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">$ find . -ls</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">11177982 0 drwxr-xr-x 9 gknauth staff 306 Jun 26 02:01 .</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">10822037 8 -rw-r--r-- 1 gknauth wheel 824 Sep 6 2007 ./c-syntax-transformer.ss</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">10821995 16 -rw-r--r-- 1 gknauth wheel 4437 Sep 6 2007 ./c-syntax.ss</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">11194697 0 drwxr-xr-x 5 gknauth staff 170 Sep 9 2007 ./copied-headers</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">11194699 8 -rw-r--r-- 1 gknauth staff 3866 May 28 06:07 ./copied-headers/errmsg.h</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">11194698 72 -rw-r--r-- 1 gknauth staff 33581 May 28 06:07 ./copied-headers/mysql.h</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">11194700 40 -rw-r--r-- 1 gknauth staff 16845 May 28 06:07 ./copied-headers/mysqld_error.h</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">17123018 40 -rw-r--r-- 1 gknauth staff 18412 Nov 13 2007 ./mysqlclient.ss</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">27239871 8 -rw-r--r-- 1 gknauth staff 82 Mar 2 2008 ./README</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">85231228 8 -rwxr-xr-x 1 gknauth staff 1303 Mar 3 15:52 ./setup</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">11195294 0 drwxr-xr-x 4 gknauth staff 136 Mar 2 2008 ./test</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">11195304 8 -rw-r--r-- 1 gknauth staff 102 Sep 9 2007 ./test/gcc-test.c</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">11195301 0 drwxr-xr-x 3 gknauth staff 102 Sep 9 2007 ./test/obscure</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">11195315 8 -rw-r--r-- 1 gknauth staff 38 Sep 9 2007 ./test/obscure/hidden-message.h</span></font></div><br></div><div>The <font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">./setup</span></font> script I wrote looks like this:</div><div><br></div><div><div>#!/bin/sh</div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">LPLT=/usr/local/plt</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">SPLT="/Applications/PLT Scheme v4.2"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"># I run this after I have rebuilt DrScheme from SVN sources,</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"># to make sure I still have connectivity to MySQL.</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">usage () {</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> echo "usage: setup {svn|std}"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> echo ""</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> echo " Builds and installs mysqlclient.ss."</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> echo ""</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> echo " setup svn # for $LPLT"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> echo " setup std # for $SPLT"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> echo ""</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> exit 1</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">}</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">if [ $# -ne 1 ]; then</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> usage</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">fi</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">case $1 in</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> svn) BASE=${LPLT} ;;</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> std) BASE="${SPLT}" ;;</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> *) echo $usage; exit 1 ;;</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">esac</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">MZC="${BASE}/bin/mzc"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">TARGET="${BASE}/collects/mysqlclient"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">NATIVEDIR="${TARGET}/compiled/native/i386-macosx/3m"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">MYSQLINC=/opt/local/include/mysql5/mysql</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">MYSQLLDIR=/opt/local/lib/mysql5/mysql</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">MYSQLLIB=libmysqlclient.dylib</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">MYSQLHFILES="mysql.h errmsg.h mysqld_error.h"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">DBOPTS="-v --save-temps --debug ++ccf -save-temps"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">mkdir -p "${TARGET}"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">mkdir -p copied-headers</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">for i in ${MYSQLHFILES}; do</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> cp ${MYSQLINC}/$i copied-headers/</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">done</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">cp c-syntax-transformer.ss "${TARGET}"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">cp c-syntax.ss "${TARGET}"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">cp mysqlclient.ss "${TARGET}"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">echo Generated C files will be in:</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">echo " ${NATIVEDIR}"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">echo ""</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">echo cd "${TARGET}"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">cd "${TARGET}"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">CMD="${MZC} ${DBOPTS} --auto-dir --extension ++ldf ${MYSQLLDIR}/${MYSQLLIB} \</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;"> ++cppf -I${MYSQLINC} ++ccf -I${MYSQLINC} mysqlclient.ss"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">echo ${CMD}</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">${CMD}</span></font></div><br></div></body></html>