⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 neon.m4

📁 linux subdivision ying gai ke yi le ba
💻 M4
📖 第 1 页 / 共 2 页
字号:
# Copyright (C) 1998-2004 Joe Orton <joe@manyfish.co.uk>    -*- autoconf -*-## This file is free software; you may copy and/or distribute it with# or without modifications, as long as this notice is preserved.# This software is distributed in the hope that it will be useful, but# WITHOUT ANY WARRANTY, to the extent permitted by law; without even# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR# PURPOSE.# The above license applies to THIS FILE ONLY, the neon library code# itself may be copied and distributed under the terms of the GNU# LGPL, see COPYING.LIB for more details# This file is part of the neon HTTP/WebDAV client library.# See http://www.webdav.org/neon/ for the latest version. # Please send any feedback to <neon@webdav.org>## Usage:##      NEON_LIBRARY# or   NEON_BUNDLED(srcdir, [ACTIONS-IF-BUNDLED], [ACTIONS-IF-NOT_BUNDLED]) # or   NEON_VPATH_BUNDLED(srcdir, builddir, #			  [ACTIONS-IF-BUNDLED], [ACTIONS-IF-NOT-BUNDLED])##   where srcdir is the location of bundled neon 'src' directory.#   If using a VPATH-enabled build, builddir is the location of the#   build directory corresponding to srcdir.##   If a bundled build *is* being used, ACTIONS-IF-BUNDLED will be#   evaluated. These actions should ensure that 'make' is run#   in srcdir, and that one of NEON_NORMAL_BUILD or NEON_LIBTOOL_BUILD #   is called.## After calling one of the above macros, if the NEON_NEED_XML_PARSER# variable is set to "yes", then you must configure an XML parser# too. You can do this your own way, or do it easily using the# NEON_XML_PARSER() macro. Example usage for where we have bundled the# neon sources in a directory called libneon, and bundled expat# sources in a directory called 'expat'.##   NEON_BUNDLED(libneon, [#	NEON_XML_PARSER(expat)#	NEON_NORMAL_BUILD#   ])## Alternatively, for a simple standalone app with neon as a# dependancy, use just:##   NEON_LIBRARY# # and rely on the user installing neon correctly.## You are free to configure an XML parser any other way you like,# but the end result must be, either expat or libxml will get linked# in, and HAVE_EXPAT or HAVE_LIBXML is defined appropriately.## To set up the bundled build environment, call ##    NEON_NORMAL_BUILD# or#    NEON_LIBTOOL_BUILD# # depending on whether you are using libtool to build, or not.# Both these macros take an optional argument specifying the set# of object files you wish to build: if the argument is not given,# all of neon will be built.AC_DEFUN([NEON_BUNDLED],[neon_bundled_srcdir=$1neon_bundled_builddir=$1NEON_COMMON_BUNDLED([$2], [$3])])AC_DEFUN([NEON_VPATH_BUNDLED],[neon_bundled_srcdir=$1neon_bundled_builddir=$2NEON_COMMON_BUNDLED([$3], [$4])])AC_DEFUN([NEON_COMMON_BUNDLED],[AC_PREREQ(2.50)AC_ARG_WITH(included-neon,AC_HELP_STRING([--with-included-neon], [force use of included neon library]),[neon_force_included="$withval"], [neon_force_included="no"])NEON_COMMON# The colons are here so there is something to evaluate# in case the argument was not passed.if test "$neon_force_included" = "yes"; then	:	$1else	:	$2fi])dnl Not got any bundled sources:AC_DEFUN([NEON_LIBRARY],[AC_PREREQ(2.50)neon_force_included=noneon_bundled_srcdir=neon_bundled_builddir=NEON_COMMON])AC_DEFUN([NEON_VERSIONS], [# Define the current versions.NEON_VERSION_MAJOR=0NEON_VERSION_MINOR=24NEON_VERSION_RELEASE=7NEON_VERSION_TAG=NEON_VERSION="${NEON_VERSION_MAJOR}.${NEON_VERSION_MINOR}.${NEON_VERSION_RELEASE}${NEON_VERSION_TAG}"# libtool library interface versioning.  Release policy dictates that# for neon 0.x.y, each x brings an incompatible interface change, and# each y brings no interface change, and since this policy has been# followed since 0.1, x == CURRENT, y == RELEASE, 0 == AGE.  For# 1.x.y, this will become N + x == CURRENT, y == RELEASE, x == AGE,# where N is constant (and equal to CURRENT + 1 from the final 0.x# release)NEON_INTERFACE_VERSION="${NEON_VERSION_MINOR}:${NEON_VERSION_RELEASE}:0"AC_DEFINE_UNQUOTED(NEON_VERSION, "${NEON_VERSION}", 	[Define to be the neon version string])AC_DEFINE_UNQUOTED(NEON_VERSION_MAJOR, [(${NEON_VERSION_MAJOR})],	[Define to be major number of neon version])AC_DEFINE_UNQUOTED(NEON_VERSION_MINOR, [(${NEON_VERSION_MINOR})],	[Define to be minor number of neon version])])dnl Define the minimum required versionAC_DEFUN([NEON_REQUIRE], [neon_require_major=$1neon_require_minor=$2])dnl Check that the external library found in a given locationdnl matches the min. required version (if any).  Requires thatdnl NEON_CONFIG be set the the full path of a valid neon-configdnl scriptdnldnl Usage:dnl    NEON_CHECK_VERSION(ACTIONS-IF-OKAY, ACTIONS-IF-FAILURE)dnlAC_DEFUN([NEON_CHECK_VERSION], [if test "x$neon_require_major" = "x"; then    # Nothing to check.    ne_goodver=yes    ne_libver="(version unknown)"else    # Check whether the library is of required version    ne_save_LIBS="$LIBS"    ne_save_CFLAGS="$CFLAGS"    CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`"    LIBS="$LIBS `$NEON_CONFIG --libs`"    ne_libver=`$NEON_CONFIG --version | sed -e "s/neon //g"`    # Check whether it's possible to link against neon    AC_CACHE_CHECK([linking against neon], [ne_cv_lib_neon],    AC_TRY_LINK_FUNC([ne_version_match],	[ne_cv_lib_neon=yes], [ne_cv_lib_neon=no]))    if test "$ne_cv_lib_neon" = "yes"; then       # Now check whether the neon library version is satisfactory       AC_CACHE_CHECK([neon library version], [ne_cv_lib_neonver],       AC_TRY_RUN([#include <ne_utils.h>int main(int argc, char **argv) {return ne_version_match($neon_require_major, $neon_require_minor);}], ne_cv_lib_neonver=yes, ne_cv_lib_neonver=no))    fi    ne_goodver=$ne_cv_lib_neonver    LIBS=$ne_save_LIBS    CFLAGS=$ne_save_CFLAGSfiif test "$ne_goodver" = "yes"; then    AC_MSG_NOTICE([using neon library $ne_libver])    $1else    AC_MSG_NOTICE([incompatible neon library version $ne_libver: wanted $neon_require_major.$neon_require_minor])    $2fi])dnl NEON_CHECK_SUPPORT(feature, var)AC_DEFUN([NEON_CHECK_SUPPORT], [if $NEON_CONFIG --support $1 >/dev/null; then   neon_$1_message="supported by neon"   $2=yeselse   neon_$1_message="not supported by neon"   $2=nofi])AC_DEFUN([NEON_USE_EXTERNAL], [# Configure to use an external neon, given a neon-config script# found at $NEON_CONFIG.neon_prefix=`$NEON_CONFIG --prefix`NEON_CHECK_VERSION([    CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`"    NEON_LIBS="$NEON_LIBS `$NEON_CONFIG --libs`"    neon_library_message="library in ${neon_prefix} (`$NEON_CONFIG --version`)"    neon_xml_parser_message="using whatever neon uses"    NEON_CHECK_SUPPORT([ssl], [NEON_SUPPORTS_SSL])    NEON_CHECK_SUPPORT([zlib], [NEON_SUPPORTS_ZLIB])    neon_got_library=yes], [neon_got_library=no])])AC_DEFUN([NEON_COMMON],[AC_REQUIRE([NEON_COMMON_CHECKS])NEON_VERSIONSAC_ARG_WITH(neon,[  --with-neon[[=DIR]]       specify location of neon library],[case $withval inyes|no) neon_force_external=$withval; neon_ext_path= ;;*) neon_force_external=yes; neon_ext_path=$withval ;;esac;], [neon_force_external=noneon_ext_path=])if test "$neon_force_included" = "no"; then    # There is no included neon source directory, or --with-included-neon    # wasn't given (so we're not forced to use it).    # Default to no external neon.    neon_got_library=no    if test "x$neon_ext_path" = "x"; then	AC_PATH_PROG([NEON_CONFIG], neon-config, none)	if test "x${NEON_CONFIG}" = "xnone"; then	    AC_MSG_NOTICE([no external neon library found])	elif test -x "${NEON_CONFIG}"; then	    NEON_USE_EXTERNAL	else	    AC_MSG_NOTICE([ignoring non-executable ${NEON_CONFIG}])	fi    else	AC_MSG_CHECKING([for neon library in $neon_ext_path])	NEON_CONFIG="$neon_ext_path/bin/neon-config"	if test -x ${NEON_CONFIG}; then	    AC_MSG_RESULT([found])	    NEON_USE_EXTERNAL	else	    AC_MSG_RESULT([not found])	    # ...will fail since force_external=yes	fi    fi    if test "$neon_got_library" = "no"; then 	if test $neon_force_external = yes; then	    AC_MSG_ERROR([could not use external neon library])	elif test -n "$neon_bundled_srcdir"; then	    # Couldn't find external neon, forced to use bundled sources	    neon_force_included="yes"	else	    # Couldn't find neon, and don't have bundled sources	    AC_MSG_ERROR(could not find neon)	fi    fifi# This isn't a simple 'else' branch, since neon_force_included# is set to yes if the search fails.if test "$neon_force_included" = "yes"; then    AC_MSG_NOTICE([using bundled neon ($NEON_VERSION)])    NEON_BUILD_BUNDLED="yes"    LIBNEON_SOURCE_CHECKS    CFLAGS="$CFLAGS -I$neon_bundled_srcdir"    NEON_LIBS="-L$neon_bundled_builddir -lneon $NEON_LIBS"    NEON_NEED_XML_PARSER=yes    neon_library_message="included libneon (${NEON_VERSION})"else    # Don't need to configure an XML parser    NEON_NEED_XML_PARSER=no    NEON_BUILD_BUNDLED="yes"fiAC_SUBST(NEON_BUILD_BUNDLED)])dnl AC_SEARCH_LIBS done differently. Usage:dnl   NE_SEARCH_LIBS(function, libnames, [extralibs], [actions-if-not-found],dnl                            [actions-if-found])dnl Tries to find 'function' by linking againt `-lLIB $NEON_LIBS' for eachdnl LIB in libnames.  If link fails and 'extralibs' is given, will alsodnl try linking against `-lLIB extralibs $NEON_LIBS`.dnl Once link succeeds, `-lLIB [extralibs]` is prepended to $NEON_LIBS, anddnl `actions-if-found' are executed, if given.dnl If link never succeeds, run `actions-if-not-found', if given, elsednl give an error and fail configure.AC_DEFUN([NE_SEARCH_LIBS], [AC_CACHE_CHECK([for library containing $1], [ne_cv_libsfor_$1], [AC_TRY_LINK_FUNC($1, [ne_cv_libsfor_$1="none needed"], [ne_sl_save_LIBS=$LIBSne_cv_libsfor_$1="not found"for lib in $2; do    LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS"    AC_TRY_LINK_FUNC($1, [ne_cv_libsfor_$1="-l$lib"; break])    m4_if($3, [], [], dnl If $3 is specified, then...              [LIBS="$ne_sl_save_LIBS -l$lib $3 $NEON_LIBS"               AC_TRY_LINK_FUNC($1, [ne_cv_libsfor_$1="-l$lib $3"; break])])doneLIBS=$ne_sl_save_LIBS])])if test "$ne_cv_libsfor_$1" = "not found"; then   m4_if($4, [], [AC_MSG_ERROR([could not find library containing $1])], [$4])elif test "$ne_cv_libsfor_$1" != "none needed"; then    NEON_LIBS="$ne_cv_libsfor_$1 $NEON_LIBS"   $5fi])dnl Check for presence and suitability of zlib libraryAC_DEFUN([NEON_ZLIB], [AC_ARG_WITH(zlib, AC_HELP_STRING([--without-zlib], [disable zlib support]),ne_use_zlib=$withval, ne_use_zlib=yes)NEON_SUPPORTS_ZLIB=noAC_SUBST(NEON_SUPPORTS_ZLIB)if test "$ne_use_zlib" = "yes"; then    AC_CHECK_HEADER(zlib.h, [  	AC_CHECK_LIB(z, inflate, [ 	    NEON_LIBS="$NEON_LIBS -lz"	    NEON_CFLAGS="$NEON_CFLAGS -DNEON_ZLIB"	    NEON_SUPPORTS_ZLIB=yes	    neon_zlib_message="found in -lz"	], [neon_zlib_message="zlib not found"])    ], [neon_zlib_message="zlib not found"])else    neon_zlib_message="zlib disabled"fi])AC_DEFUN([NE_MACOSX], [# Check for Darwin, which needs extra cpp and linker flags.AC_CACHE_CHECK([for Darwin], ne_cv_os_macosx, [case `uname -s 2>/dev/null` inDarwin) ne_cv_os_macosx=yes ;;*) ne_cv_os_macosx=no ;;esac])if test $ne_cv_os_macosx = yes; then  CPPFLAGS="$CPPFLAGS -no-cpp-precomp"  LDFLAGS="$LDFLAGS -flat_namespace"fi])AC_DEFUN([NEON_COMMON_CHECKS], [# These checks are done whether or not the bundled neon build# is used.AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CC_STDC])AC_REQUIRE([AC_LANG_C])AC_REQUIRE([AC_ISC_POSIX])AC_REQUIRE([AC_C_INLINE])AC_REQUIRE([AC_C_CONST])AC_REQUIRE([AC_TYPE_SIZE_T])AC_REQUIRE([AC_TYPE_OFF_T])AC_REQUIRE([NE_MACOSX])AC_REQUIRE([AC_PROG_MAKE_SET])AC_REQUIRE([AC_HEADER_STDC])AC_CHECK_HEADERS([errno.h stdarg.h string.h stdlib.h])NEON_FORMAT(size_t,,u) dnl size_t is unsigned; use %u formatsNEON_FORMAT(off_t)NEON_FORMAT(ssize_t)])AC_DEFUN([NEON_FORMAT_PREP], [AC_CHECK_SIZEOF(int)AC_CHECK_SIZEOF(long)AC_CHECK_SIZEOF(long long)if test "$GCC" = "yes"; then  AC_CACHE_CHECK([for gcc -Wformat -Werror sanity], ne_cv_cc_werror, [  # See whether a simple test program will compile without errors.  ne_save_CPPFLAGS=$CPPFLAGS  CPPFLAGS="$CPPFLAGS -Wformat -Werror"  AC_TRY_COMPILE([#include <sys/types.h>  #include <stdio.h>], [int i = 42; printf("%d", i);],   [ne_cv_cc_werror=yes], [ne_cv_cc_werror=no])  CPPFLAGS=$ne_save_CPPFLAGS])  ne_fmt_trycompile=$ne_cv_cc_werrorelse  ne_fmt_trycompile=nofi])dnl NEON_FORMAT(TYPE[, HEADERS[, [SPECIFIER]])dnldnl This macro finds out which modifier is needed to create adnl printf format string suitable for printing integer type TYPE (whichdnl may be an int, long, or long long).dnl The default specifier is 'd', if SPECIFIER is not given.  dnl TYPE may be defined in HEADERS; sys/types.h is always used first.AC_DEFUN([NEON_FORMAT], [AC_REQUIRE([NEON_FORMAT_PREP])AC_CHECK_SIZEOF($1, [$2])dnl Work out which specifier character to usem4_ifdef([ne_spec], [m4_undefine([ne_spec])])m4_if($#, 3, [m4_define(ne_spec,$3)], [m4_define(ne_spec,d)])AC_CACHE_CHECK([how to print $1], [ne_cv_fmt_$1], [ne_cv_fmt_$1=noneif test $ne_fmt_trycompile = yes; then  oflags="$CPPFLAGS"  # Consider format string mismatches as errors  CPPFLAGS="$CPPFLAGS -Wformat -Werror"  dnl obscured for m4 quoting: "for str in d ld qd; do"  for str in ne_spec l]ne_spec[ q]ne_spec[; do    AC_TRY_COMPILE([#include <sys/types.h>$2#include <stdio.h>], [$1 i = 1; printf("%$str", i);], 	[ne_cv_fmt_$1=$str; break])  done  CPPFLAGS=$oflagselse  # Best guess. Don't have to be too precise since we probably won't  # get a warning message anyway.  case $ac_cv_sizeof_$1 in  $ac_cv_sizeof_int) ne_cv_fmt_$1="ne_spec" ;;  $ac_cv_sizeof_long) ne_cv_fmt_$1="l]ne_spec[" ;;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -