【发布时间】:2014-10-01 22:56:19
【问题描述】:
我创建了一个使用自动工具构建的简单测试应用程序 + 库。问题是make在Cygwin下没有生成动态库(DLL左右)。
Makefile.am:
ACLOCAL_AMFLAGS = -I m4
VERSION=0:0:0
EXTRA_DIST = autogen.sh
bin_PROGRAMS = testApp
libtest_la_SOURCES = src/testLibrary.c
libtest_la_LDFLAGS = -version-info ${VERSION}
testApp_SOURCES = src/testApp.c
testApp_LDADD = libtest.la
lib_LTLIBRARIES = libtest.la
配置.ac:
AC_INIT(foobar, 1.0, me@mail.com)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(src)
AC_PROG_CC
AM_PROG_CC_C_O
LT_INIT
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([subdir-objects])
AC_OUTPUT(Makefile)
configure 表示将构建一个动态库:
checking whether the gcc linker (/usr/x86_64-pc-cygwin/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking that generated files are newer than configure... done
但没有构建动态库:
$ ls .libs
libtest.a libtest.la libtest.lai lt-testApp.c testApp.exe testApp_ltshwrapper
【问题讨论】: