libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple configure.in files with libtool


From: Gary V . Vaughan
Subject: Re: Multiple configure.in files with libtool
Date: Wed, 11 Jul 2001 19:47:50 +0100

On Wednesday 11 July 2001  3:51 pm, Tod W. Milam wrote:
> I have located the problem.  There aren't any shared libraries for
> MySQL on my system so the MySQL library must be linked to the
> executable.  Is this supposed to happen or should libtool include the
> static library inside the libtool module?

The location of the static library should be recorded in the .la file for the 
libtool library so that the final libtool link command (for the executable 
that uses that .la file) knows that it needs to link the static dependency 
into the executable.

You can force the static library (which will be made from non-PIC objects) 
code to be linked into the shared library component of a libtool archive by 
giving the fill path to the static lib on the libtool library link line.  
This is not recommended though, since many platforms won;t support it at all, 
and those that do will take a performance hit from the non-PIC objects in the 
library.  Because of that, when you do force such a linkage, libtool will 
give a warning.

Cheers,
        Gary.

> Thanks,
> Tod Milam
> address@hidden
>
> --- "Tod W. Milam" <address@hidden> wrote:
> > Hello -
> >
> > I'm not sure if this is an autoconf or libtool problem, but libtool
> > is
> > giving me the error so I'm starting with this list.
> >
> > I have a project that uses plugins (Libtool modules) for changing the
> > destination of the output.  I have everything working fine using one
> > top-level configure.in file.
> > Each plugin depends on different third-party libraries and only gets
> > compiled when that library is found on the system.
> > Using one top-level configure.in seems to link all found libraries
> > with
> > all other parts of the project.  Therefore I am trying to put
> > configure.in files in each of the plugin directories so that the
> > third-party libraries will only be linked to the appropriate module
> > file.
> > The configure part seems to work fine and everything compiles and
> > installs fine, but when I try to use one of the newly created modules
> > I
> > get "file not found" returned from the failed call to lt_dlopenext.
> >
> > Here is the top-level configure.in:
> > ----------------------------cut here--------------------------------
> > dnl Process this file with autoconf to produce a configure script.
> > AC_INIT
> > AC_CONFIG_SRCDIR([src/rlog/rlog.c])
> > AM_INIT_AUTOMAKE(rlog,1.0.2)
> > AM_CONFIG_HEADER(config.h)
> > AC_CONFIG_SUBDIRS(libltdl \
> >     src/plugins/mysql)
> >
> > dnl Checks for programs.
> > AC_PROG_CC
> > AC_PROG_CXX
> > AC_LIBTOOL_DLOPEN
> > AC_LIBLTDL_CONVENIENCE
> > AM_PROG_LIBTOOL
> >
> > AC_SUBST(INCLTDL)
> > AC_SUBST(LIBLTDL)
> >
> > dnl Checks for pthread.
> > ACX_PTHREAD()
> >
> > dnl Check for definition of socklen_t
> > TYPE_SOCKLEN_T()
> >
> > dnl Checks for header files.
> > AC_HEADER_STDC
> > AC_CHECK_HEADERS(strings.h sys/time.h unistd.h)
> >
> > dnl Checks for typedefs, structures, and compiler characteristics.
> > AC_C_CONST
> > AC_HEADER_TIME
> >
> > dnl Checks for library functions.
> > AC_FUNC_MEMCMP
> > AC_FUNC_STRFTIME
> > AC_CHECK_FUNCS(gethostname gettimeofday strdup)
> > #AC_CHECK_LIB(mysqlclient, mysql_init)
> > AC_CHECK_LIB(socket, socket)
> > AC_CHECK_LIB(nsl, gethostbyname)
> >
> > #AM_CONDITIONAL(HAVE_MYSQL,test "${ac_cv_lib_mysqlclient_mysql_init}"
> > =
> > "yes")
> > AM_CONDITIONAL(NEED_SOCKET,test "${ac_cv_lib_socket_socket}" = "yes")
> > AM_CONDITIONAL(NEED_NSL,test "${ac_cv_lib_nsl_gethostbyname}" =
> > "yes")
> > AM_CONDITIONAL(HAVE_PTHREAD,test "$acx_pthread_ok" = "yes")
> >
> > dnl Allow use of dmalloc to debug memory allocations
> > AM_WITH_DMALLOC
> >
> > AC_CONFIG_FILES([Makefile \
> >           src/Makefile \
> >           src/rlog/Makefile \
> >           src/plugins/Makefile \
> >           src/sampleApp/Makefile \
> >          ])
> > AC_OUTPUT
> > ---------------------cut here--------------------------
> >
> > Here is the configure.in from the MySQL plugin directory:
> > ---------------------cut here--------------------------
> > dnl Process this file with autoconf to produce a configure script.
> > AC_INIT(rlogMysql.c)
> > AM_INIT_AUTOMAKE(rlogMysql,1.0.2)
> > AM_CONFIG_HEADER(config.h)
> >
> > AC_PROG_CC
> > AC_LIBTOOL_DLOPEN
> > AC_LIBLTDL_CONVENIENCE
> > AM_PROG_LIBTOOL
> >
> > AC_SUBST(INCLTDL)
> > AC_SUBST(LIBLTDL)
> >
> > dnl Checks for header files.
> > AC_HEADER_STDC
> > AC_CHECK_HEADERS(strings.h sys/time.h unistd.h)
> >
> > dnl Checks for library functions.
> > AC_CHECK_LIB(mysqlclient, mysql_init)
> >
> > AM_CONDITIONAL(HAVE_MYSQL,test "${ac_cv_lib_mysqlclient_mysql_init}"
> > =
> > "yes")
> >
> > dnl Allow use of dmalloc to debug memory allocations
> > AM_WITH_DMALLOC
> >
> > AC_OUTPUT(Makefile)
> > ---------------------cut here--------------------------
> >
> > I am using the following versions of autotools:
> > autoconf (GNU Autoconf) 2.50
> > automake (GNU automake) 1.4-p4
> > ltmain.sh (GNU libtool) 1.4 (1.920 2001/04/24 23:26:18)
> >
> > Any ideas or maybe a pointer to an example?
> >
> > Thanks,
> > Tod Milam
> > address@hidden
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>
> _______________________________________________
> Libtool mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/libtool

-- 
  ())_. Gary V. Vaughan     gary@(oranda.demon.co.uk|gnu.org
  ( '/  Research Scientist  http://www.oranda.demon.co.uk       ,_())____
  / )=  GNU Hacker          http://www.gnu.org/software/libtool  \'      `&
`(_~)_  Tech' Author        http://sources.redhat.com/autobook   =`---d__/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]