diff --git a/README.md b/README.md index 4a9c6eb..36a9288 100644 --- a/README.md +++ b/README.md @@ -184,5 +184,5 @@ ds$Close() Please report any issue regarding the gdalBindings package to Dr. Hamamura (hamamura.caio@ifsp.edu.br) # Citing gdalBindings-R -Hamamura, C. gdalBindings-R: wraps around GDAL C library using Rcpp for reading and writing to Raster, version 0.1.29, accessed on May 25 2024, available at: +Hamamura, C. gdalBindings-R: wraps around GDAL C library using Rcpp for reading and writing to Raster, version 0.1.30, accessed on May 28 2024, available at: diff --git a/configure b/configure index 2e160df..3b9c5eb 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for gdalBindings 0.1.29. +# Generated by GNU Autoconf 2.71 for gdalBindings 0.1.30. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -607,8 +607,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='gdalBindings' PACKAGE_TARNAME='gdalbindings' -PACKAGE_VERSION='0.1.29' -PACKAGE_STRING='gdalBindings 0.1.29' +PACKAGE_VERSION='0.1.30' +PACKAGE_STRING='gdalBindings 0.1.30' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -649,7 +649,6 @@ LIBOBJS PROJ_DATADIR PROJ_LIBS PROJ_CFLAGS -GDAL_DEP_LIBS ac_ct_CC CFLAGS CC @@ -1277,7 +1276,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gdalBindings 0.1.29 to adapt to many kinds of systems. +\`configure' configures gdalBindings 0.1.30 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1339,7 +1338,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gdalBindings 0.1.29:";; + short | recursive ) echo "Configuration of gdalBindings 0.1.30:";; esac cat <<\_ACEOF @@ -1437,7 +1436,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gdalBindings configure 0.1.29 +gdalBindings configure 0.1.30 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1675,7 +1674,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gdalBindings $as_me 0.1.29, which was +It was created by gdalBindings $as_me 0.1.30, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3338,10 +3337,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test "x$os_name" = "xWindows" -then : - - # Check for GDAL using pkg-config +# Check for GDAL using pkg-config pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gdal" >&5 @@ -3434,10 +3430,11 @@ printf "%s\n" "yes" >&6; } fi -else $as_nop +GDAL_PKG_CONFIG_CFLAGS=$GDAL_CFLAGS +GDAL_PKG_CONFIG_LIBS=$GDAL_LIBS - # Check for GDAL gdal-config - # Allow the user to specify the path to gdal-config +# Check for GDAL gdal-config +# Allow the user to specify the path to gdal-config # Check whether --with-gdal-config was given. if test ${with_gdal_config+y} @@ -3448,12 +3445,12 @@ else $as_nop fi - # Check if the user has specified a custom path - if test -n "$gdal_config_path" +# Check if the user has specified a custom path +if test -n "$gdal_config_path" then : - # Check if the gdal-config exists at the specified path - # Extract the first word of "$gdal_config_path", so it can be a program name with args. + # Check if the gdal-config exists at the specified path + # Extract the first word of "$gdal_config_path", so it can be a program name with args. set dummy $gdal_config_path; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } @@ -3495,15 +3492,15 @@ printf "%s\n" "no" >&6; } fi - if test -z "$GDAL_CONFIG" + if test -z "$GDAL_CONFIG" then : - as_fn_error $? "gdal-config not found at specified path: $gdal_config_path" "$LINENO" 5 + as_fn_error $? "gdal-config not found at specified path: $gdal_config_path" "$LINENO" 5 fi else $as_nop - # Check for gdal-config in the default PATH - # Extract the first word of "gdal-config", so it can be a program name with args. + # Check for gdal-config in the default PATH + # Extract the first word of "gdal-config", so it can be a program name with args. set dummy gdal-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } @@ -3549,32 +3546,32 @@ fi - # If not found, error out with instructions - if test -z "$GDAL_CONFIG" + # If not found, error out with instructions + if test -z "$GDAL_CONFIG" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: - gdal-config not found. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: + gdal-config not found. - If you have installed the GDAL libraries, then make sure that - gdal-config is in your path. Try typing gdal-config at a - shell prompt and see if it runs. If not, use: - --configure-args='--with-gdal-config=/usr/local/bin/gdal-config' - with appropriate values for your installation. + If you have installed the GDAL libraries, then make sure that + gdal-config is in your path. Try typing gdal-config at a + shell prompt and see if it runs. If not, use: + --configure-args='--with-gdal-config=/usr/local/bin/gdal-config' + with appropriate values for your installation. - If you have not installed the GDAL libraries, - " >&5 + If you have not installed the GDAL libraries, + " >&5 printf "%s\n" "$as_me: - gdal-config not found. + gdal-config not found. - If you have installed the GDAL libraries, then make sure that - gdal-config is in your path. Try typing gdal-config at a - shell prompt and see if it runs. If not, use: - --configure-args='--with-gdal-config=/usr/local/bin/gdal-config' - with appropriate values for your installation. + If you have installed the GDAL libraries, then make sure that + gdal-config is in your path. Try typing gdal-config at a + shell prompt and see if it runs. If not, use: + --configure-args='--with-gdal-config=/usr/local/bin/gdal-config' + with appropriate values for your installation. - If you have not installed the GDAL libraries, - " >&6;} + If you have not installed the GDAL libraries, + " >&6;} as_fn_error $? " Please make sure the GDAL development package is installed: @@ -3591,16 +3588,13 @@ printf "%s\n" "$as_me: fi fi - # Output the found path of gdal-config - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Using gdal-config at $GDAL_CONFIG" >&5 +# Output the found path of gdal-config +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Using gdal-config at $GDAL_CONFIG" >&5 printf "%s\n" "$as_me: Using gdal-config at $GDAL_CONFIG" >&6;} - # Get compiler and linker flags from gdal-config - GDAL_CFLAGS=`${GDAL_CONFIG} --cflags` - GDAL_LIBS=$($GDAL_CONFIG --libs) - - -fi +# Get compiler and linker flags from gdal-config +GDAL_CONFIG_CFLAGS=`${GDAL_CONFIG} --cflags` +GDAL_CONFIG_LIBS=$($GDAL_CONFIG --libs) # Define CXXFLAGS which are used by default to compile the test program @@ -4404,13 +4398,16 @@ printf "%s\n" "$as_me: gdal.h not found in given locations." >&6;} fi -# Now try to link GDAL with gdal-config --libs only -LIBS="${LIBS} ${GDAL_LIBS} -Wl,--verbose" +# Try to link GDAL with `pkg-config --libs gdal` only +GDAL_LIBS=$GDAL_PKG_CONFIG_LIBS +LIBS="${GDAL_LIBS}" + +gdal_can_compile=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GDAL can be linked using only \`--libs\`" >&5 -printf %s "checking whether GDAL can be linked using only \`--libs\`... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GDAL can be linked using only \`pkg-config --libs gdal\`" >&5 +printf %s "checking whether GDAL can be linked using only \`pkg-config --libs gdal\`... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4439,7 +4436,67 @@ then : printf "%s\n" "yes" >&6; } gdal_can_compile=yes - GDAL_DEP_LIBS="" + + + +else $as_nop + # Action if the program compiles correctly + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + + # Action if the program fails to compile + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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 "x$gdal_can_compile" = "xno" +then : + + # Now try to link GDAL with gdal-config --libs only + GDAL_LIBS=$GDAL_CONFIG_LIBS + LIBS="${GDAL_LIBS}" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GDAL can be linked using only \`gdal-config --libs\`" >&5 +printf %s "checking whether GDAL can be linked using only \`gdal-config --libs\`... " >&6; } + 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 + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +GDALAllRegister(); + + ; + return 0; +} + + +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + + gdal_can_compile=yes + else $as_nop @@ -4448,9 +4505,69 @@ else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - gdal_can_compile=no + # Action if the program fails to compile + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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 + + + +fi +if test "x$gdal_can_compile" = "xno" +then : + + # Now try to link GDAL with gdal-config --libs --dep-libs + GDAL_LIBS=$($GDAL_CONFIG --libs --dep-libs) + LIBS="${GDAL_LIBS}" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GDAL can be linked using \`gdal-config --libs --dep-libs\`" >&5 +printf %s "checking whether GDAL can be linked using \`gdal-config --libs --dep-libs\`... " >&6; } + 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 + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +GDALAllRegister(); + + ; + return 0; +} + + +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + + gdal_can_compile=yes + + + +else $as_nop + # Action if the program compiles correctly + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Action if the program fails to compile fi @@ -4464,14 +4581,19 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +fi + if test "x$gdal_can_compile" = "xno" then : - GDAL_DEP_LIBS=$($GDAL_CONFIG --dep-libs) - LIBS="${LIBS} ${GDAL_DEP_LIBS}" + + # Now try to link GDAL with pkg-config --libs gdal and gdal-config --dep-libs + GDAL_LIBS=$GDAL_PKG_CONFIG_LIBS + GDAL_LIBS="${GDAL_LIBS} $($GDAL_CONFIG --dep-libs)" + LIBS="${GDAL_LIBS}" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GDAL can be linked using \`--libs\` and \`gdal-config --dep-libs\`" >&5 -printf %s "checking whether GDAL can be linked using \`--libs\` and \`gdal-config --dep-libs\`... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GDAL can be linked using both \`pkg-config --libs gdal\` and \`gdal-config --dep-libs\`" >&5 +printf %s "checking whether GDAL can be linked using both \`pkg-config --libs gdal\` and \`gdal-config --dep-libs\`... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4499,6 +4621,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } + gdal_can_compile=yes + else $as_nop # Action if the program compiles correctly @@ -4507,14 +4631,10 @@ else $as_nop printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: - Could not link to GDAL - neither with \`gdal-config --libs\` only - nor with \`--libs\` and \`--dep-libs\`. + Could not link to GDAL using \`pkg-config\` nor \`gdal-config\`. " >&5 printf "%s\n" "$as_me: - Could not link to GDAL - neither with \`gdal-config --libs\` only - nor with \`--libs\` and \`--dep-libs\`. + Could not link to GDAL using \`pkg-config\` nor \`gdal-config\`. " >&6;} as_fn_error $? " @@ -4546,8 +4666,6 @@ fi - - ################ ## PROJ ################ @@ -4716,12 +4834,14 @@ _ACEOF if ac_fn_cxx_try_run "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else $as_nop - as_fn_error $? "proj test program failed to run" "$LINENO" 5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "PROJ test program failed to run" "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -5290,7 +5410,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gdalBindings $as_me 0.1.29, which was +This file was extended by gdalBindings $as_me 0.1.30, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5345,7 +5465,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -gdalBindings config.status 0.1.29 +gdalBindings config.status 0.1.30 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index a4921bb..4ef72ce 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # Initialize the package and version -AC_INIT([gdalBindings],[0.1.29]) +AC_INIT([gdalBindings],[0.1.30]) # Initialize autoconfig AC_PREREQ([2.71]) @@ -60,54 +60,52 @@ AC_DEFUN([GDAL_TEST_PROGRAM_IFELSE], [ ]) -AS_IF([test "x$os_name" = "xWindows"], - [ - # Check for GDAL using pkg-config - PKG_CHECK_MODULES([GDAL], [gdal]) - ], - [ - # Check for GDAL gdal-config - # Allow the user to specify the path to gdal-config - AC_ARG_WITH([gdal-config], - [AS_HELP_STRING([--with-gdal-config=PATH], [specify the path to gdal-config])], - [gdal_config_path=$withval], [gdal_config_path=""]) - - # Check if the user has specified a custom path - AS_IF([test -n "$gdal_config_path"], - [ - # Check if the gdal-config exists at the specified path - AC_CHECK_PROG([GDAL_CONFIG], [$gdal_config_path], [$gdal_config_path]) - AS_IF([test -z "$GDAL_CONFIG"], [ - AC_MSG_ERROR([gdal-config not found at specified path: $gdal_config_path])])], - [ - # Check for gdal-config in the default PATH - AC_PATH_PROG([GDAL_CONFIG], [gdal-config]) - - # If not found, error out with instructions - AS_IF([test -z "$GDAL_CONFIG"], [ - AC_MSG_NOTICE([ - gdal-config not found. - - If you have installed the GDAL libraries, then make sure that - gdal-config is in your path. Try typing gdal-config at a - shell prompt and see if it runs. If not, use: - --configure-args='--with-gdal-config=/usr/local/bin/gdal-config' - with appropriate values for your installation. +# Check for GDAL using pkg-config +PKG_CHECK_MODULES([GDAL], [gdal]) - If you have not installed the GDAL libraries, - ]) - GDAL_INSTALLATION_ERROR - ] - )]) +GDAL_PKG_CONFIG_CFLAGS=$GDAL_CFLAGS +GDAL_PKG_CONFIG_LIBS=$GDAL_LIBS - # Output the found path of gdal-config - AC_MSG_NOTICE([Using gdal-config at $GDAL_CONFIG]) +# Check for GDAL gdal-config +# Allow the user to specify the path to gdal-config +AC_ARG_WITH([gdal-config], + [AS_HELP_STRING([--with-gdal-config=PATH], [specify the path to gdal-config])], + [gdal_config_path=$withval], [gdal_config_path=""]) - # Get compiler and linker flags from gdal-config - GDAL_CFLAGS=`${GDAL_CONFIG} --cflags` - GDAL_LIBS=$($GDAL_CONFIG --libs) +# Check if the user has specified a custom path +AS_IF([test -n "$gdal_config_path"], + [ + # Check if the gdal-config exists at the specified path + AC_CHECK_PROG([GDAL_CONFIG], [$gdal_config_path], [$gdal_config_path]) + AS_IF([test -z "$GDAL_CONFIG"], [ + AC_MSG_ERROR([gdal-config not found at specified path: $gdal_config_path])])], + [ + # Check for gdal-config in the default PATH + AC_PATH_PROG([GDAL_CONFIG], [gdal-config]) + + # If not found, error out with instructions + AS_IF([test -z "$GDAL_CONFIG"], [ + AC_MSG_NOTICE([ + gdal-config not found. + + If you have installed the GDAL libraries, then make sure that + gdal-config is in your path. Try typing gdal-config at a + shell prompt and see if it runs. If not, use: + --configure-args='--with-gdal-config=/usr/local/bin/gdal-config' + with appropriate values for your installation. + + If you have not installed the GDAL libraries, + ]) + GDAL_INSTALLATION_ERROR ] -) + )]) + +# Output the found path of gdal-config +AC_MSG_NOTICE([Using gdal-config at $GDAL_CONFIG]) + +# Get compiler and linker flags from gdal-config +GDAL_CONFIG_CFLAGS=`${GDAL_CONFIG} --cflags` +GDAL_CONFIG_LIBS=$($GDAL_CONFIG --libs) # Define CXXFLAGS which are used by default to compile the test program @@ -125,41 +123,67 @@ AC_CHECK_HEADER([gdal.h], ] ) -# Now try to link GDAL with gdal-config --libs only -LIBS="${LIBS} ${GDAL_LIBS} -Wl,--verbose" +# Try to link GDAL with `pkg-config --libs gdal` only +GDAL_LIBS=$GDAL_PKG_CONFIG_LIBS +LIBS="${GDAL_LIBS}" + +gdal_can_compile=no GDAL_TEST_PROGRAM_IFELSE( - [whether GDAL can be linked using only `--libs`], + [whether GDAL can be linked using only `pkg-config --libs gdal`], [ gdal_can_compile=yes - GDAL_DEP_LIBS="" - ], - [ - gdal_can_compile=no ] ) -AS_IF([test "x$gdal_can_compile" = "xno"], - GDAL_DEP_LIBS=$($GDAL_CONFIG --dep-libs) - LIBS="${LIBS} ${GDAL_DEP_LIBS}" +AS_IF([test "x$gdal_can_compile" = "xno"], [ + # Now try to link GDAL with gdal-config --libs only + GDAL_LIBS=$GDAL_CONFIG_LIBS + LIBS="${GDAL_LIBS}" + + GDAL_TEST_PROGRAM_IFELSE( + [whether GDAL can be linked using only `gdal-config --libs`], + [ + gdal_can_compile=yes + ] + ) +]) + + +AS_IF([test "x$gdal_can_compile" = "xno"], [ + # Now try to link GDAL with gdal-config --libs --dep-libs + GDAL_LIBS=$($GDAL_CONFIG --libs --dep-libs) + LIBS="${GDAL_LIBS}" + + GDAL_TEST_PROGRAM_IFELSE( + [whether GDAL can be linked using `gdal-config --libs --dep-libs`], + [ + gdal_can_compile=yes + ] + ) +]) + +AS_IF([test "x$gdal_can_compile" = "xno"], [ + # Now try to link GDAL with pkg-config --libs gdal and gdal-config --dep-libs + GDAL_LIBS=$GDAL_PKG_CONFIG_LIBS + GDAL_LIBS="${GDAL_LIBS} $($GDAL_CONFIG --dep-libs)" + LIBS="${GDAL_LIBS}" GDAL_TEST_PROGRAM_IFELSE( - [whether GDAL can be linked using `--libs` and `gdal-config --dep-libs`], - [], + [whether GDAL can be linked using both `pkg-config --libs gdal` and `gdal-config --dep-libs`], + [ + gdal_can_compile=yes + ], [ AC_MSG_NOTICE([ - Could not link to GDAL - neither with `gdal-config --libs` only - nor with `--libs` and `--dep-libs`. + Could not link to GDAL using `pkg-config` nor `gdal-config`. ]) GDAL_INSTALLATION_ERROR ] ) -) +]) AC_SUBST([GDAL_LIBS]) -AC_SUBST([GDAL_DEP_LIBS]) - ################ ## PROJ @@ -188,9 +212,10 @@ AC_RUN_IFELSE([ return ret; ]]) ], [ - AC_MSG_RESULT([yes]) + AC_MSG_RESULT([yes]) ], [ - AC_MSG_ERROR([proj test program failed to run]) + AC_MSG_RESULT([no]) + AC_MSG_ERROR([PROJ test program failed to run]) ]) AC_LANG_POP([C++]) diff --git a/configure.win b/configure.win index 2e160df..3b9c5eb 100644 --- a/configure.win +++ b/configure.win @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for gdalBindings 0.1.29. +# Generated by GNU Autoconf 2.71 for gdalBindings 0.1.30. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -607,8 +607,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='gdalBindings' PACKAGE_TARNAME='gdalbindings' -PACKAGE_VERSION='0.1.29' -PACKAGE_STRING='gdalBindings 0.1.29' +PACKAGE_VERSION='0.1.30' +PACKAGE_STRING='gdalBindings 0.1.30' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -649,7 +649,6 @@ LIBOBJS PROJ_DATADIR PROJ_LIBS PROJ_CFLAGS -GDAL_DEP_LIBS ac_ct_CC CFLAGS CC @@ -1277,7 +1276,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gdalBindings 0.1.29 to adapt to many kinds of systems. +\`configure' configures gdalBindings 0.1.30 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1339,7 +1338,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gdalBindings 0.1.29:";; + short | recursive ) echo "Configuration of gdalBindings 0.1.30:";; esac cat <<\_ACEOF @@ -1437,7 +1436,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gdalBindings configure 0.1.29 +gdalBindings configure 0.1.30 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1675,7 +1674,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gdalBindings $as_me 0.1.29, which was +It was created by gdalBindings $as_me 0.1.30, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3338,10 +3337,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test "x$os_name" = "xWindows" -then : - - # Check for GDAL using pkg-config +# Check for GDAL using pkg-config pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gdal" >&5 @@ -3434,10 +3430,11 @@ printf "%s\n" "yes" >&6; } fi -else $as_nop +GDAL_PKG_CONFIG_CFLAGS=$GDAL_CFLAGS +GDAL_PKG_CONFIG_LIBS=$GDAL_LIBS - # Check for GDAL gdal-config - # Allow the user to specify the path to gdal-config +# Check for GDAL gdal-config +# Allow the user to specify the path to gdal-config # Check whether --with-gdal-config was given. if test ${with_gdal_config+y} @@ -3448,12 +3445,12 @@ else $as_nop fi - # Check if the user has specified a custom path - if test -n "$gdal_config_path" +# Check if the user has specified a custom path +if test -n "$gdal_config_path" then : - # Check if the gdal-config exists at the specified path - # Extract the first word of "$gdal_config_path", so it can be a program name with args. + # Check if the gdal-config exists at the specified path + # Extract the first word of "$gdal_config_path", so it can be a program name with args. set dummy $gdal_config_path; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } @@ -3495,15 +3492,15 @@ printf "%s\n" "no" >&6; } fi - if test -z "$GDAL_CONFIG" + if test -z "$GDAL_CONFIG" then : - as_fn_error $? "gdal-config not found at specified path: $gdal_config_path" "$LINENO" 5 + as_fn_error $? "gdal-config not found at specified path: $gdal_config_path" "$LINENO" 5 fi else $as_nop - # Check for gdal-config in the default PATH - # Extract the first word of "gdal-config", so it can be a program name with args. + # Check for gdal-config in the default PATH + # Extract the first word of "gdal-config", so it can be a program name with args. set dummy gdal-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } @@ -3549,32 +3546,32 @@ fi - # If not found, error out with instructions - if test -z "$GDAL_CONFIG" + # If not found, error out with instructions + if test -z "$GDAL_CONFIG" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: - gdal-config not found. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: + gdal-config not found. - If you have installed the GDAL libraries, then make sure that - gdal-config is in your path. Try typing gdal-config at a - shell prompt and see if it runs. If not, use: - --configure-args='--with-gdal-config=/usr/local/bin/gdal-config' - with appropriate values for your installation. + If you have installed the GDAL libraries, then make sure that + gdal-config is in your path. Try typing gdal-config at a + shell prompt and see if it runs. If not, use: + --configure-args='--with-gdal-config=/usr/local/bin/gdal-config' + with appropriate values for your installation. - If you have not installed the GDAL libraries, - " >&5 + If you have not installed the GDAL libraries, + " >&5 printf "%s\n" "$as_me: - gdal-config not found. + gdal-config not found. - If you have installed the GDAL libraries, then make sure that - gdal-config is in your path. Try typing gdal-config at a - shell prompt and see if it runs. If not, use: - --configure-args='--with-gdal-config=/usr/local/bin/gdal-config' - with appropriate values for your installation. + If you have installed the GDAL libraries, then make sure that + gdal-config is in your path. Try typing gdal-config at a + shell prompt and see if it runs. If not, use: + --configure-args='--with-gdal-config=/usr/local/bin/gdal-config' + with appropriate values for your installation. - If you have not installed the GDAL libraries, - " >&6;} + If you have not installed the GDAL libraries, + " >&6;} as_fn_error $? " Please make sure the GDAL development package is installed: @@ -3591,16 +3588,13 @@ printf "%s\n" "$as_me: fi fi - # Output the found path of gdal-config - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Using gdal-config at $GDAL_CONFIG" >&5 +# Output the found path of gdal-config +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Using gdal-config at $GDAL_CONFIG" >&5 printf "%s\n" "$as_me: Using gdal-config at $GDAL_CONFIG" >&6;} - # Get compiler and linker flags from gdal-config - GDAL_CFLAGS=`${GDAL_CONFIG} --cflags` - GDAL_LIBS=$($GDAL_CONFIG --libs) - - -fi +# Get compiler and linker flags from gdal-config +GDAL_CONFIG_CFLAGS=`${GDAL_CONFIG} --cflags` +GDAL_CONFIG_LIBS=$($GDAL_CONFIG --libs) # Define CXXFLAGS which are used by default to compile the test program @@ -4404,13 +4398,16 @@ printf "%s\n" "$as_me: gdal.h not found in given locations." >&6;} fi -# Now try to link GDAL with gdal-config --libs only -LIBS="${LIBS} ${GDAL_LIBS} -Wl,--verbose" +# Try to link GDAL with `pkg-config --libs gdal` only +GDAL_LIBS=$GDAL_PKG_CONFIG_LIBS +LIBS="${GDAL_LIBS}" + +gdal_can_compile=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GDAL can be linked using only \`--libs\`" >&5 -printf %s "checking whether GDAL can be linked using only \`--libs\`... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GDAL can be linked using only \`pkg-config --libs gdal\`" >&5 +printf %s "checking whether GDAL can be linked using only \`pkg-config --libs gdal\`... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4439,7 +4436,67 @@ then : printf "%s\n" "yes" >&6; } gdal_can_compile=yes - GDAL_DEP_LIBS="" + + + +else $as_nop + # Action if the program compiles correctly + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + + # Action if the program fails to compile + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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 "x$gdal_can_compile" = "xno" +then : + + # Now try to link GDAL with gdal-config --libs only + GDAL_LIBS=$GDAL_CONFIG_LIBS + LIBS="${GDAL_LIBS}" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GDAL can be linked using only \`gdal-config --libs\`" >&5 +printf %s "checking whether GDAL can be linked using only \`gdal-config --libs\`... " >&6; } + 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 + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +GDALAllRegister(); + + ; + return 0; +} + + +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + + gdal_can_compile=yes + else $as_nop @@ -4448,9 +4505,69 @@ else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - gdal_can_compile=no + # Action if the program fails to compile + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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 + + + +fi +if test "x$gdal_can_compile" = "xno" +then : + + # Now try to link GDAL with gdal-config --libs --dep-libs + GDAL_LIBS=$($GDAL_CONFIG --libs --dep-libs) + LIBS="${GDAL_LIBS}" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GDAL can be linked using \`gdal-config --libs --dep-libs\`" >&5 +printf %s "checking whether GDAL can be linked using \`gdal-config --libs --dep-libs\`... " >&6; } + 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 + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +GDALAllRegister(); + + ; + return 0; +} + + +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + + gdal_can_compile=yes + + + +else $as_nop + # Action if the program compiles correctly + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # Action if the program fails to compile fi @@ -4464,14 +4581,19 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +fi + if test "x$gdal_can_compile" = "xno" then : - GDAL_DEP_LIBS=$($GDAL_CONFIG --dep-libs) - LIBS="${LIBS} ${GDAL_DEP_LIBS}" + + # Now try to link GDAL with pkg-config --libs gdal and gdal-config --dep-libs + GDAL_LIBS=$GDAL_PKG_CONFIG_LIBS + GDAL_LIBS="${GDAL_LIBS} $($GDAL_CONFIG --dep-libs)" + LIBS="${GDAL_LIBS}" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GDAL can be linked using \`--libs\` and \`gdal-config --dep-libs\`" >&5 -printf %s "checking whether GDAL can be linked using \`--libs\` and \`gdal-config --dep-libs\`... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GDAL can be linked using both \`pkg-config --libs gdal\` and \`gdal-config --dep-libs\`" >&5 +printf %s "checking whether GDAL can be linked using both \`pkg-config --libs gdal\` and \`gdal-config --dep-libs\`... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4499,6 +4621,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } + gdal_can_compile=yes + else $as_nop # Action if the program compiles correctly @@ -4507,14 +4631,10 @@ else $as_nop printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: - Could not link to GDAL - neither with \`gdal-config --libs\` only - nor with \`--libs\` and \`--dep-libs\`. + Could not link to GDAL using \`pkg-config\` nor \`gdal-config\`. " >&5 printf "%s\n" "$as_me: - Could not link to GDAL - neither with \`gdal-config --libs\` only - nor with \`--libs\` and \`--dep-libs\`. + Could not link to GDAL using \`pkg-config\` nor \`gdal-config\`. " >&6;} as_fn_error $? " @@ -4546,8 +4666,6 @@ fi - - ################ ## PROJ ################ @@ -4716,12 +4834,14 @@ _ACEOF if ac_fn_cxx_try_run "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else $as_nop - as_fn_error $? "proj test program failed to run" "$LINENO" 5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "PROJ test program failed to run" "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -5290,7 +5410,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gdalBindings $as_me 0.1.29, which was +This file was extended by gdalBindings $as_me 0.1.30, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5345,7 +5465,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -gdalBindings config.status 0.1.29 +gdalBindings config.status 0.1.30 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/src/Makevars.in b/src/Makevars.in index b4f5f96..9f78021 100644 --- a/src/Makevars.in +++ b/src/Makevars.in @@ -1,5 +1,5 @@ PKG_CPPFLAGS = @GDAL_CFLAGS@ @PROJ_CFLAGS@ -PKG_LIBS = @GDAL_LIBS@ @GDAL_DEP_LIBS@ @PROJ_LIBS@ +PKG_LIBS = @GDAL_LIBS@ @PROJ_LIBS@ # Copy PROJ data directory to inst/proj PROJ_DATADIR = @PROJ_DATADIR@