Check-in [eb2922d636]
Overview
Comment:Added yajltcl support
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:eb2922d6369200bd20f160b0bb4a0c87a121bf2f
User & Date: rkeene on 2014-12-19 02:08:04
Other Links: manifest | tags
Context
2014-12-19
02:18
Added recently added extensions to the web interface check-in: 7be354cf06 user: rkeene tags: trunk
02:08
Added yajltcl support check-in: eb2922d636 user: rkeene tags: trunk
01:11
Added TclUDP support check-in: 966987c964 user: rkeene tags: trunk
Changes

Modified .fossil-settings/ignore-glob from [a196c5bbbb] to [e36d46f2b3].

   119    119   udp/build.log
   120    120   udp/inst
   121    121   udp/inst/*
   122    122   udp/out
   123    123   udp/out/*
   124    124   udp/src
   125    125   udp/src/*
          126  +yajltcl/build
          127  +yajltcl/build/*
          128  +yajltcl/build.log
          129  +yajltcl/inst
          130  +yajltcl/inst/*
          131  +yajltcl/out
          132  +yajltcl/out/*
          133  +yajltcl/src
          134  +yajltcl/src/*
   126    135   kitdll/buildsrc/kitdll-0.0/starpack.vfs
   127    136   kitdll/buildsrc/kitdll-0.0/starpack.vfs/*
   128    137   kitdll/buildsrc/kitdll-0.0/test
   129    138   kitdll/buildsrc/kitdll-0.0/configure
   130    139   kitdll/buildsrc/kitdll-0.0/libtcl*.so
   131    140   kitdll/buildsrc/kitdll-0.0/Makefile
   132    141   kitdll/buildsrc/kitdll-0.0/*.o

Modified kitcreator from [5f7e210f4a] to [c1ea36ee46].

    26     26   if [ -f 'build/pre.sh' ]; then
    27     27   	if ! find 'kitsh/buildsrc/' -name configure -type f 2>/dev/null | grep configure >/dev/null; then
    28     28   		echo "Please remember to run 'build/pre.sh' if you expect this build to work." >&2
    29     29   	fi
    30     30   fi
    31     31   
    32     32   # Define the list of all packages, for cleaning purposes
    33         -KITCREATOR_ALLPKGS="kitsh tcl tclvfs zlib tk itcl mk4tcl thread dbus tls tclx tcc4tcl tcllib udp"
           33  +KITCREATOR_ALLPKGS="kitsh tcl tclvfs zlib tk itcl mk4tcl thread dbus tls tclx tcc4tcl tcllib udp yajltcl"
    34     34   
    35     35   # Always rebuild kitsh
    36     36   rm -f "kitsh/.success"
    37     37   for pkg in ${KITCREATOR_ALLPKGS} ${KITCREATOR_PKGS}; do
    38     38   	if [ "${mode}" != "retry" -o ! -f "${pkg}/.success" ]; then
    39     39   		rm -f "${pkg}/build.log" "${pkg}/.success"
    40     40   		rm -rf "${pkg}/out" "${pkg}/inst" "${pkg}/build"

Added yajltcl/build.sh version [ba99dc5121].

            1  +#! /usr/bin/env bash
            2  +
            3  +if [ ! -f 'build.sh' ]; then
            4  +	echo 'ERROR: This script must be run from the directory it is in' >&2
            5  +
            6  +	exit 1
            7  +fi
            8  +if [ -z "${TCLVERS}" ]; then
            9  +	echo 'ERROR: The TCLVERS environment variable is not set' >&2
           10  +
           11  +	exit 1
           12  +fi
           13  +
           14  +YAJLTCLVERS="1.5"
           15  +YAJLVERS='2.1.0'
           16  +SRC="src/yajltcl-${YAJLTCLVERS}.tar.gz"
           17  +YAJLSRC="src/yajl-${YAJLVERS}.tar.gz"
           18  +SRCURL="https://github.com/flightaware/yajl-tcl/archive/v${YAJLTCLVERS}.tar.gz"
           19  +YAJLSRCURL="http://github.com/lloyd/yajl/tarball/${YAJLVERS}"
           20  +BUILDDIR="$(pwd)/build/yajl-tcl-${YAJLTCLVERS}"
           21  +YAJLBUILDDIR="$(pwd)/build/lloyd-yajl-66cb08c"
           22  +OUTDIR="$(pwd)/out"
           23  +INSTDIR="$(pwd)/inst"
           24  +PATCHDIR="$(pwd)/patches"
           25  +export YAJLTCLVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR PATCHDIR
           26  +
           27  +# Set configure options for this sub-project
           28  +LDFLAGS="${LDFLAGS} ${KC_YAJLTCL_LDFLAGS}"
           29  +CFLAGS="${CFLAGS} ${KC_YAJLTCL_CFLAGS}"
           30  +CPPFLAGS="${CPPFLAGS} ${KC_YAJLTCL_CPPFLAGS}"
           31  +LIBS="${LIBS} ${KC_YAJLTCL_LIBS}"
           32  +export LDFLAGS CFLAGS CPPFLAGS LIBS
           33  +
           34  +rm -rf 'build' 'out' 'inst'
           35  +mkdir 'build' 'out' 'inst' || exit 1
           36  +
           37  +if [ ! -d 'buildsrc' ]; then
           38  +	mkdir 'src' >/dev/null 2>/dev/null
           39  +
           40  +	if [ ! -f "${SRC}" ]; then
           41  +		rm -f "${SRC}.tmp"
           42  +		wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
           43  +		mv "${SRC}.tmp" "${SRC}"
           44  +	fi
           45  +
           46  +	if [ ! -f "${YAJLSRC}" ]; then
           47  +		rm -f "${YAJLSRC}.tmp"
           48  +		wget -O "${YAJLSRC}.tmp" "${YAJLSRCURL}" || exit 1
           49  +		mv "${YAJLSRC}.tmp" "${YAJLSRC}"
           50  +	fi
           51  +fi
           52  +
           53  +(
           54  +	cd 'build' || exit 1
           55  +
           56  +	if [ ! -d '../buildsrc' ]; then
           57  +		gzip -dc "../${SRC}" | tar -xf -
           58  +		gzip -dc "../${YAJLSRC}" | tar -xf -
           59  +	else    
           60  +		cp -rp ../buildsrc/* './'
           61  +	fi
           62  +
           63  +	# Build YAJL
           64  +	(
           65  +		cd "${YAJLBUILDDIR}" || exit 1
           66  +		./configure -p "$(pwd)/INST" || exit 1
           67  +		make || exit 1
           68  +		make install || exit 1
           69  +		rm -f INST/lib/*.so*
           70  +		mv INST/lib/libyajl_s.a INST/lib/libyajl.a || exit 1
           71  +	) || exit 1
           72  +
           73  +	# Include YAJL's build in our pkg-config path
           74  +	PKG_CONFIG_PATH="${YAJLBUILDDIR}/INST/share/pkgconfig"
           75  +	YAJL_CFLAGS="-I${YAJLBUILDDIR}/INST/include -I${YAJLBUILDDIR}/INST/include/yajl"
           76  +	export PKG_CONFIG_PATH YAJL_CFLAGS
           77  +
           78  +	# Build YAJL-TCL
           79  +	cd "${BUILDDIR}" || exit 1
           80  +
           81  +	# YAJLTCL releases are incomplete -- they lack a configure script
           82  +	autoconf || exit 1
           83  +
           84  +	# Try to build as a shared object if requested
           85  +	if [ "${STATICYAJLTCL}" = "0" ]; then
           86  +		tryopts="--enable-shared --disable-shared"
           87  +	elif [ "${STATICYAJLTCL}" = "-1" ]; then
           88  +		tryopts="--enable-shared"
           89  +	else
           90  +		tryopts="--disable-shared"
           91  +	fi
           92  +
           93  +	SAVE_CFLAGS="${CFLAGS}"
           94  +	for tryopt in $tryopts __fail__; do
           95  +		if [ "${tryopt}" = "__fail__" ]; then
           96  +			exit 1
           97  +		fi
           98  +		# Clean up, if needed
           99  +		make distclean >/dev/null 2>/dev/null
          100  +		rm -rf "${INSTDIR}"
          101  +		mkdir "${INSTDIR}"
          102  +
          103  +		if [ "${tryopt}" == "--enable-shared" ]; then
          104  +			isshared="1"
          105  +		else
          106  +			isshared="0"
          107  +		fi
          108  +
          109  +		# If build a static YAJLTCL for KitDLL, ensure that we use PIC
          110  +		# so that it can be linked into the shared object
          111  +		if [ "${isshared}" = "0" -a "${KITTARGET}" = "kitdll" ]; then
          112  +			CFLAGS="${SAVE_CFLAGS} -fPIC"
          113  +		else
          114  +			CFLAGS="${SAVE_CFLAGS}"
          115  +		fi
          116  +		export CFLAGS
          117  +
          118  +		if [ "${isshared}" = '0' ]; then
          119  +			sed 's@USE_TCL_STUBS@XXX_TCL_STUBS@g' configure > configure.new
          120  +		else
          121  +			sed 's@XXX_TCL_STUBS@USE_TCL_STUBS@g' configure > configure.new
          122  +		fi
          123  +		cat configure.new > configure
          124  +		rm -f configure.new
          125  +
          126  +		(
          127  +			echo "Running: ./configure $tryopt --prefix=\"${INSTDIR}\" --exec-prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}"
          128  +			./configure $tryopt --prefix="${INSTDIR}" --exec-prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA}
          129  +
          130  +			echo "Running: ${MAKE:-make} tcllibdir=\"${INSTDIR}/lib\""
          131  +			${MAKE:-make} tcllibdir="${INSTDIR}/lib" || exit 1
          132  +
          133  +			echo "Running: ${MAKE:-make} tcllibdir=\"${INSTDIR}/lib\" install"
          134  +			${MAKE:-make} tcllibdir="${INSTDIR}/lib" install || exit 1
          135  +		) || continue
          136  +
          137  +		if [ "${isshared}" = '0' ]; then
          138  +			# Copy static libyajl to INSTDIR
          139  +			mkdir -p "${INSTDIR}/lib/deps"
          140  +			cp "${YAJLBUILDDIR}/INST/lib/libyajl.a" "${INSTDIR}/lib/zz-libyajl.a" || exit 1
          141  +		fi
          142  +
          143  +		break
          144  +	done
          145  +
          146  +	# Create pkgIndex if needed
          147  +	if [ ! -e "${INSTDIR}/lib/yajltcl${YAJLTCLVERS}/pkgIndex.tcl" ]; then
          148  +		cat << _EOF_ > "${INSTDIR}/lib/yajltcl${YAJLTCLVERS}/pkgIndex.tcl"
          149  +package ifneeded yajltcl ${YAJLTCLVERS} \
          150  +    "[list load {} yajltcl]; \
          151  +    [list source [file join \$dir yajl.tcl]]"
          152  +_EOF_
          153  +	fi
          154  +
          155  +	# Install files needed by installation
          156  +	cp -r "${INSTDIR}/lib" "${OUTDIR}" || exit 1
          157  +	find "${OUTDIR}" -name '*.a' -type f | xargs -n 1 rm -f --
          158  +
          159  +	exit 0
          160  +) || exit 1
          161  +
          162  +exit 0