"Fossies" - the Fresh Open Source Software Archive

Member "libisofs-1.5.4/acinclude.m4" (8 Jul 2020, 6785 Bytes) of package /linux/misc/libisofs-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 
    2 dnl Copyright (c) 2009 - 2019 Thomas Schmitt
    3 dnl Provided under the terms of the GNU General Public License version 2 or later.
    4 
    5 
    6 AC_DEFUN([LIBBURNIA_SET_FLAGS],
    7 [
    8 case $target_os in
    9 freebsd* | netbsd*)
   10         LDFLAGS="$LDFLAGS -L/usr/local/lib"
   11         CPPFLAGS="$CPPFLAGS -I/usr/local/include"
   12         ;;
   13 esac
   14 ])
   15 
   16 
   17 AC_DEFUN([TARGET_SHIZZLE],
   18 [
   19   ARCH=""
   20   LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig
   21 
   22   AC_MSG_CHECKING([target operating system])
   23 
   24   LIBBURNIA_SUPP_ACL=none
   25   LIBBURNIA_SUPP_FATTR=none
   26   LIBBURNIA_LDCONFIG_CMD="echo 'No ldconfig run performed. If needed, configure manually for:'"
   27   case $target in
   28     *-*-linux*)
   29       ARCH=linux
   30       LIBBURN_ARCH_LIBS=
   31       LIBBURNIA_SUPP_ACL=libacl
   32       LIBBURNIA_SUPP_FATTR=xattr
   33       LIBBURNIA_LDCONFIG_CMD=ldconfig
   34       ;;
   35     *-*-freebsd*)
   36       ARCH=freebsd
   37       LIBBURNIA_SUPP_ACL=libacl
   38       LIBBURNIA_SUPP_FATTR=extattr
   39       LIBBURN_ARCH_LIBS=-lcam
   40 
   41       # This may later be overridden by configure --enable-libdir-pkgconfig
   42       LIBBURNIA_PKGCONFDIR=$(echo "$libdir" | sed 's/\/lib$/\/libdata/')/pkgconfig
   43       ;;
   44     *)
   45       ARCH=
   46       LIBBURN_ARCH_LIBS=
   47 #      AC_ERROR([You are attempting to compile for an unsupported platform])
   48       ;;
   49   esac
   50 
   51   AC_MSG_RESULT([$ARCH])
   52 ])
   53 
   54 
   55 dnl LIBBURNIA_CHECK_ICONV is by Thomas Schmitt, libburnia project
   56 dnl It is based on gestures from:
   57 dnl iconv.m4 serial AM7 (gettext-0.18)
   58 dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc.
   59 dnl This file is free software; the Free Software Foundation
   60 dnl gives unlimited permission to copy and/or distribute it,
   61 dnl with or without modifications, as long as this notice is preserved.
   62 dnl From Bruno Haible.
   63 dnl
   64 AC_DEFUN([LIBBURNIA_CHECK_ICONV],
   65 [
   66 
   67   dnl Check whether it is allowed to link with -liconv
   68   AC_MSG_CHECKING([for iconv() in separate -liconv ])
   69   libburnia_liconv="no"
   70   libburnia_save_LIBS="$LIBS"
   71   LIBS="$LIBS -liconv"
   72   AC_TRY_LINK([#include <stdlib.h>
   73 #include <iconv.h>],
   74     [iconv_t cd = iconv_open("","");
   75      iconv(cd,NULL,NULL,NULL,NULL);
   76      iconv_close(cd);],
   77      [libburnia_liconv="yes"],
   78      [LIBS="$libburnia_save_LIBS"]
   79   )
   80   AC_MSG_RESULT([$libburnia_liconv])
   81 
   82   if test x"$libburnia_save_LIBS" = x"$LIBS"
   83   then
   84     dnl GNU iconv has no function iconv() but libiconv() and a macro iconv()
   85     dnl It is not tested whether this is detected by above macro.
   86     AC_CHECK_LIB(iconv, libiconv, , )
   87   fi
   88 
   89   dnl Check for iconv(..., const char **inbuf, ...)
   90   AC_MSG_CHECKING([for const qualifier with iconv() ])
   91   AC_TRY_COMPILE([
   92 #include <stdlib.h>
   93 #include <iconv.h>
   94 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
   95 ], [], [libburnia_iconv_const=""], [libburnia_iconv_const="const"]
   96   )
   97   AC_DEFINE_UNQUOTED([ICONV_CONST], [$libburnia_iconv_const])
   98   test -z "$libburnia_iconv_const" && libburnia_iconv_const="no"
   99   AC_MSG_RESULT([$libburnia_iconv_const])
  100 ])
  101 
  102 
  103 dnl LIBBURNIA_ASSERT_ICONV is by Thomas Schmitt, libburnia project
  104 dnl 
  105 AC_DEFUN([LIBBURNIA_ASSERT_ICONV],
  106 [
  107   if test x$LIBISOFS_ASSUME_ICONV = x
  108   then
  109     dnl Check for the essential gestures of libisofs/util.c
  110     AC_MSG_CHECKING([for iconv() to be accessible now ])
  111     AC_TRY_LINK([
  112 #include <stdlib.h>
  113 #include <wchar.h>
  114 #include <string.h>
  115 #include <errno.h>
  116 #include <ctype.h>
  117 #include <stdio.h>
  118 #include <limits.h>
  119 #include <iconv.h>
  120 #include <locale.h>
  121 #include <langinfo.h>
  122 #include <unistd.h>],
  123 [iconv_t cd = iconv_open("","");
  124 iconv(cd,NULL,NULL,NULL,NULL);
  125 iconv_close(cd);
  126 ], [iconv_test="yes"], [iconv_test="no"]
  127     )
  128     AC_MSG_RESULT([$iconv_test])
  129     if test x$iconv_test = xno
  130     then
  131       echo >&2
  132       echo "Cannot get function iconv() to work. Configuration aborted." >&2
  133       echo "Check whether your system needs a separate libiconv installed." >&2
  134       echo "If it is installed but not found, try something like" >&2
  135       echo '  export LDFLAGS="$LDFLAGS -L/usr/local/lib"' >&2 
  136       echo '  export CPPFLAGS="$CPPFLAGS -I/usr/local/include"' >&2
  137       echo '  export LIBS="$LIBS -liconv"' >&2
  138       echo "You may override this test by exporting variable" >&2
  139       echo "  LIBISOFS_ASSUME_ICONV=yes" >&2
  140       echo >&2
  141       (exit 1); exit 1;
  142     fi
  143   fi
  144 ])
  145 
  146 
  147 dnl LIBISOFS_ASSERT_VERS_LIBS is by Thomas Schmitt, libburnia project
  148 dnl It tests whether -Wl,--version-script=... works with the compiler
  149 AC_DEFUN([LIBISOFS_ASSERT_VERS_LIBS],
  150 [
  151     libburnia_save_LDFLAGS="$LDFLAGS"
  152     LDFLAGS="$LDFLAGS -Wl,--version-script=$srcdir/libisofs/libisofs.ver"
  153     AC_TRY_LINK([#include <stdio.h>], [printf("Hello\n");],
  154                 [vers_libs_test="yes"], [vers_libs_test="no"])
  155     if test x$vers_libs_test = xyes
  156     then
  157         LIBLDFLAGS="-Wl,--version-script=$srcdir/libisofs/libisofs.ver"
  158     fi
  159     LDFLAGS="$libburnia_save_LDFLAGS"
  160     AC_SUBST(LIBLDFLAGS)
  161 ])
  162 
  163 
  164 dnl LIBBURNIA_SET_PKGCONFIG determines the install directory for the *.pc file.
  165 dnl Important: Must be performed _after_ TARGET_SHIZZLE
  166 dnl
  167 AC_DEFUN([LIBBURNIA_SET_PKGCONFIG],
  168 [
  169 ### for testing --enable-libdir-pkgconfig on Linux
  170 ### LIBBURNIA_PKGCONFDIR="$libdir"data/pkgconfig
  171 
  172 if test "x$LIBBURNIA_PKGCONFDIR" = "x$libdir"/pkgconfig
  173 then
  174   dummy=dummy
  175 else
  176   AC_ARG_ENABLE(libdir-pkgconfig,
  177   [  --enable-libdir-pkgconfig  Install to $libdir/pkgconfig on any OS, default=no],
  178    , enable_libdir_pkgconfig="no")
  179   AC_MSG_CHECKING([for --enable-libdir-pkgconfig])
  180   if test "x$enable_libdir_pkgconfig" = xyes
  181   then
  182     LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig
  183   fi
  184   AC_MSG_RESULT([$enable_libdir_pkgconfig])
  185 fi
  186 
  187 libburnia_pkgconfig_override="no"
  188 AC_ARG_ENABLE(pkgconfig-path,
  189 [  --enable-pkgconfig-path=DIR  Absolute path of directory for libisofs-*.pc],
  190 libburnia_pkgconfig_override="yes" , enable_pkgconfig_path="none")
  191 AC_MSG_CHECKING([for overridden pkgconfig directory path])
  192 if test "x$enable_pkgconfig_path" = xno
  193 then
  194   libburnia_pkgconfig_override="no"
  195 fi
  196 if test "x$enable_pkgconfig_path" = x -o "x$enable_pkgconfig_path" = xyes
  197 then
  198   libburnia_pkgconfig_override="invalid argument"
  199 fi
  200 if test "x$libburnia_pkgconfig_override" = xyes
  201 then
  202   LIBBURNIA_PKGCONFDIR="$enable_pkgconfig_path"
  203   AC_MSG_RESULT([$LIBBURNIA_PKGCONFDIR])
  204 else
  205   AC_MSG_RESULT([$libburnia_pkgconfig_override])
  206 fi
  207 AC_SUBST(LIBBURNIA_PKGCONFDIR)
  208 
  209 dnl For debugging only
  210 ### AC_MSG_RESULT([LIBBURNIA_PKGCONFDIR = $LIBBURNIA_PKGCONFDIR])
  211  
  212 ])
  213 
  214 dnl LIBBURNIA_TRY_TIMEZONE is by Thomas Schmitt, libburnia project
  215 dnl It tests whether the global variable exists and is suitable for
  216 dnl integer arithmetics.
  217 AC_DEFUN([LIBBURNIA_TRY_TIMEZONE],
  218 [
  219     echo -n "checking for timezone variable ... "
  220     AC_TRY_LINK([ #include <time.h> ], [long int i; i = 1 - timezone; ], 
  221                 [LIBBURNIA_TIMEZONE="timezone"], [LIBBURNIA_TIMEZONE="0"]
  222     )
  223     echo "$LIBBURNIA_TIMEZONE"
  224 ])
  225