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
Answertopia.com

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

  




 

 

6.4 Running the Compiler

To check for a syntax feature of the current language's (see Language Choice) compiler, such as whether it recognizes a certain keyword, or simply to try some library feature, use AC_COMPILE_IFELSE to try to compile a small program that uses that feature.

— Macro: AC_COMPILE_IFELSE (input, [action-if-true], [action-if-false])

Run the compiler and compilation flags of the current language (see Language Choice) on the input, run the shell commands action-if-true on success, action-if-false otherwise. The input can be made by AC_LANG_PROGRAM and friends.

It is customary to report unexpected failures with AC_MSG_FAILURE. This macro does not try to link; use AC_LINK_IFELSE if you need to do that (see Running the Linker).

For tests in Erlang, the input must be the source code of a module named conftest. AC_COMPILE_IFELSE generates a conftest.beam file that can be interpreted by the Erlang virtual machine (ERL). It is recommended to use AC_LANG_PROGRAM to specify the test program, to ensure that the Erlang module has the right name.


 
 
  Published under the terms of the GNU General Public License Design by Interspire