SQLite Forum

Need help building a custom amalgamation
Login
I'm sorry if my question wasn't phrased well or didn't have enough information, I've only been coding for a few months and just want to do whatever I can to learn... I'll try my best to give more information. Currently I have downloaded the canonical source and copied the `Makefile.linux-gcc` into a parallel directory named `build`. I have added the following compile flags:

>BCC = gcc -g -O0 \\  
>-DSQLITE_OMIT_ANALYZE \\  
>-DSQLITE_OMIT_ATTACH \\  
>-DSQLITE_OMIT_AUTHORIZATION \\  
>-DSQLITE_OMIT_AUTOINCREMENT \\  
>-DSQLITE_OMIT_AUTOMATIC_INDEX \\  
>-DSQLITE_OMIT_BLOB_LITERAL \\  
>-DSQLITE_OMIT_BTREECOUNT \\  
>-DSQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA \\  
>-DSQLITE_OMIT_CAST \\  
>-DSQLITE_OMIT_CHECK \\  
>-DSQLITE_OMIT_COMPILEOPTION_DIAGS \\  
>-DSQLITE_OMIT_COMPLETE \\  
>-DSQLITE_OMIT_DECLTYPE \\  
>-DSQLITE_OMIT_DEPRECATED \\  
>-DSQLITE_OMIT_FLAG_PRAGMAS \\  
>-DSQLITE_OMIT_INCRBLOB \\  
>-DSQLITE_OMIT_INTROSPECTION_PRAGMAS \\  
>-DSQLITE_OMIT_LOAD_EXTENSION \\  
>-DSQLITE_OMIT_LOOKASIDE \\  
>-DSQLITE_OMIT_PAGER_PRAGMAS \\  
>-DSQLITE_OMIT_PRAGMA \\  
>-DSQLITE_OMIT_PROGRESS_CALLBACK \\  
>-DSQLITE_OMIT_QUICKBALANCE \\  
>-DSQLITE_OMIT_REINDEX \\  
>-DSQLITE_OMIT_SHARED_CACHE \\  
>-DSQLITE_OMIT_TCL_VARIABLE \\  
>-DSQLITE_OMIT_TMPDB \\  
>-DSQLITE_OMIT_TRACE \\  
>-DSQLITE_OMIT_UTF16 \\  
>-DSQLITE_OMIT_VACUUM \\  
>-DSQLITE_OMIT_VIEW \\  
>-DSQLITE_OMIT_VIRTUAL_TABLE \\  
>-DSQLITE_OMIT_WAL \\  
>-DSQLITE_OMIT_WSD \\  
>-DSQLITE_OMIT_UNTESTABLE  
>(And the same flags for TCC)

I'll be honest, all of these were chosen without really knowing what I was omitting, I just read through the brief description and if it didn't sound like I needed it, I added it.

I then run `make sqlite3.c` inside the build directory where the `Makefile` is and end up with a sqlite3.c file that is around 8.1 MB. The source code that I'm currently working on and will use this library in is also about 8 MB. I would really prefer not to double the size of this code just for a library that I use three functions from. I don't have an exact `M` value for you so I'm sorry if I can't be more specific there. 

I just know there's probably a large part of this library I don't need and I'm not sure how to get rid of it. Using the above compile flags the .c file seems to be the same size as the standard amalgamation.

Sorry if this entire question is naive, I'm really just trying my best to learn and even after reading the documentation over and over again I'm still struggling. Thanks in advance for any help