[gdal-dev] Building GDAL with autoconf for Android on Windows

Andrew Patterson andrew at avenza.com
Sat Apr 1 16:27:11 PDT 2023


My options are rather limited unfortunately. I'd love to bump our GDAL from
3.3.0 to 3.5.0+ to pick up the CMake, but I'm not able to do that right
now. So I'm stuck building it for Android in Git bash with the pre-Cmake
options.

That said, in the end, I've given up on building it this way. I suspect it
works just fine and all my problems are related to Git bash's trouble with
spaces. We were using a custom CMake file I was hoping to avoid using, but
after three solid days of bashing my head against this, I'm throwing in the
towel and I'll just roll my own temporary CMake. Which I guess is what you
were suggesting anyways!

Thanks for the input. It helped tip me over into doing the manual CMake
thing. I can't wait to throw it away and use the 'out-of-the-box' version,
but that may be a few months away :P

On Sat, Apr 1, 2023 at 4:35 AM Kai Pastor, DG0YT <dg0yt at darc.de> wrote:

> git bash, quotes, make, this seems to add a lot of complication when you
> could directly run cmake+ninja for fast builds on windows.
>
> I think you shoudn't try to pass escaped quotes, but just quote the whole
> arguments as in
>
>  ... "-DINST_DATA=/c/prefix_path/shared"
> "-DSYSCONF_DIR=/c/prefix_path/etc" ...
>
> Regards, Kai
>
>
> Am 31.03.23 um 02:28 schrieb Andrew Patterson:
>
> Hello!
>
> We've been using a custom CMakeLists.txt for years to build a subset of
> GDAL for Android but I'm attempting to move us to building it properly.
> Unfortunately, we can't move to 3.5+ quite yet (I'm hoping soon) so I'm
> stuck with autoconf. I was happily surprised at how quickly I passed
> through the configure step (many thanks Google's NDK page with a very
> helpful autoconf section) but now I'm running into a rather stupid blocker.
>
> I'm building this using git bash on a Windows machine, and I suspect
> that's the root of my problem. Basically, when I run make on my configured
> system, it screws up the quoting on INST_DATA & SYSCONF_DIR. The command
> being executed looks something like:
>
> ... yada yada ... -DINST_DATA=\"/c/prefix_path/shared\"
> -DSYSCONF_DIR=\"/c/prefix_path/etc\"
>
> If I copy the command being executed and change that part to:
>
> ... yada yada ... -DINST_DATA="\"/c/prefix_path/shared\""
> -DSYSCONF_DIR="\"/c/prefix_path/etc\""
>
> It works. It also works if fully remove the defines for INST_DATA &
> SYSCONF_DIR, which I know is safe because we never defined those in our old
> CMakeLists.txt and everything worked fine (we were specifying the properly
> locations ahead of time so it never needed to look in any default places).
>
> Now, obviously manually copying the commands isn't the right fix, but
> maybe someone knows how to fix the quoting? Or, frankly, is there an option
> I'm missing (or some other magic trick) to tell it not to include INST_DATA
> or SYSCONF_DIR at all?
>
> Any help here would be greatly appreciated! This looked like it was going
> to be a quick job and it turned into a frustrating full-day failure :(
>
> [image: Avenza Systems Logo]
> <https://www.google.com/url?q=https://www.avenza.com/&source=gmail-html&ust=1678977468213000&usg=AOvVaw3ajVwWQPLnJ8kVQuKtUNKi>
>
> *Andrew Patterson*
> Desktop Lead Architect
>
> +1 (416) 487-5116 x401
> 84 Merton St., Toronto, ON, M4S 1A1
>
> ///supply.founders.outreach
> <https://www.google.com/url?q=https://www.avenza.com/about/contact/&source=gmail-html&ust=1678977468213000&usg=AOvVaw0_nt7MnUyk1lGZCRk6wICQ>
> [image: AvenzaUC2023 Banner]
> <https://www.google.com/url?q=https://www.avenza.com/user-conference/&source=gmail-html&ust=1678977468213000&usg=AOvVaw2Uj9MQv3vk5IzdDU7m0ycG>
>
> _______________________________________________
> gdal-dev mailing listgdal-dev at lists.osgeo.orghttps://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>


-- 
[image: Avenza Systems Logo]
<https://www.google.com/url?q=https://www.avenza.com/&source=gmail-html&ust=1678977468213000&usg=AOvVaw3ajVwWQPLnJ8kVQuKtUNKi>

*Andrew Patterson*
Desktop Lead Architect

+1 (416) 487-5116 x401
84 Merton St., Toronto, ON, M4S 1A1

///supply.founders.outreach
<https://www.google.com/url?q=https://www.avenza.com/about/contact/&source=gmail-html&ust=1678977468213000&usg=AOvVaw0_nt7MnUyk1lGZCRk6wICQ>
[image: AvenzaUC2023 Banner]
<https://www.google.com/url?q=https://www.avenza.com/user-conference/&source=gmail-html&ust=1678977468213000&usg=AOvVaw2Uj9MQv3vk5IzdDU7m0ycG>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230401/5d4f9940/attachment.htm>


More information about the gdal-dev mailing list