+++ /dev/null
-AC_DEFUN([ENABLE_UTILLIB],[
- AC_ARG_ENABLE([utils],
- [AS_HELP_STRING([--disable-utils],
- [Disable libmemcachedutils @<:@default=on@:>@])],
- [BUILD_UTILLIB="$enableval"],
- [BUILD_UTILLIB="yes"])
-
- if test "x$BUILD_UTILLIB" = "xyes"; then
- if test x"$ax_pthread_ok" != "xyes"; then
- AC_MSG_ERROR([Sorry you need POSIX thread library to build libmemcachedutil.])
- fi
- AC_DEFINE([HAVE_LIBMEMCACHEDUTIL], [1], [Enables libmemcachedutil Support])
- fi
-
- AM_CONDITIONAL([BUILD_LIBMEMCACHEDUTIL],[test "x$BUILD_UTILLIB" = "xyes"])
-])
+++ /dev/null
-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_LIBDRIZZLE],[
- AC_REQUIRE([AC_LIB_PREFIX])
-
- dnl --------------------------------------------------------------------
- dnl Check for libdrizzle
- dnl --------------------------------------------------------------------
-
- AC_ARG_ENABLE([libdrizzle],
- [AS_HELP_STRING([--disable-libdrizzle],
- [Build with libdrizzle support @<:@default=on@:>@])],
- [ac_enable_libdrizzle="$enableval"],
- [ac_enable_libdrizzle="yes"])
-
- AS_IF([test "x$ac_enable_libdrizzle" = "xyes"],[
- AC_LIB_HAVE_LINKFLAGS(drizzle,,[
- #include <libdrizzle/drizzle_client.h>
- ],[
- drizzle_st drizzle;
- drizzle_version();
- ])
- ],[
- ac_cv_libdrizzle="no"
- ])
-
- AM_CONDITIONAL(HAVE_LIBDRIZZLE, [test "x${ac_cv_libdrizzle}" = "xyes"])
-])
-
-AC_DEFUN([PANDORA_HAVE_LIBDRIZZLE],[
- AC_REQUIRE([_PANDORA_SEARCH_LIBDRIZZLE])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBDRIZZLE],[
- AC_REQUIRE([PANDORA_HAVE_LIBDRIZZLE])
- AS_IF([test "x${ac_cv_libdrizzle}" = "xno"],[
- AC_MSG_ERROR([libdrizzle is required for ${PACKAGE}])
- ],[
- dnl We need at least 0.8 on Solaris non-sparc
- AS_IF([test "$target_cpu" != "sparc" -a "x${TARGET_SOLARIS}" = "xtrue"],[
- PANDORA_LIBDRIZZLE_RECENT
- ])
- ])
-])
-
-AC_DEFUN([PANDORA_LIBDRIZZLE_RECENT],[
- AC_CACHE_CHECK([if libdrizzle is recent enough],
- [pandora_cv_libdrizzle_recent],
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <libdrizzle/drizzle.h>
-drizzle_con_options_t foo= DRIZZLE_CON_EXPERIMENTAL;
- ]])],
- [pandora_cv_libdrizzle_recent=yes],
- [pandora_cv_libdrizzle_recent=no])])
- AS_IF([test "$pandora_cv_libdrizzle_recent" = "no"],[
- AC_MSG_ERROR([Your version of libdrizzle is too old. ${PACKAGE} requires at least version 0.8])
- ])
-])
+++ /dev/null
-dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
-dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
-dnl
-dnl Copyright (C) 2010 Monty Taylor
-dnl This file is free software; Sun Microsystems
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-dnl
-
-AC_DEFUN([PANDORA_WITH_MYSQL],[
- AC_ARG_WITH([mysql],
- [AS_HELP_STRING([--with-mysql=PATH],
- [path to mysql_config binary or mysql prefix dir])],
- [with_mysql=$withval],
- [with_mysql=":"])
-
- dnl There are three possibilities:
- dnl 1) nothing is given: we will search for mysql_config in PATH
- dnl 2) the location of mysql_config is given: we'll use that to determine
- dnl 3) a directory argument is given: that will be mysql_base
-
-
- dnl option 1: nothing, we need to insert something into MYSQL_CONFIG
- AS_IF([test "x$with_mysql" = "x:"],[
- AC_CHECK_PROGS(MYSQL_CONFIG,[mysql_config])
- ],[
- MYSQL_CONFIG="${with_mysql}"
- ])
-
- AC_CACHE_CHECK([for MySQL Base Location],[pandora_cv_mysql_base],[
-
- dnl option 2: something in MYSQL_CONFIG now, use that to get a base dir
- AS_IF([test -f "${MYSQL_CONFIG}" -a -x "${MYSQL_CONFIG}"],[
- pandora_cv_mysql_base=$(dirname $(MYSQL_CONFIG --include | sed 's/-I//'))
- ],[
- dnl option 1: a directory
- AS_IF([test -d $with_mysql],[pandora_cv_mysql_base=$with_mysql],[
- pandora_cv_mysql_base="not found"
- ])
- ])
- ])
-])
-
-AC_DEFUN([_PANDORA_SEARCH_LIBMYSQLCLIENT],[
- AC_REQUIRE([AC_LIB_PREFIX])
-
- AC_ARG_ENABLE([libmysqlclient],
- [AS_HELP_STRING([--disable-libmysqlclient],
- [Build with libmysqlclient support @<:@default=on@:>@])],
- [ac_enable_libmysqlclient="$enableval"],
- [ac_enable_libmysqlclient="yes"])
-
- AS_IF([test "x$ac_enable_libmysqlclient" = "xyes"],[
- AC_LIB_HAVE_LINKFLAGS(mysqlclient_r,,[
-#include <mysql/mysql.h>
- ],[
-MYSQL mysql;
- ])],[
- ac_cv_libmysqlclient_r="no"
- ])
-
- AM_CONDITIONAL(HAVE_LIBMYSQLCLIENT, [test "x${ac_cv_libmysqlclient_r}" = "xyes"])
-
-AC_DEFUN([PANDORA_HAVE_LIBMYSQLCLIENT],[
- AC_REQUIRE([_PANDORA_SEARCH_LIBMYSQLCLIENT])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBMYSQLCLIENT],[
- AC_REQUIRE([PANDORA_HAVE_LIBMYSQLCLIENT])
- AS_IF([test "x${ac_cv_libmysqlclient_r}" = "xno"],
- AC_MSG_ERROR([libmysqlclient_r is required for ${PACKAGE}]))
-])
-
- AS_IF([test "x$MYSQL_CONFIG" = "xISDIR"],[
- IBASE="-I${with_mysql}"
- MYSQL_CONFIG="${with_mysql}/scripts/mysql_config"
- ADDIFLAGS="$IBASE/include "
- ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb/include/ndbapi "
- ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb/include/mgmapi "
- ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb/include "
- LDFLAGS="-L${with_mysql}/storage/ndb/src/.libs -L${with_mysql}/libmysql_r/.libs/ -L${with_mysql}/mysys/.libs -L${with_mysql}/mysys -L${with_mysql}/strings/.libs -L${with_mysql}/strings "
- ],[
- IBASE=`$MYSQL_CONFIG --include`
- ADDIFLAGS=""
- # add regular MySQL C flags
- ADDCFLAGS=`$MYSQL_CONFIG --cflags`
- # add NdbAPI specific C flags
- LDFLAGS="$LDFLAGS "`$MYSQL_CONFIG --libs_r | sed 's/-lmysqlclient_r//'`
- ])
-
-
- ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb"
- ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb/ndbapi"
- ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb/mgmapi"
- ADDIFLAGS="$ADDIFLAGS $IBASE/ndb"
- ADDIFLAGS="$ADDIFLAGS $IBASE/ndb/ndbapi"
- ADDIFLAGS="$ADDIFLAGS $IBASE/ndb/mgmapi"
- ADDIFLAGS="$ADDIFLAGS $IBASE"
-
- CFLAGS="$CFLAGS $ADDCFLAGS $ADDIFLAGS"
- CXXFLAGS="$CXXFLAGS $ADDCFLAGS $ADDIFLAGS"
- MYSQL_INCLUDES="$IBASE $ADDIFLAGS"
-
-
- dnl AC_CHECK_LIB([mysqlclient_r],[safe_mutex_init],,[AC_MSG_ERROR([Can't link against libmysqlclient_r])])
- dnl First test to see if we can run with only ndbclient
- AC_CHECK_LIB([ndbclient],[decimal_bin_size],,[dnl else
- LDFLAGS="$LDFLAGS -lmysys -ldbug"
- AC_CHECK_LIB([mysqlclient_r],[safe_mutex_init],,)
- AC_CHECK_LIB([ndbclient],[ndb_init],,[
- AC_MSG_ERROR([Can't link against libndbclient])])
- AC_CHECK_LIB([mystrings],[decimal_bin_size],,[
- AC_MSG_ERROR([Can't find decimal_bin_size])])])
- AC_MSG_CHECKING(for NdbApi headers)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <NdbApi.hpp>]], [[int attr=NdbTransaction::Commit; ]])],[ndbapi_found="yes"],[])
- AS_IF([test "$ndbapi_found" = "yes"],
- [AC_MSG_RESULT(found)],
- [AC_MSG_ERROR([Couldn't find NdbApi.hpp!])])
- AC_MSG_CHECKING(for NDB_LE_ThreadConfigLoop)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mgmapi.h>]], [[int attr=NDB_LE_ThreadConfigLoop; ]])],[have_cge63="yes"],[])
- AS_IF([test "$have_cge63" = "yes"],
- [AC_MSG_RESULT(found)
- HAVE_CGE63="-DCGE63"
- AC_SUBST(HAVE_CGE63)],
- [AC_MSG_RESULT(missing)])
-
- LDFLAGS="$LDFLAGS $LIBS"
-
-
- MYSQL_MAJOR_VERSION=`$MYSQL_CONFIG --version | sed -e 's/\.//g' -e 's/-//g' -e 's/[A-Za-z]//g' | cut -c1-2`
-
- case "$MYSQL_MAJOR_VERSION" in
- 50) AC_DEFINE(MYSQL_50, [1], [mysql5.0])
- ;;
- 51) AC_DEFINE(MYSQL_51, [1], [mysql5.1])
- ;;
- *) echo "Unsupported version of MySQL Detected!"
- ;;
- esac
-
- AC_SUBST(MYSQL_MAJOR_VERSION)
- AC_SUBST(MYSQL_CONFIG)
-
-
-])
-
+++ /dev/null
-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_LIBPQ],[
- AC_REQUIRE([AC_LIB_PREFIX])
-
- dnl --------------------------------------------------------------------
- dnl Check for libpq
- dnl --------------------------------------------------------------------
-
- AC_ARG_ENABLE([libpq],
- [AS_HELP_STRING([--disable-libpq],
- [Build with libpq support @<:@default=on@:>@])],
- [ac_enable_libpq="$enableval"],
- [ac_enable_libpq="yes"])
-
- AS_IF([test "x$ac_enable_libpq" = "xyes"],[
- AC_CHECK_HEADERS([libpq-fe.h])
- AC_LIB_HAVE_LINKFLAGS(pq,,[
- #ifdef HAVE_LIBPQ_FE_H
- # include <libpq-fe.h>
- #else
- # include <postgresql/libpq-fe.h>
- #endif
- ], [
- PGconn *conn;
- conn = PQconnectdb(NULL);
- ])
- ],[
- ac_cv_libpq="no"
- ])
-
- AM_CONDITIONAL(HAVE_LIBPQ, [test "x${ac_cv_libpq}" = "xyes"])
-])
-
-AC_DEFUN([PANDORA_HAVE_LIBPQ],[
- AC_REQUIRE([_PANDORA_SEARCH_LIBPQ])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBPQ],[
- AC_REQUIRE([PANDORA_HAVE_LIBPQ])
- AS_IF([test "x${ac_cv_libpq}" = "xno"],
- AC_MSG_ERROR([libpq is required for ${PACKAGE}]))
-])
+++ /dev/null
-dnl Copyright (C) 2010 Padraig O'Sullivan
-dnl This file is free software;
-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_LIBPQXX],[
- AC_REQUIRE([AC_LIB_PREFIX])
-
- dnl --------------------------------------------------------------------
- dnl Check for libpqxx
- dnl --------------------------------------------------------------------
-
- AC_ARG_ENABLE([libpqxx],
- [AS_HELP_STRING([--disable-libpqxx],
- [Build with libpqxx support @<:@default=on@:>@])],
- [ac_enable_libpqxx="$enableval"],
- [ac_enable_libpqxx="yes"])
-
- AS_IF([test "x$ac_enable_libpqxx" = "xyes"],[
- AC_LANG_PUSH([C++])
- AC_LIB_HAVE_LINKFLAGS(pqxx,,[
- #include <pqxx/pqxx>
- ],[
- pqxx::connection conn("dbname=test");
- ])
- AC_LANG_POP()
- ],[
- ac_cv_libpqxx="no"
- ])
-
- AM_CONDITIONAL(HAVE_LIBPQXX, [test "x${ac_cv_libpqxx}" = "xyes"])
-
-])
-
-AC_DEFUN([PANDORA_HAVE_LIBPQXX],[
- AC_REQUIRE([_PANDORA_SEARCH_LIBPQXX])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBPQXX],[
- AC_REQUIRE([PANDORA_HAVE_LIBPQXX])
- AS_IF([test "x$ac_cv_libpqxx" = "xno"],[
- AC_MSG_ERROR([libpqxx is required for ${PACKAGE}])
- ])
-])
+++ /dev/null
-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_LIBSQLITE3],[
- AC_REQUIRE([AC_LIB_PREFIX])
-
- dnl --------------------------------------------------------------------
- dnl Check for libsqlite3
- dnl --------------------------------------------------------------------
-
- AC_ARG_ENABLE([libsqlite3],
- [AS_HELP_STRING([--disable-libsqlite3],
- [Build with libsqlite3 support @<:@default=on@:>@])],
- [ac_enable_libsqlite3="$enableval"],
- [ac_enable_libsqlite3="yes"])
-
- AS_IF([test "x$ac_enable_libsqlite3" = "xyes"],[
- AC_LIB_HAVE_LINKFLAGS(sqlite3,,[
- #include <stdio.h>
- #include <sqlite3.h>
- ],[
- sqlite3 *db;
- sqlite3_open(NULL, &db);
- ])
- ],[
- ac_cv_libsqlite3="no"
- ])
-
- AM_CONDITIONAL(HAVE_LIBSQLITE3, [test "x${ac_cv_libsqlite3}" = "xyes"])
-])
-
-AC_DEFUN([PANDORA_HAVE_LIBSQLITE3],[
- AC_REQUIRE([_PANDORA_SEARCH_LIBSQLITE3])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBSQLITE3],[
- AC_REQUIRE([_PANDORA_SEARCH_LIBSQLITE3])
- AS_IF([test "x${ac_cv_libsqlite3}" = "xno"],
- AC_MSG_ERROR([libsqlite3 is required for ${PACKAGE}]))
-])
+++ /dev/null
-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--------------------------------------------------------------------
-dnl PANDORA_PLUGINS
-dnl Declare our plugin modules
-dnl--------------------------------------------------------------------
-
-AC_DEFUN([PANDORA_PLUGINS],[
-
- dnl We do this to prime the files from a fresh checkout. Normally we want
- dnl these commands to be executed by make. Perhaps we should split them into
- dnl a few shell script snippets in config and make Make call them... we're
- dnl going to get there...
- dnl ANYWAY - syscmd gets called during aclocal - so before automake. It will
- dnl get called probably during autoconf too, so it's important to protect
- dnl with test -f ... if the files exist, we don't have the chicken/egg
- dnl problem and therefore don't need to do anything here
- m4_syscmd([PYTHON=${PYTHON:-python} && $PYTHON config/pandora-plugin > /dev/null])
- m4_syscmd([test -f config/plugin.stamp || touch config/plugin.stamp aclocal.m4])
-
- m4_sinclude(config/pandora-plugin.ac)
-
- 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($*)
- ],[
- AC_DEFINE_UNQUOTED([PANDORA_BUILTIN_LIST],["$pandora_builtin_list"],
- [List of plugins to be built in])
- AC_DEFINE_UNQUOTED([PANDORA_BUILTIN_SYMBOLS_LIST],["$pandora_builtin_symbols_list"],
- [List of builtin plugin symbols to be built in])
- AC_DEFINE_UNQUOTED([PANDORA_PLUGIN_LIST],["$pandora_default_plugin_list"],
- [List of plugins that should be loaded on startup if no
- value is given for --plugin-load])
- ])
-
-
- AC_SUBST(pandora_plugin_test_list)
- AC_SUBST(pandora_plugin_libs)
-
- pandora_plugin_defs=`echo $pandora_plugin_defs | sed 's/, *$//'`
- AC_SUBST(pandora_plugin_defs)
-
- AC_SUBST(PANDORA_PLUGIN_DEP_LIBS)
- AC_SUBST(pkgplugindir,"\$(pkglibdir)")
-])
-
-AC_DEFUN([PANDORA_ADD_PLUGIN_DEP_LIB],[
- PANDORA_PLUGIN_DEP_LIBS="${PANDORA_PLUGIN_DEP_LIBS} $*"
-])
+++ /dev/null
-dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
-dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
-dnl
-dnl pandora-build: A pedantic build system
-dnl
-dnl Copyright (C) 2009 Sun Microsystems, Inc.
-dnl Copyright (C) 2008 Sebastian Huber <sebastian-huber@web.de>
-dnl Copyright (C) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
-dnl Copyright (C) 2008 Rafael Laboissiere <rafael@laboissiere.net>
-dnl Copyright (C) 2008 Andrew Collier <colliera@ukzn.ac.za>
-dnl Copyright (C) 2008 Matteo Settenvini <matteo@member.fsf.org>
-dnl Copyright (C) 2008 Horst Knorr <hk_classes@knoda.org>
-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
-dnl Free Software Foundation, either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-dnl Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License along
-dnl with this program. If not, see <http://www.gnu.org/licenses/>.
-dnl
-dnl As a special exception, the respective Autoconf Macro's copyright owner
-dnl gives unlimited permission to copy, distribute and modify the configure
-dnl scripts that are the output of Autoconf when processing the Macro. You
-dnl need not follow the terms of the GNU General Public License when using
-dnl or distributing such scripts, even though portions of the text of the
-dnl Macro appear in them. The GNU General Public License (GPL) does govern
-dnl all other use of the material that constitutes the Autoconf Macro.
-dnl
-dnl This special exception to the GPL applies to versions of the Autoconf
-dnl Macro released by the Autoconf Macro Archive. When you make and
-dnl distribute a modified version of the Autoconf Macro, you may extend this
-dnl special exception to the GPL to apply to your modified version as well.
-
-dnl SYNOPSIS
-dnl
-dnl PANDORA_PYTHON3_DEVEL([version])
-dnl
-dnl DESCRIPTION
-dnl
-dnl Note: Defines as a precious variable "PYTHON3_VERSION". Don't override it
-dnl in your configure.ac.
-dnl
-dnl This macro checks for Python and tries to get the include path to
-dnl 'Python.h'. It provides the $(PYTHON3_CPPFLAGS) and $(PYTHON3_LDFLAGS)
-dnl output variables. It also exports $(PYTHON3_EXTRA_LIBS) and
-dnl $(PYTHON3_EXTRA_LDFLAGS) for embedding Python in your code.
-dnl
-dnl You can search for some particular version of Python by passing a
-dnl parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please
-dnl note that you *have* to pass also an operator along with the version to
-dnl match, and pay special attention to the single quotes surrounding the
-dnl version number. Don't use "PYTHON3_VERSION" for this: that environment
-dnl variable is declared as precious and thus reserved for the end-user.
-dnl
-dnl LAST MODIFICATION
-dnl
-dnl 2009-08-23
-
-AC_DEFUN([PANDORA_PYTHON3_DEVEL],[
- #
- # Allow the use of a (user set) custom python version
- #
- AC_ARG_VAR([PYTHON3_VERSION],[The installed Python
- version to use, for example '3.0'. This string
- will be appended to the Python interpreter
- canonical name.])
-
-
- AS_IF([test -z "$PYTHON3"],[
- AC_PATH_PROG([PYTHON3],[python[$PYTHON3_VERSION]])
- ])
- AS_IF([test -z "$PYTHON3"],[
- AC_MSG_ERROR([Cannot find python$PYTHON3_VERSION in your system path])
- PYTHON3_VERSION=""
- ])
-
- #
- # if the macro parameter ``version'' is set, honour it
- #
- if test -n "$1"; then
- AC_MSG_CHECKING([for a version of Python $1])
- ac_supports_python3_ver=`$PYTHON3 -c "import sys, string; \
- ver = string.split(sys.version)[[0]]; \
- print(ver $1)"`
- if test "$ac_supports_python3_ver" = "True"; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([this package requires Python $1.
-If you have it installed, but it isn't the default Python
-interpreter in your system path, please pass the PYTHON3_VERSION
-variable to configure. See ``configure --help'' for reference.
-])
- PYTHON_VERSION=""
- fi
- fi
-
- #
- # Check if you have distutils, else fail
- #
- AC_MSG_CHECKING([for Python3 distutils package])
- ac_python3_distutils_result=`$PYTHON3 -c "import distutils" 2>&1`
- if test -z "$ac_python3_distutils_result"; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([cannot import Python3 module "distutils".
-Please check your Python3 installation. The error was:
-$ac_python3_distutils_result])
- PYTHON3_VERSION=""
- fi
-
- #
- # Check for Python include path
- #
- AC_MSG_CHECKING([for Python3 include path])
- if test -z "$PYTHON3_CPPFLAGS"; then
- python3_path=`$PYTHON3 -c "import distutils.sysconfig; \
- print(distutils.sysconfig.get_python_inc());"`
- if test -n "${python3_path}"; then
- python3_path="-I$python3_path"
- fi
- PYTHON3_CPPFLAGS=$python3_path
- fi
- AC_MSG_RESULT([$PYTHON3_CPPFLAGS])
- AC_SUBST([PYTHON3_CPPFLAGS])
-
- #
- # Check for Python library path
- #
- AC_MSG_CHECKING([for Python3 library path])
- if test -z "$PYTHON3_LDFLAGS"; then
- # (makes two attempts to ensure we've got a version number
- # from the interpreter)
- py3_version=`$PYTHON3 -c "from distutils.sysconfig import *; \
- print(' '.join(get_config_vars('VERSION')))"`
- if test "$py3_version" == "[None]"; then
- if test -n "$PYTHON3_VERSION"; then
- py3_version=$PYTHON3_VERSION
- else
- py3_version=`$PYTHON3 -c "import sys; \
- print(sys.version[[:3]])"`
- fi
- fi
-
- PYTHON3_LDFLAGS=`$PYTHON3 -c "from distutils.sysconfig import *; \
- print('-L' + get_python_lib(0,1), \
- '-lpython');"`$py3_version
- fi
- AC_MSG_RESULT([$PYTHON3_LDFLAGS])
- AC_SUBST([PYTHON3_LDFLAGS])
-
- #
- # Check for site packages
- #
- AC_MSG_CHECKING([for Python3 site-packages path])
- if test -z "$PYTHON3_SITE_PKG"; then
- PYTHON3_SITE_PKG=`$PYTHON3 -c "import distutils.sysconfig; \
- print(distutils.sysconfig.get_python_lib(0,0));"`
- fi
- AC_MSG_RESULT([$PYTHON3_SITE_PKG])
- AC_SUBST([PYTHON3_SITE_PKG])
-
- #
- # libraries which must be linked in when embedding
- #
- AC_MSG_CHECKING(for Python3 embedding libraries)
- if test -z "$PYTHON3_EMBED_LIBS"; then
- PYTHON3_EMBED_LIBS=`$PYTHON3 -c "import distutils.sysconfig; \
- conf = distutils.sysconfig.get_config_var; \
- print(conf('LOCALMODLIBS'), conf('LIBS'))"`
- fi
- AC_MSG_RESULT([$PYTHON3_EMBED_LIBS])
- AC_SUBST(PYTHON3_EMBED_LIBS)
-
- #
- # linking flags needed when embedding
- #
- AC_MSG_CHECKING(for Python3 embedding linking flags)
- if test -z "$PYTHON3_EMBED_LDFLAGS"; then
- PYTHON3_EMBED_LDFLAGS=`$PYTHON3 -c "import distutils.sysconfig; \
- conf = distutils.sysconfig.get_config_var; \
- print(conf('LINKFORSHARED'))"`
- fi
- AC_MSG_RESULT([$PYTHON3_EMBED_LDFLAGS])
- AC_SUBST(PYTHON3_EMBED_LDFLAGS)
-
- #
- # final check to see if everything compiles alright
- #
- AC_MSG_CHECKING([for Python3 development environment consistency])
- AC_LANG_PUSH([C])
- # save current global flags
- ac_save_LIBS="$LIBS"
- ac_save_CPPFLAGS="$CPPFLAGS"
- LIBS="$ac_save_LIBS $PYTHON3_LDFLAGS"
- CPPFLAGS="$ac_save_CPPFLAGS $PYTHON3_CPPFLAGS"
- AC_TRY_LINK([
- #include <Python.h>
- ],[
- Py_Initialize();
- ],[python3exists=yes],[python3exists=no])
-
- AC_MSG_RESULT([$python3exists])
-
- if test ! "$python3exists" = "yes"; then
- AC_MSG_WARN([
- Could not link test program to Python3.
- Maybe the main Python3 library has been installed in some non-standard
- library path. If so, pass it to configure, via the LDFLAGS environment
- variable.
- Example: ./configure LDFLAGS="-L/usr/non-standard-path/python3/lib"
- ============================================================================
- ERROR!
- You probably have to install the development version of the Python3 package
- for your distribution. The exact name of this package varies among them.
- ============================================================================
- ])
- PYTHON3_VERSION=""
- fi
- AC_LANG_POP
- # turn back to default flags
- CPPFLAGS="$ac_save_CPPFLAGS"
- LIBS="$ac_save_LIBS"
-
- #
- # all done!
- #
-])
-
+++ /dev/null
-dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
-dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
-dnl
-dnl pandora-build: A pedantic build system
-dnl Copyright (C) 2009 Sun Microsystems, Inc.
-dnl This file is free software; Sun Microsystems
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-dnl
-dnl From Monty Taylor
-
-
-AC_DEFUN([PANDORA_WITH_PYTHON], [
-
- AC_ARG_WITH([python],
- [AS_HELP_STRING([--with-python],
- [Build Python Bindings @<:@default=yes@:>@])],
- [with_python=$withval
- python_requested=$withval
- ],
- [with_python=yes
- python_requested=no
- ])
-
- AS_IF([test "x$with_python" != "xno"],[
- AS_IF([test "x$with_python" != "xyes"],[PYTHON=$with_python])
- AM_PATH_PYTHON([2.4],,[with_python="no"])
- AC_PYTHON_DEVEL()
- AS_IF([test "x$pythonexists" = "xno"],[with_python="no"])
- ])
- AS_IF([test "x$with_python" = "xno" -a "$python_requested" = "yes"],[
- AC_MSG_ERROR([Python support was explicity requested, but Python support
- was not found. Please correct your build environment and try
- again])
- ])
- AM_CONDITIONAL(BUILD_PYTHON, [test "$with_python" = "yes"])
-])