libtool
[Top][All Lists]
Advanced

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

Linking to third-party shared libary


From: Kenneth Pronovici
Subject: Linking to third-party shared libary
Date: Fri, 17 Aug 2001 03:08:01 -0500 (CDT)

Hello -

This is a bit long; I apologize.  I want to make sure I'm giving you
enough information.

I'm in the process of converting several libraries that I've previously 
written to use autoconf/automake/libtool.  Everything is currently distributed 
as a shared library - no static libraries at all.  I did my original 
development on Solaris, and then I "ported" to Linux mainly by changing 
the link rule from "cc -G" to "gcc -shared".  Essentially, the libraries
wrap TIBCO functionality to give us a vendor-neutral interface.

Anyway, when I built these libraries originally, I did so by linking all 
of my objects with -ltibrv and -ltibrvcm (the TIBCO libraries) plus -lpthread.  
I was expecting to do the same thing via libtool, but it isn't working as I 
expected.  

What happens is that, even though I specify a -L option (and libtool seems
to notice it) the phase that builds my .la file fails because the linker
can't find the two TIBCO libraries.  This seems to be because the -L 
directive gets dropped along the way.  I've included my short Makefile.am
file and the actual errors below my sig for reference.

I've dug through the docs and the archives for this mailing list, and I'm
still not sure exactly what's going on.  The only way I have been able to
get my library to link successfully is to not attempt a link to the TIBCO 
libraries at all.  However, libtool will happily link to the thread library,
apparently because it's in a "usual" place.

I guess I have two questions:

   1) Is it even possible to use libtool to link my library to some
      other libraries outside the normal system library directories?
   2) Do I care?  Is there a reason why I need to link my library with
      the TIBCO libraries?  I would like to keep it this way if possible,
      but...

I really appreciate the help.  I've been beating my head against the 
monitor for a while now (urk, 3:00am).

Thanks!

KEN

-- 
Kenneth J. Pronovici <address@hidden>
Personal Homepage: http://www.skyjammer.com/~pronovic/
"I have zero tolerance for zero-tolerance policies."

-------------- System ---------------------

System is Debian 'testing', but I have installed new versions of
all autoconf/automake-related things:

Linux agamemnon 2.2.17 #24 SMP Sat Feb 24 19:22:40 CST 2001 i686 unknown  
ltmain.sh (GNU libtool) 1.4 (1.920 2001/04/24 23:26:18)
autoconf (GNU Autoconf) 2.52 
automake (GNU automake) 1.4-p5
GNU m4 1.4
gcc 2.95.4


-------------- Makefile.am -----------------

AUTOMAKE_OPTIONS = foreign
LIBS = @PTHREAD_LIBS@ @TIBRV_LIBS@
INCLUDES = address@hidden@/../include @TIBRV_INCLUDES@
lib_LTLIBRARIES = libmm.la
libmm_la_LDFLAGS = @TIBRV_LDFLAGS@
libmm_la_SOURCES= (trimmed for brevity)


------------- libtool errors --------------

(sorry this is so long)

/bin/sh ../libtool --mode=link gcc  -g -O2  -o libmm.la -rpath 
/home/pronovic/tmp/local/lib -L /opt/tibco/tibrv/lib mm_api_init.lo 
mm_api_shutdown.lo mm_setup_lists.lo mm_reg_consumer.lo mm_reg_producer.lo 
mm_set_reply_topic.lo mm_unreg_consumer.lo mm_cancel_consumer.lo 
mm_pvt_unreg_consumer.lo mm_unreg_producer.lo mm_post_msg.lo mm_post_reply.lo 
mm_ack_msg.lo mm_msg_to_string.lo mm_string_to_msg.lo mm_free_msg_contents.lo 
mm_topic_to_string.lo mm_string_to_topic.lo mm_reg_key_to_string.lo 
mm_check_ledger.lo mm_globals.lo mm_log.lo mm_debug.lo mm_severe_error.lo 
mm_gen_reg_key.lo mm_gen_topic_string.lo mm_in_string.lo mm_map_key_info.lo 
mm_map_dealloc.lo mm_setup_group.lo mm_cleanup_group.lo mm_mark_group_hung.lo 
mm_map_contains_key.lo mm_map_key_count.lo mm_map_init.lo mm_map_destroy.lo 
mm_map_get.lo mm_map_is_empty.lo mm_map_put.lo mm_map_remove.lo 
mm_val_thread_context.lo mm_val_service_class.lo mm_val_name.lo mm_tib_init.lo 
mm_tib_ack_msg.lo mm_tib_reg_advisories.lo mm_tib_ledger_handler.lo 
mm_tib_cm_adv_handler.lo mm_tib_sys_adv_handler.lo mm_tib_subscr_handler.lo 
mm_tib_complete_fn.lo mm_tib_reg_producer.lo mm_tib_reg_consumer.lo 
mm_tib_unreg_producer.lo mm_tib_unreg_consumer.lo mm_tib_post.lo 
mm_tib_post_msg.lo mm_tib_post_reply.lo mm_tib_startup_group.lo 
mm_tib_shutdown_group.lo  -lpthread -ltibrv -ltibrvcm
rm -fr .libs/libmm.la .libs/libmm.* .libs/libmm.*
gcc -shared  mm_api_init.lo mm_api_shutdown.lo mm_setup_lists.lo 
mm_reg_consumer.lo mm_reg_producer.lo mm_set_reply_topic.lo 
mm_unreg_consumer.lo mm_cancel_consumer.lo mm_pvt_unreg_consumer.lo 
mm_unreg_producer.lo mm_post_msg.lo mm_post_reply.lo mm_ack_msg.lo 
mm_msg_to_string.lo mm_string_to_msg.lo mm_free_msg_contents.lo 
mm_topic_to_string.lo mm_string_to_topic.lo mm_reg_key_to_string.lo 
mm_check_ledger.lo mm_globals.lo mm_log.lo mm_debug.lo mm_severe_error.lo 
mm_gen_reg_key.lo mm_gen_topic_string.lo mm_in_string.lo mm_map_key_info.lo 
mm_map_dealloc.lo mm_setup_group.lo mm_cleanup_group.lo mm_mark_group_hung.lo 
mm_map_contains_key.lo mm_map_key_count.lo mm_map_init.lo mm_map_destroy.lo 
mm_map_get.lo mm_map_is_empty.lo mm_map_put.lo mm_map_remove.lo 
mm_val_thread_context.lo mm_val_service_class.lo mm_val_name.lo mm_tib_init.lo 
mm_tib_ack_msg.lo mm_tib_reg_advisories.lo mm_tib_ledger_handler.lo 
mm_tib_cm_adv_handler.lo mm_tib_sys_adv_handler.lo mm_tib_subscr_handler.lo 
mm_tib_complete_fn.lo mm_tib_reg_producer..lo mm_tib_reg_consumer.lo 
mm_tib_unreg_producer.lo mm_tib_unreg_consumer.lo mm_tib_post.lo 
mm_tib_post_msg.lo mm_tib_post_reply.lo mm_tib_startup_group.lo 
mm_tib_shutdown_group.lo  -L/home/pronovic/projects/mmapi/autoconf/mmapi/libmm 
-lpthread -ltibrv -ltibrvcm  -Wl,-soname -Wl,libmm.so.0 -o .libs/libmm.so.0.0.0
/usr/bin/ld: cannot find -ltibrv
collect2: ld returned 1 exit status





reply via email to

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