From 68826376ee5f47783c644c6604f4411ec747cd7e Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Fri, 14 Nov 2025 23:52:16 +0800
Subject: [PATCH] Add UDP DNS client source code

---
 project/1.packet/openlibs/cjson/build.sh |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/project/1.packet/openlibs/cjson/build.sh b/project/1.packet/openlibs/cjson/build.sh
new file mode 100755
index 0000000..d876ed5
--- /dev/null
+++ b/project/1.packet/openlibs/cjson/build.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# libraries install path
+INST_PATH=`pwd`/../install
+
+# LingYun studio FTP server address for all the open source code
+LYFTP_SRC=http://weike-iot.com:2211/src/
+
+# set shell script exit when any command failure
+set -e
+
+# funciton used to build cjson source code
+function build_cjson()
+{
+   SRC_NAME=cJSON-1.7.15
+
+   if [ -L $INST_PATH/lib/libcjson.so ] ; then
+      echo "$SRC_NAME already compile and installed"
+      return ;
+   fi
+
+   # If source code tarball file not exist, it will download the packet.
+   if [ ! -f ${SRC_NAME}.tar.gz ] ; then
+      wget ${LYFTP_SRC}/${SRC_NAME}.tar.gz
+   fi
+
+
+   # If source code folder not exist, decompress the tarball packet
+   if [ ! -d ${SRC_NAME} ] ; then
+      tar -xzf ${SRC_NAME}.tar.gz
+   fi
+
+   cd ${SRC_NAME}
+
+   make && make DESTDIR=${INST_PATH} PREFIX=/ install
+
+   # copy static library but not use shared library
+   rm -f ${INST_PATH}/lib/libcjson*.so*
+   cp libcjson.a ${INST_PATH}/lib/
+
+   cd -
+}
+
+# start build cjson
+
+build_cjson

--
Gitblit v1.9.1