Check-in [4d5805e2be]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:add imgjp2 module to undroid/vanillawish build scripts for linux
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4d5805e2be009262f655101518c329dc8f0a298c
User & Date: chw 2019-09-08 12:51:31
Context
2019-09-08
14:19
add imgjp2 module to undroid/vanillawish build scripts for macosx check-in: c92120396a user: chw tags: trunk
12:51
add imgjp2 module to undroid/vanillawish build scripts for linux check-in: 4d5805e2be user: chw tags: trunk
09:04
add initial version of JP2 photo image format handler using libopenjp2 check-in: dcd2aa6598 user: chw tags: trunk
Changes

Changes to undroid/build-undroidwish-generic.sh.

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
...
146
147
148
149
150
151
152



153
154
155
156
157
158
159
...
275
276
277
278
279
280
281










282
283
284
285
286
287
288
....
1692
1693
1694
1695
1696
1697
1698


































1699
1700
1701
1702
1703
1704
1705
....
1855
1856
1857
1858
1859
1860
1861

1862
1863
1864
1865
1866
1867
1868
    aarch*)
      SUBDIRS="${SUBDIRS} piio"
      ;;
  esac
  SUBDIRS="${SUBDIRS} libsocketcan tclcan fswatch tserialport tcl-fuse"
fi

SUBDIRS="${SUBDIRS} topcua parse_args tkvlc tclJBlend Tix"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;
      libwebsockets)
        rm -f ${i}/build/build-stamp
	;;



      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
          if test "$ACTION" = "distclean" ; then
            rm -rf libwebsockets/build
          else
            make -C libwebsockets/build ${ACTION} || true
          fi
        ) || true
        ;;










      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
  rm ${HERE}/sdl2tk/sdl/tkConfig.sh
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail



































echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/sdl2wish* \
................................................................................
  fi
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  if test -d ${PFX_HERE}/lib/fuse* ; then
    cp -rp ${PFX_HERE}/lib/fuse* assets
  fi
  cp -rp ${PFX_HERE}/lib/Tix* assets

  if test "$(uname -o)" = "GNU/Linux" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
    cp -rp ${AWDIR}/assets/touchcal* assets
  fi
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (
    cd assets







|







 







>
>
>







 







>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
...
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
...
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
....
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
....
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
    aarch*)
      SUBDIRS="${SUBDIRS} piio"
      ;;
  esac
  SUBDIRS="${SUBDIRS} libsocketcan tclcan fswatch tserialport tcl-fuse"
fi

SUBDIRS="${SUBDIRS} topcua parse_args tkvlc tclJBlend Tix openjpeg imgjp2"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;
      libwebsockets)
        rm -f ${i}/build/build-stamp
	;;
      openjpeg)
        rm -f ${i}/build/build-stamp
	;;
      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
          if test "$ACTION" = "distclean" ; then
            rm -rf libwebsockets/build
          else
            make -C libwebsockets/build ${ACTION} || true
          fi
        ) || true
        ;;
      openjpeg)
        (
          exec >> build.log 2>&1
          if test "$ACTION" = "distclean" ; then
            rm -rf openjpeg/build
          else
            make -C openjpeg/build ${ACTION} || true
          fi
        ) || true
        ;;
      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
  rm ${HERE}/sdl2tk/sdl/tkConfig.sh
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build openjpeg (static, pic) ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  mkdir -p openjpeg/build
  cd openjpeg/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
    -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra -DBUILD_SHARED_LIBS:bool=off \
    -DBUILD_PKGCONFIG_FILES=on -DOPJ_USE_THREAD:bool=off || exit 1
  make VERBOSE=1 COLOR=0 openjp2/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_compress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_decompress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_dump/fast || exit 1
  make VERBOSE=1 COLOR=0 install/fast || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build imgjp2 ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  cd imgjp2
  test -e build-stamp && echo >&3 "already done" && exit 0
  PKG_CONFIG_PATH=${PFX_HERE}/extra/lib/pkgconfig DESTDIR=${HERE} \
    ./configure --prefix=${PFX} --with-tcl=${HERE}/tcl/unix \
      --with-tk=${HERE}/sdl2tk/sdl --enable-threads || exit 1
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/sdl2wish* \
................................................................................
  fi
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  if test -d ${PFX_HERE}/lib/fuse* ; then
    cp -rp ${PFX_HERE}/lib/fuse* assets
  fi
  cp -rp ${PFX_HERE}/lib/Tix* assets
  cp -rp ${PFX_HERE}/lib/imgjp2* assets
  if test "$(uname -o)" = "GNU/Linux" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
    cp -rp ${AWDIR}/assets/touchcal* assets
  fi
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (
    cd assets

Changes to undroid/build-undroidwish-kmsdrm.sh.

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
139
140
141
142
143
144
145



146
147
148
149
150
151
152
...
268
269
270
271
272
273
274










275
276
277
278
279
280
281
....
1620
1621
1622
1623
1624
1625
1626


































1627
1628
1629
1630
1631
1632
1633
....
1768
1769
1770
1771
1772
1773
1774

1775
1776
1777
1778
1779
1780
1781
SUBDIRS="${SUBDIRS} tkhtml dbus-tcl dbus-intf tclx libdmtx ZBar zint"
SUBDIRS="${SUBDIRS} tcl-augeas snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf libsocketcan tclcan vu"
SUBDIRS="${SUBDIRS} rl_json mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler snap7 libmodbus fswatch"
SUBDIRS="${SUBDIRS} tserialport topcua parse_args tkvlc tclJBlend"
SUBDIRS="${SUBDIRS} tcl-fuse Tix"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;
      libwebsockets)
        rm -f ${i}/build/build-stamp
	;;



      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
          if test "$ACTION" = "distclean" ; then
            rm -rf libwebsockets/build
          else
            make -C libwebsockets/build ${ACTION} || true
          fi
        ) || true
        ;;










      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
  rm ${HERE}/sdl2tk/sdl/tkConfig.sh
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail



































echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/sdl2wish* \
................................................................................
  cp -rp ${PFX_HERE}/lib/topcua* assets
  cp -rp ${PFX_HERE}/lib/parse_args* assets
  cp -rp ${PFX_HERE}/lib/tkvlc* assets
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  cp -rp ${PFX_HERE}/lib/fuse* assets
  cp -rp ${PFX_HERE}/lib/Tix* assets

  if test "$ACTION" != "ebuild" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  cp -rp ${AWDIR}/assets/touchcal* assets
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (
    cd assets







|







 







>
>
>







 







>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
...
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
....
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
....
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
SUBDIRS="${SUBDIRS} tkhtml dbus-tcl dbus-intf tclx libdmtx ZBar zint"
SUBDIRS="${SUBDIRS} tcl-augeas snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf libsocketcan tclcan vu"
SUBDIRS="${SUBDIRS} rl_json mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler snap7 libmodbus fswatch"
SUBDIRS="${SUBDIRS} tserialport topcua parse_args tkvlc tclJBlend"
SUBDIRS="${SUBDIRS} tcl-fuse Tix openjpeg imgjp2"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;
      libwebsockets)
        rm -f ${i}/build/build-stamp
	;;
      openjpeg)
        rm -f ${i}/build/build-stamp
	;;
      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
          if test "$ACTION" = "distclean" ; then
            rm -rf libwebsockets/build
          else
            make -C libwebsockets/build ${ACTION} || true
          fi
        ) || true
        ;;
      openjpeg)
        (
          exec >> build.log 2>&1
          if test "$ACTION" = "distclean" ; then
            rm -rf openjpeg/build
          else
            make -C openjpeg/build ${ACTION} || true
          fi
        ) || true
        ;;
      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
  rm ${HERE}/sdl2tk/sdl/tkConfig.sh
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build openjpeg (static, pic) ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  mkdir -p openjpeg/build
  cd openjpeg/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
    -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra -DBUILD_SHARED_LIBS:bool=off \
    -DBUILD_PKGCONFIG_FILES=on -DOPJ_USE_THREAD:bool=off || exit 1
  make VERBOSE=1 COLOR=0 openjp2/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_compress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_decompress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_dump/fast || exit 1
  make VERBOSE=1 COLOR=0 install/fast || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build imgjp2 ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  cd imgjp2
  test -e build-stamp && echo >&3 "already done" && exit 0
  PKG_CONFIG_PATH=${PFX_HERE}/extra/lib/pkgconfig DESTDIR=${HERE} \
    ./configure --prefix=${PFX} --with-tcl=${HERE}/tcl/unix \
      --with-tk=${HERE}/sdl2tk/sdl --enable-threads || exit 1
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/sdl2wish* \
................................................................................
  cp -rp ${PFX_HERE}/lib/topcua* assets
  cp -rp ${PFX_HERE}/lib/parse_args* assets
  cp -rp ${PFX_HERE}/lib/tkvlc* assets
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  cp -rp ${PFX_HERE}/lib/fuse* assets
  cp -rp ${PFX_HERE}/lib/Tix* assets
  cp -rp ${PFX_HERE}/lib/imgjp2* assets
  if test "$ACTION" != "ebuild" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  cp -rp ${AWDIR}/assets/touchcal* assets
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (
    cd assets

Changes to undroid/build-undroidwish-linux32.sh.

91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
...
140
141
142
143
144
145
146



147
148
149
150
151
152
153
...
269
270
271
272
273
274
275










276
277
278
279
280
281
282
....
1668
1669
1670
1671
1672
1673
1674



































1675
1676
1677
1678
1679
1680
1681
....
1816
1817
1818
1819
1820
1821
1822

1823
1824
1825
1826
1827
1828
1829
SUBDIRS="${SUBDIRS} tkhtml dbus-tcl dbus-intf tclx libdmtx ZBar zint"
SUBDIRS="${SUBDIRS} tcl-augeas snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf libsocketcan tclcan vu"
SUBDIRS="${SUBDIRS} rl_json mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler snap7 libmodbus fswatch"
SUBDIRS="${SUBDIRS} tserialport topcua parse_args tkvlc tclJBlend"
SUBDIRS="${SUBDIRS} tcl-fuse Tix"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;
      libwebsockets)
        rm -f ${i}/build/build-stamp
	;;



      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
          if test "$ACTION" = "distclean" ; then
            rm -rf libwebsockets/build
          else
            make -C libwebsockets/build ${ACTION} || true
          fi
        ) || true
        ;;










      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
  rm ${HERE}/sdl2tk/sdl/tkConfig.sh
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail




































echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/sdl2wish* \
................................................................................
  cp -rp ${PFX_HERE}/lib/topcua* assets
  cp -rp ${PFX_HERE}/lib/parse_args* assets
  cp -rp ${PFX_HERE}/lib/tkvlc* assets
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  cp -rp ${PFX_HERE}/lib/fuse* assets
  cp -rp ${PFX_HERE}/lib/Tix* assets

  if test "$ACTION" != "ebuild" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  cp -rp ${AWDIR}/assets/touchcal* assets
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (
    cd assets







|







 







>
>
>







 







>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
...
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
...
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
....
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
....
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
SUBDIRS="${SUBDIRS} tkhtml dbus-tcl dbus-intf tclx libdmtx ZBar zint"
SUBDIRS="${SUBDIRS} tcl-augeas snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf libsocketcan tclcan vu"
SUBDIRS="${SUBDIRS} rl_json mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler snap7 libmodbus fswatch"
SUBDIRS="${SUBDIRS} tserialport topcua parse_args tkvlc tclJBlend"
SUBDIRS="${SUBDIRS} tcl-fuse Tix openjpeg imgjp2"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;
      libwebsockets)
        rm -f ${i}/build/build-stamp
	;;
      openjpeg)
        rm -f ${i}/build/build-stamp
	;;
      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
          if test "$ACTION" = "distclean" ; then
            rm -rf libwebsockets/build
          else
            make -C libwebsockets/build ${ACTION} || true
          fi
        ) || true
        ;;
      openjpeg)
        (
          exec >> build.log 2>&1
          if test "$ACTION" = "distclean" ; then
            rm -rf openjpeg/build
          else
            make -C openjpeg/build ${ACTION} || true
          fi
        ) || true
        ;;
      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
  rm ${HERE}/sdl2tk/sdl/tkConfig.sh
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build openjpeg (static, pic) ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  mkdir -p openjpeg/build
  cd openjpeg/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
    -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra -DBUILD_SHARED_LIBS:bool=off \
    -DBUILD_PKGCONFIG_FILES=on -DOPJ_USE_THREAD:bool=off || exit 1
  make VERBOSE=1 COLOR=0 openjp2/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_compress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_decompress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_dump/fast || exit 1
  make VERBOSE=1 COLOR=0 install/fast || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build imgjp2 ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  cd imgjp2
  test -e build-stamp && echo >&3 "already done" && exit 0
  PKG_CONFIG_PATH=${PFX_HERE}/extra/lib/pkgconfig DESTDIR=${HERE} \
    ./configure --prefix=${PFX} --build=i586-linux-gnu \
      --with-tcl=${HERE}/tcl/unix --with-tk=${HERE}/sdl2tk/sdl \
      --enable-threads || exit 1
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/sdl2wish* \
................................................................................
  cp -rp ${PFX_HERE}/lib/topcua* assets
  cp -rp ${PFX_HERE}/lib/parse_args* assets
  cp -rp ${PFX_HERE}/lib/tkvlc* assets
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  cp -rp ${PFX_HERE}/lib/fuse* assets
  cp -rp ${PFX_HERE}/lib/Tix* assets
  cp -rp ${PFX_HERE}/lib/imgjp2* assets
  if test "$ACTION" != "ebuild" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  cp -rp ${AWDIR}/assets/touchcal* assets
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (
    cd assets

Changes to undroid/build-undroidwish-linux64.sh.

91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
...
140
141
142
143
144
145
146



147
148
149
150
151
152
153
...
269
270
271
272
273
274
275










276
277
278
279
280
281
282
....
1667
1668
1669
1670
1671
1672
1673



































1674
1675
1676
1677
1678
1679
1680
....
1815
1816
1817
1818
1819
1820
1821

1822
1823
1824
1825
1826
1827
1828
SUBDIRS="${SUBDIRS} tkhtml dbus-tcl dbus-intf tclx libdmtx ZBar zint"
SUBDIRS="${SUBDIRS} tcl-augeas snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf libsocketcan tclcan vu"
SUBDIRS="${SUBDIRS} rl_json mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler snap7 libmodbus fswatch"
SUBDIRS="${SUBDIRS} tserialport topcua parse_args tkvlc tclJBlend"
SUBDIRS="${SUBDIRS} tcl-fuse Tix"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;
      libwebsockets)
        rm -f ${i}/build/build-stamp
	;;



      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
          if test "$ACTION" = "distclean" ; then
            rm -rf libwebsockets/build
          else
            make -C libwebsockets/build ${ACTION} || true
          fi
        ) || true
        ;;










      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
  rm ${HERE}/sdl2tk/sdl/tkConfig.sh
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail




































echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/sdl2wish* \
................................................................................
  cp -rp ${PFX_HERE}/lib/topcua* assets
  cp -rp ${PFX_HERE}/lib/parse_args* assets
  cp -rp ${PFX_HERE}/lib/tkvlc* assets
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  cp -rp ${PFX_HERE}/lib/fuse* assets
  cp -rp ${PFX_HERE}/lib/Tix* assets

  if test "$ACTION" != "ebuild" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  cp -rp ${AWDIR}/assets/touchcal* assets
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (
    cd assets







|







 







>
>
>







 







>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
...
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
...
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
....
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
....
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
SUBDIRS="${SUBDIRS} tkhtml dbus-tcl dbus-intf tclx libdmtx ZBar zint"
SUBDIRS="${SUBDIRS} tcl-augeas snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf libsocketcan tclcan vu"
SUBDIRS="${SUBDIRS} rl_json mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler snap7 libmodbus fswatch"
SUBDIRS="${SUBDIRS} tserialport topcua parse_args tkvlc tclJBlend"
SUBDIRS="${SUBDIRS} tcl-fuse Tix openjpeg imgjp2"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;
      libwebsockets)
        rm -f ${i}/build/build-stamp
	;;
      openjpeg)
        rm -f ${i}/build/build-stamp
	;;
      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
          if test "$ACTION" = "distclean" ; then
            rm -rf libwebsockets/build
          else
            make -C libwebsockets/build ${ACTION} || true
          fi
        ) || true
        ;;
      openjpeg)
        (
          exec >> build.log 2>&1
          if test "$ACTION" = "distclean" ; then
            rm -rf openjpeg/build
          else
            make -C openjpeg/build ${ACTION} || true
          fi
        ) || true
        ;;
      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
  rm ${HERE}/sdl2tk/sdl/tkConfig.sh
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build openjpeg (static, pic) ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  mkdir -p openjpeg/build
  cd openjpeg/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
    -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra -DBUILD_SHARED_LIBS:bool=off \
    -DBUILD_PKGCONFIG_FILES=on -DOPJ_USE_THREAD:bool=off || exit 1
  make VERBOSE=1 COLOR=0 openjp2/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_compress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_decompress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_dump/fast || exit 1
  make VERBOSE=1 COLOR=0 install/fast || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build imgjp2 ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  cd imgjp2
  test -e build-stamp && echo >&3 "already done" && exit 0
  PKG_CONFIG_PATH=${PFX_HERE}/extra/lib/pkgconfig DESTDIR=${HERE} \
    ./configure --prefix=${PFX} --build=x86_64-linux-gnu \
      --with-tcl=${HERE}/tcl/unix --with-tk=${HERE}/sdl2tk/sdl \
      --enable-threads || exit 1
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/sdl2wish* \
................................................................................
  cp -rp ${PFX_HERE}/lib/topcua* assets
  cp -rp ${PFX_HERE}/lib/parse_args* assets
  cp -rp ${PFX_HERE}/lib/tkvlc* assets
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  cp -rp ${PFX_HERE}/lib/fuse* assets
  cp -rp ${PFX_HERE}/lib/Tix* assets
  cp -rp ${PFX_HERE}/lib/imgjp2* assets
  if test "$ACTION" != "ebuild" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  cp -rp ${AWDIR}/assets/touchcal* assets
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (
    cd assets

Changes to undroid/build-undroidwish-wayland.sh.

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
139
140
141
142
143
144
145



146
147
148
149
150
151
152
...
268
269
270
271
272
273
274










275
276
277
278
279
280
281
....
1620
1621
1622
1623
1624
1625
1626


































1627
1628
1629
1630
1631
1632
1633
....
1768
1769
1770
1771
1772
1773
1774

1775
1776
1777
1778
1779
1780
1781
SUBDIRS="${SUBDIRS} tkhtml dbus-tcl dbus-intf tclx libdmtx ZBar zint"
SUBDIRS="${SUBDIRS} tcl-augeas snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf libsocketcan tclcan vu"
SUBDIRS="${SUBDIRS} rl_json mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler snap7 libmodbus fswatch"
SUBDIRS="${SUBDIRS} tserialport topcua parse_args tkvlc tclJBlend"
SUBDIRS="${SUBDIRS} tcl-fuse Tix"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;
      libwebsockets)
        rm -f ${i}/build/build-stamp
	;;



      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
          if test "$ACTION" = "distclean" ; then
            rm -rf libwebsockets/build
          else
            make -C libwebsockets/build ${ACTION} || true
          fi
        ) || true
        ;;










      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
  rm ${HERE}/sdl2tk/sdl/tkConfig.sh
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail



































echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/sdl2wish* \
................................................................................
  cp -rp ${PFX_HERE}/lib/topcua* assets
  cp -rp ${PFX_HERE}/lib/parse_args* assets
  cp -rp ${PFX_HERE}/lib/tkvlc* assets
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  cp -rp ${PFX_HERE}/lib/fuse* assets
  cp -rp ${PFX_HERE}/lib/Tix* assets

  if test "$ACTION" != "ebuild" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  cp -rp ${AWDIR}/assets/touchcal* assets
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (
    cd assets







|







 







>
>
>







 







>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
...
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
....
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
....
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
SUBDIRS="${SUBDIRS} tkhtml dbus-tcl dbus-intf tclx libdmtx ZBar zint"
SUBDIRS="${SUBDIRS} tcl-augeas snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf libsocketcan tclcan vu"
SUBDIRS="${SUBDIRS} rl_json mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler snap7 libmodbus fswatch"
SUBDIRS="${SUBDIRS} tserialport topcua parse_args tkvlc tclJBlend"
SUBDIRS="${SUBDIRS} tcl-fuse Tix openjpeg imgjp2"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;
      libwebsockets)
        rm -f ${i}/build/build-stamp
	;;
      openjpeg)
        rm -f ${i}/build/build-stamp
	;;
      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
          if test "$ACTION" = "distclean" ; then
            rm -rf libwebsockets/build
          else
            make -C libwebsockets/build ${ACTION} || true
          fi
        ) || true
        ;;
      openjpeg)
        (
          exec >> build.log 2>&1
          if test "$ACTION" = "distclean" ; then
            rm -rf openjpeg/build
          else
            make -C openjpeg/build ${ACTION} || true
          fi
        ) || true
        ;;
      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
  rm ${HERE}/sdl2tk/sdl/tkConfig.sh
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build openjpeg (static, pic) ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  mkdir -p openjpeg/build
  cd openjpeg/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
    -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra -DBUILD_SHARED_LIBS:bool=off \
    -DBUILD_PKGCONFIG_FILES=on -DOPJ_USE_THREAD:bool=off || exit 1
  make VERBOSE=1 COLOR=0 openjp2/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_compress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_decompress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_dump/fast || exit 1
  make VERBOSE=1 COLOR=0 install/fast || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build imgjp2 ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  cd imgjp2
  test -e build-stamp && echo >&3 "already done" && exit 0
  PKG_CONFIG_PATH=${PFX_HERE}/extra/lib/pkgconfig DESTDIR=${HERE} \
    ./configure --prefix=${PFX} --with-tcl=${HERE}/tcl/unix \
      --with-tk=${HERE}/sdl2tk/sdl --enable-threads || exit 1
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/sdl2wish* \
................................................................................
  cp -rp ${PFX_HERE}/lib/topcua* assets
  cp -rp ${PFX_HERE}/lib/parse_args* assets
  cp -rp ${PFX_HERE}/lib/tkvlc* assets
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  cp -rp ${PFX_HERE}/lib/fuse* assets
  cp -rp ${PFX_HERE}/lib/Tix* assets
  cp -rp ${PFX_HERE}/lib/imgjp2* assets
  if test "$ACTION" != "ebuild" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  cp -rp ${AWDIR}/assets/touchcal* assets
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (
    cd assets

Changes to undroid/build-vanilla-generic.sh.

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
...
148
149
150
151
152
153
154



155
156
157
158
159
160
161
...
270
271
272
273
274
275
276










277
278
279
280
281
282
283
....
1599
1600
1601
1602
1603
1604
1605



































1606
1607
1608
1609
1610
1611
1612
....
1766
1767
1768
1769
1770
1771
1772

1773
1774
1775
1776
1777
1778
1779
  SUBDIRS="${SUBDIRS} libsocketcan tclcan fswatch tserialport tcl-fuse"
fi

if pkg-config --exists webkit2gtk-4.0 ; then
  SUBDIRS="${SUBDIRS} twv"
fi

SUBDIRS="${SUBDIRS} topcua parse_args tkvlc tclJBlend Tix"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      mpexpr)
        rm -f ${i}/unix/build-stamp
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;



      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
        ;;
      snap7)
        (
          exec >> build.log 2>&1
          make -C snap7/build/unix -f unix.mk clean || true
        ) || true
        ;;










      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
    Makefile
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail




































echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/wish* ${PFX_HERE}/lib/*.so \
................................................................................
    cp -rp ${PFX_HERE}/lib/fuse* assets
  fi
  if test -d ${PFX_HERE}/lib/twv* ; then
    cp -rp ${PFX_HERE}/lib/twv* assets
    cp -rp ${AWDIR}/undroid/tsb* assets
  fi
  cp -rp ${PFX_HERE}/lib/Tix* assets

  # add stripped down TDK
  cp -rp ${AWDIR}/undroid/TDK assets
  if test "$(uname -o)" = "GNU/Linux" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (







|







 







>
>
>







 







>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
...
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
...
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
....
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
....
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
  SUBDIRS="${SUBDIRS} libsocketcan tclcan fswatch tserialport tcl-fuse"
fi

if pkg-config --exists webkit2gtk-4.0 ; then
  SUBDIRS="${SUBDIRS} twv"
fi

SUBDIRS="${SUBDIRS} topcua parse_args tkvlc tclJBlend Tix openjpeg imgjp2"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      mpexpr)
        rm -f ${i}/unix/build-stamp
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;
      openjpeg)
        rm -f ${i}/build/build-stamp
	;;
      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
        ;;
      snap7)
        (
          exec >> build.log 2>&1
          make -C snap7/build/unix -f unix.mk clean || true
        ) || true
        ;;
      openjpeg)
        (
          exec >> build.log 2>&1
          if test "$ACTION" = "distclean" ; then
            rm -rf openjpeg/build
          else
            make -C openjpeg/build ${ACTION} || true
          fi
        ) || true
        ;;
      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
    Makefile
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build openjpeg (static, pic) ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  mkdir -p openjpeg/build
  cd openjpeg/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
    -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra -DBUILD_SHARED_LIBS:bool=off \
    -DBUILD_PKGCONFIG_FILES=on -DOPJ_USE_THREAD:bool=off || exit 1
  make VERBOSE=1 COLOR=0 openjp2/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_compress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_decompress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_dump/fast || exit 1
  make VERBOSE=1 COLOR=0 install/fast || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build imgjp2 ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  cd imgjp2
  test -e build-stamp && echo >&3 "already done" && exit 0
  PKG_CONFIG_PATH=${PFX_HERE}/extra/lib/pkgconfig DESTDIR=${HERE} \
    ./configure --prefix=${PFX} \
      --with-tcl=${HERE}/tcl/unix --with-tk=${HERE}/sdl2tk/unix \
      --enable-threads || exit 1
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/wish* ${PFX_HERE}/lib/*.so \
................................................................................
    cp -rp ${PFX_HERE}/lib/fuse* assets
  fi
  if test -d ${PFX_HERE}/lib/twv* ; then
    cp -rp ${PFX_HERE}/lib/twv* assets
    cp -rp ${AWDIR}/undroid/tsb* assets
  fi
  cp -rp ${PFX_HERE}/lib/Tix* assets
  cp -rp ${PFX_HERE}/lib/imgjp2* assets
  # add stripped down TDK
  cp -rp ${AWDIR}/undroid/TDK assets
  if test "$(uname -o)" = "GNU/Linux" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (

Changes to undroid/build-vanilla-linux32.sh.

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
137
138
139
140
141
142
143



144
145
146
147
148
149
150
...
259
260
261
262
263
264
265










266
267
268
269
270
271
272
....
1586
1587
1588
1589
1590
1591
1592



































1593
1594
1595
1596
1597
1598
1599
....
1738
1739
1740
1741
1742
1743
1744

1745
1746
1747
1748
1749
1750
1751
SUBDIRS="${SUBDIRS} dbus-tcl dbus-intf tclx libdmtx ZBar zint"
SUBDIRS="${SUBDIRS} tcl-augeas tktray snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf libsocketcan tclcan vu"
SUBDIRS="${SUBDIRS} rl_json tkdnd mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler snap7 libmodbus fswatch"
SUBDIRS="${SUBDIRS} tserialport topcua parse_args tkvlc tclJBlend"
SUBDIRS="${SUBDIRS} tcl-fuse twv Tix"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      mpexpr)
        rm -f ${i}/unix/build-stamp
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;



      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
        ;;
      snap7)
        (
          exec >> build.log 2>&1
          make -C snap7/build/unix -f unix.mk clean || true
        ) || true
        ;;










      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
    Makefile
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail




































echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/wish* ${PFX_HERE}/lib/*.so \
................................................................................
  cp -rp ${PFX_HERE}/lib/tkvlc* assets
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  cp -rp ${PFX_HERE}/lib/fuse* assets
  cp -rp ${PFX_HERE}/lib/twv* assets
  cp -rp ${AWDIR}/undroid/tsb* assets
  cp -rp ${PFX_HERE}/lib/Tix* assets

  # add stripped down TDK
  cp -rp ${AWDIR}/undroid/TDK assets
  if test "$ACTION" != "ebuild" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (







|







 







>
>
>







 







>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
...
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
....
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
....
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
SUBDIRS="${SUBDIRS} dbus-tcl dbus-intf tclx libdmtx ZBar zint"
SUBDIRS="${SUBDIRS} tcl-augeas tktray snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf libsocketcan tclcan vu"
SUBDIRS="${SUBDIRS} rl_json tkdnd mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler snap7 libmodbus fswatch"
SUBDIRS="${SUBDIRS} tserialport topcua parse_args tkvlc tclJBlend"
SUBDIRS="${SUBDIRS} tcl-fuse twv Tix openjpeg imgjp2"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      mpexpr)
        rm -f ${i}/unix/build-stamp
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;
      openjpeg)
        rm -f ${i}/build/build-stamp
	;;
      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
        ;;
      snap7)
        (
          exec >> build.log 2>&1
          make -C snap7/build/unix -f unix.mk clean || true
        ) || true
        ;;
      openjpeg)
        (
          exec >> build.log 2>&1
          if test "$ACTION" = "distclean" ; then
            rm -rf openjpeg/build
          else
            make -C openjpeg/build ${ACTION} || true
          fi
        ) || true
        ;;
      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
    Makefile
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build openjpeg (static, pic) ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  mkdir -p openjpeg/build
  cd openjpeg/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
    -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra -DBUILD_SHARED_LIBS:bool=off \
    -DBUILD_PKGCONFIG_FILES=on -DOPJ_USE_THREAD:bool=off || exit 1
  make VERBOSE=1 COLOR=0 openjp2/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_compress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_decompress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_dump/fast || exit 1
  make VERBOSE=1 COLOR=0 install/fast || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build imgjp2 ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  cd imgjp2
  test -e build-stamp && echo >&3 "already done" && exit 0
  PKG_CONFIG_PATH=${PFX_HERE}/extra/lib/pkgconfig DESTDIR=${HERE} \
    ./configure --prefix=${PFX} --build=i586-linux-gnu \
      --with-tcl=${HERE}/tcl/unix --with-tk=${HERE}/sdl2tk/unix \
      --enable-threads || exit 1
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/wish* ${PFX_HERE}/lib/*.so \
................................................................................
  cp -rp ${PFX_HERE}/lib/tkvlc* assets
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  cp -rp ${PFX_HERE}/lib/fuse* assets
  cp -rp ${PFX_HERE}/lib/twv* assets
  cp -rp ${AWDIR}/undroid/tsb* assets
  cp -rp ${PFX_HERE}/lib/Tix* assets
  cp -rp ${PFX_HERE}/lib/imgjp2* assets
  # add stripped down TDK
  cp -rp ${AWDIR}/undroid/TDK assets
  if test "$ACTION" != "ebuild" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (

Changes to undroid/build-vanilla-linux64.sh.

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
137
138
139
140
141
142
143



144
145
146
147
148
149
150
...
259
260
261
262
263
264
265










266
267
268
269
270
271
272
....
1586
1587
1588
1589
1590
1591
1592



































1593
1594
1595
1596
1597
1598
1599
....
1738
1739
1740
1741
1742
1743
1744

1745
1746
1747
1748
1749
1750
1751
SUBDIRS="${SUBDIRS} dbus-tcl dbus-intf tclx libdmtx ZBar zint"
SUBDIRS="${SUBDIRS} tcl-augeas tktray snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf libsocketcan tclcan vu"
SUBDIRS="${SUBDIRS} rl_json tkdnd mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler snap7 libmodbus fswatch"
SUBDIRS="${SUBDIRS} tserialport topcua parse_args tkvlc tclJBlend"
SUBDIRS="${SUBDIRS} tcl-fuse twv Tix"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      mpexpr)
        rm -f ${i}/unix/build-stamp
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;



      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
        ;;
      snap7)
        (
          exec >> build.log 2>&1
          make -C snap7/build/unix -f unix.mk clean || true
        ) || true
        ;;










      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
    Makefile
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail




































echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/wish* ${PFX_HERE}/lib/*.so \
................................................................................
  cp -rp ${PFX_HERE}/lib/tkvlc* assets
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  cp -rp ${PFX_HERE}/lib/fuse* assets
  cp -rp ${PFX_HERE}/lib/twv* assets
  cp -rp ${AWDIR}/undroid/tsb* assets
  cp -rp ${PFX_HERE}/lib/Tix* assets

  # add stripped down TDK
  cp -rp ${AWDIR}/undroid/TDK assets
  if test "$ACTION" != "ebuild" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (







|







 







>
>
>







 







>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
...
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
....
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
....
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
SUBDIRS="${SUBDIRS} dbus-tcl dbus-intf tclx libdmtx ZBar zint"
SUBDIRS="${SUBDIRS} tcl-augeas tktray snack tkvnc tksvg VecTcl tclral"
SUBDIRS="${SUBDIRS} tclepeg tcluvc xotcl nsf libsocketcan tclcan vu"
SUBDIRS="${SUBDIRS} rl_json tkdnd mpexpr"
SUBDIRS="${SUBDIRS} tclcsv tkzinc libffi ffidl tcl-lmdb DiffUtilTcl"
SUBDIRS="${SUBDIRS} tclparser tclcompiler snap7 libmodbus fswatch"
SUBDIRS="${SUBDIRS} tserialport topcua parse_args tkvlc tclJBlend"
SUBDIRS="${SUBDIRS} tcl-fuse twv Tix openjpeg imgjp2"

ACTION="$1"
if test -z "$ACTION" ; then
  ACTION=build
fi

clean_build_stamps() {
................................................................................
        ;;
      mpexpr)
        rm -f ${i}/unix/build-stamp
        ;;
      snap7)
        rm -f ${i}/build/unix/build-stamp
        ;;
      openjpeg)
        rm -f ${i}/build/build-stamp
	;;
      *)
        rm -f ${i}/build-stamp
        ;;
     esac
  done
}

................................................................................
        ;;
      snap7)
        (
          exec >> build.log 2>&1
          make -C snap7/build/unix -f unix.mk clean || true
        ) || true
        ;;
      openjpeg)
        (
          exec >> build.log 2>&1
          if test "$ACTION" = "distclean" ; then
            rm -rf openjpeg/build
          else
            make -C openjpeg/build ${ACTION} || true
          fi
        ) || true
        ;;
      *)
        (
          exec >> build.log 2>&1
          make -C $i ${ACTION} || true
        ) || true
        ;;
     esac
................................................................................
    Makefile
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  cp -rp demos ${PFX_HERE}/lib/Tix*
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build openjpeg (static, pic) ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  mkdir -p openjpeg/build
  cd openjpeg/build
  test -e build-stamp && echo >&3 "already done" && exit 0
  cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
    -DCMAKE_INSTALL_PREFIX=${PFX_HERE}/extra -DBUILD_SHARED_LIBS:bool=off \
    -DBUILD_PKGCONFIG_FILES=on -DOPJ_USE_THREAD:bool=off || exit 1
  make VERBOSE=1 COLOR=0 openjp2/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_compress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_decompress/fast || exit 1
  make VERBOSE=1 COLOR=0 opj_dump/fast || exit 1
  make VERBOSE=1 COLOR=0 install/fast || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "build imgjp2 ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  cd imgjp2
  test -e build-stamp && echo >&3 "already done" && exit 0
  PKG_CONFIG_PATH=${PFX_HERE}/extra/lib/pkgconfig DESTDIR=${HERE} \
    ./configure --prefix=${PFX} --build=x86_64-linux-gnu \
      --with-tcl=${HERE}/tcl/unix --with-tk=${HERE}/sdl2tk/unix \
      --enable-threads || exit 1
  make || exit 1
  make install-binaries install-libraries DESTDIR=${HERE} || exit 1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "strip binaries ... "
(
  exec 3>&1
  exec >> build.log 2>&1
  set -x
  $STRIP ${PFX_HERE}/bin/tclsh* ${PFX_HERE}/bin/wish* ${PFX_HERE}/lib/*.so \
................................................................................
  cp -rp ${PFX_HERE}/lib/tkvlc* assets
  cp -rp ${PFX_HERE}/lib/tclJBlend* assets
  cp -rp ${AWDIR}/assets/tdbcjdbc* assets
  cp -rp ${PFX_HERE}/lib/fuse* assets
  cp -rp ${PFX_HERE}/lib/twv* assets
  cp -rp ${AWDIR}/undroid/tsb* assets
  cp -rp ${PFX_HERE}/lib/Tix* assets
  cp -rp ${PFX_HERE}/lib/imgjp2* assets
  # add stripped down TDK
  cp -rp ${AWDIR}/undroid/TDK assets
  if test "$ACTION" != "ebuild" ; then
    cp -rp ${AWDIR}/undroid/mkappimg assets
  fi
  # add shortcuts providing builtin:widget, builtin:tksqlite, etc.
  (

Changes to undroid/libwebsockets/test-server/fuzxy.c.

255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
		"0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x32, "
		"0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x0d, 0x0a, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, "
		"0x3a, 0x20, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, "
		"0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x0d, 0x0a, (2048){ 0x0d, 0x0a}"
	  }, { 0, 4 }, 1 },
};

static const int ring_size(struct ring *r)
{
	return sizeof(r->buf);
}
static const int ring_used(struct ring *r)
{
	return (r->head - r->tail) & (ring_size(r) - 1);
}
static const int ring_free(struct ring *r)
{
	return (ring_size(r) - 1) - ring_used(r);
}
static const int ring_get_one(struct ring *r)
{
	int n = r->buf[r->tail] & 255;

	if (r->tail == r->head)
		return -1;

	r->tail++;







|



|



|



|







255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
		"0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x32, "
		"0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x0d, 0x0a, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, "
		"0x3a, 0x20, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, "
		"0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x0d, 0x0a, (2048){ 0x0d, 0x0a}"
	  }, { 0, 4 }, 1 },
};

static int ring_size(struct ring *r)
{
	return sizeof(r->buf);
}
static int ring_used(struct ring *r)
{
	return (r->head - r->tail) & (ring_size(r) - 1);
}
static int ring_free(struct ring *r)
{
	return (ring_size(r) - 1) - ring_used(r);
}
static int ring_get_one(struct ring *r)
{
	int n = r->buf[r->tail] & 255;

	if (r->tail == r->head)
		return -1;

	r->tail++;