Best practices with autotools分析和总结分析和总结.docxVIP

  • 1
  • 0
  • 约1.97万字
  • 约 9页
  • 2023-04-24 发布于上海
  • 举报

Best practices with autotools分析和总结分析和总结.docx

Best practices with autotools 1. Best practices with autotools The core of GNUs compile chain -- the set of tools used to build GNU software packages -- is the so-called autotools, a term that refers to the autoconf and automake programs, as well as libtool, autoheader, pkg-config, and sometimes gettext. These tools let you compile GNU software on a wide variety of platforms and Unix and Unix-like operating systems, providing developers a framework to check for the presence of the libraries, functions, and tools that they want to use. While autotools are great in the hands of an experienced developer, they can be quite a handful for the first-time user, and its not so rare that packages are shipped with working-but-broken autotools support. This article will cover some of the most common errors people make when using autotools and ways to achieve better results. Regardless of anyones opinion about them, we currently have no valid alternative for autotools. Projects such as Scons are not as portable as autotools, and they dont embody enough knowledge to be useful yet. We have tons of automatic checks with autotools, and a lot of libraries come with an m4 library with macros to check for their presence. The basic structure of an autotooled project is simple. Autoconf takes help of an aclocal.m4 file (created by aclocal using the m4 libraries on its search path and acinclude.m4 file) to parse the configure.ac file (formerly configure.in) and transform it into a configure script. For every directory there should exist an Makefile.am, which automake uses to create Makefile.in templates. The Makefile.in templates are then processed and transformed by the configure script into real Makefiles. You can avoid avoid using automake and just write your own Makefile.in files, but this is quite complex, and you lose a few features of autotools. In a configure.ac file you can use macros you define yourself, the default ones provided by autoconf and aclocal, or external macros provi

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档