Rtems 4.11-Part M4 file analysis

Source: Internet
Author: User
Tags posix perl script automake

Originally want to configure.ac and various M4 file analysis understand, found a little difficult, but fortunately also can understand some.

Basic Tutorials

First of all to understand M4, see this tutorial, write well, no matter how M4 replacement to replace, is really not so easy to understand, fortunately we do not have to write, as long as to understand the effect of it ~

And then we have to get to know the next Autoconf and Automake, this book is good "Autotools:a practioner ' s Guide to GNU Autoconf, Automake, and Libtool", CSDN has download.

folder Structure

When used with autoconf and Automake, the user-defined macros should be placed in ACINCLUDE.M4 and M4/*.M4 (the GNU autoconf manual is said to be aclocal/*.m4), as is the process:

ACINCLUDE.M4 \

aclocal/*.m4 | = = = Aclocal Perl script (provided by Automake) ===> ACLOCAL.M4

CONFIGURE.AC/

The autoconf then processes the aclocal.m4before processing the configure.ac so that the macro definitions contained in the ACINCLUDE.M4 ACLOCAL/*.M4 can be used in configure.ac

ACLOCAL/*.M4
  • VERSION.M4: Defining _rtems_version and _rtems_api constants
  • RTEMS-TOP.M4: Define rtems_topdir= Source code top-level directory (relative path) and Project_topdir=build-tree top-level directory (relative path)
  • ENABLE-CXX.M4: Define--enable-cxx option , final corresponding variable is rtems_has_cplusplus, default is no
  • ENABLE-DRVMGR.M4: Define--enable-drvmgr option , final corresponding variable is rtems_drvmgr_startup, default is Yes
  • enable-multiprocessing.m4: Define--enable-multiprocessing select entry, The final corresponding variable is Enable_multiprocessing, default to No
  • enable-networking.m4: Define--enable-networking select Items, The final corresponding variable is rtems_has_networking, the default is yes
  • enable-paravirt.m4 : Define--enable-paravirt select entry, final corresponding variable is rtems_has_paravirt, default is no
  • enable-posix.m4 : Define--enable-posix Select entry, final corresponding variable is RTEMS_HAS_POSIX_API, default is yes
  • Enable-rtemsbsp.m4 : Definition--enable- rtemsbsp Select entry, The final corresponding variable is enable_rtemsbsp, this is a list, each--enable-rtemsbsp will add a new BSP to this list, You can also add more than one space-delimited list of BSP, the default is empty
  • Enable-rtems-debug.m4: Define--enable-Rtems-debug selectedItemThe final corresponding variable is enable_rtems_debug, the default is no
  • Enable-smp.m4: Define--enable-SMP selectedItemThe final corresponding variable is RTEMS_HAS_SMP, the default is no
  • Enable-tests.m4: Define--enable-tests selectedItemThe final corresponding variable is enable_tests, the value can be yes/no/samples default to samples
  • Multilib.m4: Define--enable-MultilibOptions The final corresponding variable is multilib, the default is no, and the Automake condition Multilib is defined, and two autoconf variables are defined, @@[email protected]@ and @@[email  protected]@ can be used in makefile, one will be defined as empty and the other is # (makefile comment)
  • PATH-KSH.M4: Set the absolute path of the first shell found in bash/ksh/sh to the Ksh variable, ac_path_progs and Ac_check_progs similar, but set an absolute path
  • PROJECT-ROOT.M4: Set Packhex and BIN2C variables, point to compiled Tools/build/packhex and RTEMS-BIN2C tools
  • CANONICAL-TARGET-NAME.M4: Get the RTEMS_CPU variable from the $target variable
  • CHECK-BSPS.M4: Define RTEMS_CHECK_BSPS the macro assigns the shell variable specified by the parameter to all BSP lists (where the implied RTEMS of the BSP is not the same name), how is all BSP determined? In fact first LS c/lib/libbsp/$RTEMS _cpu/*/bsp_specs, where * is the BSP family, and then find the BSP Family folder Make/custom/*.cfg, this is the BSP. For Beagle, C/lib/libbsp/arm/beagle/make/custom/*.cfg is Beagleboardorig/beagleboardxm/beagleboneblack/ Beaglebonewhite
  • CHECK-CUSTOM-BSP.M4: Define _rtems_check_custom_bsp[bsp_name, Path], find out if <bsp_name>.cfg file exists, and assign full path to <path> The shell variable
  • BSP-ALIAS.M4: Defined _rtems_bsp_alias[bsp_path, bsp_family], returns bsp_family,bsp_path default to $RTEMS _bspAccording to the file path of the BSP configuration. bsp_family Default to Rtems_bsp_family

The acinclude.m4 file is a bit complicated, not looking closely, and I found that c/src/aclocal and cpukit/aclocal have many similar or identical files in the aclocal directory of the top-level directory (this design should be problematic), and for the time being, Regardless of the first, know how to add a BSP can continue to move forward.

Rtems 4.11-Part M4 file analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.