从脚本运行时找不到GCC

时间:2014-01-27 17:42:37

标签: macos bash gcc nginx

我正在尝试制作一个脚本来获取和编译OS X上的nginx。当我从终端运行./configure --prefix=.时,我会得到你所期望的,但当我把它放入bash脚本时,我得到:< / p>

checking for OS
 + Darwin 13.0.0 x86_64
checking for C compiler ... not found

./configure: error: C compiler cc is not found

make: *** No rule to make target `build', needed by `default'.  Stop.

关于什么会导致GCC失踪的任何想法?

1 个答案:

答案 0 :(得分:0)

  1. 检查cc的完整路径(执行which cc)。
  2. 扩展脚本中的路径(例如PATH=$PATH:/usr/bin