You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

173 lines
4.7 KiB

  1. AC_DEFUN([LIBBURNIA_SET_FLAGS],
  2. [
  3. case $target_os in
  4. freebsd* | netbsd*)
  5. LDFLAGS="$LDFLAGS -L/usr/local/lib"
  6. CPPFLAGS="$CPPFLAGS -I/usr/local/include"
  7. ;;
  8. esac
  9. ])
  10. AC_DEFUN([TARGET_SHIZZLE],
  11. [
  12. ARCH=""
  13. LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig
  14. AC_MSG_CHECKING([target operating system])
  15. LIBBURNIA_LDCONFIG_CMD="echo 'No ldconfig run performed. If needed, configure manually for:'"
  16. case $target in
  17. *-*-linux*)
  18. ARCH=linux
  19. LIBBURN_ARCH_LIBS=
  20. LIBBURNIA_LDCONFIG_CMD=ldconfig
  21. ;;
  22. *-*-freebsd*)
  23. ARCH=freebsd
  24. LIBBURN_ARCH_LIBS=-lcam
  25. LIBBURNIA_PKGCONFDIR=$(echo "$libdir" | sed 's/\/lib$/\/libdata/')/pkgconfig
  26. ;;
  27. *-kfreebsd*-gnu*)
  28. ARCH=freebsd
  29. LIBBURN_ARCH_LIBS=-lcam
  30. ;;
  31. *-solaris*)
  32. ARCH=solaris
  33. LIBBURN_ARCH_LIBS=-lvolmgt
  34. ;;
  35. *)
  36. ARCH=
  37. LIBBURN_ARCH_LIBS=
  38. # AC_ERROR([You are attempting to compile for an unsupported platform])
  39. ;;
  40. esac
  41. AC_MSG_RESULT([$ARCH])
  42. ])
  43. dnl LIBBURN_ASSERT_VERS_LIBS is by Thomas Schmitt, libburnia project
  44. dnl It tests whether -Wl,--version-script=... works with the compiler
  45. AC_DEFUN([LIBBURN_ASSERT_VERS_LIBS],
  46. [
  47. libburnia_save_LDFLAGS="$LDFLAGS"
  48. LDFLAGS="$LDFLAGS -Wl,--version-script=$srcdir/libburn/libburn.ver"
  49. AC_TRY_LINK([#include <stdio.h>], [printf("Hello\n");],
  50. [vers_libs_test="yes"], [vers_libs_test="no"])
  51. if test x$vers_libs_test = xyes
  52. then
  53. LIBLDFLAGS="-Wl,--version-script=$srcdir/libburn/libburn.ver"
  54. fi
  55. LDFLAGS="$libburnia_save_LDFLAGS"
  56. AC_SUBST(LIBLDFLAGS)
  57. ])
  58. dnl LIBBURNIA_SET_PKGCONFIG determines the install directory for the *.pc file.
  59. dnl Important: Must be performed _after_ TARGET_SHIZZLE
  60. dnl
  61. AC_DEFUN([LIBBURNIA_SET_PKGCONFIG],
  62. [
  63. ### for testing --enable-libdir-pkgconfig on Linux
  64. ### LIBBURNIA_PKGCONFDIR="$libdir"data/pkgconfig
  65. if test "x$LIBBURNIA_PKGCONFDIR" = "x$libdir"/pkgconfig
  66. then
  67. dummy=dummy
  68. else
  69. AC_ARG_ENABLE(libdir-pkgconfig,
  70. [ --enable-libdir-pkgconfig Install to $libdir/pkgconfig on any OS, default=no],
  71. , enable_libdir_pkgconfig="no")
  72. AC_MSG_CHECKING([for --enable-libdir-pkgconfig])
  73. if test "x$enable_libdir_pkgconfig" = xyes
  74. then
  75. LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig
  76. fi
  77. AC_MSG_RESULT([$enable_libdir_pkgconfig])
  78. fi
  79. libburnia_pkgconfig_override="no"
  80. AC_ARG_ENABLE(pkgconfig-path,
  81. [ --enable-pkgconfig-path=DIR Absolute path of directory for libisofs-*.pc],
  82. libburnia_pkgconfig_override="yes" , enable_pkgconfig_path="none")
  83. AC_MSG_CHECKING([for overridden pkgconfig directory path])
  84. if test "x$enable_pkgconfig_path" = xno
  85. then
  86. libburnia_pkgconfig_override="no"
  87. fi
  88. if test "x$enable_pkgconfig_path" = x -o "x$enable_pkgconfig_path" = xyes
  89. then
  90. libburnia_pkgconfig_override="invalid argument"
  91. fi
  92. if test "x$libburnia_pkgconfig_override" = xyes
  93. then
  94. LIBBURNIA_PKGCONFDIR="$enable_pkgconfig_path"
  95. AC_MSG_RESULT([$LIBBURNIA_PKGCONFDIR])
  96. else
  97. AC_MSG_RESULT([$libburnia_pkgconfig_override])
  98. fi
  99. AC_SUBST(LIBBURNIA_PKGCONFDIR)
  100. dnl For debugging only
  101. ### AC_MSG_RESULT([LIBBURNIA_PKGCONFDIR = $LIBBURNIA_PKGCONFDIR])
  102. ])
  103. dnl LIBBURNIA_CHECK_ARCH_LIBS is by Thomas Schmitt, libburnia project
  104. dnl It tests whether the OS dependent libraries are available.
  105. dnl With libisoburn they are needed only for the case that indirect linking
  106. dnl does not work. So it is worth a try to omit them.
  107. dnl $1 = "mandatory" or "optional" define the action if test linking fails.
  108. AC_DEFUN([LIBBURNIA_CHECK_ARCH_LIBS],
  109. [
  110. libburnia_save_LIBS="$LIBS"
  111. if test "x$LIBBURN_ARCH_LIBS" = x
  112. then
  113. dummy=dummy
  114. else
  115. LIBS="$LIBS $LIBBURN_ARCH_LIBS"
  116. AC_TRY_LINK([#include <stdio.h>], [printf("Hello\n");],
  117. [archlibs_test="yes"], [archlibs_test="no"])
  118. LIBS="$libburnia_save_LIBS"
  119. if test x$archlibs_test = xno
  120. then
  121. if test x"$1" = xmandatory
  122. then
  123. echo >&2
  124. echo "FATAL: Test linking with mandatory library options failed: $LIBBURN_ARCH_LIBS" >&2
  125. echo >&2
  126. (exit 1); exit 1;
  127. else
  128. echo "disabled linking with $LIBBURN_ARCH_LIBS (because not found)"
  129. LIBBURN_ARCH_LIBS=""
  130. fi
  131. else
  132. echo "enabled linking with $LIBBURN_ARCH_LIBS"
  133. fi
  134. fi
  135. ])
  136. dnl LIBBURNIA_CHECK_LINUX_SCSI is by Thomas Schmitt, libburnia project
  137. dnl
  138. AC_DEFUN([LIBBURNIA_CHECK_LINUX_SCSI],
  139. [
  140. dnl Check whether it is a Linux without scsi/scsi.h
  141. AH_TEMPLATE([Libburn_use_sg_dummY],
  142. [Define to compile without OS specific SCSI features])
  143. AC_MSG_CHECKING([for missing scsi/scsi.h on Linux])
  144. AC_TRY_COMPILE([
  145. #ifdef __linux
  146. #include <scsi/scsi.h>
  147. #endif
  148. ],
  149. [;],
  150. [AC_MSG_RESULT([no])],
  151. [AC_DEFINE([Libburn_use_sg_dummY], [yes])
  152. AC_MSG_RESULT([yes])]
  153. )
  154. ])