From fa13b2838fd32854a4b2c6a5fff47e17a72294fb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 22 Sep 2011 14:41:46 +0100 Subject: [PATCH] erlang: Use the official autoconf macros. --- TODO | 6 ------ configure.ac | 31 +++++-------------------------- erlang/Makefile.am | 6 +++--- 3 files changed, 8 insertions(+), 35 deletions(-) diff --git a/TODO b/TODO index 9fc32ef..7a4c367 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 83f25c9..c5b7bd0 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 933e602..d262f87 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 -- 1.8.3.1