Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite amalgamation in third_party #161

Closed
wants to merge 2 commits into from

Conversation

ahgamut
Copy link
Collaborator

@ahgamut ahgamut commented May 3, 2021

Added SQLite to third_party subfolder of Cosmopolitan repo.
Steps to replicate:

  • Clone my fork of SQLite https://github.com/ahgamut/sqlite/tree/cosmopolitan
  • run superconfigure and then make to obtain sqlite3.c and shell.c
  • create custom Make recipe sqlite3.mk based on Makefile obtained above
  • copy all necessary SQLite headers for compilation
  • change all #includes via find-and-replace to use the Cosmopolitan headers (<math.h> to "libc/math.h" etc.)
  • comment out lines to avoid warnings (a few Wredundant-decls)
  • Warning: Running clang-format on sqlite3.c requires a lot of RAM (crashed my system when I had 8GB RAM available).

sqlite.com compiles and runs under MODE=dbg and MODE=tiny (1024KB executable with MODE=tiny).

ahgamut added 2 commits May 4, 2021 17:35
View README for upstream source
* changed all necessary #includes with find-and-replace.
* changed two switch statements involving EACCES to if-else
* changed noinline to __noinline__
* commented useless headers, redundant declarations/definitions
@ahgamut
Copy link
Collaborator Author

ahgamut commented May 4, 2021

Ok, now it is in two commits:

First commit adds sqlite3.c and all the related headers created from f83d501 in the SQLite Github mirror.

Second commit adds sqlite3.mk and all the changes made to build with Cosmopolitan.

@ahgamut ahgamut changed the title sqlite.com in third_party sqlite amalgamation in third_party May 4, 2021
@ahgamut
Copy link
Collaborator Author

ahgamut commented May 14, 2021

No need to merge this becase #162 got merged in.

@ahgamut ahgamut closed this May 14, 2021
@ahgamut ahgamut mentioned this pull request Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant