From d4cbe99effc5f4a42897b00d0f6a8dc65fccc269 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 10 Dec 2015 19:33:16 +0000 Subject: [PATCH] Checking for availability of LIBBURN_ARCH_LIBS --- acinclude.m4 | 33 +++++++++++++++++++++++++++++++++ configure.ac | 3 +++ xorriso/configure_ac.txt | 3 +++ 3 files changed, 39 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 85a6418a..e55c36d5 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -334,4 +334,37 @@ AC_DEFUN([LIBBURNIA_TRY_TIMEZONE], echo "$LIBBURNIA_TIMEZONE" ]) +dnl LIBBURNIA_CHECK_ARCH_LIBS is by Thomas Schmitt, libburnia project +dnl It tests whether the OS dependent libraries are available. +dnl With libisoburn they are needed only for the case that indirect linking +dnl does not work. So it is worth a try to omit them. +dnl $1 = "mandatory" or "optional" define the action if test linking fails. +AC_DEFUN([LIBBURNIA_CHECK_ARCH_LIBS], +[ + libburnia_save_LIBS="$LIBS" + if test "x$LIBBURN_ARCH_LIBS" = x + then + dummy=dummy + else + LIBS="$LIBS $LIBBURN_ARCH_LIBS" + AC_TRY_LINK([#include ], [printf("Hello\n");], + [archlibs_test="yes"], [archlibs_test="no"]) + LIBS="$libburnia_save_LIBS" + if test x$archlibs_test = xno + then + if test x"$1" = xmandatory + then + echo >&2 + echo "FATAL: Test linking with mandatory library options failed: $LIBBURN_ARCH_LIBS" >&2 + echo >&2 + (exit 1); exit 1; + else + echo "disabled linking with $LIBBURN_ARCH_LIBS (because not found)" + LIBBURN_ARCH_LIBS="" + fi + else + echo "enabled linking with $LIBBURN_ARCH_LIBS" + fi + fi +]) diff --git a/configure.ac b/configure.ac index b9561b9f..39563bce 100644 --- a/configure.ac +++ b/configure.ac @@ -124,6 +124,9 @@ AC_SUBST(ARCH) AC_SUBST(LIBBURNIA_PKGCONFDIR) AC_SUBST(LIBBURN_ARCH_LIBS) +# Do not link libcam or libvolmgt if not available. +# (They are indirect dependency on FreeBSD or Solaris.) +LIBBURNIA_CHECK_ARCH_LIBS(optional) dnl Determine target directory for libisoburn-*.pc dnl Important: Must be performed _after_ TARGET_SHIZZLE diff --git a/xorriso/configure_ac.txt b/xorriso/configure_ac.txt index c214efd0..edf239c2 100644 --- a/xorriso/configure_ac.txt +++ b/xorriso/configure_ac.txt @@ -477,6 +477,9 @@ then AC_DEFINE([Libburn_read_o_direcT], []) fi +# Check for system dependent mandatory libraries (LIBBURN_ARCH_LIBS) +LIBBURNIA_CHECK_ARCH_LIBS(mandatory) + # ------- Visible mark in configure : Start of library check