The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/libsodium/dist-build/generate-emscripten-symbols.sh

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #! /bin/sh
    2 
    3 set -e
    4 
    5 symbols() {
    6   {
    7     SUMO="$1"
    8     while read symbol standard sumo; do
    9       found="$standard"
   10       if [ "x$SUMO" = "xsumo" ]; then
   11         found="$sumo"
   12       fi
   13       if [ "$found" = "1" ]; then
   14         eval "defined_${symbol}=yes"
   15       else
   16         eval "defined_${symbol}=no"
   17       fi
   18     done < emscripten-symbols.def
   19 
   20     nm /usr/local/lib/libsodium.23.dylib | \
   21     fgrep ' T _' | \
   22     cut -d' ' -f3 | {
   23       while read symbol; do
   24         eval "found=\$defined_${symbol}"
   25         if [ "$found" = "yes" ]; then
   26           echo "$symbol"
   27         elif [ "$found" != "no" ]; then
   28           echo >&2
   29           echo "*** [$symbol] was not expected ***" >&2
   30           echo >&2
   31           exit 1
   32         fi
   33       done
   34     }
   35   } | \
   36     sort | \
   37     {
   38       out='"_malloc","_free"'
   39       while read symbol ; do
   40         if [ ! -z "$out" ]; then
   41           out="${out},"
   42         fi
   43         out="${out}\"${symbol}\""
   44       done
   45       echo "[${out}]"
   46     }
   47 }
   48 
   49 out=$(symbols standard)
   50 sed s/EXPORTED_FUNCTIONS_STANDARD=\'.*\'/EXPORTED_FUNCTIONS_STANDARD=\'${out}\'/ < emscripten.sh > emscripten.sh.tmp && \
   51   mv -f emscripten.sh.tmp emscripten.sh
   52 
   53 out=$(symbols sumo)
   54 sed s/EXPORTED_FUNCTIONS_SUMO=\'.*\'/EXPORTED_FUNCTIONS_SUMO=\'${out}\'/ < emscripten.sh > emscripten.sh.tmp && \
   55   mv -f emscripten.sh.tmp emscripten.sh
   56 
   57 chmod +x emscripten.sh

Cache object: 0c6399da4ad009ad619220d5027809ef


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.