summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS140
-rw-r--r--NEWS134
-rw-r--r--README80
-rw-r--r--m4/_ac_c_ifdef.m429
-rw-r--r--m4/_acltx_test.m448
-rw-r--r--m4/ac_arg_with_path_style.m4182
-rw-r--r--m4/ac_c_bigendian_cross.m4119
-rw-r--r--m4/ac_c_long_long.m434
-rw-r--r--m4/ac_c_printf_thsep.m429
-rw-r--r--m4/ac_c_var_func.m463
-rw-r--r--m4/ac_caolan_check_package.m491
-rw-r--r--m4/ac_caolan_search_package.m488
-rw-r--r--m4/ac_check_class.m4141
-rw-r--r--m4/ac_check_classpath.m457
-rw-r--r--m4/ac_check_curl.m465
-rw-r--r--m4/ac_check_docbook_dtd.m4102
-rw-r--r--m4/ac_check_docbook_xslt.m495
-rw-r--r--m4/ac_check_docbook_xslt_min.m4107
-rw-r--r--m4/ac_check_func_in.m491
-rw-r--r--m4/ac_check_icu.m470
-rw-r--r--m4/ac_check_java_home.m456
-rw-r--r--m4/ac_check_junit.m466
-rw-r--r--m4/ac_check_mysql_db.m464
-rw-r--r--m4/ac_check_mysqlr.m443
-rw-r--r--m4/ac_check_rqrd_class.m459
-rw-r--r--m4/ac_check_struct_for.m453
-rw-r--r--m4/ac_check_symbol.m481
-rw-r--r--m4/ac_check_taglib.m465
-rw-r--r--m4/ac_check_typedef.m473
-rw-r--r--m4/ac_check_user.m469
-rw-r--r--m4/ac_compile_check_sizeof.m4111
-rw-r--r--m4/ac_compile_warnings.m489
-rw-r--r--m4/ac_cond_with_level.m4173
-rw-r--r--m4/ac_create_generic_config.m4192
-rw-r--r--m4/ac_create_target_h.m4526
-rw-r--r--m4/ac_cxx_bool.m441
-rw-r--r--m4/ac_cxx_compile_stdcxx_0x.m4103
-rw-r--r--m4/ac_cxx_compiler_vendor.m465
-rw-r--r--m4/ac_cxx_complex_math_in_namespace_std.m442
-rw-r--r--m4/ac_cxx_const_cast.m434
-rw-r--r--m4/ac_cxx_cppflags_std_lang.m436
-rw-r--r--m4/ac_cxx_cxxflags_std_lang.m431
-rw-r--r--m4/ac_cxx_default_template_parameters.m438
-rw-r--r--m4/ac_cxx_dtor_after_atexit.m454
-rw-r--r--m4/ac_cxx_dynamic_cast.m437
-rw-r--r--m4/ac_cxx_enum_computations.m447
-rw-r--r--m4/ac_cxx_enum_computations_with_cast.m447
-rw-r--r--m4/ac_cxx_exceptions.m435
-rw-r--r--m4/ac_cxx_explicit.m437
-rw-r--r--m4/ac_cxx_explicit_instantiations.m436
-rw-r--r--m4/ac_cxx_explicit_template_function_qualification.m439
-rw-r--r--m4/ac_cxx_extern_template.m434
-rw-r--r--m4/ac_cxx_full_specialization_syntax.m439
-rw-r--r--m4/ac_cxx_function_nontype_parameters.m439
-rw-r--r--m4/ac_cxx_gnucxx_hashmap.m435
-rw-r--r--m4/ac_cxx_have_complex.m438
-rw-r--r--m4/ac_cxx_have_complex_math1.m445
-rw-r--r--m4/ac_cxx_have_complex_math2.m444
-rw-r--r--m4/ac_cxx_have_empty_iostream.m461
-rw-r--r--m4/ac_cxx_have_ext_hash_map.m472
-rw-r--r--m4/ac_cxx_have_ext_hash_set.m469
-rw-r--r--m4/ac_cxx_have_ext_slist.m469
-rw-r--r--m4/ac_cxx_have_freeze_sstream.m484
-rw-r--r--m4/ac_cxx_have_ieee_math.m462
-rw-r--r--m4/ac_cxx_have_long_long_for_iostream.m485
-rw-r--r--m4/ac_cxx_have_numeric_limits.m438
-rw-r--r--m4/ac_cxx_have_sstream.m437
-rw-r--r--m4/ac_cxx_have_std.m442
-rw-r--r--m4/ac_cxx_have_stl.m440
-rw-r--r--m4/ac_cxx_have_string_push_back.m439
-rw-r--r--m4/ac_cxx_have_system_v_math.m452
-rw-r--r--m4/ac_cxx_have_valarray.m438
-rw-r--r--m4/ac_cxx_have_vector_at.m439
-rw-r--r--m4/ac_cxx_header_pre_stdcxx.m472
-rw-r--r--m4/ac_cxx_header_stdcxx_0x.m4103
-rw-r--r--m4/ac_cxx_header_stdcxx_98.m483
-rw-r--r--m4/ac_cxx_header_stdcxx_tr1.m461
-rw-r--r--m4/ac_cxx_header_tr1_unordered_map.m434
-rw-r--r--m4/ac_cxx_header_tr1_unordered_set.m434
-rw-r--r--m4/ac_cxx_header_unordered_map.m438
-rw-r--r--m4/ac_cxx_header_unordered_set.m438
-rw-r--r--m4/ac_cxx_ldflags_std_lang.m431
-rw-r--r--m4/ac_cxx_member_constants.m435
-rw-r--r--m4/ac_cxx_member_templates.m438
-rw-r--r--m4/ac_cxx_member_templates_outside_class.m443
-rw-r--r--m4/ac_cxx_mutable.m441
-rw-r--r--m4/ac_cxx_namespace_std.m435
-rw-r--r--m4/ac_cxx_namespaces.m436
-rw-r--r--m4/ac_cxx_new_for_scoping.m442
-rw-r--r--m4/ac_cxx_old_for_scoping.m438
-rw-r--r--m4/ac_cxx_partial_ordering.m441
-rw-r--r--m4/ac_cxx_partial_specialization.m440
-rw-r--r--m4/ac_cxx_reinterpret_cast.m441
-rw-r--r--m4/ac_cxx_rtti.m448
-rw-r--r--m4/ac_cxx_static_cast.m439
-rw-r--r--m4/ac_cxx_stlport_hashmap.m435
-rw-r--r--m4/ac_cxx_template_keyword_qualifier.m449
-rw-r--r--m4/ac_cxx_template_qualified_base_class.m454
-rw-r--r--m4/ac_cxx_template_qualified_return_type.m447
-rw-r--r--m4/ac_cxx_template_scoped_argument_matching.m444
-rw-r--r--m4/ac_cxx_templates.m436
-rw-r--r--m4/ac_cxx_templates_as_template_arguments.m440
-rw-r--r--m4/ac_cxx_typename.m435
-rw-r--r--m4/ac_cxx_use_numtrait.m445
-rw-r--r--m4/ac_cxx_verbose_terminate_handler.m439
-rw-r--r--m4/ac_define_dir.m445
-rw-r--r--m4/ac_define_integer_bits.m476
-rw-r--r--m4/ac_define_sub_path.m4100
-rw-r--r--m4/ac_func_accept_argtypes.m487
-rw-r--r--m4/ac_func_memmove.m447
-rw-r--r--m4/ac_func_mkdir.m496
-rw-r--r--m4/ac_func_snprintf.m481
-rw-r--r--m4/ac_java_options.m444
-rw-r--r--m4/ac_jni_include_dir.m4109
-rw-r--r--m4/ac_lib_id3.m473
-rw-r--r--m4/ac_lib_upnp.m472
-rw-r--r--m4/ac_lib_wad.m466
-rw-r--r--m4/ac_libtoolize_cflags.m429
-rw-r--r--m4/ac_numeric_namedlevel.m4107
-rw-r--r--m4/ac_path_generic.m4171
-rw-r--r--m4/ac_perl_module_version.m481
-rw-r--r--m4/ac_pkg_mico.m4215
-rw-r--r--m4/ac_pkg_swig.m4118
-rw-r--r--m4/ac_prog_apache.m4166
-rw-r--r--m4/ac_prog_cc_char_subscripts.m4118
-rw-r--r--m4/ac_prog_cc_for_build.m4139
-rw-r--r--m4/ac_prog_cp_s.m483
-rw-r--r--m4/ac_prog_crontab.m455
-rw-r--r--m4/ac_prog_httpd.m481
-rw-r--r--m4/ac_prog_jar.m448
-rw-r--r--m4/ac_prog_java.m4113
-rw-r--r--m4/ac_prog_java_cc.m4101
-rw-r--r--m4/ac_prog_java_works.m4131
-rw-r--r--m4/ac_prog_javac.m477
-rw-r--r--m4/ac_prog_javac_works.m469
-rw-r--r--m4/ac_prog_javadoc.m449
-rw-r--r--m4/ac_prog_javah.m439
-rw-r--r--m4/ac_prog_modprobe.m437
-rw-r--r--m4/ac_prog_mysql.m467
-rw-r--r--m4/ac_prog_mysqladmin.m468
-rw-r--r--m4/ac_prog_mysqld.m455
-rw-r--r--m4/ac_prog_mysqlimport.m455
-rw-r--r--m4/ac_prog_mysqlshow.m466
-rw-r--r--m4/ac_prog_perl_modules.m462
-rw-r--r--m4/ac_prog_scp.m455
-rw-r--r--m4/ac_prog_ssh.m455
-rw-r--r--m4/ac_prog_xsltproc.m494
-rw-r--r--m4/ac_prompt_user.m440
-rw-r--r--m4/ac_prompt_user_no_define.m440
-rw-r--r--m4/ac_prototype.m4230
-rw-r--r--m4/ac_prototype_accept.m466
-rw-r--r--m4/ac_prototype_getsockname.m466
-rw-r--r--m4/ac_prototype_setsockopt.m461
-rw-r--r--m4/ac_python_devel.m4320
-rw-r--r--m4/ac_python_module.m445
-rw-r--r--m4/ac_raf_func_which_getservbyname_r.m4107
-rw-r--r--m4/ac_set_default_paths_system.m4136
-rw-r--r--m4/ac_subdir_files.m467
-rw-r--r--m4/ac_sys_dev_poll.m446
-rw-r--r--m4/ac_sys_largefile_sensitive.m477
-rw-r--r--m4/ac_try_compile_java.m451
-rw-r--r--m4/ac_try_run_javac.m452
-rw-r--r--m4/ac_var_timezone_externals.m476
-rw-r--r--m4/ac_very_nice.m477
-rw-r--r--m4/acltx_class.m467
-rw-r--r--m4/acltx_class_article.m433
-rw-r--r--m4/acltx_class_book.m433
-rw-r--r--m4/acltx_class_cweb.m493
-rw-r--r--m4/acltx_class_report.m433
-rw-r--r--m4/acltx_classes.m468
-rw-r--r--m4/acltx_compress_eps.m469
-rw-r--r--m4/acltx_converting_fig.m493
-rw-r--r--m4/acltx_converting_jpg_eps.m461
-rw-r--r--m4/acltx_converting_png_eps.m461
-rw-r--r--m4/acltx_default_class.m445
-rw-r--r--m4/acltx_dvips_o_stdout.m452
-rw-r--r--m4/acltx_dvips_t.m457
-rw-r--r--m4/acltx_dvips_t_a4.m436
-rw-r--r--m4/acltx_dvips_t_a4_landscape.m437
-rw-r--r--m4/acltx_dvips_t_letter.m436
-rw-r--r--m4/acltx_dvips_t_letter_landscape.m437
-rw-r--r--m4/acltx_package.m479
-rw-r--r--m4/acltx_package_amsmath.m458
-rw-r--r--m4/acltx_package_babel.m462
-rw-r--r--m4/acltx_package_babel_language.m463
-rw-r--r--m4/acltx_package_fontenc.m461
-rw-r--r--m4/acltx_package_input.m460
-rw-r--r--m4/acltx_package_listings.m443
-rw-r--r--m4/acltx_package_listings_language.m450
-rw-r--r--m4/acltx_package_location.m443
-rw-r--r--m4/acltx_package_opt.m487
-rw-r--r--m4/acltx_packages.m469
-rw-r--r--m4/acltx_prog_bibtex.m439
-rw-r--r--m4/acltx_prog_dvibook.m439
-rw-r--r--m4/acltx_prog_dvipdf.m448
-rw-r--r--m4/acltx_prog_dvips.m448
-rw-r--r--m4/acltx_prog_fig2dev.m439
-rw-r--r--m4/acltx_prog_gnuplot.m439
-rw-r--r--m4/acltx_prog_gunzip.m439
-rw-r--r--m4/acltx_prog_gzip.m439
-rw-r--r--m4/acltx_prog_jpeg2ps.m439
-rw-r--r--m4/acltx_prog_jpegtopnm.m440
-rw-r--r--m4/acltx_prog_kpsewhich.m440
-rw-r--r--m4/acltx_prog_latex.m447
-rw-r--r--m4/acltx_prog_latex2html.m440
-rw-r--r--m4/acltx_prog_latex2man.m440
-rw-r--r--m4/acltx_prog_latex2png.m440
-rw-r--r--m4/acltx_prog_latex2rtf.m440
-rw-r--r--m4/acltx_prog_makeindex.m440
-rw-r--r--m4/acltx_prog_mf.m448
-rw-r--r--m4/acltx_prog_mktexpk.m439
-rw-r--r--m4/acltx_prog_pdflatex.m439
-rw-r--r--m4/acltx_prog_pngtopnm.m439
-rw-r--r--m4/acltx_prog_pnmtops.m439
-rw-r--r--m4/acltx_prog_ps2pdf.m448
-rw-r--r--m4/acltx_prog_psbook.m439
-rw-r--r--m4/acltx_prog_psnup.m439
-rw-r--r--m4/acltx_prog_psresize.m438
-rw-r--r--m4/acltx_prog_psselect.m439
-rw-r--r--m4/acltx_prog_pstops.m448
-rw-r--r--m4/acltx_prog_texhash.m439
-rw-r--r--m4/acltx_texmf_path.m469
-rw-r--r--m4/acx_blas.m4196
-rw-r--r--m4/acx_blas_f77_func.m4171
-rw-r--r--m4/acx_check_dos_filesys.m463
-rw-r--r--m4/acx_check_pathname_style.m468
-rw-r--r--m4/acx_f77_cmain_fflags.m499
-rw-r--r--m4/acx_func_fork.m480
-rw-r--r--m4/acx_lapack.m4128
-rw-r--r--m4/acx_mpi.m4177
-rw-r--r--m4/acx_pthread.m4271
-rw-r--r--m4/adl_compute_relative_paths.m4187
-rw-r--r--m4/adl_compute_standard_relative_paths.m4100
-rw-r--r--m4/adl_func_getopt_long.m461
-rw-r--r--m4/adl_normalize_path.m4112
-rw-r--r--m4/ag_check_allocated_ctime.m438
-rw-r--r--m4/ag_check_pathfind.m446
-rw-r--r--m4/ag_check_posix_regcomp.m442
-rw-r--r--m4/ag_check_posix_sysinfo.m437
-rw-r--r--m4/ag_check_strcspn.m453
-rw-r--r--m4/ag_check_strftime.m448
-rw-r--r--m4/ag_check_sys_siglist.m440
-rw-r--r--m4/ag_check_uname_syscall.m435
-rw-r--r--m4/am_rpm_init.m4259
-rw-r--r--m4/am_with_mpatrol.m4177
-rw-r--r--m4/ax_ac_append_to_file.m429
-rw-r--r--m4/ax_ac_print_to_file.m429
-rw-r--r--m4/ax_add_am_macro.m426
-rw-r--r--m4/ax_add_am_macro_static.m425
-rw-r--r--m4/ax_add_am_trilinos_makefile_export.m447
-rw-r--r--m4/ax_add_recursive_am_macro.m446
-rw-r--r--m4/ax_add_recursive_am_macro_static.m446
-rw-r--r--m4/ax_am_jobserver.m452
-rw-r--r--m4/ax_am_macros.m441
-rw-r--r--m4/ax_am_macros_static.m437
-rw-r--r--m4/ax_append_to_file.m424
-rw-r--r--m4/ax_auto_include_headers.m460
-rw-r--r--m4/ax_boost_asio.m4105
-rw-r--r--m4/ax_boost_base.m4219
-rw-r--r--m4/ax_boost_date_time.m4107
-rw-r--r--m4/ax_boost_filesystem.m4112
-rw-r--r--m4/ax_boost_iostreams.m4110
-rw-r--r--m4/ax_boost_program_options.m4102
-rw-r--r--m4/ax_boost_python.m486
-rw-r--r--m4/ax_boost_regex.m4105
-rw-r--r--m4/ax_boost_serialization.m4111
-rw-r--r--m4/ax_boost_signals.m4108
-rw-r--r--m4/ax_boost_system.m4114
-rw-r--r--m4/ax_boost_test_exec_monitor.m4133
-rw-r--r--m4/ax_boost_thread.m4143
-rw-r--r--m4/ax_boost_unit_test_framework.m4131
-rw-r--r--m4/ax_boost_wave.m4121
-rw-r--r--m4/ax_boost_wserialization.m4110
-rw-r--r--m4/ax_c99_inline.m461
-rw-r--r--m4/ax_c___attribute__.m464
-rw-r--r--m4/ax_c_arithmetic_rshift.m433
-rw-r--r--m4/ax_c_check_flag.m484
-rw-r--r--m4/ax_c_declare_block.m487
-rw-r--r--m4/ax_c_float_words_bigendian.m480
-rw-r--r--m4/ax_c_referenceable_passed_va_list.m494
-rw-r--r--m4/ax_cache_size.m484
-rw-r--r--m4/ax_cc_maxopt.m4178
-rw-r--r--m4/ax_cflags_aix_option.m4204
-rw-r--r--m4/ax_cflags_gcc_option.m4219
-rw-r--r--m4/ax_cflags_hpux_option.m4204
-rw-r--r--m4/ax_cflags_irix_option.m4204
-rw-r--r--m4/ax_cflags_no_writable_strings.m4174
-rw-r--r--m4/ax_cflags_strict_prototypes.m4166
-rw-r--r--m4/ax_cflags_sun_option.m4204
-rw-r--r--m4/ax_cflags_warn_all.m4151
-rw-r--r--m4/ax_cflags_warn_all_ansi.m4150
-rw-r--r--m4/ax_check_aligned_access_required.m482
-rw-r--r--m4/ax_check_awk__v.m446
-rw-r--r--m4/ax_check_awk__x_escapes.m432
-rw-r--r--m4/ax_check_awk_and.m432
-rw-r--r--m4/ax_check_awk_argind.m432
-rw-r--r--m4/ax_check_awk_array_delete.m432
-rw-r--r--m4/ax_check_awk_array_delete_elem.m432
-rw-r--r--m4/ax_check_awk_array_in.m432
-rw-r--r--m4/ax_check_awk_asort.m432
-rw-r--r--m4/ax_check_awk_asorti.m432
-rw-r--r--m4/ax_check_awk_associative_array.m432
-rw-r--r--m4/ax_check_awk_atan2.m432
-rw-r--r--m4/ax_check_awk_compl.m432
-rw-r--r--m4/ax_check_awk_conditional_expression.m432
-rw-r--r--m4/ax_check_awk_cos.m432
-rw-r--r--m4/ax_check_awk_environ.m432
-rw-r--r--m4/ax_check_awk_errno.m432
-rw-r--r--m4/ax_check_awk_exit.m440
-rw-r--r--m4/ax_check_awk_exp.m432
-rw-r--r--m4/ax_check_awk_gensub.m432
-rw-r--r--m4/ax_check_awk_getline.m432
-rw-r--r--m4/ax_check_awk_gsub.m432
-rw-r--r--m4/ax_check_awk_ignorecase.m432
-rw-r--r--m4/ax_check_awk_index.m432
-rw-r--r--m4/ax_check_awk_int.m432
-rw-r--r--m4/ax_check_awk_length.m432
-rw-r--r--m4/ax_check_awk_log.m432
-rw-r--r--m4/ax_check_awk_lshift.m432
-rw-r--r--m4/ax_check_awk_match_2parms.m432
-rw-r--r--m4/ax_check_awk_match_3parms.m433
-rw-r--r--m4/ax_check_awk_operator_multiply_multiply.m432
-rw-r--r--m4/ax_check_awk_operator_square.m432
-rw-r--r--m4/ax_check_awk_or.m432
-rw-r--r--m4/ax_check_awk_printf.m432
-rw-r--r--m4/ax_check_awk_rand.m432
-rw-r--r--m4/ax_check_awk_rshift.m432
-rw-r--r--m4/ax_check_awk_sin.m432
-rw-r--r--m4/ax_check_awk_split.m432
-rw-r--r--m4/ax_check_awk_sprintf.m432
-rw-r--r--m4/ax_check_awk_sqrt.m432
-rw-r--r--m4/ax_check_awk_srand.m432
-rw-r--r--m4/ax_check_awk_strftime.m432
-rw-r--r--m4/ax_check_awk_strtonum.m432
-rw-r--r--m4/ax_check_awk_sub.m432
-rw-r--r--m4/ax_check_awk_substr.m432
-rw-r--r--m4/ax_check_awk_system.m432
-rw-r--r--m4/ax_check_awk_systime.m432
-rw-r--r--m4/ax_check_awk_tolower.m432
-rw-r--r--m4/ax_check_awk_toupper.m432
-rw-r--r--m4/ax_check_awk_user_defined_functions.m446
-rw-r--r--m4/ax_check_awk_var_regexp.m432
-rw-r--r--m4/ax_check_awk_variable_value_pairs.m446
-rw-r--r--m4/ax_check_awk_xor.m432
-rw-r--r--m4/ax_check_compiler_flags.m474
-rw-r--r--m4/ax_check_define.m488
-rw-r--r--m4/ax_check_gd.m479
-rw-r--r--m4/ax_check_gl.m4132
-rw-r--r--m4/ax_check_glu.m4150
-rw-r--r--m4/ax_check_glut.m4113
-rw-r--r--m4/ax_check_linker_flags.m475
-rw-r--r--m4/ax_check_page_aligned_malloc.m467
-rw-r--r--m4/ax_compare_version.m4174
-rw-r--r--m4/ax_compiler_vendor.m461
-rw-r--r--m4/ax_config_feature.m4154
-rw-r--r--m4/ax_configure_args.m468
-rw-r--r--m4/ax_count_cpus.m446
-rw-r--r--m4/ax_cpp_check_flag.m484
-rw-r--r--m4/ax_cpu_freq.m491
-rw-r--r--m4/ax_cpu_vendor.m461
-rw-r--r--m4/ax_create_pkgconfig_info.m4344
-rw-r--r--m4/ax_create_stdint_h.m4725
-rw-r--r--m4/ax_cvs.m4474
-rw-r--r--m4/ax_cxx_check_flag.m484
-rw-r--r--m4/ax_cxx_gcc_abi_demangle.m454
-rw-r--r--m4/ax_cxxcpp_check_flag.m484
-rw-r--r--m4/ax_dirname.m458
-rw-r--r--m4/ax_dist_msi.m4111
-rw-r--r--m4/ax_dist_rpm.m4326
-rw-r--r--m4/ax_dll_string.m487
-rw-r--r--m4/ax_enable_builddir.m4297
-rw-r--r--m4/ax_expand_prefix.m464
-rw-r--r--m4/ax_ext.m4105
-rw-r--r--m4/ax_ext_check_header.m455
-rw-r--r--m4/ax_ext_have_lib.m469
-rw-r--r--m4/ax_extra_dist.m472
-rw-r--r--m4/ax_f90_header.m436
-rw-r--r--m4/ax_f90_internal_headmod.m468
-rw-r--r--m4/ax_f90_library.m4104
-rw-r--r--m4/ax_f90_library_setup.m476
-rw-r--r--m4/ax_f90_module.m438
-rw-r--r--m4/ax_f90_module_extension.m456
-rw-r--r--m4/ax_f90_module_flag.m466
-rw-r--r--m4/ax_file_escapes.m427
-rw-r--r--m4/ax_func_posix_memalign.m447
-rw-r--r--m4/ax_func_which_gethostbyname_r.m4188
-rw-r--r--m4/ax_gcc_archflag.m4213
-rw-r--r--m4/ax_gcc_const_call.m456
-rw-r--r--m4/ax_gcc_install_dir.m461
-rw-r--r--m4/ax_gcc_lib.m458
-rw-r--r--m4/ax_gcc_libgcc_eh.m451
-rw-r--r--m4/ax_gcc_libsupcxx.m451
-rw-r--r--m4/ax_gcc_malloc_call.m456
-rw-r--r--m4/ax_gcc_option.m4126
-rw-r--r--m4/ax_gcc_version.m463
-rw-r--r--m4/ax_gcc_warn_unused_result.m456
-rw-r--r--m4/ax_gcc_x86_cpuid.m477
-rw-r--r--m4/ax_gxx_version.m463
-rw-r--r--m4/ax_have_adns.m435
-rw-r--r--m4/ax_have_epoll.m4101
-rw-r--r--m4/ax_have_poll.m469
-rw-r--r--m4/ax_have_select.m468
-rw-r--r--m4/ax_install_files.m486
-rw-r--r--m4/ax_lang_compiler_ms.m434
-rw-r--r--m4/ax_ld_check_flag.m492
-rw-r--r--m4/ax_lib_beecrypt.m472
-rw-r--r--m4/ax_lib_crypto.m482
-rw-r--r--m4/ax_lib_expat.m4272
-rw-r--r--m4/ax_lib_firebird.m4167
-rw-r--r--m4/ax_lib_gcrypt.m4105
-rw-r--r--m4/ax_lib_mysql.m4145
-rw-r--r--m4/ax_lib_nettle.m477
-rw-r--r--m4/ax_lib_oracle_oci.m4306
-rw-r--r--m4/ax_lib_postgresql.m4152
-rw-r--r--m4/ax_lib_sqlite3.m4153
-rw-r--r--m4/ax_lib_xerces.m4286
-rw-r--r--m4/ax_lib_xml_security.m4274
-rw-r--r--m4/ax_llvm.m490
-rw-r--r--m4/ax_maintainer_mode_auto_silent.m469
-rw-r--r--m4/ax_missing_prog.m458
-rw-r--r--m4/ax_need_awk.m433
-rw-r--r--m4/ax_not_enable_frame_pointer.m464
-rw-r--r--m4/ax_openmp.m497
-rw-r--r--m4/ax_path_bdb.m4588
-rw-r--r--m4/ax_path_lib_pcre.m488
-rw-r--r--m4/ax_path_milter.m4329
-rw-r--r--m4/ax_path_missing.m439
-rw-r--r--m4/ax_perl_ext_flags.m4114
-rw-r--r--m4/ax_prefix_config_h.m4215
-rw-r--r--m4/ax_print_to_file.m424
-rw-r--r--m4/ax_prog_bison.m462
-rw-r--r--m4/ax_prog_doxygen.m4530
-rw-r--r--m4/ax_prog_fasm.m445
-rw-r--r--m4/ax_prog_fasm_opt.m446
-rw-r--r--m4/ax_prog_flex.m462
-rw-r--r--m4/ax_prog_guile_version.m462
-rw-r--r--m4/ax_prog_hla.m445
-rw-r--r--m4/ax_prog_hla_opt.m446
-rw-r--r--m4/ax_prog_masm.m445
-rw-r--r--m4/ax_prog_masm_opt.m446
-rw-r--r--m4/ax_prog_md5sum.m431
-rw-r--r--m4/ax_prog_nasm.m445
-rw-r--r--m4/ax_prog_nasm_opt.m446
-rw-r--r--m4/ax_prog_perl_version.m463
-rw-r--r--m4/ax_prog_python_version.m463
-rw-r--r--m4/ax_prog_ruby_version.m463
-rw-r--r--m4/ax_prog_tasm.m445
-rw-r--r--m4/ax_prog_tasm_opt.m446
-rw-r--r--m4/ax_prog_tcl.m478
-rw-r--r--m4/ax_prog_yasm.m445
-rw-r--r--m4/ax_prog_yasm_opt.m446
-rw-r--r--m4/ax_python.m495
-rw-r--r--m4/ax_python_config_var.m4111
-rw-r--r--m4/ax_require_one_func.m438
-rw-r--r--m4/ax_ruby_devel.m4170
-rw-r--r--m4/ax_silent_mode.m441
-rw-r--r--m4/ax_spec_file.m4131
-rw-r--r--m4/ax_spec_package_version.m4258
-rw-r--r--m4/ax_split_version.m434
-rw-r--r--m4/ax_subst_with.m4151
-rw-r--r--m4/ax_sys_perlsharpbang.m4135
-rw-r--r--m4/ax_tls.m474
-rw-r--r--m4/ax_trilinos_amesos.m440
-rw-r--r--m4/ax_trilinos_base.m4145
-rw-r--r--m4/ax_trilinos_epetra.m440
-rw-r--r--m4/ax_trilinos_epetraext.m440
-rw-r--r--m4/ax_trilinos_epetraext_hdf5.m452
-rw-r--r--m4/ax_trilinos_rtop.m440
-rw-r--r--m4/ax_trilinos_rythmos.m440
-rw-r--r--m4/ax_trilinos_teuchos.m441
-rw-r--r--m4/ax_trilinos_thyra.m440
-rw-r--r--m4/ax_trilinos_thyra_epetra.m438
-rw-r--r--m4/ax_trilinos_thyra_epetraext.m438
-rw-r--r--m4/ax_try_awk_anyout.m450
-rw-r--r--m4/ax_try_awk_expout.m456
-rw-r--r--m4/ax_upload.m479
-rw-r--r--m4/ax_warning_default_aclocaldir.m4144
-rw-r--r--m4/ax_warning_default_pkgconfig.m4159
-rw-r--r--m4/ax_wint_t.m439
-rw-r--r--m4/ax_with_apxs.m457
-rw-r--r--m4/ax_with_dmalloc.m448
-rw-r--r--m4/ax_with_guile.m432
-rw-r--r--m4/ax_with_perl.m432
-rw-r--r--m4/ax_with_prog.m467
-rw-r--r--m4/ax_with_python.m432
-rw-r--r--m4/ax_with_ruby.m432
-rw-r--r--m4/az_python.m4512
-rw-r--r--m4/berkeley_db.m4108
-rw-r--r--m4/bnv_have_qt.m4534
-rw-r--r--m4/cf_ebcdic.m471
-rw-r--r--m4/check_gnu_make.m476
-rw-r--r--m4/check_ssl.m475
-rw-r--r--m4/check_zlib.m4120
-rw-r--r--m4/compile_value.m4122
-rw-r--r--m4/ct_check_postgres_db.m485
-rw-r--r--m4/dps_check_plugin.m498
-rw-r--r--m4/dps_java_check_class.m482
-rw-r--r--m4/dps_libgcj_jar.m480
-rw-r--r--m4/dps_snprintf_oflow.m458
-rw-r--r--m4/dps_xtra_classpath.m465
-rw-r--r--m4/etr_short_sleep.m488
-rw-r--r--m4/etr_string_strcasecmp.m448
-rw-r--r--m4/etr_strings_strcasecmp.m437
-rw-r--r--m4/etr_struct_semun.m447
-rw-r--r--m4/etr_sysv_ipc.m440
-rw-r--r--m4/gl_trilinos_absolute_header.m467
-rw-r--r--m4/immdx_lib_metis.m4115
-rw-r--r--m4/klm_sys_weak_alias.m4333
-rw-r--r--m4/lib_socket_nsl.m436
-rw-r--r--m4/lua.m4196
-rw-r--r--m4/mdl_cxx_function_try_blocks.m463
-rw-r--r--m4/mdl_have_opengl.m4160
-rw-r--r--m4/merk_sip_devel.m4102
-rw-r--r--m4/mni_cxx_have_koenig_lookup.m447
-rw-r--r--m4/mp_with_curses.m484
-rw-r--r--m4/ms_check_pgsql_db.m4103
-rw-r--r--m4/ms_pgsql_priv_root.m4108
-rw-r--r--m4/ms_prog_pgclient.m455
-rw-r--r--m4/patch_libtool_changing_cmds_ifs.m489
-rw-r--r--m4/rlc_xercesc.m4496
-rw-r--r--m4/rssh_check_off64_t.m473
-rw-r--r--m4/rssh_check_sunpro_c.m443
-rw-r--r--m4/sg_afs.m4116
-rw-r--r--m4/smr_with_build_path.m440
-rw-r--r--m4/swig_enable_cxx.m450
-rw-r--r--m4/swig_multi_module_support.m453
-rw-r--r--m4/swig_python.m461
-rw-r--r--m4/type_socklen_t.m458
-rw-r--r--m4/vl_check_sign.m450
-rw-r--r--m4/vl_decl_wchar_max.m448
-rw-r--r--m4/vl_lib_readline.m4102
-rw-r--r--m4/vl_prog_cc_warnings.m4137
-rw-r--r--m4/vl_prog_fig2dev.m439
533 files changed, 43746 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..86d045a
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,140 @@
+Autoconf Archive Maintainer
+
+ Peter Simons <simons@cryp.to>
+
+
+Autoconf Macro Contributors
+
+ Francesco Salvestrini
+ Boretti Mathieu
+ Luc Maisonobe
+ Guido U. Draheim
+ Todd Veldhuizen
+ Tom Howard
+ Thomas Porschberg
+ Rhys Ulerich
+ Bogdan Drozdowski
+ Steven G. Johnson
+ Gleen Salmon
+ Michael Tindal
+ Bruce Korb
+ Benjamin Kosnik
+ Stephane Bortzmeyer
+ Mateusz Loskot
+ Dustin J. Mitchell
+ Andrew Collier
+ Alexandre Duret-Lutz
+ Sebastian Huber
+ Rafael Laboissiere
+ Loic Dachary
+ Duncan Simpson
+ Alan W. Irwin
+ Warren Young
+ Peter Simons
+ Matteo Frigo
+ Ludovic Courtès
+ Ville Laurikari
+ Scott Pakin
+ Christophe Tournayre
+ Caolan McNamara
+ Allan Caffee
+ Alain BARBET
+ Zmanda Inc.
+ Fabien Coelho
+ Braden McDaniel
+ Wes Hardaker
+ Tim Toolan
+ Stepan Kasal
+ Patrick Mauritz
+ Moritz Sinn
+ Matthew Mueller
+ Mark Elbrecht
+ Devin Weaver
+ Akos Maroy
+ YAMAMOTO Kengo
+ Uwe Mayer
+ Steve M. Robbins
+ Rüdiger Kuhlmann
+ Ruslan Shevchenko
+ Paolo Bonzini
+ Oskar Liljeblad
+ Michael Paul Bailey
+ Matthew D. Langston
+ Matteo Settenvini
+ Julian C. Cummings
+ Jan Langer
+ Horst Knorr
+ Egon Willighagen
+ Daniel Richard G.
+ Alexander Pletzer
+ raf
+ William Fulton
+ Vaclav Slavik
+ Tom Payne
+ Tal Shalif
+ Sven Verdoolaege
+ Steven Brown
+ Soren Andersen
+ Scott Grosch
+ Ryan McCabe
+ Russ Allbery
+ Ruben Fonseca
+ Ronald Landheer-Cieslak
+ Roman Rybalko
+ Robert White
+ Reuben Thomas
+ Rafal Rzepecki
+ Pete Greenwell
+ Perceval ANICHINI
+ Paul Gilmartin
+ Oren Ben-Kiki
+ Noah Slater
+ Nick Markham
+ Nic Ferrier
+ Neil Ferguson
+ Mike Frysinger
+ Michael McMaster
+ Matthieu Moy
+ Mats Kindahl of Sun Microsystems
+ Marten Svantesson
+ Mark R. Bannister
+ Mark Pulford
+ Mark Ethan Trostler
+ Marco Gomes
+ Lars Brinkhoff
+ Lapo Luchini
+ Kevin L. Mitchell
+ Kaveh Ghazi
+ Kaelin Colclasure
+ John Darrington
+ Jaroslav Hajek
+ Ilguiz Latypov
+ Graeme S. Roy
+ Gerald Point
+ Gabriele Bartolini
+ Don Anderson
+ Dodji Seketeli
+ Derek Price
+ Dean Povey
+ David Cluytens
+ Dave Benson
+ Daniel Casimiro
+ Daniel Amelang
+ Dale K. Hawkins
+ Christopher Currie
+ Christian Toepp
+ Christian Haggstrom
+ Can Bican
+ Bill Poser
+ Bernardo Innocenti
+ Ben Stanley
+ Ben Bergen
+ Bastiaan Veelo
+ Angus Lees
+ Andy Kitchen
+ Andreas Schwab
+ Alexandre Oliva
+ Alexander Petry
+ Alan Woodland
+ Alan Jenkins
+ Ahmet Inan
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..307ce40
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,134 @@
+ History of the Autoconf Archive
+ ===============================
+
+2009-04-26:
+
+ Obsolete macros were deleted from the archive. The release tarballs
+ will no longer contain them, but the download URLs will continue to
+ work for the foreseeable future. For every deleted macros, there is
+ also a stub HTML page the features an appropriate link into the Git
+ repository.
+
+ The last-modified-date section was removed from all m4 files. The
+ information is redundant: the GIT repository contains that
+ information (and much more). Originally, the idea behind that
+ timestamp was that users should always be able to infer the macros
+ "version", i.e. even from a generated configure script. In practice,
+ however, that didn't work well. For one, those timestamps have a
+ tendency to be plain wrong. Secondly, even if the timestamp was
+ correct, it's presence still didn't tell you that the macro you're
+ seeing is actually identical with the one in the Autoconf Archive.
+ After 9 years of trouble with that bit, I conclude that keeping
+ unique version information inside of the file that's supposed to be
+ versioned just isn't a good idea.
+
+ The "copyleft" section has been renamed to "license" for greater
+ accuracy. Some licenses, like all-permissive, are not really
+ copylefts.
+
+ The cross-reference graphs have been removed from the HTML pages.
+ These dot-graphs were useful a while ago, when the archive was
+ comparatively small, but with the current number 500+ macros, those
+ graphs tended to be far too large to be useful.
+
+ Ensured that all files to refer to this project consistently as
+ "Autoconf Archive".
+
+ Fixed some charset issues in the generated HTML files. Now, all
+ pages are written in plain ASCII, and special characters are encoded
+ as HTML entities.
+
+ Added an by-license index page.
+
+2008-04-12:
+
+ The markup format distributed by the Autoconf Archive has changed to
+ accomodate the aclocal utility distributed with Automake. Further
+ details are available in the GIT repository:
+
+ http://git.cryp.to/autoconf-archive?a=commit;h=76c7d0ad8925ab22e3bb50c8b27b333f31303c74
+
+2007-08-22:
+
+ The macro documentation shipped in the release tarball now features
+ cross-references.
+
+2007-07-29:
+
+ This release is the first one to be distributed under the terms of
+ the updated General Public License, version 3.
+
+2007-02-18:
+
+ The Autoconf Archive provides a public GIT repository that can be
+ cloned as follows:
+
+ git clone http://git.cryp.to/autoconf-archive
+
+ A web front-end is available under the same URL.
+
+ As a new feature, the web front-end allows every macro to link
+ directly into the repository for its own history.
+
+2006-10-23:
+
+ The Autoconf Archive switched to a new distribution format. Unlike
+ the previous one, the new format has no visible markup and looks
+ pretty much like formatted text. The m4 files now link to their home
+ page. Also new is that the copyright licenses are spelled out.
+
+2005-02-14:
+
+ The Autoconf Archive repository has moved from gnu.org to
+ <http://autoconf-archive.cryp.to/>, mostly because running on my own
+ infrastructure is far more convenient than depending on Savannah.
+
+ This release is the first one to have an out-of-the-box installation
+ procedure using Autoconf/Automake.
+
+ To travel back in time, go to:
+
+ http://web.archive.org/web/20050215104509/http://autoconf-archive.cryp.to/
+
+2005-01-28:
+
+ The Free Software Foundation recommends the all-permissive license
+ for Autoconf Macros. In an heroic effort, Tom Howard has contacted
+ each and every macro author in an attempt to get their permission to
+ re-license their work under the less restrictive license. More than
+ 50 positive responses are received.
+
+2005-01-21:
+
+ Moved all macros into a flat hierarchy. Previous releases determined
+ a macro's category by the name of the directory it was in. This
+ convention no longer necessary. Having the files in a flat hierarchy
+ works vastly better with the aclocal(1) utility than the previous
+ layout.
+
+ This release also marks the departure from free-style version
+ numbers. All version information is expressed as an ISO 8601 date. A
+ macro's version is the date of its last modification in the Archive.
+
+2001-07-14:
+
+ The Autoconf Archive repository has moved from cryp.to to
+ <http://www.gnu.org/software/ac-archive/>. This change brings mostly
+ public access to the CVS repository at Savannah. The move also
+ allows the project to dub itself the "GNU Autoconf Archive".
+
+ To travel back in time, go to:
+
+ http://web.archive.org/web/20010715000147/www.gnu.org/software/ac-archive/
+
+2001-05-19:
+
+ Moved from research.cys.de to <http://cryp.to/autoconf-archive/>.
+
+ To travel back in time, go to:
+
+ http://web.archive.org/web/20010119114000/http://research.cys.de/
+
+2000-06-15:
+
+ First version on-line at <http://research.cys.de/autoconf-archive/>.
diff --git a/README b/README
new file mode 100644
index 0000000..d6a2f9b
--- /dev/null
+++ b/README
@@ -0,0 +1,80 @@
+Autoconf Archive
+================
+
+-------------------------------------------------------------------------------
+
+:Macro Index By: Category_ ; Author_ ; License_
+:Latest Release: autoconf-archive-2009-04-26.tar.bz2_
+:Change History: `ATOM Log`_ ; `RSS Feed`_
+:GIT Repository: git clone http://git.cryp.to/autoconf-archive
+
+-------------------------------------------------------------------------------
+
+Synopsis
+--------
+
+The `Autoconf Archive`_ is a collection of more than 500 freely re-usable
+Autoconf_ macros. These macros have been contributed by friendly supporters
+of the cause from all over the Internet.
+
+How To Contribute
+-----------------
+
+If you have written a macro and would like to share it, then please `e-mail
+the m4 file to me <mailto:simons@cryp.to>`_. In addition to the actual
+source code, your submission should also include the following bits of
+information:
+
+* A synopsis that shows how the macro must be be called.
+
+* A brief description of the macro's purpose.
+
+* The list of authors (optionally with e-mail addresses).
+
+* Licensing information.
+
+You can submit your macro under any `GPL-compatible free software
+license`_, but the best choice is the `all-permissive license`_ recommended
+by the Free Software Foundation.
+
+Another great way to contribute to the Archive is to submit patches. Git_
+patches are particularly welcome.
+
+License
+-------
+
+Compilation Copyright (c) 2009 by Peter Simons <simons@cryp.to>
+
+The Autoconf Archive is free software: you can redistribute it and/or
+modify it under the terms of the `GNU General Public License version 3
+<http://www.gnu.org/licenses/gpl.html>`_ or (at your option) any later
+version.
+
+All macros are copyrighted by their respective authors. Please refer to the
+individual files for details.
+
+
+.. References used in the text above
+.. .................................
+
+.. _Autoconf Archive: http://autoconf-archive.cryp.to/
+
+.. _Category: macros-by-category.html
+
+.. _Author: macros-by-author.html
+
+.. _License: macros-by-license.html
+
+.. _Git: http://git-scm.com/
+
+.. _RSS Feed: http://git.cryp.to/autoconf-archive/rss
+
+.. _ATOM Log: http://git.cryp.to/autoconf-archive/atom
+
+.. _Autoconf: http://www.gnu.org/software/autoconf/
+
+.. _autoconf-archive-2009-04-26.tar.bz2: http://autoconf-archive.cryp.to/autoconf-archive-2009-04-26.tar.bz2
+
+.. _GPL-compatible free software license: http://www.gnu.org/licenses/license-list.html
+
+.. _all-permissive license: http://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html
diff --git a/m4/_ac_c_ifdef.m4 b/m4/_ac_c_ifdef.m4
new file mode 100644
index 0000000..1a006c6
--- /dev/null
+++ b/m4/_ac_c_ifdef.m4
@@ -0,0 +1,29 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/_ac_c_ifdef.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# _AC_C_IFDEF(MACRO-NAME, ACTION-IF-DEF, ACTION-IF-NOT-DEF)
+#
+# DESCRIPTION
+#
+# Check for the definition of macro MACRO-NAME using the current
+# language's compiler.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ludovic Courtès <ludo@chbouib.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([_AC_C_IFDEF],
+ [AC_COMPILE_IFELSE([#ifndef $1
+ # error "Macro $1 is undefined!"
+ /* For some compilers (eg. SGI's CC), #error is not
+ enough... */
+ please, do fail
+ #endif],
+ [$2], [$3])])
diff --git a/m4/_acltx_test.m4 b/m4/_acltx_test.m4
new file mode 100644
index 0000000..b68e123
--- /dev/null
+++ b/m4/_acltx_test.m4
@@ -0,0 +1,48 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/_acltx_test.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# _ACLTX_TEST(FILEDATA,VARIABLETOSET,[NOCLEAN])
+#
+# DESCRIPTION
+#
+# This macros execute the latex application with FILEDATA as input and set
+# VARIABLETOSET the yes or no depending of the result if NOCLEAN is set,
+# the folder used for the test is not delete after testing.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([_ACLTX_TEST],[
+AC_REQUIRE([ACLTX_PROG_LATEX])
+rm -rf conftest.dir/.acltx
+AS_MKDIR_P([conftest.dir/.acltx])
+cd conftest.dir/.acltx
+m4_ifval([$2],[$2="no"; export $2;])
+cat > conftest.tex << ACLEOF
+$1
+ACLEOF
+cat conftest.tex | $latex 2>&1 1>output m4_ifval([$2],[&& $2=yes])
+cd ..
+cd ..
+sed 's/^/| /' conftest.dir/.acltx/conftest.tex >&5
+echo "$as_me:$LINENO: executing cat conftest.tex | $latex" >&5
+sed 's/^/| /' conftest.dir/.acltx/output >&5
+m4_ifval([$3],,[rm -rf conftest.dir/.acltx])
+])
diff --git a/m4/ac_arg_with_path_style.m4 b/m4/ac_arg_with_path_style.m4
new file mode 100644
index 0000000..0be9400
--- /dev/null
+++ b/m4/ac_arg_with_path_style.m4
@@ -0,0 +1,182 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_arg_with_path_style.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_ARG_WITH_PATH_STYLE
+#
+# DESCRIPTION
+#
+# _AC_DEFINE(PATH_STYLE) describing the filesys interface. The value is
+# numeric, where the basetype is encoded as 16 = dos/win, 32 = unix, 64 =
+# url/www, 0 = other
+#
+# some extra semantics are described in other bits of the value,
+# especially
+#
+# 1024 accepts "/" as a dir separator
+# 2048 accepts ";" as a path separator
+# 4096 accepts "," as a path separator
+#
+# the macro provides a configure' --with-path-style option that can be
+# used with descriptive arg names. If not explicitly given, the $target_os
+# will be checked to provide a sane default. Additional (lower) bits can
+# be used by the user for some additional magic, higher bits are reserved
+# for this macro.
+#
+# the mnemonic "strict" or "also" is used to instruct the code that
+# additional seperators shall be accepted but converted to the seperator
+# of the underlying pathstyle system. (or-512)
+#
+# example: --with-path-style=win,slash
+# to make it accept ";" as pathsep, and
+# both "/" and "\" as dirseps.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_ARG_WITH_PATH_STYLE],
+[
+ AC_ARG_WITH(path-style,
+[ --with-path-style=[dos,unix,url,also,slash,comma],
+[ac_with_path_style="$withval"],
+[dnl
+ case "$target_os" in
+ *djgpp | *mingw32* | *emx*) ac_with_path_style="dos" ;;
+ *) case `eval echo $exec_prefix` in
+ *:*) ac_with_path_style="url" ;;
+ *) ac_with_path_style="posix" ;;
+ esac
+ ;;
+ esac
+])
+ ac_with_path_style__unx="0"
+ ac_with_path_style__dos="0"
+ ac_with_path_style__win="0"
+ ac_with_path_style__mac="0"
+ ac_with_path_style__def="0"
+ ac_with_path_style__use="0"
+ ac_with_path_style__slash="0"
+ ac_with_path_style__semic="0"
+ ac_with_path_style__comma="0"
+ ac_with_path_style__level="0"
+
+ case ",$ac_with_path_style," in
+ *,unx,*|*,unix,*|*,bsd,*|*,posix,*) :
+ ac_with_path_style__unx="32" ;;
+ *) ac_with_path_style__unx="0" ;;
+ esac
+ case ",$ac_with_path_style," in
+ *,dos,*|*,win,*|*,windows,*) :
+ ac_with_path_style__dos="16" ;;
+ *) ac_with_path_style__dos="0" ;;
+ esac
+ case ",$ac_with_path_style," in
+ *,web,*|*,url,*|*,www,*) :
+ ac_with_path_style__url="64" ;;
+ *) ac_with_path_style__url="0" ;;
+ esac
+ case ",$ac_with_path_style," in
+ *,mac,*|*,macintosh,*|*,apple,*) :
+ ac_with_path_style__mac="128" ;;
+ *) ac_with_path_style__mac="0" ;;
+ esac
+ case ",$ac_with_path_style," in
+ *,def,*|*,define,*|*,special,*) :
+ ac_with_path_style__def="256" ;;
+ *) ac_with_path_style__def="0" ;;
+ esac
+ case ",$ac_with_path_style," in
+ *,also,*|*,strict,*|*,accept,*|*,convert,*) :
+ ac_with_path_style__use="512" ;;
+ *) ac_with_path_style__use="0" ;;
+ esac
+ case ",$ac_with_path_style," in
+ *,sl,*|*,slash,*|*,forwslash,*|*,slashsep,*) :
+ ac_with_path_style__slash="1024" ;;
+ *) ac_with_path_style__slash="0" ;;
+ esac
+ case ",$ac_with_path_style," in
+ *,sc,*|*,semi,*|*,semisep,*|*,semicolon,*|*,semicolonsep,*) :
+ ac_with_path_style__semic="2048" ;;
+ *) ac_with_path_style__semic="0" ;;
+ esac
+ case ",$ac_with_path_style," in
+ *,cm,*|*,comma,*|*,commasep,*) :
+ ac_with_path_style__comma="4096" ;;
+ *) ac_with_path_style__comma="0" ;;
+ esac
+
+ if test "$ac_with_path_style__unx" != "0" ; then
+ ac_with_path_style__slash="1024"
+ fi
+ if test "$ac_with_path_style__dos" != "0" ; then
+ ac_with_path_style__semic="2048"
+ fi
+ if test "$ac_with_path_style__url" != "0" ; then
+ ac_with_path_style__slash="1024"
+ ac_with_path_style__semic="2048"
+ fi
+
+ case ",$ac_with_path_style," in
+ *,7,*|*,all,*|*,muchmore,*)
+ ac_with_path_style__level="7" ;;
+ *,6,*|*,extra,*|*,manymore,*)
+ ac_with_path_style__level="6" ;;
+ *,5,*|*,much,*)
+ ac_with_path_style__level="5" ;;
+ *,4,*|*,many,*)
+ ac_with_path_style__level="4" ;;
+ *,3,*|*,plus,*|*,somemore,*)
+ ac_with_path_style__level="3" ;;
+ *,2,*|*,more,*)
+ ac_with_path_style__level="2" ;;
+ *,1,*|*,some,*)
+ ac_with_path_style__level="1" ;;
+ *)
+ ac_with_path_style__level="0" ;;
+ esac
+
+ PATH_STYLE=`expr \
+ $ac_with_path_style__unx '+' \
+ $ac_with_path_style__dos '+' \
+ $ac_with_path_style__win '+' \
+ $ac_with_path_style__mac '+' \
+ $ac_with_path_style__def '+' \
+ $ac_with_path_style__use '+' \
+ $ac_with_path_style__slash '+' \
+ $ac_with_path_style__semic '+' \
+ $ac_with_path_style__comma '+' \
+ $ac_with_path_style__level `
+
+ AC_DEFINE_UNQUOTED(PATH_STYLE,$PATH_STYLE,
+ [ the OS pathstyle, 16=dos 32=unx 64=url 1024=slash 2048=semic 4096=comma ])
+])
diff --git a/m4/ac_c_bigendian_cross.m4 b/m4/ac_c_bigendian_cross.m4
new file mode 100644
index 0000000..79bc4f1
--- /dev/null
+++ b/m4/ac_c_bigendian_cross.m4
@@ -0,0 +1,119 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_c_bigendian_cross.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_C_BIGENDIAN_CROSS
+#
+# DESCRIPTION
+#
+# Check endianess even when crosscompiling (partially based on the
+# original AC_C_BIGENDIAN).
+#
+# The implementation will create a binary, but instead of running the
+# binary it will be grep'ed for some symbols that differ for different
+# endianess of the binary.
+#
+# NOTE: The upcoming autoconf 2.53 does include the idea of this macro,
+# what makes it superfluous by then.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_C_BIGENDIAN_CROSS],
+[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
+[ac_cv_c_bigendian=unknown
+# See if sys/param.h defines the BYTE_ORDER macro.
+AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/param.h>], [
+#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
+ bogus endian macros
+#endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
+AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/param.h>], [
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)])
+if test $ac_cv_c_bigendian = unknown; then
+AC_TRY_RUN([main () {
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long l;
+ char c[sizeof (long)];
+ } u;
+ u.l = 1;
+ exit (u.c[sizeof (long) - 1] == 1);
+}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes,
+[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ])
+fi])
+if test $ac_cv_c_bigendian = unknown; then
+AC_MSG_CHECKING(to probe for byte ordering)
+[
+cat >conftest.c <<EOF
+short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; }
+short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; }
+int main() { _ascii (); _ebcdic (); return 0; }
+EOF
+] if test -f conftest.c ; then
+ if ${CC-cc} -c conftest.c -o conftest.o && test -f conftest.o ; then
+ if test `grep -l BIGenDianSyS conftest.o` ; then
+ echo $ac_n ' big endian probe OK, ' 1>&AC_FD_MSG
+ ac_cv_c_bigendian=yes
+ fi
+ if test `grep -l LiTTleEnDian conftest.o` ; then
+ echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG
+ if test $ac_cv_c_bigendian = yes ; then
+ ac_cv_c_bigendian=unknown;
+ else
+ ac_cv_c_bigendian=no
+ fi
+ fi
+ echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG
+ fi
+ fi
+AC_MSG_RESULT($ac_cv_c_bigendian)
+fi
+if test $ac_cv_c_bigendian = yes; then
+ AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian])
+ BYTEORDER=4321
+else
+ BYTEORDER=1234
+fi
+AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN])
+if test $ac_cv_c_bigendian = unknown; then
+ AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian)
+fi
+])
diff --git a/m4/ac_c_long_long.m4 b/m4/ac_c_long_long.m4
new file mode 100644
index 0000000..e2124fa
--- /dev/null
+++ b/m4/ac_c_long_long.m4
@@ -0,0 +1,34 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_c_long_long.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_C_LONG_LONG
+#
+# DESCRIPTION
+#
+# Provides a test for the existence of the long long int type and defines
+# HAVE_LONG_LONG if it is found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Caolan McNamara <caolan@skynet.ie>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_C_LONG_LONG],
+[AC_CACHE_CHECK(for long long int, ac_cv_c_long_long,
+[if test "$GCC" = yes; then
+ ac_cv_c_long_long=yes
+ else
+ AC_TRY_COMPILE(,[long long int i;],
+ ac_cv_c_long_long=yes,
+ ac_cv_c_long_long=no)
+ fi])
+ if test $ac_cv_c_long_long = yes; then
+ AC_DEFINE(HAVE_LONG_LONG, 1, [compiler understands long long])
+ fi
+])
diff --git a/m4/ac_c_printf_thsep.m4 b/m4/ac_c_printf_thsep.m4
new file mode 100644
index 0000000..73a7dc4
--- /dev/null
+++ b/m4/ac_c_printf_thsep.m4
@@ -0,0 +1,29 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_c_printf_thsep.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_C_PRINTF_THSEP
+#
+# DESCRIPTION
+#
+# This macro checks whether the compiler supports the ' flag in printf,
+# which causes the non-fractional digits to be separated using a separator
+# and grouping determined by the locale. If true, HAVE_PRINTF_THSEP is
+# defined in config.h
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bill Poser <billposer@alum.mit.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_C_PRINTF_THSEP],
+[AC_TRY_COMPILE(,[printf("%'2d",101);],ac_cv_c_printf_thsep=yes,ac_cv_c_printf_thsep=no)
+ if test $ac_cv_c_printf_thsep = yes; then
+ AC_DEFINE(HAVE_PRINTF_THSEP, 1, [compiler understands printf flag for thousands separation in ints])
+ fi
+])
diff --git a/m4/ac_c_var_func.m4 b/m4/ac_c_var_func.m4
new file mode 100644
index 0000000..5730903
--- /dev/null
+++ b/m4/ac_c_var_func.m4
@@ -0,0 +1,63 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_c_var_func.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_C_VAR_FUNC
+#
+# DESCRIPTION
+#
+# This macro tests if the C complier supports the C9X standard __func__
+# indentifier.
+#
+# The new C9X standard for the C language stipulates that the identifier
+# __func__ shall be implictly declared by the compiler as if, immediately
+# following the opening brace of each function definition, the declaration
+#
+# static const char __func__[] = "function-name";
+#
+# appeared, where function-name is the name of the function where the
+# __func__ identifier is used.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Christopher Currie <christopher@currie.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_C_VAR_FUNC],
+[AC_REQUIRE([AC_PROG_CC])
+AC_CACHE_CHECK(whether $CC recognizes __func__, ac_cv_c_var_func,
+AC_TRY_COMPILE(,
+[int main() {
+char *s = __func__;
+}],
+AC_DEFINE(HAVE_FUNC,,
+[Define if the C complier supports __func__]) ac_cv_c_var_func=yes,
+ac_cv_c_var_func=no) )
+])dnl
diff --git a/m4/ac_caolan_check_package.m4 b/m4/ac_caolan_check_package.m4
new file mode 100644
index 0000000..3ff54d3
--- /dev/null
+++ b/m4/ac_caolan_check_package.m4
@@ -0,0 +1,91 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_caolan_check_package.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_caolan_CHECK_PACKAGE(PACKAGE, FUNCTION, LIBRARY , HEADERFILE [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# Provides --with-PACKAGE, --with-PACKAGE-include and
+# --with-PACKAGE-libdir options to configure. Supports the now standard
+# --with-PACKAGE=DIR approach where the package's include dir and lib dir
+# are underneath DIR, but also allows the include and lib directories to
+# be specified seperately
+#
+# adds the extra -Ipath to CFLAGS if needed adds extra -Lpath to LD_FLAGS
+# if needed searches for the FUNCTION in the LIBRARY with AC_CHECK_LIBRARY
+# and thus adds the lib to LIBS
+#
+# defines HAVE_PKG_PACKAGE if it is found, (where PACKAGE in the
+# HAVE_PKG_PACKAGE is replaced with the actual first parameter passed)
+# note that autoheader will complain of not having the HAVE_PKG_PACKAGE
+# and you will have to add it to acconfig.h manually
+#
+# LICENSE
+#
+# Copyright (c) 2008 Caolan McNamara <caolan@skynet.ie>
+# Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
+# Copyright (c) 2008 Matthew Mueller <donut@azstarnet.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_caolan_CHECK_PACKAGE],
+[
+
+AC_ARG_WITH($1,
+[ --with-$1[=DIR] root directory of $1 installation],
+with_$1=$withval
+if test "${with_$1}" != yes; then
+ $1_include="$withval/include"
+ $1_libdir="$withval/lib"
+fi
+)
+
+AC_ARG_WITH($1-include,
+[ --with-$1-include=DIR specify exact include dir for $1 headers],
+$1_include="$withval")
+
+AC_ARG_WITH($1-libdir,
+[ --with-$1-libdir=DIR specify exact library dir for $1 library
+ --without-$1 disables $1 usage completely],
+$1_libdir="$withval")
+
+if test "${with_$1}" != no ; then
+ OLD_LIBS=$LIBS
+ OLD_LDFLAGS=$LDFLAGS
+ OLD_CFLAGS=$CFLAGS
+ OLD_CPPFLAGS=$CPPFLAGS
+
+ if test "${$1_libdir}" ; then
+ LDFLAGS="$LDFLAGS -L${$1_libdir}"
+ fi
+ if test "${$1_include}" ; then
+ CPPFLAGS="$CPPFLAGS -I${$1_include}"
+ CFLAGS="$CFLAGS -I${$1_include}"
+ fi
+
+ no_good=no
+ AC_CHECK_LIB($3,$2,,no_good=yes)
+ AC_CHECK_HEADER($4,,no_good=yes)
+ if test "$no_good" = yes; then
+dnl broken
+ ifelse([$6], , , [$6])
+
+ LIBS=$OLD_LIBS
+ LDFLAGS=$OLD_LDFLAGS
+ CPPFLAGS=$OLD_CPPFLAGS
+ CFLAGS=$OLD_CFLAGS
+ else
+dnl fixed
+ ifelse([$5], , , [$5])
+
+ AC_DEFINE(HAVE_PKG_$1)
+ fi
+
+fi
+
+])
diff --git a/m4/ac_caolan_search_package.m4 b/m4/ac_caolan_search_package.m4
new file mode 100644
index 0000000..6eae1c4
--- /dev/null
+++ b/m4/ac_caolan_search_package.m4
@@ -0,0 +1,88 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_caolan_search_package.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_caolan_SEARCH_PACKAGE(PACKAGE, FUNCTION, LIBRARY LIST, HEADERFILE [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# Provides --with-PACKAGE, --with-PACKAGE-include and
+# --with-PACKAGE-libdir options to configure. Supports the now standard
+# --with-PACKAGE=DIR approach where the package's include dir and lib dir
+# are underneath DIR, but also allows the include and lib directories to
+# be specified seperately
+#
+# adds the extra -Ipath to CFLAGS if needed adds extra -Lpath to LD_FLAGS
+# if needed searches for the FUNCTION in each of the LIBRARY LIST with
+# AC_SEARCH_LIBRARY and thus adds the lib to LIBS
+#
+# defines HAVE_PKG_PACKAGE if it is found, (where PACKAGE in the
+# HAVE_PKG_PACKAGE is replaced with the actual first parameter passed)
+# note that autoheader will complain of not having the HAVE_PKG_PACKAGE
+# and you will have to add it to acconfig.h manually
+#
+# LICENSE
+#
+# Copyright (c) 2009 Caolan McNamara <caolan@skynet.ie>
+# Copyright (c) 2009 Alexandre Duret-Lutz <adl@gnu.org>
+# Copyright (c) 2009 Matthew Mueller <donut@azstarnet.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_caolan_SEARCH_PACKAGE],
+[
+
+AC_ARG_WITH($1,
+[ --with-$1[=DIR] root directory of $1 installation],
+with_$1=$withval
+if test "${with_$1}" != yes; then
+ $1_include="$withval/include"
+ $1_libdir="$withval/lib"
+fi
+)
+
+AC_ARG_WITH($1-include,
+[ --with-$1-include=DIR specify exact include dir for $1 headers],
+$1_include="$withval")
+
+AC_ARG_WITH($1-libdir,
+[ --with-$1-libdir=DIR specify exact library dir for $1 library
+ --without-$1 disables $1 usage completely],
+$1_libdir="$withval")
+
+if test "${with_$1}" != no ; then
+ OLD_LIBS=$LIBS
+ OLD_LDFLAGS=$LDFLAGS
+ OLD_CFLAGS=$CFLAGS
+ OLD_CPPFLAGS=$CPPFLAGS
+
+ if test "${$1_libdir}" ; then
+ LDFLAGS="$LDFLAGS -L${$1_libdir}"
+ fi
+ if test "${$1_include}" ; then
+ CPPFLAGS="$CPPFLAGS -I${$1_include}"
+ CFLAGS="$CFLAGS -I${$1_include}"
+ fi
+
+ success=no
+ AC_SEARCH_LIBS($2,$3,success=yes)
+ AC_CHECK_HEADERS($4,success=yes)
+ if test "$success" = yes; then
+dnl fixed
+ ifelse([$5], , , [$5])
+ AC_DEFINE(HAVE_PKG_$1)
+ else
+dnl broken
+ ifelse([$6], , , [$6])
+ LIBS=$OLD_LIBS
+ LDFLAGS=$OLD_LDFLAGS
+ CPPFLAGS=$OLD_CPPFLAGS
+ CFLAGS=$OLD_CFLAGS
+ fi
+fi
+
+])
diff --git a/m4/ac_check_class.m4 b/m4/ac_check_class.m4
new file mode 100644
index 0000000..bb142fb
--- /dev/null
+++ b/m4/ac_check_class.m4
@@ -0,0 +1,141 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_class.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_CLASS
+#
+# DESCRIPTION
+#
+# AC_CHECK_CLASS tests the existence of a given Java class, either in a
+# jar or in a '.class' file.
+#
+# *Warning*: its success or failure can depend on a proper setting of the
+# CLASSPATH env. variable.
+#
+# Note: This is part of the set of autoconf M4 macros for Java programs.
+# It is VERY IMPORTANT that you download the whole set, some macros depend
+# on other. Unfortunately, the autoconf archive does not support the
+# concept of set of macros, so I had to break it for submission. The
+# general documentation, as well as the sample configure.in, is included
+# in the AC_PROG_JAVA macro.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CHECK_CLASS],[
+AC_REQUIRE([AC_PROG_JAVA])
+ac_var_name=`echo $1 | sed 's/\./_/g'`
+dnl Normaly I'd use a AC_CACHE_CHECK here but since the variable name is
+dnl dynamic I need an extra level of extraction
+AC_MSG_CHECKING([for $1 class])
+AC_CACHE_VAL(ac_cv_class_$ac_var_name, [
+if test x$ac_cv_prog_uudecode_base64 = xyes; then
+dnl /**
+dnl * Test.java: used to test dynamicaly if a class exists.
+dnl */
+dnl public class Test
+dnl {
+dnl
+dnl public static void
+dnl main( String[] argv )
+dnl {
+dnl Class lib;
+dnl if (argv.length < 1)
+dnl {
+dnl System.err.println ("Missing argument");
+dnl System.exit (77);
+dnl }
+dnl try
+dnl {
+dnl lib = Class.forName (argv[0]);
+dnl }
+dnl catch (ClassNotFoundException e)
+dnl {
+dnl System.exit (1);
+dnl }
+dnl lib = null;
+dnl System.exit (0);
+dnl }
+dnl
+dnl }
+cat << \EOF > Test.uue
+begin-base64 644 Test.class
+yv66vgADAC0AKQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
+bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
+bWJlclRhYmxlDAAKAAsBAANlcnIBABVMamF2YS9pby9QcmludFN0cmVhbTsJ
+AA0ACQcADgEAEGphdmEvbGFuZy9TeXN0ZW0IABABABBNaXNzaW5nIGFyZ3Vt
+ZW50DAASABMBAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWCgAV
+ABEHABYBABNqYXZhL2lvL1ByaW50U3RyZWFtDAAYABkBAARleGl0AQAEKEkp
+VgoADQAXDAAcAB0BAAdmb3JOYW1lAQAlKExqYXZhL2xhbmcvU3RyaW5nOylM
+amF2YS9sYW5nL0NsYXNzOwoAHwAbBwAgAQAPamF2YS9sYW5nL0NsYXNzBwAi
+AQAgamF2YS9sYW5nL0NsYXNzTm90Rm91bmRFeGNlcHRpb24BAAY8aW5pdD4B
+AAMoKVYMACMAJAoAAwAlAQAKU291cmNlRmlsZQEACVRlc3QuamF2YQAhAAEA
+AwAAAAAAAgAJAAUABgABAAcAAABtAAMAAwAAACkqvgSiABCyAAwSD7YAFBBN
+uAAaKgMyuAAeTKcACE0EuAAaAUwDuAAasQABABMAGgAdACEAAQAIAAAAKgAK
+AAAACgAAAAsABgANAA4ADgATABAAEwASAB4AFgAiABgAJAAZACgAGgABACMA
+JAABAAcAAAAhAAEAAQAAAAUqtwAmsQAAAAEACAAAAAoAAgAAAAQABAAEAAEA
+JwAAAAIAKA==
+====
+EOF
+ if uudecode$EXEEXT Test.uue; then
+ :
+ else
+ echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC
+ echo "configure: failed file was:" >&AC_FD_CC
+ cat Test.uue >&AC_FD_CC
+ ac_cv_prog_uudecode_base64=no
+ fi
+ rm -f Test.uue
+ if AC_TRY_COMMAND($JAVA $JAVAFLAGS Test $1) >/dev/null 2>&1; then
+ eval "ac_cv_class_$ac_var_name=yes"
+ else
+ eval "ac_cv_class_$ac_var_name=no"
+ fi
+ rm -f Test.class
+else
+ AC_TRY_COMPILE_JAVA([$1], , [eval "ac_cv_class_$ac_var_name=yes"],
+ [eval "ac_cv_class_$ac_var_name=no"])
+fi
+eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`"
+eval "HAVE_$ac_var_name=$`echo ac_cv_class_$ac_var_val`"
+HAVE_LAST_CLASS=$ac_var_val
+if test x$ac_var_val = xyes; then
+ ifelse([$2], , :, [$2])
+else
+ ifelse([$3], , :, [$3])
+fi
+])
+dnl for some reason the above statment didn't fall though here?
+dnl do scripts have variable scoping?
+eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`"
+AC_MSG_RESULT($ac_var_val)
+])
diff --git a/m4/ac_check_classpath.m4 b/m4/ac_check_classpath.m4
new file mode 100644
index 0000000..b977aca
--- /dev/null
+++ b/m4/ac_check_classpath.m4
@@ -0,0 +1,57 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_classpath.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_CLASSPATH
+#
+# DESCRIPTION
+#
+# AC_CHECK_CLASSPATH just displays the CLASSPATH, for the edification of
+# the user.
+#
+# Note: This is part of the set of autoconf M4 macros for Java programs.
+# It is VERY IMPORTANT that you download the whole set, some macros depend
+# on other. Unfortunately, the autoconf archive does not support the
+# concept of set of macros, so I had to break it for submission. The
+# general documentation, as well as the sample configure.in, is included
+# in the AC_PROG_JAVA macro.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CHECK_CLASSPATH],[
+if test "x$CLASSPATH" = x; then
+ echo "You have no CLASSPATH, I hope it is good"
+else
+ echo "You have CLASSPATH $CLASSPATH, hope it is correct"
+fi
+])
diff --git a/m4/ac_check_curl.m4 b/m4/ac_check_curl.m4
new file mode 100644
index 0000000..dc19bcd
--- /dev/null
+++ b/m4/ac_check_curl.m4
@@ -0,0 +1,65 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_curl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_CURL(version, action-if, action-not)
+#
+# DESCRIPTION
+#
+# Defines CURL_LIBS, CURL_CFLAGS. See curl-config(1) man page.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Akos Maroy <darkeye@tyrell.hu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CHECK_CURL], [
+ succeeded=no
+
+ if test -z "$CURL_CONFIG"; then
+ AC_PATH_PROG(CURL_CONFIG, curl-config, no)
+ fi
+
+ if test "$CURL_CONFIG" = "no" ; then
+ echo "*** The curl-config script could not be found. Make sure it is"
+ echo "*** in your path, and that curl is properly installed."
+ echo "*** Or see http://curl.haxx.se/"
+ else
+ dnl curl-config --version returns "libcurl <version>", thus cut the number
+ CURL_VERSION=`$CURL_CONFIG --version | cut -d" " -f2`
+ AC_MSG_CHECKING(for curl >= $1)
+ VERSION_CHECK=`expr $CURL_VERSION \>\= $1`
+ if test "$VERSION_CHECK" = "1" ; then
+ AC_MSG_RESULT(yes)
+ succeeded=yes
+
+ AC_MSG_CHECKING(CURL_CFLAGS)
+ CURL_CFLAGS=`$CURL_CONFIG --cflags`
+ AC_MSG_RESULT($CURL_CFLAGS)
+
+ AC_MSG_CHECKING(CURL_LIBS)
+ CURL_LIBS=`$CURL_CONFIG --libs`
+ AC_MSG_RESULT($CURL_LIBS)
+ else
+ CURL_CFLAGS=""
+ CURL_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ ifelse([$3], ,echo "can't find curl >= $1",)
+ fi
+
+ AC_SUBST(CURL_CFLAGS)
+ AC_SUBST(CURL_LIBS)
+ fi
+
+ if test $succeeded = yes; then
+ ifelse([$2], , :, [$2])
+ else
+ ifelse([$3], , AC_MSG_ERROR([Library requirements (curl) not met.]), [$3])
+ fi
+])
diff --git a/m4/ac_check_docbook_dtd.m4 b/m4/ac_check_docbook_dtd.m4
new file mode 100644
index 0000000..5a52d07
--- /dev/null
+++ b/m4/ac_check_docbook_dtd.m4
@@ -0,0 +1,102 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_docbook_dtd.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_DOCBOOK_DTD([dtd-version])
+#
+# DESCRIPTION
+#
+# Check for access to a docbook DTD of a particular revision. This macro
+# can be used for multiple versions within the same script.
+#
+# Input:
+#
+# $1 is the version of docbook to search for; default 'current'.
+#
+# Output:
+#
+# $HAVE_DOCBOOK_DTD_VERS will be set to 'yes' or 'no' depending on the
+# results of the test, where VERS is $1, with '_' substituted for '.'
+# $HAVE_DOCBOOK_DTD will also be set to the same value.
+#
+# Example:
+#
+# AC_CHECK_DOCBOOK_DTD(4.3)
+# if test "x$HAVE_DOCBOOK_DTD_4_3" = "xyes"; then
+# ...
+#
+# LICENSE
+#
+# Copyright (c) 2008 Zmanda Inc. <http://www.zmanda.com/>
+# Copyright (c) 2008 Dustin J. Mitchell <dustin@zmanda.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CHECK_DOCBOOK_DTD],
+[
+ AC_REQUIRE([AC_PROG_XSLTPROC])
+
+ dnl define a temporary variable for the version, so this macro can be
+ dnl used with multiple versions
+ define([_VERS], $1)
+ ifelse(_VERS, [], [define([_VERS], [current])])
+ define([ac_cv_docbook_dtd_VERS], patsubst([ac_cv_docbook_dtd_]_VERS, [\.], [_]))
+ define([HAVE_DOCBOOK_DTD_VERS], patsubst([HAVE_DOCBOOK_DTD_]_VERS, [\.], [_]))
+
+ AC_CACHE_CHECK([for Docbook DTD version ]_VERS, [ac_cv_docbook_dtd_VERS],
+ [
+ ac_cv_docbook_dtd_VERS=no
+ if test -n "$XSLTPROC"; then
+ MY_XSLTPROC_FLAGS=`echo "" $XSLTPROC_FLAGS|sed -e s/--novalid//g`
+ cat <<EOF >conftest.xml
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V[]_VERS//EN" "http://www.oasis-open.org/docbook/xml/_VERS/docbookx.dtd">
+<book id="empty">
+</book>
+EOF
+ echo "Trying '$XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml'" >&AS_MESSAGE_LOG_FD
+ $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1
+ if test "$?" = 0 -o "$?" = 5; then
+ # failing to load the DTD is just a warning, so check for it in the output.
+ if grep 'warning: failed to load external entity' conftest_out >/dev/null 2>&1; then
+ : # no good..
+ else
+ ac_cv_docbook_dtd_VERS=yes
+ fi
+ fi
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+
+ rm -f conftest.xml conftest.out
+ fi
+ ])
+
+ HAVE_DOCBOOK_DTD_VERS="$ac_cv_docbook_dtd_VERS"
+ HAVE_DOCBOOK_DTD=HAVE_DOCBOOK_DTD_VERS
+ undefine([_VERS])
+])
diff --git a/m4/ac_check_docbook_xslt.m4 b/m4/ac_check_docbook_xslt.m4
new file mode 100644
index 0000000..aa8467e
--- /dev/null
+++ b/m4/ac_check_docbook_xslt.m4
@@ -0,0 +1,95 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_docbook_xslt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_DOCBOOK_XSLT([xslt-version])
+#
+# DESCRIPTION
+#
+# Check for access to docbook stylesheets of a particular revision. This
+# macro can be used for multiple versions within the same script.
+#
+# Input:
+#
+# $1 is the version of docbook to search for; default 'current'.
+#
+# Output:
+#
+# $HAVE_DOCBOOK_XSLT_VERS will be set to 'yes' or 'no' depending on the
+# results of the test, where VERS is $1, with '_' substituted for '.'.
+# $HAVE_DOCBOOK_XSLT will also be set to the same value.
+#
+# Example:
+#
+# AC_CHECK_DOCBOOK_XSLT(1.72.0)
+# if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xyes"; then
+# ...
+#
+# LICENSE
+#
+# Copyright (c) 2008 Zmanda Inc. <http://www.zmanda.com/>
+# Copyright (c) 2008 Dustin J. Mitchell <dustin@zmanda.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CHECK_DOCBOOK_XSLT],
+[
+ AC_REQUIRE([AC_PROG_XSLTPROC])
+
+ dnl define a temporary variable for the version, so this macro can be
+ dnl used with multiple versions
+ define([_VERS], $1)
+ ifelse(_VERS, [], [define([_VERS], [current])])
+
+ dnl define variable names ending in _VERS which will actually have the
+ dnl version number as a suffix
+ define([ac_cv_docbook_xslt_VERS], patsubst([ac_cv_docbook_xslt_]_VERS, [\.], [_]))
+ define([HAVE_DOCBOOK_XSLT_VERS], patsubst([HAVE_DOCBOOK_XSLT_]_VERS, [\.], [_]))
+
+ AC_CACHE_CHECK([for Docbook XSLT version ]_VERS, [ac_cv_docbook_xslt_VERS],
+ [
+ ac_cv_docbook_xslt_VERS=no
+ if test -n "$XSLTPROC"; then
+ echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl'" >&AS_MESSAGE_LOG_FD
+ $XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+
+ if test "$?" = 0; then
+ ac_cv_docbook_xslt_VERS=yes
+ fi
+ fi
+ ])
+
+ HAVE_DOCBOOK_XSLT_VERS="$ac_cv_docbook_xslt_VERS"
+ HAVE_DOCBOOK_XSLT="$HAVE_DOCBOOK_XSLT_VERS"
+
+ dnl clean up m4 namespace
+ undefine([_VERS])
+ undefine([ac_cv_docbook_xslt_VERS])
+ undefine([HAVE_DOCBOOK_XSLT_VERS])
+])
diff --git a/m4/ac_check_docbook_xslt_min.m4 b/m4/ac_check_docbook_xslt_min.m4
new file mode 100644
index 0000000..26be0fc
--- /dev/null
+++ b/m4/ac_check_docbook_xslt_min.m4
@@ -0,0 +1,107 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_docbook_xslt_min.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_DOCBOOK_XSLT_MIN(min-xslt-version)
+#
+# DESCRIPTION
+#
+# Check that the 'current' version of docbook is at least version
+# min-xslt-version. If the test is successful,
+# $DOCBOOK_XSLT_CURRENT_VERSION will be set to the current docbook
+# version; if not, it will be set to 'no'.
+#
+# Example:
+#
+# AC_CHECK_DOCBOOK_XSLT_MIN(1.72.0)
+# if test "x$DOCBOOK_XSLT_CURRENT_VERSION" = "xno"; then
+# ...
+#
+# LICENSE
+#
+# Copyright (c) 2008 Zmanda Inc. <http://www.zmanda.com/>
+# Copyright (c) 2008 Dustin J. Mitchell <dustin@zmanda.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CHECK_DOCBOOK_XSLT_MIN],
+[
+ AC_REQUIRE([AC_PROG_XSLTPROC])
+
+ AC_CACHE_CHECK([for current Docbook XSLT version], [ac_cv_docbook_xslt_current_version],
+ [
+ ac_cv_docbook_xslt_current_version=no
+
+ if test -n "$XSLTPROC"; then
+ cat >conftest.xsl <<EOF
+ <xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fm="http://freshmeat.net/projects/freshmeat-submit/"
+ version="1.0">
+ <xsl:output method="text"/>
+ <xsl:template match="fm:project/fm:Version">
+ <xsl:value-of select="." />
+ </xsl:template>
+ <!-- do nothing with any other text -->
+ <xsl:template match="text()"/>
+ </xsl:stylesheet>
+EOF
+ echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/current/VERSION' with input:" >&AS_MESSAGE_LOG_FD
+ echo "====" >&AS_MESSAGE_LOG_FD
+ cat conftest.xsl >&AS_MESSAGE_LOG_FD
+ echo "====" >&AS_MESSAGE_LOG_FD
+
+ ac_cv_docbook_xslt_current_version=`$XSLTPROC $XSLTPROC_FLAGS conftest.xsl http://docbook.sourceforge.net/release/xsl/current/VERSION 2>&AS_MESSAGE_LOG_FD`
+
+ if test "$?" != 0; then
+ ac_cv_docbook_xslt_current_version='no'
+ fi
+
+ rm conftest.xsl
+ fi
+ ])
+
+ DOCBOOK_XSLT_CURRENT_VERSION="$ac_cv_docbook_xslt_current_version"
+ AC_MSG_CHECKING([whether Docbook XSLT version is $1 or newer])
+
+ if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then
+ AC_MSG_RESULT([no])
+ else
+ AX_COMPARE_VERSION([$DOCBOOK_XSLT_CURRENT_VERSION], [lt], [$1], [
+ # version is less than required, so mark it as "no"
+ DOCBOOK_XSLT_CURRENT_VERSION=no
+ ])
+
+ if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then
+ AC_MSG_RESULT([no])
+ else
+ AC_MSG_RESULT([yes ($DOCBOOK_XSLT_CURRENT_VERSION)])
+ fi
+ fi
+])
diff --git a/m4/ac_check_func_in.m4 b/m4/ac_check_func_in.m4
new file mode 100644
index 0000000..1efdae1
--- /dev/null
+++ b/m4/ac_check_func_in.m4
@@ -0,0 +1,91 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_func_in.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_FUNC_IN(HEADER, FUNCTION [,ACTION-IF-FOUNC [,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# Checking for library functions in a given header file.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+dnl AC_CHECK_FUNC_IN(HEADER, FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+AC_DEFUN([AC_CHECK_FUNC_IN],
+[AC_MSG_CHECKING([for $2 in $1])
+AC_CACHE_VAL(ac_cv_func_$2,
+[AC_TRY_LINK(
+dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
+dnl which includes <sys/select.h> which contains a prototype for
+dnl select. Similarly for bzero.
+[/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2(); below. */
+#include <assert.h>
+#include <$1>
+/* Override any gcc2 internal prototype to avoid an error. */
+]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
+extern "C"
+#endif
+])dnl
+[/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $2();
+], [
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$2) || defined (__stub___$2)
+choke me
+#else
+$2();
+#endif
+], eval "ac_cv_func_$2=yes", eval "ac_cv_func_$2=no")])
+if eval "test \"`echo '$ac_cv_func_'$2`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ ifelse([$3], , :, [$3])
+else
+ AC_MSG_RESULT(no)
+ifelse([$4], , , [$4
+])dnl
+fi
+])
+
+dnl AC_CHECK_FUNCS_IN(HEADER, FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+AC_DEFUN([AC_CHECK_FUNCS_IN],
+[for ac_func in $2
+do
+AC_CHECK_FUNC_IN($1, $ac_func,
+ ac_tr_func=HAVE_`echo $ac_func | sed -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:' -e 's:[[^A-Z0-9]]:_:g'`
+ AC_DEFINE_UNQUOTED($ac_tr_func) $3], $4)dnl
+done
+])
diff --git a/m4/ac_check_icu.m4 b/m4/ac_check_icu.m4
new file mode 100644
index 0000000..71e88ae
--- /dev/null
+++ b/m4/ac_check_icu.m4
@@ -0,0 +1,70 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_icu.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_ICU(version, action-if, action-if-not)
+#
+# DESCRIPTION
+#
+# Defines ICU_LIBS, ICU_CFLAGS, ICU_CXXFLAGS. See icu-config(1) man page.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Akos Maroy <darkeye@tyrell.hu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CHECK_ICU], [
+ succeeded=no
+
+ if test -z "$ICU_CONFIG"; then
+ AC_PATH_PROG(ICU_CONFIG, icu-config, no)
+ fi
+
+ if test "$ICU_CONFIG" = "no" ; then
+ echo "*** The icu-config script could not be found. Make sure it is"
+ echo "*** in your path, and that taglib is properly installed."
+ echo "*** Or see http://ibm.com/software/globalization/icu/"
+ else
+ ICU_VERSION=`$ICU_CONFIG --version`
+ AC_MSG_CHECKING(for ICU >= $1)
+ VERSION_CHECK=`expr $ICU_VERSION \>\= $1`
+ if test "$VERSION_CHECK" = "1" ; then
+ AC_MSG_RESULT(yes)
+ succeeded=yes
+
+ AC_MSG_CHECKING(ICU_CFLAGS)
+ ICU_CFLAGS=`$ICU_CONFIG --cflags`
+ AC_MSG_RESULT($ICU_CFLAGS)
+
+ AC_MSG_CHECKING(ICU_CXXFLAGS)
+ ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
+ AC_MSG_RESULT($ICU_CXXFLAGS)
+
+ AC_MSG_CHECKING(ICU_LIBS)
+ ICU_LIBS=`$ICU_CONFIG --ldflags`
+ AC_MSG_RESULT($ICU_LIBS)
+ else
+ ICU_CFLAGS=""
+ ICU_CXXFLAGS=""
+ ICU_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ ifelse([$3], ,echo "can't find ICU >= $1",)
+ fi
+
+ AC_SUBST(ICU_CFLAGS)
+ AC_SUBST(ICU_CXXFLAGS)
+ AC_SUBST(ICU_LIBS)
+ fi
+
+ if test $succeeded = yes; then
+ ifelse([$2], , :, [$2])
+ else
+ ifelse([$3], , AC_MSG_ERROR([Library requirements (ICU) not met.]), [$3])
+ fi
+])
diff --git a/m4/ac_check_java_home.m4 b/m4/ac_check_java_home.m4
new file mode 100644
index 0000000..c256eef
--- /dev/null
+++ b/m4/ac_check_java_home.m4
@@ -0,0 +1,56 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_java_home.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_JAVA_HOME
+#
+# DESCRIPTION
+#
+# Check for Sun Java (JDK / JRE) installation, where the 'java' VM is in.
+# If found, set environment variable JAVA_HOME = Java installation home,
+# else left JAVA_HOME untouch, which in most case means JAVA_HOME is
+# empty.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Gleen Salmon <gleensalmon@yahoo.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CHECK_JAVA_HOME],[
+AC_REQUIRE([AC_EXEEXT])dnl
+TRY_JAVA_HOME=`ls -dr /usr/java/* 2> /dev/null | head -n 1`
+if test x$TRY_JAVA_HOME != x; then
+ PATH=$PATH:$TRY_JAVA_HOME/bin
+fi
+AC_PATH_PROG(JAVA_PATH_NAME, java$EXEEXT)
+if test x$JAVA_PATH_NAME != x; then
+ JAVA_HOME=`echo $JAVA_PATH_NAME | sed "s/\(.*\)[[/]]bin[[/]]java$EXEEXT$/\1/"`
+fi;dnl
+])
diff --git a/m4/ac_check_junit.m4 b/m4/ac_check_junit.m4
new file mode 100644
index 0000000..2edd1b5
--- /dev/null
+++ b/m4/ac_check_junit.m4
@@ -0,0 +1,66 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_junit.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_JUNIT
+#
+# DESCRIPTION
+#
+# AC_CHECK_JUNIT tests the availability of the Junit testing framework,
+# and set some variables for conditional compilation of the test suite by
+# automake.
+#
+# If available, JUNIT is set to a command launching the text based user
+# interface of Junit, @JAVA_JUNIT@ is set to $JAVA_JUNIT and @TESTS_JUNIT@
+# is set to $TESTS_JUNIT, otherwise they are set to empty values.
+#
+# You can use these variables in your Makefile.am file like this :
+#
+# # Some of the following classes are built only if junit is available
+# JAVA_JUNIT = Class1Test.java Class2Test.java AllJunitTests.java
+#
+# noinst_JAVA = Example1.java Example2.java @JAVA_JUNIT@
+#
+# EXTRA_JAVA = $(JAVA_JUNIT)
+#
+# TESTS_JUNIT = AllJunitTests
+#
+# TESTS = StandaloneTest1 StandaloneTest2 @TESTS_JUNIT@
+#
+# EXTRA_TESTS = $(TESTS_JUNIT)
+#
+# AllJunitTests :
+# echo "#! /bin/sh" > $@
+# echo "exec @JUNIT@ my.package.name.AllJunitTests" >> $@
+# chmod +x $@
+#
+# LICENSE
+#
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CHECK_JUNIT],[
+AC_CACHE_VAL(ac_cv_prog_JUNIT,[
+AC_CHECK_CLASS(junit.textui.TestRunner)
+if test x"`eval 'echo $ac_cv_class_junit_textui_TestRunner'`" != xno ; then
+ ac_cv_prog_JUNIT='$(CLASSPATH_ENV) $(JAVA) $(JAVAFLAGS) junit.textui.TestRunner'
+fi])
+AC_MSG_CHECKING([for junit])
+if test x"`eval 'echo $ac_cv_prog_JUNIT'`" != x ; then
+ JUNIT="$ac_cv_prog_JUNIT"
+ JAVA_JUNIT='$(JAVA_JUNIT)'
+ TESTS_JUNIT='$(TESTS_JUNIT)'
+else
+ JUNIT=
+ JAVA_JUNIT=
+ TESTS_JUNIT=
+fi
+AC_MSG_RESULT($JAVA_JUNIT)
+AC_SUBST(JUNIT)
+AC_SUBST(JAVA_JUNIT)
+AC_SUBST(TESTS_JUNIT)])
diff --git a/m4/ac_check_mysql_db.m4 b/m4/ac_check_mysql_db.m4
new file mode 100644
index 0000000..148a1e2
--- /dev/null
+++ b/m4/ac_check_mysql_db.m4
@@ -0,0 +1,64 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_mysql_db.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_MYSQL_DB
+#
+# DESCRIPTION
+#
+# Check if the specified MySQL database exists, if yes set your
+# environment variable to that database name else unset your environment
+# variable
+#
+# Example:
+#
+# AC_CHECK_MYSQL_DB(DBNAME, [fishmarket])
+# if test x$DBNAME = xfishmarket; then
+# bla..bla..bla..
+# else
+# bla..bla..bla..
+# fi
+#
+# LICENSE
+#
+# Copyright (c) 2008 Gleen Salmon <gleensalmon@yahoo.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CHECK_MYSQL_DB],[
+AC_REQUIRE([AC_PROG_MYSQLSHOW])dnl
+AC_MSG_CHECKING([for MySQL db $2])
+if $MYSQLSHOW -u root -prootpass $2 > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT([yes])
+else
+ unset $1
+ AC_MSG_RESULT([no])
+fi;dnl
+])
diff --git a/m4/ac_check_mysqlr.m4 b/m4/ac_check_mysqlr.m4
new file mode 100644
index 0000000..9b67933
--- /dev/null
+++ b/m4/ac_check_mysqlr.m4
@@ -0,0 +1,43 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_mysqlr.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_MYSQLR
+#
+# DESCRIPTION
+#
+# First check if mysqlconfig exists. It fails if mysqlconfig is not in
+# path. Then it checks for the libraries and replaces -lmysqlclient
+# statement with -lmysqlclient_r statement, to enable threaded client
+# library.
+#
+# The following are exported environment variables:
+#
+# MYSQL_LIBS
+# MYSQL_CFLAGS
+#
+# LICENSE
+#
+# Copyright (c) 2008 Can Bican <bican@yahoo.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CHECK_MYSQLR],[
+AC_PATH_PROG(mysqlconfig,mysql_config)
+if test [ -z "$mysqlconfig" ]
+then
+ AC_MSG_ERROR([mysql_config executable not found])
+else
+ AC_MSG_CHECKING(mysql libraries)
+ MYSQL_LIBS=`${mysqlconfig} --libs | sed -e \
+ 's/-lmysqlclient /-lmysqlclient_r /' -e 's/-lmysqlclient$/-lmysqlclient_r/'`
+ AC_MSG_RESULT($MYSQL_LIBS)
+ AC_MSG_CHECKING(mysql includes)
+ MYSQL_CFLAGS=`${mysqlconfig} --cflags`
+ AC_MSG_RESULT($MYSQL_CFLAGS)
+fi
+])
diff --git a/m4/ac_check_rqrd_class.m4 b/m4/ac_check_rqrd_class.m4
new file mode 100644
index 0000000..22c06e3
--- /dev/null
+++ b/m4/ac_check_rqrd_class.m4
@@ -0,0 +1,59 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_rqrd_class.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_RQRD_CLASS
+#
+# DESCRIPTION
+#
+# AC_CHECK_RQRD_CLASS tests the existence of a given Java class, either in
+# a jar or in a '.class' file and fails if it doesn't exist. Its success
+# or failure can depend on a proper setting of the CLASSPATH env.
+# variable.
+#
+# Note: This is part of the set of autoconf M4 macros for Java programs.
+# It is VERY IMPORTANT that you download the whole set, some macros depend
+# on other. Unfortunately, the autoconf archive does not support the
+# concept of set of macros, so I had to break it for submission. The
+# general documentation, as well as the sample configure.in, is included
+# in the AC_PROG_JAVA macro.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CHECK_RQRD_CLASS],[
+CLASS=`echo $1|sed 's/\./_/g'`
+AC_CHECK_CLASS($1)
+if test "$HAVE_LAST_CLASS" = "no"; then
+ AC_MSG_ERROR([Required class $1 missing, exiting.])
+fi
+])
diff --git a/m4/ac_check_struct_for.m4 b/m4/ac_check_struct_for.m4
new file mode 100644
index 0000000..33605f7
--- /dev/null
+++ b/m4/ac_check_struct_for.m4
@@ -0,0 +1,53 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_struct_for.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_STRUCT_FOR(INCLUDES,STRUCT,MEMBER,DEFINE,[no])
+#
+# DESCRIPTION
+#
+# Checks STRUCT for MEMBER and defines DEFINE if found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Wes Hardaker <wjhardaker@ucdavis.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CHECK_STRUCT_FOR],[
+ac_safe_struct=`echo "$2" | sed 'y%./+-%__p_%'`
+ac_safe_member=`echo "$3" | sed 'y%./+-%__p_%'`
+ac_safe_all="ac_cv_struct_${ac_safe_struct}_has_${ac_safe_member}"
+changequote(, )dnl
+ ac_uc_define=STRUCT_`echo "${ac_safe_struct}_HAS_${ac_safe_member}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+changequote([, ])dnl
+
+AC_MSG_CHECKING([for $2.$3])
+AC_CACHE_VAL($ac_safe_all,
+[
+if test "x$4" = "x"; then
+ defineit="= 0"
+elif test "x$4" = "xno"; then
+ defineit=""
+else
+ defineit="$4"
+fi
+AC_TRY_COMPILE([
+$1
+],[
+struct $2 testit;
+testit.$3 $defineit;
+], eval "${ac_safe_all}=yes", eval "${ac_safe_all}=no" )
+])
+
+if eval "test \"x$`echo ${ac_safe_all}`\" = \"xyes\""; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE_UNQUOTED($ac_uc_define)
+else
+ AC_MSG_RESULT(no)
+fi
+])
diff --git a/m4/ac_check_symbol.m4 b/m4/ac_check_symbol.m4
new file mode 100644
index 0000000..a4980e2
--- /dev/null
+++ b/m4/ac_check_symbol.m4
@@ -0,0 +1,81 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_symbol.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_SYMBOL(SYMBOL, HEADER... [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# A wrapper around AC_EGREP_HEADER. The shellvar $ac_found will hold the
+# HEADER-name that had been containing the symbol. This value is shown to
+# the user.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CHECK_SYMBOL],
+[AC_MSG_CHECKING([for $1 in $2])
+AC_CACHE_VAL(ac_cv_func_$1,
+[AC_REQUIRE_CPP()dnl
+changequote(, )dnl
+symbol="[^a-zA-Z_0-9]$1[^a-zA-Z_0-9]"
+changequote([, ])dnl
+ac_found=no
+for ac_header in $2 ; do
+ ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%' `
+ if test $ac_found != "yes" ; then
+ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ AC_EGREP_HEADER( $symbol, $ac_header, [ac_found="$ac_header"] )
+ fi
+ fi
+done
+if test "$ac_found" != "no" ; then
+ AC_MSG_RESULT($ac_found)
+ ifelse([$3], , :, [$3])
+else
+ AC_MSG_RESULT(no)
+ ifelse([$4], , , [$4
+])dnl
+fi
+])])
+
+dnl AC_CHECK_SYMBOLS( symbol..., header... [, action-if-found [, action-if-not-found]])
+AC_DEFUN([AC_CHECK_SYMBOLS],
+[for ac_func in $1
+do
+P4_CHECK_SYMBOL($ac_func, $2,
+[changequote(, )dnl
+ ac_tr_func=HAVE_`echo $ac_func | sed -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:' -e 's:[[^A-Z0-9]]:_:'`
+changequote([, ])dnl
+ AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl
+done
+])
diff --git a/m4/ac_check_taglib.m4 b/m4/ac_check_taglib.m4
new file mode 100644
index 0000000..f667817
--- /dev/null
+++ b/m4/ac_check_taglib.m4
@@ -0,0 +1,65 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_taglib.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_TAGLIB(version, action-if, action-if-not)
+#
+# DESCRIPTION
+#
+# Defines and exports TAGLIB_LIBS, TAGLIB_CFLAGS. See taglib-config man
+# page.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Akos Maroy <darkeye@tyrell.hu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CHECK_TAGLIB], [
+ succeeded=no
+
+ if test -z "$TAGLIB_CONFIG"; then
+ AC_PATH_PROG(TAGLIB_CONFIG, taglib-config, no)
+ fi
+
+ if test "$TAGLIB_CONFIG" = "no" ; then
+ echo "*** The taglib-config script could not be found. Make sure it is"
+ echo "*** in your path, and that taglib is properly installed."
+ echo "*** Or see http://developer.kde.org/~wheeler/taglib.html"
+ else
+ TAGLIB_VERSION=`$TAGLIB_CONFIG --version`
+ AC_MSG_CHECKING(for taglib >= $1)
+ VERSION_CHECK=`expr $TAGLIB_VERSION \>\= $1`
+ if test "$VERSION_CHECK" = "1" ; then
+ AC_MSG_RESULT(yes)
+ succeeded=yes
+
+ AC_MSG_CHECKING(TAGLIB_CFLAGS)
+ TAGLIB_CFLAGS=`$TAGLIB_CONFIG --cflags`
+ AC_MSG_RESULT($TAGLIB_CFLAGS)
+
+ AC_MSG_CHECKING(TAGLIB_LIBS)
+ TAGLIB_LIBS=`$TAGLIB_CONFIG --libs`
+ AC_MSG_RESULT($TAGLIB_LIBS)
+ else
+ TAGLIB_CFLAGS=""
+ TAGLIB_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ ifelse([$3], ,echo "can't find taglib >= $1",)
+ fi
+
+ AC_SUBST(TAGLIB_CFLAGS)
+ AC_SUBST(TAGLIB_LIBS)
+ fi
+
+ if test $succeeded = yes; then
+ ifelse([$2], , :, [$2])
+ else
+ ifelse([$3], , AC_MSG_ERROR([Library requirements (taglib) not met.]), [$3])
+ fi
+])
diff --git a/m4/ac_check_typedef.m4 b/m4/ac_check_typedef.m4
new file mode 100644
index 0000000..0b0ef0e
--- /dev/null
+++ b/m4/ac_check_typedef.m4
@@ -0,0 +1,73 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_typedef.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_TYPEDEF(TYPEDEF, HEADER [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]])
+#
+# DESCRIPTION
+#
+# Check if the given typedef-name is recognized as a type. The trick is to
+# use a sizeof(TYPEDEF) and see if the compiler is happy with that.
+#
+# This can be thought of as a mixture of AC_CHECK_TYPE(TYPEDEF,DEFAULT)
+# and AC_CHECK_LIB(LIBRARY,FUNCTION,ACTION-IF-FOUND,ACTION-IF-NOT-FOUND).
+#
+# A convenience macro AC_CHECK_TYPEDEF_ is provided that will not emit any
+# message to the user - it just executes one of the actions.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CHECK_TYPEDEF_],
+[dnl
+ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
+AC_CACHE_VAL(ac_cv_lib_$ac_lib_var,
+[ eval "ac_cv_type_$ac_lib_var='not-found'"
+ ac_cv_check_typedef_header=`echo ifelse([$2], , stddef.h, $2)`
+ AC_TRY_COMPILE( [#include <$ac_cv_check_typedef_header>],
+ [int x = sizeof($1); x = x;],
+ eval "ac_cv_type_$ac_lib_var=yes" ,
+ eval "ac_cv_type_$ac_lib_var=no" )
+ if test `eval echo '$ac_cv_type_'$ac_lib_var` = "no" ; then
+ ifelse([$4], , :, $4)
+ else
+ ifelse([$3], , :, $3)
+ fi
+])])
+
+dnl AC_CHECK_TYPEDEF(TYPEDEF, HEADER [, ACTION-IF-FOUND,
+dnl [, ACTION-IF-NOT-FOUND ]])
+AC_DEFUN([AC_CHECK_TYPEDEF],
+[dnl
+ AC_MSG_CHECKING([for $1 in $2])
+ AC_CHECK_TYPEDEF_($1,$2,AC_MSG_RESULT(yes),AC_MSG_RESULT(no))dnl
+])
diff --git a/m4/ac_check_user.m4 b/m4/ac_check_user.m4
new file mode 100644
index 0000000..6629b37
--- /dev/null
+++ b/m4/ac_check_user.m4
@@ -0,0 +1,69 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_check_user.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_USER
+#
+# DESCRIPTION
+#
+# Check if the specified UNIX user exists, if yes set your environment
+# variable to that username else unset your environment variable
+#
+# Example:
+#
+# AC_CHECK_USER(USER, [gleensalmon])
+# if test x$USER = xgleensalmon; then
+# bla..bla..bla..
+# else
+# bla..bla..bla..
+# fi
+#
+# Besides checking existence, this macro also set these environment
+# variables upon completion:
+#
+# USER_HOME = home directory of user, written in /etc/passwd
+#
+# LICENSE
+#
+# Copyright (c) 2008 Gleen Salmon <gleensalmon@yahoo.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CHECK_USER],[
+AC_MSG_CHECKING([for user $2])
+if grep ^$2: /etc/passwd > /dev/null; then
+ $1=$2
+ USER_HOME=`grep ^$2: /etc/passwd | sed "s/^\([[^:]]*:\)\{5\}\([[^:]]*\):[[^:]]*$/\2/"`
+ AC_MSG_RESULT([yes])
+else
+ unset $1
+ unset USER_HOME
+ AC_MSG_RESULT([no])
+fi;dnl
+])
diff --git a/m4/ac_compile_check_sizeof.m4 b/m4/ac_compile_check_sizeof.m4
new file mode 100644
index 0000000..d0f479d
--- /dev/null
+++ b/m4/ac_compile_check_sizeof.m4
@@ -0,0 +1,111 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_compile_check_sizeof.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_COMPILE_CHECK_SIZEOF(TYPE [, HEADERS [, EXTRA_SIZES...]])
+#
+# DESCRIPTION
+#
+# This macro checks for the size of TYPE using compile checks, not run
+# checks. You can supply extra HEADERS to look into. the check will cycle
+# through 1 2 4 8 16 and any EXTRA_SIZES the user supplies. If a match is
+# found, it will #define SIZEOF_`TYPE' to that value. Otherwise it will
+# emit a configure time error indicating the size of the type could not be
+# determined.
+#
+# The trick is that C will not allow duplicate case labels. While this is
+# valid C code:
+#
+# switch (0) case 0: case 1:;
+#
+# The following is not:
+#
+# switch (0) case 0: case 0:;
+#
+# Thus, the AC_TRY_COMPILE will fail if the currently tried size does not
+# match.
+#
+# Here is an example skeleton configure.in script, demonstrating the
+# macro's usage:
+#
+# AC_PROG_CC
+# AC_CHECK_HEADERS(stddef.h unistd.h)
+# AC_TYPE_SIZE_T
+# AC_CHECK_TYPE(ssize_t, int)
+#
+# headers='#ifdef HAVE_STDDEF_H
+# #include <stddef.h>
+# #endif
+# #ifdef HAVE_UNISTD_H
+# #include <unistd.h>
+# #endif
+# '
+#
+# AC_COMPILE_CHECK_SIZEOF(char)
+# AC_COMPILE_CHECK_SIZEOF(short)
+# AC_COMPILE_CHECK_SIZEOF(int)
+# AC_COMPILE_CHECK_SIZEOF(long)
+# AC_COMPILE_CHECK_SIZEOF(unsigned char *)
+# AC_COMPILE_CHECK_SIZEOF(void *)
+# AC_COMPILE_CHECK_SIZEOF(size_t, $headers)
+# AC_COMPILE_CHECK_SIZEOF(ssize_t, $headers)
+# AC_COMPILE_CHECK_SIZEOF(ptrdiff_t, $headers)
+# AC_COMPILE_CHECK_SIZEOF(off_t, $headers)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Kaveh Ghazi <ghazi@caip.rutgers.edu>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
+[changequote(<<, >>)dnl
+dnl The name to #define.
+define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
+dnl The cache variable name.
+define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
+changequote([, ])dnl
+AC_MSG_CHECKING(size of $1)
+AC_CACHE_VAL(AC_CV_NAME,
+[for ac_size in 4 8 1 2 16 $3 ; do # List sizes in rough order of prevalence.
+ AC_TRY_COMPILE([#include "confdefs.h"
+#include <sys/types.h>
+$2
+], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
+ if test x$AC_CV_NAME != x ; then break; fi
+done
+])
+if test x$AC_CV_NAME = x ; then
+ AC_MSG_ERROR([cannot determine a size for $1])
+fi
+AC_MSG_RESULT($AC_CV_NAME)
+AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
+undefine([AC_TYPE_NAME])dnl
+undefine([AC_CV_NAME])dnl
+])
diff --git a/m4/ac_compile_warnings.m4 b/m4/ac_compile_warnings.m4
new file mode 100644
index 0000000..4873890
--- /dev/null
+++ b/m4/ac_compile_warnings.m4
@@ -0,0 +1,89 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_compile_warnings.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_COMPILE_WARNINGS
+#
+# DESCRIPTION
+#
+# Set the maximum warning verbosity according to C and C++ compiler used.
+# Currently supports g++ and gcc.
+#
+# The compiler options are always added CFLAGS and CXXFLAGS even if these
+# are overidden at configure time. Removing the maximum warning flags can
+# be removed with --without-maximum-compile-warnings. For example:
+#
+# ./configure --without-maximum-compile-warnings CFLAGS= CXXFLAGS=
+#
+# LICENSE
+#
+# Copyright (c) 2008 Loic Dachary <loic@senga.org>
+# Copyright (c) 2008 William Fulton <wsf@fultondesigns.co.uk>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_COMPILE_WARNINGS], [
+AC_MSG_CHECKING([maximum warning verbosity option])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_PROG_CXX])
+
+ AC_ARG_WITH([maximum-compile-warnings],
+ AS_HELP_STRING([--without-maximum-compile-warnings],
+ [Disable maximum warning verbosity]),
+ [ac_compile_warnings_on="$withval"],
+ [ac_compile_warnings_on=""])
+
+ if test x"$ac_compile_warnings_on" = xno
+ then
+ ac_compile_warnings_msg=no
+ else
+ if test -n "$CXX"
+ then
+ if test "$GXX" = "yes"
+ then
+ ac_compile_warnings_opt='-Wall -W -ansi -pedantic'
+ fi
+ CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt"
+ ac_compile_warnings_msg="$ac_compile_warnings_opt for C++"
+ fi
+
+ if test -n "$CC"
+ then
+ if test "$GCC" = "yes"
+ then
+ ac_compile_warnings_opt='-Wall -W -ansi -pedantic'
+ fi
+ CFLAGS="$CFLAGS $ac_compile_warnings_opt"
+ ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C"
+ fi
+ fi
+ AC_MSG_RESULT([$ac_compile_warnings_msg])
+ unset ac_compile_warnings_msg
+ unset ac_compile_warnings_opt
+])
diff --git a/m4/ac_cond_with_level.m4 b/m4/ac_cond_with_level.m4
new file mode 100644
index 0000000..53ca5eb
--- /dev/null
+++ b/m4/ac_cond_with_level.m4
@@ -0,0 +1,173 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cond_with_level.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_COND_WITH_LEVEL(PACKAGE [,DEFAULT [,YESLEVEL]])
+#
+# DESCRIPTION
+#
+# Actually used after an AC_ARG_WITH(PKG,...) option-directive, where
+# AC_ARG_WITH is a part of the standard autoconf to define a `configure`
+# --with-PKG option.
+#
+# This macros works almost like AC_COND_WITH(PACKAGE [,DEFAULT]), but the
+# definition is set to a numeric value. The level of a simple "yes" is
+# given (or assumed "2" if absent), otherwise the level can be given in
+# mnemonic names, being:
+#
+# 1 = some
+# 2 = many
+# 3 = all
+# 4 = extra
+# 5 = extrasome more
+# 6 = extramany muchmore much
+# 7 = super everything
+# 8 = ultra experimental
+# 9 = insane
+#
+# this macro is most handily it making Makefile.in/Makefile.am that have a
+# set of with-level declarations, espcially optimization-levels
+#
+# the $withval shell-variable is set for further examination (it carries
+# the numeric value of the various mnemonics above)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_COND_WITH_LEVEL],
+[dnl the names to be defined...
+pushdef([WITH_VAR], patsubst(with_$1, -, _))dnl
+pushdef([VAR_WITH], patsubst(translit(with_$1, [a-z], [A-Z]), -, _))dnl
+pushdef([VAR_WITHOUT], patsubst(translit(without_$1, [a-z], [A-Z]), -, _))dnl
+pushdef([VAR_WITHVAL], patsubst(translit(withval_$1, [a-z], [A-Z]), -, _))dnl
+pushdef([VAR_WITHDEF], patsubst(translit(withdef_$1, [a-z], [A-Z]), -, _))dnl
+AC_SUBST(VAR_WITH)
+AC_SUBST(VAR_WITHOUT)
+AC_SUBST(VAR_WITHVAL)
+AC_SUBST(VAR_WITHDEF)
+if test -z "$WITH_VAR"
+ then WITH_VAR=`echo ifelse([$2], , no, [$2])`
+fi
+if test "$WITH_VAR" = "yes"
+ then WITH_VAR=`echo ifelse([$3], , some, [$3])`
+fi
+if test "$WITH_VAR" != "no"; then
+ VAR_WITH= ; VAR_WITHOUT='#'
+ case "$WITH_VAR" in
+ 9|9,*|ultrasome|ultrasome,*|insane) withval=9
+ VAR_WITHVAL=9 ; VAR_WITHDEF="-D""VAR_WITH=9" ;;
+ 8|8,*|ultra|ultra,*|experimental) withval=8
+ VAR_WITHVAL=8 ; VAR_WITHDEF="-D""VAR_WITH=8" ;;
+ 7|7,*|muchmore|somemanymore|somemanymore,*|all) withval=7
+ VAR_WITHVAL=7 ; VAR_WITHDEF="-D""VAR_WITH=7" ;;
+ 6|6,*|manymore|manymore,*|most) withval=6
+ VAR_WITHVAL=6 ; VAR_WITHDEF="-D""VAR_WITH=6" ;;
+ 5|5,*|somemore|somemore,*|almost) withval=5
+ VAR_WITHVAL=5 ; VAR_WITHDEF="-D""VAR_WITH=5" ;;
+ 4|4,*|more|more,*) withval=4
+ VAR_WITHVAL=4 ; VAR_WITHDEF="-D""VAR_WITH=4" ;;
+ 3|3,*|much|somemany,*) withval=3
+ VAR_WITHVAL=3 ; VAR_WITHDEF="-D""VAR_WITH=3" ;;
+ 2|2,*|many|many,*) withval=2
+ VAR_WITHVAL=2 ; VAR_WITHDEF="-D""VAR_WITH=2" ;;
+ 1|1,*|some|some,*) withval=1
+ VAR_WITHVAL=1 ; VAR_WITHDEF="-D""VAR_WITH=1" ;;
+ *) withval=-
+ AC_MSG_ERROR([dnl
+ bad value of --with-$1 option, choose a number or some|many|more|all... ])
+ esac
+else withval=0
+ VAR_WITH='#' ; VAR_WITHOUT=""
+ VAR_WITHVAL=0 ; VAR_WITHDEF=""
+fi
+popdef([VAR_WITH])dnl
+popdef([VAR_WITHOUT])dnl
+popdef([VAR_WITHVAL])dnl
+popdef([VAR_WITHDEF])dnl
+popdef([WITH_VAR])dnl
+])
+
+dnl and the same as AC_COND_WITH_LEVEL with an AC_DEFINE in the end...
+AC_DEFUN([AC_COND_WITH_LEVEL_DEFINE],
+[dnl the names to be defined...
+pushdef([WITH_VAR], patsubst(with_$1, -, _))dnl
+pushdef([VAR_WITH], patsubst(translit(with_$1, [a-z], [A-Z]), -, _))dnl
+pushdef([VAR_WITHOUT], patsubst(translit(without_$1, [a-z], [A-Z]), -, _))dnl
+pushdef([VAR_WITHVAL], patsubst(translit(withval_$1, [a-z], [A-Z]), -, _))dnl
+pushdef([VAR_WITHDEF], patsubst(translit(withdef_$1, [a-z], [A-Z]), -, _))dnl
+AC_SUBST(VAR_WITH)
+AC_SUBST(VAR_WITHOUT)
+AC_SUBST(VAR_WITHVAL)
+AC_SUBST(VAR_WITHDEF)
+if test -z "$WITH_VAR"
+ then WITH_VAR=`echo ifelse([$2], , no, [$2])`
+fi
+if test "$WITH_VAR" = "yes"
+ then WITH_VAR=`echo ifelse([$3], , some, [$3])`
+fi
+if test "$WITH_VAR" != "no"; then
+ VAR_WITH= ; VAR_WITHOUT='#'
+ case "$WITH_VAR" in
+ 9|9,*|ultrasome|ultrasome,*|insane) withval=9
+ VAR_WITHVAL=9 ; VAR_WITHDEF="-D""VAR_WITH=9" ;;
+ 8|8,*|ultra|ultra,*|experimental) withval=8
+ VAR_WITHVAL=8 ; VAR_WITHDEF="-D""VAR_WITH=8" ;;
+ 7|7,*|muchmore|somemanymore|somemanymore,*|all) withval=7
+ VAR_WITHVAL=7 ; VAR_WITHDEF="-D""VAR_WITH=7" ;;
+ 6|6,*|manymore|manymore,*|most) withval=6
+ VAR_WITHVAL=6 ; VAR_WITHDEF="-D""VAR_WITH=6" ;;
+ 5|5,*|somemore|somemore,*|almost) withval=5
+ VAR_WITHVAL=5 ; VAR_WITHDEF="-D""VAR_WITH=5" ;;
+ 4|4,*|more|more,*) withval=4
+ VAR_WITHVAL=4 ; VAR_WITHDEF="-D""VAR_WITH=4" ;;
+ 3|3,*|much|somemany,*) withval=3
+ VAR_WITHVAL=3 ; VAR_WITHDEF="-D""VAR_WITH=3" ;;
+ 2|2,*|many|many,*) withval=2
+ VAR_WITHVAL=2 ; VAR_WITHDEF="-D""VAR_WITH=2" ;;
+ 1|1,*|some|some,*) withval=1
+ VAR_WITHVAL=1 ; VAR_WITHDEF="-D""VAR_WITH=1" ;;
+ *) withval=-
+ AC_MSG_ERROR([dnl
+ bad value of --with-$1 option, choose a number or some|many|more|all... ])
+ esac
+dnl -- the additional line is here --
+ AC_DEFINE_UNQUOTED(VAR_WITH,$VAR_WITHVAL,"--with-$1=level")
+else withval=0
+ VAR_WITH='#' ; VAR_WITHOUT=""
+ VAR_WITHVAL=0 ; VAR_WITHDEF=""
+fi
+popdef([VAR_WITH])dnl
+popdef([VAR_WITHOUT])dnl
+popdef([VAR_WITHVAL])dnl
+popdef([VAR_WITHDEF])dnl
+popdef([WITH_VAR])dnl
+])
diff --git a/m4/ac_create_generic_config.m4 b/m4/ac_create_generic_config.m4
new file mode 100644
index 0000000..4d47dfa
--- /dev/null
+++ b/m4/ac_create_generic_config.m4
@@ -0,0 +1,192 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_create_generic_config.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CREATE_GENERIC_CONFIG [(PACKAGEnlibs [, VERSION])]
+#
+# DESCRIPTION
+#
+# Creates a generic PACKAGE-config file that has all the things that you
+# want, hmm, well, atleast it has --cflags, --version, --libs. Ahhm, did
+# you see ac_path_generic in the autoconf-archive? ;-)
+#
+# this macros saves you all the typing for a pkg-config.in script, you
+# don't even need to distribute one along. Place this macro in your
+# configure.ac, et voila, you got one that you want to install.
+#
+# oh, btw, if the first arg looks like "mylib -lwhat' then it will go to
+# be added to the --libs, and mylib is extracted.
+#
+# the defaults: $1 = $PACKAGE $LIBS $2 = $VERSION there is also an
+# AC_SUBST(GENERIC_CONFIG) that will be set to the name of the file that
+# we did output in this macro. Use as:
+#
+# install-exec-local: install-generic-config
+#
+# install-generic-config:
+# $(mkinstalldirs) $(DESTDIR)$(bindir)
+# $(INSTALL_SCRIPT) @GENERIC_CONFIG@ $(DESTDIR)$(bindir)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CREATE_GENERIC_CONFIG],[# create a generic PACKAGE-config file
+L=`echo ifelse($1, , $PACKAGE $LIBS, $1)`
+P=`echo $L | sed -e 's/ -.*//'`
+P=`echo $P`
+V=`echo ifelse($2, , $VERSION, $2)`
+F=`echo $P-config`
+L=`echo -l$L | sed -e 's/^-llib/-l/'`
+AC_MSG_RESULT(creating $F - generic $V for $L)
+test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+echo '#! /bin/sh' >$F
+echo ' ' >>$F
+echo 'package="'$P'"' >>$F
+echo 'version="'$V'"' >>$F
+echo 'libs="'$L'"' >>$F
+echo ' ' >>$F
+# in the order of occurence a standard automake Makefile
+echo 'prefix="'$prefix'"' >>$F
+echo 'exec_prefix="'$exec_prefix'"' >>$F
+echo 'bindir="'$bindir'"' >>$F
+echo 'sbindir="'$sbindir'"' >>$F
+echo 'libexecdir="'$libexecdir'"' >>$F
+echo 'datadir="'$datadir'"' >>$F
+echo 'sysconfdir="'$sysconfdir'"' >>$F
+echo 'sharedstatedir="'$sharedstatedir'"' >>$F
+echo 'localstatedir="'$localstatedir'"' >>$F
+echo 'libdir="'$libdir'"' >>$F
+echo 'infodir="'$infodir'"' >>$F
+echo 'mandir="'$mandir'"' >>$F
+echo 'includedir="'$includedir'"' >>$F
+echo 'target="'$target'"' >>$F
+echo 'host="'$host'"' >>$F
+echo 'build="'$build'"' >>$F
+echo ' ' >>$F
+echo 'if test "'"\$""#"'" -eq 0; then' >>$F
+echo ' cat <<EOF' >>$F
+echo 'Usage: $package-config [OPTIONS]' >>$F
+echo 'Options:' >>$F
+echo ' --prefix[=DIR]) : \$prefix' >>$F
+echo ' --package) : \$package' >>$F
+echo ' --version) : \$version' >>$F
+echo ' --cflags) : -I\$includedir' >>$F
+echo ' --libs) : -L\$libdir -l\$package' >>$F
+echo ' --help) print all the options (not just these)' >>$F
+echo 'EOF' >>$F
+echo 'fi' >>$F
+echo ' ' >>$F
+echo 'o=""' >>$F
+echo 'h=""' >>$F
+echo 'for i in "[$]@"; do' >>$F
+echo ' case $i in' >>$F
+echo ' --prefix=*) prefix=`echo $i | sed -e "s/--prefix=//"` ;;' >>$F
+echo ' --prefix) o="$o $prefix" ;;' >>$F
+echo ' --package) o="$o $package" ;;' >>$F
+echo ' --version) o="$o $version" ;;' >>$F
+echo ' --cflags) if test "_$includedir" != "_/usr/include"' >>$F
+echo ' then o="$o -I$includedir" ; fi' >>$F
+echo ' ;;' >>$F
+echo ' --libs) o="$o -L$libdir $libs" ;;' >>$F
+echo ' --exec_prefix|--eprefix) o="$o $exec_prefix" ;;' >>$F
+echo ' --bindir) o="$o $bindir" ;;' >>$F
+echo ' --sbindir) o="$o $sbindir" ;;' >>$F
+echo ' --libexecdir) o="$o $libexecdir" ;;' >>$F
+echo ' --datadir) o="$o $datadir" ;;' >>$F
+echo ' --datainc) o="$o -I$datadir" ;;' >>$F
+echo ' --datalib) o="$o -L$datadir" ;;' >>$F
+echo ' --sysconfdir) o="$o $sysconfdir" ;;' >>$F
+echo ' --sharedstatedir) o="$o $sharedstatedir" ;;' >>$F
+echo ' --localstatedir) o="$o $localstatedir" ;;' >>$F
+echo ' --libdir) o="$o $libdir" ;;' >>$F
+echo ' --libadd) o="$o -L$libdir" ;;' >>$F
+echo ' --infodir) o="$o $infodir" ;;' >>$F
+echo ' --mandir) o="$o $mandir" ;;' >>$F
+echo ' --target) o="$o $target" ;;' >>$F
+echo ' --host) o="$o $host" ;;' >>$F
+echo ' --build) o="$o $build" ;;' >>$F
+echo ' --data) o="$o -I$datadir/$package" ;;' >>$F
+echo ' --pkgdatadir) o="$o $datadir/$package" ;;' >>$F
+echo ' --pkgdatainc) o="$o -I$datadir/$package" ;;' >>$F
+echo ' --pkgdatalib) o="$o -L$datadir/$package" ;;' >>$F
+echo ' --pkglibdir) o="$o $libdir/$package" ;;' >>$F
+echo ' --pkglibinc) o="$o -I$libinc/$package" ;;' >>$F
+echo ' --pkglibadd) o="$o -L$libadd/$package" ;;' >>$F
+echo ' --pkgincludedir) o="$o $includedir/$package" ;;' >>$F
+echo ' --help) h="1" ;;' >>$F
+echo ' -?//*|-?/*//*|-?./*//*|//*|/*//*|./*//*) ' >>$F
+echo ' v=`echo $i | sed -e s://:\$:g`' >>$F
+echo ' v=`eval "echo $v"` ' >>$F
+echo ' o="$o $v" ;; ' >>$F
+echo ' esac' >>$F
+echo 'done' >>$F
+echo ' ' >>$F
+echo 'o=`eval "echo $o"`' >>$F
+echo 'o=`eval "echo $o"`' >>$F
+echo 'eval "echo $o"' >>$F
+echo ' ' >>$F
+echo 'if test ! -z "$h" ; then ' >>$F
+echo 'cat <<EOF' >>$F
+echo ' --prefix=xxx) (what is that for anyway?)' >>$F
+echo ' --prefix) \$prefix $prefix' >>$F
+echo ' --package) \$package $package' >>$F
+echo ' --version) \$version $version' >>$F
+echo ' --cflags) -I\$includedir unless it is /usr/include' >>$F
+echo ' --libs) -L\$libdir -l\$PACKAGE \$LIBS' >>$F
+echo ' --exec_prefix) or... ' >>$F
+echo ' --eprefix) \$exec_prefix $exec_prefix' >>$F
+echo ' --bindir) \$bindir $bindir' >>$F
+echo ' --sbindir) \$sbindir $sbindir' >>$F
+echo ' --libexecdir) \$libexecdir $libexecdir' >>$F
+echo ' --datadir) \$datadir $datadir' >>$F
+echo ' --sysconfdir) \$sysconfdir $sysconfdir' >>$F
+echo ' --sharedstatedir) \$sharedstatedir$sharedstatedir' >>$F
+echo ' --localstatedir) \$localstatedir $localstatedir' >>$F
+echo ' --libdir) \$libdir $libdir' >>$F
+echo ' --infodir) \$infodir $infodir' >>$F
+echo ' --mandir) \$mandir $mandir' >>$F
+echo ' --target) \$target $target' >>$F
+echo ' --host) \$host $host' >>$F
+echo ' --build) \$build $build' >>$F
+echo ' --data) -I\$datadir/\$package' >>$F
+echo ' --pkgdatadir) \$datadir/\$package' >>$F
+echo ' --pkglibdir) \$libdir/\$package' >>$F
+echo ' --pkgincludedir) \$includedir/\$package' >>$F
+echo ' --help) generated by ac_create_generic_config.m4' >>$F
+echo ' -I//varname and other inc-targets like --pkgdatainc supported' >>$F
+echo ' -L//varname and other lib-targets, e.g. --pkgdatalib or --libadd' >>$F
+echo 'EOF' >>$F
+echo 'fi' >>$F
+GENERIC_CONFIG="$F"
+AC_SUBST(GENERIC_CONFIG)
+])
diff --git a/m4/ac_create_target_h.m4 b/m4/ac_create_target_h.m4
new file mode 100644
index 0000000..725b268
--- /dev/null
+++ b/m4/ac_create_target_h.m4
@@ -0,0 +1,526 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_create_target_h.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CREATE_TARGET_H [(HEADER-FILE [,PREFIX)]
+#
+# DESCRIPTION
+#
+# Create the header-file and let it contain '#defines' for the target
+# platform. This macro is used for libraries that have platform-specific
+# quirks. Instead of inventing a target-specific target.h.in files, just
+# let it create a header file from the definitions of AC_CANONICAL_SYSTEM
+# and put only ifdef's in the installed header-files.
+#
+# if the HEADER-FILE is absent, [target.h] is used.
+# if the PREFIX is absent, [TARGET] is used.
+# the prefix can be the packagename. (y:a-z-:A-Z_:)
+#
+# The defines look like...
+#
+# #ifndef TARGET_CPU_M68K
+# #define TARGET_CPU_M68K "m68k"
+# #endif
+#
+# #ifndef TARGET_OS_LINUX
+# #define TARGET_OS_LINUX "linux-gnu"
+# #endif
+#
+# #ifndef TARGET_OS_TYPE /* the string itself */
+# #define TARGET_OS_TYPE "linux-gnu"
+# #endif
+#
+# Detail: in the case of hppa1.1, the three idents "hppa1_1" "hppa1" and
+# "hppa" are derived, for an m68k it just two, "m68k" and "m".
+#
+# The CREATE_TARGET_H__ variant is almost the same function, but
+# everything is lowercased instead of uppercased, and there is a "__" in
+# front of each prefix, so it looks like...
+#
+# #ifndef __target_os_linux
+# #define __target_os_linux "linux-gnulibc2"
+# #endif
+#
+# #ifndef __target_os__ /* the string itself */
+# #define __target_os__ "linux-gnulibc2"
+# #endif
+#
+# #ifndef __target_cpu_i586
+# #define __target_cpu_i586 "i586"
+# #endif
+#
+# #ifndef __target_arch_i386
+# #define __target_arch_i386 "i386"
+# #endif
+#
+# #ifndef __target_arch__ /* cpu family arch */
+# #define __target_arch__ "i386"
+# #endif
+#
+# Other differences: the default string-define is "__" instead of "_TYPE".
+#
+# Personally, I prefer the second variant (which had been the first in the
+# devprocess of this file but I assume people will often fallback to the
+# primary variant presented herein).
+#
+# NOTE: CREATE_TARGET_H does also fill HOST_OS-defines Functionality has
+# been split over functions called CREATE_TARGET_H_UPPER,
+# CREATE_TARGET_H_LOWER, CREATE_TARGET_HOST_UPPER, and
+# CREATE_TARGET_HOST_LOWER.
+#
+# CREATE_TARGET_H uses CREATE_TARGET_H_UPPER CREATE_TARGET_HOST_UPPER
+# CREATE_TARGET_H_ uses CREATE_TARGET_H_LOWER CREATE_TARGET_HOST_LOWER
+#
+# There is now a CREATE_PREFIX_TARGET_H in this file as a shorthand for
+# PREFIX_CONFIG_H from a target.h file, however w/o the target.h ever
+# created (the prefix is a bit different, since we add an extra -target-
+# and -host-).
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CREATE_TARGET_H],
+[AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
+AC_CREATE_TARGET_H_UPPER($1,$2)
+AC_CREATE_TARGET_HOST_UPPER($1,$2)
+])
+
+AC_DEFUN([AC_CREATE_TARGET_OS_H],
+[AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
+AC_CREATE_TARGET_H_LOWER($1,$2)
+AC_CREATE_TARGET_HOST_LOWER($1,$2)
+])
+
+AC_DEFUN([AC_CREATE_TARGET_H__],
+[AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
+AC_CREATE_TARGET_H_LOWER($1,$2)
+AC_CREATE_TARGET_HOST_LOWER($1,$2)
+])
+
+dnl [(OUT-FILE [, PREFIX])] defaults: PREFIX=$PACKAGE OUTFILE=$PREFIX-target.h
+AC_DEFUN([AC_CREATE_PREFIX_TARGET_H],[dnl
+ac_prefix_conf_PKG=`echo ifelse($2, , $PACKAGE, $2)`
+ac_prefix_conf_OUT=`echo ifelse($1, , $ac_prefix_conf_PKG-target.h, $1)`
+ac_prefix_conf_PRE=`echo $ac_prefix_conf_PKG-target | sed -e 'y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:'`
+AC_CREATE_TARGET_H_UPPER($ac_prefix_conf_PRE,$ac_perfix_conf_OUT)
+ac_prefix_conf_PRE=`echo __$ac_prefix_conf_PKG-host | sed -e 'y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:'`
+AC_CREATE_TARGET_HOST_UPPER($ac_prefix_conf_PRE,$ac_perfix_conf_OUT)
+])
+
+dnl [(OUT-FILE[, PREFIX])] defaults: PREFIX=$PACKAGE OUTFILE=$PREFIX-target.h
+AC_DEFUN([AC_CREATE_PREFIX_TARGET_H_],[dnl
+ac_prefix_conf_PKG=`echo ifelse($2, , $PACKAGE, $2)`
+ac_prefix_conf_OUT=`echo ifelse($1, , $ac_prefix_conf_PKG-target.h, $1)`
+ac_prefix_conf_PRE=`echo __$ac_prefix_conf_PKG-target | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:'`
+AC_CREATE_TARGET_H_LOWER($ac_prefix_conf_PRE,$ac_perfix_conf_OUT)
+ac_prefix_conf_PRE=`echo __$ac_prefix_conf_PKG-host | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:'`
+AC_CREATE_TARGET_HOST_LOWER($ac_prefix_conf_PRE,$ac_perfix_conf_OUT)
+])
+
+AC_DEFUN([AC_CREATE_TARGET_H_FILE],[dnl
+ac_need_target_h_file_new=true
+])
+
+AC_DEFUN([AC_CREATE_TARGET_H_UPPER],
+[AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
+AC_REQUIRE([AC_CREATE_TARGET_H_FILE])
+changequote({, })dnl
+ac_need_target_h_file=`echo ifelse($1, , target.h, $1)`
+ac_need_target_h_prefix=`echo ifelse($2, , target, $2) | sed -e 'y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:' -e 's:[^A-Z0-9_]::g'`
+#
+target_os0=`echo "$target_os" | sed -e 'y:abcdefghijklmnopqrstuvwxyz.-:ABCDEFGHIJKLMNOPQRSTUVWXYZ__:' -e 's:[^A-Z0-9_]::g'`
+target_os1=`echo "$target_os0" | sed -e 's:\([^0-9]*\).*:\1:' `
+target_os2=`echo "$target_os0" | sed -e 's:\([^_]*\).*:\1:' `
+target_os3=`echo "$target_os2" | sed -e 's:\([^0-9]*\).*:\1:' `
+#
+target_cpu0=`echo "$target_cpu" | sed -e 'y:abcdefghijklmnopqrstuvwxyz.-:ABCDEFGHIJKLMNOPQRSTUVWXYZ__:' -e 's:[^A-Z0-9_]::g'`
+target_cpu1=`echo "$target_cpu0" | sed -e 's:\([^0-9]*\).*:\1:' `
+target_cpu2=`echo "$target_cpu0" | sed -e 's:\([^_]*\).*:\1:' `
+target_cpu3=`echo "$target_cpu2" | sed -e 's:\([^0-9]*\).*:\1:' `
+#
+target_cpu_arch0=`echo "$target_cpu_arch" | sed -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:'`
+#
+changequote([, ])dnl
+#
+if $ac_need_target_h_file_new ; then
+AC_MSG_RESULT(creating $ac_need_target_h_file - canonical system defines)
+echo /'*' automatically generated by $PACKAGE configure '*'/ >$ac_need_target_h_file
+echo /'*' on `date` '*'/ >>$ac_need_target_h_file
+ac_need_target_h_file_new=false
+fi
+echo /'*' target uppercase defines '*'/ >>$ac_need_target_h_file
+dnl
+old1=""
+old2=""
+for i in $target_os0 $target_os1 $target_os2 $target_os3 "TYPE"
+do
+ if test "$old1" != "$i"; then
+ if test "$old2" != "$i"; then
+ echo " " >>$ac_need_target_h_file
+ echo "#ifndef "$ac_need_target_h_prefix"_OS_"$i >>$ac_need_target_h_file
+ echo "#define "$ac_need_target_h_prefix"_OS_"$i '"'"$target_os"'"' >>$ac_need_target_h_file
+ echo "#endif" >>$ac_need_target_h_file
+ fi
+ fi
+ old2="$old1"
+ old1="$i"
+done
+#
+old1=""
+old2=""
+for i in $target_cpu0 $target_cpu1 $target_cpu2 $target_cpu3 "TYPE"
+do
+ if test "$old1" != "$i"; then
+ if test "$old2" != "$i"; then
+ echo " " >>$ac_need_target_h_file
+ echo "#ifndef "$ac_need_target_h_prefix"_CPU_"$i >>$ac_need_target_h_file
+ echo "#define "$ac_need_target_h_prefix"_CPU_"$i '"'"$target_cpu"'"' >>$ac_need_target_h_file
+ echo "#endif" >>$ac_need_target_h_file
+ fi
+ fi
+ old2="$old1"
+ old1="$i"
+done
+#
+old1=""
+old2=""
+for i in $target_cpu_arch0 "TYPE"
+do
+ if test "$old1" != "$i"; then
+ if test "$old2" != "$i"; then
+ echo " " >>$ac_need_target_h_file
+ echo "#ifndef "$ac_need_target_h_prefix"_ARCH_"$i >>$ac_need_target_h_file
+ echo "#define "$ac_need_target_h_prefix"_ARCH_"$i '"'"$target_cpu_arch"'"' >>$ac_need_target_h_file
+ echo "#endif" >>$ac_need_target_h_file
+ fi
+ fi
+ old2="$old1"
+ old1="$i"
+done
+])
+
+dnl
+dnl ... the lowercase variant ...
+dnl
+AC_DEFUN([AC_CREATE_TARGET_H_LOWER],
+[AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
+AC_REQUIRE([AC_CREATE_TARGET_H_FILE])
+changequote({, })dnl
+ac_need_target_h_file=`echo ifelse($1, , target-os.h, $1)`
+ac_need_target_h_prefix=`echo ifelse($2, , target, $2) | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:' -e 's:[^a-z0-9_]::g'`
+#
+target_os0=`echo "$target_os" | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ.-:abcdefghijklmnopqrstuvwxyz__:' -e 's:[^a-z0-9_]::g'`
+target_os1=`echo "$target_os0" | sed -e 's:\([^0-9]*\).*:\1:' `
+target_os2=`echo "$target_os0" | sed -e 's:\([^_]*\).*:\1:' `
+target_os3=`echo "$target_os2" | sed -e 's:\([^0-9]*\).*:\1:' `
+#
+target_cpu0=`echo "$target_cpu" | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ.-:abcdefghijklmnopqrstuvwxyz__:' -e 's:[^a-z0-9_]::g'`
+target_cpu1=`echo "$target_cpu0" | sed -e 's:\([^0-9]*\).*:\1:' `
+target_cpu2=`echo "$target_cpu0" | sed -e 's:\([^_]*\).*:\1:' `
+target_cpu3=`echo "$target_cpu2" | sed -e 's:\([^0-9]*\).*:\1:' `
+#
+target_cpu_arch0=`echo "$target_cpu_arch" | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ:abcdefghijklmnopqrstuvwxyz:'`
+#
+changequote([, ])dnl
+#
+if $ac_need_target_h_file_new ; then
+AC_MSG_RESULT(creating $ac_need_target_h_file - canonical system defines)
+echo /'*' automatically generated by $PACKAGE configure '*'/ >$ac_need_target_h_file
+echo /'*' on `date` '*'/ >>$ac_need_target_h_file
+ac_need_target_h_file_new=false
+fi
+echo /'*' target lowercase defines '*'/ >>$ac_need_target_h_file
+dnl
+old1=""
+old2=""
+for i in $target_os0 $target_os1 $target_os2 $target_os3 "_";
+do
+ if test "$old1" != "$i"; then
+ if test "$old2" != "$i"; then
+ echo " " >>$ac_need_target_h_file
+ echo "#ifndef __"$ac_need_target_h_prefix"_os_"$i >>$ac_need_target_h_file
+ echo "#define __"$ac_need_target_h_prefix"_os_"$i '"'"$target_os"'"' >>$ac_need_target_h_file
+ echo "#endif" >>$ac_need_target_h_file
+ fi
+ fi
+ old2="$old1"
+ old1="$i"
+done
+#
+old1=""
+old2=""
+for i in $target_cpu0 $target_cpu1 $target_cpu2 $target_cpu3 "_"
+do
+ if test "$old1" != "$i"; then
+ if test "$old2" != "$i"; then
+ echo " " >>$ac_need_target_h_file
+ echo "#ifndef __"$ac_need_target_h_prefix"_cpu_"$i >>$ac_need_target_h_file
+ echo "#define __"$ac_need_target_h_prefix"_cpu_"$i '"'"$target_cpu"'"' >>$ac_need_target_h_file
+ echo "#endif" >>$ac_need_target_h_file
+ fi
+ fi
+ old2="$old1"
+ old1="$i"
+done
+#
+old1=""
+old2=""
+for i in $target_cpu_arch0 "_"
+do
+ if test "$old1" != "$i"; then
+ if test "$old2" != "$i"; then
+ echo " " >>$ac_need_target_h_file
+ echo "#ifndef __"$ac_need_target_h_prefix"_arch_"$i >>$ac_need_target_h_file
+ echo "#define __"$ac_need_target_h_prefix"_arch_"$i '"'"$target_cpu_arch"'"' >>$ac_need_target_h_file
+ echo "#endif" >>$ac_need_target_h_file
+ fi
+ fi
+ old2="$old1"
+ old1="$i"
+done
+])
+
+dnl -------------------------------------------------------------------
+dnl
+dnl ... the uppercase variant for the host ...
+dnl
+AC_DEFUN([AC_CREATE_TARGET_HOST_UPPER],
+[AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
+AC_REQUIRE([AC_CREATE_TARGET_H_FILE])
+changequote({, })dnl
+ac_need_target_h_file=`echo ifelse($1, , target.h, $1)`
+ac_need_target_h_prefix=`echo ifelse($2, , host, $2) | sed -e 'y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:' -e 's:[^A-Z0-9_]::g'`
+#
+host_os0=`echo "$host_os" | sed -e 'y:abcdefghijklmnopqrstuvwxyz.-:ABCDEFGHIJKLMNOPQRSTUVWXYZ__:' -e 's:[^A-Z0-9_]::g'`
+host_os1=`echo "$host_os0" | sed -e 's:\([^0-9]*\).*:\1:' `
+host_os2=`echo "$host_os0" | sed -e 's:\([^_]*\).*:\1:' `
+host_os3=`echo "$host_os2" | sed -e 's:\([^0-9]*\).*:\1:' `
+#
+host_cpu0=`echo "$host_cpu" | sed -e 'y:abcdefghijklmnopqrstuvwxyz.-:ABCDEFGHIJKLMNOPQRSTUVWXYZ__:' -e 's:[^A-Z0-9]::g'`
+host_cpu1=`echo "$host_cpu0" | sed -e 's:\([^0-9]*\).*:\1:' `
+host_cpu2=`echo "$host_cpu0" | sed -e 's:\([^_]*\).*:\1:' `
+host_cpu3=`echo "$host_cpu2" | sed -e 's:\([^0-9]*\).*:\1:' `
+#
+host_cpu_arch0=`echo "$host_cpu_arch" | sed -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:'`
+#
+changequote([, ])dnl
+#
+if $ac_need_target_h_file_new ; then
+AC_MSG_RESULT(creating $ac_need_target_h_file - canonical system defines)
+echo /'*' automatically generated by $PACKAGE configure '*'/ >$ac_need_target_h_file
+echo /'*' on `date` '*'/ >>$ac_need_target_h_file
+ac_need_target_h_file_new=false
+fi
+echo /'*' host uppercase defines '*'/ >>$ac_need_target_h_file
+dnl
+old1=""
+old2=""
+for i in $host_os0 $host_os1 $host_os2 $host_os3 "TYPE"
+do
+ if test "$old1" != "$i"; then
+ if test "$old2" != "$i"; then
+ echo " " >>$ac_need_target_h_file
+ echo "#ifndef "$ac_need_target_h_prefix"_OS_"$i >>$ac_need_target_h_file
+ echo "#define "$ac_need_target_h_prefix"_OS_"$i '"'"$host_os"'"' >>$ac_need_target_h_file
+ echo "#endif" >>$ac_need_target_h_file
+ fi
+ fi
+ old2="$old1"
+ old1="$i"
+done
+#
+old1=""
+old2=""
+for i in $host_cpu0 $host_cpu1 $host_cpu2 $host_cpu3 "TYPE"
+do
+ if test "$old1" != "$i"; then
+ if test "$old2" != "$i"; then
+ echo " " >>$ac_need_target_h_file
+ echo "#ifndef "$ac_need_target_h_prefix"_CPU_"$i >>$ac_need_target_h_file
+ echo "#define "$ac_need_target_h_prefix"_CPU_"$i '"'"$host_cpu"'"' >>$ac_need_target_h_file
+ echo "#endif" >>$ac_need_target_h_file
+ fi
+ fi
+ old2="$old1"
+ old1="$i"
+done
+#
+old1=""
+old2=""
+for i in $host_cpu_arch0 "TYPE"
+do
+ if test "$old1" != "$i"; then
+ if test "$old2" != "$i"; then
+ echo " " >>$ac_need_target_h_file
+ echo "#ifndef "$ac_need_target_h_prefix"_ARCH_"$i >>$ac_need_target_h_file
+ echo "#define "$ac_need_target_h_prefix"_ARCH_"$i '"'"$host_cpu_arch"'"' >>$ac_need_target_h_file
+ echo "#endif" >>$ac_need_target_h_file
+ fi
+ fi
+ old2="$old1"
+ old1="$i"
+done
+])
+
+dnl ---------------------------------------------------------------------
+dnl
+dnl ... the lowercase variant for the host ...
+dnl
+AC_DEFUN([AC_CREATE_TARGET_HOST_LOWER],
+[AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
+AC_REQUIRE([AC_CREATE_TARGET_H_FILE])
+changequote({, })dnl
+ac_need_target_h_file=`echo ifelse($1, , target.h, $1)`
+ac_need_target_h_prefix=`echo ifelse($2, , host, $2) | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:' -e 's:[^a-z0-9_]::g'`
+#
+host_os0=`echo "$host_os" | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ.-:abcdefghijklmnopqrstuvwxyz__:' -e 's:[^a-z0-9_]::g'`
+host_os1=`echo "$host_os0" | sed -e 's:\([^0-9]*\).*:\1:' `
+host_os2=`echo "$host_os0" | sed -e 's:\([^_]*\).*:\1:' `
+host_os3=`echo "$host_os2" | sed -e 's:\([^0-9]*\).*:\1:' `
+#
+host_cpu0=`echo "$host_cpu" | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ.-:abcdefghijklmnopqrstuvwxyz__:' -e 's:[^a-z0-9_]::g'`
+host_cpu1=`echo "$host_cpu0" | sed -e 's:\([^0-9]*\).*:\1:' `
+host_cpu2=`echo "$host_cpu0" | sed -e 's:\([^_]*\).*:\1:' `
+host_cpu3=`echo "$host_cpu2" | sed -e 's:\([^0-9]*\).*:\1:' `
+#
+host_cpu_arch0=`echo "$host_cpu_arch" | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ:abcdefghijklmnopqrstuvwxyz:'`
+#
+changequote([, ])dnl
+#
+if $ac_need_target_h_file_new ; then
+AC_MSG_RESULT(creating $ac_need_target_h_file - canonical system defines)
+echo /'*' automatically generated by $PACKAGE configure '*'/ >$ac_need_target_h_file
+echo /'*' on `date` '*'/ >>$ac_need_target_h_file
+ac_need_target_h_file_new=false
+fi
+echo /'*' host lowercase defines '*'/ >>$ac_need_target_h_file
+dnl
+old1=""
+old2=""
+for i in $host_os0 $host_os1 $host_os2 $host_os3 "_";
+do
+ if test "$old1" != "$i"; then
+ if test "$old2" != "$i"; then
+ echo " " >>$ac_need_target_h_file
+ echo "#ifndef __"$ac_need_target_h_prefix"_os_"$i >>$ac_need_target_h_file
+ echo "#define __"$ac_need_target_h_prefix"_os_"$i '"'"$host_os"'"' >>$ac_need_target_h_file
+ echo "#endif" >>$ac_need_target_h_file
+ fi
+ fi
+ old2="$old1"
+ old1="$i"
+done
+#
+old1=""
+old2=""
+for i in $host_cpu0 $host_cpu1 $host_cpu2 $host_cpu3 "_"
+do
+ if test "$old1" != "$i"; then
+ if test "$old2" != "$i"; then
+ echo " " >>$ac_need_target_h_file
+ echo "#ifndef __"$ac_need_target_h_prefix"_cpu_"$i >>$ac_need_target_h_file
+ echo "#define __"$ac_need_target_h_prefix"_cpu_"$i '"'"$host_cpu"'"' >>$ac_need_target_h_file
+ echo "#endif" >>$ac_need_target_h_file
+ fi
+ fi
+ old2="$old1"
+ old1="$i"
+done
+#
+old1=""
+old2=""
+for i in $host_cpu_arch0 "_"
+do
+ if test "$old1" != "$i"; then
+ if test "$old2" != "$i"; then
+ echo " " >>$ac_need_target_h_file
+ echo "#ifndef __"$ac_need_target_h_prefix"_arch_"$i >>$ac_need_target_h_file
+ echo "#define __"$ac_need_target_h_prefix"_arch_"$i '"'"$host_cpu_arch"'"' >>$ac_need_target_h_file
+ echo "#endif" >>$ac_need_target_h_file
+ fi
+ fi
+ old2="$old1"
+ old1="$i"
+done
+])
+
+dnl -------------------------------------------------------------------
+
+dnl
+dnl the instruction set architecture (ISA) has evolved for a small set
+dnl of cpu types. So they often have specific names, e.g. sparclite,
+dnl yet they share quite a few similarities. This macro will set the
+dnl shell-var $target_cpu_arch to the basic type. Note that these
+dnl names are often in conflict with their original 32-bit type name
+dnl of these processors, just use them for directory-handling or add
+dnl a prefix/suffix to distinguish them from $target_cpu
+dnl
+dnl this macros has been invented since config.guess is sometimes
+dnl too specific about the cpu-type. I chose the names along the lines
+dnl of linux/arch/ which is modelled after widespread arch-naming, IMHO.
+dnl
+AC_DEFUN([AC_CANONICAL_CPU_ARCH],
+[AC_REQUIRE([AC_CANONICAL_SYSTEM])
+target_cpu_arch="unknown"
+case $target_cpu in
+ i386*|i486*|i586*|i686*|i786*) target_cpu_arch=i386 ;;
+ power*) target_cpu_arch=ppc ;;
+ arm*) target_cpu_arch=arm ;;
+ sparc64*) target_cpu_arch=sparc64 ;;
+ sparc*) target_cpu_arch=sparc ;;
+ mips64*) target_cpu_arch=mips64 ;;
+ mips*) target_cpu_arch=mips ;;
+ alpha*) target_cpu_arch=alpha ;;
+ hppa1*) target_cpu_arch=hppa1 ;;
+ hppa2*) target_cpu_arch=hppa2 ;;
+ arm*) target_cpu_arch=arm ;;
+ m68???|mcf54??) target_cpu_arch=m68k ;;
+ *) target_cpu_arch="$target_cpu" ;;
+esac
+
+host_cpu_arch="unknown"
+case $host_cpu in
+ i386*|i486*|i586*|i686*|i786*) host_cpu_arch=i386 ;;
+ power*) host_cpu_arch=ppc ;;
+ arm*) host_cpu_arch=arm ;;
+ sparc64*) host_cpu_arch=sparc64 ;;
+ sparc*) host_cpu_arch=sparc ;;
+ mips64*) host_cpu_arch=mips64 ;;
+ mips*) host_cpu_arch=mips ;;
+ alpha*) host_cpu_arch=alpha ;;
+ hppa1*) host_cpu_arch=hppa1 ;;
+ hppa2*) host_cpu_arch=hppa2 ;;
+ arm*) host_cpu_arch=arm ;;
+ m68???|mcf54??) host_cpu_arch=m68k ;;
+ *) host_cpu_arch="$target_cpu" ;;
+esac
+])
diff --git a/m4/ac_cxx_bool.m4 b/m4/ac_cxx_bool.m4
new file mode 100644
index 0000000..d1f734d
--- /dev/null
+++ b/m4/ac_cxx_bool.m4
@@ -0,0 +1,41 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_bool.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_BOOL
+#
+# DESCRIPTION
+#
+# If the compiler recognizes bool as a separate built-in type, define
+# HAVE_BOOL. Note that a typedef is not a separate type since you cannot
+# overload a function such that it accepts either the basic type or the
+# typedef.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_BOOL],
+[AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type,
+ac_cv_cxx_bool,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+int f(int x){return 1;}
+int f(char x){return 1;}
+int f(bool x){return 1;}
+],[bool b = true; return f(b);],
+ ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_bool" = yes; then
+ AC_DEFINE(HAVE_BOOL,,[define if bool is a built-in type])
+fi
+])
diff --git a/m4/ac_cxx_compile_stdcxx_0x.m4 b/m4/ac_cxx_compile_stdcxx_0x.m4
new file mode 100644
index 0000000..ada4172
--- /dev/null
+++ b/m4/ac_cxx_compile_stdcxx_0x.m4
@@ -0,0 +1,103 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_compile_stdcxx_0x.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_COMPILE_STDCXX_0X
+#
+# DESCRIPTION
+#
+# Check for baseline language coverage in the compiler for the C++0x
+# standard.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_COMPILE_STDCXX_0X], [
+ AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
+ ac_cv_cxx_compile_cxx0x_native,
+ [AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ typedef check<check<bool>> right_angle_brackets;
+
+ int a;
+ decltype(a) b;
+
+ typedef check<int> check_type;
+ check_type c;
+ check_type&& cr = c;],,
+ ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no)
+ AC_LANG_RESTORE
+ ])
+
+ AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
+ ac_cv_cxx_compile_cxx0x_cxx,
+ [AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -std=c++0x"
+ AC_TRY_COMPILE([
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ typedef check<check<bool>> right_angle_brackets;
+
+ int a;
+ decltype(a) b;
+
+ typedef check<int> check_type;
+ check_type c;
+ check_type&& cr = c;],,
+ ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no)
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+ ])
+
+ AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
+ ac_cv_cxx_compile_cxx0x_gxx,
+ [AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+ AC_TRY_COMPILE([
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ typedef check<check<bool>> right_angle_brackets;
+
+ int a;
+ decltype(a) b;
+
+ typedef check<int> check_type;
+ check_type c;
+ check_type&& cr = c;],,
+ ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no)
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+ ])
+
+ if test "$ac_cv_cxx_compile_cxx0x_native" = yes ||
+ test "$ac_cv_cxx_compile_cxx0x_cxx" = yes ||
+ test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then
+ AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])
+ fi
+])
diff --git a/m4/ac_cxx_compiler_vendor.m4 b/m4/ac_cxx_compiler_vendor.m4
new file mode 100644
index 0000000..9716697
--- /dev/null
+++ b/m4/ac_cxx_compiler_vendor.m4
@@ -0,0 +1,65 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_compiler_vendor.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_COMPILER_VENDOR(VENDOR-NAME, [NICKNAME])
+#
+# DESCRIPTION
+#
+# Set VENDOR-NAME to the lower-case name of the compiler vendor or
+# `unknown' if the compiler's vendor is unknown. `compaq' means the CXX
+# compiler as available on Tru64/OSF1/Digital Unix on Alpha machines. If
+# NICKNAME is provided, set it to the compiler's usual name (eg. `g++',
+# `cxx', `aCC', etc.).
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ludovic Courtès <ludo@chbouib.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_COMPILER_VENDOR],
+ [AC_REQUIRE([AC_PROG_CXX])
+ AC_REQUIRE([AC_PROG_CXXCPP])
+ AC_CACHE_CHECK([the C++ compiler vendor],
+ [ac_cv_cxx_compiler_vendor],
+
+ [AC_LANG_PUSH([C++])
+
+ dnl GNU C++
+ _AC_C_IFDEF([__GNUG__],
+ [ac_cv_cxx_compiler_vendor=gnu],
+ [_AC_C_IFDEF([__DECCXX],
+ [ac_cv_cxx_compiler_vendor=compaq],
+ [dnl HP's aCC
+ _AC_C_IFDEF([__HP_aCC],
+ [ac_cv_cxx_compiler_vendor=hp],
+ [dnl SGI CC
+ _AC_C_IFDEF([__sgi],
+ [ac_cv_cxx_compiler_vendor=sgi],
+ [dnl Note: We are using the C compiler because VC++ doesn't
+ dnl recognize `.cc'(which is used by `configure') as a C++ file
+ dnl extension and requires `/TP' to be passed.
+ AC_LANG_PUSH([C])
+ _AC_C_IFDEF([_MSC_VER],
+ [ac_cv_cxx_compiler_vendor=microsoft],
+ [ac_cv_cxx_compiler_vendor=unknown])
+ AC_LANG_POP()])])])])
+
+ AC_LANG_POP()])
+ $1="$ac_cv_cxx_compiler_vendor"
+
+ dnl The compiler nickname
+ ifelse([$2], , [],
+ [case "$ac_cv_cxx_compiler_vendor" in
+ gnu) $2=g++;;
+ compaq) $2=cxx;;
+ hp) $2=aCC;;
+ sgi) $2=CC;;
+ microsoft) $2=cl;;
+ *) $2=unknown;;
+ esac])])dnl
diff --git a/m4/ac_cxx_complex_math_in_namespace_std.m4 b/m4/ac_cxx_complex_math_in_namespace_std.m4
new file mode 100644
index 0000000..e3d8bfd
--- /dev/null
+++ b/m4/ac_cxx_complex_math_in_namespace_std.m4
@@ -0,0 +1,42 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_complex_math_in_namespace_std.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_COMPLEX_MATH_IN_NAMESPACE_STD
+#
+# DESCRIPTION
+#
+# If the C math functions are in the cmath header file and std::
+# namespace, define HAVE_MATH_FN_IN_NAMESPACE_STD.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_COMPLEX_MATH_IN_NAMESPACE_STD],
+[AC_CACHE_CHECK(whether complex math functions are in std::,
+ac_cv_cxx_complex_math_in_namespace_std,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <complex>
+namespace S { using namespace std;
+ complex<float> pow(complex<float> x, complex<float> y)
+ { return std::pow(x,y); }
+ };
+],[using namespace S; complex<float> x = 1.0, y = 1.0; S::pow(x,y); return 0;],
+ ac_cv_cxx_complex_math_in_namespace_std=yes, ac_cv_cxx_complex_math_in_namespace_std=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_complex_math_in_namespace_std" = yes; then
+ AC_DEFINE(HAVE_COMPLEX_MATH_IN_NAMESPACE_STD,,
+ [define if complex math functions are in std::])
+fi
+])
diff --git a/m4/ac_cxx_const_cast.m4 b/m4/ac_cxx_const_cast.m4
new file mode 100644
index 0000000..aaa087a
--- /dev/null
+++ b/m4/ac_cxx_const_cast.m4
@@ -0,0 +1,34 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_const_cast.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_CONST_CAST
+#
+# DESCRIPTION
+#
+# If the compiler supports const_cast<>, define HAVE_CONST_CAST.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_CONST_CAST],
+[AC_CACHE_CHECK(whether the compiler supports const_cast<>,
+ac_cv_cxx_const_cast,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE(,[int x = 0;const int& y = x;int& z = const_cast<int&>(y);return z;],
+ ac_cv_cxx_const_cast=yes, ac_cv_cxx_const_cast=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_const_cast" = yes; then
+ AC_DEFINE(HAVE_CONST_CAST,,[define if the compiler supports const_cast<>])
+fi
+])
diff --git a/m4/ac_cxx_cppflags_std_lang.m4 b/m4/ac_cxx_cppflags_std_lang.m4
new file mode 100644
index 0000000..a3f8d84
--- /dev/null
+++ b/m4/ac_cxx_cppflags_std_lang.m4
@@ -0,0 +1,36 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_cppflags_std_lang.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_CPPFLAGS_STD_LANG(CPP-FLAGS)
+#
+# DESCRIPTION
+#
+# Append to CPP-FLAGS the set of flags that should be passed to the C++
+# preprocessor in order to enable use of C++ features as defined in the
+# ANSI C++ standard (eg. use of standard iostream classes in the `std'
+# namespace, etc.).
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ludovic Courtès <ludo@chbouib.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_CPPFLAGS_STD_LANG],
+ [AC_REQUIRE([AC_CXX_COMPILER_VENDOR])
+ case "$ac_cv_cxx_compiler_vendor" in
+ compaq)
+ # By default, Compaq CXX has an iostream classes implementation
+ # that is _not_ in the `std' namespace.
+ $1="$$1 -D__USE_STD_IOSTREAM=1";;
+ hp)
+ # When `configure' looks for a C++ header (eg. <iostream>) it invokes
+ # `aCC -E $CPPFLAGS'. However, including standard C++ headers like
+ # <iostream> fails if `-AA' is not supplied.
+ $1="$$1 -AA";;
+ esac])
diff --git a/m4/ac_cxx_cxxflags_std_lang.m4 b/m4/ac_cxx_cxxflags_std_lang.m4
new file mode 100644
index 0000000..562f4c5
--- /dev/null
+++ b/m4/ac_cxx_cxxflags_std_lang.m4
@@ -0,0 +1,31 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_cxxflags_std_lang.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_CXXFLAGS_STD_LANG(CXX-FLAGS)
+#
+# DESCRIPTION
+#
+# Append to variable CXX-FLAGS the set of compile-time flags that should
+# be passed to the C++ compiler in order to enable use of C++ features as
+# defined in the ANSI C++ standard (eg. use of standard iostream classes
+# in the `std' namespace, etc.). Note that if you use GNU Libtool you may
+# need to prefix each of those flags with `-Xcompiler' so that Libtool
+# doesn't discard them (see Libtool's manual and `AC_LIBTOOLIZE_CFLAGS').
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ludovic Courtès <ludo@chbouib.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_CXXFLAGS_STD_LANG],
+ [AC_REQUIRE([AC_CXX_COMPILER_VENDOR])
+ case "$ac_cv_cxx_compiler_vendor" in
+ sgi) $1="$$1 -LANG:std -exceptions";;
+ hp) $1="$$1 -AA";;
+ esac])
diff --git a/m4/ac_cxx_default_template_parameters.m4 b/m4/ac_cxx_default_template_parameters.m4
new file mode 100644
index 0000000..43168f1
--- /dev/null
+++ b/m4/ac_cxx_default_template_parameters.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_default_template_parameters.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_DEFAULT_TEMPLATE_PARAMETERS
+#
+# DESCRIPTION
+#
+# If the compiler supports default template parameters, define
+# HAVE_DEFAULT_TEMPLATE_PARAMETERS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_DEFAULT_TEMPLATE_PARAMETERS],
+[AC_CACHE_CHECK(whether the compiler supports default template parameters,
+ac_cv_cxx_default_template_parameters,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+template<class T = double, int N = 10> class A {public: int f() {return 0;}};
+],[A<float> a; return a.f();],
+ ac_cv_cxx_default_template_parameters=yes, ac_cv_cxx_default_template_parameters=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_default_template_parameters" = yes; then
+ AC_DEFINE(HAVE_DEFAULT_TEMPLATE_PARAMETERS,,
+ [define if the compiler supports default template parameters])
+fi
+])
diff --git a/m4/ac_cxx_dtor_after_atexit.m4 b/m4/ac_cxx_dtor_after_atexit.m4
new file mode 100644
index 0000000..b8e0078
--- /dev/null
+++ b/m4/ac_cxx_dtor_after_atexit.m4
@@ -0,0 +1,54 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_dtor_after_atexit.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_DTOR_AFTER_ATEXIT
+#
+# DESCRIPTION
+#
+# If the C++ compiler calls global destructors after atexit functions,
+# define HAVE_DTOR_AFTER_ATEXIT. WARNING: If cross-compiling, the test
+# cannot be performed, the default action is to define
+# HAVE_DTOR_AFTER_ATEXIT.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_DTOR_AFTER_ATEXIT],
+[AC_CACHE_CHECK(whether the compiler calls global destructors after functions registered through atexit,
+ac_cv_cxx_dtor_after_atexit,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_RUN([
+#include <unistd.h>
+#include <stdlib.h>
+
+static int dtor_called = 0;
+class A { public : ~A () { dtor_called = 1; } };
+static A a;
+
+void f() { _exit(dtor_called); }
+
+int main (int , char **)
+{
+ atexit (f);
+ return 0;
+}
+],
+ ac_cv_cxx_dtor_after_atexit=yes, ac_cv_cxx_dtor_after_atexit=yes=no,
+ ac_cv_cxx_dtor_after_atexit=yes)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_dtor_after_atexit" = yes; then
+ AC_DEFINE(HAVE_DTOR_AFTER_ATEXIT,,
+ [define if the compiler calls global destructors after functions registered through atexit])
+fi
+])
diff --git a/m4/ac_cxx_dynamic_cast.m4 b/m4/ac_cxx_dynamic_cast.m4
new file mode 100644
index 0000000..6b4d3b3
--- /dev/null
+++ b/m4/ac_cxx_dynamic_cast.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_dynamic_cast.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_DYNAMIC_CAST
+#
+# DESCRIPTION
+#
+# If the compiler supports dynamic_cast<>, define HAVE_DYNAMIC_CAST.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_DYNAMIC_CAST],
+[AC_CACHE_CHECK(whether the compiler supports dynamic_cast<>,
+ac_cv_cxx_dynamic_cast,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <typeinfo>
+class Base { public : Base () {} virtual void f () = 0;};
+class Derived : public Base { public : Derived () {} virtual void f () {} };],[
+Derived d; Base& b=d; return dynamic_cast<Derived*>(&b) ? 0 : 1;],
+ ac_cv_cxx_dynamic_cast=yes, ac_cv_cxx_dynamic_cast=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_dynamic_cast" = yes; then
+ AC_DEFINE(HAVE_DYNAMIC_CAST,,[define if the compiler supports dynamic_cast<>])
+fi
+])
diff --git a/m4/ac_cxx_enum_computations.m4 b/m4/ac_cxx_enum_computations.m4
new file mode 100644
index 0000000..edc102f
--- /dev/null
+++ b/m4/ac_cxx_enum_computations.m4
@@ -0,0 +1,47 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_enum_computations.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_ENUM_COMPUTATIONS
+#
+# DESCRIPTION
+#
+# If the compiler handle computations inside an enum, define
+# HAVE_ENUM_COMPUTATIONS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_ENUM_COMPUTATIONS],
+[AC_CACHE_CHECK(whether the compiler handle computations inside an enum,
+ac_cv_cxx_enum_computations,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+struct A { enum { a = 5, b = 7, c = 2 }; };
+struct B { enum { a = 1, b = 6, c = 9 }; };
+template<class T1, class T2> struct Z
+{ enum { a = (T1::a > T2::a) ? T1::a : T2::b,
+ b = T1::b + T2::b,
+ c = (T1::c * T2::c + T2::a + T1::a)
+ };
+};],[
+return (((int)Z<A,B>::a == 5)
+ && ((int)Z<A,B>::b == 13)
+ && ((int)Z<A,B>::c == 24)) ? 0 : 1;],
+ ac_cv_cxx_enum_computations=yes, ac_cv_cxx_enum_computations=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_enum_computations" = yes; then
+ AC_DEFINE(HAVE_ENUM_COMPUTATIONS,,
+ [define if the compiler handle computations inside an enum])
+fi
+])
diff --git a/m4/ac_cxx_enum_computations_with_cast.m4 b/m4/ac_cxx_enum_computations_with_cast.m4
new file mode 100644
index 0000000..8694a65
--- /dev/null
+++ b/m4/ac_cxx_enum_computations_with_cast.m4
@@ -0,0 +1,47 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_enum_computations_with_cast.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_ENUM_COMPUTATIONS_WITH_CAST
+#
+# DESCRIPTION
+#
+# If the compiler handle (int) casts in enum computations, define
+# HAVE_ENUM_COMPUTATIONS_WITH_CAST.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_ENUM_COMPUTATIONS_WITH_CAST],
+[AC_CACHE_CHECK(whether the compiler handles (int) casts in enum computations,
+ac_cv_cxx_enum_computations_with_cast,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+struct A { enum { a = 5, b = 7, c = 2 }; };
+struct B { enum { a = 1, b = 6, c = 9 }; };
+template<class T1, class T2> struct Z
+{ enum { a = ((int)T1::a > (int)T2::a) ? (int)T1::a : (int)T2::b,
+ b = (int)T1::b + (int)T2::b,
+ c = ((int)T1::c * (int)T2::c + (int)T2::a + (int)T1::a)
+ };
+};],[
+return (((int)Z<A,B>::a == 5)
+ && ((int)Z<A,B>::b == 13)
+ && ((int)Z<A,B>::c == 24)) ? 0 : 1;],
+ ac_cv_cxx_enum_computations_with_cast=yes, ac_cv_cxx_enum_computations_with_cast=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_enum_computations_with_cast" = yes; then
+ AC_DEFINE(HAVE_ENUM_COMPUTATIONS_WITH_CAST,,
+ [define if the compiler handles (int) casts in enum computations])
+fi
+])
diff --git a/m4/ac_cxx_exceptions.m4 b/m4/ac_cxx_exceptions.m4
new file mode 100644
index 0000000..d5c5ebf
--- /dev/null
+++ b/m4/ac_cxx_exceptions.m4
@@ -0,0 +1,35 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_exceptions.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_EXCEPTIONS
+#
+# DESCRIPTION
+#
+# If the C++ compiler supports exceptions handling (try, throw and catch),
+# define HAVE_EXCEPTIONS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_EXCEPTIONS],
+[AC_CACHE_CHECK(whether the compiler supports exceptions,
+ac_cv_cxx_exceptions,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE(,[try { throw 1; } catch (int i) { return i; }],
+ ac_cv_cxx_exceptions=yes, ac_cv_cxx_exceptions=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_exceptions" = yes; then
+ AC_DEFINE(HAVE_EXCEPTIONS,,[define if the compiler supports exceptions])
+fi
+])
diff --git a/m4/ac_cxx_explicit.m4 b/m4/ac_cxx_explicit.m4
new file mode 100644
index 0000000..68eb520
--- /dev/null
+++ b/m4/ac_cxx_explicit.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_explicit.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_EXPLICIT
+#
+# DESCRIPTION
+#
+# If the compiler can be asked to prevent using implicitly one argument
+# constructors as converting constructors with the explicit keyword,
+# define HAVE_EXPLICIT.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_EXPLICIT],
+[AC_CACHE_CHECK(whether the compiler supports the explicit keyword,
+ac_cv_cxx_explicit,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([class A{public:explicit A(double){}};],
+[double c = 5.0;A x(c);return 0;],
+ ac_cv_cxx_explicit=yes, ac_cv_cxx_explicit=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_explicit" = yes; then
+ AC_DEFINE(HAVE_EXPLICIT,,[define if the compiler supports the explicit keyword])
+fi
+])
diff --git a/m4/ac_cxx_explicit_instantiations.m4 b/m4/ac_cxx_explicit_instantiations.m4
new file mode 100644
index 0000000..7e5a4b4
--- /dev/null
+++ b/m4/ac_cxx_explicit_instantiations.m4
@@ -0,0 +1,36 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_explicit_instantiations.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_EXPLICIT_INSTANTIATIONS
+#
+# DESCRIPTION
+#
+# If the C++ compiler supports explicit instanciations syntax, define
+# HAVE_INSTANTIATIONS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_EXPLICIT_INSTANTIATIONS],
+[AC_CACHE_CHECK(whether the compiler supports explicit instantiations,
+ac_cv_cxx_explinst,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([template <class T> class A { T t; }; template class A<int>;],
+ [], ac_cv_cxx_explinst=yes, ac_cv_cxx_explinst=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_explinst" = yes; then
+ AC_DEFINE(HAVE_INSTANTIATIONS,,
+ [define if the compiler supports explicit instantiations])
+fi
+])
diff --git a/m4/ac_cxx_explicit_template_function_qualification.m4 b/m4/ac_cxx_explicit_template_function_qualification.m4
new file mode 100644
index 0000000..cbf4b7d
--- /dev/null
+++ b/m4/ac_cxx_explicit_template_function_qualification.m4
@@ -0,0 +1,39 @@
+# ======================================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_explicit_template_function_qualification.html
+# ======================================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_EXPLICIT_TEMPLATE_FUNCTION_QUALIFICATION
+#
+# DESCRIPTION
+#
+# If the compiler supports explicit template function qualification,
+# define HAVE_EXPLICIT_TEMPLATE_FUNCTION_QUALIFICATION.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_EXPLICIT_TEMPLATE_FUNCTION_QUALIFICATION],
+[AC_CACHE_CHECK(whether the compiler supports explicit template function qualification,
+ac_cv_cxx_explicit_template_function_qualification,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+template<class Z> class A { public : A() {} };
+template<class X, class Y> A<X> to (const A<Y>&) { return A<X>(); }
+],[A<float> x; A<double> y = to<double>(x); return 0;],
+ ac_cv_cxx_explicit_template_function_qualification=yes, ac_cv_cxx_explicit_template_function_qualification=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_explicit_template_function_qualification" = yes; then
+ AC_DEFINE(HAVE_EXPLICIT_TEMPLATE_FUNCTION_QUALIFICATION,,
+ [define if the compiler supports explicit template function qualification])
+fi
+])
diff --git a/m4/ac_cxx_extern_template.m4 b/m4/ac_cxx_extern_template.m4
new file mode 100644
index 0000000..89a631c
--- /dev/null
+++ b/m4/ac_cxx_extern_template.m4
@@ -0,0 +1,34 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_extern_template.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_EXTERN_TEMPLATE
+#
+# DESCRIPTION
+#
+# Test whether the C++ compiler supports "extern template".
+#
+# LICENSE
+#
+# Copyright (c) 2008 Patrick Mauritz <oxygene@studentenbude.ath.cx>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_EXTERN_TEMPLATE],[
+AC_CACHE_CHECK(whether the compiler supports extern template,
+ac_cv_cxx_extern_template,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([template <typename T> void foo(T); extern template void foo<int>(int);],
+ [],
+ ac_cv_cxx_extern_template=yes, ac_cv_cxx_extern_template=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_extern_template" = yes; then
+ AC_DEFINE(HAVE_EXTERN_TEMPLATE,,[define if the compiler supports extern template])
+fi
+])
diff --git a/m4/ac_cxx_full_specialization_syntax.m4 b/m4/ac_cxx_full_specialization_syntax.m4
new file mode 100644
index 0000000..79f27b6
--- /dev/null
+++ b/m4/ac_cxx_full_specialization_syntax.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_full_specialization_syntax.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_FULL_SPECIALIZATION_SYNTAX
+#
+# DESCRIPTION
+#
+# If the compiler recognizes the full specialization syntax, define
+# HAVE_FULL_SPECIALIZATION_SYNTAX.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_FULL_SPECIALIZATION_SYNTAX],
+[AC_CACHE_CHECK(whether the compiler recognizes the full specialization syntax,
+ac_cv_cxx_full_specialization_syntax,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+template<class T> class A { public : int f () const { return 1; } };
+template<> class A<float> { public: int f () const { return 0; } };],[
+A<float> a; return a.f();],
+ ac_cv_cxx_full_specialization_syntax=yes, ac_cv_cxx_full_specialization_syntax=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_full_specialization_syntax" = yes; then
+ AC_DEFINE(HAVE_FULL_SPECIALIZATION_SYNTAX,,
+ [define if the compiler recognizes the full specialization syntax])
+fi
+])
diff --git a/m4/ac_cxx_function_nontype_parameters.m4 b/m4/ac_cxx_function_nontype_parameters.m4
new file mode 100644
index 0000000..3bc14aa
--- /dev/null
+++ b/m4/ac_cxx_function_nontype_parameters.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_function_nontype_parameters.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_FUNCTION_NONTYPE_PARAMETERS
+#
+# DESCRIPTION
+#
+# If the compiler supports function templates with non-type parameters,
+# define HAVE_FUNCTION_NONTYPE_PARAMETERS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_FUNCTION_NONTYPE_PARAMETERS],
+[AC_CACHE_CHECK(whether the compiler supports function templates with non-type parameters,
+ac_cv_cxx_function_nontype_parameters,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+template<class T, int N> class A {};
+template<class T, int N> int f(const A<T,N>& x) { return 0; }
+],[A<double, 17> z; return f(z);],
+ ac_cv_cxx_function_nontype_parameters=yes, ac_cv_cxx_function_nontype_parameters=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_function_nontype_parameters" = yes; then
+ AC_DEFINE(HAVE_FUNCTION_NONTYPE_PARAMETERS,,
+ [define if the compiler supports function templates with non-type parameters])
+fi
+])
diff --git a/m4/ac_cxx_gnucxx_hashmap.m4 b/m4/ac_cxx_gnucxx_hashmap.m4
new file mode 100644
index 0000000..4bcc1d4
--- /dev/null
+++ b/m4/ac_cxx_gnucxx_hashmap.m4
@@ -0,0 +1,35 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_gnucxx_hashmap.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_GNUCXX_HASHMAP
+#
+# DESCRIPTION
+#
+# Test for the presence of GCC's hashmap STL extension.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Patrick Mauritz <oxygene@studentenbude.ath.cx>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_GNUCXX_HASHMAP],[
+AC_CACHE_CHECK(whether the compiler supports __gnu_cxx::hash_map,
+ac_cv_cxx_gnucxx_hashmap,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <ext/hash_map>
+using __gnu_cxx::hash_map;],
+ [],
+ ac_cv_cxx_gnucxx_hashmap=yes, ac_cv_cxx_gnucxx_hashmap=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_gnucxx_hashmap" = yes; then
+ AC_DEFINE(HAVE_GNUCXX_HASHMAP,,[define if the compiler supports __gnu_cxx::hash_map])
+fi
+])
diff --git a/m4/ac_cxx_have_complex.m4 b/m4/ac_cxx_have_complex.m4
new file mode 100644
index 0000000..c386dd6
--- /dev/null
+++ b/m4/ac_cxx_have_complex.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_complex.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_COMPLEX
+#
+# DESCRIPTION
+#
+# If the compiler has complex<T>, define HAVE_COMPLEX.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HAVE_COMPLEX],
+[AC_CACHE_CHECK(whether the compiler has complex<T>,
+ac_cv_cxx_have_complex,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <complex>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[complex<float> a; complex<double> b; return 0;],
+ ac_cv_cxx_have_complex=yes, ac_cv_cxx_have_complex=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_complex" = yes; then
+ AC_DEFINE(HAVE_COMPLEX,,[define if the compiler has complex<T>])
+fi
+])
diff --git a/m4/ac_cxx_have_complex_math1.m4 b/m4/ac_cxx_have_complex_math1.m4
new file mode 100644
index 0000000..9c0c487
--- /dev/null
+++ b/m4/ac_cxx_have_complex_math1.m4
@@ -0,0 +1,45 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_complex_math1.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_COMPLEX_MATH1
+#
+# DESCRIPTION
+#
+# If the compiler has the complex math functions cos, cosh, exp, log, pow,
+# sin, sinh, sqrt, tan and tanh, define HAVE_COMPLEX_MATH1.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HAVE_COMPLEX_MATH1],
+[AC_CACHE_CHECK(whether the compiler has complex math functions,
+ac_cv_cxx_have_complex_math1,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([#include <complex>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[complex<double> x(1.0, 1.0), y(1.0, 1.0);
+cos(x); cosh(x); exp(x); log(x); pow(x,1); pow(x,double(2.0));
+pow(x, y); pow(double(2.0), x); sin(x); sinh(x); sqrt(x); tan(x); tanh(x);
+return 0;],
+ ac_cv_cxx_have_complex_math1=yes, ac_cv_cxx_have_complex_math1=no)
+ LIBS="$ac_save_LIBS"
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_complex_math1" = yes; then
+ AC_DEFINE(HAVE_COMPLEX_MATH1,,[define if the compiler has complex math functions])
+fi
+])
diff --git a/m4/ac_cxx_have_complex_math2.m4 b/m4/ac_cxx_have_complex_math2.m4
new file mode 100644
index 0000000..977ce89
--- /dev/null
+++ b/m4/ac_cxx_have_complex_math2.m4
@@ -0,0 +1,44 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_complex_math2.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_COMPLEX_MATH2
+#
+# DESCRIPTION
+#
+# If the compiler has the complex math functions acos, asin, atan, atan2
+# and log10, define HAVE_COMPLEX_MATH2.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HAVE_COMPLEX_MATH2],
+[AC_CACHE_CHECK(whether the compiler has more complex math functions,
+ac_cv_cxx_have_complex_math2,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([#include <complex>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[complex<double> x(1.0, 1.0), y(1.0, 1.0);
+acos(x); asin(x); atan(x); atan2(x,y); atan2(x, double(3.0));
+atan2(double(3.0), x); log10(x); return 0;],
+ ac_cv_cxx_have_complex_math2=yes, ac_cv_cxx_have_complex_math2=no)
+ LIBS="$ac_save_LIBS"
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_complex_math2" = yes; then
+ AC_DEFINE(HAVE_COMPLEX_MATH2,,[define if the compiler has more complex math functions])
+fi
+])
diff --git a/m4/ac_cxx_have_empty_iostream.m4 b/m4/ac_cxx_have_empty_iostream.m4
new file mode 100644
index 0000000..acc10e2
--- /dev/null
+++ b/m4/ac_cxx_have_empty_iostream.m4
@@ -0,0 +1,61 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_empty_iostream.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_EMPTY_IOSTREAM
+#
+# DESCRIPTION
+#
+# Check if the compiler allow the empty iostream constructor. Ok before
+# gcc3, not after.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Alain BARBET <alian@cpan.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CXX_HAVE_EMPTY_IOSTREAM],
+[AC_CACHE_CHECK(whether the compiler allow empty iostream,
+ac_cv_cxx_have_empty_iostream,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <iostream>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[iostream iostr; return 0;],
+ ac_cv_cxx_have_empty_iostream=yes, ac_cv_cxx_have_empty_iostream=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_empty_iostream" = yes; then
+ AC_DEFINE(HAVE_EMPTY_IOSTREAM,,[define if the compiler allow empty
+iostream])
+fi
+])
diff --git a/m4/ac_cxx_have_ext_hash_map.m4 b/m4/ac_cxx_have_ext_hash_map.m4
new file mode 100644
index 0000000..953668f
--- /dev/null
+++ b/m4/ac_cxx_have_ext_hash_map.m4
@@ -0,0 +1,72 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_ext_hash_map.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_EXT_HASH_MAP
+#
+# DESCRIPTION
+#
+# Check if the compiler has ext/hash_map Eg:
+#
+# #if defined(HAVE_EXT_HASH_MAP)
+# #include <ext/hash_map>
+# #else
+# #if defined(HAVE_STL)
+# #include <hash_map>
+# #else
+# # Can't find hash_map header !
+# #endif
+# #endif
+#
+# This file is Alain BARBET's AC_CXX_HAVE_EXT_HASH_SET 1.1 with
+# s/set/map/g :)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Perceval ANICHINI
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CXX_HAVE_EXT_HASH_MAP],
+[AC_CACHE_CHECK(whether the compiler has ext/hash_map,
+ac_cv_cxx_have_ext_hash_map,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <ext/hash_map>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[hash_map<int, int> t; return 0;],
+ ac_cv_cxx_have_ext_hash_map=yes, ac_cv_cxx_have_ext_hash_map=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_ext_hash_map" = yes; then
+ AC_DEFINE(HAVE_EXT_HASH_MAP,,[define if the compiler has ext/hash_map])
+fi
+])
diff --git a/m4/ac_cxx_have_ext_hash_set.m4 b/m4/ac_cxx_have_ext_hash_set.m4
new file mode 100644
index 0000000..175394b
--- /dev/null
+++ b/m4/ac_cxx_have_ext_hash_set.m4
@@ -0,0 +1,69 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_ext_hash_set.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_EXT_HASH_SET
+#
+# DESCRIPTION
+#
+# Check if the compiler has ext/hash_set Eg:
+#
+# #if defined(HAVE_EXT_HASH_SET)
+# #include <ext/hash_set>
+# #else
+# #if defined(HAVE_STL)
+# #include <hash_set>
+# #else
+# # Can't find hash_set header !
+# #endif
+# #endif
+#
+# LICENSE
+#
+# Copyright (c) 2008 Alain BARBET <alian@cpan.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CXX_HAVE_EXT_HASH_SET],
+[AC_CACHE_CHECK(whether the compiler has ext/hash_set,
+ac_cv_cxx_have_ext_hash_set,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <ext/hash_set>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[hash_set<int> t; return 0;],
+ ac_cv_cxx_have_ext_hash_set=yes, ac_cv_cxx_have_ext_hash_set=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_ext_hash_set" = yes; then
+ AC_DEFINE(HAVE_EXT_HASH_SET,,[define if the compiler has ext/hash_set])
+fi
+])
diff --git a/m4/ac_cxx_have_ext_slist.m4 b/m4/ac_cxx_have_ext_slist.m4
new file mode 100644
index 0000000..fa86a3b
--- /dev/null
+++ b/m4/ac_cxx_have_ext_slist.m4
@@ -0,0 +1,69 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_ext_slist.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_EXT_SLIST
+#
+# DESCRIPTION
+#
+# Check if the compiler has ext/slist. Eg:
+#
+# #if defined(HAVE_EXT_SLIST)
+# #include <ext/slist>
+# #else
+# #if defined(HAVE_STL)
+# #include <slist>
+# #else
+# # Can't find slist header !
+# #endif
+# #endif
+#
+# LICENSE
+#
+# Copyright (c) 2008 Alain BARBET <alian@cpan.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CXX_HAVE_EXT_SLIST],
+[AC_CACHE_CHECK(whether the compiler has ext/slist,
+ac_cv_cxx_have_ext_slist,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <ext/slist>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[slist<int> s; return 0;],
+ ac_cv_cxx_have_ext_slist=yes, ac_cv_cxx_have_ext_slist=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_ext_slist" = yes; then
+ AC_DEFINE(HAVE_EXT_SLIST,,[define if the compiler has ext/slist])
+fi
+])
diff --git a/m4/ac_cxx_have_freeze_sstream.m4 b/m4/ac_cxx_have_freeze_sstream.m4
new file mode 100644
index 0000000..3fe1bae
--- /dev/null
+++ b/m4/ac_cxx_have_freeze_sstream.m4
@@ -0,0 +1,84 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_freeze_sstream.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_FREEZE_SSTREAM
+#
+# DESCRIPTION
+#
+# Check if the compiler has (need) freeze method call in stringstream/
+# strstream. Seems that Win32 and STLPort have it, libstdc++ not ...
+#
+# Eg:
+#
+# #include <sstream>
+# #ifdef HAVE_NAMESPACES
+# using namespace std;
+# #endif
+# #ifdef HAVE_SSTREAM
+# stringstream message;
+# #else
+# strstream message;
+# #endif
+# message << "Hello";
+# #ifdef HAVE_FREEZE_SSTREAM
+# message.freeze(0);
+# #endif
+#
+# LICENSE
+#
+# Copyright (c) 2008 Alain BARBET <alian@cpan.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CXX_HAVE_FREEZE_SSTREAM],
+[AC_CACHE_CHECK(whether the compiler has freeze in stringstream,
+ac_cv_cxx_have_freeze_sstream,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_REQUIRE([AC_CXX_HAVE_SSTREAM])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <sstream>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],
+[#ifdef HAVE_SSTREAM
+stringstream message;
+#else
+strstream message;
+#endif
+message << "Hello"; message.freeze(0); return 0;],
+ ac_cv_cxx_have_freeze_sstream=yes, ac_cv_cxx_have_freeze_sstream=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_freeze_sstream" = yes; then
+ AC_DEFINE(HAVE_FREEZE_SSTREAM,,[define if the compiler has freeze in
+stringstream])
+fi
+])
diff --git a/m4/ac_cxx_have_ieee_math.m4 b/m4/ac_cxx_have_ieee_math.m4
new file mode 100644
index 0000000..3fc88e5
--- /dev/null
+++ b/m4/ac_cxx_have_ieee_math.m4
@@ -0,0 +1,62 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_ieee_math.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_IEEE_MATH
+#
+# DESCRIPTION
+#
+# If the compiler has the double math functions acosh, asinh, atanh, cbrt,
+# expm1, erf, erfc, isnan, j0, j1, jn, gamma, lgamma, ilogb, logb, log1p,
+# rint, y0, y1, yn, hypot, nextafter, remainder and scalb, define
+# HAVE_IEEE_MATH.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HAVE_IEEE_MATH],
+[AC_CACHE_CHECK(whether the compiler supports IEEE math library,
+ac_cv_cxx_have_ieee_math,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([
+#ifndef _ALL_SOURCE
+ #define _ALL_SOURCE
+#endif
+#ifndef _XOPEN_SOURCE
+ #define _XOPEN_SOURCE
+#endif
+#ifndef _XOPEN_SOURCE_EXTENDED
+ #define _XOPEN_SOURCE_EXTENDED 1
+#endif
+#include <math.h>],[double x = 1.0; double y = 1.0; int i = 1;
+acosh(x); asinh(x); atanh(x); cbrt(x); expm1(x); erf(x); erfc(x); isnan(x);
+j0(x); j1(x); jn(i,x); ilogb(x); logb(x); log1p(x); rint(x);
+y0(x); y1(x); yn(i,x);
+#ifdef _THREAD_SAFE
+gamma_r(x,&i);
+lgamma_r(x,&i);
+#else
+gamma(x);
+lgamma(x);
+#endif
+hypot(x,y); nextafter(x,y); remainder(x,y); scalb(x,y);
+return 0;],
+ ac_cv_cxx_have_ieee_math=yes, ac_cv_cxx_have_ieee_math=no)
+ LIBS="$ac_save_LIBS"
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_ieee_math" = yes; then
+ AC_DEFINE(HAVE_IEEE_MATH,,[define if the compiler supports IEEE math library])
+fi
+])
diff --git a/m4/ac_cxx_have_long_long_for_iostream.m4 b/m4/ac_cxx_have_long_long_for_iostream.m4
new file mode 100644
index 0000000..d577476
--- /dev/null
+++ b/m4/ac_cxx_have_long_long_for_iostream.m4
@@ -0,0 +1,85 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_long_long_for_iostream.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_LONG_LONG_FOR_IOSTREAM
+#
+# DESCRIPTION
+#
+# Check if the compiler allow long long for [i|o]stream Seems that OpenBSD
+# / gcc-3 don't have it.
+#
+# Eg:
+#
+# #include <iostream>
+# #ifdef HAVE_SSTREAM
+# #include <strstream>
+# #else
+# #include <sstream>
+# #endif
+# #ifdef HAVE_NAMESPACES
+# using namespace std;
+# #endif
+# ostream str((streambuf *)0);
+# long long lo=1;
+# str <<
+# #ifdef HAVE_LONG_LONG_FOR_IOSTREAM
+# (long int)
+# #endif
+# lo;
+#
+# LICENSE
+#
+# Copyright (c) 2008 Alain BARBET <alian@cpan.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CXX_HAVE_LONG_LONG_FOR_IOSTREAM],
+[AC_CACHE_CHECK(whether the compiler allow long long for [i|o]stream,
+ac_cv_cxx_have_ll_for_iostream,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_REQUIRE([AC_CXX_HAVE_SSTREAM])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <iostream>
+#ifdef HAVE_SSTREAM
+#include <strstream>
+#else
+#include <sstream>
+#endif
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[ ostream str((streambuf *)0); long long l=1; str << l; return 0;],
+ ac_cv_cxx_have_ll_for_iostream=yes, ac_cv_cxx_have_ll_for_iostream=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_ll_for_iostream" = yes; then
+ AC_DEFINE(HAVE_LONG_LONG_FOR_IOSTREAM,,[define if the compiler allow long long for [i|o]stream])
+fi
+])
diff --git a/m4/ac_cxx_have_numeric_limits.m4 b/m4/ac_cxx_have_numeric_limits.m4
new file mode 100644
index 0000000..bb041e8
--- /dev/null
+++ b/m4/ac_cxx_have_numeric_limits.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_numeric_limits.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_NUMERIC_LIMITS
+#
+# DESCRIPTION
+#
+# If the compiler has numeric_limits<T>, define HAVE_NUMERIC_LIMITS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HAVE_NUMERIC_LIMITS],
+[AC_CACHE_CHECK(whether the compiler has numeric_limits<T>,
+ac_cv_cxx_have_numeric_limits,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <limits>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[double e = numeric_limits<double>::epsilon(); return 0;],
+ ac_cv_cxx_have_numeric_limits=yes, ac_cv_cxx_have_numeric_limits=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_numeric_limits" = yes; then
+ AC_DEFINE(HAVE_NUMERIC_LIMITS,,[define if the compiler has numeric_limits<T>])
+fi
+])
diff --git a/m4/ac_cxx_have_sstream.m4 b/m4/ac_cxx_have_sstream.m4
new file mode 100644
index 0000000..8a9a23a
--- /dev/null
+++ b/m4/ac_cxx_have_sstream.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_sstream.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_SSTREAM
+#
+# DESCRIPTION
+#
+# If the C++ library has a working stringstream, define HAVE_SSTREAM.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ben Stanley <Ben.Stanley@exemail.com.au>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HAVE_SSTREAM],
+[AC_CACHE_CHECK(whether the compiler has stringstream,
+ac_cv_cxx_have_sstream,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <sstream>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[stringstream message; message << "Hello"; return 0;],
+ ac_cv_cxx_have_sstream=yes, ac_cv_cxx_have_sstream=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_sstream" = yes; then
+ AC_DEFINE(HAVE_SSTREAM,,[define if the compiler has stringstream])
+fi
+])
diff --git a/m4/ac_cxx_have_std.m4 b/m4/ac_cxx_have_std.m4
new file mode 100644
index 0000000..106a374
--- /dev/null
+++ b/m4/ac_cxx_have_std.m4
@@ -0,0 +1,42 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_std.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_STD
+#
+# DESCRIPTION
+#
+# If the compiler supports ISO C++ standard library (i.e., can include the
+# files iostream, map, iomanip and cmath}), define HAVE_STD.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HAVE_STD],
+[AC_CACHE_CHECK(whether the compiler supports ISO C++ standard library,
+ac_cv_cxx_have_std,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <iostream>
+#include <map>
+#include <iomanip>
+#include <cmath>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[return 0;],
+ ac_cv_cxx_have_std=yes, ac_cv_cxx_have_std=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_std" = yes; then
+ AC_DEFINE(HAVE_STD,,[define if the compiler supports ISO C++ standard library])
+fi
+])
diff --git a/m4/ac_cxx_have_stl.m4 b/m4/ac_cxx_have_stl.m4
new file mode 100644
index 0000000..441817a
--- /dev/null
+++ b/m4/ac_cxx_have_stl.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_stl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_STL
+#
+# DESCRIPTION
+#
+# If the compiler supports the Standard Template Library, define HAVE_STL.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HAVE_STL],
+[AC_CACHE_CHECK(whether the compiler supports Standard Template Library,
+ac_cv_cxx_have_stl,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <list>
+#include <deque>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[list<int> x; x.push_back(5);
+list<int>::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0;],
+ ac_cv_cxx_have_stl=yes, ac_cv_cxx_have_stl=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_stl" = yes; then
+ AC_DEFINE(HAVE_STL,,[define if the compiler supports Standard Template Library])
+fi
+])
diff --git a/m4/ac_cxx_have_string_push_back.m4 b/m4/ac_cxx_have_string_push_back.m4
new file mode 100644
index 0000000..1adb49e
--- /dev/null
+++ b/m4/ac_cxx_have_string_push_back.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_string_push_back.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_STRING_PUSH_BACK
+#
+# DESCRIPTION
+#
+# If the implementation of the C++ library provides the method
+# std::string::push_back (char), define HAVE_STRING_PUSH_BACK.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Jan Langer <jan@langernetz.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HAVE_STRING_PUSH_BACK],
+[AC_CACHE_CHECK(whether the compiler has std::string::push_back (char),
+ac_cv_cxx_have_string_push_back,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <string>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[string message; message.push_back ('a'); return 0;],
+ ac_cv_cxx_have_string_push_back=yes, ac_cv_cxx_have_string_push_back=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_string_push_back" = yes; then
+ AC_DEFINE(HAVE_STRING_PUSH_BACK,,[define if the compiler has the method
+std::string::push_back (char)])
+fi
+])dnl
diff --git a/m4/ac_cxx_have_system_v_math.m4 b/m4/ac_cxx_have_system_v_math.m4
new file mode 100644
index 0000000..b830408
--- /dev/null
+++ b/m4/ac_cxx_have_system_v_math.m4
@@ -0,0 +1,52 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_system_v_math.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_SYSTEM_V_MATH
+#
+# DESCRIPTION
+#
+# If the compiler has the double math functions _class, trunc, itrunc,
+# nearest, rsqrt, uitrunc, copysign, drem, finite, and unordered, define
+# HAVE_SYSTEM_V_MATH.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HAVE_SYSTEM_V_MATH],
+[AC_CACHE_CHECK(whether the compiler supports System V math library,
+ac_cv_cxx_have_system_v_math,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([
+#ifndef _ALL_SOURCE
+ #define _ALL_SOURCE
+#endif
+#ifndef _XOPEN_SOURCE
+ #define _XOPEN_SOURCE
+#endif
+#ifndef _XOPEN_SOURCE_EXTENDED
+ #define _XOPEN_SOURCE_EXTENDED 1
+#endif
+#include <math.h>],[double x = 1.0; double y = 1.0;
+_class(x); trunc(x); finite(x); itrunc(x); nearest(x); rsqrt(x); uitrunc(x);
+copysign(x,y); drem(x,y); unordered(x,y);
+return 0;],
+ ac_cv_cxx_have_system_v_math=yes, ac_cv_cxx_have_system_v_math=no)
+ LIBS="$ac_save_LIBS"
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_system_v_math" = yes; then
+ AC_DEFINE(HAVE_SYSTEM_V_MATH,,[define if the compiler supports System V math library])
+fi
+])
diff --git a/m4/ac_cxx_have_valarray.m4 b/m4/ac_cxx_have_valarray.m4
new file mode 100644
index 0000000..f1fcc33
--- /dev/null
+++ b/m4/ac_cxx_have_valarray.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_valarray.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_VALARRAY
+#
+# DESCRIPTION
+#
+# If the compiler has valarray<T>, define HAVE_VALARRAY.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HAVE_VALARRAY],
+[AC_CACHE_CHECK(whether the compiler has valarray<T>,
+ac_cv_cxx_have_valarray,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <valarray>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[valarray<float> x(100); return 0;],
+ ac_cv_cxx_have_valarray=yes, ac_cv_cxx_have_valarray=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_valarray" = yes; then
+ AC_DEFINE(HAVE_VALARRAY,,[define if the compiler has valarray<T>])
+fi
+])
diff --git a/m4/ac_cxx_have_vector_at.m4 b/m4/ac_cxx_have_vector_at.m4
new file mode 100644
index 0000000..7c71df1
--- /dev/null
+++ b/m4/ac_cxx_have_vector_at.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_have_vector_at.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HAVE_VECTOR_AT
+#
+# DESCRIPTION
+#
+# If the implementation of the C++ library provides the method
+# std::vector::at(std::size_t), define HAVE_VECTOR_AT.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Jan Langer <jan@langernetz.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HAVE_VECTOR_AT],
+[AC_CACHE_CHECK(whether the compiler has std::vector::at (std::size_t),
+ac_cv_cxx_have_vector_at,
+[AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <vector>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif],[vector<int> v (1); v.at (0); return 0;],
+ ac_cv_cxx_have_vector_at=yes, ac_cv_cxx_have_vector_at=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_have_vector_at" = yes; then
+ AC_DEFINE(HAVE_VECTOR_AT,,[define if the compiler has the method
+std::vector::at (std::size_t)])
+fi
+])dnl
diff --git a/m4/ac_cxx_header_pre_stdcxx.m4 b/m4/ac_cxx_header_pre_stdcxx.m4
new file mode 100644
index 0000000..c0c94b3
--- /dev/null
+++ b/m4/ac_cxx_header_pre_stdcxx.m4
@@ -0,0 +1,72 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_header_pre_stdcxx.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HEADER_PRE_STDCXX
+#
+# DESCRIPTION
+#
+# Check whether pre-ISO-C++ headers exist.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HEADER_PRE_STDCXX], [
+ AC_CACHE_CHECK(for pre-ISO C++ include files,
+ ac_cv_cxx_pre_stdcxx,
+ [AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -Wno-deprecated"
+
+ # Omit defalloc.h, as compilation with newer compilers is problematic.
+ AC_TRY_COMPILE([
+ #include <new.h>
+ #include <iterator.h>
+ #include <alloc.h>
+ #include <set.h>
+ #include <hashtable.h>
+ #include <hash_set.h>
+ #include <fstream.h>
+ #include <tempbuf.h>
+ #include <istream.h>
+ #include <bvector.h>
+ #include <stack.h>
+ #include <rope.h>
+ #include <complex.h>
+ #include <ostream.h>
+ #include <heap.h>
+ #include <iostream.h>
+ #include <function.h>
+ #include <multimap.h>
+ #include <pair.h>
+ #include <stream.h>
+ #include <iomanip.h>
+ #include <slist.h>
+ #include <tree.h>
+ #include <vector.h>
+ #include <deque.h>
+ #include <multiset.h>
+ #include <list.h>
+ #include <map.h>
+ #include <algobase.h>
+ #include <hash_map.h>
+ #include <algo.h>
+ #include <queue.h>
+ #include <streambuf.h>
+ ],,
+ ac_cv_cxx_pre_stdcxx=yes, ac_cv_cxx_pre_stdcxx=no)
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+ ])
+ if test "$ac_cv_cxx_pre_stdcxx" = yes; then
+ AC_DEFINE(PRE_STDCXX_HEADERS,,[Define if pre-ISO C++ header files are present. ])
+ fi
+])
diff --git a/m4/ac_cxx_header_stdcxx_0x.m4 b/m4/ac_cxx_header_stdcxx_0x.m4
new file mode 100644
index 0000000..775a828
--- /dev/null
+++ b/m4/ac_cxx_header_stdcxx_0x.m4
@@ -0,0 +1,103 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_header_stdcxx_0x.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HEADER_STDCXX_0X
+#
+# DESCRIPTION
+#
+# Check for library coverage of the C++0x standard.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HEADER_STDCXX_0X], [
+ AC_CACHE_CHECK(for ISO C++ 0x include files,
+ ac_cv_cxx_stdcxx_0x,
+ [AC_REQUIRE([AC_COMPILE_STDCXX_0X])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+
+ AC_TRY_COMPILE([
+ #include <cassert>
+ #include <ccomplex>
+ #include <cctype>
+ #include <cerrno>
+ #include <cfenv>
+ #include <cfloat>
+ #include <cinttypes>
+ #include <ciso646>
+ #include <climits>
+ #include <clocale>
+ #include <cmath>
+ #include <csetjmp>
+ #include <csignal>
+ #include <cstdarg>
+ #include <cstdbool>
+ #include <cstddef>
+ #include <cstdint>
+ #include <cstdio>
+ #include <cstdlib>
+ #include <cstring>
+ #include <ctgmath>
+ #include <ctime>
+ #include <cwchar>
+ #include <cwctype>
+
+ #include <algorithm>
+ #include <array>
+ #include <bitset>
+ #include <complex>
+ #include <deque>
+ #include <exception>
+ #include <fstream>
+ #include <functional>
+ #include <iomanip>
+ #include <ios>
+ #include <iosfwd>
+ #include <iostream>
+ #include <istream>
+ #include <iterator>
+ #include <limits>
+ #include <list>
+ #include <locale>
+ #include <map>
+ #include <memory>
+ #include <new>
+ #include <numeric>
+ #include <ostream>
+ #include <queue>
+ #include <random>
+ #include <regex>
+ #include <set>
+ #include <sstream>
+ #include <stack>
+ #include <stdexcept>
+ #include <streambuf>
+ #include <string>
+ #include <tuple>
+ #include <typeinfo>
+ #include <type_traits>
+ #include <unordered_map>
+ #include <unordered_set>
+ #include <utility>
+ #include <valarray>
+ #include <vector>
+ ],,
+ ac_cv_cxx_stdcxx_0x=yes, ac_cv_cxx_stdcxx_0x=no)
+ AC_LANG_RESTORE
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ ])
+ if test "$ac_cv_cxx_stdcxx_0x" = yes; then
+ AC_DEFINE(STDCXX_0X_HEADERS,,[Define if ISO C++ 0x header files are present. ])
+ fi
+])
diff --git a/m4/ac_cxx_header_stdcxx_98.m4 b/m4/ac_cxx_header_stdcxx_98.m4
new file mode 100644
index 0000000..856241b
--- /dev/null
+++ b/m4/ac_cxx_header_stdcxx_98.m4
@@ -0,0 +1,83 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_header_stdcxx_98.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HEADER_STDCXX_98
+#
+# DESCRIPTION
+#
+# Check for complete library coverage of the C++1998/2003 standard.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HEADER_STDCXX_98], [
+ AC_CACHE_CHECK(for ISO C++ 98 include files,
+ ac_cv_cxx_stdcxx_98,
+ [AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+ #include <cassert>
+ #include <cctype>
+ #include <cerrno>
+ #include <cfloat>
+ #include <ciso646>
+ #include <climits>
+ #include <clocale>
+ #include <cmath>
+ #include <csetjmp>
+ #include <csignal>
+ #include <cstdarg>
+ #include <cstddef>
+ #include <cstdio>
+ #include <cstdlib>
+ #include <cstring>
+ #include <ctime>
+
+ #include <algorithm>
+ #include <bitset>
+ #include <complex>
+ #include <deque>
+ #include <exception>
+ #include <fstream>
+ #include <functional>
+ #include <iomanip>
+ #include <ios>
+ #include <iosfwd>
+ #include <iostream>
+ #include <istream>
+ #include <iterator>
+ #include <limits>
+ #include <list>
+ #include <locale>
+ #include <map>
+ #include <memory>
+ #include <new>
+ #include <numeric>
+ #include <ostream>
+ #include <queue>
+ #include <set>
+ #include <sstream>
+ #include <stack>
+ #include <stdexcept>
+ #include <streambuf>
+ #include <string>
+ #include <typeinfo>
+ #include <utility>
+ #include <valarray>
+ #include <vector>
+ ],,
+ ac_cv_cxx_stdcxx_98=yes, ac_cv_cxx_stdcxx_98=no)
+ AC_LANG_RESTORE
+ ])
+ if test "$ac_cv_cxx_stdcxx_98" = yes; then
+ AC_DEFINE(STDCXX_98_HEADERS,,[Define if ISO C++ 1998 header files are present. ])
+ fi
+])
diff --git a/m4/ac_cxx_header_stdcxx_tr1.m4 b/m4/ac_cxx_header_stdcxx_tr1.m4
new file mode 100644
index 0000000..901848d
--- /dev/null
+++ b/m4/ac_cxx_header_stdcxx_tr1.m4
@@ -0,0 +1,61 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_header_stdcxx_tr1.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HEADER_STDCXX_TR1
+#
+# DESCRIPTION
+#
+# Check for library coverage of the TR1 standard.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HEADER_STDCXX_TR1], [
+ AC_CACHE_CHECK(for ISO C++ TR1 include files,
+ ac_cv_cxx_stdcxx_tr1,
+ [AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+ #include <tr1/array>
+ #include <tr1/ccomplex>
+ #include <tr1/cctype>
+ #include <tr1/cfenv>
+ #include <tr1/cfloat>
+ #include <tr1/cinttypes>
+ #include <tr1/climits>
+ #include <tr1/cmath>
+ #include <tr1/complex>
+ #include <tr1/cstdarg>
+ #include <tr1/cstdbool>
+ #include <tr1/cstdint>
+ #include <tr1/cstdio>
+ #include <tr1/cstdlib>
+ #include <tr1/ctgmath>
+ #include <tr1/ctime>
+ #include <tr1/cwchar>
+ #include <tr1/cwctype>
+ #include <tr1/functional>
+ #include <tr1/memory>
+ #include <tr1/random>
+ #include <tr1/regex>
+ #include <tr1/tuple>
+ #include <tr1/type_traits>
+ #include <tr1/unordered_set>
+ #include <tr1/unordered_map>
+ #include <tr1/utility>
+ ],,
+ ac_cv_cxx_stdcxx_tr1=yes, ac_cv_cxx_stdcxx_tr1=no)
+ AC_LANG_RESTORE
+ ])
+ if test "$ac_cv_cxx_stdcxx_tr1" = yes; then
+ AC_DEFINE(STDCXX_TR1_HEADERS,,[Define if ISO C++ TR1 header files are present. ])
+ fi
+])
diff --git a/m4/ac_cxx_header_tr1_unordered_map.m4 b/m4/ac_cxx_header_tr1_unordered_map.m4
new file mode 100644
index 0000000..9af67b5
--- /dev/null
+++ b/m4/ac_cxx_header_tr1_unordered_map.m4
@@ -0,0 +1,34 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_header_tr1_unordered_map.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HEADER_TR1_UNORDERED_MAP
+#
+# DESCRIPTION
+#
+# Check whether the TR1 include <unordered_map> exists and define
+# HAVE_TR1_UNORDERED_MAP if it does.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HEADER_TR1_UNORDERED_MAP], [
+ AC_CACHE_CHECK(for tr1/unordered_map,
+ ac_cv_cxx_tr1_unordered_map,
+ [AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <tr1/unordered_map>], [using std::tr1::unordered_map;],
+ ac_cv_cxx_tr1_unordered_map=yes, ac_cv_cxx_tr1_unordered_map=no)
+ AC_LANG_RESTORE
+ ])
+ if test "$ac_cv_cxx_tr1_unordered_map" = yes; then
+ AC_DEFINE(HAVE_TR1_UNORDERED_MAP,,[Define if tr1/unordered_map is present. ])
+ fi
+])
diff --git a/m4/ac_cxx_header_tr1_unordered_set.m4 b/m4/ac_cxx_header_tr1_unordered_set.m4
new file mode 100644
index 0000000..000e951
--- /dev/null
+++ b/m4/ac_cxx_header_tr1_unordered_set.m4
@@ -0,0 +1,34 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_header_tr1_unordered_set.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HEADER_TR1_UNORDERED_SET
+#
+# DESCRIPTION
+#
+# Check whether the TR1 include <unordered_set> exists and define
+# HAVE_TR1_UNORDERED_SET if it does.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HEADER_TR1_UNORDERED_SET], [
+ AC_CACHE_CHECK(for tr1/unordered_set,
+ ac_cv_cxx_tr1_unordered_set,
+ [AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <tr1/unordered_set>], [using std::tr1::unordered_set;],
+ ac_cv_cxx_tr1_unordered_set=yes, ac_cv_cxx_tr1_unordered_set=no)
+ AC_LANG_RESTORE
+ ])
+ if test "$ac_cv_cxx_tr1_unordered_set" = yes; then
+ AC_DEFINE(HAVE_TR1_UNORDERED_SET,,[Define if tr1/unordered_set is present. ])
+ fi
+])
diff --git a/m4/ac_cxx_header_unordered_map.m4 b/m4/ac_cxx_header_unordered_map.m4
new file mode 100644
index 0000000..c5e6012
--- /dev/null
+++ b/m4/ac_cxx_header_unordered_map.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_header_unordered_map.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HEADER_UNORDERED_MAP
+#
+# DESCRIPTION
+#
+# Check whether the C++ include <unordered_map> exists and define
+# HAVE_UNORDERED_MAP if it does.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HEADER_UNORDERED_MAP], [
+ AC_CACHE_CHECK(for unordered_map,
+ ac_cv_cxx_unordered_map,
+ [AC_REQUIRE([AC_COMPILE_STDCXX_0X])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+ AC_TRY_COMPILE([#include <unordered_map>], [using std::unordered_map;],
+ ac_cv_cxx_unordered_map=yes, ac_cv_cxx_unordered_map=no)
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+ ])
+ if test "$ac_cv_cxx_unordered_map" = yes; then
+ AC_DEFINE(HAVE_UNORDERED_MAP,,[Define if unordered_map is present. ])
+ fi
+])
diff --git a/m4/ac_cxx_header_unordered_set.m4 b/m4/ac_cxx_header_unordered_set.m4
new file mode 100644
index 0000000..0573c0a
--- /dev/null
+++ b/m4/ac_cxx_header_unordered_set.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_header_unordered_set.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_HEADER_UNORDERED_SET
+#
+# DESCRIPTION
+#
+# Check whether the C++ include <unordered_set> exists and define
+# HAVE_UNORDERED_SET if it does.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_HEADER_UNORDERED_SET], [
+ AC_CACHE_CHECK(for unordered_set,
+ ac_cv_cxx_unordered_set,
+ [AC_REQUIRE([AC_COMPILE_STDCXX_0X])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+ AC_TRY_COMPILE([#include <unordered_set>], [using std::unordered_set;],
+ ac_cv_cxx_unordered_set=yes, ac_cv_cxx_unordered_set=no)
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+ ])
+ if test "$ac_cv_cxx_unordered_set" = yes; then
+ AC_DEFINE(HAVE_UNORDERED_SET,,[Define if unordered_set is present. ])
+ fi
+])
diff --git a/m4/ac_cxx_ldflags_std_lang.m4 b/m4/ac_cxx_ldflags_std_lang.m4
new file mode 100644
index 0000000..54f55da
--- /dev/null
+++ b/m4/ac_cxx_ldflags_std_lang.m4
@@ -0,0 +1,31 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_ldflags_std_lang.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_LDFLAGS_STD_LANG(LD-FLAGS)
+#
+# DESCRIPTION
+#
+# Append to LD-FLAGS the set of link-time flags that should be passed to
+# the C++ compiler in order to enable use of C++ features as defined in
+# the ANSI C++ standard (eg. use of standard iostream classes in the `std'
+# namespace, etc.). Note that if you use GNU Libtool you may need to
+# prefix each of those switches with `-Xlinker' so that Libtool doesn't
+# discard them (see Libtool's manual and `AC_LIBTOOLIZE_LDFLAGS').
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ludovic Courtès <ludo@chbouib.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_LDFLAGS_STD_LANG],
+ [AC_REQUIRE([AC_CXX_COMPILER_VENDOR])
+ case "$ac_cv_cxx_compiler_vendor" in
+ sgi) $1="$$1 -LANG:std -exceptions";;
+ hp) $1="$$1 -AA";;
+ esac])
diff --git a/m4/ac_cxx_member_constants.m4 b/m4/ac_cxx_member_constants.m4
new file mode 100644
index 0000000..2199706
--- /dev/null
+++ b/m4/ac_cxx_member_constants.m4
@@ -0,0 +1,35 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_member_constants.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_MEMBER_CONSTANTS
+#
+# DESCRIPTION
+#
+# If the compiler supports member constants, define HAVE_MEMBER_CONSTANTS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_MEMBER_CONSTANTS],
+[AC_CACHE_CHECK(whether the compiler supports member constants,
+ac_cv_cxx_member_constants,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([class C {public: static const int i = 0;}; const int C::i;],
+[return C::i;],
+ ac_cv_cxx_member_constants=yes, ac_cv_cxx_member_constants=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_member_constants" = yes; then
+ AC_DEFINE(HAVE_MEMBER_CONSTANTS,,[define if the compiler supports member constants])
+fi
+])
diff --git a/m4/ac_cxx_member_templates.m4 b/m4/ac_cxx_member_templates.m4
new file mode 100644
index 0000000..ad4b9b9
--- /dev/null
+++ b/m4/ac_cxx_member_templates.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_member_templates.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_MEMBER_TEMPLATES
+#
+# DESCRIPTION
+#
+# If the compiler supports member templates, define HAVE_MEMBER_TEMPLATES.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_MEMBER_TEMPLATES],
+[AC_CACHE_CHECK(whether the compiler supports member templates,
+ac_cv_cxx_member_templates,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+template<class T, int N> class A
+{ public:
+ template<int N2> A<T,N> operator=(const A<T,N2>& z) { return A<T,N>(); }
+};],[A<double,4> x; A<double,7> y; x = y; return 0;],
+ ac_cv_cxx_member_templates=yes, ac_cv_cxx_member_templates=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_member_templates" = yes; then
+ AC_DEFINE(HAVE_MEMBER_TEMPLATES,,[define if the compiler supports member templates])
+fi
+])
diff --git a/m4/ac_cxx_member_templates_outside_class.m4 b/m4/ac_cxx_member_templates_outside_class.m4
new file mode 100644
index 0000000..9338919
--- /dev/null
+++ b/m4/ac_cxx_member_templates_outside_class.m4
@@ -0,0 +1,43 @@
+# ============================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_member_templates_outside_class.html
+# ============================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_MEMBER_TEMPLATES_OUTSIDE_CLASS
+#
+# DESCRIPTION
+#
+# If the compiler supports member templates outside the class declaration,
+# define HAVE_MEMBER_TEMPLATES_OUTSIDE_CLASS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_MEMBER_TEMPLATES_OUTSIDE_CLASS],
+[AC_CACHE_CHECK(whether the compiler supports member templates outside the class declaration,
+ac_cv_cxx_member_templates_outside_class,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+template<class T, int N> class A
+{ public :
+ template<int N2> A<T,N> operator=(const A<T,N2>& z);
+};
+template<class T, int N> template<int N2>
+A<T,N> A<T,N>::operator=(const A<T,N2>& z){ return A<T,N>(); }],[
+A<double,4> x; A<double,7> y; x = y; return 0;],
+ ac_cv_cxx_member_templates_outside_class=yes, ac_cv_cxx_member_templates_outside_class=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_member_templates_outside_class" = yes; then
+ AC_DEFINE(HAVE_MEMBER_TEMPLATES_OUTSIDE_CLASS,,
+ [define if the compiler supports member templates outside the class declaration])
+fi
+])
diff --git a/m4/ac_cxx_mutable.m4 b/m4/ac_cxx_mutable.m4
new file mode 100644
index 0000000..87e5785
--- /dev/null
+++ b/m4/ac_cxx_mutable.m4
@@ -0,0 +1,41 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_mutable.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_MUTABLE
+#
+# DESCRIPTION
+#
+# If the compiler allows modifying class data members flagged with the
+# mutable keyword even in const objects (for example in the body of a
+# const member function), define HAVE_MUTABLE.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_MUTABLE],
+[AC_CACHE_CHECK(whether the compiler supports the mutable keyword,
+ac_cv_cxx_mutable,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+class A { mutable int i;
+ public:
+ int f (int n) const { i = n; return i; }
+ };
+],[A a; return a.f (1);],
+ ac_cv_cxx_mutable=yes, ac_cv_cxx_mutable=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_mutable" = yes; then
+ AC_DEFINE(HAVE_MUTABLE,,[define if the compiler supports the mutable keyword])
+fi
+])
diff --git a/m4/ac_cxx_namespace_std.m4 b/m4/ac_cxx_namespace_std.m4
new file mode 100644
index 0000000..91e1fbc
--- /dev/null
+++ b/m4/ac_cxx_namespace_std.m4
@@ -0,0 +1,35 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_namespace_std.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_NAMESPACE_STD
+#
+# DESCRIPTION
+#
+# If the compiler supports namespace std, define HAVE_NAMESPACE_STD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Todd Veldhuizen
+# Copyright (c) 2009 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_NAMESPACE_STD], [
+ AC_CACHE_CHECK(if g++ supports namespace std,
+ ac_cv_cxx_have_std_namespace,
+ [AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <iostream>
+ std::istream& is = std::cin;],,
+ ac_cv_cxx_have_std_namespace=yes, ac_cv_cxx_have_std_namespace=no)
+ AC_LANG_RESTORE
+ ])
+ if test "$ac_cv_cxx_have_std_namespace" = yes; then
+ AC_DEFINE(HAVE_NAMESPACE_STD,,[Define if g++ supports namespace std. ])
+ fi
+])
diff --git a/m4/ac_cxx_namespaces.m4 b/m4/ac_cxx_namespaces.m4
new file mode 100644
index 0000000..4d074ef
--- /dev/null
+++ b/m4/ac_cxx_namespaces.m4
@@ -0,0 +1,36 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_namespaces.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_NAMESPACES
+#
+# DESCRIPTION
+#
+# If the compiler can prevent names clashes using namespaces, define
+# HAVE_NAMESPACES.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_NAMESPACES],
+[AC_CACHE_CHECK(whether the compiler implements namespaces,
+ac_cv_cxx_namespaces,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
+ [using namespace Outer::Inner; return i;],
+ ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_namespaces" = yes; then
+ AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
+fi
+])
diff --git a/m4/ac_cxx_new_for_scoping.m4 b/m4/ac_cxx_new_for_scoping.m4
new file mode 100644
index 0000000..b6944b8
--- /dev/null
+++ b/m4/ac_cxx_new_for_scoping.m4
@@ -0,0 +1,42 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_new_for_scoping.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_NEW_FOR_SCOPING
+#
+# DESCRIPTION
+#
+# If the compiler accepts the new for scoping rules (the scope of a
+# variable declared inside the parentheses is restricted to the for-body),
+# define HAVE_NEW_FOR_SCOPING.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_NEW_FOR_SCOPING],
+[AC_CACHE_CHECK(whether the compiler accepts the new for scoping rules,
+ac_cv_cxx_new_for_scoping,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE(,[
+ int z = 0;
+ for (int i = 0; i < 10; ++i)
+ z = z + i;
+ for (int i = 0; i < 10; ++i)
+ z = z - i;
+ return z;],
+ ac_cv_cxx_new_for_scoping=yes, ac_cv_cxx_new_for_scoping=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_new_for_scoping" = yes; then
+ AC_DEFINE(HAVE_NEW_FOR_SCOPING,,[define if the compiler accepts the new for scoping rules])
+fi
+])
diff --git a/m4/ac_cxx_old_for_scoping.m4 b/m4/ac_cxx_old_for_scoping.m4
new file mode 100644
index 0000000..cc77a85
--- /dev/null
+++ b/m4/ac_cxx_old_for_scoping.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_old_for_scoping.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_OLD_FOR_SCOPING
+#
+# DESCRIPTION
+#
+# If the compiler accepts the old for scoping rules (the scope of a
+# variable declared inside the parentheses extends outside the for-body),
+# define HAVE_OLD_FOR_SCOPING. Note that some compilers (notably g++ and
+# egcs) support both new and old rules since they accept the old rules and
+# only generate a warning.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_OLD_FOR_SCOPING],
+[AC_CACHE_CHECK(whether the compiler accepts the old for scoping rules,
+ac_cv_cxx_old_for_scoping,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE(,[int z;for (int i=0; i < 10; ++i)z=z+i;z=i;return z;],
+ ac_cv_cxx_old_for_scoping=yes, ac_cv_cxx_old_for_scoping=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_old_for_scoping" = yes; then
+ AC_DEFINE(HAVE_OLD_FOR_SCOPING,,[define if the compiler accepts the old for scoping rules])
+fi
+])
diff --git a/m4/ac_cxx_partial_ordering.m4 b/m4/ac_cxx_partial_ordering.m4
new file mode 100644
index 0000000..f2b608b
--- /dev/null
+++ b/m4/ac_cxx_partial_ordering.m4
@@ -0,0 +1,41 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_partial_ordering.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_PARTIAL_ORDERING
+#
+# DESCRIPTION
+#
+# If the compiler supports partial ordering, define HAVE_PARTIAL_ORDERING.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_PARTIAL_ORDERING],
+[AC_CACHE_CHECK(whether the compiler supports partial ordering,
+ac_cv_cxx_partial_ordering,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+template<int N> struct I {};
+template<class T> struct A
+{ int r;
+ template<class T1, class T2> int operator() (T1, T2) { r = 0; return r; }
+ template<int N1, int N2> int operator() (I<N1>, I<N2>) { r = 1; return r; }
+};],[A<float> x, y; I<0> a; I<1> b; return x (a,b) + y (float(), double());],
+ ac_cv_cxx_partial_ordering=yes, ac_cv_cxx_partial_ordering=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_partial_ordering" = yes; then
+ AC_DEFINE(HAVE_PARTIAL_ORDERING,,
+ [define if the compiler supports partial ordering])
+fi
+])
diff --git a/m4/ac_cxx_partial_specialization.m4 b/m4/ac_cxx_partial_specialization.m4
new file mode 100644
index 0000000..be78783
--- /dev/null
+++ b/m4/ac_cxx_partial_specialization.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_partial_specialization.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_PARTIAL_SPECIALIZATION
+#
+# DESCRIPTION
+#
+# If the compiler supports partial specialization, define
+# HAVE_PARTIAL_SPECIALIZATION.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_PARTIAL_SPECIALIZATION],
+[AC_CACHE_CHECK(whether the compiler supports partial specialization,
+ac_cv_cxx_partial_specialization,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+template<class T, int N> class A { public : enum e { z = 0 }; };
+template<int N> class A<double, N> { public : enum e { z = 1 }; };
+template<class T> class A<T, 2> { public : enum e { z = 2 }; };
+],[return (A<int,3>::z == 0) && (A<double,3>::z == 1) && (A<float,2>::z == 2);],
+ ac_cv_cxx_partial_specialization=yes, ac_cv_cxx_partial_specialization=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_partial_specialization" = yes; then
+ AC_DEFINE(HAVE_PARTIAL_SPECIALIZATION,,
+ [define if the compiler supports partial specialization])
+fi
+])
diff --git a/m4/ac_cxx_reinterpret_cast.m4 b/m4/ac_cxx_reinterpret_cast.m4
new file mode 100644
index 0000000..bf7b585
--- /dev/null
+++ b/m4/ac_cxx_reinterpret_cast.m4
@@ -0,0 +1,41 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_reinterpret_cast.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_REINTERPRET_CAST
+#
+# DESCRIPTION
+#
+# If the compiler supports reinterpret_cast<>, define
+# HAVE_REINTERPRET_CAST.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_REINTERPRET_CAST],
+[AC_CACHE_CHECK(whether the compiler supports reinterpret_cast<>,
+ac_cv_cxx_reinterpret_cast,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <typeinfo>
+class Base { public : Base () {} virtual void f () = 0;};
+class Derived : public Base { public : Derived () {} virtual void f () {} };
+class Unrelated { public : Unrelated () {} };
+int g (Unrelated&) { return 0; }],[
+Derived d;Base& b=d;Unrelated& e=reinterpret_cast<Unrelated&>(b);return g(e);],
+ ac_cv_cxx_reinterpret_cast=yes, ac_cv_cxx_reinterpret_cast=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_reinterpret_cast" = yes; then
+ AC_DEFINE(HAVE_REINTERPRET_CAST,,
+ [define if the compiler supports reinterpret_cast<>])
+fi
+])
diff --git a/m4/ac_cxx_rtti.m4 b/m4/ac_cxx_rtti.m4
new file mode 100644
index 0000000..9ffdc56
--- /dev/null
+++ b/m4/ac_cxx_rtti.m4
@@ -0,0 +1,48 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_rtti.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_RTTI
+#
+# DESCRIPTION
+#
+# If the compiler supports Run-Time Type Identification (typeinfo header
+# and typeid keyword), define HAVE_RTTI.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_RTTI],
+[AC_CACHE_CHECK(whether the compiler supports Run-Time Type Identification,
+ac_cv_cxx_rtti,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <typeinfo>
+class Base { public :
+ Base () {}
+ virtual int f () { return 0; }
+ };
+class Derived : public Base { public :
+ Derived () {}
+ virtual int f () { return 1; }
+ };
+],[Derived d;
+Base *ptr = &d;
+return typeid (*ptr) == typeid (Derived);
+],
+ ac_cv_cxx_rtti=yes, ac_cv_cxx_rtti=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_rtti" = yes; then
+ AC_DEFINE(HAVE_RTTI,,
+ [define if the compiler supports Run-Time Type Identification])
+fi
+])
diff --git a/m4/ac_cxx_static_cast.m4 b/m4/ac_cxx_static_cast.m4
new file mode 100644
index 0000000..57b3468
--- /dev/null
+++ b/m4/ac_cxx_static_cast.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_static_cast.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_STATIC_CAST
+#
+# DESCRIPTION
+#
+# If the compiler supports static_cast<>, define HAVE_STATIC_CAST.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_STATIC_CAST],
+[AC_CACHE_CHECK(whether the compiler supports static_cast<>,
+ac_cv_cxx_static_cast,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <typeinfo>
+class Base { public : Base () {} virtual void f () = 0; };
+class Derived : public Base { public : Derived () {} virtual void f () {} };
+int g (Derived&) { return 0; }],[
+Derived d; Base& b = d; Derived& s = static_cast<Derived&> (b); return g (s);],
+ ac_cv_cxx_static_cast=yes, ac_cv_cxx_static_cast=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_static_cast" = yes; then
+ AC_DEFINE(HAVE_STATIC_CAST,,
+ [define if the compiler supports static_cast<>])
+fi
+])
diff --git a/m4/ac_cxx_stlport_hashmap.m4 b/m4/ac_cxx_stlport_hashmap.m4
new file mode 100644
index 0000000..5994eed
--- /dev/null
+++ b/m4/ac_cxx_stlport_hashmap.m4
@@ -0,0 +1,35 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_stlport_hashmap.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_STLPORT_HASHMAP
+#
+# DESCRIPTION
+#
+# Test for the presence of STLport's hashmap extension.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Patrick Mauritz <oxygene@studentenbude.ath.cx>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_STLPORT_HASHMAP],[
+AC_CACHE_CHECK(whether the compiler supports std::hash_map,
+ac_cv_cxx_stlport_hashmap,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <hash_map>
+using std::hash_map;],
+ [],
+ ac_cv_cxx_stlport_hashmap=yes, ac_cv_cxx_stlport_hashmap=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_stlport_hashmap" = yes; then
+ AC_DEFINE(HAVE_STLPORT_HASHMAP,,[define if the compiler supports std::hash_map])
+fi
+])
diff --git a/m4/ac_cxx_template_keyword_qualifier.m4 b/m4/ac_cxx_template_keyword_qualifier.m4
new file mode 100644
index 0000000..2ac62a2
--- /dev/null
+++ b/m4/ac_cxx_template_keyword_qualifier.m4
@@ -0,0 +1,49 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_template_keyword_qualifier.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_TEMPLATE_KEYWORD_QUALIFIER
+#
+# DESCRIPTION
+#
+# If the compiler supports use of the template keyword as a qualifier,
+# define HAVE_TEMPLATE_KEYWORD_QUALIFIER.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Bernardo Innocenti
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_TEMPLATE_KEYWORD_QUALIFIER],
+[AC_CACHE_CHECK(whether the compiler supports use of the template keyword as a qualifier,
+ac_cv_cxx_template_keyword_qualifier,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+ class X
+ {
+ public:
+ template<int> void member() {}
+ template<int> static void static_member() {}
+ };
+ template<class T> void f(T* p)
+ {
+ p->template member<200>(); // OK: < starts template argument
+ T::template static_member<100>(); // OK: < starts explicit qualification
+ }
+],[X x; f(&x); return 0;],
+ ac_cv_cxx_template_keyword_qualifier=yes, ac_cv_cxx_template_keyword_qualifier=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_template_keyword_qualifier" = yes; then
+ AC_DEFINE(HAVE_TEMPLATE_KEYWORD_QUALIFIER,,
+ [define if the compiler supports use of the template keyword as a qualifier])
+fi
+])
diff --git a/m4/ac_cxx_template_qualified_base_class.m4 b/m4/ac_cxx_template_qualified_base_class.m4
new file mode 100644
index 0000000..11b4197
--- /dev/null
+++ b/m4/ac_cxx_template_qualified_base_class.m4
@@ -0,0 +1,54 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_template_qualified_base_class.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_TEMPLATE_QUALIFIED_BASE_CLASS
+#
+# DESCRIPTION
+#
+# If the compiler supports template-qualified base class specifiers,
+# define HAVE_TEMPLATE_QUALIFIED_BASE_CLASS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_TEMPLATE_QUALIFIED_BASE_CLASS],
+[AC_CACHE_CHECK(whether the compiler supports template-qualified base class specifiers,
+ac_cv_cxx_template_qualified_base_class,
+[AC_REQUIRE([AC_CXX_TYPENAME])
+ AC_REQUIRE([AC_CXX_FULL_SPECIALIZATION_SYNTAX])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+#ifndef HAVE_TYPENAME
+ #define typename
+#endif
+class Base1 { public : int f () const { return 1; } };
+class Base2 { public : int f () const { return 0; } };
+template<class X> struct base_trait { typedef Base1 base; };
+#ifdef HAVE_FULL_SPECIALIZATION_SYNTAX
+template<> struct base_trait<float> { typedef Base2 base; };
+#else
+ struct base_trait<float> { typedef Base2 base; };
+#endif
+template<class T> class Weird : public base_trait<T>::base
+{ public :
+ typedef typename base_trait<T>::base base;
+ int g () const { return base::f (); }
+};],[ Weird<float> z; return z.g ();],
+ ac_cv_cxx_template_qualified_base_class=yes, ac_cv_cxx_template_qualified_base_class=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_template_qualified_base_class" = yes; then
+ AC_DEFINE(HAVE_TEMPLATE_QUALIFIED_BASE_CLASS,,
+ [define if the compiler supports template-qualified base class specifiers])
+fi
+])
diff --git a/m4/ac_cxx_template_qualified_return_type.m4 b/m4/ac_cxx_template_qualified_return_type.m4
new file mode 100644
index 0000000..b55d16d
--- /dev/null
+++ b/m4/ac_cxx_template_qualified_return_type.m4
@@ -0,0 +1,47 @@
+# ============================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_template_qualified_return_type.html
+# ============================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_TEMPLATE_QUALIFIED_RETURN_TYPE
+#
+# DESCRIPTION
+#
+# If the compiler supports template-qualified return types, define
+# HAVE_TEMPLATE_QUALIFIED_RETURN_TYPE.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_TEMPLATE_QUALIFIED_RETURN_TYPE],
+[AC_CACHE_CHECK(whether the compiler supports template-qualified return types,
+ac_cv_cxx_template_qualified_return_type,
+[AC_REQUIRE([AC_CXX_TYPENAME])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+#ifndef HAVE_TYPENAME
+ #define typename
+#endif
+template<class X, class Y> struct promote_trait { typedef X T; };
+template<> struct promote_trait<int, float> { typedef float T; };
+template<class T> class A { public : A () {} };
+template<class X, class Y>
+A<typename promote_trait<X,Y>::T> operator+ (const A<X>&, const A<Y>&)
+{ return A<typename promote_trait<X,Y>::T>(); }
+],[A<int> x; A<float> y; A<float> z = x + y; return 0;],
+ ac_cv_cxx_template_qualified_return_type=yes, ac_cv_cxx_template_qualified_return_type=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_template_qualified_return_type" = yes; then
+ AC_DEFINE(HAVE_TEMPLATE_QUALIFIED_RETURN_TYPE,,
+ [define if the compiler supports template-qualified return types])
+fi
+])
diff --git a/m4/ac_cxx_template_scoped_argument_matching.m4 b/m4/ac_cxx_template_scoped_argument_matching.m4
new file mode 100644
index 0000000..cb5c380
--- /dev/null
+++ b/m4/ac_cxx_template_scoped_argument_matching.m4
@@ -0,0 +1,44 @@
+# ===============================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_template_scoped_argument_matching.html
+# ===============================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_TEMPLATE_SCOPED_ARGUMENT_MATCHING
+#
+# DESCRIPTION
+#
+# If the compiler supports function matching with argument types which are
+# template scope-qualified, define HAVE_TEMPLATE_SCOPED_ARGUMENT_MATCHING.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_TEMPLATE_SCOPED_ARGUMENT_MATCHING],
+[AC_CACHE_CHECK(whether the compiler supports function matching with argument types which are template scope-qualified,
+ac_cv_cxx_template_scoped_argument_matching,
+[AC_REQUIRE([AC_CXX_TYPENAME])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+#ifndef HAVE_TYPENAME
+ #define typename
+#endif
+template<class X> class A { public : typedef X W; };
+template<class Y> class B {};
+template<class Y> void operator+(B<Y> d1, typename Y::W d2) {}
+],[B<A<float> > z; z + 0.5f; return 0;],
+ ac_cv_cxx_template_scoped_argument_matching=yes, ac_cv_cxx_template_scoped_argument_matching=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_template_scoped_argument_matching" = yes; then
+ AC_DEFINE(HAVE_TEMPLATE_SCOPED_ARGUMENT_MATCHING,,
+ [define if the compiler supports function matching with argument types which are template scope-qualified])
+fi
+])
diff --git a/m4/ac_cxx_templates.m4 b/m4/ac_cxx_templates.m4
new file mode 100644
index 0000000..cf9518d
--- /dev/null
+++ b/m4/ac_cxx_templates.m4
@@ -0,0 +1,36 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_templates.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_TEMPLATES
+#
+# DESCRIPTION
+#
+# If the compiler supports basic templates, define HAVE_TEMPLATES.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_TEMPLATES],
+[AC_CACHE_CHECK(whether the compiler supports basic templates,
+ac_cv_cxx_templates,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([template<class T> class A {public:A(){}};
+template<class T> void f(const A<T>& ){}],[
+A<double> d; A<int> i; f(d); f(i); return 0;],
+ ac_cv_cxx_templates=yes, ac_cv_cxx_templates=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_templates" = yes; then
+ AC_DEFINE(HAVE_TEMPLATES,,[define if the compiler supports basic templates])
+fi
+])
diff --git a/m4/ac_cxx_templates_as_template_arguments.m4 b/m4/ac_cxx_templates_as_template_arguments.m4
new file mode 100644
index 0000000..3aea360
--- /dev/null
+++ b/m4/ac_cxx_templates_as_template_arguments.m4
@@ -0,0 +1,40 @@
+# =============================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_templates_as_template_arguments.html
+# =============================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_TEMPLATES_AS_TEMPLATE_ARGUMENTS
+#
+# DESCRIPTION
+#
+# If the compiler supports templates as template arguments, define
+# HAVE_TEMPLATES_AS_TEMPLATE_ARGUMENTS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_TEMPLATES_AS_TEMPLATE_ARGUMENTS],
+[AC_CACHE_CHECK(whether the compiler supports templates as template arguments,
+ac_cv_cxx_templates_as_template_arguments,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+template<class T> class allocator { public : allocator() {}; };
+template<class X, template<class Y> class T_alloc>
+class A { public : A() {} private : T_alloc<X> alloc_; };
+],[A<double, allocator> x; return 0;],
+ ac_cv_cxx_templates_as_template_arguments=yes, ac_cv_cxx_templates_as_template_arguments=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_templates_as_template_arguments" = yes; then
+ AC_DEFINE(HAVE_TEMPLATES_AS_TEMPLATE_ARGUMENTS,,
+ [define if the compiler supports templates as template arguments])
+fi
+])
diff --git a/m4/ac_cxx_typename.m4 b/m4/ac_cxx_typename.m4
new file mode 100644
index 0000000..5c77f1b
--- /dev/null
+++ b/m4/ac_cxx_typename.m4
@@ -0,0 +1,35 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_typename.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_TYPENAME
+#
+# DESCRIPTION
+#
+# If the compiler recognizes the typename keyword, define HAVE_TYPENAME.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_TYPENAME],
+[AC_CACHE_CHECK(whether the compiler recognizes typename,
+ac_cv_cxx_typename,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([template<typename T>class X {public:X(){}};],
+[X<float> z; return 0;],
+ ac_cv_cxx_typename=yes, ac_cv_cxx_typename=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_typename" = yes; then
+ AC_DEFINE(HAVE_TYPENAME,,[define if the compiler recognizes typename])
+fi
+])
diff --git a/m4/ac_cxx_use_numtrait.m4 b/m4/ac_cxx_use_numtrait.m4
new file mode 100644
index 0000000..56983e6
--- /dev/null
+++ b/m4/ac_cxx_use_numtrait.m4
@@ -0,0 +1,45 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_use_numtrait.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_USE_NUMTRAIT
+#
+# DESCRIPTION
+#
+# If the compiler supports numeric traits promotions, define
+# HAVE_USE_NUMTRAIT.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Todd Veldhuizen
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_USE_NUMTRAIT],
+[AC_CACHE_CHECK(whether the compiler supports numeric traits promotions,
+ac_cv_cxx_use_numtrait,
+[AC_REQUIRE([AC_CXX_TYPENAME])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+#ifndef HAVE_TYPENAME
+ #define typename
+#endif
+template<class T_numtype> class SumType { public : typedef T_numtype T_sumtype; };
+template<> class SumType<char> { public : typedef int T_sumtype; };
+template<class T> class A {};
+template<class T> A<typename SumType<T>::T_sumtype> sum(A<T>)
+{ return A<typename SumType<T>::T_sumtype>(); }
+],[A<float> x; sum(x); return 0;],
+ ac_cv_cxx_use_numtrait=yes, ac_cv_cxx_use_numtrait=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_use_numtrait" = yes; then
+ AC_DEFINE(HAVE_USE_NUMTRAIT,,[define if the compiler supports numeric traits promotions])
+fi
+])
diff --git a/m4/ac_cxx_verbose_terminate_handler.m4 b/m4/ac_cxx_verbose_terminate_handler.m4
new file mode 100644
index 0000000..a7fa307
--- /dev/null
+++ b/m4/ac_cxx_verbose_terminate_handler.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_verbose_terminate_handler.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_VERBOSE_TERMINATE_HANDLER
+#
+# DESCRIPTION
+#
+# If the compiler does have the verbose terminate handler, define
+# HAVE_VERBOSE_TERMINATE_HANDLER.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Lapo Luchini <lapo@lapo.it>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_VERBOSE_TERMINATE_HANDLER],
+[AC_CACHE_CHECK(whether the compiler has __gnu_cxx::__verbose_terminate_handler,
+ac_cv_verbose_terminate_handler,
+[
+ AC_REQUIRE([AC_CXX_EXCEPTIONS])
+ AC_REQUIRE([AC_CXX_NAMESPACES])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE(
+ [#include <exception>], [std::set_terminate(__gnu_cxx::__verbose_terminate_handler);],
+ ac_cv_verbose_terminate_handler=yes, ac_cv_verbose_terminate_handler=no
+ )
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_verbose_terminate_handler" = yes; then
+ AC_DEFINE(HAVE_VERBOSE_TERMINATE_HANDLER, , [define if the compiler has __gnu_cxx::__verbose_terminate_handler])
+fi
+])
diff --git a/m4/ac_define_dir.m4 b/m4/ac_define_dir.m4
new file mode 100644
index 0000000..8594947
--- /dev/null
+++ b/m4/ac_define_dir.m4
@@ -0,0 +1,45 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_define_dir.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
+#
+# DESCRIPTION
+#
+# This macro sets VARNAME to the expansion of the DIR variable, taking
+# care of fixing up ${prefix} and such.
+#
+# VARNAME is then offered as both an output variable and a C preprocessor
+# symbol.
+#
+# Example:
+#
+# AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Stepan Kasal <kasal@ucw.cz>
+# Copyright (c) 2008 Andreas Schwab <schwab@suse.de>
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+# Copyright (c) 2008 Alexandre Oliva
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_DEFINE_DIR], [
+ prefix_NONE=
+ exec_prefix_NONE=
+ test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+ test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
+dnl refers to ${prefix}. Thus we have to use `eval' twice.
+ eval ac_define_dir="\"[$]$2\""
+ eval ac_define_dir="\"$ac_define_dir\""
+ AC_SUBST($1, "$ac_define_dir")
+ AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
+ test "$prefix_NONE" && prefix=NONE
+ test "$exec_prefix_NONE" && exec_prefix=NONE
+])
diff --git a/m4/ac_define_integer_bits.m4 b/m4/ac_define_integer_bits.m4
new file mode 100644
index 0000000..431d769
--- /dev/null
+++ b/m4/ac_define_integer_bits.m4
@@ -0,0 +1,76 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_define_integer_bits.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_DEFINE_INTEGER_BITS (TYPE [, CANDIDATE-TYPE]...)
+#
+# DESCRIPTION
+#
+# Given a TYPE of the form "int##_t" or "uint##_t", see if the datatype
+# TYPE is predefined. If not, then define TYPE -- both with AC_DEFINE and
+# as a shell variable -- to the first datatype of exactly ## bits in a
+# list of CANDIDATE-TYPEs. If none of the CANDIDATE-TYPEs contains exactly
+# ## bits, then set the TYPE shell variable to "no".
+#
+# For example, the following ensures that uint64_t is defined as a 64-bit
+# datatype:
+#
+# AC_DEFINE_INTEGER_BITS(uint64_t, unsigned long long, unsigned __int64, long)
+# if test "$uint64_t" = no; then
+# AC_MSG_ERROR([unable to continue without a 64-bit datatype])
+# fi
+#
+# You should then put the following in your C code to ensure that all
+# datatypes defined by AC_DEFINE_INTEGER_BITS are visible to your program:
+#
+# #include "config.h"
+#
+# #if HAVE_INTTYPES_H
+# # include <inttypes.h>
+# #else
+# # if HAVE_STDINT_H
+# # include <stdint.h>
+# # endif
+# #endif
+#
+# LICENSE
+#
+# Copyright (c) 2008 Scott Pakin <pakin@uiuc.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_DEFINE_INTEGER_BITS],
+[m4_define([ac_datatype_bits], [m4_translit($1, [a-zA-Z_])])
+m4_define([ac_datatype_bytes], [m4_eval(ac_datatype_bits/8)])
+AC_CHECK_TYPE($1, ,
+ [
+ AC_MSG_NOTICE([trying to find a suitable ]ac_datatype_bytes[-byte replacement for $1])
+ $1=no
+ find_$1 ()
+ {
+ _AC_DEFINE_INTEGER_BITS_HELPER($@)
+ :
+ }
+ find_$1
+ AC_DEFINE_UNQUOTED($1, $$1,
+ [If not already defined, then define as a datatype of *exactly* ]ac_datatype_bits[ bits.])
+ ])
+])
+
+dnl Iterate over arguments $2..$N, trying to find a good match for $1.
+m4_define([_AC_DEFINE_INTEGER_BITS_HELPER],
+[ifelse($2, , ,
+ [m4_define([ac_datatype_bits], [m4_translit($1, [a-zA-Z_])])
+ m4_define([ac_datatype_bytes], [m4_eval(ac_datatype_bits/8)])
+ AC_CHECK_SIZEOF($2)
+ if test "$AS_TR_SH(ac_cv_sizeof_$2)" -eq ac_datatype_bytes; then
+ $1="$2"
+ return
+ fi
+ _AC_DEFINE_INTEGER_BITS_HELPER($1, m4_shift(m4_shift($@)))
+ ])
+])
diff --git a/m4/ac_define_sub_path.m4 b/m4/ac_define_sub_path.m4
new file mode 100644
index 0000000..e2f99ac
--- /dev/null
+++ b/m4/ac_define_sub_path.m4
@@ -0,0 +1,100 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_define_sub_path.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_DEFINE_SUB_PATH(DEFNAME, varname, description)
+#
+# DESCRIPTION
+#
+# Look at varname and detect the subpath that it contains relative to
+# $prefix/$exec_prefix. If the path is indeed relative to
+# $prefix/$exec_prefix, then a single "./" (dotslash) is prepended,
+# otherwise it can be seen as an absolute path that can not be moved,
+# which you possibly do for "/etc" files, or even those ending up in
+# "/lib/modules" or "/winnt/system".
+#
+# This macro is not very intelligent, it's just a first try in this
+# direction. It does currently just look into the current patterns, and
+# replaces a ${prefix} with a simple dot. Amazingly, it works quite well
+# for most packages.
+#
+# Example (configure.ac):
+#
+# AC_DEFINE_DIR([EPREFIX], [exec_prefix], [--exec-prefix or default])
+# AC_DEFINE_SUB_PATH([PATH_LIBDIR], [libdir], [--bindir subdir])
+# AC_DEFINE_UNQUOTED([PACKAGE],"$PACKAGE", [Name of package])
+#
+# Example (in C):
+#
+# static const char _libdir[] = PATH_LIBDIR; /* configure default */
+# char* libdir;
+# char* eprefix = getenv (PACKAGE "DIR");
+# if (! eprefix) eprefix = EPREFIX; /* default */
+# if (*_libdir != '.') libdir = strdup(_libdir);
+# else {
+# libdir = malloc(strlen(eprefix) + strlen(_libdir) + 2);
+# strcpy(libdir, eprefix);
+# strcat(libdir, PATH_DELIMITER_STRING);
+# strcat(libdir, _libdir);
+# }
+# ...
+# free (libdir);
+#
+# The AC_DEFINE_SUB_PATHS(varnames) macro looks for the given various
+# install-paths that largely depend on either ${prefix} or ${exec_prefix}.
+# Just cut out the prefix and ac_define the value. The value is uppercased
+# and PATH_ prepended ie. ac_define_sub_paths(bindir libdir pkgdatadir)
+# will create the defines PATH_BINDIR PATH_LIBDIR PATH_PKGDATADIR - see
+# posix' include/paths.h that creates _PATH_DEV and friends.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_DEFINE_SUB_PATH],
+[dnl
+ test "_$prefix" = _NONE && prefix="$ac_default_prefix"
+ test "_$exec_prefix" = _NONE && exec_prefix='${prefix}'
+ P=`echo ifelse( $2, , [$]$1, [$]$2) | sed -e 's:^\${[a-z_]*prefix}:.:'`
+ ifelse ($3, ,
+ AC_DEFINE($1, $P, [sub path $2]),
+ AC_DEFINE($1, $P, $3))
+])
+
+AC_DEFUN([AC_DEFINE_SUB_PATHS],
+[dnl
+ test "_$prefix" = _NONE && prefix="$ac_default_prefix"
+ test "_$exec_prefix" = _NONE && exec_prefix='${prefix}'
+ for i in $1 ; do
+ P=`echo \$$i | sed -e 's:^\${[a-z_]*prefix}:.:'`
+ V=`echo path_$i | sed -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:'`
+ AC_DEFINE($V, $P, [sub path $i]),
+])
diff --git a/m4/ac_func_accept_argtypes.m4 b/m4/ac_func_accept_argtypes.m4
new file mode 100644
index 0000000..7e96dcf
--- /dev/null
+++ b/m4/ac_func_accept_argtypes.m4
@@ -0,0 +1,87 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_func_accept_argtypes.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_FUNC_ACCEPT_ARGTYPES
+#
+# DESCRIPTION
+#
+# Checks the data types of the three arguments to accept(). Results are
+# placed into the symbols ACCEPT_TYPE_ARG[123], consistent with the
+# following example:
+#
+# #define ACCEPT_TYPE_ARG1 int
+# #define ACCEPT_TYPE_ARG2 struct sockaddr *
+# #define ACCEPT_TYPE_ARG3 socklen_t *
+#
+# This macro requires AC_CHECK_HEADERS to have already verified the
+# presence or absence of sys/types.h and sys/socket.h.
+#
+# NOTE: This is just a modified version of the AC_FUNC_SELECT_ARGTYPES
+# macro. Credit for that one goes to David MacKenzie et. al.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Daniel Richard G. <skunk@iskunk.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_FUNC_ACCEPT_ARGTYPES],
+[AC_MSG_CHECKING([types of arguments for accept()])
+ AC_CACHE_VAL(ac_cv_func_accept_arg1,dnl
+ [AC_CACHE_VAL(ac_cv_func_accept_arg2,dnl
+ [AC_CACHE_VAL(ac_cv_func_accept_arg3,dnl
+ [for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do
+ for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'void *'; do
+ for ac_cv_func_accept_arg3 in 'socklen_t *' 'size_t *' 'unsigned int *' 'int *'; do
+ AC_TRY_COMPILE(dnl
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+extern accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3);],,dnl
+ [ac_not_found=no ; break 3], ac_not_found=yes)
+ done
+ done
+ done
+ ])dnl AC_CACHE_VAL
+ ])dnl AC_CACHE_VAL
+ ])dnl AC_CACHE_VAL
+ if test "$ac_not_found" = yes; then
+ ac_cv_func_accept_arg1=int
+ ac_cv_func_accept_arg2='struct sockaddr *'
+ ac_cv_func_accept_arg3='socklen_t *'
+ fi
+ AC_MSG_RESULT([$ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3])
+ AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG1,$ac_cv_func_accept_arg1)
+ AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG2,$ac_cv_func_accept_arg2)
+ AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG3,$ac_cv_func_accept_arg3)
+])
diff --git a/m4/ac_func_memmove.m4 b/m4/ac_func_memmove.m4
new file mode 100644
index 0000000..023c4e8
--- /dev/null
+++ b/m4/ac_func_memmove.m4
@@ -0,0 +1,47 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_func_memmove.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_FUNC_MEMMOVE
+#
+# DESCRIPTION
+#
+# Checks for a memmove that can handle overlaps correctly. If no working
+# memmove is found, request a replacement and warn the user about it.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Rüdiger Kuhlmann <info@ruediger-kuhlmann.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_FUNC_MEMMOVE],
+[AC_CHECK_FUNCS(memmove)
+AC_MSG_CHECKING(for working memmove)
+AC_CACHE_VAL(ac_cv_have_working_memmove,
+[AC_TRY_RUN(
+[#include <stdio.h>
+
+int main(void)
+{
+ char buf[10];
+ strcpy (buf, "01234567");
+ memmove (buf, buf + 2, 3);
+ if (strcmp (buf, "23434567"))
+ exit (1);
+ strcpy (buf, "01234567");
+ memmove (buf + 2, buf, 3);
+ if (strcmp (buf, "01012567"))
+ exit (1);
+ exit (0);
+}], ac_cv_have_working_memmove=yes, ac_cv_have_working_memmove=no, ac_cv_have_working_memmove=cross)])
+AC_MSG_RESULT([$ac_cv_have_working_memmove])
+if test x$ac_cv_have_working_memmove != "xyes"; then
+ AC_LIBOBJ(memmove)
+ AC_MSG_WARN([Replacing missing/broken memmove.])
+ AC_DEFINE(PREFER_PORTABLE_MEMMOVE, 1, "enable replacement memmove if system memmove is broken or missing")
+fi])
diff --git a/m4/ac_func_mkdir.m4 b/m4/ac_func_mkdir.m4
new file mode 100644
index 0000000..363653a
--- /dev/null
+++ b/m4/ac_func_mkdir.m4
@@ -0,0 +1,96 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_func_mkdir.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_FUNC_MKDIR
+#
+# DESCRIPTION
+#
+# Check whether mkdir() is mkdir or _mkdir, and whether it takes one or
+# two arguments.
+#
+# This macro can define HAVE_MKDIR, HAVE__MKDIR, and MKDIR_TAKES_ONE_ARG,
+# which are expected to be used as follows:
+#
+# #if HAVE_MKDIR
+# # if MKDIR_TAKES_ONE_ARG
+# /* MinGW32 */
+# # define mkdir(a, b) mkdir(a)
+# # endif
+# #else
+# # if HAVE__MKDIR
+# /* plain Windows 32 */
+# # define mkdir(a, b) _mkdir(a)
+# # else
+# # error "Don't know how to create a directory on this system."
+# # endif
+# #endif
+#
+# LICENSE
+#
+# Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_FUNC_MKDIR],
+[AC_CHECK_FUNCS([mkdir _mkdir])
+AC_CACHE_CHECK([whether mkdir takes one argument],
+ [ac_cv_mkdir_takes_one_arg],
+[AC_TRY_COMPILE([
+#include <sys/stat.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+], [mkdir (".");],
+[ac_cv_mkdir_takes_one_arg=yes], [ac_cv_mkdir_takes_one_arg=no])])
+if test x"$ac_cv_mkdir_takes_one_arg" = xyes; then
+ AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1,
+ [Define if mkdir takes only one argument.])
+fi
+])
+
+dnl Note:
+dnl =====
+dnl I have not implemented the following suggestion because I don't have
+dnl access to such a broken environment to test the macro. So I'm just
+dnl appending the comments here in case you have, and want to fix
+dnl AC_FUNC_MKDIR that way.
+dnl
+dnl |Thomas E. Dickey (dickey@herndon4.his.com) said:
+dnl | it doesn't cover the problem areas (compilers that mistreat mkdir
+dnl | may prototype it in dir.h and dirent.h, for instance).
+dnl |
+dnl |Alexandre:
+dnl | Would it be sufficient to check for these headers and #include
+dnl | them in the AC_TRY_COMPILE block? (and is AC_HEADER_DIRENT
+dnl | suitable for this?)
+dnl |
+dnl |Thomas:
+dnl | I think that might be a good starting point (with the set of recommended
+dnl | ifdef's and includes for AC_HEADER_DIRENT, of course).
diff --git a/m4/ac_func_snprintf.m4 b/m4/ac_func_snprintf.m4
new file mode 100644
index 0000000..3739b80
--- /dev/null
+++ b/m4/ac_func_snprintf.m4
@@ -0,0 +1,81 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_func_snprintf.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_FUNC_SNPRINTF
+#
+# DESCRIPTION
+#
+# Checks for a fully C99 compliant snprintf, in particular checks whether
+# it does bounds checking and returns the correct string length; does the
+# same check for vsnprintf. If no working snprintf or vsnprintf is found,
+# request a replacement and warn the user about it. Note: the mentioned
+# replacement is freely available and may be used in any project
+# regardless of it's license.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Rüdiger Kuhlmann <info@ruediger-kuhlmann.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_FUNC_SNPRINTF],
+[AC_CHECK_FUNCS(snprintf vsnprintf)
+AC_MSG_CHECKING(for working snprintf)
+AC_CACHE_VAL(ac_cv_have_working_snprintf,
+[AC_TRY_RUN(
+[#include <stdio.h>
+
+int main(void)
+{
+ char bufs[5] = { 'x', 'x', 'x', '\0', '\0' };
+ char bufd[5] = { 'x', 'x', 'x', '\0', '\0' };
+ int i;
+ i = snprintf (bufs, 2, "%s", "111");
+ if (strcmp (bufs, "1")) exit (1);
+ if (i != 3) exit (1);
+ i = snprintf (bufd, 2, "%d", 111);
+ if (strcmp (bufd, "1")) exit (1);
+ if (i != 3) exit (1);
+ exit(0);
+}], ac_cv_have_working_snprintf=yes, ac_cv_have_working_snprintf=no, ac_cv_have_working_snprintf=cross)])
+AC_MSG_RESULT([$ac_cv_have_working_snprintf])
+AC_MSG_CHECKING(for working vsnprintf)
+AC_CACHE_VAL(ac_cv_have_working_vsnprintf,
+[AC_TRY_RUN(
+[#include <stdio.h>
+#include <stdarg.h>
+
+int my_vsnprintf (char *buf, const char *tmpl, ...)
+{
+ int i;
+ va_list args;
+ va_start (args, tmpl);
+ i = vsnprintf (buf, 2, tmpl, args);
+ va_end (args);
+ return i;
+}
+
+int main(void)
+{
+ char bufs[5] = { 'x', 'x', 'x', '\0', '\0' };
+ char bufd[5] = { 'x', 'x', 'x', '\0', '\0' };
+ int i;
+ i = my_vsnprintf (bufs, "%s", "111");
+ if (strcmp (bufs, "1")) exit (1);
+ if (i != 3) exit (1);
+ i = my_vsnprintf (bufd, "%d", 111);
+ if (strcmp (bufd, "1")) exit (1);
+ if (i != 3) exit (1);
+ exit(0);
+}], ac_cv_have_working_vsnprintf=yes, ac_cv_have_working_vsnprintf=no, ac_cv_have_working_vsnprintf=cross)])
+AC_MSG_RESULT([$ac_cv_have_working_vsnprintf])
+if test x$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf != "xyesyes"; then
+ AC_LIBOBJ(snprintf)
+ AC_MSG_WARN([Replacing missing/broken (v)snprintf() with version from http://www.ijs.si/software/snprintf/.])
+ AC_DEFINE(PREFER_PORTABLE_SNPRINTF, 1, "enable replacement (v)snprintf if system (v)snprintf is broken")
+fi])
diff --git a/m4/ac_java_options.m4 b/m4/ac_java_options.m4
new file mode 100644
index 0000000..f23b4c3
--- /dev/null
+++ b/m4/ac_java_options.m4
@@ -0,0 +1,44 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_java_options.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_JAVA_OPTIONS
+#
+# DESCRIPTION
+#
+# AC_JAVA_OPTIONS adds configure command line options used for Java m4
+# macros. This Macro is optional.
+#
+# Note: This is part of the set of autoconf M4 macros for Java programs.
+# It is VERY IMPORTANT that you download the whole set, some macros depend
+# on other. Unfortunately, the autoconf archive does not support the
+# concept of set of macros, so I had to break it for submission. The
+# general documentation, as well as the sample configure.in, is included
+# in the AC_PROG_JAVA macro.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Devin Weaver <ktohg@tritarget.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_JAVA_OPTIONS],[
+AC_ARG_WITH(java-prefix,
+ [ --with-java-prefix=PFX prefix where Java runtime is installed (optional)])
+AC_ARG_WITH(javac-flags,
+ [ --with-javac-flags=FLAGS flags to pass to the Java compiler (optional)])
+AC_ARG_WITH(java-flags,
+ [ --with-java-flags=FLAGS flags to pass to the Java VM (optional)])
+JAVAPREFIX=$with_java_prefix
+JAVACFLAGS=$with_javac_flags
+JAVAFLAGS=$with_java_flags
+AC_SUBST(JAVAPREFIX)dnl
+AC_SUBST(JAVACFLAGS)dnl
+AC_SUBST(JAVAFLAGS)dnl
+AC_SUBST(JAVA)dnl
+AC_SUBST(JAVAC)dnl
+])
diff --git a/m4/ac_jni_include_dir.m4 b/m4/ac_jni_include_dir.m4
new file mode 100644
index 0000000..5116830
--- /dev/null
+++ b/m4/ac_jni_include_dir.m4
@@ -0,0 +1,109 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_jni_include_dir.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_JNI_INCLUDE_DIR
+#
+# DESCRIPTION
+#
+# AC_JNI_INCLUDE_DIR finds include directories needed for compiling
+# programs using the JNI interface.
+#
+# JNI include directories are usually in the java distribution This is
+# deduced from the value of JAVAC. When this macro completes, a list of
+# directories is left in the variable JNI_INCLUDE_DIRS.
+#
+# Example usage follows:
+#
+# AC_JNI_INCLUDE_DIR
+#
+# for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
+# do
+# CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
+# done
+#
+# If you want to force a specific compiler:
+#
+# - at the configure.in level, set JAVAC=yourcompiler before calling
+# AC_JNI_INCLUDE_DIR
+#
+# - at the configure level, setenv JAVAC
+#
+# Note: This macro can work with the autoconf M4 macros for Java programs.
+# This particular macro is not part of the original set of macros.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Don Anderson <dda@sleepycat.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_JNI_INCLUDE_DIR],[
+
+JNI_INCLUDE_DIRS=""
+
+test "x$JAVAC" = x && AC_MSG_ERROR(['\$JAVAC' undefined])
+AC_PATH_PROG(_ACJNI_JAVAC, $JAVAC, no)
+test "x$_ACJNI_JAVAC" = xno && AC_MSG_ERROR([$JAVAC could not be found in path])
+
+_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
+_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
+case "$host_os" in
+ darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+ _JINC="$_JTOPDIR/Headers";;
+ *) _JINC="$_JTOPDIR/include";;
+esac
+if test -f "$_JINC/jni.h"; then
+ JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JINC"
+else
+ _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+ if test -f "$_JTOPDIR/include/jni.h"; then
+ JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include"
+ else
+ AC_MSG_ERROR([cannot find java include files])
+ fi
+fi
+
+# get the likely subdirectories for system specific java includes
+case "$host_os" in
+bsdi*) _JNI_INC_SUBDIRS="bsdos";;
+linux*) _JNI_INC_SUBDIRS="linux genunix";;
+osf*) _JNI_INC_SUBDIRS="alpha";;
+solaris*) _JNI_INC_SUBDIRS="solaris";;
+mingw*) _JNI_INC_SUBDIRS="win32";;
+cygwin*) _JNI_INC_SUBDIRS="win32";;
+*) _JNI_INC_SUBDIRS="genunix";;
+esac
+
+# add any subdirectories that are present
+for JINCSUBDIR in $_JNI_INC_SUBDIRS
+do
+ if test -d "$_JTOPDIR/include/$JINCSUBDIR"; then
+ JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include/$JINCSUBDIR"
+ fi
+done
+])
+
+# _ACJNI_FOLLOW_SYMLINKS <path>
+# Follows symbolic links on <path>,
+# finally setting variable _ACJNI_FOLLOWED
+# --------------------
+AC_DEFUN([_ACJNI_FOLLOW_SYMLINKS],[
+# find the include directory relative to the javac executable
+_cur="$1"
+while ls -ld "$_cur" 2>/dev/null | grep " -> " >/dev/null; do
+ AC_MSG_CHECKING(symlink for $_cur)
+ _slink=`ls -ld "$_cur" | sed 's/.* -> //'`
+ case "$_slink" in
+ /*) _cur="$_slink";;
+ # 'X' avoids triggering unwanted echo options.
+ *) _cur=`echo "X$_cur" | sed -e 's/^X//' -e 's:[[^/]]*$::'`"$_slink";;
+ esac
+ AC_MSG_RESULT($_cur)
+done
+_ACJNI_FOLLOWED="$_cur"
+])# _ACJNI
diff --git a/m4/ac_lib_id3.m4 b/m4/ac_lib_id3.m4
new file mode 100644
index 0000000..2776714
--- /dev/null
+++ b/m4/ac_lib_id3.m4
@@ -0,0 +1,73 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_lib_id3.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_LIB_ID3([ACTION-IF-TRUE], [ACTION-IF-FALSE])
+#
+# DESCRIPTION
+#
+# This macro will check for the existence of id3lib
+# (http://id3lib.sourceforge.net/). It does this by checking for the
+# header file id3.h and the id3 library object file. A --with-id3lib
+# option is supported as well. The following output variables are set with
+# AC_SUBST:
+#
+# ID3_CPPFLAGS
+# ID3_LDFLAGS
+# ID3_LIBS
+#
+# You can use them like this in Makefile.am:
+#
+# AM_CPPFLAGS = $(ID3_CPPFLAGS)
+# AM_LDFLAGS = $(ID3_LDFLAGS)
+# program_LDADD = $(ID3_LIBS)
+#
+# Additionally, the C preprocessor symbol HAVE_ID3LIB will be defined with
+# AC_DEFINE if id3lib is available.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Oskar Liljeblad <oskar@osk.mine.nu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_LIB_ID3], [
+ AH_TEMPLATE([HAVE_ID3LIB], [Define if id3lib is available])
+ AC_ARG_WITH(id3lib, [ --with-id3lib=DIR prefix for id3 library files and headers], [
+ if test "$withval" = "no"; then
+ ac_id3_path=
+ $2
+ elif test "$withval" = "yes"; then
+ ac_id3_path=/usr
+ else
+ ac_id3_path="$withval"
+ fi
+ ],[ac_id3_path=/usr])
+ if test "$ac_id3_path" != ""; then
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$ac_id3_path/include"
+ AC_CHECK_HEADER([id3.h], [
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -L$ac_id3_path/lib"
+ AC_CHECK_LIB(id3, ID3Tag_New, [
+ AC_SUBST(ID3_CPPFLAGS, [-I$ac_id3_path/include])
+ AC_SUBST(ID3_LDFLAGS, [-L$ac_id3_path/lib])
+ AC_SUBST(ID3_LIBS, [-lid3])
+ AC_DEFINE([HAVE_ID3LIB])
+ $1
+ ], [
+ :
+ $2
+ ])
+ LDFLAGS="$saved_LDFLAGS"
+ ], [
+ AC_MSG_RESULT([not found])
+ $2
+ ])
+ CPPFLAGS="$saved_CPPFLAGS"
+ fi
+])
diff --git a/m4/ac_lib_upnp.m4 b/m4/ac_lib_upnp.m4
new file mode 100644
index 0000000..f69df93
--- /dev/null
+++ b/m4/ac_lib_upnp.m4
@@ -0,0 +1,72 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_lib_upnp.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_LIB_UPNP([ACTION-IF-TRUE], [ACTION-IF-FALSE])
+#
+# DESCRIPTION
+#
+# This macro will check for the existence of libupnp
+# (http://upnp.sourceforge.net/). It does this by checking for the header
+# file upnp.h and the upnp library object file. A --with-libupnp option is
+# supported as well. The following output variables are set with AC_SUBST:
+#
+# UPNP_CPPFLAGS
+# UPNP_LDFLAGS
+# UPNP_LIBS
+#
+# You can use them like this in Makefile.am:
+#
+# AM_CPPFLAGS = $(UPNP_CPPFLAGS)
+# AM_LDFLAGS = $(UPNP_LDFLAGS)
+# program_LDADD = $(UPNP_LIBS)
+#
+# Additionally, the C preprocessor symbol HAVE_LIBUPNP will be defined
+# with AC_DEFINE if libupnp is available.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Oskar Liljeblad <oskar@osk.mine.nu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_LIB_UPNP], [
+ AH_TEMPLATE([HAVE_LIBUPNP], [Define if libupnp is available])
+ AC_ARG_WITH(libupnp, [ --with-libupnp=DIR prefix for upnp library files and headers], [
+ if test "$withval" = "no"; then
+ ac_upnp_path=
+ $2
+ elif test "$withval" = "yes"; then
+ ac_upnp_path=/usr
+ else
+ ac_upnp_path="$withval"
+ fi
+ ],[ac_upnp_path=/usr])
+ if test "$ac_upnp_path" != ""; then
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$ac_upnp_path/include/upnp"
+ AC_CHECK_HEADER([upnp.h], [
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -L$ac_upnp_path/lib"
+ AC_CHECK_LIB(upnp, UpnpInit, [
+ AC_SUBST(UPNP_CPPFLAGS, [-I$ac_upnp_path/include/upnp])
+ AC_SUBST(UPNP_LDFLAGS, [-L$ac_upnp_path/lib])
+ AC_SUBST(UPNP_LIBS, [-lupnp])
+ AC_DEFINE([HAVE_LIBUPNP])
+ $1
+ ], [
+ :
+ $2
+ ])
+ LDFLAGS="$saved_LDFLAGS"
+ ], [
+ AC_MSG_RESULT([not found])
+ $2
+ ])
+ CPPFLAGS="$saved_CPPFLAGS"
+ fi
+])
diff --git a/m4/ac_lib_wad.m4 b/m4/ac_lib_wad.m4
new file mode 100644
index 0000000..13c38d4
--- /dev/null
+++ b/m4/ac_lib_wad.m4
@@ -0,0 +1,66 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_lib_wad.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_LIB_WAD
+#
+# DESCRIPTION
+#
+# This macro searches for an installed WAD library.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de>
+# Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
+# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net>
+# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_LIB_WAD],
+[
+ AC_REQUIRE([AC_PYTHON_DEVEL])
+ AC_ARG_ENABLE(wad,
+ AC_HELP_STRING([--enable-wad], [enable wad module]),
+ [
+ case "${enableval}" in
+ no) ;;
+ *) if test "x${enableval}" = xyes;
+ then
+ check_wad="yes"
+ fi ;;
+ esac
+ ], [])
+
+ if test -n "$check_wad";
+ then
+ AC_CHECK_LIB(wadpy, _init, [WADPY=-lwadpy], [], $PYTHON_LDFLAGS $PYTHON_EXTRA_LIBS)
+ AC_SUBST(WADPY)
+ fi
+])
diff --git a/m4/ac_libtoolize_cflags.m4 b/m4/ac_libtoolize_cflags.m4
new file mode 100644
index 0000000..bf2328a
--- /dev/null
+++ b/m4/ac_libtoolize_cflags.m4
@@ -0,0 +1,29 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_libtoolize_cflags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_LIBTOOLIZE_CFLAGS(COMPILER-FLAGS-VAR)
+#
+# DESCRIPTION
+#
+# Change the contents of variable COMPILER-FLAGS-VAR so that they are
+# Libtool friendly, ie. prefix each of them with `-Xcompiler' so that
+# Libtool doesn't remove them.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ludovic Courtès <ludo@chbouib.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_LIBTOOLIZE_CFLAGS],
+ [ac_libtoolize_ldflags_temp=""
+ for i in $$1
+ do
+ ac_libtoolize_ldflags_temp="$ac_libtoolize_ldflags_temp -Xcompiler $i"
+ done
+ $1="$ac_libtoolize_ldflags_temp"])dnl
diff --git a/m4/ac_numeric_namedlevel.m4 b/m4/ac_numeric_namedlevel.m4
new file mode 100644
index 0000000..c954b03
--- /dev/null
+++ b/m4/ac_numeric_namedlevel.m4
@@ -0,0 +1,107 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_numeric_namedlevel.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_NUMERIC_NAMEDLEVEL(VARNAME [,FROMVAR [,DEFAULT [,YESLEVEL]]])
+#
+# DESCRIPTION
+#
+# The levelstring FROMVAR is expanded and checked for verbal names that
+# will map on to eight different levels - the VARNAME will receive this
+# numeric level where "all" maps to 7 (lower three bits set) higher levels
+# for 8 and 9 exist too. This macro is a nice helper to convert user input
+# of a --with-opt=level into a numeric form that can be simply pushed as a
+# #define like with AC_DEFINE:
+#
+# default YESLEVEL = 2 /* including unknown levelspec */
+# default DEFAULT = 0 /* when named level is empty */
+# default FROMVAR = VARNAME
+#
+# The DEFAULT value is used if the NAMED levelstring has become empty and
+# it is copied without further conversion - a default of "0" is used if
+# absent - identical to "no". A "yes" will be set to the YESLEVEL - and
+# note that "yes" has "2" as its default value not "1". (which comes from
+# its original use to set a "gcc -O2").
+#
+# the mnemonic names are:
+#
+# 9| insane |ultrasome|experimentalplus
+# 8| ultra |ultra|experimental)
+# 7| all |muchmore|somemanymore|manymoreplus
+# 6| most |manymore|most)
+# 5| strict |somemore|almost
+# 4| more |more
+# 3| extra |manyplus|plusmuch|somemany|plusmany
+# 2| many |many|much|(yes)
+# 1| some |some|plus
+#
+# note that a level can be construcct of (some|plus) = bit-0, (many|much)
+# = bit-1, (more) = bit-2, (ultra|experimental) = bit-3 atleast in a
+# left-to-right order, ie. plusmanymore=7
+#
+# Example usage:
+#
+# AC_NUMERIC_NAMEDLEVEL(OPTLEVEL,with_optlevel,1,3)
+# AC_DEFINE(OPTLEVEL)
+# test "$GCC" = "yes" && CFLAGS="$CFLAGS -O$OPTLEVEL)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_NUMERIC_NAMEDLEVEL],
+[dnl the names to be defined...
+$1="ifelse($1,,[$]$2,[$]$1)" ; $1="[$]$1"
+$1="[$]$1" ; $1="[$]$1"
+if test "_[$]$1" = "_" ; then
+ $1="ifelse([$3],,0,[$3])"
+elif test "_[$]$1" = "_yes" ; then
+ $1="ifelse([$4],,2,[$4])"
+else
+ $1=`echo [$]$1 | sed -e 's,some,plus,' -e 's,experimental,ultra,' -e 's,over,ultra,' -e 's,much,many,'`
+ case "[$]$1" in
+ 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*|-*|+*) ;; # leave as is
+ insane|ultraplus|plusultra) $1="9" ;;
+ ultra) $1="8" ;;
+ manymoreplus|manyplusmore|plusmanymore|all) $1="7" ;;
+ moremanyplus|moreplusmany|plusmoremany) $1="7" ;;
+ manymore|moremany|most) $1="6" ;;
+ somemore|moresome|almost) $1="5" ;;
+ more) $1="4" ;;
+ manyplus|plusmany|extra) $1="3" ;;
+ many) $1="2" ;;
+ plus) $1="1" ;;
+ no) $1="0" ;;
+ yes) $1="ifelse([$4],,2,[$4])" ;;
+ *) $1="ifelse([$3],,1,[$3])" ;; # for other unkown stuff.
+ esac
+fi
+])
diff --git a/m4/ac_path_generic.m4 b/m4/ac_path_generic.m4
new file mode 100644
index 0000000..6d89ed7
--- /dev/null
+++ b/m4/ac_path_generic.m4
@@ -0,0 +1,171 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_path_generic.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PATH_GENERIC(LIBRARY [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+#
+# DESCRIPTION
+#
+# Runs a LIBRARY-config script and defines LIBRARY_CFLAGS and LIBRARY_LIBS
+#
+# The script must support `--cflags' and `--libs' args. If MINIMUM-VERSION
+# is specified, the script must also support the `--version' arg. If the
+# `--with-library-[exec-]prefix' arguments to ./configure are given, it
+# must also support `--prefix' and `--exec-prefix'. (In other words, it
+# must be like gtk-config.)
+#
+# For example:
+#
+# AC_PATH_GENERIC(Foo, 1.0.0)
+#
+# would run `foo-config --version' and check that it is at least 1.0.0
+#
+# If so, the following would then be defined:
+#
+# FOO_CFLAGS to `foo-config --cflags`
+# FOO_LIBS to `foo-config --libs`
+#
+# At present there is no support for additional "MODULES" (see
+# AM_PATH_GTK) (shamelessly stolen from gtk.m4 and then hacked around a
+# fair amount)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Angus Lees
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PATH_GENERIC],
+[dnl
+dnl we're going to need uppercase, lowercase and user-friendly versions of the
+dnl string `LIBRARY'
+pushdef([UP], translit([$1], [a-z], [A-Z]))dnl
+pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
+
+dnl
+dnl Get the cflags and libraries from the LIBRARY-config script
+dnl
+AC_ARG_WITH(DOWN-prefix,[ --with-]DOWN[-prefix=PFX Prefix where $1 is installed (optional)],
+ DOWN[]_config_prefix="$withval", DOWN[]_config_prefix="")
+AC_ARG_WITH(DOWN-exec-prefix,[ --with-]DOWN[-exec-prefix=PFX Exec prefix where $1 is installed (optional)],
+ DOWN[]_config_exec_prefix="$withval", DOWN[]_config_exec_prefix="")
+
+ if test x$DOWN[]_config_exec_prefix != x ; then
+ DOWN[]_config_args="$DOWN[]_config_args --exec-prefix=$DOWN[]_config_exec_prefix"
+ if test x${UP[]_CONFIG+set} != xset ; then
+ UP[]_CONFIG=$DOWN[]_config_exec_prefix/bin/DOWN-config
+ fi
+ fi
+ if test x$DOWN[]_config_prefix != x ; then
+ DOWN[]_config_args="$DOWN[]_config_args --prefix=$DOWN[]_config_prefix"
+ if test x${UP[]_CONFIG+set} != xset ; then
+ UP[]_CONFIG=$DOWN[]_config_prefix/bin/DOWN-config
+ fi
+ fi
+
+ AC_PATH_PROG(UP[]_CONFIG, DOWN-config, no)
+ ifelse([$2], ,
+ AC_MSG_CHECKING(for $1),
+ AC_MSG_CHECKING(for $1 - version >= $2)
+ )
+ no_[]DOWN=""
+ if test "$UP[]_CONFIG" = "no" ; then
+ no_[]DOWN=yes
+ else
+ UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args --cflags`"
+ UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args --libs`"
+ ifelse([$2], , ,[
+ DOWN[]_config_major_version=`$UP[]_CONFIG $DOWN[]_config_args \
+ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ DOWN[]_config_minor_version=`$UP[]_CONFIG $DOWN[]_config_args \
+ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ DOWN[]_config_micro_version=`$UP[]_CONFIG $DOWN[]_config_args \
+ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ DOWN[]_wanted_major_version="regexp($2, [\<\([0-9]*\)], [\1])"
+ DOWN[]_wanted_minor_version="regexp($2, [\<\([0-9]*\)\.\([0-9]*\)], [\2])"
+ DOWN[]_wanted_micro_version="regexp($2, [\<\([0-9]*\).\([0-9]*\).\([0-9]*\)], [\3])"
+
+ # Compare wanted version to what config script returned.
+ # If I knew what library was being run, i'd probably also compile
+ # a test program at this point (which also extracted and tested
+ # the version in some library-specific way)
+ if test "$DOWN[]_config_major_version" -lt \
+ "$DOWN[]_wanted_major_version" \
+ -o \( "$DOWN[]_config_major_version" -eq \
+ "$DOWN[]_wanted_major_version" \
+ -a "$DOWN[]_config_minor_version" -lt \
+ "$DOWN[]_wanted_minor_version" \) \
+ -o \( "$DOWN[]_config_major_version" -eq \
+ "$DOWN[]_wanted_major_version" \
+ -a "$DOWN[]_config_minor_version" -eq \
+ "$DOWN[]_wanted_minor_version" \
+ -a "$DOWN[]_config_micro_version" -lt \
+ "$DOWN[]_wanted_micro_version" \) ; then
+ # older version found
+ no_[]DOWN=yes
+ echo -n "*** An old version of $1 "
+ echo -n "($DOWN[]_config_major_version"
+ echo -n ".$DOWN[]_config_minor_version"
+ echo ".$DOWN[]_config_micro_version) was found."
+ echo -n "*** You need a version of $1 newer than "
+ echo -n "$DOWN[]_wanted_major_version"
+ echo -n ".$DOWN[]_wanted_minor_version"
+ echo ".$DOWN[]_wanted_micro_version."
+ echo "***"
+ echo "*** If you have already installed a sufficiently new version, this error"
+ echo "*** probably means that the wrong copy of the DOWN-config shell script is"
+ echo "*** being found. The easiest way to fix this is to remove the old version"
+ echo "*** of $1, but you can also set the UP[]_CONFIG environment to point to the"
+ echo "*** correct copy of DOWN-config. (In this case, you will have to"
+ echo "*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf"
+ echo "*** so that the correct libraries are found at run-time)"
+ fi
+ ])
+ fi
+ if test "x$no_[]DOWN" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$3], , :, [$3])
+ else
+ AC_MSG_RESULT(no)
+ if test "$UP[]_CONFIG" = "no" ; then
+ echo "*** The DOWN-config script installed by $1 could not be found"
+ echo "*** If $1 was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the UP[]_CONFIG environment variable to the"
+ echo "*** full path to DOWN-config."
+ fi
+ UP[]_CFLAGS=""
+ UP[]_LIBS=""
+ ifelse([$4], , :, [$4])
+ fi
+ AC_SUBST(UP[]_CFLAGS)
+ AC_SUBST(UP[]_LIBS)
+
+ popdef([UP])
+ popdef([DOWN])
+])
diff --git a/m4/ac_perl_module_version.m4 b/m4/ac_perl_module_version.m4
new file mode 100644
index 0000000..39a8799
--- /dev/null
+++ b/m4/ac_perl_module_version.m4
@@ -0,0 +1,81 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_perl_module_version.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PERL_MODULE_VERSION([MODULE VERSION], [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+#
+# DESCRIPTION
+#
+# Checks to see if the list of 'Module Version' are avaiable in the
+# system. If all the modules in the list are avaiable ACTION-IF-TRUE is
+# executed. Case one module is not avaiable ACTION-IF-FALSE is executed
+# and the macro execution is aborted. NOTE: Perl is needed.
+#
+# Example:
+#
+# AC_PERL_MODULE_VERSION(CGI::Test 0.104 CGI::Ajax 0.694, ,
+# AC_MSG_ERROR(Need some Perl modules))
+#
+# LICENSE
+#
+# Copyright (c) 2009 Marco Gomes <mpglesi@gmail.com>
+# Copyright (c) 2009 Ruben Fonseca <fonseka@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_PERL_MODULE_VERSION],[dnl
+ac_perl_list_modules="$1"
+# Make sure we have perl
+if test -z "$PERL"; then
+AC_CHECK_PROG(PERL,perl,perl)
+fi
+
+# Check the number of arguments
+args_num=`echo $ac_perl_list_modules | wc -w`
+let "ckeck_args = $args_num % 2"
+if test "$check_args" = "1" ; then
+ AC_MSG_ERROR(syntax error)
+else
+ eval
+fi
+
+if test "x$PERL" != x; then
+ ac_failed=0
+ while test ${#ac_perl_list_modules} -gt 2 ; do
+ module_name=`echo $ac_perl_list_modules | cut -d " " -f 1`
+ module_version=`echo $ac_perl_list_modules | cut -d " " -f 2`
+ ac_perl_list_modules=`echo $ac_perl_list_modules | cut -d " " -f 3-`
+ AC_MSG_CHECKING(for perl module $module_name version $module_version)
+
+ $PERL "-M$module_name" -e exit > /dev/null 2>&1
+ if test $? -ne 0; then
+ AC_MSG_RESULT(no);
+ ac_failed=1
+ ac_perl_list_modules=""
+ else
+ version=`$PERL "-M$module_name" -e 'print $'"$module_name::VERSION" 2>&1`
+ $PERL -e 'exit(shift cmp shift)' "$version" "$module_version"
+ if test $? -eq 0 -o $? -eq 1 ; then
+ AC_MSG_RESULT(ok);
+ else
+ AC_MSG_RESULT(no)
+ ac_failed=1
+ ac_perl_list_modules=""
+ fi
+ fi;
+ done
+
+ if test "$ac_failed" = 0; then
+ :
+ $2
+ else
+ :
+ $3
+ fi
+else
+ AC_MSG_ERROR(could not find perl)
+fi])dnl
diff --git a/m4/ac_pkg_mico.m4 b/m4/ac_pkg_mico.m4
new file mode 100644
index 0000000..c6e5707
--- /dev/null
+++ b/m4/ac_pkg_mico.m4
@@ -0,0 +1,215 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_pkg_mico.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PKG_MICO([X.X.X optional required])
+#
+# DESCRIPTION
+#
+# This macro searches for a MICO installation on your system. MICO (Mico
+# Is COrba) installs the file 'mico-setup.sh' under MICO_INSTALL_BASE/lib,
+# where MICO_INSTALL_BASE is probably /usr/local or /usr. If nothing was
+# specified when calling configure or just --with-mico, it searches in
+# $prefix/lib:/usr/local/lib:/usr/lib The argument of s--with-mico
+# specifies the full pathname of the mico-setup.sh file. For instance
+# --with-mico=/usr/local/mico-2.2.6/lib/mico-setup.sh.
+#
+# If the version argument is given (e.g. 2.2.6), AC_PKG_MICO checks that
+# the mico package is this version number or higher.
+#
+# The other optional argument to AC_PKG_MICO are 'optional' and
+# 'required'. by default, placing AC_PKG_MICO in your configure.in does
+# not enforce using mico, if it is not found on the system. If MICO
+# existence is critical for the building of your package, then you
+# probably want to specify something like "AC_PKG_MICO(2.2.6 required)".
+# Then, even if the --with-mico was not spcefied on the command line of
+# the configure script, an error will be raised if mico was not found.
+#
+# If the mico package is not found, abort configuration with error
+# message.
+#
+# It defines the symbol MICOSETUP, MICOVERSION, MICOSHAREDDIR
+# MICO_INCLUDE, MICO_LIB and MICO_CXX if mico is found. In addition, the
+# mico script mico-c++ (set in (MICO_CXX) is scaned for a string match
+# "-I.*ministl" and if foundMICO_USE_MINISTL is set to 1, otherwise to 0.
+#
+# Example of use of these variables in your Makefile.in:
+#
+# INCLUDES += @MICO_INCLUDE@
+# LDFLAGS += @MICO_LIB@
+#
+# LICENSE
+#
+# Copyright (c) 2008 Tal Shalif <tal@shalif.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_PKG_MICO],
+[
+#
+# first parse the argument given in configure.in to AC_PKG_MICO
+#
+MICO_REQUEST_VERSION=
+MICO_URGENCY="optional"
+
+changequote(<<, >>)
+
+for a in $1 $2 $3 $4 $5 $6 $7 $8 $9 x; do
+ case "$a" in
+ x) break;;
+ [0-9]*.[0-9]*.[0-9]*) MICO_REQUEST_VERSION="$a";;
+ optional|required) MICO_URGENCY="$a";;
+ *) argerror="argument to the PKG_MICO macro must be one of 'X.X.X' 'required' or 'optional'";;
+ esac
+done
+
+changequote([, ])
+
+if test -n "$argerror"; then
+ AC_MSG_ERROR($argerror)
+fi;
+
+AC_MSG_CHECKING(if mico is wanted)
+AC_ARG_WITH(mico,
+ [ --with-mico=PATH absolute path name of mico's configuration file 'mico-setup.sh' (default is to search in \$prefix/lib:/usr/local/lib:/usr/lib),
+ --without-mico to disable mico detection],
+ [
+ #
+ # Run this if -with or -without was specified
+ #
+ case "$withval" in
+ yes) MICO_URGENCY=required;;
+ no) if test x$MICO_URGENCY = xrequired; then
+ AC_MSG_ERROR("PKG_MICO was configured with the 'required' option. You can not override it from the command line")
+ fi;
+ ;;
+ *) MICO_URGENCY=required; MICOSETUP="$withval" ;;
+ esac
+
+ ],[])
+
+AC_MSG_RESULT($MICO_URGENCY)
+
+#
+# Now we know if we want mico or not, only go further if
+# it's wanted.
+#
+if test x$MICO_URGENCY = xrequired -o x$MICO_URGENCY = xoptional; then
+ #
+ # If not specified by caller, search in standard places
+ #
+ if test -z "$MICOSETUP" ; then
+ AC_PATH_PROG(MICOSETUP, mico-setup.sh, , $prefix/lib:/usr/local/lib:/usr/lib)
+ fi
+ if test -z "$MICOSETUP" ; then
+ if test x$MICO_URGENCY = xrequired ; then
+ AC_MSG_ERROR("mico setup file mico-setup.sh not found")
+ else
+ AC_MSG_RESULT("mico setup file mico-setup.sh not found")
+ fi
+ else
+ # source mico-setup.sh
+ # Collect mico version number.
+ # But be carefull - mico-setup.sh
+ # unsets prefix and exec_prefix so save them first
+ sh -c ". $MICOSETUP; echo MICOVERSION=\${MICOVERSION}; echo MICOSHAREDDIR=\${MICOSHAREDDIR}; echo MICODIR=\${MICODIR}" > conftest.mico-setup
+
+ eval `cat conftest.mico-setup`
+
+ if test -z "$MICOVERSION" ; then
+ AC_MSG_ERROR("panic: could not read the MICOVERSION variable");
+ fi
+ #
+ # Check that mico version matches requested version or above
+ #
+ if test -n "$MICO_REQUEST_VERSION" ; then
+ changequote(<<, >>)dnl
+ MICO_MAJOR=`expr $MICOVERSION : '\([0-9]*\)\.[0-9]*\.[0-9]*'`
+ MICO_MINOR=`expr $MICOVERSION : '[0-9]*\.\([0-9]*\)\.[0-9]*'`
+ MICO_RELEASE=`expr $MICOVERSION : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+ MICO_REQUEST_MAJOR=`expr $MICO_REQUEST_VERSION : '\([0-9]*\)\.[0-9]*\.[0-9]*'`
+ MICO_REQUEST_MINOR=`expr $MICO_REQUEST_VERSION : '[0-9]*\.\([0-9]*\)\.[0-9]*'`
+ MICO_REQUEST_RELEASE=`expr $MICO_REQUEST_VERSION : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+ changequote([, ])dnl
+
+ AC_MSG_CHECKING(mico version >= $MICO_REQUEST_VERSION)
+
+ version_ok=yes
+ for verpair in "$MICO_MAJOR:$MICO_REQUEST_MAJOR" "$MICO_MINOR:$MICO_REQUEST_MINOR" "$MICO_RELEASE:$MICO_REQUEST_RELEASE"; do
+ if eval "test `echo $verpair | sed 's,:, -gt ,'`"; then
+ break
+ fi
+ if eval "test `echo $verpair | sed 's,:, -lt ,'`"; then
+ version_ok=no
+ break
+ fi
+ done
+ if test x$version_ok = xno; then
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR(mico version is $MICOVERSION)
+ else
+ AC_MSG_RESULT(yes)
+ fi
+ fi
+ #
+ # look for mico-c++ and scan it for a string match
+ # to "-I*ministl"
+ #
+ AC_PATH_PROG(MICO_CXX, mico-c++, , ${MICODIR}/bin:${MICOSHAREDDIR}/bin)
+ if test -z "$MICO_CXX"; then
+ AC_MSG_ERROR("panic: can not locate and scan the mico script mico-c++")
+ fi
+
+ AC_MSG_CHECKING(if mico was compiled using ministl)
+
+ if test -z "`grep '\-I.*ministl' $MICO_CXX`"; then
+ MICO_USE_MINISTL=0
+ AC_MSG_RESULT(no)
+ else
+ MICO_USE_MINISTL=1
+ AC_MSG_RESULT(yes)
+ fi
+ #
+ # look for mico-ld and scan it for -l* libraries
+ # needed to link with mico
+ #
+ AC_PATH_PROG(MICO_LD, mico-ld, , ${MICODIR}/bin:${MICOSHAREDDIR}/bin)
+
+ if test -z "$MICO_LD"; then
+ AC_MSG_ERROR("panic: can not locate and scan the mico script mico-ld")
+ fi
+
+ AC_MSG_CHECKING(mico dependencies)
+
+ micodeps=
+ for item in `grep -- -l $MICO_LD | tr '"' ' '` ; do
+ case $item in
+ -l*) micodeps="$micodeps $item" ;;
+ esac
+ done
+
+ if test -z "$micodeps" ;then
+ AC_MSG_RESULT(none)
+ else
+ AC_MSG_RESULT($micodeps)
+ fi
+
+ AC_MSG_CHECKING(how to link with the mico library)
+ MICO_LIB="-L${MICODIR}/lib -lmico${MICOVERSION} $micodeps"
+ AC_MSG_RESULT($MICO_LIB)
+
+ MICO_INCLUDE="-I${MICOSHAREDDIR}/include"
+
+ AC_SUBST(MICODIR)
+ AC_SUBST(MICOVERSION)
+ AC_SUBST(MICOSHAREDDIR)
+ AC_SUBST(MICO_INCLUDE)
+ AC_SUBST(MICO_LIB)
+ AC_SUBST(MICO_USE_MINISTL)
+ fi
+fi
+])
diff --git a/m4/ac_pkg_swig.m4 b/m4/ac_pkg_swig.m4
new file mode 100644
index 0000000..8adaffd
--- /dev/null
+++ b/m4/ac_pkg_swig.m4
@@ -0,0 +1,118 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_pkg_swig.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_SWIG([major.minor.micro])
+#
+# DESCRIPTION
+#
+# This macro searches for a SWIG installation on your system. If found you
+# should call SWIG via $(SWIG). You can use the optional first argument to
+# check if the version of the available SWIG is greater than or equal to
+# the value of the argument. It should have the format: N[.N[.N]] (N is a
+# number between 0 and 999. Only the first N is mandatory.)
+#
+# If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks that
+# the swig package is this version number or higher.
+#
+# In configure.in, use as:
+#
+# AC_PROG_SWIG(1.3.17)
+# SWIG_ENABLE_CXX
+# SWIG_MULTI_MODULE_SUPPORT
+# SWIG_PYTHON
+#
+# LICENSE
+#
+# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de>
+# Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
+# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net>
+# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_SWIG],[
+ AC_PATH_PROG([SWIG],[swig])
+ if test -z "$SWIG" ; then
+ AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org])
+ SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
+ elif test -n "$1" ; then
+ AC_MSG_CHECKING([for SWIG version])
+ [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
+ AC_MSG_RESULT([$swig_version])
+ if test -n "$swig_version" ; then
+ # Calculate the required version number components
+ [required=$1]
+ [required_major=`echo $required | sed 's/[^0-9].*//'`]
+ if test -z "$required_major" ; then
+ [required_major=0]
+ fi
+ [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+ [required_minor=`echo $required | sed 's/[^0-9].*//'`]
+ if test -z "$required_minor" ; then
+ [required_minor=0]
+ fi
+ [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+ [required_patch=`echo $required | sed 's/[^0-9].*//'`]
+ if test -z "$required_patch" ; then
+ [required_patch=0]
+ fi
+ # Calculate the available version number components
+ [available=$swig_version]
+ [available_major=`echo $available | sed 's/[^0-9].*//'`]
+ if test -z "$available_major" ; then
+ [available_major=0]
+ fi
+ [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+ [available_minor=`echo $available | sed 's/[^0-9].*//'`]
+ if test -z "$available_minor" ; then
+ [available_minor=0]
+ fi
+ [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+ [available_patch=`echo $available | sed 's/[^0-9].*//'`]
+ if test -z "$available_patch" ; then
+ [available_patch=0]
+ fi
+ if test $available_major -ne $required_major \
+ -o $available_minor -ne $required_minor \
+ -o $available_patch -lt $required_patch ; then
+ AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org])
+ SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false'
+ else
+ AC_MSG_NOTICE([SWIG executable is '$SWIG'])
+ SWIG_LIB=`$SWIG -swiglib`
+ AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB'])
+ fi
+ else
+ AC_MSG_WARN([cannot determine SWIG version])
+ SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false'
+ fi
+ fi
+ AC_SUBST([SWIG_LIB])
+])
diff --git a/m4/ac_prog_apache.m4 b/m4/ac_prog_apache.m4
new file mode 100644
index 0000000..7aafa48
--- /dev/null
+++ b/m4/ac_prog_apache.m4
@@ -0,0 +1,166 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_apache.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_APACHE([version])
+#
+# DESCRIPTION
+#
+# This macro searches for an installed apache server. If nothing was
+# specified when calling configure or just --with-apache, it searches in
+# /usr/local/apache/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin
+# The argument of --with-apache specifies the full pathname of the httpd
+# argument. For instance --with-apache=/usr/sbin/httpd.
+#
+# If the version argument is given, AC_PROG_APACHE checks that the apache
+# server is this version number or higher.
+#
+# If the apache server is not found, abort configuration with error
+# message.
+#
+# It defines the symbol APACHE if the server is found.
+#
+# Files using apache should do the following:
+#
+# @APACHE@ -d /etc/httpd
+#
+# It defines the symbol APACHE_MODULES if a directory containing mod_env.*
+# is found in the default server root directory (obtained with httpd -V).
+#
+# The httpd.conf file listing modules to be loaded dynamicaly can use
+# @APACHE_MODULES@ to grab them in the appropriate sub directory. For
+# instance:
+#
+# ...
+# <IfModule mod_so.c>
+# LoadModule env_module @APACHE_MODULES@/mod_env.so
+# LoadModule config_log_module @APACHE_MODULES@/mod_log_config.so
+# ...
+#
+# LICENSE
+#
+# Copyright (c) 2008 Loic Dachary <loic@senga.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_APACHE],
+#
+# Handle user hints
+#
+[
+ AC_MSG_CHECKING(if apache is wanted)
+ AC_ARG_WITH(apache,
+ [ --with-apache=PATH absolute path name of apache server (default is to search httpd in
+ /usr/local/apache/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin),
+ --without-apache to disable apache detection],
+ [
+ #
+ # Run this if -with or -without was specified
+ #
+ if test "$withval" != no ; then
+ AC_MSG_RESULT(yes)
+ APACHE_WANTED=yes
+ if test "$withval" != yes ; then
+ APACHE="$withval"
+ fi
+ else
+ APACHE_WANTED=no
+ AC_MSG_RESULT(no)
+ fi
+ ], [
+ #
+ # Run this if nothing was said
+ #
+ APACHE_WANTED=yes
+ AC_MSG_RESULT(yes)
+ ])
+ #
+ # Now we know if we want apache or not, only go further if
+ # it's wanted.
+ #
+ if test $APACHE_WANTED = yes ; then
+ #
+ # If not specified by caller, search in standard places
+ #
+ if test -z "$APACHE" ; then
+ AC_PATH_PROG(APACHE, httpd, , /usr/local/apache/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin)
+ fi
+ AC_SUBST(APACHE)
+ if test -z "$APACHE" ; then
+ AC_MSG_ERROR("apache server executable not found");
+ fi
+ #
+ # Collect apache version number. If for nothing else, this
+ # guaranties that httpd is a working apache executable.
+ #
+ changequote(<<, >>)dnl
+ APACHE_READABLE_VERSION=`$APACHE -v | grep 'Server version' | sed -e 's;.*Apache/\([0-9\.][0-9\.]*\).*;\1;'`
+ changequote([, ])dnl
+ APACHE_VERSION=`echo $APACHE_READABLE_VERSION | sed -e 's/\.//g'`
+ if test -z "$APACHE_VERSION" ; then
+ AC_MSG_ERROR("could not determine apache version number");
+ fi
+ APACHE_MAJOR=`expr $APACHE_VERSION : '\(..\)'`
+ APACHE_MINOR=`expr $APACHE_VERSION : '..\(.*\)'`
+ #
+ # Check that apache version matches requested version or above
+ #
+ if test -n "$1" ; then
+ AC_MSG_CHECKING(apache version >= $1)
+ APACHE_REQUEST=`echo $1 | sed -e 's/\.//g'`
+ APACHE_REQUEST_MAJOR=`expr $APACHE_REQUEST : '\(..\)'`
+ APACHE_REQUEST_MINOR=`expr $APACHE_REQUEST : '..\(.*\)'`
+ if test "$APACHE_MAJOR" -lt "$APACHE_REQUEST_MAJOR" -o "$APACHE_MINOR" -lt "$APACHE_REQUEST_MINOR" ; then
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR(apache version is $APACHE_READABLE_VERSION)
+ else
+ AC_MSG_RESULT(yes)
+ fi
+ fi
+ #
+ # Find out if .so modules are in libexec/module.so or modules/module.so
+ #
+ HTTP_ROOT=`$APACHE -V | grep HTTPD_ROOT | sed -e 's/.*"\(.*\)"/\1/'`
+ AC_MSG_CHECKING(apache modules)
+ for dir in libexec modules
+ do
+ if test -f $HTTP_ROOT/$dir/mod_env.*
+ then
+ APACHE_MODULES=$dir
+ fi
+ done
+ if test -z "$APACHE_MODULES"
+ then
+ AC_MSG_RESULT(not found)
+ else
+ AC_MSG_RESULT(in $HTTP_ROOT/$APACHE_MODULES)
+ fi
+ AC_SUBST(APACHE_MODULES)
+ fi
+])
diff --git a/m4/ac_prog_cc_char_subscripts.m4 b/m4/ac_prog_cc_char_subscripts.m4
new file mode 100644
index 0000000..38aa53f
--- /dev/null
+++ b/m4/ac_prog_cc_char_subscripts.m4
@@ -0,0 +1,118 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_cc_char_subscripts.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_CC_CHAR_SUBSCRIPTS(substvar [,hard])
+#
+# DESCRIPTION
+#
+# Try to find a compiler option that enables usage of char-type to index a
+# value-field. This one needs unsigned-chars and it must suppress warnings
+# about usage of chars for subscripting. for gcc -funsigned-char
+# -Wno-char-subscripts
+#
+# Currently this macro knows about GCC. hopefully will evolve to use:
+# Solaris C compiler, Digital Unix C compiler, C for AIX Compiler, HP-UX C
+# compiler, and IRIX C compiler.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_CC_CHAR_SUBSCRIPTS], [
+ pushdef([CV],ac_cv_prog_cc_char_subscripts)dnl
+ hard=$2
+ if test -z "$hard"; then
+ msg="C to enable char subscripts"
+ else
+ msg="C to ensure char subscripts"
+ fi
+ AC_CACHE_CHECK($msg, CV, [
+ cat > conftest.c <<EOF
+int main (void)
+{
+ char v = 1;
+ int x[[2]] = { 3 , 4 };
+ return x[[v]];
+}
+EOF
+ cp conftest.c writetest.c
+ dnl GCC
+ if test "$GCC" = "yes";
+ then
+ if test -z "$hard"; then
+ CV="-funsigned-char -Wno-char-subscripts"
+ else
+ CV="-funsigned-char -Wno-char-subscripts"
+ fi
+
+ if test -n "`${CC-cc} -c $CV conftest.c 2>&1`" ; then
+ CV="suppressed: did not work"
+ fi
+
+ dnl Solaris C compiler
+ # Solaris sunpro has no option for unsignedchar but
+ # signedchar is the default for char. Duhh.
+
+ dnl HP-UX C compiler
+
+ dnl Digital Unix C compiler
+ elif ! $CC > /dev/null 2>&1 &&
+ $CC -c -unsigned conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o
+ then
+ # char : unsigned char
+ CV="-unsigned"
+
+ rm conftest.o
+ if test -n "`${CC-cc} -c $CV conftest.c 2>&1`" ; then
+ CV="suppressed: did not work"
+ fi
+
+ dnl C for AIX Compiler
+
+ dnl IRIX C compiler
+ # char is unsigned by default for IRIX C.
+
+ fi
+ rm -f conftest.*
+ ])
+ if test -z "[$]$1" ; then
+ if test -n "$CV" ; then
+ case "$CV" in
+ suppressed*) $1="" ;; # known but suppressed
+ *) $1="$CV" ;;
+ esac
+ fi
+ fi
+ AC_SUBST($1)
+ popdef([CV])dnl
+])
diff --git a/m4/ac_prog_cc_for_build.m4 b/m4/ac_prog_cc_for_build.m4
new file mode 100644
index 0000000..06d2c8a
--- /dev/null
+++ b/m4/ac_prog_cc_for_build.m4
@@ -0,0 +1,139 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_cc_for_build.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_CC_FOR_BUILD
+#
+# DESCRIPTION
+#
+# This macro searches for a C compiler that generates native executables,
+# that is a C compiler that surely is not a cross-compiler. This can be
+# useful if you have to generate source code at compile-time like for
+# example GCC does.
+#
+# The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything
+# needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD).
+# The value of these variables can be overridden by the user by specifying
+# a compiler with an environment variable (like you do for standard CC).
+#
+# It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object
+# file extensions for the build platform, and GCC_FOR_BUILD to `yes' if
+# the compiler we found is GCC. All these variables but GCC_FOR_BUILD are
+# substituted in the Makefile.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Paolo Bonzini <bonzini@gnu.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_PROG_CC_FOR_BUILD], [dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_CPP])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
+dnl
+pushdef([AC_TRY_COMPILER], [
+cat > conftest.$ac_ext << EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+[$1]
+EOF
+# If we can't run a trivial program, we are probably using a cross
+compiler.
+# Fail miserably.
+if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest;
+exit) 2>/dev/null; then
+ [$2]=yes
+else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.$ac_ext >&AC_FD_CC
+ [$2]=no
+fi
+[$3]=no
+rm -fr conftest*])dnl
+
+dnl Use the standard macros, but make them use other variable names
+dnl
+pushdef([cross_compiling], [#])dnl
+pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
+pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
+pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
+pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
+pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
+pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
+pushdef([ac_cv_objext], ac_cv_build_objext)dnl
+pushdef([ac_exeext], ac_build_exeext)dnl
+pushdef([ac_objext], ac_build_objext)dnl
+pushdef([CC], CC_FOR_BUILD)dnl
+pushdef([CPP], CPP_FOR_BUILD)dnl
+pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
+pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
+pushdef([host], build)dnl
+pushdef([host_alias], build_alias)dnl
+pushdef([host_cpu], build_cpu)dnl
+pushdef([host_vendor], build_vendor)dnl
+pushdef([host_os], build_os)dnl
+pushdef([ac_cv_host], ac_cv_build)dnl
+pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
+pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
+pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
+pushdef([ac_cv_host_os], ac_cv_build_os)dnl
+pushdef([ac_cpp], ac_build_cpp)dnl
+pushdef([ac_compile], ac_build_compile)dnl
+pushdef([ac_link], ac_build_link)dnl
+
+dnl Defeat the anti-duplication mechanism
+dnl
+undefine([AC_PROVIDE_AC_PROG_CPP])dnl
+undefine([AC_PROVIDE_AC_PROG_C])dnl
+undefine([AC_PROVIDE_AC_EXEEXT])dnl
+
+AC_PROG_CC
+AC_PROG_CPP
+AC_EXEEXT
+
+dnl Restore the old definitions
+dnl
+popdef([AC_TRY_COMPILER])dnl
+popdef([ac_link])dnl
+popdef([ac_compile])dnl
+popdef([ac_cpp])dnl
+popdef([ac_cv_host_os])dnl
+popdef([ac_cv_host_vendor])dnl
+popdef([ac_cv_host_cpu])dnl
+popdef([ac_cv_host_alias])dnl
+popdef([ac_cv_host])dnl
+popdef([host_os])dnl
+popdef([host_vendor])dnl
+popdef([host_cpu])dnl
+popdef([host_alias])dnl
+popdef([host])dnl
+popdef([CPPFLAGS])dnl
+popdef([CFLAGS])dnl
+popdef([CPP])dnl
+popdef([CC])dnl
+popdef([ac_objext])dnl
+popdef([ac_exeext])dnl
+popdef([ac_cv_objext])dnl
+popdef([ac_cv_exeext])dnl
+popdef([ac_cv_prog_cc_g])dnl
+popdef([ac_cv_prog_cc_works])dnl
+popdef([ac_cv_prog_cc_cross])dnl
+popdef([ac_cv_prog_gcc])dnl
+popdef([ac_cv_prog_cc])dnl
+popdef([cross_compiling])dnl
+
+dnl Finally, set Makefile variables
+dnl
+BUILD_EXEEXT=$ac_build_exeext
+BUILD_OBJEXT=$ac_build_objext
+AC_SUBST(BUILD_EXEEXT)dnl
+AC_SUBST(BUILD_OBJEXT)dnl
+AC_SUBST([CFLAGS_FOR_BUILD])dnl
+AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
+])
diff --git a/m4/ac_prog_cp_s.m4 b/m4/ac_prog_cp_s.m4
new file mode 100644
index 0000000..7eee791
--- /dev/null
+++ b/m4/ac_prog_cp_s.m4
@@ -0,0 +1,83 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_cp_s.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_CP_S
+#
+# DESCRIPTION
+#
+# Check how to make a copy by creating a symbolic link to the original -
+# it defines the variable CP_S for further use, which you should in fact
+# treat like it used to be with be LN_S. The actual value is assured to be
+# either LN_S (if the filesystem supports symbolic links) or CP (if the
+# filesystem does not know about symbolic links and you need a copy of
+# original file to have the same text in both places). In a gnu
+# environment it will simply set CP_S="cp -s" since the gnu "cp"-command
+# has the "-s" flag. You shall not try to use this command on directories
+# since it would require a "-r" in the case of a copy that is not
+# supported explicitly here. (I'm not sure if some "cp"-commands out there
+# would barf at usage of "-r" on a normal file).
+#
+# Use CP_S to create a copy of read-only data - if your filesystem
+# supports it then a symbolic link is created - a process that is quicker
+# and space-saving. However, if the target fs does not support symbolic
+# links, just copy the data. Unlike ac_prog_ln_s this macro will never
+# fail to set the CP_S ac_subst to something that works.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_CP_S],
+[AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_MSG_CHECKING(whether cp -s works)
+AC_CACHE_VAL(ac_cv_prog_CP_S,
+[rm -f conftestdata
+if cp -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_CP_S="cp -s"
+else
+ ac_cv_prog_CP_S=cp
+fi
+if test "$LN_S" = "ln -s" ; then
+ ac_cv_prog_CP_S="ln -s"
+fi])dnl
+CP_S="$ac_cv_prog_CP_S"
+if test "$ac_cv_prog_CP_S" = "ln -s"; then
+ AC_MSG_RESULT(using ln -s)
+elif test "$ac_cv_prog_CP_S" = "cp -s"; then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no, using cp)
+fi
+AC_SUBST(CP_S)dnl
+])
diff --git a/m4/ac_prog_crontab.m4 b/m4/ac_prog_crontab.m4
new file mode 100644
index 0000000..732c33e
--- /dev/null
+++ b/m4/ac_prog_crontab.m4
@@ -0,0 +1,55 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_crontab.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_CRONTAB
+#
+# DESCRIPTION
+#
+# Check for the program crontab, if exists let script continue, else pops
+# an error message
+#
+# Besides checking existence, this macro also set these environment
+# variables upon completion:
+#
+# CRONTAB = which crontab
+#
+# LICENSE
+#
+# Copyright (c) 2008 Gleen Salmon <gleensalmon@yahoo.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_CRONTAB],[
+AC_REQUIRE([AC_EXEEXT])dnl
+AC_PATH_PROG(CRONTAB, crontab$EXEEXT, nocommand)
+if test "$CRONTAB" = nocommand; then
+ AC_MSG_ERROR([crontab (needed for scheduled job) not found in $PATH])
+fi;dnl
+])
diff --git a/m4/ac_prog_httpd.m4 b/m4/ac_prog_httpd.m4
new file mode 100644
index 0000000..1a3777d
--- /dev/null
+++ b/m4/ac_prog_httpd.m4
@@ -0,0 +1,81 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_httpd.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_HTTPD
+#
+# DESCRIPTION
+#
+# Check for Apache's 'httpd', let script continue if exists & works, pops
+# up error message if not.
+#
+# Testing of functionality is by checking its compile settings
+#
+# Besides checking existence, this macro also set these environment
+# variables upon completion:
+#
+# HTTPD = which httpd
+# HTTPD_ROOT = Apache's root directory, specified when compiled / run with -d option
+# HTTPD_SERVER_ROOT = Directory for Apache's essential files, e.g. access logs / error logs / modules / scripts.
+# HTTPD_SERVER_CONFIG_FILE = Full-path of the 'httpd.conf' file
+# HTTPD_USER = Which user that httpd runs as
+# HTTPD_GROUP = Which group that httpd runs as
+# HTTPD_DOC_HOME = Document directory, taken as the first DocumentRoot path found in httpd.conf
+# HTTPD_SCRIPT_HOME = CGI script directory, taken as the first ScriptAlias path found in httpd.conf
+#
+# LICENSE
+#
+# Copyright (c) 2008 Gleen Salmon <gleensalmon@yahoo.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_HTTPD],[
+AC_REQUIRE([AC_EXEEXT])dnl
+AC_PATH_PROG(HTTPD, httpd$EXEEXT, nocommand)
+if test "$HTTPD" = nocommand; then
+ AC_MSG_ERROR([httpd not found in $PATH])
+fi
+HTTPD_ROOT=`httpd -V | grep HTTPD_ROOT | sed 's/^.*HTTPD_ROOT[[[:blank:]]]*=[[[:blank:]]]*"\(.*\)"$/\1/'`
+HTTPD_SERVER_CONFIG_FILE=`httpd -V | grep SERVER_CONFIG_FILE | sed 's/^.*SERVER_CONFIG_FILE[[[:blank:]]]*=[[[:blank:]]]*"\(.*\)"$/\1/'`
+if echo $HTTPD_SERVER_CONFIG_FILE | grep ^[[^/]] > /dev/null; then
+ HTTPD_SERVER_CONFIG_FILE=$HTTPD_ROOT/$HTTPD_SERVER_CONFIG_FILE
+fi
+SERVER_ROOT_PATTERN='^[[[:blank:]]]*ServerRoot[[[:blank:]]][[[:blank:]]]*"\([[^"]]*\)"$'
+HTTPD_USER_PATTERN='^User[[[:blank:]]][[[:blank:]]]*\([[^[:blank:]]][[^[:blank:]]]*\)$'
+HTTPD_GROUP_PATTERN='^Group[[[:blank:]]][[[:blank:]]]*\([[^[:blank:]]][[^[:blank:]]]*\)$'
+DOCUMENT_ROOT_PATTERN='^[[[:blank:]]]*DocumentRoot[[[:blank:]]][[[:blank:]]]*"\([[^"]]*\)"$'
+SCRIPT_ALIAS_PATTERN='^[[[:blank:]]]*ScriptAlias[[[:blank:]]][[[:blank:]]]*[[^[:blank:]]][[^[:blank:]]]*[[[:blank:]]][[[:blank:]]]*"\([[^"]]*\)"$'
+AC_CHECK_FILE($HTTPD_SERVER_CONFIG_FILE,
+ [HTTPD_SERVER_ROOT=`grep $SERVER_ROOT_PATTERN $HTTPD_SERVER_CONFIG_FILE | head -n 1 | sed "s/$SERVER_ROOT_PATTERN/\1/" | sed s/[[/]]$//`;
+ HTTPD_USER=`grep $HTTPD_USER_PATTERN $HTTPD_SERVER_CONFIG_FILE | sed "s/$HTTPD_USER_PATTERN/\1/"`;
+ HTTPD_GROUP=`grep $HTTPD_GROUP_PATTERN $HTTPD_SERVER_CONFIG_FILE | sed "s/$HTTPD_GROUP_PATTERN/\1/"`;
+ HTTPD_DOC_HOME=`grep $DOCUMENT_ROOT_PATTERN $HTTPD_SERVER_CONFIG_FILE | head -n 1 | sed "s/$DOCUMENT_ROOT_PATTERN/\1/" | sed s/[[/]]$//`;
+ HTTPD_SCRIPT_HOME=`grep $SCRIPT_ALIAS_PATTERN $HTTPD_SERVER_CONFIG_FILE | head -n 1 | sed "s/$SCRIPT_ALIAS_PATTERN/\1/" | sed s/[[/]]$//`],
+ AC_MSG_ERROR([httpd server-config-file (detected as $HTTPD_SERVER_CONFIG_FILE by httpd -V) cannot be found]))dnl
+])
diff --git a/m4/ac_prog_jar.m4 b/m4/ac_prog_jar.m4
new file mode 100644
index 0000000..509db6a
--- /dev/null
+++ b/m4/ac_prog_jar.m4
@@ -0,0 +1,48 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_jar.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_JAR
+#
+# DESCRIPTION
+#
+# AC_PROG_JAR tests for an existing jar program. It uses the environment
+# variable JAR then tests in sequence various common jar programs.
+#
+# If you want to force a specific compiler:
+#
+# - at the configure.in level, set JAR=yourcompiler before calling
+# AC_PROG_JAR
+#
+# - at the configure level, setenv JAR
+#
+# You can use the JAR variable in your Makefile.in, with @JAR@.
+#
+# Note: This macro depends on the autoconf M4 macros for Java programs. It
+# is VERY IMPORTANT that you download that whole set, some macros depend
+# on other. Unfortunately, the autoconf archive does not support the
+# concept of set of macros, so I had to break it for submission.
+#
+# The general documentation of those macros, as well as the sample
+# configure.in, is included in the AC_PROG_JAVA macro.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Egon Willighagen <e.willighagen@science.ru.nl>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_PROG_JAR],[
+AC_REQUIRE([AC_EXEEXT])dnl
+if test "x$JAVAPREFIX" = x; then
+ test "x$JAR" = x && AC_CHECK_PROGS(JAR, jar$EXEEXT)
+else
+ test "x$JAR" = x && AC_CHECK_PROGS(JAR, jar, $JAVAPREFIX)
+fi
+test "x$JAR" = x && AC_MSG_ERROR([no acceptable jar program found in \$PATH])
+AC_PROVIDE([$0])dnl
+])
diff --git a/m4/ac_prog_java.m4 b/m4/ac_prog_java.m4
new file mode 100644
index 0000000..5125cc0
--- /dev/null
+++ b/m4/ac_prog_java.m4
@@ -0,0 +1,113 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_java.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVA
+#
+# DESCRIPTION
+#
+# Here is a summary of the main macros:
+#
+# AC_PROG_JAVAC: finds a Java compiler.
+#
+# AC_PROG_JAVA: finds a Java virtual machine.
+#
+# AC_CHECK_CLASS: finds if we have the given class (beware of CLASSPATH!).
+#
+# AC_CHECK_RQRD_CLASS: finds if we have the given class and stops
+# otherwise.
+#
+# AC_TRY_COMPILE_JAVA: attempt to compile user given source.
+#
+# AC_TRY_RUN_JAVA: attempt to compile and run user given source.
+#
+# AC_JAVA_OPTIONS: adds Java configure options.
+#
+# AC_PROG_JAVA tests an existing Java virtual machine. It uses the
+# environment variable JAVA then tests in sequence various common Java
+# virtual machines. For political reasons, it starts with the free ones.
+# You *must* call [AC_PROG_JAVAC] before.
+#
+# If you want to force a specific VM:
+#
+# - at the configure.in level, set JAVA=yourvm before calling AC_PROG_JAVA
+#
+# (but after AC_INIT)
+#
+# - at the configure level, setenv JAVA
+#
+# You can use the JAVA variable in your Makefile.in, with @JAVA@.
+#
+# *Warning*: its success or failure can depend on a proper setting of the
+# CLASSPATH env. variable.
+#
+# TODO: allow to exclude virtual machines (rationale: most Java programs
+# cannot run with some VM like kaffe).
+#
+# Note: This is part of the set of autoconf M4 macros for Java programs.
+# It is VERY IMPORTANT that you download the whole set, some macros depend
+# on other. Unfortunately, the autoconf archive does not support the
+# concept of set of macros, so I had to break it for submission.
+#
+# A Web page, with a link to the latest CVS snapshot is at
+# <http://www.internatif.org/bortzmeyer/autoconf-Java/>.
+#
+# This is a sample configure.in Process this file with autoconf to produce
+# a configure script.
+#
+# AC_INIT(UnTag.java)
+#
+# dnl Checks for programs.
+# AC_CHECK_CLASSPATH
+# AC_PROG_JAVAC
+# AC_PROG_JAVA
+#
+# dnl Checks for classes
+# AC_CHECK_RQRD_CLASS(org.xml.sax.Parser)
+# AC_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver)
+#
+# AC_OUTPUT(Makefile)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_JAVA],[
+AC_REQUIRE([AC_EXEEXT])dnl
+if test x$JAVAPREFIX = x; then
+ test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT)
+else
+ test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT, $JAVAPREFIX)
+fi
+test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])
+AC_PROG_JAVA_WORKS
+AC_PROVIDE([$0])dnl
+])
diff --git a/m4/ac_prog_java_cc.m4 b/m4/ac_prog_java_cc.m4
new file mode 100644
index 0000000..a6646a7
--- /dev/null
+++ b/m4/ac_prog_java_cc.m4
@@ -0,0 +1,101 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_java_cc.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVA_CC
+#
+# DESCRIPTION
+#
+# Finds the appropriate java compiler on your path. By preference the java
+# compiler is gcj, then jikes then javac.
+#
+# The macro can take one argument specifying a space separated list of
+# java compiler names.
+#
+# For example:
+#
+# AC_PROG_JAVA_CC(javac, gcj)
+#
+# The macro also sets the compiler options variable: JAVA_CC_OPTS to
+# something sensible:
+#
+# - for GCJ it sets it to: @GCJ_OPTS@
+# (if GCJ_OPTS is not yet defined then it is set to "-C")
+#
+# - no other compiler has applicable options yet
+#
+# Here's an example configure.in:
+#
+# AC_INIT(Makefile.in)
+# AC_PROG_JAVA_CC()
+# AC_OUTPUT(Makefile)
+# dnl End.
+#
+# And here's the start of the Makefile.in:
+#
+# PROJECT_ROOT := @srcdir@
+# # Tool definitions.
+# JAVAC := @JAVA_CC@
+# JAVAC_OPTS := @JAVA_CC_OPTS@
+# JAR_TOOL := @jar_tool@
+#
+# LICENSE
+#
+# Copyright (c) 2008 Nic Ferrier <nferrier@tapsellferrier.co.uk>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+# AC_PROG_JAVA_CC([COMPILER ...])
+# --------------------------
+# COMPILER ... is a space separated list of java compilers to search for.
+# This just gives the user an opportunity to specify an alternative
+# search list for the java compiler.
+AC_DEFUN([AC_PROG_JAVA_CC],
+[AC_ARG_VAR([JAVA_CC], [java compiler command])dnl
+AC_ARG_VAR([JAVA_CC_FLAGS], [java compiler flags])dnl
+m4_ifval([$1],
+ [AC_CHECK_TOOLS(JAVA_CC, [$1])],
+[AC_CHECK_TOOL(JAVA_CC, gcj)
+if test -z "$JAVA_CC"; then
+ AC_CHECK_TOOL(JAVA_CC, javac)
+fi
+if test -z "$JAVA_CC"; then
+ AC_CHECK_TOOL(JAVA_CC, jikes)
+fi
+])
+
+if test "$JAVA_CC" = "gcj"; then
+ if test "$GCJ_OPTS" = ""; then
+ AC_SUBST(GCJ_OPTS,-C)
+ fi
+ AC_SUBST(JAVA_CC_OPTS, @GCJ_OPTS@,
+ [Define the compilation options for GCJ])
+fi
+test -z "$JAVA_CC" && AC_MSG_ERROR([no acceptable java compiler found in \$PATH])
+])# AC_PROG_JAVA_CC
diff --git a/m4/ac_prog_java_works.m4 b/m4/ac_prog_java_works.m4
new file mode 100644
index 0000000..b2727f4
--- /dev/null
+++ b/m4/ac_prog_java_works.m4
@@ -0,0 +1,131 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_java_works.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVA_WORKS
+#
+# DESCRIPTION
+#
+# Internal use ONLY.
+#
+# Note: This is part of the set of autoconf M4 macros for Java programs.
+# It is VERY IMPORTANT that you download the whole set, some macros depend
+# on other. Unfortunately, the autoconf archive does not support the
+# concept of set of macros, so I had to break it for submission. The
+# general documentation, as well as the sample configure.in, is included
+# in the AC_PROG_JAVA macro.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_JAVA_WORKS], [
+AC_CHECK_PROG(uudecode, uudecode$EXEEXT, yes)
+if test x$uudecode = xyes; then
+AC_CACHE_CHECK([if uudecode can decode base 64 file], ac_cv_prog_uudecode_base64, [
+dnl /**
+dnl * Test.java: used to test if java compiler works.
+dnl */
+dnl public class Test
+dnl {
+dnl
+dnl public static void
+dnl main( String[] argv )
+dnl {
+dnl System.exit (0);
+dnl }
+dnl
+dnl }
+cat << \EOF > Test.uue
+begin-base64 644 Test.class
+yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
+bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
+bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s
+YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG
+aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB
+AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB
+AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ=
+====
+EOF
+if uudecode$EXEEXT Test.uue; then
+ ac_cv_prog_uudecode_base64=yes
+else
+ echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC
+ echo "configure: failed file was:" >&AC_FD_CC
+ cat Test.uue >&AC_FD_CC
+ ac_cv_prog_uudecode_base64=no
+fi
+rm -f Test.uue])
+fi
+if test x$ac_cv_prog_uudecode_base64 != xyes; then
+ rm -f Test.class
+ AC_MSG_WARN([I have to compile Test.class from scratch])
+ if test x$ac_cv_prog_javac_works = xno; then
+ AC_MSG_ERROR([Cannot compile java source. $JAVAC does not work properly])
+ fi
+ if test x$ac_cv_prog_javac_works = x; then
+ AC_PROG_JAVAC
+ fi
+fi
+AC_CACHE_CHECK(if $JAVA works, ac_cv_prog_java_works, [
+JAVA_TEST=Test.java
+CLASS_TEST=Test.class
+TEST=Test
+changequote(, )dnl
+cat << \EOF > $JAVA_TEST
+/* [#]line __oline__ "configure" */
+public class Test {
+public static void main (String args[]) {
+ System.exit (0);
+} }
+EOF
+changequote([, ])dnl
+if test x$ac_cv_prog_uudecode_base64 != xyes; then
+ if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then
+ :
+ else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat $JAVA_TEST >&AC_FD_CC
+ AC_MSG_ERROR(The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?))
+ fi
+fi
+if AC_TRY_COMMAND($JAVA $JAVAFLAGS $TEST) >/dev/null 2>&1; then
+ ac_cv_prog_java_works=yes
+else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat $JAVA_TEST >&AC_FD_CC
+ AC_MSG_ERROR(The Java VM $JAVA failed (see config.log, check the CLASSPATH?))
+fi
+rm -fr $JAVA_TEST $CLASS_TEST Test.uue
+])
+AC_PROVIDE([$0])dnl
+]
+)
diff --git a/m4/ac_prog_javac.m4 b/m4/ac_prog_javac.m4
new file mode 100644
index 0000000..69f28bb
--- /dev/null
+++ b/m4/ac_prog_javac.m4
@@ -0,0 +1,77 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_javac.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVAC
+#
+# DESCRIPTION
+#
+# AC_PROG_JAVAC tests an existing Java compiler. It uses the environment
+# variable JAVAC then tests in sequence various common Java compilers. For
+# political reasons, it starts with the free ones.
+#
+# If you want to force a specific compiler:
+#
+# - at the configure.in level, set JAVAC=yourcompiler before calling
+# AC_PROG_JAVAC
+#
+# - at the configure level, setenv JAVAC
+#
+# You can use the JAVAC variable in your Makefile.in, with @JAVAC@.
+#
+# *Warning*: its success or failure can depend on a proper setting of the
+# CLASSPATH env. variable.
+#
+# TODO: allow to exclude compilers (rationale: most Java programs cannot
+# compile with some compilers like guavac).
+#
+# Note: This is part of the set of autoconf M4 macros for Java programs.
+# It is VERY IMPORTANT that you download the whole set, some macros depend
+# on other. Unfortunately, the autoconf archive does not support the
+# concept of set of macros, so I had to break it for submission. The
+# general documentation, as well as the sample configure.in, is included
+# in the AC_PROG_JAVA macro.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_JAVAC],[
+AC_REQUIRE([AC_EXEEXT])dnl
+if test "x$JAVAPREFIX" = x; then
+ test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT)
+else
+ test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT, $JAVAPREFIX)
+fi
+test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH])
+AC_PROG_JAVAC_WORKS
+AC_PROVIDE([$0])dnl
+])
diff --git a/m4/ac_prog_javac_works.m4 b/m4/ac_prog_javac_works.m4
new file mode 100644
index 0000000..e31ba98
--- /dev/null
+++ b/m4/ac_prog_javac_works.m4
@@ -0,0 +1,69 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_javac_works.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVAC_WORKS
+#
+# DESCRIPTION
+#
+# Internal use ONLY.
+#
+# Note: This is part of the set of autoconf M4 macros for Java programs.
+# It is VERY IMPORTANT that you download the whole set, some macros depend
+# on other. Unfortunately, the autoconf archive does not support the
+# concept of set of macros, so I had to break it for submission. The
+# general documentation, as well as the sample configure.in, is included
+# in the AC_PROG_JAVA macro.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_JAVAC_WORKS],[
+AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [
+JAVA_TEST=Test.java
+CLASS_TEST=Test.class
+cat << \EOF > $JAVA_TEST
+/* [#]line __oline__ "configure" */
+public class Test {
+}
+EOF
+if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) >/dev/null 2>&1; then
+ ac_cv_prog_javac_works=yes
+else
+ AC_MSG_ERROR([The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)])
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat $JAVA_TEST >&AC_FD_CC
+fi
+rm -f $JAVA_TEST $CLASS_TEST
+])
+AC_PROVIDE([$0])dnl
+])
diff --git a/m4/ac_prog_javadoc.m4 b/m4/ac_prog_javadoc.m4
new file mode 100644
index 0000000..8ec2e0f
--- /dev/null
+++ b/m4/ac_prog_javadoc.m4
@@ -0,0 +1,49 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_javadoc.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVADOC
+#
+# DESCRIPTION
+#
+# AC_PROG_JAVADOC tests for an existing javadoc generator. It uses the
+# environment variable JAVADOC then tests in sequence various common
+# javadoc generator.
+#
+# If you want to force a specific compiler:
+#
+# - at the configure.in level, set JAVADOC=yourgenerator before calling
+# AC_PROG_JAVADOC
+#
+# - at the configure level, setenv JAVADOC
+#
+# You can use the JAVADOC variable in your Makefile.in, with @JAVADOC@.
+#
+# Note: This macro depends on the autoconf M4 macros for Java programs. It
+# is VERY IMPORTANT that you download that whole set, some macros depend
+# on other. Unfortunately, the autoconf archive does not support the
+# concept of set of macros, so I had to break it for submission.
+#
+# The general documentation of those macros, as well as the sample
+# configure.in, is included in the AC_PROG_JAVA macro.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Egon Willighagen <e.willighagen@science.ru.nl>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_PROG_JAVADOC],[
+AC_REQUIRE([AC_EXEEXT])dnl
+if test "x$JAVAPREFIX" = x; then
+ test "x$JAVADOC" = x && AC_CHECK_PROGS(JAVADOC, javadoc$EXEEXT)
+else
+ test "x$JAVADOC" = x && AC_CHECK_PROGS(JAVADOC, javadoc, $JAVAPREFIX)
+fi
+test "x$JAVADOC" = x && AC_MSG_ERROR([no acceptable javadoc generator found in \$PATH])
+AC_PROVIDE([$0])dnl
+])
diff --git a/m4/ac_prog_javah.m4 b/m4/ac_prog_javah.m4
new file mode 100644
index 0000000..0d7000b
--- /dev/null
+++ b/m4/ac_prog_javah.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_javah.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVAH
+#
+# DESCRIPTION
+#
+# AC_PROG_JAVAH tests the availability of the javah header generator and
+# looks for the jni.h header file. If available, JAVAH is set to the full
+# path of javah and CPPFLAGS is updated accordingly.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_PROG_JAVAH],[
+AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
+AC_REQUIRE([AC_PROG_CPP])dnl
+AC_PATH_PROG(JAVAH,javah)
+if test x"`eval 'echo $ac_cv_path_JAVAH'`" != x ; then
+ AC_TRY_CPP([#include <jni.h>],,[
+ ac_save_CPPFLAGS="$CPPFLAGS"
+changequote(, )dnl
+ ac_dir=`echo $ac_cv_path_JAVAH | sed 's,\(.*\)/[^/]*/[^/]*$,\1/include,'`
+ ac_machdep=`echo $build_os | sed 's,[-0-9].*,,' | sed 's,cygwin,win32,'`
+changequote([, ])dnl
+ CPPFLAGS="$ac_save_CPPFLAGS -I$ac_dir -I$ac_dir/$ac_machdep"
+ AC_TRY_CPP([#include <jni.h>],
+ ac_save_CPPFLAGS="$CPPFLAGS",
+ AC_MSG_WARN([unable to include <jni.h>]))
+ CPPFLAGS="$ac_save_CPPFLAGS"])
+fi])
diff --git a/m4/ac_prog_modprobe.m4 b/m4/ac_prog_modprobe.m4
new file mode 100644
index 0000000..d6d6f78
--- /dev/null
+++ b/m4/ac_prog_modprobe.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_modprobe.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_MODPROBE
+#
+# DESCRIPTION
+#
+# This macro searches for a modprobe command, such as can be found on
+# Linux systems with loadable kernel module support. PATH is checked
+# first, then the default location(s).
+#
+# This is one of several autoconf macros intended to assist in configuring
+# and installing loadable kernel modules.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Kaelin Colclasure <kaelin@acm.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_PROG_MODPROBE],[
+AC_PATH_PROG(MODPROBE, modprobe, , $PATH:/sbin)
+if test -z "$MODPROBE"; then
+ AC_MSG_WARN([no support for loadable kernel modules])
+else
+ AC_MSG_CHECKING([for module_prefix])
+ module_prefix=`$MODPROBE -c | grep path.kernel.= \
+ | sed -e '2,$d' -e 's/.*=//' -e 's/.kernel//'`
+ AC_MSG_RESULT($module_prefix)
+ AC_SUBST(module_prefix)
+fi
+])
diff --git a/m4/ac_prog_mysql.m4 b/m4/ac_prog_mysql.m4
new file mode 100644
index 0000000..204543d
--- /dev/null
+++ b/m4/ac_prog_mysql.m4
@@ -0,0 +1,67 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_mysql.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_MYSQL
+#
+# DESCRIPTION
+#
+# Check for the program 'mysql' let script continue if exists & works pops
+# up error message if not.
+#
+# Testing of functionality is by invoking it with root password 'rootpass'
+# and a 'SELECT * FROM user' SQL statement. That SQL statement will select
+# all user information from the 'user' privileges table, and should work
+# on every proper MySQL server.
+#
+# Besides checking mysql, this macro also set these environment variables
+# upon completion:
+#
+# MYSQL = which mysql
+#
+# LICENSE
+#
+# Copyright (c) 2008 Gleen Salmon <gleensalmon@yahoo.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_MYSQL],[
+AC_REQUIRE([AC_EXEEXT])dnl
+AC_PATH_PROG(MYSQL, mysql$EXEEXT, nocommand)
+if test "$MYSQL" = nocommand; then
+ AC_MSG_ERROR([mysql not found in $PATH])
+fi
+AC_MSG_CHECKING([if mysql works])
+if echo 'SELECT * FROM user' | $MYSQL -u root -prootpass mysql > /dev/null; then
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_NOTICE([Before installation, set MySQL root password to rootpass; restore your root password afterwards.])
+ AC_MSG_ERROR([mysql cannot execute SELECT with root password = rootpass])
+fi;dnl
+])
diff --git a/m4/ac_prog_mysqladmin.m4 b/m4/ac_prog_mysqladmin.m4
new file mode 100644
index 0000000..dc22169
--- /dev/null
+++ b/m4/ac_prog_mysqladmin.m4
@@ -0,0 +1,68 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_mysqladmin.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_MYSQLADMIN
+#
+# DESCRIPTION
+#
+# Check for the program 'mysqladmin' let script continue if exists & works
+# pops up error message if not.
+#
+# Testing of functionality is by invoking it with root password 'rootpass'
+# and a 'flush-privileges' command.
+#
+# Besides checking mysql, this macro also set these environment variables
+# upon completion:
+#
+# MYSQLADMIN = which mysqladmin
+# MYSQL_DATADIR = directory containing mysql database
+#
+# LICENSE
+#
+# Copyright (c) 2008 Gleen Salmon <gleensalmon@yahoo.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_MYSQLADMIN],[
+AC_REQUIRE([AC_EXEEXT])dnl
+AC_PATH_PROG(MYSQLADMIN, mysqladmin$EXEEXT, nocommand)
+if test "$MYSQLADMIN" = nocommand; then
+ AC_MSG_ERROR([mysqladmin not found in $PATH])
+fi
+AC_MSG_CHECKING([if mysqladmin works])
+if $MYSQLADMIN -u root -prootpass flush-privileges; then
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_NOTICE([Before installation, set MySQL root password to rootpass; restore your root password afterwards.])
+ AC_MSG_ERROR([mysqladmin cannot run with root password = rootpass])
+fi
+DATADIR_PATTERN='^|[[[:blank:]]]*datadir[[[:blank:]]]*|[[[:blank:]]]*\([[^[:blank:]]][[^[:blank:]]]*\)[[[:blank:]]]*|'
+MYSQL_DATADIR=`$MYSQLADMIN -u root -prootpass variables 2> /dev/null | grep $DATADIR_PATTERN | sed "s/$DATADIR_PATTERN/\1/"`;dnl
+])
diff --git a/m4/ac_prog_mysqld.m4 b/m4/ac_prog_mysqld.m4
new file mode 100644
index 0000000..352d3c5
--- /dev/null
+++ b/m4/ac_prog_mysqld.m4
@@ -0,0 +1,55 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_mysqld.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_MYSQLD
+#
+# DESCRIPTION
+#
+# Check for the program 'mysqld' let script continue if exists & works
+# pops up error message if not.
+#
+# Besides checking existence, this macro also set these environment
+# variables upon completion:
+#
+# MYSQLD = which mysqld
+#
+# LICENSE
+#
+# Copyright (c) 2008 Gleen Salmon <gleensalmon@yahoo.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_MYSQLD],[
+AC_REQUIRE([AC_EXEEXT])dnl
+AC_PATH_PROG(MYSQLD, mysqld$EXEEXT, nocommand)
+if test "$MYSQLD" = nocommand; then
+ AC_MSG_ERROR([mysqld not found in $PATH])
+fi;dnl
+])
diff --git a/m4/ac_prog_mysqlimport.m4 b/m4/ac_prog_mysqlimport.m4
new file mode 100644
index 0000000..9017c15
--- /dev/null
+++ b/m4/ac_prog_mysqlimport.m4
@@ -0,0 +1,55 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_mysqlimport.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_MYSQLIMPORT
+#
+# DESCRIPTION
+#
+# Check for the program 'mysqlimport', let script continue if exists, pops
+# up error message if not.
+#
+# Besides checking existence, this macro also set these environment
+# variables upon completion:
+#
+# MYSQLIMPORT = which mysqlimport
+#
+# LICENSE
+#
+# Copyright (c) 2008 Gleen Salmon <gleensalmon@yahoo.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_MYSQLIMPORT],[
+AC_REQUIRE([AC_EXEEXT])dnl
+AC_PATH_PROG(MYSQLIMPORT, mysqlimport$EXEEXT, nocommand)
+if test "$MYSQLIMPORT" = nocommand; then
+ AC_MSG_ERROR([mysqlimport not found in $PATH])
+fi;dnl
+])
diff --git a/m4/ac_prog_mysqlshow.m4 b/m4/ac_prog_mysqlshow.m4
new file mode 100644
index 0000000..696e6bb
--- /dev/null
+++ b/m4/ac_prog_mysqlshow.m4
@@ -0,0 +1,66 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_mysqlshow.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_MYSQLSHOW
+#
+# DESCRIPTION
+#
+# Check for the program 'mysqlshow' let script continue if exists & works
+# pops up error message if not.
+#
+# Testing of functionality is by invoking it with root password
+# 'rootpass'. If it works, it should show all databases currently in
+# system.
+#
+# Besides checking mysql, this macro also set these environment variables
+# upon completion:
+#
+# MYSQLSHOW = which mysqlshow
+#
+# LICENSE
+#
+# Copyright (c) 2008 Gleen Salmon <gleensalmon@yahoo.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_MYSQLSHOW],[
+AC_REQUIRE([AC_EXEEXT])dnl
+AC_PATH_PROG(MYSQLSHOW, mysqlshow$EXEEXT, nocommand)
+if test "$MYSQLSHOW" = nocommand; then
+ AC_MSG_ERROR([mysqlshow not found in $PATH])
+fi
+AC_MSG_CHECKING([if mysqlshow works])
+if $MYSQLSHOW -u root -prootpass > /dev/null; then
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_NOTICE([Before installation, set MySQL root password to rootpass; restore your root password afterwards.])
+ AC_MSG_ERROR([mysqlshow cannot run with root password = rootpass])
+fi;dnl
+])
diff --git a/m4/ac_prog_perl_modules.m4 b/m4/ac_prog_perl_modules.m4
new file mode 100644
index 0000000..a1ae6d7
--- /dev/null
+++ b/m4/ac_prog_perl_modules.m4
@@ -0,0 +1,62 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_perl_modules.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_PERL_MODULES([MODULES], [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+#
+# DESCRIPTION
+#
+# Checks to see if the given perl modules are available. If true the shell
+# commands in ACTION-IF-TRUE are executed. If not the shell commands in
+# ACTION-IF-FALSE are run. Note if $PERL is not set (for example by
+# calling AC_CHECK_PROG, or AC_PATH_PROG), AC_CHECK_PROG(PERL, perl, perl)
+# will be run.
+#
+# Example:
+#
+# AC_CHECK_PERL_MODULES(Text::Wrap Net::LDAP, ,
+# AC_MSG_WARN(Need some Perl modules)
+#
+# LICENSE
+#
+# Copyright (c) 2009 Dean Povey <povey@wedgetail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_PROG_PERL_MODULES],[dnl
+ac_perl_modules="$1"
+# Make sure we have perl
+if test -z "$PERL"; then
+AC_CHECK_PROG(PERL,perl,perl)
+fi
+
+if test "x$PERL" != x; then
+ ac_perl_modules_failed=0
+ for ac_perl_module in $ac_perl_modules; do
+ AC_MSG_CHECKING(for perl module $ac_perl_module)
+
+ # Would be nice to log result here, but can't rely on autoconf internals
+ $PERL "-M$ac_perl_module" -e exit > /dev/null 2>&1
+ if test $? -ne 0; then
+ AC_MSG_RESULT(no);
+ ac_perl_modules_failed=1
+ else
+ AC_MSG_RESULT(ok);
+ fi
+ done
+
+ # Run optional shell commands
+ if test "$ac_perl_modules_failed" = 0; then
+ :
+ $2
+ else
+ :
+ $3
+ fi
+else
+ AC_MSG_WARN(could not find perl)
+fi])dnl
diff --git a/m4/ac_prog_scp.m4 b/m4/ac_prog_scp.m4
new file mode 100644
index 0000000..f1c0ce4
--- /dev/null
+++ b/m4/ac_prog_scp.m4
@@ -0,0 +1,55 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_scp.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_SCP
+#
+# DESCRIPTION
+#
+# Check for the program 'scp', let script continue if exists, pops up
+# error message if not.
+#
+# Besides checking existence, this macro also set these environment
+# variables upon completion:
+#
+# SCP = which scp
+#
+# LICENSE
+#
+# Copyright (c) 2008 Gleen Salmon <gleensalmon@yahoo.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_SCP],[
+AC_REQUIRE([AC_EXEEXT])dnl
+AC_PATH_PROG(SCP, scp$EXEEXT, nocommand)
+if test "$SCP" = nocommand; then
+ AC_MSG_ERROR([scp not found in $PATH])
+fi;dnl
+])
diff --git a/m4/ac_prog_ssh.m4 b/m4/ac_prog_ssh.m4
new file mode 100644
index 0000000..1f6429b
--- /dev/null
+++ b/m4/ac_prog_ssh.m4
@@ -0,0 +1,55 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_ssh.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_SSH
+#
+# DESCRIPTION
+#
+# Check for the program 'ssh', let script continue if exists, pops up
+# error message if not.
+#
+# Besides checking existence, this macro also set these environment
+# variables upon completion:
+#
+# SSH = which ssh
+#
+# LICENSE
+#
+# Copyright (c) 2008 Gleen Salmon <gleensalmon@yahoo.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_SSH],[
+AC_REQUIRE([AC_EXEEXT])dnl
+AC_PATH_PROG(SSH, ssh$EXEEXT, nocommand)
+if test "$SSH" = nocommand; then
+ AC_MSG_ERROR([ssh not found in $PATH])
+fi;dnl
+])
diff --git a/m4/ac_prog_xsltproc.m4 b/m4/ac_prog_xsltproc.m4
new file mode 100644
index 0000000..64914fd
--- /dev/null
+++ b/m4/ac_prog_xsltproc.m4
@@ -0,0 +1,94 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prog_xsltproc.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_XSLTPROC([default-flags])
+#
+# DESCRIPTION
+#
+# Find an xsltproc executable.
+#
+# Input:
+#
+# "default-flags" is the default $XSLTPROC_FLAGS, which will be overridden
+# if the user specifies --with-xsltproc-flags.
+#
+# Output:
+#
+# $XSLTPROC contains the path to xsltproc, or is empty if none was found
+# or the user specified --without-xsltproc. $XSLTPROC_FLAGS contains the
+# flags to use with xsltproc.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Zmanda Inc. <http://www.zmanda.com/>
+# Copyright (c) 2008 Dustin J. Mitchell <dustin@zmanda.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROG_XSLTPROC],
+[
+XSLTPROC_FLAGS="$1"
+AC_SUBST(XSLTPROC_FLAGS)
+
+# The (lack of) whitespace and overquoting here are all necessary for
+# proper formatting.
+AC_ARG_WITH(xsltproc,
+AS_HELP_STRING([--with-xsltproc[[[[[=PATH]]]]]],
+ [Use the xsltproc binary in in PATH.]),
+ [ ac_with_xsltproc=$withval; ],
+ [ ac_with_xsltproc=maybe; ])
+
+AC_ARG_WITH(xsltproc-flags,
+AS_HELP_STRING([ --with-xsltproc-flags=FLAGS],
+ [Flags to pass to xsltproc (default $1)]),
+ [ if test "x$withval" == "xno"; then
+ XSLTPROC_FLAGS=''
+ else
+ if test "x$withval" != "xyes"; then
+ XSLTPROC_FLAGS="$withval"
+ fi
+ fi
+ ])
+
+# search for xsltproc if it wasn't specified
+if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then
+ AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
+else
+ if test "$ac_with_xsltproc" != "no"; then
+ if test -x "$ac_with_xsltproc"; then
+ XSLTPROC="$ac_with_xsltproc";
+ else
+ AC_MSG_WARN([Specified xsltproc of $ac_with_xsltproc isn't])
+ AC_MSG_WARN([executable; searching for an alternative.])
+ AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
+ fi
+ fi
+fi
+])
diff --git a/m4/ac_prompt_user.m4 b/m4/ac_prompt_user.m4
new file mode 100644
index 0000000..3378a54
--- /dev/null
+++ b/m4/ac_prompt_user.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prompt_user.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROMPT_USER(VARIABLENAME,QUESTION,[DEFAULT])
+#
+# DESCRIPTION
+#
+# Asks a QUESTION and puts the results in VARIABLENAME with an optional
+# DEFAULT value if the user merely hits return. Also calls
+# AC_DEFINE_UNQUOTED() on the VARIABLENAME for VARIABLENAMEs that should
+# be entered into the config.h file as well.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Wes Hardaker <wjhardaker@ucdavis.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_PROMPT_USER],
+[
+MSG_CHECK=`echo "$2" | tail -1`
+AC_CACHE_CHECK($MSG_CHECK, ac_cv_user_prompt_$1,
+[echo "" >&AC_FD_MSG
+AC_PROMPT_USER_NO_DEFINE($1,[$2],$3)
+eval ac_cv_user_prompt_$1=\$$1
+echo $ac_n "setting $MSG_CHECK to... $ac_c" >&AC_FD_MSG
+])
+if test "$ac_cv_user_prompt_$1" != "none"; then
+ if test "$4" != ""; then
+ AC_DEFINE_UNQUOTED($1,"$ac_cv_user_prompt_$1")
+ else
+ AC_DEFINE_UNQUOTED($1,$ac_cv_user_prompt_$1)
+ fi
+fi
+]) dnl
diff --git a/m4/ac_prompt_user_no_define.m4 b/m4/ac_prompt_user_no_define.m4
new file mode 100644
index 0000000..3633d01
--- /dev/null
+++ b/m4/ac_prompt_user_no_define.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prompt_user_no_define.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROMPT_USER_NO_DEFINE(VARIABLENAME,QUESTION,[DEFAULT])
+#
+# DESCRIPTION
+#
+# Asks a QUESTION and puts the results in VARIABLENAME with an optional
+# DEFAULT value if the user merely hits return.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Wes Hardaker <wjhardaker@ucdavis.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_PROMPT_USER_NO_DEFINE],
+dnl changequote(<<, >>) dnl
+dnl <<
+[
+if test "x$defaults" = "xno"; then
+echo $ac_n "$2 ($3): $ac_c"
+read tmpinput
+if test "$tmpinput" = "" -a "$3" != ""; then
+ tmpinput="$3"
+fi
+eval $1=\"$tmpinput\"
+else
+tmpinput="$3"
+eval $1=\"$tmpinput\"
+fi
+]
+dnl >>
+dnl changequote([, ])
+) dnl done AC_PROMPT_USER
diff --git a/m4/ac_prototype.m4 b/m4/ac_prototype.m4
new file mode 100644
index 0000000..a3d6845
--- /dev/null
+++ b/m4/ac_prototype.m4
@@ -0,0 +1,230 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prototype.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROTOTYPE(function, includes, code, TAG1, values1 [, TAG2, values2 [...]])
+#
+# DESCRIPTION
+#
+# Try all the combinations of <TAG1>, <TAG2>... to successfully compile
+# <code>. <TAG1>, <TAG2>, ... are substituted in <code> and <include> with
+# values found in <values1>, <values2>, ... respectively. <values1>,
+# <values2>, ... contain a list of possible values for each corresponding
+# tag and all combinations are tested. When AC_TRY_COMPILE(include, code)
+# is successfull for a given substitution, the macro stops and defines the
+# following macros: FUNCTION_TAG1, FUNCTION_TAG2, ... using AC_DEFINE()
+# with values set to the current values of <TAG1>, <TAG2>, ... If no
+# combination is successfull the configure script is aborted with a
+# message.
+#
+# Intended purpose is to find which combination of argument types is
+# acceptable for a given function <function>. It is recommended to list
+# the most specific types first. For instance ARG1, [size_t, int] instead
+# of ARG1, [int, size_t].
+#
+# Generic usage pattern:
+#
+# 1) add a call in configure.in
+#
+# AC_PROTOTYPE(...)
+#
+# 2) call autoheader to see which symbols are not covered
+#
+# 3) add the lines in acconfig.h
+#
+# /* Type of Nth argument of function */
+# #undef FUNCTION_ARGN
+#
+# 4) Within the code use FUNCTION_ARGN instead of an hardwired type
+#
+# Complete example:
+#
+# 1) configure.in
+#
+# AC_PROTOTYPE(getpeername,
+# [
+# #include <sys/types.h>
+# #include <sys/socket.h>
+# ],
+# [
+# int a = 0;
+# ARG2 * b = 0;
+# ARG3 * c = 0;
+# getpeername(a, b, c);
+# ],
+# ARG2, [struct sockaddr, void],
+# ARG3, [socklen_t, size_t, int, unsigned int, long unsigned int])
+#
+# 2) call autoheader
+#
+# autoheader: Symbol `GETPEERNAME_ARG2' is not covered by ./acconfig.h
+# autoheader: Symbol `GETPEERNAME_ARG3' is not covered by ./acconfig.h
+#
+# 3) acconfig.h
+#
+# /* Type of second argument of getpeername */
+# #undef GETPEERNAME_ARG2
+#
+# /* Type of third argument of getpeername */
+# #undef GETPEERNAME_ARG3
+#
+# 4) in the code
+#
+# ...
+# GETPEERNAME_ARG2 name;
+# GETPEERNAME_ARG3 namelen;
+# ...
+# ret = getpeername(socket, &name, &namelen);
+# ...
+#
+# Implementation notes: generating all possible permutations of the
+# arguments is not easily done with the usual mixture of shell and m4,
+# that is why this macro is almost 100% m4 code. It generates long but
+# simple to read code.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Loic Dachary <loic@senga.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROTOTYPE],[
+dnl
+dnl Upper case function name
+dnl
+ pushdef([function],translit([$1], [a-z], [A-Z]))
+dnl
+dnl Collect tags that will be substituted
+dnl
+ pushdef([tags],[AC_PROTOTYPE_TAGS(builtin([shift],builtin([shift],builtin([shift],$@))))])
+dnl
+dnl Wrap in a 1 time loop, when a combination is found break to stop the combinatory exploration
+dnl
+ for i in 1
+ do
+ AC_PROTOTYPE_LOOP(AC_PROTOTYPE_REVERSE($1, AC_PROTOTYPE_SUBST($2,tags),AC_PROTOTYPE_SUBST($3,tags),builtin([shift],builtin([shift],builtin([shift],$@)))))
+ AC_MSG_ERROR($1 unable to find a working combination)
+ done
+ popdef([tags])
+ popdef([function])
+])
+
+dnl
+dnl AC_PROTOTYPE_REVERSE(list)
+dnl
+dnl Reverse the order of the <list>
+dnl
+AC_DEFUN([AC_PROTOTYPE_REVERSE],[ifelse($#,0,,$#,1,[[$1]],[AC_PROTOTYPE_REVERSE(builtin([shift],$@)),[$1]])])
+
+dnl
+dnl AC_PROTOTYPE_SUBST(string, tag)
+dnl
+dnl Substitute all occurence of <tag> in <string> with <tag>_VAL.
+dnl Assumes that tag_VAL is a macro containing the value associated to tag.
+dnl
+AC_DEFUN([AC_PROTOTYPE_SUBST],[ifelse($2,,[$1],[AC_PROTOTYPE_SUBST(patsubst([$1],[$2],[$2[]_VAL]),builtin([shift],builtin([shift],$@)))])])
+
+dnl
+dnl AC_PROTOTYPE_TAGS([tag, values, [tag, values ...]])
+dnl
+dnl Generate a list of <tag> by skipping <values>.
+dnl
+AC_DEFUN([AC_PROTOTYPE_TAGS],[ifelse($1,,[],[$1, AC_PROTOTYPE_TAGS(builtin([shift],builtin([shift],$@)))])])
+
+dnl
+dnl AC_PROTOTYPE_DEFINES(tags)
+dnl
+dnl Generate a AC_DEFINE(function_tag, tag_VAL) for each tag in <tags> list
+dnl Assumes that function is a macro containing the name of the function in upper case
+dnl and that tag_VAL is a macro containing the value associated to tag.
+dnl
+AC_DEFUN([AC_PROTOTYPE_DEFINES],[ifelse($1,,[],
+ [AC_DEFINE(function[]_$1, $1_VAL)
+ AC_SUBST(function[]_$1, "$1_VAL")
+ AC_PROTOTYPE_DEFINES(builtin([shift],$@))])])
+
+dnl
+dnl AC_PROTOTYPE_STATUS(tags)
+dnl
+dnl Generates a message suitable for argument to AC_MSG_* macros. For each tag
+dnl in the <tags> list the message tag => tag_VAL is generated.
+dnl Assumes that tag_VAL is a macro containing the value associated to tag.
+dnl
+AC_DEFUN([AC_PROTOTYPE_STATUS],[ifelse($1,,[],[$1 => $1_VAL AC_PROTOTYPE_STATUS(builtin([shift],$@))])])
+
+dnl
+dnl AC_PROTOTYPE_EACH(tag, values)
+dnl
+dnl Call AC_PROTOTYPE_LOOP for each values and define the macro tag_VAL to
+dnl the current value.
+dnl
+AC_DEFUN([AC_PROTOTYPE_EACH],[
+ ifelse($2,, [
+ ], [
+ pushdef([$1_VAL], $2)
+ AC_PROTOTYPE_LOOP(rest)
+ popdef([$1_VAL])
+ AC_PROTOTYPE_EACH($1, builtin([shift], builtin([shift], $@)))
+ ])
+])
+
+dnl
+dnl AC_PROTOTYPE_LOOP([tag, values, [tag, values ...]], code, include, function)
+dnl
+dnl If there is a tag/values pair, call AC_PROTOTYPE_EACH with it.
+dnl If there is no tag/values pair left, tries to compile the code and include
+dnl using AC_TRY_COMPILE. If it compiles, AC_DEFINE all the tags to their
+dnl current value and exit with success.
+dnl
+AC_DEFUN([AC_PROTOTYPE_LOOP],[
+ ifelse(builtin([eval], $# > 3), 1,
+ [
+ pushdef([rest],[builtin([shift],builtin([shift],$@))])
+ AC_PROTOTYPE_EACH($2,$1)
+ popdef([rest])
+ ], [
+ AC_MSG_CHECKING($3 AC_PROTOTYPE_STATUS(tags))
+dnl
+dnl Activate fatal warnings if possible, gives better guess
+dnl
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ifelse(AC_LANG,CPLUSPLUS,if test "$GXX" = "yes" ; then CPPFLAGS="$CPPFLAGS -Werror" ; fi)
+ ifelse(AC_LANG,C,if test "$GCC" = "yes" ; then CPPFLAGS="$CPPFLAGS -Werror" ; fi)
+ AC_TRY_COMPILE($2, $1, [
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ AC_MSG_RESULT(ok)
+ AC_PROTOTYPE_DEFINES(tags)
+ break;
+ ], [
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ AC_MSG_RESULT(not ok)
+ ])
+ ]
+ )
+])
diff --git a/m4/ac_prototype_accept.m4 b/m4/ac_prototype_accept.m4
new file mode 100644
index 0000000..0a451d2
--- /dev/null
+++ b/m4/ac_prototype_accept.m4
@@ -0,0 +1,66 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prototype_accept.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROTOTYPE_ACCEPT
+#
+# DESCRIPTION
+#
+# Requires the AC_PROTOTYPE macro.
+#
+# Find the type of argument two and three of accept. User must include the
+# following in acconfig.h:
+#
+# /* Type of second argument of accept */
+# #undef ACCEPT_ARG2
+#
+# /* Type of third argument of accept */
+# #undef ACCEPT_ARG3
+#
+# LICENSE
+#
+# Copyright (c) 2008 Loic Dachary <loic@senga.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROTOTYPE_ACCEPT],[
+AC_PROTOTYPE(accept,
+ [
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ ],
+ [
+ int a = 0;
+ ARG2 * b = 0;
+ ARG3 * c = 0;
+ accept(a, b, c);
+ ],
+ ARG2, [struct sockaddr, void],
+ ARG3, [socklen_t, size_t, int, unsigned int, long unsigned int])
+])
diff --git a/m4/ac_prototype_getsockname.m4 b/m4/ac_prototype_getsockname.m4
new file mode 100644
index 0000000..715dfb5
--- /dev/null
+++ b/m4/ac_prototype_getsockname.m4
@@ -0,0 +1,66 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prototype_getsockname.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROTOTYPE_GETSOCKNAME
+#
+# DESCRIPTION
+#
+# Requires the AC_PROTOTYPE macro.
+#
+# Find the type of argument two and three of getsockname. User must
+# include the following in acconfig.h:
+#
+# /* Type of second argument of getsockname */
+# #undef GETSOCKNAME_ARG2
+#
+# /* Type of third argument of getsockname */
+# #undef GETSOCKNAME_ARG3
+#
+# LICENSE
+#
+# Copyright (c) 2008 Loic Dachary <loic@senga.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROTOTYPE_GETSOCKNAME],[
+AC_PROTOTYPE(getsockname,
+ [
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ ],
+ [
+ int a = 0;
+ ARG2 * b = 0;
+ ARG3 * c = 0;
+ getsockname(a, b, c);
+ ],
+ ARG2, [struct sockaddr, void],
+ ARG3, [socklen_t, size_t, int, unsigned int, long unsigned int])
+])
diff --git a/m4/ac_prototype_setsockopt.m4 b/m4/ac_prototype_setsockopt.m4
new file mode 100644
index 0000000..505312d
--- /dev/null
+++ b/m4/ac_prototype_setsockopt.m4
@@ -0,0 +1,61 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_prototype_setsockopt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROTOTYPE_SETSOCKOPT
+#
+# DESCRIPTION
+#
+# Requires the AC_PROTOTYPE macro.
+#
+# Find the type of argument three of setsockopt. User must include the
+# following in acconfig.h:
+#
+# /* Type of third argument of setsockopt */
+# #undef SETSOCKOPT_ARG3
+#
+# LICENSE
+#
+# Copyright (c) 2008 Loic Dachary <loic@senga.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PROTOTYPE_SETSOCKOPT],[
+AC_PROTOTYPE(setsockopt,
+ [
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ ],
+ [
+ int a = 0;
+ ARG3 b = 0;
+ setsockopt(a, SOL_SOCKET, SO_REUSEADDR, b, sizeof(a));
+ ],
+ ARG3, [const void*, const char*, void*, char*])
+])
diff --git a/m4/ac_python_devel.m4 b/m4/ac_python_devel.m4
new file mode 100644
index 0000000..5183450
--- /dev/null
+++ b/m4/ac_python_devel.m4
@@ -0,0 +1,320 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_python_devel.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PYTHON_DEVEL([version])
+#
+# DESCRIPTION
+#
+# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it
+# in your configure.ac.
+#
+# This macro checks for Python and tries to get the include path to
+# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS)
+# output variables. It also exports $(PYTHON_EXTRA_LIBS) and
+# $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code.
+#
+# You can search for some particular version of Python by passing a
+# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please
+# note that you *have* to pass also an operator along with the version to
+# match, and pay special attention to the single quotes surrounding the
+# version number. Don't use "PYTHON_VERSION" for this: that environment
+# variable is declared as precious and thus reserved for the end-user.
+#
+# This macro should work for all versions of Python >= 2.1.0. As an end
+# user, you can disable the check for the python version by setting the
+# PYTHON_NOVERSIONCHECK environment variable to something else than the
+# empty string.
+#
+# If you need to use this macro for an older Python version, please
+# contact the authors. We're always open for feedback.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Sebastian Huber <sebastian-huber@web.de>
+# Copyright (c) 2009 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
+# Copyright (c) 2009 Rafael Laboissiere <rafael@laboissiere.net>
+# Copyright (c) 2009 Andrew Collier <colliera@ukzn.ac.za>
+# Copyright (c) 2009 Matteo Settenvini <matteo@member.fsf.org>
+# Copyright (c) 2009 Horst Knorr <hk_classes@knoda.org>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_PYTHON_DEVEL],[
+ #
+ # Allow the use of a (user set) custom python version
+ #
+ AC_ARG_VAR([PYTHON_VERSION],[The installed Python
+ version to use, for example '2.3'. This string
+ will be appended to the Python interpreter
+ canonical name.])
+
+ AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]])
+ if test -z "$PYTHON"; then
+ AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path])
+ PYTHON_VERSION=""
+ fi
+
+ #
+ # Check for a version of Python >= 2.1.0
+ #
+ AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
+ ac_supports_python_ver=`$PYTHON -c "import sys; \
+ ver = sys.version.split ()[[0]]; \
+ print (ver >= '2.1.0')"`
+ if test "$ac_supports_python_ver" != "True"; then
+ if test -z "$PYTHON_NOVERSIONCHECK"; then
+ AC_MSG_RESULT([no])
+ AC_MSG_FAILURE([
+This version of the AC@&t@_PYTHON_DEVEL macro
+doesn't work properly with versions of Python before
+2.1.0. You may need to re-run configure, setting the
+variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG,
+PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
+Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
+to something else than an empty string.
+])
+ else
+ AC_MSG_RESULT([skip at user request])
+ fi
+ else
+ AC_MSG_RESULT([yes])
+ fi
+
+ #
+ # if the macro parameter ``version'' is set, honour it
+ #
+ if test -n "$1"; then
+ AC_MSG_CHECKING([for a version of Python $1])
+ ac_supports_python_ver=`$PYTHON -c "import sys; \
+ ver = sys.version.split ()[[0]]; \
+ print (ver $1)"`
+ if test "$ac_supports_python_ver" = "True"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([this package requires Python $1.
+If you have it installed, but it isn't the default Python
+interpreter in your system path, please pass the PYTHON_VERSION
+variable to configure. See ``configure --help'' for reference.
+])
+ PYTHON_VERSION=""
+ fi
+ fi
+
+ #
+ # Check if you have distutils, else fail
+ #
+ AC_MSG_CHECKING([for the distutils Python package])
+ ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
+ if test -z "$ac_distutils_result"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([cannot import Python module "distutils".
+Please check your Python installation. The error was:
+$ac_distutils_result])
+ PYTHON_VERSION=""
+ fi
+
+ #
+ # Check for Python include path
+ #
+ AC_MSG_CHECKING([for Python include path])
+ if test -z "$PYTHON_CPPFLAGS"; then
+ python_path=`$PYTHON -c "import distutils.sysconfig; \
+ print (distutils.sysconfig.get_python_inc ());"`
+ if test -n "${python_path}"; then
+ python_path="-I$python_path"
+ fi
+ PYTHON_CPPFLAGS=$python_path
+ fi
+ AC_MSG_RESULT([$PYTHON_CPPFLAGS])
+ AC_SUBST([PYTHON_CPPFLAGS])
+
+ #
+ # Check for Python library path
+ #
+ AC_MSG_CHECKING([for Python library path])
+ if test -z "$PYTHON_LDFLAGS"; then
+ # (makes two attempts to ensure we've got a version number
+ # from the interpreter)
+ ac_python_version=`cat<<EOD | $PYTHON -
+
+# join all versioning strings, on some systems
+# major/minor numbers could be in different list elements
+from distutils.sysconfig import *
+ret = ''
+for e in get_config_vars ('VERSION'):
+ if (e != None):
+ ret += e
+print (ret)
+EOD`
+
+ if test -z "$ac_python_version"; then
+ if test -n "$PYTHON_VERSION"; then
+ ac_python_version=$PYTHON_VERSION
+ else
+ ac_python_version=`$PYTHON -c "import sys; \
+ print (sys.version[[:3]])"`
+ fi
+ fi
+
+ # Make the versioning information available to the compiler
+ AC_DEFINE_UNQUOTED([HAVE_PYTHON], ["$ac_python_version"],
+ [If available, contains the Python version number currently in use.])
+
+ # First, the library directory:
+ ac_python_libdir=`cat<<EOD | $PYTHON -
+
+# There should be only one
+import distutils.sysconfig
+for e in distutils.sysconfig.get_config_vars ('LIBDIR'):
+ if e != None:
+ print (e)
+ break
+EOD`
+
+ # Before checking for libpythonX.Y, we need to know
+ # the extension the OS we're on uses for libraries
+ # (we take the first one, if there's more than one fix me!):
+ ac_python_soext=`$PYTHON -c \
+ "import distutils.sysconfig; \
+ print (distutils.sysconfig.get_config_vars('SO')[[0]])"`
+
+ # Now, for the library:
+ ac_python_soname=`$PYTHON -c \
+ "import distutils.sysconfig; \
+ print (distutils.sysconfig.get_config_vars('LDLIBRARY')[[0]])"`
+
+ # Strip away extension from the end to canonicalize its name:
+ ac_python_library=`echo "$ac_python_soname" | sed "s/${ac_python_soext}$//"`
+
+ # This small piece shamelessly adapted from PostgreSQL python macro;
+ # credits goes to momjian, I think. I'd like to put the right name
+ # in the credits, if someone can point me in the right direction... ?
+ #
+ if test -n "$ac_python_libdir" -a -n "$ac_python_library" \
+ -a x"$ac_python_library" != x"$ac_python_soname"
+ then
+ # use the official shared library
+ ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"`
+ PYTHON_LDFLAGS="-L$ac_python_libdir -l$ac_python_library"
+ else
+ # old way: use libpython from python_configdir
+ ac_python_libdir=`$PYTHON -c \
+ "from distutils.sysconfig import get_python_lib as f; \
+ import os; \
+ print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"`
+ PYTHON_LDFLAGS="-L$ac_python_libdir -lpython$ac_python_version"
+ fi
+
+ if test -z "PYTHON_LDFLAGS"; then
+ AC_MSG_ERROR([
+ Cannot determine location of your Python DSO. Please check it was installed with
+ dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand.
+ ])
+ fi
+ fi
+ AC_MSG_RESULT([$PYTHON_LDFLAGS])
+ AC_SUBST([PYTHON_LDFLAGS])
+
+ #
+ # Check for site packages
+ #
+ AC_MSG_CHECKING([for Python site-packages path])
+ if test -z "$PYTHON_SITE_PKG"; then
+ PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
+ print (distutils.sysconfig.get_python_lib(0,0));"`
+ fi
+ AC_MSG_RESULT([$PYTHON_SITE_PKG])
+ AC_SUBST([PYTHON_SITE_PKG])
+
+ #
+ # libraries which must be linked in when embedding
+ #
+ AC_MSG_CHECKING(python extra libraries)
+ if test -z "$PYTHON_EXTRA_LIBS"; then
+ PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
+ conf = distutils.sysconfig.get_config_var; \
+ print (conf('LOCALMODLIBS') + ' ' + conf('LIBS'))"`
+ fi
+ AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
+ AC_SUBST(PYTHON_EXTRA_LIBS)
+
+ #
+ # linking flags needed when embedding
+ #
+ AC_MSG_CHECKING(python extra linking flags)
+ if test -z "$PYTHON_EXTRA_LDFLAGS"; then
+ PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
+ conf = distutils.sysconfig.get_config_var; \
+ print (conf('LINKFORSHARED'))"`
+ fi
+ AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
+ AC_SUBST(PYTHON_EXTRA_LDFLAGS)
+
+ #
+ # final check to see if everything compiles alright
+ #
+ AC_MSG_CHECKING([consistency of all components of python development environment])
+ # save current global flags
+ LIBS="$ac_save_LIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LDFLAGS $PYTHON_EXTRA_LIBS"
+ CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
+ AC_LANG_PUSH([C])
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[#include <Python.h>]],
+ [[Py_Initialize();]])
+ ],[pythonexists=yes],[pythonexists=no])
+ AC_LANG_POP([C])
+ # turn back to default flags
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIBS="$ac_save_LIBS"
+
+ AC_MSG_RESULT([$pythonexists])
+
+ if test ! "x$pythonexists" = "xyes"; then
+ AC_MSG_FAILURE([
+ Could not link test program to Python. Maybe the main Python library has been
+ installed in some non-standard library path. If so, pass it to configure,
+ via the LDFLAGS environment variable.
+ Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
+ ============================================================================
+ ERROR!
+ You probably have to install the development version of the Python package
+ for your distribution. The exact name of this package varies among them.
+ ============================================================================
+ ])
+ PYTHON_VERSION=""
+ fi
+
+ #
+ # all done!
+ #
+])
diff --git a/m4/ac_python_module.m4 b/m4/ac_python_module.m4
new file mode 100644
index 0000000..376d288
--- /dev/null
+++ b/m4/ac_python_module.m4
@@ -0,0 +1,45 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_python_module.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PYTHON_MODULE(modname[, fatal])
+#
+# DESCRIPTION
+#
+# Checks for Python module.
+#
+# If fatal is non-empty then absence of a module will trigger an error.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_PYTHON_MODULE],[
+ if test -z $PYTHON;
+ then
+ PYTHON="python"
+ fi
+ PYTHON_NAME=`basename $PYTHON`
+ AC_MSG_CHECKING($PYTHON_NAME module: $1)
+ $PYTHON -c "import $1" 2>/dev/null
+ if test $? -eq 0;
+ then
+ AC_MSG_RESULT(yes)
+ eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
+ else
+ AC_MSG_RESULT(no)
+ eval AS_TR_CPP(HAVE_PYMOD_$1)=no
+ #
+ if test -n "$2"
+ then
+ AC_MSG_ERROR(failed to find required module $1)
+ exit 1
+ fi
+ fi
+])
diff --git a/m4/ac_raf_func_which_getservbyname_r.m4 b/m4/ac_raf_func_which_getservbyname_r.m4
new file mode 100644
index 0000000..fb95a58
--- /dev/null
+++ b/m4/ac_raf_func_which_getservbyname_r.m4
@@ -0,0 +1,107 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_raf_func_which_getservbyname_r.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_raf_FUNC_WHICH_GETSERVBYNAME_R
+#
+# DESCRIPTION
+#
+# Provides a test to determine the correct way to call getservbyname_r:
+#
+# - defines HAVE_FUNC_GETSERVBYNAME_R_6 if it needs 6 arguments (e.g linux)
+# - defines HAVE_FUNC_GETSERVBYNAME_R_5 if it needs 5 arguments (e.g. solaris)
+# - defines HAVE_FUNC_GETSERVBYNAME_R_4 if it needs 4 arguments (e.g. osf/1)
+#
+# An example use can be found at
+# http://raf.org/autoconf/net_getservbyname.c
+#
+# Based on Caolan McNamara's gethostbyname_r macro. Based on David
+# Arnold's autoconf suggestion in the threads faq.
+#
+# LICENSE
+#
+# Copyright (c) 2008 raf <raf@raf.org>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_raf_FUNC_WHICH_GETSERVBYNAME_R],
+[AC_CACHE_CHECK(for getservbyname_r, ac_cv_func_which_getservbyname_r, [
+AC_CHECK_FUNC(getservbyname_r, [
+ AC_TRY_COMPILE([
+# include <netdb.h>
+ ], [
+
+ char *name;
+ char *proto;
+ struct servent *se;
+ struct servent_data data;
+ (void) getservbyname_r(name, proto, se, &data);
+
+ ],ac_cv_func_which_getservbyname_r=four,
+ [
+ AC_TRY_COMPILE([
+# include <netdb.h>
+ ], [
+ char *name;
+ char *proto;
+ struct servent *se, *res;
+ char buffer[2048];
+ int buflen = 2048;
+ (void) getservbyname_r(name, proto, se, buffer, buflen, &res)
+ ],ac_cv_func_which_getservbyname_r=six,
+
+ [
+ AC_TRY_COMPILE([
+# include <netdb.h>
+ ], [
+ char *name;
+ char *proto;
+ struct servent *se;
+ char buffer[2048];
+ int buflen = 2048;
+ (void) getservbyname_r(name, proto, se, buffer, buflen)
+ ],ac_cv_func_which_getservbyname_r=five,ac_cv_func_which_getservbyname_r=no)
+
+ ]
+
+ )
+ ]
+ )]
+ ,ac_cv_func_which_getservbyname_r=no)])
+
+if test $ac_cv_func_which_getservbyname_r = six; then
+ AC_DEFINE(HAVE_FUNC_GETSERVBYNAME_R_6)
+elif test $ac_cv_func_which_getservbyname_r = five; then
+ AC_DEFINE(HAVE_FUNC_GETSERVBYNAME_R_5)
+elif test $ac_cv_func_which_getservbyname_r = four; then
+ AC_DEFINE(HAVE_FUNC_GETSERVBYNAME_R_4)
+
+fi
+
+])
diff --git a/m4/ac_set_default_paths_system.m4 b/m4/ac_set_default_paths_system.m4
new file mode 100644
index 0000000..1dc07ec
--- /dev/null
+++ b/m4/ac_set_default_paths_system.m4
@@ -0,0 +1,136 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_set_default_paths_system.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_SET_DEFAULT_PATHS_SYSTEM
+#
+# DESCRIPTION
+#
+# the most interesting changes go about windows-targets - where the
+# default_prefix is set to /programs, and quite some directories are
+# aliased: sbindir := libdir := bindir and the docprefix-defaults are also
+# a bit different, even on FHS2-compliant systems where the mandir is
+# going to $prefix/man only if prefix=/usr, otherwise they shall go to
+# $datadir/man. We use an extra docprefix to express it which is either
+# defined as being prefix or datadir. not SUBSTed here.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_SET_DEFAULT_PATHS_SYSTEM],
+[AC_REQUIRE([AC_CANONICAL_HOST]) # --------------------------------------------
+case "$prefix:$ac_default_prefix" in
+ NONE:/usr/local)
+ result=""
+ AC_MSG_CHECKING(default prefix path)
+ case "${target_os}" in
+ *cygwin* | *mingw* | *uwin* | *djgpp | *emx* )
+ if test "${host_os}" = "${target_os}" ; then
+ ac_default_prefix="/programs"
+ result="(win/dos target)"
+ else
+ case "$PATH" in
+ *:/usr/local/cross-tools/$target_alias/bin:*)
+ ac_default_prefix="/usr/local/cross-tools/$target_alias" ;;
+ *:/usr/local/$target_alias/bin:*)
+ ac_default_prefix="/usr/local/$target_alias" ;;
+ *:/usr/local/$target_cpu-$target_os/bin:*)
+ ac_default_prefix="/usr/local/$target_cpu-$target_os" ;;
+ *)
+ ac_default_prefix="/programs" ;;
+ esac
+ result="(win/dos cross-compiler)"
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT($ac_default_prefix $result)
+ ;;
+esac
+AC_MSG_CHECKING(default prefix system)
+result="$prefix" ; test "$result" = "NONE" && result="$ac_default_prefix"
+case ${result} in
+ /programs | /programs/*) result="is win-/programs"
+ # on win/dos, .exe .dll and .cfg live in the same directory
+ libdir=`echo $libdir |sed -e 's:^..exec_prefix./lib$:${bindir}:'`
+ sbindir=`echo $sbindir |sed -e 's:^..exec_prefix./sbin$:${libdir}:'`
+ sysconfdir=`echo $sysconfdir |sed -e 's:^..prefix./etc$:${sbindir}:'`
+ libexecdir=`echo $libexecdir |sed -e 's:/libexec$:/system:'`
+ # help-files shall be set with --infodir, docprefix is datadir
+ docprefix="${datadir}"
+ mandir=`echo $mandir \
+ |sed -e 's:^..prefix./man$:${datadir}/info:'`
+ includedir=`echo $includedir \
+ |sed -e 's:^..prefix./include$:${datadir}/include:'`
+ # other state files (but /etc) are moved to datadir
+ sharedstatedir=`echo $sharedstatedir \
+ |sed -e 's:^..prefix./com$:${datadir}/default:'`
+ localstatedir=`echo $localstatedir \
+ |sed -e 's:^..prefix./var$:${datadir}/current:'`
+ ;;
+ /usr) result="is /usr-shipped"
+ # doc files are left at prefix
+ docprefix="${prefix}"
+ # state files go under /top
+ sysconfdir=`echo $sysconfdir |sed -e 's:^..prefix./etc$:/etc:'`
+ sharedstatedir=`echo $sharedstatedir \
+ |sed -e 's:^..prefix./com$:/etc/default:'`
+ # $prefix/var is going to end up in /var/lib
+ localstatedir=`echo $localstatedir \
+ |sed -e 's:^..prefix./var$:/var/lib:'`
+ ;;
+ /opt | /opt/*) result="is /opt-package"
+ # state files go under /top/prefix
+ sysconfdir=`echo $sysconfdir \
+ |sed -e 's:^..prefix./etc$:/etc${prefix}:'`
+ sharedstatedir=`echo $sharedstatedir \
+ |sed -e 's:^..prefix./com$:/etc/default${prefix}:'`
+ # $prefix/var is going to to be /var$prefix... once again
+ localstatedir=`echo $localstatedir \
+ |sed -e 's:^..prefix./var$:/var${prefix}:'`
+ # doc files are left at prefix
+ docprefix="${prefix}"
+ ;;
+ *) result="is /local-package"
+ # doc files are moved from prefix down to datadir
+ docprefix="${datadir}"
+ mandir=`echo $mandir \
+ |sed -e 's:^..prefix./man$:${datadir}/man:'`
+ infodir=`echo $infodir \
+ |sed -e 's:^..prefix./infodir$:${datadir}/info:'`
+ # never use $prefix/com - that is no good idea
+ sharedstatedir=`echo $sharedstatedir \
+ |sed -e 's:^..prefix./com$:${sysconfdir}/default:'`
+ ;;
+esac
+AC_MSG_RESULT($result)
+# --------------------------------------------------------
+])
diff --git a/m4/ac_subdir_files.m4 b/m4/ac_subdir_files.m4
new file mode 100644
index 0000000..51a5895
--- /dev/null
+++ b/m4/ac_subdir_files.m4
@@ -0,0 +1,67 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_subdir_files.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_SUBDIR_FILES [(SUBDIRS [, CASEPATTERN])]
+#
+# DESCRIPTION
+#
+# Look into subdirs and copy the (real) files that match pattern into the
+# local directory. Preferably we use a symbolic link of course. existing
+# local files are not overwritten.
+#
+# The default casepattern is "*.?|*.cc|*.cpp", the default subdir-list
+# contains all subdirs available.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_SUBDIR_FILES],
+[AC_BEFORE($0,[AC_PROG_CP_S])
+ for ac_subdir in ifelse([$1], , *, $1) ; do
+ if test -d $ac_subdir ; then
+ AC_MSG_CHECKING(subdir $ac_subdir)
+ for ac_file in $ac_subdir/* ; do
+ if test -f $ac_file ; then
+ if test ! -e `basename $ac_file` ; then
+ case `basename $ac_file` in
+ ifelse([$2], , *.?|*.cc|*.cpp,[$1]))
+ echo ${ECHO_N} "$ac_file," ;
+ $CP_S $ac_file . ;;
+ esac
+ fi
+ fi
+ done
+ AC_MSG_RESULT(;)
+ fi
+ done
+])
diff --git a/m4/ac_sys_dev_poll.m4 b/m4/ac_sys_dev_poll.m4
new file mode 100644
index 0000000..b690fa0
--- /dev/null
+++ b/m4/ac_sys_dev_poll.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_sys_dev_poll.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_SYS_DEV_POLL([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro tests for the presence of /dev/poll support in the build
+# environment. It checks that the needed structure (dvpoll) is available,
+# with the standard fields. /dev/poll is most often seen under Solaris.
+#
+# Note that it does not attempt to actually open /dev/poll -- you should
+# test for errors when you open it and then fall back to poll() if it is
+# unavailable.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Dave Benson <daveb@ffem.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_SYS_DEV_POLL], [AC_CACHE_CHECK(for /dev/poll support, ac_cv_dev_poll,
+ AC_TRY_COMPILE([#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/poll.h>
+#include <sys/devpoll.h>],
+[
+ struct dvpoll p;
+ p.dp_timeout = 0;
+ p.dp_nfds = 0;
+ p.dp_fds = (struct pollfd *) 0;
+ return 0;
+],
+ ac_cv_dev_poll=yes
+ [$1],
+ ac_cv_dev_poll=no
+ [$2]
+ )
+ )
+])
diff --git a/m4/ac_sys_largefile_sensitive.m4 b/m4/ac_sys_largefile_sensitive.m4
new file mode 100644
index 0000000..60acb94
--- /dev/null
+++ b/m4/ac_sys_largefile_sensitive.m4
@@ -0,0 +1,77 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_sys_largefile_sensitive.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_SYS_LARGEFILE_SENSITIVE
+#
+# DESCRIPTION
+#
+# Check whether the current system is sensitive to -Ddefines making off_t
+# having different types/sizes. Automatically define a config.h symbol
+# LARGEFILE_SENSITIVE if that is the case, otherwise leave everything as
+# is.
+#
+# This macro builds on top of AC_SYS_LARGEFILE to detect whether special
+# options are neede to make the code use 64bit off_t - in many setups this
+# will also make the code use 64bit off_t immediatly.
+#
+# The common use of a LARGEFILE_SENSITIVE config.h-define is to rename
+# exported functions, usually adding a 64 to the original function name.
+# Such renamings are only needed on systems being both (a) 32bit off_t by
+# default and (b) implementing large.file extensions (as for unix98).
+#
+# a renaming section could look like this:
+#
+# #if defined LARGEFILE_SENSITIVE && _FILE_OFFSET_BITS+0 == 64
+# #define zzip_open zzip_open64
+# #define zzip_seek zzip_seek64
+# #endif
+#
+# for libraries, it is best to take advantage of the prefix-config.h
+# macro, otherwise you want to export a renamed LARGEFILE_SENSITIVE in an
+# installed header file. -> see AX_PREFIX_CONFIG_H
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_SYS_LARGEFILE_SENSITIVE],[dnl
+AC_REQUIRE([AC_SYS_LARGEFILE])dnl
+# we know about some internals of ac_sys_largefile here...
+AC_MSG_CHECKING(whether system differentiates 64bit off_t by defines)
+ac_cv_sys_largefile_sensitive="no"
+if test ".$ac_cv_sys_file_offset_bits$ac_cv_sys_large_files" != ".nono"
+then ac_cv_sys_largefile_sensitive="yes"
+ AC_DEFINE(LARGEFILE_SENSITIVE, 1,
+ [whether the system defaults to 32bit off_t but can do 64bit when requested])
+fi
+AC_MSG_RESULT([$ac_cv_sys_largefile_sensitive])
+])
diff --git a/m4/ac_try_compile_java.m4 b/m4/ac_try_compile_java.m4
new file mode 100644
index 0000000..14629c0
--- /dev/null
+++ b/m4/ac_try_compile_java.m4
@@ -0,0 +1,51 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_try_compile_java.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_TRY_COMPILE_JAVA
+#
+# DESCRIPTION
+#
+# AC_TRY_COMPILE_JAVA attempt to compile user given source.
+#
+# *Warning*: its success or failure can depend on a proper setting of the
+# CLASSPATH env. variable.
+#
+# Note: This is part of the set of autoconf M4 macros for Java programs.
+# It is VERY IMPORTANT that you download the whole set, some macros depend
+# on other. Unfortunately, the autoconf archive does not support the
+# concept of set of macros, so I had to break it for submission. The
+# general documentation, as well as the sample configure.in, is included
+# in the AC_PROG_JAVA macro.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Devin Weaver <ktohg@tritarget.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_TRY_COMPILE_JAVA],[
+AC_REQUIRE([AC_PROG_JAVAC])dnl
+cat << \EOF > Test.java
+/* [#]line __oline__ "configure" */
+ifelse([$1], , , [import $1;])
+public class Test {
+[$2]
+}
+EOF
+if AC_TRY_COMMAND($JAVAC $JAVACFLAGS Test.java) && test -s Test.class
+then
+dnl Don't remove the temporary files here, so they can be examined.
+ ifelse([$3], , :, [$3])
+else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat Test.java >&AC_FD_CC
+ifelse([$4], , , [ rm -fr Test*
+ $4
+])dnl
+fi
+rm -fr Test*])
diff --git a/m4/ac_try_run_javac.m4 b/m4/ac_try_run_javac.m4
new file mode 100644
index 0000000..36d4fd4
--- /dev/null
+++ b/m4/ac_try_run_javac.m4
@@ -0,0 +1,52 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_try_run_javac.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_TRY_RUN_JAVA
+#
+# DESCRIPTION
+#
+# AC_TRY_RUN_JAVA attempt to compile and run user given source.
+#
+# *Warning*: its success or failure can depend on a proper setting of the
+# CLASSPATH env. variable.
+#
+# Note: This is part of the set of autoconf M4 macros for Java programs.
+# It is VERY IMPORTANT that you download the whole set, some macros depend
+# on other. Unfortunately, the autoconf archive does not support the
+# concept of set of macros, so I had to break it for submission. The
+# general documentation, as well as the sample configure.in, is included
+# in the AC_PROG_JAVA macro.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Devin Weaver <ktohg@tritarget.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_TRY_RUN_JAVA],[
+AC_REQUIRE([AC_PROG_JAVAC])dnl
+AC_REQUIRE([AC_PROG_JAVA])dnl
+cat << \EOF > Test.java
+/* [#]line __oline__ "configure" */
+ifelse([$1], , , [include $1;])
+public class Test {
+[$2]
+}
+EOF
+if AC_TRY_COMMAND($JAVAC $JAVACFLAGS Test.java) && test -s Test.class && ($JAVA $JAVAFLAGS Test; exit) 2>/dev/null
+then
+dnl Don't remove the temporary files here, so they can be examined.
+ ifelse([$3], , :, [$3])
+else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat Test.java >&AC_FD_CC
+ifelse([$4], , , [ rm -fr Test*
+ $4
+])dnl
+fi
+rm -fr Test*])
diff --git a/m4/ac_var_timezone_externals.m4 b/m4/ac_var_timezone_externals.m4
new file mode 100644
index 0000000..247cf3d
--- /dev/null
+++ b/m4/ac_var_timezone_externals.m4
@@ -0,0 +1,76 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_var_timezone_externals.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_VAR_TIMEZONE_EXTERNALS
+#
+# DESCRIPTION
+#
+# Use instead of `AC_STRUCT_TIMEZONE' to determine whether the the
+# external timezone variables `timezone', `altzone' and `daylight' exist,
+# defining `HAVE_TIMEZONE', `HAVE_ALTZONE' and `HAVE_DAYLIGHT'
+# respectively (as well as gaining the macros defined by
+# `AC_STRUCT_TIMEZONE').
+#
+# LICENSE
+#
+# Copyright (c) 2008 Mark R. Bannister
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_VAR_TIMEZONE_EXTERNALS],
+[ AC_REQUIRE([AC_STRUCT_TIMEZONE])dnl
+ AC_CACHE_CHECK(for timezone external, mb_cv_var_timezone,
+ [ AC_TRY_LINK([#include <time.h>], [return (int)timezone;],
+ mb_cv_var_timezone=yes,
+ mb_cv_var_timezone=no)
+ ])
+ AC_CACHE_CHECK(for altzone external, mb_cv_var_altzone,
+ [ AC_TRY_LINK([#include <time.h>], [return (int)altzone;],
+ mb_cv_var_altzone=yes,
+ mb_cv_var_altzone=no)
+ ])
+ AC_CACHE_CHECK(for daylight external, mb_cv_var_daylight,
+ [ AC_TRY_LINK([#include <time.h>], [return (int)daylight;],
+ mb_cv_var_daylight=yes,
+ mb_cv_var_daylight=no)
+ ])
+ if test $mb_cv_var_timezone = yes; then
+ AC_DEFINE([HAVE_TIMEZONE], 1,
+ [Define if you have the external `timezone' variable.])
+ fi
+ if test $mb_cv_var_altzone = yes; then
+ AC_DEFINE([HAVE_ALTZONE], 1,
+ [Define if you have the external `altzone' variable.])
+ fi
+ if test $mb_cv_var_daylight = yes; then
+ AC_DEFINE([HAVE_DAYLIGHT], 1,
+ [Define if you have the external `daylight' variable.])
+ fi
+])
diff --git a/m4/ac_very_nice.m4 b/m4/ac_very_nice.m4
new file mode 100644
index 0000000..d5fb166
--- /dev/null
+++ b/m4/ac_very_nice.m4
@@ -0,0 +1,77 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_very_nice.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_VERY_NICE
+#
+# DESCRIPTION
+#
+# A macro to check the options of nice, in order to have a VERY_NICE
+# variable which runs a program at the lowest priority VERY_NICE is
+# undefined if we don't find the proper options, so you can safely use:
+#
+# @VERY_NICE@ mycommand
+#
+# in a shell script.
+#
+# The VERY_NICE variable includes the placeholder NICE_VALUE that you have
+# to instantiate at run-time. If you give a argument to AC_VERY_NICE, it
+# will be used as an argument of nice for testing and included in
+# VERY_NICE instead of the above placeholder.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_VERY_NICE],[
+if test "x$1" != "x"; then
+ NICE_VALUE=$1
+else
+ NICE_VALUE=20
+fi
+AC_CHECK_PROGS(TEST_NICE, date)
+AC_CHECK_PROGS(NICE, nice, )
+AC_MSG_CHECKING(syntax of nice)
+if test "x$NICE" != "x"; then
+ if ( $NICE -n $NICE_VALUE $TEST_NICE > /dev/null 2>&1 ) ; then
+ VERY_NICE="$NICE -n $NICE_VALUE"
+ else
+ if ( $NICE -$NICE_VALUE $TEST_NICE > /dev/null 2>&1 ) ; then
+ VERY_NICE="$NICE -$NICE_VALUE"
+ fi
+ fi
+fi
+if test "x$1" = "x"; then
+ VERY_NICE=`echo $VERY_NICE | sed "s/$NICE_VALUE/NICE_VALUE/"`
+fi
+AC_MSG_RESULT($VERY_NICE)
+AC_SUBST(VERY_NICE)
+])
diff --git a/m4/acltx_class.m4 b/m4/acltx_class.m4
new file mode 100644
index 0000000..1dcf082
--- /dev/null
+++ b/m4/acltx_class.m4
@@ -0,0 +1,67 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_class.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_CLASS(CLASSNAME,VARIABLETOSET[,ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macros test is class CLASSNAME exists and work and set
+# VARIABLETOSET to yes or no If ACTION-IF-FOUND (and ACTION-IF-NOT-FOUND)
+# are set, do the correct action
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_CLASS],[
+ACLTX_PACKAGE_LOCATION($1.cls,$2_location)
+if test "[$]$2_location" = "no" ; then
+ AC_MSG_WARN([Unable to locate the $1.cls file])
+ [ac_cv_latex_class_]translit($1,[-],[_])="no";
+else
+AC_CACHE_CHECK([for usability of class $1],[ac_cv_latex_class_]translit($1,[-],[_]),[
+_ACLTX_TEST([\documentclass{$1}
+\begin{document}
+\end{document}],[ac_cv_latex_class_]translit($1,[-],[_]))
+])
+fi
+$2=$[ac_cv_latex_class_]translit($1,[-],[_]) ; export $2;
+AC_SUBST($2)
+ifelse($#,2,[],$#,3,[
+ if test "[$]$2" = "yes" ;
+ then
+ $3
+ fi
+],$#,4,[
+ ifelse($3,[],[
+ if test "[$]$2" = "no" ;
+ then
+ $4
+ fi
+ ],[
+ if test "[$]$2" = "yes" ;
+ then
+ $3
+ else
+ $4
+ fi
+ ])
+])
+
+])
diff --git a/m4/acltx_class_article.m4 b/m4/acltx_class_article.m4
new file mode 100644
index 0000000..668dae5
--- /dev/null
+++ b/m4/acltx_class_article.m4
@@ -0,0 +1,33 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_class_article.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_CLASS_ARTICLE([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro test if class article is installed and fail (default) with a
+# error message if not
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_CLASS_ARTICLE],[
+ACLTX_CLASS(article,article,[],[m4_ifval([$1],[$1],AC_MSG_ERROR([Unable to find the article class]))])])
+])
diff --git a/m4/acltx_class_book.m4 b/m4/acltx_class_book.m4
new file mode 100644
index 0000000..d48e871
--- /dev/null
+++ b/m4/acltx_class_book.m4
@@ -0,0 +1,33 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_class_book.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_CLASS_BOOK([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro test if class book is installed and fail (default) with a
+# error message if not
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_CLASS_BOOK],[
+ACLTX_CLASS(book,book,[],[m4_ifval([$1],[$1],AC_MSG_ERROR([Unable to find the book class]))])
+])
diff --git a/m4/acltx_class_cweb.m4 b/m4/acltx_class_cweb.m4
new file mode 100644
index 0000000..29cbdea
--- /dev/null
+++ b/m4/acltx_class_cweb.m4
@@ -0,0 +1,93 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_class_cweb.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_CLASS_CWEB(VARIABLETOSET[,ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macros test if the class cweb exists and works. It sets
+# VARIABLETOSET to yes or no If ACTION-IF-FOUND (and ACTION-IF-NOT-FOUND)
+# are set, do the correct action.
+#
+# The cweb package is used to provide LaTeX support atop Knuth's CWEB
+# literate programming environment. The test LaTeX document requires some
+# additional logic beyond ACLTX_CLASS because the cweb package expects
+# cweave to insert some boilerplate. Both macros for the original CWEB and
+# the compatible offshoot CWEBx are tested here. See
+# http://www.ctan.org/tex-archive/help/Catalogue/entries/cweb-latex.html.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Rhys Ulerich <rhys.ulerich@gmail.com>
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_CLASS_CWEB],[
+ACLTX_PACKAGE_LOCATION(cweb.cls,ac_cv_latex_class_cweb_location)
+if test "[$]ac_cv_latex_class_cweb_location" = "no" ; then
+ AC_MSG_WARN([Unable to locate the cweb.cls file])
+ ac_cv_latex_class_cweb="no";
+else
+ AC_CACHE_CHECK(
+ [for usability of class cweb with Levy/Knuth CWEB],
+ [ac_cv_latex_class_cweb_CWEB],[
+ _ACLTX_TEST([
+ \input cwebmac
+ \documentclass{cweb}
+ \begin{document}
+ \M{1}
+ \end{document}
+ \fi
+ \fin
+ ], [ac_cv_latex_class_cweb_CWEB])
+ ])
+ AC_CACHE_CHECK(
+ [for usability of class cweb with van Leeuwen CWEBx],
+ [ac_cv_latex_class_cweb_CWEBx],[
+ _ACLTX_TEST([
+ \input cwebcmac
+ \documentclass{cweb}
+ \begin{document}
+ \M{1}
+ \end{document}
+ \fi
+ \fin
+ ],[ac_cv_latex_class_cweb_CWEBx])
+ ])
+ ac_cv_latex_class_cweb=no
+ if test "$ac_cv_latex_class_cweb_CWEB" = yes; then
+ ac_cv_latex_class_cweb=yes
+ fi
+ if test "$ac_cv_latex_class_cweb_CWEBx" = yes; then
+ ac_cv_latex_class_cweb=yes
+ fi
+fi
+
+$1=$[ac_cv_latex_class_cweb] ; export $1
+AC_SUBST($1)
+
+if test "$[ac_cv_latex_class_cweb]" = yes ; then
+ dnl NOP required
+ :
+ ifelse([$2], , ,[$2])
+else
+ dnl NOP required
+ :
+ ifelse([$3], , ,[$3])
+fi
+])
diff --git a/m4/acltx_class_report.m4 b/m4/acltx_class_report.m4
new file mode 100644
index 0000000..cb26425
--- /dev/null
+++ b/m4/acltx_class_report.m4
@@ -0,0 +1,33 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_class_report.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_CLASS_REPORT([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro test if class report is installed and fail (default) with a
+# error message if not
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_CLASS_REPORT],[
+ACLTX_CLASS(report,report,[],[m4_ifval([$1],[$1],AC_MSG_ERROR([Unable to find the report class]))])
+])
diff --git a/m4/acltx_classes.m4 b/m4/acltx_classes.m4
new file mode 100644
index 0000000..9994322
--- /dev/null
+++ b/m4/acltx_classes.m4
@@ -0,0 +1,68 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_classes.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_CLASSES(CLASSESNAMES,VARIABLETOSET[,ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This class search for the first suitable package in CLASSESNAMES (comma
+# separated list) and set VARIABLETOSET to the class found or to no
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+define(_ACLTX_CLASSES_INTERNE,[
+ ifelse($#,1,[],$#,2,[
+ ACLTX_CLASS($2,$1)
+ ],[
+ ACLTX_CLASS($2,$1)
+ if test "$$1" = "yes";
+ then
+ $1=$2 ; export $1 ;
+ else
+ _ACLTX_CLASSES_INTERNE($1,m4_shift(m4_shift($@)))
+ fi;
+ ])
+])
+
+AC_DEFUN([ACLTX_CLASSES],[
+ _ACLTX_CLASSES_INTERNE($2,$1)
+ AC_SUBST($2)
+ifelse($#,2,[],$#,3,[
+ if test "[$]$2" != "no" ;
+ then
+ $3
+ fi
+],$#,4,[
+ ifelse($3,[],[
+ if test "[$]$2" = "no" ;
+ then
+ $4
+ fi
+ ],[
+ if test "[$]$2" != "no" ;
+ then
+ $3
+ else
+ $4
+ fi
+ ])
+])
+])
diff --git a/m4/acltx_compress_eps.m4 b/m4/acltx_compress_eps.m4
new file mode 100644
index 0000000..1fe9bc6
--- /dev/null
+++ b/m4/acltx_compress_eps.m4
@@ -0,0 +1,69 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_compress_eps.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_COMPRESS_EPS([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# this macro find a way to compress eps file, using Makefile target. If
+# the way is found, set compress_eps to this way else set compress_eps to
+# no
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_COMPRESS_EPS],[
+ACLTX_PROG_GZIP([AC_MSG_WARN([Unable to locate a gzip application to compress eps file])])
+compress_eps=''; export compress_eps;
+if test "$gzip" = "no" ; then
+ AC_MSG_CHECKING(for a way to compress eps)
+ AC_MSG_RESULT(no)
+else
+ AC_CHECK_PROGS(grep,grep,no)
+ AC_MSG_CHECKING(for a way to compress eps)
+ if test "$grep" = "no" ; then
+ AC_MSG_RESULT(no)
+ else
+ compress_eps="%.eps.gz %.eps.bb : %.eps ; cat \[$]*.eps | grep \"%%BoundingBox\" > \[$]*.eps.bb ; rm -f \[$]*.eps.gz ; gzip \[$]*.eps"; export compress_eps
+ AC_MSG_RESULT($compress_eps)
+ fi;
+fi;
+AC_SUBST(compress_eps)
+ifelse($#,0,[],$#,1,[
+ if test "$compress_eps" != "no" ;
+ then
+ $1
+ fi
+],$#,2,[
+ ifelse($1,[],[
+ if test "$compress_eps" = "no" ;
+ then
+ $2
+ fi
+ ],[
+ if test "$compress_eps" != "no" ;
+ then
+ $1
+ else
+ $2
+ fi
+ ])
+])
+])
diff --git a/m4/acltx_converting_fig.m4 b/m4/acltx_converting_fig.m4
new file mode 100644
index 0000000..215e4b8
--- /dev/null
+++ b/m4/acltx_converting_fig.m4
@@ -0,0 +1,93 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_converting_fig.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_CONVERTING_FIG([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# this macro find a way to convert .fig file to file that can be included
+# by latex and set convert_fig
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([_ACLTX_FIG2DEV_FCT],[
+AC_MSG_CHECKING([for $fig2dev -L $1 $2])
+$3='no';
+rm -rf conftest.dir/.acltx
+AS_MKDIR_P([conftest.dir/.acltx])
+cd conftest.dir/.acltx
+cat > conftest.fig << \ACLEOF
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter
+100.00
+Single
+-2
+1200 2
+4 0 0 50 -1 0 12 0.0000 6 135 435 150 450 TEST\001
+ACLEOF
+$fig2dev -L $1 $2 $4 conftest.fig conftest.eps 2>/dev/null 1>/dev/null && $3='yes';
+cd ..
+cd ..
+sed 's/^/| /' conftest.dir/.acltx/conftest.fig >&5
+echo "$as_me:$LINENO: executing $fig2dev -L $1 $2 $4 conftest.fig conftest.eps" >&5
+rm -rf conftest.dir/.acltx
+AC_MSG_RESULT([$]$3)
+])
+
+
+AC_DEFUN([ACLTX_CONVERTING_FIG],[
+convert_fig="no";
+ACLTX_PROG_FIG2DEV([AC_MSG_WARN([Unable to locate a fig2dev application to convert fig file])])
+if test "$fig2dev" != "no" ; then
+ _ACLTX_FIG2DEV_FCT(pstex,[],pstex)
+ _ACLTX_FIG2DEV_FCT(pstex_t,[-p],pstex_t,conftest)
+
+ AC_MSG_CHECKING(for a way to convert .fig file to .eps and _t file)
+ if test "$pstex" = "yes" -a "$pstex_t" = "yes" ; then
+ convert_fig="%.eps %_t : %.fig ; $fig2dev -L pstex \[$]< \[$]*.eps ; $fig2dev -L pstex_t -p \[$]* \[$]< \[$]*_t"
+ fi
+ AC_MSG_RESULT($convert_fig)
+fi
+AC_SUBST(convert_fig)
+ifelse($#,0,[],$#,1,[
+ if test "$convert_fig" != "no" ;
+ then
+ $1
+ fi
+],$#,2,[
+ ifelse($1,[],[
+ if test "$convert_fig" = "no" ;
+ then
+ $2
+ fi
+ ],[
+ if test "$convert_fig" != "no" ;
+ then
+ $1
+ else
+ $2
+ fi
+ ])
+])
+])
diff --git a/m4/acltx_converting_jpg_eps.m4 b/m4/acltx_converting_jpg_eps.m4
new file mode 100644
index 0000000..8511b64
--- /dev/null
+++ b/m4/acltx_converting_jpg_eps.m4
@@ -0,0 +1,61 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_converting_jpg_eps.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_CONVERTING_JPG_EPS([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro find a way to convert jpg to eps file. If the way is found,
+# set jpg_to_eps to this way else set jpg_to_eps to no.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_CONVERTING_JPG_EPS],[
+ACLTX_PROG_JPEGTOPNM([AC_MSG_WARN([Unable to locate a jpegtopnm application to convert jpg file])])
+ACLTX_PROG_PNMTOPS([AC_MSG_WARN([Unable to locate a pnmtops application to convert jpg file])])
+AC_MSG_CHECKING(for a way to convert jpg file to eps file)
+jpg_to_eps='no'; export jpg_to_eps;
+if test "$jpegtopnm" != "no" -a "$pnmtops" != "no" ; then
+ jpg_to_eps="%.eps : %.jpg ; $jpegtopnm \[$]*.jpg | pnmtops -noturn -nocenter -scale 1.00 - >\[$]*.eps"
+fi;
+AC_MSG_RESULT($jpg_to_eps)
+AC_SUBST(jpg_to_eps)
+ifelse($#,0,[],$#,1,[
+ if test "$jpg_to_eps" = "yes" ;
+ then
+ $1
+ fi
+],$#,2,[
+ ifelse($1,[],[
+ if test "$jpg_to_eps" = "no" ;
+ then
+ $2
+ fi
+ ],[
+ if test "$jpg_to_eps" = "yes" ;
+ then
+ $1
+ else
+ $2
+ fi
+ ])
+])
+])
diff --git a/m4/acltx_converting_png_eps.m4 b/m4/acltx_converting_png_eps.m4
new file mode 100644
index 0000000..eed46f1
--- /dev/null
+++ b/m4/acltx_converting_png_eps.m4
@@ -0,0 +1,61 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_converting_png_eps.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_CONVERTING_PNG_EPS([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro find a way to convert png to eps file. If the way is found,
+# set png_to_eps to this way else set png_to_eps to no.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_CONVERTING_PNG_EPS],[
+ACLTX_PROG_PNGTOPNM([AC_MSG_WARN([Unable to locate a pngtopnm application to convert png file])])
+ACLTX_PROG_PNMTOPS([AC_MSG_WARN([Unable to locate a pnmtops application to convert png file])])
+AC_MSG_CHECKING(for a way to convert png file to eps file)
+png_to_eps='no'; export png_to_eps;
+if test "$pngtopnm" != "no" -a "$pnmtops" != "no" ; then
+ png_to_eps="%.eps : %.png ; $pngtopnm \[$]*.png | pnmtops -noturn -nocenter -scale 1.00 - >\[$]*.eps"
+fi;
+AC_MSG_RESULT($png_to_eps)
+AC_SUBST(png_to_eps)
+ifelse($#,0,[],$#,1,[
+ if test "$png_to_eps" = "yes" ;
+ then
+ $1
+ fi
+],$#,2,[
+ ifelse($1,[],[
+ if test "$png_to_eps" = "no" ;
+ then
+ $2
+ fi
+ ],[
+ if test "$png_to_eps" = "yes" ;
+ then
+ $1
+ else
+ $2
+ fi
+ ])
+])
+])
diff --git a/m4/acltx_default_class.m4 b/m4/acltx_default_class.m4
new file mode 100644
index 0000000..a0d1817
--- /dev/null
+++ b/m4/acltx_default_class.m4
@@ -0,0 +1,45 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_default_class.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_DEFAULT_CLASS([OTHER-DEFAULT-CLASS])
+#
+# DESCRIPTION
+#
+# This class search for the first suitable class in book report article
+# and set defaultclass to this value If no one of this classes are found,
+# fail
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_DEFAULT_CLASS],[
+ if test "$acltx_cv_latex_class_default" = "" ; then
+ ACLTX_CLASSES([m4_ifval([$1],[$1,])book,report,article],defaultclass)
+ fi
+ AC_MSG_CHECKING([for a default class in m4_ifval([$1],[$1,])book,report,article])
+ AC_CACHE_VAL(acltx_cv_latex_class_default,[
+ acltx_cv_latex_class_default=$defaultclass;
+ ])
+ AC_MSG_RESULT($defaultclass)
+ AC_SUBST(defaultclass)
+ if test "$defaultclass" = "no" ; then
+ AC_MSG_ERROR([Unable to locate a default class])
+ fi
+])
diff --git a/m4/acltx_dvips_o_stdout.m4 b/m4/acltx_dvips_o_stdout.m4
new file mode 100644
index 0000000..431d75b
--- /dev/null
+++ b/m4/acltx_dvips_o_stdout.m4
@@ -0,0 +1,52 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_dvips_o_stdout.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_DVIPS_O_STDOUT
+#
+# DESCRIPTION
+#
+# Check if dvips accept "-o-".
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_DVIPS_O_STDOUT],[
+AC_REQUIRE([ACLTX_DEFAULT_CLASS])
+AC_REQUIRE([ACLTX_PROG_DVIPS])
+AC_CACHE_CHECK([for option -o- in dvips],ac_cv_dvips_o_stdout,[
+_ACLTX_TEST([\documentclass{$defaultclass}
+\begin{document}
+Test
+\end{document}],[],no)
+cd conftest.dir/.acltx
+ac_cv_dvips_o_stdout="no"; export ac_cv_dvips_o_stdout;
+$dvips -o- texput.dvi 1>/dev/null 2>&1 && ac_cv_dvips_o_stdout="yes"; export ac_cv_dvips_o_stdout
+cd ..
+cd ..
+echo "$as_me:$LINENO: executing $dvips -o- texput.dvi" >&5
+rm -rf conftest.dir/.acltx
+])
+DVIPS_O_STDOUT=$ac_cv_dvips_o_stdout; export DVIPS_O_STDOUT;
+if test $DVIPS_O_STDOUT = "no" ;
+then
+ AC_MSG_ERROR(Unable to find the option -o- in dvips)
+fi
+AC_SUBST(DVIPS_O_STDOUT)
+])
diff --git a/m4/acltx_dvips_t.m4 b/m4/acltx_dvips_t.m4
new file mode 100644
index 0000000..a3a5133
--- /dev/null
+++ b/m4/acltx_dvips_t.m4
@@ -0,0 +1,57 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_dvips_t.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_DVIPS_T(PAPERSIZE,VARIABLETOSET,[LANDSCAPE])
+#
+# DESCRIPTION
+#
+# Check if dvips accept the PAPERSIZE option with optional LANDSCAPE and
+# set VARIABLETOSET to yes or no.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_DVIPS_T],[
+AC_REQUIRE([ACLTX_DEFAULT_CLASS])
+AC_REQUIRE([ACLTX_PROG_DVIPS])
+if test "$3" = "on" ;
+then
+_ac_latex_dvips_local=" -t landscape" ; export _ac_latex_dvips_local ;
+else
+_ac_latex_dvips_local=" " ; export _ac_latex_dvips_local ;
+fi
+AC_CACHE_CHECK([for option $dvips -t $1 $_ac_latex_dvips_local],[ac_cv_dvips_t_]translit($1,[-],[_])[_]translit($3,[-],[_]),[
+_ACLTX_TEST([\documentclass{$defaultclass}
+\begin{document}
+Test
+\end{document}],[],no)
+cd conftest.dir/.acltx
+[ac_cv_dvips_t_]translit($1,[-],[_])[_]translit($3,[-],[_])="no"; export [ac_cv_dvips_t_]translit($1,[-],[_])[_]translit($3,[-],[_]);
+$dvips -o conftest.ps texput.dvi -t $1 $_ac_latex_dvips_local 2>error 1>/dev/null
+cat error | grep "dvips: no match for papersize" 1>/dev/null 2>&1 || [ac_cv_dvips_t_]translit($1,[-],[_])[_]translit($3,[-],[_])="yes"; export [ac_cv_dvips_t_]translit($1,[-],[_])[_]translit($3,[-],[_])
+cd ..
+cd ..
+echo "$as_me:$LINENO: executing $dvips -o conftest.ps texput.dvi -t $1 $_ac_latex_dvips_local" >&5
+sed 's/^/| /' conftest.dir/.acltx/error >&5
+rm -rf conftest.dir/.acltx
+])
+$2=$[ac_cv_dvips_t_]translit($1,[-],[_])[_]translit($3,[-],[_]); export $2;
+AC_SUBST($2)
+])
diff --git a/m4/acltx_dvips_t_a4.m4 b/m4/acltx_dvips_t_a4.m4
new file mode 100644
index 0000000..2c4f909
--- /dev/null
+++ b/m4/acltx_dvips_t_a4.m4
@@ -0,0 +1,36 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_dvips_t_a4.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_DVIPS_T_A4
+#
+# DESCRIPTION
+#
+# Check if dvips accepts "-t a4".
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_DVIPS_T_A4],[
+ACLTX_DVIPS_T(a4,dvips_t_a4)
+if test $dvips_t_a4 = "no";
+then
+ AC_MSG_ERROR([Unable to find the -t a4 option in dvips])
+fi
+])
diff --git a/m4/acltx_dvips_t_a4_landscape.m4 b/m4/acltx_dvips_t_a4_landscape.m4
new file mode 100644
index 0000000..9fd7925
--- /dev/null
+++ b/m4/acltx_dvips_t_a4_landscape.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_dvips_t_a4_landscape.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_DVIPS_T_A4_LANDSCAPE
+#
+# DESCRIPTION
+#
+# Check whether dvips accepts "-t a4 -t landscape".
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_DVIPS_T_A4_LANDSCAPE],[
+AC_REQUIRE([ACLTX_DVIPS_T_A4])
+ACLTX_DVIPS_T(a4,dvips_t_a4_landscape,on)
+if test $dvips_t_a4_landscape = "no";
+then
+ AC_MSG_ERROR([Unable to find the -t a4 -t landscape option in dvips])
+fi
+])
diff --git a/m4/acltx_dvips_t_letter.m4 b/m4/acltx_dvips_t_letter.m4
new file mode 100644
index 0000000..eb361e4
--- /dev/null
+++ b/m4/acltx_dvips_t_letter.m4
@@ -0,0 +1,36 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_dvips_t_letter.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_DVIPS_T_LETTER
+#
+# DESCRIPTION
+#
+# Check if dvips accept "-t letter".
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([AC_LATEX_DVIPS_T_LETTER],[
+ACLTX_DVIPS_T(letter,dvips_t_letter)
+if test $dvips_t_letter = "no";
+then
+ AC_MSG_ERROR([Unable to find the -t letter option in dvips])
+fi
+])
diff --git a/m4/acltx_dvips_t_letter_landscape.m4 b/m4/acltx_dvips_t_letter_landscape.m4
new file mode 100644
index 0000000..aefd5dc
--- /dev/null
+++ b/m4/acltx_dvips_t_letter_landscape.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_dvips_t_letter_landscape.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_DVIPS_T_LETTER_LANDSCAPE
+#
+# DESCRIPTION
+#
+# Check if dvips accepts "-t letter -t landscape".
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_DVIPS_T_LETTER_LANDSCAPE],[
+AC_REQUIRE([ACLTX_DVIPS_T_LETTER])
+ACLTX_DVIPS_T(letter,dvips_t_letter_landscape,on)
+if test $dvips_t_letter_landscape = "no";
+then
+ AC_MSG_ERROR([Unable to find the -t letter -t landscape option in dvips])
+fi
+])
diff --git a/m4/acltx_package.m4 b/m4/acltx_package.m4
new file mode 100644
index 0000000..483f891
--- /dev/null
+++ b/m4/acltx_package.m4
@@ -0,0 +1,79 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_package.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PACKAGE(PACKAGENAME,CLASSNAME,VARIABLETOSET[,ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro try to compile a latex document using class CLASSNAME and
+# including package PACKAGENAME and set VARIABLETOSET to yes or no If
+# ACTION-IF-FOUND (and ACTION-IF-NOT-FOUND) are set to the right action
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PACKAGE],[
+ACLTX_PACKAGE_LOCATION($1.sty,$3_location)
+if test "[$]$3_location" = "no" ; then
+ AC_MSG_WARN([Unable to locate the $1.sty file])
+ [ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_])="no";
+else
+if test "$[ac_cv_latex_class_]translit($2,[-],[_])" = "" ;
+then
+ ACLTX_CLASS($2,boretti_classesansparametre)
+ export boretti_classesansparametre;
+else
+ boretti_classesansparametre=$[ac_cv_latex_class_]translit($2,[-],[_]) ;
+ export boretti_classesansparemetre;
+fi;
+if test $boretti_classesansparametre = "no" ;
+then
+ AC_MSG_ERROR([Unable to find $2 class])
+fi
+AC_CACHE_CHECK([for usability of package $1 in class $2],[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_]),[
+_ACLTX_TEST([\documentclass{$2}
+\usepackage{$1}
+\begin{document}
+\end{document}],[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_]))
+])
+fi
+$3=$[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_]); export $3;
+AC_SUBST($3)
+ifelse($#,3,[],$#,4,[
+ if test "[$]$3" = "yes" ;
+ then
+ $4
+ fi
+],$#,5,[
+ ifelse($4,[],[
+ if test "[$]$3" = "no" ;
+ then
+ $5
+ fi
+ ],[
+ if test "[$]$3" = "yes" ;
+ then
+ $4
+ else
+ $5
+ fi
+ ])
+])
+])
diff --git a/m4/acltx_package_amsmath.m4 b/m4/acltx_package_amsmath.m4
new file mode 100644
index 0000000..fd8a845
--- /dev/null
+++ b/m4/acltx_package_amsmath.m4
@@ -0,0 +1,58 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_package_amsmath.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PACKAGE_AMSMATH
+#
+# DESCRIPTION
+#
+# This macro check for a way to include amsmath and set amsmath to this
+# way
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PACKAGE_AMSMATH],[
+AC_REQUIRE([ACLTX_DEFAULT_CLASS])
+AC_CACHE_CHECK([for amsmath],[ac_cv_latex_package_f_amsmath],[
+_ACLTX_TEST([\documentclass{$defaultclass}
+\usepackage{amsmath,amsfonts}
+\begin{document}
+\end{document}],[ac_cv_latex_package_f_amsmath])
+if test $ac_cv_latex_package_f_amsmath = "yes" ;
+then
+ [ac_cv_latex_package_f_amsmath]="\\usepackage{amsmath,amsfonts}" ; export [ac_cv_latex_package_f_amsmath] ;
+else
+ _ACLTX_TEST([
+ \documentclass{$defaultclass}
+ \usepackage{amstex}
+ \begin{document}
+ \end{document}
+ ],[ac_cv_latex_package_f_amsmath])
+ if test $ac_cv_latex_package_f_amsmath = "yes" ;
+ then
+ [ac_cv_latex_package_f_amsmath]="\\usepackage{amstex}" ; export [ac_cv_latex_package_f_amsmath] ;
+ else
+ AC_MSG_ERROR([Unable to find amsmath])
+ fi
+fi
+])
+amsmath=$[ac_cv_latex_package_f_amsmath]; export amsmath;
+AC_SUBST(amsmath)
+])
diff --git a/m4/acltx_package_babel.m4 b/m4/acltx_package_babel.m4
new file mode 100644
index 0000000..9186947
--- /dev/null
+++ b/m4/acltx_package_babel.m4
@@ -0,0 +1,62 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_package_babel.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PACKAGE_BABEL([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# Check if the package babel exists and set babel to yes or no
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PACKAGE_BABEL],[
+AC_REQUIRE([ACLTX_DEFAULT_CLASS])
+AC_CACHE_CHECK([for babel with class $defaultclass],[ac_cv_latex_package_f_babel],[
+_ACLTX_TEST([changequote(*, !)dnl
+\documentclass{$defaultclass}
+\usepackage[english]{babel}
+\begin{document}
+\end{document}dnl
+changequote([, ])],[ac_cv_latex_package_f_babel])
+])
+babel=$[ac_cv_latex_package_f_babel]; export babel;
+AC_SUBST(babel)
+ifelse($#,0,[],$#,1,[
+ if test "$babel" != "no" ;
+ then
+ $1
+ fi
+],$#,2,[
+ ifelse($1,[],[
+ if test "babel" = "no" ;
+ then
+ $2
+ fi
+ ],[
+ if test "babel" != "no" ;
+ then
+ $1
+ else
+ $2
+ fi
+ ])
+])
+])
diff --git a/m4/acltx_package_babel_language.m4 b/m4/acltx_package_babel_language.m4
new file mode 100644
index 0000000..460e9a0
--- /dev/null
+++ b/m4/acltx_package_babel_language.m4
@@ -0,0 +1,63 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_package_babel_language.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PACKAGE_BABEL_LANGUAGE(LANGUAGES,VARIABLETOSET[ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# Check if the package babel exists and support language and set
+# VARIABLETOSET to yes or no
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PACKAGE_BABEL_LANGUAGE],[
+ACLTX_PACKAGE_BABEL([],[AC_MSG_WARN([Unable to locate babel with $defaultclass])])
+AC_CACHE_CHECK([for babel with class $defaultclass and language $1],[ac_cv_latex_babel_langugage_]translit([$1],[-,{}()= ],[________]),[
+_ACLTX_TEST([changequote(*, !)dnl
+\documentclass{$defaultclass}
+\usepackage[$1]{babel}
+\begin{document}
+\end{document}dnl
+changequote([, ])],[ac_cv_latex_babel_langugage_]translit([$1],[-,{}()= ],[________]))
+])
+$2=$[ac_cv_latex_babel_langugage_]translit([$1],[-,{}()= ],[________]); export $2;
+AC_SUBST($2)
+ifelse($#,2,[],$#,3,[
+ if test "[$]$2" != "no" ;
+ then
+ $3
+ fi
+],$#,4,[
+ ifelse($3,[],[
+ if test "[$]$2" = "no" ;
+ then
+ $4
+ fi
+ ],[
+ if test "[$]$2" != "no" ;
+ then
+ $3
+ else
+ $4
+ fi
+ ])
+])
+])
diff --git a/m4/acltx_package_fontenc.m4 b/m4/acltx_package_fontenc.m4
new file mode 100644
index 0000000..462b203
--- /dev/null
+++ b/m4/acltx_package_fontenc.m4
@@ -0,0 +1,61 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_package_fontenc.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PACKAGE_FONTENC([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# Check if the package fontenc exists and try to use T1 or OT1 and set
+# fontenc to T1, OT1 or no
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+define(_ACLTX_PACKAGE_FONTENC_INTERNE,[changequote(*, !)dnl
+\documentclass{$defaultclass}
+\usepackage[$1]{fontenc}
+\begin{document}
+\end{document}dnl
+changequote([, ])])
+
+AC_DEFUN([ACLTX_PACKAGE_FONTENC],[
+ AC_REQUIRE([ACLTX_DEFAULT_CLASS])
+ ACLTX_PACKAGE_LOCATION(fontenc.sty,fontenc_location)
+ AC_CACHE_CHECK([for fontenc],[ac_cv_latex_package_fontenc_opt],[
+ _ACLTX_TEST([_ACLTX_PACKAGE_FONTENC_INTERNE(T1)],[ac_cv_latex_package_fontenc_opt])
+ if test $ac_cv_latex_package_fontenc_opt = "yes" ;
+ then
+ ac_cv_latex_package_fontenc_opt="T1"; export ac_cv_latex_package_fontenc_opt;
+ else
+ _ACLTX_TEST([_ACLTX_PACKAGE_FONTENC_INTERNE(OT1)],[ac_cv_latex_package_fontenc_opt])
+ if test $ac_cv_latex_package_fontenc_opt = "yes" ;
+ then
+ ac_cv_latex_package_fontenc_opt="OT1"; export ac_cv_latex_package_fontenc_opt;
+ fi
+ fi
+
+ ])
+ if test $ac_cv_latex_package_fontenc_opt = "no" ;
+ then
+ m4_ifval([$1],$1,[AC_MSG_ERROR([Unable to use fontenc with T1 nor OT1])])
+ fi
+ fontenc=$ac_cv_latex_package_fontenc_opt ; export fontenc ;
+ AC_SUBST(fontenc)
+])
diff --git a/m4/acltx_package_input.m4 b/m4/acltx_package_input.m4
new file mode 100644
index 0000000..2ccb000
--- /dev/null
+++ b/m4/acltx_package_input.m4
@@ -0,0 +1,60 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_package_input.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PACKAGE_INPUT(PACKAGENAME,CLASSNAME,VARIABLETOSET)
+#
+# DESCRIPTION
+#
+# This macro test if package in <class> exists and set <variable> to the
+# right value (yes or no). Use \input instance of \usepackage.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PACKAGE_INPUT],[
+ACLTX_PACKAGE_LOCATION($1,$3_location)
+if test "[$]$3_location" = "no" ; then
+ AC_MSG_WARN([Unable to locate the $1.sty file])
+ [ac_cv_latex_i_]translit($1,[-.],[__])[_]translit($2,[-],[_])="no";
+else
+if test "$[ac_cv_latex_class_]translit($2,[-],[_])" = "" ;
+then
+ ACLTX_CLASS($2,boretti_classesansparametre)
+ export boretti_classesansparametre;
+else
+ boretti_classesansparametre=$[ac_cv_latex_class_]translit($2,[-],[_]) ;
+ export boretti_classesansparemetre;
+fi;
+if test $boretti_classesansparametre = "no" ;
+then
+ AC_MSG_ERROR([Unable to find $2 class])
+fi
+AC_CACHE_CHECK([for usability of package $1 in class $2, using \\input instance of \\usepackage],[ac_cv_latex_i_]translit($1,[-.],[__])[_]translit($2,[-],[_]),[
+_ACLTX_TEST([
+\documentclass{$2}
+\input $1
+\begin{document}
+\end{document}
+],[ac_cv_latex_i_]translit($1,[-.],[__])[_]translit($2,[-],[_]))
+])
+fi
+$3=$[ac_cv_latex_i_]translit($1,[-.],[__])[_]translit($2,[-],[_]); export $3;
+AC_SUBST($3)
+])
diff --git a/m4/acltx_package_listings.m4 b/m4/acltx_package_listings.m4
new file mode 100644
index 0000000..3bb62cf
--- /dev/null
+++ b/m4/acltx_package_listings.m4
@@ -0,0 +1,43 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_package_listings.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PACKAGE_LISTINGS
+#
+# DESCRIPTION
+#
+# Check if the package listings exists and set listings to yes or no
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PACKAGE_LISTINGS],[
+ AC_REQUIRE([ACLTX_DEFAULT_CLASS])
+AC_CACHE_CHECK([for listings with class $defaultclass],[ac_cv_latex_package_f_listings],[
+_ACLTX_TEST([changequote(*, !)dnl
+\documentclass{$defaultclass}
+\usepackage{listings}
+\begin{document}
+\end{document}dnl
+changequote([, ])],[ac_cv_latex_package_f_listings])
+])
+listings=$[ac_cv_latex_package_f_listings]; export listings;
+AC_SUBST(listings)
+
+])
diff --git a/m4/acltx_package_listings_language.m4 b/m4/acltx_package_listings_language.m4
new file mode 100644
index 0000000..56946ce
--- /dev/null
+++ b/m4/acltx_package_listings_language.m4
@@ -0,0 +1,50 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_package_listings_language.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PACKAGE_LISTINGS_LANGUAGE(LANGUAGE,VARIABLETOSET)
+#
+# DESCRIPTION
+#
+# Test if the package listings accept the language LANGUAGE and set
+# VARIABLETOSET to yes or no
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+define(_ACLTX_PACKAGE_LANGUAGE_INTERNE,[
+changequote(*, !)dnl
+\documentclass{$defaultclass}
+\usepackage{listings}
+\lstset{language={$1}}
+\begin{document}
+\end{document}
+changequote([, ])dnl
+])
+
+AC_DEFUN([ACLTX_PACKAGE_LISTINGS_LANGUAGE],[
+AC_REQUIRE([ACLTX_PACKAGE_LISTINGS])
+AC_CACHE_CHECK([for $1 language in package listings with class book],[ac_cv_latex_listings_langugae_]translit($1,[-],[_]),[
+_ACLTX_TEST([
+_ACLTX_PACKAGE_LANGUAGE_INTERNE($1)
+],[ac_cv_latex_listings_langugae_]translit($1,[-],[_]))
+])
+$2=$[ac_cv_latex_listings_langugae_]translit($1,[-],[_]); export $2;
+AC_SUBST($2)
+])
diff --git a/m4/acltx_package_location.m4 b/m4/acltx_package_location.m4
new file mode 100644
index 0000000..736121f
--- /dev/null
+++ b/m4/acltx_package_location.m4
@@ -0,0 +1,43 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_package_location.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PACKAGE_LOCATION(FILENAME,VARIABLETOSET)
+#
+# DESCRIPTION
+#
+# Find the file FILENAME in the acces path of texmf and set VARIABLETOSET
+# to the location or no if not found
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PACKAGE_LOCATION],[
+AC_REQUIRE([ACLTX_PROG_KPSEWHICH])
+AC_CACHE_CHECK([for location of $1],[ac_cv_latex_location_]translit($1,[-.],[__]),[
+[ac_cv_latex_location_]translit($1,[-.],[__])=`$kpsewhich $1`; export [ac_cv_latex_location_]translit($1,[-.],[__]);
+if test "[ac_cv_latex_location_]translit($1,[-.],[__])" = "";
+then
+ [ac_cv_latex_location_]translit($1,[-.],[__])="no"; export [ac_cv_latex_location_]translit($1,[-.],[__]);
+fi
+echo "$as_me:$LINENO: executing $kpsewhich $1" >&5
+])
+$2=$[ac_cv_latex_location_]translit($1,[-.],[__]); export $2;
+AC_SUBST($2)
+])
diff --git a/m4/acltx_package_opt.m4 b/m4/acltx_package_opt.m4
new file mode 100644
index 0000000..801d3c5
--- /dev/null
+++ b/m4/acltx_package_opt.m4
@@ -0,0 +1,87 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_package_opt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PACKAGE_OPT(PACKAGENAME,CLASSNAME,VARIABLETOSET,PARAMETER[,ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This package do the same thing as ACLTX_PACKAGE, except, that PARAMETER
+# is optional parameter for the package
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+define(_ACLTX_PACKAGE_OPT_INTERNE,[
+changequote(*, !)dnl
+\documentclass{$2}
+\usepackage[$3]{$1}
+\begin{document}
+\end{document}
+changequote([, ])dnl
+
+])
+
+AC_DEFUN([ACLTX_PACKAGE_OPT],[
+ACLTX_PACKAGE_LOCATION($1.sty,$3_location)
+if test "[$]$3_location" = "no" ; then
+ AC_MSG_WARN([Unable to locate the $1.sty file])
+ [ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_])[_]translit([$4],[-,{}()= ],[________])="no";
+else
+if test "$[ac_cv_latex_class_]translit($2,[-],[_])" = "" ;
+then
+ ACLTX_CLASS($2,boretti_classesansparametre)
+ export boretti_classesansparametre;
+else
+ boretti_classesansparametre=$[ac_cv_latex_class_]translit($2,[-],[_]) ;
+ export boretti_classesansparemetre;
+fi;
+if test $boretti_classesansparametre = "no" ;
+then
+ AC_MSG_ERROR([Unable to find $1 class])
+fi
+AC_CACHE_CHECK([for usability of package $1 in class $2 with $4 as option],[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_])[_]translit([$4],[-,{}()= ],[________]),[
+_ACLTX_TEST([
+_ACLTX_PACKAGE_OPT_INTERNE($1,$2,[$4])
+],[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_])[_]translit([$4],[-,{}()= ],[________]))
+])
+fi
+$3=$[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_])[_]translit([$4],[-,{}()= ],[________]); export $3;
+AC_SUBST($3)
+ifelse($#,4,[],$#,5,[
+ if test "[$]$3" = "yes" ;
+ then
+ $5
+ fi
+],$#,6,[
+ ifelse($5,[],[
+ if test "[$]$3" = "no" ;
+ then
+ $6
+ fi
+ ],[
+ if test "[$]$3" = "yes" ;
+ then
+ $5
+ else
+ $6
+ fi
+ ])
+])
+])
diff --git a/m4/acltx_packages.m4 b/m4/acltx_packages.m4
new file mode 100644
index 0000000..b66729c
--- /dev/null
+++ b/m4/acltx_packages.m4
@@ -0,0 +1,69 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_packages.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PACKAGES(PACKAGESNAMES,CLASSNAME,VARIABLETOSET[,ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This package search for the first suitable package in PACKAGESNAMES
+# (comma separated list) with class CLASSNAME and set VARIABLETOSET the
+# package found or to no
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+define(_ACLTX_PACKAGE_INTERNE,[
+ ifelse($#,0,[],$#,1,[],$#,2,[],$#,3,[
+ ACLTX_PACKAGE($3,$2,$1)
+ ],[
+ ACLTX_PACKAGE($3,$2,$1)
+ if test "$$1" = "yes";
+ then
+ $1=$3 ; export $1 ;
+ else
+ _ACLTX_PACKAGE_INTERNE($1,$2,m4_shift(m4_shift(m4_shift($@))))
+ fi;
+ ])
+])
+
+AC_DEFUN([ACLTX_PACKAGES],[
+ _ACLTX_PACKAGE_INTERNE($3,$2,$1)
+ AC_SUBST($3)
+ifelse($#,3,[],$#,4,[
+ if test "[$]$3" != "no" ;
+ then
+ $4
+ fi
+],$#,5,[
+ ifelse($4,[],[
+ if test "[$]$3" = "no" ;
+ then
+ $5
+ fi
+ ],[
+ if test "[$]$3" != "no" ;
+ then
+ $4
+ else
+ $5
+ fi
+ ])
+])
+])
diff --git a/m4/acltx_prog_bibtex.m4 b/m4/acltx_prog_bibtex.m4
new file mode 100644
index 0000000..d0a516e
--- /dev/null
+++ b/m4/acltx_prog_bibtex.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_bibtex.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_BIBTEX([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a bibtex application and set the variable bibtex to the
+# name of the application or to no if not found if ACTION-IF-NOT-FOUND is
+# not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_BIBTEX],[
+AC_CHECK_PROGS(bibtex,bibtex,no)
+if test $bibtex = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the bibtex application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_dvibook.m4 b/m4/acltx_prog_dvibook.m4
new file mode 100644
index 0000000..3fb828a
--- /dev/null
+++ b/m4/acltx_prog_dvibook.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_dvibook.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_DVIBOOK([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a dvibook application and set the variable dvibook to
+# the name of the application or to no if not found if ACTION-IF-NOT-FOUND
+# is not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_DVIBOOK],[
+AC_CHECK_PROGS(dvibook,dvibook,no)
+if test $dvibook = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the dvibook application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_dvipdf.m4 b/m4/acltx_prog_dvipdf.m4
new file mode 100644
index 0000000..d8e21c3
--- /dev/null
+++ b/m4/acltx_prog_dvipdf.m4
@@ -0,0 +1,48 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_dvipdf.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_DVIPDF([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a dvipdf application and set the variable dvipdf to the
+# name of the application or to no if not found if ACTION-IF-NOT-FOUND is
+# not specified, configure fail when then application is not found.
+#
+# It is possible to set manually the program to use using dvipdf=...
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_DVIPDF],[
+AC_ARG_VAR(dvipdf,[specify default dvipdf application])
+if test "$ac_cv_env_dvipdf_set" = "set" ; then
+ AC_MSG_CHECKING([Checking for dvipdf])
+ dvipdf="$ac_cv_env_dvipdf_value";
+ AC_MSG_RESULT([$dvipdf (from parameter)])
+else
+
+AC_CHECK_PROGS(dvipdf,[dvipdf dvipdfm dvipdft],no)
+if test $dvipdf = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the dvipdf application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_dvips.m4 b/m4/acltx_prog_dvips.m4
new file mode 100644
index 0000000..169221a
--- /dev/null
+++ b/m4/acltx_prog_dvips.m4
@@ -0,0 +1,48 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_dvips.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_DVIPS([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a dvips application and set the variable dvips to the
+# name of the application or to no if not found if ACTION-IF-NOT-FOUND is
+# not specified, configure fail when then application is not found.
+#
+# It is possible to set manually the program to use using dvips=...
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_DVIPS],[
+AC_ARG_VAR(dvips,[specify default dvips application])
+if test "$ac_cv_env_dvips_set" = "set" ; then
+ AC_MSG_CHECKING([Checking for dvips])
+ dvips="$ac_cv_env_dvips_value";
+ AC_MSG_RESULT([$dvips (from parameter)])
+else
+ AC_CHECK_PROGS(dvips,dvips,no)
+fi
+if test $dvips = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the dvips application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_fig2dev.m4 b/m4/acltx_prog_fig2dev.m4
new file mode 100644
index 0000000..5bd0f29
--- /dev/null
+++ b/m4/acltx_prog_fig2dev.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_fig2dev.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_FIG2DEV([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a fig2dev application and set the variable fig2dev to
+# the name of the application or to no if not found if ACTION-IF-NOT-FOUND
+# is not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_FIG2DEV],[
+AC_CHECK_PROGS(fig2dev,[fig2dev],no)
+if test $fig2dev = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the fig2dev application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_gnuplot.m4 b/m4/acltx_prog_gnuplot.m4
new file mode 100644
index 0000000..7032557
--- /dev/null
+++ b/m4/acltx_prog_gnuplot.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_gnuplot.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_GNUPLOT([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a gnuplot application and set the variable gnuplot to
+# the name of the application or to no if not found if ACTION-IF-NOT-FOUND
+# is not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_GNUPLOT],[
+AC_CHECK_PROGS(gnuplot,[gnuplot],no)
+if test $gnuplot = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the gnuplot application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_gunzip.m4 b/m4/acltx_prog_gunzip.m4
new file mode 100644
index 0000000..57e7b29
--- /dev/null
+++ b/m4/acltx_prog_gunzip.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_gunzip.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_GUNZIP([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a gunzip application and set the variable gunzip to the
+# name of the application or to no if not found if ACTION-IF-NOT-FOUND is
+# not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_GUNZIP],[
+AC_CHECK_PROGS(gunzip,[gunzip],no)
+if test $gunzip = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the gunzip application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_gzip.m4 b/m4/acltx_prog_gzip.m4
new file mode 100644
index 0000000..e9917c2
--- /dev/null
+++ b/m4/acltx_prog_gzip.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_gzip.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_GZIP([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a gzip application and set the variable gzip to the name
+# of the application or to no if not found if ACTION-IF-NOT-FOUND is not
+# specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_GZIP],[
+AC_CHECK_PROGS(gzip,[gzip],no)
+if test $gzip = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the gzip application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_jpeg2ps.m4 b/m4/acltx_prog_jpeg2ps.m4
new file mode 100644
index 0000000..249fa81
--- /dev/null
+++ b/m4/acltx_prog_jpeg2ps.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_jpeg2ps.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_JPEG2PS([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a jpeg2ps application and set the variable jpeg2ps to
+# the name of the application or to no if not found if ACTION-IF-NOT-FOUND
+# is not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_JPEG2PS],[
+AC_CHECK_PROGS(jpeg2ps,[jpeg2ps],no)
+if test $jpeg2ps = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the jpeg2ps application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_jpegtopnm.m4 b/m4/acltx_prog_jpegtopnm.m4
new file mode 100644
index 0000000..6b43358
--- /dev/null
+++ b/m4/acltx_prog_jpegtopnm.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_jpegtopnm.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_JPGEDTOPNM([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a jpegtopnm application and set the variable jpegtopnm
+# to the name of the application or to no if not found if
+# ACTION-IF-NOT-FOUND is not specified, configure fail when then
+# application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_JPEGTOPNM],[
+AC_CHECK_PROGS(jpegtopnm,[jpegtopnm],no)
+if test $jpegtopnm = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the jpegtopnm application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_kpsewhich.m4 b/m4/acltx_prog_kpsewhich.m4
new file mode 100644
index 0000000..59f21ef
--- /dev/null
+++ b/m4/acltx_prog_kpsewhich.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_kpsewhich.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_KPSEWHICH([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a kpsewhich application and set the variable kpsewhich
+# to the name of the application or to no if not found if
+# ACTION-IF-NOT-FOUND is not specified, configure fail when then
+# application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_KPSEWHICH],[
+AC_CHECK_PROGS(kpsewhich,[kpsewhich],no)
+if test $kpsewhich = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the kpsewhich application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_latex.m4 b/m4/acltx_prog_latex.m4
new file mode 100644
index 0000000..0ada13c
--- /dev/null
+++ b/m4/acltx_prog_latex.m4
@@ -0,0 +1,47 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_latex.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_LATEX([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a latex application and set the variable latex to the
+# name of the application or to no if not found if ACTION-IF-NOT-FOUND is
+# not specified, configure fail when then application is not found.
+#
+# It is possible to set manually the program to use using latex=...
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_LATEX],[
+AC_ARG_VAR(latex,[specify default latex application])
+if test "$ac_cv_env_latex_set" = "set" ; then
+ AC_MSG_CHECKING([Checking for latex])
+ latex="$ac_cv_env_latex_value";
+ AC_MSG_RESULT([$latex (from parameter)])
+else
+ AC_CHECK_PROGS(latex,[latex elatex lambda],no)
+fi
+if test $latex = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the latex application])],
+ $1)
+fi])
diff --git a/m4/acltx_prog_latex2html.m4 b/m4/acltx_prog_latex2html.m4
new file mode 100644
index 0000000..c229023
--- /dev/null
+++ b/m4/acltx_prog_latex2html.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_latex2html.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_LATEX2HTML([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a latex2html application and set the variable latex2html
+# to the name of the application or to no if not found if
+# ACTION-IF-NOT-FOUND is not specified, configure fail when then
+# application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_LATEX2HTML],[
+AC_CHECK_PROGS(latex2html,[latex2html],no)
+if test $latex2html = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the latex2html application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_latex2man.m4 b/m4/acltx_prog_latex2man.m4
new file mode 100644
index 0000000..24a67ac
--- /dev/null
+++ b/m4/acltx_prog_latex2man.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_latex2man.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_LATEX2MAN([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a latex2man application and set the variable latex2man
+# to the name of the application or to no if not found if
+# ACTION-IF-NOT-FOUND is not specified, configure fail when then
+# application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_LATEX2MAN],[
+AC_CHECK_PROGS(latex2man,[latex2man],no)
+if test $latex2man = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the latex2man application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_latex2png.m4 b/m4/acltx_prog_latex2png.m4
new file mode 100644
index 0000000..e8ee057
--- /dev/null
+++ b/m4/acltx_prog_latex2png.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_latex2png.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_LATEX2PNG([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a latex2png application and set the variable latex2png
+# to the name of the application or to no if not found if
+# ACTION-IF-NOT-FOUND is not specified, configure fail when then
+# application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_LATEX2PNG],[
+AC_CHECK_PROGS(latex2png,[latex2png],no)
+if test $latex2png = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the latex2png application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_latex2rtf.m4 b/m4/acltx_prog_latex2rtf.m4
new file mode 100644
index 0000000..b7ea315
--- /dev/null
+++ b/m4/acltx_prog_latex2rtf.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_latex2rtf.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_LATEX2RTF([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a latex2rtf application and set the variable latex2rtf
+# to the name of the application or to no if not found if
+# ACTION-IF-NOT-FOUND is not specified, configure fail when then
+# application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_LATEX2RTF],[
+AC_CHECK_PROGS(latex2rtf,[latex2rtf],no)
+if test $latex2rtf = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the latex2rtf application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_makeindex.m4 b/m4/acltx_prog_makeindex.m4
new file mode 100644
index 0000000..5195a4b
--- /dev/null
+++ b/m4/acltx_prog_makeindex.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_makeindex.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_MAKEINDEX([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a makeindex application and set the variable makeindex
+# to the name of the application or to no if not found if
+# ACTION-IF-NOT-FOUND is not specified, configure fail when then
+# application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_MAKEINDEX],[
+AC_CHECK_PROGS(makeindex,makeindex,no)
+if test $makeindex = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the makeindex application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_mf.m4 b/m4/acltx_prog_mf.m4
new file mode 100644
index 0000000..6f8185e
--- /dev/null
+++ b/m4/acltx_prog_mf.m4
@@ -0,0 +1,48 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_mf.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_MF([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a mf application and set the variable mf to the name of
+# the application or to no if not found if ACTION-IF-NOT-FOUND is not
+# specified, configure fail when then application is not found.
+#
+# It is possible to set manually the program to use using mf=...
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_MF],[
+AC_ARG_VAR(mf,[specify default mf application])
+if test "$ac_cv_env_mf_set" = "set" ; then
+ AC_MSG_CHECKING([Checking for mf])
+ mf="$ac_cv_env_mf_value";
+ AC_MSG_RESULT([$mf (from parameter)])
+else
+ AC_CHECK_PROGS(mf,[mf mfw mf-nowin],no)
+fi
+if test $mf = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the mf application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_mktexpk.m4 b/m4/acltx_prog_mktexpk.m4
new file mode 100644
index 0000000..f3d1062
--- /dev/null
+++ b/m4/acltx_prog_mktexpk.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_mktexpk.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_MKTEXPK
+#
+# DESCRIPTION
+#
+# This macro find a mktexpk application and set the variable mktexpk to
+# the name of the application or to no if not found if ACTION-IF-NOT-FOUND
+# is not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_MKTEXPK],[
+AC_CHECK_PROGS(mktexpk,mktexpk,no)
+if test $mktexpk = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the mktexpk application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_pdflatex.m4 b/m4/acltx_prog_pdflatex.m4
new file mode 100644
index 0000000..7b1784e
--- /dev/null
+++ b/m4/acltx_prog_pdflatex.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_pdflatex.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_PROG_PDFLATEX
+#
+# DESCRIPTION
+#
+# This macro find a pdflatex application and set the variable pdflatex to
+# the name of the application or to no if not found if ACTION-IF-NOT-FOUND
+# is not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_PDFLATEX],[
+AC_CHECK_PROGS(pdflatex,[pdflatex],no)
+if test $pdflatex = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the pdflatex application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_pngtopnm.m4 b/m4/acltx_prog_pngtopnm.m4
new file mode 100644
index 0000000..c22cb5b
--- /dev/null
+++ b/m4/acltx_prog_pngtopnm.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_pngtopnm.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_PNGTOPNM([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a pngtopnm application and set the variable pngtopnm to
+# the name of the application or to no if not found if ACTION-IF-NOT-FOUND
+# is not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_PNGTOPNM],[
+AC_CHECK_PROGS(pngtopnm,[pngtopnm],no)
+if test $pngtopnm = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the pngtopnm application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_pnmtops.m4 b/m4/acltx_prog_pnmtops.m4
new file mode 100644
index 0000000..67a0a22
--- /dev/null
+++ b/m4/acltx_prog_pnmtops.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_pnmtops.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_PNMTOPS([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a pnmtops application and set the variable pnmtops to
+# the name of the application or to no if not found if ACTION-IF-NOT-FOUND
+# is not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_PNMTOPS],[
+AC_CHECK_PROGS(pnmtops,[pnmtops],no)
+if test $pnmtops = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the pnmtops application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_ps2pdf.m4 b/m4/acltx_prog_ps2pdf.m4
new file mode 100644
index 0000000..739983d
--- /dev/null
+++ b/m4/acltx_prog_ps2pdf.m4
@@ -0,0 +1,48 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_ps2pdf.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_PS2PDF([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a ps2pdf application and set the variable ps2pdf to the
+# name of the application or to no if not found if ACTION-IF-NOT-FOUND is
+# not specified, configure fail when then application is not found.
+#
+# It is possible to set manually the program to use using ps2pdf=...
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_PS2PDF],[
+AC_ARG_VAR(ps2pdf,[specify default ps2pdf application])
+if test "$ac_cv_env_ps2pdf_set" = "set" ; then
+ AC_MSG_CHECKING([Checking for ps2pdf])
+ ps2pdf="$ac_cv_env_ps2pdf_value";
+ AC_MSG_RESULT([$ps2pdf (from parameter)])
+else
+ AC_CHECK_PROGS(ps2pdf,[ps2pdf14 ps2pdf13 ps2pdf12 ps2pdf pstopdf],no)
+fi
+if test $ps2pdf = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the ps2pdf application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_psbook.m4 b/m4/acltx_prog_psbook.m4
new file mode 100644
index 0000000..6e2891a
--- /dev/null
+++ b/m4/acltx_prog_psbook.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_psbook.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_PSBOOK([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a psbook application and set the variable psbook to the
+# name of the application or to no if not found if ACTION-IF-NOT-FOUND is
+# not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_PSBOOK],[
+AC_CHECK_PROGS(psbook,[psbook],no)
+if test $psbook = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the psbook application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_psnup.m4 b/m4/acltx_prog_psnup.m4
new file mode 100644
index 0000000..8aa7092
--- /dev/null
+++ b/m4/acltx_prog_psnup.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_psnup.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_PSNUP([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a psnup application and set the variable psnup to the
+# name of the application or to no if not found if ACTION-IF-NOT-FOUND is
+# not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_PSNUP],[
+AC_CHECK_PROGS(psnup,[psnup],no)
+if test $psnup = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the psnup application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_psresize.m4 b/m4/acltx_prog_psresize.m4
new file mode 100644
index 0000000..c3b3c3c
--- /dev/null
+++ b/m4/acltx_prog_psresize.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_psresize.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_PSRESIZE([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a psresize application and set the variable psresize to
+# the name of the application or to no if not found if ACTION-IF-NOT-FOUND
+# is not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_PSRESIZE],[
+AC_CHECK_PROGS(psresize,[psresize],no)
+if test $psresize = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the psresize application])],
+ $1)
+fi])
diff --git a/m4/acltx_prog_psselect.m4 b/m4/acltx_prog_psselect.m4
new file mode 100644
index 0000000..dbaffee
--- /dev/null
+++ b/m4/acltx_prog_psselect.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_psselect.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_PSSELECT([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a psselect application and set the variable psselect to
+# the name of the application or to no if not found if ACTION-IF-NOT-FOUND
+# is not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_PSSELECT],[
+AC_CHECK_PROGS(psselect,[psselect],no)
+if test $psselect = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the psselect application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_pstops.m4 b/m4/acltx_prog_pstops.m4
new file mode 100644
index 0000000..0e3edb3
--- /dev/null
+++ b/m4/acltx_prog_pstops.m4
@@ -0,0 +1,48 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_pstops.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_PSTOPS([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a pstops application and set the variable pstops to the
+# name of the application or to no if not found if ACTION-IF-NOT-FOUND is
+# not specified, configure fail when then application is not found.
+#
+# It is possible to set manually the program to use using pstops=...
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_PSTOPS],[
+AC_ARG_VAR(pstops,[specify default pstops application])
+if test "$ac_cv_env_pstops_set" = "set" ; then
+ AC_MSG_CHECKING([Checking for pstops])
+ pstops="$ac_cv_env_pstops_value";
+ AC_MSG_RESULT([$pstops (from parameter)])
+else
+ AC_CHECK_PROGS(pstops,[pstops],no)
+fi
+if test $pstops = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the pstops application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_prog_texhash.m4 b/m4/acltx_prog_texhash.m4
new file mode 100644
index 0000000..f8ac5a5
--- /dev/null
+++ b/m4/acltx_prog_texhash.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_prog_texhash.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_PROG_TEXHASH([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a texhash application and set the variable texhash to
+# the name of the application or to no if not found if ACTION-IF-NOT-FOUND
+# is not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_PROG_TEXHASH],[
+AC_CHECK_PROGS(texhash,[texhash],no)
+if test $texhash = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the texhash application])],
+ $1)
+fi
+])
diff --git a/m4/acltx_texmf_path.m4 b/m4/acltx_texmf_path.m4
new file mode 100644
index 0000000..3a265da
--- /dev/null
+++ b/m4/acltx_texmf_path.m4
@@ -0,0 +1,69 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acltx_texmf_path.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACLTX_TEXMF_PATH
+#
+# DESCRIPTION
+#
+# This macros find a suitable path for the local texmf folder. It this
+# possible to set manually this path using texmfpath=... The variable
+# texmfpath contains the path found or. If configure is unable to locate
+# the path, configure exit with a error message.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Boretti Mathieu <boretti@eig.unige.ch>
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([ACLTX_TEXMF_PATH],[
+AC_ARG_VAR(texmfpath,[specify default local texmf path (for example /usr/TeX/texmf-local/)])
+AC_REQUIRE([ACLTX_PROG_LATEX])
+AC_REQUIRE([AC_PROG_AWK])
+AC_REQUIRE([ACLTX_CLASS_REPORT])
+AC_CACHE_CHECK([for texmf local path],[ac_cv_texmfpath_value],[
+if test "$ac_cv_env_texmfpath_set" = "set" ; then
+ ac_cv_texmfpath_value="$ac_cv_env_texmfpath_value" ; export ac_cv_texmfpath_value;
+else
+ Base=`$kpsewhich report.cls` ; export Base ;
+ Base=`echo $Base | $AWK -F / '{for(i=1;i<NF;i++) {if ($i=="texmf" || $i=="texmf-dist") break; OUT=OUT$i"/";} print OUT}'` ; export Base ;
+ if test -x "$Base/texmf.local" ;
+ then
+ Base="$Base/texmf.local" ; export Base;
+ else
+ if test -x "$Base/texmf-local" ;
+ then
+ Base="$Base/texmf-local" ; export Base;
+ else
+ if test -x "$Base/texmf" ;
+ then
+ Base="$Base/texmf" ; export Base;
+ else
+ Base="no"; export Base;
+ fi;
+ fi;
+ fi;
+ ac_cv_texmfpath_value="$Base" ; export ac_cv_texmfpath_value;
+fi
+])
+texmfpath=$ac_cv_texmfpath_value ; export texmfpath_value;
+if test "$texmfpath" = "no" ;
+then
+ AC_MSG_ERROR([Unable to find a suitable local texmf folder. Use texmfpath=... to specify it])
+fi
+AC_SUBST(texmfpath)
+])
diff --git a/m4/acx_blas.m4 b/m4/acx_blas.m4
new file mode 100644
index 0000000..6fab5b4
--- /dev/null
+++ b/m4/acx_blas.m4
@@ -0,0 +1,196 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acx_blas.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACX_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro looks for a library that implements the BLAS linear-algebra
+# interface (see http://www.netlib.org/blas/). On success, it sets the
+# BLAS_LIBS output variable to hold the requisite library linkages.
+#
+# To link with BLAS, you should link with:
+#
+# $BLAS_LIBS $LIBS $FLIBS
+#
+# in that order. FLIBS is the output variable of the
+# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), and is
+# sometimes necessary in order to link with F77 libraries. Users will also
+# need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same
+# reason.
+#
+# Many libraries are searched for, from ATLAS to CXML to ESSL. The user
+# may also use --with-blas=<lib> in order to use some specific BLAS
+# library <lib>. In order to link successfully, however, be aware that you
+# will probably need to use the same Fortran compiler (which can be set
+# via the F77 env. var.) as was used to compile the BLAS library.
+#
+# ACTION-IF-FOUND is a list of shell commands to run if a BLAS library is
+# found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is
+# not found. If ACTION-IF-FOUND is not specified, the default action will
+# define HAVE_BLAS.
+#
+# This macro requires autoconf 2.50 or later.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([ACX_BLAS], [
+AC_PREREQ(2.50)
+AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
+acx_blas_ok=no
+
+AC_ARG_WITH(blas,
+ [AC_HELP_STRING([--with-blas=<lib>], [use BLAS library <lib>])])
+case $with_blas in
+ yes | "") ;;
+ no) acx_blas_ok=disable ;;
+ -* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;;
+ *) BLAS_LIBS="-l$with_blas" ;;
+esac
+
+# Get fortran linker names of BLAS functions to check for.
+AC_F77_FUNC(sgemm)
+AC_F77_FUNC(dgemm)
+
+acx_blas_save_LIBS="$LIBS"
+LIBS="$LIBS $FLIBS"
+
+# First, check BLAS_LIBS environment variable
+if test $acx_blas_ok = no; then
+if test "x$BLAS_LIBS" != x; then
+ save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS"
+ AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS])
+ AC_TRY_LINK_FUNC($sgemm, [acx_blas_ok=yes], [BLAS_LIBS=""])
+ AC_MSG_RESULT($acx_blas_ok)
+ LIBS="$save_LIBS"
+fi
+fi
+
+# BLAS linked to by default? (happens on some supercomputers)
+if test $acx_blas_ok = no; then
+ save_LIBS="$LIBS"; LIBS="$LIBS"
+ AC_CHECK_FUNC($sgemm, [acx_blas_ok=yes])
+ LIBS="$save_LIBS"
+fi
+
+# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
+if test $acx_blas_ok = no; then
+ AC_CHECK_LIB(atlas, ATL_xerbla,
+ [AC_CHECK_LIB(f77blas, $sgemm,
+ [AC_CHECK_LIB(cblas, cblas_dgemm,
+ [acx_blas_ok=yes
+ BLAS_LIBS="-lcblas -lf77blas -latlas"],
+ [], [-lf77blas -latlas])],
+ [], [-latlas])])
+fi
+
+# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
+if test $acx_blas_ok = no; then
+ AC_CHECK_LIB(blas, $sgemm,
+ [AC_CHECK_LIB(dgemm, $dgemm,
+ [AC_CHECK_LIB(sgemm, $sgemm,
+ [acx_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"],
+ [], [-lblas])],
+ [], [-lblas])])
+fi
+
+# BLAS in Intel MKL library?
+if test $acx_blas_ok = no; then
+ AC_CHECK_LIB(mkl, $sgemm, [acx_blas_ok=yes;BLAS_LIBS="-lmkl"])
+fi
+
+# BLAS in Apple vecLib library?
+if test $acx_blas_ok = no; then
+ save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
+ AC_CHECK_FUNC($sgemm, [acx_blas_ok=yes;BLAS_LIBS="-framework vecLib"])
+ LIBS="$save_LIBS"
+fi
+
+# BLAS in Alpha CXML library?
+if test $acx_blas_ok = no; then
+ AC_CHECK_LIB(cxml, $sgemm, [acx_blas_ok=yes;BLAS_LIBS="-lcxml"])
+fi
+
+# BLAS in Alpha DXML library? (now called CXML, see above)
+if test $acx_blas_ok = no; then
+ AC_CHECK_LIB(dxml, $sgemm, [acx_blas_ok=yes;BLAS_LIBS="-ldxml"])
+fi
+
+# BLAS in Sun Performance library?
+if test $acx_blas_ok = no; then
+ if test "x$GCC" != xyes; then # only works with Sun CC
+ AC_CHECK_LIB(sunmath, acosp,
+ [AC_CHECK_LIB(sunperf, $sgemm,
+ [BLAS_LIBS="-xlic_lib=sunperf -lsunmath"
+ acx_blas_ok=yes],[],[-lsunmath])])
+ fi
+fi
+
+# BLAS in SCSL library? (SGI/Cray Scientific Library)
+if test $acx_blas_ok = no; then
+ AC_CHECK_LIB(scs, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lscs"])
+fi
+
+# BLAS in SGIMATH library?
+if test $acx_blas_ok = no; then
+ AC_CHECK_LIB(complib.sgimath, $sgemm,
+ [acx_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"])
+fi
+
+# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
+if test $acx_blas_ok = no; then
+ AC_CHECK_LIB(blas, $sgemm,
+ [AC_CHECK_LIB(essl, $sgemm,
+ [acx_blas_ok=yes; BLAS_LIBS="-lessl -lblas"],
+ [], [-lblas $FLIBS])])
+fi
+
+# Generic BLAS library?
+if test $acx_blas_ok = no; then
+ AC_CHECK_LIB(blas, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lblas"])
+fi
+
+AC_SUBST(BLAS_LIBS)
+
+LIBS="$acx_blas_save_LIBS"
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_blas_ok" = xyes; then
+ ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])
+ :
+else
+ acx_blas_ok=no
+ $2
+fi
+])dnl ACX_BLAS
diff --git a/m4/acx_blas_f77_func.m4 b/m4/acx_blas_f77_func.m4
new file mode 100644
index 0000000..0c8ae18
--- /dev/null
+++ b/m4/acx_blas_f77_func.m4
@@ -0,0 +1,171 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acx_blas_f77_func.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACX_BLAS_F77_FUNC([ACTION-IF-PASS[, ACTION-IF-FAIL[, ACTION-IF-CROSS-COMPILING]])
+# ACX_BLAS_WITH_F77_FUNC([ACTION-IF-FOUND-AND-PASS[, ACTION-IF-NOT-FOUND-OR-FAIL]])
+#
+# DESCRIPTION
+#
+# These macros are intended as a supplement to the ACX_BLAS macro, to
+# verify that BLAS functions are properly callable from Fortran. This is
+# necessary, for example, if you want to build the LAPACK library on top
+# of the BLAS.
+#
+# ACX_BLAS_F77_FUNC uses the defined BLAS_LIBS and Fortran environment to
+# check for compatibility, and takes a specific action in case of success,
+# resp. failure, resp. cross-compilation.
+#
+# ACX_BLAS_WITH_F77_FUNC is a drop-in replacement wrapper for ACX_BLAS
+# that calls ACX_BLAS_F77_FUNC after detecting a BLAS library and rejects
+# it on failure (i.e. pretends that no library was found).
+#
+# LICENSE
+#
+# Copyright (c) 2008 Jaroslav Hajek <highegg@gmail.com>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([ACX_BLAS_F77_FUNC], [
+AC_PREREQ(2.50)
+AC_REQUIRE([ACX_BLAS])
+
+# F77 call-compatibility checks
+if test "$cross_compiling" = yes ; then
+ ifelse($3, ,$1,$3)
+elif test x"$acx_blas_ok" = xyes; then
+ LIBS="$BLAS_LIBS $LIBS"
+ AC_LANG_PUSH(Fortran 77)
+# LSAME check (LOGICAL return values)
+ AC_MSG_CHECKING([whether LSAME is called correctly from Fortran])
+ AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[
+ logical lsame,w
+ external lsame
+ character c1,c2
+ c1 = 'A'
+ c2 = 'B'
+ w = lsame(c1,c2)
+ if (w) stop 1
+ w = lsame(c1,c1)
+ if (.not. w) stop 1
+ ]]),[acx_blas_lsame_fcall_ok=yes],
+ [acx_blas_lsame_fcall_ok=no])
+ AC_MSG_RESULT([$acx_blas_lsame_fcall_ok])
+# ISAMAX check (INTEGER return values)
+ AC_MSG_CHECKING([whether ISAMAX is called correctly from Fortran])
+ AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[
+ integer isamax,i
+ external isamax
+ real a(2)
+ a(1) = 1e0
+ a(2) = -2e0
+ i = isamax(2,a,1)
+ if (i.ne.2) stop 1
+ ]]),[acx_blas_isamax_fcall_ok=yes],
+ [acx_blas_isamax_fcall_ok=no])
+ AC_MSG_RESULT([$acx_blas_isamax_fcall_ok])
+# SDOT check (REAL return values)
+ AC_MSG_CHECKING([whether DDOT is called correctly from Fortran])
+ AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[
+ real sdot,a(1),b(1),w
+ external sdot
+ a(1) = 1e0
+ b(1) = 2e0
+ w = sdot(1,a,1,b,1)
+ if (w .ne. a(1)*b(1)) stop 1
+ ]]),[acx_blas_sdot_fcall_ok=yes],
+ [acx_blas_sdot_fcall_ok=no])
+ AC_MSG_RESULT([$acx_blas_sdot_fcall_ok])
+# DDOT check (DOUBLE return values)
+ AC_MSG_CHECKING([whether DDOT is called correctly from Fortran])
+ AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[
+ double precision ddot,a(1),b(1),w
+ external ddot
+ a(1) = 1d0
+ b(1) = 2d0
+ w = ddot(1,a,1,b,1)
+ if (w .ne. a(1)*b(1)) stop 1
+ ]]),[acx_blas_ddot_fcall_ok=yes],
+ [acx_blas_ddot_fcall_ok=no])
+ AC_MSG_RESULT([$acx_blas_ddot_fcall_ok])
+# CDOTU check (COMPLEX return values)
+ AC_MSG_CHECKING([whether CDOTU is called correctly from Fortran])
+ AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[
+ complex cdotu,a(1),b(1),w
+ external cdotu
+ a(1) = cmplx(1e0,1e0)
+ b(1) = cmplx(1e0,2e0)
+ w = cdotu(1,a,1,b,1)
+ if (w .ne. a(1)*b(1)) stop 1
+ ]]),[acx_blas_cdotu_fcall_ok=yes],
+ [acx_blas_cdotu_fcall_ok=no])
+ AC_MSG_RESULT([$acx_blas_cdotu_fcall_ok])
+# ZDOTU check (DOUBLE COMPLEX return values)
+ AC_MSG_CHECKING([whether ZDOTU is called correctly from Fortran])
+ AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[
+ double complex zdotu,a(1),b(1),w
+ external zdotu
+ a(1) = dcmplx(1d0,1d0)
+ b(1) = dcmplx(1d0,2d0)
+ w = zdotu(1,a,1,b,1)
+ if (w .ne. a(1)*b(1)) stop 1
+ ]]),[acx_blas_zdotu_fcall_ok=yes],
+ [acx_blas_zdotu_fcall_ok=no])
+ AC_MSG_RESULT([$acx_blas_zdotu_fcall_ok])
+
+ AC_LANG_POP(Fortran 77)
+
+# if any of the tests failed, reject the BLAS library
+ if test $acx_blas_lsame_fcall_ok = yes \
+ -a $acx_blas_sdot_fcall_ok = yes \
+ -a $acx_blas_ddot_fcall_ok = yes \
+ -a $acx_blas_cdotu_fcall_ok = yes \
+ -a $acx_blas_zdotu_fcall_ok = yes ; then
+ acx_blas_f77_func_ok=yes;
+ $1
+ else
+ acx_blas_f77_func_ok=no;
+ $2
+ fi
+fi
+
+])dnl ACX_BLAS_F77_FUNC
+
+AC_DEFUN([ACX_BLAS_WITH_F77_FUNC], [
+AC_PREREQ(2.50)
+ACX_BLAS([# disable special action], [])
+if test x$acx_blas_ok = xyes ; then
+ ACX_BLAS_F77_FUNC(
+ [ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])],
+ [acx_blas_ok=no; BLAS_LIBS=])
+fi
+if test x$acx_blas_ok = xno ; then
+ $2
+fi
+])dnl ACX_BLAS_WITH_F77_FUNC
diff --git a/m4/acx_check_dos_filesys.m4 b/m4/acx_check_dos_filesys.m4
new file mode 100644
index 0000000..b32063b
--- /dev/null
+++ b/m4/acx_check_dos_filesys.m4
@@ -0,0 +1,63 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acx_check_dos_filesys.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACX_CHECK_DOS_FILESYS_LIMITATIONS
+#
+# DESCRIPTION
+#
+# Check if the target is running on DOS. DOS doesn't allow a dot as the
+# first character, more than one dot, more than eight characters before a
+# dot, and just three letters after the dot. A DOS VM running under
+# Windows 9X does not have these restrictions. A DOS program can be
+# running in either environment, so its important to code accordingly.
+# Defines HAVE_DOS_FILESYS_LIMITATIONS if under DOS.
+#
+# Use in conjunction with ACX_CHECK_PATHNAME_STYLE_DOS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Mark Elbrecht
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([ACX_CHECK_DOS_FILESYS_LIMITATIONS],
+[AC_MSG_CHECKING(for potential DOS filename limitations)
+AC_CACHE_VAL(acx_cv_dos_limitations,
+[AC_REQUIRE([AC_CANONICAL_HOST])
+acx_cv_dos_limitations="yes"
+case ${host_os} in
+ *dos | *djgpp) acx_cv_dos_limitations="yes"
+esac
+])
+AC_MSG_RESULT($acx_cv_dos_limitations)
+if test $acx_cv_dos_limitations = "yes"; then
+ AC_DEFINE(HAVE_DOS_FILESYS_LIMITATIONS)
+fi
+])
diff --git a/m4/acx_check_pathname_style.m4 b/m4/acx_check_pathname_style.m4
new file mode 100644
index 0000000..29ddbd5
--- /dev/null
+++ b/m4/acx_check_pathname_style.m4
@@ -0,0 +1,68 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acx_check_pathname_style.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACX_CHECK_PATHNAME_STYLE_DOS
+#
+# DESCRIPTION
+#
+# Check if host OS uses DOS-style pathnames. This includes the use of
+# drive letters and backslashes. Under DOS, Windows, and OS/2, defines
+# HAVE_PATHNAME_STYLE_DOS and PATH_SEPARATOR to ';'. Otherwise, defines
+# PATH_SEPARATOR to ':'.
+#
+# This macro depends on the AC_CANONICAL_HOST.
+#
+# Use for enabling code to handle drive letters, backslashes in filenames
+# and semicolons in the PATH.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Mark Elbrecht
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([ACX_CHECK_PATHNAME_STYLE_DOS],
+[AC_MSG_CHECKING(for Windows and DOS and OS/2 style pathnames)
+AC_CACHE_VAL(acx_cv_pathname_style_dos,
+[AC_REQUIRE([AC_CANONICAL_HOST])
+
+acx_cv_pathname_style_dos="no"
+case ${host_os} in
+ *djgpp | *mingw32* | *emx*) acx_cv_pathname_style_dos="yes" ;;
+esac
+])
+AC_MSG_RESULT($acx_cv_pathname_style_dos)
+if test "$acx_cv_pathname_style_dos" = "yes"; then
+ AC_DEFINE(HAVE_PATHNAME_STYLE_DOS,,[defined if running on a system with dos style paths])
+ AC_DEFINE(PATH_SEPARATOR, ';')
+else
+ AC_DEFINE(PATH_SEPARATOR, ':')
+fi
+])
diff --git a/m4/acx_f77_cmain_fflags.m4 b/m4/acx_f77_cmain_fflags.m4
new file mode 100644
index 0000000..5066606
--- /dev/null
+++ b/m4/acx_f77_cmain_fflags.m4
@@ -0,0 +1,99 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acx_f77_cmain_fflags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACX_F77_CMAIN_FFLAGS([ACTION-IF-SUCCEED], [ACTION-IF-FAIL])
+#
+# DESCRIPTION
+#
+# This macro figures out if extra Fortran compiler flags are required in
+# order to use the Fortran linker to link programs where the main()
+# function is defined via C (or other language). On some systems, notably
+# the Alpha with Compaq compilers, the Fortran libraries have their own
+# main() function which must be disabled.
+#
+# Runs ACTION-IF-SUCCEED if successful, and ACTION-IF-FAIL if not. Defines
+# the output variable F77_CMAIN_FFLAGS to any discovered flags. (If
+# ACTION-IF-FAIL is not specified, defaults to halting with an error.)
+#
+# This macro is especially useful in conjunction with automake, since by
+# default automake uses $F77 to link programs mixing C and Fortran,
+# leading to a link error on some systems. In this case, you should set
+# the FFLAGS for that program to include F77_CMAIN_FFLAGS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([ACX_F77_CMAIN_FFLAGS],
+[AC_CACHE_CHECK([for f77 flags to use C main function], acx_cv_f77_cmain_fflags,
+[acx_cv_f77_cmain_fflags="unknown"
+AC_LANG_PUSH(C)
+AC_COMPILE_IFELSE([[int main(void) { return 0; }]],
+ [mv conftest.$ac_objext conftest_cmain.$ac_objext],
+ [acx_cv_f77_cmain_fflags=error])
+AC_LANG_POP(C)
+if test "x$acx_cv_f77_cmain_fflags" != xerror; then
+ AC_LANG_PUSH(Fortran 77)
+ acx_save_LIBS=$LIBS
+ LIBS="conftest_cmain.$ac_objext $LIBS"
+ acx_save_FFLAGS=$FFLAGS
+ for acx_flag in none -nofor_main; do
+ case $acx_flag in
+ none) FFLAGS=$acx_save_FFLAGS ;;
+ *) FFLAGS="$acx_save_FFLAGS $acx_flag" ;;
+ esac
+ AC_LINK_IFELSE([
+ subroutine foobar()
+ return
+ end
+], [acx_cv_f77_cmain_fflags=$acx_flag; break]);
+ done
+ FFLAGS=$acx_save_FFLAGS
+ LIBS=$acx_save_LIBS
+ AC_LANG_POP(Fortran 77)
+fi])
+ case $acx_cv_f77_cmain_fflags in
+ error|unknown)
+ F77_CMAIN_FFLAGS=""
+ ifelse([$2],,[AC_MSG_ERROR([cannot link C main with Fortran])],[$2])
+ ;;
+ *)
+ if test "x$acx_cv_f77_cmain_fflags" = xnone; then
+ F77_CMAIN_FFLAGS=""
+ else
+ F77_CMAIN_FFLAGS="$acx_cv_f77_cmain_fflags"
+ fi
+ $1
+ ;;
+ esac
+ AC_SUBST(F77_CMAIN_FFLAGS)
+])
diff --git a/m4/acx_func_fork.m4 b/m4/acx_func_fork.m4
new file mode 100644
index 0000000..88c8fe4
--- /dev/null
+++ b/m4/acx_func_fork.m4
@@ -0,0 +1,80 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acx_func_fork.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACX_FUNC_FORK
+#
+# DESCRIPTION
+#
+# Check to for a working fork. Use to provide a workaround for systems
+# that don't have a working fork. For example, the workaround for the
+# fork()/exec() sequence for DOS is to use spawn.
+#
+# Defines HAVE_NO_FORK is fork() doesn't work or isn't implemented.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Mark Elbrecht
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([ACX_FUNC_FORK],
+[AC_MSG_CHECKING(for a working fork)
+AC_CACHE_VAL(acx_cv_func_fork_works,
+[AC_REQUIRE([AC_TYPE_PID_T])
+AC_REQUIRE([AC_HEADER_SYS_WAIT])
+AC_TRY_RUN([#include <sys/types.h>
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+int main()
+{
+ int status;
+ pid_t child = fork();
+
+ if (child < 0) /* Error */
+ return (1);
+ else if (child == 0) /* Child */
+ return (0);
+
+ /* Parent */
+ status = (wait(&status) != child);
+ return (status >= 0) ? 0 : 1;
+}
+], acx_cv_func_fork_works=yes, acx_cv_func_fork_works=no, acx_cv_func_fork_works=no)
+])
+AC_MSG_RESULT($acx_cv_func_fork_works)
+if test $acx_cv_func_fork_works = no; then
+ AC_DEFINE(HAVE_NO_FORK)
+fi
+])
diff --git a/m4/acx_lapack.m4 b/m4/acx_lapack.m4
new file mode 100644
index 0000000..10ba0dd
--- /dev/null
+++ b/m4/acx_lapack.m4
@@ -0,0 +1,128 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acx_lapack.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro looks for a library that implements the LAPACK linear-algebra
+# interface (see http://www.netlib.org/lapack/). On success, it sets the
+# LAPACK_LIBS output variable to hold the requisite library linkages.
+#
+# To link with LAPACK, you should link with:
+#
+# $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS
+#
+# in that order. BLAS_LIBS is the output variable of the ACX_BLAS macro,
+# called automatically. FLIBS is the output variable of the
+# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), and is
+# sometimes necessary in order to link with F77 libraries. Users will also
+# need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same
+# reason.
+#
+# The user may also use --with-lapack=<lib> in order to use some specific
+# LAPACK library <lib>. In order to link successfully, however, be aware
+# that you will probably need to use the same Fortran compiler (which can
+# be set via the F77 env. var.) as was used to compile the LAPACK and BLAS
+# libraries.
+#
+# ACTION-IF-FOUND is a list of shell commands to run if a LAPACK library
+# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+# is not found. If ACTION-IF-FOUND is not specified, the default action
+# will define HAVE_LAPACK.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([ACX_LAPACK], [
+AC_REQUIRE([ACX_BLAS])
+acx_lapack_ok=no
+
+AC_ARG_WITH(lapack,
+ [AC_HELP_STRING([--with-lapack=<lib>], [use LAPACK library <lib>])])
+case $with_lapack in
+ yes | "") ;;
+ no) acx_lapack_ok=disable ;;
+ -* | */* | *.a | *.so | *.so.* | *.o) LAPACK_LIBS="$with_lapack" ;;
+ *) LAPACK_LIBS="-l$with_lapack" ;;
+esac
+
+# Get fortran linker name of LAPACK function to check for.
+AC_F77_FUNC(cheev)
+
+# We cannot use LAPACK if BLAS is not found
+if test "x$acx_blas_ok" != xyes; then
+ acx_lapack_ok=noblas
+ LAPACK_LIBS=""
+fi
+
+# First, check LAPACK_LIBS environment variable
+if test "x$LAPACK_LIBS" != x; then
+ save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS"
+ AC_MSG_CHECKING([for $cheev in $LAPACK_LIBS])
+ AC_TRY_LINK_FUNC($cheev, [acx_lapack_ok=yes], [LAPACK_LIBS=""])
+ AC_MSG_RESULT($acx_lapack_ok)
+ LIBS="$save_LIBS"
+ if test $acx_lapack_ok = no; then
+ LAPACK_LIBS=""
+ fi
+fi
+
+# LAPACK linked to by default? (is sometimes included in BLAS lib)
+if test $acx_lapack_ok = no; then
+ save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS"
+ AC_CHECK_FUNC($cheev, [acx_lapack_ok=yes])
+ LIBS="$save_LIBS"
+fi
+
+# Generic LAPACK library?
+for lapack in lapack lapack_rs6k; do
+ if test $acx_lapack_ok = no; then
+ save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS"
+ AC_CHECK_LIB($lapack, $cheev,
+ [acx_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS])
+ LIBS="$save_LIBS"
+ fi
+done
+
+AC_SUBST(LAPACK_LIBS)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_lapack_ok" = xyes; then
+ ifelse([$1],,AC_DEFINE(HAVE_LAPACK,1,[Define if you have LAPACK library.]),[$1])
+ :
+else
+ acx_lapack_ok=no
+ $2
+fi
+])dnl ACX_LAPACK
diff --git a/m4/acx_mpi.m4 b/m4/acx_mpi.m4
new file mode 100644
index 0000000..f0c9a88
--- /dev/null
+++ b/m4/acx_mpi.m4
@@ -0,0 +1,177 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acx_mpi.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACX_MPI([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro tries to find out how to compile programs that use MPI
+# (Message Passing Interface), a standard API for parallel process
+# communication (see http://www-unix.mcs.anl.gov/mpi/)
+#
+# On success, it sets the MPICC, MPICXX, MPIF77, or MPIFC output variable
+# to the name of the MPI compiler, depending upon the current language.
+# (This may just be $CC/$CXX/$F77/$FC, but is more often something like
+# mpicc/mpiCC/mpif77/mpif90.) It also sets MPILIBS to any libraries that
+# are needed for linking MPI (e.g. -lmpi or -lfmpi, if a special
+# MPICC/MPICXX/MPIF77/MPIFC was not found).
+#
+# If you want to compile everything with MPI, you should set:
+#
+# CC="MPICC" #OR# CXX="MPICXX" #OR# F77="MPIF77" #OR# FC="MPIFC"
+# LIBS="$MPILIBS $LIBS"
+#
+# NOTE: The above assumes that you will use $CC (or whatever) for linking
+# as well as for compiling. (This is the default for automake and most
+# Makefiles.)
+#
+# The user can force a particular library/compiler by setting the
+# MPICC/MPICXX/MPIF77/MPIFC and/or MPILIBS environment variables.
+#
+# ACTION-IF-FOUND is a list of shell commands to run if an MPI library is
+# found, and ACTION-IF-NOT-FOUND is a list of commands to run if it is not
+# found. If ACTION-IF-FOUND is not specified, the default action will
+# define HAVE_MPI.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+# Copyright (c) 2008 Julian C. Cummings <cummings@cacr.caltech.edu>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([ACX_MPI], [
+AC_PREREQ(2.50) dnl for AC_LANG_CASE
+
+AC_LANG_CASE([C], [
+ AC_REQUIRE([AC_PROG_CC])
+ AC_ARG_VAR(MPICC,[MPI C compiler command])
+ AC_CHECK_PROGS(MPICC, mpicc hcc mpxlc_r mpxlc mpcc cmpicc, $CC)
+ acx_mpi_save_CC="$CC"
+ CC="$MPICC"
+ AC_SUBST(MPICC)
+],
+[C++], [
+ AC_REQUIRE([AC_PROG_CXX])
+ AC_ARG_VAR(MPICXX,[MPI C++ compiler command])
+ AC_CHECK_PROGS(MPICXX, mpic++ mpicxx mpiCC hcp mpxlC_r mpxlC mpCC cmpic++, $CXX)
+ acx_mpi_save_CXX="$CXX"
+ CXX="$MPICXX"
+ AC_SUBST(MPICXX)
+],
+[Fortran 77], [
+ AC_REQUIRE([AC_PROG_F77])
+ AC_ARG_VAR(MPIF77,[MPI Fortran 77 compiler command])
+ AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf_r mpxlf mpf77 cmpifc, $F77)
+ acx_mpi_save_F77="$F77"
+ F77="$MPIF77"
+ AC_SUBST(MPIF77)
+],
+[Fortran], [
+ AC_REQUIRE([AC_PROG_FC])
+ AC_ARG_VAR(MPIFC,[MPI Fortran compiler command])
+ AC_CHECK_PROGS(MPIFC, mpif90 mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c, $FC)
+ acx_mpi_save_FC="$FC"
+ FC="$MPIFC"
+ AC_SUBST(MPIFC)
+])
+
+if test x = x"$MPILIBS"; then
+ AC_LANG_CASE([C], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])],
+ [C++], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])],
+ [Fortran 77], [AC_MSG_CHECKING([for MPI_Init])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ call MPI_Init])],[MPILIBS=" "
+ AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])],
+ [Fortran], [AC_MSG_CHECKING([for MPI_Init])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ call MPI_Init])],[MPILIBS=" "
+ AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])])
+fi
+AC_LANG_CASE([Fortran 77], [
+ if test x = x"$MPILIBS"; then
+ AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"])
+ fi
+ if test x = x"$MPILIBS"; then
+ AC_CHECK_LIB(fmpich, MPI_Init, [MPILIBS="-lfmpich"])
+ fi
+],
+[Fortran], [
+ if test x = x"$MPILIBS"; then
+ AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"])
+ fi
+ if test x = x"$MPILIBS"; then
+ AC_CHECK_LIB(mpichf90, MPI_Init, [MPILIBS="-lmpichf90"])
+ fi
+])
+if test x = x"$MPILIBS"; then
+ AC_CHECK_LIB(mpi, MPI_Init, [MPILIBS="-lmpi"])
+fi
+if test x = x"$MPILIBS"; then
+ AC_CHECK_LIB(mpich, MPI_Init, [MPILIBS="-lmpich"])
+fi
+
+dnl We have to use AC_TRY_COMPILE and not AC_CHECK_HEADER because the
+dnl latter uses $CPP, not $CC (which may be mpicc).
+AC_LANG_CASE([C], [if test x != x"$MPILIBS"; then
+ AC_MSG_CHECKING([for mpi.h])
+ AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS=""
+ AC_MSG_RESULT(no)])
+fi],
+[C++], [if test x != x"$MPILIBS"; then
+ AC_MSG_CHECKING([for mpi.h])
+ AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS=""
+ AC_MSG_RESULT(no)])
+fi],
+[Fortran 77], [if test x != x"$MPILIBS"; then
+ AC_MSG_CHECKING([for mpif.h])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[ include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS=""
+ AC_MSG_RESULT(no)])
+fi],
+[Fortran], [if test x != x"$MPILIBS"; then
+ AC_MSG_CHECKING([for mpif.h])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[ include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS=""
+ AC_MSG_RESULT(no)])
+fi])
+
+AC_LANG_CASE([C], [CC="$acx_mpi_save_CC"],
+ [C++], [CXX="$acx_mpi_save_CXX"],
+ [Fortran 77], [F77="$acx_mpi_save_F77"],
+ [Fortran], [FC="$acx_mpi_save_FC"])
+
+AC_SUBST(MPILIBS)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x = x"$MPILIBS"; then
+ $2
+ :
+else
+ ifelse([$1],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$1])
+ :
+fi
+])dnl ACX_MPI
diff --git a/m4/acx_pthread.m4 b/m4/acx_pthread.m4
new file mode 100644
index 0000000..0a86dff
--- /dev/null
+++ b/m4/acx_pthread.m4
@@ -0,0 +1,271 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acx_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro figures out how to build C programs using POSIX threads. It
+# sets the PTHREAD_LIBS output variable to the threads library and linker
+# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+# flags that are needed. (The user can also force certain compiler
+# flags/libs to be tested by setting these environment variables.)
+#
+# Also sets PTHREAD_CC to any special C compiler that is needed for
+# multi-threaded programs (defaults to the value of CC otherwise). (This
+# is necessary on AIX to use the special cc_r compiler alias.)
+#
+# NOTE: You are assumed to not only compile your program with these flags,
+# but also link it with them as well. e.g. you should link with
+# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+# If you are only building threads programs, you may wish to use these
+# variables in your default LIBS, CFLAGS, and CC:
+#
+# LIBS="$PTHREAD_LIBS $LIBS"
+# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+# CC="$PTHREAD_CC"
+#
+# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
+# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+# ACTION-IF-FOUND is a list of shell commands to run if a threads library
+# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+# is not found. If ACTION-IF-FOUND is not specified, the default action
+# will define HAVE_PTHREAD.
+#
+# Please let the authors know if this macro fails on any platform, or if
+# you have any other suggestions or comments. This macro was based on work
+# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
+# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
+# Alejandro Forero Cuervo to the autoconf macro repository. We are also
+# grateful for the helpful feedback of numerous users.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([ACX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG_C
+acx_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+ AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test x"$acx_pthread_ok" = xno; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try. Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads too;
+# also defines -D_REENTRANT)
+# ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+ *solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+
+ acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
+ ;;
+esac
+
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
+
+ case $flag in
+ none)
+ AC_MSG_CHECKING([whether pthreads work without any flags])
+ ;;
+
+ -*)
+ AC_MSG_CHECKING([whether pthreads work with $flag])
+ PTHREAD_CFLAGS="$flag"
+ ;;
+
+ pthread-config)
+ AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
+ if test x"$acx_pthread_config" = xno; then continue; fi
+ PTHREAD_CFLAGS="`pthread-config --cflags`"
+ PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+ ;;
+
+ *)
+ AC_MSG_CHECKING([for the pthreads library -l$flag])
+ PTHREAD_LIBS="-l$flag"
+ ;;
+ esac
+
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+ AC_TRY_LINK([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+ [acx_pthread_ok=yes])
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test "x$acx_pthread_ok" = xyes; then
+ break;
+ fi
+
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+ AC_MSG_CHECKING([for joinable pthread attribute])
+ attr_name=unknown
+ for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+ AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
+ [attr_name=$attr; break])
+ done
+ AC_MSG_RESULT($attr_name)
+ if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+ AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+ [Define to necessary symbol if this constant
+ uses a non-standard name on your system.])
+ fi
+
+ AC_MSG_CHECKING([if more special flags are required for pthreads])
+ flag=no
+ case "${host_cpu}-${host_os}" in
+ *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+ *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+ esac
+ AC_MSG_RESULT(${flag})
+ if test "x$flag" != xno; then
+ PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+ fi
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ # More AIX lossage: must compile with xlc_r or cc_r
+ if test x"$GCC" != xyes; then
+ AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
+ else
+ PTHREAD_CC=$CC
+ fi
+else
+ PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
+ ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+ :
+else
+ acx_pthread_ok=no
+ $2
+fi
+AC_LANG_RESTORE
+])dnl ACX_PTHREAD
diff --git a/m4/adl_compute_relative_paths.m4 b/m4/adl_compute_relative_paths.m4
new file mode 100644
index 0000000..e2005b4
--- /dev/null
+++ b/m4/adl_compute_relative_paths.m4
@@ -0,0 +1,187 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/adl_compute_relative_paths.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# adl_COMPUTE_RELATIVE_PATHS(PATH_LIST)
+#
+# DESCRIPTION
+#
+# PATH_LIST is a space-separated list of colon-separated triplets of the
+# form 'FROM:TO:RESULT'. This function iterates over these triplets and
+# set $RESULT to the relative path from $FROM to $TO. Note that $FROM and
+# $TO needs to be absolute filenames for this macro to success.
+#
+# For instance,
+#
+# first=/usr/local/bin
+# second=/usr/local/share
+# adl_COMPUTE_RELATIVE_PATHS([first:second:fs second:first:sf])
+# # $fs is set to ../share
+# # $sf is set to ../bin
+#
+# $FROM and $TO are both eval'ed recursively and normalized, this means
+# that you can call this macro with autoconf's dirnames like `prefix' or
+# `datadir'. For example:
+#
+# adl_COMPUTE_RELATIVE_PATHS([bindir:datadir:bin_to_data])
+#
+# adl_COMPUTE_RELATIVE_PATHS should also works with DOS filenames.
+#
+# You may want to use this macro in order to make your package
+# relocatable. Instead of hardcoding $datadir into your programs just
+# encode $bin_to_data and try to determine $bindir at run-time.
+#
+# This macro requires adl_NORMALIZE_PATH.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([adl_COMPUTE_RELATIVE_PATHS],
+[for _lcl_i in $1; do
+ _lcl_from=\[$]`echo "[$]_lcl_i" | sed 's,:.*$,,'`
+ _lcl_to=\[$]`echo "[$]_lcl_i" | sed 's,^[[^:]]*:,,' | sed 's,:[[^:]]*$,,'`
+ _lcl_result_var=`echo "[$]_lcl_i" | sed 's,^.*:,,'`
+ adl_RECURSIVE_EVAL([[$]_lcl_from], [_lcl_from])
+ adl_RECURSIVE_EVAL([[$]_lcl_to], [_lcl_to])
+ _lcl_notation="$_lcl_from$_lcl_to"
+ adl_NORMALIZE_PATH([_lcl_from],['/'])
+ adl_NORMALIZE_PATH([_lcl_to],['/'])
+ adl_COMPUTE_RELATIVE_PATH([_lcl_from], [_lcl_to], [_lcl_result_tmp])
+ adl_NORMALIZE_PATH([_lcl_result_tmp],["[$]_lcl_notation"])
+ eval $_lcl_result_var='[$]_lcl_result_tmp'
+done])
+
+## Note:
+## *****
+## The following helper macros are too fragile to be used out
+## of adl_COMPUTE_RELATIVE_PATHS (mainly because they assume that
+## paths are normalized), that's why I'm keeping them in the same file.
+## Still, some of them maybe worth to reuse.
+
+dnl adl_COMPUTE_RELATIVE_PATH(FROM, TO, RESULT)
+dnl ===========================================
+dnl Compute the relative path to go from $FROM to $TO and set the value
+dnl of $RESULT to that value. This function work on raw filenames
+dnl (for instead it will considerate /usr//local and /usr/local as
+dnl two distinct paths), you should really use adl_COMPUTE_REALTIVE_PATHS
+dnl instead to have the paths sanitized automatically.
+dnl
+dnl For instance:
+dnl first_dir=/somewhere/on/my/disk/bin
+dnl second_dir=/somewhere/on/another/disk/share
+dnl adl_COMPUTE_RELATIVE_PATH(first_dir, second_dir, first_to_second)
+dnl will set $first_to_second to '../../../another/disk/share'.
+AC_DEFUN([adl_COMPUTE_RELATIVE_PATH],
+[adl_COMPUTE_COMMON_PATH([$1], [$2], [_lcl_common_prefix])
+adl_COMPUTE_BACK_PATH([$1], [_lcl_common_prefix], [_lcl_first_rel])
+adl_COMPUTE_SUFFIX_PATH([$2], [_lcl_common_prefix], [_lcl_second_suffix])
+$3="[$]_lcl_first_rel[$]_lcl_second_suffix"])
+
+dnl adl_COMPUTE_COMMON_PATH(LEFT, RIGHT, RESULT)
+dnl ============================================
+dnl Compute the common path to $LEFT and $RIGHT and set the result to $RESULT.
+dnl
+dnl For instance:
+dnl first_path=/somewhere/on/my/disk/bin
+dnl second_path=/somewhere/on/another/disk/share
+dnl adl_COMPUTE_COMMON_PATH(first_path, second_path, common_path)
+dnl will set $common_path to '/somewhere/on'.
+AC_DEFUN([adl_COMPUTE_COMMON_PATH],
+[$3=''
+_lcl_second_prefix_match=''
+while test "[$]_lcl_second_prefix_match" != 0; do
+ _lcl_first_prefix=`expr "x[$]$1" : "x\([$]$3/*[[^/]]*\)"`
+ _lcl_second_prefix_match=`expr "x[$]$2" : "x[$]_lcl_first_prefix"`
+ if test "[$]_lcl_second_prefix_match" != 0; then
+ if test "[$]_lcl_first_prefix" != "[$]$3"; then
+ $3="[$]_lcl_first_prefix"
+ else
+ _lcl_second_prefix_match=0
+ fi
+ fi
+done])
+
+dnl adl_COMPUTE_SUFFIX_PATH(PATH, SUBPATH, RESULT)
+dnl ==============================================
+dnl Substrack $SUBPATH from $PATH, and set the resulting suffix
+dnl (or the empty string if $SUBPATH is not a subpath of $PATH)
+dnl to $RESULT.
+dnl
+dnl For instace:
+dnl first_path=/somewhere/on/my/disk/bin
+dnl second_path=/somewhere/on
+dnl adl_COMPUTE_SUFFIX_PATH(first_path, second_path, common_path)
+dnl will set $common_path to '/my/disk/bin'.
+AC_DEFUN([adl_COMPUTE_SUFFIX_PATH],
+[$3=`expr "x[$]$1" : "x[$]$2/*\(.*\)"`])
+
+dnl adl_COMPUTE_BACK_PATH(PATH, SUBPATH, RESULT)
+dnl ============================================
+dnl Compute the relative path to go from $PATH to $SUBPATH, knowing that
+dnl $SUBPATH is a subpath of $PATH (any other words, only repeated '../'
+dnl should be needed to move from $PATH to $SUBPATH) and set the value
+dnl of $RESULT to that value. If $SUBPATH is not a subpath of PATH,
+dnl set $RESULT to the empty string.
+dnl
+dnl For instance:
+dnl first_path=/somewhere/on/my/disk/bin
+dnl second_path=/somewhere/on
+dnl adl_COMPUTE_BACK_PATH(first_path, second_path, back_path)
+dnl will set $back_path to '../../../'.
+AC_DEFUN([adl_COMPUTE_BACK_PATH],
+[adl_COMPUTE_SUFFIX_PATH([$1], [$2], [_lcl_first_suffix])
+$3=''
+_lcl_tmp='xxx'
+while test "[$]_lcl_tmp" != ''; do
+ _lcl_tmp=`expr "x[$]_lcl_first_suffix" : "x[[^/]]*/*\(.*\)"`
+ if test "[$]_lcl_first_suffix" != ''; then
+ _lcl_first_suffix="[$]_lcl_tmp"
+ $3="../[$]$3"
+ fi
+done])
+
+
+dnl adl_RECURSIVE_EVAL(VALUE, RESULT)
+dnl =================================
+dnl Interpolate the VALUE in loop until it doesn't change,
+dnl and set the result to $RESULT.
+dnl WARNING: It's easy to get an infinite loop with some unsane input.
+AC_DEFUN([adl_RECURSIVE_EVAL],
+[_lcl_receval="$1"
+$2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+ test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+ _lcl_receval_old=''
+ while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do
+ _lcl_receval_old="[$]_lcl_receval"
+ eval _lcl_receval="\"[$]_lcl_receval\""
+ done
+ echo "[$]_lcl_receval")`])
diff --git a/m4/adl_compute_standard_relative_paths.m4 b/m4/adl_compute_standard_relative_paths.m4
new file mode 100644
index 0000000..ca7e08f
--- /dev/null
+++ b/m4/adl_compute_standard_relative_paths.m4
@@ -0,0 +1,100 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/adl_compute_standard_relative_paths.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# adl_COMPUTE_STANDARD_RELATIVE_PATHS
+#
+# DESCRIPTION
+#
+# Here is the standard hierarchy of paths, as defined by the GNU Coding
+# Standards:
+#
+# prefix
+# exec_prefix
+# bindir
+# libdir
+# libexecdir
+# sbindir
+# datadir
+# sysconfdir
+# sharestatedir
+# localstatedir
+# infodir
+# lispdir
+# includedir
+# oldincludedir
+# mandir
+#
+# This macro will setup a set of variables of the form
+# 'xxx_forward_relative_path' and 'xxx_backward_relative_path' where xxx
+# is one of the above directories. The latter variable is set to the
+# relative path to go from xxx to its parent directory, while the former
+# hold the other way.
+#
+# For instance `bindir_relative_path' will contains the value to add to
+# $exec_prefix to reach the $bindir directory (usually 'bin'), and
+# `bindir_backward_relative_path' the value to append to $bindir to reach
+# the $exec_prefix directory (usually '..').
+#
+# This macro requires adl_COMPUTE_RELATIVE_PATHS which itself requires
+# adl_NORMALIZE_PATH.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([adl_COMPUTE_STANDARD_RELATIVE_PATHS],
+## These calls need to be on separate lines for aclocal to work!
+[adl_COMPUTE_RELATIVE_PATHS(dnl
+adl_STANDARD_RELATIVE_PATH_LIST)])
+
+dnl adl_STANDARD_RELATIVE_PATH_LIST
+dnl ===============================
+dnl A list of standard paths, ready to supply to adl_COMPUTE_RELATIVE_PATHS.
+AC_DEFUN([adl_STANDARD_RELATIVE_PATH_LIST],
+[pushdef([TRIPLET],
+[$][1:$][2:$][2_forward_relative_path $]dnl
+[2:$][1:$][2_backward_relative_path])dnl
+TRIPLET(prefix, exec_prefix) dnl
+TRIPLET(exec_prefix, bindir) dnl
+TRIPLET(exec_prefix, libdir) dnl
+TRIPLET(exec_prefix, libexecdir) dnl
+TRIPLET(exec_prefix, sbindir) dnl
+TRIPLET(prefix, datadir) dnl
+TRIPLET(prefix, sysconfdir) dnl
+TRIPLET(prefix, sharestatedir) dnl
+TRIPLET(prefix, localstatedir) dnl
+TRIPLET(prefix, infodir) dnl
+TRIPLET(prefix, lispdir) dnl
+TRIPLET(prefix, includedir) dnl
+TRIPLET(prefix, oldincludedir) dnl
+TRIPLET(prefix, mandir) dnl
+popdef([TRIPLET])])
diff --git a/m4/adl_func_getopt_long.m4 b/m4/adl_func_getopt_long.m4
new file mode 100644
index 0000000..02d6ba6
--- /dev/null
+++ b/m4/adl_func_getopt_long.m4
@@ -0,0 +1,61 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/adl_func_getopt_long.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# adl_FUNC_GETOPT_LONG
+#
+# DESCRIPTION
+#
+# Check for getopt_long support.
+#
+# This assume that the standard getopt.h file (from GNU libc) is available
+# as lib/gnugetopt.h. If needed, this file will be linked as getopt.h, but
+# we want to default to the system's getopt.h file. (See
+# http://sources.redhat.com/ml/automake/2000-09/msg00041.html for an
+# explanation about why using the system's getopt.h file is important.)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([adl_FUNC_GETOPT_LONG],
+ [AC_PREREQ(2.49)dnl
+ # clean out junk possibly left behind by a previous configuration
+ rm -f lib/getopt.h
+ # Check for getopt_long support
+ AC_CHECK_HEADERS([getopt.h])
+ AC_CHECK_FUNCS([getopt_long],,
+ [# FreeBSD has a gnugetopt library for this
+ AC_CHECK_LIB([gnugetopt],[getopt_long],[AC_DEFINE([HAVE_GETOPT_LONG])],
+ [# use the GNU replacement
+ AC_LIBOBJ(getopt)
+ AC_LIBOBJ(getopt1)
+ AC_CONFIG_LINKS([lib/getopt.h:lib/gnugetopt.h])])])])
diff --git a/m4/adl_normalize_path.m4 b/m4/adl_normalize_path.m4
new file mode 100644
index 0000000..b402c78
--- /dev/null
+++ b/m4/adl_normalize_path.m4
@@ -0,0 +1,112 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/adl_normalize_path.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# adl_NORMALIZE_PATH(VARNAME, [REFERENCE_STRING])
+#
+# DESCRIPTION
+#
+# Perform some cleanups on the value of $VARNAME (interpreted as a path):
+#
+# - empty paths are changed to '.'
+# - trailing slashes are removed
+# - repeated slashes are squeezed except a leading doubled slash '//'
+# (which might indicate a networked disk on some OS).
+#
+# REFERENCE_STRING is used to turn '/' into '\' and vice-versa: if
+# REFERENCE_STRING contains some backslashes, all slashes and backslashes
+# are turned into backslashes, otherwise they are all turned into slashes.
+#
+# This makes processing of DOS filenames quite easier, because you can
+# turn a filename to the Unix notation, make your processing, and turn it
+# back to original notation.
+#
+# filename='A:\FOO\\BAR\'
+# old_filename="$filename"
+# # Switch to the unix notation
+# adl_NORMALIZE_PATH([filename], ["/"])
+# # now we have $filename = 'A:/FOO/BAR' and we can process it as if
+# # it was a Unix path. For instance let's say that you want
+# # to append '/subpath':
+# filename="$filename/subpath"
+# # finally switch back to the original notation
+# adl_NORMALIZE_PATH([filename], ["$old_filename"])
+# # now $filename equals to 'A:\FOO\BAR\subpath'
+#
+# One good reason to make all path processing with the unix convention is
+# that backslashes have a special meaning in many cases. For instance
+#
+# expr 'A:\FOO' : 'A:\Foo'
+#
+# will return 0 because the second argument is a regex in which
+# backslashes have to be backslashed. In other words, to have the two
+# strings to match you should write this instead:
+#
+# expr 'A:\Foo' : 'A:\\Foo'
+#
+# Such behavior makes DOS filenames extremely unpleasant to work with. So
+# temporary turn your paths to the Unix notation, and revert them to the
+# original notation after the processing. See the macro
+# adl_COMPUTE_RELATIVE_PATHS for a concrete example of this.
+#
+# REFERENCE_STRING defaults to $VARIABLE, this means that slashes will be
+# converted to backslashes if $VARIABLE already contains some backslashes
+# (see $thirddir below).
+#
+# firstdir='/usr/local//share'
+# seconddir='C:\Program Files\\'
+# thirddir='C:\home/usr/'
+# adl_NORMALIZE_PATH([firstdir])
+# adl_NORMALIZE_PATH([seconddir])
+# adl_NORMALIZE_PATH([thirddir])
+# # $firstdir = '/usr/local/share'
+# # $seconddir = 'C:\Program Files'
+# # $thirddir = 'C:\home\usr'
+#
+# LICENSE
+#
+# Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([adl_NORMALIZE_PATH],
+[case ":[$]$1:" in
+# change empty paths to '.'
+ ::) $1='.' ;;
+# strip trailing slashes
+ :*[[\\/]]:) $1=`echo "[$]$1" | sed 's,[[\\/]]*[$],,'` ;;
+ :*:) ;;
+esac
+# squeze repeated slashes
+case ifelse($2,,"[$]$1",$2) in
+# if the path contains any backslashes, turn slashes into backslashes
+ *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+# if the path contains slashes, also turn backslashes into slashes
+ *) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1/,g'` ;;
+esac])
diff --git a/m4/ag_check_allocated_ctime.m4 b/m4/ag_check_allocated_ctime.m4
new file mode 100644
index 0000000..edfd71b
--- /dev/null
+++ b/m4/ag_check_allocated_ctime.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ag_check_allocated_ctime.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AG_CHECK_ALLOCATED_CTIME
+#
+# DESCRIPTION
+#
+# Check whether we need to free the memory returned by ctime.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AG_CHECK_ALLOCATED_CTIME],[
+ AC_MSG_CHECKING([whether ctime() allocates memory for its result])
+ AC_CACHE_VAL([ag_cv_allocated_ctime],[
+ AC_TRY_RUN([#include <time.h>
+int main (int argc, char** argv) {
+ time_t timeVal = time( (time_t*)NULL );
+ char* pzTime = ctime( &timeVal );
+ free( (void*)pzTime );
+ return 0; }],[ag_cv_allocated_ctime=yes],[ag_cv_allocated_ctime=no],[ag_cv_allocated_ctime=no]
+ ) # end of TRY_RUN]) # end of CACHE_VAL
+
+ AC_MSG_RESULT([$ag_cv_allocated_ctime])
+ if test x$ag_cv_allocated_ctime = xyes
+ then
+ AC_DEFINE(HAVE_ALLOCATED_CTIME, 1,
+ [Define this if ctime() allocates memory for its result])
+ fi
+]) # end of AC_DEFUN of AG_CHECK_ALLOCATED_CTIME
diff --git a/m4/ag_check_pathfind.m4 b/m4/ag_check_pathfind.m4
new file mode 100644
index 0000000..afa9748
--- /dev/null
+++ b/m4/ag_check_pathfind.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ag_check_pathfind.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AG_CHECK_PATHFIND
+#
+# DESCRIPTION
+#
+# Not all systems have pathfind(3). See if we need to substitute. To make
+# this work, you have to do horrible things. See the doc for
+# AG_CHECK_STRCSPN.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AG_CHECK_PATHFIND],[
+ AC_MSG_CHECKING([whether pathfind(3) works])
+ AC_CACHE_VAL([ag_cv_pathfind],[
+ AC_TRY_RUN([#include <string.h>
+#include <stdlib.h>
+int main (int argc, char** argv) {
+ char* pz = pathfind( getenv( "PATH" ), "sh", "x" );
+ return (pz == 0) ? 1 : 0;
+}],[ag_cv_pathfind=yes],[ag_cv_pathfind=no],[ag_cv_pathfind=no]
+ ) # end of TRY_RUN]) # end of CACHE_VAL
+
+ AC_MSG_RESULT([$ag_cv_pathfind])
+ if test x$ag_cv_pathfind = xyes
+ then
+ AC_DEFINE(HAVE_PATHFIND, 1,
+ [Define this if pathfind(3) works])
+ else
+ if test x$ac_cv_lib_gen_pathfind = xyes
+ then :
+ else
+ COMPATOBJ="$COMPATOBJ pathfind.lo"
+ fi
+ fi
+]) # end of AC_DEFUN of AG_CHECK_PATHFIND
diff --git a/m4/ag_check_posix_regcomp.m4 b/m4/ag_check_posix_regcomp.m4
new file mode 100644
index 0000000..a8f1c4e
--- /dev/null
+++ b/m4/ag_check_posix_regcomp.m4
@@ -0,0 +1,42 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ag_check_posix_regcomp.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AG_CHECK_POSIX_REGCOMP
+#
+# DESCRIPTION
+#
+# Check that the POSIX compliant regular expression compiler is available
+# in the POSIX specified manner, and it works. If it fails, we have a
+# backup -- use gnu-regex.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AG_CHECK_POSIX_REGCOMP],[
+ AC_MSG_CHECKING([whether POSIX compliant regcomp()/regexec()])
+ AC_CACHE_VAL([ag_cv_posix_regcomp],[
+ AC_TRY_RUN([#include <sys/types.h>
+#include <regex.h>
+int main() {
+ int flags = REG_EXTENDED|REG_ICASE|REG_NEWLINE;
+ regex_t re;
+ if (regcomp( &re, "^.*$", flags ) != 0)
+ return 1;
+ return regcomp( &re, "|no.*", flags ); }],[ag_cv_posix_regcomp=yes],[ag_cv_posix_regcomp=no],[ag_cv_posix_regcomp=no]
+ ) # end of TRY_RUN]) # end of CACHE_VAL
+
+ AC_MSG_RESULT([$ag_cv_posix_regcomp])
+ if test x$ag_cv_posix_regcomp = xyes
+ then
+ AC_DEFINE(HAVE_POSIX_REGCOMP, 1,
+ [Define this if POSIX compliant regcomp()/regexec()])
+ fi
+]) # end of AC_DEFUN of AG_CHECK_POSIX_REGCOMP
diff --git a/m4/ag_check_posix_sysinfo.m4 b/m4/ag_check_posix_sysinfo.m4
new file mode 100644
index 0000000..6d96580
--- /dev/null
+++ b/m4/ag_check_posix_sysinfo.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ag_check_posix_sysinfo.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AG_CHECK_POSIX_SYSINFO
+#
+# DESCRIPTION
+#
+# Check that the POSIX compliant sysinfo(2) call works properly. Linux has
+# its own weirdo alternative.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AG_CHECK_POSIX_SYSINFO],[
+ AC_MSG_CHECKING([whether sysinfo(2) is POSIX])
+ AC_CACHE_VAL([ag_cv_posix_sysinfo],[
+ AC_TRY_RUN([#include <sys/systeminfo.h>
+int main() { char z[ 256 ];
+long sz = sysinfo( SI_SYSNAME, z, sizeof( z ));
+return (sz > 0) ? 0 : 1; }],[ag_cv_posix_sysinfo=yes],[ag_cv_posix_sysinfo=no],[ag_cv_posix_sysinfo=no]
+ ) # end of TRY_RUN]) # end of CACHE_VAL
+
+ AC_MSG_RESULT([$ag_cv_posix_sysinfo])
+ if test x$ag_cv_posix_sysinfo = xyes
+ then
+ AC_DEFINE(HAVE_POSIX_SYSINFO, 1,
+ [Define this if sysinfo(2) is POSIX])
+ fi
+]) # end of AC_DEFUN of AG_CHECK_POSIX_SYSINFO
diff --git a/m4/ag_check_strcspn.m4 b/m4/ag_check_strcspn.m4
new file mode 100644
index 0000000..8fd7dfe
--- /dev/null
+++ b/m4/ag_check_strcspn.m4
@@ -0,0 +1,53 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ag_check_strcspn.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AG_CHECK_STRCSPN
+#
+# DESCRIPTION
+#
+# Not all systems have strcspn(3). See if we need to substitute. To make
+# this work, you have to do horrible things. In one of your Makefile.am
+# files, you must make an explicit rule to make this object. It should
+# look like this:
+#
+# strcspn.lo : $(top_srcdir)/compat/strcspn.c
+# $(LTCOMPILE) -o $@ -c $(top_srcdir)/compat/strcspn.c
+#
+# and you must include ``@COMPATOBJ@'' in a LIBADD somewhere and, finally,
+# you must add another artificial dependency, something like:
+#
+# makeshell.lo : genshell.c @COMPATOBJ@
+#
+# It is all pretty horrific, but I have found nothing else that works.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AG_CHECK_STRCSPN],[
+ AC_MSG_CHECKING([whether strcspn matches prototype and works])
+ AC_CACHE_VAL([ag_cv_strcspn],[
+ AC_TRY_RUN([#include <string.h>
+int main (int argc, char** argv) {
+ char zRej[] = "reject";
+ char zAcc[] = "a-ok-eject";
+ return strcspn( zAcc, zRej ) - 5;
+}],[ag_cv_strcspn=yes],[ag_cv_strcspn=no],[ag_cv_strcspn=no]
+ ) # end of TRY_RUN]) # end of CACHE_VAL
+
+ AC_MSG_RESULT([$ag_cv_strcspn])
+ if test x$ag_cv_strcspn = xyes
+ then
+ AC_DEFINE(HAVE_STRCSPN, 1,
+ [Define this if strcspn matches prototype and works])
+ else
+ COMPATOBJ="$COMPATOBJ strcspn.lo"
+ fi
+]) # end of AC_DEFUN of AG_CHECK_STRCSPN
diff --git a/m4/ag_check_strftime.m4 b/m4/ag_check_strftime.m4
new file mode 100644
index 0000000..8053313
--- /dev/null
+++ b/m4/ag_check_strftime.m4
@@ -0,0 +1,48 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ag_check_strftime.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AG_CHECK_STRFTIME
+#
+# DESCRIPTION
+#
+# Check for existence and functioning of strftime routine.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AG_CHECK_STRFTIME],[
+ AC_MSG_CHECKING([whether strftime() works])
+ AC_CACHE_VAL([ag_cv_strftime],[
+ AC_TRY_RUN([#include <time.h>
+char t_buf[ 64 ];
+int main() {
+ static const char z[] = "Thursday Aug 28 240";
+ struct tm tm;
+ tm.tm_sec = 36; /* seconds after the minute [0, 61] */
+ tm.tm_min = 44; /* minutes after the hour [0, 59] */
+ tm.tm_hour = 12; /* hour since midnight [0, 23] */
+ tm.tm_mday = 28; /* day of the month [1, 31] */
+ tm.tm_mon = 7; /* months since January [0, 11] */
+ tm.tm_year = 86; /* years since 1900 */
+ tm.tm_wday = 4; /* days since Sunday [0, 6] */
+ tm.tm_yday = 239; /* days since January 1 [0, 365] */
+ tm.tm_isdst = 1; /* flag for daylight savings time */
+ strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm );
+ return (strcmp( t_buf, z ) != 0); }],[ag_cv_strftime=yes],[ag_cv_strftime=no],[ag_cv_strftime=no]
+ ) # end of TRY_RUN]) # end of CACHE_VAL
+
+ AC_MSG_RESULT([$ag_cv_strftime])
+ if test x$ag_cv_strftime = xyes
+ then
+ AC_DEFINE(HAVE_STRFTIME, 1,
+ [Define this if strftime() works])
+ fi
+]) # end of AC_DEFUN of AG_CHECK_STRFTIME
diff --git a/m4/ag_check_sys_siglist.m4 b/m4/ag_check_sys_siglist.m4
new file mode 100644
index 0000000..1acaaef
--- /dev/null
+++ b/m4/ag_check_sys_siglist.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ag_check_sys_siglist.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AG_CHECK_SYS_SIGLIST
+#
+# DESCRIPTION
+#
+# Check for existence of global sys_siglist[].
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AG_CHECK_SYS_SIGLIST],[
+ AC_MSG_CHECKING([whether there is a global text array sys_siglist])
+ AC_CACHE_VAL([ag_cv_sys_siglist],[
+ AC_TRY_RUN([#include <signal.h>
+int main() {
+ const char* pz = sys_siglist[1];
+ return (pz != 0) ? 0 : 1; }],[ag_cv_sys_siglist=yes],[ag_cv_sys_siglist=no],[ag_cv_sys_siglist=no]
+ ) # end of TRY_RUN]) # end of CACHE_VAL
+
+ AC_MSG_RESULT([$ag_cv_sys_siglist])
+ if test x$ag_cv_sys_siglist = xyes
+ then
+ AC_DEFINE(HAVE_SYS_SIGLIST, 1,
+ [Define this if there is a global text array sys_siglist])
+ NEED_SYS_SIGLIST=false
+ else
+ NEED_SYS_SIGLIST=true
+ fi
+ AC_SUBST(NEED_SYS_SIGLIST)
+]) # end of AC_DEFUN of AG_CHECK_SYS_SIGLIST
diff --git a/m4/ag_check_uname_syscall.m4 b/m4/ag_check_uname_syscall.m4
new file mode 100644
index 0000000..b01d174
--- /dev/null
+++ b/m4/ag_check_uname_syscall.m4
@@ -0,0 +1,35 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ag_check_uname_syscall.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AG_CHECK_UNAME_SYSCALL
+#
+# DESCRIPTION
+#
+# Check that the POSIX compliant uname(2) call works properly.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AG_CHECK_UNAME_SYSCALL],[
+ AC_MSG_CHECKING([whether uname(2) is POSIX])
+ AC_CACHE_VAL([ag_cv_uname_syscall],[
+ AC_TRY_RUN([#include <sys/utsname.h>
+int main() { struct utsname unm;
+return uname( &unm ); }],[ag_cv_uname_syscall=yes],[ag_cv_uname_syscall=no],[ag_cv_uname_syscall=no]
+ ) # end of TRY_RUN]) # end of CACHE_VAL
+
+ AC_MSG_RESULT([$ag_cv_uname_syscall])
+ if test x$ag_cv_uname_syscall = xyes
+ then
+ AC_DEFINE(HAVE_UNAME_SYSCALL, 1,
+ [Define this if uname(2) is POSIX])
+ fi
+]) # end of AC_DEFUN of AG_CHECK_UNAME_SYSCALL
diff --git a/m4/am_rpm_init.m4 b/m4/am_rpm_init.m4
new file mode 100644
index 0000000..b996d27
--- /dev/null
+++ b/m4/am_rpm_init.m4
@@ -0,0 +1,259 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/am_rpm_init.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AM_RPM_INIT
+#
+# DESCRIPTION
+#
+# Setup variables for creation of rpms. It will define several variables
+# useful for creating rpms on a system where rpms are supported.
+# Currently, I requires changes to Makefile.am to function properly (see
+# the example below).
+#
+# Also note that I do not use any non-UNIX OSs (and for the most part, I
+# only use RedHat), so this is probably generally not useful for other
+# systems.
+#
+# Required setup:
+#
+# In configure.in:
+#
+# dnl For my rpm.m4 macros
+# RPM_RELEASE=1
+# AC_SUBST(RPM_RELEASE)
+#
+# AM_RPM_INIT
+# dnl Enable or disable the rpm making rules in Makefile.am
+# AM_CONDITIONAL(MAKE_RPMS, test x$make_rpms = xtrue)
+#
+# Furthermore, the %GNUconfigure rpm macro has a problem in that it does
+# not define CXXFLAGS for the target system correctly, so for compiling
+# C++ code, add the following line _before_ calling AC_PROG_CXX:
+#
+# dnl This is a little hack to make this work with rpm better (see mysql++.spec.in)
+# test -z "$CXXFLAGS" && CXXFLAGS="${CFLAGS}"
+#
+# Changes to Makefile.am (I am trying to get rid of this step; suggestions
+# invited):
+#
+# if MAKE_RPMS
+# rpm: @RPM_TARGET@
+#
+# .PHONY: rpm
+#
+# $(RPM_TARGET): $(DISTFILES)
+# ${MAKE} dist
+# -mkdir -p $(RPM_DIR)/SRPMS
+# -mkdir -p `dirname $(RPM_TARGET)`
+# $(RPM_PROG) $(RPM_ARGS) $(RPM_TARBALL)
+# @echo Congratulations, $(RPM_TARGET) "(and friends)" should now exist.
+# else
+# endif
+#
+# Also, it works best with a XXXX.spec.in file like the following (this is
+# way down on the wishlist, but a program to generate the skeleton spec.in
+# much like autoscan would just kick butt!):
+#
+# ---------- 8< ----------
+# # -*- Mode:rpm-spec -*-
+# # mysql++.spec.in
+# Summary: Your package description goes here
+# %define rel @RPM_RELEASE@
+#
+# %define version @VERSION@
+# %define pkgname @PACKAGE@
+# %define prefix /usr
+#
+# %define lt_release @LT_RELEASE@
+# %define lt_version @LT_CURRENT@.@LT_REVISION@.@LT_AGE@
+#
+# # This is a hack until I can figure out how to better handle replacing
+# # autoconf macros... (gotta love autoconf...)
+# %define __aclocal aclocal || aclocal -I ./macros
+# %define configure_args @RPM_CONFIGURE_ARGS@
+#
+# Name: %{pkgname}
+# Version: %{version}
+# Release: %{rel}
+#
+# Copyright: LGPL
+# Group: # your group name goes here
+# Source: %{pkgname}-%{version}.tar.gz
+# Requires: # additional requirements
+# Buildroot: /tmp/%{pkgname}-root
+# URL: http://yoururl.go.here
+# Prefix: %{prefix}
+# BuildArchitectures: # Target platforms, i.e., i586
+# Packager: Your Name <youremail@your.address>
+#
+# %description
+# Your package description
+#
+# %changelog
+#
+# %prep
+# %setup
+# #%patch
+#
+# %build
+# %GNUconfigure %{configure_args}
+# # This is why we copy the CFLAGS to the CXXFLAGS in configure.in
+# # CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{prefix}
+# make
+#
+# %install
+# # To make things work with BUILDROOT
+# if [ "$RPM_BUILD_ROOT" != "/tmp/%{pkgname}-root" ]
+# then
+# echo
+# echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+# echo @ @
+# echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @
+# echo @ @
+# echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+# echo
+# else
+# echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+# rm -rf "$RPM_BUILD_ROOT"
+# fi
+# make DESTDIR="$RPM_BUILD_ROOT" install
+#
+# %clean
+# # Call me paranoid, but I do not want to be responsible for nuking
+# # someone's harddrive!
+# if [ "$RPM_BUILD_ROOT" != "/tmp/%{pkgname}-root" ]
+# then
+# echo
+# echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+# echo @ @
+# echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @
+# echo @ @
+# echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+# echo
+# else
+# echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+# rm -rf "$RPM_BUILD_ROOT"
+# fi
+#
+# %files
+# %defattr(-, root, root)
+# # Your application file list goes here
+# # %{prefix}/lib/lib*.so*
+# %doc COPYRIGHT ChangeLog README AUTHORS NEWS
+# %doc doc/*
+#
+# # If you install a library
+# %post -p /sbin/ldconfig
+#
+# # If you install a library
+# %postun -p /sbin/ldconfig
+#
+# %package devel
+# Summary: Development files for %{pkgname}
+# Group: Applications/Databases
+# %description devel
+# Development files for %{pkgname}.
+#
+# %files devel
+# %defattr(-, root, root)
+# # Your development files go here
+# # Programmers documentation goes here
+# %doc doc
+#
+# # end of file
+# ---------- >8 ----------
+#
+# LICENSE
+#
+# Copyright (c) 2008 Dale K. Hawkins <dhawkins@cdrgts.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+dnl AM_RPM_INIT
+dnl Figure out how to create rpms for this system and setup for an
+dnl automake target
+
+AC_DEFUN([AM_RPM_INIT],
+[dnl
+AC_REQUIRE([AC_CANONICAL_HOST])
+dnl Find the RPM program
+AC_ARG_WITH(rpm-prog,[ --with-rpm-prog=PROG Which rpm to use (optional)],
+ rpm_prog="$withval", rpm_prog="")
+
+AC_ARG_ENABLE(rpm-rules, [ --enable-rpm-rules Try to create rpm make rules (defaults to yes for Linux)],
+ enable_rpm_rules="$withval",enable_rpm_rules=no)
+
+AC_ARG_WITH(rpm-extra-args, [ --with-rpm-extra-args=ARGS Run rpm with extra arguments (defaults to none)],
+ rpm_extra_args="$withval", rpm_extra_args="")
+
+dnl AC_ARG_ENABLE(rpm-topdir, [ --enable-rpm Try to create rpm make rules (defaults to yes for Linux)],
+dnl enable_rpm_rules="$withval",no)
+
+dnl echo enable_rpm_rules is $enable_rpm_rules
+dnl echo rpm_prog is $rpm_prog
+
+ RPM_TARGET=""
+
+ if test x$enable_rpm_rules = xno ; then
+ echo "Not trying to build rpms for your system (use --enable-rpm-rules to override) "
+ no_rpm=yes
+ else
+ if test x$rpm_prog != x ; then
+ if test x${RPM_PROG+set} != xset ; then
+ RPM_PROG=$rpm_prog
+ fi
+ fi
+
+ AC_PATH_PROG(RPM_PROG, rpm, no)
+ no_rpm=no
+ if test "$RPM_PROG" = "no" ; then
+echo *** RPM Configuration Failed
+echo *** Failed to find the rpm program. If you want to build rpm packages
+echo *** indicate the path to the rpm program using --with-rpm-prog=PROG
+ no_rpm=yes
+ RPM_MAKE_RULES=""
+ else
+ AC_MSG_CHECKING(how rpm sets %{_rpmdir})
+ rpmdir=`rpm --eval %{_rpmdir}`
+ if test x$rpmdir = x"%{_rpmdir}" ; then
+ AC_MSG_RESULT([not set (cannot build rpms?)])
+ echo *** Could not determine the value of %{_rpmdir}
+ echo *** This could be because it is not set, or your version of rpm does not set it
+ echo *** It must be set in order to generate the correct rpm generation commands
+ echo ***
+ echo *** You might still be able to create rpms, but I could not automate it for you
+ echo *** BTW, if you know this is wrong, please help to improve the rpm.m4 module
+ echo *** Send corrections, updates and fixes to dhawkins@cdrgts.com. Thanks.
+ else
+ AC_MSG_RESULT([$rpmdir])
+ fi
+ AC_MSG_CHECKING(how rpm sets %{_rpmfilename})
+ rpmfilename=$rpmdir/`rpm --eval %{_rpmfilename} | sed "s/%{ARCH}/${host_cpu}/g" | sed "s/%{NAME}/$PACKAGE/g" | sed "s/%{VERSION}/${VERSION}/g" | sed "s/%{RELEASE}/${RPM_RELEASE}/g"`
+ AC_MSG_RESULT([$rpmfilename])
+
+ RPM_DIR=${rpmdir}
+ RPM_TARGET=$rpmfilename
+ RPM_ARGS="-ta $rpm_extra_args"
+ RPM_TARBALL=${PACKAGE}-${VERSION}.tar.gz
+ fi
+ fi
+
+ case "${no_rpm}" in
+ yes) make_rpms=false;;
+ no) make_rpms=true;;
+ *) AC_MSG_WARN([bad value ${no_rpm} for no_rpm (not making rpms)])
+ make_rpms=false;;
+ esac
+ AC_SUBST(RPM_DIR)
+ AC_SUBST(RPM_TARGET)
+ AC_SUBST(RPM_ARGS)
+ AC_SUBST(RPM_TARBALL)
+
+ RPM_CONFIGURE_ARGS=${ac_configure_args}
+ AC_SUBST(RPM_CONFIGURE_ARGS)
+])
diff --git a/m4/am_with_mpatrol.m4 b/m4/am_with_mpatrol.m4
new file mode 100644
index 0000000..dc24ef4
--- /dev/null
+++ b/m4/am_with_mpatrol.m4
@@ -0,0 +1,177 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/am_with_mpatrol.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AM_WITH_MPATROL(DEFAULT)
+#
+# DESCRIPTION
+#
+# Integrates the mpatrol malloc debugging library into a new or existing
+# project and also attempts to determine the support libraries that need
+# to be linked in when libmpatrol is used.
+#
+# It takes one optional parameter specifying whether mpatrol should be
+# included in the project (`yes') or not (`no'). This can also be
+# specified as `threads' if you wish to use the threadsafe version of the
+# mpatrol library. You can override the value of the optional parameter
+# with the `--with-mpatrol' option to the resulting `configure' shell
+# script.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Graeme S. Roy <graeme@epc.co.uk>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AM_WITH_MPATROL], [
+ # Firstly, determine if the mpatrol library should be used.
+
+ AC_MSG_CHECKING(if mpatrol should be used)
+ AC_ARG_WITH(mpatrol,
+ [ --with-mpatrol build with the mpatrol library],
+ [case "$withval" in
+ threads)
+ am_with_mpatrol=1
+ am_with_mpatrol_threads=1;;
+ yes)
+ am_with_mpatrol=1
+ am_with_mpatrol_threads=0;;
+ no)
+ am_with_mpatrol=0
+ am_with_mpatrol_threads=0;;
+ *)
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR(invalid value $withval for --with-mpatrol);;
+ esac
+ ],
+ [if test "x[$1]" = x
+ then
+ am_with_mpatrol=0
+ am_with_mpatrol_threads=0
+ elif test "[$1]" = no
+ then
+ am_with_mpatrol=0
+ am_with_mpatrol_threads=0
+ elif test "[$1]" = yes
+ then
+ am_with_mpatrol=1
+ am_with_mpatrol_threads=0
+ elif test "[$1]" = threads
+ then
+ am_with_mpatrol=1
+ am_with_mpatrol_threads=1
+ else
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR(invalid argument [$1])
+ fi
+ ]
+ )
+
+ if test "$am_with_mpatrol" = 1
+ then
+ AC_MSG_RESULT(yes)
+
+ # Next, determine which support libraries are available on this
+ # system. If we don't do this here then we can't link later with
+ # the mpatrol library to perform any further tests.
+
+ am_with_mpatrol_libs=""
+ AC_CHECK_LIB(ld, ldopen,
+ am_with_mpatrol_libs="$am_with_mpatrol_libs -lld")
+ AC_CHECK_LIB(elf, elf_begin,
+ am_with_mpatrol_libs="$am_with_mpatrol_libs -lelf")
+ AC_CHECK_LIB(bfd, bfd_init,
+ am_with_mpatrol_libs="$am_with_mpatrol_libs -lbfd -liberty", ,
+ -liberty)
+ AC_CHECK_LIB(imagehlp, SymInitialize,
+ am_with_mpatrol_libs="$am_with_mpatrol_libs -limagehlp")
+ AC_CHECK_LIB(cl, U_get_previous_frame,
+ am_with_mpatrol_libs="$am_with_mpatrol_libs -lcl")
+ AC_CHECK_LIB(exc, unwind,
+ am_with_mpatrol_libs="$am_with_mpatrol_libs -lexc")
+
+ # Now determine which libraries really need to be linked in with
+ # the version of libmpatrol that is on this system. For example,
+ # if the system has libelf and libbfd, we need to determine which
+ # of these, if any, libmpatrol was built with support for.
+
+ am_with_mpatrol_libs2=""
+ AC_CHECK_LIB(mpatrol, __mp_libld,
+ am_with_mpatrol_libs2="$am_with_mpatrol_libs2 -lld", ,
+ $am_with_mpatrol_libs)
+ AC_CHECK_LIB(mpatrol, __mp_libelf,
+ am_with_mpatrol_libs2="$am_with_mpatrol_libs2 -lelf", ,
+ $am_with_mpatrol_libs)
+ AC_CHECK_LIB(mpatrol, __mp_libbfd,
+ am_with_mpatrol_libs2="$am_with_mpatrol_libs2 -lbfd -liberty", ,
+ $am_with_mpatrol_libs)
+ AC_CHECK_LIB(mpatrol, __mp_libimagehlp,
+ am_with_mpatrol_libs2="$am_with_mpatrol_libs2 -limagehlp", ,
+ $am_with_mpatrol_libs)
+ AC_CHECK_LIB(mpatrol, __mp_libcl,
+ am_with_mpatrol_libs2="$am_with_mpatrol_libs2 -lcl", ,
+ $am_with_mpatrol_libs)
+ AC_CHECK_LIB(mpatrol, __mp_libexc,
+ am_with_mpatrol_libs2="$am_with_mpatrol_libs2 -lexc", ,
+ $am_with_mpatrol_libs)
+
+ # If we are using the threadsafe mpatrol library then we may also need
+ # to link in the threads library. We check blindly for pthreads here
+ # even if we don't need them (in which case it doesn't matter) since
+ # the threads libraries are linked in by default on AmigaOS, Windows
+ # and Netware and it is only UNIX systems that we need to worry about.
+
+ if test "$am_with_mpatrol_threads" = 1
+ then
+ AC_CHECK_LIB(pthread, pthread_mutex_init,
+ am_with_mpatrol_libs2="$am_with_mpatrol_libs2 -lpthread", [
+ AC_CHECK_LIB(pthreads, pthread_mutex_init,
+ am_with_mpatrol_libs2="$am_with_mpatrol_libs2 -lpthreads", [
+ AC_CHECK_LIB(thread, pthread_mutex_init,
+ am_with_mpatrol_libs2="$am_with_mpatrol_libs2 -lthread")
+ ]
+ )
+ ]
+ )
+ fi
+
+ # We now know what libraries to use in order to link with libmpatrol.
+
+ AC_DEFINE(HAVE_MPATROL, 1, [Define if using mpatrol])
+ if test "$am_with_mpatrol_threads" = 1
+ then
+ LIBS="-lmpatrolmt $am_with_mpatrol_libs2 $LIBS"
+ else
+ LIBS="-lmpatrol $am_with_mpatrol_libs2 $LIBS"
+ fi
+
+ # Finally, verify that mpatrol is correctly installed and that we can
+ # link a simple program with it.
+
+ AC_CACHE_CHECK(for working mpatrol, am_cv_with_mpatrol, [
+ AC_TRY_LINK([#include <mpatrol.h>], [
+int main(void)
+{
+ malloc(4);
+ return EXIT_SUCCESS;
+}
+],
+ [am_cv_with_mpatrol=yes],
+ [am_cv_with_mpatrol=no]
+ )
+ ]
+ )
+
+ if test "$am_cv_with_mpatrol" = no
+ then
+ AC_MSG_ERROR(mpatrol not installed correctly)
+ fi
+ else
+ AC_MSG_RESULT(no)
+ fi
+ ]
+)
diff --git a/m4/ax_ac_append_to_file.m4 b/m4/ax_ac_append_to_file.m4
new file mode 100644
index 0000000..083d97e
--- /dev/null
+++ b/m4/ax_ac_append_to_file.m4
@@ -0,0 +1,29 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_ac_append_to_file.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_AC_APPEND_TO_FILE([FILE],[DATA])
+#
+# DESCRIPTION
+#
+# Appends the specified data to the specified Autoconf is run. If you want
+# to append to a file when configure is run use AX_APPEND_TO_FILE instead.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_AC_APPEND_TO_FILE],[
+AC_REQUIRE([AX_FILE_ESCAPES])
+m4_esyscmd(
+AX_FILE_ESCAPES
+[
+printf "$2" >> "$1"
+])
+])
diff --git a/m4/ax_ac_print_to_file.m4 b/m4/ax_ac_print_to_file.m4
new file mode 100644
index 0000000..266f05d
--- /dev/null
+++ b/m4/ax_ac_print_to_file.m4
@@ -0,0 +1,29 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_ac_print_to_file.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_AC_PRINT_TO_FILE([FILE],[DATA])
+#
+# DESCRIPTION
+#
+# Writes the specified data to the specified file when Autoconf is is run.
+# If you want to print to a file when configure is run use
+# AX_PRINT_TO_FILE instead.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_AC_PRINT_TO_FILE],[
+m4_esyscmd(
+AC_REQUIRE([AX_FILE_ESCAPES])
+[
+printf "$2" > "$1"
+])
+])
diff --git a/m4/ax_add_am_macro.m4 b/m4/ax_add_am_macro.m4
new file mode 100644
index 0000000..defc051
--- /dev/null
+++ b/m4/ax_add_am_macro.m4
@@ -0,0 +1,26 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_add_am_macro.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_ADD_AM_MACRO([RULE])
+#
+# DESCRIPTION
+#
+# Adds the specified rule to $AMINCLUDE. This macro will only work
+# properly with implementations of Make which allow include statements.
+# See also AX_ADD_AM_MACRO_STATIC.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_ADD_AM_MACRO],[
+ AC_REQUIRE([AX_AM_MACROS])
+ AX_APPEND_TO_FILE([$AMINCLUDE],[$1])
+])
diff --git a/m4/ax_add_am_macro_static.m4 b/m4/ax_add_am_macro_static.m4
new file mode 100644
index 0000000..91d8d23
--- /dev/null
+++ b/m4/ax_add_am_macro_static.m4
@@ -0,0 +1,25 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_add_am_macro_static.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_ADD_AM_MACRO_STATIC([RULE])
+#
+# DESCRIPTION
+#
+# Adds the specified rule to $AMINCLUDE.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+# Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_ADD_AM_MACRO_STATIC],[
+ AC_REQUIRE([AX_AM_MACROS_STATIC])
+ AX_AC_APPEND_TO_FILE(AMINCLUDE_STATIC,[$1])
+])
diff --git a/m4/ax_add_am_trilinos_makefile_export.m4 b/m4/ax_add_am_trilinos_makefile_export.m4
new file mode 100644
index 0000000..768c7ee
--- /dev/null
+++ b/m4/ax_add_am_trilinos_makefile_export.m4
@@ -0,0 +1,47 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_add_am_trilinos_makefile_export.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT(EXPORT_SUFFIX [, ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# Checks if a file named <Makefile.export.EXPORT_SUFFIX> appears in the
+# $TRILINOS_INCLUDE directory. If so, adds an include for it using the
+# AX_AM_MACROS framework.
+#
+# If ACTION-IF-NOT-FOUND is not provided, configure fails.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT],[
+AC_REQUIRE([AX_TRILINOS_BASE])
+AC_REQUIRE([AX_AM_MACROS])
+
+AC_CACHE_CHECK(
+ [for file ${TRILINOS_INCLUDE}/Makefile.export.$1],
+ [ax_cv_add_am_trilinos_makefile_export_]translit($1,[. ],[_])[_exists],
+ [[ax_cv_add_am_trilinos_makefile_export_]translit($1,[. ],[_])[_exists]=no
+ test -f "${TRILINOS_INCLUDE}/Makefile.export.$1" && dnl
+ [ax_cv_add_am_trilinos_makefile_export_]translit($1,[. ],[_])[_exists]=yes])
+
+if test "${[ax_cv_add_am_trilinos_makefile_export_]translit($1,[. ],[_])[_exists]}" = "yes"
+then
+AX_ADD_AM_MACRO([
+include ${TRILINOS_INCLUDE}/Makefile.export.$1
+])
+else
+ ifelse([$2],,AC_MSG_ERROR([Could not find ${TRILINOS_INCLUDE}/Makefile.export.$1. Was Trilinos compiled with --enable-export-makefiles?]),[
+ AC_MSG_WARN([Could not find ${TRILINOS_INCLUDE}/Makefile.export.$1. Was Trilinos compiled with --enable-export-makefiles?])
+ $2])
+fi
+
+])
diff --git a/m4/ax_add_recursive_am_macro.m4 b/m4/ax_add_recursive_am_macro.m4
new file mode 100644
index 0000000..42daf4a
--- /dev/null
+++ b/m4/ax_add_recursive_am_macro.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_add_recursive_am_macro.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_ADD_RECURSIVE_AM_MACRO([TARGET],[RULE])
+#
+# DESCRIPTION
+#
+# Adds the specified rule to $AMINCLUDE along with a TARGET-recursive rule
+# that will call TARGET for the current directory and TARGET-am
+# recursively for each subdirectory. See also
+# AX_ADD_RECURSIVE_AM_MACRO_STATIC.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_ADD_RECURSIVE_AM_MACRO],[
+ AX_ADD_AM_MACRO([
+$1-recursive:
+ @set fnord ${AX_DOLLAR}${AX_DOLLAR}MAKEFLAGS; amf=${AX_DOLLAR}${AX_DOLLAR}2; \\
+ dot_seen=no; \\
+ list='${AX_DOLLAR}(SUBDIRS)'; for subdir in ${AX_DOLLAR}${AX_DOLLAR}list; do \\
+ echo \"Making $1 in ${AX_DOLLAR}${AX_DOLLAR}subdir\"; \\
+ if test \"${AX_DOLLAR}${AX_DOLLAR}subdir\" = \".\"; then \\
+ dot_seen=yes; \\
+ local_target=\"$1-am\"; \\
+ else \\
+ local_target=\"$1\"; \\
+ fi; \\
+ (cd ${AX_DOLLAR}${AX_DOLLAR}subdir && ${AX_DOLLAR}(MAKE) ${AX_DOLLAR}(AM_MAKEFLAGS) ${AX_DOLLAR}${AX_DOLLAR}local_target) \\
+ || case \"${AX_DOLLAR}${AX_DOLLAR}amf\" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\
+ done; \\
+ if test \"${AX_DOLLAR}${AX_DOLLAR}dot_seen\" = \"no\"; then \\
+ ${AX_DOLLAR}(MAKE) ${AX_DOLLAR}(AM_MAKEFLAGS) \"$1-am\" || exit 1; \\
+ fi; test -z \"${AX_DOLLAR}${AX_DOLLAR}fail\"
+
+$2
+])
+])
diff --git a/m4/ax_add_recursive_am_macro_static.m4 b/m4/ax_add_recursive_am_macro_static.m4
new file mode 100644
index 0000000..cd7f77d
--- /dev/null
+++ b/m4/ax_add_recursive_am_macro_static.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_add_recursive_am_macro_static.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_ADD_RECURSIVE_AM_MACRO_STATIC([TARGET],[RULE])
+#
+# DESCRIPTION
+#
+# Adds the specified rule to AMINCLUDE_STATIC along with a
+# TARGET-recursive rule that will call TARGET for the current directory
+# and TARGET-am recursively for each subdirectory.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+# Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_ADD_RECURSIVE_AM_MACRO_STATIC],[
+ AX_ADD_AM_MACRO_STATIC([
+$1-recursive:
+ @set fnord ${AX_DOLLAR}${AX_DOLLAR}MAKEFLAGS; amf=${AX_DOLLAR}${AX_DOLLAR}2; \\
+ dot_seen=no; \\
+ list='${AX_DOLLAR}(SUBDIRS)'; for subdir in ${AX_DOLLAR}${AX_DOLLAR}list; do \\
+ echo \"Making $1 in ${AX_DOLLAR}${AX_DOLLAR}subdir\"; \\
+ if test \"${AX_DOLLAR}${AX_DOLLAR}subdir\" = \".\"; then \\
+ dot_seen=yes; \\
+ local_target=\"$1-am\"; \\
+ else \\
+ local_target=\"$1\"; \\
+ fi; \\
+ (cd ${AX_DOLLAR}${AX_DOLLAR}subdir && ${AX_DOLLAR}(MAKE) ${AX_DOLLAR}(AM_MAKEFLAGS) ${AX_DOLLAR}${AX_DOLLAR}local_target) \\
+ || case \"${AX_DOLLAR}${AX_DOLLAR}amf\" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\
+ done; \\
+ if test \"${AX_DOLLAR}${AX_DOLLAR}dot_seen\" = \"no\"; then \\
+ ${AX_DOLLAR}(MAKE) ${AX_DOLLAR}(AM_MAKEFLAGS) \"$1-am\" || exit 1; \\
+ fi; test -z \"${AX_DOLLAR}${AX_DOLLAR}fail\"
+
+$2
+])
+])
diff --git a/m4/ax_am_jobserver.m4 b/m4/ax_am_jobserver.m4
new file mode 100644
index 0000000..2458c51
--- /dev/null
+++ b/m4/ax_am_jobserver.m4
@@ -0,0 +1,52 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_am_jobserver.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_AM_JOBSERVER([default_value])
+#
+# DESCRIPTION
+#
+# Enables the use of make's jobserver for the purpose of parallel building
+# by passing the -j option to make.
+#
+# The option --enable-jobserver is added to configure which can accept a
+# yes, no, or an integer. The integer is the number of separate jobs to
+# allow. If 'yes' is given, then the is assumed to be one more than the
+# number of CPUs (determined through AX_COUNT_CPUS). If the value of no is
+# given, then the jobserver is disabled. The default value is given by the
+# first argument of the macro, or 'yes' if the argument is omitted.
+#
+# This macro makes use of AX_AM_MACROS, so you must add the following line
+#
+# @INC_AMINCLUDE@
+#
+# to your Makefile.am files.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Michael Paul Bailey <jinxidoru@byu.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_AM_JOBSERVER], [
+ AC_REQUIRE([AX_COUNT_CPUS])
+ AC_REQUIRE([AX_AM_MACROS])
+ AC_ARG_ENABLE( jobserver,
+ [ --enable-jobserver@<:@=no/yes/@%:@@:>@ default=m4_ifval([$1],[$1],[yes])
+ Enable up to @%:@ make jobs
+ yes: enable one more than CPU count
+ ],, [enable_jobserver=m4_ifval([$1],[$1],[yes])])
+ if test "x$enable_jobserver" = "xyes"; then
+ enable_jobserver=$CPU_COUNT
+ ((enable_jobserver++))
+ fi
+ m4_pattern_allow(AM_MAKEFLAGS)
+ if test "x$enable_jobserver" != "xno"; then
+ AC_MSG_NOTICE([added jobserver support to make for $enable_jobserver jobs])
+ AX_ADD_AM_MACRO( AM_MAKEFLAGS += -j$enable_jobserver )
+ fi
+])
diff --git a/m4/ax_am_macros.m4 b/m4/ax_am_macros.m4
new file mode 100644
index 0000000..c38a9b8
--- /dev/null
+++ b/m4/ax_am_macros.m4
@@ -0,0 +1,41 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_am_macros.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_AM_MACROS
+#
+# DESCRIPTION
+#
+# Adds support for macros that create Make rules. You must manually add
+# the following line
+#
+# @INC_AMINCLUDE@
+#
+# to your Makefile.in (or Makefile.am if you use Automake) files.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_AM_MACROS],
+[
+AC_MSG_NOTICE([adding automake macro support])
+AMINCLUDE="aminclude.am"
+AC_SUBST(AMINCLUDE)
+AC_MSG_NOTICE([creating $AMINCLUDE])
+AMINCLUDE_TIME=`date`
+AX_PRINT_TO_FILE([$AMINCLUDE],[[
+# generated automatically by configure from AX_AUTOMAKE_MACROS
+# on $AMINCLUDE_TIME
+
+]])
+
+INC_AMINCLUDE="include \$(top_builddir)/$AMINCLUDE"
+AC_SUBST(INC_AMINCLUDE)
+])
diff --git a/m4/ax_am_macros_static.m4 b/m4/ax_am_macros_static.m4
new file mode 100644
index 0000000..53def62
--- /dev/null
+++ b/m4/ax_am_macros_static.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_am_macros_static.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_AM_MACROS_STATIC
+#
+# DESCRIPTION
+#
+# Adds support for macros that create Automake rules. You must manually
+# add the following line
+#
+# include $(top_srcdir)/aminclude_static.am
+#
+# to your Makefile.am files.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+# Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AMINCLUDE_STATIC],[aminclude_static.am])
+
+AC_DEFUN([AX_AM_MACROS_STATIC],
+[
+AMINCLUDE_TIME=`date`
+AX_AC_PRINT_TO_FILE(AMINCLUDE_STATIC,[
+# generated automatically by Autoconf from AX_AUTOMAKE_MACROS_STATIC
+# on $AMINCLUDE_TIME
+
+])
+])
diff --git a/m4/ax_append_to_file.m4 b/m4/ax_append_to_file.m4
new file mode 100644
index 0000000..a76c5fa
--- /dev/null
+++ b/m4/ax_append_to_file.m4
@@ -0,0 +1,24 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_append_to_file.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_APPEND_TO_FILE([FILE],[DATA])
+#
+# DESCRIPTION
+#
+# Appends the specified data to the specified file.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_APPEND_TO_FILE],[
+AC_REQUIRE([AX_FILE_ESCAPES])
+printf "$2" >> "$1"
+])
diff --git a/m4/ax_auto_include_headers.m4 b/m4/ax_auto_include_headers.m4
new file mode 100644
index 0000000..36186a6
--- /dev/null
+++ b/m4/ax_auto_include_headers.m4
@@ -0,0 +1,60 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_auto_include_headers.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_AUTO_INCLUDE_HEADERS(INCLUDE-FILE ...)
+#
+# DESCRIPTION
+#
+# Given a space-separated list of INCLUDE-FILEs, AX_AUTO_INCLUDE_HEADERS
+# will output a conditional #include for each INCLUDE-FILE. The following
+# example demonstrates how AX_AUTO_INCLUDE_HEADERS's might be used in a
+# configure.ac script:
+#
+# AH_BOTTOM([
+# AX_AUTO_INCLUDE_HEADERS([sys/resource.h invent.h sys/sysinfo.h])dnl
+# ])
+#
+# The preceding invocation instructs autoheader to put the following code
+# at the bottom of the config.h file:
+#
+# #ifdef HAVE_SYS_RESOURCE_H
+# # include <sys/resource.h>
+# #endif
+# #ifdef HAVE_INVENT_H
+# # include <invent.h>
+# #endif
+# #ifdef HAVE_SYS_SYSINFO_H
+# # include <sys/sysinfo.h>
+# #endif
+#
+# Note that AX_AUTO_INCLUDE_HEADERS merely outputs #ifdef/#include/#endif
+# blocks. The configure.ac script still needs to invoke AC_CHECK_HEADERS
+# to #define the various HAVE_*_H preprocessor macros.
+#
+# Here's an easy way to get from config.h a complete list of header files
+# who existence is tested by the configure script:
+#
+# cat config.h | perl -ane '/ HAVE_\S+_H / && do {$_=$F[$#F-1]; s/^HAVE_//; s/_H/.h/; s|_|/|g; tr/A-Z/a-z/; print "$_ "}'
+#
+# You can then manually edit the resulting list and incorporate it into
+# one or more calls to AX_AUTO_INCLUDE_HEADERS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Scott Pakin <pakin@uiuc.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_AUTO_INCLUDE_HEADERS], [dnl
+AC_FOREACH([AX_Header], [$1], [dnl
+m4_pushdef([AX_IfDef], AS_TR_CPP(HAVE_[]AX_Header))dnl
+[#]ifdef AX_IfDef
+[#] include <AX_Header>
+[#]endif
+m4_popdef([AX_IfDef])dnl
+])])
diff --git a/m4/ax_boost_asio.m4 b/m4/ax_boost_asio.m4
new file mode 100644
index 0000000..e470952
--- /dev/null
+++ b/m4/ax_boost_asio.m4
@@ -0,0 +1,105 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_asio.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_ASIO
+#
+# DESCRIPTION
+#
+# Test for Asio library from the Boost C++ libraries. The macro requires a
+# preceding call to AX_BOOST_BASE. Further documentation is available at
+# <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_ASIO_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_ASIO
+#
+# LICENSE
+#
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+# Copyright (c) 2008 Pete Greenwell <pete@mu.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_ASIO],
+[
+ AC_ARG_WITH([boost-asio],
+ AS_HELP_STRING([--with-boost-asio@<:@=special-lib@:>@],
+ [use the ASIO library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-asio=boost_system-gcc41-mt-1_34 ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_asio_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_asio_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::ASIO library is available,
+ ax_cv_boost_asio,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ @%:@include <boost/asio.hpp>
+ ]],
+ [[
+
+ boost::asio::io_service io;
+ boost::system::error_code timer_result;
+ boost::asio::deadline_timer t(io);
+ t.cancel();
+ io.run_one();
+ return 0;
+ ]]),
+ ax_cv_boost_asio=yes, ax_cv_boost_asio=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_asio" = "xyes"; then
+ AC_DEFINE(HAVE_BOOST_ASIO,,[define if the Boost::ASIO library is available])
+ BN=boost_system
+ if test "x$ax_boost_user_asio_lib" = "x"; then
+ for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \
+ lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \
+ $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do
+ AC_CHECK_LIB($ax_lib, main, [BOOST_ASIO_LIB="-l$ax_lib" AC_SUBST(BOOST_ASIO_LIB) link_thread="yes" break],
+ [link_thread="no"])
+ done
+ else
+ for ax_lib in $ax_boost_user_asio_lib $BN-$ax_boost_user_asio_lib; do
+ AC_CHECK_LIB($ax_lib, main,
+ [BOOST_ASIO_LIB="-l$ax_lib" AC_SUBST(BOOST_ASIO_LIB) link_asio="yes" break],
+ [link_asio="no"])
+ done
+
+ fi
+ if test "x$link_asio" = "xno"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/m4/ax_boost_base.m4 b/m4/ax_boost_base.m4
new file mode 100644
index 0000000..e1504ba
--- /dev/null
+++ b/m4/ax_boost_base.m4
@@ -0,0 +1,219 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_base.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_BASE([MINIMUM-VERSION])
+#
+# DESCRIPTION
+#
+# Test for the Boost C++ libraries of a particular version (or newer)
+#
+# If no path to the installed boost library is given the macro searchs
+# under /usr, /usr/local, /opt and /opt/local and evaluates the
+# $BOOST_ROOT environment variable. Further documentation is available at
+# <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
+#
+# And sets:
+#
+# HAVE_BOOST
+#
+# LICENSE
+#
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_BASE],
+[
+AC_ARG_WITH([boost],
+ AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is yes) - it is possible to specify the root directory for boost (optional)]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ac_boost_path=""
+ else
+ want_boost="yes"
+ ac_boost_path="$withval"
+ fi
+ ],
+ [want_boost="yes"])
+
+
+AC_ARG_WITH([boost-libdir],
+ AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
+ [Force given directory for boost libraries. Note that this will overwrite library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
+ [
+ if test -d $withval
+ then
+ ac_boost_lib_path="$withval"
+ else
+ AC_MSG_ERROR(--with-boost-libdir expected directory name)
+ fi
+ ],
+ [ac_boost_lib_path=""]
+)
+
+if test "x$want_boost" = "xyes"; then
+ boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
+ boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
+ boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
+ boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
+ boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test "x$boost_lib_version_req_sub_minor" = "x" ; then
+ boost_lib_version_req_sub_minor="0"
+ fi
+ WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
+ AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
+ succeeded=no
+
+ dnl first we check the system location for boost libraries
+ dnl this location ist chosen if boost libraries are installed with the --layout=system option
+ dnl or if you install boost with RPM
+ if test "$ac_boost_path" != ""; then
+ BOOST_LDFLAGS="-L$ac_boost_path/lib"
+ BOOST_CPPFLAGS="-I$ac_boost_path/include"
+ else
+ for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
+ if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
+ BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
+ BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
+ break;
+ fi
+ done
+ fi
+
+ dnl overwrite ld flags if we have required special directory with
+ dnl --with-boost-libdir parameter
+ if test "$ac_boost_lib_path" != ""; then
+ BOOST_LDFLAGS="-L$ac_boost_lib_path"
+ fi
+
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ @%:@include <boost/version.hpp>
+ ]], [[
+ #if BOOST_VERSION >= $WANT_BOOST_VERSION
+ // Everything is okay
+ #else
+ # error Boost version is too old
+ #endif
+ ]])],[
+ AC_MSG_RESULT(yes)
+ succeeded=yes
+ found_system=yes
+ ],[
+ ])
+ AC_LANG_POP([C++])
+
+
+
+ dnl if we found no boost with system layout we search for boost libraries
+ dnl built and installed without the --layout=system option or for a staged(not installed) version
+ if test "x$succeeded" != "xyes"; then
+ _version=0
+ if test "$ac_boost_path" != ""; then
+ if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
+ for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
+ _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
+ V_CHECK=`expr $_version_tmp \> $_version`
+ if test "$V_CHECK" = "1" ; then
+ _version=$_version_tmp
+ fi
+ VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
+ BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
+ done
+ fi
+ else
+ for ac_boost_path in /usr /usr/local /opt /opt/local ; do
+ if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
+ for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
+ _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
+ V_CHECK=`expr $_version_tmp \> $_version`
+ if test "$V_CHECK" = "1" ; then
+ _version=$_version_tmp
+ best_path=$ac_boost_path
+ fi
+ done
+ fi
+ done
+
+ VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
+ BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
+ if test "$ac_boost_lib_path" = ""
+ then
+ BOOST_LDFLAGS="-L$best_path/lib"
+ fi
+
+ if test "x$BOOST_ROOT" != "x"; then
+ if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then
+ version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
+ stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
+ stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
+ V_CHECK=`expr $stage_version_shorten \>\= $_version`
+ if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
+ AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
+ BOOST_CPPFLAGS="-I$BOOST_ROOT"
+ BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib"
+ fi
+ fi
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ @%:@include <boost/version.hpp>
+ ]], [[
+ #if BOOST_VERSION >= $WANT_BOOST_VERSION
+ // Everything is okay
+ #else
+ # error Boost version is too old
+ #endif
+ ]])],[
+ AC_MSG_RESULT(yes)
+ succeeded=yes
+ found_system=yes
+ ],[
+ ])
+ AC_LANG_POP([C++])
+ fi
+
+ if test "$succeeded" != "yes" ; then
+ if test "$_version" = "0" ; then
+ AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
+ else
+ AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
+ fi
+ else
+ AC_SUBST(BOOST_CPPFLAGS)
+ AC_SUBST(BOOST_LDFLAGS)
+ AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+fi
+
+])
diff --git a/m4/ax_boost_date_time.m4 b/m4/ax_boost_date_time.m4
new file mode 100644
index 0000000..5dd9f39
--- /dev/null
+++ b/m4/ax_boost_date_time.m4
@@ -0,0 +1,107 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_date_time.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_DATE_TIME
+#
+# DESCRIPTION
+#
+# Test for Date_Time library from the Boost C++ libraries. The macro
+# requires a preceding call to AX_BOOST_BASE. Further documentation is
+# available at <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_DATE_TIME_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_DATE_TIME
+#
+# LICENSE
+#
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+# Copyright (c) 2008 Michael Tindal
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_DATE_TIME],
+[
+ AC_ARG_WITH([boost-date-time],
+ AS_HELP_STRING([--with-boost-date-time@<:@=special-lib@:>@],
+ [use the Date_Time library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-date-time=boost_date_time-gcc-mt-d-1_33_1 ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_date_time_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_date_time_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::Date_Time library is available,
+ ax_cv_boost_date_time,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/date_time/gregorian/gregorian_types.hpp>]],
+ [[using namespace boost::gregorian; date d(2002,Jan,10);
+ return 0;
+ ]]),
+ ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_date_time" = "xyes"; then
+ AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ if test "x$ax_boost_user_date_time_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_date_time*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_date_time.*\)\.so.*$;\1;' -e 's;^lib\(boost_date_time.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
+ [link_date_time="no"])
+ done
+ if test "x$link_date_time" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_date_time*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_date_time.*\)\.dll.*$;\1;' -e 's;^\(boost_date_time.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
+ [link_date_time="no"])
+ done
+ fi
+
+ else
+ for ax_lib in $ax_boost_user_date_time_lib boost_date_time-$ax_boost_user_date_time_lib; do
+ AC_CHECK_LIB($ax_lib, main,
+ [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
+ [link_date_time="no"])
+ done
+
+ fi
+ if test "x$link_date_time" != "xyes"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/m4/ax_boost_filesystem.m4 b/m4/ax_boost_filesystem.m4
new file mode 100644
index 0000000..d5f33f0
--- /dev/null
+++ b/m4/ax_boost_filesystem.m4
@@ -0,0 +1,112 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_filesystem.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_FILESYSTEM
+#
+# DESCRIPTION
+#
+# Test for Filesystem library from the Boost C++ libraries. The macro
+# requires a preceding call to AX_BOOST_BASE. Further documentation is
+# available at <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_FILESYSTEM_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_FILESYSTEM
+#
+# LICENSE
+#
+# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
+# Copyright (c) 2009 Michael Tindal
+# Copyright (c) 2009 Roman Rybalko <libtorrent@romanr.info>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_FILESYSTEM],
+[
+ AC_ARG_WITH([boost-filesystem],
+ AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@],
+ [use the Filesystem library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_filesystem_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_filesystem_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ LIBS_SAVED=$LIBS
+ LIBS="$LIBS $BOOST_SYSTEM_LIB"
+ export LIBS
+
+ AC_CACHE_CHECK(whether the Boost::Filesystem library is available,
+ ax_cv_boost_filesystem,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/filesystem/path.hpp>]],
+ [[using namespace boost::filesystem;
+ path my_path( "foo/bar/data.txt" );
+ return 0;]]),
+ ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_filesystem" = "xyes"; then
+ AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ if test "x$ax_boost_user_filesystem_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_filesystem*.{so,dylib,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_filesystem.*\)\.so.*$;\1;' -e 's;^lib\(boost_filesystem.*\)\.a*$;\1;' -e 's;^lib\(boost_filesystem.*\)\.dylib$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
+ [link_filesystem="no"])
+ done
+ if test "x$link_program_options" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_filesystem*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_filesystem.*\)\.dll.*$;\1;' -e 's;^\(boost_filesystem.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
+ [link_filesystem="no"])
+ done
+ fi
+ else
+ for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
+ [link_filesystem="no"])
+ done
+
+ fi
+ if test "x$link_filesystem" != "xyes"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ LIBS="$LIBS_SAVED"
+ fi
+])
diff --git a/m4/ax_boost_iostreams.m4 b/m4/ax_boost_iostreams.m4
new file mode 100644
index 0000000..b3088ed
--- /dev/null
+++ b/m4/ax_boost_iostreams.m4
@@ -0,0 +1,110 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_iostreams.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_IOSTREAMS
+#
+# DESCRIPTION
+#
+# Test for IOStreams library from the Boost C++ libraries. The macro
+# requires a preceding call to AX_BOOST_BASE. Further documentation is
+# available at <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_IOSTREAMS_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_IOSTREAMS
+#
+# LICENSE
+#
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_IOSTREAMS],
+[
+ AC_ARG_WITH([boost-iostreams],
+ AS_HELP_STRING([--with-boost-iostreams@<:@=special-lib@:>@],
+ [use the IOStreams library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-iostreams=boost_iostreams-gcc-mt-d-1_33_1 ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_iostreams_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_iostreams_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::IOStreams library is available,
+ ax_cv_boost_iostreams,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/iostreams/filtering_stream.hpp>
+ @%:@include <boost/range/iterator_range.hpp>
+ ]],
+ [[std::string input = "Hello World!";
+ namespace io = boost::iostreams;
+ io::filtering_istream in(boost::make_iterator_range(input));
+ return 0;
+ ]]),
+ ax_cv_boost_iostreams=yes, ax_cv_boost_iostreams=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_iostreams" = "xyes"; then
+ AC_DEFINE(HAVE_BOOST_IOSTREAMS,,[define if the Boost::IOStreams library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ if test "x$ax_boost_user_iostreams_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_iostreams*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_iostreams.*\)\.so.*$;\1;' -e 's;^lib\(boost_iostreams.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
+ [link_iostreams="no"])
+ done
+ if test "x$link_iostreams" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_iostreams*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_iostreams.*\)\.dll.*$;\1;' -e 's;^\(boost_iostreams.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
+ [link_iostreams="no"])
+ done
+ fi
+
+ else
+ for ax_lib in $ax_boost_user_iostreams_lib boost_iostreams-$ax_boost_user_iostreams_lib; do
+ AC_CHECK_LIB($ax_lib, main,
+ [BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
+ [link_iostreams="no"])
+ done
+
+ fi
+ if test "x$link_iostreams" != "xyes"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/m4/ax_boost_program_options.m4 b/m4/ax_boost_program_options.m4
new file mode 100644
index 0000000..bf5918b
--- /dev/null
+++ b/m4/ax_boost_program_options.m4
@@ -0,0 +1,102 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_program_options.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_PROGRAM_OPTIONS
+#
+# DESCRIPTION
+#
+# Test for program options library from the Boost C++ libraries. The macro
+# requires a preceding call to AX_BOOST_BASE. Further documentation is
+# available at <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_PROGRAM_OPTIONS
+#
+# LICENSE
+#
+# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
+[
+ AC_ARG_WITH([boost-program-options],
+ AS_HELP_STRING([--with-boost-program-options@<:@=special-lib@:>@],
+ [use the program options library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-program-options=boost_program_options-gcc-mt-1_33_1 ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_program_options_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_program_options_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ export want_boost
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+ AC_CACHE_CHECK([whether the Boost::Program_Options library is available],
+ ax_cv_boost_program_options,
+ [AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/program_options.hpp>
+ ]],
+ [[boost::program_options::options_description generic("Generic options");
+ return 0;]]),
+ ax_cv_boost_program_options=yes, ax_cv_boost_program_options=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "$ax_cv_boost_program_options" = yes; then
+ AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ if test "x$ax_boost_user_program_options_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
+ [link_program_options="no"])
+ done
+ if test "x$link_program_options" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
+ [link_program_options="no"])
+ done
+ fi
+ else
+ for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do
+ AC_CHECK_LIB($ax_lib, main,
+ [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
+ [link_program_options="no"])
+ done
+ fi
+ if test "x$link_program_options" != "xyes"; then
+ AC_MSG_ERROR([Could not link against [$ax_lib] !])
+ fi
+ fi
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/m4/ax_boost_python.m4 b/m4/ax_boost_python.m4
new file mode 100644
index 0000000..2c9b2ce
--- /dev/null
+++ b/m4/ax_boost_python.m4
@@ -0,0 +1,86 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_python.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_PYTHON
+#
+# DESCRIPTION
+#
+# This macro checks to see if the Boost.Python library is installed. It
+# also attempts to guess the currect library name using several attempts.
+# It tries to build the library name using a user supplied name or suffix
+# and then just the raw library.
+#
+# If the library is found, HAVE_BOOST_PYTHON is defined and
+# BOOST_PYTHON_LIB is set to the name of the library.
+#
+# This macro calls AC_SUBST(BOOST_PYTHON_LIB).
+#
+# In order to ensure that the Python headers are specified on the include
+# path, this macro requires AX_PYTHON to be called.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Michael Tindal
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_BOOST_PYTHON],
+[AC_REQUIRE([AX_PYTHON])dnl
+AC_CACHE_CHECK(whether the Boost::Python library is available,
+ac_cv_boost_python,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ CPPFLAGS_SAVE=$CPPFLAGS
+ if test x$PYTHON_INCLUDE_DIR != x; then
+ CPPFLAGS=-I$PYTHON_INCLUDE_DIR $CPPFLAGS
+ fi
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
+ #include <boost/python/module.hpp>
+ using namespace boost::python;
+ BOOST_PYTHON_MODULE(test) { throw "Boost::Python test."; }]],
+ [[return 0;]]),
+ ac_cv_boost_python=yes, ac_cv_boost_python=no)
+ AC_LANG_RESTORE
+ CPPFLAGS=$CPPFLAGS_SAVE
+])
+if test "$ac_cv_boost_python" = "yes"; then
+ AC_DEFINE(HAVE_BOOST_PYTHON,,[define if the Boost::Python library is available])
+ ax_python_lib=boost_python
+ AC_ARG_WITH([boost-python],AS_HELP_STRING([--with-boost-python],[specify the boost python library or suffix to use]),
+ [if test "x$with_boost_python" != "xno"; then
+ ax_python_lib=$with_boost_python
+ ax_boost_python_lib=boost_python-$with_boost_python
+ fi])
+ for ax_lib in $ax_python_lib $ax_boost_python_lib boost_python; do
+ AC_CHECK_LIB($ax_lib, exit, [BOOST_PYTHON_LIB=$ax_lib break])
+ done
+ AC_SUBST(BOOST_PYTHON_LIB)
+fi
+])dnl
diff --git a/m4/ax_boost_regex.m4 b/m4/ax_boost_regex.m4
new file mode 100644
index 0000000..a02fb3c
--- /dev/null
+++ b/m4/ax_boost_regex.m4
@@ -0,0 +1,105 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_regex.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_REGEX
+#
+# DESCRIPTION
+#
+# Test for Regex library from the Boost C++ libraries. The macro requires
+# a preceding call to AX_BOOST_BASE. Further documentation is available at
+# <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_REGEX_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_REGEX
+#
+# LICENSE
+#
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+# Copyright (c) 2008 Michael Tindal
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_REGEX],
+[
+ AC_ARG_WITH([boost-regex],
+ AS_HELP_STRING([--with-boost-regex@<:@=special-lib@:>@],
+ [use the Regex library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-regex=boost_regex-gcc-mt-d-1_33_1 ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_regex_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_regex_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::Regex library is available,
+ ax_cv_boost_regex,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/regex.hpp>
+ ]],
+ [[boost::regex r(); return 0;]]),
+ ax_cv_boost_regex=yes, ax_cv_boost_regex=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_regex" = "xyes"; then
+ AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ if test "x$ax_boost_user_regex_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_regex*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
+ [link_regex="no"])
+ done
+ if test "x$link_regex" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_regex*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_regex.*\)\.dll.*$;\1;' -e 's;^\(boost_regex.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
+ [link_regex="no"])
+ done
+ fi
+
+ else
+ for ax_lib in $ax_boost_user_regex_lib boost_regex-$ax_boost_user_regex_lib; do
+ AC_CHECK_LIB($ax_lib, main,
+ [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
+ [link_regex="no"])
+ done
+ fi
+ if test "x$link_regex" != "xyes"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/m4/ax_boost_serialization.m4 b/m4/ax_boost_serialization.m4
new file mode 100644
index 0000000..6010536
--- /dev/null
+++ b/m4/ax_boost_serialization.m4
@@ -0,0 +1,111 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_serialization.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_SERIALIZATION
+#
+# DESCRIPTION
+#
+# Test for Serialization library from the Boost C++ libraries. The macro
+# requires a preceding call to AX_BOOST_BASE. Further documentation is
+# available at <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_SERIALIZATION_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_SERIALIZATION
+#
+# LICENSE
+#
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_SERIALIZATION],
+[
+ AC_ARG_WITH([boost-serialization],
+ AS_HELP_STRING([--with-boost-serialization@<:@=special-lib@:>@],
+ [use the Serialization library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-serialization=boost_serialization-gcc-mt-d-1_33_1 ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_serialization_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_serialization_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ AC_MSG_WARN(BOOST_CPPFLAGS $BOOST_CPPFLAGS)
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::Serialization library is available,
+ ax_cv_boost_serialization,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <fstream>
+ @%:@include <boost/archive/text_oarchive.hpp>
+ @%:@include <boost/archive/text_iarchive.hpp>
+ ]],
+ [[std::ofstream ofs("filename");
+ boost::archive::text_oarchive oa(ofs);
+ return 0;
+ ]]),
+ ax_cv_boost_serialization=yes, ax_cv_boost_serialization=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_serialization" = "xyes"; then
+ AC_DEFINE(HAVE_BOOST_SERIALIZATION,,[define if the Boost::Serialization library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ if test "x$ax_boost_user_serialization_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_serialization*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_serialization.*\)\.so.*$;\1;' -e 's;^lib\(boost_serialization.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_SERIALIZATION_LIB="-l$ax_lib"; AC_SUBST(BOOST_SERIALIZATION_LIB) link_serialization="yes"; break],
+ [link_serialization="no"])
+ done
+ if test "x$link_serialization" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_serialization*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_serialization.*\)\.dll.*$;\1;' -e 's;^\(boost_serialization.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_SERIALIZATION_LIB="-l$ax_lib"; AC_SUBST(BOOST_SERIALIZATION_LIB) link_serialization="yes"; break],
+ [link_serialization="no"])
+ done
+ fi
+
+ else
+ for ax_lib in $ax_boost_user_serialization_lib boost_serialization-$ax_boost_user_serialization_lib; do
+ AC_CHECK_LIB($ax_lib, main,
+ [BOOST_SERIALIZATION_LIB="-l$ax_lib"; AC_SUBST(BOOST_SERIALIZATION_LIB) link_serialization="yes"; break],
+ [link_serialization="no"])
+ done
+
+ fi
+ if test "x$link_serialization" != "xyes"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/m4/ax_boost_signals.m4 b/m4/ax_boost_signals.m4
new file mode 100644
index 0000000..e4028a0
--- /dev/null
+++ b/m4/ax_boost_signals.m4
@@ -0,0 +1,108 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_signals.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_SIGNALS
+#
+# DESCRIPTION
+#
+# Test for Signals library from the Boost C++ libraries. The macro
+# requires a preceding call to AX_BOOST_BASE. Further documentation is
+# available at <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_SIGNALS_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_SIGNALS
+#
+# LICENSE
+#
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+# Copyright (c) 2008 Michael Tindal
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_SIGNALS],
+[
+ AC_ARG_WITH([boost-signals],
+ AS_HELP_STRING([--with-boost-signals@<:@=special-lib@:>@],
+ [use the Signals library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-signals=boost_signals-gcc-mt-d ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_signals_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_signals_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::Signals library is available,
+ ax_cv_boost_signals,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/signal.hpp>
+ ]],
+ [[boost::signal<void ()> sig;
+ return 0;
+ ]]),
+ ax_cv_boost_signals=yes, ax_cv_boost_signals=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_signals" = "xyes"; then
+ AC_DEFINE(HAVE_BOOST_SIGNALS,,[define if the Boost::Signals library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ if test "x$ax_boost_user_signals_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_signals*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_signals.*\)\.so.*$;\1;' -e 's;^lib\(boost_signals.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_SIGNALS_LIB="-l$ax_lib"; AC_SUBST(BOOST_SIGNALS_LIB) link_signals="yes"; break],
+ [link_signals="no"])
+ done
+ if test "x$link_signals" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_signals*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_signals.*\)\.dll.*$;\1;' -e 's;^\(boost_signals.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_SIGNALS_LIB="-l$ax_lib"; AC_SUBST(BOOST_SIGNALS_LIB) link_signals="yes"; break],
+ [link_signals="no"])
+ done
+ fi
+
+ else
+ for ax_lib in $ax_boost_user_signals_lib boost_signals-$ax_boost_user_signals_lib; do
+ AC_CHECK_LIB($ax_lib, main,
+ [BOOST_SIGNALS_LIB="-l$ax_lib"; AC_SUBST(BOOST_SIGNALS_LIB) link_signals="yes"; break],
+ [link_signals="no"])
+ done
+
+ fi
+ if test "x$link_signals" != "xyes"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/m4/ax_boost_system.m4 b/m4/ax_boost_system.m4
new file mode 100644
index 0000000..855ed93
--- /dev/null
+++ b/m4/ax_boost_system.m4
@@ -0,0 +1,114 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_system.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_SYSTEM
+#
+# DESCRIPTION
+#
+# Test for System library from the Boost C++ libraries. The macro requires
+# a preceding call to AX_BOOST_BASE. Further documentation is available at
+# <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_SYSTEM_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_SYSTEM
+#
+# LICENSE
+#
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+# Copyright (c) 2008 Michael Tindal
+# Copyright (c) 2008 Daniel Casimiro <dan.casimiro@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_SYSTEM],
+[
+ AC_ARG_WITH([boost-system],
+ AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@],
+ [use the System library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-system=boost_system-gcc-mt ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_system_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_system_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_BUILD])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::System library is available,
+ ax_cv_boost_system,
+ [AC_LANG_PUSH([C++])
+ CXXFLAGS_SAVE=$CXXFLAGS
+
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/system/error_code.hpp>]],
+ [[boost::system::system_category]]),
+ ax_cv_boost_system=yes, ax_cv_boost_system=no)
+ CXXFLAGS=$CXXFLAGS_SAVE
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_system" = "xyes"; then
+ AC_SUBST(BOOST_CPPFLAGS)
+
+ AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+
+ LDFLAGS_SAVE=$LDFLAGS
+ if test "x$ax_boost_user_system_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_system*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.so.*$;\1;' -e 's;^lib\(boost_system.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
+ [link_system="no"])
+ done
+ if test "x$link_system" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_system*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_system.*\)\.dll.*$;\1;' -e 's;^\(boost_system.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
+ [link_system="no"])
+ done
+ fi
+
+ else
+ for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
+ [link_system="no"])
+ done
+
+ fi
+ if test "x$link_system" = "xno"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/m4/ax_boost_test_exec_monitor.m4 b/m4/ax_boost_test_exec_monitor.m4
new file mode 100644
index 0000000..94ab0d8
--- /dev/null
+++ b/m4/ax_boost_test_exec_monitor.m4
@@ -0,0 +1,133 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_test_exec_monitor.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_TEST_EXEC_MONITOR
+#
+# DESCRIPTION
+#
+# Test for Test_Exec_Monitor library from the Boost C++ libraries. The
+# macro requires a preceding call to AX_BOOST_BASE. Further documentation
+# is available at <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_TEST_EXEC_MONITOR_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_TEST_EXEC_MONITOR
+#
+# LICENSE
+#
+# Copyright (c) 2008 Dodji Seketeli <dodji@seketeli.org>
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_TEST_EXEC_MONITOR],
+[
+ AC_ARG_WITH([boost-test-exec-monitor],
+ AS_HELP_STRING([--with-boost-test-exec-monitor@<:@=special-lib@:>@],
+ [use the Test_Exec_Monitor library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-test-exec-monitor=boost_test_exec_monitor-gcc ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_test_exec_monitor_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_test_exec_monitor_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::Test_Exec_Monitor library is available,
+ ax_cv_boost_test_exec_monitor,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/test/test_tools.hpp>]],
+ [[int i=1 ; BOOST_REQUIRE(i==1); ; return 0;]]),
+ ax_cv_boost_test_exec_monitor=yes, ax_cv_boost_test_exec_monitor=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_test_exec_monitor" = "xyes"; then
+ AC_DEFINE(HAVE_BOOST_TEST_EXEC_MONITOR,,[define if the Boost::Test_Exec_Monitor library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+
+ if test "x$ax_boost_user_test_exec_monitor_lib" = "x"; then
+ saved_ldflags="${LDFLAGS}"
+
+ for monitor_library in `ls $BOOSTLIBDIR/libboost_test_exec_monitor*.{so,a}* 2>/dev/null` ; do
+ if test -r $monitor_library ; then
+ libextension=`echo $monitor_library | sed 's,.*/,,' | sed -e 's;^lib\(boost_test_exec_monitor.*\)\.so.*$;\1;' -e 's;^lib\(boost_test_exec_monitor.*\)\.a*$;\1;'`
+ ax_lib=${libextension}
+ link_test_exec_monitor="yes"
+ else
+ link_test_exec_monitor="no"
+ fi
+
+ if test "x$link_test_exec_monitor" = "xyes"; then
+ BOOST_TEST_EXEC_MONITOR_LIB="-l$ax_lib"
+ AC_SUBST(BOOST_TEST_EXEC_MONITOR_LIB)
+ break
+ fi
+ done
+ if test "x$link_test_exec_monitor" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_test_exec_monitor*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_test_exec_monitor.*\)\.dll.*$;\1;' -e 's;^\(boost_test_exec_monitor.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_TEST_EXEC_MONITOR_LIB="-l$ax_lib"; AC_SUBST(BOOST_TEST_EXEC_MONITOR_LIB) link_test_exec_monitor="yes"; break],
+ [link_test_exec_monitor="no"])
+ done
+ fi
+
+ else
+ link_test_exec_monitor="no"
+ saved_ldflags="${LDFLAGS}"
+ for ax_lib in boost_test_exec_monitor-$ax_boost_user_test_exec_monitor_lib $ax_boost_user_test_exec_monitor_lib ; do
+ if test "x$link_test_exec_monitor" = "xyes"; then
+ break;
+ fi
+ for monitor_library in `ls $BOOSTLIBDIR/lib${ax_lib}.{so,a}* 2>/dev/null` ; do
+ if test -r $monitor_library ; then
+ libextension=`echo $monitor_library | sed 's,.*/,,' | sed -e 's;^lib\(boost_test_exec_monitor.*\)\.so.*$;\1;' -e 's;^lib\(boost_test_exec_monitor.*\)\.a*$;\1;'`
+ ax_lib=${libextension}
+ link_test_exec_monitor="yes"
+ else
+ link_test_exec_monitor="no"
+ fi
+
+ if test "x$link_test_exec_monitor" = "xyes"; then
+ BOOST_TEST_EXEC_MONITOR_LIB="-l$ax_lib"
+ AC_SUBST(BOOST_TEST_EXEC_MONITOR_LIB)
+ break
+ fi
+ done
+ done
+ fi
+ if test "x$link_test_exec_monitor" != "xyes"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/m4/ax_boost_thread.m4 b/m4/ax_boost_thread.m4
new file mode 100644
index 0000000..343ef84
--- /dev/null
+++ b/m4/ax_boost_thread.m4
@@ -0,0 +1,143 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_thread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_THREAD
+#
+# DESCRIPTION
+#
+# Test for Thread library from the Boost C++ libraries. The macro requires
+# a preceding call to AX_BOOST_BASE. Further documentation is available at
+# <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_THREAD_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_THREAD
+#
+# LICENSE
+#
+# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
+# Copyright (c) 2009 Michael Tindal
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_THREAD],
+[
+ AC_ARG_WITH([boost-thread],
+ AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@],
+ [use the Thread library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-thread=boost_thread-gcc-mt ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_thread_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_thread_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_BUILD])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::Thread library is available,
+ ax_cv_boost_thread,
+ [AC_LANG_PUSH([C++])
+ CXXFLAGS_SAVE=$CXXFLAGS
+
+ if test "x$build_os" = "xsolaris" ; then
+ CXXFLAGS="-pthreads $CXXFLAGS"
+ elif test "x$build_os" = "xming32" ; then
+ CXXFLAGS="-mthreads $CXXFLAGS"
+ else
+ CXXFLAGS="-pthread $CXXFLAGS"
+ fi
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/thread/thread.hpp>]],
+ [[boost::thread_group thrds;
+ return 0;]]),
+ ax_cv_boost_thread=yes, ax_cv_boost_thread=no)
+ CXXFLAGS=$CXXFLAGS_SAVE
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_thread" = "xyes"; then
+ if test "x$build_os" = "xsolaris" ; then
+ BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
+ elif test "x$build_os" = "xming32" ; then
+ BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
+ else
+ BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
+ fi
+
+ AC_SUBST(BOOST_CPPFLAGS)
+
+ AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+
+ LDFLAGS_SAVE=$LDFLAGS
+ case "x$build_os" in
+ *bsd* )
+ LDFLAGS="-pthread $LDFLAGS"
+ break;
+ ;;
+ esac
+ if test "x$ax_boost_user_thread_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_thread*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.a*$;\1;'`; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
+ [link_thread="no"])
+ done
+ if test "x$link_thread" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_thread*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
+ [link_thread="no"])
+ done
+ fi
+
+ else
+ for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
+ [link_thread="no"])
+ done
+
+ fi
+ if test "x$link_thread" = "xno"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ else
+ case "x$build_os" in
+ *bsd* )
+ BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS"
+ break;
+ ;;
+ esac
+
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/m4/ax_boost_unit_test_framework.m4 b/m4/ax_boost_unit_test_framework.m4
new file mode 100644
index 0000000..30d4b36
--- /dev/null
+++ b/m4/ax_boost_unit_test_framework.m4
@@ -0,0 +1,131 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_unit_test_framework.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_UNIT_TEST_FRAMEWORK
+#
+# DESCRIPTION
+#
+# Test for Unit_Test_Framework library from the Boost C++ libraries. The
+# macro requires a preceding call to AX_BOOST_BASE. Further documentation
+# is available at <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_UNIT_TEST_FRAMEWORK
+#
+# LICENSE
+#
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_UNIT_TEST_FRAMEWORK],
+[
+ AC_ARG_WITH([boost-unit-test-framework],
+ AS_HELP_STRING([--with-boost-unit-test-framework@<:@=special-lib@:>@],
+ [use the Unit_Test_Framework library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-unit-test-framework=boost_unit_test_framework-gcc ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_unit_test_framework_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_unit_test_framework_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::Unit_Test_Framework library is available,
+ ax_cv_boost_unit_test_framework,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/test/unit_test.hpp>]],
+ [[using boost::unit_test::test_suite;
+ test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" ); return 0;]]),
+ ax_cv_boost_unit_test_framework=yes, ax_cv_boost_unit_test_framework=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_unit_test_framework" = "xyes"; then
+ AC_DEFINE(HAVE_BOOST_UNIT_TEST_FRAMEWORK,,[define if the Boost::Unit_Test_Framework library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+
+ if test "x$ax_boost_user_unit_test_framework_lib" = "x"; then
+ saved_ldflags="${LDFLAGS}"
+ for monitor_library in `ls $BOOSTLIBDIR/libboost_unit_test_framework*.{so,a}* 2>/dev/null` ; do
+ if test -r $monitor_library ; then
+ libextension=`echo $monitor_library | sed 's,.*/,,' | sed -e 's;^lib\(boost_unit_test_framework.*\)\.so.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.a*$;\1;'`
+ ax_lib=${libextension}
+ link_unit_test_framework="yes"
+ else
+ link_unit_test_framework="no"
+ fi
+
+ if test "x$link_unit_test_framework" = "xyes"; then
+ BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib"
+ AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB)
+ break
+ fi
+ done
+ if test "x$link_unit_test_framework" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_unit_test_framework*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_unit_test_framework.*\)\.dll.*$;\1;' -e 's;^\(boost_unit_test_framework.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib"; AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) link_unit_test_framework="yes"; break],
+ [link_unit_test_framework="no"])
+ done
+ fi
+ else
+ link_unit_test_framework="no"
+ saved_ldflags="${LDFLAGS}"
+ for ax_lib in boost_unit_test_framework-$ax_boost_user_unit_test_framework_lib $ax_boost_user_unit_test_framework_lib ; do
+ if test "x$link_unit_test_framework" = "xyes"; then
+ break;
+ fi
+ for unittest_library in `ls $BOOSTLIBDIR/lib${ax_lib}.{so,a}* 2>/dev/null` ; do
+ if test -r $unittest_library ; then
+ libextension=`echo $unittest_library | sed 's,.*/,,' | sed -e 's;^lib\(boost_unit_test_framework.*\)\.so.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.a*$;\1;'`
+ ax_lib=${libextension}
+ link_unit_test_framework="yes"
+ else
+ link_unit_test_framework="no"
+ fi
+
+ if test "x$link_unit_test_framework" = "xyes"; then
+ BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib"
+ AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB)
+ break
+ fi
+ done
+ done
+ fi
+ if test "x$link_unit_test_framework" != "xyes"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/m4/ax_boost_wave.m4 b/m4/ax_boost_wave.m4
new file mode 100644
index 0000000..2c7af92
--- /dev/null
+++ b/m4/ax_boost_wave.m4
@@ -0,0 +1,121 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_wave.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_WAVE
+#
+# DESCRIPTION
+#
+# Test for Wave library from the Boost C++ libraries. The macro requires a
+# preceding call to AX_BOOST_BASE. Further documentation is available at
+# <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_WAVE_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_WAVE
+#
+# LICENSE
+#
+# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
+# Copyright (c) 2009 Michael Tindal
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_WAVE],
+[
+ AC_ARG_WITH([boost-wave],
+ AS_HELP_STRING([--with-boost-wave@<:@=special-lib@:>@],
+ [use the Wave library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-wave=boost_wave-gcc-mt-d-1_33_1 ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_wave_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_wave_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+ AM_CONDITIONAL(ROSE_USE_BOOST_WAVE, test "x$want_boost" = "xyes" )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ LIBS_SAVED=$LIBS
+ LIBS="$LIBS $BOOST_THREAD_LIB"
+ export LIBS
+
+ AC_CACHE_CHECK(whether the Boost::Wave library is available,
+ ax_cv_boost_wave,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/wave.hpp>
+ ]],
+ [[boost::wave::token_category r; return 0;]]),
+ ax_cv_boost_wave=yes, ax_cv_boost_wave=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_wave" = "xyes"; then
+
+ AC_DEFINE(HAVE_BOOST_WAVE,,[define if the Boost::Wave library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ if test "x$ax_boost_user_wave_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_wave*.{so,dylib,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_wave.*\)\.so.*$;\1;' -e 's;^lib\(boost_wave.*\)\.a*$;\1;' -e 's;^lib\(boost_wave.*\)\.dylib$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_WAVE_LIB="-l$ax_lib"; AC_SUBST(BOOST_WAVE_LIB) link_wave="yes"; break],
+ [link_wave="no"])
+ done
+ if test "x$link_wave" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_wave*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_wave.*\)\.dll.*$;\1;' -e 's;^\(boost_wave.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_WAVE_LIB="-l$ax_lib"; AC_SUBST(BOOST_WAVE_LIB) link_wave="yes"; break],
+ [link_wave="no"])
+ done
+ fi
+
+ else
+ for ax_lib in $ax_boost_user_wave_lib boost_wave-$ax_boost_user_wave_lib; do
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_WAVE_LIB="-l$ax_lib"; AC_SUBST(BOOST_WAVE_LIB) link_wave="yes"; break],
+ [link_wave="no"])
+ done
+ fi
+ if test "x$link_wave" != "xyes"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ # DQ (4/7/2006): build a macro to use in source code to know when WAVE is to be used.
+ AC_DEFINE([USE_ROSE_BOOST_WAVE_SUPPORT],1,[Controls use of BOOST WAVE support in ROSE.])
+
+ else
+ AC_DEFINE([USE_ROSE_BOOST_WAVE_SUPPORT],0,[Controls use of BOOST WAVE support in ROSE.])
+
+ fi
+
+
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ LIBS="$LIBS_SAVED"
+
+ fi
+])
diff --git a/m4/ax_boost_wserialization.m4 b/m4/ax_boost_wserialization.m4
new file mode 100644
index 0000000..16c38ba
--- /dev/null
+++ b/m4/ax_boost_wserialization.m4
@@ -0,0 +1,110 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_boost_wserialization.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_WSERIALIZATION
+#
+# DESCRIPTION
+#
+# Test for Serialization library from the Boost C++ libraries. The macro
+# requires a preceding call to AX_BOOST_BASE. Further documentation is
+# available at <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_WSERIALIZATION_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_WSERIALIZATION
+#
+# LICENSE
+#
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BOOST_WSERIALIZATION],
+[
+ AC_ARG_WITH([boost-wserialization],
+ AS_HELP_STRING([--with-boost-wserialization@<:@=special-lib@:>@],
+ [use the WSerialization library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-wserialization=boost_wserialization-gcc-mt-d-1_33_1 ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_wserialization_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_wserialization_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::WSerialization library is available,
+ ax_cv_boost_wserialization,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <fstream>
+ @%:@include <boost/archive/text_oarchive.hpp>
+ @%:@include <boost/archive/text_iarchive.hpp>
+ ]],
+ [[std::ofstream ofs("filename");
+ boost::archive::text_oarchive oa(ofs);
+ return 0;
+ ]]),
+ ax_cv_boost_wserialization=yes, ax_cv_boost_wserialization=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_wserialization" = "xyes"; then
+ AC_DEFINE(HAVE_BOOST_WSERIALIZATION,,[define if the Boost::WSerialization library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ if test "x$ax_boost_user_wserialization_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_wserialization*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_wserialization.*\)\.so.*$;\1;' -e 's;^lib\(boost_wserialization.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_WSERIALIZATION_LIB="-l$ax_lib"; AC_SUBST(BOOST_WSERIALIZATION_LIB) link_wserialization="yes"; break],
+ [link_wserialization="no"])
+ done
+ if test "x$link_wserialization" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_wserialization*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_wserialization.*\)\.dll.*$;\1;' -e 's;^\(boost_wserialization.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_WSERIALIZATION_LIB="-l$ax_lib"; AC_SUBST(BOOST_WSERIALIZATION_LIB) link_wserialization="yes"; break],
+ [link_wserialization="no"])
+ done
+ fi
+
+ else
+ for ax_lib in $ax_boost_user_wserialization_lib boost_wserialization-$ax_boost_user_wserialization_lib; do
+ AC_CHECK_LIB($ax_lib, main,
+ [BOOST_WSERIALIZATION_LIB="-l$ax_lib"; AC_SUBST(BOOST_WSERIALIZATION_LIB) link_wserialization="yes"; break],
+ [link_wserialization="no"])
+ done
+
+ fi
+ if test "x$link_wserialization" != "xyes"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/m4/ax_c99_inline.m4 b/m4/ax_c99_inline.m4
new file mode 100644
index 0000000..9fbc3cb
--- /dev/null
+++ b/m4/ax_c99_inline.m4
@@ -0,0 +1,61 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_c99_inline.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_C99_INLINE
+#
+# DESCRIPTION
+#
+# This macro defines HAVE_C99_INLINE if the C compiler supports "inline"
+# and "extern inline" correctly. An application may replace "inline" with
+# "static inline" as a workaround for older compilers.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Michael McMaster <email@michaelmcmaster.name>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_C99_INLINE], [
+ AC_MSG_CHECKING([whether the compiler supports C99 inline functions])
+ AC_REQUIRE([AC_PROG_CC_C99])
+
+ AC_LANG_PUSH([C])
+
+ dnl In a conforming C99 implementation a function marked "inline" will not
+ dnl be compiled into the translation unit if the compiler was not able to
+ dnl inline the function.
+ dnl GCC versions before 4.3 would output the inline functions into all
+ dnl translation units that could require the definition.
+ AC_LINK_IFELSE(
+ AC_LANG_SOURCE([
+ inline void* foo() { foo(); return &foo; }
+ int main() { return foo() != 0;}
+ ]),
+
+ dnl the invalid source compiled, so the inline keyword does not work
+ dnl correctly.
+ AC_MSG_RESULT([no]),
+
+ dnl Secondary test of valid source.
+ AC_LINK_IFELSE(
+ AC_LANG_SOURCE([
+ extern inline void* foo() { foo(); return &foo; }
+ int main() { return foo() != 0;}
+ ]),
+
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_C99_INLINE], [1],
+ [Define to 1 if the "extern" keyword controls whether an inline function appears in a translation unit.]),
+
+ dnl Perhaps inline functions aren't supported at all ?
+ AC_MSG_RESULT([no])
+ )
+ )
+
+ AC_LANG_POP([C])
+ ]);
diff --git a/m4/ax_c___attribute__.m4 b/m4/ax_c___attribute__.m4
new file mode 100644
index 0000000..90d9602
--- /dev/null
+++ b/m4/ax_c___attribute__.m4
@@ -0,0 +1,64 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_c___attribute__.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_C___ATTRIBUTE__
+#
+# DESCRIPTION
+#
+# Provides a test for the compiler support of __attribute__ extensions.
+# Defines HAVE___ATTRIBUTE__ if it is found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Stepan Kasal <skasal@redhat.com>
+# Copyright (c) 2008 Christian Haggstrom
+# Copyright (c) 2008 Ryan McCabe <ryan@numb.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_C___ATTRIBUTE__], [
+ AC_CACHE_CHECK([for __attribute__], [ax_cv___attribute__],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdlib.h>
+ static void foo(void) __attribute__ ((unused));
+ static void
+ foo(void) {
+ exit(1);
+ }
+ ]], [])],
+ [ax_cv___attribute__=yes],
+ [ax_cv___attribute__=no]
+ )
+ ])
+ if test "$ax_cv___attribute__" = "yes"; then
+ AC_DEFINE([HAVE___ATTRIBUTE__], 1, [define if your compiler has __attribute__])
+ fi
+])
diff --git a/m4/ax_c_arithmetic_rshift.m4 b/m4/ax_c_arithmetic_rshift.m4
new file mode 100644
index 0000000..ceb94a3
--- /dev/null
+++ b/m4/ax_c_arithmetic_rshift.m4
@@ -0,0 +1,33 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_c_arithmetic_rshift.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_C_ARITHMETIC_RSHIFT
+#
+# DESCRIPTION
+#
+# Checks if the right shift operation is arithmetic.
+#
+# This macro uses compile-time detection and so is cross-compile ready.
+#
+# LICENSE
+#
+# Copyright (c) 2008 YAMAMOTO Kengo <yamaken AT bp.iij4u.or.jp>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_C_ARITHMETIC_RSHIFT], [
+ AC_CACHE_CHECK([whether right shift operation is arithmetic],
+ [ax_cv_c_arithmetic_rshift],
+ [AC_COMPILE_IFELSE([[int dummy[((-1 >> 1) < 0) ? 1 : -1];]],
+ [ax_cv_c_arithmetic_rshift=yes],
+ [ax_cv_c_arithmetic_rshift=no])])
+ if test "x$ax_cv_c_arithmetic_rshift" = xyes; then
+ AC_DEFINE([HAVE_ARITHMETIC_RSHIFT], [1],
+ [Define to 1 if the right shift operation is arithmetic.])
+ fi
+])
diff --git a/m4/ax_c_check_flag.m4 b/m4/ax_c_check_flag.m4
new file mode 100644
index 0000000..5a03a3c
--- /dev/null
+++ b/m4/ax_c_check_flag.m4
@@ -0,0 +1,84 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_c_check_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_C_CHECK_FLAG(FLAG-TO-CHECK,[PROLOGUE],[BODY],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# This macro tests if the C compiler supports the flag FLAG-TO-CHECK. If
+# successfull execute ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+# PROLOGUE and BODY are optional and should be used as in AC_LANG_PROGRAM
+# macro.
+#
+# This code is inspired from KDE_CHECK_COMPILER_FLAG macro. Thanks to
+# Bogdan Drozdowski <bogdandr@op.pl> for testing and bug fixes.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_C_CHECK_FLAG],[
+ AC_PREREQ([2.61])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_PROG_SED])
+
+ flag=`echo "$1" | $SED 'y% .=/+-(){}<>:*,%_______________%'`
+
+ AC_CACHE_CHECK([whether the C compiler accepts the $1 flag],
+ [ax_cv_c_check_flag_$flag],[
+
+ AC_LANG_PUSH([C])
+
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $1"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([$2],[$3])
+ ],[
+ eval "ax_cv_c_check_flag_$flag=yes"
+ ],[
+ eval "ax_cv_c_check_flag_$flag=no"
+ ])
+
+ CFLAGS="$save_CFLAGS"
+
+ AC_LANG_POP
+
+ ])
+
+ AS_IF([eval "test \"`echo '$ax_cv_c_check_flag_'$flag`\" = yes"],[
+ :
+ $4
+ ],[
+ :
+ $5
+ ])
+])
diff --git a/m4/ax_c_declare_block.m4 b/m4/ax_c_declare_block.m4
new file mode 100644
index 0000000..59bfd48
--- /dev/null
+++ b/m4/ax_c_declare_block.m4
@@ -0,0 +1,87 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_c_declare_block.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_C_DECLARE_BLOCK
+#
+# DESCRIPTION
+#
+# The macro will compile a test program to see whether the compiler does
+# allow new variable declarations in the middle of a C statement block,
+# i.e. after some non-declaration line. New compilers will allow that
+# which makes the behave a bit more like C++ - the gcc did support it for
+# quite a time already.
+#
+# #define DECLARE_BLOCK_NEEDED says they need to be at the beginning of of
+# a statement block. Additionlly two defines DECLARE_BLOCK { and
+# DECLARE_END } are being set. That makes it possible to do the following
+# in your source code (which this macro is really made up for):
+#
+# #define ___ DECLARE_BLOCK
+# #define ____ DECLARE_END
+#
+# int f() {
+# char buffer[1024];
+# fgets(buffer, 1024, stdin);
+# ___ int i; int ii = strlen(buffer);
+# for (i=0; i < ii; i++) {
+# fputc(buffer[i], stdout);
+# }____;
+# }
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_C_DECLARE_BLOCK],[dnl
+AC_CACHE_CHECK(
+ [if C variables must be declared at the beginning of a block],
+ ax_cv_c_declare_block,[
+ AC_TRY_COMPILE([#include <stdio.h>
+ int f() {
+ char buffer[1024];
+ fgets(buffer, 1024, stdin);
+ int i; int ii = strlen(buffer);
+ for (i=0; i < ii; i++) {
+ fputc(buffer[i], stdout);
+ }
+ }],
+ [],
+ ax_cv_c_declare_block=no, ax_cv_c_declare_block=yes)])
+ if test "$ax_cv_c_declare_block" = yes; then
+ AC_DEFINE([DECLARE_BLOCK_NEEDED],[1],
+ [if C variables must be declared at the beginning of a block])
+ AC_DEFINE([DECLARE_BLOCK],[{],
+ [set to { if variable declarations need a block start before])
+ AC_DEFINE([DECLARE_END],[}],
+ [set to } if variable declarations need a block start before])
+ fi
+])
diff --git a/m4/ax_c_float_words_bigendian.m4 b/m4/ax_c_float_words_bigendian.m4
new file mode 100644
index 0000000..23adbcf
--- /dev/null
+++ b/m4/ax_c_float_words_bigendian.m4
@@ -0,0 +1,80 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_c_float_words_bigendian.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN])
+#
+# DESCRIPTION
+#
+# Checks the ordering of words within a multi-word float. This check is
+# necessary because on some systems (e.g. certain ARM systems), the float
+# word ordering can be different from the byte ordering. In a multi-word
+# float context, "big-endian" implies that the word containing the sign
+# bit is found in the memory location with the lowest address. This
+# implemenation was inspired by the AC_C_BIGENDIAN macro in autoconf.
+#
+# The endianess is detected by first compiling C code that contains a
+# special double float value, then grepping the resulting object file for
+# certain strings of ASCII values. The double is specially crafted to have
+# a binary representation that corresponds with a simple string. In this
+# implementation, the string "noonsees" was selected because the
+# individual word values ("noon" and "sees") are palindromes, thus making
+# this test byte-order agnostic. If grep finds the string "noonsees" in
+# the object file, the target platform stores float words in big-endian
+# order. If grep finds "seesnoon", float words are in little-endian order.
+# If neither value is found, the user is instructed to specify the
+# ordering.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Daniel Amelang <dan@amelang.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN],
+ [AC_CACHE_CHECK(whether float word ordering is bigendian,
+ ax_cv_c_float_words_bigendian, [
+
+ax_cv_c_float_words_bigendian=unknown
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+
+double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0;
+
+]])], [
+
+if grep noonsees conftest.$ac_objext >/dev/null ; then
+ ax_cv_c_float_words_bigendian=yes
+fi
+if grep seesnoon conftest.$ac_objext >/dev/null ; then
+ if test "$ax_cv_c_float_words_bigendian" = unknown; then
+ ax_cv_c_float_words_bigendian=no
+ else
+ ax_cv_c_float_words_bigendian=unknown
+ fi
+fi
+
+])])
+
+case $ax_cv_c_float_words_bigendian in
+ yes)
+ m4_default([$1],
+ [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1,
+ [Define to 1 if your system stores words within floats
+ with the most significant word first])]) ;;
+ no)
+ $2 ;;
+ *)
+ m4_default([$3],
+ [AC_MSG_ERROR([
+
+Unknown float word ordering. You need to manually preset
+ax_cv_c_float_words_bigendian=no (or yes) according to your system.
+
+ ])]) ;;
+esac
+
+])# AX_C_FLOAT_WORDS_BIGENDIAN
diff --git a/m4/ax_c_referenceable_passed_va_list.m4 b/m4/ax_c_referenceable_passed_va_list.m4
new file mode 100644
index 0000000..3ce2f8a
--- /dev/null
+++ b/m4/ax_c_referenceable_passed_va_list.m4
@@ -0,0 +1,94 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_c_referenceable_passed_va_list.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_C_REFERENCEABLE_PASSED_VA_LIST
+#
+# DESCRIPTION
+#
+# Checks whether f(va_list va){ &va; } works as expected.
+#
+# This macro uses compile-time detection and so is cross-compile ready.
+#
+# C99 mentioned passing a pointer to va_list to other functions (footnote
+# 212 of "7.15 Variable arguments <stdarg.h>"). However, f(va_list va) {
+# &va; } produces broken pointer on some environments such as gcc on
+# x86_64, although { va_list va; &va; } works as expected. See the
+# detection code of this file and any of pages
+# http://www.gnu.org/software/autoconf/manual/html_node/Function-Portability.html,
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14557, and
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20951 for further
+# information.
+#
+# Although C99 does not define the operations f(va_list va) { &va; } and
+# &va itself as standard (footnotes are declared as "normative part,
+# information only"), certain situations need it. This macro provides a
+# type detection about va_list implementation to deal with the operation.
+#
+# Following workaround will probably work on such environments although it
+# does not ensure to be safe and portable. At least it is working on
+# x86_64-unknown-linux-gnu:
+#
+# f(va_list va)
+# {
+# va_list *vap;
+#
+# #if HAVE_REFERENCEABLE_PASSED_VA_LIST
+# vap = &va;
+# #else
+# vap = (va_list *)va;
+# #endif
+# }
+#
+# LICENSE
+#
+# Copyright (c) 2008 YAMAMOTO Kengo <yamaken AT bp.iij4u.or.jp>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_C_REFERENCEABLE_PASSED_VA_LIST], [
+ AC_CACHE_CHECK([whether f(va_list va){ &va; } works as expected],
+ [ax_cv_c_referenceable_passed_va_list],
+ [AC_LINK_IFELSE([[
+#include <stdarg.h>
+
+volatile va_list g_va;
+
+void
+vf(va_list callee_va)
+{
+ /* typeof(callee_va) differs from typeof(caller_va) by a compiler trick, if
+ * va_list is implemented as an array. On such environment, this copy
+ * operation fails. */
+ g_va = callee_va;
+}
+
+void
+f(int last, ...)
+{
+ va_list caller_va;
+
+ va_start(caller_va, last);
+ vf(caller_va); /* passed as &caller_va[0] if va_list is an array type */
+ va_end(caller_va);
+}
+
+int
+main(int argc, char *argv[])
+{
+ f(0xdeadbeef, 0xfedbeef, 0xfeedee);
+
+ return 0;
+}
+ ]],
+ [ax_cv_c_referenceable_passed_va_list=yes],
+ [ax_cv_c_referenceable_passed_va_list=no])])
+ if test "x$ax_cv_c_referenceable_passed_va_list" = xyes; then
+ AC_DEFINE([HAVE_REFERENCEABLE_PASSED_VA_LIST], [1],
+ [Define to 1 if f(va_list va){ &va; } works as expected.])
+ fi
+])
diff --git a/m4/ax_cache_size.m4 b/m4/ax_cache_size.m4
new file mode 100644
index 0000000..254c9a4
--- /dev/null
+++ b/m4/ax_cache_size.m4
@@ -0,0 +1,84 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cache_size.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CACHE_SIZE
+#
+# DESCRIPTION
+#
+# Find L1 and L2 caches size by reading the corresponding file on UNIX or
+# by requesting cpuid. The results are available in the defines
+# CPU_L1_CACHE and CPU_L2_CACHE.
+#
+# This macro depends on AX_GCC_X86_CPUID, AC_PROG_SED, AX_COUNT_CPUS, and
+# AX_CPU_VENDOR.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Christophe Tournayre <turn3r@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CACHE_SIZE],
+[
+ AC_REQUIRE([AC_PROG_SED])
+ AC_REQUIRE([AX_COUNT_CPUS])
+ AC_REQUIRE([AX_GCC_X86_CPUID])
+ AC_REQUIRE([AX_CPU_VENDOR])
+
+ AX_COUNT_CPUS
+ AX_CPU_VENDOR
+
+ ax_l1_size=unknown
+ ax_l2_size=unknown
+
+ #Check if the variable is present
+ if test -e /sys/devices/system/cpu/cpu0/cache/index0/size; then
+ for ncpu in `seq 0 $(($CPU_COUNT-1))`; do
+ for idx in `seq 0 3`; do
+ if test -e /sys/devices/system/cpu/cpu$ncpu/cache/index$idx/size ; then
+ level=`cat /sys/devices/system/cpu/cpu$ncpu/cache/index$idx/level`
+ size=`cat /sys/devices/system/cpu/cpu$ncpu/cache/index$idx/size`
+ eval CPU$ncpu\_L$level\_CACHE="$size"
+ fi
+ done
+ done
+
+ # This part can (must !!!) be optimized, because we know all caches per proc but
+ # we only take care about the first proc
+ ax_l1_size=$CPU0_L1_CACHE
+ ax_l2_size=$CPU0_L2_CACHE
+
+ else
+ #Or use CPUID
+ if test $ax_xpu_vendor != "Intel"; then
+ AX_GCC_X86_CPUID(0x80000005) # For L1 cache (not available on intel !!!)
+
+ l1_hexval=$(( 16#`echo $ax_cv_gcc_x86_cpuid_0x80000005 | cut -d ":" -f 4`))
+ ax_l1_size=$(($l1_hexval >> 24))
+ fi
+
+ AX_GCC_X86_CPUID(0x80000006) # For L2 cache
+
+ l2_hexval=$(( 16#`echo $ax_cv_gcc_x86_cpuid_0x80000006 | cut -d ":" -f 3`))
+ ax_l2_size=$(($l2_hexval >> 16))
+ fi
+
+ # Keep only digits if there is a unit (ie 1024K -> 1024) and convert in Bytes
+ AC_MSG_CHECKING(the L1 cache size)
+ ax_l1_size=`echo $ax_l1_size | $SED 's/\([[0-9]]\)[[A-Za-z]]$/\1/g'`
+ ax_l1_size=$(($ax_l1_size*1024))
+ AC_MSG_RESULT( $ax_l1_size Bytes)
+
+ AC_MSG_CHECKING(the L2 cache size)
+ ax_l2_size=`echo $ax_l2_size | $SED 's/\([[0-9]]\)[[A-Za-z]]$/\1/g'`
+ ax_l2_size=$(($ax_l2_size*1024))
+ AC_MSG_RESULT( $ax_l2_size Bytes)
+
+ AC_DEFINE_UNQUOTED([CPU_L1_CACHE], ${ax_l1_size}, [L1 cache size (in Bytes)])
+ AC_DEFINE_UNQUOTED([CPU_L2_CACHE], ${ax_l2_size}, [L2 cache size (in Bytes)])
+])
diff --git a/m4/ax_cc_maxopt.m4 b/m4/ax_cc_maxopt.m4
new file mode 100644
index 0000000..1917d7f
--- /dev/null
+++ b/m4/ax_cc_maxopt.m4
@@ -0,0 +1,178 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cc_maxopt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CC_MAXOPT
+#
+# DESCRIPTION
+#
+# Try to turn on "good" C optimization flags for various compilers and
+# architectures, for some definition of "good". (In our case, good for
+# FFTW and hopefully for other scientific codes. Modify as needed.)
+#
+# The user can override the flags by setting the CFLAGS environment
+# variable. The user can also specify --enable-portable-binary in order to
+# disable any optimization flags that might result in a binary that only
+# runs on the host architecture.
+#
+# Note also that the flags assume that ANSI C aliasing rules are followed
+# by the code (e.g. for gcc's -fstrict-aliasing), and that floating-point
+# computations can be re-ordered as needed.
+#
+# Requires macros: AX_CHECK_COMPILER_FLAGS, AX_COMPILER_VENDOR,
+# AX_GCC_ARCHFLAG, AX_GCC_X86_CPUID.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+# Copyright (c) 2008 Matteo Frigo
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CC_MAXOPT],
+[
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AX_COMPILER_VENDOR])
+AC_REQUIRE([AC_CANONICAL_HOST])
+
+AC_ARG_ENABLE(portable-binary, [AC_HELP_STRING([--enable-portable-binary], [disable compiler optimizations that would produce unportable binaries])],
+ acx_maxopt_portable=$withval, acx_maxopt_portable=no)
+
+# Try to determine "good" native compiler flags if none specified via CFLAGS
+if test "$ac_test_CFLAGS" != "set"; then
+ CFLAGS=""
+ case $ax_cv_c_compiler_vendor in
+ dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host"
+ if test "x$acx_maxopt_portable" = xno; then
+ CFLAGS="$CFLAGS -arch host"
+ fi;;
+
+ sun) CFLAGS="-native -fast -xO5 -dalign"
+ if test "x$acx_maxopt_portable" = xyes; then
+ CFLAGS="$CFLAGS -xarch=generic"
+ fi;;
+
+ hp) CFLAGS="+Oall +Optrs_ansi +DSnative"
+ if test "x$acx_maxopt_portable" = xyes; then
+ CFLAGS="$CFLAGS +DAportable"
+ fi;;
+
+ ibm) if test "x$acx_maxopt_portable" = xno; then
+ xlc_opt="-qarch=auto -qtune=auto"
+ else
+ xlc_opt="-qtune=auto"
+ fi
+ AX_CHECK_COMPILER_FLAGS($xlc_opt,
+ CFLAGS="-O3 -qansialias -w $xlc_opt",
+ [CFLAGS="-O3 -qansialias -w"
+ echo "******************************************************"
+ echo "* You seem to have the IBM C compiler. It is *"
+ echo "* recommended for best performance that you use: *"
+ echo "* *"
+ echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *"
+ echo "* ^^^ ^^^ *"
+ echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *"
+ echo "* CPU you have. (Set the CFLAGS environment var. *"
+ echo "* and re-run configure.) For more info, man cc. *"
+ echo "******************************************************"])
+ ;;
+
+ intel) CFLAGS="-O3 -ansi_alias"
+ if test "x$acx_maxopt_portable" = xno; then
+ icc_archflag=unknown
+ icc_flags=""
+ case $host_cpu in
+ i686*|x86_64*)
+ # icc accepts gcc assembly syntax, so these should work:
+ AX_GCC_X86_CPUID(0)
+ AX_GCC_X86_CPUID(1)
+ case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG
+ *:756e6547:*:*) # Intel
+ case $ax_cv_gcc_x86_cpuid_1 in
+ *6a?:*[[234]]:*:*|*6[[789b]]?:*:*:*) icc_flags="-xK";;
+ *f3[[347]]:*:*:*|*f4[1347]:*:*:*) icc_flags="-xP -xN -xW -xK";;
+ *f??:*:*:*) icc_flags="-xN -xW -xK";;
+ esac ;;
+ esac ;;
+ esac
+ if test "x$icc_flags" != x; then
+ for flag in $icc_flags; do
+ AX_CHECK_COMPILER_FLAGS($flag, [icc_archflag=$flag; break])
+ done
+ fi
+ AC_MSG_CHECKING([for icc architecture flag])
+ AC_MSG_RESULT($icc_archflag)
+ if test "x$icc_archflag" != xunknown; then
+ CFLAGS="$CFLAGS $icc_archflag"
+ fi
+ fi
+ ;;
+
+ gnu)
+ # default optimization flags for gcc on all systems
+ CFLAGS="-O3 -fomit-frame-pointer"
+
+ # -malign-double for x86 systems
+ AX_CHECK_COMPILER_FLAGS(-malign-double, CFLAGS="$CFLAGS -malign-double")
+
+ # -fstrict-aliasing for gcc-2.95+
+ AX_CHECK_COMPILER_FLAGS(-fstrict-aliasing,
+ CFLAGS="$CFLAGS -fstrict-aliasing")
+
+ # note that we enable "unsafe" fp optimization with other compilers, too
+ AX_CHECK_COMPILER_FLAGS(-ffast-math, CFLAGS="$CFLAGS -ffast-math")
+
+ AX_GCC_ARCHFLAG($acx_maxopt_portable)
+ ;;
+ esac
+
+ if test -z "$CFLAGS"; then
+ echo ""
+ echo "********************************************************"
+ echo "* WARNING: Don't know the best CFLAGS for this system *"
+ echo "* Use ./configure CFLAGS=... to specify your own flags *"
+ echo "* (otherwise, a default of CFLAGS=-O3 will be used) *"
+ echo "********************************************************"
+ echo ""
+ CFLAGS="-O3"
+ fi
+
+ AX_CHECK_COMPILER_FLAGS($CFLAGS, [], [
+ echo ""
+ echo "********************************************************"
+ echo "* WARNING: The guessed CFLAGS don't seem to work with *"
+ echo "* your compiler. *"
+ echo "* Use ./configure CFLAGS=... to specify your own flags *"
+ echo "********************************************************"
+ echo ""
+ CFLAGS=""
+ ])
+
+fi
+])
diff --git a/m4/ax_cflags_aix_option.m4 b/m4/ax_cflags_aix_option.m4
new file mode 100644
index 0000000..d13b44d
--- /dev/null
+++ b/m4/ax_cflags_aix_option.m4
@@ -0,0 +1,204 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cflags_aix_option.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CFLAGS_AIX_OPTION (optionflag [,[shellvar][,[A][,[NA]]])
+#
+# DESCRIPTION
+#
+# AX_CFLAGS_AIX_OPTION(-qubicle) would show a message as like "checking
+# CFLAGS for aix/cc -qubicle ... yes" and adds the optionflag to CFLAGS if
+# it is understood. You can override the shellvar-default of CFLAGS of
+# course. The order of arguments stems from the explicit macros like
+# AX_CFLAGS_WARN_ALL.
+#
+# The cousin AX_CXXFLAGS_AIX_OPTION would check for an option to add to
+# CXXFLAGS - and it uses the autoconf setup for C++ instead of C (since it
+# is possible to use different compilers for C and C++).
+#
+# The macro is a lot simpler than any special AX_CFLAGS_* macro (or
+# ac_cxx_rtti.m4 macro) but allows to check for arbitrary options.
+# However, if you use this macro in a few places, it would be great if you
+# would make up a new function-macro and submit it to the ac-archive.
+#
+# - $1 option-to-check-for : required ("-option" as non-value)
+# - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case)
+# - $3 action-if-found : add value to shellvariable
+# - $4 action-if-not-found : nothing
+#
+# note: in earlier versions, $1-$2 were swapped. We try to detect the
+# situation and accept a $2=~/-/ as being the old option-to-check-for.
+#
+# see also: AX_CFLAGS_GCC_OPTION for the widely used original variant.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CFLAGS_AIX_OPTION_OLD], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_aix_option_$2])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for aix/cc m4_ifval($2,$2,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-qlanglvl=ansi -qsrcmsg % m4_ifval($2,$2,-option)" dnl AIX
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_AIX_OPTION_OLD], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_aix_option_$2])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for aix/cc m4_ifval($2,$2,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-qlanglvl=ansi -qsrcmsg % m4_ifval($2,$2,-option)" dnl AIX
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl ------------------------------------------------------------------------
+
+AC_DEFUN([AX_CFLAGS_AIX_OPTION_NEW], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_aix_option_$1])dnl
+AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for aix/cc m4_ifval($1,$1,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-qlanglvl=ansi -qsrcmsg % m4_ifval($1,$1,-option)" dnl AIX
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
+ m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_AIX_OPTION_NEW], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_aix_option_$1])dnl
+AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for aix/cc m4_ifval($1,$1,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-qlanglvl=ansi -qsrcmsg % m4_ifval($1,$1,-option)" dnl AIX
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
+ m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+AC_DEFUN([AX_CFLAGS_AIX_OPTION],[ifelse(m4_regexp([$2],[-]),-1,
+[AX_CFLAGS_AIX_OPTION_NEW($@)],[AX_CFLAGS_AIX_OPTION_OLD($@)])])
+
+AC_DEFUN([AX_CXXFLAGS_AIX_OPTION],[ifelse(m4_regexp([$2],[-]),-1,
+[AX_CXXFLAGS_AIX_OPTION_NEW($@)],[AX_CXXFLAGS_AIX_OPTION_OLD($@)])])
diff --git a/m4/ax_cflags_gcc_option.m4 b/m4/ax_cflags_gcc_option.m4
new file mode 100644
index 0000000..d5e6cd1
--- /dev/null
+++ b/m4/ax_cflags_gcc_option.m4
@@ -0,0 +1,219 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cflags_gcc_option.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CFLAGS_GCC_OPTION (optionflag [,[shellvar][,[A][,[NA]]])
+#
+# DESCRIPTION
+#
+# AX_CFLAGS_GCC_OPTION(-fvomit-frame) would show a message as like
+# "checking CFLAGS for gcc -fvomit-frame ... yes" and adds the optionflag
+# to CFLAGS if it is understood. You can override the shellvar-default of
+# CFLAGS of course. The order of arguments stems from the explicit macros
+# like AX_CFLAGS_WARN_ALL.
+#
+# The cousin AX_CXXFLAGS_GCC_OPTION would check for an option to add to
+# CXXFLAGS - and it uses the autoconf setup for C++ instead of C (since it
+# is possible to use different compilers for C and C++).
+#
+# The macro is a lot simpler than any special AX_CFLAGS_* macro (or
+# ac_cxx_rtti.m4 macro) but allows to check for arbitrary options.
+# However, if you use this macro in a few places, it would be great if you
+# would make up a new function-macro and submit it to the ac-archive.
+#
+# - $1 option-to-check-for : required ("-option" as non-value)
+# - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case)
+# - $3 action-if-found : add value to shellvariable
+# - $4 action-if-not-found : nothing
+#
+# Note: in earlier versions, $1-$2 were swapped. We try to detect the
+# situation and accept a $2=~/-/ as being the old option-to-check-for.
+#
+# There are other variants that emerged from the original macro variant
+# which did just test an option to be possibly added. However, some
+# compilers accept an option silently, or possibly for just another option
+# that was not intended. Therefore, we have to do a generic test for a
+# compiler family. For gcc we check "-pedantic" being accepted which is
+# also understood by compilers who just want to be compatible with gcc
+# even when not being made from gcc sources.
+#
+# See also: AX_CFLAGS_SUN_OPTION, AX_CFLAGS_HPUX_OPTION,
+# AX_CFLAGS_AIX_OPTION, and AX_CFLAGS_IRIX_OPTION.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$2])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC
+ "-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_OLD], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$2])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC
+ "-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl -------------------------------------------------------------------------
+
+AC_DEFUN([AX_CFLAGS_GCC_OPTION_NEW], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$1])dnl
+AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC
+ "-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
+ m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_NEW], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$1])dnl
+AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC
+ "-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
+ m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+AC_DEFUN([AX_CFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
+[AX_CFLAGS_GCC_OPTION_NEW($@)],[AX_CFLAGS_GCC_OPTION_OLD($@)])])
+
+AC_DEFUN([AX_CXXFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
+[AX_CXXFLAGS_GCC_OPTION_NEW($@)],[AX_CXXFLAGS_GCC_OPTION_OLD($@)])])
diff --git a/m4/ax_cflags_hpux_option.m4 b/m4/ax_cflags_hpux_option.m4
new file mode 100644
index 0000000..dbd02af
--- /dev/null
+++ b/m4/ax_cflags_hpux_option.m4
@@ -0,0 +1,204 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cflags_hpux_option.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CFLAGS_HPUX_OPTION (optionflag [,[shellvar][,[A][,[NA]]])
+#
+# DESCRIPTION
+#
+# AX_CFLAGS_HPUX_OPTION(-Afresh) would show a message as like "checking
+# CFLAGS for hpux/cc -Afresh ... yes" and adds the optionflag to CFLAGS if
+# it is understood. You can override the shellvar-default of CFLAGS of
+# course. The order of arguments stems from the explicit macros like
+# AX_CFLAGS_WARN_ALL.
+#
+# The cousin AX_CXXFLAGS_HPUX_OPTION would check for an option to add to
+# CXXFLAGS - and it uses the autoconf setup for C++ instead of C (since it
+# is possible to use different compilers for C and C++).
+#
+# The macro is a lot simpler than any special AX_CFLAGS_* macro (or
+# ac_cxx_rtti.m4 macro) but allows to check for arbitrary options.
+# However, if you use this macro in a few places, it would be great if you
+# would make up a new function-macro and submit it to the ac-archive.
+#
+# - $1 option-to-check-for : required ("-option" as non-value)
+# - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case)
+# - $3 action-if-found : add value to shellvariable
+# - $4 action-if-not-found : nothing
+#
+# note: in earlier versions, $1-$2 were swapped. We try to detect the
+# situation and accept a $2=~/-/ as being the old option-to-check-for.
+#
+# see also: AX_CFLAGS_GCC_OPTION for the widely used original variant.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CFLAGS_HPUX_OPTION_OLD], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_hpux_option_$2])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for hpux/cc m4_ifval($2,$2,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "+ESlit +w1 -Aa % m4_ifval($2,$2,-option)" dnl HP-UX C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_HPUX_OPTION_OLD], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_hpux_option_$2])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for hpux/cc m4_ifval($2,$2,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "+ESlit +w1 -Aa % m4_ifval($2,$2,-option)" dnl HP-UX C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl ------------------------------------------------------------------------
+
+AC_DEFUN([AX_CFLAGS_HPUX_OPTION_NEW], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_hpux_option_$1])dnl
+AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for hpux/cc m4_ifval($1,$1,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "+ESlit +w1 -Aa % m4_ifval($1,$1,-option)" dnl HP-UX C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
+ m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_HPUX_OPTION_NEW], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_hpux_option_$1])dnl
+AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for hpux/cc m4_ifval($1,$1,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "+ESlit +w1 -Aa % m4_ifval($1,$1,-option)" dnl HP-UX C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
+ m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+AC_DEFUN([AX_CFLAGS_HPUX_OPTION],[ifelse(m4_regexp([$2],[-]),-1,
+[AX_CFLAGS_HPUX_OPTION_NEW($@)],[AX_CFLAGS_HPUX_OPTION_OLD($@)])])
+
+AC_DEFUN([AX_CXXFLAGS_HPUX_OPTION],[ifelse(m4_regexp([$2],[-]),-1,
+[AX_CXXFLAGS_HPUX_OPTION_NEW($@)],[AX_CXXFLAGS_HPUX_OPTION_OLD($@)])])
diff --git a/m4/ax_cflags_irix_option.m4 b/m4/ax_cflags_irix_option.m4
new file mode 100644
index 0000000..f3c0344
--- /dev/null
+++ b/m4/ax_cflags_irix_option.m4
@@ -0,0 +1,204 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cflags_irix_option.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CFLAGS_IRIX_OPTION (optionflag [,[shellvar][,[A][,[NA]]])
+#
+# DESCRIPTION
+#
+# AX_CFLAGS_IRIX_OPTION(-go_for_it) would show a message as like "checking
+# CFLAGS for irix/cc -go_for_it ... yes" and adds the optionflag to CFLAGS
+# if it is understood. You can override the shellvar-default of CFLAGS of
+# course. The order of arguments stems from the explicit macros like
+# AX_CFLAGS_WARN_ALL.
+#
+# The cousin AX_CXXFLAGS_IRIX_OPTION would check for an option to add to
+# CXXFLAGS - and it uses the autoconf setup for C++ instead of C (since it
+# is possible to use different compilers for C and C++).
+#
+# The macro is a lot simpler than any special AX_CFLAGS_* macro (or
+# ac_cxx_rtti.m4 macro) but allows to check for arbitrary options.
+# However, if you use this macro in a few places, it would be great if you
+# would make up a new function-macro and submit it to the ac-archive.
+#
+# - $1 option-to-check-for : required ("-option" as non-value)
+# - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case)
+# - $3 action-if-found : add value to shellvariable
+# - $4 action-if-not-found : nothing
+#
+# note: in earlier versions, $1-$2 were swapped. We try to detect the
+# situation and accept a $2=~/-/ as being the old option-to-check-for.
+#
+# see also: AX_CFLAGS_GCC_OPTION for the widely used original variant.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CFLAGS_IRIX_OPTION_OLD], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_irix_option_$2])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for irix/cc m4_ifval($2,$2,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-fullwarn -use_readonly_const % m4_ifval($2,$2,-option)" dnl IRIX C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_IRIX_OPTION_OLD], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_irix_option_$2])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for irix/cc m4_ifval($2,$2,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-fullwarn -use_readonly_const % m4_ifval($2,$2,-option)" dnl IRIX C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl --------------------------------------------------------------------------
+
+AC_DEFUN([AX_CFLAGS_IRIX_OPTION_NEW], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_irix_option_$1])dnl
+AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for irix/cc m4_ifval($1,$1,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-fullwarn -use_readonly_const % m4_ifval($1,$1,-option)" dnl IRIX C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
+ m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_IRIX_OPTION_NEW], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_irix_option_$1])dnl
+AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for irix/cc m4_ifval($1,$1,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-fullwarn -use_readonly_const % m4_ifval($1,$1,-option)" dnl IRIX C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
+ m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+AC_DEFUN([AX_CFLAGS_IRIX_OPTION],[ifelse(m4_regexp([$2],[-]),-1,
+[AX_CFLAGS_IRIX_OPTION_NEW($@)],[AX_CFLAGS_IRIX_OPTION_OLD($@)])])
+
+AC_DEFUN([AX_CXXFLAGS_IRIX_OPTION],[ifelse(m4_regexp([$2],[-]),-1,
+[AX_CXXFLAGS_IRIX_OPTION_NEW($@)],[AX_CXXFLAGS_IRIX_OPTION_OLD($@)])])
diff --git a/m4/ax_cflags_no_writable_strings.m4 b/m4/ax_cflags_no_writable_strings.m4
new file mode 100644
index 0000000..f263e4c
--- /dev/null
+++ b/m4/ax_cflags_no_writable_strings.m4
@@ -0,0 +1,174 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cflags_no_writable_strings.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CFLAGS_NO_WRITABLE_STRINGS [(shellvar [,default, [A/NA]])]
+#
+# DESCRIPTION
+#
+# Try to find a compiler option that makes all string literals readonly.
+#
+# The sanity check is done by looking at string.h which has a set of
+# strcpy definitions that should be defined with const-modifiers to not
+# emit a warning in all so many places.
+#
+# For the GNU CC compiler it will be -fno-writable-strings -Wwrite-strings
+# The result is added to the shellvar being CFLAGS by default.
+#
+# DEFAULTS:
+#
+# - $1 shell-variable-to-add-to : CFLAGS
+# - $2 add-value-if-not-found : nothing
+# - $3 action-if-found : add value to shellvariable
+# - $4 action-if-not-found : nothing
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CFLAGS_NO_WRITABLE_STRINGS],[dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_no_writable_strings])dnl
+AC_CACHE_CHECK([m4_ifval([$1],[$1],FLAGS) making strings readonly],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+# IRIX C compiler:
+# -use_readonly_const is the default for IRIX C,
+# puts them into .rodata, but they are copied later.
+# need to be "-G0 -rdatashared" for strictmode but
+# I am not sure what effect that has really. - guidod
+for ac_arg dnl
+in "-pedantic % -fno-writable-strings -Wwrite-strings" dnl GCC
+ "-pedantic % -fconst-strings -Wwrite-strings" dnl newer GCC
+ "-v -Xc % -xstrconst" dnl Solaris C - strings go into readonly segment
+ "+w1 -Aa % +ESlit" dnl HP-UX C - strings go into readonly segment
+ "-w0 -std1 % -readonly_strings" dnl Digital Unix - again readonly segment
+ "-fullwarn -use_readonly_const %% ok, its the default" dnl IRIX C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | -e 's,.*% *,,'` ; break])
+done
+case ".$VAR" in
+ .|.no|.no,*) ;;
+ *) # sanity check - testing strcpy() from string.h
+ cp config.log config.tmp
+ AC_TRY_COMPILE([#include <string.h>],[
+ char test[16];
+ if (strcpy (test, "test")) return 1;],
+ dnl the original did use test -n `$CC testprogram.c`
+ [if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
+ then VAR="no, suppressed, string.h," ; fi],
+ [VAR="no, suppressed, string.h"])
+ rm config.tmp
+ ;;
+esac
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_NO_WRITABLE_STRINGS],[dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_no_writable_strings])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) making strings readonly],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+# IRIX C compiler:
+# -use_readonly_const is the default for IRIX C,
+# puts them into .rodata, but they are copied later.
+# need to be "-G0 -rdatashared" for strictmode but
+# I am not sure what effect that has really. - guidod
+for ac_arg dnl
+in "-pedantic -Werror % -fno-writable-strings -Wwrite-strings" dnl GCC
+ "-pedantic -Werror % -fconst-strings -Wwrite-strings" dnl newer GCC
+ "-pedantic % -fconst-strings %% no, const-strings is default" dnl newer GCC
+ "-v -Xc % -xstrconst" dnl Solaris C - strings go into readonly segment
+ "+w1 -Aa % +ESlit" dnl HP-UX C - strings go into readonly segment
+ "-w0 -std1 % -readonly_strings" dnl Digital Unix - again readonly segment
+ "-fullwarn -use_readonly_const %% ok, its the default" dnl IRIX C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+case ".$VAR" in
+ .|.no|.no,*) ;;
+ *) # sanity check - testing strcpy() from string.h
+ cp config.log config.tmp
+ AC_TRY_COMPILE([#include <string.h>],[
+ char test[16];
+ if (strcpy (test, "test")) return 1;],
+ dnl the original did use test -n `$CC testprogram.c`
+ [if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
+ then VAR="no, suppressed, string.h," ; fi],
+ [VAR="no, suppressed, string.h"])
+ rm config.tmp
+ ;;
+esac
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
diff --git a/m4/ax_cflags_strict_prototypes.m4 b/m4/ax_cflags_strict_prototypes.m4
new file mode 100644
index 0000000..de89677
--- /dev/null
+++ b/m4/ax_cflags_strict_prototypes.m4
@@ -0,0 +1,166 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cflags_strict_prototypes.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CFLAGS_STRICT_PROTOTYPES [(shellvar [,default, [A/NA]]
+#
+# DESCRIPTION
+#
+# Try to find a compiler option that requires strict prototypes.
+#
+# The sanity check is done by looking at sys/signal.h which has a set of
+# macro-definitions SIG_DFL and SIG_IGN that are cast to the local
+# signal-handler type. If that signal-handler type is not fully qualified
+# then the system headers are not seen as strictly prototype clean.
+#
+# For the GNU CC compiler it will be -fstrict-prototypes
+# -Wstrict-prototypes The result is added to the shellvar being CFLAGS by
+# default.
+#
+# DEFAULTS:
+#
+# - $1 shell-variable-to-add-to : CFLAGS
+# - $2 add-value-if-not-found : nothing
+# - $3 action-if-found : add value to shellvariable
+# - $4 action-if-not-found : nothing
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CFLAGS_STRICT_PROTOTYPES],[dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_strict_prototypes])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for strict prototypes],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic % -fstrict-prototypes -Wstrict-prototypes" dnl GCC
+ "-pedantic % -Wstrict-prototypes" dnl try to warn atleast
+ "-pedantic % -Wmissing-prototypes" dnl or another warning
+ "-pedantic % -Werror-implicit-function-declaration" dnl
+ "-pedantic % -Wimplicit-function-declaration" dnl
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+case ".$VAR" in
+ .|.no|.no,*) ;;
+ *) # sanity check with signal() from sys/signal.h
+ cp config.log config.tmp
+ AC_TRY_COMPILE([#include <signal.h>],[
+ if (signal (SIGINT, SIG_IGN) == SIG_DFL) return 1;
+ if (signal (SIGINT, SIG_IGN) != SIG_DFL) return 2;],
+ dnl the original did use test -n `$CC testprogram.c`
+ [if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
+then if test `diff config.log config.tmp | grep -i warning | wc -l` != 1
+then VAR="no, suppressed, signal.h," ; fi ; fi],
+ [VAR="no, suppressed, signal.h"])
+ rm config.tmp
+ ;;
+esac
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_STRICT_PROTOTYPES],[dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_strict_prototypes])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for strict prototypes],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic -Werror % -fstrict-prototypes -Wstrict-prototypes" dnl GCC
+ "-pedantic -Werror % -Wstrict-prototypes" dnl try to warn atleast
+ "-pedantic -Werror % -Wmissing-prototypes" dnl try to warn atleast
+ "-pedantic -Werror % -Werror-implicit-function-declaration" dnl
+ "-pedantic -Werror % -Wimplicit-function-declaration" dnl
+ "-pedantic % -Wstrict-prototypes %% no, unsupported in C++" dnl oops
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+case ".$VAR" in
+ .|.no|.no,*) ;;
+ *) # sanity check with signal() from sys/signal.h
+ cp config.log config.tmp
+ AC_TRY_COMPILE([#include <signal.h>],[
+ if (signal (SIGINT, SIG_IGN) == SIG_DFL) return 1;
+ if (signal (SIGINT, SIG_IGN) != SIG_DFL) return 2;],
+ dnl the original did use test -n `$CC testprogram.c`
+ [if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
+then if test `diff config.log config.tmp | grep -i warning | wc -l` != 1
+then VAR="no, suppressed, signal.h," ; fi ; fi],
+ [VAR="no, suppressed, signal.h"])
+ rm config.tmp
+ ;;
+esac
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
diff --git a/m4/ax_cflags_sun_option.m4 b/m4/ax_cflags_sun_option.m4
new file mode 100644
index 0000000..17cbf07
--- /dev/null
+++ b/m4/ax_cflags_sun_option.m4
@@ -0,0 +1,204 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cflags_sun_option.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CFLAGS_SUN_OPTION (optionflag [,[shellvar][,[A][,[NA]]])
+#
+# DESCRIPTION
+#
+# AX_CFLAGS_SUN_OPTION(+xtreme) would show a message as like "checking
+# CFLAGS for sun/cc +xtreme ... yes" and adds the optionflag to CFLAGS if
+# it is understood. You can override the shellvar-default of CFLAGS of
+# course. The order of arguments stems from the explicit macros like
+# AX_CFLAGS_WARN_ALL.
+#
+# The cousin AX_CXXFLAGS_SUN_OPTION would check for an option to add to
+# CXXFLAGS - and it uses the autoconf setup for C++ instead of C (since it
+# is possible to use different compilers for C and C++).
+#
+# The macro is a lot simpler than any special AX_CFLAGS_* macro (or
+# ac_cxx_rtti.m4 macro) but allows to check for arbitrary options.
+# However, if you use this macro in a few places, it would be great if you
+# would make up a new function-macro and submit it to the ac-archive.
+#
+# - $1 option-to-check-for : required ("-option" as non-value)
+# - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case)
+# - $3 action-if-found : add value to shellvariable
+# - $4 action-if-not-found : nothing
+#
+# note: in earlier versions, $1-$2 were swapped. We try to detect the
+# situation and accept a $2=~/-/ as being the old option-to-check-for.
+#
+# see also: AX_CFLAGS_GCC_OPTION for the widely used original variant.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CFLAGS_SUN_OPTION_OLD], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_sun_option_$2])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for sun/cc m4_ifval($2,$2,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "+xstrconst -Xc % m4_ifval($2,$2,-option)" dnl Solaris C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_SUN_OPTION_OLD], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_sun_option_$2])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for sun/cc m4_ifval($2,$2,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "+xstrconst -Xc % m4_ifval($2,$2,-option)" dnl Solaris C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl -----------------------------------------------------------------------
+
+AC_DEFUN([AX_CFLAGS_SUN_OPTION_NEW], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_sun_option_$1])dnl
+AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for sun/cc m4_ifval($1,$1,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "+xstrconst -Xc % m4_ifval($1,$1,-option)" dnl Solaris C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
+ m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_SUN_OPTION_NEW], [dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_sun_option_$1])dnl
+AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for sun/cc m4_ifval($1,$1,-option)],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "+xstrconst -Xc % m4_ifval($1,$1,-option)" dnl Solaris C
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
+ m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+AC_DEFUN([AX_CFLAGS_SUN_OPTION],[ifelse(m4_regexp([$2],[-]),-1,
+[AX_CFLAGS_SUN_OPTION_NEW($@)],[AX_CFLAGS_SUN_OPTION_OLD($@)])])
+
+AC_DEFUN([AX_CXXFLAGS_SUN_OPTION],[ifelse(m4_regexp([$2],[-]),-1,
+[AX_CXXFLAGS_SUN_OPTION_NEW($@)],[AX_CXXFLAGS_SUN_OPTION_OLD($@)])])
diff --git a/m4/ax_cflags_warn_all.m4 b/m4/ax_cflags_warn_all.m4
new file mode 100644
index 0000000..3140863
--- /dev/null
+++ b/m4/ax_cflags_warn_all.m4
@@ -0,0 +1,151 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cflags_warn_all.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
+#
+# DESCRIPTION
+#
+# Try to find a compiler option that enables most reasonable warnings.
+# This macro is directly derived from VL_PROG_CC_WARNINGS which is split
+# up into two AX_CFLAGS_WARN_ALL and AX_CFLAGS_WARN_ALL_ANSI
+#
+# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
+# result is added to the shellvar being CFLAGS by default.
+#
+# Currently this macro knows about GCC, Solaris C compiler, Digital Unix C
+# compiler, C for AIX Compiler, HP-UX C compiler, IRIX C compiler, NEC
+# SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos 10.0.0.8) C
+# compiler.
+#
+# - $1 shell-variable-to-add-to : CFLAGS
+# - $2 add-value-if-not-found : nothing
+# - $3 action-if-found : add value to shellvariable
+# - $4 action-if-not-found : nothing
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic % -Wall" dnl GCC
+ "-xstrconst % -v" dnl Solaris C
+ "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
+ "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
+ "-ansi -ansiE % -fullwarn" dnl IRIX
+ "+ESlit % +w1" dnl HP-UX C
+ "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
+ "-h conform % -h msglevel 2" dnl Cray C (Unicos)
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic % -Wall" dnl GCC
+ "-xstrconst % -v" dnl Solaris C
+ "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
+ "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
+ "-ansi -ansiE % -fullwarn" dnl IRIX
+ "+ESlit % +w1" dnl HP-UX C
+ "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
+ "-h conform % -h msglevel 2" dnl Cray C (Unicos)
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl implementation tactics:
+dnl the for-argument contains a list of options. The first part of
+dnl these does only exist to detect the compiler - usually it is
+dnl a global option to enable -ansi or -extrawarnings. All other
+dnl compilers will fail about it. That was needed since a lot of
+dnl compilers will give false positives for some option-syntax
+dnl like -Woption or -Xoption as they think of it is a pass-through
+dnl to later compile stages or something. The "%" is used as a
+dnl delimimiter. A non-option comment can be given after "%%" marks
+dnl which will be shown but not added to the respective C/CXXFLAGS.
diff --git a/m4/ax_cflags_warn_all_ansi.m4 b/m4/ax_cflags_warn_all_ansi.m4
new file mode 100644
index 0000000..550fc95
--- /dev/null
+++ b/m4/ax_cflags_warn_all_ansi.m4
@@ -0,0 +1,150 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cflags_warn_all_ansi.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CFLAGS_WARN_ALL_ANSI [(shellvar [,default, [A/NA]])]
+#
+# DESCRIPTION
+#
+# Try to find a compiler option that enables most reasonable warnings.
+# This macro is directly derived from VL_PROG_CC_WARNINGS which is split
+# up into two AX_CFLAGS_WARN_ALL and AX_CFLAGS_WARN_ALL_ANSI
+#
+# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
+# result is added to the shellvar being CFLAGS by default.
+#
+# Currently this macro knows about GCC, Solaris C compiler, Digital Unix C
+# compiler, C for AIX Compiler, HP-UX C compiler, IRIX C compiler, NEC
+# SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos 10.0.0.8) C
+# compiler.
+#
+# - $1 shell-variable-to-add-to : CFLAGS
+# - $2 add-value-if-not-found : nothing
+# - $3 action-if-found : add value to shellvariable
+# - $4 action-if-not-found : nothing
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CFLAGS_WARN_ALL_ANSI],[dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all_ansi])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum ansi warnings],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_C
+ ac_save_[]FLAGS="$[]FLAGS"
+# IRIX C compiler:
+# -use_readonly_const is the default for IRIX C,
+# puts them into .rodata, but they are copied later.
+# need to be "-G0 -rdatashared" for strictmode but
+# I am not sure what effect that has really. - guidod
+for ac_arg dnl
+in "-pedantic % -Wall -ansi -pedantic" dnl GCC
+ "-xstrconst % -v -Xc" dnl Solaris C
+ "-std1 % -verbose -w0 -warnprotos -std1" dnl Digital Unix
+ " % -qlanglvl=ansi -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
+ " % -ansi -ansiE -fullwarn" dnl IRIX
+ "+ESlit % +w1 -Aa" dnl HP-UX C
+ "-Xc % -pvctl[,]fullmsg -Xc" dnl NEC SX-5 (Super-UX 10)
+ "-h conform % -h msglevel 2 -h conform" dnl Cray C (Unicos)
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_WARN_ALL_ANSI],[dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all_ansi])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum ansi warnings],
+VAR,[VAR="no, unknown"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_[]FLAGS="$[]FLAGS"
+# IRIX C compiler:
+# -use_readonly_const is the default for IRIX C,
+# puts them into .rodata, but they are copied later.
+# need to be "-G0 -rdatashared" for strictmode but
+# I am not sure what effect that has really. - guidod
+for ac_arg dnl
+in "-pedantic % -Wall -ansi -pedantic" dnl GCC
+ "-xstrconst % -v -Xc" dnl Solaris C
+ "-std1 % -verbose -w0 -warnprotos -std1" dnl Digital Unix
+ " % -qlanglvl=ansi -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
+ " % -ansi -ansiE -fullwarn" dnl IRIX
+ "+ESlit % +w1 -Aa" dnl HP-UX C
+ "-Xc % -pvctl[,]fullmsg -Xc" dnl NEC SX-5 (Super-UX 10)
+ "-h conform % -h msglevel 2 -h conform" dnl Cray C (Unicos)
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_TRY_COMPILE([],[return 0;],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_RESTORE
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
diff --git a/m4/ax_check_aligned_access_required.m4 b/m4/ax_check_aligned_access_required.m4
new file mode 100644
index 0000000..4db04b0
--- /dev/null
+++ b/m4/ax_check_aligned_access_required.m4
@@ -0,0 +1,82 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_aligned_access_required.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_ALIGNED_ACCESS_REQUIRED
+#
+# DESCRIPTION
+#
+# While the x86 CPUs allow access to memory objects to be unaligned it
+# happens that most of the modern designs require objects to be aligned -
+# or they will fail with a buserror. That mode is quite known by
+# big-endian machines (sparc, etc) however the alpha cpu is little-
+# endian.
+#
+# The following function will test for aligned access to be required and
+# set a config.h define HAVE_ALIGNED_ACCESS_REQUIRED (name derived by
+# standard usage). Structures loaded from a file (or mmapped to memory)
+# should be accessed per-byte in that case to avoid segfault type errors.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CHECK_ALIGNED_ACCESS_REQUIRED],
+[AC_CACHE_CHECK([if pointers to integers require aligned access],
+ [ax_cv_have_aligned_access_required],
+ [AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+ char* string = malloc(40);
+ int i;
+ for (i=0; i < 40; i++) string[[i]] = i;
+ {
+ void* s = string;
+ int* p = s+1;
+ int* q = s+2;
+
+ if (*p == *q) { return 1; }
+ }
+ return 0;
+}
+ ],
+ [ax_cv_have_aligned_access_required=yes],
+ [ax_cv_have_aligned_access_required=no],
+ [ax_cv_have_aligned_access_required=no])
+ ])
+if test "$ax_cv_have_aligned_access_required" = yes ; then
+ AC_DEFINE([HAVE_ALIGNED_ACCESS_REQUIRED], [1],
+ [Define if pointers to integers require aligned access])
+fi
+])
diff --git a/m4/ax_check_awk__v.m4 b/m4/ax_check_awk__v.m4
new file mode 100644
index 0000000..53b10be
--- /dev/null
+++ b/m4/ax_check_awk__v.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk__v.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK__V([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports -v option ($AWK -v var=val '<PROGRAM>'). If
+# successful execute ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK__V],[
+ AC_REQUIRE([AX_NEED_AWK])
+
+ AC_MSG_CHECKING([if $AWK supports -v option])
+
+ ax_try_awk_output=`echo "" | $AWK -v variable=A '{ print variable; }' 2> /dev/null`
+ AS_IF([test $? -eq 0],[
+ AS_IF([test "X$ax_try_awk_output" = "XA"],[
+ AC_MSG_RESULT([yes])
+ $1
+ ],[
+ AC_MSG_RESULT([no])
+ $2
+ ])
+ ],[
+ AC_MSG_RESULT([no])
+ $2
+ ])
+])
diff --git a/m4/ax_check_awk__x_escapes.m4 b/m4/ax_check_awk__x_escapes.m4
new file mode 100644
index 0000000..e153192
--- /dev/null
+++ b/m4/ax_check_awk__x_escapes.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk__x_escapes.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK__X_ESCAPES([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports \x escape codes. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK__X_ESCAPES], [
+ AX_TRY_AWK_EXPOUT([\x escapes],
+ [],[ if ( "\x41" != "A" ) exit (1) ],[],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_and.m4 b/m4/ax_check_awk_and.m4
new file mode 100644
index 0000000..1616c4d
--- /dev/null
+++ b/m4/ax_check_awk_and.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_and.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_AND([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports and() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_AND], [
+ AX_TRY_AWK_EXPOUT([and()],
+ [],[ print and(1,1) ],[1],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_argind.m4 b/m4/ax_check_awk_argind.m4
new file mode 100644
index 0000000..6f0e0c2
--- /dev/null
+++ b/m4/ax_check_awk_argind.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_argind.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_ARGIND([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports ARGIND variable. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_ARGIND], [
+ AX_TRY_AWK_EXPOUT([ARGIND],
+ [],[ if ( !ARGIND ) exit (1) ],[],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_array_delete.m4 b/m4/ax_check_awk_array_delete.m4
new file mode 100644
index 0000000..2152216
--- /dev/null
+++ b/m4/ax_check_awk_array_delete.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_array_delete.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_ARRAY_DELETE([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports delete on array. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_ARRAY_DELETE], [
+ AX_TRY_AWK_EXPOUT([array delete],
+ [],[ a[1]=1; delete a; if (a[1]!=0) exit (1) ],[],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_array_delete_elem.m4 b/m4/ax_check_awk_array_delete_elem.m4
new file mode 100644
index 0000000..00a54cd
--- /dev/null
+++ b/m4/ax_check_awk_array_delete_elem.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_array_delete_elem.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_ARRAY_DELETE_ELEM([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports delete on array element. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_ARRAY_DELETE_ELEM], [
+ AX_TRY_AWK_EXPOUT([array delete element],
+ [],[ a[1]=1; delete a[1]; if (a[1]!=0) exit (1) ],[],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_array_in.m4 b/m4/ax_check_awk_array_in.m4
new file mode 100644
index 0000000..73068d6
--- /dev/null
+++ b/m4/ax_check_awk_array_in.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_array_in.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_ARRAY_IN([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports 'in' on array. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_ARRAY_IN], [
+ AX_TRY_AWK_EXPOUT([array in],
+ [],[ i="x"; a[i]="1"; if (! (i in a)) exit (1) ],[],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_asort.m4 b/m4/ax_check_awk_asort.m4
new file mode 100644
index 0000000..cbabf90
--- /dev/null
+++ b/m4/ax_check_awk_asort.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_asort.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_ASORT([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports asort() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_ASORT], [
+ AX_TRY_AWK_EXPOUT([asort()],
+ [],[ s[1]="b"; s[2]="a"; if (asort(s) != 2) exit(1); print s[1] ],[a],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_asorti.m4 b/m4/ax_check_awk_asorti.m4
new file mode 100644
index 0000000..2ff9d62
--- /dev/null
+++ b/m4/ax_check_awk_asorti.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_asorti.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_ASORTI([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports asorti() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_ASORTI], [
+ AX_TRY_AWK_EXPOUT([asorti()],
+ [],[ s[1]="b"; s[2]="a"; if (asorti(s) != 2) exit(1); print s[1] ],[1],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_associative_array.m4 b/m4/ax_check_awk_associative_array.m4
new file mode 100644
index 0000000..101997c
--- /dev/null
+++ b/m4/ax_check_awk_associative_array.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_associative_array.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_ASSOCIATIVE_ARRAY([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports associative array. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_ASSOCIATIVE_ARRAY], [
+ AX_TRY_AWK_EXPOUT([associative array],
+ [],[ a ["i"] = "x"; print a ["i"] ],[x],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_atan2.m4 b/m4/ax_check_awk_atan2.m4
new file mode 100644
index 0000000..2f2d282
--- /dev/null
+++ b/m4/ax_check_awk_atan2.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_atan2.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_ATAN2([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports atan2() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_ATAN2], [
+ AX_TRY_AWK_EXPOUT([atan2()],
+ [],[ print atan2(0, 1) ],[0],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_compl.m4 b/m4/ax_check_awk_compl.m4
new file mode 100644
index 0000000..1bdb3ea
--- /dev/null
+++ b/m4/ax_check_awk_compl.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_compl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_COMPL([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports compl() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_COMPL], [
+ AX_TRY_AWK_ANYOUT([compl()],
+ [],[ print compl(10) ],[],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_conditional_expression.m4 b/m4/ax_check_awk_conditional_expression.m4
new file mode 100644
index 0000000..3166e6b
--- /dev/null
+++ b/m4/ax_check_awk_conditional_expression.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_conditional_expression.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_CONDITIONAL_EXPRESSION([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports conditional expression (e.g. x = y ? 5 : 6). If
+# successful execute ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_CONDITIONAL_EXPRESSION], [
+ AX_TRY_AWK_EXPOUT([conditional expression],
+ [],[ a=(1)?("y"):("n"); print a ],[y],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_cos.m4 b/m4/ax_check_awk_cos.m4
new file mode 100644
index 0000000..668c049
--- /dev/null
+++ b/m4/ax_check_awk_cos.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_cos.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_COS([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports cos() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_COS], [
+ AX_TRY_AWK_EXPOUT([cos()],
+ [],[ print cos(0) ],[1],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_environ.m4 b/m4/ax_check_awk_environ.m4
new file mode 100644
index 0000000..68766ae
--- /dev/null
+++ b/m4/ax_check_awk_environ.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_environ.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_ENVIRON([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports ENVIRON variable. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_ENVIRON], [
+ AX_TRY_AWK_EXPOUT([ENVIRON],
+ [],[ if ( !ENVIRON["PATH"] ) exit (1) ],[],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_errno.m4 b/m4/ax_check_awk_errno.m4
new file mode 100644
index 0000000..d0a070b
--- /dev/null
+++ b/m4/ax_check_awk_errno.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_errno.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_ERRNO([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports ERRNO variable. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_ERRNO], [
+ AX_TRY_AWK_EXPOUT([ERRNO],
+ [],[ getline s < "./this_file_should_not_exist"; if ( !ERRNO ) exit (1) ],[],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_exit.m4 b/m4/ax_check_awk_exit.m4
new file mode 100644
index 0000000..3b742f5
--- /dev/null
+++ b/m4/ax_check_awk_exit.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_exit.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_EXIT([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports exit(). If successful execute ACTION-IF-SUCCESS
+# otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_EXIT],[
+ AC_REQUIRE([AX_NEED_AWK])
+
+ AC_MSG_CHECKING([if $AWK supports exit()])
+ echo "" | $AWK '{ exit(99); }' 2>/dev/null
+ AS_IF([test $? -eq 99],[
+ AC_MSG_RESULT([yes])
+ $1
+ ],[
+ AC_MSG_RESULT([no])
+ $2
+ ])
+])
diff --git a/m4/ax_check_awk_exp.m4 b/m4/ax_check_awk_exp.m4
new file mode 100644
index 0000000..517c9a9
--- /dev/null
+++ b/m4/ax_check_awk_exp.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_exp.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_EXP([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports exp() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_EXP], [
+ AX_TRY_AWK_EXPOUT([exp()],
+ [],[ print exp(0) ],[1],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_gensub.m4 b/m4/ax_check_awk_gensub.m4
new file mode 100644
index 0000000..a5041a3
--- /dev/null
+++ b/m4/ax_check_awk_gensub.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_gensub.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_GENSUB([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports gensub() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_GENSUB], [
+ AX_TRY_AWK_EXPOUT([gensub()],
+ [],[ print gensub(/u/, "x", "g", "uu") ],[xx],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_getline.m4 b/m4/ax_check_awk_getline.m4
new file mode 100644
index 0000000..69eb11e
--- /dev/null
+++ b/m4/ax_check_awk_getline.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_getline.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_GETLINE([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports getline function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_GETLINE], [
+ AX_TRY_AWK_ANYOUT([getline],
+ [1],[ getline; if ( $][0 != "1" ) exit (1) ],[],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_gsub.m4 b/m4/ax_check_awk_gsub.m4
new file mode 100644
index 0000000..811d1b5
--- /dev/null
+++ b/m4/ax_check_awk_gsub.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_gsub.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_GSUB([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports gsub() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_GSUB], [
+ AX_TRY_AWK_EXPOUT([gsub()],
+ [],[ s = "AB"; gsub(/./, "X", s); print s ],[XX],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_ignorecase.m4 b/m4/ax_check_awk_ignorecase.m4
new file mode 100644
index 0000000..da6fd4a
--- /dev/null
+++ b/m4/ax_check_awk_ignorecase.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_ignorecase.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_IGNORECASE([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports IGNORECASE variable. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_IGNORECASE], [
+ AX_TRY_AWK_EXPOUT([IGNORECASE],
+ [],[ IGNORECASE = 1; if ( !("A" ~ "a") ) exit (1) ],[],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_index.m4 b/m4/ax_check_awk_index.m4
new file mode 100644
index 0000000..2370873
--- /dev/null
+++ b/m4/ax_check_awk_index.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_index.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_INDEX([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports index() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_INDEX], [
+ AX_TRY_AWK_EXPOUT([index[]()],
+ [],[ print index("AB", "B") ],[2],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_int.m4 b/m4/ax_check_awk_int.m4
new file mode 100644
index 0000000..09c5a05
--- /dev/null
+++ b/m4/ax_check_awk_int.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_int.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_INT([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports int() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_INT], [
+ AX_TRY_AWK_EXPOUT([int()],
+ [],[ print int(1.5) ],[1],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_length.m4 b/m4/ax_check_awk_length.m4
new file mode 100644
index 0000000..c05808a
--- /dev/null
+++ b/m4/ax_check_awk_length.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_length.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_LENGTH([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports length() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_LENGTH], [
+ AX_TRY_AWK_EXPOUT([length()],
+ [],[ print length("A") ],[1],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_log.m4 b/m4/ax_check_awk_log.m4
new file mode 100644
index 0000000..c43a0c8
--- /dev/null
+++ b/m4/ax_check_awk_log.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_log.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_LOG([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports log() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_LOG], [
+ AX_TRY_AWK_EXPOUT([log()],
+ [],[ print log(1) ],[0],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_lshift.m4 b/m4/ax_check_awk_lshift.m4
new file mode 100644
index 0000000..5d1452f
--- /dev/null
+++ b/m4/ax_check_awk_lshift.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_lshift.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_LSHIFT([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports lshift() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_LSHIFT], [
+ AX_TRY_AWK_EXPOUT([lshift()],
+ [],[ print lshift(10,1) ],[20],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_match_2parms.m4 b/m4/ax_check_awk_match_2parms.m4
new file mode 100644
index 0000000..08bbdf4
--- /dev/null
+++ b/m4/ax_check_awk_match_2parms.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_match_2parms.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_MATCH_2PARMS([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports match() function with 2 parameters (standard). If
+# successful execute ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_MATCH_2PARMS], [
+ AX_TRY_AWK_EXPOUT([match() with 2 parameters],
+ [],[ print match("ab", /b/) ],[2],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_match_3parms.m4 b/m4/ax_check_awk_match_3parms.m4
new file mode 100644
index 0000000..94c47f8
--- /dev/null
+++ b/m4/ax_check_awk_match_3parms.m4
@@ -0,0 +1,33 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_match_3parms.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_MATCH_3PARMS([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports match() function with 3 parameters (GNU
+# extension). If successful execute ACTION-IF-SUCCESS otherwise
+# ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_MATCH_3PARMS], [
+ AX_TRY_AWK_EXPOUT([match() with 3 parameters],
+ [],[ match("abc", /(b)/, a) ; print a[1]],[b],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_operator_multiply_multiply.m4 b/m4/ax_check_awk_operator_multiply_multiply.m4
new file mode 100644
index 0000000..5e8d933
--- /dev/null
+++ b/m4/ax_check_awk_operator_multiply_multiply.m4
@@ -0,0 +1,32 @@
+# ==============================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_operator_multiply_multiply.html
+# ==============================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_OPERATOR_MULTIPLY_MULTIPLY([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports the '**' operator. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_OPERATOR_MULTIPLY_MULTIPLY], [
+ AX_TRY_AWK_EXPOUT([operator **],
+ [],[ print 2**2 ],[4],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_operator_square.m4 b/m4/ax_check_awk_operator_square.m4
new file mode 100644
index 0000000..5f23910
--- /dev/null
+++ b/m4/ax_check_awk_operator_square.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_operator_square.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_OPERATOR_SQUARE([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports the '^' operator. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_OPERATOR_SQUARE], [
+ AX_TRY_AWK_EXPOUT([operator ^],
+ [],[ print 2^2 ],[4],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_or.m4 b/m4/ax_check_awk_or.m4
new file mode 100644
index 0000000..56aa872
--- /dev/null
+++ b/m4/ax_check_awk_or.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_or.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_OR([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports or() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_OR], [
+ AX_TRY_AWK_EXPOUT([or()],
+ [],[ print or(1,0) ],[1],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_printf.m4 b/m4/ax_check_awk_printf.m4
new file mode 100644
index 0000000..3e2bc7b
--- /dev/null
+++ b/m4/ax_check_awk_printf.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_printf.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_PRINTF([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports printf() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_PRINTF], [
+ AX_TRY_AWK_EXPOUT([printf()],
+ [],[ printf("%s\n", "X") ],[X],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_rand.m4 b/m4/ax_check_awk_rand.m4
new file mode 100644
index 0000000..5774be4
--- /dev/null
+++ b/m4/ax_check_awk_rand.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_rand.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_RAND([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports rand() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_RAND], [
+ AX_TRY_AWK_ANYOUT([rand()],
+ [],[ print rand() ],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_rshift.m4 b/m4/ax_check_awk_rshift.m4
new file mode 100644
index 0000000..41566cd
--- /dev/null
+++ b/m4/ax_check_awk_rshift.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_rshift.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_RSHIFT([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports rshift() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_RSHIFT], [
+ AX_TRY_AWK_EXPOUT([rshift()],
+ [],[ print rshift(10,1) ],[5],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_sin.m4 b/m4/ax_check_awk_sin.m4
new file mode 100644
index 0000000..ac47a33
--- /dev/null
+++ b/m4/ax_check_awk_sin.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_sin.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_SIN([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports sin() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_SIN], [
+ AX_TRY_AWK_EXPOUT([sin()],
+ [],[ print sin(0) ],[0],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_split.m4 b/m4/ax_check_awk_split.m4
new file mode 100644
index 0000000..21a822a
--- /dev/null
+++ b/m4/ax_check_awk_split.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_split.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_SPLIT([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports split() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_SPLIT], [
+ AX_TRY_AWK_EXPOUT([split()],
+ [],[ print split("A B", a, " ") ],[2],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_sprintf.m4 b/m4/ax_check_awk_sprintf.m4
new file mode 100644
index 0000000..ba72731
--- /dev/null
+++ b/m4/ax_check_awk_sprintf.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_sprintf.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_SPRINTF([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports sprintf() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_SPRINTF], [
+ AX_TRY_AWK_EXPOUT([sprintf()],
+ [],[ print sprintf("%.1s", "AB") ],[A],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_sqrt.m4 b/m4/ax_check_awk_sqrt.m4
new file mode 100644
index 0000000..9725894
--- /dev/null
+++ b/m4/ax_check_awk_sqrt.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_sqrt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_SQRT([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports sqrt() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_SQRT], [
+ AX_TRY_AWK_EXPOUT([sqrt()],
+ [],[ print sqrt(1) ],[1],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_srand.m4 b/m4/ax_check_awk_srand.m4
new file mode 100644
index 0000000..000894e
--- /dev/null
+++ b/m4/ax_check_awk_srand.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_srand.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_SRAND([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports srand() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_SRAND], [
+ AX_TRY_AWK_EXPOUT([srand()],
+ [],[ srand() ],[],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_strftime.m4 b/m4/ax_check_awk_strftime.m4
new file mode 100644
index 0000000..134c672
--- /dev/null
+++ b/m4/ax_check_awk_strftime.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_strftime.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_STRFTIME([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports strftime() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_STRFTIME], [
+ AX_TRY_AWK_EXPOUT([strftime()],
+ [],[ print strftime("%d.%m.%y", 0) ],[01.01.70],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_strtonum.m4 b/m4/ax_check_awk_strtonum.m4
new file mode 100644
index 0000000..df18662
--- /dev/null
+++ b/m4/ax_check_awk_strtonum.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_strtonum.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_STRTONUM([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports strtonum() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_STRTONUM], [
+ AX_TRY_AWK_EXPOUT([strtonum()],
+ [],[ print strtonum(15) ],[15],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_sub.m4 b/m4/ax_check_awk_sub.m4
new file mode 100644
index 0000000..f702890
--- /dev/null
+++ b/m4/ax_check_awk_sub.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_sub.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_SUB([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports sub() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_SUB], [
+ AX_TRY_AWK_EXPOUT([sub()],
+ [],[ s = "AB"; sub(/./, "X", s); print s ],[XB],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_substr.m4 b/m4/ax_check_awk_substr.m4
new file mode 100644
index 0000000..6fe6478
--- /dev/null
+++ b/m4/ax_check_awk_substr.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_substr.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_SUBSTR([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports substr() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_SUBSTR], [
+ AX_TRY_AWK_EXPOUT([substr()],
+ [],[ print substr("AB", 2, 1) ],[B],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_system.m4 b/m4/ax_check_awk_system.m4
new file mode 100644
index 0000000..c029387
--- /dev/null
+++ b/m4/ax_check_awk_system.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_system.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_SYSTEM([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports system() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_SYSTEM], [
+ AX_TRY_AWK_EXPOUT([system()],
+ [],[ system(":") ],[],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_systime.m4 b/m4/ax_check_awk_systime.m4
new file mode 100644
index 0000000..c723b09
--- /dev/null
+++ b/m4/ax_check_awk_systime.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_systime.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_SYSTIME([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports systime() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_SYSTIME], [
+ AX_TRY_AWK_ANYOUT([systime()],
+ [],[ print systime() ],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_tolower.m4 b/m4/ax_check_awk_tolower.m4
new file mode 100644
index 0000000..50f5e10
--- /dev/null
+++ b/m4/ax_check_awk_tolower.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_tolower.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_TOLOWER([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports tolower() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_TOLOWER], [
+ AX_TRY_AWK_EXPOUT([tolower()],
+ [],[ print tolower("A") ],[a],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_toupper.m4 b/m4/ax_check_awk_toupper.m4
new file mode 100644
index 0000000..71e438b
--- /dev/null
+++ b/m4/ax_check_awk_toupper.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_toupper.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_TOUPPER([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports toupper() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_TOUPPER], [
+ AX_TRY_AWK_EXPOUT([toupper()],
+ [],[ print toupper("a") ],[A],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_user_defined_functions.m4 b/m4/ax_check_awk_user_defined_functions.m4
new file mode 100644
index 0000000..b3472b3
--- /dev/null
+++ b/m4/ax_check_awk_user_defined_functions.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_user_defined_functions.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_USER_DEFINED_FUNCTIONS([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports user defined functions. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_USER_DEFINED_FUNCTIONS],[
+ AC_REQUIRE([AX_NEED_AWK])
+
+ AC_MSG_CHECKING([if $AWK supports user defined functions])
+
+ ax_awk_command=`echo "" | $AWK 'function mydouble(x) { return 2*x ; } ; { print mydouble(1) ; }' 2> /dev/null`
+ AS_IF([test $? -eq 0],[
+ AS_IF([test X"$ax_awk_command" = X"2"],[
+ AC_MSG_RESULT([yes])
+ $1
+ ],[
+ AC_MSG_RESULT([no])
+ $2
+ ])
+ ],[
+ AC_MSG_RESULT([no])
+ $2
+ ])
+])
diff --git a/m4/ax_check_awk_var_regexp.m4 b/m4/ax_check_awk_var_regexp.m4
new file mode 100644
index 0000000..e9794fc
--- /dev/null
+++ b/m4/ax_check_awk_var_regexp.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_var_regexp.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_VAR_REGEXP([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports variable regexp. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_VAR_REGEXP], [
+ AX_TRY_AWK_EXPOUT([variable regexp],
+ [],[ r="x"; if ( "x" ~ r ) print "yes" ],[yes],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_awk_variable_value_pairs.m4 b/m4/ax_check_awk_variable_value_pairs.m4
new file mode 100644
index 0000000..a18d1ae
--- /dev/null
+++ b/m4/ax_check_awk_variable_value_pairs.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_variable_value_pairs.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_VARIABLE_VALUE_PAIRS([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports variable=value pairs ($AWK '<PROGRAM>' var=val).
+# If successful execute ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_VARIABLE_VALUE_PAIRS],[
+ AC_REQUIRE([AX_NEED_AWK])
+
+ AC_MSG_CHECKING([if $AWK supports variable=value pairs])
+
+ ax_try_awk_output=`echo "" | $AWK '{ print variable; }' variable=A 2> /dev/null`
+ AS_IF([test $? -eq 0],[
+ AS_IF([test "X$ax_try_awk_output" = "XA"],[
+ AC_MSG_RESULT([yes])
+ $1
+ ],[
+ AC_MSG_RESULT([no])
+ $2
+ ])
+ ],[
+ AC_MSG_RESULT([no])
+ $2
+ ])
+])
diff --git a/m4/ax_check_awk_xor.m4 b/m4/ax_check_awk_xor.m4
new file mode 100644
index 0000000..1ea1e1a
--- /dev/null
+++ b/m4/ax_check_awk_xor.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_awk_xor.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_AWK_XOR([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Check if AWK supports xor() function. If successful execute
+# ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_AWK_XOR], [
+ AX_TRY_AWK_EXPOUT([xor()],
+ [],[ print xor(1,0) ],[1],
+ [$1],[$2])
+])
diff --git a/m4/ax_check_compiler_flags.m4 b/m4/ax_check_compiler_flags.m4
new file mode 100644
index 0000000..21f9e6f
--- /dev/null
+++ b/m4/ax_check_compiler_flags.m4
@@ -0,0 +1,74 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_compiler_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_COMPILER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
+#
+# DESCRIPTION
+#
+# Check whether the given compiler FLAGS work with the current language's
+# compiler, or whether they give an error. (Warnings, however, are
+# ignored.)
+#
+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+# success/failure.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
+# Copyright (c) 2009 Matteo Frigo
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CHECK_COMPILER_FLAGS],
+[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
+AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1])
+dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
+AS_LITERAL_IF([$1],
+ [AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]), [
+ ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
+ _AC_LANG_PREFIX[]FLAGS="$1"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+ AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes,
+ AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no)
+ _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])],
+ [ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
+ _AC_LANG_PREFIX[]FLAGS="$1"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+ eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes,
+ eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no)
+ _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])
+eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])
+AC_MSG_RESULT($ax_check_compiler_flags)
+if test "x$ax_check_compiler_flags" = xyes; then
+ m4_default([$2], :)
+else
+ m4_default([$3], :)
+fi
+])dnl AX_CHECK_COMPILER_FLAGS
diff --git a/m4/ax_check_define.m4 b/m4/ax_check_define.m4
new file mode 100644
index 0000000..b56a9a8
--- /dev/null
+++ b/m4/ax_check_define.m4
@@ -0,0 +1,88 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_define.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_DEFINE([symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
+# AX_CHECK_DEFINE([includes],[symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
+#
+# DESCRIPTION
+#
+# Complements AC_CHECK_FUNC but it does not check for a function but for a
+# define to exist. Consider a usage like:
+#
+# AC_CHECK_DEFINE(__STRICT_ANSI__, CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500")
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AC_CHECK_DEFINED],[
+AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$1])dnl
+AC_CACHE_CHECK([for $1 defined], ac_var,
+AC_TRY_COMPILE(,[
+ #ifdef $1
+ int ok;
+ #else
+ choke me
+ #endif
+],AS_VAR_SET(ac_var, yes),AS_VAR_SET(ac_var, no)))
+AS_IF([test AS_VAR_GET(ac_var) != "no"], [$2], [$3])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])
+
+AC_DEFUN([AX_CHECK_DEFINED],[
+AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$2])dnl
+AC_CACHE_CHECK([for $1 defined], ac_var,
+AC_TRY_COMPILE($1,[
+ #ifndef $2
+ int ok;
+ #else
+ choke me
+ #endif
+],AS_VAR_SET(ac_var, yes),AS_VAR_SET(ac_var, no)))
+AS_IF([test AS_VAR_GET(ac_var) != "no"], [$3], [$4])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])
+
+AC_DEFUN([AX_CHECK_FUNC],
+[AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$2])dnl
+AC_CACHE_CHECK([for $2], ac_var,
+dnl AC_LANG_FUNC_LINK_TRY
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([$1
+ #undef $2
+ char $2 ();],[
+ char (*f) () = $2;
+ return f != $2; ])],
+ [AS_VAR_SET(ac_var, yes)],
+ [AS_VAR_SET(ac_var, no)])])
+AS_IF([test AS_VAR_GET(ac_var) = yes], [$3], [$4])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])# AC_CHECK_FUNC
diff --git a/m4/ax_check_gd.m4 b/m4/ax_check_gd.m4
new file mode 100644
index 0000000..cf670da
--- /dev/null
+++ b/m4/ax_check_gd.m4
@@ -0,0 +1,79 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_gd.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_GD
+#
+# DESCRIPTION
+#
+# Check for the gd library. (See http://www.boutell.com/gd/) If gd is
+# found, the output variables GD_CFLAGS, GD_LDFLAGS and GD_LIBS will
+# contain the compiler flags, linker flags and libraries necessary to use
+# gd; otherwise, those variables will be empty. In addition, the symbol
+# HAVE_GD is defined if the library is found, and the symbols HAVE_GD_GIF,
+# HAVE_GD_JPEG and HAVE_GD_PNG are defined if the lirbary supports
+# creating images in gif, jpeg and png formats, respectively.
+#
+# The user may use --with-gd=no or --without-gd to skip checking for the
+# library. (The default is --with-gd=yes.) If the library is installed in
+# an unusual location, --with-gd=DIR will cause the macro to look for
+# gdlib-config in DIR/bin or, failing that, for the headers and libraries
+# in DIR/include and DIR/lib.
+#
+# Feedback welcome!
+#
+# LICENSE
+#
+# Copyright (c) 2008 Nick Markham <markhn@rpi.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_GD], [
+ AC_ARG_WITH(gd,
+ AC_HELP_STRING([--with-gd(=DIR)], [use the gd library (in DIR)]),,
+ with_gd=yes)
+
+ if test "$with_gd" != no; then
+ AC_PATH_PROG(GDLIB_CONFIG, gdlib-config, , [$with_gd/bin:$PATH])
+ if test -n "$GDLIB_CONFIG"; then
+ GD_CFLAGS=`$GDLIB_CONFIG --cflags`
+ GD_LDFLAGS=`$GDLIB_CONFIG --ldflags`
+ GD_LIBS=`$GDLIB_CONFIG --libs`
+ elif test -d "$with_gd"; then
+ GD_CFLAGS="-I$with_gd/include"
+ GD_LDFLAGS="-L$with_gd/lib"
+ AC_CHECK_LIB(z, inflateReset, GD_LIBS="-lz")
+ AC_CHECK_LIB(png, png_check_sig, GD_LIBS="-lpng $GD_LIBS", , $GD_LIBS)
+ fi
+
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$GD_CFLAGS $CFLAGS"
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$GD_LDFLAGS $LDFLAGS"
+
+ AC_CHECK_LIB(gd, gdImageCreate, [
+ AC_DEFINE(HAVE_GD, 1, [ Define if you have gd library. ])
+ AC_CHECK_LIB(gd, gdImageGif, AC_DEFINE(HAVE_GD_GIF, 1, [ Define if GD supports gif. ]), , "$GD_LIBS")
+ AC_CHECK_LIB(gd, gdImageJpeg, AC_DEFINE(HAVE_GD_JPEG, 1, [ Define if GD supports jpeg. ]), , "$GD_LIBS")
+ AC_CHECK_LIB(gd, gdImagePng, AC_DEFINE(HAVE_GD_PNG, 1, [ Define if GD supports png. ]), , "$GD_LIBS")
+ GD_LIBS="-lgd $GD_LIBS"
+ ], with_gd=no, $GD_LIBS)
+
+ CFLAGS="$save_CFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ fi
+
+ if test "$with_gd" = "no"; then
+ GD_CFLAGS="";
+ GD_LDFLAGS="";
+ GD_LIBS="";
+ fi
+
+ AC_SUBST(GD_CFLAGS)
+ AC_SUBST(GD_LDFLAGS)
+ AC_SUBST(GD_LIBS)
+])
diff --git a/m4/ax_check_gl.m4 b/m4/ax_check_gl.m4
new file mode 100644
index 0000000..c400249
--- /dev/null
+++ b/m4/ax_check_gl.m4
@@ -0,0 +1,132 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_gl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_GL
+#
+# DESCRIPTION
+#
+# Check for an OpenGL implementation. If GL is found, the required
+# compiler and linker flags are included in the output variables
+# "GL_CFLAGS" and "GL_LIBS", respectively. If no usable GL implementation
+# is found, "no_gl" is set to "yes".
+#
+# If the header "GL/gl.h" is found, "HAVE_GL_GL_H" is defined. If the
+# header "OpenGL/gl.h" is found, HAVE_OPENGL_GL_H is defined. These
+# preprocessor definitions may not be mutually exclusive.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CHECK_GL],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PATH_X])dnl
+AC_REQUIRE([ACX_PTHREAD])dnl
+
+AC_LANG_PUSH([C])
+AX_LANG_COMPILER_MS
+AS_IF([test X$ax_compiler_ms = Xno],
+ [GL_CFLAGS="${PTHREAD_CFLAGS}"; GL_LIBS="${PTHREAD_LIBS} -lm"])
+
+#
+# Use x_includes and x_libraries if they have been set (presumably by
+# AC_PATH_X).
+#
+AS_IF([test "X$no_x" != "Xyes"],
+ [AS_IF([test -n "$x_includes"],
+ [GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}"])]
+ AS_IF([test -n "$x_libraries"],
+ [GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}"]))
+
+ax_save_CPPFLAGS="${CPPFLAGS}"
+CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
+AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h])
+CPPFLAGS="${ax_save_CPPFLAGS}"
+
+AC_CHECK_HEADERS([windows.h])
+
+m4_define([AX_CHECK_GL_PROGRAM],
+ [AC_LANG_PROGRAM([[
+# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
+# include <windows.h>
+# endif
+# ifdef HAVE_GL_GL_H
+# include <GL/gl.h>
+# elif defined(HAVE_OPENGL_GL_H)
+# include <OpenGL/gl.h>
+# else
+# error no gl.h
+# endif]],
+ [[glBegin(0)]])])
+
+AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl],
+[ax_cv_check_gl_libgl="no"
+case $host_cpu in
+ x86_64) ax_check_gl_libdir=lib64 ;;
+ *) ax_check_gl_libdir=lib ;;
+esac
+ax_save_CPPFLAGS="${CPPFLAGS}"
+CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
+ax_save_LIBS="${LIBS}"
+LIBS=""
+ax_check_libs="-lopengl32 -lGL"
+for ax_lib in ${ax_check_libs}; do
+ AS_IF([test X$ax_compiler_ms = Xyes],
+ [ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`],
+ [ax_try_lib="${ax_lib}"])
+ LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
+AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM],
+ [ax_cv_check_gl_libgl="${ax_try_lib}"; break],
+ [ax_check_gl_nvidia_flags="-L/usr/${ax_check_gl_libdir}/nvidia" LIBS="${ax_try_lib} ${ax_check_gl_nvidia_flags} ${GL_LIBS} ${ax_save_LIBS}"
+AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM],
+ [ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_nvidia_flags}"; break],
+ [ax_check_gl_dylib_flag='-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' LIBS="${ax_try_lib} ${ax_check_gl_dylib_flag} ${GL_LIBS} ${ax_save_LIBS}"
+AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM],
+ [ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_dylib_flag}"; break])])])
+done
+
+AS_IF([test "X$ax_cv_check_gl_libgl" = Xno -a "X$no_x" = Xyes],
+[LIBS='-framework OpenGL'
+AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM],
+ [ax_cv_check_gl_libgl="$LIBS"])])
+
+LIBS=${ax_save_LIBS}
+CPPFLAGS=${ax_save_CPPFLAGS}])
+
+AS_IF([test "X$ax_cv_check_gl_libgl" = Xno],
+ [no_gl=yes; GL_CFLAGS=""; GL_LIBS=""],
+ [GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}"])
+AC_LANG_POP([C])
+
+AC_SUBST([GL_CFLAGS])
+AC_SUBST([GL_LIBS])
+])dnl
diff --git a/m4/ax_check_glu.m4 b/m4/ax_check_glu.m4
new file mode 100644
index 0000000..54b1ef1
--- /dev/null
+++ b/m4/ax_check_glu.m4
@@ -0,0 +1,150 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_glu.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_GLU
+#
+# DESCRIPTION
+#
+# Check for GLU. If GLU is found, the required preprocessor and linker
+# flags are included in the output variables "GLU_CFLAGS" and "GLU_LIBS",
+# respectively. If no GLU implementation is found, "no_glu" is set to
+# "yes".
+#
+# If the header "GL/glu.h" is found, "HAVE_GL_GLU_H" is defined. If the
+# header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined. These
+# preprocessor definitions may not be mutually exclusive.
+#
+# Some implementations (in particular, some versions of Mac OS X) are
+# known to treat the GLU tesselator callback function type as "GLvoid
+# (*)(...)" rather than the standard "GLvoid (*)()". If the former
+# condition is detected, this macro defines "HAVE_VARARGS_GLU_TESSCB".
+#
+# LICENSE
+#
+# Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CHECK_GLU],
+[AC_REQUIRE([AX_CHECK_GL])dnl
+AC_REQUIRE([AC_PROG_CXX])dnl
+GLU_CFLAGS="${GL_CFLAGS}"
+
+ax_save_CPPFLAGS="${CPPFLAGS}"
+CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
+AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h])
+CPPFLAGS="${ax_save_CPPFLAGS}"
+
+m4_define([AX_CHECK_GLU_PROGRAM],
+ [AC_LANG_PROGRAM([[
+# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
+# include <windows.h>
+# endif
+# ifdef HAVE_GL_GLU_H
+# include <GL/glu.h>
+# elif defined(HAVE_OPENGL_GLU_H)
+# include <OpenGL/glu.h>
+# else
+# error no glu.h
+# endif]],
+ [[gluBeginCurve(0)]])])
+
+AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu],
+[ax_cv_check_glu_libglu="no"
+ax_save_CPPFLAGS="${CPPFLAGS}"
+CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
+ax_save_LIBS="${LIBS}"
+
+#
+# First, check for the possibility that everything we need is already in
+# GL_LIBS.
+#
+LIBS="${GL_LIBS} ${ax_save_LIBS}"
+#
+# libGLU typically links with libstdc++ on POSIX platforms.
+# However, setting the language to C++ means that test program
+# source is named "conftest.cc"; and Microsoft cl doesn't know what
+# to do with such a file.
+#
+AC_LANG_PUSH([C++])
+AS_IF([test X$ax_compiler_ms = Xyes],
+ [AC_LANG_PUSH([C])])
+AC_LINK_IFELSE(
+[AX_CHECK_GLU_PROGRAM],
+[ax_cv_check_glu_libglu=yes],
+[LIBS=""
+ax_check_libs="-lglu32 -lGLU"
+for ax_lib in ${ax_check_libs}; do
+ AS_IF([test X$ax_compiler_ms = Xyes],
+ [ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`],
+ [ax_try_lib="${ax_lib}"])
+ LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
+ AC_LINK_IFELSE([AX_CHECK_GLU_PROGRAM],
+ [ax_cv_check_glu_libglu="${ax_try_lib}"; break])
+done
+])
+AS_IF([test X$ax_compiler_ms = Xyes],
+ [AC_LANG_POP([C])])
+AC_LANG_POP([C++])
+
+LIBS=${ax_save_LIBS}
+CPPFLAGS=${ax_save_CPPFLAGS}])
+AS_IF([test "X$ax_cv_check_glu_libglu" = Xno],
+ [no_glu=yes; GLU_CFLAGS=""; GLU_LIBS=""],
+ [AS_IF([test "X$ax_cv_check_glu_libglu" = Xyes],
+ [GLU_LIBS="$GL_LIBS"],
+ [GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}"])])
+AC_SUBST([GLU_CFLAGS])
+AC_SUBST([GLU_LIBS])
+
+#
+# Some versions of Mac OS X include a broken interpretation of the GLU
+# tesselation callback function signature.
+#
+AS_IF([test "X$ax_cv_check_glu_libglu" != Xno],
+[AC_CACHE_CHECK([for varargs GLU tesselator callback function type],
+ [ax_cv_varargs_glu_tesscb],
+[ax_cv_varargs_glu_tesscb=no
+ax_save_CFLAGS="$CFLAGS"
+CFLAGS="$GL_CFLAGS $CFLAGS"
+AC_COMPILE_IFELSE(
+[AC_LANG_PROGRAM([[
+# ifdef HAVE_GL_GLU_H
+# include <GL/glu.h>
+# else
+# include <OpenGL/glu.h>
+# endif]],
+ [[GLvoid (*func)(...); gluTessCallback(0, 0, func)]])],
+[ax_cv_varargs_glu_tesscb=yes])
+CFLAGS="$ax_save_CFLAGS"])
+AS_IF([test X$ax_cv_varargs_glu_tesscb = Xyes],
+ [AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1],
+ [Use nonstandard varargs form for the GLU tesselator callback])])])
+])
diff --git a/m4/ax_check_glut.m4 b/m4/ax_check_glut.m4
new file mode 100644
index 0000000..7c49862
--- /dev/null
+++ b/m4/ax_check_glut.m4
@@ -0,0 +1,113 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_glut.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_GLUT
+#
+# DESCRIPTION
+#
+# Check for GLUT. If GLUT is found, the required compiler and linker flags
+# are included in the output variables "GLUT_CFLAGS" and "GLUT_LIBS",
+# respectively. If GLUT is not found, "no_glut" is set to "yes".
+#
+# If the header "GL/glut.h" is found, "HAVE_GL_GLUT_H" is defined. If the
+# header "GLUT/glut.h" is found, HAVE_GLUT_GLUT_H is defined. These
+# preprocessor definitions may not be mutually exclusive.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CHECK_GLUT],
+[AC_REQUIRE([AX_CHECK_GLU])dnl
+AC_REQUIRE([AC_PATH_XTRA])dnl
+
+ax_save_CPPFLAGS="${CPPFLAGS}"
+CPPFLAGS="${GLU_CFLAGS} ${CPPFLAGS}"
+AC_CHECK_HEADERS([GL/glut.h GLUT/glut.h])
+CPPFLAGS="${ax_save_CPPFLAGS}"
+
+GLUT_CFLAGS=${GLU_CFLAGS}
+GLUT_LIBS=${GLU_LIBS}
+
+m4_define([AX_CHECK_GLUT_PROGRAM],
+ [AC_LANG_PROGRAM([[
+# if HAVE_WINDOWS_H && defined(_WIN32)
+# include <windows.h>
+# endif
+# ifdef HAVE_GL_GLUT_H
+# include <GL/glut.h>
+# elif defined(HAVE_GLUT_GLUT_H)
+# include <GLUT/glut.h>
+# else
+# error no glut.h
+# endif]],
+ [[glutMainLoop()]])])
+
+#
+# If X is present, assume GLUT depends on it.
+#
+AS_IF([test X$no_x != Xyes],
+ [GLUT_LIBS="${X_PRE_LIBS} -lXmu -lXi ${X_EXTRA_LIBS} ${GLUT_LIBS}"])
+
+AC_CACHE_CHECK([for GLUT library], [ax_cv_check_glut_libglut],
+[ax_cv_check_glut_libglut="no"
+AC_LANG_PUSH(C)
+ax_save_CPPFLAGS="${CPPFLAGS}"
+CPPFLAGS="${GLUT_CFLAGS} ${CPPFLAGS}"
+ax_save_LIBS="${LIBS}"
+LIBS=""
+ax_check_libs="-lglut32 -lglut"
+for ax_lib in ${ax_check_libs}; do
+ AS_IF([test X$ax_compiler_ms = Xyes],
+ [ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`],
+ [ax_try_lib="${ax_lib}"])
+ LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}"
+ AC_LINK_IFELSE([AX_CHECK_GLUT_PROGRAM],
+ [ax_cv_check_glut_libglut="${ax_try_lib}"; break])
+done
+
+AS_IF([test "X$ax_cv_check_glut_libglut" = Xno -a "X$no_x" = Xyes],
+[LIBS='-framework GLUT'
+AC_LINK_IFELSE([AX_CHECK_GLUT_PROGRAM],
+ [ax_cv_check_glut_libglut="$LIBS"])])
+
+CPPFLAGS="${ax_save_CPPFLAGS}"
+LIBS="${ax_save_LIBS}"
+AC_LANG_POP(C)])
+
+AS_IF([test "X$ax_cv_check_glut_libglut" = Xno],
+ [no_glut="yes"; GLUT_CFLAGS=""; GLUT_LIBS=""],
+ [GLUT_LIBS="${ax_cv_check_glut_libglut} ${GLUT_LIBS}"])
+
+AC_SUBST([GLUT_CFLAGS])
+AC_SUBST([GLUT_LIBS])
+])dnl
diff --git a/m4/ax_check_linker_flags.m4 b/m4/ax_check_linker_flags.m4
new file mode 100644
index 0000000..dfbc004
--- /dev/null
+++ b/m4/ax_check_linker_flags.m4
@@ -0,0 +1,75 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_linker_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
+#
+# DESCRIPTION
+#
+# Check whether the given linker FLAGS work with the current language's
+# linker, or whether they give an error.
+#
+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+# success/failure.
+#
+# NOTE: Based on AX_CHECK_COMPILER_FLAGS.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
+# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
+# Copyright (c) 2009 Matteo Frigo
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CHECK_LINKER_FLAGS],
+[AC_MSG_CHECKING([whether the linker accepts $1])
+dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
+AS_LITERAL_IF([$1],
+ [AC_CACHE_VAL(AS_TR_SH(ax_cv_linker_flags_[$1]), [
+ ax_save_FLAGS=$LDFLAGS
+ LDFLAGS="$1"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+ AS_TR_SH(ax_cv_linker_flags_[$1])=yes,
+ AS_TR_SH(ax_cv_linker_flags_[$1])=no)
+ LDFLAGS=$ax_save_FLAGS])],
+ [ax_save_FLAGS=$LDFLAGS
+ LDFLAGS="$1"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+ eval AS_TR_SH(ax_cv_linker_flags_[$1])=yes,
+ eval AS_TR_SH(ax_cv_linker_flags_[$1])=no)
+ LDFLAGS=$ax_save_FLAGS])
+eval ax_check_linker_flags=$AS_TR_SH(ax_cv_linker_flags_[$1])
+AC_MSG_RESULT($ax_check_linker_flags)
+if test "x$ax_check_linker_flags" = xyes; then
+ m4_default([$2], :)
+else
+ m4_default([$3], :)
+fi
+])dnl AX_CHECK_LINKER_FLAGS
diff --git a/m4/ax_check_page_aligned_malloc.m4 b/m4/ax_check_page_aligned_malloc.m4
new file mode 100644
index 0000000..6111d98
--- /dev/null
+++ b/m4/ax_check_page_aligned_malloc.m4
@@ -0,0 +1,67 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_check_page_aligned_malloc.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_PAGE_ALIGNED_MALLOC
+#
+# DESCRIPTION
+#
+# Some operating systems (generally, BSD Unix variants) lack a
+# posix_memalign function, a memalign function, and a working (meaning,
+# the memory can be freed) valloc function. To make up for it, the malloc
+# function promises to return page-aligned addresses if more than one
+# page's worth of memory is allocated. AX_CHECK_PAGE_ALIGNED_MALLOC checks
+# for this condition and defines HAVE_PAGE_ALIGNED_MALLOC if the condition
+# holds.
+#
+# As an aside, note that valloc'd memory cannot safely be freed on all
+# operating systems. (Again, some flavors of BSD are the troublemakers.)
+# It's best to avoid using valloc in favor of posix_memalign, memalign, or
+# an aligned malloc as detected by AX_CHECK_PAGE_ALIGNED_MALLOC.
+#
+# Caveat: AX_CHECK_PAGE_ALIGNED_MALLOC takes a probabalistic approach. If
+# 100 calls to malloc all return page-aligned addresses, it assumes that
+# all calls will behave likewise. It is therefore possible -- albeit
+# extremely unlikely -- that AX_CHECK_PAGE_ALIGNED_MALLOC can return a
+# false positive.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Scott Pakin <pakin@uiuc.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_PAGE_ALIGNED_MALLOC],
+[AC_CACHE_CHECK([if large mallocs guarantee page-alignment],
+ [ax_cv_func_malloc_aligned],
+ [AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+int main()
+{
+ int pagesize = getpagesize();
+ int i;
+
+ for (i=0; i<100; i++)
+ if ((unsigned long)malloc(pagesize+1) & (pagesize-1))
+ exit (1);
+ exit (0);
+}
+ ],
+ [ax_cv_func_malloc_aligned=yes],
+ [ax_cv_func_malloc_aligned=no],
+ [ax_cv_func_malloc_aligned=no])
+ ])
+if test "$ax_cv_func_malloc_aligned" = yes ; then
+ AC_DEFINE([HAVE_PAGE_ALIGNED_MALLOC], [1],
+ [Define if `malloc'ing more than one page always returns a page-aligned address.])
+fi
+])
diff --git a/m4/ax_compare_version.m4 b/m4/ax_compare_version.m4
new file mode 100644
index 0000000..e22b50f
--- /dev/null
+++ b/m4/ax_compare_version.m4
@@ -0,0 +1,174 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_compare_version.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+#
+# DESCRIPTION
+#
+# This macro compares two version strings. Due to the various number of
+# minor-version numbers that can exist, and the fact that string
+# comparisons are not compatible with numeric comparisons, this is not
+# necessarily trivial to do in a autoconf script. This macro makes doing
+# these comparisons easy.
+#
+# The six basic comparisons are available, as well as checking equality
+# limited to a certain number of minor-version levels.
+#
+# The operator OP determines what type of comparison to do, and can be one
+# of:
+#
+# eq - equal (test A == B)
+# ne - not equal (test A != B)
+# le - less than or equal (test A <= B)
+# ge - greater than or equal (test A >= B)
+# lt - less than (test A < B)
+# gt - greater than (test A > B)
+#
+# Additionally, the eq and ne operator can have a number after it to limit
+# the test to that number of minor versions.
+#
+# eq0 - equal up to the length of the shorter version
+# ne0 - not equal up to the length of the shorter version
+# eqN - equal up to N sub-version levels
+# neN - not equal up to N sub-version levels
+#
+# When the condition is true, shell commands ACTION-IF-TRUE are run,
+# otherwise shell commands ACTION-IF-FALSE are run. The environment
+# variable 'ax_compare_version' is always set to either 'true' or 'false'
+# as well.
+#
+# Examples:
+#
+# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
+# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
+#
+# would both be true.
+#
+# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
+# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
+#
+# would both be false.
+#
+# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
+#
+# would be true because it is only comparing two minor versions.
+#
+# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
+#
+# would be true because it is only comparing the lesser number of minor
+# versions of the two values.
+#
+# Note: The characters that separate the version numbers do not matter. An
+# empty string is the same as version 0. OP is evaluated by autoconf, not
+# configure, so must be a string, not a variable.
+#
+# The author would like to acknowledge Guido Draheim whose advice about
+# the m4_case and m4_ifvaln functions make this macro only include the
+# portions necessary to perform the specific comparison specified by the
+# OP argument in the final configure script.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+dnl #########################################################################
+AC_DEFUN([AX_COMPARE_VERSION], [
+ AC_PROG_AWK
+
+ # Used to indicate true or false condition
+ ax_compare_version=false
+
+ # Convert the two version strings to be compared into a format that
+ # allows a simple string comparison. The end result is that a version
+ # string of the form 1.12.5-r617 will be converted to the form
+ # 0001001200050617. In other words, each number is zero padded to four
+ # digits, and non digits are removed.
+ AS_VAR_PUSHDEF([A],[ax_compare_version_A])
+ A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
+ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
+ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+ -e 's/[[^0-9]]//g'`
+
+ AS_VAR_PUSHDEF([B],[ax_compare_version_B])
+ B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
+ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
+ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+ -e 's/[[^0-9]]//g'`
+
+ dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
+ dnl # then the first line is used to determine if the condition is true.
+ dnl # The sed right after the echo is to remove any indented white space.
+ m4_case(m4_tolower($2),
+ [lt],[
+ ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
+ ],
+ [gt],[
+ ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
+ ],
+ [le],[
+ ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
+ ],
+ [ge],[
+ ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
+ ],[
+ dnl Split the operator from the subversion count if present.
+ m4_bmatch(m4_substr($2,2),
+ [0],[
+ # A count of zero means use the length of the shorter version.
+ # Determine the number of characters in A and B.
+ ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
+ ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
+
+ # Set A to no more than B's length and B to no more than A's length.
+ A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
+ B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
+ ],
+ [[0-9]+],[
+ # A count greater than zero means use only that many subversions
+ A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
+ B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
+ ],
+ [.+],[
+ AC_WARNING(
+ [illegal OP numeric parameter: $2])
+ ],[])
+
+ # Pad zeros at end of numbers to make same length.
+ ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
+ B="$B`echo $A | sed 's/./0/g'`"
+ A="$ax_compare_version_tmp_A"
+
+ # Check for equality or inequality as necessary.
+ m4_case(m4_tolower(m4_substr($2,0,2)),
+ [eq],[
+ test "x$A" = "x$B" && ax_compare_version=true
+ ],
+ [ne],[
+ test "x$A" != "x$B" && ax_compare_version=true
+ ],[
+ AC_WARNING([illegal OP parameter: $2])
+ ])
+ ])
+
+ AS_VAR_POPDEF([A])dnl
+ AS_VAR_POPDEF([B])dnl
+
+ dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
+ if test "$ax_compare_version" = "true" ; then
+ m4_ifvaln([$4],[$4],[:])dnl
+ m4_ifvaln([$5],[else $5])dnl
+ fi
+]) dnl AX_COMPARE_VERSION
diff --git a/m4/ax_compiler_vendor.m4 b/m4/ax_compiler_vendor.m4
new file mode 100644
index 0000000..2519a5f
--- /dev/null
+++ b/m4/ax_compiler_vendor.m4
@@ -0,0 +1,61 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_compiler_vendor.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_COMPILER_VENDOR
+#
+# DESCRIPTION
+#
+# Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun,
+# hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft,
+# watcom, etc. The vendor is returned in the cache variable
+# $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+# Copyright (c) 2008 Matteo Frigo
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_COMPILER_VENDOR],
+[
+AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
+ [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown
+ # note: don't check for gcc first since some other compilers define __GNUC__
+ for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do
+ vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
+#if !($vencpp)
+ thisisanerror;
+#endif
+])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break])
+ done
+ ])
+])
diff --git a/m4/ax_config_feature.m4 b/m4/ax_config_feature.m4
new file mode 100644
index 0000000..88f8cf5
--- /dev/null
+++ b/m4/ax_config_feature.m4
@@ -0,0 +1,154 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_config_feature.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CONFIG_FEATURE(FEATURE-NAME, FEATURE-DESCRIPTION, DEFINE, DEFINE-DESCRIPTION, [ACTION-IF-ENABLED [, ACTION-IF-NOT-ENABLED]])
+#
+# DESCRIPTION
+#
+# AX_CONFIG_FEATURE is a simple wrapper for AC_ARG_ENABLE, it enables the
+# feature FEATURE-NAME and AC_DEFINEs the passed DEFINE, depending on the
+# user choice. DESCRIPTION will be used for AC_DEFINEs. ACTION-IF-ENABLED
+# and ACTION-IF-NOT-ENABLED are the actions that will be run. A feature is
+# enabled by default, in order to change this behaviour use the
+# AX_CONFIG_FEATURE_DEFAULT_ENABLED and AX_CONFIG_FEATURE_DEFAULT_DISABLED
+# macros.
+#
+# A simple example:
+#
+# AX_CONFIG_FEATURE_DEFAULT_ENABLED
+# AX_CONFIG_FEATURE(feature_xxxxx, [turns on/off XXXXX support],
+# HAVE_XXXXX, [Define if you want XXXXX support])
+#
+# ...
+#
+# AX_CONFIG_FEATURE_DEFAULT_DISABLED
+# AX_CONFIG_FEATURE(feature_yyyyy, [turns on/off YYYYY support],
+# HAVE_YYYYY, [Define if you want YYYYY support],
+# [enable_yyyyy="yes"], [enable_yyyyy="no"])
+# AM_CONDITIONAL(YYYYY, [test "$enable_yyyyy" = "yes"])
+#
+# AX_CONFIG_FEATURE_DEFAULT_ENABLED
+# AX_CONFIG_FEATURE(...)
+#
+# ...
+#
+# If you have lot of features and you want a verbose dumping of each user
+# selection use AX_CONFIG_FEATURE_VERBOSE. Use AX_CONFIG_FEATURE_SILENT in
+# order to remove a previously AX_CONFIG_FEATURE_VERBOSE. By default
+# features are silent.
+#
+# Use AX_CONFIG_FEATURE_ENABLE or AX_CONFIG_FEATURE_DISABLE in order to
+# enable or disable a specific feature.
+#
+# Another simple example:
+#
+# AS_IF([some_test_here],[AX_CONFIG_FEATURE_ENABLE(feature_xxxxx)],[])
+#
+# AX_CONFIG_FEATURE(feature_xxxxx, [turns on/off XXXXX support],
+# HAVE_XXXXX, [Define if you want XXXXX support])
+# AX_CONFIG_FEATURE(feature_yyyyy, [turns on/off YYYYY support],
+# HAVE_YYYYY, [Define if you want YYYYY support],
+# [enable_yyyyy="yes"], [enable_yyyyy="no"])
+#
+# ...
+#
+# NOTE: AX_CONFIG_FEATURE_ENABLE() must be placed first of the relative
+# AX_CONFIG_FEATURE() macro ...
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CONFIG_FEATURE],[ dnl
+m4_pushdef([FEATURE], patsubst([$1], -, _))dnl
+
+AC_ARG_ENABLE([$1],AC_HELP_STRING([--enable-$1],[$2]),[
+case "${enableval}" in
+ yes)
+ ax_config_feature_[]FEATURE[]="yes"
+ ;;
+ no)
+ ax_config_feature_[]FEATURE[]="no"
+ ;;
+ *)
+ AC_MSG_ERROR([bad value ${enableval} for feature --$1])
+ ;;
+esac
+])
+
+AS_IF([test "$ax_config_feature_[]FEATURE[]" = yes],[ dnl
+ AC_DEFINE([$3])
+ $5
+ AS_IF([test "$ax_config_feature_verbose" = yes],[ dnl
+ AC_MSG_NOTICE([Feature $1 is enabled])
+ ])
+],[ dnl
+ $6
+ AS_IF([test "$ax_config_feature_verbose" = yes],[ dnl
+ AC_MSG_NOTICE([Feature $1 is disabled])
+ ])
+])
+
+AH_TEMPLATE([$3],[$4])
+
+m4_popdef([FEATURE])dnl
+])
+
+dnl Feature global
+AC_DEFUN([AX_CONFIG_FEATURE_VERBOSE],[ dnl
+ ax_config_feature_verbose=yes
+])
+
+dnl Feature global
+AC_DEFUN([AX_CONFIG_FEATURE_SILENT],[ dnl
+ ax_config_feature_verbose=no
+])
+
+dnl Feature specific
+AC_DEFUN([AX_CONFIG_FEATURE_DEFAULT_ENABLED], [
+ ax_config_feature_[]FEATURE[]_default=yes
+])
+
+dnl Feature specific
+AC_DEFUN([AX_CONFIG_FEATURE_DEFAULT_DISABLED], [
+ ax_config_feature_[]FEATURE[]_default=no
+])
+
+dnl Feature specific
+AC_DEFUN([AX_CONFIG_FEATURE_ENABLE],[ dnl
+ ax_config_feature_[]patsubst([$1], -, _)[]=yes
+])
+
+dnl Feature specific
+AC_DEFUN([AX_CONFIG_FEATURE_DISABLE],[ dnl
+ ax_config_feature_[]patsubst([$1], -, _)[]=no
+])
diff --git a/m4/ax_configure_args.m4 b/m4/ax_configure_args.m4
new file mode 100644
index 0000000..f7eb690
--- /dev/null
+++ b/m4/ax_configure_args.m4
@@ -0,0 +1,68 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_configure_args.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CONFIGURE_ARGS
+#
+# DESCRIPTION
+#
+# Helper macro for AX_ENABLE_BUILDDIR.
+#
+# The traditional way of starting a subdir-configure is running the script
+# with ${1+"$@"} but since autoconf 2.60 this is broken. Instead we have
+# to rely on eval'ing $ac_configure_args however some old autoconf
+# versions do not provide that. To ensure maximum portability of autoconf
+# extension macros this helper can be AC_REQUIRE'd so that
+# $ac_configure_args will alsways be present.
+#
+# Sadly, the traditional "exec $SHELL" of the enable_builddir macros is
+# spoiled now and must be replaced by "eval + exit $?".
+#
+# Example:
+#
+# AC_DEFUN([AX_ENABLE_SUBDIR],[dnl
+# AC_REQUIRE([AX_CONFIGURE_ARGS])dnl
+# eval $SHELL $ac_configure_args || exit $?
+# ...])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CONFIGURE_ARGS],[
+ # [$]@ is unsable in 2.60+ but earlier autoconf had no ac_configure_args
+ if test "${ac_configure_args+set}" != "set" ; then
+ ac_configure_args=
+ for ac_arg in ${1+"[$]@"}; do
+ ac_configure_args="$ac_configure_args '$ac_arg'"
+ done
+ fi
+])
diff --git a/m4/ax_count_cpus.m4 b/m4/ax_count_cpus.m4
new file mode 100644
index 0000000..3c1b78f
--- /dev/null
+++ b/m4/ax_count_cpus.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_count_cpus.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_COUNT_CPUS
+#
+# DESCRIPTION
+#
+# Attempt to count the number of processors present on the machine. If the
+# detection fails, then a value of 1 is assumed.
+#
+# The value is placed in the CPU_COUNT variable.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Michael Paul Bailey <jinxidoru@byu.net>
+# Copyright (c) 2008 Christophe Tournayre <turn3r@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_COUNT_CPUS], [
+ AC_REQUIRE([AC_PROG_EGREP])
+ AC_MSG_CHECKING(the number of available CPUs)
+ CPU_COUNT="0"
+
+ #On MacOS
+ if test -x /usr/sbin/sysctl -a `/sbin/sysctl -a 2>/dev/null| grep -c hw.cpu`; then
+ CPU_COUNT=`/usr/sbin/sysctl -n hw.ncpu`
+ fi
+
+ #On Linux
+ if test "x$CPU_COUNT" = "x0" -a -e /proc/cpuinfo; then
+ CPU_COUNT=`$EGREP -c '^processor' /proc/cpuinfo`
+ fi
+
+ if test "x$CPU_COUNT" = "x0"; then
+ CPU_COUNT="1"
+ AC_MSG_RESULT( [unable to detect (assuming 1)] )
+ else
+ AC_MSG_RESULT( $CPU_COUNT )
+ fi
+])
diff --git a/m4/ax_cpp_check_flag.m4 b/m4/ax_cpp_check_flag.m4
new file mode 100644
index 0000000..f7fdfcc
--- /dev/null
+++ b/m4/ax_cpp_check_flag.m4
@@ -0,0 +1,84 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cpp_check_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CPP_CHECK_FLAG(FLAG-TO-CHECK,[PROLOGUE],[BODY],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# This macro tests if the C preprocessor supports the flag FLAG-TO-CHECK.
+# If successfull execute ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+# PROLOGUE and BODY are optional and should be used as in AC_LANG_PROGRAM
+# macro.
+#
+# This code is inspired from KDE_CHECK_COMPILER_FLAG macro. Thanks to
+# Bogdan Drozdowski <bogdandr@op.pl> for testing and bug fixes.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CPP_CHECK_FLAG],[
+ AC_PREREQ([2.61])
+ AC_REQUIRE([AC_PROG_CPP])
+ AC_REQUIRE([AC_PROG_SED])
+
+ flag=`echo "$1" | $SED 'y% .=/+-(){}<>:*,%_______________%'`
+
+ AC_CACHE_CHECK([whether the C preprocessor accepts the $1 flag],
+ [ax_cv_cpp_check_flag_$flag],[
+
+ AC_LANG_PUSH([C])
+
+ save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $1"
+ AC_PREPROC_IFELSE([
+ AC_LANG_PROGRAM([$2],[$3])
+ ],[
+ eval "ax_cv_cpp_check_flag_$flag=yes"
+ ],[
+ eval "ax_cv_cpp_check_flag_$flag=no"
+ ])
+
+ CPPFLAGS="$save_CPPFLAGS"
+
+ AC_LANG_POP
+
+ ])
+
+ AS_IF([eval "test \"`echo '$ax_cv_cpp_check_flag_'$flag`\" = yes"],[
+ :
+ $4
+ ],[
+ :
+ $5
+ ])
+])
diff --git a/m4/ax_cpu_freq.m4 b/m4/ax_cpu_freq.m4
new file mode 100644
index 0000000..103852a
--- /dev/null
+++ b/m4/ax_cpu_freq.m4
@@ -0,0 +1,91 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cpu_freq.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CPU_FREQ
+#
+# DESCRIPTION
+#
+# Compute the CPU frequency and define CPU_FREQ accordingly.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Christophe Tournayre <turn3r@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CPU_FREQ],
+[AC_REQUIRE([AC_PROG_CC])
+ AC_LANG_PUSH([C++])
+ AC_CACHE_CHECK(your cpu frequency, ax_cpu_freq,
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([
+#include <iostream>
+#include <sys/time.h>
+#include <fstream>
+using namespace std;
+
+static __inline__ unsigned long long int rdtsc()
+{
+ unsigned long long int x;
+ __asm__ volatile (".byte 0x0f, 0x31":"=A" (x));
+ return x;
+}
+
+static float estimate_MHz(long sleeptime = 250000)
+{
+ struct timezone tz;
+ struct timeval tvstart, tvstop;
+ unsigned long long int cycles[[2]];
+ float microseconds;
+ double freq = 1.0f;
+
+ memset(&tz, 0, sizeof(tz));
+
+ gettimeofday(&tvstart, &tz);
+ cycles[[0]] = rdtsc();
+ gettimeofday(&tvstart, &tz);
+
+ usleep(sleeptime);
+
+ gettimeofday(&tvstop, &tz);
+ cycles[[1]] = rdtsc();
+ gettimeofday(&tvstop, &tz);
+
+ microseconds = (tvstop.tv_sec - tvstart.tv_sec) * 1000000 +
+ (tvstop.tv_usec - tvstart.tv_usec);
+
+ return (float) (cycles[[1]] - cycles[[0]]) / (microseconds / freq);
+}
+
+static float average_MHz(int tries = 2)
+{
+ float frequency = 0;
+
+ for (int i = 1; i <= tries; i++)
+ frequency += estimate_MHz(i * 150000);
+
+ if (tries > 0)
+ return frequency / (float) tries;
+ else
+ return 0;
+}
+], [
+ ofstream of("conftest_cpufreq");
+ if(of.is_open())
+ of << average_MHz();
+ else
+ return 1;
+
+ of.close()
+])],
+ [ax_cpu_freq=`cat conftest_cpufreq`; rm -f conftest_cpufreq],
+ [ax_cpu_freq=unknow; rm -f conftest_cpufreq]
+ )])
+AC_LANG_POP([C++])
+
+ AC_DEFINE_UNQUOTED([CPU_FREQ], ${ax_cpu_freq}, [The cpu frequency (in MHz)])
+])
diff --git a/m4/ax_cpu_vendor.m4 b/m4/ax_cpu_vendor.m4
new file mode 100644
index 0000000..8287fe7
--- /dev/null
+++ b/m4/ax_cpu_vendor.m4
@@ -0,0 +1,61 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cpu_vendor.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CPU_VENDOR
+#
+# DESCRIPTION
+#
+# Find your CPU's vendor by requesting cpuid and define "ax_cpu_vendor"
+# accordingly. This macro depends on AX_GCC_X86_CPUID.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Christophe Tournayre <turn3r@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CPU_VENDOR],
+[
+ AC_REQUIRE([AX_GCC_X86_CPUID])
+ AX_GCC_X86_CPUID(0x0)
+
+ AC_CACHE_CHECK(for the processor vendor, ax_cpu_vendor,
+ [
+ vendor=`echo $ax_cv_gcc_x86_cpuid_0x0 | cut -d ":" -f 2`
+
+ case $vendor in
+ 756e6547*)
+ ax_cpu_vendor="Intel"
+ ;;
+ 68747541*)
+ ax_cpu_vendor="AMD"
+ ;;
+ 69727943*)
+ ax_cpu_vendor="Cyrix"
+ ;;
+ 746e6543*)
+ ax_cpu_vendor="IDT"
+ ;;
+ 646f6547*)
+ ax_cpu_vendor="Natsemi Geode"
+ ;;
+ 52697365*)
+ ax_cpu_vendor="Rise"
+ ;;
+ 65736952*)
+ ax_cpu_vendor="Rise"
+ ;;
+ 20536953*)
+ ax_cpu_vendor="SiS"
+ ;;
+ *)
+ ax_cpu_vendor="Unknown"
+ ;;
+ esac
+ ])
+])
diff --git a/m4/ax_create_pkgconfig_info.m4 b/m4/ax_create_pkgconfig_info.m4
new file mode 100644
index 0000000..f263273
--- /dev/null
+++ b/m4/ax_create_pkgconfig_info.m4
@@ -0,0 +1,344 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_create_pkgconfig_info.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CREATE_PKGCONFIG_INFO [(outputfile, [requires [,libs [,summary [,cflags [, ldflags]]]]])]
+#
+# DESCRIPTION
+#
+# Defaults:
+#
+# $1 = $PACKAGE_NAME.pc
+# $2 = (empty)
+# $3 = $PACKAGE_LIBS $LIBS (as set at that point in configure.ac)
+# $4 = $PACKAGE_SUMMARY (or $1 Library)
+# $5 = $CPPFLAGS $PACKAGE_CFLAGS (as set at the point in configure.ac)
+# $6 = $LDFLAGS $PACKAGE_LDFLAGS (as set at the point in configure.ac)
+#
+# PACKAGE_NAME defaults to $PACKAGE if not set.
+# PACKAGE_LIBS defaults to -l$PACKAGE_NAME if not set.
+#
+# The resulting file is called $PACKAGE.pc.in / $PACKAGE.pc
+#
+# You will find this macro most useful in conjunction with
+# ax_spec_defaults that can read good initializers from the .spec file. In
+# consequencd, most of the generatable installable stuff can be made from
+# information being updated in a single place for the whole project.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+# Copyright (c) 2008 Sven Verdoolaege <skimo@kotnet.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CREATE_PKGCONFIG_INFO],[dnl
+AS_VAR_PUSHDEF([PKGCONFIG_suffix],[ax_create_pkgconfig_suffix])dnl
+AS_VAR_PUSHDEF([PKGCONFIG_libdir],[ax_create_pkgconfig_libdir])dnl
+AS_VAR_PUSHDEF([PKGCONFIG_libfile],[ax_create_pkgconfig_libfile])dnl
+AS_VAR_PUSHDEF([PKGCONFIG_libname],[ax_create_pkgconfig_libname])dnl
+AS_VAR_PUSHDEF([PKGCONFIG_version],[ax_create_pkgconfig_version])dnl
+AS_VAR_PUSHDEF([PKGCONFIG_description],[ax_create_pkgconfig_description])dnl
+AS_VAR_PUSHDEF([PKGCONFIG_requires],[ax_create_pkgconfig_requires])dnl
+AS_VAR_PUSHDEF([PKGCONFIG_pkglibs],[ax_create_pkgconfig_pkglibs])dnl
+AS_VAR_PUSHDEF([PKGCONFIG_libs],[ax_create_pkgconfig_libs])dnl
+AS_VAR_PUSHDEF([PKGCONFIG_ldflags],[ax_create_pkgconfig_ldflags])dnl
+AS_VAR_PUSHDEF([PKGCONFIG_cppflags],[ax_create_pkgconfig_cppflags])dnl
+AS_VAR_PUSHDEF([PKGCONFIG_generate],[ax_create_pkgconfig_generate])dnl
+AS_VAR_PUSHDEF([PKGCONFIG_src_libdir],[ax_create_pkgconfig_src_libdir])dnl
+AS_VAR_PUSHDEF([PKGCONFIG_src_headers],[ax_create_pkgconfig_src_headers])dnl
+
+# we need the expanded forms...
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+AC_MSG_CHECKING(our pkgconfig libname)
+test ".$PKGCONFIG_libname" != "." || \
+PKGCONFIG_libname="ifelse($1,,${PACKAGE_NAME},`basename $1 .pc`)"
+test ".$PKGCONFIG_libname" != "." || \
+PKGCONFIG_libname="$PACKAGE"
+PKGCONFIG_libname=`eval echo "$PKGCONFIG_libname"`
+PKGCONFIG_libname=`eval echo "$PKGCONFIG_libname"`
+AC_MSG_RESULT($PKGCONFIG_libname)
+
+AC_MSG_CHECKING(our pkgconfig version)
+test ".$PKGCONFIG_version" != "." || \
+PKGCONFIG_version="${PACKAGE_VERSION}"
+test ".$PKGCONFIG_version" != "." || \
+PKGCONFIG_version="$VERSION"
+PKGCONFIG_version=`eval echo "$PKGCONFIG_version"`
+PKGCONFIG_version=`eval echo "$PKGCONFIG_version"`
+AC_MSG_RESULT($PKGCONFIG_version)
+
+AC_MSG_CHECKING(our pkgconfig_libdir)
+test ".$pkgconfig_libdir" = "." && \
+pkgconfig_libdir='${libdir}/pkgconfig'
+PKGCONFIG_libdir=`eval echo "$pkgconfig_libdir"`
+PKGCONFIG_libdir=`eval echo "$PKGCONFIG_libdir"`
+PKGCONFIG_libdir=`eval echo "$PKGCONFIG_libdir"`
+AC_MSG_RESULT($pkgconfig_libdir)
+test "$pkgconfig_libdir" != "$PKGCONFIG_libdir" && (
+AC_MSG_RESULT(expanded our pkgconfig_libdir... $PKGCONFIG_libdir))
+AC_SUBST([pkgconfig_libdir])
+
+AC_MSG_CHECKING(our pkgconfig_libfile)
+test ".$pkgconfig_libfile" != "." || \
+pkgconfig_libfile="ifelse($1,,$PKGCONFIG_libname.pc,`basename $1`)"
+PKGCONFIG_libfile=`eval echo "$pkgconfig_libfile"`
+PKGCONFIG_libfile=`eval echo "$PKGCONFIG_libfile"`
+AC_MSG_RESULT($pkgconfig_libfile)
+test "$pkgconfig_libfile" != "$PKGCONFIG_libfile" && (
+AC_MSG_RESULT(expanded our pkgconfig_libfile... $PKGCONFIG_libfile))
+AC_SUBST([pkgconfig_libfile])
+
+AC_MSG_CHECKING(our package / suffix)
+PKGCONFIG_suffix="$program_suffix"
+test ".$PKGCONFIG_suffix" != .NONE || PKGCONFIG_suffix=""
+AC_MSG_RESULT(${PACKAGE_NAME} / ${PKGCONFIG_suffix})
+
+AC_MSG_CHECKING(our pkgconfig description)
+PKGCONFIG_description="ifelse($4,,$PACKAGE_SUMMARY,$4)"
+test ".$PKGCONFIG_description" != "." || \
+PKGCONFIG_description="$PKGCONFIG_libname Library"
+PKGCONFIG_description=`eval echo "$PKGCONFIG_description"`
+PKGCONFIG_description=`eval echo "$PKGCONFIG_description"`
+AC_MSG_RESULT($PKGCONFIG_description)
+
+AC_MSG_CHECKING(our pkgconfig requires)
+PKGCONFIG_requires="ifelse($2,,$PACKAGE_REQUIRES,$2)"
+PKGCONFIG_requires=`eval echo "$PKGCONFIG_requires"`
+PKGCONFIG_requires=`eval echo "$PKGCONFIG_requires"`
+AC_MSG_RESULT($PKGCONFIG_requires)
+
+AC_MSG_CHECKING(our pkgconfig ext libs)
+PKGCONFIG_pkglibs="$PACKAGE_LIBS"
+test ".$PKGCONFIG_pkglibs" != "." || PKGCONFIG_pkglibs="-l$PKGCONFIG_libname"
+PKGCONFIG_libs="ifelse($3,,$PKGCONFIG_pkglibs $LIBS,$3)"
+PKGCONFIG_libs=`eval echo "$PKGCONFIG_libs"`
+PKGCONFIG_libs=`eval echo "$PKGCONFIG_libs"`
+AC_MSG_RESULT($PKGCONFIG_libs)
+
+AC_MSG_CHECKING(our pkgconfig cppflags)
+PKGCONFIG_cppflags="ifelse($5,,$CPPFLAGS $PACKAGE_CFLAGS,$5)"
+PKGCONFIG_cppflags=`eval echo "$PKGCONFIG_cppflags"`
+PKGCONFIG_cppflags=`eval echo "$PKGCONFIG_cppflags"`
+AC_MSG_RESULT($PKGCONFIG_cppflags)
+
+AC_MSG_CHECKING(our pkgconfig ldflags)
+PKGCONFIG_ldflags="ifelse($6,,$LDFLAGS $PACKAGE_LDFLAGS,$5)"
+PKGCONFIG_ldflags=`eval echo "$PKGCONFIG_ldflags"`
+PKGCONFIG_ldflags=`eval echo "$PKGCONFIG_ldflags"`
+AC_MSG_RESULT($PKGCONFIG_ldflags)
+
+test ".$PKGCONFIG_generate" != "." || \
+PKGCONFIG_generate="ifelse($1,,$PKGCONFIG_libname.pc,$1)"
+PKGCONFIG_generate=`eval echo "$PKGCONFIG_generate"`
+PKGCONFIG_generate=`eval echo "$PKGCONFIG_generate"`
+test "$pkgconfig_libfile" != "$PKGCONFIG_generate" && (
+AC_MSG_RESULT(generate the pkgconfig later... $PKGCONFIG_generate))
+
+if test ".$PKGCONFIG_src_libdir" = "." ; then
+PKGCONFIG_src_libdir=`pwd`
+PKGCONFIG_src_libdir=`AS_DIRNAME("$PKGCONFIG_src_libdir/$PKGCONFIG_generate")`
+test ! -d $PKGCONFIG_src_libdir/src || \
+PKGCONFIG_src_libdir="$PKGCONFIG_src_libdir/src"
+case ".$objdir" in
+*libs) PKGCONFIG_src_libdir="$PKGCONFIG_src_libdir/$objdir" ;; esac
+AC_MSG_RESULT(noninstalled pkgconfig -L $PKGCONFIG_src_libdir)
+fi
+
+if test ".$PKGCONFIG_src_headers" = "." ; then
+PKGCONFIG_src_headers=`pwd`
+v="$ac_top_srcdir" ;
+test ".$v" != "." || v="$ax_spec_dir"
+test ".$v" != "." || v="$srcdir"
+case "$v" in /*) PKGCONFIG_src_headers="" ;; esac
+PKGCONFIG_src_headers=`AS_DIRNAME("$PKGCONFIG_src_headers/$v/x")`
+test ! -d $PKGCONFIG_src_headers/incl[]ude || \
+PKGCONFIG_src_headers="$PKGCONFIG_src_headers/incl[]ude"
+AC_MSG_RESULT(noninstalled pkgconfig -I $PKGCONFIG_src_headers)
+fi
+
+
+dnl AC_CONFIG_COMMANDS crap disallows to use $PKGCONFIG_libfile here...
+AC_CONFIG_COMMANDS([$ax_create_pkgconfig_generate],[
+pkgconfig_generate="$ax_create_pkgconfig_generate"
+if test ! -f "$pkgconfig_generate.in"
+then generate="true"
+elif grep ' generated by configure ' $pkgconfig_generate.in >/dev/null
+then generate="true"
+else generate="false";
+fi
+if $generate ; then
+AC_MSG_NOTICE(creating $pkgconfig_generate.in)
+cat > $pkgconfig_generate.in <<AXEOF
+# generated by configure / remove this line to disable regeneration
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+libdir=@libdir@
+datadir=@datadir@
+sysconfdir=@sysconfdir@
+includedir=@includedir@
+package=@PACKAGE@
+suffix=@suffix@
+
+Name: @PACKAGE_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @PACKAGE_VERSION@
+Requires: @PACKAGE_REQUIRES@
+Libs: -L\${libdir} @LDFLAGS@ @LIBS@
+Cflags: -I\${includedir} @CPPFLAGS@
+AXEOF
+fi # DONE generate $pkgconfig_generate.in
+AC_MSG_NOTICE(creating $pkgconfig_generate)
+cat >conftest.sed <<AXEOF
+s|@prefix@|${pkgconfig_prefix}|
+s|@exec_prefix@|${pkgconfig_execprefix}|
+s|@bindir@|${pkgconfig_bindir}|
+s|@libdir@|${pkgconfig_libdir}|
+s|@datadir@|${pkgconfig_datadir}|
+s|@sysconfdir@|${pkgconfig_sysconfdir}|
+s|@includedir@|${pkgconfig_includedir}|
+s|@suffix@|${pkgconfig_suffix}|
+s|@PACKAGE@|${pkgconfig_package}|
+s|@PACKAGE_NAME@|${pkgconfig_libname}|
+s|@PACKAGE_DESCRIPTION@|${pkgconfig_description}|
+s|@PACKAGE_VERSION@|${pkgconfig_version}|
+s|@PACKAGE_REQUIRES@|${pkgconfig_requires}|
+s|@LIBS@|${pkgconfig_libs}|
+s|@LDFLAGS@|${pkgconfig_ldflags}|
+s|@CPPFLAGS@|${pkgconfig_cppflags}|
+AXEOF
+sed -f conftest.sed $pkgconfig_generate.in > $pkgconfig_generate
+if test ! -s $pkgconfig_generate ; then
+ AC_MSG_ERROR([$pkgconfig_generate is empty])
+fi ; rm conftest.sed # DONE generate $pkgconfig_generate
+pkgconfig_uninstalled=`echo $pkgconfig_generate |sed 's/.pc$/-uninstalled.pc/'`
+AC_MSG_NOTICE(creating $pkgconfig_uninstalled)
+cat >conftest.sed <<AXEOF
+s|@prefix@|${pkgconfig_prefix}|
+s|@exec_prefix@|${pkgconfig_execprefix}|
+s|@bindir@|${pkgconfig_bindir}|
+s|@libdir@|${pkgconfig_src_libdir}|
+s|@datadir@|${pkgconfig_datadir}|
+s|@sysconfdir@|${pkgconfig_sysconfdir}|
+s|@includedir@|${pkgconfig_src_headers}|
+s|@suffix@|${pkgconfig_suffix}|
+s|@PACKAGE@|${pkgconfig_package}|
+s|@PACKAGE_NAME@|${pkgconfig_libname}|
+s|@PACKAGE_DESCRIPTION@|${pkgconfig_description}|
+s|@PACKAGE_VERSION@|${pkgconfig_version}|
+s|@PACKAGE_REQUIRES@|${pkgconfig_requires}|
+s|@LIBS@|${pkgconfig_libs}|
+s|@LDFLAGS@|${pkgconfig_ldflags}|
+s|@CPPFLAGS@|${pkgconfig_cppflags}|
+AXEOF
+sed -f conftest.sed $pkgconfig_generate.in > $pkgconfig_uninstalled
+if test ! -s $pkgconfig_uninstalled ; then
+ AC_MSG_ERROR([$pkgconfig_uninstalled is empty])
+fi ; rm conftest.sed # DONE generate $pkgconfig_uninstalled
+ pkgconfig_requires_add=`echo ${pkgconfig_requires}`
+if test ".$pkgconfig_requires_add" != "." ; then
+ pkgconfig_requires_add="pkg-config $pkgconfig_requires_add"
+ else pkgconfig_requires_add=":" ; fi
+pkgconfig_uninstalled=`echo $pkgconfig_generate |sed 's/.pc$/-uninstalled.sh/'`
+AC_MSG_NOTICE(creating $pkgconfig_uninstalled)
+cat >conftest.sed <<AXEOF
+s|@prefix@|\"${pkgconfig_prefix}\"|
+s|@exec_prefix@|\"${pkgconfig_execprefix}\"|
+s|@bindir@|\"${pkgconfig_bindir}\"|
+s|@libdir@|\"${pkgconfig_src_libdir}\"|
+s|@datadir@|\"${pkgconfig_datadir}\"|
+s|@sysconfdir@|\"${pkgconfig_sysconfdir}\"|
+s|@includedir@|\"${pkgconfig_src_headers}\"|
+s|@suffix@|\"${pkgconfig_suffix}\"|
+s|@PACKAGE@|\"${pkgconfig_package}\"|
+s|@PACKAGE_NAME@|\"${pkgconfig_libname}\"|
+s|@PACKAGE_DESCRIPTION@|\"${pkgconfig_description}\"|
+s|@PACKAGE_VERSION@|\"${pkgconfig_version}\"|
+s|@PACKAGE_REQUIRES@|\"${pkgconfig_requires}\"|
+s|@LIBS@|\"${pkgconfig_libs}\"|
+s|@LDFLAGS@|\"${pkgconfig_ldflags}\"|
+s|@CPPFLAGS@|\"${pkgconfig_cppflags}\"|
+s>Name:>for option\\; do case \"\$option\" in --list-all|--name) echo >
+s>Description: *>\\;\\; --help) pkg-config --help \\; echo Buildscript Of >
+s>Version: *>\\;\\; --modversion|--version) echo >
+s>Requires:>\\;\\; --requires) echo $pkgconfig_requires_add>
+s>Libs: *>\\;\\; --libs) echo >
+s>Cflags: *>\\;\\; --cflags) echo >
+/--libs)/a\\
+ $pkgconfig_requires_add
+/--cflags)/a\\
+ $pkgconfig_requires_add\\
+;; --variable=*) eval echo '\$'\`echo \$option | sed -e 's/.*=//'\`\\
+;; --uninstalled) exit 0 \\
+;; *) ;; esac done
+AXEOF
+sed -f conftest.sed $pkgconfig_generate.in > $pkgconfig_uninstalled
+if test ! -s $pkgconfig_uninstalled ; then
+ AC_MSG_ERROR([$pkgconfig_uninstalled is empty])
+fi ; rm conftest.sed # DONE generate $pkgconfig_uninstalled
+],[
+dnl AC_CONFIG_COMMANDS crap, the AS_PUSHVAR defines are invalid here...
+ax_create_pkgconfig_generate="$ax_create_pkgconfig_generate"
+pkgconfig_prefix='$prefix'
+pkgconfig_execprefix='$exec_prefix'
+pkgconfig_bindir='$bindir'
+pkgconfig_libdir='$libdir'
+pkgconfig_includedir='$includedir'
+pkgconfig_datadir='$datadir'
+pkgconfig_sysconfdir='$sysconfdir'
+pkgconfig_suffix='$ax_create_pkgconfig_suffix'
+pkgconfig_package='$PACKAGE_NAME'
+pkgconfig_libname='$ax_create_pkgconfig_libname'
+pkgconfig_description='$ax_create_pkgconfig_description'
+pkgconfig_version='$ax_create_pkgconfig_version'
+pkgconfig_requires='$ax_create_pkgconfig_requires'
+pkgconfig_libs='$ax_create_pkgconfig_libs'
+pkgconfig_ldflags='$ax_create_pkgconfig_ldflags'
+pkgconfig_cppflags='$ax_create_pkgconfig_cppflags'
+pkgconfig_src_libdir='$ax_create_pkgconfig_src_libdir'
+pkgconfig_src_headers='$ax_create_pkgconfig_src_headers'
+])dnl
+AS_VAR_POPDEF([PKGCONFIG_suffix])dnl
+AS_VAR_POPDEF([PKGCONFIG_libdir])dnl
+AS_VAR_POPDEF([PKGCONFIG_libfile])dnl
+AS_VAR_POPDEF([PKGCONFIG_libname])dnl
+AS_VAR_POPDEF([PKGCONFIG_version])dnl
+AS_VAR_POPDEF([PKGCONFIG_description])dnl
+AS_VAR_POPDEF([PKGCONFIG_requires])dnl
+AS_VAR_POPDEF([PKGCONFIG_pkglibs])dnl
+AS_VAR_POPDEF([PKGCONFIG_libs])dnl
+AS_VAR_POPDEF([PKGCONFIG_ldflags])dnl
+AS_VAR_POPDEF([PKGCONFIG_cppflags])dnl
+AS_VAR_POPDEF([PKGCONFIG_generate])dnl
+AS_VAR_POPDEF([PKGCONFIG_src_libdir])dnl
+AS_VAR_POPDEF([PKGCONFIG_src_headers])dnl
+])
diff --git a/m4/ax_create_stdint_h.m4 b/m4/ax_create_stdint_h.m4
new file mode 100644
index 0000000..5c0aabc
--- /dev/null
+++ b/m4/ax_create_stdint_h.m4
@@ -0,0 +1,725 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_create_stdint_h.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])]
+#
+# DESCRIPTION
+#
+# the "ISO C9X: 7.18 Integer types <stdint.h>" section requires the
+# existence of an include file <stdint.h> that defines a set of typedefs,
+# especially uint8_t,int32_t,uintptr_t. Many older installations will not
+# provide this file, but some will have the very same definitions in
+# <inttypes.h>. In other enviroments we can use the inet-types in
+# <sys/types.h> which would define the typedefs int8_t and u_int8_t
+# respectivly.
+#
+# This macros will create a local "_stdint.h" or the headerfile given as
+# an argument. In many cases that file will just "#include <stdint.h>" or
+# "#include <inttypes.h>", while in other environments it will provide the
+# set of basic 'stdint's definitions/typedefs:
+#
+# int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t
+# int_least32_t.. int_fast32_t.. intmax_t
+#
+# which may or may not rely on the definitions of other files, or using
+# the AC_CHECK_SIZEOF macro to determine the actual sizeof each type.
+#
+# if your header files require the stdint-types you will want to create an
+# installable file mylib-int.h that all your other installable header may
+# include. So if you have a library package named "mylib", just use
+#
+# AX_CREATE_STDINT_H(mylib-int.h)
+#
+# in configure.ac and go to install that very header file in Makefile.am
+# along with the other headers (mylib.h) - and the mylib-specific headers
+# can simply use "#include <mylib-int.h>" to obtain the stdint-types.
+#
+# Remember, if the system already had a valid <stdint.h>, the generated
+# file will include it directly. No need for fuzzy HAVE_STDINT_H things...
+# (oops, GCC 4.2.x has deliberatly disabled its stdint.h for non-c99
+# compilation and the c99-mode is not the default. Therefore this macro
+# will not use the compiler's stdint.h - please complain to the GCC
+# developers).
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CHECK_DATA_MODEL],[
+ AC_CHECK_SIZEOF(char)
+ AC_CHECK_SIZEOF(short)
+ AC_CHECK_SIZEOF(int)
+ AC_CHECK_SIZEOF(long)
+ AC_CHECK_SIZEOF(void*)
+ ac_cv_char_data_model=""
+ ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char"
+ ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short"
+ ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int"
+ ac_cv_long_data_model=""
+ ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int"
+ ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long"
+ ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp"
+ AC_MSG_CHECKING([data model])
+ case "$ac_cv_char_data_model/$ac_cv_long_data_model" in
+ 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;;
+ 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;;
+ 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;;
+ 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;;
+ 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;;
+ 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;;
+ 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;;
+ 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;;
+ 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;;
+ 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;;
+ 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;;
+ 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;;
+ 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;;
+ 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;;
+ 222/*|333/*|444/*|666/*|888/*) :
+ ac_cv_data_model="iDSP" ; n="unusual dsptype" ;;
+ *) ac_cv_data_model="none" ; n="very unusual model" ;;
+ esac
+ AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)])
+])
+
+dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF])
+AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[
+AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[
+ ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h)
+ AC_MSG_RESULT([(..)])
+ for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h sys/types.h])
+ do
+ unset ac_cv_type_uintptr_t
+ unset ac_cv_type_uint64_t
+ AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>])
+ AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
+ m4_ifvaln([$2],[$2]) break
+ done
+ AC_MSG_CHECKING([for stdint uintptr_t])
+ ])
+])
+
+AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[
+AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[
+ ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h)
+ AC_MSG_RESULT([(..)])
+ for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h sys/types.h stdint.h])
+ do
+ unset ac_cv_type_uint32_t
+ unset ac_cv_type_uint64_t
+ AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>])
+ AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
+ m4_ifvaln([$2],[$2]) break
+ break;
+ done
+ AC_MSG_CHECKING([for stdint uint32_t])
+ ])
+])
+
+AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[
+AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[
+ ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h)
+ AC_MSG_RESULT([(..)])
+ for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do
+ unset ac_cv_type_u_int32_t
+ unset ac_cv_type_u_int64_t
+ AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>])
+ AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>])
+ m4_ifvaln([$2],[$2]) break
+ break;
+ done
+ AC_MSG_CHECKING([for stdint u_int32_t])
+ ])
+])
+
+AC_DEFUN([AX_CREATE_STDINT_H],
+[# ------ AX CREATE STDINT H -------------------------------------
+AC_MSG_CHECKING([for stdint types])
+ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)`
+# try to shortcircuit - if the default include path of the compiler
+# can find a "stdint.h" header then we assume that all compilers can.
+AC_CACHE_VAL([ac_cv_header_stdint_t],[
+old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS=""
+old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS=""
+old_CFLAGS="$CFLAGS" ; CFLAGS=""
+AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;],
+[ac_cv_stdint_result="(assuming C99 compatible system)"
+ ac_cv_header_stdint_t="stdint.h"; ],
+[ac_cv_header_stdint_t=""])
+if test "$GCC" = "yes" && test ".$ac_cv_header_stdint_t" = "."; then
+CFLAGS="-std=c99"
+AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;],
+[AC_MSG_WARN(your GCC compiler has a defunct stdint.h for its default-mode)])
+fi
+CXXFLAGS="$old_CXXFLAGS"
+CPPFLAGS="$old_CPPFLAGS"
+CFLAGS="$old_CFLAGS" ])
+
+v="... $ac_cv_header_stdint_h"
+if test "$ac_stdint_h" = "stdint.h" ; then
+ AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)])
+elif test "$ac_stdint_h" = "inttypes.h" ; then
+ AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)])
+elif test "_$ac_cv_header_stdint_t" = "_" ; then
+ AC_MSG_RESULT([(putting them into $ac_stdint_h)$v])
+else
+ ac_cv_header_stdint="$ac_cv_header_stdint_t"
+ AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)])
+fi
+
+if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit..
+
+dnl .....intro message done, now do a few system checks.....
+dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type,
+dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW
+dnl instead that is triggered with 3 or more arguments (see types.m4)
+
+inttype_headers=`echo $2 | sed -e 's/,/ /g'`
+
+ac_cv_stdint_result="(no helpful system typedefs seen)"
+AX_CHECK_HEADER_STDINT_X(dnl
+ stdint.h inttypes.h sys/inttypes.h $inttype_headers,
+ ac_cv_stdint_result="(seen uintptr_t$and64 in $i)")
+
+if test "_$ac_cv_header_stdint_x" = "_" ; then
+AX_CHECK_HEADER_STDINT_O(dnl,
+ inttypes.h sys/inttypes.h stdint.h $inttype_headers,
+ ac_cv_stdint_result="(seen uint32_t$and64 in $i)")
+fi
+
+if test "_$ac_cv_header_stdint_x" = "_" ; then
+if test "_$ac_cv_header_stdint_o" = "_" ; then
+AX_CHECK_HEADER_STDINT_U(dnl,
+ sys/types.h inttypes.h sys/inttypes.h $inttype_headers,
+ ac_cv_stdint_result="(seen u_int32_t$and64 in $i)")
+fi fi
+
+dnl if there was no good C99 header file, do some typedef checks...
+if test "_$ac_cv_header_stdint_x" = "_" ; then
+ AC_MSG_CHECKING([for stdint datatype model])
+ AC_MSG_RESULT([(..)])
+ AX_CHECK_DATA_MODEL
+fi
+
+if test "_$ac_cv_header_stdint_x" != "_" ; then
+ ac_cv_header_stdint="$ac_cv_header_stdint_x"
+elif test "_$ac_cv_header_stdint_o" != "_" ; then
+ ac_cv_header_stdint="$ac_cv_header_stdint_o"
+elif test "_$ac_cv_header_stdint_u" != "_" ; then
+ ac_cv_header_stdint="$ac_cv_header_stdint_u"
+else
+ ac_cv_header_stdint="stddef.h"
+fi
+
+AC_MSG_CHECKING([for extra inttypes in chosen header])
+AC_MSG_RESULT([($ac_cv_header_stdint)])
+dnl see if int_least and int_fast types are present in _this_ header.
+unset ac_cv_type_int_least32_t
+unset ac_cv_type_int_fast32_t
+AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>])
+AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>])
+AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>])
+
+fi # shortcircut to system "stdint.h"
+# ------------------ PREPARE VARIABLES ------------------------------
+if test "$GCC" = "yes" ; then
+ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1`
+else
+ac_cv_stdint_message="using $CC"
+fi
+
+AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl
+$ac_cv_stdint_result])
+
+dnl -----------------------------------------------------------------
+# ----------------- DONE inttypes.h checks START header -------------
+AC_CONFIG_COMMANDS([$ac_stdint_h],[
+AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h)
+ac_stdint=$tmp/_stdint.h
+
+echo "#ifndef" $_ac_stdint_h >$ac_stdint
+echo "#define" $_ac_stdint_h "1" >>$ac_stdint
+echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint
+echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint
+echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint
+if test "_$ac_cv_header_stdint_t" != "_" ; then
+echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint
+echo "#include <stdint.h>" >>$ac_stdint
+echo "#endif" >>$ac_stdint
+echo "#endif" >>$ac_stdint
+else
+
+cat >>$ac_stdint <<STDINT_EOF
+
+/* ................... shortcircuit part ........................... */
+
+#if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H
+#include <stdint.h>
+#else
+#include <stddef.h>
+
+/* .................... configured part ............................ */
+
+STDINT_EOF
+
+echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint
+if test "_$ac_cv_header_stdint_x" != "_" ; then
+ ac_header="$ac_cv_header_stdint_x"
+ echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint
+else
+ echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint
+fi
+
+echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint
+if test "_$ac_cv_header_stdint_o" != "_" ; then
+ ac_header="$ac_cv_header_stdint_o"
+ echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint
+else
+ echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint
+fi
+
+echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint
+if test "_$ac_cv_header_stdint_u" != "_" ; then
+ ac_header="$ac_cv_header_stdint_u"
+ echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint
+else
+ echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint
+fi
+
+echo "" >>$ac_stdint
+
+if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then
+ echo "#include <$ac_header>" >>$ac_stdint
+ echo "" >>$ac_stdint
+fi fi
+
+echo "/* which 64bit typedef has been found */" >>$ac_stdint
+if test "$ac_cv_type_uint64_t" = "yes" ; then
+echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint
+else
+echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint
+fi
+if test "$ac_cv_type_u_int64_t" = "yes" ; then
+echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint
+else
+echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint
+fi
+echo "" >>$ac_stdint
+
+echo "/* which type model has been detected */" >>$ac_stdint
+if test "_$ac_cv_char_data_model" != "_" ; then
+echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint
+echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint
+else
+echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint
+echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint
+fi
+echo "" >>$ac_stdint
+
+echo "/* whether int_least types were detected */" >>$ac_stdint
+if test "$ac_cv_type_int_least32_t" = "yes"; then
+echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint
+else
+echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint
+fi
+echo "/* whether int_fast types were detected */" >>$ac_stdint
+if test "$ac_cv_type_int_fast32_t" = "yes"; then
+echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint
+else
+echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint
+fi
+echo "/* whether intmax_t type was detected */" >>$ac_stdint
+if test "$ac_cv_type_intmax_t" = "yes"; then
+echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint
+else
+echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint
+fi
+echo "" >>$ac_stdint
+
+ cat >>$ac_stdint <<STDINT_EOF
+/* .................... detections part ............................ */
+
+/* whether we need to define bitspecific types from compiler base types */
+#ifndef _STDINT_HEADER_INTPTR
+#ifndef _STDINT_HEADER_UINT32
+#ifndef _STDINT_HEADER_U_INT32
+#define _STDINT_NEED_INT_MODEL_T
+#else
+#define _STDINT_HAVE_U_INT_TYPES
+#endif
+#endif
+#endif
+
+#ifdef _STDINT_HAVE_U_INT_TYPES
+#undef _STDINT_NEED_INT_MODEL_T
+#endif
+
+#ifdef _STDINT_CHAR_MODEL
+#if _STDINT_CHAR_MODEL+0 == 122 || _STDINT_CHAR_MODEL+0 == 124
+#ifndef _STDINT_BYTE_MODEL
+#define _STDINT_BYTE_MODEL 12
+#endif
+#endif
+#endif
+
+#ifndef _STDINT_HAVE_INT_LEAST32_T
+#define _STDINT_NEED_INT_LEAST_T
+#endif
+
+#ifndef _STDINT_HAVE_INT_FAST32_T
+#define _STDINT_NEED_INT_FAST_T
+#endif
+
+#ifndef _STDINT_HEADER_INTPTR
+#define _STDINT_NEED_INTPTR_T
+#ifndef _STDINT_HAVE_INTMAX_T
+#define _STDINT_NEED_INTMAX_T
+#endif
+#endif
+
+
+/* .................... definition part ............................ */
+
+/* some system headers have good uint64_t */
+#ifndef _HAVE_UINT64_T
+#if defined _STDINT_HAVE_UINT64_T || defined HAVE_UINT64_T
+#define _HAVE_UINT64_T
+#elif defined _STDINT_HAVE_U_INT64_T || defined HAVE_U_INT64_T
+#define _HAVE_UINT64_T
+typedef u_int64_t uint64_t;
+#endif
+#endif
+
+#ifndef _HAVE_UINT64_T
+/* .. here are some common heuristics using compiler runtime specifics */
+#if defined __STDC_VERSION__ && defined __STDC_VERSION__ >= 199901L
+#define _HAVE_UINT64_T
+#define _HAVE_LONGLONG_UINT64_T
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
+
+#elif !defined __STRICT_ANSI__
+#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
+#define _HAVE_UINT64_T
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+
+#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
+/* note: all ELF-systems seem to have loff-support which needs 64-bit */
+#if !defined _NO_LONGLONG
+#define _HAVE_UINT64_T
+#define _HAVE_LONGLONG_UINT64_T
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
+#endif
+
+#elif defined __alpha || (defined __mips && defined _ABIN32)
+#if !defined _NO_LONGLONG
+typedef long int64_t;
+typedef unsigned long uint64_t;
+#endif
+ /* compiler/cpu type to define int64_t */
+#endif
+#endif
+#endif
+
+#if defined _STDINT_HAVE_U_INT_TYPES
+/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */
+typedef u_int8_t uint8_t;
+typedef u_int16_t uint16_t;
+typedef u_int32_t uint32_t;
+
+/* glibc compatibility */
+#ifndef __int8_t_defined
+#define __int8_t_defined
+#endif
+#endif
+
+#ifdef _STDINT_NEED_INT_MODEL_T
+/* we must guess all the basic types. Apart from byte-adressable system, */
+/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */
+/* (btw, those nibble-addressable systems are way off, or so we assume) */
+
+dnl /* have a look at "64bit and data size neutrality" at */
+dnl /* http://unix.org/version2/whatsnew/login_64bit.html */
+dnl /* (the shorthand "ILP" types always have a "P" part) */
+
+#if defined _STDINT_BYTE_MODEL
+#if _STDINT_LONG_MODEL+0 == 242
+/* 2:4:2 = IP16 = a normal 16-bit system */
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned long uint32_t;
+#ifndef __int8_t_defined
+#define __int8_t_defined
+typedef char int8_t;
+typedef short int16_t;
+typedef long int32_t;
+#endif
+#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444
+/* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */
+/* 4:4:4 = ILP32 = a normal 32-bit system */
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+#ifndef __int8_t_defined
+#define __int8_t_defined
+typedef char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+#endif
+#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488
+/* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */
+/* 4:8:8 = LP64 = a normal 64-bit system */
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+#ifndef __int8_t_defined
+#define __int8_t_defined
+typedef char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+#endif
+/* this system has a "long" of 64bit */
+#ifndef _HAVE_UINT64_T
+#define _HAVE_UINT64_T
+typedef unsigned long uint64_t;
+typedef long int64_t;
+#endif
+#elif _STDINT_LONG_MODEL+0 == 448
+/* LLP64 a 64-bit system derived from a 32-bit system */
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+#ifndef __int8_t_defined
+#define __int8_t_defined
+typedef char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+#endif
+/* assuming the system has a "long long" */
+#ifndef _HAVE_UINT64_T
+#define _HAVE_UINT64_T
+#define _HAVE_LONGLONG_UINT64_T
+typedef unsigned long long uint64_t;
+typedef long long int64_t;
+#endif
+#else
+#define _STDINT_NO_INT32_T
+#endif
+#else
+#define _STDINT_NO_INT8_T
+#define _STDINT_NO_INT32_T
+#endif
+#endif
+
+/*
+ * quote from SunOS-5.8 sys/inttypes.h:
+ * Use at your own risk. As of February 1996, the committee is squarely
+ * behind the fixed sized types; the "least" and "fast" types are still being
+ * discussed. The probability that the "fast" types may be removed before
+ * the standard is finalized is high enough that they are not currently
+ * implemented.
+ */
+
+#if defined _STDINT_NEED_INT_LEAST_T
+typedef int8_t int_least8_t;
+typedef int16_t int_least16_t;
+typedef int32_t int_least32_t;
+#ifdef _HAVE_UINT64_T
+typedef int64_t int_least64_t;
+#endif
+
+typedef uint8_t uint_least8_t;
+typedef uint16_t uint_least16_t;
+typedef uint32_t uint_least32_t;
+#ifdef _HAVE_UINT64_T
+typedef uint64_t uint_least64_t;
+#endif
+ /* least types */
+#endif
+
+#if defined _STDINT_NEED_INT_FAST_T
+typedef int8_t int_fast8_t;
+typedef int int_fast16_t;
+typedef int32_t int_fast32_t;
+#ifdef _HAVE_UINT64_T
+typedef int64_t int_fast64_t;
+#endif
+
+typedef uint8_t uint_fast8_t;
+typedef unsigned uint_fast16_t;
+typedef uint32_t uint_fast32_t;
+#ifdef _HAVE_UINT64_T
+typedef uint64_t uint_fast64_t;
+#endif
+ /* fast types */
+#endif
+
+#ifdef _STDINT_NEED_INTMAX_T
+#ifdef _HAVE_UINT64_T
+typedef int64_t intmax_t;
+typedef uint64_t uintmax_t;
+#else
+typedef long intmax_t;
+typedef unsigned long uintmax_t;
+#endif
+#endif
+
+#ifdef _STDINT_NEED_INTPTR_T
+#ifndef __intptr_t_defined
+#define __intptr_t_defined
+/* we encourage using "long" to store pointer values, never use "int" ! */
+#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484
+typedef unsigned int uintptr_t;
+typedef int intptr_t;
+#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444
+typedef unsigned long uintptr_t;
+typedef long intptr_t;
+#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T
+typedef uint64_t uintptr_t;
+typedef int64_t intptr_t;
+#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */
+typedef unsigned long uintptr_t;
+typedef long intptr_t;
+#endif
+#endif
+#endif
+
+/* The ISO C99 standard specifies that in C++ implementations these
+ should only be defined if explicitly requested. */
+#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
+#ifndef UINT32_C
+
+/* Signed. */
+# define INT8_C(c) c
+# define INT16_C(c) c
+# define INT32_C(c) c
+# ifdef _HAVE_LONGLONG_UINT64_T
+# define INT64_C(c) c ## L
+# else
+# define INT64_C(c) c ## LL
+# endif
+
+/* Unsigned. */
+# define UINT8_C(c) c ## U
+# define UINT16_C(c) c ## U
+# define UINT32_C(c) c ## U
+# ifdef _HAVE_LONGLONG_UINT64_T
+# define UINT64_C(c) c ## UL
+# else
+# define UINT64_C(c) c ## ULL
+# endif
+
+/* Maximal type. */
+# ifdef _HAVE_LONGLONG_UINT64_T
+# define INTMAX_C(c) c ## L
+# define UINTMAX_C(c) c ## UL
+# else
+# define INTMAX_C(c) c ## LL
+# define UINTMAX_C(c) c ## ULL
+# endif
+
+ /* literalnumbers */
+#endif
+#endif
+
+/* These limits are merily those of a two complement byte-oriented system */
+
+/* Minimum of signed integral types. */
+# define INT8_MIN (-128)
+# define INT16_MIN (-32767-1)
+# define INT32_MIN (-2147483647-1)
+# define INT64_MIN (-__INT64_C(9223372036854775807)-1)
+/* Maximum of signed integral types. */
+# define INT8_MAX (127)
+# define INT16_MAX (32767)
+# define INT32_MAX (2147483647)
+# define INT64_MAX (__INT64_C(9223372036854775807))
+
+/* Maximum of unsigned integral types. */
+# define UINT8_MAX (255)
+# define UINT16_MAX (65535)
+# define UINT32_MAX (4294967295U)
+# define UINT64_MAX (__UINT64_C(18446744073709551615))
+
+/* Minimum of signed integral types having a minimum size. */
+# define INT_LEAST8_MIN INT8_MIN
+# define INT_LEAST16_MIN INT16_MIN
+# define INT_LEAST32_MIN INT32_MIN
+# define INT_LEAST64_MIN INT64_MIN
+/* Maximum of signed integral types having a minimum size. */
+# define INT_LEAST8_MAX INT8_MAX
+# define INT_LEAST16_MAX INT16_MAX
+# define INT_LEAST32_MAX INT32_MAX
+# define INT_LEAST64_MAX INT64_MAX
+
+/* Maximum of unsigned integral types having a minimum size. */
+# define UINT_LEAST8_MAX UINT8_MAX
+# define UINT_LEAST16_MAX UINT16_MAX
+# define UINT_LEAST32_MAX UINT32_MAX
+# define UINT_LEAST64_MAX UINT64_MAX
+
+ /* shortcircuit*/
+#endif
+ /* once */
+#endif
+#endif
+STDINT_EOF
+fi
+ if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then
+ AC_MSG_NOTICE([$ac_stdint_h is unchanged])
+ else
+ ac_dir=`AS_DIRNAME(["$ac_stdint_h"])`
+ AS_MKDIR_P(["$ac_dir"])
+ rm -f $ac_stdint_h
+ mv $ac_stdint $ac_stdint_h
+ fi
+],[# variables for create stdint.h replacement
+PACKAGE="$PACKAGE"
+VERSION="$VERSION"
+ac_stdint_h="$ac_stdint_h"
+_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h)
+ac_cv_stdint_message="$ac_cv_stdint_message"
+ac_cv_header_stdint_t="$ac_cv_header_stdint_t"
+ac_cv_header_stdint_x="$ac_cv_header_stdint_x"
+ac_cv_header_stdint_o="$ac_cv_header_stdint_o"
+ac_cv_header_stdint_u="$ac_cv_header_stdint_u"
+ac_cv_type_uint64_t="$ac_cv_type_uint64_t"
+ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t"
+ac_cv_char_data_model="$ac_cv_char_data_model"
+ac_cv_long_data_model="$ac_cv_long_data_model"
+ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t"
+ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t"
+ac_cv_type_intmax_t="$ac_cv_type_intmax_t"
+])
+])
diff --git a/m4/ax_cvs.m4 b/m4/ax_cvs.m4
new file mode 100644
index 0000000..be731ba
--- /dev/null
+++ b/m4/ax_cvs.m4
@@ -0,0 +1,474 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cvs.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CVS([ANON_CVSROOT])
+#
+# DESCRIPTION
+#
+# Adds support cvs targets within your Makefile.
+#
+# Branching and releasing relies on you using the following version
+# format:
+#
+# MAJOR.MINOR.POINT
+#
+# where MAJOR is the major version number, MINOR is the minor version
+# number and POINT is the point release number.
+#
+# make update
+#
+# performs a cvs update
+#
+# make commitlog
+#
+# Generates a ChangeLog template with the modifed, added
+# and removed files and opens it up for editing. This is
+# not normally used directly, but is instad called by
+# commit. It is usefull however if you want to document
+# the work you have done, but don't want to commit just
+# yet.
+#
+# make commit
+#
+# performs a cvs commit after first performing a cvs
+# update and generating a commit log.
+#
+# make cvs-rm FILES="file1 file2 ..."
+#
+# removes a file or files specified by the FILES
+# variable from the file system and from cvs. It will
+# interactively ask you to confirm the file removal,
+# unless the file does not exist on the file system.
+#
+# make cvs-add FILES="file1 file2 ..."
+#
+# adds a file or files specified by the FILES variable
+# to cvs.
+#
+# make branch-major
+#
+# creates a branch based on the major version number,
+# increments the major version number, sets the minor
+# and point versions to zero and checks out the branch
+# into a new directory.
+#
+# make branch-minor
+#
+# creates a branch based on the minor version number,
+# increments the minor version, sets the point version
+# to zero number and checks out the branch into a new
+# directory.
+#
+# make release
+#
+# performs a cvs update, followed by a distcheck, then
+# creates a release for the current version, increaments
+# the point release number and checks out the release
+# into a new direcory
+#
+# make quick-release
+#
+# same as release, but distcheck is not performed
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CVS],
+[
+AC_REQUIRE([AX_SPLIT_VERSION])
+
+AC_SUBST([ANON_CVSROOT], [$1])
+AC_MSG_CHECKING([ANON_CVSROOT])
+if test "x$ANON_CVSROOT" != "x"; then
+ AC_MSG_RESULT([$ANON_CVSROOT])
+else
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([An anonymous CVSROOT must be specified to enable CVS support])
+fi
+
+
+AC_ARG_ENABLE(cvs-support,
+ AS_HELP_STRING(--enable-cvs-support[=ARG],
+ [enable cvs support. Used by the $PACKAGE developers.
+ ARG can be "yes" or "no". If the CVSROOT is found,
+ then the default is yes,
+ otherwise the default is no.]),
+ AX_USING_CVS=$enableval )
+
+if test "x$AX_USING_CVS" != "xno"; then
+ AC_ARG_VAR(CVS, [cvs executable to use])
+ if test "x$CVS" = "x"; then
+ AC_CHECK_PROGS(CVS,[cvs])
+ fi
+ if test "x$CVS" = "x"; then
+ if test "x$AX_USING_CVS" = "x"; then
+ AX_USING_CVS=no
+ else
+ AC_MSG_ERROR([CVS support cannot be enabled: cvs executable not found])
+ fi
+ fi
+ AC_SUBST([CVS])
+fi
+
+if test "x$AX_USING_CVS" != "xno"; then
+ AC_ARG_VAR(GAWK, [gawk executable to use])
+ if test "x$GAWK" = "x"; then
+ AC_CHECK_PROGS(GAWK,[gawk])
+ fi
+ if test "x$GAWK" = "x"; then
+ if test "x$AX_USING_CVS" = "x"; then
+ AX_USING_CVS=no
+ else
+ AC_MSG_ERROR([CVS support cannot be enabled: gawk could not be found])
+ fi
+ fi
+ AC_SUBST([GAWK])
+fi
+
+if test "x$AX_USING_CVS" != "xno"; then
+ AC_ARG_VAR(CVSEDITOR, [text editor to use for cvs])
+ if test "x$CVSEDITOR" = "x"; then
+ if test "x$EDITOR" = "x"; then
+ AC_CHECK_PROGS(CVSEDITOR,[vim vi emacs])
+ else
+ AC_CHECK_PROGS(CVSEDITOR,[$EDITOR vim vi emacs])
+ fi
+ fi
+ if test "x$CVSEDITOR" = "x"; then
+ if test "x$AX_USING_CVS" = "x"; then
+ AX_USING_CVS=no
+ else
+ AC_MSG_ERROR([CVS support cannot be enabled: CVSEDITOR not set and editor not found])
+ fi
+ fi
+ AC_SUBST([CVSEDITOR])
+fi
+
+if test "x$AX_USING_CVS" != "xno"; then
+ AC_ARG_VAR(CVSROOT, [the CVSROOT to use])
+ AC_MSG_CHECKING([CVSROOT])
+ if test -e "$srcdir/CVS/Root"; then
+ CVSROOT=`cat $srcdir/CVS/Root`;
+ AC_MSG_RESULT([$CVSROOT])
+ else
+ AC_MSG_RESULT([not found])
+ if test "x$AX_USING_CVS" = "x"; then
+ AX_USING_CVS=no
+ else
+ AC_MSG_ERROR([CVS support cannot be enabled: CVSROOT not found. Did you check out from CVS?])
+ fi
+ fi
+ AC_SUBST([CVSROOT])
+fi
+
+if test "x$AX_USING_CVS" != "xno"; then
+ AC_MSG_CHECKING([USERNAME])
+ if test "x$USERNAME" != "x"; then
+ AC_MSG_RESULT([$USERNAME])
+ else
+ AC_MSG_RESULT([not set])
+ if test "x$AX_USING_CVS" = "x"; then
+ AX_USING_CVS=no
+ else
+ AC_MSG_ERROR([CVS support cannot be enabled: USERNAME enviorment variable not set])
+ fi
+ fi
+ AC_SUBST([USERNAME])
+fi
+
+if test "x$AX_USING_CVS" != "xno"; then
+ AC_MSG_CHECKING([USEREMAIL])
+ if test "x$USERNAME" != "x"; then
+ AC_MSG_RESULT([$USEREMAIL])
+ else
+ AC_MSG_RESULT([not set])
+ if test "x$AX_USING_CVS" = "x"; then
+ AX_USING_CVS=no
+ else
+ AC_MSG_ERROR([CVS support cannot be enabled: USEREMAIL enviorment variable not set])
+ fi
+ fi
+ AC_SUBST([USEREMAIL])
+fi
+
+
+if test "x$AX_USING_CVS" != "xno"; then
+ AC_MSG_NOTICE([cvs support enabled])
+ m4_pattern_allow([AC_INIT])
+ AX_PRINT_TO_FILE([ax_cvs_rel.awk],[[
+
+BEGIN {
+ if( change <= 0 )
+ exit -1;
+}
+
+/AC_INIT/ {
+ if( ${AX_DOLLAR}2 ~ /\\)${AX_DOLLAR}/ )
+ {
+ ver = substr( ${AX_DOLLAR}2, 0, length( ${AX_DOLLAR}2 ) - 1 );
+ tail=\")\";
+ }
+ else
+ ver = ${AX_DOLLAR}2;
+
+ if( ${AX_DOLLAR}2 ~ /${AX_BS}${AX_SRB}${AX_DOLLAR}/ )
+ {
+ ver = substr( ${AX_DOLLAR}2, 0, length( ${AX_DOLLAR}2 ) - 1 );
+ tail=\"${AX_SRB}\";
+ }
+ else
+ ver = ${AX_DOLLAR}2;
+
+ if( ${AX_DOLLAR}2 ~ /\\,${AX_DOLLAR}/ )
+ {
+ ver = substr( ${AX_DOLLAR}2, 0, length( ${AX_DOLLAR}2 ) - 1 );
+ tail=\",\";
+ }
+ else
+ ver = ${AX_DOLLAR}2;
+
+ n = split( ver, ver_array, \".\" );
+
+ while( change > n )
+ ver_array[ ++n ] = 0;
+
+ ver_array[ change ]++;
+
+ while( ++change <= n )
+ ver_array[ change ] = 0;
+
+ ${AX_DOLLAR}2 = \"\";
+ for( i = 1; i < n; ++i )
+ ${AX_DOLLAR}2 = ${AX_DOLLAR}2 ver_array[ i ] \".\";
+ ${AX_DOLLAR}2 = ${AX_DOLLAR}2 ver_array[ n ];
+ if( tail )
+ ${AX_DOLLAR}2 = ${AX_DOLLAR}2 tail;
+}
+
+{ print ${AX_DOLLAR}0; }
+
+]])
+fi
+AM_CONDITIONAL([ax_cvs_enabled],[test "x$AX_USING_CVS" != "xno"])
+AX_ADD_AM_MACRO_STATIC([
+if ax_cvs_enabled
+update:
+ @cd \"${AX_DOLLAR}(srcdir)\" && \$(CVS) -z9 update
+
+cvsalways:
+
+${AX_DOLLAR}(top_builddir)/commitlog: cvsalways
+ @(CURR=\`pwd\`; cd \"${AX_DOLLAR}(top_srcdir)\"; \$(CVS) -z9 diff -u --brief 2>&1 | \\
+ \$(GAWK) \\
+ \'/^Index/ { print \"\\\\t* ./\" ${AX_DOLLAR}${AX_DOLLAR}2; } \\
+ /^cvs diff: .* was removed/ { print \"\\\\t* ./\" ${AX_DOLLAR}${AX_DOLLAR}3 \" (removed)\"; } \\
+ /^cvs diff: .* is a new entry/ { print \"\\\\t* ./\" ${AX_DOLLAR}${AX_DOLLAR}3 \" (added)\"; }\' \\
+ > \"${AX_DOLLAR}${AX_DOLLAR}CURR/commitlog.tmp\")
+ @if test -s commitlog.tmp; then \\
+ echo \"\" >> commitlog.tmp; \\
+ if test -f ${AX_DOLLAR}(top_builddir)/commitlog; then \\
+ cat ${AX_DOLLAR}(top_builddir)/commitlog >> commitlog.tmp; \\
+ fi; \\
+ echo \"/* -*-change-log-*- */\" > ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ DATE=\`date +\"%%Y-%%m-%%d\"\`; \\
+ echo \"${AX_DOLLAR}${AX_DOLLAR}DATE ${USERNAME} <${USEREMAIL}>\" >> ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ echo \"\" >> ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ cat commitlog.tmp >> ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ rm -f commitlog.tmp; \\
+ \$(CVSEDITOR) ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ \$(GAWK) \'BEGIN { blank=0; } \\
+ /\\\\/\\\\* -\\\\*-change-log-\\\\*- \\\\*\\\\// { getline; } \\
+ /^[[:blank:]]*\$\$/ { if( !blank ) { blank = 1; print; } } \\
+ /[[:alnum:]]/ { print; blank = 0; } \\
+ END{ if( !blank ) print \"\"; }\' \\
+ ${AX_DOLLAR}(top_builddir)/commitlog > commitlog.tmp; \\
+ mv commitlog.tmp ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ else \\
+ echo \"no changes found\";\\
+ fi
+
+commit: update ${AX_DOLLAR}(top_builddir)/commitlog
+ @if test -f ${AX_DOLLAR}(top_builddir)/commitlog; then \\
+ cat ${AX_DOLLAR}(top_builddir)/commitlog \"\$(top_srcdir)/ChangeLog\" > ChangeLog.tmp; \\
+ mv ChangeLog.tmp \"\$(top_srcdir)/ChangeLog\"; \\
+ CURR=\`(cd \"${AX_DOLLAR}(top_builddir)\"; pwd )\`; \\
+ (cd \"\$(top_srcdir)\"; \$(CVS) -z9 commit -F \"${AX_DOLLAR}${AX_DOLLAR}CURR/commitlog\" ); \\
+ rm -f ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ fi
+
+cvs-rm:
+ @echo \"Removing files from CVS\"
+ @if test \"x\$(FILES)\" != \"x\"; then \\
+ NEWFILES=\"\"; \\
+ for FILE in \$(FILES); do \\
+ if test -e \"${AX_DOLLAR}${AX_DOLLAR}FILE\"; then \\
+ rm -i \"${AX_DOLLAR}${AX_DOLLAR}FILE\"; \\
+ fi; \\
+ if test ! -e \"${AX_DOLLAR}${AX_DOLLAR}FILE\"; then \\
+ if test \"\$(srcdir)\" != \".\"; then \\
+ FILE=\`echo \"${AX_DOLLAR}${AX_DOLLAR}FILE\" | \$(SED) -e \'s|^\$(srcdir)|.|\'\`; \\
+ fi; \\
+ NEWFILES=\"${AX_DOLLAR}${AX_DOLLAR}NEWFILES ${AX_DOLLAR}${AX_DOLLAR}FILE\"; \\
+ fi; \\
+ done; \\
+ if test \"x${AX_DOLLAR}${AX_DOLLAR}NEWFILES\" != \"x\"; then \\
+ (cd \"\$(srddir)\"; \$(CVS) remove ${AX_DOLLAR}${AX_DOLLAR}NEWFILES; ); \\
+ fi; \\
+ else \\
+ echo \"You must specify the file(s) you want to remove from cvs by using\"; \\
+ echo \"the FILES environment variable. For example:\"; \\
+ echo \" make cvs-rm FILES=\'foo bar\'\"; \\
+ echo \"\"; \\
+ exit 1; \\
+ fi
+
+cvs-add:
+ @echo \"Adding files to CVS\"
+ @if test \"x${AX_DOLLAR}(FILES)\" != \"x\"; then \\
+ NEWFILES=\"\"; \\
+ for FILE in ${AX_DOLLAR}(FILES); do \\
+ if test -e \"${AX_DOLLAR}${AX_DOLLAR}FILE\"; then \\
+ if test \"${AX_DOLLAR}(srcdir)\" != \".\"; then \\
+ FILE=\`echo \"${AX_DOLLAR}${AX_DOLLAR}FILE\" | sed -e \'s|^${AX_DOLLAR}(srcdir)|.|\'\`; \\
+ fi; \\
+ fi; \\
+ NEWFILES=\"${AX_DOLLAR}${AX_DOLLAR}NEWFILES ${AX_DOLLAR}${AX_DOLLAR}FILE\"; \\
+ done; \\
+ if test \"x${AX_DOLLAR}${AX_DOLLAR}NEWFILES\" != \"x\"; then \\
+ cd \"${AX_DOLLAR}(srcdir)\"; \$(CVS) add ${AX_DOLLAR}${AX_DOLLAR}NEWFILES; \\
+ fi; \\
+ else \\
+ echo \"You must specify the file(s) you want to add to cvs by using\"; \\
+ echo \"the FILES environment variable. For example:\"; \\
+ echo \" make cvs-add FILES=\'foo bar\'\"; \\
+ echo \"\"; \\
+ exit 1; \\
+ fi
+
+branch-major:
+ @tag=\"\$(PACKAGE)-${AX_MAJOR_VERSION}\"; \\
+ echo \"\"; \\
+ echo \"Creating major brach: ${AX_DOLLAR}${AX_DOLLAR}tag\"; \\
+ (cd \"${AX_DOLLAR}(top_srcdir)\"; \$(CVS) tag -b \"${AX_DOLLAR}${AX_DOLLAR}tag\"; ); \\
+ \$(GAWK) -f ax_cvs_rel.awk -v change=1 \"${AX_DOLLAR}(top_srcdir)/configure.ac\" > configure.tmp; \\
+ touch ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ DATE=\`date +\"%%Y-%%m-%%d\"\`; \\
+ echo \"${AX_DOLLAR}${AX_DOLLAR}DATE \$(USERNAME) <\$(USEREMAIL)>\" > commitlog.tmp ; \\
+ echo \"\" >> commitlog.tmp; \\
+ echo \" * ./configure.ac\" >> commitlog.tmp; \\
+ echo \" Created major branch: ${AX_DOLLAR}${AX_DOLLAR}tag\" >> commitlog.tmp; \\
+ echo \" Use:\" >> commitlog.tmp; \\
+ echo \" \\\\\`cvs -d\$(ANON_CVSROOT) login\\\\\`\" >> commitlog.tmp; \\
+ echo \" \\\\\`cvs -d\$(ANON_CVSROOT) co -r ${AX_DOLLAR}${AX_DOLLAR}tag \$(PACKAGE)\\\\\`\" >> commitlog.tmp; \\
+ echo \" to access the branch\" >> commitlog.tmp; \\
+ echo \"\" >> commitlog.tmp; \\
+ cat ${AX_DOLLAR}(top_builddir)/commitlog >> commitlog.tmp; \\
+ mv commitlog.tmp ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ cat ${AX_DOLLAR}(top_builddir)/commitlog \"${AX_DOLLAR}(top_srcdir)/ChangeLog\" > ChangeLog.tmp; \\
+ mv ChangeLog.tmp \"${AX_DOLLAR}(top_srcdir)/ChangeLog\"; \\
+ mv configure.tmp \"${AX_DOLLAR}(top_srcdir)/configure.ac\"; \\
+ CURR=\`(cd \"${AX_DOLLAR}(top_builddir)\"; pwd )\`; \\
+ (cd \"${AX_DOLLAR}(top_srcdir)\"; \$(CVS) -z9 commit -F \"${AX_DOLLAR}${AX_DOLLAR}CURR/commitlog\"; ); \\
+ rm -f ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ \$(CVS) -z9 -d${AX_DOLLAR}(CVSROOT) co -r ${AX_DOLLAR}${AX_DOLLAR}tag -d ${AX_DOLLAR}${AX_DOLLAR}tag \$(PACKAGE); \\
+ echo \"The branch is now available in the ${AX_DOLLAR}${AX_DOLLAR}tag directory\"; \\
+ echo \"\"
+
+
+branch-minor:
+ @tag=\"\$(PACKAGE)-${AX_MAJOR_VERSION}_${AX_MINOR_VERSION}\"; \\
+ echo \"\"; \\
+ echo \"Creating minor brach: ${AX_DOLLAR}${AX_DOLLAR}tag\"; \\
+ (cd \"${AX_DOLLAR}(top_srcdir)\"; \$(CVS) tag -b \"${AX_DOLLAR}${AX_DOLLAR}tag\"; ); \\
+ \$(GAWK) -f ax_cvs_rel.awk -v change=1 \"${AX_DOLLAR}(top_srcdir)/configure.ac\" > configure.tmp; \\
+ touch ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ DATE=\`date +\"%%Y-%%m-%%d\"\`; \\
+ echo \"${AX_DOLLAR}${AX_DOLLAR}DATE \$(USERNAME) <\$(USEREMAIL)>\" > commitlog.tmp ; \\
+ echo \"\" >> commitlog.tmp; \\
+ echo \" * ./configure.ac\" >> commitlog.tmp; \\
+ echo \" Created minor branch: ${AX_DOLLAR}${AX_DOLLAR}tag\" >> commitlog.tmp; \\
+ echo \" Use:\" >> commitlog.tmp; \\
+ echo \" \\\\\`cvs -d\$(ANON_CVSROOT) login\\\\\`\" >> commitlog.tmp; \\
+ echo \" \\\\\`cvs -d\$(ANON_CVSROOT) co -r ${AX_DOLLAR}${AX_DOLLAR}tag \$(PACKAGE)\\\\\`\" >> commitlog.tmp; \\
+ echo \" to access the branch\" >> commitlog.tmp; \\
+ echo \"\" >> commitlog.tmp; \\
+ cat ${AX_DOLLAR}(top_builddir)/commitlog >> commitlog.tmp; \\
+ mv commitlog.tmp ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ cat ${AX_DOLLAR}(top_builddir)/commitlog \"${AX_DOLLAR}(top_srcdir)/ChangeLog\" > ChangeLog.tmp; \\
+ mv ChangeLog.tmp \"${AX_DOLLAR}(top_srcdir)/ChangeLog\"; \\
+ mv configure.tmp \"${AX_DOLLAR}(top_srcdir)/configure.ac\"; \\
+ CURR=\`(cd \"${AX_DOLLAR}(top_builddir)\"; pwd )\`; \\
+ (cd \"${AX_DOLLAR}(top_srcdir)\"; \$(CVS) -z9 commit -F \"${AX_DOLLAR}${AX_DOLLAR}CURR/commitlog\"; ); \\
+ rm -f ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ \$(CVS) -z9 -d${AX_DOLLAR}(CVSROOT) co -r ${AX_DOLLAR}${AX_DOLLAR}tag -d ${AX_DOLLAR}${AX_DOLLAR}tag \$(PACKAGE); \\
+ echo \"The branch is now available in the ${AX_DOLLAR}${AX_DOLLAR}tag directory\"; \\
+ echo \"\"
+
+add_rel:
+ @touch \"${AX_DOLLAR}(top_builddir)/commitlog\"
+ @DATE=\`date +\"%%Y-%%m-%%d\"\`; \\
+ echo \"${AX_DOLLAR}${AX_DOLLAR}DATE \$(USERNAME) <\$(USEREMAIL)>\" > commitlog.tmp
+ @echo \"\" >> commitlog.tmp
+ @echo \" * ./configure.ac\" >> commitlog.tmp
+ @echo \" Released \$(PACKAGE)-\$(VERSION)\" >> commitlog.tmp
+ @echo \" You can access this release by running:\" >> commitlog.tmp
+ @echo \" \\\\\`cvs -d\$(ANON_CVSROOT) login\\\\\`\" >> commitlog.tmp
+ @tag=\"\$(PACKAGE)-${AX_MAJOR_VERSION}_${AX_MINOR_VERSION}_${AX_POINT_VERSION}\"; \\
+ echo \" \\\\\`cvs -d\$(ANON_CVSROOT) co -r ${AX_DOLLAR}${AX_DOLLAR}tag -d \$(PACKAGE)-\$(VERSION) \$(PACKAGE)\\\\\`\" >> commitlog.tmp
+ @echo \" The release will then be available in the \$(PACKAGE)-\$(VERSION) directory\" >> commitlog.tmp
+ @echo \"\" >> commitlog.tmp
+ @cat \"${AX_DOLLAR}(top_builddir)/commitlog\" >> commitlog.tmp
+ @mv commitlog.tmp \"${AX_DOLLAR}(top_builddir)/commitlog\"
+ @cat \"${AX_DOLLAR}(top_builddir)/commitlog\" \"\$(top_srcdir)/ChangeLog\" > ChangeLog.tmp
+ @mv ChangeLog.tmp \"\$(top_srcdir)/ChangeLog\"
+ @CURR=\`(cd \"${AX_DOLLAR}(top_builddir)\"; pwd )\`; \\
+ (cd \"\$(top_srcdir)\"; \$(CVS) -z9 commit -F \"${AX_DOLLAR}${AX_DOLLAR}CURR/commitlog\"; )
+ @rm -f ${AX_DOLLAR}(top_builddir)/commitlog
+
+do_tag:
+ @tag=\"\$(PACKAGE)-${AX_MAJOR_VERSION}_${AX_MINOR_VERSION}_${AX_POINT_VERSION}\"; \\
+ echo \"tagging release with ${AX_DOLLAR}${AX_DOLLAR}tag\"; \\
+ (cd \"\$(top_srcdir)\"; \$(CVS) tag -b \"${AX_DOLLAR}${AX_DOLLAR}tag\"; ); \\
+ \$(CVS) -z9 -d\$(CVSROOT) co -r ${AX_DOLLAR}${AX_DOLLAR}tag -d ${AX_DOLLAR}${AX_DOLLAR}tag \$(PACKAGE); \\
+ echo \"The release is now available in the ${AX_DOLLAR}${AX_DOLLAR}tag directory\"; \\
+ echo \"\"
+
+inc_rel:
+ @\$(GAWK) -f ax_cvs_rel.awk -v change=3 \"\$(top_srcdir)/configure.ac\" > configure.tmp;
+ @mv configure.tmp \"\$(top_srcdir)/configure.ac\"
+ @touch \"\$(top_builddir)/commitlog\"
+ @DATE=\`date +\"%%Y-%%m-%%d\"\`; \\
+ echo \"${AX_DOLLAR}${AX_DOLLAR}DATE \$(USERNAME) <\$(USEREMAIL)>\" > commitlog.tmp ; \\
+ echo \"\" >> commitlog.tmp; \\
+ echo \" * ./configure.ac\" >> commitlog.tmp; \\
+ echo \" Update version number\" >> commitlog.tmp; \\
+ echo \"\" >> commitlog.tmp; \\
+ cat ${AX_DOLLAR}(top_builddir)/commitlog >> commitlog.tmp; \\
+ mv commitlog.tmp ${AX_DOLLAR}(top_builddir)/commitlog; \\
+ cat ${AX_DOLLAR}(top_builddir)/commitlog \"${AX_DOLLAR}(top_srcdir)/ChangeLog\" > ChangeLog.tmp; \\
+ mv ChangeLog.tmp \"${AX_DOLLAR}(top_srcdir)/ChangeLog\"; \\
+ CURR=\`(cd \"${AX_DOLLAR}(top_builddir)\"; pwd )\`; \\
+ (cd \"${AX_DOLLAR}(top_srcdir)\"; \$(CVS) -z9 commit -F \"${AX_DOLLAR}${AX_DOLLAR}CURR/commitlog\"; ); \\
+ rm -f ${AX_DOLLAR}(top_builddir)/commitlog;
+
+tag: do_tag inc_rel
+
+# creates a release for the current version, increaments the point
+# release number and checkout the release into a new direcory
+release: update distcheck add_rel tag
+
+# same as release, but distcheck is not performed before releasing
+quick-release: update add_rel tag
+
+endif # ax_cvs_enabled
+])
+
+])
diff --git a/m4/ax_cxx_check_flag.m4 b/m4/ax_cxx_check_flag.m4
new file mode 100644
index 0000000..d2d27b1
--- /dev/null
+++ b/m4/ax_cxx_check_flag.m4
@@ -0,0 +1,84 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cxx_check_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CXX_CHECK_FLAG(FLAG-TO-CHECK,[PROLOGUE],[BODY],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# This macro tests if the C++ compiler supports the flag FLAG-TO-CHECK. If
+# successfull execute ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+# PROLOGUE and BODY are optional and should be used as in AC_LANG_PROGRAM
+# macro.
+#
+# This code is inspired from KDE_CHECK_COMPILER_FLAG macro. Thanks to
+# Bogdan Drozdowski <bogdandr@op.pl> for testing and bug fixes.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CXX_CHECK_FLAG],[
+ AC_PREREQ([2.61])
+ AC_REQUIRE([AC_PROG_CXX])
+ AC_REQUIRE([AC_PROG_SED])
+
+ flag=`echo "$1" | $SED 'y% .=/+-(){}<>:*,%_______________%'`
+
+ AC_CACHE_CHECK([whether the C++ compiler accepts the $1 flag],
+ [ax_cv_cxx_check_flag_$flag],[
+
+ AC_LANG_PUSH([C++])
+
+ save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $1"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([$2],[$3])
+ ],[
+ eval "ax_cv_cxx_check_flag_$flag=yes"
+ ],[
+ eval "ax_cv_cxx_check_flag_$flag=no"
+ ])
+
+ CXXFLAGS="$save_CXXFLAGS"
+
+ AC_LANG_POP
+
+ ])
+
+ AS_IF([eval "test \"`echo '$ax_cv_cxx_check_flag_'$flag`\" = yes"],[
+ :
+ $4
+ ],[
+ :
+ $5
+ ])
+])
diff --git a/m4/ax_cxx_gcc_abi_demangle.m4 b/m4/ax_cxx_gcc_abi_demangle.m4
new file mode 100644
index 0000000..bc71cee
--- /dev/null
+++ b/m4/ax_cxx_gcc_abi_demangle.m4
@@ -0,0 +1,54 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cxx_gcc_abi_demangle.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CXX_GCC_ABI_DEMANGLE
+#
+# DESCRIPTION
+#
+# If the compiler supports GCC C++ ABI name demangling (has header
+# cxxabi.h and abi::__cxa_demangle() function), define
+# HAVE_GCC_ABI_DEMANGLE
+#
+# Adapted from AC_CXX_RTTI by Luc Maisonobe
+#
+# LICENSE
+#
+# Copyright (c) 2008 Neil Ferguson <nferguso@eso.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_CXX_GCC_ABI_DEMANGLE],
+[AC_CACHE_CHECK(whether the compiler supports GCC C++ ABI name demangling,
+ac_cv_cxx_gcc_abi_demangle,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <typeinfo>
+#include <cxxabi.h>
+#include <string>
+
+template<typename TYPE>
+class A {};
+],[A<int> instance;
+int status = 0;
+char* c_name = 0;
+
+c_name = abi::__cxa_demangle(typeid(instance).name(), 0, 0, &status);
+
+std::string name(c_name);
+free(c_name);
+
+return name == "A<int>";
+],
+ ac_cv_cxx_gcc_abi_demangle=yes, ac_cv_cxx_gcc_abi_demangle=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_gcc_abi_demangle" = yes; then
+ AC_DEFINE(HAVE_GCC_ABI_DEMANGLE,1,
+ [define if the compiler supports GCC C++ ABI name demangling])
+fi
+])
diff --git a/m4/ax_cxxcpp_check_flag.m4 b/m4/ax_cxxcpp_check_flag.m4
new file mode 100644
index 0000000..6e04e82
--- /dev/null
+++ b/m4/ax_cxxcpp_check_flag.m4
@@ -0,0 +1,84 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_cxxcpp_check_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CXXCPP_CHECK_FLAG(FLAG-TO-CHECK,[PROLOGUE],[BODY],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# This macro tests if the C++ preprocessor supports the flag
+# FLAG-TO-CHECK. If successfull execute ACTION-IF-SUCCESS otherwise
+# ACTION-IF-FAILURE. PROLOGUE and BODY are optional and should be used as
+# in AC_LANG_PROGRAM macro.
+#
+# This code is inspired from KDE_CHECK_COMPILER_FLAG macro. Thanks to
+# Bogdan Drozdowski <bogdandr@op.pl> for testing and bug fixes.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_CXXCPP_CHECK_FLAG],[
+ AC_PREREQ([2.61])
+ AC_REQUIRE([AC_PROG_CXXCPP])
+ AC_REQUIRE([AC_PROG_SED])
+
+ flag=`echo "$1" | $SED 'y% .=/+-(){}<>:*,%_______________%'`
+
+ AC_CACHE_CHECK([whether the C++ preprocessor accepts the $1 flag],
+ [ax_cv_cxxcpp_check_flag_$flag],[
+
+ AC_LANG_PUSH([C++])
+
+ save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $1"
+ AC_PREPROC_IFELSE([
+ AC_LANG_PROGRAM([$2],[$3])
+ ],[
+ eval "ax_cv_cxxcpp_check_flag_$flag=yes"
+ ],[
+ eval "ax_cv_cxxcpp_check_flag_$flag=no"
+ ])
+
+ CXXFLAGS="$save_CXXFLAGS"
+
+ AC_LANG_POP
+
+ ])
+
+ AS_IF([eval "test \"`echo '$ax_cv_cxxcpp_check_flag_'$flag`\" = yes"],[
+ :
+ $4
+ ],[
+ :
+ $5
+ ])
+])
diff --git a/m4/ax_dirname.m4 b/m4/ax_dirname.m4
new file mode 100644
index 0000000..80e11f0
--- /dev/null
+++ b/m4/ax_dirname.m4
@@ -0,0 +1,58 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_dirname.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_DIRNAME(PATHNAME)
+#
+# DESCRIPTION
+#
+# Parts of the implementation have been taken from AS_DIRNAME from the
+# main autoconf package in generation 2.5x. However, we do only use "sed"
+# to cut out the dirname, and we do additionally clean up some dir/..
+# parts in the resulting pattern.
+#
+# this macro may be used in autoconf 2.13 scripts as well.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_DIRNAME],
+[echo X[]$1 |
+ sed ['s/\/[^\/:][^\/:]*\/..\//\//g
+ s/\/[^\/:][^\/:]*\/..\//\//g
+ s/\/[^\/:][^\/:]*\/..\//\//g
+ s/\/[^\/:][^\/:]*\/..\//\//g
+ /^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q']])
diff --git a/m4/ax_dist_msi.m4 b/m4/ax_dist_msi.m4
new file mode 100644
index 0000000..adc00ae
--- /dev/null
+++ b/m4/ax_dist_msi.m4
@@ -0,0 +1,111 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_dist_msi.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_DIST_MSI([File])
+#
+# DESCRIPTION
+#
+# Adds support for a msi (Microsoft Installer) dist target.
+#
+# You must manually build the msi file yourself (probably from another
+# computer). But it will be added to the list of extra bin dists and
+# flagged for uploading (see ax_extra_dist.m4 and ax_upload.m4 for
+# details).
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_DIST_MSI],
+[
+AC_REQUIRE([AX_INSTALL_FILES])
+AC_MSG_NOTICE([adding dist-msi support])
+MSI_SETUP_FILE="$1"
+AC_SUBST(MSI_SETUP_FILE)
+if test "x$MSI_SETUP_FILE" != "x"; then
+ AC_MSG_NOTICE([setting msi file... $MSI_SETUP_FILE])
+ AC_SUBST(USING_DIST_MSI)
+ AC_ARG_ENABLE(dist-msi,
+ AS_HELP_STRING(--enable-dist-msi[=ARG],
+ [enable support for msi (Microsoft Installer)
+ dist target. ARG can be
+ "yes" or "no". The default is "yes"]),
+ if test "x$enableval" != "x"; then
+ if test "x$enableval" = "xyes"; then
+ USING_DIST_MSI=true
+ AC_MSG_NOTICE([dist-msi support enabled])
+ elif test "x$enableval" = "xno"; then
+ USING_DIST_MSI=false
+ AC_MSG_NOTICE([dist-msi support disabled])
+ fi
+ fi,
+ USING_DIST_MSI=true
+ AC_MSG_NOTICE([dist-msi support enabled]))
+else
+ AC_MSG_NOTICE([setting msi file... not set])
+ AC_MSG_ERROR([a file must be specified when addind msi support])
+fi
+AM_CONDITIONAL([ax_dist_msi_enabled],[test "x$USING_DIST_MSI" = "xtrue"])
+AX_ADD_AM_MACRO_STATIC([
+
+if ax_dist_msi_enabled
+msi dist-msi: \$(top_builddir)/\$(PACKAGE)-\$(VERSION).msi
+
+\$(top_builddir)/\$(PACKAGE)-\$(VERSION).msi: \$(top_builddir)/\$(MSI_SETUP_FILE)
+ @cp -f \"\$(top_builddir)/\$(MSI_SETUP_FILE)\" \"${AX_DOLLAR}@\"
+
+])
+AM_CONDITIONAL([ax_dist_msi_have_install_files],[test "x$AX_HAVE_INSTALL_FILES" = "xtrue"])
+AX_ADD_AM_MACRO_STATIC([
+
+if ax_dist_msi_have_install_files
+\$(top_builddir)/\$(MSI_SETUP_FILE): \$(top_builddir)/install_files
+ @echo \"the msi file (\$(MSI_SETUP_FILE)) must be (re)created\"; \\
+ echo \"by building it with VC++\"; \\
+ exit -1
+else
+\$(top_builddir)/\$(MSI_SETUP_FILE): msi_up_to_date_notice
+ @if test ! -f \"\$(top_builddir)/\$(MSI_SETUP_FILE)\"; then \\
+ echo \"the msi file (\$(MSI_SETUP_FILE)) must be created\"; \\
+ echo \"by building it with VC++\"; \\
+ exit -1; \\
+ fi
+
+msi_up_to_date_notice:
+ @if test -f \"\$(top_builddir)/\$(MSI_SETUP_FILE)\"; then \\
+ echo \"Warning: Depedancy tracking cannot be enabled\"; \\
+ echo \"Warning: the msi file (\$(MSI_SETUP_FILE))\"; \\
+ echo \"Warning: Please make sure it is up to date.\"; \\
+ exit -1; \\
+ fi
+endif # ax_dist_msi_have_install_files
+])
+
+AM_CONDITIONAL([ax_dist_msi_using_ax_extra_dist],[test "x$USING_AX_EXTRA_DIST" != "x"])
+AX_ADD_AM_MACRO_STATIC([
+
+if ax_dist_msi_using_ax_extra_dist
+EXTRA_BIN_DISTS += msi
+endif # ax_dist_msi_using_ax_extra_dist
+
+])
+
+AM_CONDITIONAL([ax_dist_msi_using_ax_upload],[test "x$USING_AX_UPLOAD" != "x"])
+AX_ADD_AM_MACRO_STATIC([
+
+if ax_dist_msi_using_ax_upload
+UPLOAD_BIN += upload-msi
+UPLOAD_TARGETS += {msi=>\$(PACKAGE)-\$(VERSION).msi}
+endif # ax_dist_msi_using_ax_upload
+
+endif # ax_dist_msi_enabled
+
+])
+])
diff --git a/m4/ax_dist_rpm.m4 b/m4/ax_dist_rpm.m4
new file mode 100644
index 0000000..7f5987f
--- /dev/null
+++ b/m4/ax_dist_rpm.m4
@@ -0,0 +1,326 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_dist_rpm.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_DIST_RPM([SPEC])
+#
+# DESCRIPTION
+#
+# Adds support for a rpm dist target.
+#
+# You will need to create a spec template with everything except the files
+# and the Changlog. @NAME@ will be replaced with the value of @PACKAGE@
+# and @VER@ will be replaced with the value of @VERSION@. The files and
+# ChangeLog will be filled in automatically. For instance:
+#
+# Summary: Foobar
+# Name: @NAME@
+# Version: @VER@
+# Release: 0
+# Copyright: GPL
+# Group: Productivity/Networking
+# Source0: http://somewhere/Foobar/%{name}-%{version}.tar.gz
+# URL: http://somewhere
+# BuildRoot: %{_tmppath}/%{name}-root
+# Prefix: %{_prefix}
+#
+# %description
+# Foobar does something
+#
+# %prep
+# %setup
+#
+# %build
+# %configure
+# make
+#
+# %install
+# %makeinstall
+#
+# %clean
+# rm -rf $RPM_BUILD_ROOT
+#
+# %files
+# %defattr(-,root,root)
+#
+# %doc AUTHORS BUGS COPYING INSTALL NEWS README
+#
+# %changelog
+#
+# Make sure ax_upload.am is added to aminclude.am and you have 'include
+# aminclude.am' in your toplevel Makefile.am
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_DIST_RPM],
+[
+AC_REQUIRE([AX_INSTALL_FILES])
+AC_MSG_NOTICE([adding rpm support])
+AM_CONDITIONAL([ax_dist_rpm_enable_upload],[test "x$USING_AX_UPLOAD" != "x"])
+AM_CONDITIONAL([ax_dist_rpm_using_ax_extra_dist],[test "x$USING_AX_EXTRA_DIST" != "x"])
+ax_dist_rpm_enabled=false
+if test "x$AX_HAVE_INSTALL_FILES" = "xtrue"; then
+ AC_MSG_CHECKING([rpm spec template])
+ if test -f "$1.in"; then
+ AC_MSG_RESULT([$1.in])
+ AX_RPM_SPEC_FILE="$1";
+ AC_SUBST(AX_RPM_SPEC_FILE)
+ AC_CONFIG_FILES([spec.tmpl])
+ AC_ARG_VAR(EDITOR, [default text editor])
+ if test "x$EDITOR" = "x"; then
+ AC_CHECK_PROGS(EDITOR,[vim vi emacs])
+ fi
+ AC_ARG_VAR(RPM, [rpm executable to use])
+ if test "x$RPM" = "x"; then
+ AC_CHECK_PROGS(RPM,[rpmbuild rpm echo])
+ fi
+ if test "x$RPM" != "x"; then
+ AC_ARG_VAR(PLATFORM_SUFFIX, [A short name for your platform that will be added to the name of the the binary RPMs you may choose to create (by running make rpm). e.g. rh71 for RedHat 7.1, lsb1.3 for a LSB 1.3 compliant system (SuSE 8.2 or RedHat 9), osx103 for OS X 10.3.x, etc])
+ AC_MSG_CHECKING([rpm platform suffix])
+ if test "x$PLATFORM_SUFFIX" != "x"; then
+ AC_MSG_RESULT([$PLATFORM_SUFFIX])
+ AC_SUBST([PLATFORM_SUFFIX])
+ ax_dist_rpm_enabled=true
+ else
+ AC_MSG_RESULT([$PLATFORM_SUFFIX])
+ AC_MSG_WARN([rpm support disabled... PLATFORM_SUFFIX not set])
+ fi
+ else
+ AC_MSG_NOTICE([rpm support disabled... neither rpmbuild or rpm was found])
+ fi
+ else
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([rpm spec template "$1.in" could not be found])
+ fi
+else
+ AC_MSG_NOTICE([rpm support disabled... install_files not available])
+fi
+AM_CONDITIONAL([ax_dist_rpm_enabled], [test x"$ax_dist_rpm_enabled" = x"true"])
+
+AX_ADD_AM_MACRO_STATIC([
+if ax_dist_rpm_enabled
+
+AX_DIST_RPM_CLEANFILES = \$(top_builddir)/RPMChangeLog \$(AX_INSTALL_FILES_CLEANFILES)
+
+\$(top_builddir)/RPMChangeLog: \$(top_srcdir)/ChangeLog
+ \$(GAWK) '/^[^0-9]/ { \\
+ if( \$${AX_DOLLAR}1 == \"*\" ) \$${AX_DOLLAR}1 = \"-\"; print; } \\
+ /^\$\$/ { \\
+ print; } \\
+ /^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/ { \\
+ if( stop ) exit; \\
+ split( \$${AX_DOLLAR}1, date, \"-\" ); \\
+ \$${AX_DOLLAR}1 = strftime( \"%%a %%b %%d %%Y\", \\
+ mktime( date[ 1 ] \" \" date[ 2 ] \" \" date [ 3 ] \" 00 00 00\" ) ); \\
+ print \"* \" \$${AX_DOLLAR}0; } \\
+ /Released \$(PACKAGE)-/ { \\
+ gsub( /\$(PACKAGE)-/, \"\", \$${AX_DOLLAR}2 ); \\
+ split( \$${AX_DOLLAR}2, ver, \".\" ); \\
+ split( \"\$(VERSION)\", curr_ver, \".\" ); \\
+ if( ver[ 1 ] != curr_ver[ 1 ] || ver[ 2 ] != curr_ver[ 2 ] ) stop = 1; } \\
+ END { \\
+ print \"[Please see the ChangeLog file for older changes] - Ed.\"; }' \\
+ \$(top_srcdir)/ChangeLog > \$(top_builddir)/RPMChangeLog
+
+AX_DIST_RPM_CLEANFILES += \$(top_builddir)/\$(PACKAGE)-\$(VERSION).spec
+AX_DIST_RPM_EXTRA_DIST = \$(top_builddir)/\$(PACKAGE)-\$(VERSION).spec \$(top_builddir)/\$(AX_RPM_SPEC_FILE).in
+
+spec: \$(top_builddir)/\$(PACKAGE)-\$(VERSION).spec
+
+\$(top_builddir)/\$(PACKAGE)-\$(VERSION).spec: \$(top_builddir)/\$(AX_RPM_SPEC_FILE) \$(top_builddir)/install_files \$(top_builddir)/RPMChangeLog
+ @cat \"\$(top_builddir)/\$(AX_RPM_SPEC_FILE)\" \\
+ | \$(GAWK) -v files=\"\$\$files\" \\
+ '{ print; } \\
+ /%%defattr/ { while((getline < \"install_files\" ) > 0 ) { print; } }' \\
+ > \"\$(top_builddir)/\$(PACKAGE)-\$(VERSION).spec\"
+ @cat \"\$(top_builddir)/RPMChangeLog\" >> \"\$(top_builddir)/\$(PACKAGE)-\$(VERSION).spec\"
+
+AX_DIST_RPM_CLEANFILES += \\
+\$(top_builddir)/*.rpm \\
+\$(top_builddir)/rpmmacros
+
+~/.rpmmacros:
+ @echo \"~/.rpmmacros not found. Creating one like the following:\"; \\
+ echo \"\"; \\
+ echo \"%%packager <YOUR NAME>\"; \\
+ echo \"\"; \\
+ echo \"%%distribution <YOUR_DISTRIBUTION>\"; \\
+ echo \"%%vendor <YOUR_ORGANISATION>\"; \\
+ echo \"\"; \\
+ echo \"%%_topdir \$\$HOME/\"; \\
+ echo \"%%_tmppath /tmp/\"; \\
+ echo \"\"; \\
+ echo \"%%_rpmtopdir %%{_topdir}rpm/\"; \\
+ echo \"%%_builddir %%{_tmppath}\"; \\
+ echo \"%%_rpmdir %%{_rpmtopdir}RPMS/\"; \\
+ echo \"%%_sourcedir %%{_rpmtopdir}SOURCES/\"; \\
+ echo \"%%_specdir %%{_rpmtopdir}SPECS/\"; \\
+ echo \"%%_srcrpmdir %%{_rpmtopdir}SRPMS/\"; \\
+ echo \"\"; \\
+ echo \"Where <YOUR_NAME> is your name and <YOUR_DISTRIBUTION> is the\"; \\
+ echo \"distribution you are building on (e.g. SuSE Linux 8.2 or\"; \\
+ echo \"RedHat Linux 7.1). and <YOUR_ORGANISATION> is the organisation\"; \\
+ echo \"you are associated with.\"; \\
+ echo \"\"; \\
+ echo \"Running 'make create-rpmmacros' will create a ~/.rpmmacros file\"; \\
+ echo \"for you and try to open it in an editor\"; \\
+ exit -1
+
+create-rpmmacros:
+ @if test -e ~/.rpmmacros; then \\
+ echo \"Error: ~/.rpmmacros already exists\"; \\
+ echo \"Please remove it if you want to use\"; \\
+ echo \"this command to replace it\"; \\
+ exit -1; \\
+ else \\
+ echo \"%%packager <YOUR NAME>\" > ~/.rpmmacros; \\
+ echo \"\" >> ~/.rpmmacros; \\
+ echo \"%%distribution <YOUR_DISTRIBUTION>\" >> ~/.rpmmacros; \\
+ echo \"%%vendor <YOUR_ORGANISATION>\" >> ~/.rpmmacros; \\
+ echo \"\" >> ~/.rpmmacros; \\
+ echo \"%%_topdir \$\$HOME/\" >> ~/.rpmmacros; \\
+ echo \"%%_tmppath /tmp/\" >> ~/.rpmmacros; \\
+ echo \"\" >> ~/.rpmmacros; \\
+ echo \"%%_rpmtopdir %%{_topdir}rpm/\" >> ~/.rpmmacros; \\
+ echo \"%%_builddir %%{_tmppath}\" >> ~/.rpmmacros; \\
+ echo \"%%_rpmdir %%{_rpmtopdir}RPMS/\" >> ~/.rpmmacros; \\
+ echo \"%%_sourcedir %%{_rpmtopdir}SOURCES/\" >> ~/.rpmmacros; \\
+ echo \"%%_specdir %%{_rpmtopdir}SPECS/\" >> ~/.rpmmacros; \\
+ echo \"%%_srcrpmdir %%{_rpmtopdir}SRPMS/\" >> ~/.rpmmacros; \\
+ if test \"x$EDITOR\" = "x"; then \\
+ echo \"Error: no editor specified or found.\"; \\
+ echo \"Please edit ~/.rpmmacros manually\"; \\
+ else \\
+ $EDITOR ~/.rpmmacros; \\
+ exit \$\$?; \\
+ fi \\
+ fi
+
+rpmmacros: ~/.rpmmacros
+ @cp -f ~/.rpmmacros rpmmacros;
+
+dist-rpm: rpm
+dist-srpm: srpm
+
+rpm: \$(PACKAGE)-\$(VERSION)-0.i*.$PLATFORM_SUFFIX.rpm
+srpm: \$(PACKAGE)-\$(VERSION)-0.src.rpm
+
+\$(top_builddir)/\$(PACKAGE)-\$(VERSION)-0.i*.$PLATFORM_SUFFIX.rpm: \$(top_builddir)/rpmmacros \$(top_builddir)/\$(PACKAGE)-\$(VERSION).tar.gz
+ @\$(RPM) -tb \$(top_builddir)/\$(PACKAGE)-\$(VERSION).tar.gz
+ @RPMDIR=\`cat \$(top_builddir)/rpmmacros | \$(GAWK) '/%%_rpmdir/ { print \$${AX_DOLLAR}2; }'\`; \\
+ echo \"\$\$RPMDIR\" | \$(EGREP) \"%%{.*}\" > /dev/null 2>&1; \\
+ EXIT=\$\$?; \\
+ while test \"\$\$EXIT\" == \"0\"; do \\
+ RPMDIR=\`echo \"\$\$RPMDIR\" | \$(GAWK) '/%%{.*}/ \\
+ { match( \$${AX_DOLLAR}0, /%%{.*}/, macro ); \\
+ suffix = substr( \$${AX_DOLLAR}0, RSTART + RLENGTH ); \\
+ gsub( /{|}/, \"\", macro[ 0 ] ); \\
+ while( ( getline < \"\$(top_builddir)/rpmmacros\" ) > 0 ) \\
+ { if( \$${AX_DOLLAR}1 == macro[ 0 ] ) { print \$${AX_DOLLAR}2 suffix; exit; } } \\
+ exit 1; \\
+ }'\`; \\
+ if test \"\$${AX_DOLLAR}?\" == \"0\"; then \\
+ echo \"\$\$RPMDIR\" | \$(EGREP) \"%%{.*}\" > /dev/null 2>&1; \\
+ EXIT=\"\$${AX_DOLLAR}?\"; \\
+ else \\
+ EXIT=\"1\"; \\
+ fi; \\
+ done; \\
+ if test -d \"\$\$RPMDIR\"; then \\
+ for dir in \`ls \"\$\$RPMDIR\"\`; do \\
+ ls \"\$\${RPMDIR}\$\${dir}/\$(PACKAGE)-\$(VERSION)-0.\$\${dir}.rpm\" > /dev/null 2>&1; \\
+ if test \"\$${AX_DOLLAR}?\" == \"0\"; then \\
+ cp \"\$\${RPMDIR}\$\${dir}/\$(PACKAGE)-\$(VERSION)-0.\$\${dir}.rpm\" \"\$(top_builddir)/\$(PACKAGE)-\$(VERSION)-0.\$\${dir}.$PLATFORM_SUFFIX.rpm\"; \\
+ found=true; \\
+ fi; \\
+ done; \\
+ if ! \$\$found; then \\
+ echo \"RPM built but not found.\"; \\
+ echo \"Please copy it to \$(top_builddir) manually.\"; \\
+ exit 1; \\
+ fi; \\
+ else \\
+ echo \"RPM built but I cannot find RPM directory.\"; \\
+ echo \"Please copy it to \$(top_builddir) manually.\"; \\
+ exit 1; \\
+ fi;
+
+\$(top_builddir)/\$(PACKAGE)-\$(VERSION).tar.gz: \$(top_builddir)/install_files
+ cd \"\$(top_builddir)\" && \$(MAKE) \$(AM_MAKEFLAGS) dist-gzip
+
+
+
+
+\$(PACKAGE)-\$(VERSION)-0.src.rpm: \$(top_builddir)/rpmmacros \$(top_builddir)/\$(PACKAGE)-\$(VERSION).tar.gz
+ @\$(RPM) -ts \$(top_builddir)/\$(PACKAGE)-\$(VERSION).tar.gz
+ @SRPMDIR=\`cat rpmmacros | \$(GAWK) '/%%_srcrpmdir/ { print ${AX_DOLLAR}${AX_DOLLAR}2; }'\`; \\
+ echo \"${AX_DOLLAR}${AX_DOLLAR}SRPMDIR\" | \$(EGREP) \"%%{.*}\" > /dev/null 2>&1; \\
+ EXIT=${AX_DOLLAR}${AX_DOLLAR}?; \\
+ while test \"${AX_DOLLAR}${AX_DOLLAR}EXIT\" == \"0\"; do \\
+ SRPMDIR=\`echo \"${AX_DOLLAR}${AX_DOLLAR}SRPMDIR\" | \$(GAWK) '/%%{.*}/ \\
+ { match( ${AX_DOLLAR}${AX_DOLLAR}0, /%%{.*}/, macro ); \\
+ suffix = substr( ${AX_DOLLAR}${AX_DOLLAR}0, RSTART + RLENGTH ); \\
+ gsub( /{|}/, \"\", macro[ 0 ] ); \\
+ while( ( getline < \"rpmmacros\" ) > 0 ) \\
+ { if( ${AX_DOLLAR}${AX_DOLLAR}1 == macro[ 0 ] ) { print ${AX_DOLLAR}${AX_DOLLAR}2 suffix; exit; } } \\
+ exit 1; \\
+ }'\`; \\
+ if test \"${AX_DOLLAR}${AX_DOLLAR}?\" == \"0\"; then \\
+ echo \"${AX_DOLLAR}${AX_DOLLAR}SRPMDIR\" | \$(EGREP) \"%%{.*}\" > /dev/null 2>&1; \\
+ EXIT=\"${AX_DOLLAR}${AX_DOLLAR}?\"; \\
+ else \\
+ EXIT=\"1\"; \\
+ fi; \\
+ done; \\
+ if test -d \"${AX_DOLLAR}${AX_DOLLAR}SRPMDIR\"; then \\
+ ls \"${AX_DOLLAR}${AX_DOLLAR}{SRPMDIR}/\$(PACKAGE)-\$(VERSION)-0.src.rpm\" > /dev/null 2>&1; \\
+ if test \"${AX_DOLLAR}${AX_DOLLAR}?\" == \"0\"; then \\
+ cp \"\$${AX_DOLLAR}{SRPMDIR}/\$(PACKAGE)-\$(VERSION)-0.src.rpm\" \"${AX_DOLLAR}(top_builddir)/.\"; \\
+ found=true; \\
+ fi; \\
+ if ! ${AX_DOLLAR}${AX_DOLLAR}found; then \\
+ echo \"SRPM built but not found.\"; \\
+ echo \"Please copy it to ${AX_DOLLAR}(top_builddir) manually.\"; \\
+ exit 1; \\
+ fi; \\
+ else \\
+ echo \"SRPM built but I cannot find SRPM directory.\"; \\
+ echo \"Please copy it to ${AX_DOLLAR}(top_builddir) directory manually.\"; \\
+ exit 1; \\
+ fi;
+
+
+AX_DIST_RPM_EXTRA_BIN_DISTS = rpm
+AX_DIST_RPM_EXTRA_SRC_DISTS = srpm
+
+if ax_dist_rpm_enable_upload
+AX_DIST_RPM_UPLOAD_BIN = upload-rpm
+AX_DIST_RPM_UPLOAD_SRC = upload-srpm
+
+AX_DIST_RPM_UPLOAD_TARGETS = \\
+{rpm=>$PACKAGE-$VERSION-0.i*.$PLATFORM_SUFFIX.rpm} \\
+{srpm=>$PACKAGE-$VERSION-0.src.rpm}
+endif # ax_dist_rpm_enable_upload
+
+endif # ax_dist_rpm_enabled
+
+# These rules are included unconditionally since we cannot conditionally add
+# dependencies.
+clean-local: clean-ax-dist-rpm
+clean-ax-dist-rpm:
+ -test -z \"\$(AX_DIST_RPM_CLEANFILES)\" || rm -f \$(AX_DIST_RPM_CLEANFILES)
+
+dist-hook: dist-hook-ax-dist-rpm
+dist-hook-ax-dist-rpm: \$(AX_DIST_RPM_EXTRA_DIST)
+ -test -z \"\$(AX_DIST_RPM_EXTRA_DIST)\" || cp \$(AX_DIST_RPM_EXTRA_DIST) \$(distdir)
+
+])
+])
diff --git a/m4/ax_dll_string.m4 b/m4/ax_dll_string.m4
new file mode 100644
index 0000000..241cd53
--- /dev/null
+++ b/m4/ax_dll_string.m4
@@ -0,0 +1,87 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_dll_string.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_DLL_STRING
+#
+# DESCRIPTION
+#
+# Tests for a bug currently in g++ 3.4.4 on Cygwin (maybe other targets
+# with statically linked libstdc++?) where passing an empty std::string to
+# a dll will cause a crash on destruction due to incorrect memory
+# handling. See bug 24196 in gcc's bugzilla for more details:
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven Brown <swbrown@variadic.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+dnl Plan: compile conftest-dll.cc, conftest-exe.cc. It has a 'crash' param
+dnl that can be passed. Verify the compile worked and we can run it normally
+dnl ok. Then, pass 'crash', test if it crashed, fail.
+
+AC_DEFUN([AX_DLL_STRING],
+[
+ AC_MSG_CHECKING(if the dll string test can be compiled)
+ cat << EOF > conftest-dll.cc
+[
+#include <string>
+using namespace std;
+
+void testit(std::string (*contentGet)()) {
+ contentGet();
+}
+]
+EOF
+ cat << EOF > conftest-exe.cc
+[
+#include <string>
+#include <cstring>
+using namespace std;
+
+extern void testit(std::string (*contentGet)());
+
+std::string contentGet() {
+ return string(""); // Anything other than empty string works.
+}
+
+int main(int argc, char *argv[]) {
+ if(argc == 2 && strcmp(argv[1], "crash") == 0) {
+ testit(&contentGet);
+ }
+ return 0;
+}
+]
+EOF
+ $CXX -shared $CFLAGS $CPPFLAGS conftest-dll.cc -o conftest-dll.dll >&AS_MESSAGE_LOG_FD && $CXX $CFLAGS $CPPFLAGS conftest-exe.cc conftest-dll.dll -o conftest-exe.exe >& AS_MESSAGE_LOG_FD
+ if test x"$?" = x"0"; then
+ AC_MSG_RESULT(yes)
+
+ dnl Make sure it runs normally first.
+ AC_MSG_CHECKING(if the dll string test is usable)
+ if /bin/sh -c "(LD_LIBRARY_PATH=\"$PWD\" ./conftest-exe.exe)" >& AS_MESSAGE_LOG_FD 2>&1; then
+ AC_MSG_RESULT(yes)
+
+ dnl Now we can check for the bug.
+ AC_MSG_CHECKING(if the dll string test is affected by gcc bug 24196)
+ if ! /bin/sh -c "(LD_LIBRARY_PATH=\"$PWD\" ./conftest-exe.exe crash)" >& AS_MESSAGE_LOG_FD 2>&1; then
+ AC_MSG_RESULT(yes)
+
+ dnl We have the bug, user'll need to fix it.
+ AC_MSG_ERROR([*** This toolchain is affected by gcc bug 24196. For Cygwin as of 4/8/2006, you can downgrade to gcc/g++ 3.3.3 or check if there is a newer compiler available that's fixed.])
+ else
+ AC_MSG_RESULT(no)
+ fi
+ else
+ AC_MSG_RESULT(no)
+ fi
+ else
+ AC_MSG_RESULT(no)
+ fi
+])
diff --git a/m4/ax_enable_builddir.m4 b/m4/ax_enable_builddir.m4
new file mode 100644
index 0000000..7e4d379
--- /dev/null
+++ b/m4/ax_enable_builddir.m4
@@ -0,0 +1,297 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_enable_builddir.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_ENABLE_BUILDDIR [(dirstring-or-command [,Makefile.mk [,-all]])]
+#
+# DESCRIPTION
+#
+# If the current configure was run within the srcdir then we move all
+# configure-files into a subdir and let the configure steps continue
+# there. We provide an option --disable-builddir to suppress the move into
+# a separate builddir.
+#
+# Defaults:
+#
+# $1 = $host (overridden with $HOST)
+# $2 = Makefile.mk
+# $3 = -all
+#
+# This macro must be called before AM_INIT_AUTOMAKE. It creates a default
+# toplevel srcdir Makefile from the information found in the created
+# toplevel builddir Makefile. It just copies the variables and
+# rule-targets, each extended with a default rule-execution that recurses
+# into the build directory of the current "HOST". You can override the
+# auto-dection through `config.guess` and build-time of course, as in
+#
+# make HOST=i386-mingw-cross
+#
+# which can of course set at configure time as well using
+#
+# configure --host=i386-mingw-cross
+#
+# After the default has been created, additional rules can be appended
+# that will not just recurse into the subdirectories and only ever exist
+# in the srcdir toplevel makefile - these parts are read from the $2 =
+# Makefile.mk file
+#
+# The automatic rules are usually scanning the toplevel Makefile for lines
+# like '#### $host |$builddir' to recognize the place where to recurse
+# into. Usually, the last one is the only one used. However, almost all
+# targets have an additional "*-all" rule which makes the script to
+# recurse into _all_ variants of the current HOST (!!) setting. The "-all"
+# suffix can be overriden for the macro as well.
+#
+# a special rule is only given for things like "dist" that will copy the
+# tarball from the builddir to the sourcedir (or $(PUB)) for reason of
+# convenience.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Guido U. Draheim <guidod@gmx.de>
+# Copyright (c) 2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_ENABLE_BUILDDIR],[
+AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
+AC_REQUIRE([AX_CONFIGURE_ARGS])[]dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])[]dnl
+AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl
+AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl
+AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl
+AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl
+SUB="."
+AC_ARG_ENABLE([builddir], AC_HELP_STRING(
+ [--disable-builddir],[disable automatic build in subdir of sources])
+ ,[SUB="$enableval"], [SUB="auto"])
+if test ".$ac_srcdir_defaulted" != ".no" ; then
+if test ".$srcdir" = ".." ; then
+ if test -f config.status ; then
+ AC_MSG_NOTICE(toplevel srcdir already configured... skipping subdir build)
+ else
+ test ".$SUB" = "." && SUB="."
+ test ".$SUB" = ".no" && SUB="."
+ test ".$TARGET" = "." && TARGET="$target"
+ test ".$SUB" = ".auto" && SUB="m4_ifval([$1], [$1],[$TARGET])"
+ if test ".$SUB" != ".." ; then # we know where to go and
+ AS_MKDIR_P([$SUB])
+ echo __.$SUB.__ > $SUB/conftest.tmp
+ cd $SUB
+ if grep __.$SUB.__ conftest.tmp >/dev/null 2>/dev/null ; then
+ rm conftest.tmp
+ AC_MSG_RESULT([continue configure in default builddir "./$SUB"])
+ else
+ AC_MSG_ERROR([could not change to default builddir "./$SUB"])
+ fi
+ srcdir=`echo "$SUB" |
+ sed -e 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g;s,[[/]]$,,;'`
+ # going to restart from subdirectory location
+ test -f $srcdir/config.log && mv $srcdir/config.log .
+ test -f $srcdir/confdefs.h && mv $srcdir/confdefs.h .
+ test -f $srcdir/conftest.log && mv $srcdir/conftest.log .
+ test -f $srcdir/$cache_file && mv $srcdir/$cache_file .
+ AC_MSG_RESULT(....exec $SHELL $srcdir/[$]0 "--srcdir=$srcdir" "--enable-builddir=$SUB" ${1+"[$]@"})
+ case "[$]0" in # restart
+ [/\\]*) eval $SHELL "'[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;;
+ *) eval $SHELL "'$srcdir/[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;;
+ esac ; exit $?
+ fi
+ fi
+fi fi
+test ".$SUB" = ".auto" && SUB="."
+dnl ac_path_prog uses "set dummy" to override $@ which would defeat the "exec"
+AC_PATH_PROG(SED,gsed sed, sed)
+AUX="$am_aux_dir"
+AS_VAR_POPDEF([SED])dnl
+AS_VAR_POPDEF([AUX])dnl
+AS_VAR_POPDEF([SUB])dnl
+AC_CONFIG_COMMANDS([buildir],[dnl .............. config.status ..............
+AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl
+AS_VAR_PUSHDEF([TOP],[top_srcdir])dnl
+AS_VAR_PUSHDEF([SRC],[ac_top_srcdir])dnl
+AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl
+AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl
+pushdef([END],[Makefile.mk])dnl
+pushdef([_ALL],[ifelse([$3],,[-all],[$3])])dnl
+ SRC="$ax_enable_builddir_srcdir"
+ if test ".$SUB" = ".." ; then
+ if test -f "$TOP/Makefile" ; then
+ AC_MSG_NOTICE([skipping TOP/Makefile - left untouched])
+ else
+ AC_MSG_NOTICE([skipping TOP/Makefile - not created])
+ fi
+ else
+ if test -f "$SRC/Makefile" ; then
+ a=`grep "^VERSION " "$SRC/Makefile"` ; b=`grep "^VERSION " Makefile`
+ test "$a" != "$b" && rm "$SRC/Makefile"
+ fi
+ if test -f "$SRC/Makefile" ; then
+ echo "$SRC/Makefile : $SRC/Makefile.in" > $tmp/conftemp.mk
+ echo " []@ echo 'REMOVED,,,' >\$[]@" >> $tmp/conftemp.mk
+ eval "${MAKE-make} -f $tmp/conftemp.mk 2>/dev/null >/dev/null"
+ if grep '^REMOVED,,,' "$SRC/Makefile" >/dev/null
+ then rm $SRC/Makefile ; fi
+ cp $tmp/conftemp.mk $SRC/makefiles.mk~ ## DEBUGGING
+ fi
+ if test ! -f "$SRC/Makefile" ; then
+ AC_MSG_NOTICE([create TOP/Makefile guessed from local Makefile])
+ x='`' ; cat >$tmp/conftemp.sed <<_EOF
+/^\$/n
+x
+/^\$/bS
+x
+/\\\\\$/{H;d;}
+{H;s/.*//;x;}
+bM
+:S
+x
+/\\\\\$/{h;d;}
+{h;s/.*//;x;}
+:M
+s/\\(\\n\\) /\\1 /g
+/^ /d
+/^[[ ]]*[[\\#]]/d
+/^VPATH *=/d
+s/^srcdir *=.*/srcdir = ./
+s/^top_srcdir *=.*/top_srcdir = ./
+/[[:=]]/!d
+/^\\./d
+dnl Now handle rules (i.e. lines containing /:/ but not /:=/).
+/:=/b
+/:/!b
+s/:.*/:/
+s/ / /g
+s/ \\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/ \\1 \\1[]_ALL\\2/g
+s/^\\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/\\1 \\1[]_ALL\\2/
+s/ / /g
+/^all all[]_ALL[[ :]]/i\\
+all-configured : all[]_ALL
+dnl dist-all exists... and would make for dist-all-all
+s/ [[a-zA-Z0-9-]]*[]_ALL [[a-zA-Z0-9-]]*[]_ALL[]_ALL//g
+/[]_ALL[]_ALL/d
+a\\
+ @ HOST="\$(HOST)\" \\\\\\
+ ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
+ ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
+ ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
+ ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" = "0" ; then : \\\\\\
+ ; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi \\\\\\
+ ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
+ ; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x \\\\\\
+ ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
+ ; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) || exit; done
+dnl special rule add-on: "dist" copies the tarball to $(PUB). (source tree)
+/dist[]_ALL *:/a\\
+ @ HOST="\$(HOST)\" \\\\\\
+ ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
+ ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
+ ; found=$x echo \$\$BUILD | wc -w $x \\\\\\
+ ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\
+ ; if test "\$\$found" = "0" ; then : \\\\\\
+ ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\
+ ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
+ ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).tar.* \\\\\\
+ ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done
+dnl special rule add-on: "dist-foo" copies all the archives to $(PUB). (source tree)
+/dist-[[a-zA-Z0-9]]*[]_ALL *:/a\\
+ @ HOST="\$(HOST)\" \\\\\\
+ ; test ".\$\$HOST" = "." && HOST=$x sh ./config.guess $x \\\\\\
+ ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
+ ; found=$x echo \$\$BUILD | wc -w $x \\\\\\
+ ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).*" \\\\\\
+ ; if test "\$\$found" = "0" ; then : \\\\\\
+ ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\
+ ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
+ ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).* \\\\\\
+ ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done
+dnl special rule add-on: "distclean" removes all local builddirs completely
+/distclean[]_ALL *:/a\\
+ @ HOST="\$(HOST)\" \\\\\\
+ ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
+ ; BUILD=$x grep "^#### .*|" Makefile | sed -e 's/.*|//' $x \\\\\\
+ ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
+ ; echo "MAKE \$\$HOST : \$\$n * \$\@ (all local builds)" \\\\\\
+ ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
+ ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
+ ; echo "# rm -r \$\$i"; done ; echo "# (sleep 3)" ; sleep 3 \\\\\\
+ ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
+ ; echo "\$\$i" | grep "^/" > /dev/null && continue \\\\\\
+ ; echo "\$\$i" | grep "^../" > /dev/null && continue \\\\\\
+ ; echo "rm -r \$\$i"; (rm -r "\$\$i") ; done ; rm Makefile
+_EOF
+ cp "$tmp/conftemp.sed" "$SRC/makefile.sed~" ## DEBUGGING
+ $SED -f $tmp/conftemp.sed Makefile >$SRC/Makefile
+ if test -f "$SRC/m4_ifval([$2],[$2],[END])" ; then
+ AC_MSG_NOTICE([extend TOP/Makefile with TOP/m4_ifval([$2],[$2],[END])])
+ cat $SRC/END >>$SRC/Makefile
+ fi ; xxxx="####"
+ echo "$xxxx CONFIGURATIONS FOR TOPLEVEL MAKEFILE: " >>$SRC/Makefile
+ # sanity check
+ if grep '^; echo "MAKE ' $SRC/Makefile >/dev/null ; then
+ AC_MSG_NOTICE([buggy sed found - it deletes tab in "a" text parts])
+ $SED -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $SRC/Makefile \
+ >$SRC/Makefile~
+ (test -s $SRC/Makefile~ && mv $SRC/Makefile~ $SRC/Makefile) 2>/dev/null
+ fi
+ else
+ xxxx="\\#\\#\\#\\#"
+ # echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed
+ echo "s!^$xxxx [[^|]]* | *$SUB *\$!$xxxx ...... $SUB!" >$tmp/conftemp.sed
+ $SED -f "$tmp/conftemp.sed" "$SRC/Makefile" >$tmp/mkfile.tmp
+ cp "$tmp/conftemp.sed" "$SRC/makefiles.sed~" ## DEBUGGING
+ cp "$tmp/mkfile.tmp" "$SRC/makefiles.out~" ## DEBUGGING
+ if cmp -s "$SRC/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then
+ AC_MSG_NOTICE([keeping TOP/Makefile from earlier configure])
+ rm "$tmp/mkfile.tmp"
+ else
+ AC_MSG_NOTICE([reusing TOP/Makefile from earlier configure])
+ mv "$tmp/mkfile.tmp" "$SRC/Makefile"
+ fi
+ fi
+ AC_MSG_NOTICE([build in $SUB (HOST=$ax_enable_builddir_host)])
+ xxxx="####"
+ echo "$xxxx" "$ax_enable_builddir_host" "|$SUB" >>$SRC/Makefile
+ fi
+popdef([END])dnl
+AS_VAR_POPDEF([SED])dnl
+AS_VAR_POPDEF([AUX])dnl
+AS_VAR_POPDEF([SRC])dnl
+AS_VAR_POPDEF([TOP])dnl
+AS_VAR_POPDEF([SUB])dnl
+],[dnl
+ax_enable_builddir_srcdir="$srcdir" # $srcdir
+ax_enable_builddir_host="$HOST" # $HOST / $host
+ax_enable_builddir_version="$VERSION" # $VERSION
+ax_enable_builddir_package="$PACKAGE" # $PACKAGE
+ax_enable_builddir_auxdir="$ax_enable_builddir_auxdir" # $AUX
+ax_enable_builddir_sed="$ax_enable_builddir_sed" # $SED
+ax_enable_builddir="$ax_enable_builddir" # $SUB
+])dnl
+])
diff --git a/m4/ax_expand_prefix.m4 b/m4/ax_expand_prefix.m4
new file mode 100644
index 0000000..ef2ddf8
--- /dev/null
+++ b/m4/ax_expand_prefix.m4
@@ -0,0 +1,64 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_expand_prefix.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_EXPAND_PREFIX
+#
+# DESCRIPTION
+#
+# When $prefix and $exec_prefix are still set to NONE then set them to the
+# usual default values - being based on $ac_default_prefix. - this macro
+# can be AC_REQUIREd by other macros that need to compute values for
+# installation directories. It has been observed that it was done wrong
+# over and over again, so this is a bit more safe to do.
+#
+# remember - setting exec_prefix='${prefix}' needs you interpolate
+# directories multiple times, it is not sufficient to just say
+# MYVAR="${datadir}/putter" but you do have to run `eval` a few times,
+# sth. like MYVAR=`eval "echo \"$MYVAR\""` done atleast two times.
+#
+# The implementation of this macro simply picks up the lines that would be
+# run at the start of AC_OUTPUT anyway to set the prefix/exec_prefix
+# defaults. Between AC_INIT and the first command to AC_REQUIRE this macro
+# you can set the two variables to something explicit instead. Probably,
+# any command to compute installation directories should be run _after_
+# AM_INIT_AUTOMAKE
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_EXPAND_PREFIX],[dnl
+ # The prefix default can be set in configure.ac (otherwise it is /usr/local)
+ test "x$prefix" = xNONE && prefix=$ac_default_prefix
+ # Let make expand exec_prefix. Allows to override the makevar 'prefix' later
+ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+])
diff --git a/m4/ax_ext.m4 b/m4/ax_ext.m4
new file mode 100644
index 0000000..30c86f3
--- /dev/null
+++ b/m4/ax_ext.m4
@@ -0,0 +1,105 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_ext.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_EXT
+#
+# DESCRIPTION
+#
+# Find supported SIMD extensions by requesting cpuid. When an SIMD
+# extension is found, the -m"simdextensionname" is added to SIMD_FLAGS
+# (only if compilator support it) (ie : if "sse2" is available "-msse2" is
+# added to SIMD_FLAGS)
+#
+# This macro calls:
+#
+# AC_SUBST(SIMD_FLAGS)
+#
+# And defines:
+#
+# HAVE_MMX / HAVE_SSE / HAVE_SSE2 / HAVE_SSE3 / HAVE_SSSE3
+#
+# LICENSE
+#
+# Copyright (c) 2008 Christophe Tournayre <turn3r@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_EXT],
+[
+ AC_REQUIRE([AX_GCC_X86_CPUID])
+
+ AX_GCC_X86_CPUID(0x00000001)
+ ecx=`echo $ax_cv_gcc_x86_cpuid_0x00000001 | cut -d ":" -f 3`
+ edx=`echo $ax_cv_gcc_x86_cpuid_0x00000001 | cut -d ":" -f 4`
+
+ AC_CACHE_CHECK([whether mmx is supported], [ax_have_mmx_ext],
+ [
+ ax_have_mmx_ext=no
+ if test "$((0x$edx>>23&0x01))" = 1; then
+ ax_have_mmx_ext=yes
+ fi
+ ])
+
+ AC_CACHE_CHECK([whether sse is supported], [ax_have_sse_ext],
+ [
+ ax_have_sse_ext=no
+ if test "$((0x$edx>>25&0x01))" = 1; then
+ ax_have_sse_ext=yes
+ fi
+ ])
+
+ AC_CACHE_CHECK([whether sse2 is supported], [ax_have_sse2_ext],
+ [
+ ax_have_sse2_ext=no
+ if test "$((0x$edx>>26&0x01))" = 1; then
+ ax_have_sse2_ext=yes
+ fi
+ ])
+
+ AC_CACHE_CHECK([whether sse3 is supported], [ax_have_sse3_ext],
+ [
+ ax_have_sse3_ext=no
+ if test "$((0x$ecx&0x01))" = 1; then
+ ax_have_sse3_ext=yes
+ fi
+ ])
+
+ AC_CACHE_CHECK([whether ssse3 is supported], [ax_have_ssse3_ext],
+ [
+ ax_have_ssse3_ext=no
+ if test "$((0x$ecx>>9&0x01))" = 1; then
+ ax_have_ssse3_ext=yes
+ fi
+ ])
+
+ if test "$ax_have_mmx_ext" = yes; then
+ AC_DEFINE(HAVE_MMX,,[Support mmx instructions])
+ AX_CHECK_COMPILER_FLAGS(-mmmx, SIMD_FLAGS="$SIMD_FLAGS -mmmx", [])
+ fi
+
+ if test "$ax_have_sse_ext" = yes; then
+ AC_DEFINE(HAVE_SSE,,[Support SSE (Streaming SIMD Extensions) instructions])
+ AX_CHECK_COMPILER_FLAGS(-msse, SIMD_FLAGS="$SIMD_FLAGS -msse", [])
+ fi
+
+ if test "$ax_have_sse2_ext" = yes; then
+ AC_DEFINE(HAVE_SSE2,,[Support SSE2 (Streaming SIMD Extensions 2) instructions])
+ AX_CHECK_COMPILER_FLAGS(-msse2, SIMD_FLAGS="$SIMD_FLAGS -msse2", [])
+ fi
+
+ if test "$ax_have_sse3_ext" = yes; then
+ AC_DEFINE(HAVE_SSE3,,[Support SSE3 (Streaming SIMD Extensions 3) instructions])
+ AX_CHECK_COMPILER_FLAGS(-msse3, SIMD_FLAGS="$SIMD_FLAGS -msse3", [])
+ fi
+
+ if test "$ax_have_ssse3_ext" = yes; then
+ AC_DEFINE(HAVE_SSSE3,,[Support SSSE3 (Supplemental Streaming SIMD Extensions 3) instructions])
+ fi
+
+ AC_SUBST(SIMD_FLAGS)
+])
diff --git a/m4/ax_ext_check_header.m4 b/m4/ax_ext_check_header.m4
new file mode 100644
index 0000000..73e4b64
--- /dev/null
+++ b/m4/ax_ext_check_header.m4
@@ -0,0 +1,55 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_ext_check_header.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_EXT_CHECK_HEADER(<header>, <paths>).
+#
+# DESCRIPTION
+#
+# Check for <header> with -I<path> for each path in <paths> if need be.
+# The first sucecssful path is chosen (eg if you say
+# AX_EXT_CHECK_HEADER(foo.h, bar baz qux) and -Ibaz works then -Iqux will
+# not be tested.
+#
+# Any -I flags that locate a header are added to CFLAGS and CPPFLAGS. AS
+# with AC_CHECK_HEADERS it causes HAVE_<header>_H to be defined as 1.
+#
+# Example:
+#
+# AX_EXT_HAVE_HEADER(openssl/rsa.h, /usr/local/include /usr/local/ssl/include /usr/local/openssl/include)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Duncan Simpson <dps@simpson.demon.co.uk>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_EXT_HAVE_HEADER],
+[AC_LANG_PUSH(C)
+ AC_CHECK_HEADER($1, [$3 got="yes"], [$4 got="no"], $5)
+ hdr=`echo $1 | $as_tr_sh`
+ for dir in $2; do
+ if test "x${got}" = "xno"; then
+ ext_hashdr_cvdir=`echo $dir | $as_tr_sh`
+ AC_CACHE_CHECK([for $1 library with -I$dir],
+ [ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}],
+ [ext_have_hdr_save_cflags=${CFLAGS}
+ CFLAGS="${CFLAGS} -I${dir}"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([#inc[]lude <$1>])],
+ [got="yes"; eval "ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}"="yes"],
+ [got="no"; eval "ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}"="no"])
+ CFLAGS=$ext_have_hdr_save_cflags])
+ if eval `echo 'test x${'ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}'}' = "xyes"`; then
+ CFLAGS="${CFLAGS} -I${dir}"
+ CPPFLAGS="${CPPFLAGS} -I${dir}"
+ got="yes";
+ hdr=`echo $1 | $as_tr_cpp`
+ AC_DEFINE_UNQUOTED(HAVE_${hdr}, 1,
+ [Define this if you have the $1 header])
+ fi; fi; done
+AC_LANG_POP])
diff --git a/m4/ax_ext_have_lib.m4 b/m4/ax_ext_have_lib.m4
new file mode 100644
index 0000000..a23a74f
--- /dev/null
+++ b/m4/ax_ext_have_lib.m4
@@ -0,0 +1,69 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_ext_have_lib.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_EXT_HAVE_LIB(<directories>, <library>, <function>, <extra libraries>)
+#
+# DESCRIPTION
+#
+# AX_EXT_HAVE_LIB is identical to AC_SEARCH_LIBS with the exception that
+# will add -L<directory> when looking, and use a different variable for
+# each directory.
+#
+# Any required -L<directory> flags are added to LDFLAGS and located
+# libraies are added to LIBS
+#
+# Some libraries are unlinkable without other extra libraries, which can
+# be specified in the 4th argument. The mysql client library needs -lz,
+# for example.
+#
+# Example:
+#
+# AX_EXT_HAVE_LIB(/lib /usr/lib /usr/local/lib /usr/lib/mysql /usr/local/mysql/lib, mysqlclient, mysql_init, [-lz])
+#
+# which finds the mysql client library if succeds system when it tries
+# with -L/usr/lib/mysql then it adds -lmysqlclient to LIBS and
+# -L/usr/lib/mysql to LDFLAGS.
+#
+# The test itself is based on the autoconf 2.53 version of AC_SEARCH_LIBS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Duncan Simpson <dps@simpson.demon.co.uk>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_EXT_HAVE_LIB],
+[
+new_ldflags=${LDFLAGS}
+new_libs=$LIBS
+AC_CHECK_LIB([$2], $3, new_libs="-l$2"; ext_lib_found="yes", ext_lib_found="no")
+for dir in $1
+do
+if test $ext_lib_found = no
+then
+ext_haslib_cvdir=`echo $dir | $as_tr_sh`
+AC_CACHE_CHECK([for $2 library with -L$dir], [ext_cv${ext_haslib_cvdir}_haslib_$2],
+[ext_func_search_save_LIBS=$LIBS
+ext_func_save_ldflags=${LDFLAGS}
+LIBS="-l$2 $4 ${ext_func_search_save_LIBS}"
+LDFLAGS="-L$dir ${ext_func_save_ldflags}"
+AC_TRY_LINK_FUNC([$3], [eval "ext_cv${ext_haslib_cvdir}_haslib_$2"="yes"],
+[eval "ext_cv${ext_haslib_cvdir}_haslib_$2"="no"])
+LIBS=$ext_func_search_save_LIBS
+LDFLAGS=$ext_func_save_ldflags
+])
+if eval `echo 'test x${'ext_cv${ext_haslib_cvdir}_haslib_$2'}' = "xyes"`; then
+new_libs="-l$2 ${new_libs}"
+new_ldflags="-L${dir} ${new_ldflags}"
+ext_lib_found="yes"
+fi
+fi
+done
+LIBS=$new_libs
+LDFLAGS=$new_ldflags
+])
diff --git a/m4/ax_extra_dist.m4 b/m4/ax_extra_dist.m4
new file mode 100644
index 0000000..549e808
--- /dev/null
+++ b/m4/ax_extra_dist.m4
@@ -0,0 +1,72 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_extra_dist.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_EXTRA_DIST
+#
+# DESCRIPTION
+#
+# Allow support for custom dist targets.
+#
+# To add custom dist targets, you must create a dist-<TYPE> target within
+# your Makefile.am, where <TYPE> is the name of the dist and then add
+# <TYPE> to EXTRA_SRC_DISTS or EXTRA_BIN_DISTS. For example:
+#
+# dist-foobar:
+# <rules for making the foobar dist>
+#
+# EXTRA_BIN_DISTS += foobar
+#
+# You can then build all the src dist targets by running:
+#
+# make dist-src
+#
+# You can build all the binary dist targets by running:
+#
+# make dist-bin
+#
+# and you can build both the src and dist targets by running:
+#
+# make all-dist
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_EXTRA_DIST],
+[
+AC_MSG_NOTICE([adding custom dist support])
+AM_CONDITIONAL(USING_AX_EXTRA_DIST, [true])
+AX_ADD_AM_MACRO_STATIC([
+EXTRA_SRC_DISTS =
+EXTRA_BIN_DISTS =
+dist-src-extra:
+ @echo \"Making custom src targets...\"
+ @cd \$(top_builddir); \\
+ list='\$(EXTRA_SRC_DISTS)'; \\
+ for dist in \$\$list; do \\
+ \$(MAKE) \$(AM_MAKEFLAGS) dist-\$\$dist; \\
+ done
+
+dist-src: dist-all dist-src-extra
+
+
+dist-bin:
+ @echo \"Making custom binary targets...\"
+ @cd \$(top_builddir); \\
+ list='\$(EXTRA_BIN_DISTS)'; \\
+ for dist in \$\$list; do \\
+ \$(MAKE) \$(AM_MAKEFLAGS) dist-\$\$dist; \\
+ done
+
+all-dist dist2 dist-all2: dist-src dist-bin
+
+all-dist-check dist2-check dist-all-check: dist-check dist-src-extra dist-bin
+])
+])# AX_EXTRA_DIST
diff --git a/m4/ax_f90_header.m4 b/m4/ax_f90_header.m4
new file mode 100644
index 0000000..1d28f47
--- /dev/null
+++ b/m4/ax_f90_header.m4
@@ -0,0 +1,36 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_f90_header.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_F90_HEADER(HEADER, HEADER-REGEXP, FUNCTION-BODY [, SEARCH-PATH [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+#
+# DESCRIPTION
+#
+# Set up the compiler flags to use a given fortran 90 header. HEADER is
+# the name of the header. HEADER-REGEXP is a regular expression (used by
+# find) matched by the filename of the header. FUNCTION-BODY is the body
+# of a function (including the 'use' statement and the call to a function
+# defined by the module) SEARCH-PATH is a colon-separated list of
+# directories that will be recursively searched for header files. If
+# empty, the search path will be composed of $prefix, $ac_default_prefix,
+# and all directories exactly one level *above* the directories in
+# $LD_LIBRARY_PATH (the rationale is that when libraries are put in
+# /some/path/lib, the headers are often put in a directory like
+# /some/path/include). An output variable named F90_HEADER_xxx will be set
+# up with the proper flag for substitution in Makefiles (xxx is built from
+# the first argument, with autoconf traditional escapes).
+#
+# LICENSE
+#
+# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_F90_HEADER],[
+ AX_F90_INTERNAL_HEADMOD([$1 fortran 90 header],[$2],-I,
+ [$3],AS_TR_SH(F90_HEADER_$1),[$4],[$5],[$6])
+])
diff --git a/m4/ax_f90_internal_headmod.m4 b/m4/ax_f90_internal_headmod.m4
new file mode 100644
index 0000000..d9b9c54
--- /dev/null
+++ b/m4/ax_f90_internal_headmod.m4
@@ -0,0 +1,68 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_f90_internal_headmod.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_F90_INTERNAL_HEADMOD(MESSAGE, FILE-REGEXP, FLAG, FUNCTION-BODY, OUTPUT-VAR[, SEARCH-PATH [, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]])
+#
+# DESCRIPTION
+#
+# Internal macro used by AX_F90_HEADER and AX_F90_MODULE.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_F90_INTERNAL_HEADMOD],[
+AS_VAR_PUSHDEF([ax_include],[ax_cv_f90_headmod_$2])
+AC_MSG_CHECKING([$1])
+AC_LANG_PUSH(Fortran)
+AS_VAR_SET(ax_include,"not found")
+if test "x$6" = x ; then
+ax_search="$prefix:$ac_default_prefix"
+for ax_base in "" `echo $LD_LIBRARY_PATH | tr ':' '\012'` ; do
+ if test "x$ax_base" != x ; then
+ changequote(,)dnl
+ ax_base=`echo $ax_base | sed 's,/[^/]*$,,'`
+ changequote([,])dnl
+ ax_search="${ax_search}:${ax_base}"
+ fi
+done
+else
+ax_search="$6"
+fi
+for ax_base in `echo $ax_search | tr ':' '\012'` ; do
+ if test "AS_VAR_GET(ax_include)" = "not found" ; then
+ for ax_mod in "" `find $ax_base -follow -name $2 -print` ; do
+ if test "x$ax_mod" != x ; then
+ changequote(,)dnl
+ ax_dir=`echo $ax_mod | sed 's,/[^/]*$,,'`
+ changequote([,])dnl
+ ax_save_FCFLAGS="$FCFLAGS"
+ FCFLAGS="$ax_save_FCFLAGS $3$ax_dir"
+ AC_COMPILE_IFELSE([subroutine conftest_routine
+$4
+ end subroutine conftest_routine
+ ],AS_VAR_SET(ax_include,"$3$ax_dir"),[])
+ FCFLAGS="$ax_save_FCFLAGS"
+ fi
+ done
+ fi
+done
+AC_LANG_POP(Fortran)
+AC_MSG_RESULT([AS_VAR_GET(ax_include)])
+if test "AS_VAR_GET(ax_include)" = "not found"; then
+ $5=""
+ $8
+else
+ $5="AS_VAR_GET(ax_include)"
+ $7
+fi
+AC_SUBST($5)
+AS_VAR_POPDEF([ax_include])
+])
diff --git a/m4/ax_f90_library.m4 b/m4/ax_f90_library.m4
new file mode 100644
index 0000000..3b35a52
--- /dev/null
+++ b/m4/ax_f90_library.m4
@@ -0,0 +1,104 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_f90_library.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_F90_LIBRARY(LIBRARY, LIB-REGEXP, FUNCTION-BODY [, SEARCH-PATH [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+#
+# DESCRIPTION
+#
+# Set up the compiler flags to link a given fortran 90 library LIBRARY is
+# the name of the library. LIB-REGEXP is a regular expression (used by
+# find) matched by the filename of the library, this is useful either if
+# the library filename does not follow the traditional libxxx.a or
+# libxxx.so pattern, or if some specific information is embedded into the
+# name, like compiler used, debugging status ...). FUNCTION-BODY is the
+# body of a function (including the 'use' statements and the call to a
+# function defined by the library) SEARCH-PATH is a colon-separated list
+# of directories that will be used as the base directoris for 'find' to
+# look for the library file. If empty, the search path will be composed of
+# $prefix/lib, $ac_default_prefix/lib, and $LD_LIBRARY_PATH. Two output
+# variables named F90_LDFLAGS_xxx and F90_LIBS_xxx will be set up with the
+# proper flag for substitution in Makefiles (xxx is built from the first
+# argument, with autoconf traditional escapes).
+#
+# LICENSE
+#
+# Copyright (c) 2009 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_F90_LIBRARY],[
+AS_VAR_PUSHDEF([ax_ldflags],[ax_cv_f90_ldflags_$1])
+AS_VAR_PUSHDEF([ax_libs],[ax_cv_f90_libs_$1])
+AC_MSG_CHECKING([$1 fortran 90 library])
+AC_LANG_PUSH(Fortran)
+AS_VAR_SET([ax_ldflags],"")
+AS_VAR_SET([ax_libs],"not found")
+if test "x$4" = x ; then
+ax_search="$prefix:$ac_default_prefix"
+for ax_base in "" `echo $LD_LIBRARY_PATH | tr ':' '\012'` ; do
+ if test "x$ax_base" != x ; then
+ changequote(,)dnl
+ ax_base=`echo $ax_base | sed 's,/[^/]*$,,'`
+ changequote([,])dnl
+ ax_search="${ax_search}:${ax_base}"
+ fi
+done
+else
+ax_search="$4"
+fi
+ax_save_LDFLAGS="$LDFLAGS"
+ax_save_LIBS="$LIBS"
+for ax_base in `echo $ax_search | tr ':' '\012'` ; do
+ if test "AS_VAR_GET(ax_libs)" = "not found" ; then
+ for ax_lib in "" `find $ax_base -follow -name '$2' -print` ; do
+ if test "x$ax_lib" != x ; then
+ changequote(,)dnl
+ ax_dir=`echo $ax_lib | sed 's,/[^/]*$,,'`
+ ax_lib=`echo $ax_lib | sed 's,.*/\([^/]*\)$,\1,'`
+ changequote([,])dnl
+ case "$ax_lib" in
+ lib*)
+ changequote(,)dnl
+ ax_lib="`echo $ax_lib | sed 's,lib\(.*\)\.[^.]*$,\1,'`"
+ changequote([,])dnl
+ AS_VAR_SET([ax_ldflags],"-L $ax_dir")
+ AS_VAR_SET([ax_libs],"-l$ax_lib")
+ ;;
+ *)
+ AS_VAR_SET([ax_ldflags],"")
+ AS_VAR_SET(ax_libs,"$ax_lib")
+ ;;
+ esac
+ LDFLAGS="$ax_save_LDFLAGS AS_VAR_GET(ax_ldflags)"
+ LIBS="AS_VAR_GET(ax_libs) $ax_save_LIBS"
+ AC_LINK_IFELSE([program conftest_program
+$3
+ end program conftest_program
+ ],[],[AS_VAR_SET(ax_ldflags,"")
+ AS_VAR_SET(ax_libs,"not found")
+ ])
+ fi
+ done
+ fi
+done
+AC_LANG_POP(Fortran)
+AC_MSG_RESULT([AS_VAR_GET(ax_ldflags) AS_VAR_GET(ax_libs)])
+if test "AS_VAR_GET(ax_libs)" = "not found"; then
+ AS_TR_SH(F90_LDFLAGS_$1)=""
+ AS_TR_SH(F90_LIBS_$1)=""
+ $5
+else
+ AS_TR_SH(F90_LDFLAGS_$1)=AS_VAR_GET(ax_ldflags)
+ AS_TR_SH(F90_LIBS_$1)=AS_VAR_GET(ax_libs)
+ $6
+fi
+AC_SUBST(AS_TR_SH(F90_LDFLAGS_$1))
+AC_SUBST(AS_TR_SH(F90_LIBS_$1))
+AS_VAR_POPDEF([ax_libs])
+AS_VAR_POPDEF([ax_ldflags])
+])
diff --git a/m4/ax_f90_library_setup.m4 b/m4/ax_f90_library_setup.m4
new file mode 100644
index 0000000..e762da7
--- /dev/null
+++ b/m4/ax_f90_library_setup.m4
@@ -0,0 +1,76 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_f90_library_setup.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_F90_LIBRARY_SETUP(LIBRARY, HEADER-REGEXP, MODULE-REGEXP, LIB-REGEXP, FUNCTION-BODY)
+#
+# DESCRIPTION
+#
+# Convenience macro to set up a fortran 90 library in a simplified way.
+# LIBRARY is the name of the library. HEADER-REGEXP is a regular
+# expression (used by find) matched by the header file to look for (may be
+# empty). MODULE-REGEXP is a regular expression (used by find) matched by
+# the filename of the module (may be empty). LIB-REGEXP is a regular
+# expression (used by find) matched by the filename of the library, this
+# is useful either if the library filename does not follow the traditional
+# libxxx.a or libxxx.so pattern, or if some specific information is
+# embedded into the name, like compiler used, debugging status ...).
+# FUNCTION-BODY is the body of a function (including the 'use' statements
+# and the call to a function defined by the library).
+#
+# This macro is a simple wrapper around AX_F90_MODULE and AX_F90_LIBRARY
+# that uses the parameters provided by the end user through a --with-xxx
+# option to set up the search path. Both a module and a library will be
+# tested, the same path will be used for both tests, so the path must be
+# set up with a common parent directory of both the library file and the
+# module file. The macro also automatically updates the FCFLAGS, LDFLAGS
+# and LIBS variables in addition to providing the F90_HEADER_xxx,
+# F90_MODULE_xxx, F90_LDFLAGS_xxx and F90_LIBS_xxx output variables.
+#
+# Example: suppose you have /home/nostradamus/esoteric/lib/libalchemy.a
+# and /home/nostradamus/esoteric/mod/alchemy.mod which provides a function
+# transmute_into_gold, you can use the following in you configure.ac:
+#
+# AX_F90_MODULE_EXTENSION
+# if test x$ax_cv_f90_modext = xunknown ; then
+# AC_MSG_ERROR([unable to find f90 modules extension])
+# fi
+# AX_F90_LIBRARY_SETUP(alchemy,[],alchemy.$ax_cv_f90_modext,libalchemy*,[
+# use alchemy
+# call transmute_into_gold('lead')
+# ])
+#
+# and the user could configure your package using a command like this:
+#
+# ./configure --with-alchemy=$HOME/esoteric
+#
+# LICENSE
+#
+# Copyright (c) 2009 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_F90_LIBRARY_SETUP],[
+ AC_ARG_WITH([$1],[ --with-$1=path specify search path form $1 module and library],
+ [if test x${withval} = xno ; then
+ AC_MSG_WARN([$1 disabled at user option])
+ fi],[withval=""])
+ if test x$2 != x ; then
+ AX_F90_HEADER([$1],[$2],[$5],$withval,[
+ FCFLAGS="$FCFLAGS $AS_TR_SH(F90_HEADER_$1)"
+ ],[])
+ fi
+ if test x$3 != x ; then
+ AX_F90_MODULE([$1],[$3],[$5],$withval,[
+ FCFLAGS="$FCFLAGS $AS_TR_SH(F90_MODULE_$1)"
+ ],[])
+ fi
+ AX_F90_LIBRARY([$1],[$4],[$5],$withval,[
+ LDFLAGS="$LDFLAGS $AS_TR_SH(F90_LDFLAGS_$1)"
+ LIBS="$AS_TR_SH(F90_LIBS_$1) $LIBS"
+ ],[])
+])
diff --git a/m4/ax_f90_module.m4 b/m4/ax_f90_module.m4
new file mode 100644
index 0000000..d505278
--- /dev/null
+++ b/m4/ax_f90_module.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_f90_module.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_F90_MODULE(MODULE, MODULE-REGEXP, FUNCTION-BODY [, SEARCH-PATH [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+#
+# DESCRIPTION
+#
+# Set up the compiler flags to use a given fortran 90 module MODULE is the
+# name of the module. MODULE-REGEXP is a regular expression (used by find)
+# matched by the filename of the module. FUNCTION-BODY is the body of a
+# function (including the 'use' statement and the call to a function
+# defined by the module) SEARCH-PATH is a colon-separated list of
+# directories that will be recursively searched for modules files. If
+# empty, the search path will be composed of $prefix, $ac_default_prefix,
+# and all directories exactly one level *above* the directories in
+# $LD_LIBRARY_PATH (the rationale is that when libraries are put in
+# /some/path/lib, the modules are often put in a directory like
+# /some/path/include or /some/path/mod or something similar). An output
+# variable named F90_MODULE_xxx will be set up with the proper flag for
+# substitution in Makefiles (xxx is built from the first argument, with
+# autoconf traditional escapes).
+#
+# LICENSE
+#
+# Copyright (c) 2009 Luc Maisonobe <luc@spaceroots.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_F90_MODULE],[
+ AC_REQUIRE([AX_F90_MODULE_FLAG])
+ AX_F90_INTERNAL_HEADMOD([$1 fortran 90 module],[$2],"$ax_cv_f90_modflag",
+ [$3],AS_TR_SH(F90_MODULE_$1),[$4],[$5],[$6])
+])
diff --git a/m4/ax_f90_module_extension.m4 b/m4/ax_f90_module_extension.m4
new file mode 100644
index 0000000..771dfd1
--- /dev/null
+++ b/m4/ax_f90_module_extension.m4
@@ -0,0 +1,56 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_f90_module_extension.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_F90_MODULE_EXTENSION
+#
+# DESCRIPTION
+#
+# Find Fortran 90 modules file extension. The module extension is stored
+# in the cached variable ax_f90_modext, or "unknown" if the extension
+# cannot be found.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Luc Maisonobe <luc@spaceroots.org>
+# Copyright (c) 2009 Alexander Pletzer <pletzer@txcorp.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_F90_MODULE_EXTENSION],[
+AC_CACHE_CHECK([fortran 90 modules extension],
+ax_cv_f90_modext,
+[AC_LANG_PUSH(Fortran)
+i=0
+while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
+ i=`expr $i + 1`
+done
+mkdir tmpdir_$i
+cd tmpdir_$i
+AC_COMPILE_IFELSE([
+!234567
+ module conftest_module
+ contains
+ subroutine conftest_routine
+ write(*,'(a)') 'gotcha!'
+ end subroutine conftest_routine
+ end module conftest_module
+ ],
+ [ax_cv_f90_modext=`ls | sed -n 's,conftest_module\.,,p'`
+ if test x$ax_cv_f90_modext = x ; then
+dnl Some F90 compilers put module filename in uppercase letters
+ ax_cv_f90_modext=`ls | sed -n 's,CONFTEST_MODULE\.,,p'`
+ if test x$ax_cv_f90_modext = x ; then
+ ax_cv_f90_modext=""
+ fi
+ fi
+ ],
+ [ax_cv_f90_modext=""])
+cd ..
+rm -fr tmpdir_$i
+AC_LANG_POP(Fortran)
+])])
diff --git a/m4/ax_f90_module_flag.m4 b/m4/ax_f90_module_flag.m4
new file mode 100644
index 0000000..a56aa97
--- /dev/null
+++ b/m4/ax_f90_module_flag.m4
@@ -0,0 +1,66 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_f90_module_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_F90_MODULE_FLAG
+#
+# DESCRIPTION
+#
+# Find Fortran 90 modules inclusion flag. The module inclusion flag is
+# stored in the cached variable ax_f90_modflag. An error is triggered if
+# the flag cannot be found. Supported are the -I GNU compilers flag, the
+# -M SUN compilers flag, and the -p Absoft Pro Fortran compiler flag.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Luc Maisonobe <luc@spaceroots.org>
+# Copyright (c) 2009 Julian C. Cummings <cummings@cacr.caltech.edu>
+# Copyright (c) 2009 Alexander Pletzer <pletzer@txcorp.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_F90_MODULE_FLAG],[
+AC_CACHE_CHECK([fortran 90 modules inclusion flag],
+ax_cv_f90_modflag,
+[AC_LANG_PUSH(Fortran)
+i=0
+while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
+ i=`expr $i + 1`
+done
+mkdir tmpdir_$i
+cd tmpdir_$i
+AC_COMPILE_IFELSE([
+!234567
+ module conftest_module
+ contains
+ subroutine conftest_routine
+ write(*,'(a)') 'gotcha!'
+ end subroutine conftest_routine
+ end module conftest_module
+ ],[],[])
+cd ..
+ax_cv_f90_modflag="not found"
+for ax_flag in "-I " "-M" "-p"; do
+ if test "$ax_cv_f90_modflag" = "not found" ; then
+ ax_save_FCFLAGS="$FCFLAGS"
+ FCFLAGS="$ax_save_FCFLAGS ${ax_flag}tmpdir_$i"
+ AC_COMPILE_IFELSE([
+!234567
+ program conftest_program
+ use conftest_module
+ call conftest_routine
+ end program conftest_program
+ ],[ax_cv_f90_modflag="$ax_flag"],[])
+ FCFLAGS="$ax_save_FCFLAGS"
+ fi
+done
+rm -fr tmpdir_$i
+if test "$ax_cv_f90_modflag" = "not found" ; then
+ AC_MSG_ERROR([unable to find compiler flag for modules inclusion])
+fi
+AC_LANG_POP(Fortran)
+])])
diff --git a/m4/ax_file_escapes.m4 b/m4/ax_file_escapes.m4
new file mode 100644
index 0000000..461b6d3
--- /dev/null
+++ b/m4/ax_file_escapes.m4
@@ -0,0 +1,27 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_file_escapes.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_FILE_ESCAPES
+#
+# DESCRIPTION
+#
+# Writes the specified data to the specified file.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_FILE_ESCAPES],[
+AX_DOLLAR="\$"
+AX_SRB="\\135"
+AX_SLB="\\133"
+AX_BS="\\\\"
+AX_DQ="\""
+])
diff --git a/m4/ax_func_posix_memalign.m4 b/m4/ax_func_posix_memalign.m4
new file mode 100644
index 0000000..eeca0a7
--- /dev/null
+++ b/m4/ax_func_posix_memalign.m4
@@ -0,0 +1,47 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_func_posix_memalign.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_FUNC_POSIX_MEMALIGN
+#
+# DESCRIPTION
+#
+# Some versions of posix_memalign (notably glibc 2.2.5) incorrectly apply
+# their power-of-two check to the size argument, not the alignment
+# argument. AX_FUNC_POSIX_MEMALIGN defines HAVE_POSIX_MEMALIGN if the
+# power-of-two check is correctly applied to the alignment argument.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Scott Pakin <pakin@uiuc.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_FUNC_POSIX_MEMALIGN],
+[AC_CACHE_CHECK([for working posix_memalign],
+ [ax_cv_func_posix_memalign_works],
+ [AC_TRY_RUN([
+#include <stdlib.h>
+
+int
+main ()
+{
+ void *buffer;
+
+ /* Some versions of glibc incorrectly perform the alignment check on
+ * the size word. */
+ exit (posix_memalign (&buffer, sizeof(void *), 123) != 0);
+}
+ ],
+ [ax_cv_func_posix_memalign_works=yes],
+ [ax_cv_func_posix_memalign_works=no],
+ [ax_cv_func_posix_memalign_works=no])])
+if test "$ax_cv_func_posix_memalign_works" = "yes" ; then
+ AC_DEFINE([HAVE_POSIX_MEMALIGN], [1],
+ [Define to 1 if `posix_memalign' works.])
+fi
+])
diff --git a/m4/ax_func_which_gethostbyname_r.m4 b/m4/ax_func_which_gethostbyname_r.m4
new file mode 100644
index 0000000..48d85b4
--- /dev/null
+++ b/m4/ax_func_which_gethostbyname_r.m4
@@ -0,0 +1,188 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_func_which_gethostbyname_r.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_FUNC_WHICH_GETHOSTBYNAME_R
+#
+# DESCRIPTION
+#
+# Determines which historical variant of the gethostbyname_r() call
+# (taking three, five, or six arguments) is available on the system and
+# defines one of the following macros accordingly:
+#
+# HAVE_FUNC_GETHOSTBYNAME_R_6
+# HAVE_FUNC_GETHOSTBYNAME_R_5
+# HAVE_FUNC_GETHOSTBYNAME_R_3
+#
+# If used in conjunction with gethostname.c, the API demonstrated in
+# test.c can be used regardless of which gethostbyname_r() is available.
+# These example files can be found at
+# http://www.csn.ul.ie/~caolan/publink/gethostbyname_r
+#
+# based on David Arnold's autoconf suggestion in the threads faq
+#
+# Originally named "AC_caolan_FUNC_WHICH_GETHOSTBYNAME_R". Rewritten for
+# Autoconf 2.5x by Daniel Richard G.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Caolan McNamara <caolan@skynet.ie>
+# Copyright (c) 2008 Daniel Richard G. <skunk@iskunk.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_FUNC_WHICH_GETHOSTBYNAME_R], [
+
+ AC_LANG_PUSH(C)
+ AC_MSG_CHECKING([how many arguments gethostbyname_r() takes])
+
+ AC_CACHE_VAL(ac_cv_func_which_gethostbyname_r, [
+
+################################################################
+
+ac_cv_func_which_gethostbyname_r=unknown
+
+#
+# ONE ARGUMENT (sanity check)
+#
+
+# This should fail, as there is no variant of gethostbyname_r() that takes
+# a single argument. If it actually compiles, then we can assume that
+# netdb.h is not declaring the function, and the compiler is thereby
+# assuming an implicit prototype. In which case, we're out of luck.
+#
+AC_COMPILE_IFELSE(
+ AC_LANG_PROGRAM(
+ [[#include <netdb.h>]],
+ [[
+ char *name = "www.gnu.org";
+ (void)gethostbyname_r(name) /* ; */
+ ]]),
+ ac_cv_func_which_gethostbyname_r=no)
+
+#
+# SIX ARGUMENTS
+# (e.g. Linux)
+#
+
+if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
+
+AC_COMPILE_IFELSE(
+ AC_LANG_PROGRAM(
+ [[#include <netdb.h>]],
+ [[
+ char *name = "www.gnu.org";
+ struct hostent ret, *retp;
+ char buf@<:@1024@:>@;
+ int buflen = 1024;
+ int my_h_errno;
+ (void)gethostbyname_r(name, &ret, buf, buflen, &retp, &my_h_errno) /* ; */
+ ]]),
+ ac_cv_func_which_gethostbyname_r=six)
+
+fi
+
+#
+# FIVE ARGUMENTS
+# (e.g. Solaris)
+#
+
+if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
+
+AC_COMPILE_IFELSE(
+ AC_LANG_PROGRAM(
+ [[#include <netdb.h>]],
+ [[
+ char *name = "www.gnu.org";
+ struct hostent ret;
+ char buf@<:@1024@:>@;
+ int buflen = 1024;
+ int my_h_errno;
+ (void)gethostbyname_r(name, &ret, buf, buflen, &my_h_errno) /* ; */
+ ]]),
+ ac_cv_func_which_gethostbyname_r=five)
+
+fi
+
+#
+# THREE ARGUMENTS
+# (e.g. AIX, HP-UX, Tru64)
+#
+
+if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
+
+AC_COMPILE_IFELSE(
+ AC_LANG_PROGRAM(
+ [[#include <netdb.h>]],
+ [[
+ char *name = "www.gnu.org";
+ struct hostent ret;
+ struct hostent_data data;
+ (void)gethostbyname_r(name, &ret, &data) /* ; */
+ ]]),
+ ac_cv_func_which_gethostbyname_r=three)
+
+fi
+
+################################################################
+
+]) dnl end AC_CACHE_VAL
+
+case "$ac_cv_func_which_gethostbyname_r" in
+ three)
+ AC_MSG_RESULT([three])
+ AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_3)
+ ;;
+
+ five)
+ AC_MSG_RESULT([five])
+ AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_5)
+ ;;
+
+ six)
+ AC_MSG_RESULT([six])
+ AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_6)
+ ;;
+
+ no)
+ AC_MSG_RESULT([cannot find function declaration in netdb.h])
+ ;;
+
+ unknown)
+ AC_MSG_RESULT([can't tell])
+ ;;
+
+ *)
+ AC_MSG_ERROR([internal error])
+ ;;
+esac
+
+AC_LANG_POP(C)
+
+]) dnl end AC_DEFUN
diff --git a/m4/ax_gcc_archflag.m4 b/m4/ax_gcc_archflag.m4
new file mode 100644
index 0000000..590015b
--- /dev/null
+++ b/m4/ax_gcc_archflag.m4
@@ -0,0 +1,213 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_gcc_archflag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE])
+#
+# DESCRIPTION
+#
+# This macro tries to guess the "native" arch corresponding to the target
+# architecture for use with gcc's -march=arch or -mtune=arch flags. If
+# found, the cache variable $ax_cv_gcc_archflag is set to this flag and
+# ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is is set to
+# "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is
+# to add $ax_cv_gcc_archflag to the end of $CFLAGS.
+#
+# PORTABLE? should be either [yes] (default) or [no]. In the former case,
+# the flag is set to -mtune (or equivalent) so that the architecture is
+# only used for tuning, but the instruction set used is still portable. In
+# the latter case, the flag is set to -march (or equivalent) so that
+# architecture-specific instructions are enabled.
+#
+# The user can specify --with-gcc-arch=<arch> in order to override the
+# macro's choice of architecture, or --without-gcc-arch to disable this.
+#
+# When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is
+# called unless the user specified --with-gcc-arch manually.
+#
+# Requires macros: AX_CHECK_COMPILER_FLAGS, AX_GCC_X86_CPUID
+#
+# (The main emphasis here is on recent CPUs, on the principle that doing
+# high-performance computing on old hardware is uncommon.)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+# Copyright (c) 2008 Matteo Frigo
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_GCC_ARCHFLAG],
+[AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_CANONICAL_HOST])
+
+AC_ARG_WITH(gcc-arch, [AC_HELP_STRING([--with-gcc-arch=<arch>], [use architecture <arch> for gcc -march/-mtune, instead of guessing])],
+ ax_gcc_arch=$withval, ax_gcc_arch=yes)
+
+AC_MSG_CHECKING([for gcc architecture flag])
+AC_MSG_RESULT([])
+AC_CACHE_VAL(ax_cv_gcc_archflag,
+[
+ax_cv_gcc_archflag="unknown"
+
+if test "$GCC" = yes; then
+
+if test "x$ax_gcc_arch" = xyes; then
+ax_gcc_arch=""
+if test "$cross_compiling" = no; then
+case $host_cpu in
+ i[[3456]]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones
+ AX_GCC_X86_CPUID(0)
+ AX_GCC_X86_CPUID(1)
+ case $ax_cv_gcc_x86_cpuid_0 in
+ *:756e6547:*:*) # Intel
+ case $ax_cv_gcc_x86_cpuid_1 in
+ *5[[48]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;;
+ *5??:*:*:*) ax_gcc_arch=pentium ;;
+ *6[[3456]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
+ *6a?:*[[01]]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
+ *6a?:*[[234]]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
+ *6[[9d]]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;;
+ *6[[78b]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
+ *6??:*:*:*) ax_gcc_arch=pentiumpro ;;
+ *f3[[347]]:*:*:*|*f4[1347]:*:*:*)
+ case $host_cpu in
+ x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;;
+ *) ax_gcc_arch="prescott pentium4 pentiumpro" ;;
+ esac ;;
+ *f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";;
+ esac ;;
+ *:68747541:*:*) # AMD
+ case $ax_cv_gcc_x86_cpuid_1 in
+ *5[[67]]?:*:*:*) ax_gcc_arch=k6 ;;
+ *5[[8d]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;;
+ *5[[9]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;;
+ *60?:*:*:*) ax_gcc_arch=k7 ;;
+ *6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;;
+ *6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;;
+ *67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;;
+ *6[[68a]]?:*:*:*)
+ AX_GCC_X86_CPUID(0x80000006) # L2 cache size
+ case $ax_cv_gcc_x86_cpuid_0x80000006 in
+ *:*:*[[1-9a-f]]??????:*) # (L2 = ecx >> 16) >= 256
+ ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;;
+ *) ax_gcc_arch="athlon-4 athlon k7" ;;
+ esac ;;
+ *f[[4cef8b]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;;
+ *f5?:*:*:*) ax_gcc_arch="opteron k8" ;;
+ *f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;;
+ *f??:*:*:*) ax_gcc_arch="k8" ;;
+ esac ;;
+ *:746e6543:*:*) # IDT
+ case $ax_cv_gcc_x86_cpuid_1 in
+ *54?:*:*:*) ax_gcc_arch=winchip-c6 ;;
+ *58?:*:*:*) ax_gcc_arch=winchip2 ;;
+ *6[[78]]?:*:*:*) ax_gcc_arch=c3 ;;
+ *69?:*:*:*) ax_gcc_arch="c3-2 c3" ;;
+ esac ;;
+ esac
+ if test x"$ax_gcc_arch" = x; then # fallback
+ case $host_cpu in
+ i586*) ax_gcc_arch=pentium ;;
+ i686*) ax_gcc_arch=pentiumpro ;;
+ esac
+ fi
+ ;;
+
+ sparc*)
+ AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/])
+ cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null`
+ cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters`
+ case $cputype in
+ *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;;
+ *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;;
+ *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;;
+ *supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;;
+ *hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;;
+ *cypress*) ax_gcc_arch=cypress ;;
+ esac ;;
+
+ alphaev5) ax_gcc_arch=ev5 ;;
+ alphaev56) ax_gcc_arch=ev56 ;;
+ alphapca56) ax_gcc_arch="pca56 ev56" ;;
+ alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;;
+ alphaev6) ax_gcc_arch=ev6 ;;
+ alphaev67) ax_gcc_arch=ev67 ;;
+ alphaev68) ax_gcc_arch="ev68 ev67" ;;
+ alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;;
+ alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;;
+ alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;;
+
+ powerpc*)
+ cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null`
+ cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'`
+ case $cputype in
+ *750*) ax_gcc_arch="750 G3" ;;
+ *740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;;
+ *74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;;
+ *74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;;
+ *970*) ax_gcc_arch="970 G5 power4";;
+ *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";;
+ *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";;
+ 603ev|8240) ax_gcc_arch="$cputype 603e 603";;
+ *) ax_gcc_arch=$cputype ;;
+ esac
+ ax_gcc_arch="$ax_gcc_arch powerpc"
+ ;;
+esac
+fi # not cross-compiling
+fi # guess arch
+
+if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then
+for arch in $ax_gcc_arch; do
+ if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code
+ flags="-mtune=$arch"
+ # -mcpu=$arch and m$arch generate nonportable code on every arch except
+ # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr.
+ case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac
+ else
+ flags="-march=$arch -mcpu=$arch -m$arch"
+ fi
+ for flag in $flags; do
+ AX_CHECK_COMPILER_FLAGS($flag, [ax_cv_gcc_archflag=$flag; break])
+ done
+ test "x$ax_cv_gcc_archflag" = xunknown || break
+done
+fi
+
+fi # $GCC=yes
+])
+AC_MSG_CHECKING([for gcc architecture flag])
+AC_MSG_RESULT($ax_cv_gcc_archflag)
+if test "x$ax_cv_gcc_archflag" = xunknown; then
+ m4_default([$3],:)
+else
+ m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"])
+fi
+])
diff --git a/m4/ax_gcc_const_call.m4 b/m4/ax_gcc_const_call.m4
new file mode 100644
index 0000000..34ae0b9
--- /dev/null
+++ b/m4/ax_gcc_const_call.m4
@@ -0,0 +1,56 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_gcc_const_call.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_CONST_CALL
+#
+# DESCRIPTION
+#
+# The macro will compile a test program to see whether the compiler does
+# understand the per-function postfix pragma.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_GCC_CONST_CALL],[dnl
+AC_CACHE_CHECK(
+ [whether the compiler supports function __attribute__((__const__))],
+ ax_cv_gcc_const_call,[
+ AC_TRY_COMPILE([__attribute__((__const__))
+ int f(int i) { return i; }],
+ [],
+ ax_cv_gcc_const_call=yes, ax_cv_gcc_const_call=no)])
+ if test "$ax_cv_gcc_const_call" = yes; then
+ AC_DEFINE([GCC_CONST_CALL],[__attribute__((__const__))],
+ [most gcc compilers know a function __attribute__((__const__))])
+ fi
+])
diff --git a/m4/ax_gcc_install_dir.m4 b/m4/ax_gcc_install_dir.m4
new file mode 100644
index 0000000..618dc30
--- /dev/null
+++ b/m4/ax_gcc_install_dir.m4
@@ -0,0 +1,61 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_gcc_install_dir.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_INSTALL_DIR(VARIABLE)
+#
+# DESCRIPTION
+#
+# AX_GCC_INSTALL_DIR(VARIABLE) defines VARIABLE as the gcc install
+# directory. The install directory will be obtained using the gcc
+# -print-search-dirs option. This macro requires AX_GCC_OPTION macro.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_GCC_INSTALL_DIR], [
+ AC_REQUIRE([AC_PROG_CC])
+
+ AS_IF([test "x$GCC" = "xyes"],[
+ AX_GCC_OPTION([-print-search-dirs],[],[],[
+ AC_MSG_CHECKING([gcc install directory])
+ ax_gcc_install_dir=`$CC -print-search-dirs | grep install | sed -e "s,^install:,," -e "s,^\s*,," -e "s,\/$,," `
+ AC_MSG_RESULT([$ax_gcc_install_dir])
+ $1=$ax_gcc_install_dir
+ ],[
+ unset $1
+ ])
+ ],[
+ AC_MSG_RESULT([sorry, no gcc available])
+ unset $1
+ ])
+])
diff --git a/m4/ax_gcc_lib.m4 b/m4/ax_gcc_lib.m4
new file mode 100644
index 0000000..172b50a
--- /dev/null
+++ b/m4/ax_gcc_lib.m4
@@ -0,0 +1,58 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_gcc_lib.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_LIB(LIBRARY,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# AX_GCC_LIB looks for LIBRARY inside gcc install directory, performs
+# ACTION-IF-FOUND if the library is available, ACTION-IF-NOT-FOUND
+# otherwise. The gcc install directory is retrieved using
+# AX_GCC_INSTALL_DIR macro.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_GCC_LIB], [
+ AX_GCC_INSTALL_DIR([GCC_INSTALL_DIR])
+
+ AC_MSG_CHECKING([if gcc $1 is available in $GCC_INSTALL_DIR])
+
+ AS_IF([test -f "$GCC_INSTALL_DIR/$1"],[
+ AC_MSG_RESULT([yes])
+ $2
+ ],[
+ AC_MSG_RESULT([no])
+ $3
+ ])
+])
diff --git a/m4/ax_gcc_libgcc_eh.m4 b/m4/ax_gcc_libgcc_eh.m4
new file mode 100644
index 0000000..3cc7483
--- /dev/null
+++ b/m4/ax_gcc_libgcc_eh.m4
@@ -0,0 +1,51 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_gcc_libgcc_eh.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_LIBGCC_EH(VARIABLE)
+#
+# DESCRIPTION
+#
+# AX_GCC_LIBGCC_EH defines VARIABLE as the absolute path to libgcc_eh.a if
+# it is available on the system, empty otherwise
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_GCC_LIBGCC_EH], [
+ AX_GCC_LIB([libgcc_eh.a],[
+ AX_GCC_INSTALL_DIR([GCC_INSTALL_DIR])
+ $1="$GCC_INSTALL_DIR/libgcc_eh.a"
+ ],[
+ $1=""
+ ])
+])
diff --git a/m4/ax_gcc_libsupcxx.m4 b/m4/ax_gcc_libsupcxx.m4
new file mode 100644
index 0000000..765c5b4
--- /dev/null
+++ b/m4/ax_gcc_libsupcxx.m4
@@ -0,0 +1,51 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_gcc_libsupcxx.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_LIBSUPCXX(VARIABLE)
+#
+# DESCRIPTION
+#
+# AX_GCC_LIBSUPCXX defines VARIABLE as the absolute path to libsupc++.a if
+# it is available on the system, empty otherwise
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_GCC_LIBSUPCXX], [
+ AX_GCC_LIB([libsupc++.a],[
+ AX_GCC_INSTALL_DIR([GCC_INSTALL_DIR])
+ $1="$GCC_INSTALL_DIR/libsupc++.a"
+ ],[
+ $1=""
+ ])
+])
diff --git a/m4/ax_gcc_malloc_call.m4 b/m4/ax_gcc_malloc_call.m4
new file mode 100644
index 0000000..65b5b1d
--- /dev/null
+++ b/m4/ax_gcc_malloc_call.m4
@@ -0,0 +1,56 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_gcc_malloc_call.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_MALLOC_CALL
+#
+# DESCRIPTION
+#
+# The macro will compile a test program to see whether the compiler does
+# understand the per-function postfix pragma.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_GCC_MALLOC_CALL],[dnl
+AC_CACHE_CHECK(
+ [whether the compiler supports function __attribute__((__malloc__))],
+ ax_cv_gcc_malloc_call,[
+ AC_TRY_COMPILE([__attribute__((__malloc__))
+ int f(int i) { return i; }],
+ [],
+ ax_cv_gcc_malloc_call=yes, ax_cv_gcc_malloc_call=no)])
+ if test "$ax_cv_gcc_malloc_call" = yes; then
+ AC_DEFINE([GCC_MALLOC_CALL],[__attribute__((__malloc__))],
+ [most gcc compilers know a function __attribute__((__malloc__))])
+ fi
+])
diff --git a/m4/ax_gcc_option.m4 b/m4/ax_gcc_option.m4
new file mode 100644
index 0000000..46a924a
--- /dev/null
+++ b/m4/ax_gcc_option.m4
@@ -0,0 +1,126 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_gcc_option.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_OPTION(OPTION,EXTRA-OPTIONS,TEST-PROGRAM,ACTION-IF-SUCCESSFUL,ACTION-IF-NOT-SUCCESFUL)
+#
+# DESCRIPTION
+#
+# AX_GCC_OPTION checks wheter gcc accepts the passed OPTION. If it accepts
+# the OPTION then ACTION-IF-SUCCESSFUL will be executed, otherwise
+# ACTION-IF-UNSUCCESSFUL.
+#
+# NOTE: This macro will be obsoleted by AX_C_CHECK_FLAG AX_CXX_CHECK_FLAG,
+# AX_CPP_CHECK_FLAG, AX_CXXCPP_CHECK_FLAG and AX_LD_CHECK_FLAG.
+#
+# A typical usage should be the following one:
+#
+# AX_GCC_OPTION([-fomit-frame-pointer],[],[],[
+# AC_MSG_NOTICE([The option is supported])],[
+# AC_MSG_NOTICE([No luck this time])
+# ])
+#
+# The macro doesn't discriminate between languages so, if you are testing
+# for an option that works for C++ but not for C you should use '-x c++'
+# as EXTRA-OPTIONS:
+#
+# AX_GCC_OPTION([-fno-rtti],[-x c++],[],[ ... ],[ ... ])
+#
+# OPTION is tested against the following code:
+#
+# int main()
+# {
+# return 0;
+# }
+#
+# The optional TEST-PROGRAM comes handy when the default main() is not
+# suited for the option being checked
+#
+# So, if you need to test for -fstrict-prototypes option you should
+# probably use the macro as follows:
+#
+# AX_GCC_OPTION([-fstrict-prototypes],[-x c++],[
+# int main(int argc, char ** argv)
+# {
+# (void) argc;
+# (void) argv;
+#
+# return 0;
+# }
+# ],[ ... ],[ ... ])
+#
+# Note that the macro compiles but doesn't link the test program so it is
+# not suited for checking options that are passed to the linker, like:
+#
+# -Wl,-L<a-library-path>
+#
+# In order to avoid such kind of problems you should think about usinguse
+# the AX_*_CHECK_FLAG family macros
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+# Copyright (c) 2008 Bogdan Drozdowski <bogdandr@op.pl>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_GCC_OPTION], [
+ AC_REQUIRE([AC_PROG_CC])
+
+ AC_MSG_CHECKING([if gcc accepts $1 option])
+
+ AS_IF([ test "x$GCC" = "xyes" ],[
+ AS_IF([ test -z "$3" ],[
+ ax_gcc_option_test="int main()
+{
+ return 0;
+}"
+ ],[
+ ax_gcc_option_test="$3"
+ ])
+
+ # Dump the test program to file
+ cat <<EOF > conftest.c
+$ax_gcc_option_test
+EOF
+
+ # Dump back the file to the log, useful for debugging purposes
+ AC_TRY_COMMAND(cat conftest.c 1>&AS_MESSAGE_LOG_FD)
+
+ AS_IF([ AC_TRY_COMMAND($CC $2 $1 -c conftest.c 1>&AS_MESSAGE_LOG_FD) ],[
+ AC_MSG_RESULT([yes])
+ $4
+ ],[
+ AC_MSG_RESULT([no])
+ $5
+ ])
+ ],[
+ AC_MSG_RESULT([no gcc available])
+ ])
+])
diff --git a/m4/ax_gcc_version.m4 b/m4/ax_gcc_version.m4
new file mode 100644
index 0000000..f2eb598
--- /dev/null
+++ b/m4/ax_gcc_version.m4
@@ -0,0 +1,63 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_gcc_version.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_VERSION
+#
+# DESCRIPTION
+#
+# This macro retrieves the gcc version and returns it in the GCC_VERSION
+# variable if available, an empty string otherwise.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_GCC_VERSION], [
+ GCC_VERSION=""
+ AX_GCC_OPTION([-dumpversion],[],[],[
+ ax_gcc_version_option=yes
+ ],[
+ ax_gcc_version_option=no
+ ])
+ AS_IF([test "x$GCC" = "xyes"],[
+ AS_IF([test "x$ax_gcc_version_option" != "xno"],[
+ AC_CACHE_CHECK([gcc version],[ax_cv_gcc_version],[
+ ax_cv_gcc_version="`$CC -dumpversion`"
+ AS_IF([test "x$ax_cv_gcc_version" = "x"],[
+ ax_cv_gcc_version=""
+ ])
+ ])
+ GCC_VERSION=$ax_cv_gcc_version
+ ])
+ ])
+ AC_SUBST([GCC_VERSION])
+])
diff --git a/m4/ax_gcc_warn_unused_result.m4 b/m4/ax_gcc_warn_unused_result.m4
new file mode 100644
index 0000000..3cbdc83
--- /dev/null
+++ b/m4/ax_gcc_warn_unused_result.m4
@@ -0,0 +1,56 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_gcc_warn_unused_result.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_WARN_UNUSED_RESULT
+#
+# DESCRIPTION
+#
+# The macro will compile a test program to see whether the compiler does
+# understand the per-function postfix pragma.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_GCC_WARN_UNUSED_RESULT],[dnl
+AC_CACHE_CHECK(
+ [whether the compiler supports function __attribute__((__warn_unused_result__))],
+ ax_cv_gcc_warn_unused_result,[
+ AC_TRY_COMPILE([__attribute__((__warn_unused_result__))
+ int f(int i) { return i; }],
+ [],
+ ax_cv_gcc_warn_unused_result=yes, ax_cv_gcc_warn_unused_result=no)])
+ if test "$ax_cv_gcc_warn_unused_result" = yes; then
+ AC_DEFINE([GCC_WARN_UNUSED_RESULT],[__attribute__((__warn_unused_result__))],
+ [most gcc compilers know a function __attribute__((__warn_unused_result__))])
+ fi
+])
diff --git a/m4/ax_gcc_x86_cpuid.m4 b/m4/ax_gcc_x86_cpuid.m4
new file mode 100644
index 0000000..321dce7
--- /dev/null
+++ b/m4/ax_gcc_x86_cpuid.m4
@@ -0,0 +1,77 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_gcc_x86_cpuid.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_X86_CPUID(OP)
+#
+# DESCRIPTION
+#
+# On Pentium and later x86 processors, with gcc or a compiler that has a
+# compatible syntax for inline assembly instructions, run a small program
+# that executes the cpuid instruction with input OP. This can be used to
+# detect the CPU type.
+#
+# On output, the values of the eax, ebx, ecx, and edx registers are stored
+# as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable
+# ax_cv_gcc_x86_cpuid_OP.
+#
+# If the cpuid instruction fails (because you are running a
+# cross-compiler, or because you are not using gcc, or because you are on
+# a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP
+# is set to the string "unknown".
+#
+# This macro mainly exists to be used in AX_GCC_ARCHFLAG.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+# Copyright (c) 2008 Matteo Frigo
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_GCC_X86_CPUID],
+[AC_REQUIRE([AC_PROG_CC])
+AC_LANG_PUSH([C])
+AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1,
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [
+ int op = $1, eax, ebx, ecx, edx;
+ FILE *f;
+ __asm__("cpuid"
+ : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
+ : "a" (op));
+ f = fopen("conftest_cpuid", "w"); if (!f) return 1;
+ fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
+ fclose(f);
+ return 0;
+])],
+ [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid],
+ [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid],
+ [ax_cv_gcc_x86_cpuid_$1=unknown])])
+AC_LANG_POP([C])
+])
diff --git a/m4/ax_gxx_version.m4 b/m4/ax_gxx_version.m4
new file mode 100644
index 0000000..fd1608f
--- /dev/null
+++ b/m4/ax_gxx_version.m4
@@ -0,0 +1,63 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_gxx_version.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GXX_VERSION
+#
+# DESCRIPTION
+#
+# This macro retrieves the g++ version and returns it in the GXX_VERSION
+# variable if available, an empty string otherwise.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_GXX_VERSION], [
+ GXX_VERSION=""
+ AX_GCC_OPTION([-dumpversion],[],[],[
+ ax_gcc_version_option=yes
+ ],[
+ ax_gcc_version_option=no
+ ])
+ AS_IF([test "x$GXX" = "xyes"],[
+ AS_IF([test "x$ax_gxx_version_option" != "no"],[
+ AC_CACHE_CHECK([gxx version],[ax_cv_gxx_version],[
+ ax_cv_gxx_version="`$CXX -dumpversion`"
+ AS_IF([test "x$ax_cv_gxx_version" = "x"],[
+ ax_cv_gxx_version=""
+ ])
+ ])
+ GXX_VERSION=$ax_cv_gxx_version
+ ])
+ ])
+ AC_SUBST([GXX_VERSION])
+])
diff --git a/m4/ax_have_adns.m4 b/m4/ax_have_adns.m4
new file mode 100644
index 0000000..54fea80
--- /dev/null
+++ b/m4/ax_have_adns.m4
@@ -0,0 +1,35 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_have_adns.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_HAVE_ADNS([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# Check whether the GNU ADNS library available from
+# http://www.chiark.greenend.org.uk/~ian/adns/ is installed on this
+# system. The test is known to work with version 1.4 (or later). If the
+# library is found, the flags necessary to link it are added to $LIBS.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Peter Simons <simons@cryp.to>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_HAVE_ADNS], [dnl
+ AC_CHECK_HEADER([adns.h], [dnl
+ AC_SEARCH_LIBS([adns_init], [adns], [dnl
+ AC_CACHE_CHECK([for GNU ADNS], [ax_cv_have_adns], [dnl
+ AC_LINK_IFELSE([dnl
+ AC_LANG_PROGRAM(
+ [#include <adns.h>],
+ [int rc; rc = adns_init((adns_state *)(0), adns_if_none, (FILE *)(0));])],
+ [ax_cv_have_adns=yes],
+ [ax_cv_have_adns=no])])])])
+ AS_IF([test "${ax_cv_have_adns}" = "yes"], [$1], [$2])
+])dnl
diff --git a/m4/ax_have_epoll.m4 b/m4/ax_have_epoll.m4
new file mode 100644
index 0000000..64778ab
--- /dev/null
+++ b/m4/ax_have_epoll.m4
@@ -0,0 +1,101 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_have_epoll.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_HAVE_EPOLL([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# AX_HAVE_EPOLL_PWAIT([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro determines whether the system supports the epoll I/O event
+# interface. A neat usage example would be:
+#
+# AX_HAVE_EPOLL(
+# [AX_CONFIG_FEATURE_ENABLE(epoll)],
+# [AX_CONFIG_FEATURE_DISABLE(epoll)])
+# AX_CONFIG_FEATURE(
+# [epoll], [This platform supports epoll(7)],
+# [HAVE_EPOLL], [This platform supports epoll(7).])
+#
+# The epoll interface was added to the Linux kernel in version 2.5.45, and
+# the macro verifies that a kernel newer than this is installed. This
+# check is somewhat unreliable if <linux/version.h> doesn't match the
+# running kernel, but it is necessary regardless, because glibc comes with
+# stubs for the epoll_create(), epolL_wait(), etc. that allow programs to
+# compile and link even if the kernel is too old; the problem would then
+# be detected only at runtime.
+#
+# Linux kernel version 2.6.19 adds the epoll_pwait() call in addition to
+# epoll_wait(). The availability of that function can be tested with the
+# second macro. Generally speaking, it is safe to assume that
+# AX_HAVE_EPOLL would succeed if AX_HAVE_EPOLL_PWAIT has, but not the
+# other way round.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Peter Simons <simons@cryp.to>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_HAVE_EPOLL], [dnl
+ ax_have_epoll_cppflags="${CPPFLAGS}"
+ AC_CHECK_HEADER([linux/version.h], [CPPFLAGS="${CPPFLAGS} -DHAVE_LINUX_VERSION_H"])
+ AC_MSG_CHECKING([for Linux epoll(7) interface])
+ AC_CACHE_VAL([ax_cv_have_epoll], [dnl
+ AC_LINK_IFELSE([dnl
+ AC_LANG_PROGRAM([dnl
+#include <sys/epoll.h>
+#ifdef HAVE_LINUX_VERSION_H
+# include <linux/version.h>
+# if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,45)
+# error linux kernel version is too old to have epoll
+# endif
+#endif
+], [dnl
+int fd, rc;
+struct epoll_event ev;
+fd = epoll_create(128);
+rc = epoll_wait(fd, &ev, 1, 0);])],
+ [ax_cv_have_epoll=yes],
+ [ax_cv_have_epoll=no])])
+ CPPFLAGS="${ax_have_epoll_cppflags}"
+ AS_IF([test "${ax_cv_have_epoll}" = "yes"],
+ [AC_MSG_RESULT([yes])
+$1],[AC_MSG_RESULT([no])
+$2])
+])dnl
+
+AC_DEFUN([AX_HAVE_EPOLL_PWAIT], [dnl
+ ax_have_epoll_cppflags="${CPPFLAGS}"
+ AC_CHECK_HEADER([linux/version.h],
+ [CPPFLAGS="${CPPFLAGS} -DHAVE_LINUX_VERSION_H"])
+ AC_MSG_CHECKING([for Linux epoll(7) interface with signals extension])
+ AC_CACHE_VAL([ax_cv_have_epoll_pwait], [dnl
+ AC_LINK_IFELSE([dnl
+ AC_LANG_PROGRAM([dnl
+#ifdef HAVE_LINUX_VERSION_H
+# include <linux/version.h>
+# if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+# error linux kernel version is too old to have epoll_pwait
+# endif
+#endif
+#include <sys/epoll.h>
+#include <signal.h>
+], [dnl
+int fd, rc;
+struct epoll_event ev;
+fd = epoll_create(128);
+rc = epoll_wait(fd, &ev, 1, 0);
+rc = epoll_pwait(fd, &ev, 1, 0, (sigset_t const *)(0));])],
+ [ax_cv_have_epoll_pwait=yes],
+ [ax_cv_have_epoll_pwait=no])])
+ CPPFLAGS="${ax_have_epoll_cppflags}"
+ AS_IF([test "${ax_cv_have_epoll_pwait}" = "yes"],
+ [AC_MSG_RESULT([yes])
+$1],[AC_MSG_RESULT([no])
+$2])
+])dnl
diff --git a/m4/ax_have_poll.m4 b/m4/ax_have_poll.m4
new file mode 100644
index 0000000..33b02b4
--- /dev/null
+++ b/m4/ax_have_poll.m4
@@ -0,0 +1,69 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_have_poll.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_HAVE_POLL([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# AX_HAVE_PPOLL([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro determines whether the system supports the poll I/O event
+# interface. A neat usage example would be:
+#
+# AX_HAVE_POLL(
+# [AX_CONFIG_FEATURE_ENABLE(poll)],
+# [AX_CONFIG_FEATURE_DISABLE(poll)])
+# AX_CONFIG_FEATURE(
+# [poll], [This platform supports poll(7)],
+# [HAVE_POLL], [This platform supports poll(7).])
+#
+# Some systems -- most notably Linux kernel 2.6.16 and later -- also have
+# the variant ppoll(). The availability of that function can be tested
+# with the second macro. Generally speaking, it is safe to assume that
+# AX_HAVE_POLL would succeed if AX_HAVE_PPOLL has, but not the other way
+# round.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Peter Simons <simons@cryp.to>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_HAVE_POLL], [dnl
+ AC_MSG_CHECKING([for poll(2)])
+ AC_CACHE_VAL([ax_cv_have_poll], [dnl
+ AC_LINK_IFELSE([dnl
+ AC_LANG_PROGRAM(
+ [#include <poll.h>],
+ [int rc; rc = poll((struct pollfd *)(0), 0, 0);])],
+ [ax_cv_have_poll=yes],
+ [ax_cv_have_poll=no])])
+ AS_IF([test "${ax_cv_have_poll}" = "yes"],
+ [AC_MSG_RESULT([yes])
+$1],[AC_MSG_RESULT([no])
+$2])
+])dnl
+
+AC_DEFUN([AX_HAVE_PPOLL], [dnl
+ AC_MSG_CHECKING([for ppoll(2)])
+ AC_CACHE_VAL([ax_cv_have_ppoll], [dnl
+ AC_LINK_IFELSE([dnl
+ AC_LANG_PROGRAM(
+ [dnl
+#include <poll.h>
+#include <signal.h>],
+ [dnl
+int rc;
+rc = poll((struct pollfd *)(0), 0, 0);
+rc = ppoll((struct pollfd *)(0), 0, (struct timespec const *)(0), (sigset_t const *)(0));])],
+ [ax_cv_have_ppoll=yes],
+ [ax_cv_have_ppoll=no])])
+ AS_IF([test "${ax_cv_have_ppoll}" = "yes"],
+ [AC_MSG_RESULT([yes])
+$1],[AC_MSG_RESULT([no])
+$2])
+])
diff --git a/m4/ax_have_select.m4 b/m4/ax_have_select.m4
new file mode 100644
index 0000000..2361364
--- /dev/null
+++ b/m4/ax_have_select.m4
@@ -0,0 +1,68 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_have_select.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_HAVE_SELECT([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# AX_HAVE_PSELECT([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro determines whether the system supports the select I/O event
+# interface. A neat usage example would be:
+#
+# AX_HAVE_SELECT(
+# [AX_CONFIG_FEATURE_ENABLE(select)],
+# [AX_CONFIG_FEATURE_DISABLE(select)])
+# AX_CONFIG_FEATURE(
+# [select], [This platform supports select(7)],
+# [HAVE_SELECT], [This platform supports select(7).])
+#
+# Some systems also have the variant pselect(). The availability of that
+# function can be tested with the second macro. Generally speaking, it is
+# safe to assume that AX_HAVE_SELECT would succeed if AX_HAVE_SELECT_PWAIT
+# has, but not the other way round.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Peter Simons <simons@cryp.to>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_HAVE_SELECT], [dnl
+ AC_MSG_CHECKING([for select(2)])
+ AC_CACHE_VAL([ax_cv_have_select], [dnl
+ AC_LINK_IFELSE([dnl
+ AC_LANG_PROGRAM(
+ [#include <sys/select.h>],
+ [int rc; rc = select(0, (fd_set *)(0), (fd_set *)(0), (fd_set *)(0), (struct timeval *)(0));])],
+ [ax_cv_have_select=yes],
+ [ax_cv_have_select=no])])
+ AS_IF([test "${ax_cv_have_select}" = "yes"],
+ [AC_MSG_RESULT([yes])
+$1],[AC_MSG_RESULT([no])
+$2])
+])dnl
+
+AC_DEFUN([AX_HAVE_PSELECT], [dnl
+ AC_MSG_CHECKING([for pselect(2)])
+ AC_CACHE_VAL([ax_cv_have_pselect], [dnl
+ AC_LINK_IFELSE([dnl
+ AC_LANG_PROGRAM(
+ [dnl
+#include <sys/select.h>
+#include <signal.h>],
+ [dnl
+int rc;
+rc = select(0, (fd_set *)(0), (fd_set *)(0), (fd_set *)(0), (struct timeval *)(0));
+rc = pselect(0, (fd_set *)(0), (fd_set *)(0), (fd_set *)(0), (struct timespec const *)(0), (sigset_t const *)(0));])],
+ [ax_cv_have_pselect=yes],
+ [ax_cv_have_pselect=no])])
+ AS_IF([test "${ax_cv_have_pselect}" = "yes"],
+ [AC_MSG_RESULT([yes])
+$1],[AC_MSG_RESULT([no])
+$2])
+])dnl
diff --git a/m4/ax_install_files.m4 b/m4/ax_install_files.m4
new file mode 100644
index 0000000..58cd80a
--- /dev/null
+++ b/m4/ax_install_files.m4
@@ -0,0 +1,86 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_install_files.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_INSTALL_FILES
+#
+# DESCRIPTION
+#
+# Adds target for creating a install_files file, which contains the list
+# of files that will be installed.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_INSTALL_FILES],
+[
+AC_MSG_NOTICE([adding install_files support])
+AC_ARG_VAR(GAWK, [gawk executable to use])
+if test "x$GAWK" = "x"; then
+ AC_CHECK_PROGS(GAWK,[gawk])
+fi
+AC_SUBST(GAWK)
+
+if test "x$GAWK" != "x"; then
+ AC_MSG_NOTICE([install_files support enabled])
+ AX_HAVE_INSTALL_FILES=true
+else
+ AX_HAVE_INSTALL_FILES=false;
+ AC_MSG_WARN([install_files support disable... gawk not found])
+fi
+AM_CONDITIONAL([ax_install_files_enabled],
+ [test "x$AX_HAVE_INSTALL_FILES" = "xtrue"])
+
+AX_ADD_AM_MACRO_STATIC([
+
+if ax_install_files_enabled
+AX_INSTALL_FILES_CLEANFILES = \\
+\$(top_builddir)/install_files
+
+\$(top_builddir)/install_files: do-mfstamp-recursive
+ @if test \"\$(top_builddir)/mfstamp\" -nt \"\$(top_builddir)/install_files\"; then \\
+ cd \$(top_builddir) && STAGING=\"\$(PWD)/staging\"; \\
+ \$(MAKE) \$(AM_MAKEFLAGS) DESTDIR=\"\$\$STAGING\" install; \\
+ cd \"\$\$STAGING\" && find "." ! -type d -print | \\
+ \$(GAWK) ' \\
+ /^\\.\\/usr\\/local\\/lib/ { \\
+ sub( /\\.\\/usr\\/local\\/lib/, \"%%{_libdir}\" ); } \\
+ /^\\.\\/usr\\/local\\/bin/ { \\
+ sub( /\\.\\/usr\\/local\\/bin/, \"%%{_bindir}\" ); } \\
+ /^\\.\\/usr\\/local\\/include/ { \\
+ sub( /\\.\\/usr\\/local\\/include/, \"%%{_includedir}\" ); } \\
+ /^\\.\\/usr\\/local\\/share/ { \\
+ sub( /\\.\\/usr\\/local\\/share/, \"%%{_datadir}\" ); } \\
+ /^\\.\\/usr\\/local/ { \\
+ sub( /\\.\\/usr\\/local/, \"%%{_prefix}\" ); } \\
+ /^\\./ { sub( /\\./, \"\" ); } \\
+ /./ { print; }' > ../install_files; \\
+ rm -rf \"\$\$STAGING\"; \\
+ else \\
+ echo \"\\\`\$(top_builddir)/install_files\' is up to date.\"; \\
+ fi
+
+])
+AX_ADD_RECURSIVE_AM_MACRO_STATIC([do-mfstamp],[
+\$(top_builddir)/mfstamp: do-mfstamp-recursive
+
+do-mfstamp-am do-mfstamp: Makefile.in
+ @echo \"timestamp for all Makefile.in files\" > \$(top_builddir)/mfstamp
+ @touch ${AX_DOLLAR}@
+
+])
+AX_ADD_AM_MACRO_STATIC([
+endif # ax_install_files_enabled
+
+clean-local: clean-ax-install-files
+clean-ax-install-files:
+ -test -z \"\$(AX_INSTALL_FILES)\" || rm -f \$(AX_INSTALL_FILES)
+])
+])# AX_INSTALL_FILES
diff --git a/m4/ax_lang_compiler_ms.m4 b/m4/ax_lang_compiler_ms.m4
new file mode 100644
index 0000000..8560ddf
--- /dev/null
+++ b/m4/ax_lang_compiler_ms.m4
@@ -0,0 +1,34 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lang_compiler_ms.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LANG_COMPILER_MS
+#
+# DESCRIPTION
+#
+# Check whether the compiler for the current language is Microsoft.
+#
+# This macro is modeled after _AC_LANG_COMPILER_GNU in the GNU Autoconf
+# implementation.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_LANG_COMPILER_MS],
+[AC_CACHE_CHECK([whether we are using the Microsoft _AC_LANG compiler],
+ [ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef _MSC_VER
+ choke me
+#endif
+]])],
+ [ax_compiler_ms=yes],
+ [ax_compiler_ms=no])
+ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms=$ax_compiler_ms
+])])
diff --git a/m4/ax_ld_check_flag.m4 b/m4/ax_ld_check_flag.m4
new file mode 100644
index 0000000..36a88ed
--- /dev/null
+++ b/m4/ax_ld_check_flag.m4
@@ -0,0 +1,92 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_ld_check_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LD_CHECK_FLAG(FLAG-TO-CHECK,[PROLOGUE],[BODY],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# This macro tests if the C++ compiler supports the flag FLAG-TO-CHECK. If
+# successfull execute ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+# PROLOGUE and BODY are optional and should be used as in AC_LANG_PROGRAM
+# macro.
+#
+# Example:
+#
+# AX_LD_CHECK_FLAG([-Wl,-L/usr/lib],[],[],[
+# ...
+# ],[
+# ...
+# ])
+#
+# This code is inspired from KDE_CHECK_COMPILER_FLAG macro. Thanks to
+# Bogdan Drozdowski <bogdandr@op.pl> for testing and bug fixes.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_LD_CHECK_FLAG],[
+ AC_PREREQ([2.61])
+ AC_REQUIRE([AC_PROG_CXX])
+ AC_REQUIRE([AC_PROG_SED])
+
+ flag=`echo "$1" | $SED 'y% .=/+-(){}<>:*,%_______________%'`
+
+ AC_CACHE_CHECK([whether the linker accepts the $1 flag],
+ [ax_cv_ld_check_flag_$flag],[
+
+ #AC_LANG_PUSH([C])
+
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $1"
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([$2],[$3])
+ ],[
+ eval "ax_cv_ld_check_flag_$flag=yes"
+ ],[
+ eval "ax_cv_ld_check_flag_$flag=no"
+ ])
+
+ LDFLAGS="$save_LDFLAGS"
+
+ #AC_LANG_POP
+
+ ])
+
+ AS_IF([eval "test \"`echo '$ax_cv_ld_check_flag_'$flag`\" = yes"],[
+ :
+ $4
+ ],[
+ :
+ $5
+ ])
+])
diff --git a/m4/ax_lib_beecrypt.m4 b/m4/ax_lib_beecrypt.m4
new file mode 100644
index 0000000..d72892a
--- /dev/null
+++ b/m4/ax_lib_beecrypt.m4
@@ -0,0 +1,72 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lib_beecrypt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_BEECRYPT([yes|no|auto])
+#
+# DESCRIPTION
+#
+# Searches for the 'beecrypt' library with the --with... option.
+#
+# If found, define HAVE_BEECRYPT and macro BEECRYPT_LIBS. Also defines
+# BEECRYPT_WITH_<algo> for the algorithms found available. Possible
+# algorithms: BASE64 AES BF MD5 SHA1 SHA256 SHA384 SHA512.
+#
+# The argument is used if no --with...-beecrypt option is set. Value "yes"
+# requires the configuration by default. Value "no" does not require it by
+# default. Value "auto" configures the library only if available.
+#
+# See also AX_LIB_CRYPTO and AX_LIB_GCRYPT.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Fabien Coelho <autoconf.archive@coelho.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+# AX_CHECK_BEECRYPT_ALGO([name],[function])
+AC_DEFUN([AX_CHECK_BEECRYPT_ALGO],[
+ AC_CHECK_LIB([beecrypt], [$2],
+ AC_DEFINE([BEECRYPT_WITH_$1],[1],[Algorithm $1 in beecrypt library]))
+])
+
+# AX_LIB_BEECRYPT([yes|no|auto])
+AC_DEFUN([AX_LIB_BEECRYPT],[
+ AC_MSG_CHECKING([whether beecrypt is enabled])
+ AC_ARG_WITH([beecrypt],[ --with-beecrypt require beecrypt library
+ --without-beecrypt disable beecrypt library],[
+ AC_MSG_RESULT([$withval])
+ ac_with_beecrypt=$withval
+ ],[
+ AC_MSG_RESULT([$1])
+ ac_with_beecrypt=$1
+ ])
+ if test "$ac_with_beecrypt" = "yes" -o "$ac_with_beecrypt" = "auto" ; then
+ AC_CHECK_HEADERS([beecrypt/beecrypt.h],[
+ AC_CHECK_LIB([beecrypt],[blockCipherFind],[
+ AC_DEFINE([HAVE_BEECRYPT],[1],[Beecrypt library is available])
+ HAVE_BEECRYPT=1
+ AC_SUBST([BEECRYPT_LIBS],[-lbeecrypt])
+ # encoding
+ AX_CHECK_BEECRYPT_ALGO([BASE64],[b64encode])
+ # ciphers
+ AX_CHECK_BEECRYPT_ALGO([AES],[aesSetup])
+ AX_CHECK_BEECRYPT_ALGO([BF],[blowfishSetup])
+ # digests
+ AX_CHECK_BEECRYPT_ALGO([MD5],[md5Digest])
+ AX_CHECK_BEECRYPT_ALGO([SHA1],[sha1Digest])
+ AX_CHECK_BEECRYPT_ALGO([SHA256],[sha256Digest])
+ AX_CHECK_BEECRYPT_ALGO([SHA384],[sha384Digest])
+ AX_CHECK_BEECRYPT_ALGO([SHA512],[sha512Digest])
+ ])
+ ])
+ # complain only if explicitely required
+ if test "$ac_with_beecrypt" = "yes" -a "x$HAVE_BEECRYPT" = "x" ; then
+ AC_MSG_ERROR([cannot configure required beecrypt library])
+ fi
+ fi
+])
diff --git a/m4/ax_lib_crypto.m4 b/m4/ax_lib_crypto.m4
new file mode 100644
index 0000000..ec479da
--- /dev/null
+++ b/m4/ax_lib_crypto.m4
@@ -0,0 +1,82 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lib_crypto.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_CRYPTO([yes|no|auto])
+#
+# DESCRIPTION
+#
+# Searches for the 'crypto' library with the --with... option.
+#
+# If found, define HAVE_CRYPTO and macro CRYPTO_LIBS. Also defines
+# CRYPTO_WITH_<algo> for the algorithms found available. Possible
+# algorithms: AES BF CAMELLIA CAST DES IDEA RC2 RC5 MD2 MD4 MD5 SHA RIPEMD
+# RSA DSA DH
+#
+# The argument is used if no --with...-crypto option is set. Value "yes"
+# requires the configuration by default. Value "no" does not require it by
+# default. Value "auto" configures the library only if available.
+#
+# See also AX_LIB_BEECRYPT and AX_LIB_GCRYPT.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Fabien Coelho <autoconf.archive@coelho.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+# AX_CHECK_CRYPTO_LIB([algo-name],[function])
+AC_DEFUN([AX_CHECK_CRYPTO_LIB],[
+ AC_CHECK_LIB([crypto], $2, [
+ AC_DEFINE([CRYPTO_WITH_$1],[1],[Algorithm $1 in openssl crypto library])
+ ])
+])
+
+# AX_LIB_CRYPTO([yes|no|auto])
+AC_DEFUN([AX_LIB_CRYPTO],[
+ AC_MSG_CHECKING([whether openssl crypto is enabled])
+ AC_ARG_WITH([crypto],[ --with-crypto requite crypto library
+ --without-crypto disable crypto library],[
+ AC_MSG_RESULT([$withval])
+ ac_with_crypto=$withval
+ ],[
+ AC_MSG_RESULT([$1])
+ ac_with_crypto=$1
+ ])
+ if test "$ac_with_crypto" = "yes" -o "$ac_with_crypto" = "auto" ; then
+ AC_CHECK_HEADERS([openssl/opensslconf.h],[
+ AC_CHECK_LIB([crypto], [CRYPTO_lock],[
+ AC_DEFINE([HAVE_CRYPTO],[1],[Openssl crypto library is available])
+ HAVE_CRYPTO=1
+ AC_SUBST([CRYPTO_LIBS],[-lcrypto])
+ # ciphers
+ AX_CHECK_CRYPTO_LIB([AES],[AES_ecb_encrypt])
+ AX_CHECK_CRYPTO_LIB([BF],[BF_ecb_encrypt])
+ AX_CHECK_CRYPTO_LIB([CAST],[CAST_ecb_encrypt])
+ AX_CHECK_CRYPTO_LIB([CAMELLIA],[Camellia_ecb_encrypt])
+ AX_CHECK_CRYPTO_LIB([DES],[DES_ecb_encrypt])
+ AX_CHECK_CRYPTO_LIB([IDEA],[idea_ecb_encrypt])
+ AX_CHECK_CRYPTO_LIB([RC2],[RC2_ecb_encrypt])
+ AX_CHECK_CRYPTO_LIB([RC5],[RC5_32_ecb_encrypt])
+ # digests
+ AX_CHECK_CRYPTO_LIB([MD2],[MD2])
+ AX_CHECK_CRYPTO_LIB([MD4],[MD4])
+ AX_CHECK_CRYPTO_LIB([MD5],[MD5])
+ AX_CHECK_CRYPTO_LIB([RIPEMD],[RIPEMD160])
+ AX_CHECK_CRYPTO_LIB([SHA],[SHA1])
+ # others
+ AX_CHECK_CRYPTO_LIB([RSA],[RSA_set_method])
+ AX_CHECK_CRYPTO_LIB([DSA],[DSA_set_method])
+ AX_CHECK_CRYPTO_LIB([DH],[DH_set_method])
+ ])
+ ])
+ # complain only if crypto as *explicitely* required
+ if test "$ac_with_crypto" = "yes" -a "x$HAVE_CRYPTO" = "x" ; then
+ AC_MSG_ERROR([cannot configure required openssl crypto library])
+ fi
+ fi
+])
diff --git a/m4/ax_lib_expat.m4 b/m4/ax_lib_expat.m4
new file mode 100644
index 0000000..37d04f7
--- /dev/null
+++ b/m4/ax_lib_expat.m4
@@ -0,0 +1,272 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lib_expat.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_EXPAT([MINIMUM-VERSION])
+#
+# DESCRIPTION
+#
+# This macro provides tests of availability of Expat XML Parser of
+# particular version or newer. This macro checks for Expat XML Parser
+# headers and libraries and defines compilation flags
+#
+# Macro supports following options and their values:
+#
+# 1) Single-option usage:
+#
+# --with-expat -- yes, no, or path to Expat XML Parser
+# installation prefix
+#
+# 2) Three-options usage (all options are required):
+#
+# --with-expat=yes
+# --with-expat-inc -- path to base directory with Expat headers
+# --with-expat-lib -- linker flags for Expat
+#
+# This macro calls:
+#
+# AC_SUBST(EXPAT_CFLAGS)
+# AC_SUBST(EXPAT_LDFLAGS)
+# AC_SUBST(EXPAT_VERSION) -- only if version requirement is used
+#
+# And sets:
+#
+# HAVE_EXPAT
+#
+# LICENSE
+#
+# Copyright (c) 2008 Mateusz Loskot <mateusz@loskot.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_LIB_EXPAT],
+[
+ AC_ARG_WITH([expat],
+ AC_HELP_STRING([--with-expat=@<:@ARG@:>@],
+ [use Expat XML Parser from given prefix (ARG=path); check standard prefixes (ARG=yes); disable (ARG=no)]
+ ),
+ [
+ if test "$withval" = "yes"; then
+ if test -f /usr/local/include/expat.h ; then
+ expat_prefix=/usr/local
+ elif test -f /usr/include/expat.h ; then
+ expat_prefix=/usr
+ else
+ expat_prefix=""
+ fi
+ expat_requested="yes"
+ elif test -d "$withval"; then
+ expat_prefix="$withval"
+ expat_requested="yes"
+ else
+ expat_prefix=""
+ expat_requested="no"
+ fi
+ ],
+ [
+ dnl Default behavior is implicit yes
+ if test -f /usr/local/include/expat.h ; then
+ expat_prefix=/usr/local
+ elif test -f /usr/include/expat.h ; then
+ expat_prefix=/usr
+ else
+ expat_prefix=""
+ fi
+ ]
+ )
+
+ AC_ARG_WITH([expat-inc],
+ AC_HELP_STRING([--with-expat-inc=@<:@DIR@:>@],
+ [path to Expat XML Parser headers]
+ ),
+ [expat_include_dir="$withval"],
+ [expat_include_dir=""]
+ )
+ AC_ARG_WITH([expat-lib],
+ AC_HELP_STRING([--with-expat-lib=@<:@ARG@:>@],
+ [link options for Expat XML Parser libraries]
+ ),
+ [expat_lib_flags="$withval"],
+ [expat_lib_flags=""]
+ )
+
+ EXPAT_CFLAGS=""
+ EXPAT_LDFLAGS=""
+ EXPAT_VERSION=""
+
+ dnl
+ dnl Collect include/lib paths and flags
+ dnl
+ run_expat_test="no"
+
+ if test -n "$expat_prefix"; then
+ expat_include_dir="$expat_prefix/include"
+ expat_lib_flags="-L$expat_prefix/lib -lexpat"
+ run_expat_test="yes"
+ elif test "$expat_requested" = "yes"; then
+ if test -n "$expat_include_dir" -a -n "$expat_lib_flags"; then
+ run_expat_test="yes"
+ fi
+ else
+ run_expat_test="no"
+ fi
+
+ dnl
+ dnl Check Expat XML Parser files
+ dnl
+ if test "$run_expat_test" = "yes"; then
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$expat_include_dir"
+
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $expat_lib_flags"
+
+ dnl
+ dnl Check Expat headers
+ dnl
+ AC_MSG_CHECKING([for Expat XML Parser headers in $expat_include_dir])
+
+ AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[
+@%:@include <expat.h>
+ ]],
+ [[]]
+ )],
+ [
+ EXPAT_CFLAGS="-I$expat_include_dir"
+ expat_header_found="yes"
+ AC_MSG_RESULT([found])
+ ],
+ [
+ expat_header_found="no"
+ AC_MSG_RESULT([not found])
+ ]
+ )
+ AC_LANG_POP([C++])
+
+ dnl
+ dnl Check Expat libraries
+ dnl
+ if test "$expat_header_found" = "yes"; then
+
+ AC_MSG_CHECKING([for Expat XML Parser libraries])
+
+ AC_LANG_PUSH([C++])
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM(
+ [[
+@%:@include <expat.h>
+ ]],
+ [[
+XML_Parser p = XML_ParserCreate(NULL);
+XML_ParserFree(p);
+p = NULL;
+ ]]
+ )],
+ [
+ EXPAT_LDFLAGS="$expat_lib_flags"
+ expat_lib_found="yes"
+ AC_MSG_RESULT([found])
+ ],
+ [
+ expat_lib_found="no"
+ AC_MSG_RESULT([not found])
+ ]
+ )
+ AC_LANG_POP([C++])
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ fi
+
+ AC_MSG_CHECKING([for Expat XML Parser])
+
+ if test "$run_expat_test" = "yes"; then
+ if test "$expat_header_found" = "yes" -a "$expat_lib_found" = "yes"; then
+
+ AC_SUBST([EXPAT_CFLAGS])
+ AC_SUBST([EXPAT_LDFLAGS])
+
+ HAVE_EXPAT="yes"
+ else
+ HAVE_EXPAT="no"
+ fi
+
+ AC_MSG_RESULT([$HAVE_EXPAT])
+
+ dnl
+ dnl Check Expat version
+ dnl
+ if test "$HAVE_EXPAT" = "yes"; then
+
+ expat_version_req=ifelse([$1], [], [], [$1])
+
+ if test -n "$expat_version_req"; then
+
+ AC_MSG_CHECKING([if Expat XML Parser version is >= $expat_version_req])
+
+ if test -f "$expat_include_dir/expat.h"; then
+
+ expat_major=`cat $expat_include_dir/expat.h | \
+ grep '^#define.*XML_MAJOR_VERSION.*[0-9]$' | \
+ sed -e 's/#define XML_MAJOR_VERSION.//'`
+
+ expat_minor=`cat $expat_include_dir/expat.h | \
+ grep '^#define.*XML_MINOR_VERSION.*[0-9]$' | \
+ sed -e 's/#define XML_MINOR_VERSION.//'`
+
+ expat_revision=`cat $expat_include_dir/expat.h | \
+ grep '^#define.*XML_MICRO_VERSION.*[0-9]$' | \
+ sed -e 's/#define XML_MICRO_VERSION.//'`
+
+ EXPAT_VERSION="$expat_major.$expat_minor.$expat_revision"
+ AC_SUBST([EXPAT_VERSION])
+
+ dnl Decompose required version string and calculate numerical representation
+ expat_version_req_major=`expr $expat_version_req : '\([[0-9]]*\)'`
+ expat_version_req_minor=`expr $expat_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
+ expat_version_req_revision=`expr $expat_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test "x$expat_version_req_revision" = "x"; then
+ expat_version_req_revision="0"
+ fi
+
+ expat_version_req_number=`expr $expat_version_req_major \* 10000 \
+ \+ $expat_version_req_minor \* 100 \
+ \+ $expat_version_req_revision`
+
+ dnl Calculate numerical representation of detected version
+ expat_version_number=`expr $expat_major \* 10000 \
+ \+ $expat_minor \* 100 \
+ \+ $expat_revision`
+
+ expat_version_check=`expr $expat_version_number \>\= $expat_version_req_number`
+ if test "$expat_version_check" = "1"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([Found Expat XML Parser $EXPAT_VERSION, which is older than required. Possible compilation failure.])
+ fi
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([Missing expat.h header. Unable to determine Expat version.])
+ fi
+ fi
+ fi
+
+ else
+ HAVE_EXPAT="no"
+ AC_MSG_RESULT([$HAVE_EXPAT])
+
+ if test "$expat_requested" = "yes"; then
+ AC_MSG_WARN([Expat XML Parser support requested but headers or library not found. Specify valid prefix of Expat using --with-expat=@<:@DIR@:>@ or provide include directory and linker flags using --with-expat-inc and --with-expat-lib])
+ fi
+ fi
+])
diff --git a/m4/ax_lib_firebird.m4 b/m4/ax_lib_firebird.m4
new file mode 100644
index 0000000..021bccb
--- /dev/null
+++ b/m4/ax_lib_firebird.m4
@@ -0,0 +1,167 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lib_firebird.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_FIREBIRD([MINIMUM-VERSION])
+#
+# DESCRIPTION
+#
+# Test for the Firebird client library of a particular version (or newer).
+# This macro takes only one optional argument, the required version of
+# Firebird library. If required version is not passed, then 1.5.0 is used
+# in test of existance of Firebird client library.
+#
+# For more information about Firebird API versioning check: API Identifies
+# Client Version http://www.firebirdsql.org/rlsnotes20/rnfbtwo-apiods.html
+#
+# If no intallation prefix to the installed Firebird library is given the
+# macro searches under /usr, /usr/local, and /opt.
+#
+# This macro calls:
+#
+# AC_SUBST(FIREBIRD_CFLAGS)
+# AC_SUBST(FIREBIRD_LDFLAGS)
+# AC_SUBST(FIREBIRD_VERSION)
+#
+# And sets:
+#
+# HAVE_FIREBIRD
+#
+# LICENSE
+#
+# Copyright (c) 2008 Mateusz Loskot <mateusz@loskot.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_LIB_FIREBIRD],
+[
+ AC_ARG_WITH([firebird],
+ AC_HELP_STRING(
+ [--with-firebird=@<:@ARG@:>@],
+ [use Firebird client library @<:@default=yes@:>@, optionally specify the prefix for firebird library]
+ ),
+ [
+ if test "$withval" = "no"; then
+ WANT_FIREBIRD="no"
+ elif test "$withval" = "yes"; then
+ WANT_FIREBIRD="yes"
+ ac_firebird_path=""
+ else
+ WANT_FIREBIRD="yes"
+ ac_firebird_path="$withval"
+ fi
+ ],
+ [WANT_FIREBIRD="yes"]
+ )
+
+ FIREBIRD_CFLAGS=""
+ FIREBIRD_LDFLAGS=""
+ FIREBIRD_VERSION=""
+
+ if test "x$WANT_FIREBIRD" = "xyes"; then
+
+ ac_firebird_header="ibase.h"
+
+ firebird_version_req=ifelse([$1], [], [3.0.0], [$1])
+ firebird_version_req_shorten=`expr $firebird_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
+ firebird_version_req_major=`expr $firebird_version_req : '\([[0-9]]*\)'`
+ firebird_version_req_minor=`expr $firebird_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
+ firebird_version_req_micro=`expr $firebird_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test "x$firebird_version_req_micro" = "x" ; then
+ firebird_version_req_micro="0"
+ fi
+
+ dnl FB_API_VER represents the version of Firebird as follows:
+ dnl - Any version of Interbase, or Firebird 1.0.x: 10
+ dnl - Firebird 1.5.x: 15
+ dnl - Firebird 2.0.x: 20
+
+ firebird_version_req_number=`expr $firebird_version_req_major \+ $firebird_version_req_minor`
+
+ AC_MSG_CHECKING([for Firebird client library >= $firebird_version_req])
+
+ if test "$ac_firebird_path" != ""; then
+ ac_firebird_ldflags="-L$ac_firebird_path/lib"
+ ac_firebird_cppflags="-I$ac_firebird_path/include"
+ else
+ for ac_firebird_path_tmp in /usr /usr/local /opt ; do
+ if test -f "$ac_firebird_path_tmp/include/$ac_firebird_header" \
+ && test -r "$ac_firebird_path_tmp/include/$ac_firebird_header"; then
+ ac_firebird_path=$ac_firebird_path_tmp
+ ac_firebird_cppflags="-I$ac_firebird_path_tmp/include"
+ ac_firebird_ldflags="-L$ac_firebird_path_tmp/lib"
+ break;
+ fi
+ done
+ fi
+
+ ac_firebird_header_path="$ac_firebird_path/include/$ac_firebird_header"
+
+ if test ! -f "$ac_firebird_header_path"; then
+ AC_MSG_RESULT([no])
+ success="no"
+ else
+
+ ac_firebird_ldflags="$ac_firebird_ldflags -lfbclient -lpthread"
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $ac_firebird_cppflags"
+
+ AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM([[@%:@include <ibase.h>]],
+ [[
+#if (FB_API_VER >= $firebird_version_req_number)
+// Everything is okay
+#else
+# error Firebird version is too old
+#endif
+ ]]
+ )
+ ],
+ [
+ AC_MSG_RESULT([yes])
+ success="yes"
+ ],
+ [
+ AC_MSG_RESULT([not found])
+ succees="no"
+ ]
+ )
+ AC_LANG_POP([C++])
+
+ CPPFLAGS="$saved_CPPFLAGS"
+
+ if test "$success" = "yes"; then
+
+ FIREBIRD_CFLAGS="$ac_firebird_cppflags"
+ FIREBIRD_LDFLAGS="$ac_firebird_ldflags"
+
+ dnl Retrieve Firebird release version
+
+ ac_firebird_version=`cat $ac_firebird_header_path | \
+ grep '#define.*FB_API_VER.*' | \
+ sed -e 's/.* //'`
+
+ if test -n "$ac_firebird_version"; then
+ ac_firebird_version_major=`expr $ac_firebird_version \/ 10`
+ ac_firebird_version_minor=`expr $ac_firebird_version \% 10`
+
+ FIREBIRD_VERSION="$ac_firebird_version_major.$ac_firebird_version_minor.x"
+ else
+ AC_MSG_WARN([Could not find FB_API_VER macro in $ac_firebird_header to get Firebird version.])
+ fi
+
+ AC_SUBST(FIREBIRD_CFLAGS)
+ AC_SUBST(FIREBIRD_LDFLAGS)
+ AC_SUBST(FIREBIRD_VERSION)
+ AC_DEFINE(HAVE_FIREBIRD)
+ fi
+ fi
+ fi
+])
diff --git a/m4/ax_lib_gcrypt.m4 b/m4/ax_lib_gcrypt.m4
new file mode 100644
index 0000000..8d93519
--- /dev/null
+++ b/m4/ax_lib_gcrypt.m4
@@ -0,0 +1,105 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lib_gcrypt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_GCRYPT([yes|no|auto])
+#
+# DESCRIPTION
+#
+# Searches for the 'gcrypt' library with the --with... option.
+#
+# If found, define HAVE_GCRYPT and macro GCRYPT_LIBS and GCRYPT_CFLAGS.
+# Also defines GCRYPT_WITH_<algo> for the algorithms found available.
+# Possible algorithms are: AES ARCFOUR BLOWFISH CAST5 DES IDEA RFC2268
+# SERPENT TWOFISH CRC HAVAL MD2 MD4 MD5 RMD160 SHA0 SHA1 SHA224 SHA256
+# SHA384 SHA512 TIGER WHIRLPOOL DSA ELGAMAL RSA
+#
+# The argument is used if no --with...-gcrypt option is set. Value "yes"
+# requires the configuration by default. Value "no" does not require it by
+# default. Value "auto" configures the library only if available.
+#
+# See also AX_LIB_BEECRYPT and AX_LIB_CRYPTO.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Fabien Coelho <autoconf.archive@coelho.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+# AX_CHECK_GCRYPT_ALGO([algo])
+# generate convenient defines for each algorithm
+AC_DEFUN([AX_CHECK_GCRYPT_ALGO],[
+ AC_REQUIRE([AC_PROG_EGREP])
+ AC_MSG_CHECKING([for $1 in gcrypt])
+ if echo $gcrypt_algos | $EGREP -i ":.*( $1 | $1$)" > /dev/null ; then
+ AC_DEFINE([GCRYPT_WITH_$1],[1],[Algorithm $1 in gcrypt library])
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+])
+
+# AX_LIB_GCRYPT([yes|no|auto])
+AC_DEFUN([AX_LIB_GCRYPT],[
+ AC_MSG_CHECKING([whether gcrypt is enabled])
+ AC_ARG_WITH([gcrypt],[ --with-gcrypt require gcrypt library
+ --without-gcrypt disable gcrypt library],[
+ AC_MSG_RESULT([$withval])
+ ac_with_gcrypt=$withval
+ ],[
+ AC_MSG_RESULT($1)
+ ac_with_gcrypt=$1
+ ])
+ if test "$ac_with_gcrypt" = "yes" -o "$ac_with_gcrypt" = "auto" ; then
+ AM_PATH_LIBGCRYPT([1.2.0],[
+ AC_DEFINE([HAVE_GCRYPT],[1],[Gcrypt library is available])
+ HAVE_GCRYPT=1
+ # checking for available algorithms...
+ gcrypt_algos=`$LIBGCRYPT_CONFIG --algorithms`
+ # ciphers
+ # this does not work with a "for" loop: nothing generated in config.h:-(
+ AX_CHECK_GCRYPT_ALGO([AES])
+ AX_CHECK_GCRYPT_ALGO([ARCFOUR])
+ AX_CHECK_GCRYPT_ALGO([BLOWFISH])
+ AX_CHECK_GCRYPT_ALGO([CAST5])
+ AX_CHECK_GCRYPT_ALGO([DES])
+ AX_CHECK_GCRYPT_ALGO([IDEA])
+ AX_CHECK_GCRYPT_ALGO([RFC2268])
+ AX_CHECK_GCRYPT_ALGO([SERPENT])
+ AX_CHECK_GCRYPT_ALGO([TWOFISH])
+ # digests
+ AX_CHECK_GCRYPT_ALGO([CRC])
+ AX_CHECK_GCRYPT_ALGO([HAVAL])
+ AX_CHECK_GCRYPT_ALGO([MD2])
+ AX_CHECK_GCRYPT_ALGO([MD4])
+ AX_CHECK_GCRYPT_ALGO([MD5])
+ AX_CHECK_GCRYPT_ALGO([RMD160])
+ AX_CHECK_GCRYPT_ALGO([SHA0])
+ AX_CHECK_GCRYPT_ALGO([SHA1])
+ AX_CHECK_GCRYPT_ALGO([SHA224])
+ AX_CHECK_GCRYPT_ALGO([SHA256])
+ AX_CHECK_GCRYPT_ALGO([SHA384])
+ AX_CHECK_GCRYPT_ALGO([SHA512])
+ AX_CHECK_GCRYPT_ALGO([TIGER])
+ AX_CHECK_GCRYPT_ALGO([WHIRLPOOL])
+ # others
+ AX_CHECK_GCRYPT_ALGO([DSA])
+ AX_CHECK_GCRYPT_ALGO([ELGAMAL])
+ AX_CHECK_GCRYPT_ALGO([RSA])
+ # conclusion
+ GCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
+ GCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
+ AC_SUBST(GCRYPT_CFLAGS)
+ AC_SUBST(GCRYPT_LIBS)
+ ],[
+ # complain only if explicitely required
+ if test "$ac_with_gcrypt" = "yes" ; then
+ AC_MSG_ERROR([cannot configure required gcrypt library])
+ fi
+ ])
+ fi
+])
diff --git a/m4/ax_lib_mysql.m4 b/m4/ax_lib_mysql.m4
new file mode 100644
index 0000000..ba68fb6
--- /dev/null
+++ b/m4/ax_lib_mysql.m4
@@ -0,0 +1,145 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lib_mysql.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_MYSQL([MINIMUM-VERSION])
+#
+# DESCRIPTION
+#
+# This macro provides tests of availability of MySQL client library of
+# particular version or newer.
+#
+# AX_LIB_MYSQL macro takes only one argument which is optional. If there
+# is no required version passed, then macro does not run version test.
+#
+# The --with-mysql option takes one of three possible values:
+#
+# no - do not check for MySQL client library
+#
+# yes - do check for MySQL library in standard locations (mysql_config
+# should be in the PATH)
+#
+# path - complete path to mysql_config utility, use this option if
+# mysql_config can't be found in the PATH
+#
+# This macro calls:
+#
+# AC_SUBST(MYSQL_CFLAGS)
+# AC_SUBST(MYSQL_LDFLAGS)
+# AC_SUBST(MYSQL_VERSION)
+#
+# And sets:
+#
+# HAVE_MYSQL
+#
+# LICENSE
+#
+# Copyright (c) 2008 Mateusz Loskot <mateusz@loskot.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_LIB_MYSQL],
+[
+ AC_ARG_WITH([mysql],
+ AC_HELP_STRING([--with-mysql=@<:@ARG@:>@],
+ [use MySQL client library @<:@default=yes@:>@, optionally specify path to mysql_config]
+ ),
+ [
+ if test "$withval" = "no"; then
+ want_mysql="no"
+ elif test "$withval" = "yes"; then
+ want_mysql="yes"
+ else
+ want_mysql="yes"
+ MYSQL_CONFIG="$withval"
+ fi
+ ],
+ [want_mysql="yes"]
+ )
+
+ MYSQL_CFLAGS=""
+ MYSQL_LDFLAGS=""
+ MYSQL_VERSION=""
+
+ dnl
+ dnl Check MySQL libraries (libpq)
+ dnl
+
+ if test "$want_mysql" = "yes"; then
+
+ if test -z "$MYSQL_CONFIG" -o test; then
+ AC_PATH_PROG([MYSQL_CONFIG], [mysql_config], [no])
+ fi
+
+ if test "$MYSQL_CONFIG" != "no"; then
+ AC_MSG_CHECKING([for MySQL libraries])
+
+ MYSQL_CFLAGS="`$MYSQL_CONFIG --cflags`"
+ MYSQL_LDFLAGS="`$MYSQL_CONFIG --libs`"
+
+ MYSQL_VERSION=`$MYSQL_CONFIG --version`
+
+ AC_DEFINE([HAVE_MYSQL], [1],
+ [Define to 1 if MySQL libraries are available])
+
+ found_mysql="yes"
+ AC_MSG_RESULT([yes])
+ else
+ found_mysql="no"
+ AC_MSG_RESULT([no])
+ fi
+ fi
+
+ dnl
+ dnl Check if required version of MySQL is available
+ dnl
+
+
+ mysql_version_req=ifelse([$1], [], [], [$1])
+
+ if test "$found_mysql" = "yes" -a -n "$mysql_version_req"; then
+
+ AC_MSG_CHECKING([if MySQL version is >= $mysql_version_req])
+
+ dnl Decompose required version string of MySQL
+ dnl and calculate its number representation
+ mysql_version_req_major=`expr $mysql_version_req : '\([[0-9]]*\)'`
+ mysql_version_req_minor=`expr $mysql_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
+ mysql_version_req_micro=`expr $mysql_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test "x$mysql_version_req_micro" = "x"; then
+ mysql_version_req_micro="0"
+ fi
+
+ mysql_version_req_number=`expr $mysql_version_req_major \* 1000000 \
+ \+ $mysql_version_req_minor \* 1000 \
+ \+ $mysql_version_req_micro`
+
+ dnl Decompose version string of installed MySQL
+ dnl and calculate its number representation
+ mysql_version_major=`expr $MYSQL_VERSION : '\([[0-9]]*\)'`
+ mysql_version_minor=`expr $MYSQL_VERSION : '[[0-9]]*\.\([[0-9]]*\)'`
+ mysql_version_micro=`expr $MYSQL_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test "x$mysql_version_micro" = "x"; then
+ mysql_version_micro="0"
+ fi
+
+ mysql_version_number=`expr $mysql_version_major \* 1000000 \
+ \+ $mysql_version_minor \* 1000 \
+ \+ $mysql_version_micro`
+
+ mysql_version_check=`expr $mysql_version_number \>\= $mysql_version_req_number`
+ if test "$mysql_version_check" = "1"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+
+ AC_SUBST([MYSQL_VERSION])
+ AC_SUBST([MYSQL_CFLAGS])
+ AC_SUBST([MYSQL_LDFLAGS])
+])
diff --git a/m4/ax_lib_nettle.m4 b/m4/ax_lib_nettle.m4
new file mode 100644
index 0000000..b921157
--- /dev/null
+++ b/m4/ax_lib_nettle.m4
@@ -0,0 +1,77 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lib_nettle.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_NETTLE([yes|no|auto])
+#
+# DESCRIPTION
+#
+# Searches for the 'nettle' library with the --with... option.
+#
+# If found, define HAVE_NETTLE and macro NETTLE_LIBS. Also defines
+# NETTLE_WITH_<algo> for the algorithms found available. Possible
+# algorithms: AES ARCTWO BLOWFISH CAST128 DES DES3 SERPENT TWOFISH MD2 MD4
+# MD5 SHA1 SHA256.
+#
+# The argument is used if no --with...-nettle option is set. Value "yes"
+# requires the configuration by default. Value "no" does not require it by
+# default. Value "auto" configures the library only if available.
+#
+# See also AX_LIB_BEECRYPT, AX_LIB_CRYPTO, and AX_LIB_GCRYPT.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Fabien Coelho <autoconf.archive@coelho.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+# AX_CHECK_NETTLE_ALGO([name],[function])
+AC_DEFUN([AX_CHECK_NETTLE_ALGO],[
+ AC_CHECK_LIB([nettle], [nettle_$2],
+ AC_DEFINE([NETTLE_WITH_$1],[1],[Algorithm $1 in nettle library]))
+])
+
+# AX_LIB_NETTLE([yes|no|auto])
+AC_DEFUN([AX_LIB_NETTLE],[
+ AC_MSG_CHECKING([whether nettle is enabled])
+ AC_ARG_WITH([nettle],[ --with-nettle require nettle library
+ --without-nettle disable nettle library],[
+ AC_MSG_RESULT([$withval])
+ ax_with_nettle=$withval
+ ],[
+ AC_MSG_RESULT([$1])
+ ax_with_nettle=$1
+ ])
+ if test "$ax_with_nettle" = "yes" -o "$ax_with_nettle" = "auto" ; then
+ AC_CHECK_HEADERS([nettle/nettle-meta.h],[
+ AC_CHECK_LIB([nettle],[nettle_base64_encode_final],[
+ AC_DEFINE([HAVE_NETTLE],[1],[Nettle library is available])
+ HAVE_NETTLE=1
+ AC_SUBST([NETTLE_LIBS],[-lnettle])
+ # ciphers
+ AX_CHECK_NETTLE_ALGO([AES],[aes_encrypt])
+ AX_CHECK_NETTLE_ALGO([ARCTWO],[arctwo_encrypt])
+ AX_CHECK_NETTLE_ALGO([BLOWFISH],[blowfish_encrypt])
+ AX_CHECK_NETTLE_ALGO([CAST128],[cast128_encrypt])
+ AX_CHECK_NETTLE_ALGO([DES],[des_encrypt])
+ AX_CHECK_NETTLE_ALGO([DES3],[des3_encrypt])
+ AX_CHECK_NETTLE_ALGO([SERPENT],[serpent_encrypt])
+ AX_CHECK_NETTLE_ALGO([TWOFISH],[twofish_encrypt])
+ # digests
+ AX_CHECK_NETTLE_ALGO([MD2],[md2_digest])
+ AX_CHECK_NETTLE_ALGO([MD4],[md4_digest])
+ AX_CHECK_NETTLE_ALGO([MD5],[md5_digest])
+ AX_CHECK_NETTLE_ALGO([SHA1],[sha1_digest])
+ AX_CHECK_NETTLE_ALGO([SHA256],[sha256_digest])
+ ])
+ ])
+ # complain only if explicitely required
+ if test "$ax_with_nettle" = "yes" -a "x$HAVE_NETTLE" = "x" ; then
+ AC_MSG_ERROR([cannot configure required nettle library])
+ fi
+ fi
+])
diff --git a/m4/ax_lib_oracle_oci.m4 b/m4/ax_lib_oracle_oci.m4
new file mode 100644
index 0000000..a08d71d
--- /dev/null
+++ b/m4/ax_lib_oracle_oci.m4
@@ -0,0 +1,306 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lib_oracle_oci.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_ORACLE_OCI([MINIMUM-VERSION])
+#
+# DESCRIPTION
+#
+# This macro provides tests of availability of Oracle OCI API of
+# particular version or newer. This macros checks for Oracle OCI headers
+# and libraries and defines compilation flags.
+#
+# Macro supports following options and their values:
+#
+# 1) Single-option usage:
+#
+# --with-oci -- path to ORACLE_HOME directory
+#
+# 2) Two-options usage (both options are required):
+#
+# --with-oci-include -- path to directory with OCI headers
+# --with-oci-lib -- path to directory with OCI libraries
+#
+# NOTE: These options described above do not take yes|no values. If 'yes'
+# value is passed, then WARNING message will be displayed, 'no' value, as
+# well as the --without-oci-* variations will cause the macro to not check
+# enything.
+#
+# This macro calls:
+#
+# AC_SUBST(ORACLE_OCI_CFLAGS)
+# AC_SUBST(ORACLE_OCI_LDFLAGS)
+# AC_SUBST(ORACLE_OCI_VERSION)
+#
+# And sets:
+#
+# HAVE_ORACLE_OCI
+#
+# LICENSE
+#
+# Copyright (c) 2008 Mateusz Loskot <mateusz@loskot.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_LIB_ORACLE_OCI],
+[
+ AC_ARG_WITH([oci],
+ AC_HELP_STRING([--with-oci=@<:@ARG@:>@],
+ [use Oracle OCI API from given Oracle home (ARG=path); use existing ORACLE_HOME (ARG=yes); disable Oracle OCI support (ARG=no)]
+ ),
+ [
+ if test "$withval" = "yes"; then
+ if test -n "$ORACLE_HOME"; then
+ oracle_home_dir="$ORACLE_HOME"
+ else
+ oracle_home_dir=""
+ fi
+ elif test -d "$withval"; then
+ oracle_home_dir="$withval"
+ else
+ oracle_home_dir=""
+ fi
+ ],
+ [
+ if test -n "$ORACLE_HOME"; then
+ oracle_home_dir="$ORACLE_HOME"
+ else
+ oracle_home_dir=""
+ fi
+ ]
+ )
+
+ AC_ARG_WITH([oci-include],
+ AC_HELP_STRING([--with-oci-include=@<:@DIR@:>@],
+ [use Oracle OCI API headers from given path]
+ ),
+ [oracle_home_include_dir="$withval"],
+ [oracle_home_include_dir=""]
+ )
+ AC_ARG_WITH([oci-lib],
+ AC_HELP_STRING([--with-oci-lib=@<:@DIR@:>@],
+ [use Oracle OCI API libraries from given path]
+ ),
+ [oracle_home_lib_dir="$withval"],
+ [oracle_home_lib_dir=""]
+ )
+
+ ORACLE_OCI_CFLAGS=""
+ ORACLE_OCI_LDFLAGS=""
+ ORACLE_OCI_VERSION=""
+
+ dnl
+ dnl Collect include/lib paths
+ dnl
+ want_oracle_but_no_path="no"
+
+ if test -n "$oracle_home_dir"; then
+
+ if test "$oracle_home_dir" != "no" -a "$oracle_home_dir" != "yes"; then
+ dnl ORACLE_HOME path provided
+
+ dnl Primary path to OCI headers, available in Oracle>=10
+ oracle_include_dir="$oracle_home_dir/rdbms/public"
+
+ dnl Secondary path to OCI headers used by older versions
+ oracle_include_dir2="$oracle_home_dir/rdbms/demo"
+
+ dnl Library path
+ oracle_lib_dir="$oracle_home_dir/lib"
+ elif test "$oracle_home_dir" = "yes"; then
+ want_oracle_but_no_path="yes"
+ fi
+
+ elif test -n "$oracle_home_include_dir" -o -n "$oracle_home_lib_dir"; then
+
+ if test "$oracle_home_include_dir" != "no" -a "$oracle_home_include_dir" != "yes"; then
+ oracle_include_dir="$oracle_home_include_dir"
+ elif test "$oracle_home_include_dir" = "yes"; then
+ want_oracle_but_no_path="yes"
+ fi
+
+ if test "$oracle_home_lib_dir" != "no" -a "$oracle_home_lib_dir" != "yes"; then
+ oracle_lib_dir="$oracle_home_lib_dir"
+ elif test "$oracle_home_lib_dir" = "yes"; then
+ want_oracle_but_no_path="yes"
+ fi
+ fi
+
+ if test "$want_oracle_but_no_path" = "yes"; then
+ AC_MSG_WARN([Oracle support is requested but no Oracle paths have been provided. \
+Please, locate Oracle directories using --with-oci or \
+--with-oci-include and --with-oci-lib options.])
+ fi
+
+ dnl
+ dnl Check OCI files
+ dnl
+ if test -n "$oracle_include_dir" -a -n "$oracle_lib_dir"; then
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$oracle_include_dir"
+
+ dnl Additional path for older Oracle installations
+ if test -n "$oracle_include_dir2"; then
+ CPPFLAGS="$CPPFLAGS -I$oracle_include_dir2"
+ fi
+
+ dnl Depending on later Oracle version detection,
+ dnl -lnnz10 flag might be removed for older Oracle < 10.x
+ saved_LDFLAGS="$LDFLAGS"
+ oci_ldflags="-L$oracle_lib_dir -lclntsh"
+ LDFLAGS="$LDFLAGS $oci_ldflags"
+
+ dnl
+ dnl Check OCI headers
+ dnl
+ AC_MSG_CHECKING([for Oracle OCI headers in $oracle_include_dir])
+
+ AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[@%:@include <oci.h>]],
+ [[
+#if defined(OCI_MAJOR_VERSION)
+#if OCI_MAJOR_VERSION == 10 && OCI_MINOR_VERSION == 2
+// Oracle 10.2 detected
+#endif
+#elif defined(OCI_V7_SYNTAX)
+// OK, older Oracle detected
+// TODO - mloskot: find better macro to check for older versions;
+#else
+# error Oracle oci.h header not found
+#endif
+ ]]
+ )],
+ [
+ ORACLE_OCI_CFLAGS="-I$oracle_include_dir"
+
+ if test -n "$oracle_include_dir2"; then
+ ORACLE_OCI_CFLAGS="$ORACLE_OCI_CFLAGS -I$oracle_include_dir2"
+ fi
+
+ oci_header_found="yes"
+ AC_MSG_RESULT([yes])
+ ],
+ [
+ oci_header_found="no"
+ AC_MSG_RESULT([not found])
+ ]
+ )
+ AC_LANG_POP([C++])
+
+ dnl
+ dnl Check OCI libraries
+ dnl
+ if test "$oci_header_found" = "yes"; then
+
+ AC_MSG_CHECKING([for Oracle OCI libraries in $oracle_lib_dir])
+
+ AC_LANG_PUSH(C++)
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[@%:@include <oci.h>]],
+ [[
+OCIEnv* envh = 0;
+OCIEnvCreate(&envh, OCI_DEFAULT, 0, 0, 0, 0, 0, 0);
+if (envh) OCIHandleFree(envh, OCI_HTYPE_ENV);
+ ]]
+ )],
+ [
+ ORACLE_OCI_LDFLAGS="$oci_ldflags"
+ oci_lib_found="yes"
+ AC_MSG_RESULT([yes])
+ ],
+ [
+ oci_lib_found="no"
+ AC_MSG_RESULT([not found])
+ ]
+ )
+ AC_LANG_POP([C++])
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ fi
+
+ dnl
+ dnl Check required version of Oracle is available
+ dnl
+ oracle_version_req=ifelse([$1], [], [], [$1])
+
+ if test "$oci_header_found" = "yes" -a "$oci_lib_found" = "yes" -a \
+ -n "$oracle_version_req"; then
+
+ oracle_version_major=`cat $oracle_include_dir/oci.h \
+ | grep '#define.*OCI_MAJOR_VERSION.*' \
+ | sed -e 's/#define OCI_MAJOR_VERSION *//' \
+ | sed -e 's/ *\/\*.*\*\///'`
+
+ oracle_version_minor=`cat $oracle_include_dir/oci.h \
+ | grep '#define.*OCI_MINOR_VERSION.*' \
+ | sed -e 's/#define OCI_MINOR_VERSION *//' \
+ | sed -e 's/ *\/\*.*\*\///'`
+
+ AC_MSG_CHECKING([if Oracle OCI version is >= $oracle_version_req])
+
+ if test -n "$oracle_version_major" -a -n $"oracle_version_minor"; then
+
+ ORACLE_OCI_VERSION="$oracle_version_major.$oracle_version_minor"
+
+ dnl Decompose required version string of Oracle
+ dnl and calculate its number representation
+ oracle_version_req_major=`expr $oracle_version_req : '\([[0-9]]*\)'`
+ oracle_version_req_minor=`expr $oracle_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
+
+ oracle_version_req_number=`expr $oracle_version_req_major \* 1000000 \
+ \+ $oracle_version_req_minor \* 1000`
+
+ dnl Calculate its number representation
+ oracle_version_number=`expr $oracle_version_major \* 1000000 \
+ \+ $oracle_version_minor \* 1000`
+
+ oracle_version_check=`expr $oracle_version_number \>\= $oracle_version_req_number`
+ if test "$oracle_version_check" = "1"; then
+
+ oracle_version_checked="yes"
+ AC_MSG_RESULT([yes])
+
+ dnl Add -lnnz10 flag to Oracle >= 10.x
+ AC_MSG_CHECKING([for Oracle version >= 10.x to use -lnnz10 flag])
+ oracle_nnz10_check=`expr $oracle_version_number \>\= 10 \* 1000000`
+ if test "$oracle_nnz10_check" = "1"; then
+ ORACLE_OCI_LDFLAGS="$ORACLE_OCI_LDFLAGS -lnnz10"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ else
+ oracle_version_checked="no"
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Oracle $ORACLE_OCI_VERSION found, but required version is $oracle_version_req])
+ fi
+ else
+ ORACLE_OCI_VERSION="UNKNOWN"
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([Oracle version unknown, probably OCI older than 10.2 is available])
+ fi
+ fi
+
+ AC_MSG_CHECKING([if Oracle support is enabled])
+
+ if test "$oci_header_found" = "yes" -a "$oci_lib_found" = "yes"; then
+
+ AC_SUBST([ORACLE_OCI_VERSION])
+ AC_SUBST([ORACLE_OCI_CFLAGS])
+ AC_SUBST([ORACLE_OCI_LDFLAGS])
+
+ HAVE_ORACLE_OCI="yes"
+ else
+ HAVE_ORACLE_OCI="no"
+ fi
+
+ AC_MSG_RESULT([$HAVE_ORACLE_OCI])
+])
diff --git a/m4/ax_lib_postgresql.m4 b/m4/ax_lib_postgresql.m4
new file mode 100644
index 0000000..4284229
--- /dev/null
+++ b/m4/ax_lib_postgresql.m4
@@ -0,0 +1,152 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lib_postgresql.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_POSTGRESQL([MINIMUM-VERSION])
+#
+# DESCRIPTION
+#
+# This macro provides tests of availability of PostgreSQL 'libpq' library
+# of particular version or newer.
+#
+# AX_LIB_POSTGRESQL macro takes only one argument which is optional. If
+# there is no required version passed, then macro does not run version
+# test.
+#
+# The --with-postgresql option takes one of three possible values:
+#
+# no - do not check for PostgreSQL client library
+#
+# yes - do check for PostgreSQL library in standard locations (pg_config
+# should be in the PATH)
+#
+# path - complete path to pg_config utility, use this option if pg_config
+# can't be found in the PATH
+#
+# This macro calls:
+#
+# AC_SUBST(POSTGRESQL_CFLAGS)
+# AC_SUBST(POSTGRESQL_LDFLAGS)
+# AC_SUBST(POSTGRESQL_VERSION)
+#
+# And sets:
+#
+# HAVE_POSTGRESQL
+#
+# LICENSE
+#
+# Copyright (c) 2008 Mateusz Loskot <mateusz@loskot.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_LIB_POSTGRESQL],
+[
+ AC_ARG_WITH([postgresql],
+ AC_HELP_STRING([--with-postgresql=@<:@ARG@:>@],
+ [use PostgreSQL library @<:@default=yes@:>@, optionally specify path to pg_config]
+ ),
+ [
+ if test "$withval" = "no"; then
+ want_postgresql="no"
+ elif test "$withval" = "yes"; then
+ want_postgresql="yes"
+ else
+ want_postgresql="yes"
+ PG_CONFIG="$withval"
+ fi
+ ],
+ [want_postgresql="yes"]
+ )
+
+ POSTGRESQL_CFLAGS=""
+ POSTGRESQL_LDFLAGS=""
+ POSTGRESQL_VERSION=""
+
+ dnl
+ dnl Check PostgreSQL libraries (libpq)
+ dnl
+
+ if test "$want_postgresql" = "yes"; then
+
+ if test -z "$PG_CONFIG" -o test; then
+ AC_PATH_PROG([PG_CONFIG], [pg_config], [])
+ fi
+
+ if test ! -x "$PG_CONFIG"; then
+ AC_MSG_ERROR([$PG_CONFIG does not exist or it is not an exectuable file])
+ PG_CONFIG="no"
+ found_postgresql="no"
+ fi
+
+ if test "$PG_CONFIG" != "no"; then
+ AC_MSG_CHECKING([for PostgreSQL libraries])
+
+ POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
+ POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq"
+
+ POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'`
+
+ AC_DEFINE([HAVE_POSTGRESQL], [1],
+ [Define to 1 if PostgreSQL libraries are available])
+
+ found_postgresql="yes"
+ AC_MSG_RESULT([yes])
+ else
+ found_postgresql="no"
+ AC_MSG_RESULT([no])
+ fi
+ fi
+
+ dnl
+ dnl Check if required version of PostgreSQL is available
+ dnl
+
+
+ postgresql_version_req=ifelse([$1], [], [], [$1])
+
+ if test "$found_postgresql" = "yes" -a -n "$postgresql_version_req"; then
+
+ AC_MSG_CHECKING([if PostgreSQL version is >= $postgresql_version_req])
+
+ dnl Decompose required version string of PostgreSQL
+ dnl and calculate its number representation
+ postgresql_version_req_major=`expr $postgresql_version_req : '\([[0-9]]*\)'`
+ postgresql_version_req_minor=`expr $postgresql_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
+ postgresql_version_req_micro=`expr $postgresql_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test "x$postgresql_version_req_micro" = "x"; then
+ postgresql_version_req_micro="0"
+ fi
+
+ postgresql_version_req_number=`expr $postgresql_version_req_major \* 1000000 \
+ \+ $postgresql_version_req_minor \* 1000 \
+ \+ $postgresql_version_req_micro`
+
+ dnl Decompose version string of installed PostgreSQL
+ dnl and calculate its number representation
+ postgresql_version_major=`expr $POSTGRESQL_VERSION : '\([[0-9]]*\)'`
+ postgresql_version_minor=`expr $POSTGRESQL_VERSION : '[[0-9]]*\.\([[0-9]]*\)'`
+ postgresql_version_micro=`expr $POSTGRESQL_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test "x$postgresql_version_micro" = "x"; then
+ postgresql_version_micro="0"
+ fi
+
+ postgresql_version_number=`expr $postgresql_version_major \* 1000000 \
+ \+ $postgresql_version_minor \* 1000 \
+ \+ $postgresql_version_micro`
+
+ postgresql_version_check=`expr $postgresql_version_number \>\= $postgresql_version_req_number`
+ if test "$postgresql_version_check" = "1"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+
+ AC_SUBST([POSTGRESQL_VERSION])
+ AC_SUBST([POSTGRESQL_CFLAGS])
+ AC_SUBST([POSTGRESQL_LDFLAGS])
+])
diff --git a/m4/ax_lib_sqlite3.m4 b/m4/ax_lib_sqlite3.m4
new file mode 100644
index 0000000..463d6c5
--- /dev/null
+++ b/m4/ax_lib_sqlite3.m4
@@ -0,0 +1,153 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lib_sqlite3.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_SQLITE3([MINIMUM-VERSION])
+#
+# DESCRIPTION
+#
+# Test for the SQLite 3 library of a particular version (or newer)
+#
+# This macro takes only one optional argument, required version of SQLite
+# 3 library. If required version is not passed, 3.0.0 is used in the test
+# of existance of SQLite 3.
+#
+# If no intallation prefix to the installed SQLite library is given the
+# macro searches under /usr, /usr/local, and /opt.
+#
+# This macro calls:
+#
+# AC_SUBST(SQLITE3_CFLAGS)
+# AC_SUBST(SQLITE3_LDFLAGS)
+# AC_SUBST(SQLITE3_VERSION)
+#
+# And sets:
+#
+# HAVE_SQLITE3
+#
+# LICENSE
+#
+# Copyright (c) 2008 Mateusz Loskot <mateusz@loskot.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_LIB_SQLITE3],
+[
+ AC_ARG_WITH([sqlite3],
+ AC_HELP_STRING(
+ [--with-sqlite3=@<:@ARG@:>@],
+ [use SQLite 3 library @<:@default=yes@:>@, optionally specify the prefix for sqlite3 library]
+ ),
+ [
+ if test "$withval" = "no"; then
+ WANT_SQLITE3="no"
+ elif test "$withval" = "yes"; then
+ WANT_SQLITE3="yes"
+ ac_sqlite3_path=""
+ else
+ WANT_SQLITE3="yes"
+ ac_sqlite3_path="$withval"
+ fi
+ ],
+ [WANT_SQLITE3="yes"]
+ )
+
+ SQLITE3_CFLAGS=""
+ SQLITE3_LDFLAGS=""
+ SQLITE3_VERSION=""
+
+ if test "x$WANT_SQLITE3" = "xyes"; then
+
+ ac_sqlite3_header="sqlite3.h"
+
+ sqlite3_version_req=ifelse([$1], [], [3.0.0], [$1])
+ sqlite3_version_req_shorten=`expr $sqlite3_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
+ sqlite3_version_req_major=`expr $sqlite3_version_req : '\([[0-9]]*\)'`
+ sqlite3_version_req_minor=`expr $sqlite3_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
+ sqlite3_version_req_micro=`expr $sqlite3_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test "x$sqlite3_version_req_micro" = "x" ; then
+ sqlite3_version_req_micro="0"
+ fi
+
+ sqlite3_version_req_number=`expr $sqlite3_version_req_major \* 1000000 \
+ \+ $sqlite3_version_req_minor \* 1000 \
+ \+ $sqlite3_version_req_micro`
+
+ AC_MSG_CHECKING([for SQLite3 library >= $sqlite3_version_req])
+
+ if test "$ac_sqlite3_path" != ""; then
+ ac_sqlite3_ldflags="-L$ac_sqlite3_path/lib"
+ ac_sqlite3_cppflags="-I$ac_sqlite3_path/include"
+ else
+ for ac_sqlite3_path_tmp in /usr /usr/local /opt ; do
+ if test -f "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header" \
+ && test -r "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header"; then
+ ac_sqlite3_path=$ac_sqlite3_path_tmp
+ ac_sqlite3_cppflags="-I$ac_sqlite3_path_tmp/include"
+ ac_sqlite3_ldflags="-L$ac_sqlite3_path_tmp/lib"
+ break;
+ fi
+ done
+ fi
+
+ ac_sqlite3_ldflags="$ac_sqlite3_ldflags -lsqlite3"
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $ac_sqlite3_cppflags"
+
+ AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM([[@%:@include <sqlite3.h>]],
+ [[
+#if (SQLITE_VERSION_NUMBER >= $sqlite3_version_req_number)
+// Everything is okay
+#else
+# error SQLite version is too old
+#endif
+ ]]
+ )
+ ],
+ [
+ AC_MSG_RESULT([yes])
+ success="yes"
+ ],
+ [
+ AC_MSG_RESULT([not found])
+ succees="no"
+ ]
+ )
+ AC_LANG_POP([C++])
+
+ CPPFLAGS="$saved_CPPFLAGS"
+
+ if test "$success" = "yes"; then
+
+ SQLITE3_CFLAGS="$ac_sqlite3_cppflags"
+ SQLITE3_LDFLAGS="$ac_sqlite3_ldflags"
+
+ ac_sqlite3_header_path="$ac_sqlite3_path/include/$ac_sqlite3_header"
+
+ dnl Retrieve SQLite release version
+ if test "x$ac_sqlite3_header_path" != "x"; then
+ ac_sqlite3_version=`cat $ac_sqlite3_header_path \
+ | grep '#define.*SQLITE_VERSION.*\"' | sed -e 's/.* "//' \
+ | sed -e 's/"//'`
+ if test $ac_sqlite3_version != ""; then
+ SQLITE3_VERSION=$ac_sqlite3_version
+ else
+ AC_MSG_WARN([Can not find SQLITE_VERSION macro in sqlite3.h header to retrieve SQLite version!])
+ fi
+ fi
+
+ AC_SUBST(SQLITE3_CFLAGS)
+ AC_SUBST(SQLITE3_LDFLAGS)
+ AC_SUBST(SQLITE3_VERSION)
+ AC_DEFINE([HAVE_SQLITE3], [], [Have the SQLITE3 library])
+ fi
+ fi
+])
diff --git a/m4/ax_lib_xerces.m4 b/m4/ax_lib_xerces.m4
new file mode 100644
index 0000000..9a8cf5c
--- /dev/null
+++ b/m4/ax_lib_xerces.m4
@@ -0,0 +1,286 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lib_xerces.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_XERCES([MINIMUM-VERSION])
+#
+# DESCRIPTION
+#
+# This macro provides tests of availability of Apache Xerces C++ Parser of
+# particular version or newer. This macros checks for Apache Xerces C++
+# Parser headers and libraries and defines compilation flags
+#
+# Macro supports following options and their values:
+#
+# 1) Single-option usage:
+#
+# --with-xerces - yes, no or path to Xerces installation prefix
+#
+# 2) Three-options usage (all options are required):
+#
+# --with-xerces=yes
+# --with-xerces-inc - path to base directory with Xerces headers
+# --with-xerces-lib - linker flags for Xerces
+#
+# This macro calls:
+#
+# AC_SUBST(XERCES_CFLAGS)
+# AC_SUBST(XERCES_LDFLAGS)
+# AC_SUBST(XERCES_VERSION) - only if version requirement is used
+#
+# And sets:
+#
+# HAVE_XERCES
+#
+# LICENSE
+#
+# Copyright (c) 2008 Mateusz Loskot <mateusz@loskot.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_LIB_XERCES],
+[
+ AC_REQUIRE([ACX_PTHREAD])
+
+ AC_ARG_WITH([xerces],
+ AC_HELP_STRING([--with-xerces=@<:@ARG@:>@],
+ [use Xerces C++ Parser from given prefix (ARG=path); check standard prefixes (ARG=yes); disable (ARG=no)]
+ ),
+ [
+ if test "$withval" = "yes"; then
+ if test -d /usr/local/include/xercesc ; then
+ xerces_prefix=/usr/local
+ elif test -d /usr/include/xercesc ; then
+ xerces_prefix=/usr
+ else
+ xerces_prefix=""
+ fi
+ xerces_requested="yes"
+ elif test -d "$withval"; then
+ xerces_prefix="$withval"
+ xerces_requested="yes"
+ else
+ xerces_prefix=""
+ xerces_requested="no"
+ fi
+ ],
+ [
+ dnl Default behavior is implicit yes
+ if test -d /usr/local/include/xercesc ; then
+ xerces_prefix=/usr/local
+ elif test -d /usr/include/xercesc ; then
+ xerces_prefix=/usr
+ else
+ xerces_prefix=""
+ fi
+ ]
+ )
+
+ AC_ARG_WITH([xerces-inc],
+ AC_HELP_STRING([--with-xerces-inc=@<:@DIR@:>@],
+ [path to Xerces C++ Parser headers]
+ ),
+ [xerces_include_dir="$withval"],
+ [xerces_include_dir=""]
+ )
+ AC_ARG_WITH([xerces-lib],
+ AC_HELP_STRING([--with-xerces-lib=@<:@ARG@:>@],
+ [link options for Xerces C++ Parser libraries]
+ ),
+ [xerces_ldflags="$withval"],
+ [xerces_ldflags=""]
+ )
+
+ XERCES_CPPFLAGS=""
+ XERCES_LDFLAGS=""
+ XERCES_VERSION=""
+
+ dnl
+ dnl Collect include/lib paths and flags
+ dnl
+ run_xerces_test="no"
+
+ if test -n "$xerces_prefix"; then
+ xerces_include_dir="$xerces_prefix/include"
+ xerces_include_dir2="$xerces_prefix/include/xercesc"
+ xerces_ldflags="-L$xerces_prefix/lib"
+ run_xerces_test="yes"
+ elif test "$xerces_requested" = "yes"; then
+ if test -n "$xerces_include_dir" -a -n "$xerces_lib_flags"; then
+ xerces_include_dir2="$xerces_include_dir/xercesc"
+ run_xerces_test="yes"
+ fi
+ else
+ run_xerces_test="no"
+ fi
+
+ xerces_libs="-lxerces-c"
+
+ dnl
+ dnl Check Xerces C++ Parser files
+ dnl
+ if test "$run_xerces_test" = "yes"; then
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$xerces_include_dir -I$xerces_include_dir2"
+
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $xerces_ldflags $PTHREAD_LDFLAGS"
+
+ saved_LIBS="$LIBS"
+ LIBS="$xerces_libs $PTHREAD_LIBS $LIBS"
+
+ dnl
+ dnl Check Xerces headers
+ dnl
+ AC_MSG_CHECKING([for Xerces C++ Parser headers in $xerces_include_dir and $xerces_include_dir2])
+
+ AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[
+@%:@include <xercesc/util/XercesDefs.hpp>
+@%:@include <xercesc/util/PlatformUtils.hpp>
+ ]],
+ [[]]
+ )],
+ [
+ XERCES_CPPFLAGS="-I$xerces_include_dir -I$xerces_include_dir2"
+ xerces_header_found="yes"
+ AC_MSG_RESULT([found])
+ ],
+ [
+ xerces_header_found="no"
+ AC_MSG_RESULT([not found])
+ ]
+ )
+ AC_LANG_POP([C++])
+
+ dnl
+ dnl Check Xerces libraries
+ dnl
+ if test "$xerces_header_found" = "yes"; then
+
+ AC_MSG_CHECKING([for Xerces C++ Parser libraries])
+
+ AC_LANG_PUSH([C++])
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM(
+ [[
+@%:@include <xercesc/util/XercesDefs.hpp>
+@%:@include <xercesc/util/PlatformUtils.hpp>
+#if (_XERCES_VERSION >= 20200)
+XERCES_CPP_NAMESPACE_USE
+#endif
+ ]],
+ [[
+XMLPlatformUtils::Initialize();
+ ]]
+ )],
+ [
+ XERCES_LDFLAGS="$xerces_ldflags $PTHREAD_LDFLAGS"
+ XERCES_LIBS="$xerces_libs $PTHREAD_LIBS"
+ xerces_lib_found="yes"
+ AC_MSG_RESULT([found])
+ ],
+ [
+ xerces_lib_found="no"
+ AC_MSG_RESULT([not found])
+ ]
+ )
+ AC_LANG_POP([C++])
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ LIBS="$saved_LIBS"
+ fi
+
+ AC_MSG_CHECKING([for Xerces C++ Parser])
+
+ if test "$run_xerces_test" = "yes"; then
+ if test "$xerces_header_found" = "yes" -a "$xerces_lib_found" = "yes"; then
+
+ AC_SUBST([XERCES_CPPFLAGS])
+ AC_SUBST([XERCES_LDFLAGS])
+ AC_SUBST([XERCES_LIBS])
+
+ HAVE_XERCES="yes"
+ else
+ HAVE_XERCES="no"
+ fi
+
+ AC_MSG_RESULT([$HAVE_XERCES])
+
+ dnl
+ dnl Check Xerces version
+ dnl
+ if test "$HAVE_XERCES" = "yes"; then
+
+ xerces_version_req=ifelse([$1], [], [], [$1])
+
+ if test -n "$xerces_version_req"; then
+
+ AC_MSG_CHECKING([if Xerces C++ Parser version is >= $xerces_version_req])
+
+ if test -f "$xerces_include_dir2/util/XercesVersion.hpp"; then
+
+ xerces_major=`cat $xerces_include_dir2/util/XercesVersion.hpp | \
+ grep '^#define.*XERCES_VERSION_MAJOR.*[0-9]$' | \
+ sed -e 's/#define XERCES_VERSION_MAJOR.//'`
+
+ xerces_minor=`cat $xerces_include_dir2/util/XercesVersion.hpp | \
+ grep '^#define.*XERCES_VERSION_MINOR.*[0-9]$' | \
+ sed -e 's/#define XERCES_VERSION_MINOR.//'`
+
+ xerces_revision=`cat $xerces_include_dir2/util/XercesVersion.hpp | \
+ grep '^#define.*XERCES_VERSION_REVISION.*[0-9]$' | \
+ sed -e 's/#define XERCES_VERSION_REVISION.//'`
+
+ XERCES_VERSION="$xerces_major.$xerces_minor.$xerces_revision"
+ AC_SUBST([XERCES_VERSION])
+
+ dnl Decompose required version string and calculate numerical representation
+ xerces_version_req_major=`expr $xerces_version_req : '\([[0-9]]*\)'`
+ xerces_version_req_minor=`expr $xerces_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
+ xerces_version_req_revision=`expr $xerces_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test "x$xerces_version_req_revision" = "x"; then
+ xerces_version_req_revision="0"
+ fi
+
+ xerces_version_req_number=`expr $xerces_version_req_major \* 10000 \
+ \+ $xerces_version_req_minor \* 100 \
+ \+ $xerces_version_req_revision`
+
+ dnl Calculate numerical representation of detected version
+ xerces_version_number=`expr $xerces_major \* 10000 \
+ \+ $xerces_minor \* 100 \
+ \+ $xerces_revision`
+
+ xerces_version_check=`expr $xerces_version_number \>\= $xerces_version_req_number`
+ if test "$xerces_version_check" = "1"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([Found Xerces C++ Parser $XERCES_VERSION, which is older than required. Possible compilation failure.])
+ fi
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([Missing header XercesVersion.hpp. Unable to determine Xerces version.])
+ fi
+ fi
+ fi
+
+ else
+ HAVE_XERCES="no"
+ AC_MSG_RESULT([$HAVE_XERCES])
+
+ if test "$xerces_requested" = "yes"; then
+ AC_MSG_WARN([Xerces C++ Parser support requested but headers or library not found. Specify valid prefix of Xerces C++ using --with-xerces=@<:@DIR@:>@ or provide include directory and linker flags using --with-xerces-inc and --with-xerces-lib])
+ fi
+ fi
+])
diff --git a/m4/ax_lib_xml_security.m4 b/m4/ax_lib_xml_security.m4
new file mode 100644
index 0000000..a792159
--- /dev/null
+++ b/m4/ax_lib_xml_security.m4
@@ -0,0 +1,274 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lib_xml_security.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_XML_SECURITY([MINIMUM-VERSION])
+#
+# DESCRIPTION
+#
+# This macro provides tests of availability of Apache Xml-Security C++
+# library <http://santuario.apache.org/index.html> of particular version
+# or newer. This macros checks for Apache Xml-Security C++ headers and
+# libraries and defines compilation flags
+#
+# Macro supports following options and their values:
+#
+# 1) Single-option usage:
+#
+# --with-xml-security - yes, no or path to Xml-Security installation prefix
+#
+# 2) Three-options usage (all options are required):
+#
+# --with-xml-security=yes
+# --with-xml-security-inc - path to base directory with Xml-Security headers
+# --with-xml-security-lib - linker flags for Xml-Security
+#
+# This macro calls:
+#
+# AC_SUBST(XML_SECURITY_CFLAGS)
+# AC_SUBST(XML_SECURITY_LDFLAGS)
+# AC_SUBST(XML_SECURITY_VERSION) - only if version requirement is used
+#
+# And sets:
+#
+# HAVE_XML_SECURITY
+#
+# LICENSE
+#
+# Copyright (c) 2008 Alexander Petry <petry@itwm.fhg.de>
+# Copyright (c) 2008 Mateusz Loskot <mateusz@loskot.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_LIB_XML_SECURITY],
+[
+ AC_ARG_WITH([xml-security],
+ AC_HELP_STRING([--with-xml-security=@<:@ARG@:>@],
+ [use Xml-Security C++ library from given prefix (ARG=path); check standard prefixes (ARG=yes); disable (ARG=no)]
+ ),
+ [
+ if test "$withval" = "yes"; then
+ if test -d /usr/local/include/xsec ; then
+ xml_security_prefix=/usr/local
+ elif test -d /usr/include/xsec ; then
+ xml_security_prefix=/usr
+ else
+ xml_security_prefix=""
+ fi
+ xml_security_requested="yes"
+ elif test -d "$withval"; then
+ xml_security_prefix="$withval"
+ xml_security_requested="yes"
+ else
+ xml_security_prefix=""
+ xml_security_requested="no"
+ fi
+ ],
+ [
+ dnl Default behavior is implicit yes
+ if test -d /usr/local/include/xsec ; then
+ xml_security_prefix=/usr/local
+ elif test -d /usr/include/xsec ; then
+ xml_security_prefix=/usr
+ else
+ xml-security_prefix=""
+ fi
+ ]
+ )
+
+ AC_ARG_WITH([xml-security-inc],
+ AC_HELP_STRING([--with-xml-security-inc=@<:@DIR@:>@],
+ [path to Xml-Security C++ headers]
+ ),
+ [xml_security_include_dir="$withval"],
+ [xml_security_include_dir=""]
+ )
+ AC_ARG_WITH([xml-security-lib],
+ AC_HELP_STRING([--with-xml-security-lib=@<:@ARG@:>@],
+ [link options for Xml-Security C++ Parser libraries]
+ ),
+ [xml_security_lib_flags="$withval"],
+ [xml_security_lib_flags=""]
+ )
+
+ XML_SECURITY_CFLAGS=""
+ XML_SECURITY_LDFLAGS=""
+ XML_SECURITY_VERSION=""
+
+ dnl
+ dnl Collect include/lib paths and flags
+ dnl
+ run_xml_security_test="no"
+
+ if test -n "$xml_security_prefix"; then
+ xml_security_include_dir="$xml_security_prefix/include"
+ xml_security_include_dir2="$xml_security_prefix/include/xsec"
+ xml_security_lib_flags="-L$xml_security_prefix/lib -lxml-security-c -lpthread"
+ run_xml_security_test="yes"
+ elif test "$xml_security_requested" = "yes"; then
+ if test -n "$xml_security_include_dir" -a -n "$xml_security_lib_flags"; then
+ xml_security_include_dir2="$xml_security_include_dir/xenc"
+ run_xml_security_test="yes"
+ fi
+ else
+ run_xml_security_test="no"
+ fi
+
+ dnl
+ dnl Check Xml-Security C++ files
+ dnl
+ if test "$run_xml_security_test" = "yes"; then
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$xml_security_include_dir -I$xml_security_include_dir2"
+
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $xml_security_lib_flags"
+
+ dnl
+ dnl Check Xml-Security headers
+ dnl
+ AC_MSG_CHECKING([for Xml-Security C++ headers in $xml_security_include_dir and $xml_security_include_dir2])
+
+ AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[
+ @%:@include <xsec/utils/XSECPlatformUtils.hpp>
+ ]],
+ [[
+ ]]
+ )],
+ [
+ XML_SECURITY_CFLAGS="-I$xml_security_include_dir -I$xml_security_include_dir2"
+ xml_security_header_found="yes"
+ AC_MSG_RESULT([found])
+ ],
+ [
+ xml_security_header_found="no"
+ AC_MSG_RESULT([not found])
+ ]
+ )
+ AC_LANG_POP([C++])
+
+ dnl
+ dnl Check Xml-Security libraries
+ dnl
+ if test "$xml_security_header_found" = "yes"; then
+
+ AC_MSG_CHECKING([for Xml-Security C++ libraries])
+
+ AC_LANG_PUSH([C++])
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM(
+ [[
+@%:@include <xsec/utils/XSECPlatformUtils.hpp>
+#ifdef XERCES_CPP_NAMESPACE_USE
+XERCES_CPP_NAMESPACE_USE
+#endif
+ ]],
+ [[
+XSECPlatformUtils::Initialise();
+ ]]
+ )],
+ [
+ XML_SECURITY_LDFLAGS="$xml_security_lib_flags"
+ xml_security_lib_found="yes"
+ AC_MSG_RESULT([found])
+ ],
+ [
+ xml_security_lib_found="no"
+ AC_MSG_RESULT([not found])
+ ]
+ )
+ AC_LANG_POP([C++])
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ fi
+
+ AC_MSG_CHECKING([for Xml-Security C++])
+
+ if test "$run_xml_security_test" = "yes"; then
+ if test x"$xml_security_header_found" = x"yes" -a x"$xml_security_lib_found" = x"yes"; then
+
+ AC_SUBST([XML_SECURITY_CFLAGS])
+ AC_SUBST([XML_SECURITY_LDFLAGS])
+
+ HAVE_XML_SECURITY="yes"
+ else
+ HAVE_XML_SECURITY="no"
+ fi
+
+ AC_MSG_RESULT([$HAVE_XML_SECURITY])
+
+ dnl
+ dnl Check Xml-Security version
+ dnl
+ if test "$HAVE_XML_SECURITY" = "yes"; then
+
+ xml_security_version_req=ifelse([$1], [], [], [$1])
+
+ if test -n "$xml_security_version_req"; then
+
+ AC_MSG_CHECKING([if Xml-Security C++ version is >= $xml_security_version_req])
+
+ if test -f "$xml_security_include_dir2/framework/XSECConfig.hpp"; then
+
+ xml_security_major=`cat $xml_security_include_dir2/framework/XSECConfig.hpp | \
+ grep '^#define.*XSEC_VERSION_MAJOR.*[0-9]$' | \
+ sed -e 's/#define XSEC_VERSION_MAJOR.//'`
+
+ xml_security_medium=`cat $xml_security_include_dir2/framework/XSECConfig.hpp | \
+ grep '^#define.*XSEC_VERSION_MEDIUM.*[0-9]$' | \
+ sed -e 's/#define XSEC_VERSION_MEDIUM.//'`
+
+ xml_security_minor=`cat $xml_security_include_dir2/framework/XSECConfig.hpp | \
+ grep '^#define.*XSEC_VERSION_MINOR.*[0-9]$' | \
+ sed -e 's/#define XSEC_VERSION_MINOR.//'`
+
+ XML_SECURITY_VERSION="$xml_security_major.$xml_security_medium.$xml_security_minor"
+ AC_SUBST([XML_SECURITY_VERSION])
+
+ dnl Decompose required version string and calculate numerical representation
+ xml_security_version_req_major=`expr $xml_security_version_req : '\([[0-9]]*\)'`
+ xml_security_version_req_medium=`expr $xml_security_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
+ xml_security_version_req_minor=`expr $xml_security_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+
+ xml_security_version_req_number=`expr $xml_security_version_req_major \* 10000 \
+ \+ $xml_security_version_req_medium \* 100 \
+ \+ $xml_security_version_req_minor`
+
+ dnl Calculate numerical representation of detected version
+ xml_security_version_number=`expr $xml_security_major \* 10000 \
+ \+ $xml_security_medium \* 100 \
+ \+ $xml_security_minor`
+
+ xml_security_version_check=`expr $xml_security_version_number \>\= $xml_security_version_req_number`
+ if test "$xml_security_version_check" = "1"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([Found Xml-Security C++ $XML_SECURITY_VERSION, which is older than required. Possible compilation failure.])
+ fi
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([Missing header XSECConfig.hpp. Unable to determine Xml-Security version.])
+ fi
+ fi
+ fi
+
+ else
+ HAVE_XML_SECURITY="no"
+ AC_MSG_RESULT([$HAVE_XML_SECURITY])
+
+ if test "$xml_security_requested" = "yes"; then
+ AC_MSG_ERROR([Xml-Security C++ support requested but headers or library not found. Specify valid prefix of Xml-Security C++ using --with-xml-security=@<:@DIR@:>@ or provide headers and linker flags using --with-xml-security-inc and --with-xml-security-lib])
+ fi
+ fi
+])
diff --git a/m4/ax_llvm.m4 b/m4/ax_llvm.m4
new file mode 100644
index 0000000..6023cda
--- /dev/null
+++ b/m4/ax_llvm.m4
@@ -0,0 +1,90 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_llvm.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LLVM([llvm-libs])
+#
+# DESCRIPTION
+#
+# Test for the existance of llvm, and make sure that it can be linked with
+# the llvm-libs argument that is passed on to llvm-config i.e.:
+#
+# llvm --libs <llvm-libs>
+#
+# llvm-config will also include any libraries that are depended apon.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Andy Kitchen <agimbleinthewabe@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_LLVM],
+[
+AC_ARG_WITH([llvm],
+ AS_HELP_STRING([--with-llvm@<:@=DIR@:>@], [use llvm (default is yes) - it is possible to specify the root directory for llvm (optional)]),
+ [
+ if test "$withval" = "no"; then
+ want_llvm="no"
+ elif test "$withval" = "yes"; then
+ want_llvm="yes"
+ ac_llvm_config_path=`which llvm-config`
+ else
+ want_llvm="yes"
+ ac_llvm_config_path="$withval"
+ fi
+ ],
+ [want_llvm="yes"])
+
+ succeeded=no
+ if test -z "$ac_llvm_config_path"; then
+ ac_llvm_config_path=`which llvm-config`
+ fi
+
+ if test "x$want_llvm" = "xyes"; then
+ if test -e "$ac_llvm_config_path"; then
+ LLVM_CPPFLAGS=`$ac_llvm_config_path --cxxflags`
+ LLVM_LDFLAGS="$($ac_llvm_config_path --ldflags) $($ac_llvm_config_path --libs $1)"
+
+ AC_REQUIRE([AC_PROG_CXX])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $LLVM_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $LLVM_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(can compile with and link with llvm([$1]),
+ ax_cv_llvm,
+ [AC_LANG_PUSH([C++])
+ AC_LINK_IFELSE(AC_LANG_PROGRAM([[@%:@include <llvm/Module.h>
+ ]],
+ [[llvm::Module *M = new llvm::Module("test"); return 0;]]),
+ ax_cv_llvm=yes, ax_cv_llvm=no)
+ AC_LANG_POP([C++])
+ ])
+
+ if test "x$ax_cv_llvm" = "xyes"; then
+ succeeded=yes
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ else
+ succeeded=no
+ fi
+ fi
+
+ if test "$succeeded" != "yes" ; then
+ AC_MSG_ERROR([[We could not detect the llvm libraries make sure that llvm-config is on your path or specified by --with-llvm.]])
+ else
+ AC_SUBST(LLVM_CPPFLAGS)
+ AC_SUBST(LLVM_LDFLAGS)
+ AC_DEFINE(HAVE_LLVM,,[define if the llvm library is available])
+ fi
+])
diff --git a/m4/ax_maintainer_mode_auto_silent.m4 b/m4/ax_maintainer_mode_auto_silent.m4
new file mode 100644
index 0000000..14c750f
--- /dev/null
+++ b/m4/ax_maintainer_mode_auto_silent.m4
@@ -0,0 +1,69 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_maintainer_mode_auto_silent.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_MAINTAINER_MODE_AUTO_SILENT
+#
+# DESCRIPTION
+#
+# Set autotools to error/sleep settings so that they are not run when
+# being errornously triggered. Likewise make libtool-silent when libtool
+# has been used.
+#
+# I am using the macro quite a lot since some automake versions had the
+# tendency to try to rerun some autotools on a mere make even when not
+# quite in --maintainer-mode. That is very annoying. Likewise, a user who
+# installs from source does not want to see doubled compiler messages.
+#
+# I did not put an AC-REQUIRE(MAINTAINER_MODE) in here - should I?
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_MAINTAINER_MODE_AUTO_SILENT],[dnl
+dnl ac_REQUIRE([am_MAINTAINER_MODE])dn
+AC_MSG_CHECKING(auto silent in maintainer mode)
+if test "$USE_MAINTAINER_MODE" = "no" ; then
+ test ".$TIMEOUT" = "." && TIMEOUT="9"
+ AUTOHEADER="sleep $TIMEOUT ; true || autoheader || skipped"
+ AUTOMAKE="sleep $TIMEOUT ; true || automake || skipped"
+ AUTOCONF="sleep $TIMEOUT ; true || autoconf || skipped"
+ if test ".$LIBTOOL" != "." ; then
+ LIBTOOL="$LIBTOOL --silent"
+ AC_MSG_RESULT([libtool-silent, auto-sleep-9])
+ else
+ AC_MSG_RESULT([auto-sleep-9])
+ fi
+else
+ AC_MSG_RESULT([no])
+fi
+])
diff --git a/m4/ax_missing_prog.m4 b/m4/ax_missing_prog.m4
new file mode 100644
index 0000000..7e2e49f
--- /dev/null
+++ b/m4/ax_missing_prog.m4
@@ -0,0 +1,58 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_missing_prog.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_MISSING_PROG(VARIABLE,PROGRAM,[MESSAGE])
+#
+# DESCRIPTION
+#
+# Simple wrapper for the AM_MISSING_PROG which displays a warning MESSAGE
+# if provided. A typical use is the following:
+#
+# AC_PROG_AWK
+# AS_IF([test -z "$AWK"],[
+# AX_MISSING_PROG(AWK,[awk],[awk seems missing ...])
+# ])
+#
+# Programs wrapped with AX_MISSING_PROG should be used only in the package
+# building phase (because they will be wrapped with the automake 'missing'
+# script, which will not be installed).
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_MISSING_PROG],[dnl
+ AS_IF([ test ! -z "$3" ],[
+ AC_MSG_WARN([$3])
+ ])
+ AM_MISSING_PROG([$1],[$2])
+])
diff --git a/m4/ax_need_awk.m4 b/m4/ax_need_awk.m4
new file mode 100644
index 0000000..c78e66b
--- /dev/null
+++ b/m4/ax_need_awk.m4
@@ -0,0 +1,33 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_need_awk.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_NEED_AWK
+#
+# DESCRIPTION
+#
+# Check if an awk implementation is available. Bail-out if not found.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_NEED_AWK],[
+ AC_REQUIRE([AC_PROG_AWK])
+
+ AS_IF([test "x$AWK" = "x"],[
+ AC_MSG_ERROR([cannot find awk, bailing out])
+ ])
+])
diff --git a/m4/ax_not_enable_frame_pointer.m4 b/m4/ax_not_enable_frame_pointer.m4
new file mode 100644
index 0000000..2b984b1
--- /dev/null
+++ b/m4/ax_not_enable_frame_pointer.m4
@@ -0,0 +1,64 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_not_enable_frame_pointer.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_NOT_ENABLE_FRAME_POINTER ([shellvar])
+#
+# DESCRIPTION
+#
+# add --enable-frame-pointer option, the default will add the gcc
+# -fomit-frame-pointer option to the shellvar (per default CFLAGS) and
+# remove the " -g " debuginfo option from it. In other words, the default
+# is "--disable-frame-pointer"
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_NOT_ENABLE_FRAME_POINTER],[dnl
+AS_VAR_PUSHDEF([VAR],[enable_frame_pointer])dnl
+AC_MSG_CHECKING([m4_ifval($1,$1,CFLAGS) frame-pointer])
+AC_ARG_ENABLE([frame-pointer], AC_HELP_STRING(
+ [--enable-frame-pointer],[enable callframe generation for debugging]))
+case ".$VAR" in
+ .|.no|.no,*) test ".$VAR" = "." && VAR="no"
+ m4_ifval($1,$1,CFLAGS)=`echo dnl
+ " $m4_ifval($1,$1,CFLAGS) " | sed -e 's/ -g / /'`
+ if test ".$GCC" = ".yes" ; then
+ m4_ifval($1,$1,CFLAGS)="$m4_ifval($1,$1,CFLAGS) -fomit-frame-pointer"
+ AC_MSG_RESULT([$VAR, -fomit-frame-pointer added])
+ else
+ AC_MSG_RESULT([$VAR, -g removed])
+ fi ;;
+ *) AC_MSG_RESULT([$VAR, kept]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+])
diff --git a/m4/ax_openmp.m4 b/m4/ax_openmp.m4
new file mode 100644
index 0000000..b534bbb
--- /dev/null
+++ b/m4/ax_openmp.m4
@@ -0,0 +1,97 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_openmp.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_OPENMP([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro tries to find out how to compile programs that use OpenMP a
+# standard API and set of compiler directives for parallel programming
+# (see http://www-unix.mcs/)
+#
+# On success, it sets the OPENMP_CFLAGS/OPENMP_CXXFLAGS/OPENMP_F77FLAGS
+# output variable to the flag (e.g. -omp) used both to compile *and* link
+# OpenMP programs in the current language.
+#
+# NOTE: You are assumed to not only compile your program with these flags,
+# but also link it with them as well.
+#
+# If you want to compile everything with OpenMP, you should set:
+#
+# CFLAGS="$CFLAGS $OPENMP_CFLAGS"
+# #OR# CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"
+# #OR# FFLAGS="$FFLAGS $OPENMP_FFLAGS"
+#
+# (depending on the selected language).
+#
+# The user can override the default choice by setting the corresponding
+# environment variable (e.g. OPENMP_CFLAGS).
+#
+# ACTION-IF-FOUND is a list of shell commands to run if an OpenMP flag is
+# found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is
+# not found. If ACTION-IF-FOUND is not specified, the default action will
+# define HAVE_OPENMP.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_OPENMP], [
+AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
+
+AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
+ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown
+# Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI),
+# -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none
+ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none"
+if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then
+ ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags"
+fi
+for ax_openmp_flag in $ax_openmp_flags; do
+ case $ax_openmp_flag in
+ none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;;
+ *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;;
+ esac
+ AC_TRY_LINK_FUNC(omp_set_num_threads,
+ [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break])
+done
+[]_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS
+])
+if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then
+ m4_default([$2],:)
+else
+ if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" != "xnone"; then
+ OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ax_cv_[]_AC_LANG_ABBREV[]_openmp
+ fi
+ m4_default([$1], [AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])])
+fi
+])dnl AX_OPENMP
diff --git a/m4/ax_path_bdb.m4 b/m4/ax_path_bdb.m4
new file mode 100644
index 0000000..4f6b75e
--- /dev/null
+++ b/m4/ax_path_bdb.m4
@@ -0,0 +1,588 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_path_bdb.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PATH_BDB([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro finds the latest version of Berkeley DB on the system, and
+# ensures that the header file and library versions match. If
+# MINIMUM-VERSION is specified, it will ensure that the library found is
+# at least that version.
+#
+# It determines the name of the library as well as the path to the header
+# file and library. It will check both the default environment as well as
+# the default Berkeley DB install location. When found, it sets BDB_LIBS,
+# BDB_CPPFLAGS, and BDB_LDFLAGS to the necessary values to add to LIBS,
+# CPPFLAGS, and LDFLAGS, as well as setting BDB_VERSION to the version
+# found. HAVE_DB_H is defined also.
+#
+# The option --with-bdb-dir=DIR can be used to specify a specific Berkeley
+# DB installation to use.
+#
+# An example of it's use is:
+#
+# AX_PATH_BDB([3],[
+# LIBS="$BDB_LIBS $LIBS"
+# LDFLAGS="$BDB_LDFLAGS $LDFLAGS"
+# CPPFLAGS="$CPPFLAGS $BDB_CPPFLAGS"
+# ])
+#
+# which will locate the latest version of Berkeley DB on the system, and
+# ensure that it is version 3.0 or higher.
+#
+# Details: This macro does not use either AC_CHECK_HEADERS or AC_CHECK_LIB
+# because, first, the functions inside the library are sometimes renamed
+# to contain a version code that is only available from the db.h on the
+# system, and second, because it is common to have multiple db.h and libdb
+# files on a system it is important to make sure the ones being used
+# correspond to the same version. Additionally, there are many different
+# possible names for libdb when installed by an OS distribution, and these
+# need to be checked if db.h does not correspond to libdb.
+#
+# When cross compiling, only header versions are verified since it would
+# be difficult to check the library version. Additionally the default
+# Berkeley DB installation locations /usr/local/BerkeleyDB* are not
+# searched for higher versions of the library.
+#
+# The format for the list of library names to search came from the Cyrus
+# IMAP distribution, although they are generated dynamically here, and
+# only for the version found in db.h.
+#
+# The macro AX_COMPARE_VERSION is required to use this macro, and should
+# be available from the Autoconf Macro Archive.
+#
+# The author would like to acknowledge the generous and valuable feedback
+# from Guido Draheim, without which this macro would be far less robust,
+# and have poor and inconsistent cross compilation support.
+#
+# Changes:
+#
+# 1/5/05 applied patch from Rafa Rzepecki to eliminate compiler
+# warning about unused variable, argv
+#
+# LICENSE
+#
+# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+dnl #########################################################################
+AC_DEFUN([AX_PATH_BDB], [
+ dnl # Used to indicate success or failure of this function.
+ ax_path_bdb_ok=no
+
+ # Add --with-bdb-dir option to configure.
+ AC_ARG_WITH([bdb-dir],
+ [AC_HELP_STRING([--with-bdb-dir=DIR],
+ [Berkeley DB installation directory])])
+
+ # Check if --with-bdb-dir was specified.
+ if test "x$with_bdb_dir" = "x" ; then
+ # No option specified, so just search the system.
+ AX_PATH_BDB_NO_OPTIONS([$1], [HIGHEST], [
+ ax_path_bdb_ok=yes
+ ])
+ else
+ # Set --with-bdb-dir option.
+ ax_path_bdb_INC="$with_bdb_dir/include"
+ ax_path_bdb_LIB="$with_bdb_dir/lib"
+
+ dnl # Save previous environment, and modify with new stuff.
+ ax_path_bdb_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="-I$ax_path_bdb_INC $CPPFLAGS"
+
+ ax_path_bdb_save_LDFLAGS=$LDFLAGS
+ LDFLAGS="-L$ax_path_bdb_LIB $LDFLAGS"
+
+ # Check for specific header file db.h
+ AC_MSG_CHECKING([db.h presence in $ax_path_bdb_INC])
+ if test -f "$ax_path_bdb_INC/db.h" ; then
+ AC_MSG_RESULT([yes])
+ # Check for library
+ AX_PATH_BDB_NO_OPTIONS([$1], [ENVONLY], [
+ ax_path_bdb_ok=yes
+ BDB_CPPFLAGS="-I$ax_path_bdb_INC"
+ BDB_LDFLAGS="-L$ax_path_bdb_LIB"
+ ])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_NOTICE([no usable Berkeley DB not found])
+ fi
+
+ dnl # Restore the environment.
+ CPPFLAGS="$ax_path_bdb_save_CPPFLAGS"
+ LDFLAGS="$ax_path_bdb_save_LDFLAGS"
+
+ fi
+
+ dnl # Execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND.
+ if test "$ax_path_bdb_ok" = "yes" ; then
+ m4_ifvaln([$2],[$2],[:])dnl
+ m4_ifvaln([$3],[else $3])dnl
+ fi
+
+]) dnl AX_PATH_BDB
+
+dnl #########################################################################
+dnl Check for berkeley DB of at least MINIMUM-VERSION on system.
+dnl
+dnl The OPTION argument determines how the checks occur, and can be one of:
+dnl
+dnl HIGHEST - Check both the environment and the default installation
+dnl directories for Berkeley DB and choose the version that
+dnl is highest. (default)
+dnl ENVFIRST - Check the environment first, and if no satisfactory
+dnl library is found there check the default installation
+dnl directories for Berkeley DB which is /usr/local/BerkeleyDB*
+dnl ENVONLY - Check the current environment only.
+dnl
+dnl Requires AX_PATH_BDB_PATH_GET_VERSION, AX_PATH_BDB_PATH_FIND_HIGHEST,
+dnl AX_PATH_BDB_ENV_CONFIRM_LIB, AX_PATH_BDB_ENV_GET_VERSION, and
+dnl AX_COMPARE_VERSION macros.
+dnl
+dnl Result: sets ax_path_bdb_no_options_ok to yes or no
+dnl sets BDB_LIBS, BDB_CPPFLAGS, BDB_LDFLAGS, BDB_VERSION
+dnl
+dnl AX_PATH_BDB_NO_OPTIONS([MINIMUM-VERSION], [OPTION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+AC_DEFUN([AX_PATH_BDB_NO_OPTIONS], [
+ dnl # Used to indicate success or failure of this function.
+ ax_path_bdb_no_options_ok=no
+
+ # Values to add to environment to use Berkeley DB.
+ BDB_VERSION=''
+ BDB_LIBS=''
+ BDB_CPPFLAGS=''
+ BDB_LDFLAGS=''
+
+ # Check cross compilation here.
+ if test "x$cross_compiling" = "xyes" ; then
+ # If cross compiling, can't use AC_RUN_IFELSE so do these tests.
+ # The AC_PREPROC_IFELSE confirms that db.h is preprocessable,
+ # and extracts the version number from it.
+ AC_MSG_CHECKING([for db.h])
+
+ AS_VAR_PUSHDEF([HEADER_VERSION],[ax_path_bdb_no_options_HEADER_VERSION])dnl
+ HEADER_VERSION=''
+ AC_PREPROC_IFELSE([
+ AC_LANG_SOURCE([[
+#include <db.h>
+AX_PATH_BDB_STUFF DB_VERSION_MAJOR,DB_VERSION_MINOR,DB_VERSION_PATCH
+ ]])
+ ],[
+ # Extract version from preprocessor output.
+ HEADER_VERSION=`eval "$ac_cpp conftest.$ac_ext" 2> /dev/null \
+ | grep AX_PATH_BDB_STUFF | sed 's/[[^0-9,]]//g;s/,/./g;1q'`
+ ],[])
+
+ if test "x$HEADER_VERSION" = "x" ; then
+ AC_MSG_RESULT([no])
+ else
+ AC_MSG_RESULT([$HEADER_VERSION])
+
+ # Check that version is high enough.
+ AX_COMPARE_VERSION([$HEADER_VERSION],[ge],[$1],[
+ # get major and minor version numbers
+ AS_VAR_PUSHDEF([MAJ],[ax_path_bdb_no_options_MAJOR])dnl
+ MAJ=`echo $HEADER_VERSION | sed 's,\..*,,'`
+ AS_VAR_PUSHDEF([MIN],[ax_path_bdb_no_options_MINOR])dnl
+ MIN=`echo $HEADER_VERSION | sed 's,^[[0-9]]*\.,,;s,\.[[0-9]]*$,,'`
+
+ dnl # Save LIBS.
+ ax_path_bdb_no_options_save_LIBS="$LIBS"
+
+ # Check that we can link with the library.
+ AC_SEARCH_LIBS([db_version],
+ [db db-$MAJ.$MIN db$MAJ.$MIN db$MAJ$MIN db-$MAJ db$MAJ],[
+ # Sucessfully found library.
+ ax_path_bdb_no_options_ok=yes
+ BDB_VERSION=$HEADER_VERSION
+
+ # Extract library from LIBS
+ ax_path_bdb_no_options_LEN=` \
+ echo "x$ax_path_bdb_no_options_save_LIBS" \
+ | awk '{print(length)}'`
+ BDB_LIBS=`echo "x$LIBS " \
+ | sed "s/.\{$ax_path_bdb_no_options_LEN\}\$//;s/^x//;s/ //g"`
+ ],[])
+
+ dnl # Restore LIBS
+ LIBS="$ax_path_bdb_no_options_save_LIBS"
+
+ AS_VAR_POPDEF([MAJ])dnl
+ AS_VAR_POPDEF([MIN])dnl
+ ])
+ fi
+
+ AS_VAR_POPDEF([HEADER_VERSION])dnl
+ else
+ # Not cross compiling.
+ # Check version of Berkeley DB in the current environment.
+ AX_PATH_BDB_ENV_GET_VERSION([
+ AX_COMPARE_VERSION([$ax_path_bdb_env_get_version_VERSION],[ge],[$1],[
+ # Found acceptable version in current environment.
+ ax_path_bdb_no_options_ok=yes
+ BDB_VERSION="$ax_path_bdb_env_get_version_VERSION"
+ BDB_LIBS="$ax_path_bdb_env_get_version_LIBS"
+ ])
+ ])
+
+ # Determine if we need to search /usr/local/BerkeleyDB*
+ ax_path_bdb_no_options_DONE=no
+ if test "x$2" = "xENVONLY" ; then
+ ax_path_bdb_no_options_DONE=yes
+ elif test "x$2" = "xENVFIRST" ; then
+ ax_path_bdb_no_options_DONE=$ax_path_bdb_no_options_ok
+ fi
+
+ if test "$ax_path_bdb_no_options_DONE" = "no" ; then
+ # Check for highest in /usr/local/BerkeleyDB*
+ AX_PATH_BDB_PATH_FIND_HIGHEST([
+ if test "$ax_path_bdb_no_options_ok" = "yes" ; then
+ # If we already have an acceptable version use this if higher.
+ AX_COMPARE_VERSION(
+ [$ax_path_bdb_path_find_highest_VERSION],[gt],[$BDB_VERSION])
+ else
+ # Since we didn't have an acceptable version check if this one is.
+ AX_COMPARE_VERSION(
+ [$ax_path_bdb_path_find_highest_VERSION],[ge],[$1])
+ fi
+ ])
+
+ dnl # If result from _AX_COMPARE_VERSION is true we want this version.
+ if test "$ax_compare_version" = "true" ; then
+ ax_path_bdb_no_options_ok=yes
+ BDB_LIBS="-ldb"
+ if test "x$ax_path_bdb_path_find_highest_DIR" != x ; then
+ BDB_CPPFLAGS="-I$ax_path_bdb_path_find_highest_DIR/include"
+ BDB_LDFLAGS="-L$ax_path_bdb_path_find_highest_DIR/lib"
+ fi
+ BDB_VERSION="$ax_path_bdb_path_find_highest_VERSION"
+ fi
+ fi
+ fi
+
+ dnl # Execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND.
+ if test "$ax_path_bdb_no_options_ok" = "yes" ; then
+ AC_MSG_NOTICE([using Berkeley DB version $BDB_VERSION])
+ AC_DEFINE([HAVE_DB_H],[1],
+ [Define to 1 if you have the <db.h> header file.])
+ m4_ifvaln([$3],[$3])dnl
+ else
+ AC_MSG_NOTICE([no Berkeley DB version $1 or higher found])
+ m4_ifvaln([$4],[$4])dnl
+ fi
+]) dnl AX_PATH_BDB_NO_OPTIONS
+
+dnl #########################################################################
+dnl Check the default installation directory for Berkeley DB which is
+dnl of the form /usr/local/BerkeleyDB* for the highest version.
+dnl
+dnl Result: sets ax_path_bdb_path_find_highest_ok to yes or no,
+dnl sets ax_path_bdb_path_find_highest_VERSION to version,
+dnl sets ax_path_bdb_path_find_highest_DIR to directory.
+dnl
+dnl AX_PATH_BDB_PATH_FIND_HIGHEST([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+AC_DEFUN([AX_PATH_BDB_PATH_FIND_HIGHEST], [
+ dnl # Used to indicate success or failure of this function.
+ ax_path_bdb_path_find_highest_ok=no
+
+ AS_VAR_PUSHDEF([VERSION],[ax_path_bdb_path_find_highest_VERSION])dnl
+ VERSION=''
+
+ ax_path_bdb_path_find_highest_DIR=''
+
+ # find highest verison in default install directory for Berkeley DB
+ AS_VAR_PUSHDEF([CURDIR],[ax_path_bdb_path_find_highest_CURDIR])dnl
+ AS_VAR_PUSHDEF([CUR_VERSION],[ax_path_bdb_path_get_version_VERSION])dnl
+
+ for CURDIR in `ls -d /usr/local/BerkeleyDB* 2> /dev/null`
+ do
+ AX_PATH_BDB_PATH_GET_VERSION([$CURDIR],[
+ AX_COMPARE_VERSION([$CUR_VERSION],[gt],[$VERSION],[
+ ax_path_bdb_path_find_highest_ok=yes
+ ax_path_bdb_path_find_highest_DIR="$CURDIR"
+ VERSION="$CUR_VERSION"
+ ])
+ ])
+ done
+
+ AS_VAR_POPDEF([VERSION])dnl
+ AS_VAR_POPDEF([CUR_VERSION])dnl
+ AS_VAR_POPDEF([CURDIR])dnl
+
+ dnl # Execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND.
+ if test "$ax_path_bdb_path_find_highest_ok" = "yes" ; then
+ m4_ifvaln([$1],[$1],[:])dnl
+ m4_ifvaln([$2],[else $2])dnl
+ fi
+
+]) dnl AX_PATH_BDB_PATH_FIND_HIGHEST
+
+dnl #########################################################################
+dnl Checks for Berkeley DB in specified directory's lib and include
+dnl subdirectories.
+dnl
+dnl Result: sets ax_path_bdb_path_get_version_ok to yes or no,
+dnl sets ax_path_bdb_path_get_version_VERSION to version.
+dnl
+dnl AX_PATH_BDB_PATH_GET_VERSION(BDB-DIR, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+AC_DEFUN([AX_PATH_BDB_PATH_GET_VERSION], [
+ dnl # Used to indicate success or failure of this function.
+ ax_path_bdb_path_get_version_ok=no
+
+ # Indicate status of checking for Berkeley DB header.
+ AC_MSG_CHECKING([in $1/include for db.h])
+ ax_path_bdb_path_get_version_got_header=no
+ test -f "$1/include/db.h" && ax_path_bdb_path_get_version_got_header=yes
+ AC_MSG_RESULT([$ax_path_bdb_path_get_version_got_header])
+
+ # Indicate status of checking for Berkeley DB library.
+ AC_MSG_CHECKING([in $1/lib for library -ldb])
+
+ ax_path_bdb_path_get_version_VERSION=''
+
+ if test -d "$1/include" && test -d "$1/lib" &&
+ test "$ax_path_bdb_path_get_version_got_header" = "yes" ; then
+ dnl # save and modify environment
+ ax_path_bdb_path_get_version_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="-I$1/include $CPPFLAGS"
+
+ ax_path_bdb_path_get_version_save_LIBS="$LIBS"
+ LIBS="$LIBS -ldb"
+
+ ax_path_bdb_path_get_version_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="-L$1/lib $LDFLAGS"
+
+ # Compile and run a program that compares the version defined in
+ # the header file with a version defined in the library function
+ # db_version.
+ AC_RUN_IFELSE([
+ AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <db.h>
+int main(int argc,char **argv)
+{
+ int major,minor,patch;
+ (void) argv;
+ db_version(&major,&minor,&patch);
+ if (argc > 1)
+ printf("%d.%d.%d\n",DB_VERSION_MAJOR,DB_VERSION_MINOR,DB_VERSION_PATCH);
+ if (DB_VERSION_MAJOR == major && DB_VERSION_MINOR == minor &&
+ DB_VERSION_PATCH == patch)
+ return 0;
+ else
+ return 1;
+}
+ ]])
+ ],[
+ # Program compiled and ran, so get version by adding argument.
+ ax_path_bdb_path_get_version_VERSION=`./conftest$ac_exeext x`
+ ax_path_bdb_path_get_version_ok=yes
+ ],[],[])
+
+ dnl # restore environment
+ CPPFLAGS="$ax_path_bdb_path_get_version_save_CPPFLAGS"
+ LIBS="$ax_path_bdb_path_get_version_save_LIBS"
+ LDFLAGS="$ax_path_bdb_path_get_version_save_LDFLAGS"
+ fi
+
+ dnl # Finally, execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND.
+ if test "$ax_path_bdb_path_get_version_ok" = "yes" ; then
+ AC_MSG_RESULT([$ax_path_bdb_path_get_version_VERSION])
+ m4_ifvaln([$2],[$2])dnl
+ else
+ AC_MSG_RESULT([no])
+ m4_ifvaln([$3],[$3])dnl
+ fi
+]) dnl AX_PATH_BDB_PATH_GET_VERSION
+
+#############################################################################
+dnl Checks if version of library and header match specified version.
+dnl Only meant to be used by AX_PATH_BDB_ENV_GET_VERSION macro.
+dnl
+dnl Requires AX_COMPARE_VERSION macro.
+dnl
+dnl Result: sets ax_path_bdb_env_confirm_lib_ok to yes or no.
+dnl
+dnl AX_PATH_BDB_ENV_CONFIRM_LIB(VERSION, [LIBNAME])
+AC_DEFUN([AX_PATH_BDB_ENV_CONFIRM_LIB], [
+ dnl # Used to indicate success or failure of this function.
+ ax_path_bdb_env_confirm_lib_ok=no
+
+ dnl # save and modify environment to link with library LIBNAME
+ ax_path_bdb_env_confirm_lib_save_LIBS="$LIBS"
+ LIBS="$LIBS $2"
+
+ # Compile and run a program that compares the version defined in
+ # the header file with a version defined in the library function
+ # db_version.
+ AC_RUN_IFELSE([
+ AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <db.h>
+int main(int argc,char **argv)
+{
+ int major,minor,patch;
+ (void) argv;
+ db_version(&major,&minor,&patch);
+ if (argc > 1)
+ printf("%d.%d.%d\n",DB_VERSION_MAJOR,DB_VERSION_MINOR,DB_VERSION_PATCH);
+ if (DB_VERSION_MAJOR == major && DB_VERSION_MINOR == minor &&
+ DB_VERSION_PATCH == patch)
+ return 0;
+ else
+ return 1;
+}
+ ]])
+ ],[
+ # Program compiled and ran, so get version by giving an argument,
+ # which will tell the program to print the output.
+ ax_path_bdb_env_confirm_lib_VERSION=`./conftest$ac_exeext x`
+
+ # If the versions all match up, indicate success.
+ AX_COMPARE_VERSION([$ax_path_bdb_env_confirm_lib_VERSION],[eq],[$1],[
+ ax_path_bdb_env_confirm_lib_ok=yes
+ ])
+ ],[],[])
+
+ dnl # restore environment
+ LIBS="$ax_path_bdb_env_confirm_lib_save_LIBS"
+
+]) dnl AX_PATH_BDB_ENV_CONFIRM_LIB
+
+#############################################################################
+dnl Finds the version and library name for Berkeley DB in the
+dnl current environment. Tries many different names for library.
+dnl
+dnl Requires AX_PATH_BDB_ENV_CONFIRM_LIB macro.
+dnl
+dnl Result: set ax_path_bdb_env_get_version_ok to yes or no,
+dnl set ax_path_bdb_env_get_version_VERSION to the version found,
+dnl and ax_path_bdb_env_get_version_LIBNAME to the library name.
+dnl
+dnl AX_PATH_BDB_ENV_GET_VERSION([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+AC_DEFUN([AX_PATH_BDB_ENV_GET_VERSION], [
+ dnl # Used to indicate success or failure of this function.
+ ax_path_bdb_env_get_version_ok=no
+
+ ax_path_bdb_env_get_version_VERSION=''
+ ax_path_bdb_env_get_version_LIBS=''
+
+ AS_VAR_PUSHDEF([HEADER_VERSION],[ax_path_bdb_env_get_version_HEADER_VERSION])dnl
+ AS_VAR_PUSHDEF([TEST_LIBNAME],[ax_path_bdb_env_get_version_TEST_LIBNAME])dnl
+
+ # Indicate status of checking for Berkeley DB library.
+ AC_MSG_CHECKING([for db.h])
+
+ # Compile and run a program that determines the Berkeley DB version
+ # in the header file db.h.
+ HEADER_VERSION=''
+ AC_RUN_IFELSE([
+ AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <db.h>
+int main(int argc,char **argv)
+{
+ (void) argv;
+ if (argc > 1)
+ printf("%d.%d.%d\n",DB_VERSION_MAJOR,DB_VERSION_MINOR,DB_VERSION_PATCH);
+ return 0;
+}
+ ]])
+ ],[
+ # Program compiled and ran, so get version by adding an argument.
+ HEADER_VERSION=`./conftest$ac_exeext x`
+ AC_MSG_RESULT([$HEADER_VERSION])
+ ],[AC_MSG_RESULT([no])],[AC_MSG_RESULT([no])])
+
+ # Have header version, so try to find corresponding library.
+ # Looks for library names in the order:
+ # nothing, db, db-X.Y, dbX.Y, dbXY, db-X, dbX
+ # and stops when it finds the first one that matches the version
+ # of the header file.
+ if test "x$HEADER_VERSION" != "x" ; then
+ AC_MSG_CHECKING([for library containing Berkeley DB $HEADER_VERSION])
+
+ AS_VAR_PUSHDEF([MAJOR],[ax_path_bdb_env_get_version_MAJOR])dnl
+ AS_VAR_PUSHDEF([MINOR],[ax_path_bdb_env_get_version_MINOR])dnl
+
+ # get major and minor version numbers
+ MAJOR=`echo $HEADER_VERSION | sed 's,\..*,,'`
+ MINOR=`echo $HEADER_VERSION | sed 's,^[[0-9]]*\.,,;s,\.[[0-9]]*$,,'`
+
+ # see if it is already specified in LIBS
+ TEST_LIBNAME=''
+ AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
+
+ if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then
+ # try format "db"
+ TEST_LIBNAME='-ldb'
+ AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
+ fi
+
+ if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then
+ # try format "db-X.Y"
+ TEST_LIBNAME="-ldb-${MAJOR}.$MINOR"
+ AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
+ fi
+
+ if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then
+ # try format "dbX.Y"
+ TEST_LIBNAME="-ldb${MAJOR}.$MINOR"
+ AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
+ fi
+
+ if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then
+ # try format "dbXY"
+ TEST_LIBNAME="-ldb$MAJOR$MINOR"
+ AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
+ fi
+
+ if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then
+ # try format "db-X"
+ TEST_LIBNAME="-ldb-$MAJOR"
+ AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
+ fi
+
+ if test "$ax_path_bdb_env_confirm_lib_ok" = "no" ; then
+ # try format "dbX"
+ TEST_LIBNAME="-ldb$MAJOR"
+ AX_PATH_BDB_ENV_CONFIRM_LIB([$HEADER_VERSION], [$TEST_LIBNAME])
+ fi
+
+ dnl # Found a valid library.
+ if test "$ax_path_bdb_env_confirm_lib_ok" = "yes" ; then
+ if test "x$TEST_LIBNAME" = "x" ; then
+ AC_MSG_RESULT([none required])
+ else
+ AC_MSG_RESULT([$TEST_LIBNAME])
+ fi
+ ax_path_bdb_env_get_version_VERSION="$HEADER_VERSION"
+ ax_path_bdb_env_get_version_LIBS="$TEST_LIBNAME"
+ ax_path_bdb_env_get_version_ok=yes
+ else
+ AC_MSG_RESULT([no])
+ fi
+
+ AS_VAR_POPDEF([MAJOR])dnl
+ AS_VAR_POPDEF([MINOR])dnl
+ fi
+
+ AS_VAR_POPDEF([HEADER_VERSION])dnl
+ AS_VAR_POPDEF([TEST_LIBNAME])dnl
+
+ dnl # Execute ACTION-IF-FOUND / ACTION-IF-NOT-FOUND.
+ if test "$ax_path_bdb_env_confirm_lib_ok" = "yes" ; then
+ m4_ifvaln([$1],[$1],[:])dnl
+ m4_ifvaln([$2],[else $2])dnl
+ fi
+
+]) dnl BDB_ENV_GET_VERSION
+
+#############################################################################
diff --git a/m4/ax_path_lib_pcre.m4 b/m4/ax_path_lib_pcre.m4
new file mode 100644
index 0000000..bf8fff3
--- /dev/null
+++ b/m4/ax_path_lib_pcre.m4
@@ -0,0 +1,88 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_path_lib_pcre.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PATH_LIB_PCRE [(A/NA)]
+#
+# DESCRIPTION
+#
+# check for pcre lib and set PCRE_LIBS and PCRE_CFLAGS accordingly.
+#
+# also provide --with-pcre option that may point to the $prefix of the
+# pcre installation - the macro will check $pcre/include and $pcre/lib to
+# contain the necessary files.
+#
+# the usual two ACTION-IF-FOUND / ACTION-IF-NOT-FOUND are supported and
+# they can take advantage of the LIBS/CFLAGS additions.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_PATH_LIB_PCRE],[dnl
+AC_MSG_CHECKING([lib pcre])
+AC_ARG_WITH(pcre,
+[ --with-pcre[[=prefix]] compile xmlpcre part (via libpcre check)],,
+ with_pcre="yes")
+if test ".$with_pcre" = ".no" ; then
+ AC_MSG_RESULT([disabled])
+ m4_ifval($2,$2)
+else
+ AC_MSG_RESULT([(testing)])
+ AC_CHECK_LIB(pcre, pcre_study)
+ if test "$ac_cv_lib_pcre_pcre_study" = "yes" ; then
+ PCRE_LIBS="-lpcre"
+ AC_MSG_CHECKING([lib pcre])
+ AC_MSG_RESULT([$PCRE_LIBS])
+ m4_ifval($1,$1)
+ else
+ OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$with_pcre/lib"
+ OLDCPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS -I$with_pcre/include"
+ AC_CHECK_LIB(pcre, pcre_compile)
+ CPPFLAGS="$OLDCPPFLAGS"
+ LDFLAGS="$OLDLDFLAGS"
+ if test "$ac_cv_lib_pcre_pcre_compile" = "yes" ; then
+ AC_MSG_RESULT(.setting PCRE_LIBS -L$with_pcre/lib -lpcre)
+ PCRE_LIBS="-L$with_pcre/lib -lpcre"
+ test -d "$with_pcre/include" && PCRE_CFLAGS="-I$with_pcre/include"
+ AC_MSG_CHECKING([lib pcre])
+ AC_MSG_RESULT([$PCRE_LIBS])
+ m4_ifval($1,$1)
+ else
+ AC_MSG_CHECKING([lib pcre])
+ AC_MSG_RESULT([no, (WARNING)])
+ m4_ifval($2,$2)
+ fi
+ fi
+fi
+AC_SUBST([PCRE_LIBS])
+AC_SUBST([PCRE_CFLAGS])
+])
diff --git a/m4/ax_path_milter.m4 b/m4/ax_path_milter.m4
new file mode 100644
index 0000000..b7bbf3d
--- /dev/null
+++ b/m4/ax_path_milter.m4
@@ -0,0 +1,329 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_path_milter.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PATH_MILTER([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+#
+# DESCRIPTION
+#
+# This macro tries to automatically find the library libmilter.a and the
+# header file "libmilter/mfapi.h", which are required when compiling a
+# milter for Sendmail. When successful, it sets the output variable
+# MILTER_LIBS to "-lmilter", MILTER_LDFLAGS to contain an -Lpathtolib
+# option, and MILTER_CPPFLAGS to contain an -Ipathtoinclude option, if
+# they are necessary.
+#
+# The easiest way to use this macro is something like:
+#
+# AX_PATH_MILTER([8.12],[
+# LIBS="$MILTER_LIBS $LIBS"
+# LDFLAGS="$MILTER_LDFLAGS $LDFLAGS"
+# CPPFLAGS="$CPPFLAGS $MILTER_CPPFLAGS"
+# ],[
+# AC_MSG_ERROR([required milter library and header not found])
+# ])
+#
+# If the macro is successful, it just adds any flags to the necessary
+# environment. If it is not successful, it would likely be a fatal error,
+# because if an application is linking with libmilter.a, it is probably
+# because it is a milter.
+#
+# There are two optional "--with" options for configure which are added.
+# If they are specified, they override any searching that is done. They
+# are:
+#
+# --with-sendmail-base=<DIR> This option is used to explicitly
+# specify the base of the sendmail distribution.
+#
+# --with-sendmail-obj=<DIR> The option is used to explicitly specify
+# the "obj.*" subdirectory in the sendmail distribution
+# that should be used.
+#
+# When sendmail-base is not specified, the current environment is first
+# tested to see if the header and library are available, and if so
+# MILTER_LDFLAGS and MILTER_CPPFLAGS are left empty.
+#
+# There are two places that are searched for the sendmail base directory.
+# The first location is one directory down from the current directory. It
+# checks if there is a directory of the form sendmail-8.1*, limited to
+# version 8.12.x or higher, then chooses the directory with the highest
+# version number. If that method does not succeed, it then looks in the
+# file /etc/mail/sendmail.cf for the directory it was built from, and uses
+# the base of that distribution. If neither of these methods work, then it
+# fails.
+#
+# There are two methods for finding the "obj.*" directory when it is not
+# specified. The first is to try to run sendmail's Build program with the
+# -M option which will print out the name of the obj. directory for the
+# tool in the directory where it is run from. If this does not work, is
+# looks for the newest directory of the form "obj.*" in the sendmail base
+# directory.
+#
+# Two addition output variables that are defined, whether or not the files
+# are found are SENDMAIL_BASE_DIR and SENDMAIL_OBJ_DIR, which are the
+# suspected location of the sendmail base directory and obj.*
+# subdirectory.
+#
+# NOTE: POSIX threads MUST be configured BEFORE this function is called or
+# it will not find libmilter.a even if it exists. The easiest way is to
+# use the ACX_PTHREAD macro by Steven G. Johnson and Alejandro Forero
+# Cuervo which is available from the Autoconf Macro Archive.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+###############################################################################
+AC_DEFUN([AX_PATH_MILTER], [
+
+# Used to indicate success or failure of this function.
+ax_path_milter_ok=no
+
+# Convert sections of MINIMUM-VERSION to three digit numbers by adding zeros.
+# For example 8.12.9 would become 008.012.009
+ac_milter_minimum_version=`echo "$1" | sed 's,\([[0-9]]*\),x\1x,g;s,x\([[0-9]]\)x,x0\1x,g;s,x\([[0-9]][[0-9]]\)x,x0\1x,g;s,x,,g'`
+
+# Add options --with-sendmail-base and --with-sendmail-obj to configure.
+AC_ARG_WITH([sendmail-base],
+ [ --with-sendmail-base=<DIR> base directory of sendmail distribution])
+AC_ARG_WITH([sendmail-obj],
+ [ --with-sendmail-obj=<DIR> obj.* subdirectory in sendmail distribution])
+
+# Check for functions required by libmilter.
+AC_CHECK_FUNC(inet_aton, [], [AC_SEARCH_LIBS(inet_aton, [socket nsl resolv])])
+AC_CHECK_FUNC(socket, [], [AC_SEARCH_LIBS(socket, [socket nsl])])
+AC_CHECK_FUNC(gethostbyname, [], [AC_SEARCH_LIBS(gethostbyname, [socket nsl])])
+
+###############################################################################
+#
+# If neither --with-sendmail-base or --with-sendmail-obj is specified
+# check the existing environment first for mfapi.h and libmilter without
+# modifying CPPFLAGS, LDFLAGS, and LIBS first.
+#
+if test "x$with_sendmail_base$with_sendmail_obj" = "x" ; then
+ AC_CHECK_HEADER([libmilter/mfapi.h],[
+ AC_CHECK_LIB([milter],[smfi_main],[
+ # both tests succeeded so indicate success
+ ax_path_milter_ok=yes
+
+ # add -lmilter to the libraries to link
+ MILTER_LIBS="-lmilter"
+ ])
+ ])
+
+ if test "$ax_path_milter_ok" = "no" ; then
+ # Unset the cached test results because we will be trying them again later.
+ ac_milter_tmp=abcdefg
+ if unset ac_milter_tmp 2> /dev/null ; then
+ unset ac_cv_header_libmilter_mfapi_h
+ unset ac_cv_lib_milter_smfi_main
+ else
+ AC_MSG_WARN(
+ [system doesn't have unset so either use --with-sendmail-base
+ or set LDFLAGS and CPPFLAGS with the necessary -L and -I options])
+ fi
+ fi
+fi
+
+###############################################################################
+#
+# If didn't already fine necessary files then search.
+#
+if test "$ax_path_milter_ok" = "no" ; then
+ #############################################################################
+ #
+ # Determine the sendmail base directory and set SENDMAIL_BASE_DIR.
+ #
+ if test "x$with_sendmail_base" != "x" ; then
+ # set SENDMAIL_BASE_DIR to the one specified by--with-sendmail-base
+ SENDMAIL_BASE_DIR="$with_sendmail_base"
+ else
+ AC_MSG_CHECKING([for sendmail base directory in ../ ])
+ #
+ # --with-sendmail-base is not used, so we will try to determine it
+ #
+ # 1) List all directories one level down that look like sendmail.
+ # 2) Select ones that are sendmail 8.12 or higher (including 8.13
+ # versions when they come out).
+ # 3) Replace any single digit last version numbers with a two digit
+ # version number (ie. 8.12.9 becomes 8.12.09).
+ # 4) Sort all of the directories found in reverse order.
+ # 5) Take the first one (the highest version).
+ # 6) Restore the single digit version numbers.
+ #
+ ac_milter_tmp=`ls -d ../sendmail-8.1* 2> /dev/null | grep '../sendmail-8.1[[2-9]]' | sed 's,\.\([[0-9]]\)$,.0\1,' | sort -r | sed '1q' | sed 's,\.0\([[0-9]]\)$,.\1,'`
+
+ # Convert found version sections to three digit numbers by adding zeros.
+ ac_milter_found_version=`echo "$ac_milter_tmp" | sed 's,.*/sendmail-,,;s,\([[0-9]]*\),x\1x,g;s,x\([[0-9]]\)x,x0\1x,g;s,x\([[0-9]][[0-9]]\)x,x0\1x,g;s,x,,g'`
+
+ # If ac_milter_minimum_version is equal to ac_milter_lower_version, then
+ # the found version is greater than or equal to the minumum version.
+ # Pick the version string that is the lesser of the two.
+ # An empty string would be less than anything.
+ # In short, ac_milter_version_ok will equal yes if the version is ok,
+ # and no otherwise.
+ ac_milter_version_ok=`echo "x$ac_milter_minimum_version
+x$ac_milter_found_version" | sort | sed '1q' | sed "s,x${ac_milter_minimum_version},yes,;s,x${ac_milter_found_version},no," `
+
+ # If we have something add the current directory to it.
+ if test "x$ac_milter_tmp" != "x" ; then
+ ac_milter_tmp="`pwd`/$ac_milter_tmp"
+ fi
+
+ if test -r "${ac_milter_tmp}/include/libmilter/mfapi.h" && \
+ test "$ac_milter_version_ok" = "yes" ; then
+ # The file mfapi.h exists so we will use this as SENDMAIL_BASE_DIR.
+ AC_MSG_RESULT([yes])
+ SENDMAIL_BASE_DIR="$ac_milter_tmp"
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([for sendmail base from /etc/mail/sendmail.cf])
+ #
+ # The previous method to find SENDMAIL_BASE_DIR failed, so we will
+ # try this method.
+ #
+ # 1) Check for a line in /etc/mail/sendmail.cf of the form:
+ # ##### in /some/path/sendmail-8.x.x/more/path
+ # This is the directory that the sendmail.cf file was built in.
+ # 2) Take the first occurrence if there are more than one.
+ # 3) Remove the leading "##### in ".
+ # 4) Remove everything after the sendmail-8.x.x path component.
+ #
+dnl # Note that the following expression only should not use double
+dnl # square brackets because for some reason, possibly having to
+dnl # do with the pound sign, m4 doesn't convert them to single brackets.
+dnl #
+ ac_milter_tmp=`grep "^##### in /" /etc/mail/sendmail.cf 2> /dev/null | grep "/sendmail-8.1" | sed '1q' | sed 's,^##### in ,,' | sed 's,\(/sendmail-8\.[0-9.]*\).*,\1,'`
+
+ # Convert found version sections to three digit numbers by adding zeros.
+ ac_milter_found_version=`echo "$ac_milter_tmp" | sed 's,.*/sendmail-,,;s,\([[0-9]]*\),x\1x,g;s,x\([[0-9]]\)x,x0\1x,g;s,x\([[0-9]][[0-9]]\)x,x0\1x,g;s,x,,g'`
+
+ # ac_milter_version_ok will equal yes if the version is ok, otherwise no.
+ ac_milter_version_ok=`echo "x$ac_milter_minimum_version
+x$ac_milter_found_version" | sort | sed '1q' | sed "s,x${ac_milter_minimum_version},yes,;s,x${ac_milter_found_version},no," `
+
+ if test -r "${ac_milter_tmp}/include/libmilter/mfapi.h" && \
+ test "$ac_milter_version_ok" = "yes" ; then
+ # The file mfapi.h exists so we will use this as SENDMAIL_BASE_DIR.
+ AC_MSG_RESULT([yes])
+ SENDMAIL_BASE_DIR="$ac_milter_tmp"
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+ fi
+
+ #############################################################################
+ #
+ # Determine the sendmail obj.* directory and set SENDMAIL_OBJ_DIR.
+ # We can only do this if we found SENDMAIL_BASE_DIR.
+ #
+ if test "x$SENDMAIL_BASE_DIR" != "x" ; then
+ if test "x$with_sendmail_obj" != "x" ; then
+ # set SENDMAIL_OBJ_DIR to the one specified by--with-sendmail-obj
+ SENDMAIL_OBJ_DIR="$with_sendmail_obj"
+ else
+ AC_MSG_CHECKING([for sendmail obj.* subdirectory using Build -M])
+ #
+ # --with-sendmail-obj is not used, so we will try to determine it
+ #
+ # Try to run sendmail's Build program with the -M option which will
+ # print out the name of the obj. directory for the tool in the
+ # directory where it is run from.
+ #
+ ac_milter_tmp=`(cd ${SENDMAIL_BASE_DIR}/libmilter 1> /dev/null ; ./Build -M ) 2> /dev/null`
+
+ if test -f "${ac_milter_tmp}/libmilter.a" ; then
+ # libmilter.a exists so this is the one we will choose
+ AC_MSG_RESULT([yes])
+ # Remove beginning and end of path from obj.* directory.
+ SENDMAIL_OBJ_DIR=`echo "$ac_milter_tmp" | sed 's,/libmilter$,,;s,.*/,,'`
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([for sendmail obj.* subdirectory using ls])
+ #
+ # List all directories of the form "obj." in the sendmail base
+ # directory, and choose the one with the latest modification date.
+ #
+ ac_milter_tmp=`ls -dt ${SENDMAIL_BASE_DIR}/obj.*/libmilter 2> /dev/null | sed '1q'`
+
+ if test -f "${ac_milter_tmp}/libmilter.a" ; then
+ # libmilter.a exists so this is the one we will choose
+ AC_MSG_RESULT([yes])
+ # Remove beginning and end of path from obj.* directory.
+ SENDMAIL_OBJ_DIR=`echo "$ac_milter_tmp" | sed 's,/libmilter$,,;s,.*/,,'`
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+ fi
+ fi
+
+ #############################################################################
+ #
+ # If we have both SENDMAIL_BASE_DIR and SENDMAIL_OBJ_DIR we will check
+ # for the necessary files.
+ #
+ if test "x$SENDMAIL_BASE_DIR" != "x" && \
+ test "x$SENDMAIL_OBJ_DIR" != "x" ; then
+
+ # Save and modify CPPFLAGS.
+ ac_milter_save_CPPFLAGS="$CPPFLAGS"
+ MILTER_CPPFLAGS="-I$SENDMAIL_BASE_DIR/include"
+ CPPFLAGS="$CPPFLAGS $MILTER_CPPFLAGS"
+
+ # Save and modify LDFLAGS.
+ ac_milter_save_LDFLAGS="$LDLFAGS"
+ MILTER_LDFLAGS="-L${SENDMAIL_BASE_DIR}/${SENDMAIL_OBJ_DIR}/libmilter"
+ LDFLAGS="$MILTER_LDFLAGS $LDFLAGS"
+
+ AC_CHECK_HEADER([libmilter/mfapi.h],[
+ AC_CHECK_LIB([milter],[smfi_main],[
+ # both tests succeeded so add -lmilter to the libraries to link
+ MILTER_LIBS="-lmilter"
+
+ # indicate success
+ ax_path_milter_ok=yes
+ ])
+ ])
+
+ # Restore the modified environment
+ CPPFLAGS="$ac_milter_save_CPPFLAGS"
+ LDFLAGS="$ac_milter_save_LDFLAGS"
+
+ fi
+fi
+
+# If failure, clear MILTER_LIBS, MILTER_LDFLAGS and MILTER_CPPFLAGS.
+if test "$ax_path_milter_ok" = "no" ; then
+ MILTER_CPPFLAGS=""
+ MILTER_LIBS=""
+ MILTER_LDFLAGS=""
+fi
+
+# export these to the make environment
+AC_SUBST([MILTER_LIBS])
+AC_SUBST([MILTER_CPPFLAGS])
+AC_SUBST([MILTER_LDFLAGS])
+AC_SUBST([SENDMAIL_BASE_DIR])
+AC_SUBST([SENDMAIL_OBJ_DIR])
+
+# Indicate status of checking for libmilter stuff.
+AC_MSG_CHECKING([if files required by libmilter are present])
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND.
+if test "$ax_path_milter_ok" = "yes" ; then
+ AC_MSG_RESULT([yes])
+ $2
+else
+ AC_MSG_RESULT([no])
+ $3
+fi
+
+])dnl
diff --git a/m4/ax_path_missing.m4 b/m4/ax_path_missing.m4
new file mode 100644
index 0000000..649e051
--- /dev/null
+++ b/m4/ax_path_missing.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_path_missing.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PATH_MISSING(VARIABLE, PROG-TO-CHECK-FOR, WARNING-IF-NOT-FOUND, PATH)
+#
+# DESCRIPTION
+#
+# Check whether program PROG-TO-CHECK-FOR exists in path. If it is found,
+# set VARIABLE to the full path of PROG-TO-CHECK-FOR, otherwise warn using
+# the string WARNING-IF-NOT-FOUND and set VARIABLE to the full path of the
+# Automake missing script with PROG-TO-CHECK-FOR as the command to run.
+#
+# A typical use is the following:
+#
+# AX_PATH_MISSING([AUTOGEN],[autogen],[autogen seems missing ...])
+#
+# This macro is the combination of AC_PATH_PROG and AX_MISSING_PROG. If
+# you do not want to run AC_PATH_PROG, simply use AX_MISSING_PROG or
+# AM_MISSING.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Noah Slater <nslater@bytesexual.org>
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_PATH_MISSING], [
+ AC_PATH_PROG([$1],[$2],[$4])
+ AS_IF([ test -z "${$1}" ],[
+ unset $1
+ AX_MISSING_PROG([$1],[$2],[$3])
+ ])
+])
diff --git a/m4/ax_perl_ext_flags.m4 b/m4/ax_perl_ext_flags.m4
new file mode 100644
index 0000000..07e7cf0
--- /dev/null
+++ b/m4/ax_perl_ext_flags.m4
@@ -0,0 +1,114 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_perl_ext_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PERL_EXT_FLAGS([CFLAGS-VARIABLE], [LDFLAGS-VARIABLE], [EXTRA-MODULES])
+# AX_PERL_EXT_CFLAGS([CFLAGS-VARIABLE])
+# AX_PERL_EXT_LDFLAGS([LDFLAGS-VARIABLE], [EXTRA-MODULES])
+#
+# DESCRIPTION
+#
+# Fetches the linker flags and C compiler flags for compiling and linking
+# programs that embed a Perl interpreter. If the EXTRA-MODULES argument is
+# submitted, it is a space separated list of extra modules to link. The
+# flags will be stored in the provided variables.
+#
+# Examples:
+#
+# AX_PERL_EXT_FLAGS([PERLXS_CFLAGS], [PERLXS_LDFLAGS])
+# AC_SUBST([PERLXS_CFLAGS])
+# AC_SUBST([PERLXS_LDFLAGS])
+#
+# AX_PERL_EXT_CFLAGS([PERLXS_CFLAGS])
+# AC_SUBST([PERLXS_CFLAGS])
+#
+# AX_PERL_EXT_LDFLAGS([PERLXS_LDFLAGS], [-std Socket])
+#
+# LICENSE
+#
+# Copyright (c) 2009 Mats Kindahl of Sun Microsystems <mats@sun.com>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# 3. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+AC_DEFUN([AX_PERL_EXT_CFLAGS],
+[AC_CHECK_PROG(PERL,perl,perl)
+ _AX_PERL_EXT_MODULE_CHECK([ExtUtils::Embed], [have_embed=yes],
+ [have_embed=no])
+ AS_IF([test $have_embed = no],
+ AC_MSG_ERROR([Require ExtUtils::Embed to proceed]))
+ _AX_PERL_EXT_EMBED_CHECK([$1],[ccopts])
+])
+
+
+AC_DEFUN([AX_PERL_EXT_LDFLAGS],
+[AC_CHECK_PROG(PERL,perl,perl)
+ _AX_PERL_EXT_MODULE_CHECK([ExtUtils::Embed], [have_embed=yes],
+ [have_embed=no])
+ AS_IF([test $have_embed = no],
+ AC_MSG_ERROR([Require ExtUtils::Embed to proceed]))
+ _AX_PERL_EXT_EMBED_CHECK([$1],[ldopts],[$2])
+])
+
+
+AC_DEFUN([AX_PERL_EXT_FLAGS],
+[AC_CHECK_PROG(PERL,perl,perl)
+ _AX_PERL_EXT_MODULE_CHECK([ExtUtils::Embed], [have_embed=yes],
+ [have_embed=no])
+ AS_IF([test $have_embed = no],
+ AC_MSG_ERROR([Require ExtUtils::Embed to proceed]))
+ _AX_PERL_EXT_EMBED_CHECK([$1],[ccopts])
+ _AX_PERL_EXT_EMBED_CHECK([$2],[ldopts],[$3])
+])
+
+
+dnl _AX_PERL_EXT_MODULE_CHECK(MODULE-NAME, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
+dnl
+dnl Check for the existance of the perl module given by MODULE-NAME.
+dnl
+AC_DEFUN([_AX_PERL_EXT_MODULE_CHECK],
+[AC_MSG_CHECKING([for perl module $1])
+ $PERL "-M$1" -e exit > /dev/null 2>&1
+ AS_IF([test $? -eq 0],
+ [AC_MSG_RESULT(yes)
+ $2],
+ [AC_MSG_RESULT(no)
+ $3])
+])
+
+dnl _AX_PERL_EXT_EMBED_CHECK(VARIABLE, COMMAND, [EXTRA-FLAGS]) Use
+dnl
+dnl ExtUtils::Embed fetch flags for embedding Perl in a C/C++
+dnl application
+dnl
+AC_DEFUN([_AX_PERL_EXT_EMBED_CHECK],
+[AC_MSG_CHECKING([for perl $2 embed flags])
+ ax_c_perlxs_extras="$3"
+ $1=`$PERL -MExtUtils::Embed -e $2 ${ax_c_perlxs_extras:+"-- $3"}`
+ AC_MSG_RESULT($$1)
+])
diff --git a/m4/ax_prefix_config_h.m4 b/m4/ax_prefix_config_h.m4
new file mode 100644
index 0000000..ac8bd81
--- /dev/null
+++ b/m4/ax_prefix_config_h.m4
@@ -0,0 +1,215 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prefix_config_h.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])]
+#
+# DESCRIPTION
+#
+# This is a new variant from ac_prefix_config_ this one will use a
+# lowercase-prefix if the config-define was starting with a
+# lowercase-char, e.g. "#define const", "#define restrict", or "#define
+# off_t", (and this one can live in another directory, e.g.
+# testpkg/config.h therefore I decided to move the output-header to be the
+# first arg)
+#
+# takes the usual config.h generated header file; looks for each of the
+# generated "#define SOMEDEF" lines, and prefixes the defined name (ie.
+# makes it "#define PREFIX_SOMEDEF". The result is written to the output
+# config.header file. The PREFIX is converted to uppercase for the
+# conversions.
+#
+# Defaults:
+#
+# OUTPUT-HEADER = $PACKAGE-config.h
+# PREFIX = $PACKAGE
+# ORIG-HEADER, from AM_CONFIG_HEADER(config.h)
+#
+# Your configure.ac script should contain both macros in this order, and
+# unlike the earlier variations of this prefix-macro it is okay to place
+# the AX_PREFIX_CONFIG_H call before the AC_OUTPUT invokation.
+#
+# Example:
+#
+# AC_INIT(config.h.in) # config.h.in as created by "autoheader"
+# AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE
+# AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in
+# AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it..
+# AC_MEMORY_H # makes "#undef NEED_MEMORY_H"
+# AC_C_CONST_H # makes "#undef const"
+# AC_OUTPUT(Makefile) # creates the "config.h" now
+# # and also mylib/_config.h
+#
+# if the argument to AX_PREFIX_CONFIG_H would have been omitted then the
+# default outputfile would have been called simply "testpkg-config.h", but
+# even under the name "mylib/_config.h" it contains prefix-defines like
+#
+# #ifndef TESTPKG_VERSION
+# #define TESTPKG_VERSION "0.1.1"
+# #endif
+# #ifndef TESTPKG_NEED_MEMORY_H
+# #define TESTPKG_NEED_MEMORY_H 1
+# #endif
+# #ifndef _testpkg_const
+# #define _testpkg_const _const
+# #endif
+#
+# and this "mylib/_config.h" can be installed along with other
+# header-files, which is most convenient when creating a shared library
+# (that has some headers) where some functionality is dependent on the
+# OS-features detected at compile-time. No need to invent some
+# "mylib-confdefs.h.in" manually. :-)
+#
+# Note that some AC_DEFINEs that end up in the config.h file are actually
+# self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the AC_TYPE_OFF_T
+# say that they "will define inline|const|off_t if the system does not do
+# it by itself". You might want to clean up about these - consider an
+# extra mylib/conf.h that reads something like:
+#
+# #include <mylib/_config.h>
+# #ifndef _testpkg_const
+# #define _testpkg_const const
+# #endif
+#
+# and then start using _testpkg_const in the header files. That is also a
+# good thing to differentiate whether some library-user has starting to
+# take up with a different compiler, so perhaps it could read something
+# like this:
+#
+# #ifdef _MSC_VER
+# #include <mylib/_msvc.h>
+# #else
+# #include <mylib/_config.h>
+# #endif
+# #ifndef _testpkg_const
+# #define _testpkg_const const
+# #endif
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+# Copyright (c) 2008 Marten Svantesson
+# Copyright (c) 2008 Gerald Point <Gerald.Point@labri.fr>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_PREFIX_CONFIG_H],[dnl
+AC_BEFORE([AC_CONFIG_HEADERS],[$0])dnl
+AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl
+AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl
+AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl
+AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl
+AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl
+AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl
+AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl
+m4_pushdef([_script],[conftest.prefix])dnl
+m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
+_OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)`
+_DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"`
+_PKG=`echo ifelse($2, , $PACKAGE, $2)`
+_LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"`
+_UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`
+_INP=`echo "ifelse($3,,,$3)" | sed -e 's/ *//'`
+if test ".$_INP" = "."; then
+ for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue
+ case "$ac_file" in
+ *.h) _INP=$ac_file ;;
+ *)
+ esac
+ test ".$_INP" != "." && break
+ done
+fi
+if test ".$_INP" = "."; then
+ case "$_OUT" in
+ */*) _INP=`basename "$_OUT"`
+ ;;
+ *-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"`
+ ;;
+ *) _INP=config.h
+ ;;
+ esac
+fi
+if test -z "$_PKG" ; then
+ AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H])
+else
+ if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then
+ _INP="$srcdir/$_INP"
+ fi fi
+ AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines)
+ if test -f $_INP ; then
+ echo "s/^@%:@undef *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/" > _script
+ echo "s/^@%:@undef *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/" >> _script
+ echo "s/^@%:@def[]ine *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1 \\" >> _script
+ echo "@%:@def[]ine $_UPP""_\\1 \\2 \\" >> _script
+ echo "@%:@endif/" >>_script
+ echo "s/^@%:@def[]ine *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1 \\" >> _script
+ echo "@%:@define $_LOW""_\\1 \\2 \\" >> _script
+ echo "@%:@endif/" >> _script
+ # now executing _script on _DEF input to create _OUT output file
+ echo "@%:@ifndef $_DEF" >$tmp/pconfig.h
+ echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h
+ echo ' ' >>$tmp/pconfig.h
+ echo /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h
+
+ sed -f _script $_INP >>$tmp/pconfig.h
+ echo ' ' >>$tmp/pconfig.h
+ echo '/* once:' $_DEF '*/' >>$tmp/pconfig.h
+ echo "@%:@endif" >>$tmp/pconfig.h
+ if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then
+ AC_MSG_NOTICE([$_OUT is unchanged])
+ else
+ ac_dir=`AS_DIRNAME(["$_OUT"])`
+ AS_MKDIR_P(["$ac_dir"])
+ rm -f "$_OUT"
+ mv $tmp/pconfig.h "$_OUT"
+ fi
+ cp _script _configs.sed
+ else
+ AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT])
+ fi
+ rm -f conftest.*
+fi
+m4_popdef([_symbol])dnl
+m4_popdef([_script])dnl
+AS_VAR_POPDEF([_INP])dnl
+AS_VAR_POPDEF([_UPP])dnl
+AS_VAR_POPDEF([_LOW])dnl
+AS_VAR_POPDEF([_PKG])dnl
+AS_VAR_POPDEF([_DEF])dnl
+AS_VAR_POPDEF([_OUT])dnl
+],[PACKAGE="$PACKAGE"])])
+
+dnl implementation note: a bug report (31.5.2005) from Marten Svantesson points
+dnl out a problem where `echo "\1"` results in a Control-A. The unix standard
+dnl http://www.opengroup.org/onlinepubs/000095399/utilities/echo.html
+dnl defines all backslash-sequences to be inherently non-portable asking
+dnl for replacement mit printf. Some old systems had problems with that
+dnl one either. However, the latest libtool (!) release does export an $ECHO
+dnl (and $echo) that does the right thing - just one question is left: what
+dnl was the first version to have it? Is it greater 2.58 ?
diff --git a/m4/ax_print_to_file.m4 b/m4/ax_print_to_file.m4
new file mode 100644
index 0000000..f726508
--- /dev/null
+++ b/m4/ax_print_to_file.m4
@@ -0,0 +1,24 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_print_to_file.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PRINT_TO_FILE([FILE],[DATA])
+#
+# DESCRIPTION
+#
+# Writes the specified data to the specified file.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_PRINT_TO_FILE],[
+AC_REQUIRE([AX_FILE_ESCAPES])
+printf "$2" > "$1"
+])
diff --git a/m4/ax_prog_bison.m4 b/m4/ax_prog_bison.m4
new file mode 100644
index 0000000..5b69ef3
--- /dev/null
+++ b/m4/ax_prog_bison.m4
@@ -0,0 +1,62 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_bison.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_BISON(ACTION-IF-TRUE,ACTION-IF-FALSE)
+#
+# DESCRIPTION
+#
+# Check whether bison is the parser generator. Run ACTION-IF-TRUE if
+# successful, ACTION-IF-FALSE otherwise
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_PROG_BISON], [
+ AC_REQUIRE([AC_PROG_YACC])
+ AC_REQUIRE([AC_PROG_SED])
+
+ AC_CACHE_CHECK([if bison is the parser generator],[ax_cv_prog_bison],[
+ AS_IF([test "`echo \"$YACC\" | $SED 's,^.*\(bison\).*$,\1,'`" = "bison" ],[
+ ax_cv_prog_bison=yes
+ ],[
+ ax_cv_prog_bison=no
+ ])
+ ])
+ AS_IF([test "$ax_cv_prog_bison" = yes],[
+ :
+ $1
+ ],[
+ :
+ $2
+ ])
+])
diff --git a/m4/ax_prog_doxygen.m4 b/m4/ax_prog_doxygen.m4
new file mode 100644
index 0000000..6d4950c
--- /dev/null
+++ b/m4/ax_prog_doxygen.m4
@@ -0,0 +1,530 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_doxygen.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# DX_INIT_DOXYGEN(PROJECT-NAME, DOXYFILE-PATH, [OUTPUT-DIR])
+# DX_DOXYGEN_FEATURE(ON|OFF)
+# DX_DOT_FEATURE(ON|OFF)
+# DX_HTML_FEATURE(ON|OFF)
+# DX_CHM_FEATURE(ON|OFF)
+# DX_CHI_FEATURE(ON|OFF)
+# DX_MAN_FEATURE(ON|OFF)
+# DX_RTF_FEATURE(ON|OFF)
+# DX_XML_FEATURE(ON|OFF)
+# DX_PDF_FEATURE(ON|OFF)
+# DX_PS_FEATURE(ON|OFF)
+#
+# DESCRIPTION
+#
+# The DX_*_FEATURE macros control the default setting for the given
+# Doxygen feature. Supported features are 'DOXYGEN' itself, 'DOT' for
+# generating graphics, 'HTML' for plain HTML, 'CHM' for compressed HTML
+# help (for MS users), 'CHI' for generating a seperate .chi file by the
+# .chm file, and 'MAN', 'RTF', 'XML', 'PDF' and 'PS' for the appropriate
+# output formats. The environment variable DOXYGEN_PAPER_SIZE may be
+# specified to override the default 'a4wide' paper size.
+#
+# By default, HTML, PDF and PS documentation is generated as this seems to
+# be the most popular and portable combination. MAN pages created by
+# Doxygen are usually problematic, though by picking an appropriate subset
+# and doing some massaging they might be better than nothing. CHM and RTF
+# are specific for MS (note that you can't generate both HTML and CHM at
+# the same time). The XML is rather useless unless you apply specialized
+# post-processing to it.
+#
+# The macros mainly control the default state of the feature. The use can
+# override the default by specifying --enable or --disable. The macros
+# ensure that contradictory flags are not given (e.g.,
+# --enable-doxygen-html and --enable-doxygen-chm,
+# --enable-doxygen-anything with --disable-doxygen, etc.) Finally, each
+# feature will be automatically disabled (with a warning) if the required
+# programs are missing.
+#
+# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN
+# with the following parameters: a one-word name for the project for use
+# as a filename base etc., an optional configuration file name (the
+# default is 'Doxyfile', the same as Doxygen's default), and an optional
+# output directory name (the default is 'doxygen-doc').
+#
+# Automake Support
+#
+# The following is a template aminclude.am file for use with Automake.
+# Make targets and variables values are controlled by the various
+# DX_COND_* conditionals set by autoconf.
+#
+# The provided targets are:
+#
+# doxygen-doc: Generate all doxygen documentation.
+#
+# doxygen-run: Run doxygen, which will generate some of the
+# documentation (HTML, CHM, CHI, MAN, RTF, XML)
+# but will not do the post processing required
+# for the rest of it (PS, PDF, and some MAN).
+#
+# doxygen-man: Rename some doxygen generated man pages.
+#
+# doxygen-ps: Generate doxygen PostScript documentation.
+#
+# doxygen-pdf: Generate doxygen PDF documentation.
+#
+# Note that by default these are not integrated into the automake targets.
+# If doxygen is used to generate man pages, you can achieve this
+# integration by setting man3_MANS to the list of man pages generated and
+# then adding the dependency:
+#
+# $(man3_MANS): doxygen-doc
+#
+# This will cause make to run doxygen and generate all the documentation.
+#
+# The following variable is intended for use in Makefile.am:
+#
+# DX_CLEANFILES = everything to clean.
+#
+# Then add this variable to MOSTLYCLEANFILES.
+#
+# ----- begin aminclude.am -------------------------------------
+#
+# ## --------------------------------- ##
+# ## Format-independent Doxygen rules. ##
+# ## --------------------------------- ##
+#
+# if DX_COND_doc
+#
+# ## ------------------------------- ##
+# ## Rules specific for HTML output. ##
+# ## ------------------------------- ##
+#
+# if DX_COND_html
+#
+# DX_CLEAN_HTML = @DX_DOCDIR@/html
+#
+# endif DX_COND_html
+#
+# ## ------------------------------ ##
+# ## Rules specific for CHM output. ##
+# ## ------------------------------ ##
+#
+# if DX_COND_chm
+#
+# DX_CLEAN_CHM = @DX_DOCDIR@/chm
+#
+# if DX_COND_chi
+#
+# DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi
+#
+# endif DX_COND_chi
+#
+# endif DX_COND_chm
+#
+# ## ------------------------------ ##
+# ## Rules specific for MAN output. ##
+# ## ------------------------------ ##
+#
+# if DX_COND_man
+#
+# DX_CLEAN_MAN = @DX_DOCDIR@/man
+#
+# endif DX_COND_man
+#
+# ## ------------------------------ ##
+# ## Rules specific for RTF output. ##
+# ## ------------------------------ ##
+#
+# if DX_COND_rtf
+#
+# DX_CLEAN_RTF = @DX_DOCDIR@/rtf
+#
+# endif DX_COND_rtf
+#
+# ## ------------------------------ ##
+# ## Rules specific for XML output. ##
+# ## ------------------------------ ##
+#
+# if DX_COND_xml
+#
+# DX_CLEAN_XML = @DX_DOCDIR@/xml
+#
+# endif DX_COND_xml
+#
+# ## ----------------------------- ##
+# ## Rules specific for PS output. ##
+# ## ----------------------------- ##
+#
+# if DX_COND_ps
+#
+# DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps
+#
+# DX_PS_GOAL = doxygen-ps
+#
+# doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps
+#
+# @DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag
+# cd @DX_DOCDIR@/latex; \
+# rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
+# $(DX_LATEX) refman.tex; \
+# $(MAKEINDEX_PATH) refman.idx; \
+# $(DX_LATEX) refman.tex; \
+# countdown=5; \
+# while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
+# refman.log > /dev/null 2>&1 \
+# && test $$countdown -gt 0; do \
+# $(DX_LATEX) refman.tex; \
+# countdown=`expr $$countdown - 1`; \
+# done; \
+# $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi
+#
+# endif DX_COND_ps
+#
+# ## ------------------------------ ##
+# ## Rules specific for PDF output. ##
+# ## ------------------------------ ##
+#
+# if DX_COND_pdf
+#
+# DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf
+#
+# DX_PDF_GOAL = doxygen-pdf
+#
+# doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf
+#
+# @DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag
+# cd @DX_DOCDIR@/latex; \
+# rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
+# $(DX_PDFLATEX) refman.tex; \
+# $(DX_MAKEINDEX) refman.idx; \
+# $(DX_PDFLATEX) refman.tex; \
+# countdown=5; \
+# while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
+# refman.log > /dev/null 2>&1 \
+# && test $$countdown -gt 0; do \
+# $(DX_PDFLATEX) refman.tex; \
+# countdown=`expr $$countdown - 1`; \
+# done; \
+# mv refman.pdf ../@PACKAGE@.pdf
+#
+# endif DX_COND_pdf
+#
+# ## ------------------------------------------------- ##
+# ## Rules specific for LaTeX (shared for PS and PDF). ##
+# ## ------------------------------------------------- ##
+#
+# if DX_COND_latex
+#
+# DX_CLEAN_LATEX = @DX_DOCDIR@/latex
+#
+# endif DX_COND_latex
+#
+# .PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL)
+#
+# .INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
+#
+# doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag
+#
+# doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
+#
+# @DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS)
+# rm -rf @DX_DOCDIR@
+# $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG)
+#
+# DX_CLEANFILES = \
+# @DX_DOCDIR@/@PACKAGE@.tag \
+# -r \
+# $(DX_CLEAN_HTML) \
+# $(DX_CLEAN_CHM) \
+# $(DX_CLEAN_CHI) \
+# $(DX_CLEAN_MAN) \
+# $(DX_CLEAN_RTF) \
+# $(DX_CLEAN_XML) \
+# $(DX_CLEAN_PS) \
+# $(DX_CLEAN_PDF) \
+# $(DX_CLEAN_LATEX)
+#
+# endif DX_COND_doc
+#
+# ----- end aminclude.am ---------------------------------------
+#
+# LICENSE
+#
+# Copyright (c) 2009 Oren Ben-Kiki <oren@ben-kiki.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+## ----------##
+## Defaults. ##
+## ----------##
+
+DX_ENV=""
+AC_DEFUN([DX_FEATURE_doc], ON)
+AC_DEFUN([DX_FEATURE_dot], ON)
+AC_DEFUN([DX_FEATURE_man], OFF)
+AC_DEFUN([DX_FEATURE_html], ON)
+AC_DEFUN([DX_FEATURE_chm], OFF)
+AC_DEFUN([DX_FEATURE_chi], OFF)
+AC_DEFUN([DX_FEATURE_rtf], OFF)
+AC_DEFUN([DX_FEATURE_xml], OFF)
+AC_DEFUN([DX_FEATURE_pdf], ON)
+AC_DEFUN([DX_FEATURE_ps], ON)
+
+## --------------- ##
+## Private macros. ##
+## --------------- ##
+
+# DX_ENV_APPEND(VARIABLE, VALUE)
+# ------------------------------
+# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen.
+AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])])
+
+# DX_DIRNAME_EXPR
+# ---------------
+# Expand into a shell expression prints the directory part of a path.
+AC_DEFUN([DX_DIRNAME_EXPR],
+ [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']])
+
+# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF)
+# -------------------------------------
+# Expands according to the M4 (static) status of the feature.
+AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])])
+
+# DX_REQUIRE_PROG(VARIABLE, PROGRAM)
+# ----------------------------------
+# Require the specified program to be found for the DX_CURRENT_FEATURE to work.
+AC_DEFUN([DX_REQUIRE_PROG], [
+AC_PATH_TOOL([$1], [$2])
+if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then
+ AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION])
+ AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0)
+fi
+])
+
+# DX_TEST_FEATURE(FEATURE)
+# ------------------------
+# Expand to a shell expression testing whether the feature is active.
+AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1])
+
+# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE)
+# -------------------------------------------------
+# Verify that a required features has the right state before trying to turn on
+# the DX_CURRENT_FEATURE.
+AC_DEFUN([DX_CHECK_DEPEND], [
+test "$DX_FLAG_$1" = "$2" \
+|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1,
+ requires, contradicts) doxygen-DX_CURRENT_FEATURE])
+])
+
+# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE)
+# ----------------------------------------------------------
+# Turn off the DX_CURRENT_FEATURE if the required feature is off.
+AC_DEFUN([DX_CLEAR_DEPEND], [
+test "$DX_FLAG_$1" = "$2" || AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0)
+])
+
+# DX_FEATURE_ARG(FEATURE, DESCRIPTION,
+# CHECK_DEPEND, CLEAR_DEPEND,
+# REQUIRE, DO-IF-ON, DO-IF-OFF)
+# --------------------------------------------
+# Parse the command-line option controlling a feature. CHECK_DEPEND is called
+# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND),
+# otherwise CLEAR_DEPEND is called to turn off the default state if a required
+# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional
+# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and
+# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature.
+AC_DEFUN([DX_ARG_ABLE], [
+ AC_DEFUN([DX_CURRENT_FEATURE], [$1])
+ AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2])
+ AC_ARG_ENABLE(doxygen-$1,
+ [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1],
+ [--enable-doxygen-$1]),
+ DX_IF_FEATURE([$1], [don't $2], [$2]))],
+ [
+case "$enableval" in
+#(
+y|Y|yes|Yes|YES)
+ AC_SUBST([DX_FLAG_$1], 1)
+ $3
+;; #(
+n|N|no|No|NO)
+ AC_SUBST([DX_FLAG_$1], 0)
+;; #(
+*)
+ AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1])
+;;
+esac
+], [
+AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)])
+$4
+])
+if DX_TEST_FEATURE([$1]); then
+ $5
+ :
+fi
+if DX_TEST_FEATURE([$1]); then
+ AM_CONDITIONAL(DX_COND_$1, :)
+ $6
+ :
+else
+ AM_CONDITIONAL(DX_COND_$1, false)
+ $7
+ :
+fi
+])
+
+## -------------- ##
+## Public macros. ##
+## -------------- ##
+
+# DX_XXX_FEATURE(DEFAULT_STATE)
+# -----------------------------
+AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])])
+AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])])
+AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])])
+AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])])
+AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])])
+AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])])
+AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
+AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
+AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])])
+AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])])
+
+# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR])
+# ---------------------------------------------------------
+# PROJECT also serves as the base name for the documentation files.
+# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc".
+AC_DEFUN([DX_INIT_DOXYGEN], [
+
+# Files:
+AC_SUBST([DX_PROJECT], [$1])
+AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])])
+AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])])
+
+# Environment variables used inside doxygen.cfg:
+DX_ENV_APPEND(SRCDIR, $srcdir)
+DX_ENV_APPEND(PROJECT, $DX_PROJECT)
+DX_ENV_APPEND(DOCDIR, $DX_DOCDIR)
+DX_ENV_APPEND(VERSION, $PACKAGE_VERSION)
+
+# Doxygen itself:
+DX_ARG_ABLE(doc, [generate any doxygen documentation],
+ [],
+ [],
+ [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen)
+ DX_REQUIRE_PROG([DX_PERL], perl)],
+ [DX_ENV_APPEND(PERL_PATH, $DX_PERL)])
+
+# Dot for graphics:
+DX_ARG_ABLE(dot, [generate graphics for doxygen documentation],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [DX_REQUIRE_PROG([DX_DOT], dot)],
+ [DX_ENV_APPEND(HAVE_DOT, YES)
+ DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])],
+ [DX_ENV_APPEND(HAVE_DOT, NO)])
+
+# Man pages generation:
+DX_ARG_ABLE(man, [generate doxygen manual pages],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [],
+ [DX_ENV_APPEND(GENERATE_MAN, YES)],
+ [DX_ENV_APPEND(GENERATE_MAN, NO)])
+
+# RTF file generation:
+DX_ARG_ABLE(rtf, [generate doxygen RTF documentation],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [],
+ [DX_ENV_APPEND(GENERATE_RTF, YES)],
+ [DX_ENV_APPEND(GENERATE_RTF, NO)])
+
+# XML file generation:
+DX_ARG_ABLE(xml, [generate doxygen XML documentation],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [],
+ [DX_ENV_APPEND(GENERATE_XML, YES)],
+ [DX_ENV_APPEND(GENERATE_XML, NO)])
+
+# (Compressed) HTML help generation:
+DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [DX_REQUIRE_PROG([DX_HHC], hhc)],
+ [DX_ENV_APPEND(HHC_PATH, $DX_HHC)
+ DX_ENV_APPEND(GENERATE_HTML, YES)
+ DX_ENV_APPEND(GENERATE_HTMLHELP, YES)],
+ [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)])
+
+# Seperate CHI file generation.
+DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file],
+ [DX_CHECK_DEPEND(chm, 1)],
+ [DX_CLEAR_DEPEND(chm, 1)],
+ [],
+ [DX_ENV_APPEND(GENERATE_CHI, YES)],
+ [DX_ENV_APPEND(GENERATE_CHI, NO)])
+
+# Plain HTML pages generation:
+DX_ARG_ABLE(html, [generate doxygen plain HTML documentation],
+ [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)],
+ [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)],
+ [],
+ [DX_ENV_APPEND(GENERATE_HTML, YES)],
+ [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)])
+
+# PostScript file generation:
+DX_ARG_ABLE(ps, [generate doxygen PostScript documentation],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [DX_REQUIRE_PROG([DX_LATEX], latex)
+ DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
+ DX_REQUIRE_PROG([DX_DVIPS], dvips)
+ DX_REQUIRE_PROG([DX_EGREP], egrep)])
+
+# PDF file generation:
+DX_ARG_ABLE(pdf, [generate doxygen PDF documentation],
+ [DX_CHECK_DEPEND(doc, 1)],
+ [DX_CLEAR_DEPEND(doc, 1)],
+ [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex)
+ DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
+ DX_REQUIRE_PROG([DX_EGREP], egrep)])
+
+# LaTeX generation for PS and/or PDF:
+if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then
+ AM_CONDITIONAL(DX_COND_latex, :)
+ DX_ENV_APPEND(GENERATE_LATEX, YES)
+else
+ AM_CONDITIONAL(DX_COND_latex, false)
+ DX_ENV_APPEND(GENERATE_LATEX, NO)
+fi
+
+# Paper size for PS and/or PDF:
+AC_ARG_VAR(DOXYGEN_PAPER_SIZE,
+ [a4wide (default), a4, letter, legal or executive])
+case "$DOXYGEN_PAPER_SIZE" in
+#(
+"")
+ AC_SUBST(DOXYGEN_PAPER_SIZE, "")
+;; #(
+a4wide|a4|letter|legal|executive)
+ DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE)
+;; #(
+*)
+ AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'])
+;;
+esac
+
+#For debugging:
+#echo DX_FLAG_doc=$DX_FLAG_doc
+#echo DX_FLAG_dot=$DX_FLAG_dot
+#echo DX_FLAG_man=$DX_FLAG_man
+#echo DX_FLAG_html=$DX_FLAG_html
+#echo DX_FLAG_chm=$DX_FLAG_chm
+#echo DX_FLAG_chi=$DX_FLAG_chi
+#echo DX_FLAG_rtf=$DX_FLAG_rtf
+#echo DX_FLAG_xml=$DX_FLAG_xml
+#echo DX_FLAG_pdf=$DX_FLAG_pdf
+#echo DX_FLAG_ps=$DX_FLAG_ps
+#echo DX_ENV=$DX_ENV
+])
diff --git a/m4/ax_prog_fasm.m4 b/m4/ax_prog_fasm.m4
new file mode 100644
index 0000000..a116306
--- /dev/null
+++ b/m4/ax_prog_fasm.m4
@@ -0,0 +1,45 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_fasm.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_FASM([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro searches for the FASM assembler and sets the variable "fasm"
+# to the name of the application or to "no" if not found. If
+# ACTION-IF-NOT-FOUND is not specified, configure will fail when the
+# program is not found.
+#
+# Example:
+#
+# AX_PROG_FASM()
+# AX_PROG_FASM([fasm_avail="no"])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bogdan Drozdowski <bogdandr # op . pl>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([AX_PROG_FASM],[
+AC_CHECK_PROGS(fasm,[fasm],no)
+if test $fasm = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([FASM assembler not found])],
+ $1)
+fi
+])
diff --git a/m4/ax_prog_fasm_opt.m4 b/m4/ax_prog_fasm_opt.m4
new file mode 100644
index 0000000..a662c7d
--- /dev/null
+++ b/m4/ax_prog_fasm_opt.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_fasm_opt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_FASM_OPT(option, var_name)
+#
+# DESCRIPTION
+#
+# This macro checks if the FASM assembler accepts the given option. If
+# yes, the option is appended to the variable 'var_name', otherwise
+# 'var_name' is unchanged.
+#
+# Example:
+#
+# AX_PROG_FASM_OPT([-m 256], [FASM_OPTS])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bogdan Drozdowski <bogdandr # op . pl>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([AX_PROG_FASM_OPT],[
+AC_REQUIRE([AX_PROG_FASM])dnl
+AC_MSG_CHECKING([if $fasm accepts $1])
+echo '' > conftest.asm
+if $fasm $$2 $1 conftest.asm > conftest.err; then
+ $2="$$2 $1"
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+])
diff --git a/m4/ax_prog_flex.m4 b/m4/ax_prog_flex.m4
new file mode 100644
index 0000000..0b734ea
--- /dev/null
+++ b/m4/ax_prog_flex.m4
@@ -0,0 +1,62 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_flex.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_FLEX(ACTION-IF-TRUE,ACTION-IF-FALSE)
+#
+# DESCRIPTION
+#
+# Check whether flex is the scanner generator. Run ACTION-IF-TRUE if
+# successful, ACTION-IF-FALSE otherwise
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_PROG_FLEX], [
+ AC_REQUIRE([AM_PROG_LEX])
+ AC_REQUIRE([AC_PROG_SED])
+
+ AC_CACHE_CHECK([if flex is the lexer generator],[ax_cv_prog_flex],[
+ AS_IF([test "`echo \"$LEX\" | $SED 's,^.*\(flex\).*$,\1,'`" = "flex"],[
+ ax_cv_prog_flex=yes
+ ],[
+ ax_cv_prog_flex=no
+ ])
+ ])
+ AS_IF([test "$ax_cv_prog_flex" = yes],[
+ :
+ $1
+ ],[
+ :
+ $2
+ ])
+])
diff --git a/m4/ax_prog_guile_version.m4 b/m4/ax_prog_guile_version.m4
new file mode 100644
index 0000000..7f94597
--- /dev/null
+++ b/m4/ax_prog_guile_version.m4
@@ -0,0 +1,62 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_guile_version.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_GUILE_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
+#
+# DESCRIPTION
+#
+# Makes sure that guile supports the version indicated. If true the shell
+# commands in ACTION-IF-TRUE are executed. If not the shell commands in
+# ACTION-IF-FALSE are run. Note if $GUILE is not set (for example by
+# running AC_CHECK_PROG or AC_PATH_PROG) the macro will fail.
+#
+# Example:
+#
+# AC_PATH_PROG([GUILE],[guile])
+# AC_PROG_GUILE_VERSION([1.6.0],[ ... ],[ ... ])
+#
+# This will check to make sure that the guile you have supports at least
+# version 1.6.0.
+#
+# NOTE: This macro uses the $GUILE variable to perform the check.
+# AX_WITH_GUILE can be used to set that variable prior to running this
+# macro. The $GUILE_VERSION variable will be valorized with the detected
+# version.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_PROG_GUILE_VERSION],[
+ AC_REQUIRE([AC_PROG_SED])
+
+ AS_IF([test -n "$GUILE"],[
+ ax_guile_version="$1"
+
+ AC_MSG_CHECKING([for guile version])
+ changequote(<<,>>)
+ guile_version=`$GUILE -q --version 2>&1 | head -n 1 | $SED -e 's/.* \([0-9]*\.[0-9]*\.[0-9]*\)/\1/'`
+ changequote([,])
+ AC_MSG_RESULT($guile_version)
+
+ AC_SUBST([GUILE_VERSION],[$guile_version])
+
+ AX_COMPARE_VERSION([$ax_guile_version],[le],[$guile_version],[
+ :
+ $2
+ ],[
+ :
+ $3
+ ])
+ ],[
+ AC_MSG_WARN([could not find the guile interpreter])
+ $3
+ ])
+])
diff --git a/m4/ax_prog_hla.m4 b/m4/ax_prog_hla.m4
new file mode 100644
index 0000000..2ce4388
--- /dev/null
+++ b/m4/ax_prog_hla.m4
@@ -0,0 +1,45 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_hla.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_HLA([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro searches for the HLA assembler and sets the variable "hla" to
+# the name of the application or to "no" if not found. If
+# ACTION-IF-NOT-FOUND is not specified, configure will fail when the
+# program is not found.
+#
+# Example:
+#
+# AX_PROG_HLA()
+# AX_PROG_HLA([hla_avail="no"])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bogdan Drozdowski <bogdandr # op . pl>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([AX_PROG_HLA],[
+AC_CHECK_PROGS(hla,[hla],no)
+if test hla = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([HLA assembler not found])],
+ $1)
+fi
+])
diff --git a/m4/ax_prog_hla_opt.m4 b/m4/ax_prog_hla_opt.m4
new file mode 100644
index 0000000..2cebac1
--- /dev/null
+++ b/m4/ax_prog_hla_opt.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_hla_opt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_HLA_OPT(option, var_name)
+#
+# DESCRIPTION
+#
+# This macro checks if the HLA assembler accepts the given option. If yes,
+# the option is appended to the variable 'var_name', otherwise 'var_name'
+# is unchanged.
+#
+# Example:
+#
+# AX_PROG_HLA_OPT([-v], [HLA_OPTS])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bogdan Drozdowski <bogdandr # op . pl>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([AX_PROG_HLA_OPT],[
+AC_REQUIRE([AX_PROG_HLA])dnl
+AC_MSG_CHECKING([if $hla accepts $1])
+echo '' > conftest.hla
+if $hla $$2 $1 conftest.hla > conftest.err; then
+ $2="$$2 $1"
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+])
diff --git a/m4/ax_prog_masm.m4 b/m4/ax_prog_masm.m4
new file mode 100644
index 0000000..5b47488
--- /dev/null
+++ b/m4/ax_prog_masm.m4
@@ -0,0 +1,45 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_masm.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_MASM([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro searches for the MASM assembler and sets the variable "masm"
+# to the name of the application or to "no" if not found. If
+# ACTION-IF-NOT-FOUND is not specified, configure will fail when the
+# program is not found.
+#
+# Example:
+#
+# AX_PROG_MASM()
+# AX_PROG_MASM([masm_avail="no"])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bogdan Drozdowski <bogdandr # op . pl>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([AX_PROG_MASM],[
+AC_CHECK_PROGS(masm,[ml masm ml32 ml64 masm32],no)
+if test $masm = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([MASM assembler not found])],
+ $1)
+fi
+])
diff --git a/m4/ax_prog_masm_opt.m4 b/m4/ax_prog_masm_opt.m4
new file mode 100644
index 0000000..ed8c035
--- /dev/null
+++ b/m4/ax_prog_masm_opt.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_masm_opt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_MASM_OPT(option, var_name)
+#
+# DESCRIPTION
+#
+# This macro checks if the MASM assembler accepts the given option. If
+# yes, the option is appended to the variable 'var_name', otherwise
+# 'var_name' is unchanged.
+#
+# Example:
+#
+# AX_PROG_MASM_OPT([/coff], [MASM_OPTS])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bogdan Drozdowski <bogdandr # op . pl>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([AX_PROG_MASM_OPT],[
+AC_REQUIRE([AX_PROG_MASM])dnl
+AC_MSG_CHECKING([if $masm accepts $1])
+echo '' > conftest.asm
+if $masm $$2 $1 conftest.asm > conftest.err; then
+ $2="$$2 $1"
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+])
diff --git a/m4/ax_prog_md5sum.m4 b/m4/ax_prog_md5sum.m4
new file mode 100644
index 0000000..9226c15
--- /dev/null
+++ b/m4/ax_prog_md5sum.m4
@@ -0,0 +1,31 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_md5sum.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_MD5SUM([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro find a md5sum application and set the variable md5sum to the
+# name of the application or to no if not found if ACTION-IF-NOT-FOUND is
+# not specified, configure fail when then application is not found.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Gabriele Bartolini <gabriele.bartolini@devise.it>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_PROG_MD5SUM],[
+# Mac users have md5 instead of md5sum
+AC_CHECK_PROGS(md5sum,[md5sum md5],no)
+if test $md5sum = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([Unable to find the md5sum application (or equivalent)])],
+ $1)
+fi
+])
diff --git a/m4/ax_prog_nasm.m4 b/m4/ax_prog_nasm.m4
new file mode 100644
index 0000000..e9c30dc
--- /dev/null
+++ b/m4/ax_prog_nasm.m4
@@ -0,0 +1,45 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_nasm.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_NASM([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro searches for the NASM assembler and sets the variable "nasm"
+# to the name of the application or to "no" if not found. If
+# ACTION-IF-NOT-FOUND is not specified, configure will fail when the
+# program is not found.
+#
+# Example:
+#
+# AX_PROG_NASM()
+# AX_PROG_NASM([nasm_avail="no"])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bogdan Drozdowski <bogdandr # op . pl>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([AX_PROG_NASM],[
+AC_CHECK_PROGS(nasm,[nasm],no)
+if test $nasm = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([NASM assembler not found])],
+ $1)
+fi
+])
diff --git a/m4/ax_prog_nasm_opt.m4 b/m4/ax_prog_nasm_opt.m4
new file mode 100644
index 0000000..29daaf6
--- /dev/null
+++ b/m4/ax_prog_nasm_opt.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_nasm_opt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_NASM_OPT(option, var_name)
+#
+# DESCRIPTION
+#
+# This macro checks if the NASM assembler accepts the given option. If
+# yes, the option is appended to the variable 'var_name', otherwise
+# 'var_name' is unchanged.
+#
+# Example:
+#
+# AX_PROG_NASM_OPT([-f obj], [NASM_OPTS])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bogdan Drozdowski <bogdandr # op . pl>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([AX_PROG_NASM_OPT],[
+AC_REQUIRE([AX_PROG_NASM])dnl
+AC_MSG_CHECKING([if $nasm accepts $1])
+echo '' > conftest.asm
+if $nasm $$2 $1 conftest.asm > conftest.err; then
+ $2="$$2 $1"
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+])
diff --git a/m4/ax_prog_perl_version.m4 b/m4/ax_prog_perl_version.m4
new file mode 100644
index 0000000..8241747
--- /dev/null
+++ b/m4/ax_prog_perl_version.m4
@@ -0,0 +1,63 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_perl_version.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_PERL_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
+#
+# DESCRIPTION
+#
+# Makes sure that perl supports the version indicated. If true the shell
+# commands in ACTION-IF-TRUE are executed. If not the shell commands in
+# ACTION-IF-FALSE are run. Note if $PERL is not set (for example by
+# running AC_CHECK_PROG or AC_PATH_PROG) the macro will fail.
+#
+# Example:
+#
+# AC_PATH_PROG([PERL],[perl])
+# AX_PROG_PERL_VERSION([5.8.0],[ ... ],[ ... ])
+#
+# This will check to make sure that the perl you have supports at least
+# version 5.8.0.
+#
+# NOTE: This macro uses the $PERL variable to perform the check.
+# AX_WITH_PERL can be used to set that variable prior to running this
+# macro. The $PERL_VERSION variable will be valorized with the detected
+# version.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_PROG_PERL_VERSION],[
+ AC_REQUIRE([AC_PROG_SED])
+ AC_REQUIRE([AC_PROG_GREP])
+
+ AS_IF([test -n "$PERL"],[
+ ax_perl_version="$1"
+
+ AC_MSG_CHECKING([for perl version])
+ changequote(<<,>>)
+ perl_version=`$PERL --version 2>&1 | $GREP "This is perl" | $SED -e 's/.* v\([0-9]*\.[0-9]*\.[0-9]*\) .*/\1/'`
+ changequote([,])
+ AC_MSG_RESULT($perl_version)
+
+ AC_SUBST([PERL_VERSION],[$perl_version])
+
+ AX_COMPARE_VERSION([$ax_perl_version],[le],[$perl_version],[
+ :
+ $2
+ ],[
+ :
+ $3
+ ])
+ ],[
+ AC_MSG_WARN([could not find the perl interpreter])
+ $3
+ ])
+])
diff --git a/m4/ax_prog_python_version.m4 b/m4/ax_prog_python_version.m4
new file mode 100644
index 0000000..886b5af
--- /dev/null
+++ b/m4/ax_prog_python_version.m4
@@ -0,0 +1,63 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_python_version.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_PYTHON_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
+#
+# DESCRIPTION
+#
+# Makes sure that python supports the version indicated. If true the shell
+# commands in ACTION-IF-TRUE are executed. If not the shell commands in
+# ACTION-IF-FALSE are run. Note if $PYTHON is not set (for example by
+# running AC_CHECK_PROG or AC_PATH_PROG) the macro will fail.
+#
+# Example:
+#
+# AC_PATH_PROG([PYTHON],[python])
+# AX_PROG_PYTHON_VERSION([2.4.4],[ ... ],[ ... ])
+#
+# This will check to make sure that the python you have supports at least
+# version 2.4.4.
+#
+# NOTE: This macro uses the $PYTHON variable to perform the check.
+# AX_WITH_PYTHON can be used to set that variable prior to running this
+# macro. The $PYTHON_VERSION variable will be valorized with the detected
+# version.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_PROG_PYTHON_VERSION],[
+ AC_REQUIRE([AC_PROG_SED])
+ AC_REQUIRE([AC_PROG_GREP])
+
+ AS_IF([test -n "$PYTHON"],[
+ ax_python_version="$1"
+
+ AC_MSG_CHECKING([for python version])
+ changequote(<<,>>)
+ python_version=`$PYTHON -V 2>&1 | $GREP "^Python " | $SED -e 's/^.* \([0-9]*\.[0-9]*\.[0-9]*\)/\1/'`
+ changequote([,])
+ AC_MSG_RESULT($python_version)
+
+ AC_SUBST([PYTHON_VERSION],[$python_version])
+
+ AX_COMPARE_VERSION([$ax_python_version],[le],[$python_version],[
+ :
+ $2
+ ],[
+ :
+ $3
+ ])
+ ],[
+ AC_MSG_WARN([could not find the python interpreter])
+ $3
+ ])
+])
diff --git a/m4/ax_prog_ruby_version.m4 b/m4/ax_prog_ruby_version.m4
new file mode 100644
index 0000000..6b11cfd
--- /dev/null
+++ b/m4/ax_prog_ruby_version.m4
@@ -0,0 +1,63 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_ruby_version.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_RUBY_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
+#
+# DESCRIPTION
+#
+# Makes sure that ruby supports the version indicated. If true the shell
+# commands in ACTION-IF-TRUE are executed. If not the shell commands in
+# ACTION-IF-FALSE are run. Note if $RUBY is not set (for example by
+# running AC_CHECK_PROG or AC_PATH_PROG) the macro will fail.
+#
+# Example:
+#
+# AC_PATH_PROG([RUBY],[ruby])
+# AC_PROG_RUBY_VERSION([1.8.0],[ ... ],[ ... ])
+#
+# This will check to make sure that the ruby you have supports at least
+# version 1.6.0.
+#
+# NOTE: This macro uses the $RUBY variable to perform the check.
+# AX_WITH_RUBY can be used to set that variable prior to running this
+# macro. The $RUBY_VERSION variable will be valorized with the detected
+# version.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_PROG_RUBY_VERSION],[
+ AC_REQUIRE([AC_PROG_SED])
+ AC_REQUIRE([AC_PROG_GREP])
+
+ AS_IF([test -n "$RUBY"],[
+ ax_ruby_version="$1"
+
+ AC_MSG_CHECKING([for ruby version])
+ changequote(<<,>>)
+ ruby_version=`$RUBY --version 2>&1 | $GREP "^ruby " | $SED -e 's/^.* \([0-9]*\.[0-9]*\.[0-9]*\) .*/\1/'`
+ changequote([,])
+ AC_MSG_RESULT($ruby_version)
+
+ AC_SUBST([RUBY_VERSION],[$ruby_version])
+
+ AX_COMPARE_VERSION([$ax_ruby_version],[le],[$ruby_version],[
+ :
+ $2
+ ],[
+ :
+ $3
+ ])
+ ],[
+ AC_MSG_WARN([could not find the ruby interpreter])
+ $3
+ ])
+])
diff --git a/m4/ax_prog_tasm.m4 b/m4/ax_prog_tasm.m4
new file mode 100644
index 0000000..5c1a6d2
--- /dev/null
+++ b/m4/ax_prog_tasm.m4
@@ -0,0 +1,45 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_tasm.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_TASM([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro searches for the TASM assembler and sets the variable "tasm"
+# to the name of the application or to "no" if not found. If
+# ACTION-IF-NOT-FOUND is not specified, configure will fail when the
+# program is not found.
+#
+# Example:
+#
+# AX_PROG_TASM()
+# AX_PROG_TASM([tasm_avail="no"])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bogdan Drozdowski <bogdandr # op . pl>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([AX_PROG_TASM],[
+AC_CHECK_PROGS(tasm,[tasm tasm32],no)
+if test $tasm = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([TASM assembler not found])],
+ $1)
+fi
+])
diff --git a/m4/ax_prog_tasm_opt.m4 b/m4/ax_prog_tasm_opt.m4
new file mode 100644
index 0000000..4521efd
--- /dev/null
+++ b/m4/ax_prog_tasm_opt.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_tasm_opt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_TASM_OPT(option, var_name)
+#
+# DESCRIPTION
+#
+# This macro checks if the TASM assembler accepts the given option. If
+# yes, the option is appended to the variable 'var_name', otherwise
+# 'var_name' is unchanged.
+#
+# Example:
+#
+# AX_PROG_TASM_OPT([/z], [TASM_OPTS])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bogdan Drozdowski <bogdandr # op . pl>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([AX_PROG_TASM_OPT],[
+AC_REQUIRE([AX_PROG_TASM])dnl
+AC_MSG_CHECKING([if $tasm accepts $1])
+echo '' > conftest.asm
+if $tasm $$2 $1 conftest.asm > conftest.err; then
+ $2="$$2 $1"
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+])
diff --git a/m4/ax_prog_tcl.m4 b/m4/ax_prog_tcl.m4
new file mode 100644
index 0000000..3fadb64
--- /dev/null
+++ b/m4/ax_prog_tcl.m4
@@ -0,0 +1,78 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_tcl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_TCL([min-version])
+#
+# DESCRIPTION
+#
+# Searches for tcl (tclsh and wish) in PATH and checks which version is
+# installed. The macro bails out if either tcl is not found or the minimum
+# version is not satisfied, unless minimum version is "0".
+#
+# Example:
+#
+# AX_PROG_TCL
+#
+# This checks for tcl and if not found, exits with an error. If found, it
+# prints tcl path and version number.
+#
+# AX_PROG_TCL([8.0])
+#
+# Checks for tcl and exits with an error if its not found or the version
+# is below 8.0.
+#
+# LICENSE
+#
+# Copyright (c) 2008 David Cluytens
+# Copyright (c) 2008 Uwe Mayer <merkosh@hadiko.de>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_PROG_TCL], [
+#-- check for tclsh in PATH
+AC_PATH_PROG([TCLSH], [tclsh], [no])
+if [(test x"$TCLSH" == x"no") && (test x"$1" != x"0")]; then
+ AC_MSG_ERROR([tclsh not found])
+fi
+
+#-- check for wish in PATH
+AC_PATH_PROG([WISH], [wish], [no])
+
+#-- check vor tcl version
+AC_MSG_CHECKING([tcl version])
+version=`echo "puts [[set tcl_version]]" | tclsh -`
+AC_MSG_RESULT([$version])
+
+#-- compare tcl version with min-version
+required=$1
+if [(test x"$1" != x"") && (test "${required/./}" -gt "${version/./}")]; then
+ AC_MSG_ERROR([tcl version $1 required])
+fi
+])dnl
diff --git a/m4/ax_prog_yasm.m4 b/m4/ax_prog_yasm.m4
new file mode 100644
index 0000000..eacb276
--- /dev/null
+++ b/m4/ax_prog_yasm.m4
@@ -0,0 +1,45 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_yasm.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_YASM([ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro searches for the YASM assembler and sets the variable "yasm"
+# to the name of the application or to "no" if not found. If
+# ACTION-IF-NOT-FOUND is not specified, configure will fail when the
+# program is not found.
+#
+# Example:
+#
+# AX_PROG_YASM()
+# AX_PROG_YASM([yasm_avail="no"])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bogdan Drozdowski <bogdandr # op . pl>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([AX_PROG_YASM],[
+AC_CHECK_PROGS(yasm,[yasm],no)
+if test $yasm = "no" ;
+then
+ ifelse($#,0,[AC_MSG_ERROR([YASM assembler not found])],
+ $1)
+fi
+])
diff --git a/m4/ax_prog_yasm_opt.m4 b/m4/ax_prog_yasm_opt.m4
new file mode 100644
index 0000000..10cd054
--- /dev/null
+++ b/m4/ax_prog_yasm_opt.m4
@@ -0,0 +1,46 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_prog_yasm_opt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_YASM_OPT(option, var_name)
+#
+# DESCRIPTION
+#
+# This macro checks if the YASM assembler accepts the given option. If
+# yes, the option is appended to the variable 'var_name', otherwise
+# 'var_name' is unchanged.
+#
+# Example:
+#
+# AX_PROG_YASM_OPT([-f bin], [YASM_OPTS])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bogdan Drozdowski <bogdandr # op . pl>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([AX_PROG_YASM_OPT],[
+AC_REQUIRE([AX_PROG_YASM])dnl
+AC_MSG_CHECKING([if $yasm accepts $1])
+echo '' > conftest.asm
+if $yasm $$2 $1 conftest.asm > conftest.err; then
+ $2="$$2 $1"
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+])
diff --git a/m4/ax_python.m4 b/m4/ax_python.m4
new file mode 100644
index 0000000..e2bc293
--- /dev/null
+++ b/m4/ax_python.m4
@@ -0,0 +1,95 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_python.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PYTHON
+#
+# DESCRIPTION
+#
+# This macro does a complete Python development environment check.
+#
+# It recurses through several python versions (from 2.1 to 2.5 in this
+# version), looking for an executable. When it finds an executable, it
+# looks to find the header files and library.
+#
+# It sets PYTHON_BIN to the name of the python executable,
+# PYTHON_INCLUDE_DIR to the directory holding the header files, and
+# PYTHON_LIB to the name of the Python library.
+#
+# This macro calls AC_SUBST on PYTHON_BIN (via AC_CHECK_PROG),
+# PYTHON_INCLUDE_DIR and PYTHON_LIB.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Michael Tindal
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_PYTHON],
+[AC_MSG_CHECKING(for python build information)
+AC_MSG_RESULT([])
+for python in python2.5 python2.4 python2.3 python2.2 python2.1 python; do
+AC_CHECK_PROGS(PYTHON_BIN, [$python])
+ax_python_bin=$PYTHON_BIN
+if test x$ax_python_bin != x; then
+ AC_CHECK_LIB($ax_python_bin, main, ax_python_lib=$ax_python_bin, ax_python_lib=no)
+ AC_CHECK_HEADER([$ax_python_bin/Python.h],
+ [[ax_python_header=`locate $ax_python_bin/Python.h | sed -e s,/Python.h,,`]],
+ ax_python_header=no)
+ if test $ax_python_lib != no; then
+ if test $ax_python_header != no; then
+ break;
+ fi
+ fi
+fi
+done
+if test x$ax_python_bin = x; then
+ ax_python_bin=no
+fi
+if test x$ax_python_header = x; then
+ ax_python_header=no
+fi
+if test x$ax_python_lib = x; then
+ ax_python_lib=no
+fi
+
+AC_MSG_RESULT([ results of the Python check:])
+AC_MSG_RESULT([ Binary: $ax_python_bin])
+AC_MSG_RESULT([ Library: $ax_python_lib])
+AC_MSG_RESULT([ Include Dir: $ax_python_header])
+
+if test x$ax_python_header != xno; then
+ PYTHON_INCLUDE_DIR=$ax_python_header
+ AC_SUBST(PYTHON_INCLUDE_DIR)
+fi
+if test x$ax_python_lib != xno; then
+ PYTHON_LIB=$ax_python_lib
+ AC_SUBST(PYTHON_LIB)
+fi
+])dnl
diff --git a/m4/ax_python_config_var.m4 b/m4/ax_python_config_var.m4
new file mode 100644
index 0000000..44c9a1d
--- /dev/null
+++ b/m4/ax_python_config_var.m4
@@ -0,0 +1,111 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_python_config_var.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PYTHON_CONFIG_VAR(PYTHON_VARIABLE, [SHELL_VARIABLE])
+# AX_PYTHON_CONFIG_H
+# AX_PYTHON_MAKEFILE
+#
+# DESCRIPTION
+#
+# AX_PYTHON_CONFIG_VAR:
+#
+# Using the Python module distutils.sysconfig[1], return a Python
+# configuration variable. PYTHON_VARIABLE is the name of the variable to
+# request from Python, and SHELL_VARIABLE is the name of the shell
+# variable into which the results should be deposited. If SHELL_VARIABLE
+# is not specified, the macro wil prefix PY_ to the PYTHON_VARIABLE, e.g.,
+# LIBS -> PY_LIBS.
+#
+# SHELL_VARIABLE is AC_SUBST'd. No action is taken if an error occurs.
+# Note if $PYTHON is not set, AC_CHECK_PROG(PYTHON, python, python) will
+# be run.
+#
+# Example:
+#
+# AX_PYTHON_CONFIG_VAR(LINKFORSHARED, PY_LFS)
+#
+# AX_PYTHON_CONFIG_H:
+#
+# Using the Python module distutils.sysconfig[1], put the full pathname of
+# the config.h file used to compile Python into the shell variable
+# PY_CONFIG_H. PY_CONFIG_H is AC_SUBST'd. Note if $PYTHON is not set,
+# AC_CHECK_PROG(PYTHON, python, python) will be run.
+#
+# AX_PYTHON_MAKEFILE:
+#
+# Using the Python module distutils.sysconfig[1], put the full pathname of
+# the Makefile file used to compile Python into the shell variable
+# PY_MAKEFILE. PY_MAKEFILE is AC_SUBST'd. Note if $PYTHON is not set,
+# AC_CHECK_PROG(PYTHON, python, python) will be run.
+#
+# [1]
+# http://www.python.org/doc/current/dist/module-distutils.sysconfig.html
+#
+# LICENSE
+#
+# Copyright (c) 2008 Dustin J. Mitchell <dustin@cs.uchicago.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_PYTHON_CONFIG_VAR],
+[
+ AC_MSG_CHECKING(for Python config variable $1)
+ if test -z "$PYTHON"
+ then
+ AC_CHECK_PROG(PYTHON,python,python)
+ fi
+ py_error="no"
+ pyval=`$PYTHON -c "from distutils import sysconfig;dnl
+print sysconfig.get_config_var('$1')"` || py_error="yes"
+ if test "$py_error" = "yes"
+ then
+ AC_MSG_RESULT(no - an error occurred)
+ else
+ AC_MSG_RESULT($pyval)
+ m4_ifval([$2],[$2],[PY_$1])="$pyval"
+ AC_SUBST(m4_ifval([$2],[$2],[PY_$1]))
+ fi
+])
+
+AC_DEFUN([AX_PYTHON_CONFIG_H],
+[
+ AC_MSG_CHECKING(location of Python's config.h)
+ if test -z "$PYTHON"
+ then
+ AC_CHECK_PROG(PYTHON,python,python)
+ fi
+ py_error="no"
+ PY_CONFIG_H=`$PYTHON -c "from distutils import sysconfig;dnl
+print sysconfig.get_config_h_filename()"` || py_error = "yes"
+ if test "$py_error" = "yes"
+ then
+ AC_MSG_RESULT(no - an error occurred)
+ else
+ AC_MSG_RESULT($PY_CONFIG_H)
+ AC_SUBST(PY_CONFIG_H)
+ fi
+])
+
+AC_DEFUN([AX_PYTHON_MAKEFILE],
+[
+ AC_MSG_CHECKING(location of Python's Makefile)
+ if test -z "$PYTHON"
+ then
+ AC_CHECK_PROG(PYTHON,python,python)
+ fi
+ py_error="no"
+ PY_MAKEFILE=`$PYTHON -c "from distutils import sysconfig;dnl
+print sysconfig.get_makefile_filename()"` || py_error = "yes"
+ if test "$py_error" = "yes"
+ then
+ AC_MSG_RESULT(no - an error occurred)
+ else
+ AC_MSG_RESULT($PY_MAKEFILE)
+ AC_SUBST(PY_MAKEFILE)
+ fi
+])
diff --git a/m4/ax_require_one_func.m4 b/m4/ax_require_one_func.m4
new file mode 100644
index 0000000..283fdac
--- /dev/null
+++ b/m4/ax_require_one_func.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_require_one_func.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_REQUIRE_ONE_FUNC (FUNCTION..., [ACTION-IF-ANY-FOUND], [ACTION-IF-NONE-FOUND])
+#
+# DESCRIPTION
+#
+# AX_REQUIRE_ONE_FUNC is a simple wrapper for AC_CHECK_FUNCS. It calls
+# AC_CHECK_FUNCS on the list of functions named in the first argument,
+# then invokes ACTION-IF-ANY-FOUND if at least one of the functions exists
+# or ACTION-IF-NONE-FOUND if none of the functions exist.
+#
+# Here's an example:
+#
+# AX_REQUIRE_ONE_FUNC([posix_memalign memalign valloc], ,
+# [AC_MSG_ERROR([unable to allocate page-aligned memory])])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Scott Pakin <pakin@uiuc.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_REQUIRE_ONE_FUNC],
+[m4_define([ax_1func_cv], [AS_TR_SH(ax_cv_func_any_$1)])
+AC_CACHE_VAL([ax_1func_cv],
+ [ax_1func_cv=no
+ AC_CHECK_FUNCS([$1], [ax_1func_cv="$ax_1func_cv $ac_func"])])
+AS_IF([test "$ax_1func_cv" = "no"],
+ [$3],
+ [ax_1func_cv=`echo $ax_1func_cv | sed 's/^no //'`
+ $2])
+])
diff --git a/m4/ax_ruby_devel.m4 b/m4/ax_ruby_devel.m4
new file mode 100644
index 0000000..53e726e
--- /dev/null
+++ b/m4/ax_ruby_devel.m4
@@ -0,0 +1,170 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_ruby_devel.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_RUBY_DEVEL([version])
+#
+# DESCRIPTION
+#
+# This macro checks for Ruby and tries to get the include path to
+# 'ruby.h'. It provides the $(RUBY_CPPFLAGS) and $(RUBY_LDFLAGS) output
+# variables. It also exports $(RUBY_EXTRA_LIBS) for embedding Ruby in your
+# code.
+#
+# You can search for some particular version of Ruby by passing a
+# parameter to this macro, for example "1.8.6".
+#
+# LICENSE
+#
+# Copyright (c) 2008 Rafal Rzepecki <divided.mind@gmail.com>
+# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de>
+# Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
+# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net>
+# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
+# Copyright (c) 2008 Matteo Settenvini <matteo@member.fsf.org>
+# Copyright (c) 2008 Horst Knorr <hk_classes@knoda.org>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_RUBY_DEVEL],[
+ AC_REQUIRE([AX_WITH_RUBY])
+ AS_IF([test -n "$1"], [AX_PROG_RUBY_VERSION([$1])])
+
+ #
+ # Check if you have mkmf, else fail
+ #
+ AC_MSG_CHECKING([for the mkmf Ruby package])
+ ac_mkmf_result=`$RUBY -rmkmf -e ";" 2>&1`
+ if test -z "$ac_mkmf_result"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([cannot import Ruby module "mkmf".
+Please check your Ruby installation. The error was:
+$ac_distutils_result])
+ fi
+
+ #
+ # Check for Ruby include path
+ #
+ AC_MSG_CHECKING([for Ruby include path])
+ if test -z "$RUBY_CPPFLAGS"; then
+ ruby_path=`$RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]]'`
+ if test -n "${ruby_path}"; then
+ ruby_path="-I$ruby_path"
+ fi
+ RUBY_CPPFLAGS=$ruby_path
+ fi
+ AC_MSG_RESULT([$RUBY_CPPFLAGS])
+ AC_SUBST([RUBY_CPPFLAGS])
+
+ #
+ # Check for Ruby library path
+ #
+ AC_MSG_CHECKING([for Ruby library path])
+ if test -z "$RUBY_LDFLAGS"; then
+ RUBY_LDFLAGS=`$RUBY -rmkmf -e 'print Config::CONFIG[["LIBRUBYARG_SHARED"]]'`
+ fi
+ AC_MSG_RESULT([$RUBY_LDFLAGS])
+ AC_SUBST([RUBY_LDFLAGS])
+
+ #
+ # Check for site packages
+ #
+ AC_MSG_CHECKING([for Ruby site-packages path])
+ if test -z "$RUBY_SITE_PKG"; then
+ RUBY_SITE_PKG=`$RUBY -rmkmf -e 'print Config::CONFIG[["sitearchdir"]]'`
+ fi
+ AC_MSG_RESULT([$RUBY_SITE_PKG])
+ AC_SUBST([RUBY_SITE_PKG])
+
+ #
+ # libraries which must be linked in when embedding
+ #
+ AC_MSG_CHECKING(ruby extra libraries)
+ if test -z "$RUBY_EXTRA_LIBS"; then
+ RUBY_EXTRA_LIBS=`$RUBY -rmkmf -e 'print Config::CONFIG[["SOLIBS"]]'`
+ fi
+ AC_MSG_RESULT([$RUBY_EXTRA_LIBS])
+ AC_SUBST(RUBY_EXTRA_LIBS)
+
+ #
+ # linking flags needed when embedding
+ # (is it even needed for Ruby?)
+ #
+ # AC_MSG_CHECKING(ruby extra linking flags)
+ # if test -z "$RUBY_EXTRA_LDFLAGS"; then
+ # RUBY_EXTRA_LDFLAGS=`$RUBY -rmkmf -e 'print Config::CONFIG[["LINKFORSHARED"]]'`
+ # fi
+ # AC_MSG_RESULT([$RUBY_EXTRA_LDFLAGS])
+ # AC_SUBST(RUBY_EXTRA_LDFLAGS)
+
+ # this flags breaks ruby.h, and is sometimes defined by KDE m4 macros
+ CFLAGS="`echo "$CFLAGS" | sed -e 's/-std=iso9899:1990//g;'`"
+ #
+ # final check to see if everything compiles alright
+ #
+ AC_MSG_CHECKING([consistency of all components of ruby development environment])
+ AC_LANG_PUSH([C])
+ # save current global flags
+ ac_save_LIBS="$LIBS"
+ LIBS="$ac_save_LIBS $RUBY_LDFLAGS"
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$ac_save_CPPFLAGS $RUBY_CPPFLAGS"
+ AC_TRY_LINK([
+ #include <ruby.h>
+ ],[
+ ruby_init();
+ ],[rubyexists=yes],[rubyexists=no])
+
+ AC_MSG_RESULT([$rubyexists])
+
+ if test ! "$rubyexists" = "yes"; then
+ AC_MSG_ERROR([
+ Could not link test program to Ruby. Maybe the main Ruby library has been
+ installed in some non-standard library path. If so, pass it to configure,
+ via the LDFLAGS environment variable.
+ Example: ./configure LDFLAGS="-L/usr/non-standard-path/ruby/lib"
+ ============================================================================
+ ERROR!
+ You probably have to install the development version of the Ruby package
+ for your distribution. The exact name of this package varies among them.
+ ============================================================================
+ ])
+ RUBY_VERSION=""
+ fi
+ AC_LANG_POP
+ # turn back to default flags
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIBS="$ac_save_LIBS"
+
+ #
+ # all done!
+ #
+])
diff --git a/m4/ax_silent_mode.m4 b/m4/ax_silent_mode.m4
new file mode 100644
index 0000000..4d45f11
--- /dev/null
+++ b/m4/ax_silent_mode.m4
@@ -0,0 +1,41 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_silent_mode.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_SILENT_MODE(on|off)
+#
+# DESCRIPTION
+#
+# Temporarily disable console output when running Autoconf macros. For
+# example:
+#
+# AX_SILENT_MODE(on) dnl disable console output
+# AC_PROG_CXX
+# AX_SILENT_MODE(off) dnl enable console output
+# AC_PROG_RANLIB
+#
+# LICENSE
+#
+# Copyright (c) 2008 Peter Simons <simons@cryp.to>
+# Copyright (c) 2008 Paolo Bonzini <bonzini@gnu.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_SILENT_MODE],
+ [
+ case "$1" in
+ on)
+ exec 6>/dev/null
+ ;;
+ off)
+ exec 6>&1
+ ;;
+ *)
+ AC_MSG_ERROR([Silent mode can only be switched "on" or "off".])
+ ;;
+ esac
+ ])dnl
diff --git a/m4/ax_spec_file.m4 b/m4/ax_spec_file.m4
new file mode 100644
index 0000000..352ed10
--- /dev/null
+++ b/m4/ax_spec_file.m4
@@ -0,0 +1,131 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_spec_file.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_SPEC_FILE [(rpmspecfile [,subdirpath])]
+#
+# DESCRIPTION
+#
+# set the specfile - if no argument has been given then check whether the
+# ac_unique_file looks like a .spec file and use it. This macro is
+# ac_REQUIRED by many AX_SPEC_ routines.
+#
+# the AX_SPEC_EXTRACT macro is a helper used by many AX_SPEC_ routines and
+# therefore placed here to be automatically included in the macro set of
+# (older) aclocal/acinclude.
+#
+# AX_SPEC_EXTRACT(shellvar [,specvar [,defaultvalue]])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_SPEC_FILE],
+[ AC_MSG_CHECKING([rpm spec file])
+ if test ".$1" != "." ; then
+ ax_spec_file_="$1"
+ ax_spec_file=`basename $1`
+ else
+ case ".$ac_unique_file" in
+ *.spec) ax_spec_file="$ac_unique_file"
+ ax_spec_file_="$ac_unique_file" ;;
+ *) ax_spec_file="TODO"
+ if test ".$PACKAGE" != "."
+ then ax_spec_file_="$PACKAGE.spec"
+ else ax_spec_file_="README"
+ fi
+ cat m4_ifset([AS_MESSAGE_LOG_FD],[>&AS_MESSAGE_LOG_FD],[>>config.log]) <<EOF
+ no ax_spec_file argument has been given, using defaults of
+ (1) $ax_spec_file_
+ (2) $ax_spec_file
+EOF
+ ;;
+ esac
+ fi
+ # find specfile
+ for i in ifelse($2,,,$2) . $srcdir $srcdir/.. .. ; do
+ if test -f "$i/$ax_spec_file_" ; then
+ ax_spec_dir="$i"
+ ax_spec_file="$ax_spec_dir/$ax_spec_file_"
+ break
+ fi
+ if test -f "$i/$ax_spec_file" ; then
+ ax_spec_dir="$i"
+ ax_spec_file="$ax_spec_dir/$ax_spec_file"
+ break
+ fi
+ done
+ case "$ax_spec_file" in
+ ./*) if test "$ax_spec_file" = "./$ax_spec_file_" ; then
+ ax_spec_file="$ax_spec_file_"
+ fi
+ AC_MSG_RESULT([$ax_spec_file]) ;;
+ */*) AC_MSG_RESULT([$ax_spec_file]) ;;
+ *) AC_MSG_ERROR([no rpm spec file found]) ;;
+ esac
+ m4_define([m4_ax_spec_file],[ax_spec_file])
+])
+
+dnl AX_SPEC_EXTRACT(shellvar [,specvar [,defaultvalue]])
+
+AC_DEFUN([AX_SPEC_EXTRACT],
+[
+ if test ".$[]$1" = "." ; then
+ $1=`grep -i '^[[ ]]*m4_ifval([$2],[$2],[$1])[[ ]]*:' dnl
+ "$ax_spec_file" | sed -e 's/.*:[[ ]]*//' dnl
+ -e 's/[[ ]][[ ]]*/ /g' -e 's/^ //' -e 's/ $[]//' -e 'q'`
+ if test ".$[]$1" = "." ; then
+ for $1 in $2 $1 m4_tolower([$1]) ; do
+ $1=`echo "$[]$1" | sed -e 's/^%//g'`
+ $1=`sed dnl
+ -e "/^%[[ ]]*def[]ine[[ ]][[ ]]*$[]$1[[ ]]/!d" dnl
+ -e "s/^%[[ ]]*def[]ine[[ ]][[ ]]*$[]$1[[ ]]*//" dnl
+ -e 's/[[ ]][[ ]]*/ /' -e 's/ $[]//' -e 'q' $ax_spec_file`
+ test ".$1" != "." && break
+ done
+ fi
+ case ".$[]$1" in
+ .%{*)
+ $1=`echo "$[]$1" | sed -e 's/%{//' -e 's/}$[]//'`
+ $1=`sed dnl
+ -e "/^%[[ ]]*def[]ine[[ ]][[ ]]*$[]$1[[ ]]/!d" dnl
+ -e "s/^%[[ ]]*def[]ine[[ ]][[ ]]*$[]$1[[ ]]*//" dnl
+ -e 's/[[ ]][[ ]]*/ /' -e 's/ $[]//' -e 'q' $ax_spec_file` ;;
+ .%*)
+ $1=`echo "$[]$1" | sed -e 's/%//'`
+ $1=`sed dnl
+ -e "/^%[[ ]]*def[]ine[[ ]][[ ]]*$[]$1[[ ]]/!d" dnl
+ -e "s/^%[[ ]]*def[]ine[[ ]][[ ]]*$[]$1[[ ]]*//" dnl
+ -e 's/[[ ]][[ ]]*/ /' -e 's/ $[]//' -e 'q' $ax_spec_file` ;;
+ esac
+ m4_ifval([$3],[test ".$[]$1" = "." && $1="$3"])
+ fi # test ".$[]$1" = "."
+])
diff --git a/m4/ax_spec_package_version.m4 b/m4/ax_spec_package_version.m4
new file mode 100644
index 0000000..9314608
--- /dev/null
+++ b/m4/ax_spec_package_version.m4
@@ -0,0 +1,258 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_spec_package_version.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_SPEC_PACKAGE_AND_VERSION ([specfile])
+# AX_SPEC_PACKAGE_NAME ([shellvar],[defaultvalue])
+# AX_SPEC_PACKAGE_VERSION ([shellvar],[defaultvalue])
+# AX_SPEC_PACKAGE_SUMMARY ([shellvar],[defaultvalue])
+# AX_SPEC_PACKAGE_LICENSE ([shellvar],[defaultvalue])
+# AX_SPEC_PACKAGE_CATEGORY ([shellvar],[defaultvalue])
+# AX_SPEC_PACKAGE_ICON ([shellvar],[defaultvalue])
+# AX_SPEC_DEFAULTS([specfile])
+#
+# DESCRIPTION
+#
+# set PACKAGE from the given specfile - default to basename of the
+# rpmspecfile if no "name:" could be found in the spec file.
+#
+# set VERSION from the given specfile - default to a date-derived value if
+# no "version:" could be found in the spec file.
+#
+# this macro builds on top of AX_SPEC_FILE / AX_SPEC_EXTRACT
+#
+# more specific: if not "name:" or "%define name" was found in the
+# myproject.spec file then the PACKAGE var is set to the basename
+# "myproject". When no spec file was present then it will usually default
+# to "TODO".
+#
+# The version spec looks for "version:" or "%define version" in the spec
+# file. When no such value was seen or no spec file had been present then
+# the value is set to `date +0.%y.%W%w`.
+#
+# the version value itself is sanitized somewhat with making it to always
+# carry atleast three digits (1.2.3) and clensing superflous "0" chars
+# around from generating numbers elsewhere.
+#
+# additional macros are provided that extract a specific value from the
+# spec file, among these:
+#
+# set PACKAGE_SUMMARY from the given specfile - default to package and try
+# to detect a type suffix if "summary:" was not in the spec file
+#
+# set PACKAGE_LICENSE from the given specfile - if no "license:" tag was
+# given in the spec file then various COPYING files are grepped to have a
+# guess and the final fallback will be GNU GPL (or GNU LGPL).
+#
+# set PACKAGE_ICON from the given specfile - if no "icon:" tag was given
+# in the spec file then we default to $PACKAGE-icon.png
+#
+# the final AX_SPEC_INIT(specfile) will initialize all variables to its
+# defaults according to the spec file given.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_SPEC_PACKAGE_LICENSE],[AC_REQUIRE([AX_SPEC_FILE])dnl
+ AS_VAR_PUSHDEF([VAR],[PACKAGE_LICENSE])dnl
+ AC_MSG_CHECKING([for spec license type])
+ if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
+ then k="(w/o spec)"
+ else k=""
+ AX_SPEC_EXTRACT(VAR,[license],m4_ifval($1,$1))
+ VAR=`echo $VAR | sed -e 's/ *License//g'`
+ fi fi
+ test ".$VAR" = "." && k="(fallback)"
+ ifelse($2,,[dnl here the defaults for LICENSE / COPYRIGHT
+ if test ".$VAR" = "." ; then
+ for ac_file in "$srcdir/COPYING" "$srcdir/COPYING" "$srcdir/LICENSE" ; do
+ test -f "$ac_file" || continue
+dnl http://www.ibiblio.org/osrt/omf/omf_elements "16. Rights"
+ if grep "GNU LESSER GENERAL PUBLIC LICENSE" "$ac_file" >/dev/null
+ then VAR="GNU LGPL" ; break
+ elif grep "GNU GENERAL PUBLIC LICENSE" "$ac_file" >/dev/null
+ then VAR="GNU GPL" ; break
+ elif grep "MOZILLA PUBLIC LICENSE" "$ac_file" >/dev/null
+ then VAR="MPL" ; break
+ elif grep "Mozilla Public License" "$ac_file" >/dev/null
+ then VAR="MPL" ; break
+ elif grep -i "artistic license" "$ac_file" >/dev/null
+ then VAR="Artistic" ; break
+ elif grep -i "artistic control" "$ac_file" >/dev/null
+ then VAR="Artistic" ; break
+ elif grep -i "semblance of artistic" "$ac_file" >/dev/null
+ then VAR="Artistic" ; break
+ elif grep -i "above copyright notice" "$ac_file" >/dev/null
+ then VAR="BSD" ; break
+ fi
+ done
+ if test ".$VAR" = "." ; then
+ if test "$srcdir/COPYING.LIB" ; then VAR="GNU LGPL"
+ elif test ".$ltmain" != "." ; then VAR="GNU LGPL"
+ else VAR="GNU GPL"
+ fi
+ fi
+ fi
+ ],[test ".$VAR" = "." && VAR="$2"])
+ test "$VAR" = "GPL" && VAR="GNU GPL"
+ test "$VAR" = "LGPL" && VAR="GNU LGPL"
+ AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
+ AS_VAR_POPDEF([VAR])dnl
+])
+
+AC_DEFUN([AX_SPEC_PACKAGE_SUMMARY],[AC_REQUIRE([AX_SPEC_FILE])dnl
+ AS_VAR_PUSHDEF([VAR],[PACKAGE_SUMMARY])dnl
+ AC_MSG_CHECKING([for spec summary])
+ if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
+ then k="(w/o spec)"
+ else k=""
+ AX_SPEC_EXTRACT(VAR,[summary],m4_ifval($1,$1))
+ fi fi
+ test ".$VAR" = "." && k="(fallback)"
+ ifelse($2,,[dnl here the defaults for SUMMARY
+ if test ".$VAR" = "." ; then VAR="$PACKAGE"
+ test ".$VAR" = "." && VAR="foo"
+ test ".$ltmain" != "." && VAR="$VAR library"
+ fi
+ ],[test ".$VAR" = "." && VAR="$2"])
+ AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
+ AS_VAR_POPDEF([VAR])dnl
+])
+
+AC_DEFUN([AX_SPEC_PACKAGE_ICON],[AC_REQUIRE([AX_SPEC_FILE])dnl
+ AS_VAR_PUSHDEF([VAR],[PACKAGE_ICON])dnl
+ AC_MSG_CHECKING([for spec icon])
+ if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
+ then k="(w/o spec)"
+ else k=""
+ AX_SPEC_EXTRACT(VAR,[icon],m4_ifval($1,$1))
+ fi fi
+ test ".$VAR" = "." && k="(fallback)"
+ ifelse($2,,[dnl here the defaults for ICON
+ if test ".$VAR" = "." ; then VAR="$PACKAGE-icon.png" ; fi
+ ],[test ".$VAR" = "." && VAR="$2"])
+ AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
+ AS_VAR_POPDEF([VAR])dnl
+])
+
+AC_DEFUN([AX_SPEC_PACKAGE_CATEGORY],[AC_REQUIRE([AX_SPEC_FILE])dnl
+ AS_VAR_PUSHDEF([VAR],[PACKAGE_CATEGORY])dnl
+ AC_MSG_CHECKING([for spec category])
+ if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
+ then k="(w/o spec)"
+ else k=""
+ AX_SPEC_EXTRACT(VAR,[group],m4_ifval($1,$1))
+ VAR=`echo $VAR | sed -e 's/ /-/g'`
+ fi fi
+ test ".$VAR" = "." && k="(fallback)"
+ ifelse($2,,[dnl here the defaults for CATEGORY
+ if test ".$VAR" = "." ; then if test ".$ltmain" != "."
+ then VAR="Development/Library"
+ else VAR="Development/Other"
+ fi fi
+ ],[test ".$VAR" = "." && VAR="$2"])
+ AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
+ AS_VAR_POPDEF([VAR])dnl
+])
+
+AC_DEFUN([AX_SPEC_PACKAGE_NAME],[AC_REQUIRE([AX_SPEC_FILE])dnl
+ AS_VAR_PUSHDEF([VAR],[PACKAGE_NAME])dnl
+ AC_MSG_CHECKING([for spec package])
+ if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
+ then k="(w/o spec)"
+ else k=""
+ AX_SPEC_EXTRACT(VAR,[name],m4_ifval($1,$1))
+ VAR=`echo $VAR | sed -e 's/ /-/g'`
+ fi fi
+ test ".$VAR" = "." && k="(fallback)"
+ ifelse($2,,[dnl here the defaults for PACKAGE
+ test ".$VAR" = "." && VAR=`basename $ax_spec_file .spec`
+ test ".$VAR" = ".README" && VAR="TODO"
+ test ".$VAR" = ".TODO" && VAR="foo"
+ ],[test ".$VAR" = "." && VAR="$2"])
+ test "VAR" = "PACKAGE_NAME" && test ".$PACKAGE" = "." && PACKAGE="$VAR"
+ AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
+ AS_VAR_POPDEF([VAR])dnl
+])
+
+AC_DEFUN([AX_SPEC_PACKAGE_VERSION_],[AC_REQUIRE([AX_SPEC_FILE])dnl
+ AS_VAR_PUSHDEF([VAR],[PACKAGE_VERSION])dnl
+ AC_MSG_CHECKING([for spec version])
+ if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
+ then k="(w/o spec)"
+ else k=""
+ AX_SPEC_EXTRACT(VAR,[version],m4_ifval($1,$1))
+ VAR=`echo $VAR | sed -e 's/ /-/g'`
+ fi fi
+ test ".$VAR" = "." && k="(fallback)"
+ ifelse($2,,[dnl here the defaults for VERSION
+ test ".$VAR" = "." && VAR=`date +0.%y.%W%w`
+ ],[test ".$VAR" = "." && VAR="$2"])
+ test "VAR" = "PACKAGE_VERSION" && test ".$VERSION" = "." && VERSION="$VAR"
+ case "$VAR" in # note we set traditional VERSION before cleaning things up
+ *.*.) VAR="$VAR"`date +%W%w` ;;
+ *.*.*) ;;
+ *.) VAR="$VAR"`date +%y.%W%w` ;;
+ *.*) VAR="$VAR.0" ;;
+ *) VAR=AS_TR_SH([$VAR]) ; VAR="$VAR.`date +%y.%W%w`" ;;
+ esac
+ VAR=`echo $VAR | sed -e "s/[[.]][0]\\([0-9]\\)/.\\1/g"`
+ AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
+ AS_VAR_POPDEF([VAR])dnl
+])
+
+dnl for compatibility, we define ax_spec_package_version
+dnl to do all of ax_spec_package_name as well.
+AC_DEFUN([AX_SPEC_PACKAGE_VERSION],[AC_REQUIRE([AX_SPEC_FILE])dnl
+ ifelse($1,,
+ AC_MSG_WARN([please use ax_spec_package_AND_version now!]),
+ AC_MSG_ERROR([please use ax_spec_package_AND_version now!]))
+ AX_SPEC_PACKAGE_NAME
+ AX_SPEC_PACKAGE_VERSION_
+
+])
+
+AC_DEFUN([AX_SPEC_PACKAGE_AND_VERSION],[
+ m4_ifset([m4_ax_spec_file],,[AX_SPEC_FILE($1)])
+ AX_SPEC_PACKAGE_NAME
+ AX_SPEC_PACKAGE_VERSION_
+])
+
+AC_DEFUN([AX_SPEC_DEFAULTS],[
+ m4_ifset([m4_ax_spec_file],,[AX_SPEC_FILE($1)])
+ AX_SPEC_PACKAGE_NAME
+ AX_SPEC_PACKAGE_VERSION_
+ AX_SPEC_PACKAGE_LICENSE
+ AX_SPEC_PACKAGE_SUMMARY
+ AX_SPEC_PACKAGE_CATEGORY
+ AX_SPEC_PACKAGE_ICON
+])
diff --git a/m4/ax_split_version.m4 b/m4/ax_split_version.m4
new file mode 100644
index 0000000..2e9cc96
--- /dev/null
+++ b/m4/ax_split_version.m4
@@ -0,0 +1,34 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_split_version.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_SPLIT_VERSION
+#
+# DESCRIPTION
+#
+# Splits a version number in the format MAJOR.MINOR.POINT into it's
+# separeate components.
+#
+# Sets the variables.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_SPLIT_VERSION],[
+ AX_MAJOR_VERSION=`echo "$VERSION" | $SED 's/\([[^.]][[^.]]*\).*/\1/'`
+ AX_MINOR_VERSION=`echo "$VERSION" | $SED 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
+ AX_POINT_VERSION=`echo "$VERSION" | $SED 's/[[^.]][[^.]]*.[[^.]][[^.]]*.\(.*\)/\1/'`
+ AC_MSG_CHECKING([Major version])
+ AC_MSG_RESULT([$AX_MAJOR_VERSION])
+ AC_MSG_CHECKING([Minor version])
+ AC_MSG_RESULT([$AX_MINOR_VERSION])
+ AC_MSG_CHECKING([Point version])
+ AC_MSG_RESULT([$AX_POINT_VERSION])
+])
diff --git a/m4/ax_subst_with.m4 b/m4/ax_subst_with.m4
new file mode 100644
index 0000000..cdee883
--- /dev/null
+++ b/m4/ax_subst_with.m4
@@ -0,0 +1,151 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_subst_with.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_SUBST_WITH([varname])
+#
+# DESCRIPTION
+#
+# a very simple macro but also very helpful - the varname is usually the
+# one from an AC_ARG_ENABLE or AC_ARG_WITH option. it is transliterated
+# into uppercase and a prefix WITH_ and WITHOUT_ that are both _SUBSTed.
+#
+# Only one of these is set to "#" while the other is empty. In other words
+# a call like AC_WITHNONE(enable-call) will create two SUBST-symbols as
+# WITH_ENABLE_CALL and WITHOUT_ENABLE_CALL. When the varname had been set
+# to something not "no" or "0" or ":" or "false" then it results in
+#
+# WITH_ENABLE_CALL="" ; WITHOUT_ENABLE_CALL="#"
+#
+# which you can use in your Makefile quite easily as if using an
+# AM_CONDITIONAL but which can be also parsed by normal make
+#
+# USE = @WITH_ENABLE_CALL@ -Denabled USE = @WITHOUT_ENABLE_CALL@
+# -Dnot_enabled
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+dnl AX_SUBST_WITH_IF(flag,cond) - not unlike AM_CONDITIONAL
+AC_DEFUN([AX_SUBST_WITH_IF],[dnl
+pushdef([VAR_WITH], patsubst(translit([with_$1], [a-z], [A-Z]), -, _))dnl
+pushdef([VAR_WITHOUT], patsubst(translit([without_$1], [a-z], [A-Z]), -, _))dnl
+AC_SUBST(VAR_WITH)
+AC_SUBST(VAR_WITHOUT)
+if $2; then
+ VAR_WITH=""
+ VAR_WITHOUT="#"
+else
+ VAR_WITH="#"
+ VAR_WITHOUT=""
+fi
+popdef([VAR_WITHOUT])dnl
+popdef([VAR_WITH])dnl
+])
+
+dnl AX_SUBST_WITH(varname [,default]) - not unlike AM_CONDITIONAL
+AC_DEFUN([AX_SUBST_WITH],[dnl
+pushdef([VAR], patsubst(translit([with_$1], [A-Z], [a-z]), -, _))dnl
+pushdef([VAR_WITH], patsubst(translit([with_$1], [a-z], [A-Z]), -, _))dnl
+pushdef([VAR_WITHOUT], patsubst(translit([without_$1], [a-z], [A-Z]), -, _))dnl
+pushdef([VAR_WITHVAL], patsubst(translit([withval_$1], [a-z], [A-Z]), -, _))dnl
+AC_SUBST(VAR_WITH)
+AC_SUBST(VAR_WITHOUT)
+VAR_WITHVAL=`echo "$VAR"`
+test ".$VAR_WITHVAL" = "." && VAR_WITHVAL="m4_ifval([$2],[$2],no)"
+test ".$VAR_WITHVAL" = ".:" && VAR_WITHVAL="no"
+test ".$VAR_WITHVAL" = ".0" && VAR_WITHVAL="no"
+test ".$VAR_WITHVAL" = ".no" && VAR_WITHVAL="no"
+test ".$VAR_WITHVAL" = ".false" && VAR_WITHVAL="no"
+if test ".$VAR_WITHVAL" != ".no" ; then
+ VAR_WITH=""
+ VAR_WITHOUT="#"
+else
+ VAR_WITH="#"
+ VAR_WITHOUT=""
+fi
+popdef([VAR_WITHVAL])dnl
+popdef([VAR_WITHOUT])dnl
+popdef([VAR_WITH])dnl
+popdef([VAR])dnl
+])
+
+dnl AX_SUBST_WITH_DEFINE(varname [,default]) - not unlike AM_CONDITIONAL
+AC_DEFUN([AX_SUBST_WITH_DEFINE],[dnl
+pushdef([VAR], patsubst(translit([with_$1], [A-Z], [a-z]), -, _))dnl
+pushdef([VAR_WITH], patsubst(translit([with_$1], [a-z], [A-Z]), -, _))dnl
+pushdef([VAR_WITHOUT], patsubst(translit([without_$1], [a-z], [A-Z]), -, _))dnl
+pushdef([VAR_WITHVAL], patsubst(translit([withval_$1], [a-z], [A-Z]), -, _))dnl
+AC_SUBST(VAR_WITH)
+AC_SUBST(VAR_WITHOUT)
+VAR_WITHVAL=`echo "$VAR"`
+test ".$VAR_WITHVAL" = "." && VAR_WITHVAL="m4_ifval([$2],[$2],no)"
+test ".$VAR_WITHVAL" = ".:" && VAR_WITHVAL="no"
+test ".$VAR_WITHVAL" = ".0" && VAR_WITHVAL="no"
+test ".$VAR_WITHVAL" = ".no" && VAR_WITHVAL="no"
+test ".$VAR_WITHVAL" = ".false" && VAR_WITHVAL="no"
+if test ".$VAR_WITHVAL" != ".no" ; then
+ VAR_WITH=""
+ VAR_WITHOUT="#"
+ case "$VAR_WITHVAL" in
+ [[0123456789]]*) ;;
+ [yes)] VAR_WITHVAL="1" ;;
+ [*)] VAR_WITHVAL=`echo "\"$VAR_WITHVAL\"" | sed -e 's,"",",g'` ;;
+ esac
+else
+ VAR_WITH="#"
+ VAR_WITHOUT=""
+fi
+if test ".$VAR_WITHVAL" != ".no" ; then
+ AC_DEFINE_UNQUOTED(VAR_WITH, $VAR_WITHVAL,
+ [whether $1 feature is enabled])
+fi dnl
+popdef([VAR_WITHVAL])dnl
+popdef([VAR_WITHOUT])dnl
+popdef([VAR_WITH])dnl
+popdef([VAR])dnl
+])
+
+dnl backward compatibility helpers
+AC_DEFUN([AX_SUBST_WITH_ARG],[dnl
+pushdef([VAR], patsubst(translit([with_$1], [A-Z], [a-z]), -, _))dnl
+m4_ifvaln([$2],[test ".$VAR" = "." && VAR="$2"])dnl
+AX_SUBST_WITH([$1],[$2])
+popdef([VAR])dnl
+])
+
+AC_DEFUN([AX_SUBST_WITH_DEFINE_ARG],[dnl
+pushdef([VAR], patsubst(translit([with_$1], [A-Z], [a-z]), -, _))dnl
+m4_ifvaln([$2],[test ".$VAR" = "." && VAR="$2"])dnl
+AX_SUBST_WITH_DEFINE([$1],[$2])
+popdef([VAR])dnl
+])
diff --git a/m4/ax_sys_perlsharpbang.m4 b/m4/ax_sys_perlsharpbang.m4
new file mode 100644
index 0000000..44a00c8
--- /dev/null
+++ b/m4/ax_sys_perlsharpbang.m4
@@ -0,0 +1,135 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_sys_perlsharpbang.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_SYS_PERLSHARPBANG
+#
+# DESCRIPTION
+#
+# Determine how the perl interpreter is located by the OS kernel and make
+# substitution variable PERL_SHEBANG available. Does AC_PATH_PROG to find
+# the path to perl. As a side-effect, that sets PERLINTERP and makes it
+# available as a substitution variable.
+#
+# Note: The macro allows for the possibility (expected to be seldom used)
+# of an explicit user override (the "user" being the operator executing
+# the final 'configure' script, in this context) by making the option
+# argument like:
+#
+# --with-perl-shebang='#! /my/funky/perlpath' # OR
+# --with-perl-shebang='/my/funky/perlpath' # we just throw away the #! anyway
+# # bec it must be absent in Makefile
+#
+# Rationale: The are various ways of starting an interpreter on different
+# *nix-like systems. Many use the simple
+#
+# #!/usr/bin/perl
+#
+# but it could be instead
+#
+# #!/usr/local/bin/perl
+#
+# and there is even the possibility that the user wants
+#
+# #!/usr/bin/env perl
+#
+# to find whichever perl comes first in the current $PATH. This is
+# preferred by some of us because we run multiple perl installations on
+# the same box. Adjusting our $PATH then allows us to set precedence over
+# other perls, even whatever the "house" version is.
+#
+# Users on very non-unix systems like MS Windows do not have a kernel that
+# does this kind of thing from the first line of script files, but instead
+# the perl on their machine is started and merely notices whatever comes
+# after the interpreter path on this first line of the script (options
+# like "-w").
+#
+# Acknowledgement: this macro was in part inspired by Dean Povey's
+# AC_PROG_PERL_VERSION.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Soren Andersen <somian *AT* pobox |DOT| com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_SYS_PERLSHARPBANG],[dnl
+
+ AC_PATH_PROG(PERLINTERP,perl,perl)
+ ac_cv_path_perlinterp="$PERLINTERP"
+ _sHpB='#!'
+
+ AC_ARG_WITH(perl-shebang,
+ AC_HELP_STRING([--with-perl-shebang],
+ [override what perl thinks is the way for the kernel to start it (seldom needed)]dnl
+ ),
+ [opt_perl_shebang="$withval"]dnl
+ ,dnl
+ [opt_perl_shebang="not_set"]dnl
+ )dnl
+
+ AC_CACHE_CHECK([whether explicit instead of detected sharpbang is to be used],
+ ax_cv_opt_perl_shebang,
+ [ case "$opt_perl_shebang" in
+ not_set ) ax_cv_opt_perl_shebang=''
+ ;;
+ * )
+ ax_cv_opt_perl_shebang=`echo "$opt_perl_shebang" | sed -e's|^#!\s*\(.*\)$|\1|'`
+ esac
+ ]dnl
+ )dnl
+
+ if test "A$ax_cv_opt_perl_shebang" != "A"
+ then
+ ac_cv_sys_kernshrpbang_perl="$ax_cv_opt_perl_shebang"
+ PERL_SHEBANG="$ac_cv_sys_kernshrpbang_perl"
+ AC_SUBST(PERL_SHEBANG)dnl
+ AC_MSG_NOTICE([OK - PERL_SHEBANG is $_sHpB$PERL_SHEBANG.])
+
+# Automatic detection of sharpbang formula starts here
+ else dnl
+
+ _somian_shbangperl=`$PERLINTERP -V:startperl`
+ negclass="[[^']]"; dnl
+# must leave this comment: m4 will remove the outer brackets for us, heheh
+ AC_CACHE_CHECK([for kernel sharpbang invocation to start perl],
+ ac_cv_sys_kernshrpbang_perl,
+ [_somian_kspb_perl=`echo "$_somian_shbangperl" | sed -ne"s|.*='\($negclass*\)';$|\1|p"`
+ if test "x$_somian_kspb_perl" == x
+ then _somian_ksbp_warn_empty='durnit'
+ else
+ case "A$_somian_kspb_perl" in
+ A#!*perl* )
+ ac_cv_sys_kernshrpbang_perl=`echo "$_somian_kspb_perl" | sed -e's|#!\(.*\)$|\1|'`
+ ;;
+ A* ) _somian_ksbp_warn_defau='trouble'
+ ac_cv_sys_kernshrpbang_perl="$PERLINTERP"
+ esac
+ fi
+])dnl Done with testing sharpbang
+
+# The above prints Checking ... result message to user.
+ PERL_SHEBANG="$ac_cv_sys_kernshrpbang_perl"
+ AC_SUBST(PERL_SHEBANG)
+ if test A${_somian_ksbp_warn_empty+set} == Aset
+ then AC_MSG_WARN([dnl
+In last check, doing $PERLINTERP -V:startperl yielded empty result! That should not happen.])
+ fi
+# Inform user after printing result value
+ if test A${_somian_ksbp_warn_defau+set} == Aset
+ then AC_MSG_NOTICE([Maybe Not good -])
+ AC_MSG_WARN([dnl
+In last check perl's Config query did not work so we bunted: $_sHpB$PERLINTERP])
+ else AC_MSG_NOTICE([OK Good result - ])
+ AC_MSG_NOTICE([dnl
+In last check we got a proper-looking answer from perl's Config: $_somian_shbangperl])
+dnl Done with user info messages
+ fi
+dnl Outer loop checked for user override term here
+ fi dnl
+
+])dnl EOMACRO DEF
diff --git a/m4/ax_tls.m4 b/m4/ax_tls.m4
new file mode 100644
index 0000000..228110b
--- /dev/null
+++ b/m4/ax_tls.m4
@@ -0,0 +1,74 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_tls.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TLS
+#
+# DESCRIPTION
+#
+# Provides a test for the compiler support of thread local storage (TLS)
+# extensions. Defines TLS if it is found. Currently only knows about GCC
+# and MSVC. I think SunPro uses the same as GCC, and Borland apparently
+# supports either.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Alan Woodland <ajw05@aber.ac.uk>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_TLS], [
+ AC_MSG_CHECKING(for thread local storage (TLS) class)
+ AC_CACHE_VAL(ac_cv_tls, [
+ ax_tls_keywords="__thread __declspec(thread) none"
+ for ax_tls_keyword in $ax_tls_keywords; do
+ case $ax_tls_keyword in
+ none) ac_cv_tls=none ; break ;;
+ *)
+ AC_TRY_COMPILE(
+ [#include <stdlib.h>
+ static void
+ foo(void) {
+ static ] $ax_tls_keyword [ int bar;
+ exit(1);
+ }],
+ [],
+ [ac_cv_tls=$ax_tls_keyword ; break],
+ ac_cv_tls=none
+ )
+ esac
+ done
+])
+
+ if test "$ac_cv_tls" != "none"; then
+ dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
+ AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
+ fi
+ AC_MSG_RESULT($ac_cv_tls)
+])
diff --git a/m4/ax_trilinos_amesos.m4 b/m4/ax_trilinos_amesos.m4
new file mode 100644
index 0000000..ebe6039
--- /dev/null
+++ b/m4/ax_trilinos_amesos.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_amesos.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_AMESOS([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# On success, adds "include Makefile.export.amesos" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_AMESOS],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ ax_trilinos_amesos=yes
+ AC_HAVE_LIBRARY([amesos],[:],[ax_trilinos_amesos=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([amesos.macros],[ax_trilinos_amesos=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([amesos],[ax_trilinos_amesos=no])
+ if test "$ax_trilinos_amesos" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Amesos not found.]),
+ [$2])
+ fi
+])
diff --git a/m4/ax_trilinos_base.m4 b/m4/ax_trilinos_base.m4
new file mode 100644
index 0000000..22298e2
--- /dev/null
+++ b/m4/ax_trilinos_base.m4
@@ -0,0 +1,145 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_base.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_BASE([, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+#
+# DESCRIPTION
+#
+# Test for the Trilinos (http://trilinos.sandia.gov/) libraries.
+#
+# Provides a --with-trilinos=DIR option. Searches --with-trilinos,
+# $TRILINOS_HOME, and the usual places for Trilinos installation headers.
+#
+# Requires that a development branch or released version greater than
+# MINIMUM-VERSION be found. If not specified, the default minimum version
+# is 8.0.0.
+#
+# Supports separately specifying --with-trilinos-include or
+# --with-trilinos-libdir to override default locations underneath either
+# --with-trilinos or $TRILINOS_HOME.
+#
+# On success, adds -Ipath to CPPFLAGS, -Lpath to LDFLAGS, sets the
+# variable TRILINOS_INCLUDE based on the discovered location of
+# Trilinos_version.h, and #defines HAVE_TRILINOS. When ACTION-IF-NOT-FOUND
+# is not specified, the default behavior is for configure to fail.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
+# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
+# Copyright (c) 2009 Caolan McNamara <caolan@skynet.ie>
+# Copyright (c) 2009 Alexandre Duret-Lutz <adl@gnu.org>
+# Copyright (c) 2009 Matthew Mueller <donut@azstarnet.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_BASE],
+[
+AC_REQUIRE([gl_TRILINOS_ABSOLUTE_HEADER])
+AC_ARG_VAR(TRILINOS_HOME,[root directory of Trilinos installation])
+
+AC_ARG_WITH(trilinos, [AS_HELP_STRING([--with-trilinos[=DIR]],[root directory of Trilinos installation])],[
+with_trilinos=$withval
+if test "${with_trilinos}" != yes; then
+ TRILINOS_HOME=$withval
+ trilinos_include="$withval/include"
+ trilinos_libdir="$withval/lib"
+fi
+],[
+with_trilinos=$withval
+if test "x${TRILINOS_HOME}" != "x"; then
+ trilinos_include="${TRILINOS_HOME}/include"
+ trilinos_libdir="${TRILINOS_HOME}/lib"
+fi
+])
+
+AC_ARG_WITH(trilinos-include,
+[AS_HELP_STRING([--with-trilinos-include=DIR],[specify exact directory for Trilinos headers])],[
+if test -d "$withval"; then
+ trilinos_include="$withval"
+else
+ AC_MSG_ERROR([--with-trilinos-include expected directory name])
+fi
+])
+
+AC_ARG_WITH(trilinos-libdir, [AS_HELP_STRING([--with-trilinos-libdir=DIR],[specify exact directory for Trilinos libraries])],[
+if test -d "$withval"; then
+ trilinos_libdir="$withval"
+else
+ AC_MSG_ERROR([--with-trilinos-libdir expected directory name])
+fi
+])
+
+if test "${with_trilinos}" != no ; then
+
+ OLD_LIBS=$LIBS
+ OLD_LDFLAGS=$LDFLAGS
+ OLD_CPPFLAGS=$CPPFLAGS
+
+ if test -d "${trilinos_libdir}" ; then
+ LDFLAGS="-L${trilinos_libdir} $LDFLAGS"
+ fi
+ if test -d "${trilinos_include}" ; then
+ CPPFLAGS="-I${trilinos_include} $CPPFLAGS"
+ fi
+
+ succeeded=no
+ AC_CHECK_HEADER([Trilinos_version.h],[found_header=yes],[found_header=no])
+ if test "$found_header" = yes; then
+ dnl Patterned after AX_BOOST_BASE
+ trilinos_lib_version_req=ifelse([$1],,8.0.0,$1)
+ trilinos_lib_version_req_shorten=`expr $trilinos_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
+ trilinos_lib_version_req_major=`expr $trilinos_lib_version_req : '\([[0-9]]*\)'`
+ trilinos_lib_version_req_minor=`expr $trilinos_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
+ trilinos_lib_version_req_sub_minor=`expr $trilinos_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test "x$trilinos_lib_version_req_sub_minor" = "x" ; then
+ trilinos_lib_version_req_sub_minor="0"
+ fi
+ WANT_TRILINOS_VERSION=`expr $trilinos_lib_version_req_major \* 10000 \+ $trilinos_lib_version_req_minor \* 100 \+ $trilinos_lib_version_req_sub_minor`
+ AC_LANG_PUSH([C++])
+ AC_MSG_CHECKING(for Trilinos release >= $trilinos_lib_version_req)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ @%:@include <Trilinos_version.h>
+ ]], [[
+ #if (TRILINOS_MAJOR_VERSION == 0)
+ /* Development branch has zero major version. A-OK. */
+ #elif (TRILINOS_MAJOR_MINOR_VERSION >= $WANT_TRILINOS_VERSION)
+ /* Stable release of appropriate version. A-OK. */
+ #else
+ # error Trilinos version is too old
+ #endif
+ ]])],[
+ AC_MSG_RESULT(yes)
+ succeeded=yes
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+ AC_LANG_POP([C++])
+ fi
+
+ if test "$succeeded" = no; then
+ LIBS=$OLD_LIBS
+ LDFLAGS=$OLD_LDFLAGS
+ CPPFLAGS=$OLD_CPPFLAGS
+
+ ifelse([$3],,AC_MSG_ERROR([Trilinos not found. Try either --with-trilinos or setting TRILINOS_HOME.]),
+ [$3])
+ else
+ dnl Find the absolute path to Trilinos_version.h
+ dnl We need it to back out the discovered TRILINOS_INCLUDE directory.
+ gl_TRILINOS_ABSOLUTE_HEADER([Trilinos_version.h])
+ TRILINOS_INCLUDE=`AS_DIRNAME([$gl_cv_absolute_Trilinos_version_h])`
+
+ AC_DEFINE(HAVE_TRILINOS,1,[Define if Trilinos is available])
+ AC_SUBST(TRILINOS_INCLUDE)
+ ifelse([$2],,,[$2])
+ fi
+
+fi
+
+])
diff --git a/m4/ax_trilinos_epetra.m4 b/m4/ax_trilinos_epetra.m4
new file mode 100644
index 0000000..70df188
--- /dev/null
+++ b/m4/ax_trilinos_epetra.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_epetra.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_EPETRA([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# On success, adds "include Makefile.export.epetra" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_EPETRA],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ ax_trilinos_epetra=yes
+ AC_HAVE_LIBRARY([epetra],[:],[ax_trilinos_epetra=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([epetra.macros],[ax_trilinos_epetra=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([epetra],[ax_trilinos_epetra=no])
+ if test "$ax_trilinos_epetra" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Epetra not usable.]),
+ [$2])
+ fi
+])
diff --git a/m4/ax_trilinos_epetraext.m4 b/m4/ax_trilinos_epetraext.m4
new file mode 100644
index 0000000..f246ec9
--- /dev/null
+++ b/m4/ax_trilinos_epetraext.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_epetraext.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_EPETRAEXT([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# On success, adds "include Makefile.export.epetraext" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_EPETRAEXT],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ ax_trilinos_epetraext=yes
+ AC_HAVE_LIBRARY([epetraext],[:],[ax_trilinos_epetraext=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([epetraext.macros],[ax_trilinos_epetraext=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([epetraext],[ax_trilinos_epetraext=no])
+ if test "$ax_trilinos_epetraext" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos EpetraExt not usable.]),
+ [$2])
+ fi
+])
diff --git a/m4/ax_trilinos_epetraext_hdf5.m4 b/m4/ax_trilinos_epetraext_hdf5.m4
new file mode 100644
index 0000000..b837246
--- /dev/null
+++ b/m4/ax_trilinos_epetraext_hdf5.m4
@@ -0,0 +1,52 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_epetraext_hdf5.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_EPETRAEXT_HDF5([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# Checks if EpetraExt was compiled with HDF5 support
+# (--enable-epetraext-hdf5) enabled. When ACTION-IF-NOT-FOUND is not
+# specified, the default behavior is for configure to fail.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_EPETRAEXT_HDF5],[
+ AC_REQUIRE([AC_LIB_HDF5])
+ AC_REQUIRE([AX_TRILINOS_EPETRAEXT])
+ ax_trilinos_epetraext_hdf5=yes
+ AC_CHECK_HEADER([EpetraExt_ConfigDefs.h],,[ax_trilinos_epetraext_hdf5=no])
+ AC_MSG_CHECKING([for HDF5 support in EpetraExt release])
+ AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ @%:@include <EpetraExt_ConfigDefs.h>
+ ]], [[
+ #ifndef HAVE_EPETRAEXT_HDF5
+ # error HAVE_EPETRAEXT_HDF5 was not defined in EpetraExt_ConfigDefs.h
+ #endif
+ ]])],[
+ AC_MSG_RESULT(yes)
+ ],[
+ AC_MSG_RESULT(no)
+ ax_trilinos_epetraext_hdf5=no
+ ])
+ AC_LANG_POP([C++])
+ if test "$ax_trilinos_epetraext_hdf5" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos EpetraExt HDF5 not usable.]),
+ [$2])
+ fi
+])
diff --git a/m4/ax_trilinos_rtop.m4 b/m4/ax_trilinos_rtop.m4
new file mode 100644
index 0000000..4fbe742
--- /dev/null
+++ b/m4/ax_trilinos_rtop.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_rtop.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_RTOP([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# On success, adds "include Makefile.export.rtop" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_RTOP],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ ax_trilinos_rtop=yes
+ AC_HAVE_LIBRARY([rtop],[:],[ax_trilinos_rtop=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([rtop.macros],[ax_trilinos_rtop=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([rtop],[ax_trilinos_rtop=no])
+ if test "$ax_trilinos_rtop" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos RTOp not usable.]),
+ [$2])
+ fi
+])
diff --git a/m4/ax_trilinos_rythmos.m4 b/m4/ax_trilinos_rythmos.m4
new file mode 100644
index 0000000..9989cb7
--- /dev/null
+++ b/m4/ax_trilinos_rythmos.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_rythmos.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_RYTHMOS([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# On success, adds "include Makefile.export.rythmos" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_RYTHMOS],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ ax_trilinos_rythmos=yes
+ AC_HAVE_LIBRARY([rythmos],[:],[ax_trilinos_rythmos=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([rythmos.macros],[ax_trilinos_rythmos=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([rythmos],[ax_trilinos_rythmos=no])
+ if test "$ax_trilinos_rythmos" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Rythmos not usable.]),
+ [$2])
+ fi
+])
diff --git a/m4/ax_trilinos_teuchos.m4 b/m4/ax_trilinos_teuchos.m4
new file mode 100644
index 0000000..de00ce8
--- /dev/null
+++ b/m4/ax_trilinos_teuchos.m4
@@ -0,0 +1,41 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_teuchos.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_TEUCHOS([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# On success, adds "include Makefile.export.teuchos" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option.
+#
+# When ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_TEUCHOS],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ ax_trilinos_teuchos=yes
+ AC_HAVE_LIBRARY([teuchos],[:],[ax_trilinos_teuchos=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([teuchos.macros],[ax_trilinos_teuchos=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([teuchos],[ax_trilinos_teuchos=no])
+ if test "$ax_trilinos_teuchos" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Teuchos not usable]),
+ [$2])
+ fi
+])
diff --git a/m4/ax_trilinos_thyra.m4 b/m4/ax_trilinos_thyra.m4
new file mode 100644
index 0000000..7bdc840
--- /dev/null
+++ b/m4/ax_trilinos_thyra.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_thyra.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_THYRA([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# On success, adds "include Makefile.export.thyra" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_THYRA],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ ax_trilinos_thyra=yes
+ AC_HAVE_LIBRARY([thyra],[:],[ax_trilinos_thyra=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([thyra.macros],[ax_trilinos_thyra=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([thyra],[ax_trilinos_thyra=no])
+ if test "$ax_trilinos_thyra" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Thyra not usable.]),
+ [$2])
+ fi
+])
diff --git a/m4/ax_trilinos_thyra_epetra.m4 b/m4/ax_trilinos_thyra_epetra.m4
new file mode 100644
index 0000000..da14bbb
--- /dev/null
+++ b/m4/ax_trilinos_thyra_epetra.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_thyra_epetra.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_THYRA_EPETRA([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# Checks if the Thyra/Epetra adapters were compiled with Trilinos. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_THYRA_EPETRA],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ AC_REQUIRE([AX_TRILINOS_EPETRA])
+ AC_REQUIRE([AX_TRILINOS_THYRA])
+ ax_trilinos_thyra_epetra=yes
+ AC_HAVE_LIBRARY([thyraepetra],[:],[ax_trilinos_thyra_epetra=no])
+ if test "$ax_trilinos_thyra_epetra" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Thyra/Epetra support not usable.]),
+ [$2])
+ fi
+])
diff --git a/m4/ax_trilinos_thyra_epetraext.m4 b/m4/ax_trilinos_thyra_epetraext.m4
new file mode 100644
index 0000000..7fad6ac
--- /dev/null
+++ b/m4/ax_trilinos_thyra_epetraext.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_thyra_epetraext.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_THYRA_EPETRAEXT([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# Checks if the Thyra/EpetraExt adapters were compiled with Trilinos. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_THYRA_EPETRAEXT],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ AC_REQUIRE([AX_TRILINOS_EPETRAEXT])
+ AC_REQUIRE([AX_TRILINOS_THYRA_EPETRA])
+ ax_trilinos_thyra_epetraext=yes
+ AC_HAVE_LIBRARY([thyraepetraext],[:],[ax_trilinos_thyra_epetraext=no])
+ if test "$ax_trilinos_thyra_epetraext" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Thyra/EpetraExt adapters not usable.]),
+ [$2])
+ fi
+])
diff --git a/m4/ax_try_awk_anyout.m4 b/m4/ax_try_awk_anyout.m4
new file mode 100644
index 0000000..8760d7a
--- /dev/null
+++ b/m4/ax_try_awk_anyout.m4
@@ -0,0 +1,50 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_try_awk_anyout.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRY_AWK_ANYOUT(NAME,TEST-INPUT,TEST-BODY,[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Run a test using the awk program found on AWK variable. The test being
+# run has TEST-BODY as body and is feeded with TEST-INPUT. If successful
+# execute ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRY_AWK_ANYOUT], [
+ AC_REQUIRE([AX_NEED_AWK])
+
+ AC_MSG_CHECKING([if $AWK supports $1])
+
+ cat <<EOF > conftest.out
+$2
+EOF
+
+ ax_try_awk_output=`$AWK '{ [$3] ; }' conftest.out 2> /dev/null`
+ ax_try_awk_result=$?
+
+ rm -f conftest.out
+
+ AS_IF([test $ax_try_awk_result -eq 0],[
+ AC_MSG_RESULT([yes])
+ $4
+ ],[
+ AC_MSG_RESULT([no])
+ $5
+ ])
+])
diff --git a/m4/ax_try_awk_expout.m4 b/m4/ax_try_awk_expout.m4
new file mode 100644
index 0000000..3905804
--- /dev/null
+++ b/m4/ax_try_awk_expout.m4
@@ -0,0 +1,56 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_try_awk_expout.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRY_AWK_EXPOUT(NAME,TEST-INPUT,TEST-BODY,EXPECTED-OUTPUT,[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+# Run a test using the awk program found on AWK variable. The test being
+# run has TEST-BODY as body and is feeded with TEST-INPUT. Check if the
+# test gives the expected output. If successful execute ACTION-IF-SUCCESS
+# otherwise ACTION-IF-FAILURE.
+#
+# This work is heavily based upon testawk.sh script by Heiner Steven. You
+# should find his script (and related works) at
+# <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
+# Alessandro Massignan for his suggestions and extensive nawk tests on
+# FreeBSD.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRY_AWK_EXPOUT], [
+ AC_REQUIRE([AX_NEED_AWK])
+
+ AC_MSG_CHECKING([if $AWK supports $1])
+
+ cat <<EOF > conftest.out
+$2
+EOF
+
+ ax_try_awk_output=`$AWK '{ [$3] ; }' conftest.out 2> /dev/null`
+ ax_try_awk_result=$?
+
+ rm -f conftest.out
+
+ AS_IF([test $ax_try_awk_result -eq 0],[
+ AS_IF([test "X$ax_try_awk_output" = "X[$4]"],[
+ AC_MSG_RESULT([yes])
+ $5
+ ],[
+ AC_MSG_RESULT([no])
+ $6
+ ])
+ ],[
+ AC_MSG_RESULT([no])
+ $6
+ ])
+])
diff --git a/m4/ax_upload.m4 b/m4/ax_upload.m4
new file mode 100644
index 0000000..3e2b494
--- /dev/null
+++ b/m4/ax_upload.m4
@@ -0,0 +1,79 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_upload.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_UPLOAD([command])
+#
+# DESCRIPTION
+#
+# Adds support for uploading dist files. %%s in the command will be
+# substituted with the name of the file. e.g:
+#
+# AX_UPLOAD([ncftpput -v upload.sourceforge.net /incoming %%s])
+#
+# To add upload support for other custom dists add upload-<TYPE> to
+# UPLOAD_BIN or UPLOAD_SRC, where <TYPE> is the type of dist that is being
+# uploaded and add a mapping from <TYPE> to the dist file name in the
+# format '{<TYPE>=><FILENAME>}' to UPLOAD_TARGETS. For example:
+#
+# UPLOAD_BIN += upload-foobar
+# UPLOAD_TARGETS += {foobar=>@PACKAGE@-@VERSION@.fb}
+#
+# You can then upload of the src distribution files by running:
+#
+# make upload-src
+#
+# all the binaru distribution files by running:
+#
+# make upload-bin
+#
+# or both by running:
+#
+# make upload
+#
+# LICENSE
+#
+# Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_UPLOAD],
+[
+AC_MSG_NOTICE([adding upload support])
+AM_CONDITIONAL(USING_AX_UPLOAD, [true])
+AC_MSG_NOTICE([setting upload command... \`$1\`])
+AX_ADD_AM_MACRO_STATIC([
+UPLOAD_BIN =
+UPLOAD_SRC = upload-gzip upload-bzip2 upload-zip
+UPLOAD_TARGETS = \\
+{gzip=>$PACKAGE-$VERSION.tar.gz} \\
+{bzip2=>$PACKAGE-$VERSION.tar.bz2} \\
+{zip=>$PACKAGE-$VERSION.zip}
+
+\$(UPLOAD_BIN) \$(UPLOAD_SRC):
+ @TYPE=\`echo ${AX_DOLLAR}@ | \$(SED) -e \'s/upload-//\'\`; \\
+ DIST=\"dist-\$\${TYPE}\"; \\
+ \$(MAKE) \$(AM_MAKEFLAGS) \$\${DIST}; \\
+ list=\'\$(UPLOAD_TARGETS)\'; \\
+ pattern=\`echo \"^{\$\${TYPE}=>\"\`; \\
+ for dist in \$\$list; do \\
+ echo \$\$dist | \$(EGREP) \"^{\$\${TYPE}=>\" > /dev/null 2>&1; \\
+ if test \"\$\$?\" -eq \"0\"; then \\
+ TARGET=\`echo \"\$\$dist\" | \$(AWK) -v pattern=\$\$pattern \'{ sub( pattern, \"\"); sub( /}\$\$/, \"\" ); print; }\'\`; \\
+ UPLOAD_COMMAND=\`printf \"$1\" \$\$TARGET \`; \\
+ echo \"Uploading \$\$TARGET ...\"; \\
+ \$\$UPLOAD_COMMAND; \\
+ fi \\
+ done
+
+upload-src: \$(UPLOAD_SRC)
+
+upload-bin: \$(UPLOAD_BIN)
+
+upload upload-all all-upload: upload-src upload-bin
+])
+])
diff --git a/m4/ax_warning_default_aclocaldir.m4 b/m4/ax_warning_default_aclocaldir.m4
new file mode 100644
index 0000000..1530884
--- /dev/null
+++ b/m4/ax_warning_default_aclocaldir.m4
@@ -0,0 +1,144 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_warning_default_aclocaldir.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_WARNING_DEFAULT_ACLOCALDIR [(dirvariable [,[defsetting][,[A][,[N/A]]]])]
+# AX_ENABLE_DEFAULT_ACLOCALDIR [(dirvariable [,defsetting])]
+#
+# DESCRIPTION
+#
+# print a warning message if the $(datadir)/aclocal directory is not in
+# the dirlist searched by the aclocal tool. This macro is useful if some
+# `make install` would target $(datadir)/aclocal to install an autoconf m4
+# file of your project to be picked up by other projects.
+#
+# default $1 dirvariable = aclocaldir
+# default $2 defsetting = ${datadir}/aclocal
+# default $3 action = nothing to do
+# default $4 action = warn the user about mismatch
+#
+# In the _WARNING_ variant, the defsetting is not placed in dirvariable
+# nor is it ac_subst'ed in any way. The default fail-action $4 is to send
+# a warning message to the user, and the default accept-action $3 is
+# nothing. It is expected that a Makefile is generated with
+# aclocaldir=${datadir}/aclocal
+#
+# The _ENABLE_ variant however will set not only the $aclocaldir shell var
+# of the script, but it is also AC-SUBST'ed on default - and furthermore a
+# configure option "--enable-default-aclocaldir" is provided. Only if that
+# option is set then $2 default is not set to the canonic default in the a
+# $prefix subpath but instead $2 default is set to the primary path where
+# `aclocal` looks for macros. The user may also override the default on
+# the command line.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_WARNING_DEFAULT_ACLOCALDIR],[dnl
+AC_REQUIRE([AX_EXPAND_PREFIX])dnl
+AS_VAR_PUSHDEF([DIR],[ax_warning_default_aclocal_dir])dnl
+AS_VAR_PUSHDEF([BIN],[ax_warning_default_aclocal_bin])dnl
+AS_VAR_PUSHDEF([LOC],[ax_warning_default_aclocal_loc])dnl
+LOC='m4_if([$2],,[${datadir}/aclocal],[$2])'
+m4_ifval([$1],[test ".$[]$1" != "." && LOC="$[]$1"])
+ if test ".$ACLOCAL" = "." ; then
+ AC_PATH_PROG([ACLOCAL],[aclocal],[:])
+ fi
+ BIN="$ACLOCAL"
+ test ".$BIN" = "." && BIN="aclocal"
+ DIR=`test ".$SHELL" = "." && SHELL="'sh'" ; eval "$BIN --print-ac-dir"`
+ test ".$DIR" = "." && test -d "/usr/share/aclocal" && DIR="/usr/share/aclocal"
+ test ".$DIR" = "." && DIR="/tmp"
+DIR=`eval "echo $DIR"` # we need to expand
+DIR=`eval "echo $DIR"`
+LOC=`eval "echo $LOC"`
+LOC=`eval "echo $LOC"`
+LOC=`eval "echo $LOC"`
+LOC=`eval "echo $LOC"`
+AC_RUN_LOG([: test "$LOC" = "$DIR"])
+if test "$LOC" != "$DIR" ; then
+ if test -f "$DIR/dirlist" ; then
+ for DIR in `cat $DIR/dirlist` $DIR ; do
+ AC_RUN_LOG([: test "$LOC" = "$DIR"])
+ test "$LOC" = "$DIR" && break
+ done
+ fi
+ if test "$LOC" != "$DIR" ; then
+ m4_ifval([$4],[$4],[dnl
+ AC_MSG_NOTICE([warning: m4_if([$1],,[aclocaldir],[$1])=$LOC dnl
+(see config.log)])
+ AC_MSG_NOTICE([perhaps: make install m4_if([$1],,[aclocaldir],[$1])=$DIR])
+ cat m4_ifset([AS_MESSAGE_LOG_FD],[>&AS_MESSAGE_LOG_FD],[>>config.log]) <<EOF
+ aclocaldir: the m4_if([$1],,[default aclocaldir],[$1 value]) of $LOC
+ aclocaldir: is not listed in the dirlist where aclocal will look
+ aclocaldir: for macros - you can override the install-path using
+ aclocaldir: make install aclocaldir=$DIR
+ aclocaldir: or append the directory to aclocal reconfigures later as
+ aclocaldir: aclocal -I $LOC
+ aclocaldir: when an autoconf macro is needed from that directory
+EOF
+ m4_ifvaln([$5],[$5])])dnl
+ m4_ifvaln([$3],[else $3])dnl
+ fi
+fi
+AS_VAR_POPDEF([LOC])dnl
+AS_VAR_POPDEF([BIN])dnl
+AS_VAR_POPDEF([DIR])dnl
+])
+
+AC_DEFUN([AX_ENABLE_DEFAULT_ACLOCALDIR],[dnl
+AS_VAR_PUSHDEF([BIN],[ax_warning_default_aclocal_bin])dnl
+AS_VAR_PUSHDEF([DIR],[ax_warning_default_aclocal_def])dnl
+AS_VAR_PUSHDEF([DEF],[ax_warning_default_aclocal_def])dnl
+AC_ARG_ENABLE([enable-default-aclocaldir],
+[ --enable-default-aclocaldir(=PATH) override the datadir/aclocal default])
+test ".$enable_default_aclocaldir" = "." && enable_default_aclocaldir="no"
+case ".$enable_default_aclocaldir" in
+ .no) DIR='m4_if([$2],,[${datadir}/aclocal],[$2])' ;;
+ .yes) # autodetect
+ if test ".$ACLOCAL" = "." ; then
+ AC_PATH_PROG([ACLOCAL],[aclocal],[:])
+ fi
+ BIN="$ACLOCAL"
+ test ".$BIN" = "." && BIN="aclocal"
+ DIR=`test ".$SHELL" = "." && SHELL="'sh'" ; eval "$BIN --print-ac-dir"`
+ test ".$DIR" = "." && test -d "/usr/share/aclocal" && DIR="/usr/share/aclocal"
+ test ".$DIR" = "." && DIR="/tmp" ;;
+ *) DIR="$enable_default_aclocaldir" ;;
+esac
+AX_WARNING_DEFAULT_ACLOCALDIR([$1],[$DEF],[$3],[$4],[$5])
+m4_if([$1],,[aclocaldir],[$1])="$ax_warning_default_aclocal_dir"
+AC_SUBST(m4_if([$1],,[aclocaldir],[$1]))
+AS_VAR_POPDEF([DEF])dnl
+AS_VAR_POPDEF([DIR])dnl
+AS_VAR_POPDEF([BIN])dnl
+])
diff --git a/m4/ax_warning_default_pkgconfig.m4 b/m4/ax_warning_default_pkgconfig.m4
new file mode 100644
index 0000000..35ddef1
--- /dev/null
+++ b/m4/ax_warning_default_pkgconfig.m4
@@ -0,0 +1,159 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_warning_default_pkgconfig.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_WARNING_DEFAULT_PKGCONFIGDIR [(dirvariable [,[defsetting][,[A][,[N/A]]]])]
+# AX_ENABLE_DEFAULT_PKGCONFIGDIR [(dirvariable [,defsetting])]
+#
+# DESCRIPTION
+#
+# print a warning message if the $(datadir)/aclocal directory is not in
+# the dirlist searched by the aclocal tool. This macro is useful if some
+# `make install` would target $(datadir)/aclocal to install an autoconf m4
+# file of your project to be picked up by other projects.
+#
+# default $1 dirvariable = pkgconfigdir
+# default $2 defsetting = ${libdir}/pkgconfig
+# default $3 action = nothing to do
+# default $4 action = warn the user about mismatch
+#
+# In the _WARNING_ variant, the defsetting is not placed in dirvariable
+# nor is it ac_subst'ed in any way. The default fail-action $4 is to send
+# a warning message to the user, and the default accept-action $3 is
+# nothing. It is expected that a Makefile is generated with
+# pkgconfigdir=${libdir}/pkgconfig
+#
+# The _ENABLE_ variant however will set not only the $pkgconfigdir shell
+# var of the script, but it is also AC-SUBST'ed on default - and
+# furthermore a configure option "--enable-default-pkgconfigdir" is
+# provided. Only if that option is set then $2 default is not set to the
+# canonic default in the a $prefix subpath but instead $2 default is set
+# to the primary path where `pkg-config` looks for .pc files. The user may
+# also override the default on the command line.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_WARNING_DEFAULT_PKGCONFIGDIR],[dnl
+AC_REQUIRE([AX_EXPAND_PREFIX])dnl
+AS_VAR_PUSHDEF([DIR],[ax_warning_default_pkgconfig_dir])dnl
+AS_VAR_PUSHDEF([BIN],[ax_warning_default_pkgconfig_bin])dnl
+AS_VAR_PUSHDEF([LOC],[ax_warning_default_pkgconfig_loc])dnl
+LOC='m4_if([$2],,[${libdir}/pkgconfig],[$2])'
+m4_ifval([$1],[test ".$[]$1" != "." && LOC="$[]$1"])
+ if test ".$PKG_CONFIG" = "." ; then # we use the same default as in pkg.m4
+ AC_PATH_PROG([PKG_CONFIG],[pkg-config],[no])
+ fi
+ if test "$PKG_CONFIG" = "no"
+ then DIR="/" ; test -d "/usr/lib/pkgconfig" && DIR="/usr/lib/pkgconfig"
+ else BIN=`AS_DIRNAME(["$DIR"])` ;
+ if test -d "$BIN/lib/pkgconfig" ; then
+ DIR="$BIN/lib/pkgconfig"
+ else BIN=`AS_DIRNAME(["$DIR"])`
+ if test -d "$BIN/lib/pkgconfig" ; then
+ DIR="$BIN/lib/pkgconfig"
+ else
+ if test -d "/usr/lib/pkgconfig" ; then
+ DIR="/usr/lib/pkgconfig"
+ else
+ DIR="/"
+ fi fi fi
+ fi
+AC_RUN_LOG([: last pkgconfig dir is assumed as "$DIR"])
+DIR=`eval "echo $DIR"`
+DIR=`eval "echo $DIR"`
+LOC=`eval "echo $LOC"`
+LOC=`eval "echo $LOC"`
+LOC=`eval "echo $LOC"`
+LOC=`eval "echo $LOC"`
+for DIR in `echo "$PKG_CONFIG_PATH:$DIR" | sed -e 's,:, ,g'` ; do
+ AC_RUN_LOG([: test ".$LOC" = ".$DIR"])
+ test ".$LOC" = ".$DIR" && break
+done
+if test "$LOC" != "$DIR" ; then
+ m4_ifval([$4],[$4],[dnl
+ AC_MSG_NOTICE([warning: m4_if([$1],,[pkgconfigdir],[$1])=$LOC dnl
+(see config.log)])
+ AC_MSG_NOTICE([perhaps: make install m4_if([$1],,[pkgconfigdir],[$1])=$DIR])
+ cat m4_ifset([AS_MESSAGE_LOG_FD],[>&AS_MESSAGE_LOG_FD],[>>config.log]) <<EOF
+ pkgconfigdir: the m4_if([$1],,[default pkgconfigdir],[$1 value]) of $LOC
+ pkgconfigdir: is not listed in the dirlist where pkg-config will look for
+ pkgconfigdir: package-configs - you can override the install-path using
+ pkgconfigdir: make install m4_if([$1],,[pkgconfigdir],[$1])=$DIR
+ pkgconfigdir: or set/append the directory to the environment variable
+ pkgconfigdir: PKG_CONFIG_PATH="$LOC"
+EOF
+ m4_ifvaln([$5],[$5])])dnl
+ m4_ifvaln([$3],[else $3])dnl
+fi
+AS_VAR_POPDEF([LOC])dnl
+AS_VAR_POPDEF([BIN])dnl
+AS_VAR_POPDEF([DIR])dnl
+])
+
+AC_DEFUN([AX_ENABLE_DEFAULT_PKGCONFIGDIR],[dnl
+AS_VAR_PUSHDEF([BIN],[ax_warning_default_pkgconfig_bin])dnl
+AS_VAR_PUSHDEF([DIR],[ax_warning_default_pkgconfig_def])dnl
+AS_VAR_PUSHDEF([DEF],[ax_warning_default_pkgconfig_def])dnl
+AC_ARG_ENABLE([enable-default-pkgconfigdir],
+[ --enable-default-pkgconfigdir(=PATH) override the libdir/pkgconfig default])
+test ".$enable_default_pkgconfigdir" = "." && enable_default_pkgconfigdir="no"
+case ".$enable_default_pkgconfigdir" in
+ .no) DIR='m4_if([$2],,[${libdir}/pkgconfig],[$2])' ;;
+ .yes) # autodetect
+ if test ".$PKG_CONFIG" = "." ; then # we use the same default as in pkg.m4
+ AC_PATH_PROG([PKG_CONFIG],[pkg-config],[no])
+ fi
+ if test "$PKG_CONFIG" = "no"
+ then DIR="/tmp" ; test -d "/usr/lib/pkgconfig" && DIR="/usr/lib/pkgconfig"
+ else BIN=`AS_DIRNAME(["$DIR"])` ;
+ if test -d "$BIN/lib/pkgconfig" ; then
+ DIR="$BIN/lib/pkgconfig"
+ else BIN=`AS_DIRNAME(["$DIR"])`
+ if test -d "$BIN/lib/pkgconfig" ; then
+ DIR="$BIN/lib/pkgconfig"
+ else
+ if test -d "/usr/lib/pkgconfig" ; then
+ DIR="/usr/lib/pkgconfig"
+ else
+ DIR="/tmp"
+ fi fi fi
+ fi ;;
+ *) DIR="$enable_default_pkgconfigdir" ;;
+esac
+AX_WARNING_DEFAULT_PKGCONFIGDIR([$1],[$DEF],[$3],[$4],[$5])
+m4_if([$1],,[pkgconfigdir],[$1])="$ax_warning_default_pkgconfig_dir"
+AC_SUBST(m4_if([$1],,[pkgconfigdir],[$1]))
+AS_VAR_POPDEF([DEF])dnl
+AS_VAR_POPDEF([DIR])dnl
+AS_VAR_POPDEF([BIN])dnl
+])
diff --git a/m4/ax_wint_t.m4 b/m4/ax_wint_t.m4
new file mode 100644
index 0000000..9c6c4cf
--- /dev/null
+++ b/m4/ax_wint_t.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_wint_t.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_WINT_T
+#
+# DESCRIPTION
+#
+# It turns out that MacOS X doesn't guarantee to provide the "wint_t" type
+# unless you include the strange header <runetype.h> in addition to
+# <wchar.h>. Consequently, the "do I have a system wint_t?" probe fails
+# and an alternate gets used. Unfortunately, by the time the program gets
+# built, one way or another that funny header winds up getting included
+# and the "#define wint_t unsigned int" patch-up-hack mutilates the
+# typedef. This macro will get it right.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_WINT_T],[
+ AC_CHECK_HEADERS([runetype.h wchar.h])
+ AC_CHECK_TYPE(wint_t, [], [
+ AC_DEFINE_UNQUOTED([wint_t], [unsigned int],
+ [Define to `unsigned int' if not found])], [
+ AC_INCLUDES_DEFAULT
+ #if HAVE_RUNETYPE_H
+ # include <runetype.h>
+ #endif
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+ ])])
diff --git a/m4/ax_with_apxs.m4 b/m4/ax_with_apxs.m4
new file mode 100644
index 0000000..482929b
--- /dev/null
+++ b/m4/ax_with_apxs.m4
@@ -0,0 +1,57 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_with_apxs.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_WITH_APXS([value-if-not-found], [path])
+#
+# DESCRIPTION
+#
+# Locates an installed apxs binary, placing the result in the precious
+# variable $APXS. Accepts a preset $APXS, then --with-apxs, and failing
+# that searches for apxs in the given path (which defaults to the system
+# path). If apxs is found, $APXS is set to the full path of the binary;
+# otherwise it is set to VALUE-IF-NOT-FOUND, which defaults to apxs.
+#
+# Example:
+#
+# AX_WITH_APXS(missing)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Dustin J. Mitchell <dustin@cs.uchicago.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_WITH_APXS],
+[
+ AC_ARG_VAR([APXS])
+
+ dnl unless APXS was supplied to us (as a precious variable)
+ if test -z "$APXS"
+ then
+ AC_MSG_CHECKING(for --with-apxs)
+ AC_ARG_WITH(apxs,
+ AC_HELP_STRING([--with-apxs=APXS],
+ [absolute path name of apxs executable]),
+ [ if test "$withval" != "yes"
+ then
+ APXS="$withval"
+ AC_MSG_RESULT($withval)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ ],
+ [ AC_MSG_RESULT(no)
+ ])
+ fi
+
+ dnl if it's still not found, check the paths, or use the fallback
+ if test -z "$APXS"
+ then
+ AC_PATH_PROG([APXS], apxs, m4_ifval([$1],[$1],[apxs]), $2)
+ fi
+])
diff --git a/m4/ax_with_dmalloc.m4 b/m4/ax_with_dmalloc.m4
new file mode 100644
index 0000000..2fa95e5
--- /dev/null
+++ b/m4/ax_with_dmalloc.m4
@@ -0,0 +1,48 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_with_dmalloc.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_WITH_DMALLOC
+#
+# DESCRIPTION
+#
+# Let the user enable/disable support for the dmalloc library available
+# from <http://www.dmalloc.org/>.
+#
+# The macro adds the command-line flag "--with-dmalloc". Furthermore,
+# "-IPREFIX/include" will be added to "$CPPFLAGS", "-LPREFIX/lib" to
+# "$LDFLAGS", and "-DDEBUG_DMALLOC" and "-DDMALLOC_FUNC_CHECK" to
+# "$CPPFLAGS".
+#
+# To enable dmalloc support in your code, add the following snippet to
+# your header files:
+#
+# #ifdef DEBUG_DMALLOC
+# # include <dmalloc.h>
+# #endif
+#
+# LICENSE
+#
+# Copyright (c) 2008 Peter Simons <simons@cryp.to>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_WITH_DMALLOC], [
+AC_MSG_CHECKING(whether to use the dmalloc library)
+AC_ARG_WITH(dmalloc,
+[ --with-dmalloc[=PREFIX] Compile with dmalloc library],
+if test "$withval" = "" -o "$withval" = "yes"; then
+ ac_cv_dmalloc="/usr/local"
+else
+ ac_cv_dmalloc="$withval"
+fi
+AC_MSG_RESULT(yes)
+CPPFLAGS="$CPPFLAGS -DDEBUG_DMALLOC -DDMALLOC_FUNC_CHECK -I$ac_cv_dmalloc/include"
+LDFLAGS="$LDFLAGS -L$ac_cv_dmalloc/lib"
+LIBS="$LIBS -ldmalloc"
+,AC_MSG_RESULT(no))
+])dnl
diff --git a/m4/ax_with_guile.m4 b/m4/ax_with_guile.m4
new file mode 100644
index 0000000..d6510b5
--- /dev/null
+++ b/m4/ax_with_guile.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_with_guile.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_WITH_GUILE([VALUE-IF-NOT-FOUND],[PATH])
+#
+# DESCRIPTION
+#
+# Locates an installed Guile binary, placing the result in the precious
+# variable $GUILE. Accepts a present $GUILE, then --with-guile, and
+# failing that searches for guile in the given path (which defaults to the
+# system path). If guile is found, $GUILE is set to the full path of the
+# binary; if it is not found $GUILE is set to VALUE-IF-NOT-FOUND if
+# provided, unchanged otherwise.
+#
+# A typical use could be the following one:
+#
+# AX_WITH_GUILE
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_WITH_GUILE],[
+ AX_WITH_PROG(GUILE,guile,$1,$2)
+])
diff --git a/m4/ax_with_perl.m4 b/m4/ax_with_perl.m4
new file mode 100644
index 0000000..5e4cbbc
--- /dev/null
+++ b/m4/ax_with_perl.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_with_perl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_WITH_PERL([VALUE-IF-NOT-FOUND],[PATH])
+#
+# DESCRIPTION
+#
+# Locates an installed Perl binary, placing the result in the precious
+# variable $PERL. Accepts a present $PERL, then --with-perl, and failing
+# that searches for perl in the given path (which defaults to the system
+# path). If perl is found, $PERL is set to the full path of the binary; if
+# it is not found $PERL is set to VALUE-IF-NOT-FOUND if provided,
+# unchanged otherwise.
+#
+# A typical use could be the following one:
+#
+# AX_WITH_PERL
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_WITH_PERL],[
+ AX_WITH_PROG(PERL,perl,$1,$2)
+])
diff --git a/m4/ax_with_prog.m4 b/m4/ax_with_prog.m4
new file mode 100644
index 0000000..e6bb6df
--- /dev/null
+++ b/m4/ax_with_prog.m4
@@ -0,0 +1,67 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_with_prog.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_WITH_PROG([VARIABLE],[program],[VALUE-IF-NOT-FOUND],[PATH])
+#
+# DESCRIPTION
+#
+# Locates an installed program binary, placing the result in the precious
+# variable VARIABLE. Accepts a present VARIABLE, then --with-program, and
+# failing that searches for program in the given path (which defaults to
+# the system path). If program is found, VARIABLE is set to the full path
+# of the binary; if it is not found VARIABLE is set to VALUE-IF-NOT-FOUND
+# if provided, unchanged otherwise.
+#
+# A typical example could be the following one:
+#
+# AX_WITH_PROG(PERL,perl)
+#
+# NOTE: This macro is based upon the original AX_WITH_PYTHON macro from
+# Dustin J. Mitchell <dustin@cs.uchicago.edu>.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+# Copyright (c) 2008 Dustin J. Mitchell <dustin@cs.uchicago.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_WITH_PROG],[
+ AC_PREREQ([2.61])
+
+ pushdef([VARIABLE],$1)
+ pushdef([EXECUTABLE],$2)
+ pushdef([VALUE_IF_NOT_FOUND],$3)
+ pushdef([PATH_PROG],$4)
+
+ AC_ARG_VAR(VARIABLE,Absolute path to EXECUTABLE executable)
+
+ AS_IF(test -z "$VARIABLE",[
+ AC_MSG_CHECKING(whether EXECUTABLE executable path has been provided)
+ AC_ARG_WITH(EXECUTABLE,AS_HELP_STRING([--with-EXECUTABLE=[[[[PATH]]]]],absolute path to EXECUTABLE executable), [
+ AS_IF([test "$withval" != "yes"],[
+ VARIABLE="$withval"
+ AC_MSG_RESULT($VARIABLE)
+ ],[
+ VARIABLE=""
+ AC_MSG_RESULT([no])
+ ])
+ ],[
+ AC_MSG_RESULT([no])
+ ])
+
+ AS_IF(test -z "$VARIABLE",[
+ AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[])
+ ])
+ ])
+
+ popdef([PATH_PROG])
+ popdef([VALUE_IF_NOT_FOUND])
+ popdef([EXECUTABLE])
+ popdef([VARIABLE])
+])
diff --git a/m4/ax_with_python.m4 b/m4/ax_with_python.m4
new file mode 100644
index 0000000..699187c
--- /dev/null
+++ b/m4/ax_with_python.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_with_python.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_WITH_PYTHON([VALUE-IF-NOT-FOUND],[PATH])
+#
+# DESCRIPTION
+#
+# Locates an installed Python binary, placing the result in the precious
+# variable $PYTHON. Accepts a present $PYTHON, then --with-python, and
+# failing that searches for python in the given path (which defaults to
+# the system path). If python is found, $PYTHON is set to the full path of
+# the binary; if it is not found $PYTHON is set to VALUE-IF-NOT-FOUND if
+# provided, unchanged otherwise.
+#
+# A typical use could be the following one:
+#
+# AX_WITH_PYTHON
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_WITH_PYTHON],[
+ AX_WITH_PROG(PYTHON,python,$1,$2)
+])
diff --git a/m4/ax_with_ruby.m4 b/m4/ax_with_ruby.m4
new file mode 100644
index 0000000..c7c5087
--- /dev/null
+++ b/m4/ax_with_ruby.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_with_ruby.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_WITH_RUBY([VALUE-IF-NOT-FOUND],[PATH])
+#
+# DESCRIPTION
+#
+# Locates an installed Ruby binary, placing the result in the precious
+# variable $RUBY. Accepts a present $RUBY, then --with-ruby, and failing
+# that searches for ruby in the given path (which defaults to the system
+# path). If ruby is found, $RUBY is set to the full path of the binary; if
+# it is not found $RUBY is set to VALUE-IF-NOT-FOUND if provided,
+# unchanged otherwise.
+#
+# A typical use could be the following one:
+#
+# AX_WITH_RUBY
+#
+# LICENSE
+#
+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_WITH_RUBY],[
+ AX_WITH_PROG(RUBY,ruby,$1,$2)
+])
diff --git a/m4/az_python.m4 b/m4/az_python.m4
new file mode 100644
index 0000000..074507c
--- /dev/null
+++ b/m4/az_python.m4
@@ -0,0 +1,512 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/az_python.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AZ_PYTHON_DEFAULT
+# AZ_PYTHON_ENABLE
+# AZ_PYTHON_WITH
+# AZ_PYTHON_PATH
+# AZ_PYTHON_VERSION_ENSURE( [2.2] )
+# AZ_PYTHON_CSPEC
+# AZ_PYTHON_LSPEC
+#
+# DESCRIPTION
+#
+# This file provides autoconf support for those applications that want to
+# embed python. It supports all pythons >= 2.2 which is the first official
+# release containing distutils. Version 2.2 of python was released
+# December 21, 2001. Since it actually executes the python, cross platform
+# configuration will probably not work. Also, most of the platforms
+# supported are consistent until you look into MacOSX. The python included
+# with it is installed as a framework which is a very different
+# environment to set up the normal tools such as gcc and libtool to deal
+# with. Therefore, once we establish which python that we are going to
+# use, we use its distutils to actually compile and link our modules or
+# applications.
+#
+# At this time, it does NOT support linking with Python statically. It
+# does support dynamic linking.
+#
+# This set of macros help define $PYTHON, $PYTHON_USE, $PYTHON_CSPEC and
+# $PYTHON_LSPEC. $PYTHON defines the full executable path for the Python
+# being linked to and is used within these macros to determine if that has
+# been specified or found. These macros do execute this python version so
+# it must be present on the system at configure time.
+#
+# $PYTHON_USE is an automake variable that defines whether Python support
+# should be included or not in your application. $PYTHON_CSPEC is a
+# variable that supplies additional CFLAGS for the compilation of the
+# application/shared library. $PYTHON_LSPEC is a variable that supplies
+# additional LDFLAGS for linking the application/shared library.
+#
+# The following is an example of how to set up for python usage within
+# your application in your configure.in:
+#
+# AZ_PYTHON_DEFAULT( )
+# AZ_PYTHON_ENABLE( ) # Optional
+# AZ_PYTHON_WITH( ) # Optional
+# AZ_PYTHON_PATH( ) # or AZ_PYTHON_INSIST( )
+# # if $PYTHON is not defined, then the following do nothing.
+# AZ_PYTHON_VERSION_ENSURE( [2.2] )
+# AZ_PYTHON_CSPEC
+# AZ_PYTHON_LSPEC
+#
+# The AZ_PYTHON_DEFAULT sets the $PYTHON_USE to false. Thereby, excluding
+# it if it was optional.
+#
+# The AZ_PYTHON_ENABLE looks for the optional configure parameters of
+# --enable-python/--disable-python and establishes the $PYTHON and
+# $PYTHON_USE variables accordingly.
+#
+# The AZ_PYTHON_WITH looks for the optional configure parameters of
+# --with-python/--without-python and establishes the $PYTHON and
+# $PYTHON_USE variables accordingly.
+#
+# The AZ_PYTHON_PATH looks for python assuming that none has been
+# previously found or defined and issues an error if it does not find it.
+# If it does find it, it establishes the $PYTHON and $PYTHON_USE variables
+# accordingly. AZ_PYTHON_INSIST could be used here instead if you want to
+# insist that Python support be included using the --enable-python or
+# --with-python checks previously done.
+#
+# The AZ_PYTHON_VERSION_ENSURE issues an error if the Python previously
+# found is not of version 2.2 or greater.
+#
+# Once that these macros have be run, we can use PYTHON_USE within the
+# makefile.am file to conditionally add the Python support such as:
+#
+# Makefile.am example showing optional inclusion of directories:
+#
+# if PYTHON_USE
+# plugins = plugins
+# src = src
+# else
+# plugins =
+# src =
+# endif
+#
+# SUBDIRS = . $(plugins) $(src)
+#
+# Makefile.am example showing optional shared library build:
+#
+# if PYTHON_USE
+# lib_LTLIBRARIES = libElemList.la
+# libElemList_la_SOURCES = libElemList.c
+# libElemList_la_CFLAGS = @PYTHON_CSPEC@
+# libElemList_la_LDFLAGS = @PYTHON_LSPEC@
+# endif
+#
+# Makefile.am example showing optional program build:
+#
+# if PYTHON_USE
+# bin_PROGRAMS = runFunc
+# runFunc_SOURCES = runFunc.c
+# runFunc_CFLAGS = @PYTHON_CSPEC@
+# runFunc_LDFLAGS = @PYTHON_LSPEC@
+# endif
+#
+# The above compiles the modules only if PYTHON_USE was specified as true.
+# Also, the else portion of the if was optional.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Robert White <kranki@mac.com>
+# Copyright (c) 2008 Dustin J. Mitchell <dustin@cs.uchicago.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+# AZ_PYTHON_DEFAULT( )
+# -----------------
+# Sets the default to not include Python support.
+
+AC_DEFUN([AZ_PYTHON_DEFAULT],
+[
+ az_python_use=false
+ AM_CONDITIONAL(PYTHON_USE, test x"$az_python_use" = x"true")
+])
+
+
+
+# AZ_PYTHON_ENABLE( [path] )
+# -----------------------------------------------------------------
+# Handles the various --enable-python commands.
+# Input:
+# $1 is the optional search path for the python executable if needed
+# Ouput:
+# PYTHON_USE (AM_CONDITIONAL) is true if python executable found
+# and --enable-python was requested; otherwise false.
+# $PYTHON contains the full executable path to python if PYTHON_ENABLE_USE
+# is true.
+#
+# Example:
+# AZ_PYTHON_ENABLE( )
+# or
+# AZ_PYTHON_ENABLE( "/usr/bin" )
+
+AC_DEFUN([AZ_PYTHON_ENABLE],
+[
+ AC_ARG_VAR([PYTHON],[Python Executable Path])
+
+ # unless PYTHON was supplied to us (as a precious variable),
+ # see if --enable-python[=PythonExecutablePath], --enable-python,
+ # --disable-python or --enable-python=no was given.
+ if test -z "$PYTHON"
+ then
+ AC_MSG_CHECKING(for --enable-python)
+ AC_ARG_ENABLE(
+ python,
+ AC_HELP_STRING([--enable-python@<:@=PYTHON@:>@],
+ [absolute path name of Python executable]
+ ),
+ [
+ if test "$enableval" = "yes"
+ then
+ # "yes" was specified, but we don't have a path
+ # for the executable.
+ # So, let's searth the PATH Environment Variable.
+ AC_MSG_RESULT(yes)
+ AC_PATH_PROG(
+ [PYTHON],
+ python,
+ [],
+ $1
+ )
+ if test -z "$PYTHON"
+ then
+ AC_MSG_ERROR(no path to python found)
+ fi
+ az_python_use=true
+ AM_CONDITIONAL(PYTHON_USE, test x"$az_python_use" = x"true")
+ AZ_PYTHON_PREFIX( )
+ elif test "$enableval" = "no"
+ then
+ AC_MSG_RESULT(no)
+ az_python_use=false
+ AM_CONDITIONAL(PYTHON_USE, test x"$az_python_use" = x"true")
+ else
+ # $enableval must be the executable path then.
+ AC_SUBST([PYTHON], ["${enableval}"])
+ AC_MSG_RESULT($withval)
+ az_python_use=true
+ AM_CONDITIONAL(PYTHON_USE, test x"$az_python_use" = x"true")
+ AZ_PYTHON_PREFIX( )
+ fi
+ ],
+ [
+ # --with-python was not specified.
+ AC_MSG_RESULT(no)
+ az_python_use=false
+ AM_CONDITIONAL(PYTHON_USE, test x"$az_python_use" = x"true")
+ ]
+ )
+ fi
+
+])
+
+
+
+# AZ_PYTHON_CSPEC( )
+# -----------------
+# Set up the c compiler options to compile Python
+# embedded programs/libraries in $PYTHON_CSPEC if
+# $PYTHON has been defined.
+
+AC_DEFUN([AZ_PYTHON_CSPEC],
+[
+ AC_ARG_VAR( [PYTHON], [Python Executable Path] )
+ if test -n "$PYTHON"
+ then
+ az_python_prefix=`${PYTHON} -c "import sys; print sys.prefix"`
+ if test -z "$az_python_prefix"
+ then
+ AC_MSG_ERROR([Python Prefix is not known])
+ fi
+ az_python_execprefix=`${PYTHON} -c "import sys; print sys.exec_prefix"`
+ az_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`
+ az_python_includespec="-I${az_python_prefix}/include/python${az_python_version}"
+ if test x"$python_prefix" != x"$python_execprefix"; then
+ az_python_execspec="-I${az_python_execprefix}/include/python${az_python_version}"
+ az_python_includespec="${az_python_includespec} $az_python_execspec"
+ fi
+ az_python_ccshared=`${PYTHON} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('CFLAGSFORSHARED')"`
+ az_python_cspec="${az_python_ccshared} ${az_python_includespec}"
+ AC_SUBST([PYTHON_CSPEC], [${az_python_cspec}])
+ AC_MSG_NOTICE([PYTHON_CSPEC=${az_python_cspec}])
+ fi
+])
+
+
+
+# AZ_PYTHON_INSIST( )
+# -----------------
+# Look for Python and set the output variable 'PYTHON'
+# to 'python' if found, empty otherwise.
+
+AC_DEFUN([AZ_PYTHON_PATH],
+[
+ AC_ARG_VAR( [PYTHON], [Python Executable Path] )
+ if test -z "$PYTHON"
+ then
+ AC_MSG_ERROR([Python Executable not found])
+ fi
+])
+
+
+
+# AZ_PYTHON_LSPEC( )
+# -----------------
+# Set up the linker options to link Python embedded
+# programs/libraries in $PYTHON_LSPEC if $PYTHON
+# has been defined.
+
+AC_DEFUN([AZ_PYTHON_LSPEC],
+[
+ AC_ARG_VAR( [PYTHON], [Python Executable Path] )
+ if test -n "$PYTHON"
+ then
+ AZ_PYTHON_RUN([
+import sys
+import distutils.sysconfig
+strUseFrameWork = "--enable-framework"
+dictConfig = distutils.sysconfig.get_config_vars( )
+strConfigArgs = dictConfig.get("CONFIG_ARGS")
+strLinkSpec = dictConfig.get('LDFLAGS')
+if -1 == strConfigArgs.find(strUseFrameWork):
+ strLibPL = dictConfig.get("LIBPL")
+ if strLibPL and (strLibPL != ""):
+ strLinkSpec += " -L%s" % (strLibPL)
+ strSys = dictConfig.get("SYSLIBS")
+ if strSys and (strSys != ""):
+ strLinkSpec += " %s" % (strSys)
+ strSHL = dictConfig.get("SHLIBS")
+ if strSHL and (strSHL != ""):
+ strLinkSpec += " %s" % (strSHL)
+ # Construct the Python Library Name.
+ strTmplte = " -lpython%d.%d"
+ if (sys.platform == "win32") or (sys.platform == "os2emx"):
+ strTmplte = " -lpython%d%d"
+ strWrk = strTmplte % ( (sys.hexversion >> 24),
+ ((sys.hexversion >> 16) & 0xff))
+ strLinkSpec += strWrk
+else:
+ # This is not ideal since it changes the search path
+ # for Frameworks which could have side-effects on
+ # other included Frameworks. However, it is necessary
+ # where someone has installed more than one frameworked
+ # Python. Frameworks are really only used in MacOSX.
+ strLibFW = dictConfig.get("PYTHONFRAMEWORKPREFIX")
+ if strLibFW and (strLibFW != ""):
+ strLinkSpec += " -F%s" % (strLibFW)
+strLinkSpec += " %s" % (dictConfig.get('LINKFORSHARED'))
+print strLinkSpec
+ ])
+ AC_SUBST([PYTHON_LSPEC], [${az_python_output}])
+ AC_MSG_NOTICE([PYTHON_LSPEC=${az_python_output}])
+ fi
+])
+
+
+
+# AZ_PYTHON_PATH( )
+# -----------------
+# Look for Python and set the output variable 'PYTHON'
+# to 'python' if found, empty otherwise.
+
+AC_DEFUN([AZ_PYTHON_PATH],
+[
+ AC_ARG_VAR( [PYTHON], [Python Executable Path] )
+ AC_PATH_PROG( PYTHON, python, [], $1 )
+ if test -z "$PYTHON"
+ then
+ AC_MSG_ERROR([Python Executable not found])
+ else
+ az_python_use=true
+ fi
+ AM_CONDITIONAL(PYTHON_USE, test "$az_python_use" = "true")
+])
+
+
+
+# AZ_PYTHON_PREFIX( )
+# -------------------
+# Use the values of $prefix and $exec_prefix for the corresponding
+# values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX.
+
+AC_DEFUN([AZ_PYTHON_PREFIX],
+[
+ if test -z "$PYTHON"
+ then
+ AC_MSG_ERROR([Python Executable Path is not known])
+ fi
+ ax_python_prefix=`${PYTHON} -c "import sys; print sys.prefix"`
+ ax_python_execprefix=`${PYTHON} -c "import sys; print sys.exec_prefix"`
+ AC_SUBST([PYTHON_PREFIX], ["${ax_python_prefix}"])
+ AC_SUBST([PYTHON_EXECPREFIX], ["${ax_python_execprefix}"])
+])
+
+
+
+# AZ_PYTHON_RUN( PYTHON_PROGRAM )
+# -----------------
+# Run a Python Test Program saving its output
+# in az_python_output and its condition code
+# in az_python_cc.
+
+AC_DEFUN([AZ_PYTHON_RUN],
+[
+ AC_ARG_VAR( [PYTHON], [Python Executable Path] )
+ if test -z "$PYTHON"
+ then
+ AC_MSG_ERROR([Python Executable not found])
+ else
+ cat >conftest.py <<_ACEOF
+$1
+_ACEOF
+ az_python_output=`$PYTHON conftest.py`
+ az_python_cc=$?
+ rm conftest.py
+ if test -f "conftest.pyc"
+ then
+ rm conftest.pyc
+ fi
+ fi
+])
+
+
+
+# AZ_PYTHON_VERSION_CHECK( VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE] )
+# -----------------------------------------------------------------------------
+# Run ACTION-IF-TRUE if the Python interpreter has version >= VERSION.
+# Run ACTION-IF-FALSE otherwise.
+# This test uses sys.hexversion instead of the string equivalant (first
+# word of sys.version), in order to cope with versions such as 2.2c1.
+# hexversion has been introduced in Python 1.5.2; it's probably not
+# worth to support older versions (1.5.1 was released on October 31, 1998).
+
+AC_DEFUN([AZ_PYTHON_VERSION_CHECK],
+ [
+ AC_ARG_VAR( [PYTHON], [Python Executable Path] )
+ if test -n "$PYTHON"
+ then
+ AC_MSG_CHECKING([whether $PYTHON version >= $1])
+ AZ_PYTHON_RUN([
+import sys, string
+# split strings by '.' and convert to numeric. Append some zeros
+# because we need at least 4 digits for the hex conversion.
+minver = map(int, string.split('$1', '.')) + [[0, 0, 0]]
+minverhex = 0
+for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]]
+if sys.hexversion >= minverhex:
+ sys.exit( 0 )
+else:
+ sys.exit( 1 )
+ ])
+ if test $az_python_cc -eq 0
+ then
+ $2
+ m4_ifvaln(
+ [$3],
+ [else $3]
+ )
+ fi
+ fi
+])
+
+
+
+# AZ_PYTHON_VERSION_ENSURE( VERSION )
+# -----------------
+# Insure that the Python Interpreter Version
+# is greater than or equal to the VERSION
+# parameter.
+
+AC_DEFUN([AZ_PYTHON_VERSION_ENSURE],
+[
+ AZ_PYTHON_VERSION_CHECK(
+ [$1],
+ [AC_MSG_RESULT(yes)],
+ [AC_MSG_ERROR(too old)]
+ )
+])
+
+
+
+# AZ_PYTHON_WITH( [path] )
+# -----------------------------------------------------------------
+# Handles the various --with-python commands.
+# Input:
+# $1 is the optional search path for the python executable if needed
+# Ouput:
+# PYTHON_USE (AM_CONDITIONAL) is true if python executable found
+# and --with-python was requested; otherwise false.
+# $PYTHON contains the full executable path to python if PYTHON_USE
+# is true.
+#
+# Example:
+# AZ_PYTHON_WITH( )
+# or
+# AZ_PYTHON_WITH("/usr/bin")
+
+AC_DEFUN([AZ_PYTHON_WITH],
+[
+ AC_ARG_VAR([PYTHON],[Python Executable Path])
+
+ # unless PYTHON was supplied to us (as a precious variable),
+ # see if --with-python[=PythonExecutablePath], --with-python,
+ # --without-python or --with-python=no was given.
+ if test -z "$PYTHON"
+ then
+ AC_MSG_CHECKING(for --with-python)
+ AC_ARG_WITH(
+ python,
+ AC_HELP_STRING([--with-python@<:@=PYTHON@:>@],
+ [absolute path name of Python executable]
+ ),
+ [
+ if test "$withval" = "yes"
+ then
+ # "yes" was specified, but we don't have a path
+ # for the executable.
+ # So, let's searth the PATH Environment Variable.
+ AC_MSG_RESULT(yes)
+ AC_PATH_PROG(
+ [PYTHON],
+ python,
+ [],
+ $1
+ )
+ if test -z "$PYTHON"
+ then
+ AC_MSG_ERROR(no path to python found)
+ fi
+ az_python_use=true
+ AM_CONDITIONAL(PYTHON_USE, test x"$az_python_use" = x"true")
+ AZ_PYTHON_PREFIX( )
+ elif test "$withval" = "no"
+ then
+ AC_MSG_RESULT(no)
+ az_python_use=false
+ AM_CONDITIONAL(PYTHON_USE, test x"$az_python_use" = x"true")
+ else
+ # $withval must be the executable path then.
+ AC_SUBST([PYTHON], ["${withval}"])
+ AC_MSG_RESULT($withval)
+ az_python_use=true
+ AM_CONDITIONAL(PYTHON_USE, test x"$az_python_use" = x"true")
+ AZ_PYTHON_PREFIX( )
+ fi
+ ],
+ [
+ # --with-python was not specified.
+ AC_MSG_RESULT(no)
+ az_python_use=false
+ AM_CONDITIONAL(PYTHON_USE, test x"$az_python_use" = x"true")
+ ]
+ )
+ fi
+
+])
diff --git a/m4/berkeley_db.m4 b/m4/berkeley_db.m4
new file mode 100644
index 0000000..70d5928
--- /dev/null
+++ b/m4/berkeley_db.m4
@@ -0,0 +1,108 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/berkeley_db.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BERKELEY_DB([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+#
+# DESCRIPTION
+#
+# This macro tries to find Berkeley DB. It honors MINIMUM-VERSION if
+# given.
+#
+# If libdb is found, DB_HEADER and DB_LIBS variables are set and
+# ACTION-IF-FOUND shell code is executed if specified. DB_HEADER is set to
+# location of db.h header in quotes (e.g. "db3/db.h") and
+# AC_DEFINE_UNQUOTED is called on it, so that you can type
+#
+# #include DB_HEADER
+#
+# in your C/C++ code. DB_LIBS is set to linker flags needed to link
+# against the library (e.g. -ldb3.1) and AC_SUBST is called on it.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Vaclav Slavik <vaclav.slavik@matfyz.cz>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_BERKELEY_DB],
+[
+ old_LIBS="$LIBS"
+
+ minversion=ifelse([$1], ,,$1)
+
+ DB_HEADER=""
+ DB_LIBS=""
+
+ if test -z $minversion ; then
+ minvermajor=0
+ minverminor=0
+ minverpatch=0
+ AC_MSG_CHECKING([for Berkeley DB])
+ else
+ minvermajor=`echo $minversion | cut -d. -f1`
+ minverminor=`echo $minversion | cut -d. -f2`
+ minverpatch=`echo $minversion | cut -d. -f3`
+ minvermajor=${minvermajor:-0}
+ minverminor=${minverminor:-0}
+ minverpatch=${minverpatch:-0}
+ AC_MSG_CHECKING([for Berkeley DB >= $minversion])
+ fi
+
+ for version in "" 5.0 4.9 4.8 4.7 4.6 4.5 4.4 4.3 4.2 4.1 4.0 3.6 3.5 3.4 3.3 3.2 3.1 ; do
+
+ if test -z $version ; then
+ db_lib="-ldb"
+ try_headers="db.h"
+ else
+ db_lib="-ldb-$version"
+ try_headers="db$version/db.h db`echo $version | sed -e 's,\..*,,g'`/db.h"
+ fi
+
+ LIBS="$old_LIBS $db_lib"
+
+ for db_hdr in $try_headers ; do
+ if test -z $DB_HEADER ; then
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [
+ #include <${db_hdr}>
+ ],
+ [
+ #if !((DB_VERSION_MAJOR > (${minvermajor}) || \
+ (DB_VERSION_MAJOR == (${minvermajor}) && \
+ DB_VERSION_MINOR > (${minverminor})) || \
+ (DB_VERSION_MAJOR == (${minvermajor}) && \
+ DB_VERSION_MINOR == (${minverminor}) && \
+ DB_VERSION_PATCH >= (${minverpatch}))))
+ #error "too old version"
+ #endif
+
+ DB *db;
+ db_create(&db, NULL, 0);
+ ])],
+ [
+ AC_MSG_RESULT([header $db_hdr, library $db_lib])
+
+ DB_HEADER="$db_hdr"
+ DB_LIBS="$db_lib"
+ ])
+ fi
+ done
+ done
+
+ LIBS="$old_LIBS"
+
+ if test -z $DB_HEADER ; then
+ AC_MSG_RESULT([not found])
+ ifelse([$3], , :, [$3])
+ else
+ AC_DEFINE_UNQUOTED(DB_HEADER, ["$DB_HEADER"], ["Berkeley DB Header File"])
+ AC_SUBST(DB_LIBS)
+ ifelse([$2], , :, [$2])
+ fi
+])
diff --git a/m4/bnv_have_qt.m4 b/m4/bnv_have_qt.m4
new file mode 100644
index 0000000..d1ef466
--- /dev/null
+++ b/m4/bnv_have_qt.m4
@@ -0,0 +1,534 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/bnv_have_qt.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# BNV_HAVE_QT [--with-Qt-dir=DIR] [--with-Qt-lib-dir=DIR] [--with-Qt-lib=LIB]
+# BNV_HAVE_QT [--with-Qt-include-dir=DIR] [--with-Qt-bin-dir=DIR] [--with-Qt-lib-dir=DIR] [--with-Qt-lib=LIB]
+#
+# DESCRIPTION
+#
+# Searches common directories for Qt include files, libraries and Qt
+# binary utilities. The macro supports several different versions of the
+# Qt framework being installed on the same machine. Without options, the
+# macro is designed to look for the latest library, i.e., the highest
+# definition of QT_VERSION in qglobal.h. By use of one or more options a
+# different library may be selected. There are two different sets of
+# options. Both sets contain the option --with-Qt-lib=LIB which can be
+# used to force the use of a particular version of the library file when
+# more than one are available. LIB must be in the form as it would appear
+# behind the "-l" option to the compiler. Examples for LIB would be
+# "qt-mt" for the multi-threaded version and "qt" for the regular version.
+# In addition to this, the first set consists of an option
+# --with-Qt-dir=DIR which can be used when the installation conforms to
+# Trolltech's standard installation, which means that header files are in
+# DIR/include, binary utilities are in DIR/bin and the library is in
+# DIR/lib. The second set of options can be used to indicate individual
+# locations for the header files, the binary utilities and the library
+# file, in addition to the specific version of the library file.
+#
+# The following shell variable is set to either "yes" or "no":
+#
+# have_qt
+#
+# Additionally, the following variables are exported:
+#
+# QT_CXXFLAGS
+# QT_LIBS
+# QT_MOC
+# QT_UIC
+# QT_LRELEASE
+# QT_LUPDATE
+# QT_DIR
+#
+# which respectively contain an "-I" flag pointing to the Qt include
+# directory (and "-DQT_THREAD_SUPPORT" when LIB is "qt-mt"), link flags
+# necessary to link with Qt and X, the name of the meta object compiler
+# and the user interface compiler both with full path, and finaly the
+# variable QTDIR as Trolltech likes to see it defined (if possible).
+#
+# Example lines for Makefile.in:
+#
+# CXXFLAGS = @QT_CXXFLAGS@
+# MOC = @QT_MOC@
+#
+# After the variables have been set, a trial compile and link is performed
+# to check the correct functioning of the meta object compiler. This test
+# may fail when the different detected elements stem from different
+# releases of the Qt framework. In that case, an error message is emitted
+# and configure stops.
+#
+# No common variables such as $LIBS or $CFLAGS are polluted.
+#
+# Options:
+#
+# --with-Qt-dir=DIR: DIR is equal to $QTDIR if you have followed the
+# installation instructions of Trolltech. Header files are in DIR/include,
+# binary utilities are in DIR/bin and the library is in DIR/lib.
+#
+# --with-Qt-include-dir=DIR: Qt header files are in DIR.
+#
+# --with-Qt-bin-dir=DIR: Qt utilities such as moc and uic are in DIR.
+#
+# --with-Qt-lib-dir=DIR: The Qt library is in DIR.
+#
+# --with-Qt-lib=LIB: Use -lLIB to link with the Qt library.
+#
+# If some option "=no" or, equivalently, a --without-Qt-* version is given
+# in stead of a --with-Qt-*, "have_qt" is set to "no" and the other
+# variables are set to the empty string.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Bastiaan Veelo <Bastiaan@Veelo.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+dnl Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007 Bastiaan Veelo
+
+dnl THANKS! This code includes bug fixes and contributions made by:
+dnl Tim McClarren,
+dnl Dennis R. Weilert,
+dnl Qingning Huo,
+dnl Brian Mingus,
+dnl Jens Hannemann,
+dnl Pavel Roskin,
+dnl Scott J. Bertin.
+dnl Pierre Hebert
+
+dnl ChangeLog
+dnl 2008-04-12 * Add QT_LRELEASE and QT_LUPDATE (due to Pierre Hebert)
+dnl 2008-04-12 * Hide output of ls and fix an m4 quoting problem (due to Scott J. Bertin).
+dnl 2008-04-12 * Check compiler return value instead of parsing the error stream,
+dnl which detected warnings as false negatives (due to Jens Hannemann).
+dnl 2008-04-12 * Spelling of "Success".
+dnl * Fixed unsave test for $bnv_qt_lib without quotes.
+dnl * Put dnl in front of all comments.
+dnl * Changed -l$bnv_qt_lib_dir into -L$bnv_qt_lib_dir (all due to Pavel Roskin).
+dnl 2008-04-12 * Support for 64bit architectures.
+dnl * Updated documentation.
+dnl 2008-04-12: * Fix "cat: bnv_qt_test.c: No such file or directory" (due to Jens Hannemann).
+dnl * Hide output of failing ls.
+dnl 2008-04-12: * Check in /Developer on Mac OS X; Check in $QTDIR (due to Brian Mingus).
+
+dnl Calls BNV_PATH_QT_DIRECT (contained in this file) as a subroutine.
+AC_DEFUN([BNV_HAVE_QT],
+[
+ AC_REQUIRE([AC_PROG_CXX])
+ AC_REQUIRE([AC_PATH_X])
+ AC_REQUIRE([AC_PATH_XTRA])
+
+ AC_MSG_CHECKING(for Qt)
+
+ AC_ARG_WITH([Qt-dir],
+ [ --with-Qt-dir=DIR DIR is equal to $QTDIR if you have followed the
+ installation instructions of Trolltech. Header
+ files are in DIR/include, binary utilities are
+ in DIR/bin. The library is in DIR/lib, unless
+ --with-Qt-lib-dir is also set.])
+ AC_ARG_WITH([Qt-include-dir],
+ [ --with-Qt-include-dir=DIR
+ Qt header files are in DIR])
+ AC_ARG_WITH([Qt-bin-dir],
+ [ --with-Qt-bin-dir=DIR Qt utilities such as moc and uic are in DIR])
+ AC_ARG_WITH([Qt-lib-dir],
+ [ --with-Qt-lib-dir=DIR The Qt library is in DIR])
+ AC_ARG_WITH([Qt-lib],
+ [ --with-Qt-lib=LIB Use -lLIB to link with the Qt library])
+ if test x"$with_Qt_dir" = x"no" ||
+ test x"$with_Qt_include-dir" = x"no" ||
+ test x"$with_Qt_bin_dir" = x"no" ||
+ test x"$with_Qt_lib_dir" = x"no" ||
+ test x"$with_Qt_lib" = x"no"; then
+ # user disabled Qt. Leave cache alone.
+ have_qt="User disabled Qt."
+ else
+ # "yes" is a bogus option
+ if test x"$with_Qt_dir" = xyes; then
+ with_Qt_dir=
+ fi
+ if test x"$with_Qt_include_dir" = xyes; then
+ with_Qt_include_dir=
+ fi
+ if test x"$with_Qt_bin_dir" = xyes; then
+ with_Qt_bin_dir=
+ fi
+ if test x"$with_Qt_lib_dir" = xyes; then
+ with_Qt_lib_dir=
+ fi
+ if test x"$with_Qt_lib" = xyes; then
+ with_Qt_lib=
+ fi
+ # No Qt unless we discover otherwise
+ have_qt=no
+ # Check whether we are requested to link with a specific version
+ if test x"$with_Qt_lib" != x; then
+ bnv_qt_lib="$with_Qt_lib"
+ fi
+ # Check whether we were supplied with an answer already
+ if test x"$with_Qt_dir" != x; then
+ have_qt=yes
+ bnv_qt_dir="$with_Qt_dir"
+ bnv_qt_include_dir="$with_Qt_dir/include"
+ bnv_qt_bin_dir="$with_Qt_dir/bin"
+ bnv_qt_lib_dir="$with_Qt_dir/lib"
+ # Only search for the lib if the user did not define one already
+ if test x"$bnv_qt_lib" = x; then
+ bnv_qt_lib="`ls $bnv_qt_lib_dir/libqt* | sed -n 1p |
+ sed s@$bnv_qt_lib_dir/lib@@ | [sed s@[.].*@@]`"
+ fi
+ bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
+ else
+ # Use cached value or do search, starting with suggestions from
+ # the command line
+ AC_CACHE_VAL(bnv_cv_have_qt,
+ [
+ # We are not given a solution and there is no cached value.
+ bnv_qt_dir=NO
+ bnv_qt_include_dir=NO
+ bnv_qt_lib_dir=NO
+ if test x"$bnv_qt_lib" = x; then
+ bnv_qt_lib=NO
+ fi
+ BNV_PATH_QT_DIRECT
+ if test "$bnv_qt_dir" = NO ||
+ test "$bnv_qt_include_dir" = NO ||
+ test "$bnv_qt_lib_dir" = NO ||
+ test "$bnv_qt_lib" = NO; then
+ # Problem with finding complete Qt. Cache the known absence of Qt.
+ bnv_cv_have_qt="have_qt=no"
+ else
+ # Record where we found Qt for the cache.
+ bnv_cv_have_qt="have_qt=yes \
+ bnv_qt_dir=$bnv_qt_dir \
+ bnv_qt_include_dir=$bnv_qt_include_dir \
+ bnv_qt_bin_dir=$bnv_qt_bin_dir \
+ bnv_qt_LIBS=\"$bnv_qt_LIBS\""
+ fi
+ ])dnl
+ eval "$bnv_cv_have_qt"
+ fi # all $bnv_qt_* are set
+ fi # $have_qt reflects the system status
+ if test x"$have_qt" = xyes; then
+ QT_CXXFLAGS="-I$bnv_qt_include_dir"
+ if test x"$bnv_qt_lib" = xqt-mt; then
+ QT_CXXFLAGS="$QT_CXXFLAGS -DQT_THREAD_SUPPORT"
+ fi
+ QT_DIR="$bnv_qt_dir"
+ QT_LIBS="$bnv_qt_LIBS"
+ # If bnv_qt_dir is defined, utilities are expected to be in the
+ # bin subdirectory
+ if test x"$bnv_qt_dir" != x; then
+ if test -x "$bnv_qt_dir/bin/uic"; then
+ QT_UIC="$bnv_qt_dir/bin/uic"
+ else
+ # Old versions of Qt don't have uic
+ QT_UIC=
+ fi
+ QT_MOC="$bnv_qt_dir/bin/moc"
+ QT_LRELEASE="$bnv_qt_dir/bin/lrelease"
+ QT_LUPDATE="$bnv_qt_dir/bin/lupdate"
+ else
+ # Or maybe we are told where to look for the utilities
+ if test x"$bnv_qt_bin_dir" != x; then
+ if test -x "$bnv_qt_bin_dir/uic"; then
+ QT_UIC="$bnv_qt_bin_dir/uic"
+ else
+ # Old versions of Qt don't have uic
+ QT_UIC=
+ fi
+ QT_MOC="$bnv_qt_bin_dir/moc"
+ QT_LRELEASE="$bnv_qt_bin_dir/lrelease"
+ QT_LUPDATE="$bnv_qt_bin_dir/lupdate"
+ else
+ # Last possibility is that they are in $PATH
+ QT_UIC="`which uic`"
+ QT_MOC="`which moc`"
+ QT_LRELEASE="`which lrelease`"
+ QT_LUPDATE="`which lupdate`"
+ fi
+ fi
+ # All variables are defined, report the result
+ AC_MSG_RESULT([$have_qt:
+ QT_CXXFLAGS=$QT_CXXFLAGS
+ QT_DIR=$QT_DIR
+ QT_LIBS=$QT_LIBS
+ QT_UIC=$QT_UIC
+ QT_MOC=$QT_MOC
+ QT_LRELEASE=$QT_LRELEASE
+ QT_LUPDATE=$QT_LUPDATE])
+ else
+ # Qt was not found
+ QT_CXXFLAGS=
+ QT_DIR=
+ QT_LIBS=
+ QT_UIC=
+ QT_MOC=
+ QT_LRELEASE=
+ QT_LUPDATE=
+ AC_MSG_RESULT($have_qt)
+ fi
+ AC_SUBST(QT_CXXFLAGS)
+ AC_SUBST(QT_DIR)
+ AC_SUBST(QT_LIBS)
+ AC_SUBST(QT_UIC)
+ AC_SUBST(QT_MOC)
+ AC_SUBST(QT_LRELEASE)
+ AC_SUBST(QT_LUPDATE)
+
+ #### Being paranoid:
+ if test x"$have_qt" = xyes; then
+ AC_MSG_CHECKING(correct functioning of Qt installation)
+ AC_CACHE_VAL(bnv_cv_qt_test_result,
+ [
+ cat > bnv_qt_test.h << EOF
+#include <qobject.h>
+class Test : public QObject
+{
+Q_OBJECT
+public:
+ Test() {}
+ ~Test() {}
+public slots:
+ void receive() {}
+signals:
+ void send();
+};
+EOF
+
+ cat > bnv_qt_main.$ac_ext << EOF
+#include "bnv_qt_test.h"
+#include <qapplication.h>
+int main( int argc, char **argv )
+{
+ QApplication app( argc, argv );
+ Test t;
+ QObject::connect( &t, SIGNAL(send()), &t, SLOT(receive()) );
+}
+EOF
+
+ bnv_cv_qt_test_result="failure"
+ bnv_try_1="$QT_MOC bnv_qt_test.h -o moc_bnv_qt_test.$ac_ext >/dev/null 2>/dev/null"
+ AC_TRY_EVAL(bnv_try_1)
+ if test x"$ac_status" != x0; then
+ echo "$bnv_err_1" >&AC_FD_CC
+ echo "configure: could not run $QT_MOC on:" >&AC_FD_CC
+ cat bnv_qt_test.h >&AC_FD_CC
+ else
+ bnv_try_2="$CXX $QT_CXXFLAGS -c $CXXFLAGS -o moc_bnv_qt_test.o moc_bnv_qt_test.$ac_ext >/dev/null 2>/dev/null"
+ AC_TRY_EVAL(bnv_try_2)
+ if test x"$ac_status" != x0; then
+ echo "$bnv_err_2" >&AC_FD_CC
+ echo "configure: could not compile:" >&AC_FD_CC
+ cat moc_bnv_qt_test.$ac_ext >&AC_FD_CC
+ else
+ bnv_try_3="$CXX $QT_CXXFLAGS -c $CXXFLAGS -o bnv_qt_main.o bnv_qt_main.$ac_ext >/dev/null 2>/dev/null"
+ AC_TRY_EVAL(bnv_try_3)
+ if test x"$ac_status" != x0; then
+ echo "$bnv_err_3" >&AC_FD_CC
+ echo "configure: could not compile:" >&AC_FD_CC
+ cat bnv_qt_main.$ac_ext >&AC_FD_CC
+ else
+ bnv_try_4="$CXX $QT_LIBS $LIBS -o bnv_qt_main bnv_qt_main.o moc_bnv_qt_test.o >/dev/null 2>/dev/null"
+ AC_TRY_EVAL(bnv_try_4)
+ if test x"$ac_status" != x0; then
+ echo "$bnv_err_4" >&AC_FD_CC
+ else
+ bnv_cv_qt_test_result="success"
+ fi
+ fi
+ fi
+ fi
+ ])dnl AC_CACHE_VAL bnv_cv_qt_test_result
+ AC_MSG_RESULT([$bnv_cv_qt_test_result]);
+ if test x"$bnv_cv_qt_test_result" = "xfailure"; then
+ AC_MSG_ERROR([Failed to find matching components of a complete
+ Qt installation. Try using more options,
+ see ./configure --help.])
+ fi
+
+ rm -f bnv_qt_test.h moc_bnv_qt_test.$ac_ext moc_bnv_qt_test.o \
+ bnv_qt_main.$ac_ext bnv_qt_main.o bnv_qt_main
+ fi
+])
+
+dnl Internal subroutine of BNV_HAVE_QT
+dnl Set bnv_qt_dir bnv_qt_include_dir bnv_qt_bin_dir bnv_qt_lib_dir bnv_qt_lib
+AC_DEFUN([BNV_PATH_QT_DIRECT],
+[
+ ## Binary utilities ##
+ if test x"$with_Qt_bin_dir" != x; then
+ bnv_qt_bin_dir=$with_Qt_bin_dir
+ fi
+ ## Look for header files ##
+ if test x"$with_Qt_include_dir" != x; then
+ bnv_qt_include_dir="$with_Qt_include_dir"
+ else
+ # The following header file is expected to define QT_VERSION.
+ qt_direct_test_header=qglobal.h
+ # Look for the header file in a standard set of common directories.
+ bnv_include_path_list="
+ /usr/include
+ `ls -dr ${QTDIR}/include 2>/dev/null`
+ `ls -dr /usr/include/qt* 2>/dev/null`
+ `ls -dr /usr/lib/qt*/include 2>/dev/null`
+ `ls -dr /usr/local/qt*/include 2>/dev/null`
+ `ls -dr /opt/qt*/include 2>/dev/null`
+ `ls -dr /Developer/qt*/include 2>/dev/null`
+ "
+ for bnv_dir in $bnv_include_path_list; do
+ if test -r "$bnv_dir/$qt_direct_test_header"; then
+ bnv_dirs="$bnv_dirs $bnv_dir"
+ fi
+ done
+ # Now look for the newest in this list
+ bnv_prev_ver=0
+ for bnv_dir in $bnv_dirs; do
+ bnv_this_ver=`egrep -w '#define QT_VERSION' $bnv_dir/$qt_direct_test_header | sed s/'#define QT_VERSION'//`
+ if expr $bnv_this_ver '>' $bnv_prev_ver > /dev/null; then
+ bnv_qt_include_dir=$bnv_dir
+ bnv_prev_ver=$bnv_this_ver
+ fi
+ done
+ fi dnl Found header files.
+
+ # Are these headers located in a traditional Trolltech installation?
+ # That would be $bnv_qt_include_dir stripped from its last element:
+ bnv_possible_qt_dir=`dirname $bnv_qt_include_dir`
+ if (test -x $bnv_possible_qt_dir/bin/moc) &&
+ ((ls $bnv_possible_qt_dir/lib/libqt* > /dev/null 2>/dev/null) ||
+ (ls $bnv_possible_qt_dir/lib64/libqt* > /dev/null 2>/dev/null)); then
+ # Then the rest is a piece of cake
+ bnv_qt_dir=$bnv_possible_qt_dir
+ bnv_qt_bin_dir="$bnv_qt_dir/bin"
+ if test x"$with_Qt_lib_dir" != x; then
+ bnv_qt_lib_dir="$with_Qt_lib_dir"
+ else
+ if (test -d $bnv_qt_dir/lib64); then
+ bnv_qt_lib_dir="$bnv_qt_dir/lib64"
+ else
+ bnv_qt_lib_dir="$bnv_qt_dir/lib"
+ fi
+ fi
+ # Only look for lib if the user did not supply it already
+ if test x"$bnv_qt_lib" = xNO; then
+ bnv_qt_lib="`ls $bnv_qt_lib_dir/libqt* | sed -n 1p |
+ sed s@$bnv_qt_lib_dir/lib@@ | [sed s@[.].*@@]`"
+ fi
+ bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
+ else
+ # There is no valid definition for $QTDIR as Trolltech likes to see it
+ bnv_qt_dir=
+ ## Look for Qt library ##
+ if test x"$with_Qt_lib_dir" != x; then
+ bnv_qt_lib_dir="$with_Qt_lib_dir"
+ # Only look for lib if the user did not supply it already
+ if test x"$bnv_qt_lib" = xNO; then
+ bnv_qt_lib="`ls $bnv_qt_lib_dir/libqt* | sed -n 1p |
+ sed s@$bnv_qt_lib_dir/lib@@ | [sed s@[.].*@@]`"
+ fi
+ bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
+ else
+ # Normally, when there is no traditional Trolltech installation,
+ # the library is installed in a place where the linker finds it
+ # automatically.
+ # If the user did not define the library name, try with qt
+ if test x"$bnv_qt_lib" = xNO; then
+ bnv_qt_lib=qt
+ fi
+ qt_direct_test_header=qapplication.h
+ qt_direct_test_main="
+ int argc;
+ char ** argv;
+ QApplication app(argc,argv);
+ "
+ # See if we find the library without any special options.
+ # Don't add top $LIBS permanently yet
+ bnv_save_LIBS="$LIBS"
+ LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
+ bnv_qt_LIBS="$LIBS"
+ bnv_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="-I$bnv_qt_include_dir"
+ AC_TRY_LINK([#include <$qt_direct_test_header>],
+ $qt_direct_test_main,
+ [
+ # Success.
+ # We can link with no special library directory.
+ bnv_qt_lib_dir=
+ ], [
+ # That did not work. Try the multi-threaded version
+ echo "Non-critical error, please neglect the above." >&AC_FD_CC
+ bnv_qt_lib=qt-mt
+ LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
+ AC_TRY_LINK([#include <$qt_direct_test_header>],
+ $qt_direct_test_main,
+ [
+ # Success.
+ # We can link with no special library directory.
+ bnv_qt_lib_dir=
+ ], [
+ # That did not work. Try the OpenGL version
+ echo "Non-critical error, please neglect the above." >&AC_FD_CC
+ bnv_qt_lib=qt-gl
+ LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
+ AC_TRY_LINK([#include <$qt_direct_test_header>],
+ $qt_direct_test_main,
+ [
+ # Success.
+ # We can link with no special library directory.
+ bnv_qt_lib_dir=
+ ], [
+ # That did not work. Maybe a library version I don't know about?
+ echo "Non-critical error, please neglect the above." >&AC_FD_CC
+ # Look for some Qt lib in a standard set of common directories.
+ bnv_dir_list="
+ `echo $bnv_qt_includes | sed ss/includess`
+ /lib
+ /usr/lib64
+ /usr/lib
+ /usr/local/lib64
+ /usr/local/lib
+ /opt/lib64
+ /opt/lib
+ `ls -dr /usr/lib64/qt* 2>/dev/null`
+ `ls -dr /usr/lib64/qt*/lib64 2>/dev/null`
+ `ls -dr /usr/lib/qt* 2>/dev/null`
+ `ls -dr /usr/local/qt* 2>/dev/null`
+ `ls -dr /opt/qt* 2>/dev/null`
+ "
+ for bnv_dir in $bnv_dir_list; do
+ if ls $bnv_dir/libqt* >/dev/null 2>/dev/null; then
+ # Gamble that it's the first one...
+ bnv_qt_lib="`ls $bnv_dir/libqt* | sed -n 1p |
+ sed s@$bnv_dir/lib@@ | sed s/[[.]].*//`"
+ bnv_qt_lib_dir="$bnv_dir"
+ break
+ fi
+ done
+ # Try with that one
+ LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
+ AC_TRY_LINK([#include <$qt_direct_test_header>],
+ $qt_direct_test_main,
+ [
+ # Success.
+ # We can link with no special library directory.
+ bnv_qt_lib_dir=
+ ], [
+ # Leave bnv_qt_lib_dir defined
+ ])
+ ])
+ ])
+ ])
+ if test x"$bnv_qt_lib_dir" != x; then
+ bnv_qt_LIBS="-L$bnv_qt_lib_dir $LIBS"
+ else
+ bnv_qt_LIBS="$LIBS"
+ fi
+ LIBS="$bnv_save_LIBS"
+ CXXFLAGS="$bnv_save_CXXFLAGS"
+ fi dnl $with_Qt_lib_dir was not given
+ fi dnl Done setting up for non-traditional Trolltech installation
+])
diff --git a/m4/cf_ebcdic.m4 b/m4/cf_ebcdic.m4
new file mode 100644
index 0000000..cd36404
--- /dev/null
+++ b/m4/cf_ebcdic.m4
@@ -0,0 +1,71 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/cf_ebcdic.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# CF_EBCDIC
+#
+# DESCRIPTION
+#
+# If the target character set is EBCDIC, defines variables cf_cv_ebcdic,
+# EBCDIC, and NOT_ASCII.
+#
+# I originally wrote this and submitted it to the Lynx distribution.
+# Editorial revisions by Tom Dickey, et. al.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Paul Gilmartin <pg@sweng.stortek.com>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+dnl Check whether character set is EBCDIC.
+AC_DEFUN([CF_EBCDIC],[
+AC_MSG_CHECKING(if character set is EBCDIC)
+AC_CACHE_VAL(cf_cv_ebcdic,[
+ AC_TRY_COMPILE([ ],
+[ /* TryCompile function for CharSet.
+ Treat any failure as ASCII for compatibility with existing art.
+ Use compile-time rather than run-time tests for cross-compiler
+ tolerance. */
+#if '0'!=240
+make an error "Character set is not EBCDIC"
+#endif ],
+[ # TryCompile action if true
+cf_cv_ebcdic=yes ],
+[ # TryCompile action if false
+cf_cv_ebcdic=no])
+# end of TryCompile ])
+# end of CacheVal CvEbcdic
+AC_MSG_RESULT($cf_cv_ebcdic)
+case "$cf_cv_ebcdic" in #(vi
+ yes) AC_DEFINE(EBCDIC)
+ AC_DEFINE(NOT_ASCII);; #(vi
+ *) ;;
+esac
+])dnl
diff --git a/m4/check_gnu_make.m4 b/m4/check_gnu_make.m4
new file mode 100644
index 0000000..e9be43c
--- /dev/null
+++ b/m4/check_gnu_make.m4
@@ -0,0 +1,76 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/check_gnu_make.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# CHECK_GNU_MAKE()
+#
+# DESCRIPTION
+#
+# This macro searches for a GNU version of make. If a match is found, the
+# makefile variable `ifGNUmake' is set to the empty string, otherwise it
+# is set to "#". This is useful for including a special features in a
+# Makefile, which cannot be handled by other versions of make. The
+# variable _cv_gnu_make_command is set to the command to invoke GNU make
+# if it exists, the empty string otherwise.
+#
+# Here is an example of its use:
+#
+# Makefile.in might contain:
+#
+# # A failsafe way of putting a dependency rule into a makefile
+# $(DEPEND):
+# $(CC) -MM $(srcdir)/*.c > $(DEPEND)
+#
+# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
+# @ifGNUmake@ include $(DEPEND)
+# @ifGNUmake@ endif
+#
+# Then configure.in would normally contain:
+#
+# CHECK_GNU_MAKE()
+# AC_OUTPUT(Makefile)
+#
+# Then perhaps to cause gnu make to override any other make, we could do
+# something like this (note that GNU make always looks for GNUmakefile
+# first):
+#
+# if ! test x$_cv_gnu_make_command = x ; then
+# mv Makefile GNUmakefile
+# echo .DEFAULT: > Makefile ;
+# echo \ $_cv_gnu_make_command \$@ >> Makefile;
+# fi
+#
+# Then, if any (well almost any) other make is called, and GNU make also
+# exists, then the other make wraps the GNU make.
+#
+# LICENSE
+#
+# Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN(
+ [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
+ _cv_gnu_make_command='' ;
+dnl Search all the common names for GNU make
+ for a in "$MAKE" make gmake gnumake ; do
+ if test -z "$a" ; then continue ; fi ;
+ if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
+ _cv_gnu_make_command=$a ;
+ break;
+ fi
+ done ;
+ ) ;
+dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
+ if test "x$_cv_gnu_make_command" != "x" ; then
+ ifGNUmake='' ;
+ else
+ ifGNUmake='#' ;
+ AC_MSG_RESULT("Not found");
+ fi
+ AC_SUBST(ifGNUmake)
+] )
diff --git a/m4/check_ssl.m4 b/m4/check_ssl.m4
new file mode 100644
index 0000000..d2e8449
--- /dev/null
+++ b/m4/check_ssl.m4
@@ -0,0 +1,75 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/check_ssl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# CHECK_SSL
+#
+# DESCRIPTION
+#
+# This macro will check various standard spots for OpenSSL including a
+# user-supplied directory. The user uses '--with-ssl' or
+# '--with-ssl=/path/to/ssl' as arguments to configure.
+#
+# If OpenSSL is found the include directory gets added to CFLAGS and
+# CXXFLAGS as well as '-DHAVE_SSL', '-lssl' & '-lcrypto' get added to
+# LIBS, and the libraries location gets added to LDFLAGS. Finally
+# 'HAVE_SSL' gets set to 'yes' for use in your Makefile.in I use it like
+# so (valid for gmake):
+#
+# HAVE_SSL = @HAVE_SSL@
+# ifeq ($(HAVE_SSL),yes)
+# SRCS+= @srcdir@/my_file_that_needs_ssl.c
+# endif
+#
+# For bsd 'bmake' use:
+#
+# .if ${HAVE_SSL} == "yes"
+# SRCS+= @srcdir@/my_file_that_needs_ssl.c
+# .endif
+#
+# LICENSE
+#
+# Copyright (c) 2009 Mark Ethan Trostler <trostler@juniper.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([CHECK_SSL],
+[AC_MSG_CHECKING(if ssl is wanted)
+AC_ARG_WITH(ssl,
+[ --with-ssl enable ssl [will check /usr/local/ssl
+ /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr ]
+],
+[ AC_MSG_RESULT(yes)
+ for dir in $withval /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do
+ ssldir="$dir"
+ if test -f "$dir/include/openssl/ssl.h"; then
+ found_ssl="yes";
+ CFLAGS="$CFLAGS -I$ssldir/include/openssl -DHAVE_SSL";
+ CXXFLAGS="$CXXFLAGS -I$ssldir/include/openssl -DHAVE_SSL";
+ break;
+ fi
+ if test -f "$dir/include/ssl.h"; then
+ found_ssl="yes";
+ CFLAGS="$CFLAGS -I$ssldir/include/ -DHAVE_SSL";
+ CXXFLAGS="$CXXFLAGS -I$ssldir/include/ -DHAVE_SSL";
+ break
+ fi
+ done
+ if test x_$found_ssl != x_yes; then
+ AC_MSG_ERROR(Cannot find ssl libraries)
+ else
+ printf "OpenSSL found in $ssldir\n";
+ LIBS="$LIBS -lssl -lcrypto";
+ LDFLAGS="$LDFLAGS -L$ssldir/lib";
+ HAVE_SSL=yes
+ fi
+ AC_SUBST(HAVE_SSL)
+],
+[
+ AC_MSG_RESULT(no)
+])
+])dnl
diff --git a/m4/check_zlib.m4 b/m4/check_zlib.m4
new file mode 100644
index 0000000..17afc96
--- /dev/null
+++ b/m4/check_zlib.m4
@@ -0,0 +1,120 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/check_zlib.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# CHECK_ZLIB()
+#
+# DESCRIPTION
+#
+# This macro searches for an installed zlib library. If nothing was
+# specified when calling configure, it searches first in /usr/local and
+# then in /usr. If the --with-zlib=DIR is specified, it will try to find
+# it in DIR/include/zlib.h and DIR/lib/libz.a. If --without-zlib is
+# specified, the library is not searched at all.
+#
+# If either the header file (zlib.h) or the library (libz) is not found,
+# the configuration exits on error, asking for a valid zlib installation
+# directory or --without-zlib.
+#
+# The macro defines the symbol HAVE_LIBZ if the library is found. You
+# should use autoheader to include a definition for this symbol in a
+# config.h file. Sample usage in a C/C++ source is as follows:
+#
+# #ifdef HAVE_LIBZ
+# #include <zlib.h>
+# #endif /* HAVE_LIBZ */
+#
+# LICENSE
+#
+# Copyright (c) 2008 Loic Dachary <loic@senga.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([CHECK_ZLIB],
+#
+# Handle user hints
+#
+[AC_MSG_CHECKING(if zlib is wanted)
+AC_ARG_WITH(zlib,
+[ --with-zlib=DIR root directory path of zlib installation [defaults to
+ /usr/local or /usr if not found in /usr/local]
+ --without-zlib to disable zlib usage completely],
+[if test "$withval" != no ; then
+ AC_MSG_RESULT(yes)
+ if test -d "$withval"
+ then
+ ZLIB_HOME="$withval"
+ else
+ AC_MSG_WARN([Sorry, $withval does not exist, checking usual places])
+ fi
+else
+ AC_MSG_RESULT(no)
+fi])
+
+ZLIB_HOME=/usr/local
+if test ! -f "${ZLIB_HOME}/include/zlib.h"
+then
+ ZLIB_HOME=/usr
+fi
+
+#
+# Locate zlib, if wanted
+#
+if test -n "${ZLIB_HOME}"
+then
+ ZLIB_OLD_LDFLAGS=$LDFLAGS
+ ZLIB_OLD_CPPFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+ CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+ AC_LANG_SAVE
+ AC_LANG_C
+ AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
+ AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
+ AC_LANG_RESTORE
+ if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"
+ then
+ #
+ # If both library and header were found, use them
+ #
+ AC_CHECK_LIB(z, inflateEnd)
+ AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
+ AC_MSG_RESULT(ok)
+ else
+ #
+ # If either header or library was not found, revert and bomb
+ #
+ AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
+ LDFLAGS="$ZLIB_OLD_LDFLAGS"
+ CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
+ AC_MSG_RESULT(failed)
+ AC_MSG_ERROR(either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib)
+ fi
+fi
+
+])
diff --git a/m4/compile_value.m4 b/m4/compile_value.m4
new file mode 100644
index 0000000..f11f4c9
--- /dev/null
+++ b/m4/compile_value.m4
@@ -0,0 +1,122 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/compile_value.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_C_COMPILE_VALUE (COMPILE-VALUE, ALIAS, INCLUDES)
+#
+# DESCRIPTION
+#
+# The AC_C_COMPILE_VALUE macro determines a compile time value by
+# generating the object code and reading the value from the code. Static
+# data initializers like sizeof(int) are unavailable to preprocessor. The
+# macro calculates the values known to compiler's static initializer.
+#
+# Assumptions: The sought value should not exceed 65535. The shell
+# interpreter and the sed utility are expected to exist and work similarly
+# across possible build platforms.
+#
+# Result: The resulting configure script will generate the preprocessor
+# symbol definition:
+#
+# #define COMPILE_VALUE_<ALIAS> <NUMBER>
+#
+# It was important that the value was embedded into the object file in a
+# predefined byte order during the test. This ensured that the result was
+# independent from the target platform's byte order.
+#
+# The existing AC_CHECK_SIZEOF macro also computes the size of the given
+# type without running the test program. However, the existing macro will
+# produce a piece of configure script that will take the time proportional
+# to the logarithm of the sought value.
+#
+# Example of use in configure.in:
+#
+# AC_C_COMPILE_VALUE(sizeof(int), sizeof_int)
+# AC_C_COMPILE_VALUE([sizeof(int[[543]])], sizeof_int543)
+#
+# As a result of runnfing the generated configure script, the following
+# definition will appear in config.h:
+#
+# #define COMPILE_VALUE_SIZEOF_INT 4
+# #define COMPILE_VALUE_SIZEOF_INT543 2172
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ilguiz Latypov
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+## Portability defines that help interoperate with classic and modern autoconfs
+ifdef([AC_TR_SH],[
+define([AC_TR_SH_REUSE],[AC_TR_SH([$1])])
+define([AC_TR_CPP_REUSE],[AC_TR_CPP([$1])])
+], [
+define([AC_TR_SH_REUSE],
+ [patsubst(translit([[$1]], [*+], [pp]), [[^a-zA-Z0-9_]], [_])])
+define([AC_TR_CPP_REUSE],
+ [patsubst(translit([[$1]],
+ [*abcdefghijklmnopqrstuvwxyz],
+ [PABCDEFGHIJKLMNOPQRSTUVWXYZ]),
+ [[^A-Z0-9_]], [_])])
+])
+
+AC_DEFUN([AC_C_COMPILE_VALUE], [
+ pushdef([ac_c_compile_value],
+ AC_TR_SH_REUSE([ac_cv_c_compile_value_$2]))dnl
+ ac_c_compile_value_expand="$1"
+ AC_CACHE_CHECK([value of $1 by analyzing object code],
+ ac_c_compile_value, [
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -c -o conftest.o"
+ AC_TRY_COMPILE([$3
+ #include <stddef.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+ #define COMPILE_VALUE $ac_c_compile_value_expand
+ #define HEX_DIGIT(n) ((n) >= 10 ? 'a' + (n) - 10 : '0' + (n))
+ char object_code_block[] = {
+ '\n', 'e', '4', 'V', 'A',
+ '0', 'x',
+ (char) HEX_DIGIT((((COMPILE_VALUE / 16) / 16) / 16) % 16),
+ (char) HEX_DIGIT(((COMPILE_VALUE / 16) / 16) % 16),
+ (char) HEX_DIGIT((COMPILE_VALUE / 16) % 16),
+ (char) HEX_DIGIT(COMPILE_VALUE % 16),
+ 'Y', '3', 'p', 'M', '\n'
+ };],
+ [],
+ [ac_c_compile_value=`
+ typeset -i n=\`sed -ne 's/^e4VA0x\(.*\)Y3pM$/0x\1/p' < conftest.o\`;
+ echo $n`],
+ [ac_c_compile_value=0])
+ CFLAGS="$save_CFLAGS"])
+ AC_DEFINE_UNQUOTED(AC_TR_CPP_REUSE(compile_value_$2),
+ [$[]ac_c_compile_value],
+ [$1])
+ popdef([ac_c_compile_value])dnl
+])
diff --git a/m4/ct_check_postgres_db.m4 b/m4/ct_check_postgres_db.m4
new file mode 100644
index 0000000..8cf7d1c
--- /dev/null
+++ b/m4/ct_check_postgres_db.m4
@@ -0,0 +1,85 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ct_check_postgres_db.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# CT_CHECK_POSTGRES_DB
+#
+# DESCRIPTION
+#
+# This macro tries to find the headers and librarys for the PostgreSQL
+# database to build client applications.
+#
+# If includes are found, the variable PQINCPATH will be set. If librarys
+# are found, the variable PQLIBPATH will be set. if no check was
+# successful, the script exits with a error message.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Christian Toepp <c.toepp@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([CT_CHECK_POSTGRES_DB], [
+
+AC_ARG_WITH(pgsql,
+ [ --with-pgsql=PREFIX Prefix of your PostgreSQL installation],
+ [pg_prefix=$withval], [pg_prefix=])
+AC_ARG_WITH(pgsql-inc,
+ [ --with-pgsql-inc=PATH Path to the include directory of PostgreSQL],
+ [pg_inc=$withval], [pg_inc=])
+AC_ARG_WITH(pgsql-lib,
+ [ --with-pgsql-lib=PATH Path to the librarys of PostgreSQL],
+ [pg_lib=$withval], [pg_lib=])
+
+
+AC_SUBST(PQINCPATH)
+AC_SUBST(PQLIBPATH)
+
+if test "$pg_prefix" != ""; then
+ AC_MSG_CHECKING([for PostgreSQL includes in $pg_prefix/include])
+ if test -f "$pg_prefix/include/libpq-fe.h" ; then
+ PQINCPATH="-I$pg_prefix/include"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_ERROR(libpq-fe.h not found)
+ fi
+ AC_MSG_CHECKING([for PostgreSQL librarys in $pg_prefix/lib])
+ if test -f "$pg_prefix/lib/libpq.so" ; then
+ PQLIBPATH="-L$pg_prefix/lib"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_ERROR(libpq.so not found)
+ fi
+else
+ if test "$pg_inc" != ""; then
+ AC_MSG_CHECKING([for PostgreSQL includes in $pg_inc])
+ if test -f "$pg_inc/libpq-fe.h" ; then
+ PQINCPATH="-I$pg_inc"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_ERROR(libpq-fe.h not found)
+ fi
+ fi
+ if test "$pg_lib" != ""; then
+ AC_MSG_CHECKING([for PostgreSQL librarys in $pg_lib])
+ if test -f "$pg_lib/libpq.so" ; then
+ PQLIBPATH="-L$pg_lib"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_ERROR(libpq.so not found)
+ fi
+ fi
+fi
+
+if test "$PQINCPATH" = "" ; then
+ AC_CHECK_HEADER([libpq-fe.h], [], AC_MSG_ERROR(libpq-fe.h not found))
+fi
+if test "$PQLIBPATH" = "" ; then
+ AC_CHECK_LIB(pq, PQconnectdb, [], AC_MSG_ERROR(libpq.so not found))
+fi
+
+])
diff --git a/m4/dps_check_plugin.m4 b/m4/dps_check_plugin.m4
new file mode 100644
index 0000000..f32b3ca
--- /dev/null
+++ b/m4/dps_check_plugin.m4
@@ -0,0 +1,98 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/dps_check_plugin.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# DPS_CHECK_JAVA_PLUGIN(<shell-variable>)
+#
+# DESCRIPTION
+#
+# This macro sets <shell-variable> to empty on failure and to a compatible
+# version of plugin.jar otherwise. Directories searched are /usr/java/*
+# and /usr/local/java/*, which are assumed to be j{dk,re} installations.
+# Apply the shell variable as you see fit. If sun changes things so
+# <jre>/lib/plugin.jar is not the magic file it will stop working.
+#
+# This macro assumes that unzip, zipinfo or pkzipc is avialable (and can
+# list the contents of the jar archive). The first two are assumed to work
+# similarly enough to the infozip versisonms. The pkzipc version is
+# assumed to work if I undertstand the documentation on pkware's site but
+# YMMV. I do not have access to pwkware's version to test it.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Duncan Simpson <dps@simpson.demon.co.uk>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([DPS_CHECK_JAVA_PLUGIN],
+[AC_REQUIRE([AC_PROG_AWK])
+AC_REQUIRE([AC_PROG_FGREP])
+AC_CHECK_PROG(ZIPINFO,[zipinfo unzip pkzipc])
+AC_MSG_CHECKING([for the java plugin])
+case "x$ZIPINFO" in
+[*/zipinfo)]
+ zipinf="zipinfo -1" ;;
+[*/unzip)]
+ zipinf="unzip -l";;
+[*/pkzipc)]
+ ziping="unzipc -view";;
+[x*)]
+ AC_MSG_RESULT([skiped, none of zipinfo, unzip and pkzipc found])
+ AC_SUBST($1,[])
+ zipinf="";;
+esac
+if test "x$zipinf" != "x"; then
+jplugin=""
+for jhome in `ls -dr /usr/java/* /usr/local/java/* 2> /dev/null`; do
+for jfile in lib/plugin.jar jre/lib/plugin.jar; do
+if test "x$jplugin" = "x" && test -f "$jhome/$jfile"; then
+eval "$zipinf $jhome/$jfile | $AWK '{ print \$NF; }' | $FGREP netscape/javascript/JSObject" >/dev/null 2>/dev/null
+if test $? -eq 0; then
+dnl Some version of gcj (and javac) refuse to work with some files
+dnl that pass this test. To stop this problem make sure that the compiler
+dnl still works with this jar file in the classpath
+cat << \EOF > Test.java
+/* [#]line __oline__ "configure" */
+public class Test {
+}
+EOF
+if eval "$JAVAC -classpath $jhome/$jfile Test.java 2>/dev/null >/dev/null" && test -f Test.class; then
+jplugin="$jhome/$jfile"
+fi
+rm -f Test.java Test.class
+fi; fi; done; done
+if test "x$jplugin" != "x"; then
+AC_SUBST($1,$jplugin)
+AC_MSG_RESULT($jplugin)
+else
+AC_MSG_RESULT([java plugin not found])
+AC_SUBST($1,[])
+fi
+fi
+])
diff --git a/m4/dps_java_check_class.m4 b/m4/dps_java_check_class.m4
new file mode 100644
index 0000000..ea5dfcc
--- /dev/null
+++ b/m4/dps_java_check_class.m4
@@ -0,0 +1,82 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/dps_java_check_class.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# DPS_JAVA_CHECK_CLASS(<class>,<action-if-found>,<action-if-not-found>)
+#
+# DESCRIPTION
+#
+# Test if a Java class is available. Based on AC_PROG_JAVAC_WORKS. This
+# version uses a cache variable which is both compiler, options and
+# classpath dependent (so if you switch from javac to gcj it correctly
+# notices and redoes the test).
+#
+# The macro tries to compile a minimal program importing <class>. Some
+# newer compilers moan about the failure to use this but fail or produce a
+# class file anyway. All moaing is sunk to /dev/null since I only wanted
+# to know if the class could be imported. This is a recommended followup
+# to DPS_CHECK_JAVA_PLUGIN with classpath appropriately adjusted.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Duncan Simpson <dps@simpson.demon.co.uk>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([DPS_JAVA_CHECK_CLASS],[
+m4_define([cache_val],[m4_translit(dps_cv_have_java_class_$1, " ." ,"__")])
+if test "x$CLASSPATH" != "x"; then
+xtra=" with classpath ${CLASSPATH}"
+xopts=`echo ${CLASSPATH} | ${SED} 's/^ *://'`
+xopts="-classpath $xopts"
+else xtra=""; xopts=""; fi
+cache_var="cache_val"AS_TR_SH([_Jc_${JAVAC}_Cp_${CLASSPATH}])
+AC_CACHE_CHECK([if the $1 class is avialable$xtra], [$cache_var], [
+JAVA_TEST=Test.java
+CLASS_TEST=Test.class
+cat << \EOF > $JAVA_TEST
+/* [#]xline __oline__ "configure" */
+import $1;
+public class Test {
+}
+EOF
+if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $xopts $JAVA_TEST) >/dev/null 2>&1; then
+ eval "${cache_var}=yes"
+else
+ eval "${cache_var}=no"
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat $JAVA_TEST >&AC_FD_CC
+fi
+rm -f $JAVA_TEST $CLASS_TEST
+])
+if eval 'test "x$'${cache_var}'" = "xyes"'; then
+$2
+true; else
+$3
+false; fi])
diff --git a/m4/dps_libgcj_jar.m4 b/m4/dps_libgcj_jar.m4
new file mode 100644
index 0000000..bcfaea4
--- /dev/null
+++ b/m4/dps_libgcj_jar.m4
@@ -0,0 +1,80 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/dps_libgcj_jar.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# DPS_LIBGCJ_JAR
+#
+# DESCRIPTION
+#
+# Locate libgcj.jar so you can place it before everything else when using
+# gcj.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Duncan Simpson <dps@simpson.demon.co.uk>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([DPS_LIBGCJ_JAR],
+[
+AC_REQUIRE([AC_EXEEXT])
+AC_REQUIRE([AC_PROG_JAVAC])
+AC_REQUIRE([AC_PROG_FGREP])
+AC_CHECK_PROG(SED, sed)
+if test "x$SED" = "x"; then
+AC_MSG_WARN([sed not avaiable, so libgcj.jar test skipped])
+else
+AC_MSG_CHECKING([if $JAVAC is gcj]);
+jc=`eval "[echo x$JAVAC | $SED 's/^x.*\\/\\([^/]*\\)\$/x\\1/;s/^ *\\([^ ]*\\) .*$/\\1/;s/"$EXEEXT"$//']"`
+if test "x$jc" != "xxgcj"; then
+AC_MSG_RESULT(no)
+else
+AC_MSG_RESULT(yes)
+AC_MSG_CHECKING([libgcj.jar location])
+save_cp="$CLASSPATH";
+unset CLASSPATH;
+AC_MSG_CHECKING([gcj default classpath])
+cat << \EOF > Test.java
+/* [#]line __oline__ "configure" */
+public class Test {
+}
+EOF
+lgcj=`eval "[$JAVAC -v -C Test.java 2>&1 | $FGREP \\(system\\) | $SED 's/^ *\\([^ ]*\\) .*$/\\1/;s/\\.jar\\//.jar/']"`;
+if test -f Test.class && test "x$lgcj" != "x"; then
+AC_MSG_RESULT($lgcj)
+$1="$lgcj:"
+else
+AC_MSG_RESULT(failed)
+$1=""
+fi
+if test "x$save_cp" != "x"; then CLASSPATH="$save_cp"; fi
+rm -f Test.java Test.class
+fi
+fi
+])
diff --git a/m4/dps_snprintf_oflow.m4 b/m4/dps_snprintf_oflow.m4
new file mode 100644
index 0000000..1e59a74
--- /dev/null
+++ b/m4/dps_snprintf_oflow.m4
@@ -0,0 +1,58 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/dps_snprintf_oflow.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# dps_snprintf_oflow
+#
+# DESCRIPTION
+#
+# Checks whether snprintf ignores the value of n or not and defines
+# HAVE_SNPRINTF_BUG if it does.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Duncan Simpson <dps@simpson.demon.co.uk>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([dps_snprintf_oflow],
+[AC_MSG_CHECKING(whether snprintf ignores n)
+AC_CACHE_VAL(dps_cv_snprintf_bug,
+[AC_TRY_RUN(
+changequote(<<, >>)dnl
+<<#include <stdio.h>
+
+#ifndef HAVE_SNPRINTF
+#ifdef HAVE_VSNPRINTF
+#include "vsnprintf.h"
+#else /* not HAVE_VSNPRINTF */
+#include "vsnprintf.c"
+#endif /* HAVE_VSNPRINTF */
+#endif /* HAVE_SNPRINTF */
+
+int main(void)
+{
+char ovbuf[7];
+int i;
+for (i=0; i<7; i++) ovbuf[i]='x';
+snprintf(ovbuf, 4,"foo%s", "bar");
+if (ovbuf[5]!='x') exit(1);
+snprintf(ovbuf, 4,"foo%d", 666);
+if (ovbuf[5]!='x') exit(1);
+exit(0);
+} >>
+changequote([, ]), dps_cv_snprintf_bug=0, dps_cv_snprintf_bug=1,
+dps_cv_snprintf_bug=2)])
+if test $dps_cv_snprintf_bug -eq 0; then
+ AC_MSG_RESULT([no, snprintf is ok])
+else if test $dps_cv_snprintf_bug -eq 1; then
+ AC_MSG_RESULT([yes, snprintf is broken])
+ AC_DEFINE(HAVE_SNPRINTF_BUG,1)
+else
+ AC_MSG_RESULT([unknown, assuming yes])
+ AC_DEFINE(HAVE_SNPRINTF_BUG,1)
+fi; fi])
diff --git a/m4/dps_xtra_classpath.m4 b/m4/dps_xtra_classpath.m4
new file mode 100644
index 0000000..39bad87
--- /dev/null
+++ b/m4/dps_xtra_classpath.m4
@@ -0,0 +1,65 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/dps_xtra_classpath.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# DPS_XTRA_CLASSPATH(<classpath>,<class>,<jarfile>,<action-if-found>,<action-if-not-found>)
+#
+# DESCRIPTION
+#
+# Set $1 to extra classpath components required for class $2 found in a
+# jar file in $3. If the class is found do $4 and otherwise do $5. Uses
+# DPS_JAVA_CHECK_CLASS for testing whether a class is avialable
+#
+# LICENSE
+#
+# Copyright (c) 2008 Duncan Simpson <dps@simpson.demon.co.uk>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([DPS_XTRA_CLASSPATH],[
+AC_CHECK_PROG(SED, sed)
+DPS_JAVA_CHECK_CLASS([$2],[got="yes"],[got="no"])
+cpxtra=""; saved_cp="${CLASSPATH}";
+for jhome in `ls -dr /usr/java/* /usr/local/java/* 2> /dev/null`; do
+for jdir in lib jre/lib; do
+for jfile in $3; do
+if test "x$got" != "xyes" && test -f "$jhome/$jdir/$jfile"; then
+CLASSPATH="${saved_cp}:$jhome/$jdir/$jfile"
+DPS_JAVA_CHECK_CLASS([$2],[got="yes"; cpxtra="$jhome/$jdir/$jfile:"],[got="no"])
+fi; done; done; done
+if test "x${saved_cp}" != "x"; then
+CLASSPATH="${saved_cp}"
+else unset CLASSPATH; fi
+if test "x$got" = "xyes"; then
+$1="$cpxtra"
+$4
+true; else
+$5
+false; fi
+])
diff --git a/m4/etr_short_sleep.m4 b/m4/etr_short_sleep.m4
new file mode 100644
index 0000000..a46790e
--- /dev/null
+++ b/m4/etr_short_sleep.m4
@@ -0,0 +1,88 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/etr_short_sleep.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ETR_SHORT_SLEEP
+#
+# DESCRIPTION
+#
+# This macro searches for a "sleep" function that has 1/1000 of a second
+# accuracy. On some systems, this is known as nap() and on others usleep()
+# / 1000. There are probably other functions like this defined in other
+# system libraries, but we don't know how to search for them yet.
+# Contributions joyously accepted. :)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Warren Young <warren@etr-usa.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([ETR_SHORT_SLEEP],
+[
+ AC_MSG_CHECKING([for nap() in libc])
+ AC_TRY_LINK([ extern "C" long nap(long ms); ], [ nap(42); ],
+ [
+ etr_ss_found=yes
+ etr_ss_factor=1
+ AC_DEFINE(HAVE_NAP,1,
+ [Define to use the nap() system call for short sleeps])
+ AC_MSG_RESULT(yes)
+ ],
+ [
+ AC_MSG_RESULT(no)
+ etr_ss_found=no
+ ])
+
+ if test x"$etr_ss_found" = "xno"
+ then
+ AC_MSG_CHECKING([for usleep()])
+ AC_TRY_LINK([ #include <unistd.h> ], [ usleep(42); ],
+ [
+ etr_ss_found=yes
+ etr_ss_factor=1000
+ AC_DEFINE(HAVE_USLEEP,1,
+ [Define to use the usleep() system call for short sleeps])
+ AC_MSG_RESULT(yes)
+ ],
+ [
+ AC_MSG_RESULT(no)
+ etr_ss_found=no
+ ])
+ fi
+
+ if test x"$etr_ss_found" = "xno"
+ then
+ save_LIBS=$LIBS
+ LIBS="$LIBS -lx"
+ AC_MSG_CHECKING([for nap() in libx])
+ AC_TRY_LINK([ extern "C" long nap(long ms); ], [ nap(42); ],
+ [
+ etr_ss_found=yes
+ etr_ss_factor=1
+ AC_DEFINE(HAVE_NAP,1,
+ [Define to use the nap() system call for short sleeps])
+ AC_MSG_RESULT(yes)
+ ],
+ [
+ AC_MSG_RESULT(no)
+ etr_ss_found=no
+ ])
+
+ LIBS=$save_LIBS
+ ETR_SS_LIB=-lx
+ AC_SUBST(ETR_SS_LIB)
+ fi
+
+ if test x"$etr_ss_found" = "xyes"
+ then
+ AC_DEFINE_UNQUOTED(SHORT_SLEEP_FACTOR, $etr_ss_factor,
+ [Multiply milliseconds by this to get the argument for the short sleep system call])
+ else
+ AC_MSG_ERROR([Could not find a "short sleep" system call.])
+ fi
+])dnl ETR_SHORT_SLEEP
diff --git a/m4/etr_string_strcasecmp.m4 b/m4/etr_string_strcasecmp.m4
new file mode 100644
index 0000000..465387c
--- /dev/null
+++ b/m4/etr_string_strcasecmp.m4
@@ -0,0 +1,48 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/etr_string_strcasecmp.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ETR_STRING_STRCASECMP
+#
+# DESCRIPTION
+#
+# This macro tries to find strcasecmp() in string.h.
+#
+# Use this macro in conjunction with ETR_STRINGS_STRCASECMP in your
+# configure.in like so:
+#
+# ETR_STRING_STRCASECMP
+# if test x"$ac_cv_string_strcasecmp" = "xno" ; then
+# ETR_STRINGS_STRCASECMP
+# fi
+#
+# This will cause either HAVE_STRING_STRCASECMP or HAVE_STRINGS_STRCASECMP
+# to be defined in config.h, which will tell your code what header to
+# include to get strcasecmp()'s prototype.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Warren Young <warren@etr-usa.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([ETR_STRING_STRCASECMP],
+[
+AC_CACHE_CHECK([for strcasecmp() in string.h], ac_cv_string_strcasecmp, [
+ AC_TRY_LINK(
+ [ #include <string.h> ],
+ [ strcasecmp("foo", "bar"); ],
+ ac_cv_string_strcasecmp=yes,
+ ac_cv_string_strcasecmp=no)
+])
+
+ if test x"$ac_cv_string_strcasecmp" = "xyes"
+ then
+ AC_DEFINE(HAVE_STRING_STRCASECMP, 1,
+ [ Define if your system has strcasecmp() in string.h ])
+ fi
+]) dnl ETR_STRING_STRCASECMP
diff --git a/m4/etr_strings_strcasecmp.m4 b/m4/etr_strings_strcasecmp.m4
new file mode 100644
index 0000000..96dddef
--- /dev/null
+++ b/m4/etr_strings_strcasecmp.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/etr_strings_strcasecmp.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ETR_STRINGS_STRCASECMP
+#
+# DESCRIPTION
+#
+# This macro tries to find strcasecmp() in strings.h. See the
+# ETR_STRING_STRCASECMP macro's commentary for usage details.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Warren Young <warren@etr-usa.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([ETR_STRINGS_STRCASECMP],
+[ AC_CACHE_CHECK([for strcasecmp() in strings.h], ac_cv_strings_strcasecmp, [
+
+ AC_TRY_LINK(
+ [ #include <strings.h> ],
+ [ strcasecmp("foo", "bar"); ],
+ ac_cv_strings_strcasecmp=yes,
+ ac_cv_strings_strcasecmp=no)
+])
+
+ if test x"$ac_cv_strings_strcasecmp" = "xyes"
+ then
+ AC_DEFINE(HAVE_STRINGS_STRCASECMP, 1,
+ [ Define if your system has strcasecmp() in strings.h ])
+ fi
+]) dnl ETR_STRINGS_STRCASECMP
diff --git a/m4/etr_struct_semun.m4 b/m4/etr_struct_semun.m4
new file mode 100644
index 0000000..7a34bdb
--- /dev/null
+++ b/m4/etr_struct_semun.m4
@@ -0,0 +1,47 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/etr_struct_semun.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ETR_STRUCT_SEMUN
+#
+# DESCRIPTION
+#
+# This macro checks to see if sys/sem.h defines struct semun. Some systems
+# do, some systems don't. Your code must be able to deal with this
+# possibility; if HAVE_STRUCT_SEMUM isn't defined for a given system, you
+# have to define this structure before you can call functions like
+# semctl().
+#
+# You should call ETR_SYSV_IPC before this macro, to separate the check
+# for System V IPC headers from the check for struct semun.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Warren Young <warren@etr-usa.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([ETR_STRUCT_SEMUN],
+[
+AC_CACHE_CHECK([for struct semun], ac_cv_struct_semun, [
+ AC_TRY_COMPILE(
+ [
+ #include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/sem.h>
+ ],
+ [ struct semun s; ],
+ ac_cv_struct_semun=yes,
+ ac_cv_struct_semun=no)
+])
+
+ if test x"$ac_cv_struct_semun" = "xyes"
+ then
+ AC_DEFINE(HAVE_STRUCT_SEMUN, 1,
+ [ Define if your system's sys/sem.h file defines struct semun ])
+ fi
+]) dnl ETR_STRUCT_SEMUN
diff --git a/m4/etr_sysv_ipc.m4 b/m4/etr_sysv_ipc.m4
new file mode 100644
index 0000000..b54e954
--- /dev/null
+++ b/m4/etr_sysv_ipc.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/etr_sysv_ipc.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ETR_SYSV_IPC
+#
+# DESCRIPTION
+#
+# This macro checks for the SysV IPC header files. It only checks that you
+# can compile a program with them, not whether the system actually
+# implements working SysV IPC.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Warren Young <warren@etr-usa.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([ETR_SYSV_IPC],
+[
+AC_CACHE_CHECK([for System V IPC headers], ac_cv_sysv_ipc, [
+ AC_TRY_COMPILE(
+ [
+ #include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/msg.h>
+ #include <sys/sem.h>
+ #include <sys/shm.h>
+ ],, ac_cv_sysv_ipc=yes, ac_cv_sysv_ipc=no)
+])
+
+ if test x"$ac_cv_sysv_ipc" = "xyes"
+ then
+ AC_DEFINE(HAVE_SYSV_IPC, 1, [ Define if you have System V IPC ])
+ fi
+]) dnl ETR_SYSV_IPC
diff --git a/m4/gl_trilinos_absolute_header.m4 b/m4/gl_trilinos_absolute_header.m4
new file mode 100644
index 0000000..492b707
--- /dev/null
+++ b/m4/gl_trilinos_absolute_header.m4
@@ -0,0 +1,67 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/gl_trilinos_absolute_header.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# gl_TRILINOS_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
+#
+# DESCRIPTION
+#
+# Find the absolute name of a header file, assuming the header exists. If
+# the header were sys/inttypes.h, this macro would define
+# ABSOLUTE_SYS_INTTYPES_H to the `""' quoted absolute name of
+# sys/inttypes.h in config.h (e.g. `#define ABSOLUTE_SYS_INTTYPES_H
+# "///usr/include/sys/inttypes.h"'). The three "///" are to pacify Sun C
+# 5.8, which otherwise would say "warning: #include of /usr/include/...
+# may be non-portable". Use `""', not `<>', so that the /// cannot be
+# confused with a C99 comment.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Derek Price
+# Copyright (c) 2009 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Derek Price.
+dnl Modified by Rhys Ulerich to use AC_CHECK_HEADERS instead of _ONCE
+
+AC_DEFUN([gl_TRILINOS_ABSOLUTE_HEADER],
+[AC_LANG_PREPROC_REQUIRE()dnl
+AC_FOREACH([gl_HEADER_NAME], [$1],
+ [AS_VAR_PUSHDEF([gl_absolute_header],
+ [gl_cv_absolute_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
+ AC_CACHE_CHECK([absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
+ m4_quote(m4_defn([gl_absolute_header])),
+ [AS_VAR_PUSHDEF([ac_header_exists],
+ [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
+ AC_CHECK_HEADERS(m4_quote(m4_defn([gl_HEADER_NAME])))dnl
+ if test AS_VAR_GET(ac_header_exists) = yes; then
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]])])
+dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+ AS_VAR_SET(gl_absolute_header,
+[`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{
+ s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#
+ s#^/[^/]#//&#
+ p
+ q
+}'`])
+ fi
+ AS_VAR_POPDEF([ac_header_exists])dnl
+ ])dnl
+ AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_quote(m4_defn([gl_HEADER_NAME]))),
+ ["AS_VAR_GET(gl_absolute_header)"],
+ [Define this to an absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>.])
+ AS_VAR_POPDEF([gl_absolute_header])dnl
+])dnl
+])# gl_TRILINOS_ABSOLUTE_HEADER
diff --git a/m4/immdx_lib_metis.m4 b/m4/immdx_lib_metis.m4
new file mode 100644
index 0000000..b881898
--- /dev/null
+++ b/m4/immdx_lib_metis.m4
@@ -0,0 +1,115 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/immdx_lib_metis.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# IMMDX_LIB_METIS([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# This macro searches for the METIS library in the user specified
+# location. The user may specify the location either by defining the
+# environment variable METIS or by using the --with-metis option to
+# configure. If the environment variable is defined it has precedent over
+# everything else. If no location was specified then it searches in
+# /usr/lib and /usr/local/lib for the library and in /usr/include and
+# /usr/local/include for the header files. Upon sucessful completion the
+# variables METIS_LIB and METIS_INCLUDE are set.
+#
+# ACTION-IF-FOUND is a list of shell commands to run if a METIS library is
+# found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is
+# not found. If ACTION-IF-FOUND is not specified, the default action will
+# define HAVE_METIS. If ACTION-IF-NOT-FOUND is not specified then an error
+# will be generated halting configure.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ben Bergen <ben@cs.fau.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([IMMDX_LIB_METIS], [
+ AC_MSG_CHECKING(for METIS library)
+ AC_REQUIRE([AC_PROG_CC])
+ #
+ # User hints...
+ #
+ AC_ARG_VAR([METIS], [METIS library location])
+ AC_ARG_WITH([metis],
+ [AC_HELP_STRING([--with-metis],
+ [user defined path to METIS library])],
+ [
+ if test -n "$METIS" ; then
+ AC_MSG_RESULT(yes)
+ with_metis=$METIS
+ elif test "$withval" != no ; then
+ AC_MSG_RESULT(yes)
+ with_metis=$withval
+ else
+ AC_MSG_RESULT(no)
+ fi
+ ],
+ [
+ if test -n "$METIS" ; then
+ with_metis=$METIS
+ AC_MSG_RESULT(yes)
+ else
+ with_metis=/usr
+ if test ! -f "$with_metis/include/metis.h" ; then
+ with_metis=/usr/local
+ if test ! -f "$with_metis/include/metis.h" ; then
+ with_metis=""
+ AC_MSG_RESULT(failed)
+ else
+ AC_MSG_RESULT(yes)
+ fi
+ else
+ AC_MSG_RESULT(yes)
+ fi
+ fi
+ ])
+ #
+ # locate METIS library
+ #
+ if test -n "$with_metis" ; then
+ old_CFLAGS=$CFLAGS
+ old_LDFLAGS=$LDFLAGS
+ CFLAGS="-I$with_metis/include"
+ LDFLAGS="-L$with_metis/lib"
+
+ AC_LANG_SAVE
+ AC_LANG_C
+
+ AC_CHECK_LIB(metis, METIS_PartMeshDual,
+ [metis_lib=yes], [metis_lib=yes], [-lm])
+ AC_CHECK_HEADER(metis.h, [metis_h=yes],
+ [metis_h=no], [/* check */])
+
+ AC_LANG_RESTORE
+
+ CFLAGS=$old_CFLAGS
+ LDFLAGS=$old_LDFLAGS
+
+ AC_MSG_CHECKING(METIS in $with_metis)
+ if test "$metis_lib" = "yes" -a "$metis_h" = "yes" ; then
+ AC_SUBST(METIS_INCLUDE, [-I$with_metis/include])
+ AC_SUBST(METIS_LIB, [-L$with_metis/lib])
+ AC_MSG_RESULT(ok)
+ else
+ AC_MSG_RESULT(failed)
+ fi
+ fi
+ #
+ #
+ #
+ if test x = x"$METIS_LIB" ; then
+ ifelse([$2],,[AC_MSG_ERROR(Failed to find valid METIS library)],[$2])
+ :
+ else
+ ifelse([$1],,[AC_DEFINE(HAVE_METIS,1,[Define if you have METIS library])],[$1])
+ :
+ fi
+ ])dnl IMMDX_LIB_METIS
diff --git a/m4/klm_sys_weak_alias.m4 b/m4/klm_sys_weak_alias.m4
new file mode 100644
index 0000000..8b8d940
--- /dev/null
+++ b/m4/klm_sys_weak_alias.m4
@@ -0,0 +1,333 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/klm_sys_weak_alias.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# KLM_SYS_WEAK_ALIAS
+#
+# DESCRIPTION
+#
+# Determines whether weak aliases are supported on the system, and if so,
+# what scheme is used to declare them. Also checks to see if aliases can
+# cross object file boundaries, as some systems don't permit them to.
+#
+# Most systems permit something called a "weak alias" or "weak symbol."
+# These aliases permit a library to provide a stub form of a routine
+# defined in another library, thus allowing the first library to operate
+# even if the other library is not linked. This macro will check for
+# support of weak aliases, figure out what schemes are available, and
+# determine some characteristics of the weak alias support -- primarily,
+# whether a weak alias declared in one object file may be referenced from
+# another object file.
+#
+# There are four known schemes of declaring weak symbols; each scheme is
+# checked in turn, and the first one found is prefered. Note that only one
+# of the mentioned preprocessor macros will be defined!
+#
+# 1. Function attributes
+#
+# This scheme was first introduced by the GNU C compiler, and attaches
+# attributes to particular functions. It is among the easiest to use, and
+# so is the first one checked. If this scheme is detected, the
+# preprocessor macro HAVE_SYS_WEAK_ALIAS_ATTRIBUTE will be defined to 1.
+# This scheme is used as in the following code fragment:
+#
+# void __weakf(int c)
+# {
+# /* Function definition... */
+# }
+#
+# void weakf(int c) __attribute__((weak, alias("__weakf")));
+#
+# 2. #pragma weak
+#
+# This scheme is in use by many compilers other than the GNU C compiler.
+# It is also particularly easy to use, and fairly portable -- well, as
+# portable as these things get. If this scheme is detected first, the
+# preprocessor macro HAVE_SYS_WEAK_ALIAS_PRAGMA will be defined to 1. This
+# scheme is used as in the following code fragment:
+#
+# extern void weakf(int c);
+# #pragma weak weakf = __weakf
+# void __weakf(int c)
+# {
+# /* Function definition... */
+# }
+#
+# 3. #pragma _HP_SECONDARY_DEF
+#
+# This scheme appears to be in use by the HP compiler. As it is rather
+# specialized, this is one of the last schemes checked. If it is the first
+# one detected, the preprocessor macro HAVE_SYS_WEAK_ALIAS_HPSECONDARY
+# will be defined to 1. This scheme is used as in the following code
+# fragment:
+#
+# extern void weakf(int c);
+# #pragma _HP_SECONDARY_DEF __weakf weakf
+# void __weakf(int c)
+# {
+# /* Function definition... */
+# }
+#
+# 4. #pragma _CRI duplicate
+#
+# This scheme appears to be in use by the Cray compiler. As it is rather
+# specialized, it too is one of the last schemes checked. If it is the
+# first one detected, the preprocessor macro
+# HAVE_SYS_WEAK_ALIAS_CRIDUPLICATE will be defined to 1. This scheme is
+# used as in the following code fragment:
+#
+# extern void weakf(int c);
+# #pragma _CRI duplicate weakf as __weakf
+# void __weakf(int c)
+# {
+# /* Function definition... */
+# }
+#
+# In addition to the preprocessor macros listed above, if any scheme is
+# found, the preprocessor macro HAVE_SYS_WEAK_ALIAS will also be defined
+# to 1.
+#
+# Once a weak aliasing scheme has been found, a check will be performed to
+# see if weak aliases are honored across object file boundaries. If they
+# are, the HAVE_SYS_WEAK_ALIAS_CROSSFILE preprocessor macro is defined to
+# 1.
+#
+# This Autoconf macro also makes two substitutions. The first, WEAK_ALIAS,
+# contains the name of the scheme found (one of "attribute", "pragma",
+# "hpsecondary", or "criduplicate"), or "no" if no weak aliasing scheme
+# was found. The second, WEAK_ALIAS_CROSSFILE, is set to "yes" or "no"
+# depending on whether or not weak aliases may cross object file
+# boundaries.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Kevin L. Mitchell <klmitch@mit.edu>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([KLM_SYS_WEAK_ALIAS], [
+ # starting point: no aliasing scheme yet...
+ klm_sys_weak_alias=no
+
+ # Figure out what kind of aliasing may be supported...
+ _KLM_SYS_WEAK_ALIAS_ATTRIBUTE
+ _KLM_SYS_WEAK_ALIAS_PRAGMA
+ _KLM_SYS_WEAK_ALIAS_HPSECONDARY
+ _KLM_SYS_WEAK_ALIAS_CRIDUPLICATE
+
+ # Do we actually support aliasing?
+ AC_CACHE_CHECK([how to create weak aliases with $CC],
+ [klm_cv_sys_weak_alias],
+ [klm_cv_sys_weak_alias=$klm_sys_weak_alias])
+
+ # OK, set a #define
+ AS_IF([test $klm_cv_sys_weak_alias != no], [
+ AC_DEFINE([HAVE_SYS_WEAK_ALIAS], 1,
+ [Define this if your system can create weak aliases])
+ ])
+
+ # Can aliases cross object file boundaries?
+ _KLM_SYS_WEAK_ALIAS_CROSSFILE
+
+ # OK, remember the results
+ AC_SUBST([WEAK_ALIAS], [$klm_cv_sys_weak_alias])
+ AC_SUBST([WEAK_ALIAS_CROSSFILE], [$klm_cv_sys_weak_alias_crossfile])
+])
+
+AC_DEFUN([_KLM_SYS_WEAK_ALIAS_ATTRIBUTE],
+[ # Test whether compiler accepts __attribute__ form of weak aliasing
+ AC_CACHE_CHECK([whether $CC accepts function __attribute__((weak,alias()))],
+ [klm_cv_sys_weak_alias_attribute], [
+ # We add -Werror if it's gcc to force an error exit if the weak attribute
+ # isn't understood
+ AS_IF([test $GCC = yes], [
+ save_CFLAGS=$CFLAGS
+ CFLAGS=-Werror])
+
+ # Try linking with a weak alias...
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([
+void __weakf(int c) {}
+void weakf(int c) __attribute__((weak, alias("__weakf")));],
+ [weakf(0)])],
+ [klm_cv_sys_weak_alias_attribute=yes],
+ [klm_cv_sys_weak_alias_attribute=no])
+
+ # Restore original CFLAGS
+ AS_IF([test $GCC = yes], [
+ CFLAGS=$save_CFLAGS])
+ ])
+
+ # What was the result of the test?
+ AS_IF([test $klm_sys_weak_alias = no &&
+ test $klm_cv_sys_weak_alias_attribute = yes], [
+ klm_sys_weak_alias=attribute
+ AC_DEFINE([HAVE_SYS_WEAK_ALIAS_ATTRIBUTE], 1,
+ [Define this if weak aliases may be created with __attribute__])
+ ])
+])
+
+AC_DEFUN([_KLM_SYS_WEAK_ALIAS_PRAGMA],
+[ # Test whether compiler accepts #pragma form of weak aliasing
+ AC_CACHE_CHECK([whether $CC supports @%:@pragma weak],
+ [klm_cv_sys_weak_alias_pragma], [
+
+ # Try linking with a weak alias...
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([
+extern void weakf(int c);
+@%:@pragma weak weakf = __weakf
+void __weakf(int c) {}],
+ [weakf(0)])],
+ [klm_cv_sys_weak_alias_pragma=yes],
+ [klm_cv_sys_weak_alias_pragma=no])
+ ])
+
+ # What was the result of the test?
+ AS_IF([test $klm_sys_weak_alias = no &&
+ test $klm_cv_sys_weak_alias_pragma = yes], [
+ klm_sys_weak_alias=pragma
+ AC_DEFINE([HAVE_SYS_WEAK_ALIAS_PRAGMA], 1,
+ [Define this if weak aliases may be created with @%:@pragma weak])
+ ])
+])
+
+AC_DEFUN([_KLM_SYS_WEAK_ALIAS_HPSECONDARY],
+[ # Test whether compiler accepts _HP_SECONDARY_DEF pragma from HP...
+ AC_CACHE_CHECK([whether $CC supports @%:@pragma _HP_SECONDARY_DEF],
+ [klm_cv_sys_weak_alias_hpsecondary], [
+
+ # Try linking with a weak alias...
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([
+extern void weakf(int c);
+@%:@pragma _HP_SECONDARY_DEF __weakf weakf
+void __weakf(int c) {}],
+ [weakf(0)])],
+ [klm_cv_sys_weak_alias_hpsecondary=yes],
+ [klm_cv_sys_weak_alias_hpsecondary=no])
+ ])
+
+ # What was the result of the test?
+ AS_IF([test $klm_sys_weak_alias = no &&
+ test $klm_cv_sys_weak_alias_hpsecondary = yes], [
+ klm_sys_weak_alias=hpsecondary
+ AC_DEFINE([HAVE_SYS_WEAK_ALIAS_HPSECONDARY], 1,
+ [Define this if weak aliases may be created with @%:@pragma _HP_SECONDARY_DEF])
+ ])
+])
+
+AC_DEFUN([_KLM_SYS_WEAK_ALIAS_CRIDUPLICATE],
+[ # Test whether compiler accepts "_CRI duplicate" pragma from Cray
+ AC_CACHE_CHECK([whether $CC supports @%:@pragma _CRI duplicate],
+ [klm_cv_sys_weak_alias_criduplicate], [
+
+ # Try linking with a weak alias...
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([
+extern void weakf(int c);
+@%:@pragma _CRI duplicate weakf as __weakf
+void __weakf(int c) {}],
+ [weakf(0)])],
+ [klm_cv_sys_weak_alias_criduplicate=yes],
+ [klm_cv_sys_weak_alias_criduplicate=no])
+ ])
+
+ # What was the result of the test?
+ AS_IF([test $klm_sys_weak_alias = no &&
+ test $klm_cv_sys_weak_alias_criduplicate = yes], [
+ klm_sys_weak_alias=criduplicate
+ AC_DEFINE([HAVE_SYS_WEAK_ALIAS_CRIDUPLICATE], 1,
+ [Define this if weak aliases may be created with @%:@pragma _CRI duplicate])
+ ])
+])
+
+dnl Note: This macro is modeled closely on AC_LINK_IFELSE, and in fact
+dnl depends on some implementation details of that macro, particularly
+dnl its use of _AC_MSG_LOG_CONFTEST to log the failed test program and
+dnl its use of ac_link for running the linker.
+AC_DEFUN([_KLM_SYS_WEAK_ALIAS_CROSSFILE],
+[ # Check to see if weak aliases can cross object file boundaries
+ AC_CACHE_CHECK([whether $CC supports weak aliases across object file boundaries],
+ [klm_cv_sys_weak_alias_crossfile], [
+ AS_IF([test $klm_cv_sys_weak_alias = no],
+ [klm_cv_sys_weak_alias_crossfile=no], [
+dnl Must build our own test files...
+ # conftest1 contains our weak alias definition...
+ cat >conftest1.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+ cat confdefs.h >>conftest1.$ac_ext
+ cat >>conftest1.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+@%:@ifndef HAVE_SYS_WEAK_ALIAS_ATTRIBUTE
+extern void weakf(int c);
+@%:@endif
+@%:@if defined(HAVE_SYS_WEAK_ALIAS_PRAGMA)
+@%:@pragma weak weakf = __weakf
+@%:@elif defined(HAVE_SYS_WEAK_ALIAS_HPSECONDARY)
+@%:@pragma _HP_SECONDARY_DEF __weakf weakf
+@%:@elif defined(HAVE_SYS_WEAK_ALIAS_CRIDUPLICATE)
+@%:@pragma _CRI duplicate weakf as __weakf
+@%:@endif
+void __weakf(int c) {}
+@%:@ifdef HAVE_SYS_WEAK_ALIAS_ATTRIBUTE
+void weakf(int c) __attribute((weak, alias("__weakf")));
+@%:@endif
+_ACEOF
+ # And conftest2 contains our main routine that calls it
+ cat >conftest2.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+ cat confdefs.h >> conftest2.$ac_ext
+ cat >>conftest2.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+extern void weakf(int c);
+int
+main ()
+{
+ weakf(0);
+ return 0;
+}
+_ACEOF
+ # We must remove the object files (if any) ourselves...
+ rm -f conftest2.$ac_objext conftest$ac_exeext
+
+ # Change ac_link to compile *2* files together
+ save_aclink=$ac_link
+ ac_link=`echo "$ac_link" | \
+ sed -e 's/conftest\(\.\$ac_ext\)/conftest1\1 conftest2\1/'`
+dnl Substitute our own routine for logging the conftest
+m4_pushdef([_AC_MSG_LOG_CONFTEST],
+[echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
+echo ">>> conftest1.$ac_ext" >&AS_MESSAGE_LOG_FD
+sed "s/^/| /" conftest1.$ac_ext >&AS_MESSAGE_LOG_FD
+echo ">>> conftest2.$ac_ext" >&AS_MESSAGE_LOG_FD
+sed "s/^/| /" conftest2.$ac_ext >&AS_MESSAGE_LOG_FD
+])dnl
+ # Since we created the files ourselves, don't use SOURCE argument
+ AC_LINK_IFELSE(, [klm_cv_sys_weak_alias_crossfile=yes],
+ [klm_cv_sys_weak_alias_crossfile=no])
+dnl Restore _AC_MSG_LOG_CONFTEST
+m4_popdef([_AC_MSG_LOG_CONFTEST])dnl
+ # Restore ac_link
+ ac_link=$save_aclink
+
+ # We must remove the object files (if any) and C files ourselves...
+ rm -f conftest1.$ac_ext conftest2.$ac_ext \
+ conftest1.$ac_objext conftest2.$ac_objext
+ ])
+ ])
+
+ # What were the results of the test?
+ AS_IF([test $klm_cv_sys_weak_alias_crossfile = yes], [
+ AC_DEFINE([HAVE_SYS_WEAK_ALIAS_CROSSFILE], 1,
+ [Define this if weak aliases in other files are honored])
+ ])
+])
diff --git a/m4/lib_socket_nsl.m4 b/m4/lib_socket_nsl.m4
new file mode 100644
index 0000000..99ae282
--- /dev/null
+++ b/m4/lib_socket_nsl.m4
@@ -0,0 +1,36 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/lib_socket_nsl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# LIB_SOCKET_NSL
+#
+# DESCRIPTION
+#
+# This macro figures out what libraries are required on this platform to
+# link sockets programs.
+#
+# The common cases are not to need any extra libraries, or to need
+# -lsocket and -lnsl. We need to avoid linking with libnsl unless we need
+# it, though, since on some OSes where it isn't necessary it will totally
+# break networking. Unisys also includes gethostbyname() in libsocket but
+# needs libnsl for socket().
+#
+# LICENSE
+#
+# Copyright (c) 2008 Russ Allbery <rra@stanford.edu>
+# Copyright (c) 2008 Stepan Kasal <kasal@ucw.cz>
+# Copyright (c) 2008 Warren Young <warren@etr-usa.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([LIB_SOCKET_NSL],
+[
+ AC_SEARCH_LIBS([gethostbyname], [nsl])
+ AC_SEARCH_LIBS([socket], [socket], [], [
+ AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],
+ [], [-lnsl])])
+])
diff --git a/m4/lua.m4 b/m4/lua.m4
new file mode 100644
index 0000000..6c89aa9
--- /dev/null
+++ b/m4/lua.m4
@@ -0,0 +1,196 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/lua.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_WITH_LUA
+# AX_LUA_VERSION (MIN-VERSION, [TOO-BIG-VERSION])
+# AX_LUA_HEADERS
+# AX_LUA_LIBS
+# AX_LUA_LIB_VERSION (MIN-VERSION, [TOO-BIG-VERSION])
+#
+# DESCRIPTION
+#
+# Detect Lua interpreter, headers and libraries, optionally enforcing a
+# particular range of versions.
+#
+# AX_WITH_LUA searches for Lua interpreter and defines LUA if found.
+#
+# AX_LUA_VERSION checks that the version of Lua is at least MIN-VERSION
+# and less than TOO-BIG-VERSION, if given.
+#
+# AX_LUA_HEADERS searches for Lua headers and defines HAVE_LUA_H and
+# HAVE_LUALIB_H if found, and defines LUA_INCLUDE to the preprocessor
+# flags needed, if any.
+#
+# AX_LUA_LIBS searches for Lua libraries and defines LUA_LIB if found.
+#
+# AX_LUA_LIB_VERSION checks that the Lua libraries' version is at least
+# MIN-VERSION, and less than TOO-BIG-VERSION, if given.
+#
+# Versions are specified as three-digit integers whose first digit is the
+# major version and last two are the minor version (the same format as
+# LUA_VERSION_NUM in lua.h); e.g. 501 for Lua 5.1. The revision (e.g. the
+# "3" in "5.1.3") is ignored.
+#
+# The following options are added by these macros:
+#
+# --with-lua-prefix=DIR Lua files are in DIR.
+# --with-lua-suffix=ARG Lua binaries and library files are
+# suffixed with ARG.
+# --with-lua-includes=DIR Lua include files are in DIR.
+# --with-lua-libraries=DIR Lua library files are in DIR.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Reuben Thomas <rrt@sc3d.org>
+# Copyright (c) 2009 Matthieu Moy <Matthieu.Moy@imag.fr>
+# Copyright (c) 2009 Tom Payne <twpayne@gmail.com>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+dnl Helper function to declare extra options
+AC_DEFUN([_AX_LUA_OPTS],
+ [AC_ARG_WITH([lua-prefix],
+ [AS_HELP_STRING([--with-lua-prefix=DIR],
+ [Lua files are in DIR])])
+ AC_ARG_WITH([lua-suffix],
+ [AS_HELP_STRING([--with-lua-suffix=ARG],
+ [Lua binary and library files are suffixed with ARG])])
+ AC_ARG_WITH([lua-includes],
+ [AS_HELP_STRING([--with-lua-includes=DIR],
+ [Lua include files are in DIR])])
+ AC_ARG_WITH([lua-libraries],
+ [AS_HELP_STRING([--with-lua-libraries=DIR],
+ [Lua library files are in DIR])])])dnl
+
+AC_DEFUN([AX_WITH_LUA],
+ [_AX_LUA_OPTS
+ if test "x$with_lua_prefix" = x; then
+ lua_search_path="$PATH"
+ else
+ lua_search_path="$with_lua_prefix/bin"
+ fi
+ if test "x$LUA" = x; then
+ AC_PATH_PROG([LUA], [lua$with_lua_suffix], [], [$lua_search_path])
+ fi])dnl
+
+dnl Helper function to parse minimum & maximum versions
+AC_DEFUN([_AX_LUA_VERSIONS],
+ [lua_min_version=$1
+ lua_max_version=$2
+ if test "x$lua_min_version" = x; then
+ lua_min_version=0
+ fi
+ if test "x$lua_max_version" = x; then
+ lua_max_version=1000
+ fi])
+
+AC_DEFUN([AX_LUA_VERSION],
+ [_AX_LUA_OPTS
+ AC_MSG_CHECKING([Lua version is in range $1 <= v < $2])
+ _AX_LUA_VERSIONS($1, $2)
+ if test "x$LUA" != x; then
+ lua_text_version=$($LUA -v 2>&1 | head -n 1 | cut -d' ' -f2)
+ case $lua_text_version in
+ 5.1*)
+ lua_version=501
+ ;;
+ 5.0*)
+ lua_version=500
+ ;;
+ 4.0*)
+ lua_version=400
+ ;;
+ *)
+ lua_version=-1
+ ;;
+ esac
+ if test $lua_version -ge "$lua_min_version" -a $lua_version -lt "$lua_max_version"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_FAILURE([Lua version not in desired range.])
+ fi
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_FAILURE([Lua version not in desired range.])
+ fi])dnl
+
+AC_DEFUN([AX_LUA_HEADERS],
+ [_AX_LUA_OPTS
+ if test "x$with_lua_includes" != x; then
+ LUA_INCLUDE="-I$with_lua_includes"
+ elif test "x$with_lua_prefix" != x; then
+ LUA_INCLUDE="-I$with_lua_prefix/include"
+ fi
+ LUA_OLD_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $LUA_INCLUDE"
+ AC_CHECK_HEADERS([lua.h lualib.h])
+ CPPFLAGS="$LUA_OLD_CPPFLAGS"])dnl
+
+AC_DEFUN([AX_LUA_LIBS],
+ [_AX_LUA_OPTS
+ if test "x$with_lua_libraries" != x; then
+ LUA_LIB="-L$with_lua_libraries"
+ elif test "x$with_lua_prefix" != x; then
+ LUA_LIB="-L$with_lua_prefix/lib"
+ fi
+ AC_CHECK_LIB([m], [exp], [lua_extra_libs="$lua_extra_libs -lm"], [])
+ AC_CHECK_LIB([dl], [dlopen], [lua_extra_libs="$lua_extra_libs -ldl"], [])
+ AC_CHECK_LIB([lua$with_lua_suffix],
+ [lua_call],
+ [LUA_LIB="$LUA_LIB -llua$with_lua_suffix $lua_extra_libs"],
+ [],
+ [$LUA_LIB $lua_extra_libs])])dnl
+
+AC_DEFUN([AX_LUA_LIB_VERSION],
+ [_AX_LUA_OPTS
+ AC_MSG_CHECKING([liblua version is in range $1 <= v < $2])
+ _AX_LUA_VERSIONS($1, $2)
+ LUA_OLD_LIBS="$LIBS"
+ LIBS="$LIBS $LUA_LIB"
+ LUA_OLD_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $LUA_INCLUDE"
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <lua.h>
+#include <stdlib.h>
+#include <stdio.h>
+int main()
+{
+ printf("(found %s, %d)... ", LUA_VERSION, LUA_VERSION_NUM);
+ if (LUA_VERSION_NUM >= $lua_min_version && LUA_VERSION_NUM < $lua_max_version)
+ exit(EXIT_SUCCESS);
+ exit(EXIT_FAILURE);
+}
+]])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_FAILURE([Lua libraries version not in desired range])])
+ LIBS="$LUA_OLD_LIBS"
+ CPPFLAGS="$LUA_OLD_CPPFLAGS"])dnl
diff --git a/m4/mdl_cxx_function_try_blocks.m4 b/m4/mdl_cxx_function_try_blocks.m4
new file mode 100644
index 0000000..81f92c5
--- /dev/null
+++ b/m4/mdl_cxx_function_try_blocks.m4
@@ -0,0 +1,63 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/mdl_cxx_function_try_blocks.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# MDL_CXX_FUNCTION_TRY_BLOCKS
+#
+# DESCRIPTION
+#
+# If the C++ compiler supports function try blocks, define
+# `HAVE_FUNCTION_TRY_BLOCKS'.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Matthew D. Langston
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([MDL_CXX_FUNCTION_TRY_BLOCKS],
+[
+AC_REQUIRE([AC_PROG_CXX])
+changequote(,)dnl
+AC_MSG_CHECKING(whether ${CXX} supports function try blocks)
+changequote([,])dnl
+AC_CACHE_VAL(mdl_cv_have_function_try_blocks,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_TRY_COMPILE([void foo() try{} catch( ... ){}],
+[foo();],
+mdl_cv_have_function_try_blocks=yes,
+mdl_cv_have_function_try_blocks=no)
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($mdl_cv_have_function_try_blocks)
+if test "$mdl_cv_have_function_try_blocks" = yes; then
+AC_DEFINE(HAVE_FUNCTION_TRY_BLOCKS)
+fi])
diff --git a/m4/mdl_have_opengl.m4 b/m4/mdl_have_opengl.m4
new file mode 100644
index 0000000..73e2cfc
--- /dev/null
+++ b/m4/mdl_have_opengl.m4
@@ -0,0 +1,160 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/mdl_have_opengl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# MDL_HAVE_OPENGL
+#
+# DESCRIPTION
+#
+# Search for OpenGL. We search first for Mesa (a GPL'ed version of Mesa)
+# before a vendor's version of OpenGL, unless we were specifically asked
+# not to with `--with-Mesa=no' or `--without-Mesa'.
+#
+# The four "standard" OpenGL libraries are searched for: "-lGL", "-lGLU",
+# "-lGLX" (or "-lMesaGL", "-lMesaGLU" as the case may be) and "-lglut".
+#
+# All of the libraries that are found (since "-lglut" or "-lGLX" might be
+# missing) are added to the shell output variable "GL_LIBS", along with
+# any other libraries that are necessary to successfully link an OpenGL
+# application (e.g. the X11 libraries). Care has been taken to make sure
+# that all of the libraries in "GL_LIBS" are listed in the proper order.
+#
+# Additionally, the shell output variable "GL_CFLAGS" is set to any flags
+# (e.g. "-I" flags) that are necessary to successfully compile an OpenGL
+# application.
+#
+# The following shell variable (which are not output variables) are also
+# set to either "yes" or "no" (depending on which libraries were found) to
+# help you determine exactly what was found.
+#
+# have_GL
+# have_GLU
+# have_GLX
+# have_glut
+#
+# LICENSE
+#
+# Copyright (c) 2008 Matthew D. Langston
+# Copyright (c) 2008 Ahmet Inan <auto@ainan.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([MDL_HAVE_OPENGL],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_PATH_X])
+ AC_REQUIRE([AC_PATH_XTRA])
+
+ AC_CACHE_CHECK([for OpenGL], mdl_cv_have_OpenGL,
+ [
+dnl Check for Mesa first, unless we were asked not to.
+ AC_ARG_WITH([--with-Mesa],
+ [Prefer the Mesa library over a vendors native OpenGL library (default=yes)],
+ with_Mesa_help_string)
+ AC_ARG_ENABLE(Mesa, $with_Mesa_help_string, use_Mesa=$enableval, use_Mesa=yes)
+
+ if test x"$use_Mesa" = xyes; then
+ GL_search_list="MesaGL GL"
+ GLU_search_list="MesaGLU GLU"
+ GLX_search_list="MesaGLX GLX"
+ else
+ GL_search_list="GL MesaGL"
+ GLU_search_list="GLU MesaGLU"
+ GLX_search_list="GLX MesaGLX"
+ fi
+
+ AC_LANG_SAVE
+ AC_LANG_C
+
+dnl If we are running under X11 then add in the appropriate libraries.
+if test x"$no_x" != xyes; then
+dnl Add everything we need to compile and link X programs to GL_X_CFLAGS
+dnl and GL_X_LIBS.
+ GL_CFLAGS="$X_CFLAGS"
+ GL_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
+fi
+ GL_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$GL_CFLAGS"
+
+ GL_save_LIBS="$LIBS"
+ LIBS="$GL_X_LIBS"
+
+
+ # Save the "AC_MSG_RESULT file descriptor" to FD 8.
+ exec 8>&AC_FD_MSG
+
+ # Temporarily turn off AC_MSG_RESULT so that the user gets pretty
+ # messages.
+ exec AC_FD_MSG>/dev/null
+
+ AC_SEARCH_LIBS(glAccum, $GL_search_list, have_GL=yes, have_GL=no)
+ AC_SEARCH_LIBS(gluBeginCurve, $GLU_search_list, have_GLU=yes, have_GLU=no)
+ AC_SEARCH_LIBS(glXChooseVisual, $GLX_search_list, have_GLX=yes, have_GLX=no)
+ AC_SEARCH_LIBS(glutInit, glut, have_glut=yes, have_glut=no)
+
+
+
+ # Restore pretty messages.
+ exec AC_FD_MSG>&8
+
+ if test -n "$LIBS"; then
+ mdl_cv_have_OpenGL=yes
+ GL_LIBS="$LIBS"
+ AC_SUBST(GL_CFLAGS)
+ AC_SUBST(GL_LIBS)
+ else
+ mdl_cv_have_OpenGL=no
+ GL_CFLAGS=
+ fi
+
+dnl Reset GL_X_LIBS regardless, since it was just a temporary variable
+dnl and we don't want to be global namespace polluters.
+ GL_X_LIBS=
+
+ LIBS="$GL_save_LIBS"
+ CPPFLAGS="$GL_save_CPPFLAGS"
+
+ AC_LANG_RESTORE
+
+dnl bugfix: dont forget to cache this variables, too
+ mdl_cv_GL_CFLAGS="$GL_CFLAGS"
+ mdl_cv_GL_LIBS="$GL_LIBS"
+ mdl_cv_have_GL="$have_GL"
+ mdl_cv_have_GLU="$have_GLU"
+ mdl_cv_have_GLX="$have_GLX"
+ mdl_cv_have_glut="$have_glut"
+ ])
+ GL_CFLAGS="$mdl_cv_GL_CFLAGS"
+ GL_LIBS="$mdl_cv_GL_LIBS"
+ have_GL="$mdl_cv_have_GL"
+ have_GLU="$mdl_cv_have_GLU"
+ have_GLX="$mdl_cv_have_GLX"
+ have_glut="$mdl_cv_have_glut"
+])
+dnl endof bugfix -ainan
diff --git a/m4/merk_sip_devel.m4 b/m4/merk_sip_devel.m4
new file mode 100644
index 0000000..d6b4294
--- /dev/null
+++ b/m4/merk_sip_devel.m4
@@ -0,0 +1,102 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/merk_sip_devel.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# MERK_SIP_DEVEL([<min_version>])
+#
+# DESCRIPTION
+#
+# Searches for the sip executable and the sip include path. The sip
+# include path consists of two components, one which contains the file
+# qt/qtmod.sip and the other one the path to sip.h, which should be found
+# in the include/pythonX.Y directory.
+#
+# The macro bails out if the executable or the file cannot be located.
+# Otherwise it defines:
+#
+# SIP the path to the sip executable
+# SIP_CPPFLAGS include path: -I<path-to-qt/qtmod.sip> -I<path-to-sip.h-dir>
+#
+# Example:
+#
+# MERK_SIP_DEVEL
+# MERK_SIP_DEVEL([4.1])
+#
+# Requires: perl (for version string comparison)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Uwe Mayer <merkosh@hadiko.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([MERK_SIP_DEVEL],[
+#-- provice --with-sip=PATH command line argument
+AC_ARG_WITH([sip],
+ AS_HELP_STRING([--with-sip=PATH], [specify the location of the qt/qtmod.sip file]),
+ [sip_search_dir="$withval"],
+ [sip_search_dir=""])
+
+#-- check for sip executable
+AC_PATH_PROG([SIP], [sip], [no])
+if test x"$SIP" == x"no"; then
+ AC_MSG_ERROR([failed to find required command sip])
+fi
+AC_SUBST([SIP])
+
+#-- check for minimum sip version
+if test x"$1" != x""; then
+ AC_CHECK_PROG([PERL], [perl], [$(which perl)])
+ if test x"$PERL" == x""; then
+ AC_MSG_ERROR([perl required for checking sip version])
+ fi
+ AC_MSG_CHECKING([sip version >= $1])
+ sip_version=$($SIP -V |cut -f 1 -d " ")
+ merk_sip_devel_result=$(echo "$sip_version" |perl -e '("$1" lt <STDIN>) && print "ok"')
+ if test x"$merk_sip_devel_result" == x""; then
+ AC_MSG_RESULT([$sip_version])
+ AC_MSG_ERROR([a newer version of sip is required])
+ else
+ AC_MSG_RESULT([ok])
+ fi
+fi
+
+#-- Check for SIP include path
+AC_MSG_CHECKING([for sip include path])
+
+# check for qt/qtmod.sip
+for i in "$sip_search_dir" "/usr/share/sip"; do
+ sip_path1=`find $i -type f -name qtmod.sip -print | sed "1q"`
+ if test -n "$sip_path1"; then
+ break
+ fi
+done
+
+sip_path1=`echo "$sip_path1" | sed 's,/qt/qtmod.sip,,'`
+if test -z "$sip_path1" ; then
+ AC_MSG_ERROR([cannot find qt/qtmod.sip; try --with-sip=PATH])
+fi
+
+# check for sip.h
+dnl this part of the code to detect python version and include path
+dnl was taken from ac_python_devel macro, (rev. 2008-04-12)
+python_path=`echo $PYTHON | sed "s,/bin.*$,,"`
+for i in "$python_path/include/python$PYTHON_VERSION/" "$python_path/include/python/" "$python_path/" ; do
+ python_path=`find $i -type f -name Python.h -print | sed "1q"`
+ if test -n "$python_path" ; then
+ break
+ fi
+done
+sip_path2=`echo $python_path | sed "s,/Python.h$,,"`
+if ! test -f "$sip_path2/sip.h"; then
+ AC_MSG_ERROR([cannot find include path to sip.h])
+fi
+
+AC_MSG_RESULT([$sip_path1,$sip_path2])
+
+AC_SUBST([SIP_CPPFLAGS],["-I$sip_path1 -I$sip_path2"])
+])
diff --git a/m4/mni_cxx_have_koenig_lookup.m4 b/m4/mni_cxx_have_koenig_lookup.m4
new file mode 100644
index 0000000..47494bb
--- /dev/null
+++ b/m4/mni_cxx_have_koenig_lookup.m4
@@ -0,0 +1,47 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/mni_cxx_have_koenig_lookup.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# mni_CXX_HAVE_KOENIG_LOOKUP
+#
+# DESCRIPTION
+#
+# Define CXX_HAVE_KOENIG_LOOKUP if the C++ compiler has argument-dependent
+# name lookup (a.k.a. Koenig lookup).
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steve M. Robbins <smr@debian.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([mni_CXX_HAVE_KOENIG_LOOKUP],
+ [AC_CACHE_CHECK(whether the compiler implements Koenig lookup,
+ ac_cv_cxx_have_koenig_lookup,
+ [AC_LANG_PUSH(C++)
+ AC_TRY_COMPILE([
+ namespace N1 {
+ class C {};
+ void f1(const C& c) {}
+ }
+
+ namespace N2 {
+ void f2() {
+ N1::C x;
+ f1(x); // resolves to N1::f1() if we have Koenig lookup,
+ // otherwise this will fail to compile.
+ }
+ }
+ ],[],
+ ac_cv_cxx_have_koenig_lookup=yes,
+ ac_cv_cxx_have_koenig_lookup=no)
+ AC_LANG_POP])
+ if test "$ac_cv_cxx_have_koenig_lookup" = yes; then
+ AC_DEFINE(CXX_HAVE_KOENIG_LOOKUP,1,
+ [define to 1 if the compiler implements Koenig lookup])
+ fi
+])
diff --git a/m4/mp_with_curses.m4 b/m4/mp_with_curses.m4
new file mode 100644
index 0000000..c2976dc
--- /dev/null
+++ b/m4/mp_with_curses.m4
@@ -0,0 +1,84 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/mp_with_curses.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# MP_WITH_CURSES
+#
+# DESCRIPTION
+#
+# Detect SysV compatible curses, such as ncurses.
+#
+# Defines HAVE_CURSES_H or HAVE_NCURSES_H if curses is found. CURSES_LIB
+# is also set with the required libary, but is not appended to LIBS
+# automatically. If no working curses libary is found CURSES_LIB will be
+# left blank.
+#
+# This macro adds the option "--with-ncurses" to configure which can force
+# the use of ncurses or nothing at all.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Mark Pulford <mark@kyne.com.au>
+#
+# This program 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 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([MP_WITH_CURSES],
+ [AC_ARG_WITH(ncurses, [ --with-ncurses Force the use of ncurses over curses],,)
+ mp_save_LIBS="$LIBS"
+ CURSES_LIB=""
+ if test "$with_ncurses" != yes
+ then
+ AC_CACHE_CHECK([for working curses], mp_cv_curses,
+ [LIBS="$LIBS -lcurses"
+ AC_TRY_LINK(
+ [#include <curses.h>],
+ [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
+ mp_cv_curses=yes, mp_cv_curses=no)])
+ if test "$mp_cv_curses" = yes
+ then
+ AC_DEFINE([HAVE_CURSES_H],[1],[Define if you have curses.h])
+ CURSES_LIB="-lcurses"
+ fi
+ fi
+ if test ! "$CURSES_LIB"
+ then
+ AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
+ [LIBS="$mp_save_LIBS -lncurses"
+ AC_TRY_LINK(
+ [#include <ncurses.h>],
+ [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
+ mp_cv_ncurses=yes, mp_cv_ncurses=no)])
+ if test "$mp_cv_ncurses" = yes
+ then
+ AC_DEFINE([HAVE_NCURSES_H],[1],[Define if you have ncurses.h])
+ CURSES_LIB="-lncurses"
+ fi
+ fi
+ LIBS="$mp_save_LIBS"
+])dnl
diff --git a/m4/ms_check_pgsql_db.m4 b/m4/ms_check_pgsql_db.m4
new file mode 100644
index 0000000..673246b
--- /dev/null
+++ b/m4/ms_check_pgsql_db.m4
@@ -0,0 +1,103 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ms_check_pgsql_db.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# MS_CHECK_PGSQL_DB([DB], [USER], [HOST], [PASSWORD], [ACTION_IF_FAILED], [ACTION_IF_OK])
+#
+# DESCRIPTION
+#
+# This macro checks wether we can connect to a PostgreSQL server with the
+# given data. The macro MS_PROG_PGCLIENT is required by this one. The
+# variable $pgclient_call is set for later use in Makefiles, if you'd like
+# to make use of this, you must do
+#
+# AC_SUBST(pgclient_call)
+#
+# after having called MS_CHECK_PGSQL_DB. You can then do something like
+# the following in your Makefile.am:
+#
+# @pgclient_call@ -f file.sql
+#
+# If you want the user to set the data, you should support something like
+# these configure options:
+#
+# AC_ARG_WITH(pgsql-host,
+# [ --with-pgsql-host=HOST server is running on HOST @<:@local socket@:>@],
+# [pg_host=$withval], [pg_host=])
+#
+# AC_ARG_WITH(pgsql-db,
+# [ --with-pgsql-db=DATABASE use DATABASE @<:@tarantoola@:>@],
+# [pg_db=$withval], [pg_db=tarantoola])
+#
+# AC_ARG_WITH(pgsql-user,
+# [ --with-pgsql-user=USER use USER @<:@postgres@:>@],
+# [pg_user=$withval], [pg_user=postgres])
+#
+# AC_ARG_WITH(pgsql-password,
+# [ --with-pgsql-password=PASSWORD use PASSWORD @<:@none@:>@],
+# [pg_password=$withval], [pg_password=""])
+#
+# You can then call the macro like this:
+#
+# MS_CHECK_PGSQL_DB([$pg_db], [$pg_user], [$pg_host], [$pg_password], [AC_MSG_ERROR([We need a database connection!])])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Moritz Sinn <moritz@freesources.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([MS_CHECK_PGSQL_DB], [
+AC_REQUIRE([MS_PROG_PGCLIENT])
+AC_MSG_CHECKING([for PostgreSQL db $1 (user: $2, host: $3)])
+
+pgclient_call="$pgclient"
+
+if test "x$1" != "x"; then
+ pgclient_call="$pgclient_call dbname=$1";
+fi
+if test "x$2" != "x"; then
+ pgclient_call="$pgclient_call user=$2";
+fi
+if test "x$3" != "x"; then
+ pgclient_call="$pgclient_call host=$3";
+fi
+if test "x$4" != "x"; then
+ pgclient_call="$pgclient_call password=$4";
+fi
+
+$pgclient_call -c 'SELECT 1' > /dev/null 2>&1
+if test "x$?" = "x0"; then
+ AC_MSG_RESULT([yes])
+ $6
+else
+ AC_MSG_RESULT([no])
+ $5
+fi;
+])dnl
diff --git a/m4/ms_pgsql_priv_root.m4 b/m4/ms_pgsql_priv_root.m4
new file mode 100644
index 0000000..a61e6d2
--- /dev/null
+++ b/m4/ms_pgsql_priv_root.m4
@@ -0,0 +1,108 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ms_pgsql_priv_root.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# MS_PGSQL_PRIV_ROOT(DB, USER, [HOST], [PASSWORD], [ACTION_IF_FAILED], [ACTION_IF_OK])
+#
+# DESCRIPTION
+#
+# This macro checks wether the given PostgreSQL user has root privileges
+# (can create and drop databases) It is recommended to first call
+# MS_CHECK_PGSQL_DB, this makes it easier to locate the cause of error.
+# The macro MS_PROG_PGCLIENT is required by this one.
+#
+# The variable $pgclient_root_call is set for later use in Makefiles, if
+# you'd like to make use of this, you must do
+#
+# AC_SUBST(pgclient_root_call)
+#
+# after having called MS_CHECK_PGSQL_PRIV_ROOT. You can then do something
+# like the following in your Makefile.am:
+#
+# @pgclient_root_call@ -f file.sql
+#
+# If you want the user to set the data, you should support something like
+# these configure options:
+#
+# AC_ARG_WITH(pgsql-host,
+# [ --with-pgsql-host=HOST server is running on HOST @<:@local socket@:>@],
+# [pg_host=$withval], [pg_host=])
+#
+# AC_ARG_WITH(pgsql-db,
+# [ --with-pgsql-db=DBNAME use database DBNAME @<:@test@:>@],
+# [pg_db=$withval], [pg_db=test])
+#
+# AC_ARG_WITH(pgsql-root-user,
+# [ --with-pgsql-root-user=USER use user USER, must have root (all) privileges @<:@postgres@:>@],
+# [pg_root_user=$withval], [pg_root_user=postgres])
+#
+# AC_ARG_WITH(pgsql-password,
+# [ --with-pgsql-password=PASSWORD use password PASSWORD @<:@none@:>@],
+# [pg_password=$withval], [pg_password=""])
+#
+# You can then call the macro like this:
+#
+# MS_CHECK_PGSQL_PRIV_ROOT([$pg_db], [$pg_root_user], [$pg_host], [$pg_password], [AC_MSG_ERROR([We need root privileges on database!])])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Moritz Sinn <moritz@freesources.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([MS_CHECK_PGSQL_PRIV_ROOT], [
+AC_REQUIRE([MS_PROG_PGCLIENT])dnl
+AC_REQUIRE([MS_CHECK_PGSQL_DB])dnl
+AC_MSG_CHECKING([if PostgreSQL user $2 has root privileges])
+
+pgclient_root_call="$pgclient"
+
+if test "x$1" != "x"; then
+ pgclient_root_call="$pgclient_root_call dbname=$1";
+fi
+if test "x$2" != "x"; then
+ pgclient_root_call="$pgclient_root_call user=$2";
+fi
+if test "x$3" != "x"; then
+ pgclient_root_call="$pgclient_root_call host=$3";
+fi
+if test "x$4" != "x"; then
+ pgclient_root_call="$pgclient_root_call password=$4";
+fi
+
+testdb="test`date +%s`"
+echo "CREATE DATABASE $testdb; DROP DATABASE $testdb;" | $pgclient_root_call > /dev/null 2>&1
+if test "x$?" = "x0"; then
+ AC_MSG_RESULT([yes])
+ $6
+else
+ AC_MSG_RESULT([no])
+ $5
+fi;
+])dnl
diff --git a/m4/ms_prog_pgclient.m4 b/m4/ms_prog_pgclient.m4
new file mode 100644
index 0000000..ac2d209
--- /dev/null
+++ b/m4/ms_prog_pgclient.m4
@@ -0,0 +1,55 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ms_prog_pgclient.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# MS_PROG_PGCLIENT()
+#
+# DESCRIPTION
+#
+# This macro searches for a program called 'pgclient'. If found the
+# variable $pgclient is set to its path. Else it is set to 0. An option is
+# added to the configure script for setting an search path instead of
+# $PATH ($pgclient_dir). If pgclient is necessary for installing your
+# program, you can do something like the following to stop configure with
+# an error if pgclient wasn't found:
+#
+# if test "x$pgclient" = "x0"; then AC_MSG_ERROR([We need that to setup the database!]); fi
+#
+# pgclient can be found at http://pgclient.freesources.org
+#
+# LICENSE
+#
+# Copyright (c) 2008 Moritz Sinn <moritz@freesources.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([MS_PROG_PGCLIENT], [
+AC_ARG_WITH(pgclient, [ --with-pgclient=DIR where to find pgclient (default: $PATH)], [pgclient_dir=$withval], [pgclient_dir=$PATH])
+AC_PATH_PROG([pgclient], [pgclient], [0], $pgclient_dir)
+])dnl
diff --git a/m4/patch_libtool_changing_cmds_ifs.m4 b/m4/patch_libtool_changing_cmds_ifs.m4
new file mode 100644
index 0000000..e9144c5
--- /dev/null
+++ b/m4/patch_libtool_changing_cmds_ifs.m4
@@ -0,0 +1,89 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/patch_libtool_changing_cmds_ifs.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# PATCH_LIBTOOL_CHANGING_CMDS_IFS
+#
+# DESCRIPTION
+#
+# Do a `grep "^[a-z]*_cmds=" libtool` - these are "subroutines" encoded by
+# libtool.m4 into the generated libtool script. Since libtool assumes that
+# there is no subroutine-facility in the shell invoked, these are not
+# actually subroutines, but actually a "list of commands". This looks
+# correct, but the command separator is not ";" - it is "~", the tilde
+# character.
+#
+# Now, grep again, look for `grep 'IFS="~"' libtool` and see that libtool
+# scripting uses a for-loop on the command-list, i.e for cmd in
+# $some_cmds. This works correctly when the IFS was modified, where IFS
+# stands for "input field separator" which is whitespace characters by
+# default.
+#
+# The problem: I have some real-world filesystems where there are
+# directories using "~" inside of them, to be more to the point, it is a
+# change control management software that uses source repositories of the
+# form "path/master/project~version/src" and libtool has the tendency to
+# resolve any symlinks so that it will paste such path into the $_cmds
+# script when it gets evaluated a number of times.
+#
+# This script is a workaround: I do not know why the ";" was not chosen as
+# the IFS, perhaps it has some weird interactions in some shells since it
+# is also the default record separator being one time bigger in context
+# than the argument separator. I have made good success however with using
+# "?" as the IFS, since there is no path-name that uses a question mark,
+# and there is no _cmds ever around that uses "?" for some thing.
+#
+# Oh yes, there are some usages of "*" to match shell-wise at the output
+# file of some tool, so that might have triggered the choice to not use
+# "?" in the first place - but in real life it never occured that a _cmds
+# script was created that has gone to use "?". And so, this ac-macro
+# exchanges the s/~/?/g in configured _cmds variables and replaces all
+# occurences of s/IFS="~"/IFS="?"/ - and it all works smooth now.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([PATCH_LIBTOOL_CHANGING_CMDS_IFS],
+[# patch libtool to change $_cmds IFS from ~ to ? character
+if grep "^[[_$as_cr_letters]]_cmds=.*[[?]]" libtool >/dev/null; then
+ AC_MSG_WARN(dnl
+ [patching libtool skipped - _cmds already contain question marks])
+else
+ AC_MSG_RESULT([patching libtool to change cmds IFS from ~ to ?])
+ test -f libtool.old || (mv libtool libtool.old && cp libtool.old libtool)
+ sed -e "/^[[_$as_cr_letters]]*_cmds=/s/~/?/g" -e 's/IFS="~"/IFS="?"/g' \
+ -e "s/IFS='~'/IFS='?'/g" libtool > libtool.new
+ (test -s libtool.new || rm libtool.new) 2>/dev/null
+ test -f libtool.new && mv libtool.new libtool # not 2>/dev/null !!
+ test -f libtool || mv libtool.old libtool
+fi
+])
diff --git a/m4/rlc_xercesc.m4 b/m4/rlc_xercesc.m4
new file mode 100644
index 0000000..f610ffb
--- /dev/null
+++ b/m4/rlc_xercesc.m4
@@ -0,0 +1,496 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/rlc_xercesc.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# rlc_XERCESC
+#
+# DESCRIPTION
+#
+# Define $HAVE_LIBXERCES_C, $LIBXERCES_C, and $LTLIBXERCES_C to signify
+# whether Xerces is available.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ronald Landheer-Cieslak <blytkerchan@users.sourceforge.net>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([rlc_XERCESC],
+[
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+
+ AC_LANG_PUSH(C++)
+ rlc_XERCESC_BODY()
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCXERCES_C])
+
+ AC_CACHE_CHECK([for libxerces-c], [ac_cv_libxerces_c], [
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBXERCES_C $LIBICONV"
+ AC_TRY_LINK([
+#include <xercesc/util/PlatformUtils.hpp>
+#ifdef XERCES_CPP_NAMESPACE_USE
+XERCES_CPP_NAMESPACE_USE
+#endif
+ ], [
+try
+{
+ XMLPlatformUtils::Initialize();
+}
+catch (...)
+{
+ // ...
+}
+XMLPlatformUtils::Terminate();
+ ], [ac_cv_libxerces_c=yes], [ac_cv_libxerces_c=no])
+ LIBS="$ac_save_LIBS"
+ ])
+ if test "$ac_cv_libxerces_c" = yes; then
+ HAVE_LIBXERCES_C=yes
+ AC_DEFINE(HAVE_LIBXERCES_C, 1, [Define if you have the xerces-c library.])
+ AC_MSG_CHECKING([how to link with libxerces-c])
+ AC_MSG_RESULT([$LIBXERCES_C])
+ else
+ HAVE_LIBXERCES_C=no
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIBXERCES_C=
+ LTLIBXERCES_C=
+ fi
+
+ AC_LANG_POP(C++)
+
+ AC_SUBST(HAVE_LIBXERCES_C)
+ AC_SUBST(LIBXERCES_C)
+ AC_SUBST(LTLIBXERCES_C)
+])
+
+AC_DEFUN([rlc_XERCESC_BODY],
+[
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ AC_ARG_WITH([libxerces-c-prefix],
+[ --with-libxerces-c-prefix[=DIR] search for libxerces-c in DIR/include and DIR/lib
+ --without-libxerces-c-prefix don't search for libxerces-c in includedir and libdir],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/lib"
+ fi
+ fi
+])
+ dnl Search the library and its dependencies in $additional_libdir and
+ dnl $LDFLAGS. Using breadth-first-seach.
+ LIBXERCES_C=
+ LTLIBXERCES_C=
+ INCXERCES_C=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='xerces-c'
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+ dnl or AC_LIB_HAVE_LINKFLAGS call.
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIBXERCES_C="${LTLIBXERCES_C}${LTLIBXERCES_C:+ }$value"
+ else
+ dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+ dnl that this library doesn't exist. So just drop it.
+ :
+ fi
+ else
+ dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ if test $use_additional = yes; then
+ found_so="$additional_libdir/lib$name.$shlibext*"
+ for i in $found_so; do
+ if test -f $i && test -x $i; then
+ found_so="$i"
+ break
+ fi
+ done
+ if test -n "$shlibext" && test -f $found_so; then
+ found_dir="$additional_libdir"
+ if test -f "$additional_libdir/lib$name.la"; then
+ found_la="$additional_libdir/lib$name.la"
+ fi
+ else
+ if test -f "$additional_libdir/lib$name.$libext"; then
+ found_dir="$additional_libdir"
+ found_a="$additional_libdir/lib$name.$libext"
+ if test -f "$additional_libdir/lib$name.la"; then
+ found_la="$additional_libdir/lib$name.la"
+ fi
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIBXERCES_C; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$shlibext"; then
+ found_dir="$dir"
+ found_so="$dir/lib$name.$shlibext*"
+ for i in $found_so; do
+ if test -f $i && test -x $i; then
+ found_so="$i"
+ break
+ fi
+ done
+
+ if test -f "$dir/lib$name.la"; then
+ found_la="$dir/lib$name.la"
+ fi
+ else
+ if test -f "$dir/lib$name.$libext"; then
+ found_dir="$dir"
+ found_a="$dir/lib$name.$libext"
+ if test -f "$dir/lib$name.la"; then
+ found_la="$dir/lib$name.la"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ dnl Found the library.
+ LTLIBXERCES_C="${LTLIBXERCES_C}${LTLIBXERCES_C:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ dnl Linking with a shared library. We attempt to hardcode its
+ dnl directory into the executable's runpath, unless it's the
+ dnl standard /usr/lib.
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+ dnl No hardcoding is needed.
+ LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }$found_so"
+ else
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ dnl Potentially add DIR to ltrpathdirs.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ if test "$hardcode_direct" = yes; then
+ dnl resulting binary.
+ LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }$found_so"
+ else
+ if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }$found_so"
+ dnl Potentially add DIR to rpathdirs.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ dnl Rely on "-L$found_dir".
+ dnl But don't add it if it's already contained in the LDFLAGS
+ haveit=
+ for x in $LDFLAGS $LIBXERCES_C; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }-L$found_dir"
+ fi
+ if test "$hardcode_minus_L" != no; then
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }$found_so"
+ else
+ dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
+ dnl here, because this doesn't fit in flags passed to the
+ dnl compiler. So give up. No hardcoding. This affects only
+ dnl very old systems.
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ dnl Linking with a static library.
+ LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }$found_a"
+ else
+ dnl We shouldn't come here, but anyway it's good to have a
+ dnl fallback.
+ LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }-L$found_dir -l$name"
+ fi
+ fi
+ dnl Assume the include files are nearby.
+ additional_includedir=
+ case "$found_dir" in
+ */lib | */lib/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 3. if it's already present in $CPPFLAGS or the already
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INCXERCES_C; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ INCXERCES_C="${INCXERCES_C}${INCXERCES_C:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ dnl Look for dependencies.
+ if test -n "$found_la"; then
+ dnl Read the .la file. It defines the variables
+ dnl dlname, library_names, old_library, dependency_libs, current,
+ dnl age, revision, installed, dlopen, dlpreopen, libdir.
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ dnl We use only dependency_libs.
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 3. if it's already present in $LDFLAGS or the already
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_libdir" != "X/usr/lib"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/lib"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIBXERCES_C; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIBXERCES_C; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LTLIBXERCES_C="${LTLIBXERCES_C}${LTLIBXERCES_C:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ dnl Potentially add DIR to rpathdirs.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ dnl Potentially add DIR to ltrpathdirs.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ dnl Handle this in the next round.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ dnl Handle this in the next round. Throw away the .la's
+ dnl directory; it is already contained in a preceding -L
+ dnl option.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ dnl Most likely an immediate library name.
+ LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }$dep"
+ LTLIBXERCES_C="${LTLIBXERCES_C}${LTLIBXERCES_C:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ dnl Didn't find the library; assume it is in the system directories
+ dnl known to the linker and runtime loader. (All the system
+ dnl directories known to the linker should also be known to the
+ dnl runtime loader, otherwise the system is severely misconfigured.)
+ LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }-l$name"
+ LTLIBXERCES_C="${LTLIBXERCES_C}${LTLIBXERCES_C:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user must
+ dnl pass all path elements in one option. We can arrange that for a
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+ done
+ dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBXERCES_C="${LIBXERCES_C}${LIBXERCES_C:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ dnl When using libtool, the option that works for both libraries and
+ dnl executables is -R. The -R options are cumulative.
+ for found_dir in $ltrpathdirs; do
+ LTLIBXERCES_C="${LTLIBXERCES_C}${LTLIBXERCES_C:+ }-R$found_dir"
+ done
+ fi
+])
diff --git a/m4/rssh_check_off64_t.m4 b/m4/rssh_check_off64_t.m4
new file mode 100644
index 0000000..dfbef96
--- /dev/null
+++ b/m4/rssh_check_off64_t.m4
@@ -0,0 +1,73 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/rssh_check_off64_t.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# RSSH_CHECK_OFF64_T
+#
+# DESCRIPTION
+#
+# Check if off64_t is defined. On true define HAVE_OFF64_T, also define
+# __LARGEFILE64_SOURCE where one is needed. (Note that an appropriative
+# entry must be in config.h.in.)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([RSSH_CHECK_OFF64_T], [
+AC_REQUIRE([AC_SYS_LARGEFILE])dnl
+AC_CHECK_HEADER(unistd.h)
+AC_CACHE_CHECK([whether type off64_t support],
+ [rssh_cv_check_off64_t],
+ [
+ AC_COMPILE_IFELSE(
+AC_LANG_SOURCE([
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+extern off64_t x1;
+])
+,rssh_have_off64t=1)
+ if test "x$rssh_have_off64t" = "x"
+ then
+ AC_COMPILE_IFELSE(
+AC_LANG_SOURCE([
+#define _LARGEFILE64_SOURCE
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+extern off64_t x1;
+]),
+ rssh_cv_check_off64_t="_LARGEFILE64_SOURCE",
+ rssh_cv_check_off64_t="no"
+)dnl
+
+ else
+ rssh_cv_check_off64_t=yes
+ fi
+ ])dnl
+
+if test "x$rssh_cv_check_off64_t" = "x_LARGEFILE64_SOURCE"
+then
+ AC_DEFINE(_LARGEFILE64_SOURCE)
+ AC_DEFINE(HAVE_OFF64_T)
+elif test "x$rssh_cv_check_off64_t" = "xyes"
+then
+ AC_DEFINE(HAVE_OFF64_T)
+fi
+])dnl
diff --git a/m4/rssh_check_sunpro_c.m4 b/m4/rssh_check_sunpro_c.m4
new file mode 100644
index 0000000..cceafb9
--- /dev/null
+++ b/m4/rssh_check_sunpro_c.m4
@@ -0,0 +1,43 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/rssh_check_sunpro_c.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# RSSH_CHECK_SUNPRO_C([ACTION-IF-YES],[ACTION-IF-NOT])
+#
+# DESCRIPTION
+#
+# Check whether we are using SUN workshop C compiler. The corresponding
+# cache values is rssh_cv_check_sunpro_c, which is set to "yes" or "no"
+# respectively.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([RSSH_CHECK_SUNPRO_C],
+[AC_CACHE_CHECK([whether using Sun Worckshop C compiler],
+ [rssh_cv_check_sunpro_c],
+
+[AC_LANG_SAVE
+ AC_LANG_C
+ AC_TRY_COMPILE([],
+[#ifndef __SUNPRO_C
+# include "error: this is not Sun Workshop."
+#endif
+],
+ rssh_cv_check_sunpro_c=yes,
+ rssh_cv_check_sunpro_c=no)
+AC_LANG_RESTORE])
+if test ${rssh_cv_check_sunpro_c} = yes
+then
+ $2
+else
+ $3
+fi
+])dnl
diff --git a/m4/sg_afs.m4 b/m4/sg_afs.m4
new file mode 100644
index 0000000..c7c9276
--- /dev/null
+++ b/m4/sg_afs.m4
@@ -0,0 +1,116 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/sg_afs.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# SG_AFS
+#
+# DESCRIPTION
+#
+# This sets up the proper includes and libs needed for building programs
+# that link with AFS. It adds a --with-afsdir option that lets you specify
+# where the AFS includes and libs are (defaulting to /usr/afsws).
+#
+# It also adds the -I and -L options to CPPFLAGS and LDFLAGS
+#
+# It creates an AC_SUBST(AFSWS) that contains the directory being used.
+#
+# It checks for -lBSD, -lsocket and -lnsl since AFS needs those if they
+# exist. It also adds -R/usr/ucblib -L/usr/ucblib -lucb if on Solaris.
+#
+# It sets VICE_ETC_PATH to be the directory where /usr/vice/etc lives,
+# since AFS 3.4 uses a different define than AFS 3.5 does for that path.
+#
+# Finally, it defines AFS_int32 to be the in32 type needed. In older
+# versions of afs it was 'int32', and in newer versions it's 'afs_int32'.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Scott Grosch <Scott.Grosch@intel.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([SG_AFS],
+[AC_ARG_WITH(afsdir, AC_HELP_STRING([--with-afsdir=DIR],
+ [Directory holding AFS includes/libs]),
+ sg_cv_with_afsdir=$withval)
+ AC_CACHE_CHECK([for location of AFS directory],
+ sg_cv_with_afsdir, sg_cv_with_afsdir=/usr/afsws)
+
+CPPFLAGS="-I${sg_cv_with_afsdir}/include $CPPFLAGS"
+LDFLAGS="-L${sg_cv_with_afsdir}/lib -L${sg_cv_with_afsdir}/lib/afs $LDFLAGS"
+
+dnl Once we specify a directory, we try to link a test program. If the link
+dnl works, we store the value of the directory in a cache variable. If not,
+dnl we put _FAILED_ in the cache value. In this way we don't try to link
+dnl the test program if our afsdir value was cached, as we know it works.
+AC_MSG_CHECKING([whether the specified AFS dir looks valid])
+if test "x${sg_cv_afsdir_link_works:-set}" != "x$sg_cv_with_afsdir"; then
+ save_LIBS="$LIBS"
+ LIBS="$save_LIBS -lcmd"
+ AC_TRY_LINK([#include <afs/cmd.h>],
+ [cmd_CreateAlias((struct cmd_syndesc *)0, "foo")],
+ sg_cv_afsdir_link_works=$sg_cv_with_afsdir,
+ sg_cv_afsdir_link_works=_FAILED_)
+ LIBS="$save_LIBS"
+ wasCached=""
+else
+ wasCached="(cached)"
+fi
+if test "x$sg_cv_afsdir_link_works" = "x$sg_cv_with_afsdir"; then
+ AC_MSG_RESULT([${wasCached} yes])
+else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Unable to link test program....bad AFS dir specified?])
+fi
+
+dnl Much easier to use in XXX.in files
+AFSWS=$sg_cv_with_afsdir
+AC_SUBST(AFSWS)
+
+dnl Linking against AFS always needs these
+AC_CHECK_LIB(BSD, signal)
+AC_CHECK_LIB(socket, getservbyname)
+AC_CHECK_LIB(nsl, gethostbyname)
+
+dnl On Solaris is just always needs the -lucb library from the compatibility
+dnl area. I can't think of any other way to do this than just hardcode it.
+AC_CANONICAL_HOST
+case "$host" in
+*-*-solaris*)
+ LDFLAGS="-L/usr/ucblib -R/usr/ucblib $LDFLAGS"
+ LIBS="-lucb $LIBS"
+ ;;
+esac
+
+dnl And it always needs these libs added
+LIBS="$LIBS -lacl -lvolser -lvldb -lprot -lkauth -lauth -lrxkad -lubik ${sg_cv_with_afsdir}/lib/afs/vlib.a -ldir ${sg_cv_with_afsdir}/lib/afs/util.a -lsys -lafsint -lrx -lsys -ldes -lcom_err -llwp -lcmd -laudit"
+
+dnl This really should be AC_CHECK_LIB() but that always fails for some reason
+if test -f "${sg_cv_with_afsdir}/lib/afs/libaudit.a"; then
+ LIBS="$LIBS -laudit"
+fi
+
+dnl If dirpath.h exists and has the value, use that. Otherwise don't
+AC_CHECK_HEADERS(afs/dirpath.h,
+ [AC_DEFINE(VICE_ETC_PATH, AFSDIR_CLIENT_ETC_DIRPATH)],
+ [AC_DEFINE(VICE_ETC_PATH, AFSCONF_CLIENTNAME)])
+
+dnl Find out if we should use afs_int32 or int32. They changed the
+dnl type across AFS versions.
+AC_CACHE_CHECK([for AFS int32 type], ac_cv_type_int32,
+[AC_EGREP_CPP(dnl
+changequote(<<,>>)dnl
+<<(^|[^a-zA-Z_0-9])afs_int32[^a-zA-Z_0-9]>>dnl
+changequote([,]), [#include <afs/stds.h>
+], ac_cv_type_int32=afs_int32, ac_cv_type_int32=int32)])
+AC_DEFINE_UNQUOTED(AFS_int32, $ac_cv_type_int32)
+
+AH_TEMPLATE([VICE_ETC_PATH],
+[Define this to be the define used in the AFS header for /usr/vice/etc])
+
+AH_TEMPLATE([AFS_int32], [Define this to be the type AFS uses for int32])
+])dnl
diff --git a/m4/smr_with_build_path.m4 b/m4/smr_with_build_path.m4
new file mode 100644
index 0000000..1fc9eaa
--- /dev/null
+++ b/m4/smr_with_build_path.m4
@@ -0,0 +1,40 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/smr_with_build_path.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# smr_WITH_BUILD_PATH
+#
+# DESCRIPTION
+#
+# This macro adds a "--with-build-path" option to the configure script.
+# This configure option provides a convenient way to add "-I" options to
+# CPPFLAGS and "-L" options to LDFLAGS, at configure time.
+#
+# Invoking "./configure --with-build-path=DIR" results in "-I DIR/include"
+# being added to CPPFLAGS if DIR/include exists, and "-L DIR/lib" being
+# added to LDFLAGS if DIR/lib exists.
+#
+# Separate multiple directories using colons; e.g.
+# "--with-build-path=DIR1:DIR2:DIR3".
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steve M. Robbins <smr@debian.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([smr_WITH_BUILD_PATH],
+[
+ AC_ARG_WITH([build-path],
+ [ --with-build-path=DIR build using DIR/include and DIR/lib],
+ [
+ for d in `echo $withval | tr : ' '`; do
+ test -d $d/include && CPPFLAGS="$CPPFLAGS -I$d/include"
+ test -d $d/lib && LDFLAGS="$LDFLAGS -L$d/lib"
+ done
+ ])
+])
diff --git a/m4/swig_enable_cxx.m4 b/m4/swig_enable_cxx.m4
new file mode 100644
index 0000000..9523683
--- /dev/null
+++ b/m4/swig_enable_cxx.m4
@@ -0,0 +1,50 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/swig_enable_cxx.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# SWIG_ENABLE_CXX
+#
+# DESCRIPTION
+#
+# Enable SWIG C++ support. This affects all invocations of $(SWIG).
+#
+# LICENSE
+#
+# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de>
+# Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
+# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net>
+# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([SWIG_ENABLE_CXX],[
+ AC_REQUIRE([AC_PROG_SWIG])
+ AC_REQUIRE([AC_PROG_CXX])
+ SWIG="$SWIG -c++"
+])
diff --git a/m4/swig_multi_module_support.m4 b/m4/swig_multi_module_support.m4
new file mode 100644
index 0000000..62f2428
--- /dev/null
+++ b/m4/swig_multi_module_support.m4
@@ -0,0 +1,53 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/swig_multi_module_support.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# SWIG_MULTI_MODULE_SUPPORT
+#
+# DESCRIPTION
+#
+# Enable support for multiple modules. This effects all invocations of
+# $(SWIG). You have to link all generated modules against the appropriate
+# SWIG runtime library. If you want to build Python modules for example,
+# use the SWIG_PYTHON macro and link the modules against
+# $(SWIG_PYTHON_LIBS).
+#
+# LICENSE
+#
+# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de>
+# Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
+# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net>
+# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([SWIG_MULTI_MODULE_SUPPORT],[
+ AC_REQUIRE([AC_PROG_SWIG])
+ SWIG="$SWIG -noruntime"
+])
diff --git a/m4/swig_python.m4 b/m4/swig_python.m4
new file mode 100644
index 0000000..7545fb7
--- /dev/null
+++ b/m4/swig_python.m4
@@ -0,0 +1,61 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/swig_python.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# SWIG_PYTHON([use-shadow-classes = {no, yes}])
+#
+# DESCRIPTION
+#
+# Checks for Python and provides the $(SWIG_PYTHON_CPPFLAGS), and
+# $(SWIG_PYTHON_OPT) output variables.
+#
+# $(SWIG_PYTHON_OPT) contains all necessary SWIG options to generate code
+# for Python. Shadow classes are enabled unless the value of the optional
+# first argument is exactly 'no'. If you need multi module support
+# (provided by the SWIG_MULTI_MODULE_SUPPORT macro) use
+# $(SWIG_PYTHON_LIBS) to link against the appropriate library. It contains
+# the SWIG Python runtime library that is needed by the type check system
+# for example.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de>
+# Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
+# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net>
+# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([SWIG_PYTHON],[
+ AC_REQUIRE([AC_PROG_SWIG])
+ AC_REQUIRE([AC_PYTHON_DEVEL])
+ test "x$1" != "xno" || swig_shadow=" -noproxy"
+ AC_SUBST([SWIG_PYTHON_OPT],[-python$swig_shadow])
+ AC_SUBST([SWIG_PYTHON_CPPFLAGS],[$PYTHON_CPPFLAGS])
+])
diff --git a/m4/type_socklen_t.m4 b/m4/type_socklen_t.m4
new file mode 100644
index 0000000..17108eb
--- /dev/null
+++ b/m4/type_socklen_t.m4
@@ -0,0 +1,58 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/type_socklen_t.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# TYPE_SOCKLEN_T
+#
+# DESCRIPTION
+#
+# Check whether sys/socket.h defines type socklen_t. Please note that some
+# systems require sys/types.h to be included before sys/socket.h can be
+# compiled.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Lars Brinkhoff <lars@nocrew.org>
+#
+# This program 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 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it 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, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. 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 the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([TYPE_SOCKLEN_T],
+[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
+[
+ AC_TRY_COMPILE(
+ [#include <sys/types.h>
+ #include <sys/socket.h>],
+ [socklen_t len = 42; return 0;],
+ ac_cv_type_socklen_t=yes,
+ ac_cv_type_socklen_t=no)
+])
+ if test $ac_cv_type_socklen_t != yes; then
+ AC_DEFINE(socklen_t, int, [Substitute for socklen_t])
+ fi
+])
diff --git a/m4/vl_check_sign.m4 b/m4/vl_check_sign.m4
new file mode 100644
index 0000000..c0cfb36
--- /dev/null
+++ b/m4/vl_check_sign.m4
@@ -0,0 +1,50 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/vl_check_sign.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# VL_CHECK_SIGN (TYPE, [ACTION-IF-SIGNED], [ACTION-IF-UNSIGNED], [INCLUDES])
+#
+# DESCRIPTION
+#
+# Checks whether TYPE is signed or not. If no INCLUDES are specified, the
+# default includes are used. If ACTION-IF-SIGNED is given, it is
+# additional shell code to execute when the type is signed. If
+# ACTION-IF-UNSIGNED is given, it is executed when the type is unsigned.
+#
+# This macro assumes that the type exists. Therefore the existence of the
+# type should be checked before calling this macro. For example:
+#
+# AC_CHECK_HEADERS([wchar.h])
+# AC_CHECK_TYPE([wchar_t],,[ AC_MSG_ERROR([Type wchar_t not found.]) ])
+# VL_CHECK_SIGN([wchar_t],
+# [ AC_DEFINE(WCHAR_T_SIGNED, 1, [Define if wchar_t is signed]) ],
+# [ AC_DEFINE(WCHAR_T_UNSIGNED, 1, [Define if wchar_t is unsigned]) ], [
+# #ifdef HAVE_WCHAR_H
+# #include <wchar.h>
+# #endif
+# ])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ville Laurikari <vl@iki.fi>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([VL_CHECK_SIGN], [
+ typename=`echo $1 | sed "s/@<:@^a-zA-Z0-9_@:>@/_/g"`
+ AC_CACHE_CHECK([whether $1 is signed], vl_cv_decl_${typename}_signed, [
+ AC_TRY_COMPILE([$4],
+ [ int foo @<:@ 1 - 2 * !((($1) -1) < 0) @:>@ ],
+ [ eval "vl_cv_decl_${typename}_signed=\"yes\"" ],
+ [ eval "vl_cv_decl_${typename}_signed=\"no\"" ])])
+ symbolname=`echo $1 | sed "s/@<:@^a-zA-Z0-9_@:>@/_/g" | tr "a-z" "A-Z"`
+ if eval "test \"\${vl_cv_decl_${typename}_signed}\" = \"yes\""; then
+ $2
+ elif eval "test \"\${vl_cv_decl_${typename}_signed}\" = \"no\""; then
+ $3
+ fi
+])dnl
diff --git a/m4/vl_decl_wchar_max.m4 b/m4/vl_decl_wchar_max.m4
new file mode 100644
index 0000000..0849da8
--- /dev/null
+++ b/m4/vl_decl_wchar_max.m4
@@ -0,0 +1,48 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/vl_decl_wchar_max.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# VL_DECL_WCHAR_MAX
+#
+# DESCRIPTION
+#
+# Checks whether the system headers define WCHAR_MAX or not. If it is
+# already defined, does nothing. Otherwise checks the size and signedness
+# of `wchar_t', and defines WCHAR_MAX to the maximum value that can be
+# stored in a variable of type `wchar_t'.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ville Laurikari <vl@iki.fi>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([VL_DECL_WCHAR_MAX], [
+ AC_CACHE_CHECK([whether WCHAR_MAX is defined], vl_cv_decl_wchar_max, [
+ AC_TRY_COMPILE([
+#ifdef HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+],[WCHAR_MAX],[vl_cv_decl_wchar_max="yes"],[vl_cv_decl_wchar_max="no"])])
+ if test $vl_cv_decl_wchar_max = "no"; then
+ VL_CHECK_SIGN([wchar_t],
+ [ wc_signed="yes"
+ AC_DEFINE(WCHAR_T_SIGNED, 1, [Define if wchar_t is signed]) ],
+ [ wc_signed="no"
+ AC_DEFINE(WCHAR_T_UNSIGNED, 1, [Define if wchar_t is unsigned])], [
+#ifdef HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+])
+ if test "$wc_signed" = "yes"; then
+ AC_DEFINE(WCHAR_MAX, [(1L << (sizeof(wchar_t) * 8 - 1) - 1)], [
+Define to the maximum value of wchar_t if not already defined elsewhere])
+ elif test "$wc_signed" = "no"; then
+ AC_DEFINE(WCHAR_MAX, [(1L << (sizeof(wchar_t) * 8) - 1)])
+ fi
+ fi
+])dnl
diff --git a/m4/vl_lib_readline.m4 b/m4/vl_lib_readline.m4
new file mode 100644
index 0000000..3a589b2
--- /dev/null
+++ b/m4/vl_lib_readline.m4
@@ -0,0 +1,102 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/vl_lib_readline.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# VL_LIB_READLINE
+#
+# DESCRIPTION
+#
+# Searches for a readline compatible library. If found, defines
+# `HAVE_LIBREADLINE'. If the found library has the `add_history' function,
+# sets also `HAVE_READLINE_HISTORY'. Also checks for the locations of the
+# necessary include files and sets `HAVE_READLINE_H' or
+# `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
+# 'HAVE_HISTORY_H' if the corresponding include files exists.
+#
+# The libraries that may be readline compatible are `libedit',
+# `libeditline' and `libreadline'. Sometimes we need to link a termcap
+# library for readline to work, this macro tests these cases too by trying
+# to link with `libtermcap', `libcurses' or `libncurses' before giving up.
+#
+# Here is an example of how to use the information provided by this macro
+# to perform the necessary includes or declarations in a C file:
+#
+# #ifdef HAVE_LIBREADLINE
+# # if defined(HAVE_READLINE_READLINE_H)
+# # include <readline/readline.h>
+# # elif defined(HAVE_READLINE_H)
+# # include <readline.h>
+# # else /* !defined(HAVE_READLINE_H) */
+# extern char *readline ();
+# # endif /* !defined(HAVE_READLINE_H) */
+# char *cmdline = NULL;
+# #else /* !defined(HAVE_READLINE_READLINE_H) */
+# /* no readline */
+# #endif /* HAVE_LIBREADLINE */
+#
+# #ifdef HAVE_READLINE_HISTORY
+# # if defined(HAVE_READLINE_HISTORY_H)
+# # include <readline/history.h>
+# # elif defined(HAVE_HISTORY_H)
+# # include <history.h>
+# # else /* !defined(HAVE_HISTORY_H) */
+# extern void add_history ();
+# extern int write_history ();
+# extern int read_history ();
+# # endif /* defined(HAVE_READLINE_HISTORY_H) */
+# /* no history */
+# #endif /* HAVE_READLINE_HISTORY */
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ville Laurikari <vl@iki.fi>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([VL_LIB_READLINE], [
+ AC_CACHE_CHECK([for a readline compatible library],
+ vl_cv_lib_readline, [
+ ORIG_LIBS="$LIBS"
+ for readline_lib in readline edit editline; do
+ for termcap_lib in "" termcap curses ncurses; do
+ if test -z "$termcap_lib"; then
+ TRY_LIB="-l$readline_lib"
+ else
+ TRY_LIB="-l$readline_lib -l$termcap_lib"
+ fi
+ LIBS="$ORIG_LIBS $TRY_LIB"
+ AC_TRY_LINK_FUNC(readline, vl_cv_lib_readline="$TRY_LIB")
+ if test -n "$vl_cv_lib_readline"; then
+ break
+ fi
+ done
+ if test -n "$vl_cv_lib_readline"; then
+ break
+ fi
+ done
+ if test -z "$vl_cv_lib_readline"; then
+ vl_cv_lib_readline="no"
+ LIBS="$ORIG_LIBS"
+ fi
+ ])
+
+ if test "$vl_cv_lib_readline" != "no"; then
+ AC_DEFINE(HAVE_LIBREADLINE, 1,
+ [Define if you have a readline compatible library])
+ AC_CHECK_HEADERS(readline.h readline/readline.h)
+ AC_CACHE_CHECK([whether readline supports history],
+ vl_cv_lib_readline_history, [
+ vl_cv_lib_readline_history="no"
+ AC_TRY_LINK_FUNC(add_history, vl_cv_lib_readline_history="yes")
+ ])
+ if test "$vl_cv_lib_readline_history" = "yes"; then
+ AC_DEFINE(HAVE_READLINE_HISTORY, 1,
+ [Define if your readline library has \`add_history'])
+ AC_CHECK_HEADERS(history.h readline/history.h)
+ fi
+ fi
+])dnl
diff --git a/m4/vl_prog_cc_warnings.m4 b/m4/vl_prog_cc_warnings.m4
new file mode 100644
index 0000000..b90881b
--- /dev/null
+++ b/m4/vl_prog_cc_warnings.m4
@@ -0,0 +1,137 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/vl_prog_cc_warnings.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# VL_PROG_CC_WARNINGS([ANSI])
+#
+# DESCRIPTION
+#
+# Enables a reasonable set of warnings for the C compiler. Optionally, if
+# the first argument is nonempty, turns on flags which enforce and/or
+# enable proper ANSI C if such are known with the compiler used.
+#
+# Currently this macro knows about GCC, Solaris C compiler, Digital Unix C
+# compiler, C for AIX Compiler, HP-UX C compiler, IRIX C compiler, NEC
+# SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos 10.0.0.8) C
+# compiler.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ville Laurikari <vl@iki.fi>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([VL_PROG_CC_WARNINGS], [
+ ansi=$1
+ if test -z "$ansi"; then
+ msg="for C compiler warning flags"
+ else
+ msg="for C compiler warning and ANSI conformance flags"
+ fi
+ AC_CACHE_CHECK($msg, vl_cv_prog_cc_warnings, [
+ if test -n "$CC"; then
+ cat > conftest.c <<EOF
+int main(int argc, char **argv) { return 0; }
+EOF
+
+ dnl GCC
+ if test "$GCC" = "yes"; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-Wall"
+ else
+ vl_cv_prog_cc_warnings="-Wall -ansi -pedantic"
+ fi
+
+ dnl Most compilers print some kind of a version string with some command
+ dnl line options (often "-V"). The version string should be checked
+ dnl before doing a test compilation run with compiler-specific flags.
+ dnl This is because some compilers (like the Cray compiler) only
+ dnl produce a warning message for unknown flags instead of returning
+ dnl an error, resulting in a false positive. Also, compilers may do
+ dnl erratic things when invoked with flags meant for a different
+ dnl compiler.
+
+ dnl Solaris C compiler
+ elif $CC -V 2>&1 | grep -i "WorkShop" > /dev/null 2>&1 &&
+ $CC -c -v -Xc conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-v"
+ else
+ vl_cv_prog_cc_warnings="-v -Xc"
+ fi
+
+ dnl Digital Unix C compiler
+ elif $CC -V 2>&1 | grep -i "Digital UNIX Compiler" > /dev/null 2>&1 &&
+ $CC -c -verbose -w0 -warnprotos -std1 conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-verbose -w0 -warnprotos"
+ else
+ vl_cv_prog_cc_warnings="-verbose -w0 -warnprotos -std1"
+ fi
+
+ dnl C for AIX Compiler
+ elif $CC 2>&1 | grep -i "C for AIX Compiler" > /dev/null 2>&1 &&
+ $CC -c -qlanglvl=ansi -qinfo=all conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd"
+ else
+ vl_cv_prog_cc_warnings="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd -qlanglvl=ansi"
+ fi
+
+ dnl IRIX C compiler
+ elif $CC -version 2>&1 | grep -i "MIPSpro Compilers" > /dev/null 2>&1 &&
+ $CC -c -fullwarn -ansi -ansiE conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-fullwarn"
+ else
+ vl_cv_prog_cc_warnings="-fullwarn -ansi -ansiE"
+ fi
+
+ dnl HP-UX C compiler
+ elif what $CC 2>&1 | grep -i "HP C Compiler" > /dev/null 2>&1 &&
+ $CC -c -Aa +w1 conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="+w1"
+ else
+ vl_cv_prog_cc_warnings="+w1 -Aa"
+ fi
+
+ dnl The NEC SX-5 (Super-UX 10) C compiler
+ elif $CC -V 2>&1 | grep "/SX" > /dev/null 2>&1 &&
+ $CC -c -pvctl[,]fullmsg -Xc conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-pvctl[,]fullmsg"
+ else
+ vl_cv_prog_cc_warnings="-pvctl[,]fullmsg -Xc"
+ fi
+
+ dnl The Cray C compiler (Unicos)
+ elif $CC -V 2>&1 | grep -i "Cray" > /dev/null 2>&1 &&
+ $CC -c -h msglevel 2 conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-h msglevel 2"
+ else
+ vl_cv_prog_cc_warnings="-h msglevel 2 -h conform"
+ fi
+
+ fi
+ rm -f conftest.*
+ fi
+ if test -n "$vl_cv_prog_cc_warnings"; then
+ CFLAGS="$CFLAGS $vl_cv_prog_cc_warnings"
+ else
+ vl_cv_prog_cc_warnings="unknown"
+ fi
+ ])
+])dnl
diff --git a/m4/vl_prog_fig2dev.m4 b/m4/vl_prog_fig2dev.m4
new file mode 100644
index 0000000..bfec927
--- /dev/null
+++ b/m4/vl_prog_fig2dev.m4
@@ -0,0 +1,39 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/vl_prog_fig2dev.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# VL_PROG_FIG2DEV
+#
+# DESCRIPTION
+#
+# If `fig2dev' is found, sets the output variable `FIG2DEV' to `fig2dev',
+# and `FIG2DEV_ESPLANG' to the graphics language which can be used to
+# produce Encapsulated PostScript. Older versions of `fig2dev' produce EPS
+# with `-Lps' and new versions with `-Leps', this macro finds out the
+# correct language option automatically.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ville Laurikari <vl@iki.fi>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([VL_PROG_FIG2DEV], [
+ AC_CHECK_PROG(FIG2DEV, fig2dev, fig2dev)
+ if test "x$FIG2DEV" != "x"; then
+ AC_CACHE_CHECK(how to produce EPS with fig2dev,
+ vl_cv_sys_fig2dev_epslang, [
+ if "$FIG2DEV" -Leps /dev/null 2>&1 | grep Unknown > /dev/null; then
+ vl_cv_sys_fig2dev_epslang=ps
+ else
+ vl_cv_sys_fig2dev_epslang=eps
+ fi
+ ])
+ FIG2DEV_EPSLANG=$vl_cv_sys_fig2dev_epslang
+ AC_SUBST(FIG2DEV_EPSLANG)
+ fi
+])