现在但不能编译

时间:2014-05-05 17:38:21

标签: macos osx-mavericks configure

尝试在安装了Xcode 5.1.1和命令行工具的OSX Mavericks上运行./configure时,我收到以下警告:

checking pcre.h presence... yes
configure: WARNING: pcre.h: present but cannot be compiled
configure: WARNING: pcre.h:     check for missing prerequisite headers?
configure: WARNING: pcre.h: see the Autoconf documentation
configure: WARNING: pcre.h:     section "Present But Cannot Be Compiled"
configure: WARNING: pcre.h: proceeding with the compiler's result
checking for pcre.h... no

同样的消息也会出现在其他头文件中...... time.hsys/time.hsyslog.h等。

有任何线索可以解决这个问题吗?

1 个答案:

答案 0 :(得分:2)

线索在config.log中,正如twalberg建议的那样:

  

configure:14647:gcc -c -g -O2 -Wextra -Werror-implicit-function-declaration -fno-tree-pre -Wall -Wno-unused-parameter -std = gnu99 -DOS_DARWIN -DIPFW -I / opt / local / include conftest.c>& 5
   clang:错误:未知参数:' - fno-tree-pre'

我选择强制我的项目使用llvm-gcc以更好地兼容旧项目:

  

CC = llvm-gcc ./configure

您还可以编辑“configure.ac”并从CFLAGS中删除“-fno-tree-pcre”,但是您可能会遇到其他兼容性问题。祝你好运!

  

--- configure.ac.orig 2014-09-24 16:16:11.000000000 -0700
  +++ configure.ac.works 2014-09-24 16:19:29.000000000 -0700
  @@ -65,7 +65,7 @@
                  CFLAGS =“$ CFLAGS -Wextra -Werror-implicit-function-declaration”
                  #删除破坏我们代码的优化选项
                  #VJ 2010/06/27:no-tree-pre添加。它打破了ringbuffers代码    - CFLAGS =“$ CFLAGS -fno-tree-pre”
  + CFLAGS =“$ CFLAGS”
          否则
                  CFLAGS =“$ CFLAGS -W”
          音响