Made optional the use of libcam and thus SCSI passthrough on GNU/FreeBSD systems

This commit is contained in:
Thomas Schmitt 2021-03-12 09:32:19 +01:00
parent be21a6374b
commit a5146807ff
2 changed files with 83 additions and 14 deletions

View File

@ -27,6 +27,7 @@ AC_DEFUN([TARGET_SHIZZLE],
AC_MSG_CHECKING([target operating system]) AC_MSG_CHECKING([target operating system])
libburn_check_libcam=
LIBBURNIA_SUPP_ACL=none LIBBURNIA_SUPP_ACL=none
LIBBURNIA_SUPP_FATTR=none LIBBURNIA_SUPP_FATTR=none
LIBBURNIA_LDCONFIG_CMD="echo 'No ldconfig run performed. If needed, configure manually for:'" LIBBURNIA_LDCONFIG_CMD="echo 'No ldconfig run performed. If needed, configure manually for:'"
@ -50,6 +51,7 @@ AC_DEFUN([TARGET_SHIZZLE],
*-kfreebsd*-gnu*) *-kfreebsd*-gnu*)
ARCH=freebsd ARCH=freebsd
LIBBURN_ARCH_LIBS=-lcam LIBBURN_ARCH_LIBS=-lcam
libburn_check_libcam=yes
;; ;;
*-solaris*) *-solaris*)
ARCH=solaris ARCH=solaris
@ -61,8 +63,12 @@ AC_DEFUN([TARGET_SHIZZLE],
# AC_ERROR([You are attempting to compile for an unsupported platform]) # AC_ERROR([You are attempting to compile for an unsupported platform])
;; ;;
esac esac
AC_MSG_RESULT([$ARCH]) AC_MSG_RESULT([$ARCH])
if test x"$libburn_check_libcam" = xyes
then
LIBBURNIA_CHECK_LIBCAM
fi
]) ])
@ -352,6 +358,7 @@ dnl It tests whether the OS dependent libraries are available.
dnl With libisoburn they are needed only for the case that indirect linking 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 does not work. So it is worth a try to omit them.
dnl $1 = "mandatory" or "optional" define the action if test linking fails. dnl $1 = "mandatory" or "optional" define the action if test linking fails.
dnl "silent" is like "optional" but without message.
AC_DEFUN([LIBBURNIA_CHECK_ARCH_LIBS], AC_DEFUN([LIBBURNIA_CHECK_ARCH_LIBS],
[ [
libburnia_save_LIBS="$LIBS" libburnia_save_LIBS="$LIBS"
@ -372,11 +379,19 @@ AC_DEFUN([LIBBURNIA_CHECK_ARCH_LIBS],
echo >&2 echo >&2
(exit 1); exit 1; (exit 1); exit 1;
else else
echo "disabled linking with $LIBBURN_ARCH_LIBS (because not found)" if test x"$1" = xoptional
then
echo "disabled linking with $LIBBURN_ARCH_LIBS (because not found)"
fi
LIBBURN_ARCH_LIBS="" LIBBURN_ARCH_LIBS=""
fi fi
else else
echo "enabled linking with $LIBBURN_ARCH_LIBS" if test x"$1" = xsilent
then
dummy=dummy
else
echo "enabled linking with $LIBBURN_ARCH_LIBS"
fi
fi fi
fi fi
]) ])
@ -387,18 +402,72 @@ dnl
AC_DEFUN([LIBBURNIA_CHECK_LINUX_SCSI], AC_DEFUN([LIBBURNIA_CHECK_LINUX_SCSI],
[ [
dnl Check whether it is a Linux without scsi/scsi.h dnl Check whether it is a Linux without scsi/scsi.h
AH_TEMPLATE([Libburn_use_sg_dummY], libburn_scsi_disabled=
[Define to compile without OS specific SCSI features]) if test x"$ARCH" = xlinux
AC_MSG_CHECKING([for missing scsi/scsi.h on Linux]) then
AC_TRY_COMPILE([ AH_TEMPLATE([Libburn_use_sg_dummY],
[Define to compile without OS specific SCSI features])
AC_MSG_CHECKING([for missing scsi/scsi.h on Linux])
AC_TRY_COMPILE([
#ifdef __linux #ifdef __linux
#include <scsi/scsi.h> #include <scsi/scsi.h>
#endif #endif
], ],
[;], [;],
[AC_MSG_RESULT([no])], [AC_MSG_RESULT([no])],
[AC_DEFINE([Libburn_use_sg_dummY], [yes]) [AC_DEFINE([Libburn_use_sg_dummY], [yes])
AC_MSG_RESULT([yes])] libburn_scsi_disabled=yes
) AC_MSG_RESULT([yes])]
)
fi
if test x"$libburn_scsi_disabled" = xyes
then
echo "disabled operation of optical drives via SCSI"
fi
])
dnl LIBBURNIA_CHECK_LIBCAM is by Thomas Schmitt, libburnia project
dnl
AC_DEFUN([LIBBURNIA_CHECK_LIBCAM],
[
dnl Check whether libcam is requested for FreeBSD kernel but missing
libburn_scsi_disabled=
if test x"$LIBBURN_ARCH_LIBS" = x"-lcam"
then
AH_TEMPLATE([Libburn_use_sg_dummY],
[Define to compile without OS specific SCSI features])
AC_MSG_CHECKING([for missing libcam for SCSI on FreeBSD kernel])
dnl If libcam is not available, LIBBURN_ARCH_LIBS will be made empty
LIBBURNIA_CHECK_ARCH_LIBS(silent)
if test x"$LIBBURN_ARCH_LIBS" = x
then
AC_DEFINE([Libburn_use_sg_dummY], [yes])
libburn_scsi_disabled=yes
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
if test x"$LIBBURN_ARCH_LIBS" = x"-lcam"
then
AC_MSG_CHECKING([for missing libcam headers])
AC_TRY_COMPILE([
#include <stdio.h>
#include <camlib.h>
#include <cam/scsi/scsi_message.h>
#include <cam/scsi/scsi_pass.h>
],
[;],
[AC_MSG_RESULT([no])],
[AC_DEFINE([Libburn_use_sg_dummY], [yes])
libburn_scsi_disabled=yes
AC_MSG_RESULT([yes])]
)
fi
if test x"$libburn_scsi_disabled" = xyes
then
echo "disabled operation of optical drives via SCSI"
fi
]) ])

View File

@ -1 +1 @@
#define Xorriso_timestamP "2021.02.03.115443" #define Xorriso_timestamP "2021.03.12.083144"