Subject: [clisp-list] Building add-on module

From: "John K. Hinsdale" <[email-masked]>
Date: Tue Jul 2 08:32:16 2002

I'm trying to build an add-on module (for an Oracle interface) and
having some trouble getting it to build.

The notes in the generated Makefile say to make a subdir of the src/
directory w/ the same name as the module, and I've done all that, and
also created the necessary .lisp interface, etc.  All my "C" files and
.lisp interface file compile fine in isolation.

What I really like to do is be able to just build a single "full"
distribution w/ all the other modules (regex, wildcards, OS calls) as
well as my Oracle module.

The docs (again notes in the Makefile - out of date?) say to create a
Makefile (either by hand or generated by autoconf) specific to my
module.  That's good, as I have compilation things specific to Oracle
such as where to get its headers and link libs.  However when I run
the "makemake" with --with-module=oracle it generates a build that
appears to ignore my Makefile and use a general set of compilation
flags.

I've also noticed when working w/ a toy-addon that the Makefile
generated by "clisp-link create-module-set" also seems to get ignored.

I'd like to avoid a solution that requires me to distribute Oracle's
header files as I will then have compatibility and license issues.
What I really want is to be able to say (somewhere, anywhere) where to
get those headers and libs, but it is not obvious to me where.

Any ideas?  One way I can force it work is to edit the generated
Makefile by hand, but I would like to avoid that.  My ultimate goal is
to be able to distribute to interested parties a directory that they
can graft right onto their CLISP distribution for a build that would
include the Oracle package.

---
John Hinsdale, Alma Mater Software, Inc., Tarrytown, NY 10591-3710 USA
[email-masked] | http://www.alma.com/staff/hin | +1 914 631 4690

---

From: Sam Steingold <[email-masked]>
Date: Tue Jul 2 09:33:44 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] Building add-on module"
> * Sent on Tue, 2 Jul 2002 11:22:50 -0400
> * Honorable "John K. Hinsdale" <[email-masked]> writes:
>

I recommend using a separate build directory - do not build in src/!

> well as my Oracle module.

$ mkdir modules/oracle
$ mv .... modules/oracle
$ ./configure --with-module=oracle --build build-dir

if you want to rebuild,
$ cd build-dir
$ rm -rf full
$ make

> module.

it also recommends 'rm rf full'.

> get those headers and libs, but it is not obvious to me where.

your best bet is to use autoconf for this.

> include the Oracle package.

note that CLISP is under GPL which means that _IF_ you distribute your
code, it _MUST_ be distributed under the GPL.
would you like us to distribute your module with CLISP?

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Those who can laugh at themselves will never cease to be amused.

---

From: "John K. Hinsdale" <[email-masked]>
Date: Tue Jul 2 11:44:58 2002

> ...

OK thanks for the tips.  I'll give it a whirl.  It's been pointed out
I could do something like auto-detection of the Oracle environment
that is used in the equivalent module they have in the perl ("DBD").

 > note that CLISP is under GPL which means that _IF_ you distribute
 > your code, it _MUST_ be distributed under the GPL.
 > 

No problem on all counts.

But let me get it built first, and running on a few Unixen :)

I have a few potential volunteers to eventually test it on: Linux,
Solaris and SGI Irix.

thanks; keep you posted.

---

---

From: "John K. Hinsdale" <[email-masked]>
Date: Fri Jul 5 09:52:06 2002

> Date: 02 Jul 2002 12:25:39 -0400
 > From: Sam Steingold <[email-masked]>

 > your best bet is to use autoconf for this.

OK, I've set all this up properly, incl. the module dir suitable for
eventual distribution and an autoconf-generated Makefile that has
everything needed to compile my stuff, yet the CLISP build is _still_
ignoring my Makefile and I have no idea why.

I did everything Sam suggested, e.g., w/ autoconf and a separate build
dire ("mysrc") and in fact the build _is_ running my "configure" when
it sees it.  I see my "configure" generates the desired Makefile; but
then when it comes time to compile my "C" sources my Makefile is not
used -- instead the build uses a gcc command appearing in the parent
directory's Makefile.

Any ideas?  Perhaps my problem may be due to how I've set up the
"link.sh" which I am not quite clear on its role.  The docs say it is
to set some make/environment variables, however I notice that the
link.sh in all the other modules contain a "make clisp-module" and I
assumed I had to do that as well.  But shouldn't it use my module's
Makefile?  Otherwise what is the point of creating it?

Any help would be greatly appreciated.  I've got all this code and no
Lisp to run it(!).

You can peek at my build area at: http://hinsdale.net/clisp-2.28/
The Oracle module is in http://hinsdale.net/clisp-2.28/modules/oracle/
and the build command I'm using is: http://hinsdale.net/clisp-2.28/doconf
with output: http://hinsdale.net/clisp-2.28/doconf.log

My next step is to wade into the source for the build environment in
detail, but before I do that I was hoping someone would eyeball it for
some obvious problem.

---

---

From: "John K. Hinsdale" <[email-masked]>
Date: Fri Jul 5 14:20:03 2002

> ignoring my Makefile and I have no idea why.

Pls. disregard my previous post about the "make" problems; I've
figured it out.

[turns out my Makefile was not really being ignored, but a def.
inside it _was_ (I was trying to glom on the Oracle header dirs. using
$INCLUDES and that was apparently getting clobbered elsewhere in the
build environment).

So I've at last got a functional CLISP and can now read and write to
Oracle databases.  (perhaps the first to do that from CLISP?)

I'm going to hone the module it a bit more, create some documentation
and then put it out for beta on other platforms.

Thanks to all who have helped me thus far.  I make nearly my entire
living mucking with Oracle databases and it will be interesting to try
doing it it from Lisp instead of perl.

---