Skip to content
Permalink
Browse files

gdal: allows for correct detection of CharLS version on case insensit…

…ive systems. Fixes #60625
  • Loading branch information
Veence committed Jun 27, 2020
1 parent 6f05b45 commit bcc04bf03c5f6579a5a1a85ff795eb9785b2642c
Showing with 221 additions and 2 deletions.
  1. +3 −2 gis/gdal/Portfile
  2. +218 −0 gis/gdal/files/patch-charls-configure.diff
@@ -8,6 +8,7 @@ PortGroup active_variants 1.1
PortGroup compiler_blacklist_versions 1.0
PortGroup legacysupport 1.0
PortGroup conflicts_build 1.0
PortGroup debug 1.0
mpi.setup

github.setup OSGeo gdal 3.1.0 v
@@ -43,8 +44,8 @@ platform darwin {
}
}

# see https://trac.macports.org/ticket/58948
#patchfiles-append patch-bash-completion-location.diff
# see https://trac.macports.org/ticket/60625
patchfiles-append patch-charls-configure.diff

# this can be removed in a future version of MacPorts
# see https://github.com/macports/macports-base/pull/161
@@ -0,0 +1,218 @@
--- configure.old 2020-05-04 11:06:30.000000000 +0200
+++ configure 2020-06-27 08:50:55.000000000 +0200
@@ -30259,26 +30259,32 @@
CHARLS_INC=

if test "$with_charls" = "yes" -o "$with_charls" = "" ; then
- for ac_header in CharLS/interface.h
+ for ac_header in charls/version.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "CharLS/interface.h" "ac_cv_header_CharLS_interface_h" "$ac_includes_default"
-if test "x$ac_cv_header_CharLS_interface_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "charls/version.h" "ac_cv_header_charls_version_h" "$ac_includes_default"
+if test "x$ac_cv_header_charls_version_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_CHARLS_INTERFACE_H 1
+#define HAVE_CHARLS_VERSION_H 1
_ACEOF

fi

done

- if test "$ac_cv_header_CharLS_interface_h" = "yes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JpegLsDecode in -lCharLS" >&5
-$as_echo_n "checking for JpegLsDecode in -lCharLS... " >&6; }
-if ${ac_cv_lib_CharLS_JpegLsDecode+:} false; then :
+ if test "$ac_cv_header_charls_version_h" = "yes"; then
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JpegLsDecode in -lcharls" >&5
+$as_echo_n "checking for JpegLsDecode in -lcharls... " >&6; }
+if ${ac_cv_lib_charls_JpegLsDecode+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lCharLS $LIBS"
+LIBS="-lcharls $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

@@ -30297,46 +30303,46 @@
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_CharLS_JpegLsDecode=yes
+if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_lib_charls_JpegLsDecode=yes
else
- ac_cv_lib_CharLS_JpegLsDecode=no
+ ac_cv_lib_charls_JpegLsDecode=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_CharLS_JpegLsDecode" >&5
-$as_echo "$ac_cv_lib_CharLS_JpegLsDecode" >&6; }
-if test "x$ac_cv_lib_CharLS_JpegLsDecode" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_charls_JpegLsDecode" >&5
+$as_echo "$ac_cv_lib_charls_JpegLsDecode" >&6; }
+if test "x$ac_cv_lib_charls_JpegLsDecode" = xyes; then :
HAVE_CHARLS=yes
fi

+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
if test "$HAVE_CHARLS" = "yes"; then
- LIBS="-lCharLS $LIBS"
- CHARLS_INC="-DCHARLS_INTERFACE_H"
+ LIBS="-lcharls $LIBS"
+ CHARLS_INC="-DCHARLS_2_1"
fi
else
- for ac_header in CharLS/charls.h
+ for ac_header in CharLS/interface.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "CharLS/charls.h" "ac_cv_header_CharLS_charls_h" "$ac_includes_default"
-if test "x$ac_cv_header_CharLS_charls_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "CharLS/interface.h" "ac_cv_header_CharLS_interface_h" "$ac_includes_default"
+if test "x$ac_cv_header_CharLS_interface_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_CHARLS_CHARLS_H 1
+#define HAVE_CHARLS_INTERFACE_H 1
_ACEOF

fi

done

- if test "$ac_cv_header_CharLS_charls_h" = "yes"; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JpegLsDecode in -lCharLS" >&5
+ if test "$ac_cv_header_CharLS_interface_h" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JpegLsDecode in -lCharLS" >&5
$as_echo_n "checking for JpegLsDecode in -lCharLS... " >&6; }
if ${ac_cv_lib_CharLS_JpegLsDecode+:} false; then :
$as_echo_n "(cached) " >&6
@@ -30361,7 +30367,7 @@
return 0;
}
_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_CharLS_JpegLsDecode=yes
else
ac_cv_lib_CharLS_JpegLsDecode=no
@@ -30376,21 +30382,15 @@
HAVE_CHARLS=yes
fi

- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- if test "$HAVE_CHARLS" = "yes"; then
- LIBS="-lCharLS $LIBS"
- CHARLS_INC="-DCHARLS_2"
- fi
+ if test "$HAVE_CHARLS" = "yes"; then
+ LIBS="-lCharLS $LIBS"
+ CHARLS_INC="-DCHARLS_INTERFACE_H"
+ fi
else
- for ac_header in charls/charls.h
+ for ac_header in CharLS/charls.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "charls/charls.h" "ac_cv_header_charls_charls_h" "$ac_includes_default"
-if test "x$ac_cv_header_charls_charls_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "CharLS/charls.h" "ac_cv_header_CharLS_charls_h" "$ac_includes_default"
+if test "x$ac_cv_header_CharLS_charls_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_CHARLS_CHARLS_H 1
_ACEOF
@@ -30399,20 +30399,20 @@

done

- if test "$ac_cv_header_charls_charls_h" = "yes"; then
- ac_ext=cpp
+ if test "$ac_cv_header_CharLS_charls_h" = "yes"; then
+ ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JpegLsDecode in -lcharls" >&5
-$as_echo_n "checking for JpegLsDecode in -lcharls... " >&6; }
-if ${ac_cv_lib_charls_JpegLsDecode+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JpegLsDecode in -lCharLS" >&5
+$as_echo_n "checking for JpegLsDecode in -lCharLS... " >&6; }
+if ${ac_cv_lib_CharLS_JpegLsDecode+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcharls $LIBS"
+LIBS="-lCharLS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

@@ -30432,31 +30432,31 @@
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
- ac_cv_lib_charls_JpegLsDecode=yes
+ ac_cv_lib_CharLS_JpegLsDecode=yes
else
- ac_cv_lib_charls_JpegLsDecode=no
+ ac_cv_lib_CharLS_JpegLsDecode=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_charls_JpegLsDecode" >&5
-$as_echo "$ac_cv_lib_charls_JpegLsDecode" >&6; }
-if test "x$ac_cv_lib_charls_JpegLsDecode" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_CharLS_JpegLsDecode" >&5
+$as_echo "$ac_cv_lib_CharLS_JpegLsDecode" >&6; }
+if test "x$ac_cv_lib_CharLS_JpegLsDecode" = xyes; then :
HAVE_CHARLS=yes
fi

- ac_ext=c
+ ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

- if test "$HAVE_CHARLS" = "yes"; then
- LIBS="-lcharls $LIBS"
- CHARLS_INC="-DCHARLS_2_1"
- fi
+ if test "$HAVE_CHARLS" = "yes"; then
+ LIBS="-lCharLS $LIBS"
+ CHARLS_INC="-DCHARLS_2"
fi
+ fi
fi
fi
fi

0 comments on commit bcc04bf

Please sign in to comment.
You can’t perform that action at this time.