summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-09-22 14:41:46 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-09-22 14:41:46 +0100
commitfa13b2838fd32854a4b2c6a5fff47e17a72294fb (patch)
treeab4253d4984bcccb99b63a939e4274e0738f6838
parent8324d2fcf00d5f3d6bc0f10ae61bbfd7c1961d93 (diff)
downloadlibguestfs-fa13b2838fd32854a4b2c6a5fff47e17a72294fb.tar.gz
libguestfs-fa13b2838fd32854a4b2c6a5fff47e17a72294fb.tar.xz
libguestfs-fa13b2838fd32854a4b2c6a5fff47e17a72294fb.zip
erlang: Use the official autoconf macros.
-rw-r--r--TODO6
-rw-r--r--configure.ac31
-rw-r--r--erlang/Makefile.am6
3 files changed, 8 insertions, 35 deletions
diff --git a/TODO b/TODO
index 9fc32efa..7a4c3675 100644
--- a/TODO
+++ b/TODO
@@ -532,9 +532,3 @@ libosinfo mappings for virt-inspector
-------------------------------------
Return libosinfo mappings from inspection API.
-
-Erlang bindings
----------------
-
-Use the AC_ERLANG_* autoconf macros. See:
-https://github.com/ndim/erlusb/blob/master/configure.ac
diff --git a/configure.ac b/configure.ac
index 83f25c96..c5b7bd00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -887,42 +887,21 @@ AS_IF([test "x$enable_php" != "xno"],
AM_CONDITIONAL([HAVE_PHP], [test "x$PHP" != "xno" && test "x$PHPIZE" != "xno"])
dnl Erlang
-ERLC=no
-ERL_INTERFACEDIR=no
AC_ARG_ENABLE([erlang],
AS_HELP_STRING([--disable-erlang], [Disable Erlang language bindings]),
[],
[enable_erlang=yes])
AS_IF([test "x$enable_erlang" != "xno"],
[
- ERLC=
- AC_CHECK_PROG([ERLC],[erlc],[erlc],[no])
+ AC_ERLANG_PATH_ERLC([no])
if test "x$ERLC" != "xno"; then
- dnl Look for erl_interface directory in various places.
- AC_MSG_CHECKING([for erl_interface])
-
- for d in \
- $libdir /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64
- do
- dir=`ls -1d $d/erlang/lib/erl_interface-* 2>/dev/null`
- if test "x$dir" != "x" && test -d "$dir"; then
- AC_MSG_RESULT([$dir])
- ERL_INTERFACEDIR=$dir
- break
- fi
- done
-
- if test "x$ERL_INTERFACEDIR" = "xno"; then
- AC_MSG_RESULT([not found])
- fi
+ AC_ERLANG_CHECK_LIB([erl_interface], [],
+ [AC_MSG_FAILURE([Erlang erl_interface library not installed. Use --disable-erlang to disable.])])
+ AC_ERLANG_SUBST_LIB_DIR
fi
-
- AC_SUBST([ERLC])
- AC_SUBST([ERL_INTERFACEDIR])
])
-AM_CONDITIONAL([HAVE_ERLANG],
- [test "x$ERLC" != "xno" && test "x$ERL_INTERFACEDIR" != "xno"])
+AM_CONDITIONAL([HAVE_ERLANG], [test "x$ERLC" != "xno"])
dnl Check for Perl modules needed by Perl virt tools (virt-df, etc.)
AS_IF([test "x$PERL" != "xno"],
diff --git a/erlang/Makefile.am b/erlang/Makefile.am
index 933e6026..d262f874 100644
--- a/erlang/Makefile.am
+++ b/erlang/Makefile.am
@@ -41,12 +41,12 @@ erl_guestfs_SOURCES = erl-guestfs.c erl-guestfs-proto.c
erl_guestfs_CFLAGS = \
-I$(top_srcdir)/src -I$(top_builddir)/src \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
- -I$(ERL_INTERFACEDIR)/include \
+ -I$(ERLANG_LIB_DIR_erl_interface)/include \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
erl_guestfs_LDADD = \
- $(ERL_INTERFACEDIR)/lib/liberl_interface.a \
- $(ERL_INTERFACEDIR)/lib/libei.a \
+ $(ERLANG_LIB_DIR_erl_interface)/lib/liberl_interface.a \
+ $(ERLANG_LIB_DIR_erl_interface)/lib/libei.a \
-lpthread \
$(top_builddir)/src/libguestfs.la \
../gnulib/lib/libgnu.la