summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2009-07-27 23:17:58 +0200
committerPeter Simons <simons@cryp.to>2009-07-27 23:17:58 +0200
commit21c9dd60751f17acbbf918da8c3facad1e0e093e (patch)
tree83f297b283772da94f3ebac8721746a961fcf33a
parent8968e9db39f4e5bb7abb0ab32cb0b33aab705a63 (diff)
downloadautoconf-archive-21c9dd60751f17acbbf918da8c3facad1e0e093e.tar.gz
maint: implemented texinfo generator
-rw-r--r--autoconf-archive.texi582
-rw-r--r--cfg.mk34
-rwxr-xr-xmacro2texi.py63
3 files changed, 670 insertions, 9 deletions
diff --git a/autoconf-archive.texi b/autoconf-archive.texi
new file mode 100644
index 0000000..5509105
--- /dev/null
+++ b/autoconf-archive.texi
@@ -0,0 +1,582 @@
+\input texinfo @c -*-texinfo-*-
+@comment %**start of header
+@setfilename autoconf-archive.info
+@settitle Autoconf Archive
+@ifclear texi2html
+@paragraphindent none
+@end ifclear
+@comment %**end of header
+
+@include stage/version.texi
+
+@copying
+This manual is for Autoconf Archive @value{VERSION},
+which is a collection of re-usable Autoconf macros.
+
+Compilation Copyright @copyright{} 2001-2009 Peter Simons @email{simons@@cryp.to}
+
+Figure out proper license.
+@end copying
+
+@dircategory Software development
+@direntry
+* Autoconf Archive: (autoconf-archive). A collection of re-usable Autoconf macros.
+@end direntry
+
+@titlepage
+@title Autoconf Archive
+@subtitle Version @value{VERSION}
+@author @email{autoconf-archive-maintainers@@nongnu.org}
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
+@c @contents
+
+@ifnottex
+@node Top
+@top Autoconf Archive
+
+@insertcopying
+@end ifnottex
+
+@menu
+* _ac_c_ifdef::
+* _acltx_test::
+* ac_arg_with_path_style::
+* ac_c_bigendian_cross::
+* ac_c_long_long::
+* ac_c_printf_thsep::
+* ac_c_var_func::
+* ac_caolan_check_package::
+* ac_caolan_search_package::
+* ac_check_class::
+* ac_check_classpath::
+* ac_check_curl::
+* ac_check_docbook_dtd::
+* ac_check_docbook_xslt::
+* ac_check_docbook_xslt_min::
+* ac_check_func_in::
+* ac_check_icu::
+* ac_check_java_home::
+* ac_check_junit::
+* ac_check_mysql_db::
+* ac_check_mysqlr::
+* ac_check_rqrd_class::
+* ac_check_struct_for::
+* ac_check_symbol::
+* ac_check_taglib::
+* ac_check_typedef::
+* ac_check_user::
+* ac_compile_check_sizeof::
+* ac_compile_warnings::
+* ac_cond_with_level::
+* ac_create_generic_config::
+* ac_create_target_h::
+* ac_cxx_bool::
+* ac_cxx_compile_stdcxx_0x::
+* ac_cxx_compiler_vendor::
+* ac_cxx_complex_math_in_namespace_std::
+* ac_cxx_const_cast::
+* ac_cxx_cppflags_std_lang::
+* ac_cxx_cxxflags_std_lang::
+* ac_cxx_default_template_parameters::
+* ac_cxx_dtor_after_atexit::
+* ac_cxx_dynamic_cast::
+* ac_cxx_enum_computations::
+* ac_cxx_enum_computations_with_cast::
+* ac_cxx_exceptions::
+* ac_cxx_explicit::
+* ac_cxx_explicit_instantiations::
+* ac_cxx_explicit_template_function_qualification::
+* ac_cxx_extern_template::
+* ac_cxx_full_specialization_syntax::
+* ac_cxx_function_nontype_parameters::
+* ac_cxx_gnucxx_hashmap::
+* ac_cxx_have_complex::
+* ac_cxx_have_complex_math1::
+* ac_cxx_have_complex_math2::
+* ac_cxx_have_empty_iostream::
+* ac_cxx_have_ext_hash_map::
+* ac_cxx_have_ext_hash_set::
+* ac_cxx_have_ext_slist::
+* ac_cxx_have_freeze_sstream::
+* ac_cxx_have_ieee_math::
+* ac_cxx_have_long_long_for_iostream::
+* ac_cxx_have_numeric_limits::
+* ac_cxx_have_sstream::
+* ac_cxx_have_std::
+* ac_cxx_have_stl::
+* ac_cxx_have_string_push_back::
+* ac_cxx_have_system_v_math::
+* ac_cxx_have_valarray::
+* ac_cxx_have_vector_at::
+* ac_cxx_header_pre_stdcxx::
+* ac_cxx_header_stdcxx_0x::
+* ac_cxx_header_stdcxx_98::
+* ac_cxx_header_stdcxx_tr1::
+* ac_cxx_header_tr1_unordered_map::
+* ac_cxx_header_tr1_unordered_set::
+* ac_cxx_header_unordered_map::
+* ac_cxx_header_unordered_set::
+* ac_cxx_ldflags_std_lang::
+* ac_cxx_member_constants::
+* ac_cxx_member_templates::
+* ac_cxx_member_templates_outside_class::
+* ac_cxx_mutable::
+* ac_cxx_namespace_std::
+* ac_cxx_namespaces::
+* ac_cxx_new_for_scoping::
+* ac_cxx_old_for_scoping::
+* ac_cxx_partial_ordering::
+* ac_cxx_partial_specialization::
+* ac_cxx_reinterpret_cast::
+* ac_cxx_rtti::
+* ac_cxx_static_cast::
+* ac_cxx_stlport_hashmap::
+* ac_cxx_template_keyword_qualifier::
+* ac_cxx_template_qualified_base_class::
+* ac_cxx_template_qualified_return_type::
+* ac_cxx_template_scoped_argument_matching::
+* ac_cxx_templates::
+* ac_cxx_templates_as_template_arguments::
+* ac_cxx_typename::
+* ac_cxx_use_numtrait::
+* ac_cxx_verbose_terminate_handler::
+* ac_define_dir::
+* ac_define_integer_bits::
+* ac_define_sub_path::
+* ac_func_accept_argtypes::
+* ac_func_memmove::
+* ac_func_mkdir::
+* ac_func_snprintf::
+* ac_java_options::
+* ac_jni_include_dir::
+* ac_lib_id3::
+* ac_lib_upnp::
+* ac_lib_wad::
+* ac_libtoolize_cflags::
+* ac_numeric_namedlevel::
+* ac_path_generic::
+* ac_perl_module_version::
+* ac_pkg_mico::
+* ac_pkg_swig::
+* ac_prog_apache::
+* ac_prog_cc_char_subscripts::
+* ac_prog_cc_for_build::
+* ac_prog_cp_s::
+* ac_prog_crontab::
+* ac_prog_httpd::
+* ac_prog_jar::
+* ac_prog_java::
+* ac_prog_java_cc::
+* ac_prog_java_works::
+* ac_prog_javac::
+* ac_prog_javac_works::
+* ac_prog_javadoc::
+* ac_prog_javah::
+* ac_prog_modprobe::
+* ac_prog_mysql::
+* ac_prog_mysqladmin::
+* ac_prog_mysqld::
+* ac_prog_mysqlimport::
+* ac_prog_mysqlshow::
+* ac_prog_perl_modules::
+* ac_prog_scp::
+* ac_prog_ssh::
+* ac_prog_xsltproc::
+* ac_prompt_user::
+* ac_prompt_user_no_define::
+* ac_prototype::
+* ac_prototype_accept::
+* ac_prototype_getsockname::
+* ac_prototype_setsockopt::
+* ac_python_devel::
+* ac_python_module::
+* ac_raf_func_which_getservbyname_r::
+* ac_set_default_paths_system::
+* ac_subdir_files::
+* ac_sys_dev_poll::
+* ac_sys_largefile_sensitive::
+* ac_try_compile_java::
+* ac_try_run_javac::
+* ac_var_timezone_externals::
+* ac_very_nice::
+* acltx_class::
+* acltx_class_article::
+* acltx_class_book::
+* acltx_class_cweb::
+* acltx_class_report::
+* acltx_classes::
+* acltx_compress_eps::
+* acltx_converting_fig::
+* acltx_converting_jpg_eps::
+* acltx_converting_png_eps::
+* acltx_default_class::
+* acltx_dvips_o_stdout::
+* acltx_dvips_t::
+* acltx_dvips_t_a4::
+* acltx_dvips_t_a4_landscape::
+* acltx_dvips_t_letter::
+* acltx_dvips_t_letter_landscape::
+* acltx_package::
+* acltx_package_amsmath::
+* acltx_package_babel::
+* acltx_package_babel_language::
+* acltx_package_fontenc::
+* acltx_package_input::
+* acltx_package_listings::
+* acltx_package_listings_language::
+* acltx_package_location::
+* acltx_package_opt::
+* acltx_packages::
+* acltx_prog_bibtex::
+* acltx_prog_dvibook::
+* acltx_prog_dvipdf::
+* acltx_prog_dvips::
+* acltx_prog_fig2dev::
+* acltx_prog_gnuplot::
+* acltx_prog_gunzip::
+* acltx_prog_gzip::
+* acltx_prog_jpeg2ps::
+* acltx_prog_jpegtopnm::
+* acltx_prog_kpsewhich::
+* acltx_prog_latex::
+* acltx_prog_latex2html::
+* acltx_prog_latex2man::
+* acltx_prog_latex2png::
+* acltx_prog_latex2rtf::
+* acltx_prog_makeindex::
+* acltx_prog_mf::
+* acltx_prog_mktexpk::
+* acltx_prog_pdflatex::
+* acltx_prog_pngtopnm::
+* acltx_prog_pnmtops::
+* acltx_prog_ps2pdf::
+* acltx_prog_psbook::
+* acltx_prog_psnup::
+* acltx_prog_psresize::
+* acltx_prog_psselect::
+* acltx_prog_pstops::
+* acltx_prog_texhash::
+* acltx_texmf_path::
+* acx_blas::
+* acx_blas_f77_func::
+* acx_check_dos_filesys::
+* acx_check_pathname_style::
+* acx_f77_cmain_fflags::
+* acx_func_fork::
+* acx_lapack::
+* acx_mpi::
+* acx_pthread::
+* adl_compute_relative_paths::
+* adl_compute_standard_relative_paths::
+* adl_func_getopt_long::
+* adl_normalize_path::
+* ag_check_allocated_ctime::
+* ag_check_pathfind::
+* ag_check_posix_regcomp::
+* ag_check_posix_sysinfo::
+* ag_check_strcspn::
+* ag_check_strftime::
+* ag_check_sys_siglist::
+* ag_check_uname_syscall::
+* am_rpm_init::
+* am_with_mpatrol::
+* ax_ac_append_to_file::
+* ax_ac_print_to_file::
+* ax_add_am_macro::
+* ax_add_am_macro_static::
+* ax_add_am_trilinos_makefile_export::
+* ax_add_recursive_am_macro::
+* ax_add_recursive_am_macro_static::
+* ax_am_jobserver::
+* ax_am_macros::
+* ax_am_macros_static::
+* ax_append_to_file::
+* ax_auto_include_headers::
+* ax_boost_asio::
+* ax_boost_base::
+* ax_boost_date_time::
+* ax_boost_filesystem::
+* ax_boost_iostreams::
+* ax_boost_program_options::
+* ax_boost_python::
+* ax_boost_regex::
+* ax_boost_serialization::
+* ax_boost_signals::
+* ax_boost_system::
+* ax_boost_test_exec_monitor::
+* ax_boost_thread::
+* ax_boost_unit_test_framework::
+* ax_boost_wave::
+* ax_boost_wserialization::
+* ax_c99_inline::
+* ax_c___attribute__::
+* ax_c_arithmetic_rshift::
+* ax_c_check_flag::
+* ax_c_declare_block::
+* ax_c_float_words_bigendian::
+* ax_c_referenceable_passed_va_list::
+* ax_cache_size::
+* ax_cc_maxopt::
+* ax_cflags_aix_option::
+* ax_cflags_gcc_option::
+* ax_cflags_hpux_option::
+* ax_cflags_irix_option::
+* ax_cflags_no_writable_strings::
+* ax_cflags_strict_prototypes::
+* ax_cflags_sun_option::
+* ax_cflags_warn_all::
+* ax_cflags_warn_all_ansi::
+* ax_check_aligned_access_required::
+* ax_check_awk__v::
+* ax_check_awk__x_escapes::
+* ax_check_awk_and::
+* ax_check_awk_argind::
+* ax_check_awk_array_delete::
+* ax_check_awk_array_delete_elem::
+* ax_check_awk_array_in::
+* ax_check_awk_asort::
+* ax_check_awk_asorti::
+* ax_check_awk_associative_array::
+* ax_check_awk_atan2::
+* ax_check_awk_compl::
+* ax_check_awk_conditional_expression::
+* ax_check_awk_cos::
+* ax_check_awk_environ::
+* ax_check_awk_errno::
+* ax_check_awk_exit::
+* ax_check_awk_exp::
+* ax_check_awk_gensub::
+* ax_check_awk_getline::
+* ax_check_awk_gsub::
+* ax_check_awk_ignorecase::
+* ax_check_awk_index::
+* ax_check_awk_int::
+* ax_check_awk_length::
+* ax_check_awk_log::
+* ax_check_awk_lshift::
+* ax_check_awk_match_2parms::
+* ax_check_awk_match_3parms::
+* ax_check_awk_operator_multiply_multiply::
+* ax_check_awk_operator_square::
+* ax_check_awk_or::
+* ax_check_awk_printf::
+* ax_check_awk_rand::
+* ax_check_awk_rshift::
+* ax_check_awk_sin::
+* ax_check_awk_split::
+* ax_check_awk_sprintf::
+* ax_check_awk_sqrt::
+* ax_check_awk_srand::
+* ax_check_awk_strftime::
+* ax_check_awk_strtonum::
+* ax_check_awk_sub::
+* ax_check_awk_substr::
+* ax_check_awk_system::
+* ax_check_awk_systime::
+* ax_check_awk_tolower::
+* ax_check_awk_toupper::
+* ax_check_awk_user_defined_functions::
+* ax_check_awk_var_regexp::
+* ax_check_awk_variable_value_pairs::
+* ax_check_awk_xor::
+* ax_check_compiler_flags::
+* ax_check_define::
+* ax_check_gd::
+* ax_check_gl::
+* ax_check_glu::
+* ax_check_glut::
+* ax_check_linker_flags::
+* ax_check_openssl::
+* ax_check_page_aligned_malloc::
+* ax_compare_version::
+* ax_compiler_vendor::
+* ax_config_feature::
+* ax_configure_args::
+* ax_count_cpus::
+* ax_cpp_check_flag::
+* ax_cpu_freq::
+* ax_cpu_vendor::
+* ax_create_pkgconfig_info::
+* ax_create_stdint_h::
+* ax_cvs::
+* ax_cxx_check_flag::
+* ax_cxx_gcc_abi_demangle::
+* ax_cxxcpp_check_flag::
+* ax_dirname::
+* ax_dist_msi::
+* ax_dist_rpm::
+* ax_dll_string::
+* ax_enable_builddir::
+* ax_expand_prefix::
+* ax_ext::
+* ax_ext_check_header::
+* ax_ext_have_lib::
+* ax_extra_dist::
+* ax_f90_header::
+* ax_f90_internal_headmod::
+* ax_f90_library::
+* ax_f90_library_setup::
+* ax_f90_module::
+* ax_f90_module_extension::
+* ax_f90_module_flag::
+* ax_file_escapes::
+* ax_func_posix_memalign::
+* ax_func_which_gethostbyname_r::
+* ax_gcc_archflag::
+* ax_gcc_const_call::
+* ax_gcc_install_dir::
+* ax_gcc_lib::
+* ax_gcc_libgcc_eh::
+* ax_gcc_libsupcxx::
+* ax_gcc_malloc_call::
+* ax_gcc_option::
+* ax_gcc_version::
+* ax_gcc_warn_unused_result::
+* ax_gcc_x86_cpuid::
+* ax_gxx_version::
+* ax_have_adns::
+* ax_have_epoll::
+* ax_have_poll::
+* ax_have_select::
+* ax_install_files::
+* ax_lang_compiler_ms::
+* ax_ld_check_flag::
+* ax_lib_beecrypt::
+* ax_lib_crypto::
+* ax_lib_expat::
+* ax_lib_firebird::
+* ax_lib_gcrypt::
+* ax_lib_mysql::
+* ax_lib_nettle::
+* ax_lib_nokalva::
+* ax_lib_oracle_oci::
+* ax_lib_postgresql::
+* ax_lib_sqlite3::
+* ax_lib_xalan::
+* ax_lib_xerces::
+* ax_lib_xml_security::
+* ax_llvm::
+* ax_maintainer_mode_auto_silent::
+* ax_missing_prog::
+* ax_need_awk::
+* ax_not_enable_frame_pointer::
+* ax_openmp::
+* ax_path_bdb::
+* ax_path_lib_pcre::
+* ax_path_milter::
+* ax_path_missing::
+* ax_perl_ext_flags::
+* ax_prefix_config_h::
+* ax_print_to_file::
+* ax_prog_bison::
+* ax_prog_doxygen::
+* ax_prog_fasm::
+* ax_prog_fasm_opt::
+* ax_prog_flex::
+* ax_prog_guile_version::
+* ax_prog_hla::
+* ax_prog_hla_opt::
+* ax_prog_masm::
+* ax_prog_masm_opt::
+* ax_prog_md5sum::
+* ax_prog_nasm::
+* ax_prog_nasm_opt::
+* ax_prog_perl_version::
+* ax_prog_python_version::
+* ax_prog_ruby_version::
+* ax_prog_tasm::
+* ax_prog_tasm_opt::
+* ax_prog_tcl::
+* ax_prog_yasm::
+* ax_prog_yasm_opt::
+* ax_python::
+* ax_python_config_var::
+* ax_require_one_func::
+* ax_ruby_devel::
+* ax_silent_mode::
+* ax_spec_file::
+* ax_spec_package_version::
+* ax_split_version::
+* ax_subst_with::
+* ax_sys_perlsharpbang::
+* ax_tls::
+* ax_trilinos_amesos::
+* ax_trilinos_base::
+* ax_trilinos_epetra::
+* ax_trilinos_epetraext::
+* ax_trilinos_epetraext_hdf5::
+* ax_trilinos_rtop::
+* ax_trilinos_rythmos::
+* ax_trilinos_teuchos::
+* ax_trilinos_thyra::
+* ax_trilinos_thyra_epetra::
+* ax_trilinos_thyra_epetraext::
+* ax_try_awk_anyout::
+* ax_try_awk_expout::
+* ax_upload::
+* ax_warning_default_aclocaldir::
+* ax_warning_default_pkgconfig::
+* ax_wint_t::
+* ax_with_apxs::
+* ax_with_dmalloc::
+* ax_with_guile::
+* ax_with_perl::
+* ax_with_prog::
+* ax_with_python::
+* ax_with_ruby::
+* az_python::
+* berkeley_db::
+* bnv_have_qt::
+* cf_ebcdic::
+* check_gnu_make::
+* check_ssl::
+* check_zlib::
+* compile_value::
+* ct_check_postgres_db::
+* dps_check_plugin::
+* dps_java_check_class::
+* dps_libgcj_jar::
+* dps_snprintf_oflow::
+* dps_xtra_classpath::
+* etr_short_sleep::
+* etr_string_strcasecmp::
+* etr_strings_strcasecmp::
+* etr_struct_semun::
+* etr_sysv_ipc::
+* gl_trilinos_absolute_header::
+* immdx_lib_metis::
+* klm_sys_weak_alias::
+* lib_socket_nsl::
+* lua::
+* mdl_cxx_function_try_blocks::
+* mdl_have_opengl::
+* merk_sip_devel::
+* mni_cxx_have_koenig_lookup::
+* mp_with_curses::
+* ms_check_pgsql_db::
+* ms_pgsql_priv_root::
+* ms_prog_pgclient::
+* patch_libtool_changing_cmds_ifs::
+* rlc_xercesc::
+* rssh_check_off64_t::
+* rssh_check_sunpro_c::
+* sg_afs::
+* smr_with_build_path::
+* swig_enable_cxx::
+* swig_multi_module_support::
+* swig_python::
+* type_socklen_t::
+* vl_check_sign::
+* vl_decl_wchar_max::
+* vl_lib_readline::
+* vl_prog_cc_warnings::
+* vl_prog_fig2dev::
+@end menu
+
+@include stage/all-macros.texi
+
+@bye
diff --git a/cfg.mk b/cfg.mk
index f3b308d..2299dd2 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -17,24 +17,40 @@ STAGEDIR := $(srcdir)/stage
M4_FILES := $(wildcard $(M4DIR)/*.m4)
MACROS := $(patsubst $(M4DIR)/%.m4,%, $(M4_FILES))
-CANON_M4_FILES := $(patsubst %,$(STAGEDIR)/%.m4,$(MACROS))
-RAW_HTML_FILES := $(patsubst %,$(STAGEDIR)/%.html,$(MACROS))
HTML_FILES := $(patsubst %,$(HTMLDIR)/%.html,$(MACROS))
+TEXI_FILES := $(patsubst %,$(STAGEDIR)/%.texi,$(MACROS))
-.PHONY: website
-ALL_RECURSIVE_TARGETS += website
-website: $(HTML_FILES)
+.PHONY: generate
+ALL_RECURSIVE_TARGETS += generate
+generate: $(HTML_FILES) $(TEXI_FILES) autoconf-archive.info
-$(STAGEDIR)/%.html : $(M4DIR)/%.m4 $(STAGEDIR)/.dirCreated $(srcdir)/macro.py $(srcdir)/macro2html.py
+$(STAGEDIR)/manifest:
+ @$(MKDIR_P) $(STAGEDIR)
+ @rm -f "$@"
+ @for n in $(basename $(notdir $(M4_FILES))); do echo "$$n" >>"$@"; done
+
+$(STAGEDIR)/%.html : $(M4DIR)/%.m4 $(STAGEDIR)/manifest $(srcdir)/macro.py $(srcdir)/macro2html.py
+ @echo generating $@
@$(srcdir)/macro2html.py "$<" "$@"
+$(STAGEDIR)/%.texi : $(M4DIR)/%.m4 $(STAGEDIR)/manifest $(srcdir)/macro.py $(srcdir)/macro2texi.py
+ @echo generating $@
+ @$(srcdir)/macro2texi.py "$<" "$@"
+
$(HTMLDIR)/%.html : $(STAGEDIR)/%.html
- @echo generating $*.html
+ @echo pretty-printing $@
@tidy -quiet -ascii --indent yes --indent-spaces 1 --tidy-mark no -wrap 80 --hide-comments yes "$<" >"$@"
-$(STAGEDIR)/.dirCreated:
+$(STAGEDIR)/all-macros.texi: $(TEXI_FILES)
@$(MKDIR_P) $(STAGEDIR)
- @touch $@
+ @rm -f "$@"
+ @for n in $(TEXI_FILES); do echo "@include $$n" >>"$@"; done
+
+autoconf-archive.info: autoconf-archive.texi $(STAGEDIR)/all-macros.texi $(STAGEDIR)/version.texi
+ makeinfo $<
+
+$(STAGEDIR)/version.texi:
+ echo @set VERSION $(VERSION) >"$@"
taint-distcheck:
diff --git a/macro2texi.py b/macro2texi.py
new file mode 100755
index 0000000..1445e2d
--- /dev/null
+++ b/macro2texi.py
@@ -0,0 +1,63 @@
+#! /usr/bin/env python
+
+assert __name__ == "__main__"
+
+import sys
+from macro import Macro, writeFile
+
+tmpl = """\
+@node %(name)s
+@unnumbered %(name)s
+
+@majorheading Synopsis
+
+%(synopsis)s
+
+@majorheading Description
+
+%(description)s
+
+@majorheading Homepage
+
+@url{http://www.nongnu.org/autoconf-archive/%(name)s.html}
+
+@majorheading License
+
+%(authors)s
+
+%(license)s
+"""
+
+def quoteTexi(buf):
+ return buf.replace('@', "@@").replace('{', "@{").replace('}', "@}")
+
+def formatParagraph(para):
+ assert para
+ assert para[0]
+ assert para[0][0]
+ if para[0][0].isspace():
+ return "@smallexample\n%s\n@end smallexample" % quoteTexi('\n'.join(para))
+ else:
+ return quoteTexi('\n'.join(para))
+
+def formatAuthor(a):
+ assert a
+ a["year"] = quoteTexi(a["year"])
+ a["name"] = quoteTexi(a["name"])
+ if "email" in a:
+ a["email"] = quoteTexi(a["email"])
+ return "Copyright @copyright{} %(year)s %(name)s @email{%(email)s}" % a
+ else:
+ return "Copyright @copyright{} %(year)s %(name)s" % a
+
+if len(sys.argv) != 3:
+ raise Exception("invalid command line syntax: %s" % ' '.join(map(repr, sys.argv)))
+(m4File,outFile) = sys.argv[1:]
+assert outFile != m4File
+m = Macro(m4File)
+m.synopsis = "@smallexample\n%s\n@end smallexample" % "\n".join(map(quoteTexi, m.synopsis))
+m.description = '\n\n'.join(map(formatParagraph, m.description))
+m.description = m.description.replace("@end smallexample\n@smallexample", "\n")
+m.authors = " @* ".join(map(formatAuthor, m.authors))
+m.license = "\n\n".join(map(formatParagraph, m.license))
+writeFile(outFile, tmpl % m.__dict__)