[packages] gd: remove private libtool copy, supply missing macros
[openwrt/svn-archive/archive.git] / libs / gd / patches / 001-missing-macros.patch
1 --- /dev/null
2 +++ b/iconv.m4
3 @@ -0,0 +1,101 @@
4 +# iconv.m4 serial AM4 (gettext-0.11.3)
5 +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
6 +dnl This file is free software; the Free Software Foundation
7 +dnl gives unlimited permission to copy and/or distribute it,
8 +dnl with or without modifications, as long as this notice is preserved.
9 +
10 +dnl From Bruno Haible.
11 +
12 +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
13 +[
14 + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
15 + AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
16 + AC_REQUIRE([AC_LIB_RPATH])
17 +
18 + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
19 + dnl accordingly.
20 + AC_LIB_LINKFLAGS_BODY([iconv])
21 +])
22 +
23 +AC_DEFUN([AM_ICONV_LINK],
24 +[
25 + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
26 + dnl those with the standalone portable GNU libiconv installed).
27 +
28 + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
29 + dnl accordingly.
30 + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
31 +
32 + dnl Add $INCICONV to CPPFLAGS before performing the following checks,
33 + dnl because if the user has installed libiconv and not disabled its use
34 + dnl via --without-libiconv-prefix, he wants to use it. The first
35 + dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
36 + am_save_CPPFLAGS="$CPPFLAGS"
37 + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
38 +
39 + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
40 + am_cv_func_iconv="no, consider installing GNU libiconv"
41 + am_cv_lib_iconv=no
42 + AC_TRY_LINK([#include <stdlib.h>
43 +#include <iconv.h>],
44 + [iconv_t cd = iconv_open("","");
45 + iconv(cd,NULL,NULL,NULL,NULL);
46 + iconv_close(cd);],
47 + am_cv_func_iconv=yes)
48 + if test "$am_cv_func_iconv" != yes; then
49 + am_save_LIBS="$LIBS"
50 + LIBS="$LIBS $LIBICONV"
51 + AC_TRY_LINK([#include <stdlib.h>
52 +#include <iconv.h>],
53 + [iconv_t cd = iconv_open("","");
54 + iconv(cd,NULL,NULL,NULL,NULL);
55 + iconv_close(cd);],
56 + am_cv_lib_iconv=yes
57 + am_cv_func_iconv=yes)
58 + LIBS="$am_save_LIBS"
59 + fi
60 + ])
61 + if test "$am_cv_func_iconv" = yes; then
62 + AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
63 + fi
64 + if test "$am_cv_lib_iconv" = yes; then
65 + AC_MSG_CHECKING([how to link with libiconv])
66 + AC_MSG_RESULT([$LIBICONV])
67 + else
68 + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
69 + dnl either.
70 + CPPFLAGS="$am_save_CPPFLAGS"
71 + LIBICONV=
72 + LTLIBICONV=
73 + fi
74 + AC_SUBST(LIBICONV)
75 + AC_SUBST(LTLIBICONV)
76 +])
77 +
78 +AC_DEFUN([AM_ICONV],
79 +[
80 + AM_ICONV_LINK
81 + if test "$am_cv_func_iconv" = yes; then
82 + AC_MSG_CHECKING([for iconv declaration])
83 + AC_CACHE_VAL(am_cv_proto_iconv, [
84 + AC_TRY_COMPILE([
85 +#include <stdlib.h>
86 +#include <iconv.h>
87 +extern
88 +#ifdef __cplusplus
89 +"C"
90 +#endif
91 +#if defined(__STDC__) || defined(__cplusplus)
92 +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
93 +#else
94 +size_t iconv();
95 +#endif
96 +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
97 + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
98 + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
99 + AC_MSG_RESULT([$]{ac_t:-
100 + }[$]am_cv_proto_iconv)
101 + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
102 + [Define as const if the declaration of iconv() needs const.])
103 + fi
104 +])