Next: , Previous: Makefile rules, Up: Integrating libtool   [Contents][Index]


5.2 libtool¤È¶¦¤ËAutomake¤ò»ÈÍѤ¹¤ë

libtool¥é¥¤¥Ö¥é¥ê¤Î¥µ¥Ý¡¼¥È¤Ï¡¤‘LTLIBRARIES’¥×¥é¥¤¥Þ¥ê¤Î²¼¤Ç¼ÂÁõ ¤µ¤ì¤Æ¤¤¤Þ¤¹¡¥

libtoolÇÛÉÛʪ¤Îdemo¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Î¡¤Automake Makefile.am¤«¤é¤ÎÎã¤Ï¡¤°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡¥

ºÇ½é¤Ë¡¤¥×¥í¥°¥é¥à¤òlibtool¥é¥¤¥Ö¥é¥ê¤È¥ê¥ó¥¯¤¹¤ë¤¿¤á¡¤ ‘program_LDADD’ÊÑ¿ô¤Î¤ß¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡¥

bin_PROGRAMS = hell hell.debug

# Build hell from main.c and libhello.la
hell_SOURCES = main.c
hell_LDADD = libhello.la

# Create an easier-to-debug version of hell.
hell_debug_SOURCES = main.c
hell_debug_LDADD = libhello.la
hell_debug_LDFLAGS = -static

¥Õ¥é¥°‘-dlopen’¤È‘-dlpreopen’(see Link mode)¤Ï¡¤ program_LDADDÊÑ¿ô¤Ç¡¤¤è¤êŬÀڤˤʤê¤Þ¤¹¡¥»Äǰ¤Ê¤¬¤é¡¤¥ê¥ê¡¼¥¹1.4 ¤Þ¤Ç¤ÎGNU automake¤Ï¡¤program_LDADDÊÑ¿ô¤Ç¤³¤ì¤é¤Î¥Õ¥é¥°¤ò¼õ¤±Æþ ¤ì¤Ê¤¤¤¿¤á¡¤°Ê²¼¤ÇÂåÍѤ·¤Þ¤¹¡¥

(¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤Ê¤¤¶¦Í­libtool¥é¥¤¥Ö¥é¥ê¤È¤Î¥ê¥ó¥¯¤òÈò¤±¤ë¤¿¤á ‘-static’¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ê)‘program’¤ò¥ê¥ó¥¯¤·¤Æ¤¤¤ë´Ö¡¤ libtool ¤ËÅϤ·¤¿¤¤¤¢¤é¤æ¤ë¥Õ¥é¥°¤òµÍ¤á¹þ¤à¤¿¤á¡¤‘program_LDFLAGS’ ÊÑ¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡¥

libtool¥é¥¤¥Ö¥é¥ê¤ò¥Ó¥ë¥É¤¹¤ë¤³¤È¤Ï¡¤¤Û¤È¤ó¤ÉËÁ¸±¤Ç¤¹… ‘-version-info’(see Versioning)¥ª¥×¥·¥ç¥ó¤òlibtool¤ËÅϤ¹¤¿¤á¡¤ ‘libhello_la_LDFLAGS’¤ò»ÈÍѤ¹¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡¥

# Build a libtool library, libhello.la for installation in libdir.
lib_LTLIBRARIES = libhello.la
libhello_la_SOURCES = hello.c foo.c
libhello_la_LDFLAGS = -version-info 3:12:1

-rpath’¥ª¥×¥·¥ç¥ó¤Ï¡¤(noinst_LTLIBRARIES¤È¤·¤Æ¥ê¥¹¥È¥¢¥Ã ¥×¤µ¤ì¤ë¥é¥¤¥Ö¥é¥ê°Ê³°)Automake¤Ë¤è¤ê¼«Æ°Åª¤ËÅϤµ¤ì¤ë¤Î¤Ç¡¤»ØÄꤹ¤ëɬ ÍפϤ¢¤ê¤Þ¤»¤ó¡¥

¾ÜºÙ¤Ï¡¤See The Automake Manual in The Automake Manual.