pandora-build v0.57
authorMonty Taylor <mordred@inaugust.com>
Wed, 16 Sep 2009 09:02:26 +0000 (02:02 -0700)
committerMonty Taylor <mordred@inaugust.com>
Wed, 16 Sep 2009 09:02:26 +0000 (02:02 -0700)
13 files changed:
config/autorun.sh
m4/pandora_canonical.m4
m4/pandora_ensure_gcc_version.m4
m4/pandora_extensions.m4 [new file with mode: 0644]
m4/pandora_platform.m4
m4/pandora_plugins.m4
m4/pandora_pthread.m4
m4/pandora_python3_devel.m4 [new file with mode: 0644]
m4/pandora_swig.m4
m4/pandora_vc_build.m4
m4/pandora_with_lua.m4
m4/pandora_with_perl.m4
m4/pandora_with_python3.m4

index 1dcbec69532142af0bb53ca45a2a51c932a10222..4785b9fccab1d95e75873d89bf0f06b82ab393b9 100755 (executable)
@@ -57,14 +57,14 @@ if test x$LIBTOOLIZE = x; then
 fi
 
 if test x$ACLOCAL = x; then
-  ACLOCAL=`locate_binary aclocal-1.10 aclocal-1.9 aclocal19 aclocal`
+  ACLOCAL=`locate_binary aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal19 aclocal`
   if test x$ACLOCAL = x; then
     die "Did not find a supported aclocal"
   fi
 fi
 
 if test x$AUTOMAKE = x; then
-  AUTOMAKE=`locate_binary automake-1.10 automake-1.9 automake19 automake`
+  AUTOMAKE=`locate_binary automake-1.11 automake-1.10 automake-1.9 automake19 automake`
   if test x$AUTOMAKE = x; then
     die "Did not find a supported automake"
   fi
index 65c8a6b579049a833813fe530c07efe63f8c49a0..5bf12598b092b92a01b6d2e2b23fc3c056e9779b 100644 (file)
@@ -4,7 +4,7 @@ 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.47])
+AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.57])
 
 AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
   dnl Force dependency tracking on for Sun Studio builds
@@ -23,6 +23,7 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
   m4_define([PCT_REQUIRE_CXX],[no])
   m4_define([PCT_IGNORE_SHARED_PTR],[no])
   m4_define([PCT_FORCE_GCC42],[no])
+  m4_define([PCT_SRC_IN_SRC],[no])
   m4_foreach([pct_arg],[$*],[
     m4_case(pct_arg,
       [use-gnulib], [
@@ -40,6 +41,10 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
       [force-gcc42], [
         m4_undefine([PCT_FORCE_GCC42])
         m4_define([PCT_FORCE_GCC42],[yes])
+      ],
+      [src-in-src], [
+        m4_undefine([PCT_SRC_IN_SRC])
+        m4_define([PCT_SRC_IN_SRC],[yes])
     ])
   ])
 
@@ -54,6 +59,7 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
   AC_CANONICAL_TARGET
   
   AM_INIT_AUTOMAKE(-Wall -Werror nostdinc subdir-objects)
+  m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 
   m4_if(PCT_USE_GNULIB,yes,[ gl_EARLY ])
   
@@ -64,8 +70,7 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
   dnl Once we can use a modern autoconf, we can use this
   dnl AC_PROG_CC_C99
   AC_REQUIRE([AC_PROG_CXX])
-  gl_USE_SYSTEM_EXTENSIONS
-  AC_PROG_CPP
+  PANDORA_EXTENSIONS
   AM_PROG_CC_C_O
 
 
@@ -94,7 +99,10 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
     ])
   ])
   
-  m4_if(PCT_USE_GNULIB, [yes], [gl_INIT])
+  m4_if(PCT_USE_GNULIB, [yes], [
+    gl_INIT
+    AC_CONFIG_LIBOBJ_DIR([gnulib])
+  ])
 
   AC_C_BIGENDIAN
   AC_C_CONST
@@ -137,6 +145,9 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
     AM_CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${AM_CPPFLAGS}"
     ])
   ])
+  AS_IF([test "PCT_SRC_IN_SRC" = "yes"],[
+    AM_CPPFLAGS="-I\$(top_srcdir)/src -I\$(top_builddir)/src ${AM_CPPFLAGS}"
+  ])
 
   PANDORA_USE_PIPE
 
index 608a552776dccce0d36a481373302b53f0b42377..d8e28d8c9ea352f02785f3e506304a55b916ac26 100644 (file)
@@ -8,12 +8,15 @@ dnl You're gonna get 4.2.
 AC_DEFUN([PANDORA_MAC_GCC42],
   [AS_IF([test "$GCC" = "yes"],[
     AS_IF([test "$host_vendor" = "apple" -a "x${ac_cv_env_CC_set}" = "x"],[
-      AS_IF([test -f /usr/bin/gcc-4.2],
+      host_os_version=`echo ${host_os} | perl -ple 's/^\D+//g;s,\..*,,'`
+      AS_IF([test "$host_os_version" -lt 10],[
+        AS_IF([test -f /usr/bin/gcc-4.2],
         [
           CPP="/usr/bin/gcc-4.2 -E"
           CC=/usr/bin/gcc-4.2
           CXX=/usr/bin/g++-4.2
         ])
+      ])
     ])
   ])
 ])
diff --git a/m4/pandora_extensions.m4 b/m4/pandora_extensions.m4
new file mode 100644 (file)
index 0000000..ee73b80
--- /dev/null
@@ -0,0 +1,16 @@
+dnl  Copyright (C) 2009 Sun Microsystems
+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.
+
+AC_DEFUN([PANDORA_EXTENSIONS],[
+
+  m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
+    [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
+    [AC_REQUIRE([AC_GNU_SOURCE])])
+
+])
+
+AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],[
+  AC_REQUIRE([PANDORA_EXTENSIONS])
+])
index 76ef66bc1ac05910083f93654df5ce3b12080c18..c4f2b2ad546334373831721fd25ec32c97d48828 100644 (file)
@@ -63,6 +63,15 @@ AC_DEFUN([PANDORA_PLATFORM],[
   AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
   AC_CHECK_DECL([__ICC], [INTELCC="yes"], [INTELCC="no"])
 
-  AS_IF([test "x$INTELCC" = "xyes"], [enable_rpath=no])
+  AS_IF([test "$INTELCC" = "yes"], [enable_rpath=no])
+  dnl By default, Sun Studio grabs special versions of limits.h and string.h
+  dnl when you use <cstring> and <climits>. By setting this define, we can
+  dnl disable that and cause those to wrap the standard headers instead.
+  dnl http://www.stlport.com/doc/configure.html
+  AS_IF([test "$SUNCC" = "yes"],[
+    AC_DEFINE([_STLP_NO_NEW_C_HEADERS],[1],
+      [Cause Sun Studio to not be quite so strict with standards conflicts])
+  ])
 
 ])
index 53b5ebfd59eabbd2b5050746ee22a9d3ccdd979d..40c789fcc8060dfdbf874dce8df134ab535267ea 100644 (file)
@@ -9,15 +9,22 @@ dnl--------------------------------------------------------------------
 
 AC_DEFUN([PANDORA_PLUGINS],[
 
-  m4_include(config/plugin.ac)
+  m4_sinclude(config/plugin.ac)
   dnl Add code here to read set plugin lists and  set drizzled_default_plugin_list
   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])
 
   pandora_builtin_list=`echo $pandora_builtin_list | sed 's/, *$//'`
-  AC_DEFINE_UNQUOTED([PANDORA_BUILTIN_LIST],[$pandora_builtin_list],
-                     [List of plugins to be built in])
+  AS_IF([test "x$pandora_builtin_list" = "x"], pandora_builtin_list="NULL")
+  AC_SUBST([PANDORA_BUILTIN_LIST],[$pandora_builtin_list])
+  m4_ifblank($1,[
+    AC_DEFINE_UNQUOTED([PANDORA_BUILTIN_LIST],[$pandora_builtin_list],
+                       [List of plugins to be built in])
+    ],[
+    AC_CONFIG_FILES($*)
+  ])
+
 
   AC_SUBST(pandora_plugin_test_list)
   AC_SUBST(pandora_plugin_libs)
index 92bdfc44f5e3e93f20689591d20590e6180cca62..78af2ba516637098b6c0a40b176cefe6bb56542f 100644 (file)
@@ -14,12 +14,56 @@ dnl --------------------------------------------------------------------
 dnl  Check for libpthread
 dnl --------------------------------------------------------------------
 
+AC_DEFUN([PANDORA_PTHREAD_YIELD],[
+  AC_REQUIRE([ACX_PTHREAD])
+
+  save_CFLAGS="${CFLAGS}"
+  save_CXXFLAGS="${CXXFLAGS}"
+  CFLAGS="${PTHREAD_CFLAGS} ${CFLAGS}"
+  CXXFLAGS="${PTHREAD_CFLAGS} ${CXXFLAGS}"
+  dnl Some OSes like Mac OS X have that as a replacement for pthread_yield()
+  AC_CHECK_FUNCS(pthread_yield_np)
+  AC_CACHE_CHECK([if pthread_yield takes zero arguments],
+    [pandora_cv_pthread_yield_zero_arg],
+    [AC_LINK_IFELSE([
+      AC_LANG_PROGRAM([[
+#include <pthread.h>
+        ]],[[
+  pthread_yield();
+        ]])],
+      [pandora_cv_pthread_yield_zero_arg=yes],
+      [pandora_cv_pthread_yield_zero_arg=no])])
+  AS_IF([test "$pandora_cv_pthread_yield_zero_arg" = "yes"],[
+    AC_DEFINE([HAVE_PTHREAD_YIELD_ZERO_ARG], [1],
+              [pthread_yield that doesn't take any arguments])
+  ])
+
+  AC_CACHE_CHECK([if pthread_yield takes one argument],
+    [pandora_cv_pthread_yield_one_arg],
+    [AC_LINK_IFELSE([
+      AC_LANG_PROGRAM([[
+#include <pthread.h>
+        ]],[[
+  pthread_yield(0);
+        ]])],
+      [pandora_cv_pthread_yield_one_arg=yes],
+      [pandora_cv_pthread_yield_one_arg=no])])
+  AS_IF([test "$pandora_cv_pthread_yield_one_arg" = "yes"],[
+    AC_DEFINE([HAVE_PTHREAD_YIELD_ONE_ARG], [1],
+              [pthread_yield function with one argument])
+  ])
+
+  CFLAGS="${save_CFLAGS}"
+  CXXFLAGS="${save_CXXFLAGS}"
+])
+
+
 AC_DEFUN([_PANDORA_SEARCH_PTHREAD],[
-  ACX_PTHREAD
+  AC_REQUIRE([ACX_PTHREAD])
   LIBS="${PTHREAD_LIBS} ${LIBS}"
   AM_CFLAGS="${PTHREAD_CFLAGS} ${AM_CFLAGS}"
   AM_CXXFLAGS="${PTHREAD_CFLAGS} ${AM_CXXFLAGS}"
-  CC="$PTHREAD_CC"
+  PANDORA_PTHREAD_YIELD
 ])
 
 
diff --git a/m4/pandora_python3_devel.m4 b/m4/pandora_python3_devel.m4
new file mode 100644 (file)
index 0000000..7712ef1
--- /dev/null
@@ -0,0 +1,236 @@
+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!
+       #
+])
+
index 07f57e2d90ae26da09fd5015abbcdbf4735cd0e2..fe91b08bcb7039d32d2b63e2573fcd432830c155 100644 (file)
@@ -11,9 +11,10 @@ dnl From Monty Taylor
 
 AC_DEFUN([PANDORA_SWIG],[
 
-  AC_PROG_SWIG(1.3.36)
-  AC_DEFINE([SWIG_TYPE_TABLE],
-    [libgearman],
+  AC_PROG_SWIG(1.3.31)
+  
+  AC_DEFINE_UNQUOTED([SWIG_TYPE_TABLE],
+    [$PACKAGE],
     [Type Table name for SWIG symbol table])
 
   dnl Have to hard-code /usr/local/include and /usr/include into the path.
@@ -22,11 +23,17 @@ AC_DEFUN([PANDORA_SWIG],[
   AC_SUBST([SWIG])
 
 
-  AC_CACHE_CHECK([if swig supports Python3],
-    [ac_cv_swig_has_python3_],
-    [
-      AS_IF([swig -python3 2>&1 | grep "Unable to find" > /dev/null],
-        [ac_cv_swig_has_python3_=no],
-        [ac_cv_swig_has_python3_=yes])
-    ])
+])
+
+AC_DEFUN([PANDORA_SWIG_PYTHON3],[
+  AC_REQUIRE([PANDORA_SWIG])
+  AS_IF([test "x$SWIG" != "x"],[
+    AC_CACHE_CHECK([if swig supports Python3],
+      [ac_cv_swig_has_python3_],
+      [
+        AS_IF([$SWIG -python -help 2>&1 | grep py3 > /dev/null],
+          [ac_cv_swig_has_python3_=yes],
+          [ac_cv_swig_has_python3_=no])
+      ])
+  ])
 ])
index ada6ccf6c693f7e66419ac403356745b7ffad330..fa54986af4cdfcf0230ed3826610036662b52330 100644 (file)
@@ -28,5 +28,30 @@ AC_DEFUN([PANDORA_BUILDING_FROM_VC],[
     ac_cv_building_from_hg=no
   ])
 
+  AS_IF([test -d "${srcdir}/.git"],[
+    ac_cv_building_from_git=yes
+    ac_cv_building_from_vc=yes
+    ],[
+    ac_cv_building_from_git=no
+  ])
+
+
 ])
   
+dnl Takes one argument which is the prefix to append
+AC_DEFUN([PANDORA_EXPORT_BZR_INFO],[
+  m4_ifnblank($1,[
+    m4_define([PEBI_PREFIX],m4_toupper(m4_normalize($1))[_])
+  ],[
+    m4_define([PEBI_PREFIX],[])
+  ])
+
+  AC_DEFINE(PEBI_PREFIX[BZR_REVID], ["BZR_REVID"], [bzr revision ID])
+  AC_DEFINE(PEBI_PREFIX[BZR_BRANCH], ["BZR_BRANCH"], [bzr branch name])
+  AC_DEFINE(PEBI_PREFIX[RELEASE_DATE], ["RELEASE_DATE"], [Release date based on the date of the repo checkout])
+  AC_DEFINE(PEBI_PREFIX[RELEASE_VERSION], ["RELEASE_VERSION"], [$1 version number formatted for display])
+  AC_DEFINE(PEBI_PREFIX[RELEASE_COMMENT], ["RELEASE_COMMENT"], [Set to trunk if the branch is the main $1 branch])
+  AC_DEFINE(PEBI_PREFIX[RELEASE_ID], [RELEASE_ID], [$1 version number formatted for numerical comparison])
+])
+
index 6e4a96fefbba6377ae5f6993d1a6338669a2934a..26af035dcc27714270c9463b0115b7323b08baae 100644 (file)
@@ -27,18 +27,28 @@ AC_DEFUN([PANDORA_WITH_LUA],[
       AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
       with_lua=yes
     ],[
-      PKG_CHECK_MODULES([LUA], lua5.1 >= 5.1, [
+      LUAPC=lua5.1
+      PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1, [
         AC_DEFINE([HAVE_LUA], [1], [liblua])
         AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
-       with_lua=yes
+        with_lua=yes
       ],[
         AC_DEFINE([HAVE_LUA],["x"],["x"])
         with_lua=no
       ])
     ])
 
-   AC_SUBST(LUA_CFLAGS)
-   AC_SUBST(LUA_LIBS)
+    AC_CACHE_CHECK([for LUA installation location],[pandora_cv_lua_archdir],[
+      AS_IF([test "$prefix" = "NONE"],[
+        pandora_cv_lua_archdir=`${PKG_CONFIG} --define-variable=prefix=${ac_default_prefix} --variable=INSTALL_CMOD ${LUAPC}`
+      ],[
+        pandora_cv_lua_archdir=`${PKG_CONFIG} --define-variable=prefix=${prefix} --variable=INSTALL_CMOD ${LUAPC}`
+      ])
+    ])
+    LUA_ARCHDIR="${pandora_cv_lua_archdir}"
+    AC_SUBST(LUA_ARCHDIR)
+    AC_SUBST(LUA_CFLAGS)
+    AC_SUBST(LUA_LIBS)
   ])
   AM_CONDITIONAL(BUILD_LUA, test "$with_lua" = "yes")
 
index e3fd50a2b785bb9f13b6b38f0d01dcc418deca82..f17c07a7b5b64186640fb3010637c8c13a725fed 100644 (file)
@@ -18,6 +18,11 @@ AC_DEFUN([PANDORA_WITH_PERL], [
     [with_perl=$withval], 
     [with_perl=yes])
 
+  AC_ARG_WITH([perl-arch],
+    [AS_HELP_STRING([--with-perl-arch],
+      [Install Perl bindings into system location @<:@default=no@:>@])],
+    [with_perl_arch=$withval],
+    [with_perl_arch=no])
 
   AS_IF([test "x$with_perl" != "xno"],[
     AS_IF([test "x$with_perl" != "xyes"],
@@ -25,14 +30,52 @@ AC_DEFUN([PANDORA_WITH_PERL], [
       [ac_chk_perl=perl])
     AC_CHECK_PROGS(PERL,$ac_chk_perl)
   ])
+  AS_IF([test "x$PERL" != "x"],[
+    AC_CACHE_CHECK([for Perl include path],[pandora_cv_perl_include],[
+      pandora_cv_perl_include=`$PERL -MConfig -e 'print $Config{archlib};'`
+      pandora_cv_perl_include="${pandora_cv_perl_include}/CORE"
+    ])
+    AC_CACHE_CHECK([for Perl CPPFLAGS],[pandora_cv_perl_cppflags],[
+      pandora_cv_perl_cppflags=`$PERL -MConfig -e 'print $Config{cppflags};'`
+      pandora_cv_perl_cppflags="${pandora_cv_perl_cppflags}"
+    ])
+    PERL_CPPFLAGS="-I${pandora_cv_perl_include} ${pandora_cv_perl_cppflags}"
 
-  AM_CONDITIONAL(BUILD_PERL, [test "$with_perl" = "yes"])
+    AC_CACHE_CHECK([for Perl development headers],
+      [pandora_cv_perl_dev],[
+        
+        save_CPPFLAGS="${CPPFLAGS}"
+        CPPFLAGS="${CPPFLAGS} ${PERL_CPPFLAGS}"
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <math.h>
+#include <stdlib.h>
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+        ]])],
+        [pandora_cv_perl_dev=yes],
+        [pandora_cv_perl_dev=no])
+        CPPFLAGS="${save_CPPFLAGS}"
+      ])
 
-dnl Don't think we need these anymore, but it's a good reference
-dnl if test "x$PERL" != "x"; then
-dnl  PERLCCFLAGS=`$PERL -MConfig -e 'print $Config{ccflags};'`
-dnl  PERLCPPFLAGS=`$PERL -MConfig -e 'print $Config{cppflags};'`
-dnl  PERLLIBS=`$PERL -MConfig -e 'print $Config{perllibs};'`
-dnl fi 
+    AS_IF([test "${pandora_cv_perl_dev}" = "no"],
+      [with_perl=no])
+
+    AC_CACHE_CHECK([for Perl install location],
+      [pandora_cv_perl_archdir],[
+        AS_IF([test "${with_perl_arch}" = "no"],[
+          pandora_cv_perl_archdir=`$PERL -MConfig -e 'print $Config{sitearch}'`
+        ],[
+          pandora_cv_perl_archdir=`$PERL -MConfig -e 'print $Config{archlib}'`
+        ])
+        pandora_cv_perl_archdir="${pandora_cv_perl_archdir}"
+    ])
+    PERL_ARCHDIR="${pandora_cv_perl_archdir}"
+  ])
+  AC_SUBST([PERL_CPPFLAGS])
+  AC_SUBST([PERL_ARCHDIR])
+
+  AM_CONDITIONAL(BUILD_PERL, [test "$with_perl" != "no"])
 
 ])
index 1b964ff3289d976239efefb447fb1c89b2cf9e46..9b7117e2176081783e7eb0cc4dbb92163b9502b4 100644 (file)
@@ -15,21 +15,30 @@ AC_DEFUN([PANDORA_WITH_PYTHON3], [
 
   AC_ARG_WITH([python3], 
     [AS_HELP_STRING([--with-python3],
-      [Build Python3 Bindings @<:@default=yes@:>@])],
-    [with_python3=$withval], 
-    [with_python3=yes])
+      [Build Python3 Bindings @<:@default=yes@:>@])],[
+        with_python3=$withval
+        python3_requested=yes
+      ],[ 
+        with_python3=yes
+        python3_requested=no
+      ])
 
-  AS_IF([test "x$ac_cv_swig_has_python3_" != "xno"],[
+  AS_IF([test "x$ac_cv_swig_has_python3_" != "xyes"],[
+     with_python3=no
+  ],[
    AS_IF([test "x$with_python3" != "xno"],[
      AS_IF([test "x$with_python3" != "xyes"],
-       [PYTHON3=$with_python3],
-       [AC_PATH_PROG([PYTHON3],[python3],[no])
-        AS_IF([test "x$PYTHON3" = "xno"],
-          [with_python3=no])
+       [PYTHON3=$with_python3],[
+        AC_PATH_PROG([PYTHON3],[python3],[no])
+        PANDORA_PYTHON3_DEVEL()
+        AS_IF([test "x$python3exists" = "xno"],[with_python="no"])
      ]) 
    ])
-  ],[
-     with_python3=no
   ])
-AM_CONDITIONAL(BUILD_PYTHON3, [test "$with_python3" = "yes"])
+  AS_IF([test "x$with_python3" = "xno" -a "$python3_requested" = "yes"],[
+    AC_MSG_ERROR([Python3 support was explicity requested, but Python3 support
+                  was not found. Please correct your build environment and try
+                  again])
+  ])
+  AM_CONDITIONAL(BUILD_PYTHON3, [test "$with_python3" = "yes"])
 ])