필자는 Autoconf에서 Automake로 컴파일러 옵션을 가져 오는 데 시간이 많이 걸리고 있습니다. 내 소스 파일 중 일부는 Automake per-object flags 있습니다 컴파일러 플래그를 Autoconf에서 Automake로 전달하는 방법은 무엇입니까?
## Makefile.am
librijndael_simd_la_SOURCES = rijndael-simd.cpp
librijndael_simd_la_CXXFLAGS = $(AES_FLAG)
AES_FLAG
는 IA-32, Aarch32/64 Power8에 대한 건축 플래그를 필요
Makefile.am
으로 하드 코딩되었습니다.
내가 초기 Autotools가 지원 구축하고 나는 하드 코드 Autoconf에의 옵션을 시도하고있다 :
# configure.ac
AC_SUBST([GCM_FLAG], [-mssse3 -mpclmul])
AC_SUBST([AES_FLAG], [-msse4.1 -maes])
AC_SUBST([SHA_FLAG], [-msse4.2 -msha])
...
AC_OUTPUT(Makefile)
을하지만 결과 :
이$ ./configure
...
checking how to run the C++ preprocessor... g++ -E
./configure: line 16195: -mpclmul: command not found
./configure: line 16199: -maes: command not found
./configure: line 16201: -msha: command not found
autoconf가 설명서, 3.1.2 The Autoconf Language가 말한다 이중 브래킷 ([[
및 ]]
)을 사용하는 경우 :
AC_SUBST([[GCM_FLAG]], [[-mssse3 -mpclmul]])
AC_SUBST([[AES_FLAG]], [[-msse4.1 -maes]])
AC_SUBST([[SHA_FLAG]], [[-msse4.2 -msha]])
그것은 (나는 이것이 대부분의 사람들이 매뉴얼을 따르지 않는 이유를 추측) 결과 :
$ autoreconf --force --install
...
error: AC_SUBST: `[AES_FLAG]' is not a valid shell variable name
configure.ac:50: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
autoreconf: aclocal failed with exit status: 1
나는이 문서이라고 생각하지만 예, 문제 해결 단계를 제공하지 않습니다 7.2 Setting Output Variables합니다.
순수하게, 나는이 간단한 작업을 수행하는 방법을 보여주는 1000 개의 블로그가 있다고 생각했지만 그렇게 보일 수는 없습니다 : autoconf pass compiler option to automake.
Autoconf에서 Automake로 컴파일러 플래그를 전달하는 방법은 무엇입니까?
_GCM_FLAG_ 및 기타를 다루는'Makefile.in' 또는'Makefile' 세그먼트를 추가 할 수 있습니까? –
감사합니다. @Vicente. 멀리까지 (즉,'Makefile.am '이'Makefile'으로 바뀌었을 때까지 충분히). – jww
드문 경우에만 이중 괄호가 필요하거나 필요합니다. –