configure.ac_linux中configure报错_configure prefix(5)

电脑杂谈  发布时间:2017-04-06 14:01:55  来源:网络整理

代码2287-2301行,用来创建.gdbinit文件,方便调试gcc。

# Determine whether gdb needs tk/tcl or not.
# Use 'maybe' since enable_gdbtk might be true even if tk isn't available
# and in that case we want gdb to be built without tk.  Ugh!
# In fact I believe gdb is the *only* package directly dependent on tk,
# so we should be able to put the 'maybe's in unconditionally and
# leave out the maybe dependencies when enable_gdbtk is false.  I'm not
# 100% sure that that's safe though.

gdb_tk="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-libgui"
case "$enable_gdbtk" in
  no)
    GDB_TK="" ;;
  yes)
    GDB_TK="${gdb_tk}" ;;
  *)
    # Only add the dependency on gdbtk when GDBtk is part of the gdb
    # distro.  Eventually someone will fix this and move Insight, nee
    # gdbtk to a separate directory.
    if test -d ${srcdir}/gdb/gdbtk ; then
      GDB_TK="${gdb_tk}"
    else
      GDB_TK=""
    fi
    ;;
esac
CONFIGURE_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-configure-/g`
INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`

代码2352-2378行,用来确定gdb是否需要tk/tcl。这里作者提到一个他认为可以进行改进,但又不太确定的地方。

7、去掉Makefile中不需要的目标(target)

extrasub_build=
for module in ${build_configdirs} ; do
  if test -z "${no_recursion}" \
     && test -f ${build_subdir}/${module}/Makefile; then
    echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
    rm -f ${build_subdir}/${module}/Makefile
  fi
  extrasub_build="$extrasub_build
/^@if build-$module\$/d
/^@endif build-$module\$/d
/^@if build-$module-$bootstrap_suffix\$/d
/^@endif build-$module-$bootstrap_suffix\$/d"
done
... ...
AC_CONFIG_FILES([Makefile],
  [sed "$extrasub_build" Makefile |
   sed "$extrasub_host" |
   sed "$extrasub_target" > mf$$
   mv -f mf$$ Makefile],
  [extrasub_build="$extrasub_build"
   extrasub_host="$extrasub_host"
   extrasub_target="$extrasub_target"])
AC_OUTPUT

这部分代码位于2382-2392,2445-2497,3199-3207行,用来删除掉Makefile(或者Makefile.in)中不需要的目标。

Makefile.in文件中有许多@if和@endif包裹的模块。configure.ac中定义了变量extrasub_build,extrasub_host,

extrasub_target,它们是根据build_configdirs,configdirs,target_configdirs的内容而定义的sed语句。

在最后的AC_CONFIG_FILES命令中,将会调用这些sed语句,修改Makefile,对@if语句块进行选择性的删除。

8、设定BUILD_CONFIG变量,以调整顶层makefile

# Adjust the toplevel makefile according to whether bootstrap was selected.
case $enable_bootstrap in
  yes)
    bootstrap_suffix=bootstrap
    BUILD_CONFIG=bootstrap-debug
    ;;
  no)
    bootstrap_suffix=no-bootstrap
    BUILD_CONFIG=
    ;;
esac
... ...
AC_MSG_RESULT($BUILD_CONFIG)

这部分代码位于2401-2443行,根据是否选择了bootstrap,来设定BUILD_CONFIG变量的值。

Makefile中会根据该变量的值将config子目录下相应的mk文件包含进来。

9、串行化configure

# Create the serialization dependencies.  This uses a temporary file.

AC_ARG_ENABLE([serial-configure],
[AS_HELP_STRING([[--enable-serial-[{host,target,build}-]configure]],
                [force sequential configuration of
                 sub-packages for the host, target or build
                 machine, or all sub-packages])])
... ...
serialization_dependencies=serdep.tmp
AC_SUBST_FILE(serialization_dependencies)

这部分代码位于2499-2547行,用来实现对串行化configure的支持。

10、对自举(bootstrap)的支持

# ---------------------
# GCC bootstrap support
# ---------------------

# Stage specific cflags for build.
stage1_cflags="-g"
case $build in
  vax-*-*)
    case ${GCC} in
      yes) stage1_cflags="-g -Wa,-J" ;;
      *) stage1_cflags="-g -J" ;;
    esac ;;
esac
... ...

这部分代码位于3118-3197行,用来设定不同阶段的命令行选项(比如stage1_cflags),

指定哪些文件在自举过程中不需要进行比较操作。


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-39818-5.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...