macos 配置选项,例如“--extra-cflags”---我很困惑
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10475903/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
a configure's options such as "--extra-cflags" --- I am confused
提问by Henry
# configure for i386 build
./configure \
--cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/system \
--target-os=darwin \
--arch=i386 \
--cpu=i386 \
--extra-cflags='-arch i386' \
--extra-ldflags='-arch i386' \
--prefix=compiled/i386 \
--enable-cross-compile \
--disable-armv5te \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc
the below will build ffmpeg static libraries for i386. but i don't know about the option's means such as "--extra-cflags"、"--extra-ldflags"、"--sysroot="、"--as=".
下面将为 i386 构建 ffmpeg 静态库。但我不知道该选项的含义,例如“--extra-cflags”、“--extra-ldflags”、“--sysroot="、"--as="。
who can tell me about those options mean ? where i can find the details explanation?
谁能告诉我那些选项是什么意思?我在哪里可以找到详细说明?
thanks . I am waitting for your help.
谢谢 。我在等你的帮助。
回答by Ernest Friedman-Hill
You can always run the configure
script as configure --help
; it will print a usage statement and information about many of the accepted parameters -- and usually, hopefully, the package-specific ones of interest.
您始终可以将configure
脚本运行为configure --help
; 它将打印关于许多可接受参数的使用声明和信息——通常,希望是感兴趣的特定于包的参数。
That said, --extra-cflags
would provide extra command-line switches for the C compiler, --as
would give the path to the assembler, --sysroot
would give an alternate installation directory, and --extra-ldflags
would provide extra flags for the linker. Those are all fairly advanced, and you're unlikely to need to use them.
也就是说,--extra-cflags
将为 C 编译器提供额外的命令行开关,--as
提供汇编程序的路径,--sysroot
提供备用安装目录,并--extra-ldflags
为链接器提供额外的标志。这些都是相当先进的,您不太可能需要使用它们。
回答by eepp
This is a funny configure
script, because usual Autoconf ones use environment variables for such things like C flags (CFLAGS
) and the C compiler location (CC
). For example:
这是一个有趣的configure
脚本,因为通常的 Autoconf 使用诸如 C 标志 ( CFLAGS
) 和 C 编译器位置 ( CC
) 之类的环境变量。例如:
CC=/path/to/my/specific/gcc/version CFLAGS="-I/additional/include/dir -L/additional/library/dir" \
./configure --prefix=/installation/dir --host=cross-compiler-triplet-if-any \
--enable-something --with-some-feature --disable-something-else