From db67ec92f832b5cf51c1b8bff3d843549b97dac7 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Thu, 23 Dec 2010 11:33:20 -0800 Subject: [PATCH] Updated pandora-build files to version 0.167 --- .quickly | 2 +- config/autorun.sh | 4 +- config/lcov.am | 42 +++++ config/pandora-plugin | 78 +++++++-- m4/iconv.m4 | 68 ++++++-- m4/pandora_64bit.m4 | 4 +- m4/pandora_bison.m4 | 33 ++++ m4/pandora_canonical.m4 | 191 +++++++++++++++++++-- m4/pandora_check_compiler_version.m4 | 4 +- m4/pandora_check_cxx_standard.m4 | 6 +- m4/pandora_compile_stdcxx_0x.m4 | 103 +++++++++++ m4/pandora_cxx_demangle.m4 | 4 +- m4/pandora_drizzle_build.m4 | 55 ++---- m4/pandora_enable_dtrace.m4 | 8 +- m4/pandora_ensure_gcc_version.m4 | 4 +- m4/pandora_extensions.m4 | 4 +- m4/pandora_fdatasync.m4 | 4 +- m4/pandora_flex.m4 | 33 ++++ m4/pandora_have_better_malloc.m4 | 6 +- m4/pandora_have_boost.m4 | 32 +++- m4/pandora_have_gcc_atomics.m4 | 4 +- m4/pandora_have_libavahi.m4 | 4 +- m4/pandora_have_libbdb.m4 | 4 +- m4/pandora_have_libboost_date_time.m4 | 46 +++++ m4/pandora_have_libboost_filesystem.m4 | 45 +++++ m4/pandora_have_libboost_iostreams.m4 | 49 ++++++ m4/pandora_have_libboost_regex.m4 | 54 ++++++ m4/pandora_have_libboost_thread.m4 | 54 ++++++ m4/pandora_have_libcurl.m4 | 62 +++++++ m4/pandora_have_libdl.m4 | 4 +- m4/pandora_have_libdrizzle.m4 | 4 +- m4/pandora_have_libevent.m4 | 4 +- m4/pandora_have_libgearman.m4 | 4 +- m4/pandora_have_libgtest.m4 | 3 + m4/pandora_have_libhaildb.m4 | 43 +++++ m4/pandora_have_libldap.m4 | 4 +- m4/pandora_have_libmemcached.m4 | 4 +- m4/pandora_have_libpcre.m4 | 4 +- m4/pandora_have_libpq.m4 | 4 +- m4/pandora_have_libreadline.m4 | 4 +- m4/pandora_have_libsqlite3.m4 | 4 +- m4/pandora_have_libtokyocabinet.m4 | 4 +- m4/pandora_have_libuuid.m4 | 4 +- m4/pandora_have_libxml2.m4 | 4 +- m4/pandora_have_libz.m4 | 4 +- m4/pandora_have_protobuf.m4 | 4 +- m4/pandora_have_sasl.m4 | 4 +- m4/pandora_header_assert.m4 | 4 +- m4/pandora_header_stdcxx_98.m4 | 83 +++++++++ m4/pandora_intltool.m4 | 225 +++++++++++++++++++++++++ m4/pandora_libtool.m4 | 4 +- m4/pandora_optimize.m4 | 16 +- m4/pandora_platform.m4 | 31 +++- m4/pandora_plugins.m4 | 9 +- m4/pandora_print_callstack.m4 | 4 +- m4/pandora_python3_devel.m4 | 12 +- m4/pandora_run_cpplint.m4 | 4 +- m4/pandora_sasl.m4 | 4 +- m4/pandora_shared_ptr.m4 | 4 +- m4/pandora_vc_build.m4 | 7 +- m4/pandora_version.m4 | 4 +- m4/pandora_visibility.m4 | 14 +- m4/pandora_warnings.m4 | 175 +++++++++++++------ m4/pandora_with_memcached.m4 | 4 +- m4/po.m4 | 10 +- m4/progtest.m4 | 14 +- 66 files changed, 1488 insertions(+), 257 deletions(-) create mode 100644 config/lcov.am create mode 100644 m4/pandora_bison.m4 create mode 100644 m4/pandora_compile_stdcxx_0x.m4 create mode 100644 m4/pandora_flex.m4 create mode 100644 m4/pandora_have_libboost_date_time.m4 create mode 100644 m4/pandora_have_libboost_filesystem.m4 create mode 100644 m4/pandora_have_libboost_iostreams.m4 create mode 100644 m4/pandora_have_libboost_regex.m4 create mode 100644 m4/pandora_have_libboost_thread.m4 create mode 100644 m4/pandora_have_libcurl.m4 create mode 100644 m4/pandora_have_libhaildb.m4 create mode 100644 m4/pandora_header_stdcxx_98.m4 create mode 100644 m4/pandora_intltool.m4 diff --git a/.quickly b/.quickly index b7c3fe31..424a3768 100644 --- a/.quickly +++ b/.quickly @@ -2,4 +2,4 @@ project = libmemcached version = 0.4.2 template = pandora-build project-type = library -pandora-version = 0.134 +pandora-version = 0.167 diff --git a/config/autorun.sh b/config/autorun.sh index 511b6bba..ae57443a 100755 --- a/config/autorun.sh +++ b/config/autorun.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2006 Jan Kneschke -# Copyright (c) 2009 Sun Microsystems +# Copyright (C) 2006 Jan Kneschke +# Copyright (C) 2009 Sun Microsystems, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/config/lcov.am b/config/lcov.am new file mode 100644 index 00000000..7509df10 --- /dev/null +++ b/config/lcov.am @@ -0,0 +1,42 @@ +# Copyright (C) 2010 Hartmut Holzgraefe +# +# 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; version 2 of the License. +# +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +LCOV = lcov +LCOV_GENHTML = genhtml + +lcov: lcov-html + +lcov-test: lcov-clean-data test + +drizzle_lcov.info: lcov-test + @echo "Generating $@" + $(LCOV) --directory . --capture --base-directory . --output-file $@ + $(LCOV) --remove $@ '/usr/include/*' --output-file $@ + $(LCOV) --remove $@ '/usr/local/include/*' --output-file $@ + @echo + +lcov-html: drizzle_lcov.info + @echo "Generating lcov HTML" + @$(LCOV_GENHTML) --legend --output-directory lcov_html/ --title "Drizzle Code Coverage" $< + +lcov-clean: + rm -f drizzle_lcov.info + rm -rf lcov_data/ + rm -rf lcov_html/ + +lcov-clean-data: + @find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f + + diff --git a/config/pandora-plugin b/config/pandora-plugin index 3ffcaaff..91302914 100755 --- a/config/pandora-plugin +++ b/config/pandora-plugin @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2009 Sun Microsystems +# Copyright (C) 2009 Sun Microsystems, Inc. # # 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 @@ -25,6 +25,7 @@ import subprocess plugin_am_file=None plugin_ac_file=None +plugin_doc_index=None class ChangeProtectedFile(object): @@ -130,9 +131,16 @@ VERSION=$(PANDORA_RELEASE_VERSION) pkgplugindir=%(pkgplugindir)s EXTRA_DIST = plugin.ini +noinst_HEADERS= +nobase_include_HEADERS= +check_PROGRAMS= +noinst_LTLIBRARIES= +bin_PROGRAMS= + + """ % plugin) if plugin['headers'] != "": - plugin_file.write("noinst_HEADERS = %(headers)s\n" % plugin) + plugin_file.write("noinst_HEADERS += %(headers)s\n" % plugin) if plugin['install_headers'] != "": plugin_file.write("nobase_include_HEADERS += %(install_headers)s\n" % plugin) if plugin['testsuite']: @@ -191,8 +199,16 @@ def write_plugin(plugin, plugin_ini_list): write_plugin_ac(plugin, plugin_ac_file) write_plugin_am(plugin, plugin_am_file) + write_plugin_docs(plugin, plugin_doc_index) plugin['writing_status'] = 'done' +def write_plugin_docs(plugin, doc_index): + if plugin['docs'] is not None and os.path.isdir("docs/plugins"): + if not os.path.exists(os.path.join("docs/plugins",plugin["name"])): + os.symlink(os.path.abspath(plugin["docs"]), os.path.join("docs/plugins",plugin["name"])) + doc_index.write(""" + %(name)s/index""" % plugin) + def write_plugin_ac(plugin, plugin_ac): # # Write plugin config instructions into plugin.ac file. @@ -229,8 +245,8 @@ AS_HELP_STRING([--without-%(name_with_dashes)s-plugin],[Disable building %(title ]) AC_ARG_ENABLE([%(name_with_dashes)s-plugin],[ dnl indented wierd to make the help output correct -AS_HELP_STRING([--enable-%(name_with_dashes)s-plugin],[Build %(title)s. @<:@default=%(default_yesno)s@:>@]) -AS_HELP_STRING([--disable-%(name_with_dashes)s-plugin],[Disable building %(title)s]) +AS_HELP_STRING([--enable-%(name_with_dashes)s-plugin],[Enable loading %(title)s by default. @<:@default=%(default_yesno)s@:>@]) +AS_HELP_STRING([--disable-%(name_with_dashes)s-plugin],[Disable loading %(title)s by default.]) ], [enable_%(name)s_plugin="$enableval"], [enable_%(name)s_plugin=%(default_yesno)s]) @@ -271,11 +287,13 @@ AS_IF([test "x$with_%(name)s_plugin" = "xyes"], if plugin['static']: plugin_ac.write(""" AS_IF([test "x$enable_%(name)s_plugin" = "xyes"],[ - pandora_builtin_list="%(module_name)s,${pandora_builtin_list}" - pandora_builtin_symbols_list="_drizzled_%(module_name)s_plugin_,${pandora_builtin_symbols_list}" - pandora_plugin_libs="${pandora_plugin_libs} \${top_builddir}/%(root_plugin_dir)s/%(libname)s.la" + pandora_builtin_load_list="%(module_name)s,${pandora_builtin_load_list}" + pandora_builtin_load_symbols_list="_drizzled_%(module_name)s_plugin_,${pandora_builtin_load_symbols_list}" PANDORA_PLUGIN_DEP_LIBS="${PANDORA_PLUGIN_DEP_LIBS} %(plugin_dep_libs)s" ]) + pandora_builtin_list="%(module_name)s,${pandora_builtin_list}" + pandora_builtin_symbols_list="_drizzled_%(module_name)s_plugin_,${pandora_builtin_symbols_list}" + pandora_plugin_libs="${pandora_plugin_libs} \${top_builddir}/%(root_plugin_dir)s/%(libname)s.la" """ % plugin) else: @@ -320,11 +338,14 @@ def expand_plugin_ini(plugin): plugin['tests']= fix_file_paths(plugin, plugin['tests']) # Make a yes/no version for autoconf help messages - if plugin['load_by_default'] or plugin['static']: + if plugin['load_by_default']: plugin['default_yesno']="yes" else: plugin['default_yesno']="no" + if plugin.has_key('extra_dist'): + plugin['extra_dist']=" ".join([os.path.join(plugin['rel_path'],f) for f in plugin['extra_dist'].split()]) + plugin['build_conditional_tag']= "BUILD_%s_PLUGIN" % plugin['name'].upper() plugin['name_with_dashes']= plugin['name'].replace('_','-') @@ -348,18 +369,24 @@ def find_testsuite(plugin_dir): return "" return None +def find_docs(plugin_dir): + if os.path.isfile(os.path.join(plugin_dir, "docs", "index.rst")): + return os.path.join(plugin_dir, "docs") + def read_plugin_ini(plugin_dir): + sources_default="" if plugin_dir == ".": plugin_name="**OUT-OF-TREE**" + module_name="**OUT-OF-TREE**" else: - short_name=os.path.basename(plugin_dir) + sources_default="%s.cc" % os.path.basename(plugin_dir) plugin_name = plugin_dir[plugin_dir.index(config['root_plugin_dir']) + len(config['root_plugin_dir']) + 1:] module_name = plugin_name.replace("/", config['module_name_separator']).replace("\\", config['module_name_separator']) plugin_name = plugin_name.replace("/", config['plugin_name_separator']).replace("\\", config['plugin_name_separator']) plugin_file= os.path.join(plugin_dir,config['plugin_ini_fname']) - plugin_defaults= dict(sources="%s.cc" % short_name, + plugin_defaults= dict(sources=sources_default, headers="", install_headers="", cflags="", @@ -394,7 +421,6 @@ def read_plugin_ini(plugin_dir): sys.exit(1) if not plugin.has_key('version'): plugin['version'] = config['default_plugin_version'] - if plugin.has_key('load_by_default'): plugin['load_by_default']=parser.getboolean('plugin','load_by_default') if plugin.has_key('disabled'): @@ -404,12 +430,19 @@ def read_plugin_ini(plugin_dir): else: plugin['enabled']="yes" if plugin.has_key('static'): - plugin['static']= parser.getboolean('plugin','static') + try: + plugin['static']= parser.getboolean('plugin','static') + except: + if plugin['static'][:5] == os.sys.platform[:5]: + plugin['static']= True + else: + plugin['static']= False if plugin.has_key('install'): plugin['install']= parser.getboolean('plugin','install') if plugin.has_key('testsuite'): if plugin['testsuite'] == 'disable': plugin['testsuite']= False + plugin['dist_testsuite']= find_testsuite(plugin_dir) else: plugin_testsuite= find_testsuite(plugin_dir) plugin['testsuitedir']=plugin_testsuite @@ -417,6 +450,7 @@ def read_plugin_ini(plugin_dir): plugin['testsuite']=True else: plugin['testsuite']=False + plugin['docs']= find_docs(plugin_dir) plugin['cflags']+= ' ' + config['extra_cflags'] plugin['cppflags']+= ' ' + config['extra_cppflags'] @@ -471,6 +505,8 @@ EXTRA_DIST += %(rel_path)s/plugin.ini %(rel_path)s/plugin.ini: """ % plugin) + if plugin.has_key('extra_dist') and plugin['extra_dist'] != "": + plugin_am.write("EXTRA_DIST += %(extra_dist)s\n" % plugin) if plugin['headers'] != "": plugin_am.write("noinst_HEADERS += %(headers)s\n" % plugin) if plugin['install_headers'] != "": @@ -478,6 +514,10 @@ EXTRA_DIST += %(rel_path)s/plugin.ini if plugin['testsuite']: if plugin.has_key('testsuitedir') and plugin['testsuitedir'] != "": plugin_am.write("EXTRA_DIST += %(rel_path)s/%(testsuitedir)s\n" % plugin) + if plugin.has_key('dist_testsuite') and plugin['dist_testsuite'] != "": + plugin_am.write("EXTRA_DIST += %(rel_path)s/%(dist_testsuite)s\n" % plugin) + if plugin['docs'] is not None: + plugin_am.write("EXTRA_DIST += ${top_srcdir}/%(rel_path)s/docs/*.rst\n" % plugin) if plugin['static']: plugin_am.write(""" %(root_plugin_dir)s_%(plugin_prefix)s%(name)s_dir=${top_srcdir}/%(rel_path)s @@ -593,7 +633,6 @@ os.path.walk(os.path.join(config['top_srcdir'], accumulate_plugins, plugin_list) - if not os.path.exists("config/pandora-plugin.am") or "write" in actions: plugin_am_file = ChangeProtectedFile(os.path.join('config', 'pandora-plugin.am')) plugin_am_file.write(""" @@ -624,6 +663,17 @@ if not os.path.exists("config/pandora-plugin.ac") or "write" in actions: plugin_ac_file = ChangeProtectedFile(os.path.join('config', 'pandora-plugin.ac')) plugin_ac_file.write("dnl Generated file, run make to rebuild\n") +if os.path.exists("docs/plugins"): + if not os.path.exists("docs/plugins/list.rst") or "write" in actions: + plugin_doc_index = ChangeProtectedFile("docs/plugins/list.rst") + plugin_doc_index.write(""" +Plugin Documentation +==================== + +.. toctree:: + :maxdepth: 2 +""") + if os.path.exists('plugin.ini'): # Are we in a plugin dir which wants to have a self-sufficient build system? @@ -665,3 +715,5 @@ if plugin_am_file is not None: plugin_am_file.close() if plugin_ac_file is not None: plugin_ac_file.close() +if plugin_doc_index is not None: + plugin_doc_index.close() diff --git a/m4/iconv.m4 b/m4/iconv.m4 index 66bc76f4..e2041b9b 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -1,5 +1,5 @@ -# iconv.m4 serial AM6 (gettext-0.17) -dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc. +# iconv.m4 serial 11 (gettext-0.18.1) +dnl Copyright (C) 2000-2002, 2007-2010 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. @@ -34,7 +34,7 @@ AC_DEFUN([AM_ICONV_LINK], am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) - AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [ + AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include @@ -42,7 +42,7 @@ AC_DEFUN([AM_ICONV_LINK], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], - am_cv_func_iconv=yes) + [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" @@ -51,14 +51,14 @@ AC_DEFUN([AM_ICONV_LINK], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], - am_cv_lib_iconv=yes - am_cv_func_iconv=yes) + [am_cv_lib_iconv=yes] + [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then - AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [ - dnl This tests against bugs in AIX 5.1 and HP-UX 11.11. + AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ + dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" @@ -87,6 +87,25 @@ int main () return 1; } } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\263"; + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { @@ -134,7 +153,7 @@ int main () am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then - AC_DEFINE(HAVE_ICONV, 1, + AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then @@ -147,16 +166,31 @@ int main () LIBICONV= LTLIBICONV= fi - AC_SUBST(LIBICONV) - AC_SUBST(LTLIBICONV) + AC_SUBST([LIBICONV]) + AC_SUBST([LTLIBICONV]) ]) -AC_DEFUN([AM_ICONV], +dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to +dnl avoid warnings like +dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". +dnl This is tricky because of the way 'aclocal' is implemented: +dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. +dnl Otherwise aclocal's initial scan pass would miss the macro definition. +dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. +dnl Otherwise aclocal would emit many "Use of uninitialized value $1" +dnl warnings. +m4_define([gl_iconv_AC_DEFUN], + m4_version_prereq([2.64], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [[AC_DEFUN( + [$1], [$2])]])) +gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) - AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_CACHE_VAL([am_cv_proto_iconv], [ AC_TRY_COMPILE([ #include #include @@ -169,12 +203,12 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si #else size_t iconv(); #endif -], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") +], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - AC_MSG_RESULT([$]{ac_t:- - }[$]am_cv_proto_iconv) - AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + AC_MSG_RESULT([ + $am_cv_proto_iconv]) + AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) fi ]) diff --git a/m4/pandora_64bit.m4 b/m4/pandora_64bit.m4 index ed123d2b..e026fd92 100644 --- a/m4/pandora_64bit.m4 +++ b/m4/pandora_64bit.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_bison.m4 b/m4/pandora_bison.m4 new file mode 100644 index 00000000..c95896c7 --- /dev/null +++ b/m4/pandora_bison.m4 @@ -0,0 +1,33 @@ +dnl Copyright (C) 2010 Monty Taylor +dnl Copyright (C) 2010 Hartmut Holzgraefe +dnl This file is free software; Monty Taylor and Hartmut Holzgraefe +dnl give unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([_PANDORA_SEARCH_BISON],[ + + dnl -------------------------------------------------------------------- + dnl Check for bison + dnl -------------------------------------------------------------------- + + AC_CHECK_PROGS([YACC], ['bison -y'], [:]) + AS_IF([test "x$YACC" = "x:"],[ + pandora_have_bison=no + YACC='if test -f "$@"; then echo "WARNING: no proper bison binary found, ignoring changes to $<"; exit 0; else echo "ERROR: no proper bison binary found"; exit 1; fi;' + ],[ + pandora_have_bison=yes + ]) + + AM_CONDITIONAL(HAVE_BISON, [test "x${pandora_have_bison}" = "xyes"]) +]) + +AC_DEFUN([PANDORA_HAVE_BISON],[ + AC_REQUIRE([_PANDORA_SEARCH_BISON]) +]) + +AC_DEFUN([PANDORA_REQUIRE_BISON],[ + AC_REQUIRE([PANDORA_HAVE_BISON]) + AS_IF([test "x${pandora_have_bison}" = "xno" -a "$pandora_building_from_bzr" = "yes"], + AC_MSG_ERROR(["bison is required for ${PACKAGE} to build from a bzr branch"]) + ) +]) diff --git a/m4/pandora_canonical.m4 b/m4/pandora_canonical.m4 index 8443bf80..6768783b 100644 --- a/m4/pandora_canonical.m4 +++ b/m4/pandora_canonical.m4 @@ -1,10 +1,10 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Which version of the canonical setup we're using -AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.134]) +AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.167]) AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[ AC_ARG_ENABLE([fat-binaries], @@ -23,6 +23,12 @@ AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[ ]) ]) +AC_DEFUN([PANDORA_BLOCK_BAD_OPTIONS],[ + AS_IF([test "x${prefix}" = "x"],[ + AC_MSG_ERROR([--prefix requires an argument]) + ]) +]) + dnl The standard setup for how we build Pandora projects AC_DEFUN([PANDORA_CANONICAL_TARGET],[ AC_REQUIRE([PANDORA_FORCE_DEPEND_TRACKING]) @@ -32,6 +38,7 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ m4_define([PCT_REQUIRE_CXX],[no]) m4_define([PCT_FORCE_GCC42],[no]) m4_define([PCT_DONT_SUPPRESS_INCLUDE],[no]) + m4_define([PCT_NO_VC_CHANGELOG],[no]) m4_define([PCT_VERSION_FROM_VC],[no]) m4_define([PCT_USE_VISIBILITY],[yes]) m4_foreach([pct_arg],[$*],[ @@ -52,6 +59,10 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ m4_undefine([PCT_DONT_SUPPRESS_INCLUDE]) m4_define([PCT_DONT_SUPPRESS_INCLUDE],[yes]) ], + [no-vc-changelog], [ + m4_undefine([PCT_NO_VC_CHANGELOG]) + m4_define([PCT_NO_VC_CHANGELOG],[yes]) + ], [version-from-vc], [ m4_undefine([PCT_VERSION_FROM_VC]) m4_define([PCT_VERSION_FROM_VC],[yes]) @@ -66,6 +77,8 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ AC_CONFIG_HEADERS([config.h]) ]) + PANDORA_BLOCK_BAD_OPTIONS + # We need to prevent canonical target # from injecting -O2 into CFLAGS - but we won't modify anything if we have # set CFLAGS on the command line, since that should take ultimate precedence @@ -77,15 +90,17 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ AC_CANONICAL_TARGET m4_if(PCT_DONT_SUPRESS_INCLUDE,yes,[ - AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability subdir-objects foreign) + AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability subdir-objects foreign tar-ustar) ],[ - AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability nostdinc subdir-objects foreign) + AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability nostdinc subdir-objects foreign tar-ustar) ]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) m4_if(m4_substr(m4_esyscmd(test -d gnulib && echo 0),0,1),0,[ gl_EARLY + ],[ + PANDORA_EXTENSIONS ]) AC_REQUIRE([AC_PROG_CC]) @@ -94,10 +109,27 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ ]) AC_REQUIRE([PANDORA_64BIT]) + m4_if(PCT_NO_VC_CHANGELOG,yes,[ + vc_changelog=no + ],[ + vc_changelog=yes + ]) m4_if(PCT_VERSION_FROM_VC,yes,[ PANDORA_VC_VERSION ],[ PANDORA_TEST_VC_DIR + + changequote(<<, >>)dnl + PANDORA_RELEASE_ID=`echo $VERSION | sed 's/[^0-9]//g'` + changequote([, ])dnl + + PANDORA_RELEASE_COMMENT="" + AC_DEFINE_UNQUOTED([PANDORA_RELEASE_VERSION],["$VERSION"], + [Version of the software]) + + AC_SUBST(PANDORA_RELEASE_COMMENT) + AC_SUBST(PANDORA_RELEASE_VERSION) + AC_SUBST(PANDORA_RELEASE_ID) ]) PANDORA_VERSION @@ -121,8 +153,9 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ AS_IF([test "$ac_cv_cxx_stdcxx_98" = "no"],[ AC_MSG_ERROR([No working C++ Compiler has been found. ${PACKAGE} requires a C++ compiler that can handle C++98]) ]) - ]) + PANDORA_CXX_CSTDINT + PANDORA_CXX_CINTTYPES m4_if(m4_substr(m4_esyscmd(test -d gnulib && echo 0),0,1),0,[ gl_INIT @@ -144,6 +177,8 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ AC_SYS_LARGEFILE PANDORA_CLOCK_GETTIME + AC_CHECK_HEADERS(sys/socket.h) + # off_t is not a builtin type AC_CHECK_SIZEOF(off_t, 4) AS_IF([test "$ac_cv_sizeof_off_t" -eq 0],[ @@ -176,6 +211,25 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ AC_DEFINE([TIME_T_UNSIGNED], 1, [Define to 1 if time_t is unsigned]) ]) + AC_CACHE_CHECK([if system defines RUSAGE_THREAD], [ac_cv_rusage_thread],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[ +#include +#include + ]],[[ + int x= RUSAGE_THREAD; + ]]) + ],[ + ac_cv_rusage_thread=yes + ],[ + ac_cv_rusage_thread=no + ]) + ]) + AS_IF([test "$ac_cv_rusage_thread" = "no"],[ + AC_DEFINE([RUSAGE_THREAD], [RUSAGE_SELF], + [Define if system doesn't define]) + ]) + AC_CHECK_LIBM dnl Bug on FreeBSD - LIBM check doesn't set the damn variable AC_SUBST([LIBM]) @@ -201,11 +255,9 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ PANDORA_HAVE_GCC_ATOMICS m4_if(PCT_USE_VISIBILITY,[yes],[ - dnl We need to inject error into the cflags to test if visibility works or not - save_CFLAGS="${CFLAGS}" - CFLAGS="${CFLAGS} -Werror" - PANDORA_VISIBILITY - CFLAGS="${save_CFLAGS}" + PANDORA_ENABLE_VISIBILITY + ],[ + PANDORA_CHECK_VISIBILITY ]) PANDORA_HEADER_ASSERT @@ -220,10 +272,37 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ AC_CHECK_PROGS([DOXYGEN], [doxygen]) AC_CHECK_PROGS([PERL], [perl]) AC_CHECK_PROGS([DPKG_GENSYMBOLS], [dpkg-gensymbols], [:]) + AC_CHECK_PROGS([LCOV], [lcov], [echo lcov not found]) + AC_CHECK_PROGS([LCOV_GENHTML], [genhtml], [echo genhtml not found]) + + AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [:]) + AS_IF([test "x${SPHINXBUILD}" != "x:"],[ + AC_CACHE_CHECK([if sphinx is new enough],[ac_cv_recent_sphinx],[ + + ${SPHINXBUILD} -Q -C -b man -d conftest.d . . >/dev/null 2>&1 + AS_IF([test $? -eq 0],[ac_cv_recent_sphinx=yes], + [ac_cv_recent_sphinx=no]) + rm -rf conftest.d + ]) + ]) AM_CONDITIONAL(HAVE_DPKG_GENSYMBOLS,[test "x${DPKG_GENSYMBOLS}" != "x:"]) - - PANDORA_WITH_GETTEXT + AM_CONDITIONAL(HAVE_SPHINX,[test "x${SPHINXBUILD}" != "x:"]) + AM_CONDITIONAL(HAVE_RECENT_SPHINX,[test "x${ac_cv_recent_sphinx}" = "xyes"]) + + m4_if(m4_substr(m4_esyscmd(test -d po && echo 0),0,1),0, [ + AM_PO_SUBDIRS + IT_PROG_INTLTOOL([0.35],[no-xml]) + + GETTEXT_PACKAGE=$PACKAGE + AC_CHECK_LIB(intl, libintl_gettext) + AC_SUBST([GETTEXT_PACKAGE]) + AS_IF([test "x${USE_NLS}" = "xyes" -a "x${pandora_have_intltool}" = "xyes"], + [AC_DEFINE([ENABLE_NLS],[1],[Turn on language support]) + AC_CONFIG_FILES([po/Makefile.in]) + ]) + ]) + AM_CONDITIONAL(BUILD_PO,[test "x${USE_NLS}" = "xyes" -a "x${pandora_have_intltool}" = "xyes"]) AS_IF([test "x${gl_LIBOBJS}" != "x"],[ AS_IF([test "$GCC" = "yes"],[ @@ -240,6 +319,92 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ PANDORA_USE_PIPE + AH_TOP([ +#ifndef __CONFIG_H__ +#define __CONFIG_H__ + +/* _SYS_FEATURE_TESTS_H is Solaris, _FEATURES_H is GCC */ +#if defined( _SYS_FEATURE_TESTS_H) || defined(_FEATURES_H) +#error "You should include config.h as your first include file" +#endif + +#include "config/top.h" +]) + mkdir -p config + cat > config/top.h.stamp </dev/null 2>&1 || mv config/top.h.stamp config/top.h + rm -f config/top.h.stamp + + AH_BOTTOM([ +#if defined(__cplusplus) +# include CSTDINT_H +# include CINTTYPES_H +#else +# include +# include +#endif + +#if !defined(HAVE_ULONG) && !defined(__USE_MISC) +# define HAVE_ULONG 1 +typedef unsigned long int ulong; +#endif + +/* To hide the platform differences between MS Windows and Unix, I am + * going to use the Microsoft way and #define the Microsoft-specific + * functions to the unix way. Microsoft use a separate subsystem for sockets, + * but Unix normally just use a filedescriptor on the same functions. It is + * a lot easier to map back to the unix way with macros than going the other + * way without side effect ;-) + */ +#ifdef TARGET_OS_WINDOWS +#define random() rand() +#define srandom(a) srand(a) +#define get_socket_errno() WSAGetLastError() +#else +#define INVALID_SOCKET -1 +#define SOCKET_ERROR -1 +#define closesocket(a) close(a) +#define get_socket_errno() errno +#endif + +#if defined(__cplusplus) +# if defined(DEBUG) +# include +# include +# endif +template +inline To implicit_cast(From const &f) { + return f; +} +template // use like this: down_cast(foo); +inline To down_cast(From* f) { // so we only accept pointers + // Ensures that To is a sub-type of From *. This test is here only + // for compile-time type checking, and has no overhead in an + // optimized build at run-time, as it will be optimized away + // completely. + if (false) { + implicit_cast(0); + } + +#if defined(DEBUG) + assert(f == NULL || dynamic_cast(f) != NULL); // RTTI: debug mode only! +#endif + return static_cast(f); +} +#endif /* defined(__cplusplus) */ + +#endif /* __CONFIG_H__ */ + ]) AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}" AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}" diff --git a/m4/pandora_check_compiler_version.m4 b/m4/pandora_check_compiler_version.m4 index ab7c6718..f39174ed 100644 --- a/m4/pandora_check_compiler_version.m4 +++ b/m4/pandora_check_compiler_version.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_check_cxx_standard.m4 b/m4/pandora_check_cxx_standard.m4 index 6a88a31f..a5f0cca3 100644 --- a/m4/pandora_check_cxx_standard.m4 +++ b/m4/pandora_check_cxx_standard.m4 @@ -1,10 +1,10 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([PANDORA_CHECK_CXX_STANDARD],[ - AC_REQUIRE([AC_CXX_COMPILE_STDCXX_0X]) + dnl AC_REQUIRE([AC_CXX_COMPILE_STDCXX_0X]) AS_IF([test "$GCC" = "yes"], [AS_IF([test "$ac_cv_cxx_compile_cxx0x_native" = "yes"],[], [AS_IF([test "$ac_cv_cxx_compile_cxx0x_gxx" = "yes"], diff --git a/m4/pandora_compile_stdcxx_0x.m4 b/m4/pandora_compile_stdcxx_0x.m4 new file mode 100644 index 00000000..4445779a --- /dev/null +++ b/m4/pandora_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 +# +# Copying and distribution of 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 + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + typedef check> right_angle_brackets; + + int a; + decltype(a) b; + + typedef check 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 + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + typedef check> right_angle_brackets; + + int a; + decltype(a) b; + + typedef check 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 + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + typedef check> right_angle_brackets; + + int a; + decltype(a) b; + + typedef check 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/pandora_cxx_demangle.m4 b/m4/pandora_cxx_demangle.m4 index d2d9ddd5..5ae66877 100644 --- a/m4/pandora_cxx_demangle.m4 +++ b/m4/pandora_cxx_demangle.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_drizzle_build.m4 b/m4/pandora_drizzle_build.m4 index 2c7a321d..54f946f1 100644 --- a/m4/pandora_drizzle_build.m4 +++ b/m4/pandora_drizzle_build.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,11 +9,6 @@ dnl are set. AC_DEFUN([PANDORA_DRIZZLE_BUILD],[ - PANDORA_HAVE_CXX_UNORDERED - - PANDORA_CXX_CSTDINT - PANDORA_CXX_CINTTYPES - AC_STRUCT_TM AC_FUNC_ALLOCA @@ -38,7 +33,7 @@ AC_DEFUN([PANDORA_DRIZZLE_BUILD],[ AC_CHECK_HEADERS(sys/types.h sys/fpu.h fpu_control.h ieeefp.h) AC_CHECK_HEADERS(select.h sys/select.h) AC_CHECK_HEADERS(utime.h sys/utime.h ) - AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h) + AC_CHECK_HEADERS(synch.h sys/mman.h) AC_CHECK_HEADERS(sched.h) AC_CHECK_HEADERS(sys/prctl.h) AC_CHECK_HEADERS(execinfo.h) @@ -68,45 +63,15 @@ AC_DEFUN([PANDORA_DRIZZLE_BUILD],[ ]]) AC_CHECK_TYPES([uint, ulong]) + PANDORA_REQUIRE_BISON + PANDORA_CXX_DEMANGLE PANDORA_REQUIRE_BOOST([1.38]) PANDORA_REQUIRE_BOOST_PROGRAM_OPTIONS + PANDORA_REQUIRE_BOOST_THREAD + PANDORA_REQUIRE_BOOST_REGEX + PANDORA_REQUIRE_BOOST_DATE_TIME + PANDORA_REQUIRE_BOOST_FILESYSTEM + PANDORA_REQUIRE_BOOST_IOSTREAMS - - AH_TOP([ -#ifndef __CONFIG_H__ -#define __CONFIG_H__ - -#include "config/top.h" -]) - mkdir -p config - cat > config/top.h.stamp </dev/null 2>&1 || mv config/top.h.stamp config/top.h - rm -f config/top.h.stamp - - - AH_BOTTOM([ -#if defined(__cplusplus) -# include CSTDINT_H -# include CINTTYPES_H -#else -# include -# include -#endif - -#if !defined(HAVE_ULONG) && !defined(__USE_MISC) -typedef unsigned long int ulong; -#endif - -#endif /* __CONFIG_H__ */ - ]) ]) diff --git a/m4/pandora_enable_dtrace.m4 b/m4/pandora_enable_dtrace.m4 index 627fd3d0..390efc57 100644 --- a/m4/pandora_enable_dtrace.m4 +++ b/m4/pandora_enable_dtrace.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -15,7 +15,9 @@ AC_DEFUN([PANDORA_ENABLE_DTRACE],[ AS_IF([test "$ac_cv_enable_dtrace" = "yes"],[ AC_CHECK_PROGS([DTRACE], [dtrace]) - AS_IF([test "x$ac_cv_prog_DTRACE" = "xdtrace"],[ + AC_CHECK_HEADERS(sys/sdt.h) + + AS_IF([test "x$ac_cv_prog_DTRACE" = "xdtrace" -a "x${ac_cv_header_sys_sdt_h}" = "xyes"],[ AC_CACHE_CHECK([if dtrace works],[ac_cv_dtrace_works],[ cat >conftest.d <<_ACEOF diff --git a/m4/pandora_ensure_gcc_version.m4 b/m4/pandora_ensure_gcc_version.m4 index 588fa442..9d2f65d3 100644 --- a/m4/pandora_ensure_gcc_version.m4 +++ b/m4/pandora_ensure_gcc_version.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_extensions.m4 b/m4/pandora_extensions.m4 index ee73b804..b2720eff 100644 --- a/m4/pandora_extensions.m4 +++ b/m4/pandora_extensions.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_fdatasync.m4 b/m4/pandora_fdatasync.m4 index 3a17c18d..e8bba25c 100644 --- a/m4/pandora_fdatasync.m4 +++ b/m4/pandora_fdatasync.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_flex.m4 b/m4/pandora_flex.m4 new file mode 100644 index 00000000..0fb2f81c --- /dev/null +++ b/m4/pandora_flex.m4 @@ -0,0 +1,33 @@ +dnl Copyright (C) 2010 Monty Taylor +dnl Copyright (C) 2010 Hartmut Holzgraefe +dnl This file is free software; Monty Taylor and Hartmut Holzgraefe +dnl give unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([_PANDORA_SEARCH_FLEX],[ + + dnl -------------------------------------------------------------------- + dnl Check for flex + dnl -------------------------------------------------------------------- + + AC_CHECK_PROGS([LEX], ['flex'], [:]) + AS_IF([test "x$LEX" = "x:"],[ + pandora_have_flex=no + LEX='if test -f "$@"; then echo "WARNING: no proper flex binary found, ignoring changes to $<"; exit 0; else echo "ERROR: no proper flex binary found"; exit 1; fi;' + ],[ + pandora_have_flex=yes + ]) + + AM_CONDITIONAL(HAVE_FLEX, [test "x${pandora_have_flex}" = "xyes"]) +]) + +AC_DEFUN([PANDORA_HAVE_FLEX],[ + AC_REQUIRE([_PANDORA_SEARCH_FLEX]) +]) + +AC_DEFUN([PANDORA_REQUIRE_FLEX],[ + AC_REQUIRE([PANDORA_HAVE_FLEX]) + AS_IF([test "x${pandora_have_flex}" = "xno" -a "$pandora_building_from_bzr" = "yes"], + AC_MSG_ERROR(["flex is required for ${PACKAGE} to build from a bzr branch"]) + ) +]) diff --git a/m4/pandora_have_better_malloc.m4 b/m4/pandora_have_better_malloc.m4 index 6f46ee9a..c984cbaf 100644 --- a/m4/pandora_have_better_malloc.m4 +++ b/m4/pandora_have_better_malloc.m4 @@ -1,11 +1,9 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([PANDORA_HAVE_BETTER_MALLOC],[ - AC_REQUIRE([AC_FUNC_MALLOC]) - AC_REQUIRE([AC_FUNC_REALLOC]) AC_REQUIRE([AC_LIB_PREFIX]) AC_ARG_ENABLE([umem], diff --git a/m4/pandora_have_boost.m4 b/m4/pandora_have_boost.m4 index 67ee1b0b..2a571dbb 100644 --- a/m4/pandora_have_boost.m4 +++ b/m4/pandora_have_boost.m4 @@ -19,11 +19,10 @@ AC_DEFUN([_PANDORA_SEARCH_BOOST],[ AS_IF([test "x$ac_enable_boost" = "xyes"],[ dnl link against libc because we're just looking for headers here AC_LANG_PUSH(C++) - AC_LIB_HAVE_LINKFLAGS(c,,[ - #include - ],[ - boost::pool<> test_pool(1); - ]) + AC_LIB_HAVE_LINKFLAGS(c,, + [#include ], + [boost::pool<> test_pool(1);], + [system]) AC_LANG_POP() ],[ ac_cv_boost="no" @@ -55,7 +54,28 @@ AC_DEFUN([_PANDORA_SEARCH_BOOST],[ ac_cv_boost=no ]) ]) - + + AS_IF([test "x${ac_gcc_profile_mode}" = "xyes"],[ + AC_CACHE_CHECK([if boost is recent enough for GCC Profile Mode], + [pandora_cv_boost_profile],[ + pandora_need_boost_version=104300 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include + +#if BOOST_VERSION < ${pandora_need_boost_version} +# error boost too old! +#endif + ]],[[]]) + ],[ + pandora_cv_boost_profile=yes + ],[ + pandora_cv_boost_profile=no + ]) + ]) + AS_IF([test "x${pandora_cv_boost_profile}" = "xyes"],[ + AC_DEFINE([BOOST_DETAIL_NO_CONTAINER_FWD],[1],[Disable forward decl of stl in boost]) + ]) + ]) AM_CONDITIONAL(HAVE_BOOST, [test "x${ac_cv_boost}" = "xyes"]) diff --git a/m4/pandora_have_gcc_atomics.m4 b/m4/pandora_have_gcc_atomics.m4 index 47257d6a..a106895f 100644 --- a/m4/pandora_have_gcc_atomics.m4 +++ b/m4/pandora_have_gcc_atomics.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libavahi.m4 b/m4/pandora_have_libavahi.m4 index 72c274f7..b32432dc 100644 --- a/m4/pandora_have_libavahi.m4 +++ b/m4/pandora_have_libavahi.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libbdb.m4 b/m4/pandora_have_libbdb.m4 index 3e2d1446..443d3cc2 100644 --- a/m4/pandora_have_libbdb.m4 +++ b/m4/pandora_have_libbdb.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libboost_date_time.m4 b/m4/pandora_have_libboost_date_time.m4 new file mode 100644 index 00000000..71c3efe3 --- /dev/null +++ b/m4/pandora_have_libboost_date_time.m4 @@ -0,0 +1,46 @@ +dnl Copyright (C) 2010 Monty Taylor +dnl This file is free software; Monty Taylor +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([_PANDORA_SEARCH_BOOST_DATE_TIME],[ + AC_REQUIRE([AC_LIB_PREFIX]) + AC_REQUIRE([ACX_PTHREAD]) + + dnl -------------------------------------------------------------------- + dnl Check for Boost.Date_Time + dnl -------------------------------------------------------------------- + + AC_LANG_PUSH(C++) + AC_LIB_HAVE_LINKFLAGS(boost_date_time-mt,,[ + #include + ],[ + boost::gregorian::date weekstart(2002,2,1); + ]) + AS_IF([test "x${ac_cv_libboost_date_time_mt}" = "xno"],[ + AC_LIB_HAVE_LINKFLAGS(boost_date_time,,[ + #include + ],[ + boost::gregorian::date weekstart(2002,2,1); + ]) + ]) + AC_LANG_POP() + + AM_CONDITIONAL(HAVE_BOOST_DATE_TIME, + [test "x${ac_cv_libboost_date_time}" = "xyes" -o "x${ac_cv_libboost_date_time_mt}" = "xyes"]) + BOOST_LIBS="${BOOST_LIBS} ${LTLIBBOOST_DATE_TIME_MT} ${LTLIBBOOST_DATE_TIME}" + AC_SUBST(BOOST_LIBS) +]) + +AC_DEFUN([PANDORA_HAVE_BOOST_DATE_TIME],[ + PANDORA_HAVE_BOOST($1) + _PANDORA_SEARCH_BOOST_DATE_TIME($1) +]) + +AC_DEFUN([PANDORA_REQUIRE_BOOST_DATE_TIME],[ + PANDORA_REQUIRE_BOOST($1) + _PANDORA_SEARCH_BOOST_DATE_TIME($1) + AS_IF([test "x${ac_cv_libboost_date_time}" = "xno" -a "x${ac_cv_libboost_date_time_mt}" = "xno"], + AC_MSG_ERROR([Boost.Date_Time is required for ${PACKAGE}])) +]) + diff --git a/m4/pandora_have_libboost_filesystem.m4 b/m4/pandora_have_libboost_filesystem.m4 new file mode 100644 index 00000000..6b9ecba5 --- /dev/null +++ b/m4/pandora_have_libboost_filesystem.m4 @@ -0,0 +1,45 @@ +dnl Copyright (C) 2010 Monty Taylor +dnl This file is free software; Monty Taylor +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([_PANDORA_SEARCH_BOOST_FILESYSTEM],[ + AC_REQUIRE([AC_LIB_PREFIX]) + + dnl -------------------------------------------------------------------- + dnl Check for Boost.Filesystem + dnl -------------------------------------------------------------------- + + AC_LANG_PUSH(C++) + AC_LIB_HAVE_LINKFLAGS(boost_filesystem-mt,boost_system-mt,[ + #include + ],[ + boost::filesystem::path my_path("some_dir/file.txt"); + ]) + AS_IF([test "x${ac_cv_libboost_filesystem_mt}" = "xno"],[ + AC_LIB_HAVE_LINKFLAGS(boost_filesystem,boost_system,[ + #include + ],[ + boost::filesystem::path my_path("some_dir/file.txt"); + ]) + ]) + AC_LANG_POP() + + AM_CONDITIONAL(HAVE_BOOST_FILESYSTEM, + [test "x${ac_cv_libboost_filesystem}" = "xyes" -o "x${ac_cv_libboost_filesystem_mt}" = "xyes"]) + BOOST_LIBS="${BOOST_LIBS} ${LTLIBBOOST_FILESYSTEM_MT} ${LTLIBBOOST_FILESYSTEM}" + AC_SUBST(BOOST_LIBS) +]) + +AC_DEFUN([PANDORA_HAVE_BOOST_FILESYSTEM],[ + PANDORA_HAVE_BOOST($1) + _PANDORA_SEARCH_BOOST_FILESYSTEM($1) +]) + +AC_DEFUN([PANDORA_REQUIRE_BOOST_FILESYSTEM],[ + PANDORA_REQUIRE_BOOST($1) + _PANDORA_SEARCH_BOOST_FILESYSTEM($1) + AS_IF([test "x${ac_cv_libboost_filesystem}" = "xno" -a "x${ac_cv_libboost_filesystem_mt}" = "xno"], + AC_MSG_ERROR([Boost.Filesystem is required for ${PACKAGE}])) +]) + diff --git a/m4/pandora_have_libboost_iostreams.m4 b/m4/pandora_have_libboost_iostreams.m4 new file mode 100644 index 00000000..e9ac7b6e --- /dev/null +++ b/m4/pandora_have_libboost_iostreams.m4 @@ -0,0 +1,49 @@ +dnl Copyright (C) 2010 Andrew Hutchings +dnl This file is free software; Andrew Hutchings +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([_PANDORA_SEARCH_BOOST_IOSTREAMS],[ + AC_REQUIRE([AC_LIB_PREFIX]) + + dnl -------------------------------------------------------------------- + dnl Check for Boost.Iostreams + dnl -------------------------------------------------------------------- + + AC_LANG_PUSH(C++) + AC_LIB_HAVE_LINKFLAGS(boost_iostreams-mt,,[ + #include + #include + ],[ + const char* input= "hello world"; + boost::iostreams::stream in(input, strlen(input)); + ]) + AS_IF([test "x${ac_cv_libboost_iostreams_mt}" = "xno"],[ + AC_LIB_HAVE_LINKFLAGS(boost_iostreams,,[ + #include + #include + ],[ + const char* input= "hello world"; + boost::iostreams::stream in(input, strlen(input)); + ]) + ]) + AC_LANG_POP() + + AM_CONDITIONAL(HAVE_BOOST_IOSTREAMS, + [test "x${ac_cv_libboost_iostreams}" = "xyes" -o "x${ac_cv_libboost_iostreams_mt}" = "xyes"]) + BOOST_LIBS="${BOOST_LIBS} ${LTLIBBOOST_IOSTREAMS_MT} ${LTLIBBOOST_IOSTREAMS}" + AC_SUBST(BOOST_LIBS) +]) + +AC_DEFUN([PANDORA_HAVE_BOOST_IOSTREAMS],[ + PANDORA_HAVE_BOOST($1) + _PANDORA_SEARCH_BOOST_IOSTREAMS($1) +]) + +AC_DEFUN([PANDORA_REQUIRE_BOOST_IOSTREAMS],[ + PANDORA_REQUIRE_BOOST($1) + _PANDORA_SEARCH_BOOST_IOSTREAMS($1) + AS_IF([test "x${ac_cv_libboost_iostreams}" = "xno" -a "x${ac_cv_libboost_iostreams_mt}" = "xno"], + AC_MSG_ERROR([Boost.Iostreams is required for ${PACKAGE}])) +]) + diff --git a/m4/pandora_have_libboost_regex.m4 b/m4/pandora_have_libboost_regex.m4 new file mode 100644 index 00000000..50a496ac --- /dev/null +++ b/m4/pandora_have_libboost_regex.m4 @@ -0,0 +1,54 @@ +dnl Copyright (C) 2010 Andrew Hutchings +dnl This file is free software; Andrew Hutchings +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([_PANDORA_SEARCH_BOOST_REGEX],[ + AC_REQUIRE([AC_LIB_PREFIX]) + AC_REQUIRE([ACX_PTHREAD]) + + dnl -------------------------------------------------------------------- + dnl Check for boost::regex + dnl -------------------------------------------------------------------- + + save_CFLAGS="${CFLAGS}" + save_CXXFLAGS="${CXXFLAGS}" + CFLAGS="${PTHREAD_CFLAGS} ${CFLAGS}" + CXXFLAGS="${PTHREAD_CFLAGS} ${CXXFLAGS}" + + AC_LANG_PUSH(C++) + AC_LIB_HAVE_LINKFLAGS(boost_regex-mt,,[ + #include + ],[ + boost::regex test_regex("drizzle"); + ]) + AS_IF([test "x${ac_cv_libboost_regex_mt}" = "xno"],[ + AC_LIB_HAVE_LINKFLAGS(boost_regex,,[ + #include + ],[ + boost::regex test_regex("drizzle"); + ]) + ]) + AC_LANG_POP() + CFLAGS="${save_CFLAGS}" + CXXFLAGS="${save_CXXFLAGS}" + + + AM_CONDITIONAL(HAVE_BOOST_REGEX, + [test "x${ac_cv_libboost_regex}" = "xyes" -o "x${ac_cv_libboost_regex_mt}" = "xyes"]) + BOOST_LIBS="${BOOST_LIBS} ${LTLIBBOOST_REGEX_MT} ${LTLIBBOOST_REGEX}" + AC_SUBST(BOOST_LIBS) +]) + +AC_DEFUN([PANDORA_HAVE_BOOST_REGEX],[ + PANDORA_HAVE_BOOST($1) + _PANDORA_SEARCH_BOOST_REGEX($1) +]) + +AC_DEFUN([PANDORA_REQUIRE_BOOST_REGEX],[ + PANDORA_REQUIRE_BOOST($1) + _PANDORA_SEARCH_BOOST_REGEX($1) + AS_IF([test "x${ac_cv_libboost_regex}" = "xno" -a "x${ac_cv_libboost_regex_mt}" = "xno"], + AC_MSG_ERROR([boost::regex is required for ${PACKAGE}])) +]) + diff --git a/m4/pandora_have_libboost_thread.m4 b/m4/pandora_have_libboost_thread.m4 new file mode 100644 index 00000000..e3359fb3 --- /dev/null +++ b/m4/pandora_have_libboost_thread.m4 @@ -0,0 +1,54 @@ +dnl Copyright (C) 2010 Monty Taylor +dnl This file is free software; Monty Taylor +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([_PANDORA_SEARCH_BOOST_THREAD],[ + AC_REQUIRE([AC_LIB_PREFIX]) + AC_REQUIRE([ACX_PTHREAD]) + + dnl -------------------------------------------------------------------- + dnl Check for boost::thread + dnl -------------------------------------------------------------------- + + save_CFLAGS="${CFLAGS}" + save_CXXFLAGS="${CXXFLAGS}" + CFLAGS="${PTHREAD_CFLAGS} ${CFLAGS}" + CXXFLAGS="${PTHREAD_CFLAGS} ${CXXFLAGS}" + + AC_LANG_PUSH(C++) + AC_LIB_HAVE_LINKFLAGS(boost_thread-mt,,[ + #include + ],[ + boost::thread id; + ]) + AS_IF([test "x${ac_cv_libboost_thread_mt}" = "xno"],[ + AC_LIB_HAVE_LINKFLAGS(boost_thread,,[ + #include + ],[ + boost::thread id; + ]) + ]) + AC_LANG_POP() + CFLAGS="${save_CFLAGS}" + CXXFLAGS="${save_CXXFLAGS}" + + + AM_CONDITIONAL(HAVE_BOOST_THREAD, + [test "x${ac_cv_libboost_thread}" = "xyes" -o "x${ac_cv_libboost_thread_mt}" = "xyes"]) + BOOST_LIBS="${BOOST_LIBS} ${LTLIBBOOST_THREAD_MT} ${LTLIBBOOST_THREAD}" + AC_SUBST(BOOST_LIBS) +]) + +AC_DEFUN([PANDORA_HAVE_BOOST_THREAD],[ + PANDORA_HAVE_BOOST($1) + _PANDORA_SEARCH_BOOST_THREAD($1) +]) + +AC_DEFUN([PANDORA_REQUIRE_BOOST_THREAD],[ + PANDORA_REQUIRE_BOOST($1) + _PANDORA_SEARCH_BOOST_THREAD($1) + AS_IF([test "x${ac_cv_libboost_thread}" = "xno" -a "x${ac_cv_libboost_thread_mt}" = "xno"], + AC_MSG_ERROR([boost::thread is required for ${PACKAGE}])) +]) + diff --git a/m4/pandora_have_libcurl.m4 b/m4/pandora_have_libcurl.m4 new file mode 100644 index 00000000..d86ee3e5 --- /dev/null +++ b/m4/pandora_have_libcurl.m4 @@ -0,0 +1,62 @@ +dnl Copyright (C) 2010 Monty Taylor +dnl This file is free software; Monty Taylor +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([_PANDORA_SEARCH_LIBCURL],[ + AC_REQUIRE([AC_LIB_PREFIX]) + + dnl -------------------------------------------------------------------- + dnl Check for libcurl + dnl -------------------------------------------------------------------- + + AC_ARG_ENABLE([libcurl], + [AS_HELP_STRING([--disable-libcurl], + [Build with libcurl support @<:@default=on@:>@])], + [ac_enable_libcurl="$enableval"], + [ac_enable_libcurl="yes"]) + + AS_IF([test "x$ac_enable_libcurl" = "xyes"],[ + AC_LIB_HAVE_LINKFLAGS(curl,, + [#include ], + [ + CURL *handle; + handle=curl_easy_init(); + ]) + ],[ + ac_cv_libcurl="no" + ]) + + AC_CACHE_CHECK([if libcurl has CURLOPT_USERNAME], + [pandora_cv_curl_have_username],[ + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM( + [[ + CURL *handle; + handle=curl_easy_init(); + rv= curl_easy_setopt(curl_handle, CURLOPT_USERNAME, "foo"); + ]])], + [pandora_cv_curl_have_username=yes], + [pandora_cv_curl_have_username=no]) + ]) + + AM_CONDITIONAL(HAVE_LIBCURL,[test "x${ac_cv_libcurl}" = "xyes"]) + AS_IF([test "x$pandora_cv_curl_have_username" = "xyes"], + AC_DEFINE([HAVE_CURLOPT_USERNAME],[1], + [Does libcurl provide the CURLOPT_USERNAME constant])) + +]) + +AC_DEFUN([PANDORA_HAVE_LIBCURL],[ + AC_REQUIRE([_PANDORA_SEARCH_LIBCURL]) + AS_IF([test "x${ac_cv_libcurl}" = "xno"],[ + AC_MSG_WARN([libcurl development lib not found. On Debian this is found in libcurl4-gnutls-dev. On RHEL5/Fedora11 it's in curl-devel. On RHEL6/Fedora12 it's in libcurl-devel.]) + ]) +]) + +AC_DEFUN([PANDORA_REQUIRE_LIBCURL],[ + PANDORA_HAVE_LIBCURL($1) + AS_IF([test "x${ac_cv_libcurl}" = "xno"],[ + AC_MSG_ERROR([libcurl is required for ${PACKAGE}]) + ]) +]) diff --git a/m4/pandora_have_libdl.m4 b/m4/pandora_have_libdl.m4 index 1317ee9d..dde71638 100644 --- a/m4/pandora_have_libdl.m4 +++ b/m4/pandora_have_libdl.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libdrizzle.m4 b/m4/pandora_have_libdrizzle.m4 index 58763c1b..bdd4b6a8 100644 --- a/m4/pandora_have_libdrizzle.m4 +++ b/m4/pandora_have_libdrizzle.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libevent.m4 b/m4/pandora_have_libevent.m4 index 87e5a89d..c7a6c645 100644 --- a/m4/pandora_have_libevent.m4 +++ b/m4/pandora_have_libevent.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libgearman.m4 b/m4/pandora_have_libgearman.m4 index d66a9e45..2eeb34fa 100644 --- a/m4/pandora_have_libgearman.m4 +++ b/m4/pandora_have_libgearman.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libgtest.m4 b/m4/pandora_have_libgtest.m4 index f21c7ef4..fe269fb1 100644 --- a/m4/pandora_have_libgtest.m4 +++ b/m4/pandora_have_libgtest.m4 @@ -18,6 +18,8 @@ AC_DEFUN([_PANDORA_SEARCH_LIBGTEST],[ AS_IF([test "x$ac_enable_libgtest" = "xyes"],[ AC_LANG_PUSH(C++) + save_CXXFLAGS="${CXXFLAGS}" + CXXFLAGS="${AM_CXXFLAGS} ${CXXFLAGS}" AC_LIB_HAVE_LINKFLAGS(gtest,,[ #include TEST(pandora_test_libgtest, PandoraTest) @@ -25,6 +27,7 @@ TEST(pandora_test_libgtest, PandoraTest) ASSERT_EQ(1, 1); } ],[]) + CXXFLAGS="${save_CXXFLAGS}" AC_LANG_POP() ],[ ac_cv_libgtest="no" diff --git a/m4/pandora_have_libhaildb.m4 b/m4/pandora_have_libhaildb.m4 new file mode 100644 index 00000000..56f71ccc --- /dev/null +++ b/m4/pandora_have_libhaildb.m4 @@ -0,0 +1,43 @@ +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([_PANDORA_SEARCH_LIBHAILDB],[ + AC_REQUIRE([AC_LIB_PREFIX]) + + dnl -------------------------------------------------------------------- + dnl Check for libhaildb + dnl -------------------------------------------------------------------- + + AC_ARG_ENABLE([libhaildb], + [AS_HELP_STRING([--disable-libhaildb], + [Build with libhaildb support @<:@default=on@:>@])], + [ac_enable_libhaildb="$enableval"], + [ac_enable_libhaildb="yes"]) + + + AS_IF([test "x$ac_enable_libhaildb" = "xyes"],[ + AC_LIB_HAVE_LINKFLAGS(haildb,,[ + #include + ],[ + ib_set_panic_handler(NULL); + ]) + AS_IF([test "x${ac_cv_libhaildb}" = "xyes"],[ + AC_DEFINE([HAVE_HAILDB_H],[1],[Do we have haildb.h]) + ]) + ],[ + ac_cv_libhaildb="no" + ]) + AM_CONDITIONAL(HAVE_LIBHAILDB, [test "x${ac_cv_libhaildb}" = "xyes"]) +]) + +AC_DEFUN([PANDORA_HAVE_LIBHAILDB],[ + AC_REQUIRE([_PANDORA_SEARCH_LIBHAILDB]) +]) + +AC_DEFUN([PANDORA_REQUIRE_LIBHAILDB],[ + AC_REQUIRE([PANDORA_HAVE_LIBHAILDB]) + AS_IF([test "x${ac_cv_libhaildb}" = "xno"], + AC_MSG_ERROR([libhaildb 2.2.0 or later is required for ${PACKAGE}])) +]) diff --git a/m4/pandora_have_libldap.m4 b/m4/pandora_have_libldap.m4 index b3f2f106..7533e856 100644 --- a/m4/pandora_have_libldap.m4 +++ b/m4/pandora_have_libldap.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libmemcached.m4 b/m4/pandora_have_libmemcached.m4 index 8b20afac..a281306b 100644 --- a/m4/pandora_have_libmemcached.m4 +++ b/m4/pandora_have_libmemcached.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libpcre.m4 b/m4/pandora_have_libpcre.m4 index 64c649b0..bfa733a1 100644 --- a/m4/pandora_have_libpcre.m4 +++ b/m4/pandora_have_libpcre.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libpq.m4 b/m4/pandora_have_libpq.m4 index 3812dc59..28675d1a 100644 --- a/m4/pandora_have_libpq.m4 +++ b/m4/pandora_have_libpq.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libreadline.m4 b/m4/pandora_have_libreadline.m4 index bc739d5d..b49e97dd 100644 --- a/m4/pandora_have_libreadline.m4 +++ b/m4/pandora_have_libreadline.m4 @@ -56,8 +56,8 @@ # # COPYLEFT # -# Copyright (c) 2009 Monty Taylor -# Copyright (c) 2002 Ville Laurikari +# Copyright (C) 2009 Monty Taylor +# Copyright (C) 2002 Ville Laurikari # # Copying and distribution of this file, with or without # modification, are permitted in any medium without royalty provided diff --git a/m4/pandora_have_libsqlite3.m4 b/m4/pandora_have_libsqlite3.m4 index 15e0195c..c1120332 100644 --- a/m4/pandora_have_libsqlite3.m4 +++ b/m4/pandora_have_libsqlite3.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libtokyocabinet.m4 b/m4/pandora_have_libtokyocabinet.m4 index eb0062d5..91906a7c 100644 --- a/m4/pandora_have_libtokyocabinet.m4 +++ b/m4/pandora_have_libtokyocabinet.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libuuid.m4 b/m4/pandora_have_libuuid.m4 index 5ba66d78..f1c583e6 100644 --- a/m4/pandora_have_libuuid.m4 +++ b/m4/pandora_have_libuuid.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libxml2.m4 b/m4/pandora_have_libxml2.m4 index eabd0f3a..76c5805c 100644 --- a/m4/pandora_have_libxml2.m4 +++ b/m4/pandora_have_libxml2.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_libz.m4 b/m4/pandora_have_libz.m4 index 823cb4ef..6122120a 100644 --- a/m4/pandora_have_libz.m4 +++ b/m4/pandora_have_libz.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_have_protobuf.m4 b/m4/pandora_have_protobuf.m4 index 068c6762..47f4cd4a 100644 --- a/m4/pandora_have_protobuf.m4 +++ b/m4/pandora_have_protobuf.m4 @@ -23,7 +23,9 @@ AC_DEFUN([_PANDORA_SEARCH_LIBPROTOBUF],[ [#include ], [google::protobuf::FileDescriptor* file;], [system]) - CXXFLAGS="${save_CXXFLAGS}" + CXXFLAGS="${PTHREAD_CFLAGS} ${save_CXXFLAGS}" + LIBPROTOBUF="${LIBPROTOBUF} ${PTHREAD_LIBS}" + LTLIBPROTOBUF="${LTLIBPROTOBUF} ${PTHREAD_LIBS}" AC_LANG_POP() ]) diff --git a/m4/pandora_have_sasl.m4 b/m4/pandora_have_sasl.m4 index 75513d12..ca4a21dc 100644 --- a/m4/pandora_have_sasl.m4 +++ b/m4/pandora_have_sasl.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_header_assert.m4 b/m4/pandora_header_assert.m4 index 1bd95eb5..2fdf9d4c 100644 --- a/m4/pandora_header_assert.m4 +++ b/m4/pandora_header_assert.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_header_stdcxx_98.m4 b/m4/pandora_header_stdcxx_98.m4 new file mode 100644 index 00000000..130daecd --- /dev/null +++ b/m4/pandora_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 +# +# Copying and distribution of 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 + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + ],, + 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/pandora_intltool.m4 b/m4/pandora_intltool.m4 new file mode 100644 index 00000000..b3e70625 --- /dev/null +++ b/m4/pandora_intltool.m4 @@ -0,0 +1,225 @@ +## intltool.m4 - Configure intltool for the target system. -*-Shell-script-*- +## Copyright (C) 2001 Eazel, Inc. +## Author: Maciej Stachowiak +## Kenneth Christiansen +## +## 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, write to the Free Software +## Foundation, Inc., 51 Franklin Place - Suite 330, Boston, MA 02110-1301, USA. +## +## As a special exception to the GNU General Public License, if you +## distribute this file as part of a program that contains a +## configuration script generated by Autoconf, you may include it under +## the same distribution terms that you use for the rest of that program. + +dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) +# serial 40 IT_PROG_INTLTOOL +AC_DEFUN([IT_PROG_INTLTOOL], [ +AC_PREREQ([2.50])dnl +AC_REQUIRE([AM_NLS])dnl + +case "$am__api_version" in + 1.[01234]) + AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) + ;; + *) + ;; +esac + +if test -n "$1"; then + AC_MSG_CHECKING([for intltool >= $1]) + + INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` + [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + ] + AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) + AS_IF([test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT"],[ + pandora_have_intltool=yes + ],[ + pandora_have_intltool=no + AC_MSG_WARN([Your intltool is too old. You need intltool $1 or later.]) + ]) +fi +AC_CHECK_HEADERS([libintl.h]) +AS_IF([test "x${ac_cv_header_libintl_h}" = "xfalse" -o "x${ac_cv_header_libintl_h}" = "xno"],[ + pandora_have_intltool=no +]) + +AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update]) +AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge]) +AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract]) +if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then + AC_MSG_WARN([The intltool scripts were not found. Please install intltool.]) + AC_MSG_WARN([On Debian: apt-get install intltool. On Redhat: yum install intltool]) +fi + + INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' +INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@' + INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' +INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' + INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + +_IT_SUBST(INTLTOOL_DESKTOP_RULE) +_IT_SUBST(INTLTOOL_DIRECTORY_RULE) +_IT_SUBST(INTLTOOL_KEYS_RULE) +_IT_SUBST(INTLTOOL_PROP_RULE) +_IT_SUBST(INTLTOOL_OAF_RULE) +_IT_SUBST(INTLTOOL_PONG_RULE) +_IT_SUBST(INTLTOOL_SERVER_RULE) +_IT_SUBST(INTLTOOL_SHEET_RULE) +_IT_SUBST(INTLTOOL_SOUNDLIST_RULE) +_IT_SUBST(INTLTOOL_UI_RULE) +_IT_SUBST(INTLTOOL_XAM_RULE) +_IT_SUBST(INTLTOOL_KBD_RULE) +_IT_SUBST(INTLTOOL_XML_RULE) +_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE) +_IT_SUBST(INTLTOOL_CAVES_RULE) +_IT_SUBST(INTLTOOL_SCHEMAS_RULE) +_IT_SUBST(INTLTOOL_THEME_RULE) +_IT_SUBST(INTLTOOL_SERVICE_RULE) +_IT_SUBST(INTLTOOL_POLICY_RULE) + +# Check the gettext tools to make sure they are GNU +AC_PATH_PROG(XGETTEXT, xgettext) +AC_PATH_PROG(MSGMERGE, msgmerge) +AC_PATH_PROG(MSGFMT, msgfmt) +AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) +if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then + AC_MSG_WARN([GNU gettext tools not found; required for intltool]) +fi +xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" +mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" +mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" +if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then + AC_MSG_WARN([GNU gettext tools not found; required for intltool]) +fi + +AC_PATH_PROG(INTLTOOL_PERL, perl) +if test -z "$INTLTOOL_PERL"; then + AC_MSG_WARN([perl not found]) +fi +AC_MSG_CHECKING([for perl >= 5.8.1]) +$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 +if test $? -ne 0; then + AC_MSG_WARN([perl 5.8.1 is required for intltool]) +else + IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`" + AC_MSG_RESULT([$IT_PERL_VERSION]) +fi +if test "x$2" != "xno-xml"; then + AC_MSG_CHECKING([for XML::Parser]) + if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then + AC_MSG_RESULT([ok]) + else + AC_MSG_WARN([XML::Parser perl module is required for intltool]) + fi +fi + +# Substitute ALL_LINGUAS so we can use it in po/Makefile +AC_SUBST(ALL_LINGUAS) + +# Set DATADIRNAME correctly if it is not set yet +# (copied from glib-gettext.m4) +if test -z "$DATADIRNAME"; then + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[]], + [[extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr]])], + [DATADIRNAME=share], + [case $host in + *-*-solaris*) + dnl On Solaris, if bind_textdomain_codeset is in libc, + dnl GNU format message catalog is always supported, + dnl since both are added to the libc all together. + dnl Hence, we'd like to go with DATADIRNAME=share + dnl in this case. + AC_CHECK_FUNC(bind_textdomain_codeset, + [DATADIRNAME=share], [DATADIRNAME=lib]) + ;; + *) + [DATADIRNAME=lib] + ;; + esac]) +fi +AC_SUBST(DATADIRNAME) + +IT_PO_SUBDIR([po]) +]) + + +# IT_PO_SUBDIR(DIRNAME) +# --------------------- +# All po subdirs have to be declared with this macro; the subdir "po" is +# declared by IT_PROG_INTLTOOL. +# +AC_DEFUN([IT_PO_SUBDIR], +[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. +dnl +dnl The following CONFIG_COMMANDS should be exetuted at the very end +dnl of config.status. +AC_CONFIG_COMMANDS_PRE([ + AC_CONFIG_COMMANDS([$1/stamp-it], [ + if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then + AC_MSG_WARN([$1/Makefile.in.in was not created by intltoolize.]) + else + rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp" + >"$1/stamp-it.tmp" + [sed '/^#/d + s/^[[].*] *// + /^[ ]*$/d + '"s|^| $ac_top_srcdir/|" \ + "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" + ] + [sed '/^POTFILES =/,/[^\\]$/ { + /^POTFILES =/!d + r $1/POTFILES + } + ' "$1/Makefile.in" >"$1/Makefile"] + rm -f "$1/Makefile.tmp" + mv "$1/stamp-it.tmp" "$1/stamp-it" + fi + ]) +])dnl +]) + +# _IT_SUBST(VARIABLE) +# ------------------- +# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST +# +AC_DEFUN([_IT_SUBST], +[ +AC_SUBST([$1]) +m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) +] +) + +# deprecated macros +AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL]) +# A hint is needed for aclocal from Automake <= 1.9.4: +# AC_DEFUN([AC_PROG_INTLTOOL], ...) + diff --git a/m4/pandora_libtool.m4 b/m4/pandora_libtool.m4 index 543cbb6b..85456198 100644 --- a/m4/pandora_libtool.m4 +++ b/m4/pandora_libtool.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_optimize.m4 b/m4/pandora_optimize.m4 index 65f9cdc8..fb2cd776 100644 --- a/m4/pandora_optimize.m4 +++ b/m4/pandora_optimize.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -22,25 +22,21 @@ AC_DEFUN([PANDORA_OPTIMIZE],[ dnl with using AC_CC_STD_C99 above CC="${CC} -std=gnu99" - AM_CPPFLAGS="-ggdb3 ${AM_CPPFLAGS}" + AM_CPPFLAGS="-g ${AM_CPPFLAGS}" DEBUG_CFLAGS="-O0" DEBUG_CXXFLAGS="-O0" - OPTIMIZE_CFLAGS="-O3" - OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_CFLAGS="-O2" + OPTIMIZE_CXXFLAGS="-O2" ]) AS_IF([test "$INTELCC" = "yes"],[ - dnl Once we can use a modern autoconf, we can replace the std=gnu99 here - dnl with using AC_CC_STD_C99 above - CC="${CC} -std=c99" - AM_CPPFLAGS="-g ${AM_CPPFLAGS}" DEBUG_CFLAGS="-O0" DEBUG_CXXFLAGS="-O0" - OPTIMIZE_CFLAGS="-xHOST -O3 -no-prec-div -static" + OPTIMIZE_CFLAGS="-xHOST -O2 -no-prec-div -static" OPTIMIZE_CXXFLAGS="${OPTIMIZE_CFLAGS}" ]) diff --git a/m4/pandora_platform.m4 b/m4/pandora_platform.m4 index aaec77de..0d2f103b 100644 --- a/m4/pandora_platform.m4 +++ b/m4/pandora_platform.m4 @@ -23,11 +23,20 @@ AC_DEFUN([PANDORA_PLATFORM],[ case "$host_os" in - *solaris*|*freebsd*) + *solaris*) AS_IF([test "x${ac_cv_env_CPPFLAGS_set}" = "x"],[ CPPFLAGS="${CPPFLAGS} -I/usr/local/include" ]) + AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[ + LDFLAGS="${LDFLAGS} -L/usr/local/lib" + ]) + ;; + *freebsd*) + AS_IF([test "x${ac_cv_env_CPPFLAGS_set}" = "x"],[ + CPPFLAGS="${CPPFLAGS} -isystem /usr/local/include" + ]) + AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[ LDFLAGS="${LDFLAGS} -L/usr/local/lib" ]) @@ -50,6 +59,7 @@ AC_DEFUN([PANDORA_PLATFORM],[ *solaris*) TARGET_SOLARIS="true" PANDORA_OPTIMIZE_BITFIELD=0 + AS_IF([test "x${USE_NLS}" = "xyes"],[LIBS="${LIBS} -lintl"]) AC_SUBST(TARGET_SOLARIS) AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris]) ;; @@ -59,9 +69,26 @@ AC_DEFUN([PANDORA_PLATFORM],[ AC_DEFINE([TARGET_OS_FREEBSD], [1], [Whether we are building for FreeBSD]) AC_DEFINE([__APPLE_CC__],[1],[Workaround for bug in FreeBSD headers]) ;; - *) + *mingw32*) + TARGET_WINDOWS="true" + AC_SUBST(TARGET_WINDOWS) + AC_DEFINE([TARGET_OS_WINDOWS], [1], [Whether we are building for Windows]) + AC_DEFINE([WINVER], [WindowsXP], [Version of Windows]) + AC_DEFINE([_WIN32_WINNT], [0x0501], [Magical number to make things work]) + AC_DEFINE([EAI_SYSTEM], [11], [Another magical number]) + AH_BOTTOM([ +#ifndef HAVE_SYS_SOCKET_H +# define SHUT_RD SD_RECEIVE +# define SHUT_WR SD_SEND +# define SHUT_RDWR SD_BOTH +#endif + ]) + + LIBS="$LIBS -lwsock32 -lws2_32" + AM_CFLAGS="${AM_CFLAGS} -I\${top_srcdir}/win32/mingw -I\${top_builddir}/win32/mingw -I\${top_srcdir}/win32 -I\${top_builddir}/win32" ;; esac + AM_CONDITIONAL(BUILD_WIN32, [test "x${TARGET_WINDOWS}" = "xtrue"]) AC_SUBST(PANDORA_OPTIMIZE_BITFIELD) diff --git a/m4/pandora_plugins.m4 b/m4/pandora_plugins.m4 index 217a0968..6ee13da0 100644 --- a/m4/pandora_plugins.m4 +++ b/m4/pandora_plugins.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl-------------------------------------------------------------------- @@ -25,9 +25,14 @@ AC_DEFUN([PANDORA_PLUGINS],[ dnl Add code here to read set plugin lists and set drizzled_default_plugin_list pandora_builtin_list=`echo $pandora_builtin_list | sed 's/, *$//'` pandora_builtin_symbols_list=`echo $pandora_builtin_symbols_list | sed 's/, *$//'` + pandora_builtin_load_list=`echo $pandora_builtin_load_list | sed 's/, *$//'` + pandora_builtin_load_symbols_list=`echo $pandora_builtin_load_symbols_list | sed 's/, *$//'` AS_IF([test "x$pandora_builtin_symbols_list" = "x"], pandora_builtin_symbols_list="NULL") + AS_IF([test "x$pandora_builtin_load_symbols_list" = "x"], pandora_builtin_load_symbols_list="NULL") AC_SUBST([PANDORA_BUILTIN_LIST],[$pandora_builtin_list]) AC_SUBST([PANDORA_BUILTIN_SYMBOLS_LIST],[$pandora_builtin_symbols_list]) + AC_SUBST([PANDORA_BUILTIN_LOAD_LIST],[$pandora_builtin_load_list]) + AC_SUBST([PANDORA_BUILTIN_LOAD_SYMBOLS_LIST],[$pandora_builtin_load_symbols_list]) AC_SUBST([PANDORA_PLUGIN_LIST],[$pandora_default_plugin_list]) m4_ifval(m4_normalize([$1]),[ AC_CONFIG_FILES($*) diff --git a/m4/pandora_print_callstack.m4 b/m4/pandora_print_callstack.m4 index e28b5933..93faa83d 100644 --- a/m4/pandora_print_callstack.m4 +++ b/m4/pandora_print_callstack.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_python3_devel.m4 b/m4/pandora_python3_devel.m4 index 7712ef19..53a5ffdc 100644 --- a/m4/pandora_python3_devel.m4 +++ b/m4/pandora_python3_devel.m4 @@ -4,12 +4,12 @@ dnl dnl pandora-build: A pedantic build system dnl dnl Copyright (C) 2009 Sun Microsystems, Inc. -dnl Copyright (c) 2008 Sebastian Huber -dnl Copyright (c) 2008 Alan W. Irwin -dnl Copyright (c) 2008 Rafael Laboissiere -dnl Copyright (c) 2008 Andrew Collier -dnl Copyright (c) 2008 Matteo Settenvini -dnl Copyright (c) 2008 Horst Knorr +dnl Copyright (C) 2008 Sebastian Huber +dnl Copyright (C) 2008 Alan W. Irwin +dnl Copyright (C) 2008 Rafael Laboissiere +dnl Copyright (C) 2008 Andrew Collier +dnl Copyright (C) 2008 Matteo Settenvini +dnl Copyright (C) 2008 Horst Knorr dnl dnl This program is free software: you can redistribute it and/or modify it dnl under the terms of the GNU General Public License as published by the diff --git a/m4/pandora_run_cpplint.m4 b/m4/pandora_run_cpplint.m4 index 5099acf6..6d3e9527 100644 --- a/m4/pandora_run_cpplint.m4 +++ b/m4/pandora_run_cpplint.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_sasl.m4 b/m4/pandora_sasl.m4 index 75513d12..ca4a21dc 100644 --- a/m4/pandora_sasl.m4 +++ b/m4/pandora_sasl.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_shared_ptr.m4 b/m4/pandora_shared_ptr.m4 index 5d6e8dde..61fdf151 100644 --- a/m4/pandora_shared_ptr.m4 +++ b/m4/pandora_shared_ptr.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_vc_build.m4 b/m4/pandora_vc_build.m4 index c1a8fba5..9ae485a6 100644 --- a/m4/pandora_vc_build.m4 +++ b/m4/pandora_vc_build.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -53,6 +53,9 @@ AC_DEFUN([PANDORA_BUILDING_FROM_VC],[ PANDORA_VC_REVNO="${PANDORA_BZR_REVNO}" PANDORA_VC_REVID=`bzr log -r-1 --show-ids | grep revision-id | cut -f2 -d' ' | head -1` PANDORA_VC_BRANCH=`bzr nick` + if test "x${vcs_changelog}" = "xyes"; then + bzr log --gnu > ChangeLog + fi fi fi diff --git a/m4/pandora_version.m4 b/m4/pandora_version.m4 index 3a62798a..ee0bfb23 100644 --- a/m4/pandora_version.m4 +++ b/m4/pandora_version.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/pandora_visibility.m4 b/m4/pandora_visibility.m4 index cb68644d..a85d68b0 100644 --- a/m4/pandora_visibility.m4 +++ b/m4/pandora_visibility.m4 @@ -20,17 +20,16 @@ dnl "really only recommended for legacy code". dnl Set the variable CFLAG_VISIBILITY. dnl Defines and sets the variable HAVE_VISIBILITY. -AC_DEFUN([PANDORA_VISIBILITY], +AC_DEFUN([PANDORA_CHECK_VISIBILITY], [ AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([PANDORA_PLATFORM]) CFLAG_VISIBILITY= HAVE_VISIBILITY=0 AS_IF([test -n "$GCC"],[ AC_MSG_CHECKING([for simple visibility declarations]) AC_CACHE_VAL([gl_cv_cc_visibility], [ gl_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fvisibility=hidden" + CFLAGS="$CFLAGS -fvisibility=hidden -Werror" AC_TRY_COMPILE( [extern __attribute__((__visibility__("hidden"))) int hiddenvar; extern __attribute__((__visibility__("default"))) int exportedvar; @@ -43,15 +42,24 @@ AC_DEFUN([PANDORA_VISIBILITY], AC_MSG_RESULT([$gl_cv_cc_visibility]) if test $gl_cv_cc_visibility = yes; then CFLAG_VISIBILITY="-fvisibility=hidden" + NO_VISIBILITY="-fvisibility=default" HAVE_VISIBILITY=1 fi ]) AS_IF([test "x$SUNCC" = "xyes"],[ CFLAG_VISIBILITY="-xldscope=hidden" + NO_VISIBILITY="-xldscope=global" HAVE_VISIBILITY=1 ]) AC_SUBST([CFLAG_VISIBILITY]) + AC_SUBST([NO_VISIBILITY]) AC_SUBST([HAVE_VISIBILITY]) AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY], [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.]) ]) + +AC_DEFUN([PANDORA_ENABLE_VISIBILITY],[ + AC_REQUIRE([PANDORA_CHECK_VISIBILITY]) + AM_CFLAGS="${AM_CFLAGS} ${CFLAG_VISIBILITY}" + AM_CXXFLAGS="${AM_CXXFLAGS} ${CFLAG_VISIBILITY}" +]) diff --git a/m4/pandora_warnings.m4 b/m4/pandora_warnings.m4 index 9ee365a0..99f40c93 100644 --- a/m4/pandora_warnings.m4 +++ b/m4/pandora_warnings.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -34,6 +34,12 @@ AC_DEFUN([PANDORA_WARNINGS],[ [ac_cv_warnings_as_errors=yes], [ac_cv_warnings_as_errors=no])) + AC_ARG_ENABLE([gcc-profile-mode], + [AS_HELP_STRING([--enable-gcc-profile-mode], + [Toggle gcc profile mode @<:@default=off@:>@])], + [ac_gcc_profile_mode="$enableval"], + [ac_gcc_profile_mode="no"]) + AC_ARG_ENABLE([profiling], [AS_HELP_STRING([--enable-profiling], [Toggle profiling @<:@default=off@:>@])], @@ -87,69 +93,47 @@ AC_DEFUN([PANDORA_WARNINGS],[ F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option" ]) - AC_CACHE_CHECK([whether it is safe to use -Wconversion], - [ac_cv_safe_to_use_wconversion_], + AC_CACHE_CHECK([whether it is safe to use -floop-parallelize-all], + [ac_cv_safe_to_use_floop_parallelize_all_], [save_CFLAGS="$CFLAGS" - dnl Use -Werror here instead of ${W_FAIL} so that we don't spew - dnl conversion warnings to all the tarball folks - CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}" + CFLAGS="-floop-parallelize-all ${AM_CFLAGS} ${CFLAGS}" AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[ -#include -void foo(bool a) -{ - (void)a; -} - ]],[[ -foo(0); - ]])], - [ac_cv_safe_to_use_wconversion_=yes], - [ac_cv_safe_to_use_wconversion_=no]) + [AC_LANG_PROGRAM([],[])], + [ac_cv_safe_to_use_floop_parallelize_all_=yes], + [ac_cv_safe_to_use_floop_parallelize_all_=no]) CFLAGS="$save_CFLAGS"]) - AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"], - [W_CONVERSION="-Wconversion" - AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons], - [ac_cv_safe_to_use_Wconversion_], - [save_CFLAGS="$CFLAGS" - dnl Use -Werror here instead of ${W_FAIL} so that we don't spew - dnl conversion warnings to all the tarball folks - CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[ -#include - ]],[[ -uint16_t x= htons(80); - ]])], - [ac_cv_safe_to_use_Wconversion_=yes], - [ac_cv_safe_to_use_Wconversion_=no]) - CFLAGS="$save_CFLAGS"]) - - AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"], - [NO_CONVERSION="-Wno-conversion"]) - ]) + AS_IF([test "$ac_cv_safe_to_use_floop_parallelize_all_" = "yes"], + [ + F_LOOP_PARALLELIZE_ALL="-floop-parallelize-all" + ]) NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing" NO_SHADOW="-Wno-shadow" AS_IF([test "$INTELCC" = "yes"],[ m4_if(PW_LESS_WARNINGS,[no],[ - BASE_WARNINGS="-w1 -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual" + BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188" ],[ - BASE_WARNINGS="-w1 -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981" + dnl 2203 is like old-style-cast + dnl 1684 is like strict-aliasing + dnl 188 is about using enums as bitfields + dnl 1683 is a warning about _EXPLICIT_ casting, which we want + BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188,981,2259,2203,1683,1684" ]) CC_WARNINGS="${BASE_WARNINGS}" CXX_WARNINGS="${BASE_WARNINGS}" + PROTOSKIP_WARNINGS="-diag-disable 188,981,967,2259,1683,1684,2203" + ],[ m4_if(PW_LESS_WARNINGS,[no],[ - BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing" + BASE_WARNINGS_FULL="${W_CONVERSION} -Wstrict-aliasing" CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings" - CXX_WARNINGS_FULL="-Wold-style-cast" + CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast" NO_OLD_STYLE_CAST="-Wno-old-style-cast" NO_EFF_CXX="-Wno-effc++" ],[ - BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}" + BASE_WARNINGS_FULL="${NO_STRICT_ALIASING}" ]) AS_IF([test "${ac_cv_assert}" = "no"], @@ -169,11 +153,87 @@ uint16_t x= htons(80); [ac_cv_safe_to_use_Wextra_=no]) CFLAGS="$save_CFLAGS"]) - BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}" + BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${F_LOOP_PARALLELIZE_ALL} ${BASE_WARNINGS_FULL}" AS_IF([test "$ac_cv_safe_to_use_Wextra_" = "yes"], [BASE_WARNINGS="${BASE_WARNINGS} -Wextra"], [BASE_WARNINGS="${BASE_WARNINGS} -W"]) + AC_CACHE_CHECK([whether it is safe to use -Wformat], + [ac_cv_safe_to_use_wformat_], + [save_CFLAGS="$CFLAGS" + dnl Use -Werror here instead of ${W_FAIL} so that we don't spew + dnl conversion warnings to all the tarball folks + CFLAGS="-Wformat -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ +#include +#include +#include +void foo(); +void foo() +{ + uint64_t test_u= 0; + printf("This is a %" PRIu64 "test\n", test_u); +} + ]],[[ +foo(); + ]])], + [ac_cv_safe_to_use_wformat_=yes], + [ac_cv_safe_to_use_wformat_=no]) + CFLAGS="$save_CFLAGS"]) + AS_IF([test "$ac_cv_safe_to_use_wformat_" = "yes"],[ + BASE_WARNINGS="${BASE_WARNINGS} -Wformat -Wno-format-nonliteral -Wno-format-security" + BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wformat=2 -Wno-format-nonliteral -Wno-format-security" + ],[ + BASE_WARNINGS="${BASE_WARNINGS} -Wno-format" + BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wno-format" + ]) + + + + AC_CACHE_CHECK([whether it is safe to use -Wconversion], + [ac_cv_safe_to_use_wconversion_], + [save_CFLAGS="$CFLAGS" + dnl Use -Werror here instead of ${W_FAIL} so that we don't spew + dnl conversion warnings to all the tarball folks + CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ +#include +void foo(bool a) +{ + (void)a; +} + ]],[[ +foo(0); + ]])], + [ac_cv_safe_to_use_wconversion_=yes], + [ac_cv_safe_to_use_wconversion_=no]) + CFLAGS="$save_CFLAGS"]) + + AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"], + [W_CONVERSION="-Wconversion" + AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons], + [ac_cv_safe_to_use_Wconversion_], + [save_CFLAGS="$CFLAGS" + dnl Use -Werror here instead of ${W_FAIL} so that we don't spew + dnl conversion warnings to all the tarball folks + CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include + ]],[[ +uint16_t x= htons(80); + ]])], + [ac_cv_safe_to_use_Wconversion_=yes], + [ac_cv_safe_to_use_Wconversion_=no]) + CFLAGS="$save_CFLAGS"]) + + AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"], + [NO_CONVERSION="-Wno-conversion"]) + ]) + CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}" CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}" @@ -196,6 +256,25 @@ uint16_t x= htons(80); AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"], [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"]) + AC_CACHE_CHECK([whether it is safe to use -Wframe-larger-than], + [ac_cv_safe_to_use_Wframe_larger_than_], + [AC_LANG_PUSH(C++) + save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="-Werror -pedantic -Wframe-larger-than=32768 ${AM_CXXFLAGS}" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM( + [[ +#include + ]], [[]]) + ], + [ac_cv_safe_to_use_Wframe_larger_than_=yes], + [ac_cv_safe_to_use_Wframe_larger_than_=no]) + CXXFLAGS="$save_CXXFLAGS" + AC_LANG_POP() + ]) + AS_IF([test "$ac_cv_safe_to_use_Wframe_larger_than_" = "yes"], + [CXX_WARNINGS="${CXX_WARNINGS} -Wframe-larger-than=32768"]) + AC_CACHE_CHECK([whether it is safe to use -Wlogical-op], [ac_cv_safe_to_use_Wlogical_op_], [save_CFLAGS="$CFLAGS" @@ -333,8 +412,8 @@ inline const EnumDescriptor* GetEnumDescriptor() { CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint" ]) - CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL} ${CFLAG_VISIBILITY}" - CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL} ${CFLAG_VISIBILITY}" + CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL}" + CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL}" PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit" BOOSTSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint,hidef,wvarhidenmem" NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED" diff --git a/m4/pandora_with_memcached.m4 b/m4/pandora_with_memcached.m4 index 81fc5955..4ea906b6 100644 --- a/m4/pandora_with_memcached.m4 +++ b/m4/pandora_with_memcached.m4 @@ -1,5 +1,5 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/po.m4 b/m4/po.m4 index 0734762a..47f36a41 100644 --- a/m4/po.m4 +++ b/m4/po.m4 @@ -1,5 +1,5 @@ -# po.m4 serial 15 (gettext-0.17) -dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. +# po.m4 serial 17 (gettext-0.18) +dnl Copyright (C) 1995-2010 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. @@ -17,7 +17,7 @@ dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. -AC_PREREQ(2.50) +AC_PREREQ([2.50]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], @@ -29,7 +29,7 @@ AC_DEFUN([AM_PO_SUBDIRS], dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. - AC_SUBST([GETTEXT_MACRO_VERSION], [0.17]) + AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. @@ -41,7 +41,7 @@ AC_DEFUN([AM_PO_SUBDIRS], [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl diff --git a/m4/progtest.m4 b/m4/progtest.m4 index a56365cd..2d804ac9 100644 --- a/m4/progtest.m4 +++ b/m4/progtest.m4 @@ -1,5 +1,5 @@ -# progtest.m4 serial 4 (gettext-0.14.2) -dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. +# progtest.m4 serial 6 (gettext-0.18) +dnl Copyright (C) 1996-2003, 2005, 2008-2010 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. @@ -16,7 +16,7 @@ dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. -AC_PREREQ(2.50) +AC_PREREQ([2.50]) # Search path for a program which passes the given test. @@ -55,7 +55,7 @@ rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL(ac_cv_path_$1, +AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. @@ -84,9 +84,9 @@ ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then - AC_MSG_RESULT([$]$1) + AC_MSG_RESULT([$][$1]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi -AC_SUBST($1)dnl +AC_SUBST([$1])dnl ]) -- 2.30.2