1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
OCaml-MySQL -- MySQL access for OCaml
*************************************
http://ocaml-mysql.forge.ocamlcore.org/
=======================================
Based on a release by:
Shawn Wagner
shawnw@speakeasy.org
http://raevnos.pennmush.org/code/ocaml-mysql
============================================
Based on a release by:
Christian Lindig
lindig@eecs.harvard.edu
http://www.eecs.harvard.edu/~lindig
===================================
ocaml-mysql is a package for OCaml that provides access to mysql
databases. It consists of low-level C bindings to libmysqlclient and a
module Mysql intended for application development.
1 Building
*=*=*=*=*=*
Compiling this package from sources requires the following software to
be installed on your system:
1. ocaml 3.09 or above.
2. findlib
3. The mysql client library and header files.
4. An ANSI C compiler like gcc.
A configure script is provided which should help to find the
particular files. In case configure fails, edit the setting in the
config file directly. This also applies when the C compiler fails to
find some include file. However, you should first try the obvious:
<<
% ./configure
% make
% make opt
% make install
>>
This creates the mysql libraries.
1' Building on windows
*=*=*=*=*=*=*=*=*=*=*=*
Compiling this package from sources requires the following software to be
installed on your system:
1. ocaml 3.11 or above with accompanying C compiler setup (msvc or mingw)
2. findlib
3. MySQL Connector/C <http://dev.mysql.com/downloads/connector/c/>
4. GNU Make
ocaml/msvc :
Copy Makefile.msvc to Makefile and edit MYSQL_DIR variable to point to the root
of installed MySQL Connector/C distribution. Afterwards run `make` to build mysql library,
`make demos` to compile examples and `make install` to install with ocamlfind.
ocaml/mingw:
Some mingw reimp versions can't process libmysql.lib import library.
In such cases try to rename this file into "$M/lib/libmysql.a" without
any processing by reimp.
$ export P="c:/Program Files/MySQL/MySQL Connector C 6.0.2"
$ export M="c:/mingw"
$ cp "$P/lib/opt/libmysql.lib" "$M/lib/"
$ (cd "$M/lib" && reimp libmysql.lib && mv liblibmysql.a libmysql.a)
$ CPPFLAGS="-I$P/include" ./configure
$ make all opt demos
2 Troubleshooting
*=*=*=*=*=*=*=*=*=
If compilation fails this is most probably because include or library
files were not found. The configure looks in a number of places but may
fail to find the files on your system. In case you have GNU Autoconf
installed you can take a look at the configure.in and add more
directories to search:
<<
AC_CHECKING(for MySQL header files)
dnl
dirs="/usr/local/include
/usr/local/mysql/include
/usr/include
/usr/include/mysql"
>>
Do not forget to create a new configure script by invoking autoconf.
Please send a patch back to the author.
3. Documentation
*=*=*=*=*=*=*=*=
Check the interface files, or doc/mysql/html/index.html (generated with `make htdoc`).
Reading the mysql documentation should help, too.
Two small demos are available. Build them with `make demos`.
Note: The library can be used in multithreaded ocaml programs without
blocking threads during i/o with the database server.
Since MySQL 5.5 it is safe to share database handle between threads in most scenarios, see
http://dev.mysql.com/doc/refman/5.5/en/c-api-threaded-clients.html
4 Copying
*=*=*=*=*=
You are encouraged to distribute this code under the terms of the
Lesser GNU Public License. See the file COPYING for details.
5. Authors
*=*=*=*=*=
Previous maintainers:
Christian Lindig
Shawn Wagner
Current maintainer:
ygrek <ygrek@autistici.org>
|