termux-packages/packages/postgis/configure.diff
Henrik Grimler 714aa0dfa7
postgis: add package
postgis is not really set up for cross-compilation. It wants to run
cross-compiled programs to check proj and protobuf versions, so we
need to patch that in configure script.

The current patch added to do this will be annoying to maintain. I
tried patching the configure.ac script instead but got weird errors
that seemed to have more to do with the autoconf version we have in
the docker image.

Fixes https://github.com/termux/termux-packages/issues/8142
2021-12-05 13:57:09 +01:00

171 lines
3.9 KiB
Diff

--- ../configure.orig 2021-12-05 10:26:50.984021147 +0000
+++ ./configure 2021-12-05 10:49:16.032713588 +0000
@@ -14497,7 +14497,7 @@
esac
CPPFLAGS_SAVE="$CPPFLAGS"
-CPPFLAGS="$XML2_CPPFLAGS"
+CPPFLAGS="$XML2_CPPFLAGS -I@TERMUX_PREFIX@/include"
for ac_header in libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -16989,106 +16989,7 @@
-
- ac_fn_c_check_header_mongrel "$LINENO" "proj.h" "ac_cv_header_proj_h" "$ac_includes_default"
-if test "x$ac_cv_header_proj_h" = xyes; then :
-
- if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-
- #ifdef HAVE_STDINT_H
- #include <stdio.h>
- #endif
- #include "proj.h"
-
-int
-main ()
-{
-
- FILE *fp;
- int vernum;
-
- fp = fopen("conftest.out", "w");
- vernum = (100 * PROJ_VERSION_MAJOR) + (10 * PROJ_VERSION_MINOR) + PROJ_VERSION_PATCH;
- fprintf(fp, "%d\n", vernum);
- fclose(fp);
-
- ;
- return 0;
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
- POSTGIS_PROJ_VERSION=`cat conftest.out | sed 's/\([0-9]\)\([0-9]\)\([0-9]\)/\1\2/'`
-
-else
-
- POSTGIS_PROJ_VERSION=""
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-else
-
- if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #ifdef HAVE_STDINT_H
- #include <stdio.h>
- #endif
- #include "proj_api.h"
-
-int
-main ()
-{
-
- FILE *fp;
-
- fp = fopen("conftest.out", "w");
- fprintf(fp, "%d\n", PJ_VERSION);
- fclose(fp);
-
- ;
- return 0;
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
- POSTGIS_PROJ_VERSION=`cat conftest.out | sed 's/\([0-9]\)\([0-9]\)\([0-9]\)/\1\2/'`
-
-else
-
- POSTGIS_PROJ_VERSION=""
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-fi
-
-
-
-
+POSTGIS_PROJ_VERSION=@PROJ_VERSION@
cat >>confdefs.h <<_ACEOF
#define POSTGIS_PROJ_VERSION $POSTGIS_PROJ_VERSION
_ACEOF
@@ -17709,49 +17610,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking protobuf-c version" >&5
$as_echo_n "checking protobuf-c version... " >&6; }
-
- if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-
- #ifdef HAVE_STDINT_H
- #include <stdio.h>
- #endif
- #include "protobuf-c/protobuf-c.h"
-
-int
-main ()
-{
-
- FILE *fp = fopen("conftest.out", "w");
- fprintf(fp, "%d\n", PROTOBUF_C_VERSION_NUMBER);
- fclose(fp);
-
- ;
- return 0;
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
- PROTOC_VERSION=`cat conftest.out`
-
-else
-
- PROTOC_VERSION="0"
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
+PROTOC_VERSION=@PROTOBUF_VERSION@
if test ! "$PROTOC_VERSION" -ge 1001000; then
as_fn_error $? "\"Old protobuf-c release found but 1.1.0 is required. You can disable MVT and Geobuf support using --without-protobuf\"" "$LINENO" 5