使用autotools编译共享库/插件时出现问题

时间:2011-07-16 13:15:40

标签: shared-libraries autotools

我对autotools很新,看起来我有一个libtool的问题 - 它不构建一个共享库,而是创建一个静态库...

这就是我的configure.ac的样子:

AC_PREREQ([2.67])
AC_INIT([helloworld], [1.0], [...])
AM_INIT_AUTOMAKE([foreign])
LT_INIT

# Checks for programs.
AC_PROG_CXX
AC_PROG_LIBTOOL

# Checks for header files.
AC_CHECK_HEADERS([alloca.h inttypes.h stdint.h])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

和Makefile.am:

noinst_LTLIBRARIES=helloworld.la

helloworld_la_CXXFLAGS=-w -DLINUX ...
helloworld_la_LDFLAGS=-avoid-version -module -shared -export-dynamic

# List of source files
helloworld_la_SOURCES=helloworld.cpp ...

这里有什么问题吗?

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

我相信你想要

lib_LTLIBRARIES = helloworld.la

使用noinst指示libtool构建一个便利库,以及那些 通常不共享。

相关问题