linux

configure文件全攻略

2009年2月23日 阅读(76)

为了支持交叉编译,可能需要修改的内容项目

一.需要修改的变量:

  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>

Use these variables to override the choices made by `configure’ or to help
it to find libraries and programs with nonstandard names/locations.

二.需要修改的软件包

有些工具可能需要修改,比如生成二进制文件的工具,需要特殊的面向目标平台的链接程序等、

 

configure文件内容:

# 相关变量
# Initializations.
#

#安装目录选项,即将来的文件在make install exec_prefix=/foo会安装这个
#设置进行安装,为了达到这个效果,需要设置的变量
# Installation directory options.

#交叉编译涉及的变量
build=$build_alias
host=$host_alias
target=$target_alias

处理命令行configure参数的一堆:
‘–host=HOST’
指定软件运行的系统平台.如果没有指定,将会运行`config.guess’来检测.
‘–target=GARGET’
指定软件面向(target to)的系统平台.这主要在程序语言工具如编译器和汇编器上下文中起作用.如果没有指定,默认将使用’–host’选项的值.

#查找源文件
# Find the source files, if location was not specified.

#显示help信息的部分,包括help信息内容
# Report the –help message.

Some influential environment variables:

  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>

Use these variables to override the choices made by `configure’ or to help
it to find libraries and programs with nonstandard names/locations.

You Might Also Like