"Fossies" - the Fresh Open Source Software Archive

Member "libisoburn-1.5.4/acinclude.m4" (8 Jul 2020, 11914 Bytes) of package /linux/misc/libisoburn-1.5.4.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "acinclude.m4": 1.5.0_vs_1.5.2.

    1 dnl Copyright (C) 2008 - 2019 Thomas Schmitt <scdbackup@gmx.net>
    2 dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc.
    3 dnl Provided under GPL version 2 or later.
    4 
    5 
    6 AC_DEFUN([LIBBURNIA_SET_FLAGS],
    7 [
    8 case $target_os in
    9 freebsd*)
   10         LDFLAGS="$LDFLAGS -L/usr/local/lib"
   11         CPPFLAGS="$CPPFLAGS -I/usr/local/include"
   12         ;;
   13 netbsd*)
   14         LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/pkg/lib"
   15         CPPFLAGS="$CPPFLAGS -I/usr/local/include -I/usr/pkg/include"
   16         ;;
   17 solaris*)
   18         LDFLAGS="$LDFLAGS -L/usr/local/lib"
   19 esac
   20 ])
   21 
   22 
   23 AC_DEFUN([TARGET_SHIZZLE],
   24 [
   25   ARCH=""
   26   LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig
   27 
   28   AC_MSG_CHECKING([target operating system])
   29 
   30   LIBBURNIA_SUPP_ACL=none
   31   LIBBURNIA_SUPP_FATTR=none
   32   LIBBURNIA_LDCONFIG_CMD="echo 'No ldconfig run performed. If needed, configure manually for:'"
   33   case $target in
   34     *-*-linux*)
   35       ARCH=linux
   36       LIBBURN_ARCH_LIBS=
   37       LIBBURNIA_SUPP_ACL=libacl
   38       LIBBURNIA_SUPP_FATTR=xattr
   39       LIBBURNIA_LDCONFIG_CMD=ldconfig
   40       ;;
   41     *-*-freebsd*)
   42       ARCH=freebsd
   43       LIBBURN_ARCH_LIBS=-lcam
   44       LIBBURNIA_SUPP_ACL=libacl
   45       LIBBURNIA_SUPP_FATTR=extattr
   46 
   47       # This may later be overridden by configure --enable-libdir-pkgconfig
   48       LIBBURNIA_PKGCONFDIR=$(echo "$libdir" | sed 's/\/lib$/\/libdata/')/pkgconfig
   49       ;;
   50     *-kfreebsd*-gnu*)
   51       ARCH=freebsd
   52       LIBBURN_ARCH_LIBS=-lcam
   53       ;;
   54     *-solaris*)
   55       ARCH=solaris
   56       LIBBURN_ARCH_LIBS=-lvolmgt
   57       ;;
   58     *)
   59       ARCH=
   60       LIBBURN_ARCH_LIBS=
   61 #      AC_ERROR([You are attempting to compile for an unsupported platform])
   62       ;;
   63   esac
   64 
   65   AC_MSG_RESULT([$ARCH])
   66 ])
   67 
   68 
   69 dnl LIBBURNIA_CHECK_ICONV is by Thomas Schmitt, libburnia project
   70 dnl It is based on gestures from:
   71 dnl iconv.m4 serial AM7 (gettext-0.18)
   72 dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc.
   73 dnl This file is free software; the Free Software Foundation
   74 dnl gives unlimited permission to copy and/or distribute it,
   75 dnl with or without modifications, as long as this notice is preserved.
   76 dnl From Bruno Haible.
   77 dnl
   78 AC_DEFUN([LIBBURNIA_CHECK_ICONV],
   79 [
   80 
   81   dnl Check whether it is allowed to link with -liconv
   82   AC_MSG_CHECKING([for iconv() in separate -liconv ])
   83   libburnia_liconv="no"
   84   libburnia_save_LIBS="$LIBS"
   85   LIBS="$LIBS -liconv"
   86   AC_TRY_LINK([#include <stdlib.h>
   87 #include <iconv.h>],
   88     [iconv_t cd = iconv_open("","");
   89      iconv(cd,NULL,NULL,NULL,NULL);
   90      iconv_close(cd);],
   91      [libburnia_liconv="yes"],
   92      [LIBS="$libburnia_save_LIBS"]
   93   )
   94   AC_MSG_RESULT([$libburnia_liconv])
   95 
   96   if test x"$libburnia_save_LIBS" = x"$LIBS"
   97   then
   98     dnl GNU iconv has no function iconv() but libiconv() and a macro iconv()
   99     dnl It is not tested whether this is detected by above macro.
  100     AC_CHECK_LIB(iconv, libiconv, , )
  101   fi
  102 
  103   dnl Check for iconv(..., const char **inbuf, ...)
  104   AC_MSG_CHECKING([for const qualifier with iconv() ])
  105   AC_TRY_COMPILE([
  106 #include <stdlib.h>
  107 #include <iconv.h>
  108 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
  109 ], [], [libburnia_iconv_const=""], [libburnia_iconv_const="const"]
  110   )
  111   if test x$libburnia_iconv_const = xconst
  112   then
  113     AC_DEFINE_UNQUOTED([ICONV_CONST], [const])
  114   else
  115     AC_DEFINE_UNQUOTED([ICONV_CONST], [])
  116   fi
  117   test -z "$libburnia_iconv_const" && libburnia_iconv_const="no"
  118   AC_MSG_RESULT([$libburnia_iconv_const])
  119 ])
  120 
  121 
  122 dnl LIBBURNIA_ASSERT_ICONV is by Thomas Schmitt, libburnia project
  123 dnl 
  124 AC_DEFUN([LIBBURNIA_ASSERT_ICONV],
  125 [
  126   if test x$XORRISO_ASSUME_ICONV = x
  127   then
  128     dnl Check for the essential gestures of libisofs/util.c
  129     AC_MSG_CHECKING([for iconv() to be accessible now ])
  130     AC_TRY_LINK([
  131 #include <stdlib.h>
  132 #include <wchar.h>
  133 #include <string.h>
  134 #include <errno.h>
  135 #include <ctype.h>
  136 #include <stdio.h>
  137 #include <limits.h>
  138 #include <iconv.h>
  139 #include <locale.h>
  140 #include <langinfo.h>
  141 #include <unistd.h>],
  142 [iconv_t cd = iconv_open("","");
  143 iconv(cd,NULL,NULL,NULL,NULL);
  144 iconv_close(cd);
  145 ], [iconv_test="yes"], [iconv_test="no"]
  146     )
  147     AC_MSG_RESULT([$iconv_test])
  148     if test x$iconv_test = xno
  149     then
  150       echo >&2
  151       echo "Cannot get function iconv() to work. Configuration aborted." >&2
  152       echo "Check whether your system needs a separate libiconv installed." >&2
  153       echo "If it is installed but not found, try something like" >&2
  154       echo '  export LDFLAGS="$LDFLAGS -L/usr/local/lib"' >&2 
  155       echo '  export CPPFLAGS="$CPPFLAGS -I/usr/local/include"' >&2
  156       echo '  export LIBS="$LIBS -liconv"' >&2
  157       echo "You may override this test by exporting variable" >&2
  158       echo "  XORRISO_ASSUME_ICONV=yes" >&2
  159       echo >&2
  160       (exit 1); exit 1;
  161     fi
  162   fi
  163 ])
  164 
  165 
  166 dnl LIBBURNIA_TRY_EDITLINE is by Thomas Schmitt, libburnia project
  167 dnl It performs the actual test compilation for editline.
  168 dnl Variable LIBS has to be set by the caller.
  169 AC_DEFUN([LIBBURNIA_TRY_EDITLINE],
  170 [
  171     AC_TRY_LINK([
  172 #include <ctype.h>
  173 #include <sys/types.h>
  174 #include <unistd.h>
  175 #include <stdlib.h>
  176 #include <stdio.h>
  177 #include <string.h>
  178 #include <histedit.h>],
  179 [EditLine *editline_handle; History *editline_history; HistEvent ev; int count;
  180 editline_handle= el_init("dummy", stdin, stdout, stderr);
  181 el_set(editline_handle, EL_EDITOR, "emacs");
  182 editline_history= history_init();
  183 history(editline_history, &ev, H_SETSIZE, 1000);
  184 el_gets(editline_handle, &count);
  185 ], [editline_test="yes"], [editline_test="no"]
  186     )
  187 ])
  188 
  189 dnl LIBBURNIA_ASSERT_EDITLINE is by Thomas Schmitt, libburnia project
  190 dnl It disables xorriso editline if not all needed functions are present
  191 AC_DEFUN([LIBBURNIA_ASSERT_EDITLINE],
  192 [
  193   if test x$XORRISO_ASSUME_EDITLINE = x
  194   then
  195     dnl Check for the essential gestures of xorriso/text_io.c
  196     AC_MSG_CHECKING([for desired functions in libedit])
  197     libburnia_save_LIBS="$LIBS"
  198     LIBS="$LIBS -ledit"
  199     LIBBURNIA_TRY_EDITLINE
  200     if test x$editline_test = xno
  201     then
  202         LIBS="$libburnia_save_LIBS"
  203         LIBS="$LIBS -ledit"
  204         LIBBURNIA_TRY_EDITLINE
  205     fi
  206     if test x$editline_test = xno
  207     then
  208         READLINE_DEF=
  209         LIBS="$libburnia_save_LIBS"
  210     fi
  211     AC_MSG_RESULT([$editline_test $editline_msg])
  212   fi
  213 ])
  214 
  215 
  216 dnl LIBBURNIA_TRY_READLINE is by Thomas Schmitt, libburnia project
  217 dnl It performs the actual test compilation for readline.
  218 dnl Variable LIBS has to be set by the caller.
  219 AC_DEFUN([LIBBURNIA_TRY_READLINE],
  220 [
  221     AC_TRY_LINK([
  222 #include <ctype.h>
  223 #include <sys/types.h>
  224 #include <unistd.h>
  225 #include <stdlib.h>
  226 #include <stdio.h>
  227 #include <string.h>
  228 #include <readline/readline.h>
  229 #include <readline/history.h>],
  230 [HIST_ENTRY **hl;
  231 readline("");
  232 add_history("");
  233 hl= history_list();
  234 ], [readline_test="yes"], [readline_test="no"]
  235     )
  236 ])
  237 
  238 dnl LIBBURNIA_ASSERT_READLINE is by Thomas Schmitt, libburnia project
  239 dnl It disables xorriso readline if not all needed functions are present
  240 AC_DEFUN([LIBBURNIA_ASSERT_READLINE],
  241 [
  242   if test x$XORRISO_ASSUME_READLINE = x
  243   then
  244     dnl Check for the essential gestures of xorriso/text_io.c
  245     AC_MSG_CHECKING([for desired functions in libreadline])
  246     readline_msg=
  247     libburnia_save_LIBS="$LIBS"
  248     LIBS="$LIBS -lreadline"
  249     LIBBURNIA_TRY_READLINE
  250     if test x$readline_test = xno
  251     then
  252         LIBS="$libburnia_save_LIBS"
  253         LIBS="$LIBS -lreadline -lcurses"
  254         LIBBURNIA_TRY_READLINE
  255         if test x$readline_test = xyes
  256         then
  257             readline_msg=", with -lcurses"
  258         fi
  259     fi
  260     if test x$readline_test = xno
  261     then
  262         READLINE_DEF=
  263         LIBS="$libburnia_save_LIBS"
  264     fi
  265     AC_MSG_RESULT([$readline_test $readline_msg])
  266   fi
  267 ])
  268 
  269 
  270 dnl LIBISOBURN_ASSERT_VERS_LIBS is by Thomas Schmitt, libburnia project
  271 dnl It tests whether -Wl,--version-script=... works with the compiler
  272 AC_DEFUN([LIBISOBURN_ASSERT_VERS_LIBS],
  273 [
  274     libburnia_save_LDFLAGS="$LDFLAGS"
  275     LDFLAGS="$LDFLAGS -Wl,--version-script=$srcdir/libisoburn/libisoburn.ver"
  276     AC_TRY_LINK([#include <stdio.h>], [printf("Hello\n");],
  277                 [vers_libs_test="yes"], [vers_libs_test="no"])
  278     if test x$vers_libs_test = xyes
  279     then
  280         LIBLDFLAGS="-Wl,--version-script=$srcdir/libisoburn/libisoburn.ver"
  281     fi
  282     LDFLAGS="$libburnia_save_LDFLAGS"
  283     AC_SUBST(LIBLDFLAGS)
  284 ])
  285 
  286 
  287 dnl LIBBURNIA_SET_PKGCONFIG is by Thomas Schmitt, libburnia project
  288 dnl It determines the install directory for the *.pc file.
  289 dnl Important: Must be performed _after_ TARGET_SHIZZLE
  290 dnl
  291 AC_DEFUN([LIBBURNIA_SET_PKGCONFIG],
  292 [
  293 ### for testing --enable-libdir-pkgconfig on Linux
  294 ### LIBBURNIA_PKGCONFDIR="$libdir"data/pkgconfig
  295 
  296 if test "x$LIBBURNIA_PKGCONFDIR" = "x$libdir"/pkgconfig
  297 then
  298   dummy=dummy
  299 else
  300   AC_ARG_ENABLE(libdir-pkgconfig,
  301   [  --enable-libdir-pkgconfig  Install to $libdir/pkgconfig on any OS, default=no],
  302    , enable_libdir_pkgconfig="no")
  303   AC_MSG_CHECKING([for --enable-libdir-pkgconfig])
  304   if test "x$enable_libdir_pkgconfig" = xyes
  305   then
  306     LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig
  307   fi
  308   AC_MSG_RESULT([$enable_libdir_pkgconfig])
  309 fi
  310 
  311 libburnia_pkgconfig_override="no"
  312 AC_ARG_ENABLE(pkgconfig-path,
  313 [  --enable-pkgconfig-path=DIR  Absolute path of directory for libisofs-*.pc],
  314 libburnia_pkgconfig_override="yes" , enable_pkgconfig_path="none")
  315 AC_MSG_CHECKING([for overridden pkgconfig directory path])
  316 if test "x$enable_pkgconfig_path" = xno
  317 then
  318   libburnia_pkgconfig_override="no"
  319 fi
  320 if test "x$enable_pkgconfig_path" = x -o "x$enable_pkgconfig_path" = xyes
  321 then
  322   libburnia_pkgconfig_override="invalid argument"
  323 fi
  324 if test "x$libburnia_pkgconfig_override" = xyes
  325 then
  326   LIBBURNIA_PKGCONFDIR="$enable_pkgconfig_path"
  327   AC_MSG_RESULT([$LIBBURNIA_PKGCONFDIR])
  328 else
  329   AC_MSG_RESULT([$libburnia_pkgconfig_override])
  330 fi
  331 AC_SUBST(LIBBURNIA_PKGCONFDIR)
  332 
  333 dnl For debugging only
  334 ### AC_MSG_RESULT([LIBBURNIA_PKGCONFDIR = $LIBBURNIA_PKGCONFDIR])
  335  
  336 ])
  337 
  338 dnl LIBBURNIA_TRY_TIMEZONE is by Thomas Schmitt, libburnia project
  339 dnl It tests whether the global variable exists and is suitable for
  340 dnl integer arithmetics.
  341 AC_DEFUN([LIBBURNIA_TRY_TIMEZONE],
  342 [
  343     echo -n "checking for timezone variable ... "
  344     AC_TRY_LINK([ #include <time.h> ], [long int i; i = 1 - timezone; ],
  345                 [LIBBURNIA_TIMEZONE="timezone"], [LIBBURNIA_TIMEZONE="0"]
  346     )
  347     echo "$LIBBURNIA_TIMEZONE"
  348 ])
  349 
  350 dnl LIBBURNIA_CHECK_ARCH_LIBS is by Thomas Schmitt, libburnia project
  351 dnl It tests whether the OS dependent libraries are available.
  352 dnl With libisoburn they are needed only for the case that indirect linking
  353 dnl does not work. So it is worth a try to omit them.
  354 dnl $1 = "mandatory" or "optional" define the action if test linking fails.
  355 AC_DEFUN([LIBBURNIA_CHECK_ARCH_LIBS],
  356 [
  357     libburnia_save_LIBS="$LIBS"
  358     if test "x$LIBBURN_ARCH_LIBS" = x
  359     then
  360       dummy=dummy
  361     else
  362       LIBS="$LIBS $LIBBURN_ARCH_LIBS"
  363       AC_TRY_LINK([#include <stdio.h>], [printf("Hello\n");],
  364                   [archlibs_test="yes"], [archlibs_test="no"])
  365       LIBS="$libburnia_save_LIBS"
  366       if test x$archlibs_test = xno
  367       then
  368         if test x"$1" = xmandatory
  369         then
  370           echo >&2
  371           echo "FATAL: Test linking with mandatory library options failed: $LIBBURN_ARCH_LIBS" >&2
  372           echo >&2
  373           (exit 1); exit 1;
  374         else
  375           echo "disabled linking with $LIBBURN_ARCH_LIBS (because not found)"
  376           LIBBURN_ARCH_LIBS=""
  377         fi
  378       else
  379         echo "enabled  linking with $LIBBURN_ARCH_LIBS"
  380       fi
  381     fi
  382 ])
  383 
  384 
  385 dnl LIBBURNIA_CHECK_LINUX_SCSI is by Thomas Schmitt, libburnia project
  386 dnl
  387 AC_DEFUN([LIBBURNIA_CHECK_LINUX_SCSI],
  388 [
  389   dnl Check whether it is a Linux without scsi/scsi.h
  390   AH_TEMPLATE([Libburn_use_sg_dummY],
  391               [Define to compile without OS specific SCSI features])
  392   AC_MSG_CHECKING([for missing scsi/scsi.h on Linux])
  393   AC_TRY_COMPILE([
  394 #ifdef __linux
  395 #include <scsi/scsi.h>
  396 #endif
  397      ],
  398      [;],
  399      [AC_MSG_RESULT([no])],
  400      [AC_DEFINE([Libburn_use_sg_dummY], [yes])
  401       AC_MSG_RESULT([yes])]
  402   )
  403 ])
  404