mirror of
https://github.com/json-c/json-c.git
synced 2026-04-09 23:39:06 +08:00
Make the benchmark work with pre-cmake versions of json-c. Fetch a few more data files.
This commit is contained in:
@@ -80,9 +80,14 @@ mkdir -p "${WORK}"
|
|||||||
DATA="${RUNDIR}/data"
|
DATA="${RUNDIR}/data"
|
||||||
mkdir -p "${DATA}"
|
mkdir -p "${DATA}"
|
||||||
|
|
||||||
if [ ! -r "${DATA}/canada.json" ] ; then
|
for file in citm_catalog.json twitter.json canada.json ; do
|
||||||
curl -L -o "${DATA}/canada.json" 'https://github.com/mloskot/json_benchmark/raw/master/data/canada.json'
|
if [ ! -r "${DATA}/${file}" ] ; then
|
||||||
fi
|
echo "Fetching ${file} from github.com/mloskot/json_benchmark"
|
||||||
|
URL="https://github.com/mloskot/json_benchmark/raw/master/data/${file}"
|
||||||
|
curl -s -L -o "${DATA}/${file}" "$URL"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
|
||||||
# Identify "after" commit hash, in order of preference
|
# Identify "after" commit hash, in order of preference
|
||||||
if [ ! -z "$after_arg" -a -d "$after_arg" ] ; then
|
if [ ! -z "$after_arg" -a -d "$after_arg" ] ; then
|
||||||
@@ -180,8 +185,16 @@ compile_benchmark()
|
|||||||
fi
|
fi
|
||||||
# else, use the provided $src_dir
|
# else, use the provided $src_dir
|
||||||
|
|
||||||
cd "${build_dir}"
|
if [ -e "${src_dir}/CMakeLists.txt" ] ; then
|
||||||
cmake -DCMAKE_INSTALL_PREFIX="${inst_dir}" "${src_dir}"
|
cd "${build_dir}"
|
||||||
|
cmake -DCMAKE_INSTALL_PREFIX="${inst_dir}" "${src_dir}"
|
||||||
|
else
|
||||||
|
# Old versions of json-c used automake/autoconf
|
||||||
|
cd "${src_dir}"
|
||||||
|
sh autogen.sh # always run it, configure doesn't always work
|
||||||
|
cd "${build_dir}"
|
||||||
|
"${src_dir}/configure" --prefix="${inst_dir}"
|
||||||
|
fi
|
||||||
make all install
|
make all install
|
||||||
|
|
||||||
cd "${bench_dir}"
|
cd "${bench_dir}"
|
||||||
|
|||||||
Reference in New Issue
Block a user