The Autoconf Macro Archive!

| # Welcome To The Autoconf Macro archive! | ac-archive.sf.net 0.5.32

## C++ Support: ac_cxx_bool.m4 ac_cxx_complex_math_in_namespace_std.m4 ac_cxx_const_cast.m4 ac_cxx_default_template_parameters.m4 ac_cxx_dtor_after_atexit.m4 ac_cxx_dynamic_cast.m4 ac_cxx_enum_computations.m4 ac_cxx_enum_computations_with_cast.m4 ac_cxx_exceptions.m4 ac_cxx_explicit.m4 ac_cxx_explicit_instantiations.m4 ac_cxx_explicit_template_function_qualification.m4 ac_cxx_full_specialization_syntax.m4 ac_cxx_function_nontype_parameters.m4 ac_cxx_have_complex.m4 ac_cxx_have_complex_math1.m4 ac_cxx_have_complex_math2.m4 ac_cxx_have_ieee_math.m4 ac_cxx_have_numeric_limits.m4 ac_cxx_have_sstream.m4 ac_cxx_have_std.m4 ac_cxx_have_stl.m4 ac_cxx_have_string_push_back.m4 ac_cxx_have_system_v_math.m4 ac_cxx_have_valarray.m4 ac_cxx_have_vector_at.m4 ac_cxx_member_constants.m4 ac_cxx_member_templates.m4 ac_cxx_member_templates_outside_class.m4 ac_cxx_mutable.m4 ac_cxx_namespaces.m4 ac_cxx_nceg_restrict.m4 ac_cxx_new_for_scoping.m4 ac_cxx_old_for_scoping.m4 ac_cxx_partial_ordering.m4 ac_cxx_partial_specialization.m4 ac_cxx_reinterpret_cast.m4 ac_cxx_rtti.m4 ac_cxx_static_cast.m4 ac_cxx_template_keyword_qualifier.m4 ac_cxx_template_objs.m4 ac_cxx_template_qualified_base_class.m4 ac_cxx_template_qualified_return_type.m4 ac_cxx_template_scoped_argument_matching.m4 ac_cxx_templates.m4 ac_cxx_templates_as_template_arguments.m4 ac_cxx_typename.m4 ac_cxx_use_numtrait.m4 mdl_cxx_function_try_blocks.m4 mni_cxx_have_koenig_lookup.m4 ## C Support: ac_c_var_func.m4 ac_check_cc_opt.m4 ac_func_long_long.m4 ac_func_mkdir.m4 ac_func_snprintf.m4 ac_func_vsnprintf.m4 ac_need_stdint_h.m4 ac_prog_cc_char_subscripts.m4 ac_prog_cc_no_writeable_strings.m4 ac_prog_cc_strict_prototypes.m4 ac_prog_cc_warnings.m4 acx_restrict.m4 dps_snprintf_oflow.m4 etr_string_strcasecmp.m4 etr_strings_strcasecmp.m4 ## Cross Compilation: ac_c_bigendian_cross.m4 ac_prog_cc_for_build.m4 ## Installed Packages: ac_caolan_check_package.m4 ac_caolan_search_package.m4 ac_cond_with.m4 ac_config_libconfig_in.m4 ac_jni_include_dirs.m4 ac_lib_readline.m4 ac_path_lib.m4 ac_pkg_mico.m4 ac_prog_apache.m4 ac_prog_cp_s.m4 ac_prog_fig2dev.m4 ac_prog_modprobe.m4 acx_pthread.m4 adl_func_getopt_long.m4 am_rpm_init.m4 am_with_mpatrol.m4 bnv_have_qt.m4 check_gnu_make.m4 check_zlib.m4 mdl_have_opengl.m4 mp_with_curses.m4 patch_libtool_on_darwin_zsh_overquoting.m4 patch_libtool_sys_lib_search_path_spec.m4 patch_libtool_to_add_host_cc.m4 peti_path_sendmail.m4 peti_with_dmalloc.m4 rssh_check_sunpro_c.m4 sg_afs.m4 smr_with_build_path.m4 ## Java Support: ac_check_class.m4 ac_check_classpath.m4 ac_check_junit.m4 ac_check_rqrd_class.m4 ac_java_options.m4 ac_prog_jar.m4 ac_prog_java.m4 ac_prog_java_works.m4 ac_prog_javac.m4 ac_prog_javac_works.m4 ac_prog_javadoc.m4 ac_prog_javah.m4 ac_try_compile_java.m4 ac_try_run_javac.m4 ## Miscellaneous: ac_caolan_func_which_gethostbyname_r.m4 ac_check_struct_for.m4 ac_compile_check_sizeof.m4 ac_compile_warnings.m4 ac_cond_with.m4 ac_cond_with_level.m4 ac_create_generic_config.m4 ac_create_prefix_config_h.m4 ac_create_target_h.m4 ac_define_dir.m4 ac_define_versionlevel.m4 ac_func_accept_argtypes.m4 ac_need_target_h.m4 ac_path_generic.m4 ac_prefix_config_h.m4 ac_prompt_user.m4 ac_prompt_user_no_define.m4 ac_prototype.m4 ac_prototype_accept.m4 ac_prototype_getsockname.m4 ac_prototype_setsockopt.m4 ac_raf_func_which_getservbyname_r.m4 ac_subdir_files.m4 ac_subst_dir.m4 ac_sys_dev_poll.m4 ac_very_nice.m4 acx_check_dos_filesys.m4 acx_check_pathname_style.m4 acx_func_fork.m4 cf_ebcdic.m4 etr_short_sleep.m4 etr_socket_nsl.m4 etr_struct_semun.m4 etr_sysv_ipc.m4 normpath.m4 peti_enable_dynamic_linking.m4 peti_path_srcdir.m4 peti_pedantic_gcc.m4 peti_silent_mode.m4 qef_c_noreturn.m4 relpaths.m4 stdrelpaths.m4 type_socklen_t.m4 ## adl's macros: ac_func_mkdir.m4 normpath.m4 relpaths.m4 stdrelpaths.m4 ## bkorb's macros: ag_check_allocated_ctime.m4 ag_check_posix_regcomp.m4 ag_check_posix_sysinfo.m4 ag_check_strftime.m4 ag_check_sys_siglist.m4 ag_check_uname_syscall.m4 ## guidod's macros: ac_arg_with_path_style.m4 ac_as_dirname.m4 ac_as_mkdir_p.m4 ac_c_bigendian_cross.m4 ac_c_long_long_.m4 ac_check_cc_opt.m4 ac_check_func_in.m4 ac_check_symbol.m4 ac_check_typedef.m4 ac_cond_with.m4 ac_cond_with_level.m4 ac_create_generic_config.m4 ac_create_prefix_config_h.m4 ac_create_stdint_h.m4 ac_create_target_h.m4 ac_define_dir_.m4 ac_define_path_style.m4 ac_define_versionlevel.m4 ac_echo_mkfile.m4 ac_echo_n.m4 ac_need_stdint_h.m4 ac_need_target_h.m4 ac_numeric_namedlevel.m4 ac_prefix_config_h.m4 ac_prog_cc_char_subscripts.m4 ac_prog_cc_no_writeable_strings.m4 ac_prog_cc_strict_prototypes.m4 ac_prog_cp_s.m4 ac_set_default_paths_dllsystem.m4 ac_set_default_paths_system.m4 ac_set_releaseinfo_versioninfo.m4 ac_set_versionlevel.m4 ac_spec_package_version.m4 ac_subdir_files.m4 ac_subst_prefix_subpaths.m4 ac_withnone.m4 patch_libtool_on_darwin_zsh_overquoting.m4 patch_libtool_sys_lib_search_path_spec.m4 patch_libtool_to_add_host_cc.m4 ## rleigh's macros: ac_config_libconfig_in.m4 ac_path_lib.m4 |
## Introduction | introduction downloading gnu.org.archive contribute! acpackage (history) acinclude (the tool) formatting copyright
I'd like to say one small thing before going into details: Please contribute! Much effort has been put into this place, in the hope that it will be useful to as many people as possible. But we can't do it all by ourselves -- we need your help. If you have written a macro (or two?) of which you think that it might be useful, please contribute it to the archive. Curiously enough, many people seem to be scared away by the idea that "their macro is not good enough to be published". Try to look at it this way: Nobody is perfect, nobody knows everything and nobody will be flamed if there is a minor stylistic deficiency in the code of a macro published here. Hey, do you know any better way to get your code debugged for free by several hundred volunteers? :-) Enough for now, just have a look at the autoconf macros - they are grouped by category on the left side. ## Downloading all macros at once In case you want to download all macros at once rather than having to click through the whole list and access them individually, just get tarballs and rpm archives from the project's sourceforge filelist, where updates are posted every time a member of the archive changes or new macros are added. ## The GNU Autoconf Macro Archive The GNU Autoconf Macro Archive lives at http://www.gnu.org/software/ac-archive which has a CVS repository at the sourceforge-like savannah project page at http://savannnah.gnu.org/projects/ac-archive that I am also co-maintaining - Peter Simons has created the original idea of an Autoconf Macro Archive, and he does also maintain the GNU pages that were created from his original private site. Much of this front page was originally written by him - including the GPL copyright information at the end of page ;-) ## If you want to contribute ... then please don't hesitate a second! Just send the m4 source to Guido Draheim <guidod@gnu.org> via electronic mail. See the section about the contribution format on the macro documentation guidelines. Note that the two ac-archive repositories (sourceforge and savannah) are constantly kept in sync while the sfnet branch offers space for experimental extras. It is therefore updated more frequently than the original GNU ac-archive which works the traditional way without neither of the `aclocal` installoption or the `acinclude` packageoption. further reading... GNU Autoconf configure maker GNU Automake makefile generator GNU Libtool sharedlibrary tool GNU M4 the macro processor RedHat Autotools project sources Basic AC-Archive @ GNU (the official site) Basic AC-Archive @ Savannah (developers) Extra AC-Archive @ Project (summary) Extra AC-Archive @ Sourceforge (home) ............ including RPMs and tarballs Autogen to easily create new autoconf tests. ## acpackage aclocal acinclude and other history There was a time that the autoconf project was invented to help people make their projects more portable and it was a time that the basic autoconf project provided all the means to do it, and the automake project invented the "aclocal" tool to augment on top of it with macro series provided by other packages which they were installing in the /usr/share/aclocal subdirectory. There you will find macro-files like "libtool.m4" which hold the macros to properly "configure" the functionality of these tools in the case that a developer wants to use them in a project. And the "aclocal" tool will detect the macros in the "configure.in" script copying the needed macros a file called "aclocal.m4" which the "autoconf" tool will see automatically and bind in to its resources otherwise coming from /usr/share/autoconf. However, the macros in package-specific "share/aclocal" and the base functionality in "share/autoconf" do not adress a specific area: the use of macros in multiple projects where these macros are neither general w.r.t. to portability and neither project-centric w.r.t. to just one project. These are often some feature tests developed in one project and that was found useful enough to be reused in other projects - and it is the natural way to give it a name and reference the functionality by its name - et voila, this is what the term "macro" says, to pack a series of commands under a name, possibly with some arguments that to carry package-specific variables into the heart of the memorized feature test. It happens to be very easy to develop such a macro, (1) just cut out your shell script that you came to test a feature, and put it into its own file, e.g. "ac_mytest.m4". (2) Then put up the trailer and footer that you can see in the "contribution" example or in any of the other ac-archive scripts - i.e. add a comment-block (using the "dnl"-m4-comment instead of the "#"-sh-comment) and the `AC_DEFUN([AC_MYTEST],[......])` declaration to give it the name `"AC_MYTEST"`. And (3) do not forget to look for the "["s and "]"s in the macro body since these are the autoconf-quotes - just double them into "[["s and "]]"s which "autoconf" will shrink back to simple square when it expands your "configure.ac" to the "configure" script. Well, that's all what is needed to create an ac-macro. The next step is not related to creation of an ac-macro but how make these to be reused in multiple projects. Just copying the bew file "ac_mytest.m4" to that project directory is not enough since neither "aclocal" nor "autoconf" will see it automatically. The way to manage these has a bit of history to watch out for. (a) "autoconf" tool will use all the macros in "share/autoconf/" directory plus the macros in "aclocal.m4" in the project directory. (b) "aclocal" will use all the macros in "share/aclocal" plus the macros in "acinclude.m4" in the project directory. To augment on these tools, the traditional way is (A) create a subdirectory "m4/" in your project directory, copy the ac-macros thereunder and make sure to call "aclocal -I m4" to have these macros copied into "aclocal.m4" - to ensure this, watch out for "automake" which will create a rule in its "Makefile.in" to call "aclocal" automatically. There is an option called $(ACLOCAL_AMFLAGS) you can use to add the requried subdir for it. (B) just copy the two macros you need into the project directory, and "cat" the two macros together into the "acinclude.m4" file, i.e. "cat mytest1.m4 mytest2.m4 >acinclude.m4" - downside: you want to do that only for one or two macros, not a dozen of them. Well, both of these ways have a drawback - when you update your cross-project ac-macro, how do you distribute the changes to other project directories? Originally, the "aclocal" command could distribute the changes, and that is what Guido Draheim started to do - to create a distribution archive including rpm file that will install the extra macros into "share/aclocal" so that all projects will instantly find the updated ac-macro. This was convenient for his two dozen macros, and the project was called "aclocals" to give the impression to extend the "aclocals" macros being installed. However, later he discovered the ac-archive project invented by Peter Simons, and instantly started to reuse some of the macros stored there - which of course results in two competeing strains of update paths with both packaging tarballs to carry around macros. Well, in the opensource world there is never something wrong with solving the problem of overlap between two projects - merge them! I do not want to delve into the specifics why the merge did not succeed instantly with the sfnet branch showing the benefit that the "aclocals" packaging system can provide to the ac-archive - the gnu-hosted series is pretty much the original site that was present as a subdirectory of Peter's homepage and which is now a subdirectory at www.gnu.org. Let's hope that the final pieces can be solved later and the sfnet branch will degenerate to a place for pure experimentation ... and rpm series which I doubt will be shipped on the gnu.org servers sometime soon. ## acinclude (the tool) With more and more macros to show up in the ac-archive however the limitations of the "aclocals" installoption became more and more inconvenient to handle - the merged series of user-centric macros with the heap of macros out of the ac-archive was just a bit much. With the growing popularity (partly through the fame of being a gnu project) the number of macros in the ac-archive multiplied and it was unfair to have 200 macros being handled in the "share/aclocal" directory. The ac-archive website had been broken into six subcategories for a reason and with more and more macros showing up, we do actually consider to add more subcategories in order to handle the bulk of macros more easily. Furthermore, it became known that more and more projects started to get another dependency on the ac-archive project, or more specifically, the sfnet branch for any maintainer-clean of those projects since for convience these projects did not ship the m4 ac-archive macros but they did just use the aclocal.m4 file being generated by "aclocal" itself. But any maintainer-clean will sweep that file, and if a bootstrap build of a project did not preinstall the ac-archive then a number of unresolved autoconf macros will be the result (debian autobuild maintainers may have seen these). To overcome this problem area, Guido Draheim did develop the "acinclude" tool recently - which is actually a copy of "aclocal" modified for the needs of the "ac-archive". This tool will (as the name suggests) create a file called "acinclude.m4" in the project directory which will be left untouched by any maintainer-sweeps *and* which automake will see and automatically include in a tarball of the resp. project directory. Furthermore, this "acinclude" tool will not just scan one directory like "aclocal" would but it will scan for m4-files in the subdirectories of any of its "-I"-options - with a default to look for m4-files in the subdirectories (!!) of "share/aclocal" which the original "aclocal" tool will ignore. That way, the new "acinclude" installoption will copy the ac-archive to the "share/aclocal" path as it is - with all its subcategories represented in the form of subdirectories. Furthermore, these directories are always searched in alphabetic order with any macro found in later directories to overwrite the previous ones - and since the official ac-archive directories are starting in big-caps, any developer can start out with his own subdir to hold his specific macros or some experimental extension to the official ones. Now have a look back into the previous section where we talked about the sequence of tools the files that they create. This sequence is now simply enlarged with a third tool - and it reads now like this: (a) "autoconf" tool will use all the macros in "share/autoconf/" directory plus the macros in "aclocal.m4" in the project directory - creating "configure". (b) "aclocal" will use all the macros in "share/aclocal/" plus the macros in "acinclude.m4" in the project directory. - creating "aclocal.m4" (c) "acinclude" will use all the macros in "share/aclocal/*/" (the subdirectoires of "share/aclocal" plus the macros in "acpackage.m4" - creating "acinclude.m4" and the "acinclude.m4" file will then be known to carry cross-project macros coming either directly from the ac-archive's official subcategories or from a user-specific subcategories where examples can see be seen in the sfnet branch for some well-known developers. However, please note: the "acinclude" tool is a quick hack that just does what is should do - so please report any problems or ideas about it as you would do for any beta software.

## Contribution Format

Please contribute! Just send the m4 source to Guido Draheim <guidod@gnu.org> via electronic mail for inclusion into the Autoconf Macro Archive. I would appreciate if you could split your macros into one-per-mail, rather than sending me your whole aclocal.m4 file, because this makes the inclusion of the submission into the archive much easier for me.

Also, I'd like to ask you to adhere to a few formatting rules in your submissions: Every macro should start with a few comment lines, describing what exactly it tests, what results it does produce and how it may be called by potential users. After the comments, the actual m4 code follows.

In the comments, you should use a few directives to mark special contents, that is interpreted by the perl scripts which convert the m4 input to the HTML page the users will see:

`@synopsis`
  This keyword should be followed by a one-line example, showing how to use the autoconf macro, similar to the synopsis line in the usual Unix man files.

`@version`
  This keyword usually contains the string "`$Id$`" to have the version automatically maintained by CVS here on the server. You may set it manually, though, if you want to.

`@author`
  You have written the macro, so please say so and state your name and e-mail address after this keyword, so that users may express their gratitude, report problems or suggest enhancements.

Here is an example, how your submission should look like:

    dnl @synopsis The syntax how to use the macro.
    dnl
    dnl A description of what the macro does and what results
    dnl it produces.
    dnl
    dnl This description may extend over multiple paragraphs,
    dnl if you like.
    dnl
    dnl   Every line that is indented by more than one
    dnl   blank will be formatted verbatim, so that you
    dnl   can include examples in the description.
    dnl
    dnl @version $Id$
    dnl @author Your Name <your@email.address>
    dnl
    AC_DEFUN([MACRO_NAME],
    [...]
    ])dnl

Macro names should always be quoted in brackets, otherwise Autoconf will break in case a macro definition is (accidently) included multiple times in a configure.in file, as the macro name would be expanded the second time the definition is parsed. (and btw, if your macro name starts off with AC_ or AM_ then autoconf will warn about symbols that had not been expanded).

## All these macros are copyrighted!

Please note that every macro contained in this archive is copyrighted by its respective author, unless the macro source explicitely says otherwise. Permission has been granted, though, to use and distribute all macros under the following license, which is a modified version of the GNU General Public License version 2:

> Every Autoconf macro presented on this web site is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

> They are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. (You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place -- Suite 330, Boston, MA 02111-1307, USA.)

> As a special exception, the Free Software Foundation gives unlimited permission to copy, distribute and modify the configure scripts that are the output of Autoconf. You need not follow the terms of the GNU General Public License when using or distributing such scripts, even though portions of the text of Autoconf appear in them. The GNU General Public License (GPL) does govern all other use of the material that constitutes the Autoconf program.

> Certain portions of the Autoconf source text are designed to be copied (in certain cases, depending on the input) into the output of Autoconf. We call these the "data" portions. The rest of the Autoconf source text consists of comments plus executable code that decides which of the data portions to output in any given case. We call these comments and executable code the "non-data" portions. Autoconf never copies any of the non-data portions into its output.

> This special exception to the GPL applies to versions of Autoconf released by the Free Software Foundation. When you make and distribute a modified version of Autoconf, you may extend this special exception to the GPL to apply to your modified version as well, *unless* your modified version has the potential to copy into its output some of the text that was the non-data portion of the version that you started with. (In other words, unless your change moves or copies text from the non-data portions to the data portions.) If your modification has such potential, you must delete any notice of this special exception to the GPL from your modified version.

(generated 2002-09-12)