libtool
[Top][All Lists]
Advanced

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

ltdl and C++


From: Alessandro Candini
Subject: ltdl and C++
Date: Mon, 19 Sep 2011 15:34:22 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Thunderbird/3.1.13

Hi everyone.
I have a problem making ltdl library work with some C++ code.
I have implemented my personal version of the example at the end of Chapter 7 in the book "Autotools" by John Calcote. Basically it is the same, but I have C++ source files and I use g++ instead of gcc. Configure and make works but I do not produce a dynamic linked executable, unlike the original John's example:
../src $ ldd hello
    not a dynamic executable

And I noticed that during compilation the fPIC flag is used although I removed every reference to it in all my Makefile.am files.

Do you have any ideas?

Here is my configure.ac:

AC_PREREQ([2.67])
AC_INIT([hello], [1.0], address@hidden, [], [www.meeo.it])
AM_INIT_AUTOMAKE
LT_PREREQ([2.2])
LT_INIT([dlopen])
AC_CONFIG_SRCDIR([src/hello.cpp])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_CHECK_PROG([bash_shell],[bash -x],[bash -x],,,[/usr/sbin/bash])
AC_PROG_INSTALL
# AC_PROG_RANLIB
AC_PROG_CC_C_O
AC_SUBST([CXXFLAGS], ["-Wall -g -O2"])

# Checks for command line options.
AC_ARG_ENABLE([async-exec],
          [AS_HELP_STRING([--disable-async-exec],
                  [disable asynchronous execution @<:@default: no@:>@])],
          [async_exec=${enableval}], [async_exec=yes])

# Checks for libraries.
if test "x${async_exec}" = xyes; then
    have_pthreads=no
    AC_SEARCH_LIBS([pthread_create], [pthread], [have_pthreads=yes])

    if test "x${have_pthreads}" = xyes; then
        AC_CHECK_HEADERS([pthread.h], [], [have_pthreads=no])
    fi

    if test "x${have_pthreads}" = xno; then
        AC_MSG_WARN([
             -----------------------------------------
             Unable to find pthreads on this system.
             Building a single-threaded version.
             -----------------------------------------])
        async_exec=no
    fi
fi

if test "x${async_exec}" = xyes; then
    AC_DEFINE([ASYNC_EXEC], 1, [async execution enabled])
fi
# Checks for typedefs, structures, and compiler characteristics.

# Checks for header files.
AC_CHECK_HEADERS([stdlib.h ltdl.h])

# Checks for library functions.
#AC_SEARCH_LIBS([dlopen], [dl])
AC_SEARCH_LIBS([lt_dlopen], [ltdl])

AC_CONFIG_FILES([Makefile
                 common/Makefile
                 include/Makefile
                 libhello/Makefile
                 src/Makefile
                 src/modules/hithere/Makefile])
AC_OUTPUT

--
Alessandro Candini

MEEO S.r.l.
Via Saragat 9
I-44122 Ferrara, Italy
Tel: +39 0532 1861501
Fax: +39 0532 1861637
http://www.meeo.it

========================================
"ATTENZIONE:le informazioni contenute in questo messaggio sono
da considerarsi confidenziali ed il loro utilizzo è riservato unicamente
al destinatario sopra indicato. Chi dovesse ricevere questo messaggio
per errore è tenuto ad informare il mittente ed a rimuoverlo
definitivamente da ogni supporto elettronico o cartaceo."

"WARNING:This message contains confidential and/or proprietary
information which may be subject to privilege or immunity and which
is intended for use of its addressee only. Should you receive this
message in error, you are kindly requested to inform the sender and
to definitively remove it from any paper or electronic format."




reply via email to

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