servo/etc/jsdefine
author Emilio Cobos Álvarez <emilio@crisal.io>
Tue, 17 Oct 2017 11:37:07 +0200
changeset 437466 da7f10ba43442e258c8ffafbd3b20ae5b2e1f805
parent 381520 011d6feca67a86ea040809de94e51c634766265f
permissions -rwxr-xr-x
Bug 1409079: Simplify WebComponents enabled checks. r=smaug MozReview-Commit-ID: F8WAYvregRu

#!/bin/bash
#
# Handy tool for extracting #defines from jsapi.h.  For example:
#     ./jsdefine %x JSCLASS_GLOBAL_FLAGS
# outputs
#     48000

ETCDIR=$(dirname $0)
JSDIR=${ETCDIR}/../../build/src/mozjs/dist/
INCDIR=${JSDIR}/include
LIBDIR=${JSDIR}/lib

echo > jsdefine.c
echo '#include "jsapi.h"' >> jsdefine.c
echo '' >> jsdefine.c
echo 'int main() {' >> jsdefine.c
echo '    printf(' >> jsdefine.c
echo '      "'"$1"'\n"', >> jsdefine.c
echo "      $2);" >> jsdefine.c
echo '}' >> jsdefine.c

g++ -I ${INCDIR} jsdefine.c -o jsdefine.exe 
./jsdefine.exe