Imported Upstream version 2.6.0
This commit is contained in:
parent
26fb71b504
commit
459aaf9392
510 changed files with 40508 additions and 18859 deletions
177
m4/ax_compare_version.m4
Executable file
177
m4/ax_compare_version.m4
Executable file
|
|
@ -0,0 +1,177 @@
|
|||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_compare_version.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro compares two version strings. Due to the various number of
|
||||
# minor-version numbers that can exist, and the fact that string
|
||||
# comparisons are not compatible with numeric comparisons, this is not
|
||||
# necessarily trivial to do in a autoconf script. This macro makes doing
|
||||
# these comparisons easy.
|
||||
#
|
||||
# The six basic comparisons are available, as well as checking equality
|
||||
# limited to a certain number of minor-version levels.
|
||||
#
|
||||
# The operator OP determines what type of comparison to do, and can be one
|
||||
# of:
|
||||
#
|
||||
# eq - equal (test A == B)
|
||||
# ne - not equal (test A != B)
|
||||
# le - less than or equal (test A <= B)
|
||||
# ge - greater than or equal (test A >= B)
|
||||
# lt - less than (test A < B)
|
||||
# gt - greater than (test A > B)
|
||||
#
|
||||
# Additionally, the eq and ne operator can have a number after it to limit
|
||||
# the test to that number of minor versions.
|
||||
#
|
||||
# eq0 - equal up to the length of the shorter version
|
||||
# ne0 - not equal up to the length of the shorter version
|
||||
# eqN - equal up to N sub-version levels
|
||||
# neN - not equal up to N sub-version levels
|
||||
#
|
||||
# When the condition is true, shell commands ACTION-IF-TRUE are run,
|
||||
# otherwise shell commands ACTION-IF-FALSE are run. The environment
|
||||
# variable 'ax_compare_version' is always set to either 'true' or 'false'
|
||||
# as well.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
|
||||
# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
|
||||
#
|
||||
# would both be true.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
|
||||
# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
|
||||
#
|
||||
# would both be false.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
|
||||
#
|
||||
# would be true because it is only comparing two minor versions.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
|
||||
#
|
||||
# would be true because it is only comparing the lesser number of minor
|
||||
# versions of the two values.
|
||||
#
|
||||
# Note: The characters that separate the version numbers do not matter. An
|
||||
# empty string is the same as version 0. OP is evaluated by autoconf, not
|
||||
# configure, so must be a string, not a variable.
|
||||
#
|
||||
# The author would like to acknowledge Guido Draheim whose advice about
|
||||
# the m4_case and m4_ifvaln functions make this macro only include the
|
||||
# portions necessary to perform the specific comparison specified by the
|
||||
# OP argument in the final configure script.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
|
||||
#
|
||||
# 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. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 11
|
||||
|
||||
dnl #########################################################################
|
||||
AC_DEFUN([AX_COMPARE_VERSION], [
|
||||
AC_REQUIRE([AC_PROG_AWK])
|
||||
|
||||
# Used to indicate true or false condition
|
||||
ax_compare_version=false
|
||||
|
||||
# Convert the two version strings to be compared into a format that
|
||||
# allows a simple string comparison. The end result is that a version
|
||||
# string of the form 1.12.5-r617 will be converted to the form
|
||||
# 0001001200050617. In other words, each number is zero padded to four
|
||||
# digits, and non digits are removed.
|
||||
AS_VAR_PUSHDEF([A],[ax_compare_version_A])
|
||||
A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
|
||||
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/[[^0-9]]//g'`
|
||||
|
||||
AS_VAR_PUSHDEF([B],[ax_compare_version_B])
|
||||
B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
|
||||
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/[[^0-9]]//g'`
|
||||
|
||||
dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
|
||||
dnl # then the first line is used to determine if the condition is true.
|
||||
dnl # The sed right after the echo is to remove any indented white space.
|
||||
m4_case(m4_tolower($2),
|
||||
[lt],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
|
||||
],
|
||||
[gt],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
|
||||
],
|
||||
[le],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
|
||||
],
|
||||
[ge],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
|
||||
],[
|
||||
dnl Split the operator from the subversion count if present.
|
||||
m4_bmatch(m4_substr($2,2),
|
||||
[0],[
|
||||
# A count of zero means use the length of the shorter version.
|
||||
# Determine the number of characters in A and B.
|
||||
ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
|
||||
ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
|
||||
|
||||
# Set A to no more than B's length and B to no more than A's length.
|
||||
A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
|
||||
B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
|
||||
],
|
||||
[[0-9]+],[
|
||||
# A count greater than zero means use only that many subversions
|
||||
A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
|
||||
B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
|
||||
],
|
||||
[.+],[
|
||||
AC_WARNING(
|
||||
[illegal OP numeric parameter: $2])
|
||||
],[])
|
||||
|
||||
# Pad zeros at end of numbers to make same length.
|
||||
ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
|
||||
B="$B`echo $A | sed 's/./0/g'`"
|
||||
A="$ax_compare_version_tmp_A"
|
||||
|
||||
# Check for equality or inequality as necessary.
|
||||
m4_case(m4_tolower(m4_substr($2,0,2)),
|
||||
[eq],[
|
||||
test "x$A" = "x$B" && ax_compare_version=true
|
||||
],
|
||||
[ne],[
|
||||
test "x$A" != "x$B" && ax_compare_version=true
|
||||
],[
|
||||
AC_WARNING([illegal OP parameter: $2])
|
||||
])
|
||||
])
|
||||
|
||||
AS_VAR_POPDEF([A])dnl
|
||||
AS_VAR_POPDEF([B])dnl
|
||||
|
||||
dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
|
||||
if test "$ax_compare_version" = "true" ; then
|
||||
m4_ifvaln([$4],[$4],[:])dnl
|
||||
m4_ifvaln([$5],[else $5])dnl
|
||||
fi
|
||||
]) dnl AX_COMPARE_VERSION
|
||||
13
m4/libtool.m4
vendored
13
m4/libtool.m4
vendored
|
|
@ -2445,7 +2445,7 @@ linux*oldld* | linux*aout* | linux*coff*)
|
|||
;;
|
||||
|
||||
# This must be Linux ELF.
|
||||
linux* | k*bsd*-gnu)
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
version_type=linux
|
||||
need_lib_prefix=no
|
||||
need_version=no
|
||||
|
|
@ -3084,7 +3084,7 @@ irix5* | irix6* | nonstopux*)
|
|||
;;
|
||||
|
||||
# This must be Linux ELF.
|
||||
linux* | k*bsd*-gnu)
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
lt_cv_deplibs_check_method=pass_all
|
||||
;;
|
||||
|
||||
|
|
@ -3705,7 +3705,7 @@ m4_if([$1], [CXX], [
|
|||
;;
|
||||
esac
|
||||
;;
|
||||
linux* | k*bsd*-gnu)
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
case $cc_basename in
|
||||
KCC*)
|
||||
# KAI C++ Compiler
|
||||
|
|
@ -3989,7 +3989,7 @@ m4_if([$1], [CXX], [
|
|||
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
|
||||
;;
|
||||
|
||||
linux* | k*bsd*-gnu)
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
case $cc_basename in
|
||||
# old Intel for x86_64 which still supported -KPIC.
|
||||
ecc*)
|
||||
|
|
@ -4285,6 +4285,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
|
|||
fi
|
||||
supports_anon_versioning=no
|
||||
case `$LD -v 2>&1` in
|
||||
*GNU\ gold*) supports_anon_versioning=yes ;;
|
||||
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
|
||||
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
|
||||
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
|
||||
|
|
@ -4376,7 +4377,7 @@ _LT_EOF
|
|||
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
||||
;;
|
||||
|
||||
gnu* | linux* | tpf* | k*bsd*-gnu)
|
||||
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
tmp_diet=no
|
||||
if test "$host_os" = linux-dietlibc; then
|
||||
case $cc_basename in
|
||||
|
|
@ -5860,7 +5861,7 @@ if test "$_lt_caught_CXX_error" != yes; then
|
|||
_LT_TAGVAR(inherit_rpath, $1)=yes
|
||||
;;
|
||||
|
||||
linux* | k*bsd*-gnu)
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
case $cc_basename in
|
||||
KCC*)
|
||||
# Kuck and Associates, Inc. (KAI) C++ Compiler
|
||||
|
|
|
|||
10
m4/ltversion.m4
vendored
10
m4/ltversion.m4
vendored
|
|
@ -9,15 +9,15 @@
|
|||
|
||||
# Generated from ltversion.in.
|
||||
|
||||
# serial 3012 ltversion.m4
|
||||
# serial 3017 ltversion.m4
|
||||
# This file is part of GNU Libtool
|
||||
|
||||
m4_define([LT_PACKAGE_VERSION], [2.2.6])
|
||||
m4_define([LT_PACKAGE_REVISION], [1.3012])
|
||||
m4_define([LT_PACKAGE_VERSION], [2.2.6b])
|
||||
m4_define([LT_PACKAGE_REVISION], [1.3017])
|
||||
|
||||
AC_DEFUN([LTVERSION_VERSION],
|
||||
[macro_version='2.2.6'
|
||||
macro_revision='1.3012'
|
||||
[macro_version='2.2.6b'
|
||||
macro_revision='1.3017'
|
||||
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
||||
_LT_DECL(, macro_revision, 0)
|
||||
])
|
||||
|
|
|
|||
40
m4/nut_check_asciidoc.m4
Normal file
40
m4/nut_check_asciidoc.m4
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
dnl Check for LIBUSB compiler flags. On success, set nut_have_libusb="yes"
|
||||
dnl and set LIBUSB_CFLAGS and LIBUSB_LDFLAGS. On failure, set
|
||||
dnl nut_have_libusb="no". This macro can be run multiple times, but will
|
||||
dnl do the checking only once.
|
||||
|
||||
AC_DEFUN([NUT_CHECK_ASCIIDOC],
|
||||
[
|
||||
if test -z "${nut_have_asciidoc_seen}"; then
|
||||
nut_have_asciidoc_seen=yes
|
||||
|
||||
AC_PATH_PROGS([ASCIIDOC], [asciidoc])
|
||||
if test -n "${ASCIIDOC}"; then
|
||||
AC_MSG_CHECKING([for asciiDoc version])
|
||||
ASCIIDOC_VERSION="`${ASCIIDOC} --version 2>/dev/null`"
|
||||
dnl strip 'asciidoc ' from version string
|
||||
ASCIIDOC_VERSION="${ASCIIDOC_VERSION##* }"
|
||||
AC_MSG_RESULT(${ASCIIDOC_VERSION} found)
|
||||
fi
|
||||
|
||||
AC_PATH_PROGS([A2X], [a2x])
|
||||
if test -n "${A2X}"; then
|
||||
AC_MSG_CHECKING([for a2x version])
|
||||
A2X_VERSION="`${A2X} --version 2>/dev/null`"
|
||||
dnl strip 'a2x ' from version string
|
||||
A2X_VERSION="${A2X_VERSION##* }"
|
||||
AC_MSG_RESULT(${A2X_VERSION} found)
|
||||
fi
|
||||
|
||||
AC_PATH_PROGS([DBLATEX], [dblatex])
|
||||
if test -n "${DBLATEX}"; then
|
||||
AC_MSG_CHECKING([for dblatex version])
|
||||
DBLATEX_VERSION="`${DBLATEX} --version 2>/dev/null`"
|
||||
dnl strip 'dblatex version ' from version string
|
||||
DBLATEX_VERSION="${DBLATEX_VERSION##* }"
|
||||
AC_MSG_RESULT(${DBLATEX_VERSION} found)
|
||||
fi
|
||||
|
||||
dnl FIXME check for xsltproc, xmlllint, etc for chunked HTML and man pages
|
||||
fi
|
||||
])
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
dnl Check for various features required for IPv6 support. Define a
|
||||
dnl preprocessor symbol for each individual feature (HAVE_GETADDRINFO,
|
||||
dnl HAVE_FREEADDRINFO, HAVE_STRUCT_ADDRINFO, HAVE_SOCKADDR_STORAGE,
|
||||
dnl HAVE_SOCKADDR_IN6, HAVE_IN6_ADDR). Also set the shell variable nut_have_ipv6=yes
|
||||
dnl if all the required features are present. Set nut_have_ipv6=no otherwise.
|
||||
|
||||
AC_DEFUN([NUT_CHECK_IPV6],
|
||||
[
|
||||
if test -z "${nut_check_ipv6_seen}"; then
|
||||
nut_check_ipv6_seen=yes
|
||||
|
||||
AC_CHECK_FUNCS([getaddrinfo freeaddrinfo], [nut_have_ipv6=yes], [nut_have_ipv6=no])
|
||||
|
||||
AC_CHECK_TYPES([struct addrinfo],
|
||||
[], [nut_have_ipv6=no], [#include <netdb.h>])
|
||||
|
||||
AC_CHECK_TYPES([struct sockaddr_storage],
|
||||
[], [nut_have_ipv6=no], [#include <sys/socket.h>])
|
||||
|
||||
AC_CHECK_TYPES([struct sockaddr_in6, struct in6_addr],
|
||||
[], [nut_have_ipv6=no], [#include <netinet/in.h>])
|
||||
|
||||
if test "${nut_have_ipv6}" = "yes"; then
|
||||
AC_DEFINE(HAVE_IPV6, 1, [Define to enable IPv6 support])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
|
@ -21,38 +21,55 @@ if test -z "${nut_have_libgd_seen}"; then
|
|||
|
||||
AC_MSG_CHECKING(for gd version via gdlib-config)
|
||||
GD_VERSION=`gdlib-config --version 2>/dev/null`
|
||||
if test "$?" = "0"; then
|
||||
AC_MSG_RESULT(${GD_VERSION})
|
||||
else
|
||||
AC_MSG_RESULT(not found)
|
||||
GD_VERSION="unknown"
|
||||
if test "$?" != "0" -o -z "${GD_VERSION}"; then
|
||||
GD_VERSION="none"
|
||||
fi
|
||||
AC_MSG_RESULT(${GD_VERSION} found)
|
||||
|
||||
case "${GD_VERSION}" in
|
||||
unknown)
|
||||
none)
|
||||
;;
|
||||
2.0.5 | 2.0.6 | 2.0.7)
|
||||
AC_MSG_WARN([[gd ${GD_VERSION} detected, unable to use gdlib-config script]])
|
||||
AC_MSG_WARN([[If gd detection fails, upgrade gd or use --with-gd-includes and --with-gd-libs]])
|
||||
;;
|
||||
*)
|
||||
CFLAGS="`gdlib-config --includes`"
|
||||
LDFLAGS="`gdlib-config --ldflags`"
|
||||
LIBS="`gdlib-config --libs`"
|
||||
CFLAGS="`gdlib-config --includes 2>/dev/null`"
|
||||
LDFLAGS="`gdlib-config --ldflags 2>/dev/null`"
|
||||
LIBS="`gdlib-config --libs 2>/dev/null`"
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Now allow overriding gd settings if the user knows best
|
||||
AC_MSG_CHECKING(for gd include flags)
|
||||
AC_ARG_WITH(gd-includes, [
|
||||
AC_HELP_STRING([--with-gd-includes=CFLAGS], [include flags for the gd library])
|
||||
], [CFLAGS="${withval}"], [])
|
||||
AC_ARG_WITH(gd-includes,
|
||||
AS_HELP_STRING([@<:@--with-gd-includes=CFLAGS@:>@], [include flags for the gd library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-gd-includes - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
CFLAGS="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [])
|
||||
AC_MSG_RESULT([${CFLAGS}])
|
||||
|
||||
AC_MSG_CHECKING(for gd library flags)
|
||||
AC_ARG_WITH(gd-libs, [
|
||||
AC_HELP_STRING([--with-gd-libs=LDFLAGS], [linker flags for the gd library])
|
||||
], [LDFLAGS="${withval}" LIBS=""], [])
|
||||
AC_ARG_WITH(gd-libs,
|
||||
AS_HELP_STRING([@<:@--with-gd-libs=LDFLAGS@:>@], [linker flags for the gd library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-gd-libs - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
LDFLAGS="${withval}"
|
||||
LIBS=""
|
||||
;;
|
||||
esac
|
||||
], [])
|
||||
AC_MSG_RESULT([${LDFLAGS} ${LIBS}])
|
||||
|
||||
dnl check if gd is usable
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
dnl Check for LIBHAL compiler flags. On success, set nut_have_libhal="yes"
|
||||
dnl and set LIBHAL_CFLAGS and LIBHAL_LDFLAGS. On failure, set
|
||||
dnl and set LIBHAL_CFLAGS and LIBHAL_LIBS. On failure, set
|
||||
dnl nut_have_libhal="no". This macro can be run multiple times, but will
|
||||
dnl do the checking only once.
|
||||
dnl NUT requires HAL version 0.5.8 at least
|
||||
|
|
@ -10,129 +10,72 @@ if test -z "${nut_have_libhal_seen}"; then
|
|||
nut_have_libhal_seen=yes
|
||||
|
||||
CFLAGS_ORIG="${CFLAGS}"
|
||||
LDFLAGS_ORIG="${LDFLAGS}"
|
||||
LIBS_ORIG="${LIBS}"
|
||||
|
||||
AC_MSG_CHECKING(for libhal version via pkg-config (0.5.8 minimum required))
|
||||
HAL_VERSION=`pkg-config --silence-errors --modversion hal`
|
||||
if test "$?" = "0"; then
|
||||
if pkg-config --atleast-version=0.5.8 hal; then
|
||||
AC_MSG_RESULT(${HAL_VERSION} found)
|
||||
nut_have_libhal=yes
|
||||
|
||||
dnl also get cflags from glib-2.0 to workaround a bug in dbus-glib
|
||||
AC_MSG_CHECKING(for libhal cflags via pkg-config)
|
||||
CFLAGS=`pkg-config --silence-errors --cflags hal dbus-glib-1`
|
||||
if test "$?" = "0"; then
|
||||
AC_MSG_RESULT(${CFLAGS})
|
||||
else
|
||||
AC_MSG_RESULT(not found)
|
||||
nut_have_libhal=no
|
||||
fi
|
||||
|
||||
dnl also get libs from glib-2.0 to workaround a bug in dbus-glib
|
||||
AC_MSG_CHECKING(for libhal ldflags via pkg-config)
|
||||
LDFLAGS=`pkg-config --silence-errors --libs hal dbus-glib-1`
|
||||
if test "$?" = "0"; then
|
||||
AC_MSG_RESULT(${LDFLAGS})
|
||||
else
|
||||
AC_MSG_RESULT(not found)
|
||||
nut_have_libhal=no
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(${HAL_VERSION} is too old)
|
||||
nut_have_libhal=no
|
||||
fi
|
||||
HAL_VERSION="`pkg-config --silence-errors --modversion hal 2>/dev/null`"
|
||||
if test "$?" != "0" -o -z "${HAL_VERSION}"; then
|
||||
AC_MSG_RESULT(none found)
|
||||
elif pkg-config --silence-errors --atleast-version=0.5.8 hal 2>/dev/null; then
|
||||
AC_MSG_RESULT(${HAL_VERSION} found)
|
||||
else
|
||||
AC_MSG_RESULT(not found)
|
||||
nut_have_libhal=check
|
||||
AC_MSG_WARN(${HAL_VERSION} is too old)
|
||||
fi
|
||||
|
||||
dnl try again using defaults if pkg-config is not available
|
||||
if test "${nut_have_libhal}" = "check"; then
|
||||
CFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include"
|
||||
LDFLAGS="-lhal -ldbus-1 -lpthread"
|
||||
AC_MSG_CHECKING(for libhal cflags)
|
||||
AC_ARG_WITH(hal-includes,
|
||||
AS_HELP_STRING([@<:@--with-hal-includes=CFLAGS@:>@], [include flags for the HAL library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-hal-includes - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
CFLAGS="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [
|
||||
dnl also get cflags from glib-2.0 to workaround a bug in dbus-glib
|
||||
CFLAGS="`pkg-config --silence-errors --cflags hal dbus-glib-1 2>/dev/null`"
|
||||
if test "$?" != "0"; then
|
||||
CFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include"
|
||||
fi
|
||||
])
|
||||
AC_MSG_RESULT([${CFLAGS}])
|
||||
|
||||
AC_CHECK_HEADERS(libhal.h, [nut_have_libhal=yes], [nut_have_libhal=no], [AC_INCLUDES_DEFAULT])
|
||||
AC_CHECK_FUNCS(libhal_device_new_changeset, [], [nut_have_libhal=no])
|
||||
fi
|
||||
AC_MSG_CHECKING(for libhal ldflags)
|
||||
AC_ARG_WITH(hal-libs,
|
||||
AS_HELP_STRING([@<:@--with-hal-libs=LIBS@:>@], [linker flags for the HAL library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-hal-libs - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
LIBS="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [
|
||||
dnl also get libs from glib-2.0 to workaround a bug in dbus-glib
|
||||
LIBS="`pkg-config --silence-errors --libs hal dbus-glib-1 2>/dev/null`"
|
||||
if test "$?" != "0"; then
|
||||
LIBS="-lhal -ldbus-1 -lpthread"
|
||||
fi
|
||||
])
|
||||
AC_MSG_RESULT([${LIBS}])
|
||||
|
||||
dnl check if HAL is usable
|
||||
AC_CHECK_HEADERS(libhal.h, [nut_have_libhal=yes], [nut_have_libhal=no], [AC_INCLUDES_DEFAULT])
|
||||
AC_CHECK_HEADERS(glib.h dbus/dbus-glib.h, [], [nut_have_libhal=no], [AC_INCLUDES_DEFAULT])
|
||||
AC_CHECK_FUNCS(libhal_device_new_changeset, [], [nut_have_libhal=no])
|
||||
|
||||
if test "${nut_have_libhal}" = "yes"; then
|
||||
AC_CHECK_FUNCS(g_timeout_add_seconds)
|
||||
LIBHAL_CFLAGS="${CFLAGS}"
|
||||
LIBHAL_LDFLAGS="${LDFLAGS}"
|
||||
|
||||
dnl this will only work as of HAL 0.5.9
|
||||
AC_MSG_CHECKING(for libhal user via pkg-config)
|
||||
HAL_USER=`pkg-config --silence-errors --variable=haluser hal`
|
||||
if test -n "$HAL_USER"; then
|
||||
AC_MSG_RESULT(${HAL_USER})
|
||||
else
|
||||
HAL_USER="haldaemon"
|
||||
AC_MSG_RESULT(using default (${HAL_USER}))
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(HAL_USER, "${HAL_USER}", [HAL user])
|
||||
|
||||
dnl the device match key changed with HAL 0.5.11
|
||||
AC_MSG_CHECKING(for hal-${HAL_VERSION} device match key)
|
||||
HAL_DEVICE_MATCH_KEY=`pkg-config --silence-errors --atleast-version=0.5.11 hal`
|
||||
if test "$?" != "0"; then
|
||||
HAL_DEVICE_MATCH_KEY="info.bus"
|
||||
else
|
||||
HAL_DEVICE_MATCH_KEY="info.subsystem"
|
||||
fi
|
||||
AC_MSG_RESULT(${HAL_DEVICE_MATCH_KEY})
|
||||
AC_DEFINE_UNQUOTED(HAL_DEVICE_MATCH_KEY, "${HAL_DEVICE_MATCH_KEY}", [HAL device match key])
|
||||
|
||||
dnl Determine installation paths for callout and .fdi
|
||||
dnl As per HAL spec, §5 Callouts and §2 Device Information Files
|
||||
dnl - addon install path: $libdir/hal
|
||||
AC_MSG_CHECKING(for libhal Callouts path)
|
||||
HAL_CALLOUTS_PATH=`pkg-config --silence-errors --variable=libexecdir hal`
|
||||
if test -n "$HAL_CALLOUTS_PATH"; then
|
||||
AC_MSG_RESULT(${HAL_CALLOUTS_PATH})
|
||||
else
|
||||
# fallback to detecting the right path
|
||||
if (test -d "${libdir}/hal"); then
|
||||
# For Debian
|
||||
HAL_CALLOUTS_PATH="${libdir}/hal"
|
||||
AC_MSG_RESULT(${HAL_CALLOUTS_PATH})
|
||||
elif (test -d "/usr/libexec"); then
|
||||
# For RedHat
|
||||
HAL_CALLOUTS_PATH="${libexecdir}"
|
||||
AC_MSG_RESULT(${HAL_CALLOUTS_PATH})
|
||||
elif (test -d "/usr/lib/hal"); then
|
||||
# For OpenSUSE
|
||||
HAL_CALLOUTS_PATH="${libdir}/hal"
|
||||
AC_MSG_RESULT(${HAL_CALLOUTS_PATH})
|
||||
else
|
||||
# FIXME
|
||||
HAL_CALLOUTS_PATH="${libdir}/hal"
|
||||
AC_MSG_RESULT(using default (${HAL_CALLOUTS_PATH}))
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl - fdi install path: $datarootdir/hal/fdi/information/20thirdparty
|
||||
AC_MSG_CHECKING(for libhal Device Information path)
|
||||
HAL_FDI_PATH=`pkg-config --silence-errors --variable=hal_fdidir hal`
|
||||
if test -n "$HAL_FDI_PATH"; then
|
||||
HAL_FDI_PATH="${HAL_FDI_PATH}/information/20thirdparty"
|
||||
AC_MSG_RESULT(${HAL_FDI_PATH})
|
||||
else
|
||||
# seems supported everywhere
|
||||
HAL_FDI_PATH="${datarootdir}/hal/fdi/information/20thirdparty"
|
||||
AC_MSG_RESULT(${HAL_FDI_PATH})
|
||||
fi
|
||||
LIBHAL_LIBS="${LIBS}"
|
||||
fi
|
||||
|
||||
CFLAGS="${CFLAGS_ORIG}"
|
||||
LDFLAGS="${LDFLAGS_ORIG}"
|
||||
|
||||
dnl - test for g_timeout_add_seconds availability
|
||||
AC_MSG_CHECKING([if GLib is version 2.14.0 or newer])
|
||||
if pkg-config --silence-errors --atleast-version=2.14.0 glib-2.0; then
|
||||
AC_DEFINE(HAVE_GLIB_2_14, 1, [Define to 1 if GLib is version 2.14 or newer])
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
LIBS="${LIBS_ORIG}"
|
||||
fi
|
||||
])
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
dnl Check for LIBNEON compiler flags. On success, set nut_have_neon="yes"
|
||||
dnl and set LIBNEON_CFLAGS and LIBNEON_LDFLAGS. On failure, set
|
||||
dnl and set LIBNEON_CFLAGS and LIBNEON_LIBS. On failure, set
|
||||
dnl nut_have_neon="no". This macro can be run multiple times, but will
|
||||
dnl do the checking only once.
|
||||
|
||||
|
|
@ -8,30 +8,47 @@ AC_DEFUN([NUT_CHECK_LIBNEON],
|
|||
if test -z "${nut_have_neon_seen}"; then
|
||||
nut_have_neon_seen=yes
|
||||
|
||||
dnl save CFLAGS and LDFLAGS
|
||||
dnl save CFLAGS and LIBS
|
||||
CFLAGS_ORIG="${CFLAGS}"
|
||||
LDFLAGS_ORIG="${LDFLAGS}"
|
||||
LIBS_ORIG="${LIBS}"
|
||||
|
||||
dnl See which version of the neon library (if any) is installed
|
||||
AC_MSG_CHECKING(for libneon version via pkg-config (0.25.0 minimum required))
|
||||
NEON_VERSION=`pkg-config --silence-errors --modversion neon`
|
||||
if test "$?" = "0"; then
|
||||
AC_MSG_RESULT(${NEON_VERSION} found)
|
||||
else
|
||||
AC_MSG_RESULT(not found)
|
||||
NEON_VERSION="`pkg-config --silence-errors --modversion neon 2>/dev/null`"
|
||||
if test "$?" != "0" -o -z "${NEON_VERSION}"; then
|
||||
NEON_VERSION="none"
|
||||
fi
|
||||
AC_MSG_RESULT(${NEON_VERSION} found)
|
||||
|
||||
AC_MSG_CHECKING(for libneon cflags)
|
||||
AC_ARG_WITH(neon-includes, [
|
||||
AC_HELP_STRING([--with-neon-includes=CFLAGS], [include flags for the neon library])
|
||||
], [CFLAGS="${withval}"], [CFLAGS="`pkg-config --silence-errors --cflags neon`"])
|
||||
AC_ARG_WITH(neon-includes,
|
||||
AS_HELP_STRING([@<:@--with-neon-includes=CFLAGS@:>@], [include flags for the neon library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-neon-includes - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
CFLAGS="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [CFLAGS="`pkg-config --silence-errors --cflags neon 2>/dev/null`"])
|
||||
AC_MSG_RESULT([${CFLAGS}])
|
||||
|
||||
AC_MSG_CHECKING(for libneon ldflags)
|
||||
AC_ARG_WITH(neon-libs, [
|
||||
AC_HELP_STRING([--with-neon-libs=LDFLAGS], [linker flags for the neon library])
|
||||
], [LDFLAGS="${withval}"], [LDFLAGS="`pkg-config --silence-errors --libs neon`"])
|
||||
AC_MSG_RESULT([${LDFLAGS}])
|
||||
AC_ARG_WITH(neon-libs,
|
||||
AS_HELP_STRING([@<:@--with-neon-libs=LIBS@:>@], [linker flags for the neon library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-neon-libs - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
LIBS="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [LIBS="`pkg-config --silence-errors --libs neon 2>/dev/null`"])
|
||||
AC_MSG_RESULT([${LIBS}])
|
||||
|
||||
dnl check if neon is usable
|
||||
AC_CHECK_HEADERS(ne_xmlreq.h, [nut_have_neon=yes], [nut_have_neon=no], [AC_INCLUDES_DEFAULT])
|
||||
|
|
@ -41,11 +58,11 @@ if test -z "${nut_have_neon_seen}"; then
|
|||
dnl Check for connect timeout support in library (optional)
|
||||
AC_CHECK_FUNCS(ne_set_connect_timeout ne_sock_connect_timeout)
|
||||
LIBNEON_CFLAGS="${CFLAGS}"
|
||||
LIBNEON_LDFLAGS="${LDFLAGS}"
|
||||
LIBNEON_LIBS="${LIBS}"
|
||||
fi
|
||||
|
||||
dnl restore original CFLAGS and LDFLAGS
|
||||
dnl restore original CFLAGS and LIBS
|
||||
CFLAGS="${CFLAGS_ORIG}"
|
||||
LDFLAGS="${LDFLAGS_ORIG}"
|
||||
LIBS="${LIBS_ORIG}"
|
||||
fi
|
||||
])
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
dnl Check for LIBNETSNMP compiler flags. On success, set
|
||||
dnl nut_have_libnetsnmp="yes" and set LIBNETSNMP_CFLAGS and
|
||||
dnl LIBNETSNMP_LDFLAGS. On failure, set nut_have_libnetsnmp="no".
|
||||
dnl LIBNETSNMP_LIBS. On failure, set nut_have_libnetsnmp="no".
|
||||
dnl This macro can be run multiple times, but will do the checking only
|
||||
dnl once.
|
||||
|
||||
|
|
@ -9,30 +9,47 @@ AC_DEFUN([NUT_CHECK_LIBNETSNMP],
|
|||
if test -z "${nut_have_libnetsnmp_seen}"; then
|
||||
nut_have_libnetsnmp_seen=yes
|
||||
|
||||
dnl save CFLAGS and LDFLAGS
|
||||
dnl save CFLAGS and LIBS
|
||||
CFLAGS_ORIG="${CFLAGS}"
|
||||
LDFLAGS_ORIG="${LDFLAGS}"
|
||||
LIBS_ORIG="${LIBS}"
|
||||
|
||||
dnl See which version of the Net-SNMP library (if any) is installed
|
||||
AC_MSG_CHECKING(for Net-SNMP version via net-snmp-config)
|
||||
SNMP_VERSION=`net-snmp-config --version 2>/dev/null`
|
||||
if test "$?" = "0"; then
|
||||
AC_MSG_RESULT(${SNMP_VERSION} found)
|
||||
else
|
||||
AC_MSG_RESULT(not found)
|
||||
if test "$?" != "0" -o -z "${SNMP_VERSION}"; then
|
||||
SNMP_VERSION="none"
|
||||
fi
|
||||
AC_MSG_RESULT(${SNMP_VERSION} found)
|
||||
|
||||
AC_MSG_CHECKING(for Net-SNMP cflags)
|
||||
AC_ARG_WITH(snmp-includes, [
|
||||
AC_HELP_STRING([--with-snmp-includes=CFLAGS], [include flags for the Net-SNMP library])
|
||||
], [CFLAGS="${withval}"], [CFLAGS="`net-snmp-config --cflags 2>/dev/null`"])
|
||||
AC_ARG_WITH(snmp-includes,
|
||||
AS_HELP_STRING([@<:@--with-snmp-includes=CFLAGS@:>@], [include flags for the Net-SNMP library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-snmp-includes - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
CFLAGS="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [CFLAGS="`net-snmp-config --base-cflags 2>/dev/null`"])
|
||||
AC_MSG_RESULT([${CFLAGS}])
|
||||
|
||||
AC_MSG_CHECKING(for Net-SNMP libs)
|
||||
AC_ARG_WITH(snmp-libs, [
|
||||
AC_HELP_STRING([--with-snmp-libs=LDFLAGS], [linker flags for the Net-SNMP library])
|
||||
], [LDFLAGS="${withval}"], [LDFLAGS="`net-snmp-config --libs 2>/dev/null`"])
|
||||
AC_MSG_RESULT([${LDFLAGS}])
|
||||
AC_ARG_WITH(snmp-libs,
|
||||
AS_HELP_STRING([@<:@--with-snmp-libs=LIBS@:>@], [linker flags for the Net-SNMP library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-snmp-libs - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
LIBS="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [LIBS="`net-snmp-config --libs 2>/dev/null`"])
|
||||
AC_MSG_RESULT([${LIBS}])
|
||||
|
||||
dnl Check if the Net-SNMP library is usable
|
||||
AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [nut_have_libnetsnmp=yes], [nut_have_libnetsnmp=no], [AC_INCLUDES_DEFAULT])
|
||||
|
|
@ -40,11 +57,11 @@ if test -z "${nut_have_libnetsnmp_seen}"; then
|
|||
|
||||
if test "${nut_have_libnetsnmp}" = "yes"; then
|
||||
LIBNETSNMP_CFLAGS="${CFLAGS}"
|
||||
LIBNETSNMP_LDFLAGS="${LDFLAGS}"
|
||||
LIBNETSNMP_LIBS="${LIBS}"
|
||||
fi
|
||||
|
||||
dnl restore original CFLAGS and LDFLAGS
|
||||
dnl restore original CFLAGS and LIBS
|
||||
CFLAGS="${CFLAGS_ORIG}"
|
||||
LDFLAGS="${LDFLAGS_ORIG}"
|
||||
LIBS="${LIBS_ORIG}"
|
||||
fi
|
||||
])
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
dnl Check for LIBPOWERMAN compiler flags. On success, set nut_have_libpowerman="yes"
|
||||
dnl and set LIBPOWERMAN_CFLAGS and LIBPOWERMAN_LDFLAGS. On failure, set
|
||||
dnl and set LIBPOWERMAN_CFLAGS and LIBPOWERMAN_LIBS. On failure, set
|
||||
dnl nut_have_libpowerman="no". This macro can be run multiple times, but will
|
||||
dnl do the checking only once.
|
||||
|
||||
|
|
@ -8,21 +8,39 @@ AC_DEFUN([NUT_CHECK_LIBPOWERMAN],
|
|||
if test -z "${nut_have_libpowerman_seen}"; then
|
||||
nut_have_libpowerman_seen=yes
|
||||
|
||||
dnl save CFLAGS and LDFLAGS
|
||||
dnl save CFLAGS and LIBS
|
||||
CFLAGS_ORIG="${CFLAGS}"
|
||||
LDFLAGS_ORIG="${LDFLAGS}"
|
||||
LIBS_ORIG="${LIBS}"
|
||||
|
||||
AC_MSG_CHECKING(for libpowerman cflags)
|
||||
AC_ARG_WITH(powerman-includes, [
|
||||
AC_HELP_STRING([--with-powerman-includes=CFLAGS], [include flags for the libpowerman library])
|
||||
], [CFLAGS="${withval}"], [CFLAGS="`pkg-config --silence-errors --cflags libpowerman`"])
|
||||
AC_ARG_WITH(powerman-includes,
|
||||
AS_HELP_STRING([@<:@--with-powerman-includes=CFLAGS@:>@], [include flags for the libpowerman library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-powerman-includes - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
CFLAGS="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [CFLAGS="`pkg-config --silence-errors --cflags libpowerman 2>/dev/null`"])
|
||||
AC_MSG_RESULT([${CFLAGS}])
|
||||
|
||||
AC_MSG_CHECKING(for libpowerman libs)
|
||||
AC_ARG_WITH(powerman-libs, [
|
||||
AC_HELP_STRING([--with-powerman-libs=LDFLAGS], [linker flags for the libpowerman library])
|
||||
], [LDFLAGS="${withval}"], [LDFLAGS="`pkg-config --silence-errors --libs libpowerman`"])
|
||||
AC_MSG_RESULT([${LDFLAGS}])
|
||||
AC_ARG_WITH(powerman-libs,
|
||||
AS_HELP_STRING([@<:@--with-powerman-libs=LIBS@:>@], [linker flags for the libpowerman library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-powerman-libs - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
LIBS="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [LIBS="`pkg-config --silence-errors --libs libpowerman 2>/dev/null`"])
|
||||
AC_MSG_RESULT([${LIBS}])
|
||||
|
||||
dnl check if libpowerman is usable
|
||||
AC_CHECK_HEADERS(libpowerman.h, [nut_have_libpowerman=yes], [nut_have_libpowerman=no], [AC_INCLUDES_DEFAULT])
|
||||
|
|
@ -30,12 +48,12 @@ if test -z "${nut_have_libpowerman_seen}"; then
|
|||
|
||||
if test "${nut_have_libpowerman}" = "yes"; then
|
||||
LIBPOWERMAN_CFLAGS="${CFLAGS}"
|
||||
LIBPOWERMAN_LDFLAGS="${LDFLAGS}"
|
||||
LIBPOWERMAN_LIBS="${LIBS}"
|
||||
fi
|
||||
|
||||
dnl restore original CFLAGS and LDFLAGS
|
||||
dnl restore original CFLAGS and LIBS
|
||||
CFLAGS="${CFLAGS_ORIG}"
|
||||
LDFLAGS="${LDFLAGS_ORIG}"
|
||||
LIBS="${LIBS_ORIG}"
|
||||
|
||||
fi
|
||||
])
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
dnl Check for LIBSSL compiler flags. On success, set nut_have_libssl="yes"
|
||||
dnl and set LIBSSL_CFLAGS and LIBSSL_LDFLAGS. On failure, set
|
||||
dnl and set LIBSSL_CFLAGS and LIBSSL_LIBS. On failure, set
|
||||
dnl nut_have_libssl="no". This macro can be run multiple times, but will
|
||||
dnl do the checking only once.
|
||||
|
||||
|
|
@ -8,34 +8,52 @@ AC_DEFUN([NUT_CHECK_LIBSSL],
|
|||
if test -z "${nut_have_libssl_seen}"; then
|
||||
nut_have_libssl_seen=yes
|
||||
|
||||
dnl save CFLAGS and LDFLAGS
|
||||
dnl save CFLAGS and LIBS
|
||||
CFLAGS_ORIG="${CFLAGS}"
|
||||
LDFLAGS_ORIG="${LDFLAGS}"
|
||||
LIBS_ORIG="${LIBS}"
|
||||
|
||||
AC_MSG_CHECKING(for openssl version via pkg-config)
|
||||
OPENSSL_VERSION=`pkg-config --silence-errors --modversion openssl`
|
||||
if test "$?" = "0"; then
|
||||
AC_MSG_RESULT(${OPENSSL_VERSION} found)
|
||||
CFLAGS="`pkg-config --silence-errors --cflags openssl`"
|
||||
LDFLAGS="`pkg-config --silence-errors --libs openssl`"
|
||||
OPENSSL_VERSION="`pkg-config --silence-errors --modversion openssl 2>/dev/null`"
|
||||
if test "$?" = "0" -a -n "${OPENSSL_VERSION}"; then
|
||||
CFLAGS="`pkg-config --silence-errors --cflags openssl 2>/dev/null`"
|
||||
LIBS="`pkg-config --silence-errors --libs openssl 2>/dev/null`"
|
||||
else
|
||||
AC_MSG_RESULT(not found)
|
||||
OPENSSL_VERSION="none"
|
||||
CFLAGS=""
|
||||
LDFLAGS="-lssl -lcrypto"
|
||||
LIBS="-lssl -lcrypto"
|
||||
fi
|
||||
AC_MSG_RESULT(${OPENSSL_VERSION} found)
|
||||
|
||||
dnl allow overriding openssl settings if the user knows best
|
||||
AC_MSG_CHECKING(for openssl cflags)
|
||||
AC_ARG_WITH(ssl-includes, [
|
||||
AC_HELP_STRING([--with-ssl-includes=CFLAGS], [include flags for the OpenSSL library])
|
||||
], [CFLAGS="${withval}"], [])
|
||||
AC_ARG_WITH(ssl-includes,
|
||||
AS_HELP_STRING([@<:@--with-ssl-includes=CFLAGS@:>@], [include flags for the OpenSSL library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-ssl-includes - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
CFLAGS="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [])
|
||||
AC_MSG_RESULT([${CFLAGS}])
|
||||
|
||||
AC_MSG_CHECKING(for openssl ldflags)
|
||||
AC_ARG_WITH(ssl-libs, [
|
||||
AC_HELP_STRING([--with-ssl-libs=LDFLAGS], [linker flags for the OpenSSL library])
|
||||
], [LDFLAGS="${withval}"], [])
|
||||
AC_MSG_RESULT([${LDFLAGS}])
|
||||
AC_ARG_WITH(ssl-libs,
|
||||
AS_HELP_STRING([@<:@--with-ssl-libs=LIBS@:>@], [linker flags for the OpenSSL library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-ssl-libs - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
LIBS="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [])
|
||||
AC_MSG_RESULT([${LIBS}])
|
||||
|
||||
dnl check if openssl is usable
|
||||
AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_libssl=yes], [nut_have_libssl=no], [AC_INCLUDES_DEFAULT])
|
||||
|
|
@ -44,11 +62,11 @@ if test -z "${nut_have_libssl_seen}"; then
|
|||
if test "${nut_have_libssl}" = "yes"; then
|
||||
AC_DEFINE(HAVE_SSL, 1, [Define to enable SSL development code])
|
||||
LIBSSL_CFLAGS="${CFLAGS}"
|
||||
LIBSSL_LDFLAGS="${LDFLAGS}"
|
||||
LIBSSL_LIBS="${LIBS}"
|
||||
fi
|
||||
|
||||
dnl restore original CFLAGS and LDFLAGS
|
||||
dnl restore original CFLAGS and LIBS
|
||||
CFLAGS="${CFLAGS_ORIG}"
|
||||
LDFLAGS="${LDFLAGS_ORIG}"
|
||||
LIBS="${LIBS_ORIG}"
|
||||
fi
|
||||
])
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
dnl Check for LIBUSB compiler flags. On success, set nut_have_libusb="yes"
|
||||
dnl and set LIBUSB_CFLAGS and LIBUSB_LDFLAGS. On failure, set
|
||||
dnl and set LIBUSB_CFLAGS and LIBUSB_LIBS. On failure, set
|
||||
dnl nut_have_libusb="no". This macro can be run multiple times, but will
|
||||
dnl do the checking only once.
|
||||
|
||||
|
|
@ -8,41 +8,58 @@ AC_DEFUN([NUT_CHECK_LIBUSB],
|
|||
if test -z "${nut_have_libusb_seen}"; then
|
||||
nut_have_libusb_seen=yes
|
||||
|
||||
dnl save CFLAGS and LDFLAGS
|
||||
dnl save CFLAGS and LIBS
|
||||
CFLAGS_ORIG="${CFLAGS}"
|
||||
LDFLAGS_ORIG="${LDFLAGS}"
|
||||
LIBS_ORIG="${LIBS}"
|
||||
|
||||
AC_MSG_CHECKING(for libusb version via pkg-config)
|
||||
LIBUSB_VERSION=`pkg-config --silence-errors --modversion libusb`
|
||||
if test "$?" = "0"; then
|
||||
AC_MSG_RESULT(${LIBUSB_VERSION} found)
|
||||
CFLAGS="`pkg-config --silence-errors --cflags libusb`"
|
||||
LDFLAGS="`pkg-config --silence-errors --libs libusb`"
|
||||
LIBUSB_VERSION="`pkg-config --silence-errors --modversion libusb 2>/dev/null`"
|
||||
if test "$?" = "0" -a -n "${LIBUSB_VERSION}"; then
|
||||
CFLAGS="`pkg-config --silence-errors --cflags libusb 2>/dev/null`"
|
||||
LIBS="`pkg-config --silence-errors --libs libusb 2>/dev/null`"
|
||||
else
|
||||
AC_MSG_CHECKING(via libusb-config)
|
||||
LIBUSB_VERSION=`libusb-config --version 2>/dev/null`
|
||||
if test "$?" = "0"; then
|
||||
AC_MSG_RESULT(${LIBUSB_VERSION} found)
|
||||
LIBUSB_VERSION="`libusb-config --version 2>/dev/null`"
|
||||
if test "$?" = "0" -a -n "${LIBUSB_VERSION}"; then
|
||||
CFLAGS="`libusb-config --cflags 2>/dev/null`"
|
||||
LDFLAGS="`libusb-config --libs 2>/dev/null`"
|
||||
LIBS="`libusb-config --libs 2>/dev/null`"
|
||||
else
|
||||
AC_MSG_RESULT(not found)
|
||||
LIBUSB_VERSION="none"
|
||||
CFLAGS=""
|
||||
LDFLAGS="-lusb"
|
||||
LIBS="-lusb"
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT(${LIBUSB_VERSION} found)
|
||||
|
||||
AC_MSG_CHECKING(for libusb cflags)
|
||||
AC_ARG_WITH(usb-includes, [
|
||||
AC_HELP_STRING([--with-usb-includes=CFLAGS], [include flags for the libusb library])
|
||||
], [CFLAGS="${withval}"], [])
|
||||
AC_ARG_WITH(usb-includes,
|
||||
AS_HELP_STRING([@<:@--with-usb-includes=CFLAGS@:>@], [include flags for the libusb library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-usb-includes - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
CFLAGS="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [])
|
||||
AC_MSG_RESULT([${CFLAGS}])
|
||||
|
||||
AC_MSG_CHECKING(for libusb ldflags)
|
||||
AC_ARG_WITH(usb-libs, [
|
||||
AC_HELP_STRING([--with-usb-libs=LDFLAGS], [linker flags for the libusb library])
|
||||
], [LDFLAGS="${withval}"], [])
|
||||
AC_MSG_RESULT([${LDFLAGS}])
|
||||
AC_ARG_WITH(usb-libs,
|
||||
AS_HELP_STRING([@<:@--with-usb-libs=LIBS@:>@], [linker flags for the libusb library]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-usb-libs - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
LIBS="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [])
|
||||
AC_MSG_RESULT([${LIBS}])
|
||||
|
||||
dnl check if libusb is usable
|
||||
AC_CHECK_HEADERS(usb.h, [nut_have_libusb=yes], [nut_have_libusb=no], [AC_INCLUDES_DEFAULT])
|
||||
|
|
@ -52,11 +69,11 @@ if test -z "${nut_have_libusb_seen}"; then
|
|||
dnl Check for libusb "force driver unbind" availability
|
||||
AC_CHECK_FUNCS(usb_detach_kernel_driver_np)
|
||||
LIBUSB_CFLAGS="${CFLAGS}"
|
||||
LIBUSB_LDFLAGS="${LDFLAGS}"
|
||||
LIBUSB_LIBS="${LIBS}"
|
||||
fi
|
||||
|
||||
dnl restore original CFLAGS and LDFLAGS
|
||||
dnl restore original CFLAGS and LIBS
|
||||
CFLAGS="${CFLAGS_ORIG}"
|
||||
LDFLAGS="${LDFLAGS_ORIG}"
|
||||
LIBS="${LIBS_ORIG}"
|
||||
fi
|
||||
])
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
dnl Check for LIBWRAP compiler flags. On success, set nut_have_libwrap="yes"
|
||||
dnl and set LIBWRAP_CFLAGS and LIBWRAP_LDFLAGS. On failure, set
|
||||
dnl and set LIBWRAP_CFLAGS and LIBWRAP_LIBS. On failure, set
|
||||
dnl nut_have_libwrap="no". This macro can be run multiple times, but will
|
||||
dnl do the checking only once.
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ int allow_severity = 0, deny_severity = 0;
|
|||
if test "${nut_have_libwrap}" = "yes"; then
|
||||
AC_DEFINE(HAVE_WRAP, 1, [Define to enable libwrap support])
|
||||
LIBWRAP_CFLAGS=""
|
||||
LIBWRAP_LDFLAGS="${LIBS}"
|
||||
LIBWRAP_LIBS="${LIBS}"
|
||||
fi
|
||||
|
||||
dnl restore original LIBS
|
||||
|
|
|
|||
0
m4/nut_check_os.m4
Executable file → Normal file
0
m4/nut_check_os.m4
Executable file → Normal file
102
m4/nut_config_libhal.m4
Normal file
102
m4/nut_config_libhal.m4
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
dnl Check for LIBHAL configuration if support for HAL was found.
|
||||
dnl This keeps compile and link time options separate from runtime
|
||||
dnl configuration items. This macro can be run multiple times, but
|
||||
dnl will do the checking only once.
|
||||
|
||||
AC_DEFUN([NUT_CONFIG_LIBHAL],
|
||||
[
|
||||
if test -z "${nut_have_config_libhal_seen}" -a "${nut_have_libhal}" = "yes"; then
|
||||
nut_have_config_libhal_seen=yes
|
||||
|
||||
AC_REQUIRE([NUT_CHECK_LIBHAL])
|
||||
|
||||
AC_MSG_CHECKING(for libhal user)
|
||||
AC_ARG_WITH(hal-user,
|
||||
AS_HELP_STRING([@<:@--with-hal-user=USER@:>@], [addons run as user]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-hal-user - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
HAL_USER="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [
|
||||
dnl this will only work as of HAL 0.5.9
|
||||
HAL_USER="`pkg-config --silence-errors --variable=haluser hal 2>/dev/null`"
|
||||
if test "$?" != "0" -o -z "${HAL_USER}"; then
|
||||
HAL_USER="haldaemon"
|
||||
fi
|
||||
])
|
||||
AC_MSG_RESULT(${HAL_USER})
|
||||
AC_DEFINE_UNQUOTED(HAL_USER, "${HAL_USER}", [addons run as user])
|
||||
|
||||
AC_MSG_CHECKING(for libhal device match key)
|
||||
AC_ARG_WITH(hal-device-match-key,
|
||||
AS_HELP_STRING([@<:@--with-hal-device-match-key=KEY@:>@], [device match key]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-hal-device-match-key - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
HAL_DEVICE_MATCH_KEY="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [
|
||||
dnl the device match key changed with HAL 0.5.11
|
||||
if pkg-config --silence-errors --atleast-version=0.5.11 hal 2>/dev/null; then
|
||||
HAL_DEVICE_MATCH_KEY="info.bus"
|
||||
else
|
||||
HAL_DEVICE_MATCH_KEY="info.subsystem"
|
||||
fi
|
||||
])
|
||||
AC_MSG_RESULT(${HAL_DEVICE_MATCH_KEY})
|
||||
|
||||
AC_MSG_CHECKING(for libhal Callouts path)
|
||||
AC_ARG_WITH(hal-callouts-path,
|
||||
AS_HELP_STRING([@<:@--with-hal-callouts-path=PATH@:>@], [installation path for callouts]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-hal-callouts-path - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
HAL_CALLOUTS_PATH="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [
|
||||
dnl Determine installation path for callouts
|
||||
dnl As per HAL spec, §5 Callouts addon install path: $libdir/hal
|
||||
HAL_CALLOUTS_PATH="`pkg-config --silence-errors --variable=libexecdir hal 2>/dev/null`"
|
||||
if test "$?" != "0" -o -z "${HAL_CALLOUTS_PATH}"; then
|
||||
HAL_CALLOUTS_PATH="${libdir}/hal"
|
||||
fi
|
||||
])
|
||||
AC_MSG_RESULT(${HAL_CALLOUTS_PATH})
|
||||
|
||||
AC_MSG_CHECKING(for libhal Device Information path)
|
||||
AC_ARG_WITH(hal-fdi-path,
|
||||
AS_HELP_STRING([@<:@--with-hal-fdi-path=PATH@:>@], [installation path for device information files]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|no)
|
||||
AC_MSG_ERROR(invalid option --with(out)-hal-fdi-path - see docs/configure.txt)
|
||||
;;
|
||||
*)
|
||||
HAL_FDI_PATH="${withval}"
|
||||
;;
|
||||
esac
|
||||
], [
|
||||
dnl Determine installation path for .fdi
|
||||
dnl As per HAL spec, §2 Device Information Files
|
||||
dnl fdi install path: $datarootdir/hal/fdi/information/20thirdparty
|
||||
HAL_FDI_PATH="`pkg-config --silence-errors --variable=hal_fdidir hal 2>/dev/null`"
|
||||
if test "$?" != "0" -o -z "${HAL_FDI_PATH}"; then
|
||||
HAL_FDI_PATH="${datarootdir}/hal/fdi/information/20thirdparty"
|
||||
fi
|
||||
])
|
||||
AC_MSG_RESULT(${HAL_FDI_PATH})
|
||||
fi
|
||||
])
|
||||
|
|
@ -5,7 +5,7 @@ AC_DEFUN([NUT_REPORT],
|
|||
nut_report_feature_flag="1"
|
||||
ac_clean_files="${ac_clean_files} conf_nut_report_feature"
|
||||
echo > conf_nut_report_feature
|
||||
echo "Configuration summary:" >> conf_nut_report_feature
|
||||
echo -e "Configuration summary:\n======================" >> conf_nut_report_feature
|
||||
fi
|
||||
echo "$1: $2" >> conf_nut_report_feature
|
||||
])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue