2011-11-26 5 views
4

Automake가 설치되지 않는 동적 모듈을 빌드하는 방법을 알려주십시오.Automake : 설치하지 않을 공유 모듈 빌드하기

pkglib_LTLIBRARIES = mywrapper.la 
mywrapper_la_LDFLAGS = -no-undefined -module -avoid-version 

pkglibdir으로 mywrapper.so를 설치합니다. 정적 편의 라이브러리가 발생

noinst_LTLIBRARIES = mywrapper.la 
mywrapper_la_LDFLAGS = -no-undefined -module -avoid-version 
대신 내장합니다.

해당 동적 모듈은 테스트 슈트를 실행하는 데에만 사용되므로 배포되지 않습니다.

답변

3

같은 문제가있었습니다. 이것은 내가 나중에 참조 할 수 있도록 자신의 초조 주석을 포함하여, 한 일이다

# The rpath is necessary because stoopid libtool won't build a shared library 
# if it's noinst_, because what POSSIBLE reason could you have to do that? 
TEST_PLUGIN_LIBTOOL_FLAGS = \ 
    -module \ 
    -shared \ 
    -avoid-version \ 
    -export-symbols-regex "<whatever symbols you need to export>" \ 
    -rpath $(abs_builddir) 

noinst_LTLIBRARIES = mywrapper.la 
mywrapper_la_LDFLAGS = $(TEST_PLUGIN_LIBTOOL_FLAGS) 
+0

아, 고맙습니다. – dottedmag

1

당신은 테스트 대상입니다 check_LTLIBRARIES를 사용할 수 있습니다. Automake가의 Uniform Naming Scheme에 따르면

특별한 접두사 '의 check_'는 명령 실행 '체크하기'가 될 때까지 질문 의 개체를 빌드 할 수 없습니다 것을 나타냅니다. 그 개체도 설치되어 있지 않습니다.

또한 기본적으로 정적 라이브러리를 생성합니다. 나는 이것을 다음과 같이 강제했다 ​​:

check_LTLIBRARIES = mywrapper.la 
mywrapper_la_LDFLAGS = -no-undefined -module -shared -avoid-version -rpath /tmp 

테스트 스위트 실행 파일을 컴파일하고 실행할 수도있다.

check_PROGRAMS = suite 

suite_SOURCES = ... 
suite_LDFLAGS = ... 
suite_LDADD = ... 

check-local: 
    ./suite 
+1

이것이 작동하면 좋은 해결책이 될 수 있습니다. 'check_PROGRAMS'가 있는지 아십니까? 아니면'noinst_PROGRAMS'를 사용합니까? – jww