Re: missing info in the models tarballs.

David Fang <[email protected]>
Newsgroups gmane.comp.gnu.gnucap.devel
Message-ID <[email protected]>
> /usr/include/stdlib.h:226: error: declaration of C function 'int
> setenv(const char*, const char*, int)' conflicts with
> ../Include/cpstd.h:54: error: previous declaration 'void setenv()' here
> ../Include/wrapper.cc: In static member function 'static void
> MODEL_SPICE::init_ckt()':
> ../Include/wrapper.cc:247: warning: the address of 'static CKTcircuit*
> MODEL_SPICE::ckt()', will always evaluate as 'true'
> make[1]: *** [wrapper.o] Error 1
>
> And in cpstd.h:
>
> #ifndef linux
> extern void setenv();
> #endif /* linux */

After I commented out the above, the link command is incorrect:

g++ wrapper.o asrc.o asrcacld.o asrcask.o asrcconv.o asrcdel.o asrcdest.o
asrcfbr.o asrcload.o asrcmdel.o asrcpar.o asrcpzld.o asrcset.o  devsup.o
-shared -o asrc.so
powerpc-apple-darwin8-g++-4.0.1: unrecognized option '-shared'

Then it complains about missing symbols, because it didn't figure out that
it's supposed to build a shared library, right? I strongly recommend
GNU libtool -- it works like magic; I don't even know what magic flags and
incantations are needed on various platforms I use. Static and shared
libraries just work.  (BTW, .dylib is the proper extension on darwin, but
autoconf/libtool take care of it for you.)

configure.ac:
AC_PROG_LIBTOOL

Makefile.am:
pkglib_LTLIBRARIES = libasrc.la
# will install libasrc.{so,dylib,a} in /prefix/lib/gnucap, for example.

# one possibiliy: flags reference the installed gnucap base
# alternative: make gnucap core sources a build-time dependence
libasrc_la_CPPFLAGS = @GNUCAP_CPPFLAGS@
libasrc_la_SOURCES = ...
libasrc_la_LIBADD = @GNUCAP_LIBS@
libasrc_la_LDFLAGS = @GNUCAP_LDFLAGS@
# values determined by configure, user-customizable, probably don't need
# to separate library and  path arguments.

and that's it.

One thing that might make life easier is pkg-config, which keeps the
necessary package information (paths, compile flags, link flags) of a
configured install in a handy configuration file.  Then plug-in modules
can just reference the config file (can be script too) during their
configuration process.


David Fang
Computer Systems Laboratory
Electrical & Computer Engineering
Cornell University
http://www.csl.cornell.edu/~fang/
	-- (2400 baud? Netscape 3.0?? lynx??? No problem!)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.