Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Back: Autoconf macro archive
Forward: Migrating Existing Packages
 
FastBack: Writing New Macros for Autoconf
Up: Future directions for macro writers
FastForward: Migrating Existing Packages
Top: Autoconf, Automake, and Libtool
Contents: Table of Contents
Index: Index
About: About this document

23.5.2 Primitive macros to aid in building macros

Writing new macros is one aspect of Autoconf that has proven troublesome to users in the past, since this is one area where Autoconf's implementation details leak out. Autoconf extensively uses m4 to perform the translation of `configure.in' to `configure'. Thus, it is necessary to understand implementation details such as M4s quoting rules in order to write Autoconf macros (21. M4).

Another aspect of macro writing which is extremely hard to get right is writing portable Bourne shell scripts (see section 22. Writing Portable Bourne Shell). Writing portable software, be it in Bourne shell or C++, is something that can only be mastered with years of experience--and exposure to many different kinds of machines! Rather than expect all macro writers to acquire this experience, it makes sense for Autoconf to become a `knowledge base' for this experience.

With this in mind, one future direction for Autoconf will be to provide a library of low-level macros to assist in writing new macros. By way of hypothetical example, consider the benefit of using a macro named AC_FOREACH instead of needing to learn the hard way that some vendor's implementation of Bourne shell has a broken for loop construct. This idea will be explored in future versions of Autoconf.

When migrating existing packages to the GNU Autotools, which is the topic of the next chapter, it is worth remember these guidelines for best practices as you write the necessary tests to make those packages portable.


This document was generated by Gary V. Vaughan on February, 8 2006 using texi2html

 
 
  Published under the terms of the Open Publication License Design by Interspire