Skip to content

Commit

Permalink
iconv support
Browse files Browse the repository at this point in the history
  • Loading branch information
longhuan2018 committed Dec 22, 2020
1 parent ab38632 commit 21089dd
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
42 changes: 38 additions & 4 deletions ports/spatialite-tools/fix-linux-configure.patch
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
diff --git a/configure.ac b/configure.ac
index ff15f2922..c254b3619 100644
index ff15f2922..268b55ff9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -142,6 +142,7 @@ fi
@@ -17,6 +17,8 @@ AH_TEMPLATE([OMIT_FREEXL],
[Should be defined in order to disable FREEXL support.])
AH_TEMPLATE([OMIT_READOSM],
[Should be defined in order to disable ReadOSM support.])
+AH_TEMPLATE([OMIT_ICONV],
+ [Should be defined in order to disable ICONV support.])
AH_TEMPLATE([ENABLE_LIBXML2],
[Should be defined in order to enable LIBXML2 support.])
AH_TEMPLATE([ENABLE_MINIZIP],
@@ -142,6 +144,7 @@ fi
AC_ARG_WITH([geosconfig],
[AS_HELP_STRING([--with-geosconfig=FILE], [specify an alternative geos-config file])],
[GEOSCONFIG="$withval"], [GEOSCONFIG=""])
+if 0; then
if test "x$GEOSCONFIG" = "x"; then
# GEOSCONFIG was not specified, so search within the current path
AC_PATH_PROG([GEOSCONFIG], [geos-config])
@@ -164,6 +165,7 @@ fi
@@ -164,6 +167,7 @@ fi
# Extract the linker and include flags
GEOS_LDFLAGS=`$GEOSCONFIG --ldflags`
GEOS_CPPFLAGS=-I`$GEOSCONFIG --includes`
+fi
AC_SUBST([GEOS_LDFLAGS])
AC_SUBST([GEOS_CPPFLAGS])
# Ensure that we can parse geos_c.h
@@ -172,11 +174,14 @@ CPPFLAGS="$GEOS_CPPFLAGS"
@@ -172,11 +176,14 @@ CPPFLAGS="$GEOS_CPPFLAGS"
AC_CHECK_HEADERS([geos_c.h],, [AC_MSG_ERROR([could not find geos_c.h - you may need to specify the directory of a geos-config file using --with-geosconfig])])
CPPFLAGS="$CPPFLAGS_SAVE"
# Ensure we can link against libgeos_c
Expand All @@ -33,3 +42,28 @@ index ff15f2922..c254b3619 100644

PKG_CHECK_MODULES([LIBSPATIALITE], [spatialite], , AC_MSG_ERROR(['libspatialite' is required but it doesn't seem to be installed on this system.]))
AC_SUBST(LIBSPATIALITE_CFLAGS)
@@ -218,6 +225,24 @@ fi

AM_CONDITIONAL([NO_READOSM], [test "$NOREADOSM" = "true"])

+#-----------------------------------------------------------------------
+# --enable-iconv
+#
+AC_ARG_ENABLE(iconv, [AS_HELP_STRING(
+ [--enable-iconv], [enables ICONV inclusion [default=yes]])],
+ [], [enable_iconv=yes])
+if test x"$enable_iconv" != "xno"; then
+ AC_CHECK_HEADERS(iconv.h,, [AC_MSG_ERROR([cannot find iconv.h, bailing out])])
+# on some systems "iconv()" lives in libc. On others it lives in libiconv
+# on older systems "libiconv()" lives in libiconv
+ AC_SEARCH_LIBS(iconv,iconv,,
+ AC_SEARCH_LIBS(libiconv,iconv,,AC_MSG_ERROR(['libiconv' is required but it doesn't seem to be installed on this system.]),))
+ AC_SEARCH_LIBS(locale_charset,charset,,
+ AC_SEARCH_LIBS(nl_langinfo,c,,AC_MSG_ERROR(['libcharset' is required but it doesn't seem to be installed on this system.]),))
+else
+ AC_DEFINE(OMIT_ICONV)
+fi
+
#-----------------------------------------------------------------------
# --enable-libxml2
#
4 changes: 2 additions & 2 deletions ports/spatialite-tools/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ elseif (VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) # Build in UNIX
endif()

list(APPEND OPTIONS_RELEASE
"LIBXML2_LIBS=-lxml2 -llzma -liconv"
"LIBXML2_LIBS=-lxml2 -llzma"
"GEOS_LDFLAGS=-lgeos_c -lgeos"
)
list(APPEND OPTIONS_DEBUG
"LIBXML2_LIBS=-lxml2 -llzmad -liconv"
"LIBXML2_LIBS=-lxml2 -llzmad"
"GEOS_LDFLAGS=-lgeos_cd -lgeosd"
)

Expand Down

0 comments on commit 21089dd

Please sign in to comment.