[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re: a libtool program
From: |
Ralf Wildenhues |
Subject: |
Re: Re: a libtool program |
Date: |
Tue, 23 Sep 2008 23:26:06 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
* zqiang320 wrote on Tue, Sep 23, 2008 at 03:43:15PM CEST:
> the file configure.in:
>
> AC_INIT(main.c)
> AM_INIT_AUTOMAKE(main, 0.1)
There is a newer interface available, please use this:
AC_INIT(main, 0.1, bugreport-address)
AM_INIT_AUTOMAKE(gnu)
(i.e., AM_INIT_AUTOMAKE takes as arguments global automake options).
> AC_CONFIG_HEADER(config.h)
> AM_PROG_LIBTOOL
> AC_PROG_INSTALL
> AC_PROG_MAKE_SET
You don't need this macro.
> AC_PROG_CC
> AC_LANG_C
This neither.
> AC_HEADER_STDC
> AC_OUTPUT(Makefile libsbml/src/Makefile)
> Makefile.am:
>
> AUTOMAKE_OPTS = gnu
Either use AUTOMAKE_OPTIONS, or my advice above.
> bin_PROGRAMS = main
> main_SOURCES = main.c
> main_LDADD = ./sundials/src/cvodes/libsundials_cvodes.la -lm
> ./sundials/src/nvec_ser/libsundials_nvecserial.la -lm
> ./libsbml/src/libsbml.la -lm -lstd++
No need to list libraries twice, no need for './' prefixes (they
actually reduce portability to non-GNU make), and no need to list
indirect dependencies (they should go in library_la_LIBADD).
libstdc++ should be implied by the compiler driver, so if you need C++
then add something like
EXTRA_main_SOURCES = unused.cpp
Thus probably something like:
main_LDADD = sundials/src/cvodes/libsundials_cvodes.la
sundials/src/nvec_ser/libsundials_nvecserial.la libsbml/src/libsbml.la -lm
> INCLUDES = -I./sundials/include -I./libsbml/include
Prefer AM_CPPFLAGS.
> include_HEADERS = ./sundials/include ./libsbml/include
This variable should list only files, not directories.
Again, better drop the ./ prefixes (here, and everywhere else).
Also, it looks like your toplevel Makefile.am is missing something like
SUBDIRS = sundials/src
in order to recurse down.
> libsbml/src/Makefile.am:
>
> AUTOMAKE_OPTS = gnu
See above.
> lib_LTLIBRARIES = libsbml.la
> libsbml_la_SOURCES = ./common/*.cpp ./math/*.cpp ./math/*.c ./util/*.cpp
> ./util/*.c
No wildcards:
<http://www.gnu.org/software/automake/manual/html_node/wildcards.html>
> include_HEADERS = ../../include
See above.
> libsbml_la_LDFLAGS = -version-info 0:0:0
Hope that helps.
Cheers,
Ralf