emsr對此問題的回答:How can I specify that I want C++0x in Makefile.am?是我遇到問題的解決方案。人無我有一個新問題:我在哪裏可以放置更多自動工具宏?
我把宏定義爲M4/check.m4並相應地改變我的configure.ac:
AC_INIT([CppSs], [0.1], [[email protected]])
m4_include([m4/check.m4])
LT_INIT
AC_CONFIG_SRCDIR([src/main.cc])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
# ...
# Check for C++0x features
AC_COMPILE_STDCXX_OX
AC_HEADER_STDCXX_11
AC_OUTPUT
現在,當我運行autoreconf -v
我得到這些消息(試過-fiv也):
configure.ac:43: warning: AC_COMPILE_STDCXX_11 is m4_require'd but not m4_defun'd
../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from...
../../lib/autoconf/general.m4:2032: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2053: AC_CACHE_CHECK is expanded from... m4/cppss.
m4:90: AC_HEADER_STDCXX_11 is expanded from...
的./configure產量:
...
./configure: line 16234: AC_COMPILE_STDCXX_OX: command not found
./configure: line 16235: AC_COMPILE_STDCXX_11: command not found
...
我缺少什麼?
感謝,斯特芬
在問題中是否存在拼寫錯誤?你m4_include([m4/check.m4]),但是你寫出宏定義在m4/foo.m4中。 –
@William Pursell:是的,這是一個錯字,謝謝指出。更正它。 – steffen