您的位置:首页 > 运维架构 > Linux

Tips: 使用autotools生成动态.so库文件 / Generate .so library files using autotools in Solaris and Linux

2010-02-07 22:35 861 查看
Makefile.am形式如下

lib_LTLIBRARIES=libprintinfo.la
libprintinfo_la_SOURCES=printinfo.h printinfo.cpp

注意
1 ./Configure, make之后并不会马上生成libprintinfo.so文件,而要等到make install之后,libprintinfo.so文件将会位于/usr/local/lib中。

2 需要在文件configure.in中加入一行:AC_PROG_LIBTOOL;

3 如果发生错误configure.in:18: required file `./ltmain.sh' not found,则可运行libtoolize命令生成该文件;

参考资料
1. 例解autoconf和automake生成Makefile文件,http://www.ibm.com/developerworks/cn /linux/l-makefile/
2. 《嵌入式Linux应用程序开发详解》之3.7 使用autotools。

// The English Version
Makefile.am is like this:

lib_LTLIBRARIES=libprintinfo.la
libprintinfo_la_SOURCES=printinfo.h printinfo.cpp

Notes:
1 After "./Configure", "make", the file libprintinfo.so will not appear immediately,until you run "make install",the file libprintinfo.so will defaultly under /usr/local/lib.

2 You may need to add one line in file configure.in:AC_PROG_LIBTOOL;

3 If you meet the error of "configure.in:18: required file `./ltmain.sh' not found",you can use the command tool "libtoolize" to generate the file Itmain.sh.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐