*** french ********************************************************************* ******************************************************************************** (english below) libsqlite3 pour Scol Bibliothèque support de SQLITE3 pour applications Scol. Il s'agit d'une version alpha : bogues ou divers disfonctionnements peuvent survenir, ne pas utiliser en production. Licence : Scol (voir fichier COPYING) Auteur : Stéphane Bisaro, aka iri Pour toute questions et/ou suggestions, pour tout retour d'expériences, prière de poster sur le forum du Scolring : http://www.scolring.org/ Merci. -==============================================================================- COMPILATION En premier, compilez les sources de la dernière version disponible de Sqlite3 (http://www.sqlite.org/). Suivez les indications fournies. Pour informations et en supposant que ces sources sont dans le sous-dossier 'rsc' : * Sur un système GNU/Linux $ cd sqlite3_root_project $ gcc -c -fPIC sqlite3/sqlite3.c -o obj/sqlite3.o $ ar rs lib/libsqlite3_lin-x.y.z.a obj/sqlite3.o où x, y, z sont les numéros de version des sources. * Sur un système MS Windows avec MingW Ouvrez l'invite de commandes Placez-vous dans le répertoire de gcc (par défaut c:\mingw\bin) C:\>cd mingw\bin C:\MinGW\bin>gcc -c -fPIC x:\trunk\scol\plugins\sqlite3\sqlite3\sqlite3.c -o x:\trunk\scol\plugins\sqlite3\obj\sqlite3.o C:\MinGW\bin>ar rs x:\trunk\scol\plugins\sqlite3\lib\libsqlite3_win-x.y.z.a x:\trunk\scol\plugins\sqlite3\obj\sqlite3.o où x, y, z sont les numéros de version des sources. La bibliothèque statique est créée. Note : x:\sqlite3\sqlite3\sqlite3.c:1: warning: -fPIC ignored for target (all code is posit ion independent) A priori, ce warning sur une architecture x86 est à ignorer et mieux vaut garder l'option -fpIC. En second, compilation de la bibliothèque pour Scol. * Sur un système GNU/Linux $ gcc -c -Wall -pedantic -fpic -Iinclude -I../../hscol src/main.c -Isqlite3 -o obj/main.o $ gcc -shared -L./sqlite3 -o bin/release/libsqlite3.so obj/main.o lib/sqlite3_lin-x.y.z.a -lpthread * Sur un système MS Windows C:\MinGW\bin>gcc -c -Wall -pedantic -fpic -Ix:\trunk\scol\hscol -Ix:\trunk\scol\plugins\sqlite3\include -Ix:\trunk\scol\plugins\sqlite3\sqlite3 x:\trunk\scol\plugins\sqlite3\src\main.c -o x:\trunk\scol\plugins\sqlite3\obj\main.o C:\MinGW\bin>gcc -shared -Lx:\trunk\scol\plugins\sqlite3\sqlite3 -o x:\trunk\scol\plugins\sqlite3\bin\release\libsqlite3.dll x:\trunk\scol\plugins\sqlite3\obj\main.o x:\trunk\scol\plugins\sqlite3\lib\sqlite3_win-x.y.z -lpthread La bibliothèque pour Scol est créée. INSTALLATION Copier la bibliothèque (*.dll pour version Windows, *.so pour la version GNU/Linux) dans le sous-répertoire 'plugins' de Scol. Éditer le fichier usm.ini à la racine du répertoire Scol et ajouter cette ligne : - Sous windows : plugin plugins/libsqlite3.dll ScolLoadPlugin ScolUnloadPlugin - Sous GNU/Linux : plugin ./plugins/libsqlite3.so ScolLoadPlugin ScolUnloadPlugin Relancer Scol. DOCUMENTATION : Voir dans le dossier 'doc' de la présente archive : - un fichier 'doc.txt' contenant la doc actuellement rédigée : usages, API, compilation, ...; - un répertoire 'tests' contenant une ou plusieurs applications exemples. SUPPORT : Visiter le site du Scolring : http://www.scolring.org/ Bonne journée et bon Scol *** english ******************************************************************** ******************************************************************************** Sqlite3 support for Scol language More infos : visit the Scolring : http://www.scolring.org/ Please, you should remember that this library is still a ALPHA version, provided "AS IT". Be carefull if you use it to the critical process. License : Scol (see COPYING file), BSD-like Author : Stéphane Bisaro, aka iri For any suggests and/or comments, go to Scolring forum : http://www.scolring.org/ Thanks. -==============================================================================- COMPILATION First, compile the last Sqlite3 sources (http://www.sqlite.org/). Follows the given informations. If you want and assuming the sources are in the 'rssc' sub-folder, you could make this : * On GNU/Linux $ cd sqlite3_root_project $ gcc -c -fPIC sqlite3/sqlite3.c -o obj/sqlite3.o $ ar rs lib/libsqlite3_lin-x.y.z.a obj/sqlite3.o where x, y, z are the major, minor, micro version numbers of sqlite3 sources. * On MS Windows with MingW Open the COMMAND interface Goto the gcc folder (by default c:\mingw\bin) C:\>cd mingw\bin C:\MinGW\bin>gcc -c -fPIC x:\trunk\scol\plugins\sqlite3\sqlite3\sqlite3.c -o x:\trunk\scol\plugins\sqlite3\obj\sqlite3.o C:\MinGW\bin>ar rs x:\trunk\scol\plugins\sqlite3\lib\libsqlite3_win-x.y.z.a x:\trunk\scol\plugins\sqlite3\obj\sqlite3.o where x, y, z are the major, minor, micro version numbers of sqlite3 sources. Adapt the path to your project. The static library is created. Note : x:\sqlite3\src\sqlite3.c:1: warning: -fPIC ignored for target (all code is posit ion independent) It looks like -fPIC is not necessary on x86, but all manuals say that it's needed, so I use it too ... Next, compile the Scol library * On GNU/Linux $ gcc -c -Wall -pedantic -fpic -Iinclude -I../../hscol src/main.c -Isqlite3 -o obj/main.o $ gcc -shared -L./sqlite3 -o bin/release/libsqlite3.so obj/main.o lib/sqlite3_lin-x.y.z.a -lpthread * On MS Windows with MingW C:\MinGW\bin>gcc -c -Wall -pedantic -fpic -Ix:\trunk\scol\hscol -Ix:\trunk\scol\plugins\sqlite3\include -Ix:\trunk\scol\plugins\sqlite3\sqlite3 x:\trunk\scol\plugins\sqlite3\src\main.c -o x:\trunk\scol\plugins\sqlite3\obj\main.o C:\MinGW\bin>gcc -shared -Lx:\trunk\scol\plugins\sqlite3\sqlite3 -o x:\trunk\scol\plugins\sqlite3\bin\release\libsqlite3.dll x:\trunk\scol\plugins\sqlite3\obj\main.o x:\trunk\scol\plugins\sqlite3\lib\sqlite3_win-x.y.z -lpthread The Scol library is created. INSTALLATION Close Scol, if any. Copy the library (*.dll under MS Windows, *.so under GNU/Linux) to the subfolder "plugins" of "scol". Edit the "usm.ini" file (as the samefolder than "scol.exe" (under Windows) or "scol" (under GNU/Linux)) and add this line : - Under windows : plugin plugins/libsqlite3.dll ScolLoadPlugin ScolUnloadPlugin - Under GNU/Linux : plugin ./plugins/libsqlite3.so ScolLoadPlugin ScolUnloadPlugin Launch Scol. SUPPORT : Visit or post to the Scolring forum : http://www.scolring.org/ have phun