#!/bin/sh

# Compilation script for SQLite 3.6.22 CLI for Mac OS X on PowerPC

for i in G3 7400 7450 G5; do
	# Options for the full-featured command line interface from:
	# https://sqlite.org/howtocompile.html
	cc \
		shell.c \
		sqlite3.c \
		-DSQLITE_THREADSAFE=0 \
		-DSQLITE_ENABLE_FTS4 \
		-DSQLITE_ENABLE_FTS5 \
		-DSQLITE_ENABLE_JSON1 \
		-DSQLITE_ENABLE_RTREE \
		-DSQLITE_ENABLE_EXPLAIN_COMMENTS \
		-DHAVE_USLEEP \
		-DHAVE_READLINE \
		-ldl \
		-lreadline \
		-lncurses \
		-mcpu=$i \
		-mmacosx-version-min=10.1 \
		-mtune=$i \
		-Os \
		-o sqlite3-$i
	strip sqlite3-$i
done
