Matching iconv.h and iconv library.
Alex Cherepanov <[email protected]> Tue, 05 Aug 2008 12:10:43 -0400
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------060307010901010700080202
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
gdevopvp.c uses some basic functionality from iconv library
but none of GNU extensions.
configure script searches first for the native implementation
of iconv functions. If not, it searches for the GNU version.
GNU header uses different names in the library and defines
some macros to map iconv* names to GNU names.
gcc uses GNU version of iconv.h first, which requires a compatibility
flag to link with the native libraries.
When the flag is set, the code won't link with GNU library.
So the compatibility flag is set when iconv* functions come
come from non-gnu library. This flag affects GNU header but should
have no effect on the native header.
--------------060307010901010700080202
Content-Type: text/plain;
name="hpux1.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="hpux1.diff"
Index: gs/src/configure.ac
===================================================================
--- gs/src/configure.ac (revision 8935)
+++ gs/src/configure.ac (working copy)
@@ -293,6 +293,7 @@
case $with_libiconv in
gnu)
AC_DEFINE(USE_LIBICONV_GNU, 1, [Using GNU libiconv])
+ CFLAGS="$CFLAGS -DUSE_LIBICONV_GNU"
;;
native)
AC_DEFINE(USE_LIBICONV_NATIVE, 1, [Using a native implementation of iconv in a separate library])
Index: gs/contrib/opvp/gdevopvp.c
===================================================================
--- gs/contrib/opvp/gdevopvp.c (revision 8935)
+++ gs/contrib/opvp/gdevopvp.c (working copy)
@@ -25,13 +25,18 @@
#include <unistd.h>
#include <string.h>
#include <locale.h>
-#include <iconv.h>
#include <langinfo.h>
#include <dlfcn.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+/* Set compatibility flag just in case we have GNU iconv.h */
+#ifndef USE_LIBICONV_GNU
+# define LIBCONV_PLUG
+#endif
+#include <iconv.h>
+
#include "string_.h"
#include "math_.h"
#include "gx.h"
--------------060307010901010700080202
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review
--------------060307010901010700080202--