summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-03-06 12:43:05 +0100
committerGuido Günther <agx@sigxcpu.org>2014-03-06 12:43:05 +0100
commit9c408f94dfc5728b4d533584d7eff9bd86ba2ae3 (patch)
treea16cbcdf9e5df031705a36f8e2acd9c97a9b145d /m4
parent22e83d797960efd261a6188c1ebe42b169fcbc86 (diff)
New upstream version 1.2.2
Diffstat (limited to 'm4')
-rw-r--r--m4/gnulib-common.m456
-rw-r--r--m4/gnulib-comp.m41
-rw-r--r--m4/libtool.m44
-rw-r--r--m4/pthread.m417
-rw-r--r--m4/virt-driver-bhyve.m457
-rw-r--r--m4/virt-lib.m420
-rw-r--r--m4/virt-systemd-daemon.m434
7 files changed, 179 insertions, 10 deletions
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 3b61b239b..20ce40e74 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -379,3 +379,59 @@ AC_DEFUN([gl_CACHE_VAL_SILENT],
# AS_VAR_COPY was added in autoconf 2.63b
m4_define_default([AS_VAR_COPY],
[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
+
+# AC_PROG_SED was added in autoconf 2.59b
+m4_ifndef([AC_PROG_SED],
+[AC_DEFUN([AC_PROG_SED],
+[AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED,
+ [dnl ac_script should not contain more than 99 commands (for HP-UX sed),
+ dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed.
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ AS_UNSET([ac_script])
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ _AS_PATH_WALK([], [
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ AS_EXECUTABLE_P(["$ac_path_SED"]) || continue
+ case `"$ac_path_SED" --version 2>&1` in
+ *GNU*) ac_cv_path_SED=$ac_path_SED ac_path_SED_found=:;;
+ *)
+ ac_count=0
+ _AS_ECHO_N([0123456789]) >conftest.in
+ while :
+ do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >> conftest.nl
+ "$ac_path_SED" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
+ diff conftest.out conftest.nl >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best so far, but keep looking for better
+ ac_cv_path_SED=$ac_path_SED
+ ac_path_SED_max=$ac_count
+ fi
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+ esac
+ $ac_path_SED_found && break 3
+ done
+ done])
+ if test -z "$ac_cv_path_SED"; then
+ AC_ERROR([no acceptable sed could be found in \$PATH])
+ fi
+ else
+ ac_cv_path_SED=$SED
+ fi
+ SED="$ac_cv_path_SED"
+ AC_SUBST([SED])dnl
+ rm -f conftest.sed
+])])])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 11bac77d4..b397cc8a3 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -809,6 +809,7 @@ AC_SUBST([LTALLOCA])
gl_SYS_STAT_MODULE_INDICATOR([lstat])
AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER],
[AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])])
+ AC_REQUIRE([AC_PROG_SED])
gl_FUNC_MALLOC_GNU
if test $REPLACE_MALLOC = 1; then
AC_LIBOBJ([malloc])
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 126202f9c..f12cfdf0b 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1326,10 +1326,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- powerpcle-*linux*)
+ powerpc64le-*linux*)
LD="${LD-ld} -m elf32lppclinux"
;;
- powerpc-*linux*)
+ powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
diff --git a/m4/pthread.m4 b/m4/pthread.m4
index 2141e53f1..1ed0dd335 100644
--- a/m4/pthread.m4
+++ b/m4/pthread.m4
@@ -1,4 +1,4 @@
-# pthread.m4 serial 7
+# pthread.m4 serial 8
dnl Copyright (C) 2009-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,6 +10,19 @@ AC_DEFUN([gl_PTHREAD_CHECK],
gl_CHECK_NEXT_HEADERS([pthread.h])
if test $ac_cv_header_pthread_h = yes; then
HAVE_PTHREAD_H=1
+ # mingw 3.0 uses winpthreads which installs broken macros via <pthread.h>
+ AC_CACHE_CHECK([whether <pthread.h> pollutes the namespace],
+ [gl_cv_header_pthread_h_pollution],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ #ifdef strtok_r
+ #error
+ break me
+ #endif
+ ]])],
+ [gl_cv_header_pthread_h_pollution=no],
+ [gl_cv_header_pthread_h_pollution=yes])])
else
HAVE_PTHREAD_H=0
fi
@@ -31,6 +44,8 @@ AC_DEFUN([gl_PTHREAD_CHECK],
test $ac_cv_type_pthread_spinlock_t != yes; then
PTHREAD_H='pthread.h'
AC_LIBOBJ([pthread])
+ elif test $gl_cv_header_pthread_h_pollution = yes; then
+ PTHREAD_H=pthread.h
else
PTHREAD_H=
fi
diff --git a/m4/virt-driver-bhyve.m4 b/m4/virt-driver-bhyve.m4
new file mode 100644
index 000000000..9c0030b70
--- /dev/null
+++ b/m4/virt-driver-bhyve.m4
@@ -0,0 +1,57 @@
+dnl The bhyve driver
+dnl
+dnl Copyright (C) 2014 Roman Bogorodskiy
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library. If not, see
+dnl <http://www.gnu.org/licenses/>.
+dnl
+
+AC_DEFUN([LIBVIRT_DRIVER_CHECK_BHYVE],[
+ AC_ARG_WITH([bhyve],
+ [AS_HELP_STRING([--with-bhyve],
+ [add BHyVe support @<:@default=check@:>@])])
+ m4_divert_text([DEFAULTS], [with_bhyve=check])
+
+ if test "$with_bhyve" != "no"; then
+ AC_PATH_PROG([BHYVE], [bhyve], [], [$PATH:/usr/sbin])
+ AC_PATH_PROG([BHYVECTL], [bhyvectl], [], [$PATH:/usr/sbin])
+ AC_PATH_PROG([BHYVELOAD], [bhyveload], [], [$PATH:/usr/sbin/])
+
+ if test -z "$BHYVE" || test -z "$BHYVECTL" \
+ test -z "$BHYVELOAD" || test "$with_freebsd" = "no"; then
+ if test "$with_bhyve" = "check"; then
+ with_bhyve="no"
+ else
+ AC_MSG_ERROR([The bhyve driver cannot be enabled])
+ fi
+ else
+ with_bhyve="yes"
+ fi
+ fi
+
+ if test "$with_bhyve" = "yes"; then
+ AC_DEFINE_UNQUOTED([WITH_BHYVE], 1, [whether bhyve driver is enabled])
+ AC_DEFINE_UNQUOTED([BHYVE], ["$BHYVE"],
+ [Location of the bhyve tool])
+ AC_DEFINE_UNQUOTED([BHYVECTL], ["$BHYVECTL"],
+ [Location of the bhyvectl tool])
+ AC_DEFINE_UNQUOTED([BHYVELOAD], ["$BHYVELOAD"],
+ [Location of the bhyveload tool])
+ fi
+ AM_CONDITIONAL([WITH_BHYVE], [test "$with_bhyve" = "yes"])
+])
+
+AC_DEFUN([LIBVIRT_DRIVER_RESULT_BHYVE],[
+ AC_MSG_NOTICE([ Bhyve: $with_bhyve])
+])
diff --git a/m4/virt-lib.m4 b/m4/virt-lib.m4
index cff4fbb8d..75b9b1dec 100644
--- a/m4/virt-lib.m4
+++ b/m4/virt-lib.m4
@@ -1,7 +1,7 @@
dnl
dnl virt-lib.m4: Helper macros for checking for libraries
dnl
-dnl Copyright (C) 2012-2013 Red Hat, Inc.
+dnl Copyright (C) 2012-2014 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
@@ -54,16 +54,17 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[
m4_pushdef([header_name], [$4])
m4_pushdef([check_name_lc], m4_tolower(check_name))
+ m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-]))
m4_pushdef([config_var], [WITH_]check_name)
m4_pushdef([make_var], [WITH_]check_name)
m4_pushdef([cflags_var], check_name[_CFLAGS])
m4_pushdef([libs_var], check_name[_LIBS])
- m4_pushdef([arg_var], [with-]check_name_lc)
+ m4_pushdef([arg_var], [with-]check_name_dash)
m4_pushdef([with_var], [with_]check_name_lc)
m4_divert_text([DEFAULTS], [with_var][=check])
- AC_ARG_WITH(check_name_lc,
+ AC_ARG_WITH(check_name_dash,
[AS_HELP_STRING([--arg_var],
[with lib]]m4_dquote(library_name)[[ support @<:@default=check@:>@])])
@@ -126,6 +127,7 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[
m4_popdef([make_var])
m4_popdef([config_var])
+ m4_popdef([check_name_dash])
m4_popdef([check_name_lc])
m4_popdef([header_name])
@@ -182,18 +184,19 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[
m4_pushdef([header_name_alt], [$8])
m4_pushdef([check_name_lc], m4_tolower(check_name))
+ m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-]))
m4_pushdef([config_var], [WITH_]check_name)
m4_pushdef([make_var], [WITH_]check_name)
m4_pushdef([cflags_var], check_name[_CFLAGS])
m4_pushdef([libs_var], check_name[_LIBS])
- m4_pushdef([arg_var], [with-]check_name_lc)
+ m4_pushdef([arg_var], [with-]check_name_dash)
m4_pushdef([with_var], [with_]check_name_lc)
m4_pushdef([config_var_alt], [WITH_]check_name_alt)
m4_pushdef([make_var_alt], [WITH_]check_name_alt)
m4_divert_text([DEFAULTS], [with_var][=check])
- AC_ARG_WITH(check_name_lc,
+ AC_ARG_WITH(check_name_dash,
[AS_HELP_STRING([--arg_var],
[with lib]]m4_dquote(library_name)[[ support @<:@default=check@:>@])])
@@ -273,6 +276,7 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[
m4_popdef([config_var])
m4_popdef([check_name_lc])
+ m4_popdef([check_name_dash])
m4_popdef([header_name_alt])
m4_popdef([function_name_alt])
@@ -310,16 +314,17 @@ AC_DEFUN([LIBVIRT_CHECK_PKG],[
m4_pushdef([pc_version], [$3])
m4_pushdef([check_name_lc], m4_tolower(check_name))
+ m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-]))
m4_pushdef([config_var], [WITH_]check_name)
m4_pushdef([make_var], [WITH_]check_name)
m4_pushdef([cflags_var], check_name[_CFLAGS])
m4_pushdef([libs_var], check_name[_LIBS])
- m4_pushdef([arg_var], [with-]check_name_lc)
+ m4_pushdef([arg_var], [with-]check_name_dash)
m4_pushdef([with_var], [with_]check_name_lc)
m4_divert_text([DEFAULTS], [with_var][=check])
- AC_ARG_WITH(check_name_lc,
+ AC_ARG_WITH(check_name_dash,
[AS_HELP_STRING([--arg_var],
[with ]]m4_dquote(pc_name)[[ (>= ]]m4_dquote(pc_version)[[) support @<:@default=check@:>@])])
@@ -353,6 +358,7 @@ AC_DEFUN([LIBVIRT_CHECK_PKG],[
m4_popdef([config_var])
m4_popdef([check_name_lc])
+ m4_popdef([check_name_dash])
m4_popdef([pc_version])
m4_popdef([pc_name])
diff --git a/m4/virt-systemd-daemon.m4 b/m4/virt-systemd-daemon.m4
new file mode 100644
index 000000000..8516e41d5
--- /dev/null
+++ b/m4/virt-systemd-daemon.m4
@@ -0,0 +1,34 @@
+dnl The libsystemd-daemon.so library
+dnl
+dnl Copyright (C) 2012-2013 Red Hat, Inc.
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library. If not, see
+dnl <http://www.gnu.org/licenses/>.
+dnl
+
+AC_DEFUN([LIBVIRT_CHECK_SYSTEMD_DAEMON],[
+ LIBVIRT_CHECK_PKG([SYSTEMD_DAEMON], [libsystemd-daemon], [0.27.1])
+
+ old_CFLAGS="$CFLAGS"
+ old_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $SYSTEMD_DAEMON_CFLAGS"
+ LIBS="$LIBS $SYSTEMD_DAEMON_LIBS"
+ AC_CHECK_FUNCS([sd_notify])
+ CFLAGS="$old_CFLAGS"
+ LIBS="$old_LIBS"
+])
+
+AC_DEFUN([LIBVIRT_RESULT_SYSTEMD_DAEMON],[
+ LIBVIRT_RESULT_LIB([SYSTEMD_DAEMON])
+])