Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MB-6433: Remove pandora build system

Change-Id: Ie06d3fee44f63f8e47c8a4cf2bedbf5cc1b00f8a
Reviewed-on: http://review.couchbase.org/20183
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
  • Loading branch information...
commit 8440faece5f3b8d8e5ac35f8b13c3116f3628c8c 1 parent 8962083
@trondn trondn authored
Showing with 414 additions and 4,156 deletions.
  1. +6 −97 config/autorun.sh
  2. +180 −43 configure.ac
  3. +0 −103 m4/ac_cxx_compile_stdcxx_0x.m4
  4. +0 −67 m4/ac_cxx_header_stdcxx_98.m4
  5. +0 −276 m4/acx_pthread.m4
  6. +228 −0 m4/couchbase.m4
  7. +0 −110 m4/lib-ld.m4
  8. +0 −767 m4/lib-link.m4
  9. +0 −221 m4/lib-prefix.m4
  10. +0 −60 m4/pandora_64bit.m4
  11. +0 −172 m4/pandora_canonical.m4
  12. +0 −37 m4/pandora_check_compiler_version.m4
  13. +0 −23 m4/pandora_check_cxx_standard.m4
  14. +0 −39 m4/pandora_ensure_gcc_version.m4
  15. +0 −16 m4/pandora_extensions.m4
  16. +0 −41 m4/pandora_have_innodb.m4
  17. +0 −42 m4/pandora_have_libcouchstore.m4
  18. +0 −55 m4/pandora_have_libdrizzle.m4
  19. +0 −66 m4/pandora_have_libevent.m4
  20. +0 −41 m4/pandora_have_libgearman.m4
  21. +0 −44 m4/pandora_have_libmemcached.m4
  22. +0 −80 m4/pandora_have_protobuf.m4
  23. +0 −23 m4/pandora_header_assert.m4
  24. +0 −15 m4/pandora_libtool.m4
  25. +0 −79 m4/pandora_optimize.m4
  26. +0 −77 m4/pandora_platform.m4
  27. +0 −41 m4/pandora_plugins.m4
  28. +0 −59 m4/pandora_print_callstack.m4
  29. +0 −94 m4/pandora_pthread.m4
  30. +0 −236 m4/pandora_python3_devel.m4
  31. +0 −133 m4/pandora_sasl.m4
  32. +0 −56 m4/pandora_shared_ptr.m4
  33. +0 −39 m4/pandora_swig.m4
  34. +0 −52 m4/pandora_unordered_map.m4
  35. +0 −36 m4/pandora_use_pipe.m4
  36. +0 −57 m4/pandora_vc_build.m4
  37. +0 −343 m4/pandora_warnings.m4
  38. +0 −55 m4/pandora_with_lua.m4
  39. +0 −33 m4/pandora_with_memcached.m4
  40. +0 −81 m4/pandora_with_perl.m4
  41. +0 −56 m4/pandora_with_php.m4
  42. +0 −28 m4/pandora_with_python.m4
  43. +0 −44 m4/pandora_with_python3.m4
  44. +0 −33 m4/pandora_with_r.m4
  45. +0 −79 m4/pandora_with_ruby.m4
  46. +0 −7 m4/pod2man.m4
View
103 config/autorun.sh
@@ -1,101 +1,10 @@
#!/bin/sh
-LIBTOOLIZE_FLAGS="--automake --copy --force"
-AUTOMAKE_FLAGS="--add-missing --copy --force --foreign --warning=portability"
-ACLOCAL_FLAGS="-I m4"
-AUTOHEADER_FLAGS="--warnings=error"
-AUTOCONF_CLAGS="--warnings=error --force"
+set -e
+cat > m4/version.m4 <<EOF
+m4_define([VERSION_NUMBER], [`git describe | tr '-' '_'`])
+m4_define([GIT_CHANGESET],[`git rev-parse HEAD`])
+EOF
-ARGV0=$0
-ARGS="$@"
-
-die() { echo "$@"; exit 1; }
-
-run() {
- echo "$ARGV0: running \`$@' $ARGS"
- $@ $ARGS
-}
-
-# Try to locate a program by using which, and verify that the file is an
-# executable
-locate_binary() {
- for f in $@
- do
- file=`which $f 2>/dev/null | grep -v '^no '`
- if test -n "$file" -a -x "$file"; then
- echo $file
- return 0
- fi
- done
-
- echo ""
- return 1
-}
-
-if test -f config/pre_hook.sh
-then
- . config/pre_hook.sh
-fi
-
-if [ -d .git ]
-then
- perl config/version.pl || die "Failed to run config/version.pl"
-fi
-
-# Try to detect the supported binaries if the user didn't
-# override that by pushing the environment variable
-if test x$LIBTOOLIZE = x; then
- LIBTOOLIZE=`locate_binary libtoolize glibtoolize`
- if test x$LIBTOOLIZE = x; then
- die "Did not find a supported libtoolize"
- fi
-fi
-
-if test x$ACLOCAL = x; then
- ACLOCAL=`locate_binary aclocal-1.11 aclocal-1.10 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.11 automake-1.10 automake`
- if test x$AUTOMAKE = x; then
- die "Did not find a supported automake"
- fi
-fi
-
-if test x$AUTOCONF = x; then
- AUTOCONF=`locate_binary autoconf`
- if test x$AUTOCONF = x; then
- die "Did not find a supported autoconf"
- fi
-fi
-
-if test x$AUTOHEADER = x; then
- AUTOHEADER=`locate_binary autoheader`
- if test x$AUTOHEADER = x; then
- die "Did not find a supported autoheader"
- fi
-fi
-
-run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
-run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
-run $AUTOHEADER $AUTOHEADER_FLAGS || die "Can't execute autoheader"
-run $AUTOMAKE $AUTOMAKE_FLAGS || die "Can't execute automake"
-run $AUTOCONF $AUTOCONF_FLAGS || die "Can't execute autoconf"
-
-if test -f config/post_hook.sh
-then
- . config/post_hook.sh
-fi
-
-echo "---"
-echo "Configured with the following tools:"
-echo " * `$LIBTOOLIZE --version | head -1`"
-echo " * `$ACLOCAL --version | head -1`"
-echo " * `$AUTOHEADER --version | head -1`"
-echo " * `$AUTOMAKE --version | head -1`"
-echo " * `$AUTOCONF --version | head -1`"
-echo "---"
+autoreconf -i --force
View
223 configure.ac
@@ -18,17 +18,181 @@ m4_include([m4/version.m4])
AC_INIT(ep-engine, VERSION_NUMBER, support@couchbase.com)
AC_CONFIG_SRCDIR([README.markdown])
AC_CONFIG_AUX_DIR(config)
+
+# Preserve what the user specified as CFLAGS/CXXFLAGS/CPPFLAGS/LDFLAGS
+SAVE_CFLAGS="$CFLAGS"
+SAVE_CXXFLAGS="$CXXFLAGS"
+SAVE_CPPFLAGS="$CPPFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
+
+# The stupid automake system thinks it is a good idea to inject
+# -g -O2 to C(XX)FLAGS if it isn't set..
+# Why I don't like this? Well -g is in conflict with -g3 that I'm
+# adding for Sun Studio
+AS_IF([test "x$CFLAGS" = "x" ],
+ [CFLAGS="-I."])
+AS_IF([test "x$CXXFLAGS" = "x" ],
+ [CXXFLAGS="-I."])
+AS_IF([test "x$CPPFLAGS" = "x" ],
+ [CPPFLAGS="-I."])
+
+AC_USE_SYSTEM_EXTENSIONS
+AM_INIT_AUTOMAKE(subdir-objects foreign)
+AC_PROG_CXX
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_LN_S
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
AM_CONFIG_HEADER([src/config.h])
AC_CONFIG_MACRO_DIR([m4])
-AC_DISABLE_STATIC
-m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
-
-PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, require-cxx,
- force-gcc42)
-PANDORA_SHARED_PTR
-PANDORA_REQUIRE_PTHREAD
-PANDORA_REQUIRE_LIBEVENT
-PANDORA_HAVE_LIBCOUCHSTORE
+
+# Restore CFLAGS/CXXFLAGS now that I've prevented automake
+# to inject the extra options ;)
+AS_IF([test "x$CFLAGS" = "x-I." ],
+ [CFLAGS=""])
+AS_IF([test "x$CXXFLAGS" = "x-I." ],
+ [CXXFLAGS=""])
+AS_IF([test "x$CPPFLAGS" = "x-I." ],
+ [CPPFLAGS=""])
+
+# the malloc tests seems to be broken for cross compilation.. ignore them
+ac_cv_func_malloc_0_nonnull=yes
+ac_cv_func_realloc_0_nonnull=yes
+
+COUCHBASE_GENERIC_COMPILER(c99 c++ pthread)
+
+AS_IF([test "$ac_cv_enable_gcov" = "yes"],
+ [ LIBS="$LIBS -lgcov" ])
+
+AC_CHECK_HEADERS_ONCE([arpa/inet.h netdb.h mach/mach_time.h poll.h
+ atomic.h sysexits.h unistd.h sys/socket.h
+ netinet/in.h netinet/tcp.h ws2tcpip.h
+ winsock2.h])
+
+AC_LANG_PUSH(C++)
+AC_CHECK_HEADERS([memory tr1/memory boost/shared_ptr.hpp])
+AC_CACHE_CHECK([the namespace of shared_ptr],
+ [ac_cv_shared_namespace],[
+ for namespace in std tr1 std::tr1 boost
+ do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+#if defined(HAVE_MEMORY)
+# include <memory>
+#endif
+#if defined(HAVE_TR1_MEMORY)
+# include <tr1/memory>
+#endif
+#if defined(HAVE_BOOST_SHARED_PTR_HPP)
+# include <boost/shared_ptr.hpp>
+#endif
+#include <string>
+
+using $namespace::shared_ptr;
+using namespace std;
+ ]],[[
+shared_ptr<string> test_ptr(new string("test string"));
+ ]])],
+ [
+ ac_cv_shared_ptr_namespace="${namespace}"
+ break
+ ],[ac_cv_shared_ptr_namespace=missing])
+ done
+ ])
+AS_IF([test "x$ac_cv_shared_ptr_namespace" = "missing" ],
+ AC_MSG_ERROR([Can't build ep-engine without a known shared_ptr]))
+
+AC_DEFINE_UNQUOTED([SHARED_PTR_NAMESPACE],
+ ${ac_cv_shared_ptr_namespace},
+ [The namespace in which SHARED_PTR can be found])
+
+AC_CHECK_HEADERS([tr1/unordered_map boost/unordered_map.hpp])
+AC_CACHE_CHECK([the location of unordered_map header file],
+ [ac_cv_unordered_namespace],[
+ for namespace in std tr1 std::tr1 boost
+ do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+#if defined(HAVE_TR1_UNORDERED_MAP)
+# include <tr1/unordered_map>
+#endif
+#if defined(HAVE_BOOST_UNORDERED_MAP_HPP)
+# include <boost/unordered_map.hpp>
+#endif
+#include <string>
+
+using $namespace::unordered_map;
+using namespace std;
+ ]],[[
+unordered_map<string, string> test_map;
+ ]])],
+ [
+ ac_cv_unordered_map_namespace="${namespace}"
+ break
+ ],[ac_cv_unordered_map_namespace=missing])
+ done
+ ])
+
+AC_DEFINE_UNQUOTED([UNORDERED_MAP_NAMESPACE],
+ ${ac_cv_unordered_map_namespace},
+ [The namespace in which UNORDERED_MAP can be found])
+
+AS_IF([test "x$ac_cv_unordered_map_namespace" = "missing" ],
+ AC_MSG_ERROR([Can't build ep-engine without a known unordered_map]))
+
+AC_LANG_POP()
+
+
+saved_LIBS="$LIBS"
+LIBS="$LIBS -lcouchstore"
+AC_CACHE_CHECK([for libcouchstore],[ac_cv_have_libcouchstore],[
+ AC_TRY_LINK([
+ #include <sys/types.h>
+ #include <stdlib.h>
+ #include <libcouchstore/couch_db.h>
+ ],[
+ couchstore_close_db(NULL);
+ ], [
+ ac_cv_have_libcouchstore=yes
+ ], [
+ ac_cv_have_libcouchstore=no
+ ])
+ ])
+LIBS="$saved_LIBS"
+
+AS_IF([test "x$ac_cv_have_libcouchstore" = "xyes"],
+ [ AC_DEFINE([HAVE_LIBCOUCHSTORE], [1], [Have libcouchstore])
+ LTLIBCOUCHSTORE=-lcouchstore
+ ], [
+ AC_MSG_ERROR([Can't build ep-engine without libcouchstore])
+ ])
+
+AC_SUBST(LTLIBCOUCHSTORE)
+AM_CONDITIONAL(HAVE_LIBCOUCHSTORE, [test "x$ac_cv_have_libcouchstore" = "xyes"])
+
+AC_CACHE_CHECK([for libevent >= 1.4], [ac_cv_have_libevent],
+ [ saved_libs="$LIBS"
+ LIBS="$LIBS -levent"
+ AC_TRY_LINK([
+ #include <sys/types.h>
+ #include <event.h>
+ ],[
+ event_base_new();
+ ],[
+ ac_cv_have_libevent="yes"
+ ], [
+ ac_cv_have_libevent="no"
+ ])
+ LIBS="$saved_libs"
+ ])
+LIBS="$saved_LIBS"
+AS_IF([test "x$ac_cv_have_libevent" = "xyes"],
+ [ AC_DEFINE([HAVE_LIBEVENT], [1], [Have libevent])
+ LTLIBEVENT=-levent
+ ])
+AC_SUBST(LTLIBEVENT)
+
PANDORA_ENABLE_DTRACE
AC_ARG_ENABLE([valgrind],
@@ -70,20 +234,6 @@ AC_DEFUN([AC_C_HTONLL],
AC_C_HTONLL
-AC_CHECK_HEADERS([arpa/inet.h])
-AC_CHECK_HEADERS([netdb.h])
-AC_CHECK_HEADERS([mach/mach_time.h])
-AC_CHECK_HEADERS([poll.h])
-AC_CHECK_HEADERS([atomic.h])
-AC_CHECK_HEADERS([sysexits.h])
-AC_CHECK_HEADERS([unistd.h])
-
-AC_CHECK_HEADERS_ONCE([sys/socket.h
- netinet/in.h
- netinet/tcp.h
- ws2tcpip.h
- winsock2.h])
-
AC_CHECK_FUNCS(gethrtime)
AC_SEARCH_LIBS(clock_gettime, rt)
AC_CHECK_FUNCS(clock_gettime)
@@ -149,6 +299,7 @@ AC_ARG_WITH([memcached],
AS_IF(test "x${ac_cv_with_memcached}" != "x",
[CPPFLAGS="-I${ac_cv_with_memcached}/include $CPPFLAGS"
+ AM_CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS"
PATH="${ac_cv_with_memcached}:$PATH"])
AC_CHECK_HEADERS(memcached/engine.h)
@@ -167,13 +318,6 @@ AS_IF(test "x${ENGINE_TESTAPP}" = "xno",
AM_CONDITIONAL(BUILD_BYTEORDER, test "x$ac_cv_have_htonll" != "xyes")
-AS_IF([test "x$SUNCC" = "xyes"],
- [
- CFLAGS="-D_XOPEN_SOURCE=600 $CFLAGS"
- CPPFLAGS="-xldscope=hidden -mt $CPPFLAGS"
- CXXFLAGS="-erroff=truncwarn1,signextwarn,notused,inllargeuse,wunreachable $CXXFLAGS"
- ])
-
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(gethostbyname, nsl)
@@ -210,23 +354,16 @@ return 0;
AM_CONDITIONAL(HAVE_GOOGLETEST, [test "$ac_cv_have_gtest" = "yes"])
+dnl restore CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS
+CFLAGS="$SAVE_CFLAGS"
+CXXFLAGS="$SAVE_CXXFLAGS"
+CPPFLAGS="$SAVE_CPPFLAGS"
+LDFLAGS="$SAVE_LDFLAGS"
+
dnl ----------------------------------------------------------------------------
AC_CONFIG_FILES(Makefile wrapper/wrapper)
AC_OUTPUT
-echo "---"
-echo "Configuration summary for $PACKAGE_NAME version $VERSION"
-echo ""
-echo " * Installation prefix: $prefix"
-echo " * System type: $host_vendor-$host_os"
-echo " * Host CPU: $host_cpu"
-echo " * C Compiler: $CC_VERSION"
-echo " * C++ Compiler: $CXX_VERSION"
-echo " * Assertions enabled: $ac_cv_assert"
-echo " * Debug enabled: $with_debug"
-echo " * Warnings as failure: $ac_cv_warnings_as_errors"
-echo " * Google test framework: $ac_cv_have_gtest"
-echo ""
AS_IF(test "$ac_cv_have_gtest" = "", [
echo "**************************************************************"
echo "You should consider installing gtest to be able to run tests.."
View
103 m4/ac_cxx_compile_stdcxx_0x.m4
@@ -1,103 +0,0 @@
-# ===========================================================================
-# http://autoconf-archive.cryp.to/ac_cxx_compile_stdcxx_0x.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AC_CXX_COMPILE_STDCXX_0X
-#
-# DESCRIPTION
-#
-# Check for baseline language coverage in the compiler for the C++0x
-# standard.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved.
-
-AC_DEFUN([AC_CXX_COMPILE_STDCXX_0X], [
- AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
- ac_cv_cxx_compile_cxx0x_native,
- [AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([
- template <typename T>
- struct check
- {
- static_assert(sizeof(int) <= sizeof(T), "not big enough");
- };
-
- typedef check<check<bool>> right_angle_brackets;
-
- int a;
- decltype(a) b;
-
- typedef check<int> check_type;
- check_type c;
- check_type&& cr = c;],,
- ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no)
- AC_LANG_RESTORE
- ])
-
- AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
- ac_cv_cxx_compile_cxx0x_cxx,
- [AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=c++0x"
- AC_TRY_COMPILE([
- template <typename T>
- struct check
- {
- static_assert(sizeof(int) <= sizeof(T), "not big enough");
- };
-
- typedef check<check<bool>> right_angle_brackets;
-
- int a;
- decltype(a) b;
-
- typedef check<int> check_type;
- check_type c;
- check_type&& cr = c;],,
- ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no)
- CXXFLAGS="$ac_save_CXXFLAGS"
- AC_LANG_RESTORE
- ])
-
- AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
- ac_cv_cxx_compile_cxx0x_gxx,
- [AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=gnu++0x"
- AC_TRY_COMPILE([
- template <typename T>
- struct check
- {
- static_assert(sizeof(int) <= sizeof(T), "not big enough");
- };
-
- typedef check<check<bool>> right_angle_brackets;
-
- int a;
- decltype(a) b;
-
- typedef check<int> check_type;
- check_type c;
- check_type&& cr = c;],,
- ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no)
- CXXFLAGS="$ac_save_CXXFLAGS"
- AC_LANG_RESTORE
- ])
-
- if test "$ac_cv_cxx_compile_cxx0x_native" = yes ||
- test "$ac_cv_cxx_compile_cxx0x_cxx" = yes ||
- test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then
- AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])
- fi
-])
View
67 m4/ac_cxx_header_stdcxx_98.m4
@@ -1,67 +0,0 @@
-dnl Copyright © 2008 Benjamin Kosnik <bkoz@redhat.com>
-
-dnl Copying and distribution of 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_PUSH(C++)
- AC_TRY_COMPILE([
- #include <cassert>
- #include <cctype>
- #include <cerrno>
- #include <cfloat>
- #include <ciso646>
- #include <climits>
- #include <clocale>
- #include <cmath>
- #include <csetjmp>
- #include <csignal>
- #include <cstdarg>
- #include <cstddef>
- #include <cstdio>
- #include <cstdlib>
- #include <cstring>
- #include <ctime>
-
- #include <algorithm>
- #include <bitset>
- #include <complex>
- #include <deque>
- #include <exception>
- #include <fstream>
- #include <functional>
- #include <iomanip>
- #include <ios>
- #include <iosfwd>
- #include <iostream>
- #include <istream>
- #include <iterator>
- #include <limits>
- #include <list>
- #include <locale>
- #include <map>
- #include <memory>
- #include <new>
- #include <numeric>
- #include <ostream>
- #include <queue>
- #include <set>
- #include <sstream>
- #include <stack>
- #include <stdexcept>
- #include <streambuf>
- #include <string>
- #include <typeinfo>
- #include <utility>
- #include <valarray>
- #include <vector>
- ],,
- ac_cv_cxx_stdcxx_98=yes, ac_cv_cxx_stdcxx_98=no)
- AC_LANG_POP()
- ])
- if test "$ac_cv_cxx_stdcxx_98" = yes; then
- AC_DEFINE(STDCXX_98_HEADERS,,[Define if ISO C++ 1998 header files are present. ])
- fi
-])
View
276 m4/acx_pthread.m4
@@ -1,276 +0,0 @@
-##### http://autoconf-archive.cryp.to/acx_pthread.html
-#
-# SYNOPSIS
-#
-# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
-#
-# DESCRIPTION
-#
-# This macro figures out how to build C programs using POSIX threads.
-# It sets the PTHREAD_LIBS output variable to the threads library and
-# linker flags, and the PTHREAD_CFLAGS output variable to any special
-# C compiler flags that are needed. (The user can also force certain
-# compiler flags/libs to be tested by setting these environment
-# variables.)
-#
-# Also sets PTHREAD_CC to any special C compiler that is needed for
-# multi-threaded programs (defaults to the value of CC otherwise).
-# (This is necessary on AIX to use the special cc_r compiler alias.)
-#
-# NOTE: You are assumed to not only compile your program with these
-# flags, but also link it with them as well. e.g. you should link
-# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
-# $LIBS
-#
-# If you are only building threads programs, you may wish to use
-# these variables in your default LIBS, CFLAGS, and CC:
-#
-# LIBS="$PTHREAD_LIBS $LIBS"
-# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-# CC="$PTHREAD_CC"
-#
-# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
-# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
-# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
-#
-# ACTION-IF-FOUND is a list of shell commands to run if a threads
-# library is found, and ACTION-IF-NOT-FOUND is a list of commands to
-# run it if it is not found. If ACTION-IF-FOUND is not specified, the
-# default action will define HAVE_PTHREAD.
-#
-# Please let the authors know if this macro fails on any platform, or
-# if you have any other suggestions or comments. This macro was based
-# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
-# (with help from M. Frigo), as well as ac_pthread and hb_pthread
-# macros posted by Alejandro Forero Cuervo to the autoconf macro
-# repository. We are also grateful for the helpful feedback of
-# numerous users.
-#
-# LAST MODIFICATION
-#
-# 2006-05-29
-#
-# COPYLEFT
-#
-# Copyright (c) 2006 Steven G. Johnson <stevenj@alum.mit.edu>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
-# As a special exception, the respective Autoconf Macro's copyright
-# owner gives unlimited permission to copy, distribute and modify the
-# configure scripts that are the output of Autoconf when processing
-# the Macro. You need not follow the terms of the GNU General Public
-# License when using or distributing such scripts, even though
-# portions of the text of the Macro appear in them. The GNU General
-# Public License (GPL) does govern all other use of the material that
-# constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the
-# Autoconf Macro released by the Autoconf Macro Archive. When you
-# make and distribute a modified version of the Autoconf Macro, you
-# may extend this special exception to the GPL to apply to your
-# modified version as well.
-
-AC_DEFUN([ACX_PTHREAD], [
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_LANG_PUSH([C])
-acx_pthread_ok=no
-
-# We used to check for pthread.h first, but this fails if pthread.h
-# requires special compiler flags (e.g. on True64 or Sequent).
-# It gets checked for in the link test anyway.
-
-# First of all, check if the user has set any of the PTHREAD_LIBS,
-# etcetera environment variables, and if threads linking works using
-# them:
-if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- save_LIBS="$LIBS"
- LIBS="$PTHREAD_LIBS $LIBS"
- AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
- AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
- AC_MSG_RESULT($acx_pthread_ok)
- if test x"$acx_pthread_ok" = xno; then
- PTHREAD_LIBS=""
- PTHREAD_CFLAGS=""
- fi
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-fi
-
-# We must check for the threads library under a number of different
-# names; the ordering is very important because some systems
-# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
-# libraries is broken (non-POSIX).
-
-# Create a list of thread flags to try. Items starting with a "-" are
-# C compiler flags, and other items are library names, except for "none"
-# which indicates that we try without any flags at all, and "pthread-config"
-# which is a program returning the flags for the Pth emulation library.
-
-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
-
-# The ordering *is* (sometimes) important. Some notes on the
-# individual items follow:
-
-# pthreads: AIX (must check this before -lpthread)
-# none: in case threads are in libc; should be tried before -Kthread and
-# other compiler flags to prevent continual compiler warnings
-# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
-# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
-# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
-# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
-# -pthreads: Solaris/gcc
-# -mthreads: Mingw32/gcc, Lynx/gcc
-# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
-# doesn't hurt to check since this sometimes defines pthreads too;
-# also defines -D_REENTRANT)
-# ... -mt is also the pthreads flag for HP/aCC
-# pthread: Linux, etcetera
-# --thread-safe: KAI C++
-# pthread-config: use pthread-config program (for GNU Pth library)
-
-case "${host_cpu}-${host_os}" in
- *solaris*)
-
- # On Solaris (at least, for some versions), libc contains stubbed
- # (non-functional) versions of the pthreads routines, so link-based
- # tests will erroneously succeed. (We need to link with -pthreads/-mt/
- # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
- # a function called by this macro, so we could check for that, but
- # who knows whether they'll stub that too in a future libc.) So,
- # we'll just look for -pthreads and -lpthread first:
-
- acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
- ;;
-esac
-
-if test x"$acx_pthread_ok" = xno; then
-for flag in $acx_pthread_flags; do
-
- case $flag in
- none)
- AC_MSG_CHECKING([whether pthreads work without any flags])
- ;;
-
- -*)
- AC_MSG_CHECKING([whether pthreads work with $flag])
- PTHREAD_CFLAGS="$flag"
- ;;
-
- pthread-config)
- AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
- if test x"$acx_pthread_config" = xno; then continue; fi
- PTHREAD_CFLAGS="`pthread-config --cflags`"
- PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
- ;;
-
- *)
- AC_MSG_CHECKING([for the pthreads library -l$flag])
- PTHREAD_LIBS="-l$flag"
- ;;
- esac
-
- save_LIBS="$LIBS"
- save_CFLAGS="$CFLAGS"
- LIBS="$PTHREAD_LIBS $LIBS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-
- # Check for various functions. We must include pthread.h,
- # since some functions may be macros. (On the Sequent, we
- # need a special flag -Kthread to make this header compile.)
- # We check for pthread_join because it is in -lpthread on IRIX
- # while pthread_create is in libc. We check for pthread_attr_init
- # due to DEC craziness with -lpthreads. We check for
- # pthread_cleanup_push because it is one of the few pthread
- # functions on Solaris that doesn't have a non-functional libc stub.
- # We try pthread_create on general principles.
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_t th; pthread_join(th, 0);
- pthread_attr_init(0); pthread_cleanup_push(0, 0);
- pthread_create(0,0,0,0); pthread_cleanup_pop(0); ]])],[acx_pthread_ok=yes],[])
-
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-
- AC_MSG_RESULT($acx_pthread_ok)
- if test "x$acx_pthread_ok" = xyes; then
- break;
- fi
-
- PTHREAD_LIBS=""
- PTHREAD_CFLAGS=""
-done
-fi
-
-# Various other checks:
-if test "x$acx_pthread_ok" = xyes; then
- save_LIBS="$LIBS"
- LIBS="$PTHREAD_LIBS $LIBS"
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-
- # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
- AC_MSG_CHECKING([for joinable pthread attribute])
- attr_name=unknown
- for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[int attr=$attr; return attr;]])],[attr_name=$attr; break],[])
- done
- AC_MSG_RESULT($attr_name)
- if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
- AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
- [Define to necessary symbol if this constant
- uses a non-standard name on your system.])
- fi
-
- AC_MSG_CHECKING([if more special flags are required for pthreads])
- flag=no
- case "${host_cpu}-${host_os}" in
- *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
- *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
- esac
- AC_MSG_RESULT(${flag})
- if test "x$flag" != xno; then
- PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
- fi
-
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-
- # More AIX lossage: must compile with xlc_r or cc_r
- if test x"$GCC" != xyes; then
- AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
- else
- PTHREAD_CC=$CC
- fi
-else
- PTHREAD_CC="$CC"
-fi
-
-AC_SUBST(PTHREAD_LIBS)
-AC_SUBST(PTHREAD_CFLAGS)
-AC_SUBST(PTHREAD_CC)
-
-# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
-if test x"$acx_pthread_ok" = xyes; then
- ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
- :
-else
- acx_pthread_ok=no
- $2
-fi
-AC_LANG_POP([])
-])dnl ACX_PTHREAD
View
228 m4/couchbase.m4
@@ -0,0 +1,228 @@
+dnl Copyright (C) 2011 Couchbase, Inc
+dnl This file is free software; Couchbase, 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([COUCHBASE_GENERIC_COMPILER], [
+ AC_ARG_ENABLE([warnings],
+ [AS_HELP_STRING([--enable-warnings],
+ [Enable more compiler warnings. @<:@default=off@:>@])],
+ [ac_cv_enable_warnings="yes"],
+ [ac_cv_enable_warnings="no"])
+
+ AC_ARG_ENABLE([werror],
+ [AS_HELP_STRING([--enable-werror],
+ [Treat warnings as errors. @<:@default=off@:>@])],
+ [ac_cv_enable_werror="yes"],
+ [ac_cv_enable_werror="no"])
+
+ AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug],
+ [Enable debug build (non-optimized). @<:@default=off@:>@])],
+ [ac_cv_enable_debug="yes"],
+ [ac_cv_enable_debug="no"])
+
+ AC_ARG_ENABLE([gcov],
+ [AS_HELP_STRING([--enable-gcov],
+ [Enable gcov build (code coverage). @<:@default=off@:>@])],
+ [ac_cv_enable_gcov="yes"],
+ [ac_cv_enable_gcov="no"])
+
+ AC_ARG_ENABLE([tcov],
+ [AS_HELP_STRING([--enable-tcov],
+ [Enable tcov build (code coverage). @<:@default=off@:>@])],
+ [ac_cv_enable_tcov="yes"],
+ [ac_cv_enable_tcov="no"])
+
+ AC_CACHE_CHECK([whether the C++ compiler works], [ac_cv_prog_cxx_works], [
+ AC_LANG_PUSH([C++])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+ [ac_cv_prog_cxx_works=yes],
+ [ac_cv_prog_cxx_works=no])
+ AC_LANG_POP([C++])])
+
+ C_LANGUAGE_SPEC=c99
+ m4_foreach([arg], [$*],
+ [
+ m4_case(arg, [c89], [C_LANGUAGE_SPEC=c89],
+ [c99], [C_LANGUAGE_SPEC=c99],
+ [cxx], [NEED_CPP=yes],
+ [pthread], [PTHREAD=yes])
+ ])
+
+ GCC_NO_WERROR="-Wno-error"
+ GCC_WERROR="-Werror"
+ GCC_C_OPTIMIZE="-O3"
+ GCC_CXX_OPTIMIZE="-O3"
+ GCC_C_DEBUG="-O0 -g3"
+ GCC_CXX_DEBUG="-O0 -g3"
+ GCC_VISIBILITY="-DHAVE_VISIBILITY=1 -fvisibility=hidden"
+ GCC_CPPFLAGS="-pipe"
+ GCC_CFLAGS="-std=gnu99"
+ GCC_CXXFLAGS=""
+ GCC_C89=-std=c89
+ GCC_C99=-std=gnu99
+ GCC_LDFLAGS=""
+ GCC_CPP_WARNINGS="-Wall -pedantic -Wshadow -fdiagnostics-show-option -Wformat -fno-strict-aliasing -Wno-strict-aliasing -Wextra"
+ GCC_C_COMPILER_WARNINGS="-Wundef -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align"
+ GCC_CXX_COMPILER_WARNINGS="-std=gnu++98 -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long -Wno-redundant-decls"
+
+ SPRO_NO_WERROR="-errwarn=%none"
+ SPRO_WERROR="-errwarn=%all"
+ SPRO_C_OPTIMIZE="-O -xbuiltin=%default"
+ SPRO_CXX_OPTIMIZE="-O -xbuiltin=%default"
+ SPRO_C_DEBUG="-g3 -traceback=common -xcheck=%all"
+ SPRO_CXX_DEBUG="-g3 -traceback=common -xcheck=%all"
+ SPRO_VISIBILITY="-xldscope=hidden"
+ SPRO_CPPFLAGS="-mt=yes -D_THREAD_SAFE"
+ SPRO_CXXFLAGS="-xlang=c99 -compat=5 -library=stlport4 -template=no%extdef"
+ SPRO_C89="-Xt -xc99=none"
+ SPRO_C99="-D_XOPEN_SOURCE=600 -xc99=all"
+ SPRO_CFLAGS=""
+ SPRO_CPP_WARNINGS="-errhdr=%user -errfmt=error -errshort=full -errtags "
+ SPRO_C_COMPILER_WARNINGS="-v"
+ SPRO_CXX_COMPILER_WARNINGS="+w +w2"
+ SPRO_LDFLAGS="-mt=yes"
+
+ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+ AC_CHECK_DECL([__GNUC__], [GCC="yes"], [GCC="no"])
+
+ AS_IF([test "x$GCC" = "xyes"],
+ [
+ AM_CPPFLAGS="$AM_CPPFLAGS $GCC_CPPFLAGS"
+ AM_CFLAGS="$AM_CPPFLAGS $GCC_CFLAGS"
+ AM_CXXFLAGS="$AM_CPPFLAGS $GCC_CXXFLAGS"
+ AS_IF(test "$C_LANGUAGE_SPEC" = c89,
+ [AM_CFLAGS="$AM_CPPFLAGS $GCC_C89"],
+ AS_IF(test "$C_LANGUAGE_SPEC" = c99,
+ [AM_CFLAGS="$AM_CPPFLAGS $GCC_C99"])
+ )
+ AM_LDFLAGS="$AM_LDFLAGS $GCC_LDFLAGS"
+ NO_WERROR="$GCC_NO_WERROR"
+ WERROR="$GCC_WERROR"
+ C_OPTIMIZE="$GCC_C_OPTIMIZE"
+ CXX_OPTIMIZE="$GCC_CXX_OPTIMIZE"
+ C_DEBUG="$GCC_C_DEBUG"
+ CXX_DEBUG="$GCC_CXX_DEBUG"
+ VISIBILITY="$GCC_VISIBILITY"
+ CPP_WARNINGS="$GCC_CPP_WARNINGS"
+ C_COMPILER_WARNINGS="$GCC_C_COMPILER_WARNINGS"
+ CXX_COMPILER_WARNINGS="$GCC_CXX_COMPILER_WARNINGS"
+ ])
+
+ AS_IF([test "x$SUNCC" = "xyes"],
+ [
+ AM_CPPFLAGS="$AM_CPPFLAGS $SPRO_CPPFLAGS"
+ AM_CFLAGS="$AM_CPPFLAGS $SPRO_CFLAGS"
+ AM_CXXFLAGS="$AM_CPPFLAGS $SPRO_CXXFLAGS"
+ AS_IF(test "$C_LANGUAGE_SPEC" = c89,
+ [AM_CFLAGS="$AM_CPPFLAGS $SPRO_C89"],
+ AS_IF(test "$C_LANGUAGE_SPEC" = c99,
+ [AM_CFLAGS="$AM_CPPFLAGS $SPRO_C99"])
+ )
+ AM_LDFLAGS="$AM_LDFLAGS $SPRO_LDFLAGS"
+ NO_WERROR="$SPRO_NO_WERROR"
+ WERROR="$SPRO_WERROR"
+ C_OPTIMIZE="$SPRO_C_OPTIMIZE"
+ CXX_OPTIMIZE="$SPRO_CXX_OPTIMIZE"
+ C_DEBUG="$SPRO_C_DEBUG"
+ CXX_DEBUG="$SPRO_CXX_DEBUG"
+ VISIBILITY="$SPRO_VISIBILITY"
+ CPP_WARNINGS="$SPRO_CPP_WARNINGS"
+ C_COMPILER_WARNINGS="$SPRO_C_COMPILER_WARNINGS"
+ CXX_COMPILER_WARNINGS="$SPRO_CXX_COMPILER_WARNINGS"
+ ])
+
+ AM_CPPFLAGS="$AM_CPPFLAGS -I\${top_srcdir}/include $VISIBILITY"
+ AM_LDFLAGS="$AM_LDFLAGS $VISIBILITY"
+
+
+ AS_IF([test "$ac_cv_enable_warnings" = "yes"],
+ [AM_CPPFLAGS="$AM_CPPFLAGS $CPP_WARNINGS"
+ AM_CFLAGS="$AM_CFLAGS $C_COMPILER_WARNINGS"
+ AM_CXXFLAGS="$AM_CXXFLAGS $CXX_COMPILER_WARNINGS"])
+
+ AS_IF([test "$ac_cv_enable_werror" = "yes"],
+ [
+ AM_CPPFLAGS="$AM_CPPFLAGS $WERROR"
+ ])
+
+ AS_IF([test "$ac_cv_enable_debug" = "yes"],
+ [
+ AM_CFLAGS="$AM_CFLAGS $C_DEBUG"
+ AM_CXXFLAGS="$AM_CXXFLAGS $CXX_DEBUG"
+ ],
+ [
+ AM_CFLAGS="$AM_CFLAGS $C_OPTIMIZE"
+ AM_CXXFLAGS="$AM_CXXFLAGS $CXX_OPTIMIZE"
+ ])
+
+ dnl gcov settings
+ AS_IF([test "$ac_cv_enable_gcov" = "yes"],
+ [
+ AM_CPPFLAGS="$AM_CPPFLAGS -fprofile-arcs -ftest-coverage"
+ AM_LDFLAGS="$AM_LDFLAGS -lgcov"
+ AC_DEFINE(ENABLE_GCOV, 1, [gcov enabled])
+ ])
+ AM_CONDITIONAL(ENABLE_GCOV, [test "$ac_cv_enable_gcov" = "yes"])
+
+ dnl tcov settings
+ AS_IF([test "$ac_cv_enable_tcov" = "yes"],
+ [
+ AM_CPPFLAGS="$AM_CPPFLAGS -xprofile=tcov"
+ AM_LDFLAGS="$AM_LDFLAGS -xprofile=tcov"
+ dnl due to the stupid libtool it's dropping -xprofile when
+ dnl building shared objects.. let's fool it..
+ AM_PROFILE_SOLDFLAGS="-Wc,-xprofile=tcov"
+ AC_DEFINE(ENABLE_TCOV, 1, [tcov enabled])
+ ])
+ AM_CONDITIONAL(ENABLE_TCOV, [test "$ac_cv_enable_tcov" = "yes"])
+ AC_SUBST(AM_PROFILE_SOLDFLAGS)
+
+ AS_IF([ test "x$PTHREAD" = "xyes" ], [
+ GCC_CPPFLAGS="$GCC_CPPFLAGS -pthread -D_THREAD_SAFE"
+ GCC_LDFLAGS="-lpthread"
+ ])
+
+ dnl Export GCC variables
+ AC_SUBST(GCC_NO_WERROR)
+ AC_SUBST(GCC_WERROR)
+ AC_SUBST(GCC_C_OPTIMIZE)
+ AC_SUBST(GCC_CXX_OPTIMIZE)
+ AC_SUBST(GCC_C_DEBUG)
+ AC_SUBST(GCC_CXX_DEBUG)
+ AC_SUBST(GCC_VISIBILITY)
+ AC_SUBST(GCC_CPPFLAGS)
+ AC_SUBST(GCC_CPP_WARNINGS)
+ AC_SUBST(GCC_C_COMPILER_WARNINGS)
+ AC_SUBST(GCC_CXX_COMPILER_WARNINGS)
+
+ dnl Export Sun Studio variables
+ AC_SUBST(SPRO_NO_WERROR)
+ AC_SUBST(SPRO_WERROR)
+ AC_SUBST(SPRO_C_OPTIMIZE)
+ AC_SUBST(SPRO_CXX_OPTIMIZE)
+ AC_SUBST(SPRO_C_DEBUG)
+ AC_SUBST(SPRO_CXX_DEBUG)
+ AC_SUBST(SPRO_VISIBILITY)
+ AC_SUBST(SPRO_CPPFLAGS)
+ AC_SUBST(SPRO_CPP_WARNINGS)
+ AC_SUBST(SPRO_C_COMPILER_WARNINGS)
+ AC_SUBST(SPRO_CXX_COMPILER_WARNINGS)
+
+ dnl Export the ones we're using
+ AC_SUBST(NO_WERROR)
+ AC_SUBST(WERROR)
+ AC_SUBST(C_OPTIMIZE)
+ AC_SUBST(CXX_OPTIMIZE)
+ AC_SUBST(C_DEBUG)
+ AC_SUBST(CXX_DEBUG)
+ AC_SUBST(VISIBILITY)
+ AC_SUBST(CPP_WARNINGS)
+ AC_SUBST(C_COMPILER_WARNINGS)
+ AC_SUBST(CXX_COMPILER_WARNINGS)
+ AC_SUBST(AM_LDFLAGS)
+ AC_SUBST(AM_CPPFLAGS)
+ AC_SUBST(AM_CFLAGS)
+ AC_SUBST(AM_CXXFLAGS)
+])
View
110 m4/lib-ld.m4
@@ -1,110 +0,0 @@
-# lib-ld.m4 serial 3 (gettext-0.13)
-dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Subroutines of libtool.m4,
-dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
-dnl with libtool.m4.
-
-dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
-AC_DEFUN([AC_LIB_PROG_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- acl_cv_prog_gnu_ld=yes ;;
-*)
- acl_cv_prog_gnu_ld=no ;;
-esac])
-with_gnu_ld=$acl_cv_prog_gnu_ld
-])
-
-dnl From libtool-1.4. Sets the variable LD.
-AC_DEFUN([AC_LIB_PROG_LD],
-[AC_ARG_WITH(gnu-ld,
-[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by GCC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]* | [A-Za-z]:[\\/]*)]
- [re_direlt='/[^/][^/]*/\.\./']
- # Canonicalize the path of ld
- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(acl_cv_path_LD,
-[if test -z "$LD"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- acl_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some GNU ld's only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break ;;
- *)
- test "$with_gnu_ld" != yes && break ;;
- esac
- fi
- done
- IFS="$ac_save_ifs"
-else
- acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$acl_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_LIB_PROG_LD_GNU
-])
View
767 m4/lib-link.m4
@@ -1,767 +0,0 @@
-# lib-link.m4 serial 18 (gettext-0.18)
-dnl Copyright (C) 2001-2009 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-AC_PREREQ([2.54])
-
-dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
-dnl the libraries corresponding to explicit and implicit dependencies.
-dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
-dnl augments the CPPFLAGS variable.
-dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
-dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
-AC_DEFUN([AC_LIB_LINKFLAGS],
-[
- AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
- AC_REQUIRE([AC_LIB_RPATH])
- pushdef([Name],[translit([$1],[./-], [___])])
- pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
- AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
- AC_LIB_LINKFLAGS_BODY([$1], [$2])
- ac_cv_lib[]Name[]_libs="$LIB[]NAME"
- ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
- ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
- ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
- ])
- LIB[]NAME="$ac_cv_lib[]Name[]_libs"
- LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
- INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
- LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
- AC_SUBST([LIB]NAME)
- AC_SUBST([LTLIB]NAME)
- AC_SUBST([LIB]NAME[_PREFIX])
- dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
- dnl results of this search when this library appears as a dependency.
- HAVE_LIB[]NAME=yes
- popdef([NAME])
- popdef([Name])
-])
-
-dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [system])
-dnl searches for libname and the libraries corresponding to explicit and
-dnl implicit dependencies, together with the specified include files and
-dnl the ability to compile and link the specified testcode. If found, it
-dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
-dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
-dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
-dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
-dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
-dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
-AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
-[
- AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
- AC_REQUIRE([AC_LIB_RPATH])
- pushdef([Name],[translit([$1],[./-], [___])])
- pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-
- dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
- dnl accordingly.
- AC_LIB_LINKFLAGS_BODY([$1], [$2], [$5])
-
- dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
- dnl because if the user has installed lib[]Name and not disabled its use
- dnl via --without-lib[]Name-prefix, he wants to use it.
- ac_save_CPPFLAGS="$CPPFLAGS"
- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
-
- AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS $LIB[]NAME"
- AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
- LIBS="$ac_save_LIBS"
- ])
- if test "$ac_cv_lib[]Name" = yes; then
- HAVE_LIB[]NAME=yes
- AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
- AC_MSG_CHECKING([how to link with lib[]$1])
- AC_MSG_RESULT([$LIB[]NAME])
- else
- HAVE_LIB[]NAME=no
- dnl If $LIB[]NAME didn't lead to a usable library, we don't need
- dnl $INC[]NAME either.
- CPPFLAGS="$ac_save_CPPFLAGS"
- LIB[]NAME=
- LTLIB[]NAME=
- LIB[]NAME[]_PREFIX=
- fi
- AC_SUBST([HAVE_LIB]NAME)
- AC_SUBST([LIB]NAME)
- AC_SUBST([LTLIB]NAME)
- AC_SUBST([LIB]NAME[_PREFIX])
- popdef([NAME])
- popdef([Name])
-])
-
-dnl Determine the platform dependent parameters needed to use rpath:
-dnl acl_libext,
-dnl acl_shlibext,
-dnl acl_hardcode_libdir_flag_spec,
-dnl acl_hardcode_libdir_separator,
-dnl acl_hardcode_direct,
-dnl acl_hardcode_minus_L.
-AC_DEFUN([AC_LIB_RPATH],
-[
- dnl Tell automake >= 1.10 to complain if config.rpath is missing.
- m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
- AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
- AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
- AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
- AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
- CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
- ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
- . ./conftest.sh
- rm -f ./conftest.sh
- acl_cv_rpath=done
- ])
- wl="$acl_cv_wl"
- acl_libext="$acl_cv_libext"
- acl_shlibext="$acl_cv_shlibext"
- acl_libname_spec="$acl_cv_libname_spec"
- acl_library_names_spec="$acl_cv_library_names_spec"
- acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
- acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
- acl_hardcode_direct="$acl_cv_hardcode_direct"
- acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
- dnl Determine whether the user wants rpath handling at all.
- AC_ARG_ENABLE([rpath],
- [ --disable-rpath do not hardcode runtime library paths],
- :, enable_rpath=yes)
-])
-
-dnl AC_LIB_FROMPACKAGE(name, package)
-dnl declares that libname comes from the given package. The configure file
-dnl will then not have a --with-libname-prefix option but a
-dnl --with-package-prefix option. Several libraries can come from the same
-dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
-dnl macro call that searches for libname.
-AC_DEFUN([AC_LIB_FROMPACKAGE],
-[
- pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
- define([acl_frompackage_]NAME, [$2])
- popdef([NAME])
- pushdef([PACK],[$2])
- pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
- define([acl_libsinpackage_]PACKUP,
- m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
- popdef([PACKUP])
- popdef([PACK])
-])
-
-dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies, system]) searches for
-dnl libname and the libraries corresponding to explicit and implicit
-dnl dependencies.
-dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
-dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
-dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
-dnl If system==system, -isystem is used instead of -I
-AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
-[
- AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
- pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
- pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
- pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
- pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
- dnl Autoconf >= 2.61 supports dots in --with options.
- pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
- dnl By default, look in $includedir and $libdir.
- use_additional=yes
- if test "x$GCC" = "xyes" -a "x$3" = "xsystem"
- then
- i_system="-isystem "
- else
- i_system="-I"
- fi
-
- AC_LIB_WITH_FINAL_PREFIX([
- eval additional_includedir=\"$includedir\"
- eval additional_libdir=\"$libdir\"
- ])
- AC_ARG_WITH(P_A_C_K[-prefix],
-[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
- --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
-[
- if test "X$withval" = "Xno"; then
- use_additional=no
- else
- if test "X$withval" = "X"; then
- AC_LIB_WITH_FINAL_PREFIX([
- eval additional_includedir=\"$includedir\"
- eval additional_libdir=\"$libdir\"
- ])
- else
- additional_includedir="$withval/include"
- additional_libdir="$withval/$acl_libdirstem"
- if test "$acl_libdirstem2" != "$acl_libdirstem" \
- && ! test -d "$withval/$acl_libdirstem"; then
- additional_libdir="$withval/$acl_libdirstem2"
- fi
- fi
- fi
-])
- dnl Search the library and its dependencies in $additional_libdir and
- dnl $LDFLAGS. Using breadth-first-seach.
- LIB[]NAME=
- LTLIB[]NAME=
- INC[]NAME=
- LIB[]NAME[]_PREFIX=
- rpathdirs=
- ltrpathdirs=
- names_already_handled=
- names_next_round='$1 $2'
- while test -n "$names_next_round"; do
- names_this_round="$names_next_round"
- names_next_round=
- for name in $names_this_round; do
- already_handled=
- for n in $names_already_handled; do
- if test "$n" = "$name"; then
- already_handled=yes
- break
- fi
- done
- if test -z "$already_handled"; then
- names_already_handled="$names_already_handled $name"
- dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
- dnl or AC_LIB_HAVE_LINKFLAGS call.
- uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
- eval value=\"\$HAVE_LIB$uppername\"
- if test -n "$value"; then
- if test "$value" = yes; then
- eval value=\"\$LIB$uppername\"
- test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
- eval value=\"\$LTLIB$uppername\"
- test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
- else
- dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
- dnl that this library doesn't exist. So just drop it.
- :
- fi
- else
- dnl Search the library lib$name in $additional_libdir and $LDFLAGS
- dnl and the already constructed $LIBNAME/$LTLIBNAME.
- found_dir=
- found_la=
- found_so=
- found_a=
- eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
- if test -n "$acl_shlibext"; then
- shrext=".$acl_shlibext" # typically: shrext=.so
- else
- shrext=
- fi
- if test $use_additional = yes; then
- dir="$additional_libdir"
- dnl The same code as in the loop below:
- dnl First look for a shared library.
- if test -n "$acl_shlibext"; then
- if test -f "$dir/$libname$shrext"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext"
- else
- if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
- ver=`(cd "$dir" && \
- for f in "$libname$shrext".*; do echo "$f"; done \
- | sed -e "s,^$libname$shrext\\\\.,," \
- | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
- | sed 1q ) 2>/dev/null`
- if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext.$ver"
- fi
- else
- eval library_names=\"$acl_library_names_spec\"
- for f in $library_names; do
- if test -f "$dir/$f"; then
- found_dir="$dir"
- found_so="$dir/$f"
- break
- fi
- done
- fi
- fi
- fi
- dnl Then look for a static library.
- if test "X$found_dir" = "X"; then
- if test -f "$dir/$libname.$acl_libext"; then
- found_dir="$dir"
- found_a="$dir/$libname.$acl_libext"
- fi
- fi
- if test "X$found_dir" != "X"; then
- if test -f "$dir/$libname.la"; then
- found_la="$dir/$libname.la"
- fi
- fi
- fi
- if test "X$found_dir" = "X"; then
- for x in $LDFLAGS $LTLIB[]NAME; do
- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
- case "$x" in
- -L*)
- dir=`echo "X$x" | sed -e 's/^X-L//'`
- dnl First look for a shared library.
- if test -n "$acl_shlibext"; then
- if test -f "$dir/$libname$shrext"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext"
- else
- if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
- ver=`(cd "$dir" && \
- for f in "$libname$shrext".*; do echo "$f"; done \
- | sed -e "s,^$libname$shrext\\\\.,," \
- | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
- | sed 1q ) 2>/dev/null`
- if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext.$ver"
- fi
- else
- eval library_names=\"$acl_library_names_spec\"
- for f in $library_names; do
- if test -f "$dir/$f"; then
- found_dir="$dir"
- found_so="$dir/$f"
- break
- fi
- done
- fi
- fi
- fi
- dnl Then look for a static library.
- if test "X$found_dir" = "X"; then
- if test -f "$dir/$libname.$acl_libext"; then
- found_dir="$dir"
- found_a="$dir/$libname.$acl_libext"
- fi
- fi
- if test "X$found_dir" != "X"; then
- if test -f "$dir/$libname.la"; then
- found_la="$dir/$libname.la"
- fi
- fi
- ;;
- esac
- if test "X$found_dir" != "X"; then
- break
- fi
- done
- fi
- if test "X$found_dir" != "X"; then
- dnl Found the library.
- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
- if test "X$found_so" != "X"; then
- dnl Linking with a shared library. We attempt to hardcode its
- dnl directory into the executable's runpath, unless it's the
- dnl standard /usr/lib.
- if test "$enable_rpath" = no \
- || test "X$found_dir" = "X/usr/$acl_libdirstem" \
- || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
- dnl No hardcoding is needed.
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
- else
- dnl Use an explicit option to hardcode DIR into the resulting
- dnl binary.
- dnl Potentially add DIR to ltrpathdirs.
- dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
- haveit=
- for x in $ltrpathdirs; do
- if test "X$x" = "X$found_dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- ltrpathdirs="$ltrpathdirs $found_dir"
- fi
- dnl The hardcoding into $LIBNAME is system dependent.
- if test "$acl_hardcode_direct" = yes; then
- dnl Using DIR/libNAME.so during linking hardcodes DIR into the
- dnl resulting binary.
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
- else
- if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
- dnl Use an explicit option to hardcode DIR into the resulting
- dnl binary.
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
- dnl Potentially add DIR to rpathdirs.
- dnl The rpathdirs will be appended to $LIBNAME at the end.
- haveit=
- for x in $rpathdirs; do
- if test "X$x" = "X$found_dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- rpathdirs="$rpathdirs $found_dir"
- fi
- else
- dnl Rely on "-L$found_dir".
- dnl But don't add it if it's already contained in the LDFLAGS
- dnl or the already constructed $LIBNAME
- haveit=
- for x in $LDFLAGS $LIB[]NAME; do
- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
- if test "X$x" = "X-L$found_dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
- fi
- if test "$acl_hardcode_minus_L" != no; then
- dnl FIXME: Not sure whether we should use
- dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
- dnl here.
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
- else
- dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
- dnl here, because this doesn't fit in flags passed to the
- dnl compiler. So give up. No hardcoding. This affects only
- dnl very old systems.
- dnl FIXME: Not sure whether we should use
- dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
- dnl here.
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
- fi
- fi
- fi
- fi
- else
- if test "X$found_a" != "X"; then
- dnl Linking with a static library.
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
- else
- dnl We shouldn't come here, but anyway it's good to have a
- dnl fallback.
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
- fi
- fi
- dnl Assume the include files are nearby.
- additional_includedir=
- case "$found_dir" in
- */$acl_libdirstem | */$acl_libdirstem/)
- basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
- if test "$name" = '$1'; then
- LIB[]NAME[]_PREFIX="$basedir"
- fi
- additional_includedir="$basedir/include"
- ;;
- */$acl_libdirstem2 | */$acl_libdirstem2/)
- basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
- if test "$name" = '$1'; then
- LIB[]NAME[]_PREFIX="$basedir"
- fi
- additional_includedir="$basedir/include"
- ;;
- esac
- if test "X$additional_includedir" != "X"; then
- dnl Potentially add $additional_includedir to $INCNAME.
- dnl But don't add it
- dnl 1. if it's the standard /usr/include,
- dnl 2. if it's /usr/local/include and we are using GCC on Linux,
- dnl 3. if it's already present in $CPPFLAGS or the already
- dnl constructed $INCNAME,
- dnl 4. if it doesn't exist as a directory.
- if test "X$additional_includedir" != "X/usr/include"; then
- haveit=
- if test "X$additional_includedir" = "X/usr/local/include"; then
- if test -n "$GCC"; then
- case $host_os in
- linux* | gnu* | k*bsd*-gnu) haveit=yes;;
- esac
- fi
- fi
- if test -z "$haveit"; then
- for x in $CPPFLAGS $INC[]NAME; do
- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
- if test "X$x" = "X${i_system}$additional_includedir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- if test -d "$additional_includedir"; then
- dnl Really add $additional_includedir to $INCNAME.
- INC[]NAME="${INC[]NAME}${INC[]NAME:+ }${i_system}$additional_includedir"
- fi
- fi
- fi
- fi
- fi
- dnl Look for dependencies.
- if test -n "$found_la"; then
- dnl Read the .la file. It defines the variables
- dnl dlname, library_names, old_library, dependency_libs, current,
- dnl age, revision, installed, dlopen, dlpreopen, libdir.
- save_libdir="$libdir"
- case "$found_la" in
- */* | *\\*) . "$found_la" ;;
- *) . "./$found_la" ;;
- esac
- libdir="$save_libdir"
- dnl We use only dependency_libs.
- for dep in $dependency_libs; do
- case "$dep" in
- -L*)
- additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
- dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
- dnl But don't add it
- dnl 1. if it's the standard /usr/lib,
- dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
- dnl 3. if it's already present in $LDFLAGS or the already
- dnl constructed $LIBNAME,
- dnl 4. if it doesn't exist as a directory.
- if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
- && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
- haveit=
- if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
- || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
- if test -n "$GCC"; then
- case $host_os in
- linux* | gnu* | k*bsd*-gnu) haveit=yes;;
- esac
- fi
- fi
- if test -z "$haveit"; then
- haveit=
- for x in $LDFLAGS $LIB[]NAME; do
- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
- if test "X$x" = "X-L$additional_libdir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- if test -d "$additional_libdir"; then
- dnl Really add $additional_libdir to $LIBNAME.
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
- fi
- fi
- haveit=
- for x in $LDFLAGS $LTLIB[]NAME; do
- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
- if test "X$x" = "X-L$additional_libdir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- if test -d "$additional_libdir"; then
- dnl Really add $additional_libdir to $LTLIBNAME.
- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
- fi
- fi
- fi
- fi
- ;;
- -R*)
- dir=`echo "X$dep" | sed -e 's/^X-R//'`
- if test "$enable_rpath" != no; then
- dnl Potentially add DIR to rpathdirs.
- dnl The rpathdirs will be appended to $LIBNAME at the end.
- haveit=
- for x in $rpathdirs; do
- if test "X$x" = "X$dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- rpathdirs="$rpathdirs $dir"
- fi
- dnl Potentially add DIR to ltrpathdirs.
- dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
- haveit=
- for x in $ltrpathdirs; do
- if test "X$x" = "X$dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- ltrpathdirs="$ltrpathdirs $dir"
- fi
- fi
- ;;
- -l*)
- dnl Handle this in the next round.
- names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
- ;;
- *.la)
- dnl Handle this in the next round. Throw away the .la's
- dnl directory; it is already contained in a preceding -L
- dnl option.
- names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
- ;;
- *)
- dnl Most likely an immediate library name.
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
- ;;
- esac
- done
- fi
- else
- dnl Didn't find the library; assume it is in the system directories
- dnl known to the linker and runtime loader. (All the system
- dnl directories known to the linker should also be known to the
- dnl runtime loader, otherwise the system is severely misconfigured.)
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
- fi
- fi
- fi
- done
- done
- if test "X$rpathdirs" != "X"; then
- if test -n "$acl_hardcode_libdir_separator"; then
- dnl Weird platform: only the last -rpath option counts, the user must
- dnl pass all path elements in one option. We can arrange that for a
- dnl single library, but not when more than one $LIBNAMEs are used.
- alldirs=
- for found_dir in $rpathdirs; do
- alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
- done
- dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
- acl_save_libdir="$libdir"
- libdir="$alldirs"
- eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
- else
- dnl The -rpath options are cumulative.
- for found_dir in $rpathdirs; do
- acl_save_libdir="$libdir"
- libdir="$found_dir"
- eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
- done
- fi
- fi
- if test "X$ltrpathdirs" != "X"; then
- dnl When using libtool, the option that works for both libraries and
- dnl executables is -R. The -R options are cumulative.
- for found_dir in $ltrpathdirs; do
- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
- done
- fi
- popdef([P_A_C_K])
- popdef([PACKLIBS])
- popdef([PACKUP])
- popdef([PACK])
- popdef([NAME])
-])
-
-dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
-dnl unless already present in VAR.
-dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
-dnl contains two or three consecutive elements that belong together.
-AC_DEFUN([AC_LIB_APPENDTOVAR],
-[
- for element in [$2]; do
- haveit=
- for x in $[$1]; do
- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
- if test "X$x" = "X$element"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- [$1]="${[$1]}${[$1]:+ }$element"
- fi
- done
-])
-
-dnl For those cases where a variable contains several -L and -l options
-dnl referring to unknown libraries and directories, this macro determines the
-dnl necessary additional linker options for the runtime path.
-dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
-dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
-dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
-dnl otherwise linking without libtool is assumed.
-AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
-[
- AC_REQUIRE([AC_LIB_RPATH])
- AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
- $1=
- if test "$enable_rpath" != no; then
- if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
- dnl Use an explicit option to hardcode directories into the resulting
- dnl binary.
- rpathdirs=
- next=
- for opt in $2; do
- if test -n "$next"; then
- dir="$next"
- dnl No need to hardcode the standard /usr/lib.
- if test "X$dir" != "X/usr/$acl_libdirstem" \
- && test "X$dir" != "X/usr/$acl_libdirstem2"; then
- rpathdirs="$rpathdirs $dir"
- fi
- next=
- else
- case $opt in
- -L) next=yes ;;
- -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
- dnl No need to hardcode the standard /usr/lib.
- if test "X$dir" != "X/usr/$acl_libdirstem" \
- && test "X$dir" != "X/usr/$acl_libdirstem2"; then
- rpathdirs="$rpathdirs $dir"
- fi
- next= ;;
- *) next= ;;
- esac
- fi
- done
- if test "X$rpathdirs" != "X"; then
- if test -n ""$3""; then
- dnl libtool is used for linking. Use -R options.
- for dir in $rpathdirs; do
- $1="${$1}${$1:+ }-R$dir"
- done
- else
- dnl The linker is used for linking directly.
- if test -n "$acl_hardcode_libdir_separator"; then
- dnl Weird platform: only the last -rpath option counts, the user
- dnl must pass all path elements in one option.
- alldirs=
- for dir in $rpathdirs; do
- alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
- done
- acl_save_libdir="$libdir"
- libdir="$alldirs"
- eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
- $1="$flag"
- else
- dnl The -rpath options are cumulative.
- for dir in $rpathdirs; do
- acl_save_libdir="$libdir"
- libdir="$dir"
- eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
- $1="${$1}${$1:+ }$flag"
- done
- fi
- fi
- fi
- fi
- fi
- AC_SUBST([$1])
-])
View
221 m4/lib-prefix.m4
@@ -1,221 +0,0 @@
-# lib-prefix.m4 serial 6 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
-dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
-dnl require excessive bracketing.
-ifdef([AC_HELP_STRING],
-[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
-[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
-
-dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
-dnl to access previously installed libraries. The basic assumption is that
-dnl a user will want packages to use other packages he previously installed
-dnl with the same --prefix option.
-dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
-dnl libraries, but is otherwise very convenient.
-AC_DEFUN([AC_LIB_PREFIX],
-[
- AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST])
- AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
- AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
- dnl By default, look in $includedir and $libdir.
- use_additional=yes
- AC_LIB_WITH_FINAL_PREFIX([
- eval additional_includedir=\"$includedir\"
- eval additional_libdir=\"$libdir\"
- ])
- AC_LIB_ARG_WITH([lib-prefix],
-[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
- --without-lib-prefix don't search for libraries in includedir and libdir],
-[
- if test "X$withval" = "Xno"; then
- use_additional=no
- else
- if test "X$withval" = "X"; then
- AC_LIB_WITH_FINAL_PREFIX([
- eval additional_includedir=\"$includedir\"
- eval additional_libdir=\"$libdir\"
- ])
- else
- additional_includedir="$withval/include"
- additional_libdir="$withval/$acl_libdirstem"
- fi
- fi
-])
- if test $use_additional = yes; then
- dnl Potentially add $additional_includedir to $CPPFLAGS.
- dnl But don't add it
- dnl 1. if it's the standard /usr/include,
- dnl 2. if it's already present in $CPPFLAGS,
- dnl 3. if it's /usr/local/include and we are using GCC on Linux,
- dnl 4. if it doesn't exist as a directory.
- if test "X$additional_includedir" != "X/usr/include"; then
- haveit=
- for x in $CPPFLAGS; do
- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
- if test "X$x" = "X-I$additional_includedir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- if test "X$additional_includedir" = "X/usr/local/include"; then
- if test -n "$GCC"; then
- case $host_os in
- linux* | gnu* | k*bsd*-gnu) haveit=yes;;
- esac
- fi
- fi
- if test -z "$haveit"; then
- if test -d "$additional_includedir"; then
- dnl Really add $additional_includedir to $CPPFLAGS.
- CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
- fi
- fi
- fi
- fi
- dnl Potentially add $additional_libdir to $LDFLAGS.
- dnl But don't add it
- dnl 1. if it's the standard /usr/lib,
- dnl 2. if it's already present in $LDFLAGS,
- dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
- dnl 4. if it doesn't exist as a directory.
- if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
- haveit=
- for x in $LDFLAGS; do
- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
- if test "X$x" = "X-L$additional_libdir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
- if test -n "$GCC"; then
- case $host_os in
- linux*) haveit=yes;;
- esac
- fi
- fi
- if test -z "$haveit"; then
- if test -d "$additional_libdir"; then
- dnl Really add $additional_libdir to $LDFLAGS.
- LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
- fi
- fi
- fi
- fi
- fi
-])
-
-dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
-dnl acl_final_exec_prefix, containing the values to which $prefix and
-dnl $exec_prefix will expand at the end of the configure script.
-AC_DEFUN([AC_LIB_PREPARE_PREFIX],
-[
- dnl Unfortunately, prefix and exec_prefix get only finally determined
- dnl at the end of configure.
- if test "X$prefix" = "XNONE"; then
- acl_final_prefix="$ac_default_prefix"
- else
- acl_final_prefix="$prefix"
- fi
- if test "X$exec_prefix" = "XNONE"; then
- acl_final_exec_prefix='${prefix}'
- else
- acl_final_exec_prefix="$exec_prefix"
- fi
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
- prefix="$acl_save_prefix"
-])
-
-dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
-dnl variables prefix and exec_prefix bound to the values they will have
-dnl at the end of the configure script.
-AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
-[
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- $1
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-])
-
-dnl AC_LIB_PREPARE_MULTILIB creates
-dnl - a variable acl_libdirstem, containing the basename of the libdir, either
-dnl "lib" or "lib64" or "lib/64",
-dnl - a variable acl_libdirstem2, as a secondary possible value for
-dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
-dnl "lib/amd64".
-AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
-[
- dnl There is no formal standard regarding lib and lib64.
- dnl On glibc systems, the current practice is that on a system supporting
- dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
- dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
- dnl the compiler's default mode by looking at the compiler's library search
- dnl path. If at least one of its elements ends in /lib64 or points to a
- dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
- dnl Otherwise we use the default, namely "lib".
- dnl On Solaris systems, the current practice is that on a system supporting
- dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
- dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
- dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
- AC_REQUIRE([AC_CANONICAL_HOST])
- acl_libdirstem=lib
- acl_libdirstem2=
- case "$host_os" in
- solaris*)
- dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
- dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
- dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
- dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
- dnl symlink is missing, so we set acl_libdirstem2 too.
- AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
- [AC_RUN_IFELSE([
- AC_LANG_PROGRAM([], [[
- return sizeof(void*) == 8 ? 0 : 1;
- ]])
- ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
- ])
- if test $gl_cv_solaris_64bit = yes; then
- acl_libdirstem=lib/64
- case "$host_cpu" in
- sparc*) acl_libdirstem2=lib/sparcv9 ;;
- i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
- esac
- fi
- ;;
- *)
- searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
- if test -n "$searchpath"; then
- acl_save_IFS="${IFS= }"; IFS=":"
- for searchdir in $searchpath; do
- if test -d "$searchdir"; then
- case "$searchdir" in
- */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
- *) searchdir=`cd "$searchdir" && pwd`
- case "$searchdir" in
- */lib64 ) acl_libdirstem=lib64 ;;
- esac ;;
- esac
- fi
- done
- IFS="$acl_save_IFS"
- fi
- ;;
- esac
- test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
-])
View
60 m4/pandora_64bit.m4
@@ -1,60 +0,0 @@
-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.
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: PANDORA_64BIT
-dnl ---------------------------------------------------------------------------
-AC_DEFUN([PANDORA_64BIT],[
- AC_BEFORE([$0], [AC_LIB_PREFIX])
-
- AC_ARG_ENABLE([64bit],
- [AS_HELP_STRING([--disable-64bit],
- [Build 64 bit binary @<:@default=on@:>@])],
- [ac_enable_64bit="$enableval"],
- [ac_enable_64bit="yes"])
-
- AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
- AS_IF([test "x$ISAINFO" != "xno"],
- [isainfo_b=`${ISAINFO} -b`],
- [isainfo_b="x"])
-
- AS_IF([test "$isainfo_b" != "x"],[
-
- isainfo_k=`${ISAINFO} -k`
- DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_b}"
-
- AS_IF([test "x$ac_enable_64bit" = "xyes"],[
-
- AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[
- LDFLAGS="-L/usr/local/lib/${isainfo_k} ${LDFLAGS}"
- ])
-
- AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[
- dnl The user hasn't overridden the default libdir, so we'll
- dnl the dir suffix to match solaris 32/64-bit policy
- libdir="${libdir}/${isainfo_k}"
- ])
-
- AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],[
- CFLAGS="${CFLAGS} -m64"
- ac_cv_env_CFLAGS_set=set
- ac_cv_env_CFLAGS_value='-m64'
- ])
- AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],[
- CXXFLAGS="${CXXFLAGS} -m64"
- ac_cv_env_CXXFLAGS_set=set
- ac_cv_env_CXXFLAGS_value='-m64'
- ])
-
- AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes"],[
- AM_CFLAGS="-xmemalign=8s ${AM_CFLAGS}"
- AM_CXXFLAGS="-xmemalign=8s ${AM_CXXFLAGS}"
- ])
- ])
- ])
-])
-dnl ---------------------------------------------------------------------------
-dnl End Macro: PANDORA_64BIT
-dnl ---------------------------------------------------------------------------
View
172 m4/pandora_canonical.m4
@@ -1,172 +0,0 @@
-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.
-
-dnl Which version of the canonical setup we're using
-AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.65])
-
-AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
- dnl Force dependency tracking on for Sun Studio builds
- AS_IF([test "x${enable_dependency_tracking}" = "x"],[
- enable_dependency_tracking=yes
- ])
-])
-
-dnl The standard setup for how we build Pandora projects
-AC_DEFUN([PANDORA_CANONICAL_TARGET],[
- AC_REQUIRE([PANDORA_FORCE_DEPEND_TRACKING])
- ifdef([m4_define],,[define([m4_define], defn([define]))])
- ifdef([m4_undefine],,[define([m4_undefine], defn([undefine]))])
- m4_define([PCT_ALL_ARGS],[$*])
- m4_define([PCT_USE_GNULIB],[no])
- m4_define([PCT_REQUIRE_CXX],[no])
- m4_define([PCT_IGNORE_SHARED_PTR],[no])
- m4_define([PCT_IGNORE_UNORDERED_MAP],[no])
- m4_define([PCT_FORCE_GCC42],[no])
- m4_define([PCT_SRC_IN_SRC],[no])
- m4_foreach([pct_arg],[$*],[
- m4_case(pct_arg,
- [use-gnulib], [
- m4_undefine([PCT_USE_GNULIB])
- m4_define([PCT_USE_GNULIB],[yes])
- ],
- [require-cxx], [
- m4_undefine([PCT_REQUIRE_CXX])
- m4_define([PCT_REQUIRE_CXX],[yes])
- ],
- [ignore-shared-ptr], [
- m4_undefine([PCT_IGNORE_SHARED_PTR])
- m4_define([PCT_IGNORE_SHARED_PTR],[yes])
- ],
- [ignore-unordered-map], [
- m4_undefine([PCT_IGNORE_UNORDERED_MAP])
- m4_define([PCT_IGNORE_UNORDERED_MAP],[yes])
- ],
- [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])
- ])
- ])
-
- # 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
- AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],
- [CFLAGS=""])
- AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],
- [CXXFLAGS=""])
-
- 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 ])
-
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([PANDORA_MAC_GCC42])
- AC_REQUIRE([PANDORA_64BIT])
-
- dnl Once we can use a modern autoconf, we can use this
- dnl AC_PROG_CC_C99
- AC_REQUIRE([AC_PROG_CXX])
- PANDORA_EXTENSIONS
- AM_PROG_CC_C_O
-
-
- m4_if(PCT_FORCE_GCC42, [yes], [
- AS_IF([test "$GCC" = "yes"], PANDORA_ENSURE_GCC_VERSION)
- ])
-
- PANDORA_PLATFORM
-
- PANDORA_LIBTOOL
-
- dnl autoconf doesn't automatically provide a fail-if-no-C++ macro
- dnl so we check c++98 features and fail if we don't have them, mainly
- dnl for that reason
- PANDORA_CHECK_CXX_STANDARD
- m4_if(PCT_REQUIRE_CXX, [yes], [
- 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_SHARED_PTR
- m4_if(PCT_IGNORE_SHARED_PTR, [no], [
- AS_IF([test "$ac_cv_shared_ptr_namespace" = "missing"],[
- AC_MSG_WARN([a usable shared_ptr implementation was not found. Let someone know what your platform is.])
- ])
- ])
-
- PANDORA_UNORDERED_MAP
- m4_if(PCT_IGNORE_UNORDERED_MAP, [no], [
- AS_IF([test "$ac_cv_unordered_map_namespace" = "missing"],[
- AC_MSG_WARN([a usable unordered_map implementation was not found. Let someone know what your platform is.])
- ])
- ])
-
- m4_if(PCT_USE_GNULIB, [yes], [
- gl_INIT
- AC_CONFIG_LIBOBJ_DIR([gnulib])
- ])
-
- AC_C_BIGENDIAN
- AC_C_CONST
- AC_C_INLINE
- AC_C_VOLATILE
- AC_C_RESTRICT
-
- AC_HEADER_TIME
- AC_TYPE_SIZE_T
- AC_SYS_LARGEFILE
-
-
- PANDORA_CHECK_C_VERSION
- PANDORA_CHECK_CXX_VERSION
-
- PANDORA_OPTIMIZE
-
- dnl We need to inject error into the cflags to test if visibility works or not
- save_CFLAGS="${CFLAGS}"
- CFLAGS="${CFLAGS} -Werror"
- gl_VISIBILITY
- CFLAGS="${save_CFLAGS}"
-
- PANDORA_HEADER_ASSERT
-
- PANDORA_WARNINGS(PCT_ALL_ARGS)
-
- PANDORA_ENABLE_DTRACE
-
- AC_LIB_PREFIX
- PANDORA_HAVE_BETTER_MALLOC
-
- AC_CHECK_PROGS([DOXYGEN], [doxygen])
- AC_CHECK_PROGS([PERL], [perl])
-
- AS_IF([test "x${gl_LIBOBJS}" != "x"],[
- AS_IF([test "$GCC" = "yes"],[
- AM_CPPFLAGS="-isystem \$(top_srcdir)/gnulib -isystem \$(top_builddir)/gnulib ${AM_CPPFLAGS}"
- ],[
- 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}"
- ])
-
- AM_CPPFLAGS="-I\${top_srcdir} -I\${top_builddir} ${AM_CPPFLAGS}"
- AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
- AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
-
- AC_SUBST([AM_CFLAGS])
- AC_SUBST([AM_CXXFLAGS])
- AC_SUBST([AM_CPPFLAGS])
-
-])
View
37 m4/pandora_check_compiler_version.m4
@@ -1,37 +0,0 @@
-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_CHECK_C_VERSION],[
-
- dnl Print version of C compiler
- AC_MSG_CHECKING("C Compiler version--$GCC")
- AS_IF([test "$GCC" = "yes"],[
- CC_VERSION=`$CC --version | sed 1q`
- ],[AS_IF([test "$SUNCC" = "yes"],[
- CC_VERSION=`$CC -V 2>&1 | sed 1q`
- ],[
- CC_VERSION=""
- ])
- ])
- AC_MSG_RESULT("$CC_VERSION")
- AC_SUBST(CC_VERSION)
-])
-
-
-AC_DEFUN([PANDORA_CHECK_CXX_VERSION], [
- dnl Print version of CXX compiler
- AC_MSG_CHECKING("C++ Compiler version")
- AS_IF([test "$GCC" = "yes"],[
- CXX_VERSION=`$CXX --version | sed 1q`
- ],[AS_IF([test "$SUNCC" = "yes"],[
- CXX_VERSION=`$CXX -V 2>&1 | sed 1q`
- ],[
- CXX_VERSION=""
- ])
- ])
- AC_MSG_RESULT("$CXX_VERSION")
- AC_SUBST(CXX_VERSION)
-])
View
23 m4/pandora_check_cxx_standard.m4
@@ -1,23 +0,0 @@
-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],[
- 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"],
- [CXX_STANDARD="-std=gnu++0x"],
- [CXX_STANDARD="-std=gnu++98"])
- ])
- ])
- AM_CXXFLAGS="${CXX_STANDARD} ${AM_CXXFLAGS}"
-
- save_CXXFLAGS="${CXXFLAGS}"
- CXXFLAGS="${CXXFLAGS} ${CXX_STANDARD}"
- AC_CXX_HEADER_STDCXX_98
- CXXFLAGS="${save_CXXFLAGS}"
-
- AC_SUBST([CXX_STANDARD])
-])
View
39 m4/pandora_ensure_gcc_version.m4
@@ -1,39 +0,0 @@
-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.
-
-dnl If the user is on a Mac and didn't ask for a specific compiler
-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"],[
- 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
- ])
- ])
- ])
- ])
-])
-
-dnl
-AC_DEFUN([PANDORA_ENSURE_GCC_VERSION],[
- AC_REQUIRE([PANDORA_MAC_GCC42])
- AC_CACHE_CHECK([if GCC is recent enough], [ac_cv_gcc_recent],
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#if !defined(__GNUC__) || (__GNUC__ < 4) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ < 1))
-# error GCC is Too Old!
-#endif
- ]])],
- [ac_cv_gcc_recent=yes],
- [ac_cv_gcc_recent=no])])
- AS_IF([test "$ac_cv_gcc_recent" = "no" -a "$host_vendor" = "apple"],
- AC_MSG_ERROR([Your version of GCC is too old. At least version 4.2 is required on OSX. You may need to install a version of XCode >= 3.1.2]))
- AS_IF([test "$ac_cv_gcc_recent" = "no"],
- AC_MSG_ERROR([Your version of GCC is too old. At least version 4.1 is required]))
-])
View
16 m4/pandora_extensions.m4
@@ -1,16 +0,0 @@
-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])
-])
View
41 m4/pandora_have_innodb.m4
@@ -1,41 +0,0 @@
-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_SEARCH_LIBINNODB],[
- AC_REQUIRE([AC_LIB_PREFIX])
-
- dnl --------------------------------------------------------------------
- dnl Check for libinnodb
- dnl --------------------------------------------------------------------
-
- AC_ARG_ENABLE([libinnodb],
- [AS_HELP_STRING([--disable-libinnodb],
- [Build with libinnodb support @<:@default=on@:>@])],
- [ac_enable_libinnodb="$enableval"],
- [ac_enable_libinnodb="yes"])
-
- AS_IF([test "x$ac_enable_libinnodb" = "xyes"],[
- AC_LIB_HAVE_LINKFLAGS(innodb,,[
- #include <embedded_innodb-1.0/innodb.h>
- ],[
- ib_u64_t
- ib_api_version(void);
- ])
- ],[
- ac_cv_libinnodb="no"
- ])
-
- AM_CONDITIONAL(HAVE_LIBINNODB, [test "x${ac_cv_libinnodb}" = "xyes"])
-])
-
-AC_DEFUN([PANDORA_HAVE_LIBINNODB],[
- AC_REQUIRE([_PANDORA_SEARCH_LIBINNODB])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBINNODB],[
- AC_REQUIRE([PANDORA_HAVE_LIBINNODB])
- AS_IF([test "x${ac_cv_libinnodb}" = "xno"],
- AC_MSG_ERROR([libinnodb is required for ${PACKAGE}]))
-])
View
42 m4/pandora_have_libcouchstore.m4
@@ -1,42 +0,0 @@
-dnl Copyright (C) 2012 Couchbase, Inc
-dnl This file is free software; Couchbase, 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_LIBCOUCHSTORE],[
- AC_REQUIRE([AC_LIB_PREFIX])
-
- dnl --------------------------------------------------------------------
- dnl Check for libcouchstore
- dnl --------------------------------------------------------------------
-
- AC_ARG_ENABLE([libcouchstore],
- [AS_HELP_STRING([--disable-libcouchstore],
- [Build with libcouchstore support @<:@default=on@:>@])],
- [ac_enable_libcouchstore="$enableval"],
- [ac_enable_libcouchstore="yes"])
-
- AS_IF([test "x$ac_enable_libcouchstore" = "xyes"],[
- AC_LIB_HAVE_LINKFLAGS(couchstore,,[
- #include <stdio.h>
- #include <libcouchstore/couch_db.h>
- ],[
- Db *db;
- couchstore_open_db(NULL, 0, &db);
- ])
- ],[
- ac_cv_libcouchstore="no"
- ])
-
- AM_CONDITIONAL(HAVE_LIBCOUCHSTORE, [test "x${ac_cv_libcouchstore}" = "xyes"])
-])
-
-AC_DEFUN([PANDORA_HAVE_LIBCOUCHSTORE],[
- AC_REQUIRE([_PANDORA_SEARCH_LIBCOUCHSTORE])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBCOUCHSTORE],[
- AC_REQUIRE([_PANDORA_SEARCH_LIBCOUCHSTORE])
- AS_IF([test "x${ac_cv_libcouchstore}" = "xno"],
- AC_MSG_ERROR([libcouchstore is required for ${PACKAGE}]))
-])
View
55 m4/pandora_have_libdrizzle.m4
@@ -1,55 +0,0 @@
-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_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@:>@])],