2017-03-29 16 views
4

autoconf의 기본값 인 configure --help 출력 내용을 변경하고 싶습니다. 특히 전환에 배치 된 텍스트를 _AC_INIT_HELP으로 변경하고 싶습니다.기본 autoconf 구성을 변경하는 방법 configure --help 출력

나는 이것이 autoconf 교리에서 전적으로 "정결하지 않은"해킹이 될 것이라는 것을 알고 있지만, 이식성 등의 결과로 기꺼이 살아야한다. 그러나 Autoconf 구현을 직접 편집하지 않기를 바란다. 또는 생성 된 configure 스크립트에 사후 처리 단계가 필요합니다.

m4의 힘처럼 보일 것 같지만 여러 가지를 시도해 보았습니다. 아무 것도 작동하지 않았습니다. 대부분은 m4 충돌을 낳습니다. 예 :

$ cat configure.ac 
AC_PREREQ(2.69) 
m4_define([_AC_INIT_HELP],patsubst(m4_defn([_AC_INIT_HELP]),[Fine],[Foo])) 
AC_INIT(foo,1.0) 
AC_OUTPUT() 
$ autoreconf 
/usr/local/pkg/autotools-201608/bin/m4: memory exhausted 
autom4te: /usr/local/pkg/autotools-201608/bin/m4 failed with exit status: 1 
aclocal: error: echo failed with exit status: 1 
autoreconf: aclocal failed with exit status: 1 

어떻게하면됩니까?

답변

3

마지막으로 직접 답변을 찾았습니다.

의 핵심은 악용하는 것입니다 m4_copy :

AC_PREREQ(2.69) 
m4_copy([_AC_INIT_HELP],[_MY_INIT_HELP]) 
m4_define([_AC_INIT_HELP],[patsubst(m4_defn([_MY_INIT_HELP]),[Fine],[Foo])]) 
AC_INIT(foo,1.0) 
AC_OUTPUT()