]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Use ICONV_CONST instead of ICONV_IS_POSIX; switch a detection of iconv to AM_ICONV.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 16 Mar 2011 14:44:22 +0000 (10:44 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 16 Mar 2011 14:44:22 +0000 (10:44 -0400)
This version needs to solve about config.rpath, which AM_ICONV requires.

SVN-Revision: 3017

CMakeLists.txt
build/clean.sh
build/cmake/config.h.in
configure.ac
libarchive/archive_string.c

index 4c1c70da12634925daba19e9a862eeeabdb884ac..c7cb83de2a4cfd33191f74799e87a186b06801fb 100644 (file)
@@ -465,7 +465,7 @@ IF(HAVE_ICONV_H)
   HAVE_POSIX_ICONV_IN_LIBC)
   IF(HAVE_POSIX_ICONV_IN_LIBC)
     SET(HAVE_ICONV true)
-    SET(ICONV_IS_POSIX true)
+    SET(ICONV_CONST "const")
   ELSE(HAVE_POSIX_ICONV_IN_LIBC)
 
     # Try non-POSIX-conforming iconv() in libc
@@ -477,6 +477,7 @@ IF(HAVE_ICONV_H)
   HAVE_NONPOSIX_ICONV_IN_LIBC)
     IF(HAVE_NONPOSIX_ICONV_IN_LIBC)
       SET(HAVE_ICONV true)
+      SET(ICONV_CONST "") 
     ELSE(HAVE_NONPOSIX_ICONV_IN_LIBC)
 
       # iconv isn't in libc, try libiconv
@@ -489,7 +490,7 @@ IF(HAVE_ICONV_H)
        HAVE_POSIX_ICONV_IN_LIBICONV)
       IF(HAVE_POSIX_ICONV_IN_LIBICONV)
         SET(HAVE_ICONV true) 
-        SET(ICONV_IS_POSIX true
+        SET(ICONV_CONST "const"
         LIST(APPEND ADDITIONAL_LIBS "iconv")
       ELSE(HAVE_POSIX_ICONV_IN_LIBICONV)
 
@@ -501,8 +502,9 @@ IF(HAVE_ICONV_H)
          HAVE_NONPOSIX_ICONV_IN_LIBICONV)
         IF(HAVE_NONPOSIX_ICONV_IN_LIBICONV)
           SET(HAVE_ICONV true) 
+          SET(ICONV_CONST "") 
           LIST(APPEND ADDITIONAL_LIBS "iconv")
-       ENDIF(HAVE_NONPOSIX_ICONV_IN_LIBICONV)
+        ENDIF(HAVE_NONPOSIX_ICONV_IN_LIBICONV)
       ENDIF(HAVE_POSIX_ICONV_IN_LIBICONV)
     ENDIF(HAVE_NONPOSIX_ICONV_IN_LIBC)
   ENDIF(HAVE_POSIX_ICONV_IN_LIBC)
index 9e7e7998fc01b53447fd36559059b09f0d98ffb2..e4465f8a786c72ed17cd3f9aba24ea4d8b67fd8a 100755 (executable)
@@ -51,7 +51,8 @@ rm -f bsdcpio_test
 rm -f bsdtar
 rm -f bsdtar_test
 rm -f build/autoconf/compile
-rm -f build/autoconf/config.*
+rm -f build/autoconf/config.guess
+rm -f build/autoconf/config.sub
 rm -f build/autoconf/depcomp
 rm -f build/autoconf/install-sh
 rm -f build/autoconf/libtool.m4
index 5df98c547217860e252a0225a3ba388dad0f7dcc..0fc6692d4e78a0b4471063aaf3d88cceceaaa6eb 100644 (file)
@@ -495,9 +495,6 @@ typedef uint64_t uintmax_t;
 /* Define to 1 if you have the `iconv' function. */
 #cmakedefine HAVE_ICONV 1
 
-/* Define to 1 if the 'iconv' function follows POSIX. */
-#cmakedefine ICONV_IS_POSIX 1
-
 /* Define to 1 if you have the <iconv.h> header file. */
 #cmakedefine HAVE_ICONV_H 1
 
@@ -922,6 +919,9 @@ typedef uint64_t uintmax_t;
 /* Define to 1 if you have the <zlib.h> header file. */
 #cmakedefine HAVE_ZLIB_H 1
 
+/* Define as const if the declaration of iconv() needs const. */
+#cmakedefine ICONV_CONST ${ICONV_CONST}
+
 /* Define to 1 if you have the `_ctime64_s' function. */
 #cmakedefine HAVE__CTIME64_S 1
 
index f9d402e3eb583c7269f0bc43a5ca40e73f68adee..1d43d173c84f8c4948de756cd04cd37912507389 100644 (file)
@@ -237,8 +237,7 @@ AC_ARG_WITH([iconv],
 
 if test "x$with_iconv" != "xno"; then
   AC_CHECK_HEADERS([iconv.h])
-  AC_CHECK_LIB(iconv, iconv)
-  AC_CHECK_FUNCS([iconv])
+  AM_ICONV
 fi
 
 AC_ARG_WITH([lzma],
index 98640db2b44a7d3293fb05d8dc276b410d4c4ae8..547788b217cd4c0e9b5d404f1dca9371d2e2931c 100644 (file)
@@ -503,11 +503,7 @@ int
 archive_wstring_append_from_mbs(struct archive *a, struct archive_wstring *dest, const char *p, size_t len)
 {
        char buff[256];
-#if ICONV_IS_POSIX
-       const char *inp;
-#else
-       char *inp;
-#endif
+       ICONV_CONST char *inp;
        size_t remaining;
        iconv_t cd;
        int return_value = 0; /* success */
@@ -644,11 +640,7 @@ int
 archive_string_append_from_unicode_to_mbs(struct archive *a, struct archive_string *as, const wchar_t *w, size_t len)
 {
        char buff[256];
-#if ICONV_IS_POSIX
-       const char *inp;
-#else
-       char *inp;
-#endif
+       ICONV_CONST char *inp;
        size_t remaining;
        iconv_t cd;
        int return_value = 0; /* success */