Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

147 lines (130 sloc) 4.394 kb
# libcouchstore
# Copyright (C) 2010, 2011 Couchbase, Inc
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
AC_PREREQ(2.59)
m4_include([m4/version.m4])
AC_INIT(libcouchstore, VERSION_NUMBER, support@couchbase.com)
AC_CONFIG_SRCDIR([src/couch_db.c])
AC_CONFIG_AUX_DIR(config)
AC_USE_SYSTEM_EXTENSIONS
AM_INIT_AUTOMAKE(subdir-objects)
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AM_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
# 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)
PANDORA_HAVE_LIBLUA
AC_CACHE_CHECK([for htonll], [ac_cv_have_htonll],
[AC_TRY_LINK([
#include <sys/types.h>
#include <netinet/in.h>
#include <inttypes.h>
], [
return htonll(0);
],
[ ac_cv_have_htonll=yes ],
[ ac_cv_have_htonll=no ])
])
AS_IF([test "x$ac_cv_have_htonll" = "xyes"],[
AC_DEFINE([HAVE_HTONLL], [1], [Have ntohll])])
AC_SEARCH_LIBS(floor, m)
AC_SEARCH_LIBS(pow, m)
AC_SEARCH_LIBS(fabs, m)
AC_ARG_WITH([docs],
[AS_HELP_STRING([--with-docs],
[Generate documentation (yes|no) @<:@default=yes@:>@])],
[with_docs=$withval],
[with_docs=yes])
AC_PATH_PROG(POD2MAN, pod2man, missing)
AS_IF([test "$with_docs" = "yes" -a "$POD2MAN" = "missing" ],
[ AC_MSG_ERROR([pod2man is required for building docs])])
AM_CONDITIONAL(BUILD_DOCS, test "$with_docs" = "yes")
AS_CASE( [$(uname -s)],
[CYGWIN*], [
IS_WINDOWS="TRUE"
] ,
[*], [
IS_WINDOWS="FALSE"
])
AM_CONDITIONAL([WINDOWS], [test x$IS_WINDOWS = xTRUE])
AC_CHECK_HEADERS_ONCE([snappy-c.h netinet/in.h inttypes.h])
dnl Check that we're able to find a usable libsnappy
AC_CACHE_CHECK([for libsnappy], [ac_cv_have_libsnappy],
[ saved_libs="$LIBS"
AS_IF([test "x${IS_WINDOWS}" = "xTRUE"], [LIBS="-lsnappy -lstdc++.dll"],
[test "x${IS_WINDOWS}" != "xTRUE"],[LIBS="-lsnappy"])
AC_TRY_LINK([
#include <snappy-c.h>
#include <stddef.h>
],[
size_t sizetest = snappy_max_compressed_length(10);
],[
ac_cv_have_libsnappy="yes"
], [
ac_cv_have_libsnappy="no"
])
LIBS="$saved_libs"
])
AS_IF([test "x$ac_cv_header_snappy_c_h" != "xyes"],
[AC_MSG_ERROR(Failed to locate snappy-c.h)])
AS_IF([test "x${ac_cv_have_libsnappy}" != "xyes"],
[AC_MSG_ERROR(Failed to locate libsnappy)])
AH_TOP([
#ifndef CONFIG_H
#define CONFIG_H
/*
* This file is generated by running configure. Any changes you make to this
* file will be overwritten the next time you run configure. If you want to
* make permanent changes to the file you should edit configure.ac instead.
* All platform-specific includes should be placed inside config_static.h
* to keep the config.h as small as possible. That allows us for easily
* use another build systems with a poor support for automake (like Windows)
*/
])
AH_BOTTOM([
#include "config_static.h"
#endif
])
#
# To ensure that we don't break applications in mysterious ways we need
# to version our library. For a detailed description, check out:
# http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
#
LIBCOUCHSTORE_API_CURRENT=1
LIBCOUCHSTORE_API_REVISION=0
LIBCOUCHSTORE_API_AGE=0
AC_SUBST(LIBCOUCHSTORE_API_CURRENT)
AC_SUBST(LIBCOUCHSTORE_API_REVISION)
AC_SUBST(LIBCOUCHSTORE_API_AGE)
dnl ----------------------------------------------------------------------------
AC_CONFIG_FILES(Makefile libcouchstore.pc)
AC_OUTPUT
AS_IF(test "$with_docs" = "no",
[
echo "*****"
echo "*"
echo "* WARNING: You are not generating any documentation."
echo "* Please don't ship libcouchstore to an end user"
echo "* without documentation..."
echo "*"
echo "*****"
])
Jump to Line
Something went wrong with that request. Please try again.