Autoconf manual은 AC_CONFIG_COMMANDS_PRE
및 AC_CONFIG_COMMANDS_PRE
매크로 (아래 참조)에 대해 설명합니다. 나는 다음과 같은 상대적 순서로 매크로를 사용할 때AC_CONFIG_COMMANDS_PRE 및 AC_CONFIG_COMMANDS_POST를 사용하는 방법?
들은 적용되지 않습니다
configure: creating ./config.status
sed: -e expression #1, char 1: unknown command: `|'
sed: -e expression #1, char 1: unknown command: `|'
sed: -e expression #1, char 1: unknown command: `|'
: 그럼이 결과
AC_CONFIG_COMMANDS_POST([sed -e '|S["CC"]|d' config.status > config.status.xxx; mv config.status.xxx config.status])
AC_CONFIG_COMMANDS_POST([sed -e '|S["FLAGS"]|d' config.status > config.status.xxx; mv config.status.xxx config.status])
AC_CONFIG_COMMANDS_POST([sed -e '|S["ac_ct_CC"]|d' config.status > config.status.xxx; mv config.status.xxx config.status])
AC_OUTPUT(Makefile)
:
## configure.ac
...
AC_OUTPUT(Makefile)
AC_CONFIG_COMMANDS_POST(cmd)
AC_CONFIG_COMMANDS_POST(cmd)
AC_CONFIG_COMMANDS_POST(cmd)
내가 상대 순서를 변경하는 경우
제 첫 질문은 cmd
의 형식은 무엇입니까? AC_CONFIG_COMMANDS
과 같이 대괄호 ([
및 ]
)로 묶어야합니까? 아니면 다른 것이 필요합니까?
내 두 번째 질문은 매크로의 상대적인 순서는 무엇입니까 AC_OUTPUT
, AC_CONFIG_COMMANDS_PRE
및 AC_CONFIG_COMMANDS_POST
?
제 3의 질문은 어느 시점에서 config.status
또는 Makefile
으로 작성되었으므로 고칠 수 있습니까?
또한 수동 3.1.3 Standard configure.ac Layout있는 부분이 있습니다,하지만 AC_OUTPUT
, AC_CONFIG_COMMANDS_PRE
및 AC_CONFIG_COMMANDS_POST
의 상대적 순서를 설명하지 않습니다.
Makefile
을 수정하는 것이 더 좋지만, Makefile
이 준비되어있을 때가 아니라 config.status
이 준비되었을 때 설명서를 읽은 것으로 표시되는 것 같습니다.
미리 감사드립니다.
— Macro: AC_CONFIG_COMMANDS (tag..., [cmds], [init-cmds]) Specify additional shell commands to run at the end of config.status, and shell commands to initialize any variables from configure. Associate the commands with tag. Since typically the cmds create a file, tag should naturally be the name of that file. If needed, the directory hosting tag is created. This macro is one of the instantiating macros; see Configuration Actions. Here is an unrealistic example: fubar=42 AC_CONFIG_COMMANDS([fubar], [echo this is extra $fubar, and so on.], [fubar=$fubar]) — Macro: AC_CONFIG_COMMANDS_PRE (cmds) Execute the cmds right before creating config.status. This macro presents the last opportunity to call AC_SUBST, AC_DEFINE, or AC_CONFIG_FOOS macros. — Macro: AC_CONFIG_COMMANDS_POST (cmds) Execute the cmds right after creating config.status.
'sed' 오류에 관해서는 파이프 기호'|'를 주소의 정규식 구분 기호로 사용하려고하는 것 같습니다. 일반 구분 기호는 슬래시 ('/')입니다. 다른 것을 사용하려면 백 슬래시 앞에'sed -e '\ | S [ "CC"] | d'config.status [...]'를 써야합니다. –