Next: Installing executables, Previous: Debugging executables, Up: Using libtool [Contents][Index]
libtool¤¬Ìµ¤¤¥·¥¹¥Æ¥à¤Ç¥é¥¤¥Ö¥é¥ê¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤Ï¡¤Á´¤¯´Êñ¤Ç ¤¹… ¤½¤ì¤é¤ò¤½¤Î¾ì½ê¤Ë¥³¥Ô¡¼¤¹¤ë¤À¤±¤Ç¤¹¡¥4
burger$ su Password: ******** burger# cp libhello.a /usr/local/lib/libhello.a burger#
¤ª¤Ã¤È¡¤ranlib
¥³¥Þ¥ó¥É¤ò˺¤ì¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡¥
burger# ranlib /usr/local/lib/libhello.a burger#
libtool¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Ï¡¤Æ±ÍͤËÁ´¤¯Ã±½ã¤Ç¤¹¡¥Ä̾ï»ÈÍѤ¹¤ë¡¤
install
¤äcp
¥³¥Þ¥ó¥É¤ò¤½¤Î¤Þ¤Þ»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤
(see Install mode)¡¥
a23# libtool --mode=install cp libhello.la /usr/local/lib/libhello.la cp libhello.la /usr/local/lib/libhello.la cp .libs/libhello.a /usr/local/lib/libhello.a ranlib /usr/local/lib/libhello.a a23#
¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë¤Çlibtool¤ò½õ¤±(see Uninstall mode)¡¤¥ê¥ó¥¯¤· (see Linking executables)¡¤dlopen¤Ç¥×¥í¥°¥é¥à¤ò½õ¤±¤ë (see Dlopened modules)¤¿¤á¡¤libtool¤Î¥é¥¤¥Ö¥é¥êlibhello.la ¤â¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡¥
¶¦Í¥é¥¤¥Ö¥é¥ê¤ÎÎã¤Ï¡¤°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡¥
burger# libtool --mode=install install -c libhello.la /usr/local/lib/libhello.la install -c .libs/libhello.so.0.0 /usr/local/lib/libhello.so.0.0 install -c libhello.la /usr/local/lib/libhello.la install -c .libs/libhello.a /usr/local/lib/libhello.a ranlib /usr/local/lib/libhello.a burger#
¥é¥¤¥Ö¥é¥ê¥¤¥ó¥¹¥È¡¼¥ë»þ¤ËBSD¸ß´¹¤Îinstall¥×¥í¥°¥é¥à¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¤ ‘-s’(¥·¥ó¥Ü¥ë¤Îstrip)¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È°ÂÁ´¤Ç¤¹¡¥libtool¤Ï ‘-s’ ¥Õ¥é¥°¤ò̵»ë¤¹¤ë¡¤¤Þ¤¿¤Ï¥é¥¤¥Ö¥é¥ê¤«¤é¥Ç¥Ð¥Ã¥°¤È¥³¥ó¥Ñ¥¤¥é¥· ¥ó¥Ü¥ë¤Î¤ß¤òstrip¤¹¤ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥
¥é¥¤¥Ö¥é¥ê¤ò°ìÅÙÇÛÃÖ¤¹¤ë¤È¡¤»ÈÍѤ¹¤ëÁ°¤ËɬÍפÊÄɲäΥ³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç ¥ó¤ò¹Ô¤¤¤Þ¤¹¡¥ºÇ½é¤Ë¡¤¥Ó¥ë¥É»þ¤Ë»ÈÍѤ·¤¿‘-rpath’¥Õ¥é¥°¤ÈƱ¤¸¾ì½ê ¤Ë¡¤¥é¥¤¥Ö¥é¥ê¤¬¼ÂºÝ¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò³Î¤«¤á¤ëɬÍפ¬¤¢¤ê¤Þ ¤¹¡¥
¤½¤·¤Æ¡¤‘libtool -n --mode=finish libdir’¤ò¼Â¹Ô¤¹¤ë¤È¡¤¹Ô¤¦ ¤³¤È¤Î¥Ò¥ó¥È¤¬Í¿¤¨¤é¤ì¤ë¤Ï¤º¤Ç¤¹(see Finish mode)¡¥
burger# libtool -n --mode=finish /usr/local/lib PATH="$PATH:/sbin" ldconfig -m /usr/local/lib ----------------------------------------------------------------- Libraries have been installed in: /usr/local/lib To link against installed libraries in a given directory, LIBDIR, you must use the `-LLIBDIR' flag during linking. You will also need to do one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-RLIBDIR' linker flag See any operating system documentation about shared libraries for more information, such as the ld and ld.so manual pages. ----------------------------------------------------------------- burger#
¤³¤ì¤é¤Î¥¹¥Æ¥Ã¥×¤ò´°Î»¤·¤¿¸å¡¤¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥é¥¤¥Ö¥é¥ê¤Î»ÈÍѳ«»Ï¤¬ ²Äǽ¤Ë¤Ê¤ê¤Þ¤¹¡¥ºîÀ®¤µ¤ì¤¿¥é¥¤¥Ö¥é¥ê¤Ë°Í¸¤¹¤ë¼Â¹Ô·Á¼°¤â¥¤¥ó¥¹¥È¡¼¥ë¤Ç ¤¤Þ¤¹¡¥