Artifact Content

Not logged in

Artifact 2680e5ffffad314021e58b1a0bb0f202a5cb573b:


#!/bin/bash
########################################################################
# Generates an "amalgamation build" for cson, including only the components
# needed for adding cson to the Fossil SCM system.
# Output is two files, cson_amalgamation_fossil.{c,h}.
########################################################################

LIB_BASH=createAmalgamation-lib.bash
. ${LIB_BASH} || {
    echo "Could not source config/lib script [${LIB_BASH}]."
    exit 127
}

AMAL_SOURCES="
parser/JSON_parser.h
parser/JSON_parser.c
${dir_src}/cson.c
${dir_src}/cson_lists.h
${dir_src}/cson_sqlite3.c
"
# The ordering of headers is important for the amalgamation build
AMAL_HEADERS="
${inc_cson}/cson.h
${inc_cson}/cson_sqlite3.h
"
#set -x
AMAL_FOSSIL_C=cson_amalgamation_fossil.c
AMAL_FOSSIL_H=cson_amalgamation_fossil.h
wh_create_code \
    ${AMAL_HEADERS} > ${AMAL_FOSSIL_H}
wh_create_code \
    -i ${AMAL_FOSSIL_H} \
    ${AMAL_SOURCES} > ${AMAL_FOSSIL_C}

echo "Done:"

ls -la ${AMAL_FOSSIL_C} ${AMAL_FOSSIL_H}

CFLAGS="${CFLAGS} -std=c89 -DCSON_ENABLE_SQLITE3=1" 
wh_try_compilers ${AMAL_FOSSIL_C}