| sniproxy: add missing m4 files |
| |
| The sniproxy build system depends on m4 macro files supplied with iconv, but |
| these aren't available in Buildroot. Supply them directly since trying to |
| source them from the Buildroot environment leads to a lot of tree churn. |
| |
| GitHub discussion: https://github.com/dlundquist/sniproxy/issues/91 |
| |
| Signed-off-by: Will Angley <willangley@google.com> |
| |
| diff -purN sniproxy-0.40.orig/m4/lib-ld.m4 sniproxy-0.40/m4/lib-ld.m4 |
| --- sniproxy-0.40.orig/m4/lib-ld.m4 1969-12-31 19:00:00.000000000 -0500 |
| +++ sniproxy-0.40/m4/lib-ld.m4 2016-01-11 21:15:14.378147145 -0500 |
| @@ -0,0 +1,109 @@ |
| +# lib-ld.m4 serial 5 (gettext-0.18.2) |
| +dnl Copyright (C) 1996-2003, 2009-2011 Free Software Foundation, Inc. |
| +dnl This file is free software; the Free Software Foundation |
| +dnl gives unlimited permission to copy and/or distribute it, |
| +dnl with or without modifications, as long as this notice is preserved. |
| + |
| +dnl Subroutines of libtool.m4, |
| +dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision |
| +dnl with libtool.m4. |
| + |
| +dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. |
| +AC_DEFUN([AC_LIB_PROG_LD_GNU], |
| +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], |
| +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. |
| +case `$LD -v 2>&1 </dev/null` in |
| +*GNU* | *'with BFD'*) |
| + acl_cv_prog_gnu_ld=yes ;; |
| +*) |
| + acl_cv_prog_gnu_ld=no ;; |
| +esac]) |
| +with_gnu_ld=$acl_cv_prog_gnu_ld |
| +]) |
| + |
| +dnl From libtool-1.4. Sets the variable LD. |
| +AC_DEFUN([AC_LIB_PROG_LD], |
| +[AC_ARG_WITH([gnu-ld], |
| +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], |
| +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) |
| +AC_REQUIRE([AC_PROG_CC])dnl |
| +AC_REQUIRE([AC_CANONICAL_HOST])dnl |
| +# Prepare PATH_SEPARATOR. |
| +# The user is always right. |
| +if test "${PATH_SEPARATOR+set}" != set; then |
| + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which |
| + # contains only /bin. Note that ksh looks also at the FPATH variable, |
| + # so we have to set that as well for the test. |
| + PATH_SEPARATOR=: |
| + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ |
| + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ |
| + || PATH_SEPARATOR=';' |
| + } |
| +fi |
| +ac_prog=ld |
| +if test "$GCC" = yes; then |
| + # Check if gcc -print-prog-name=ld gives a path. |
| + AC_MSG_CHECKING([for ld used by GCC]) |
| + case $host in |
| + *-*-mingw*) |
| + # gcc leaves a trailing carriage return which upsets mingw |
| + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; |
| + *) |
| + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; |
| + esac |
| + case $ac_prog in |
| + # Accept absolute paths. |
| + [[\\/]* | [A-Za-z]:[\\/]*)] |
| + [re_direlt='/[^/][^/]*/\.\./'] |
| + # Canonicalize the path of ld |
| + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` |
| + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do |
| + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` |
| + done |
| + test -z "$LD" && LD="$ac_prog" |
| + ;; |
| + "") |
| + # If it fails, then pretend we aren't using GCC. |
| + ac_prog=ld |
| + ;; |
| + *) |
| + # If it is relative, then search for the first ld in PATH. |
| + with_gnu_ld=unknown |
| + ;; |
| + esac |
| +elif test "$with_gnu_ld" = yes; then |
| + AC_MSG_CHECKING([for GNU ld]) |
| +else |
| + AC_MSG_CHECKING([for non-GNU ld]) |
| +fi |
| +AC_CACHE_VAL([acl_cv_path_LD], |
| +[if test -z "$LD"; then |
| + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" |
| + for ac_dir in $PATH; do |
| + test -z "$ac_dir" && ac_dir=. |
| + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then |
| + acl_cv_path_LD="$ac_dir/$ac_prog" |
| + # Check to see if the program is GNU ld. I'd rather use --version, |
| + # but apparently some GNU ld's only accept -v. |
| + # Break only if it was the GNU/non-GNU ld that we prefer. |
| + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in |
| + *GNU* | *'with BFD'*) |
| + test "$with_gnu_ld" != no && break ;; |
| + *) |
| + test "$with_gnu_ld" != yes && break ;; |
| + esac |
| + fi |
| + done |
| + IFS="$ac_save_ifs" |
| +else |
| + acl_cv_path_LD="$LD" # Let the user override the test with a path. |
| +fi]) |
| +LD="$acl_cv_path_LD" |
| +if test -n "$LD"; then |
| + AC_MSG_RESULT([$LD]) |
| +else |
| + AC_MSG_RESULT([no]) |
| +fi |
| +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) |
| +AC_LIB_PROG_LD_GNU |
| +]) |
| diff -purN sniproxy-0.40.orig/m4/lib-prefix.m4 sniproxy-0.40/m4/lib-prefix.m4 |
| --- sniproxy-0.40.orig/m4/lib-prefix.m4 1969-12-31 19:00:00.000000000 -0500 |
| +++ sniproxy-0.40/m4/lib-prefix.m4 2016-01-11 21:11:55.943564608 -0500 |
| @@ -0,0 +1,224 @@ |
| +# lib-prefix.m4 serial 7 (gettext-0.18) |
| +dnl Copyright (C) 2001-2005, 2008-2011 Free Software Foundation, Inc. |
| +dnl This file is free software; the Free Software Foundation |
| +dnl gives unlimited permission to copy and/or distribute it, |
| +dnl with or without modifications, as long as this notice is preserved. |
| + |
| +dnl From Bruno Haible. |
| + |
| +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and |
| +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't |
| +dnl require excessive bracketing. |
| +ifdef([AC_HELP_STRING], |
| +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], |
| +[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) |
| + |
| +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed |
| +dnl to access previously installed libraries. The basic assumption is that |
| +dnl a user will want packages to use other packages he previously installed |
| +dnl with the same --prefix option. |
| +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate |
| +dnl libraries, but is otherwise very convenient. |
| +AC_DEFUN([AC_LIB_PREFIX], |
| +[ |
| + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) |
| + AC_REQUIRE([AC_PROG_CC]) |
| + AC_REQUIRE([AC_CANONICAL_HOST]) |
| + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) |
| + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| + dnl By default, look in $includedir and $libdir. |
| + use_additional=yes |
| + AC_LIB_WITH_FINAL_PREFIX([ |
| + eval additional_includedir=\"$includedir\" |
| + eval additional_libdir=\"$libdir\" |
| + ]) |
| + AC_LIB_ARG_WITH([lib-prefix], |
| +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib |
| + --without-lib-prefix don't search for libraries in includedir and libdir], |
| +[ |
| + if test "X$withval" = "Xno"; then |
| + use_additional=no |
| + else |
| + if test "X$withval" = "X"; then |
| + AC_LIB_WITH_FINAL_PREFIX([ |
| + eval additional_includedir=\"$includedir\" |
| + eval additional_libdir=\"$libdir\" |
| + ]) |
| + else |
| + additional_includedir="$withval/include" |
| + additional_libdir="$withval/$acl_libdirstem" |
| + fi |
| + fi |
| +]) |
| + if test $use_additional = yes; then |
| + dnl Potentially add $additional_includedir to $CPPFLAGS. |
| + dnl But don't add it |
| + dnl 1. if it's the standard /usr/include, |
| + dnl 2. if it's already present in $CPPFLAGS, |
| + dnl 3. if it's /usr/local/include and we are using GCC on Linux, |
| + dnl 4. if it doesn't exist as a directory. |
| + if test "X$additional_includedir" != "X/usr/include"; then |
| + haveit= |
| + for x in $CPPFLAGS; do |
| + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| + if test "X$x" = "X-I$additional_includedir"; then |
| + haveit=yes |
| + break |
| + fi |
| + done |
| + if test -z "$haveit"; then |
| + if test "X$additional_includedir" = "X/usr/local/include"; then |
| + if test -n "$GCC"; then |
| + case $host_os in |
| + linux* | gnu* | k*bsd*-gnu) haveit=yes;; |
| + esac |
| + fi |
| + fi |
| + if test -z "$haveit"; then |
| + if test -d "$additional_includedir"; then |
| + dnl Really add $additional_includedir to $CPPFLAGS. |
| + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" |
| + fi |
| + fi |
| + fi |
| + fi |
| + dnl Potentially add $additional_libdir to $LDFLAGS. |
| + dnl But don't add it |
| + dnl 1. if it's the standard /usr/lib, |
| + dnl 2. if it's already present in $LDFLAGS, |
| + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, |
| + dnl 4. if it doesn't exist as a directory. |
| + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then |
| + haveit= |
| + for x in $LDFLAGS; do |
| + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| + if test "X$x" = "X-L$additional_libdir"; then |
| + haveit=yes |
| + break |
| + fi |
| + done |
| + if test -z "$haveit"; then |
| + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then |
| + if test -n "$GCC"; then |
| + case $host_os in |
| + linux*) haveit=yes;; |
| + esac |
| + fi |
| + fi |
| + if test -z "$haveit"; then |
| + if test -d "$additional_libdir"; then |
| + dnl Really add $additional_libdir to $LDFLAGS. |
| + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" |
| + fi |
| + fi |
| + fi |
| + fi |
| + fi |
| +]) |
| + |
| +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, |
| +dnl acl_final_exec_prefix, containing the values to which $prefix and |
| +dnl $exec_prefix will expand at the end of the configure script. |
| +AC_DEFUN([AC_LIB_PREPARE_PREFIX], |
| +[ |
| + dnl Unfortunately, prefix and exec_prefix get only finally determined |
| + dnl at the end of configure. |
| + if test "X$prefix" = "XNONE"; then |
| + acl_final_prefix="$ac_default_prefix" |
| + else |
| + acl_final_prefix="$prefix" |
| + fi |
| + if test "X$exec_prefix" = "XNONE"; then |
| + acl_final_exec_prefix='${prefix}' |
| + else |
| + acl_final_exec_prefix="$exec_prefix" |
| + fi |
| + acl_save_prefix="$prefix" |
| + prefix="$acl_final_prefix" |
| + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" |
| + prefix="$acl_save_prefix" |
| +]) |
| + |
| +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the |
| +dnl variables prefix and exec_prefix bound to the values they will have |
| +dnl at the end of the configure script. |
| +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], |
| +[ |
| + acl_save_prefix="$prefix" |
| + prefix="$acl_final_prefix" |
| + acl_save_exec_prefix="$exec_prefix" |
| + exec_prefix="$acl_final_exec_prefix" |
| + $1 |
| + exec_prefix="$acl_save_exec_prefix" |
| + prefix="$acl_save_prefix" |
| +]) |
| + |
| +dnl AC_LIB_PREPARE_MULTILIB creates |
| +dnl - a variable acl_libdirstem, containing the basename of the libdir, either |
| +dnl "lib" or "lib64" or "lib/64", |
| +dnl - a variable acl_libdirstem2, as a secondary possible value for |
| +dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or |
| +dnl "lib/amd64". |
| +AC_DEFUN([AC_LIB_PREPARE_MULTILIB], |
| +[ |
| + dnl There is no formal standard regarding lib and lib64. |
| + dnl On glibc systems, the current practice is that on a system supporting |
| + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under |
| + dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine |
| + dnl the compiler's default mode by looking at the compiler's library search |
| + dnl path. If at least one of its elements ends in /lib64 or points to a |
| + dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. |
| + dnl Otherwise we use the default, namely "lib". |
| + dnl On Solaris systems, the current practice is that on a system supporting |
| + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under |
| + dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or |
| + dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. |
| + AC_REQUIRE([AC_CANONICAL_HOST]) |
| + acl_libdirstem=lib |
| + acl_libdirstem2= |
| + case "$host_os" in |
| + solaris*) |
| + dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment |
| + dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>. |
| + dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." |
| + dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the |
| + dnl symlink is missing, so we set acl_libdirstem2 too. |
| + AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], |
| + [AC_EGREP_CPP([sixtyfour bits], [ |
| +#ifdef _LP64 |
| +sixtyfour bits |
| +#endif |
| + ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) |
| + ]) |
| + if test $gl_cv_solaris_64bit = yes; then |
| + acl_libdirstem=lib/64 |
| + case "$host_cpu" in |
| + sparc*) acl_libdirstem2=lib/sparcv9 ;; |
| + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; |
| + esac |
| + fi |
| + ;; |
| + *) |
| + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` |
| + if test -n "$searchpath"; then |
| + acl_save_IFS="${IFS= }"; IFS=":" |
| + for searchdir in $searchpath; do |
| + if test -d "$searchdir"; then |
| + case "$searchdir" in |
| + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; |
| + */../ | */.. ) |
| + # Better ignore directories of this form. They are misleading. |
| + ;; |
| + *) searchdir=`cd "$searchdir" && pwd` |
| + case "$searchdir" in |
| + */lib64 ) acl_libdirstem=lib64 ;; |
| + esac ;; |
| + esac |
| + fi |
| + done |
| + IFS="$acl_save_IFS" |
| + fi |
| + ;; |
| + esac |
| + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" |
| +]) |