libtool 为shared library 编译 PIC 对象,生成 .lo 文件;static library 则是非PIC,生成 .o 文件。
如果使用autoconf/autobuild的话就很简单了:
加入 configure.ac
AC_PROG_LIBTOOL
加入 Makefile.am
BUILT_SOURCES = tps.h
#lib_LIBRARIES = libtps.a
lib_LTLIBRARIES = libtps.la
#libtps_a_SOURCES=tps.cc
libtps_la_SOURCES=tps.cc
libtps_la_LDFLAGS = -version-info 1:0:1
#bin_PROGRAMS = ad bmark
bin_PROGRAMS = bmark
#ad_SOURCES = tps.h tps.cc
bmark_SOURCES = tps.h bmark.cc
bmark_LDFLAGS = -L. -L./.lib/ -ltps
RSS feed for comments on this post · TrackBack URI
Leave a reply