@@ -31,6 +31,7 @@ while [ $# -gt 0 ]; do
3131 shift
3232done
3333
34+ ENTRYPWD=` pwd`
3435DIST=` pwd` /dist
3536DISTSRCSEP=$DIST /src-separate
3637DISTSRCCOM=$DIST /src
@@ -56,6 +57,7 @@ rm -rf $DIST
5657mkdir $DIST
5758mkdir $DIST /src-separate
5859mkdir $DIST /src
60+ mkdir $DIST /config
5961mkdir $DIST /extras
6062mkdir $DIST /polyfills
6163# mkdir $DIST/doc
@@ -76,6 +78,7 @@ mkdir $DIST/examples/alloc-torture
7678mkdir $DIST /examples/alloc-hybrid
7779mkdir $DIST /examples/debug-trans-socket
7880mkdir $DIST /examples/codepage-conv
81+ mkdir $DIST /examples/dummy-date-provider
7982
8083# Copy most files directly
8184
@@ -98,6 +101,8 @@ for i in \
98101 duk_bi_boolean.c \
99102 duk_bi_buffer.c \
100103 duk_bi_date.c \
104+ duk_bi_date_unix.c \
105+ duk_bi_date_windows.c \
101106 duk_bi_duktape.c \
102107 duk_bi_error.c \
103108 duk_bi_function.c \
@@ -200,6 +205,21 @@ for i in \
200205 cp src/$i $DISTSRCSEP /
201206done
202207
208+ cd $ENTRYPWD /config
209+ tar cfz $DIST /config/genconfig_metadata.tar.gz \
210+ tags.yaml \
211+ feature-options \
212+ config-options \
213+ header-snippets \
214+ other-defines
215+ cd $ENTRYPWD
216+ for i in \
217+ README.rst \
218+ genconfig.py \
219+ ; do
220+ cp config/$i $DIST /config/
221+ done
222+
203223for i in \
204224 README.rst \
205225 Makefile \
@@ -349,6 +369,13 @@ for i in \
349369 cp examples/codepage-conv/$i $DIST /examples/codepage-conv/
350370done
351371
372+ for i in \
373+ README.rst \
374+ dummy_date_provider.c \
375+ ; do
376+ cp examples/dummy-date-provider/$i $DIST /examples/dummy-date-provider/
377+ done
378+
352379cp extras/README.rst $DIST /extras/
353380# XXX: copy extras
354381
@@ -395,6 +422,23 @@ echo '/*' > $DIST/AUTHORS.rst.tmp
395422cat AUTHORS.rst | python util/make_ascii.py | sed -e ' s/^/ \* /' >> $DIST /AUTHORS.rst.tmp
396423echo ' */' >> $DIST /AUTHORS.rst.tmp
397424
425+ # Build duk_config.h from snippets using genconfig.
426+ python config/genconfig.py --metadata config --output $DIST /duk_config.h.tmp \
427+ generate-autodetect-header
428+ cp $DIST /duk_config.h.tmp $DISTSRCCOM /duk_config.h
429+ cp $DIST /duk_config.h.tmp $DISTSRCSEP /duk_config.h
430+ cp $DIST /duk_config.h.tmp $DIST /config/duk_config.h-autodetect
431+
432+ # Generate a few barebones config examples
433+ python config/genconfig.py --metadata config --emit-legacy-feature-check --emit-config-sanity-check --omit-removed-config-options --omit-unused-config-options \
434+ --output $DIST /config/duk_config.h-linux-gcc-x64 \
435+ --platform linux --compiler gcc --architecture x64 \
436+ generate-barebones-header
437+ python config/genconfig.py --metadata config --emit-legacy-feature-check --emit-config-sanity-check --omit-removed-config-options --omit-unused-config-options \
438+ --output $DIST /config/duk_config.h-linux-gcc-x86 \
439+ --platform linux --compiler gcc --architecture x86 \
440+ generate-barebones-header
441+
398442# Build duktape.h from parts, with some git-related replacements.
399443# The only difference between single and separate file duktape.h
400444# is the internal DUK_SINGLE_FILE define.
@@ -415,18 +459,10 @@ cat src/duktape.h.in | sed -e '
415459 r dist/AUTHORS.rst.tmp
416460 d
417461}
418- /^@DUK_FEATURES_H@$/ {
419- r src/duk_features.h.in
420- d
421- }
422462/^@DUK_API_PUBLIC_H@$/ {
423463 r src/duk_api_public.h.in
424464 d
425465}
426- /^@DUK_FEATURES_SANITY_H@$/ {
427- r src/duk_features_sanity.h.in
428- d
429- }
430466/^@DUK_DBLUNION_H@$/ {
431467 r src/duk_dblunion.h.in
432468 d
@@ -737,13 +773,13 @@ done
737773rm $DISTSRCSEP /caseconv.txt
738774
739775# Create a combined source file, duktape.c, into a separate combined source
740- # directory. This allows user to just include "duktape.c" and "duktape.h"
741- # into a project and maximizes inlining and size optimization opportunities
742- # even with older compilers. Because some projects include these files into
743- # their repository, the result should be deterministic and diffable. Also,
744- # it must retain __FILE__/__LINE__ behavior through preprocessor directives.
745- # Whitespace and comments can be stripped as long as the other requirements
746- # are met.
776+ # directory. This allows user to just include "duktape.c", "duktape.h", and
777+ # "duk_config.h" into a project and maximizes inlining and size optimization
778+ # opportunities even with older compilers. Because some projects include
779+ # these files into their repository, the result should be deterministic and
780+ # diffable. Also, it must retain __FILE__/__LINE__ behavior through
781+ # preprocessor directives. Whitespace and comments can be stripped as long
782+ # as the other requirements are met.
747783
748784python util/combine_src.py $DISTSRCSEP $DISTSRCCOM /duktape.c \
749785 " $DUK_VERSION " " $GIT_COMMIT " " $GIT_DESCRIBE " \
0 commit comments