gstf / libspatialite-ios

libspatialite compiled for iOS
55 stars 47 forks source link

Failed to build sqlite3 autoconf dependency on iOS 11, Xcode 9 #19

Open iNiKe opened 6 years ago

iNiKe commented 6 years ago

SQLite3-autoconf builds shell utility by default (shell.c -> sqlite3[.exe]). It uses system() call that was deprecated in iOS 8: 'system' is deprecated: first deprecated in iOS 8.0 - Use posix_spawn APIs instead.

In iOS 11 system() was disabled: swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable") __API_AVAILABLE(macos(10.0)) IOS_PROHIBITED WATCHOS_PROHIBITED __TVOS_PROHIBITED int system(const char *) DARWIN_ALIAS_C(system);

undef __swift_unavailable_on

sqlite3 configure does not have option to exclude shell utility from makefile So you need to modify makefile or replace "make clean install" command with targets excluding shell utility.

fhhowdy commented 6 years ago

Is there a workaround for this? I have been unsuccessful thus far.

sera4am commented 6 years ago

Download Xcode 8.3.3 Rename app name and change build environment use xcode-select when make.

SonicScholar commented 6 years ago

I've got Xcode 9.3.1. cloned this repo and ran make

This is the main error I'm getting:


shell.c:4870:9: error: 'system' is unavailable: not available on iOS
    x = system(zCmd);
        ^
sera4am commented 6 years ago

matrixugly I've got Xcode 9.3.1.

Can change build environment to older xcode version. use "xcode-select -s" command

Download Xcode 8.3.3 from apple developer site https://developer.apple.com/download/more/

Rename download and extracted Xcode.app to Xcode8.3.3.app and drop in Application folder And terminal "xcode-select -s /Application/Xcode.8.3.3.app" (change build environment) then make!

-- Dont forget back to currently xcode version environment after build. "xcode-select -s /Application/Xcode.app"

SonicScholar commented 6 years ago

Thanks so much for the reply! I will give this a try and let you know how it goes :)