<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],&nbsp;and&nbsp;the interface to MySQL5&nbsp;is&nbsp;working&nbsp;on&nbsp;my&nbsp;Mac.&nbsp;&nbsp;I&nbsp;can&nbsp;try&nbsp;Ubuntu&nbsp;Jaunty&nbsp;tomorrow,&nbsp;but&nbsp;last&nbsp;I&nbsp;checked,&nbsp;that&nbsp;worked&nbsp;too. &nbsp;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 &nbsp; &nbsp; &nbsp; &nbsp;0 drwxr-xr-x &nbsp; &nbsp;9 gknauth &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp; 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 &nbsp; &nbsp; &nbsp; &nbsp;8 -rw-r--r-- &nbsp; &nbsp;1 gknauth &nbsp;wheel &nbsp; &nbsp; &nbsp; &nbsp; 824 Sep &nbsp;6 &nbsp;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 &nbsp; &nbsp; &nbsp; 16 -rw-r--r-- &nbsp; &nbsp;1 gknauth &nbsp;wheel &nbsp; &nbsp; &nbsp; &nbsp;4437 Sep &nbsp;6 &nbsp;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 &nbsp; &nbsp; &nbsp; &nbsp;0 drwxr-xr-x &nbsp; &nbsp;5 gknauth &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp; 170 Sep &nbsp;9 &nbsp;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 &nbsp; &nbsp; &nbsp; &nbsp;8 -rw-r--r-- &nbsp; &nbsp;1 gknauth &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp;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 &nbsp; &nbsp; &nbsp; 72 -rw-r--r-- &nbsp; &nbsp;1 gknauth &nbsp;staff &nbsp; &nbsp; &nbsp; 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 &nbsp; &nbsp; &nbsp; 40 -rw-r--r-- &nbsp; &nbsp;1 gknauth &nbsp;staff &nbsp; &nbsp; &nbsp; 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 &nbsp; &nbsp; &nbsp; 40 -rw-r--r-- &nbsp; &nbsp;1 gknauth &nbsp;staff &nbsp; &nbsp; &nbsp; 18412 Nov 13 &nbsp;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 &nbsp; &nbsp; &nbsp; &nbsp;8 -rw-r--r-- &nbsp; &nbsp;1 gknauth &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;82 Mar &nbsp;2 &nbsp;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 &nbsp; &nbsp; &nbsp; &nbsp;8 -rwxr-xr-x &nbsp; &nbsp;1 gknauth &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp;1303 Mar &nbsp;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 &nbsp; &nbsp; &nbsp; &nbsp;0 drwxr-xr-x &nbsp; &nbsp;4 gknauth &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp; 136 Mar &nbsp;2 &nbsp;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 &nbsp; &nbsp; &nbsp; &nbsp;8 -rw-r--r-- &nbsp; &nbsp;1 gknauth &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp; 102 Sep &nbsp;9 &nbsp;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 &nbsp; &nbsp; &nbsp; &nbsp;0 drwxr-xr-x &nbsp; &nbsp;3 gknauth &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp; 102 Sep &nbsp;9 &nbsp;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 &nbsp; &nbsp; &nbsp; &nbsp;8 -rw-r--r-- &nbsp; &nbsp;1 gknauth &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;38 Sep &nbsp;9 &nbsp;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;">&nbsp;&nbsp;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;">&nbsp;&nbsp;echo ""</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">&nbsp;&nbsp;echo " &nbsp;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;">&nbsp;&nbsp;echo ""</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">&nbsp;&nbsp;echo " &nbsp;setup svn &nbsp; &nbsp;# for $LPLT"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">&nbsp;&nbsp;echo " &nbsp;setup std &nbsp; &nbsp;# for $SPLT"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">&nbsp;&nbsp;echo ""</span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 12px;">&nbsp;&nbsp;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;">&nbsp;&nbsp;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;">&nbsp;&nbsp;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;">&nbsp;&nbsp;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;">&nbsp;&nbsp;*) 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;">&nbsp;&nbsp;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 " &nbsp;${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;">&nbsp;&nbsp;++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>