Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将参数传递到./configure_C_Bash_Gcc_Makefile_Configure - Fatal编程技术网

将参数传递到./configure

将参数传递到./configure,c,bash,gcc,makefile,configure,C,Bash,Gcc,Makefile,Configure,无论出于何种原因,我使用的第三方驱动程序需要在Makefile中添加-I/usr/include作为编译器标志,否则make会失败,因为它找不到某些头文件 我不想编辑提供的Makefile,而是在我自己的bash脚本中,将-I/usr/include传递到/configure,该脚本构建了几个其他驱动程序 我已经用/configure --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C h

无论出于何种原因,我使用的第三方驱动程序需要在Makefile中添加
-I/usr/include
作为编译器标志,否则
make
会失败,因为它找不到某些头文件

我不想编辑提供的Makefile,而是在我自己的bash脚本中,将
-I/usr/include
传递到
/configure
,该脚本构建了几个其他驱动程序

我已经用
/configure

--includedir=DIR       C header files [PREFIX/include]
--oldincludedir=DIR    C header files for non-gcc [/usr/include]
DIR
替换为
/usr/include

两次生成都失败,但如果我将
-I/usr/include
添加到makefile中的
额外\u CFLAGS
,则
make
将成功运行


是否可以提供包含目录的
make
configure
,这样我就不必编辑第三方makefile?或者我只是遗漏了什么?

如果它是一个标准的autoconf包,那么用户(您)就拥有
CFLAGS
cxflags
、和
CPPFLAGS
(这里的CPP代表C预处理器,而不是C++)变量,因此您可以随意修改它们。例如,其中任何一项都应满足您的要求:

./configure CPPFLAGS='-I/usr/include'
或:


如果它是一个标准的autoconf包,那么用户(您)就拥有
CFLAGS
cxflags
、和
CPPFLAGS
(这里的CPP代表C预处理器,而不是C++)变量,因此您可以随意修改它们。例如,其中任何一项都应满足您的要求:

./configure CPPFLAGS='-I/usr/include'
或:

另外,
--includedir
不起作用的原因是因为这是安装头文件的地方。不是在哪里可以找到它们。另外,
--includedir
不起作用的原因是因为这是安装头文件的地方。而不是在哪里找到它们。