From bea978b4f27373fa9d648a3810237dc885c882ab Mon Sep 17 00:00:00 2001 From: Yahweasel Date: Fri, 27 Sep 2024 23:32:39 -0400 Subject: [PATCH 1/5] Switching to (more modern?) terser --- Makefile | 12 ++--- Makefile.m4 | 6 +-- package-lock.json | 135 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 +- 4 files changed, 145 insertions(+), 11 deletions(-) create mode 100644 package-lock.json diff --git a/Makefile b/Makefile index 5eea87a8..8a3f5c69 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ LIBAVJS_VERSION_BASE=5.4 LIBAVJS_VERSION=$(LIBAVJS_VERSION_BASE).$(FFMPEG_VERSION)$(LIBAVJS_VERSION_SUFFIX) LIBAVJS_VERSION_SHORT=$(LIBAVJS_VERSION_BASE).$(FFMPEG_VERSION_MAJOR) EMCC=emcc -MINIFIER=node_modules/.bin/uglifyjs -m +MINIFIER=node_modules/.bin/terser OPTFLAGS=-Oz NOTHRFLAGS=build/inst/base/lib/libemfiberthreads.a THRFLAGS=-pthread @@ -73,7 +73,7 @@ build-%: \ dist/libav-$(LIBAVJS_VERSION)-%.js: build/libav-$(LIBAVJS_VERSION).js \ dist/libav-$(LIBAVJS_VERSION)-%.wasm.js \ - node_modules/.bin/uglifyjs + node_modules/.bin/terser mkdir -p dist sed "s/@CONFIG/$(*)/g ; s/@DBG//g" < $< | $(MINIFIER) > $(@) @@ -83,7 +83,7 @@ dist/libav-%.js: dist/libav-$(LIBAVJS_VERSION)-%.js dist/libav-$(LIBAVJS_VERSION)-%.mjs: build/libav-$(LIBAVJS_VERSION).mjs \ dist/libav-$(LIBAVJS_VERSION)-%.wasm.mjs \ - node_modules/.bin/uglifyjs + node_modules/.bin/terser mkdir -p dist sed "s/@CONFIG/$(*)/g ; s/@DBG//g" < $< | $(MINIFIER) > $(@) @@ -93,7 +93,7 @@ dist/libav-%.mjs: dist/libav-$(LIBAVJS_VERSION)-%.mjs dist/libav-$(LIBAVJS_VERSION)-%.dbg.js: build/libav-$(LIBAVJS_VERSION).js \ dist/libav-$(LIBAVJS_VERSION)-%.dbg.wasm.js \ - node_modules/.bin/uglifyjs + node_modules/.bin/terser mkdir -p dist sed "s/@CONFIG/$(*)/g ; s/@DBG/.dbg/g" < $< | cat > $(@) @@ -103,7 +103,7 @@ dist/libav-%.dbg.js: dist/libav-$(LIBAVJS_VERSION)-%.dbg.js dist/libav-$(LIBAVJS_VERSION)-%.dbg.mjs: build/libav-$(LIBAVJS_VERSION).mjs \ dist/libav-$(LIBAVJS_VERSION)-%.dbg.wasm.mjs \ - node_modules/.bin/uglifyjs + node_modules/.bin/terser mkdir -p dist sed "s/@CONFIG/$(*)/g ; s/@DBG/.dbg/g" < $< | cat > $(@) @@ -526,7 +526,7 @@ build/libav-$(LIBAVJS_VERSION).js: libav.in.js post.in.js funcs.json tools/apply build/libav.types.d.ts build/libav-$(LIBAVJS_VERSION).mjs build/exports.json build/post.js: build/libav-$(LIBAVJS_VERSION).js touch $@ -node_modules/.bin/uglifyjs: +node_modules/.bin/terser: npm install # Targets diff --git a/Makefile.m4 b/Makefile.m4 index 0be09179..ae38c1e1 100644 --- a/Makefile.m4 +++ b/Makefile.m4 @@ -11,7 +11,7 @@ LIBAVJS_VERSION_BASE=5.4 LIBAVJS_VERSION=$(LIBAVJS_VERSION_BASE).$(FFMPEG_VERSION)$(LIBAVJS_VERSION_SUFFIX) LIBAVJS_VERSION_SHORT=$(LIBAVJS_VERSION_BASE).$(FFMPEG_VERSION_MAJOR) EMCC=emcc -MINIFIER=node_modules/.bin/uglifyjs -m +MINIFIER=node_modules/.bin/terser OPTFLAGS=-Oz NOTHRFLAGS=build/inst/base/lib/libemfiberthreads.a THRFLAGS=-pthread @@ -71,7 +71,7 @@ build-%: \ define([[[febuildrule]]], [[[ dist/libav-$(LIBAVJS_VERSION)-%$1.$2: build/libav-$(LIBAVJS_VERSION).$2 \ dist/libav-$(LIBAVJS_VERSION)-%$1.wasm.$2 \ - node_modules/.bin/uglifyjs + node_modules/.bin/terser mkdir -p dist sed "s/@CONFIG/$(*)/g ; s/@DBG/$1/g" < $< | $3 > $(@) @@ -147,7 +147,7 @@ build/libav-$(LIBAVJS_VERSION).js: libav.in.js post.in.js funcs.json tools/apply build/libav.types.d.ts build/libav-$(LIBAVJS_VERSION).mjs build/exports.json build/post.js: build/libav-$(LIBAVJS_VERSION).js touch $@ -node_modules/.bin/uglifyjs: +node_modules/.bin/terser: npm install # Targets diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..546e7e4d --- /dev/null +++ b/package-lock.json @@ -0,0 +1,135 @@ +{ + "name": "libav.js", + "version": "5.4.6", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "libav.js", + "version": "5.4.6", + "license": "LGPL-2.1", + "devDependencies": { + "terser": "^5.34.1" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/acorn": { + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/terser": { + "version": "5.34.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.34.1.tgz", + "integrity": "sha512-FsJZ7iZLd/BXkz+4xrRTGJ26o/6VTjQytUk8b8OxkwcD2I+79VPJlz7qss1+zE7h8GNIScFqXcDyJ/KqBYZFVA==", + "dev": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + } + } +} diff --git a/package.json b/package.json index 9414522a..095f4622 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,6 @@ }, "homepage": "https://github.com/Yahweasel/libav.js#readme", "devDependencies": { - "fast-xml-parser": "^4.2.2", - "uglify-js": "^3.14.3" + "terser": "^5.34.1" } } From da59e812bee5dd60db4a10089f8945b4a08458c6 Mon Sep 17 00:00:00 2001 From: Yahweasel Date: Fri, 27 Sep 2024 23:33:01 -0400 Subject: [PATCH 2/5] Removing package-lock from gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3c57074e..eb7f0331 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,3 @@ tests/out.webm tests/out.mp4 node_modules/ -package-lock.json From f5841ad54bb2217491666c8f400e20d152a21149 Mon Sep 17 00:00:00 2001 From: Yahweasel Date: Fri, 27 Sep 2024 23:33:31 -0400 Subject: [PATCH 3/5] Once and for all fixing this errno-transfer issue --- extern-post.js | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/extern-post.js b/extern-post.js index 828bdec5..669cd4d5 100644 --- a/extern-post.js +++ b/extern-post.js @@ -48,41 +48,42 @@ if (/* We're in a worker */ var fun = e.data[1]; var args = e.data.slice(2); var ret = void 0; - var transfer = []; var succ = true; + + function reply() { + var transfer = []; + if (ret && ret.libavjsTransfer) + transfer = ret.libavjsTransfer + try { + postMessage([id, fun, succ, ret], transfer); + } catch (ex) { + try { + ret = JSON.parse(JSON.stringify( + ret, function(k, v) { return v; } + )); + postMessage([id, fun, succ, ret], transfer); + } catch (ex) { + postMessage([id, fun, succ, "" + ret]); + } + } + } + try { ret = libav[fun].apply(libav, args); } catch (ex) { succ = false; ret = ex; } - if (succ && typeof ret === "object" && ret !== null && ret.then) { + if (succ && ret && ret.then) { // Let the promise resolve ret.then(function(res) { ret = res; }).catch(function(ex) { succ = false; ret = ex; - }).then(function() { - if (typeof ret === "object" && ret && ret.libavjsTransfer) - transfer = ret.libavjsTransfer; - try { - postMessage([id, fun, succ, ret], transfer); - } catch (ex) { - postMessage([id, fun, succ, "" + ret]); - } - }); + }).then(reply); - } else { - if (typeof ret === "object" && ret && ret.libavjsTransfer) - transfer = ret.libavjsTransfer; - try { - postMessage([id, fun, succ, ret], transfer); - } catch (ex) { - postMessage([id, fun, succ, "" + ret]); - } - - } + } else reply(); }; libav.onwrite = function(name, pos, buf) { From 44fd2dc4ea60018bc1b80cae92241fc359102a34 Mon Sep 17 00:00:00 2001 From: Yahweasel Date: Fri, 27 Sep 2024 23:41:27 -0400 Subject: [PATCH 4/5] Apparently these tests work with threads again --- tests/tests/602-demuxing-block-device.js | 3 --- tests/tests/616-reentrancy.js | 3 --- 2 files changed, 6 deletions(-) diff --git a/tests/tests/602-demuxing-block-device.js b/tests/tests/602-demuxing-block-device.js index 262b2fff..a1ef1f1f 100644 --- a/tests/tests/602-demuxing-block-device.js +++ b/tests/tests/602-demuxing-block-device.js @@ -15,9 +15,6 @@ // Example of directly using a block device -if (h.libAVOpts && h.libAVOpts.yesthreads) - throw new Error("Known bug: test 602 does not work with threads."); - const libav = await h.LibAV(); const buf = await h.readCachedFile("bbb.webm"); diff --git a/tests/tests/616-reentrancy.js b/tests/tests/616-reentrancy.js index 9b4d7f6d..1b943321 100644 --- a/tests/tests/616-reentrancy.js +++ b/tests/tests/616-reentrancy.js @@ -15,9 +15,6 @@ // Check for reentrancy issues by trying to do two files at once -if (h.libAVOpts && h.libAVOpts.yesthreads) - throw new Error("Known bug: test 616 does not work with threads."); - const libav = await h.LibAV(); const buf = await h.readCachedFile("bbb.webm"); From 9508ac6ea9460dc7043b4b861cb9ba64f3cfecf2 Mon Sep 17 00:00:00 2001 From: Yahweasel Date: Sat, 28 Sep 2024 10:18:26 -0400 Subject: [PATCH 5/5] A bit more care in using -l for libs instead of .a --- Makefile | 536 +++++++++++++++++++++++++++++++++++++++++++++++----- Makefile.m4 | 28 ++- 2 files changed, 508 insertions(+), 56 deletions(-) diff --git a/Makefile b/Makefile index 8a3f5c69..3989f9a1 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ LIBAVJS_VERSION_SHORT=$(LIBAVJS_VERSION_BASE).$(FFMPEG_VERSION_MAJOR) EMCC=emcc MINIFIER=node_modules/.bin/terser OPTFLAGS=-Oz -NOTHRFLAGS=build/inst/base/lib/libemfiberthreads.a +NOTHRFLAGS=-Lbuild/inst/base/lib -lemfiberthreads THRFLAGS=-pthread ES6FLAGS=-sEXPORT_ES6=1 -sUSE_ES6_IMPORT_META=1 EFLAGS=\ @@ -115,8 +115,12 @@ dist/libav.types.d.ts: build/libav.types.d.ts mkdir -p dist cp $< $@ +# Link rule that checks for a library's existence before linking it +# Use: linkfflib(library name, target inst name) + + # General build rule for any target -# Use: buildrule(target file name, debug infix, target inst name, CFLAGS, target file suffix) +# Use: buildrule(target file name, debug infix, target inst name, extra link flags, target file suffix) # asm.js version @@ -124,16 +128,52 @@ dist/libav.types.d.ts: build/libav.types.d.ts dist/libav-$(LIBAVJS_VERSION)-%.asm.js: build/ffmpeg-$(FFMPEG_VERSION)/build-base-%/libavformat/libavformat.a \ build/exports.json pre.js build/post.js extern-post.js bindings.c mkdir -p $(@).d - $(EMCC) $(OPTFLAGS) $(EFLAGS) $(NOTHRFLAGS) -s WASM=0 \ + $(EMCC) $(OPTFLAGS) $(EFLAGS) \ -Ibuild/ffmpeg-$(FFMPEG_VERSION) -Ibuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*) \ `test ! -e configs/configs/$(*)/link-flags.txt || cat configs/configs/$(*)/link-flags.txt` \ bindings.c \ `grep LIBAVJS_WITH_CLI configs/configs/$(*)/link-flags.txt > /dev/null 2>&1 && echo ' \ build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/fftools/*.o \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice/libavdevice.a \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice -lavdevice \ '` \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/*/lib*.a \ - `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).asm.js + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil/libavutil.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil -lavutil \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat/libavformat.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat -lavformat \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec/libavcodec.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec -lavcodec \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter/libavfilter.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter -lavfilter \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample/libswresample.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample -lswresample \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale/libswscale.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale -lswscale \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob/libfoob.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob -lfoob \ + '` \ + \ + `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` \ + $(NOTHRFLAGS) -s WASM=0 \ + -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).asm.js if [ -e $(@).d/libav-$(LIBAVJS_VERSION)-$(*).asm.wasm.map ] ; then \ ./tools/adjust-sourcemap.js $(@).d/libav-$(LIBAVJS_VERSION)-$(*).asm.wasm.map \ ffmpeg $(FFMPEG_VERSION) \ @@ -157,16 +197,52 @@ dist/libav-$(LIBAVJS_VERSION)-%.asm.js: build/ffmpeg-$(FFMPEG_VERSION)/build-bas dist/libav-$(LIBAVJS_VERSION)-%.asm.mjs: build/ffmpeg-$(FFMPEG_VERSION)/build-base-%/libavformat/libavformat.a \ build/exports.json pre.js build/post.js extern-post.js bindings.c mkdir -p $(@).d - $(EMCC) $(OPTFLAGS) $(EFLAGS) $(NOTHRFLAGS) $(ES6FLAGS) -s WASM=0 \ + $(EMCC) $(OPTFLAGS) $(EFLAGS) \ -Ibuild/ffmpeg-$(FFMPEG_VERSION) -Ibuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*) \ `test ! -e configs/configs/$(*)/link-flags.txt || cat configs/configs/$(*)/link-flags.txt` \ bindings.c \ `grep LIBAVJS_WITH_CLI configs/configs/$(*)/link-flags.txt > /dev/null 2>&1 && echo ' \ build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/fftools/*.o \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice/libavdevice.a \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice -lavdevice \ '` \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/*/lib*.a \ - `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).asm.mjs + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil/libavutil.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil -lavutil \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat/libavformat.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat -lavformat \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec/libavcodec.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec -lavcodec \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter/libavfilter.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter -lavfilter \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample/libswresample.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample -lswresample \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale/libswscale.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale -lswscale \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob/libfoob.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob -lfoob \ + '` \ + \ + `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` \ + $(NOTHRFLAGS) $(ES6FLAGS) -s WASM=0 \ + -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).asm.mjs if [ -e $(@).d/libav-$(LIBAVJS_VERSION)-$(*).asm.wasm.map ] ; then \ ./tools/adjust-sourcemap.js $(@).d/libav-$(LIBAVJS_VERSION)-$(*).asm.wasm.map \ ffmpeg $(FFMPEG_VERSION) \ @@ -190,16 +266,52 @@ dist/libav-$(LIBAVJS_VERSION)-%.asm.mjs: build/ffmpeg-$(FFMPEG_VERSION)/build-ba dist/libav-$(LIBAVJS_VERSION)-%.dbg.asm.js: build/ffmpeg-$(FFMPEG_VERSION)/build-base-%/libavformat/libavformat.a \ build/exports.json pre.js build/post.js extern-post.js bindings.c mkdir -p $(@).d - $(EMCC) $(OPTFLAGS) $(EFLAGS) $(NOTHRFLAGS) -g2 -s WASM=0 \ + $(EMCC) $(OPTFLAGS) $(EFLAGS) \ -Ibuild/ffmpeg-$(FFMPEG_VERSION) -Ibuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*) \ `test ! -e configs/configs/$(*)/link-flags.txt || cat configs/configs/$(*)/link-flags.txt` \ bindings.c \ `grep LIBAVJS_WITH_CLI configs/configs/$(*)/link-flags.txt > /dev/null 2>&1 && echo ' \ build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/fftools/*.o \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice/libavdevice.a \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice -lavdevice \ '` \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/*/lib*.a \ - `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.asm.js + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil/libavutil.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil -lavutil \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat/libavformat.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat -lavformat \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec/libavcodec.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec -lavcodec \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter/libavfilter.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter -lavfilter \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample/libswresample.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample -lswresample \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale/libswscale.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale -lswscale \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob/libfoob.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob -lfoob \ + '` \ + \ + `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` \ + $(NOTHRFLAGS) -g2 -s WASM=0 \ + -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.asm.js if [ -e $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.asm.wasm.map ] ; then \ ./tools/adjust-sourcemap.js $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.asm.wasm.map \ ffmpeg $(FFMPEG_VERSION) \ @@ -223,16 +335,52 @@ dist/libav-$(LIBAVJS_VERSION)-%.dbg.asm.js: build/ffmpeg-$(FFMPEG_VERSION)/build dist/libav-$(LIBAVJS_VERSION)-%.dbg.asm.mjs: build/ffmpeg-$(FFMPEG_VERSION)/build-base-%/libavformat/libavformat.a \ build/exports.json pre.js build/post.js extern-post.js bindings.c mkdir -p $(@).d - $(EMCC) $(OPTFLAGS) $(EFLAGS) $(NOTHRFLAGS) -g2 $(ES6FLAGS) -s WASM=0 \ + $(EMCC) $(OPTFLAGS) $(EFLAGS) \ -Ibuild/ffmpeg-$(FFMPEG_VERSION) -Ibuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*) \ `test ! -e configs/configs/$(*)/link-flags.txt || cat configs/configs/$(*)/link-flags.txt` \ bindings.c \ `grep LIBAVJS_WITH_CLI configs/configs/$(*)/link-flags.txt > /dev/null 2>&1 && echo ' \ build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/fftools/*.o \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice/libavdevice.a \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice -lavdevice \ '` \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/*/lib*.a \ - `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.asm.mjs + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil/libavutil.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil -lavutil \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat/libavformat.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat -lavformat \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec/libavcodec.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec -lavcodec \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter/libavfilter.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter -lavfilter \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample/libswresample.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample -lswresample \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale/libswscale.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale -lswscale \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob/libfoob.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob -lfoob \ + '` \ + \ + `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` \ + $(NOTHRFLAGS) -g2 $(ES6FLAGS) -s WASM=0 \ + -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.asm.mjs if [ -e $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.asm.wasm.map ] ; then \ ./tools/adjust-sourcemap.js $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.asm.wasm.map \ ffmpeg $(FFMPEG_VERSION) \ @@ -257,16 +405,52 @@ dist/libav-$(LIBAVJS_VERSION)-%.dbg.asm.mjs: build/ffmpeg-$(FFMPEG_VERSION)/buil dist/libav-$(LIBAVJS_VERSION)-%.wasm.js: build/ffmpeg-$(FFMPEG_VERSION)/build-base-%/libavformat/libavformat.a \ build/exports.json pre.js build/post.js extern-post.js bindings.c mkdir -p $(@).d - $(EMCC) $(OPTFLAGS) $(EFLAGS) $(NOTHRFLAGS) \ + $(EMCC) $(OPTFLAGS) $(EFLAGS) \ -Ibuild/ffmpeg-$(FFMPEG_VERSION) -Ibuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*) \ `test ! -e configs/configs/$(*)/link-flags.txt || cat configs/configs/$(*)/link-flags.txt` \ bindings.c \ `grep LIBAVJS_WITH_CLI configs/configs/$(*)/link-flags.txt > /dev/null 2>&1 && echo ' \ build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/fftools/*.o \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice/libavdevice.a \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice -lavdevice \ '` \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/*/lib*.a \ - `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).wasm.js + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil/libavutil.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil -lavutil \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat/libavformat.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat -lavformat \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec/libavcodec.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec -lavcodec \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter/libavfilter.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter -lavfilter \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample/libswresample.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample -lswresample \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale/libswscale.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale -lswscale \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob/libfoob.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob -lfoob \ + '` \ + \ + `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` \ + $(NOTHRFLAGS) \ + -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).wasm.js if [ -e $(@).d/libav-$(LIBAVJS_VERSION)-$(*).wasm.wasm.map ] ; then \ ./tools/adjust-sourcemap.js $(@).d/libav-$(LIBAVJS_VERSION)-$(*).wasm.wasm.map \ ffmpeg $(FFMPEG_VERSION) \ @@ -290,16 +474,52 @@ dist/libav-$(LIBAVJS_VERSION)-%.wasm.js: build/ffmpeg-$(FFMPEG_VERSION)/build-ba dist/libav-$(LIBAVJS_VERSION)-%.wasm.mjs: build/ffmpeg-$(FFMPEG_VERSION)/build-base-%/libavformat/libavformat.a \ build/exports.json pre.js build/post.js extern-post.js bindings.c mkdir -p $(@).d - $(EMCC) $(OPTFLAGS) $(EFLAGS) $(NOTHRFLAGS) $(ES6FLAGS) \ + $(EMCC) $(OPTFLAGS) $(EFLAGS) \ -Ibuild/ffmpeg-$(FFMPEG_VERSION) -Ibuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*) \ `test ! -e configs/configs/$(*)/link-flags.txt || cat configs/configs/$(*)/link-flags.txt` \ bindings.c \ `grep LIBAVJS_WITH_CLI configs/configs/$(*)/link-flags.txt > /dev/null 2>&1 && echo ' \ build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/fftools/*.o \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice/libavdevice.a \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice -lavdevice \ '` \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/*/lib*.a \ - `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).wasm.mjs + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil/libavutil.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil -lavutil \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat/libavformat.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat -lavformat \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec/libavcodec.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec -lavcodec \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter/libavfilter.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter -lavfilter \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample/libswresample.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample -lswresample \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale/libswscale.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale -lswscale \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob/libfoob.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob -lfoob \ + '` \ + \ + `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` \ + $(NOTHRFLAGS) $(ES6FLAGS) \ + -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).wasm.mjs if [ -e $(@).d/libav-$(LIBAVJS_VERSION)-$(*).wasm.wasm.map ] ; then \ ./tools/adjust-sourcemap.js $(@).d/libav-$(LIBAVJS_VERSION)-$(*).wasm.wasm.map \ ffmpeg $(FFMPEG_VERSION) \ @@ -323,16 +543,52 @@ dist/libav-$(LIBAVJS_VERSION)-%.wasm.mjs: build/ffmpeg-$(FFMPEG_VERSION)/build-b dist/libav-$(LIBAVJS_VERSION)-%.dbg.wasm.js: build/ffmpeg-$(FFMPEG_VERSION)/build-base-%/libavformat/libavformat.a \ build/exports.json pre.js build/post.js extern-post.js bindings.c mkdir -p $(@).d - $(EMCC) $(OPTFLAGS) $(EFLAGS) $(NOTHRFLAGS) -gsource-map \ + $(EMCC) $(OPTFLAGS) $(EFLAGS) \ -Ibuild/ffmpeg-$(FFMPEG_VERSION) -Ibuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*) \ `test ! -e configs/configs/$(*)/link-flags.txt || cat configs/configs/$(*)/link-flags.txt` \ bindings.c \ `grep LIBAVJS_WITH_CLI configs/configs/$(*)/link-flags.txt > /dev/null 2>&1 && echo ' \ build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/fftools/*.o \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice/libavdevice.a \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice -lavdevice \ '` \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/*/lib*.a \ - `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.wasm.js + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil/libavutil.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil -lavutil \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat/libavformat.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat -lavformat \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec/libavcodec.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec -lavcodec \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter/libavfilter.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter -lavfilter \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample/libswresample.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample -lswresample \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale/libswscale.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale -lswscale \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob/libfoob.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob -lfoob \ + '` \ + \ + `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` \ + $(NOTHRFLAGS) -gsource-map \ + -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.wasm.js if [ -e $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.wasm.wasm.map ] ; then \ ./tools/adjust-sourcemap.js $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.wasm.wasm.map \ ffmpeg $(FFMPEG_VERSION) \ @@ -356,16 +612,52 @@ dist/libav-$(LIBAVJS_VERSION)-%.dbg.wasm.js: build/ffmpeg-$(FFMPEG_VERSION)/buil dist/libav-$(LIBAVJS_VERSION)-%.dbg.wasm.mjs: build/ffmpeg-$(FFMPEG_VERSION)/build-base-%/libavformat/libavformat.a \ build/exports.json pre.js build/post.js extern-post.js bindings.c mkdir -p $(@).d - $(EMCC) $(OPTFLAGS) $(EFLAGS) $(NOTHRFLAGS) -gsource-map $(ES6FLAGS) \ + $(EMCC) $(OPTFLAGS) $(EFLAGS) \ -Ibuild/ffmpeg-$(FFMPEG_VERSION) -Ibuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*) \ `test ! -e configs/configs/$(*)/link-flags.txt || cat configs/configs/$(*)/link-flags.txt` \ bindings.c \ `grep LIBAVJS_WITH_CLI configs/configs/$(*)/link-flags.txt > /dev/null 2>&1 && echo ' \ build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/fftools/*.o \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice/libavdevice.a \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavdevice -lavdevice \ '` \ - build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/*/lib*.a \ - `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.wasm.mjs + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil/libavutil.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavutil -lavutil \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat/libavformat.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavformat -lavformat \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec/libavcodec.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavcodec -lavcodec \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter/libavfilter.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libavfilter -lavfilter \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample/libswresample.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswresample -lswresample \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale/libswscale.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libswscale -lswscale \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob/libfoob.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-base-$(*)/libfoob -lfoob \ + '` \ + \ + `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/base/' configs/configs/$(*)/libs.txt` \ + $(NOTHRFLAGS) -gsource-map $(ES6FLAGS) \ + -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.wasm.mjs if [ -e $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.wasm.wasm.map ] ; then \ ./tools/adjust-sourcemap.js $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.wasm.wasm.map \ ffmpeg $(FFMPEG_VERSION) \ @@ -390,16 +682,52 @@ dist/libav-$(LIBAVJS_VERSION)-%.dbg.wasm.mjs: build/ffmpeg-$(FFMPEG_VERSION)/bui dist/libav-$(LIBAVJS_VERSION)-%.thr.js: build/ffmpeg-$(FFMPEG_VERSION)/build-thr-%/libavformat/libavformat.a \ build/exports.json pre.js build/post.js extern-post.js bindings.c mkdir -p $(@).d - $(EMCC) $(OPTFLAGS) $(EFLAGS) $(THRFLAGS) -sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency \ + $(EMCC) $(OPTFLAGS) $(EFLAGS) \ -Ibuild/ffmpeg-$(FFMPEG_VERSION) -Ibuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*) \ `test ! -e configs/configs/$(*)/link-flags.txt || cat configs/configs/$(*)/link-flags.txt` \ bindings.c \ `grep LIBAVJS_WITH_CLI configs/configs/$(*)/link-flags.txt > /dev/null 2>&1 && echo ' \ build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/fftools/*.o \ - build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavdevice/libavdevice.a \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavdevice -lavdevice \ '` \ - build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/*/lib*.a \ - `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/thr/' configs/configs/$(*)/libs.txt` -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).thr.js + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavutil/libavutil.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavutil -lavutil \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavformat/libavformat.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavformat -lavformat \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavcodec/libavcodec.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavcodec -lavcodec \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavfilter/libavfilter.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavfilter -lavfilter \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswresample/libswresample.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswresample -lswresample \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswscale/libswscale.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswscale -lswscale \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libfoob/libfoob.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libfoob -lfoob \ + '` \ + \ + `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/thr/' configs/configs/$(*)/libs.txt` \ + $(THRFLAGS) -sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency \ + -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).thr.js if [ -e $(@).d/libav-$(LIBAVJS_VERSION)-$(*).thr.wasm.map ] ; then \ ./tools/adjust-sourcemap.js $(@).d/libav-$(LIBAVJS_VERSION)-$(*).thr.wasm.map \ ffmpeg $(FFMPEG_VERSION) \ @@ -423,16 +751,52 @@ dist/libav-$(LIBAVJS_VERSION)-%.thr.js: build/ffmpeg-$(FFMPEG_VERSION)/build-thr dist/libav-$(LIBAVJS_VERSION)-%.thr.mjs: build/ffmpeg-$(FFMPEG_VERSION)/build-thr-%/libavformat/libavformat.a \ build/exports.json pre.js build/post.js extern-post.js bindings.c mkdir -p $(@).d - $(EMCC) $(OPTFLAGS) $(EFLAGS) $(ES6FLAGS) $(THRFLAGS) -sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency \ + $(EMCC) $(OPTFLAGS) $(EFLAGS) \ -Ibuild/ffmpeg-$(FFMPEG_VERSION) -Ibuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*) \ `test ! -e configs/configs/$(*)/link-flags.txt || cat configs/configs/$(*)/link-flags.txt` \ bindings.c \ `grep LIBAVJS_WITH_CLI configs/configs/$(*)/link-flags.txt > /dev/null 2>&1 && echo ' \ build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/fftools/*.o \ - build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavdevice/libavdevice.a \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavdevice -lavdevice \ '` \ - build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/*/lib*.a \ - `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/thr/' configs/configs/$(*)/libs.txt` -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).thr.mjs + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavutil/libavutil.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavutil -lavutil \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavformat/libavformat.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavformat -lavformat \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavcodec/libavcodec.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavcodec -lavcodec \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavfilter/libavfilter.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavfilter -lavfilter \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswresample/libswresample.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswresample -lswresample \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswscale/libswscale.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswscale -lswscale \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libfoob/libfoob.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libfoob -lfoob \ + '` \ + \ + `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/thr/' configs/configs/$(*)/libs.txt` \ + $(ES6FLAGS) $(THRFLAGS) -sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency \ + -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).thr.mjs if [ -e $(@).d/libav-$(LIBAVJS_VERSION)-$(*).thr.wasm.map ] ; then \ ./tools/adjust-sourcemap.js $(@).d/libav-$(LIBAVJS_VERSION)-$(*).thr.wasm.map \ ffmpeg $(FFMPEG_VERSION) \ @@ -456,16 +820,52 @@ dist/libav-$(LIBAVJS_VERSION)-%.thr.mjs: build/ffmpeg-$(FFMPEG_VERSION)/build-th dist/libav-$(LIBAVJS_VERSION)-%.dbg.thr.js: build/ffmpeg-$(FFMPEG_VERSION)/build-thr-%/libavformat/libavformat.a \ build/exports.json pre.js build/post.js extern-post.js bindings.c mkdir -p $(@).d - $(EMCC) $(OPTFLAGS) $(EFLAGS) -gsource-map $(THRFLAGS) -sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency \ + $(EMCC) $(OPTFLAGS) $(EFLAGS) \ -Ibuild/ffmpeg-$(FFMPEG_VERSION) -Ibuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*) \ `test ! -e configs/configs/$(*)/link-flags.txt || cat configs/configs/$(*)/link-flags.txt` \ bindings.c \ `grep LIBAVJS_WITH_CLI configs/configs/$(*)/link-flags.txt > /dev/null 2>&1 && echo ' \ build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/fftools/*.o \ - build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavdevice/libavdevice.a \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavdevice -lavdevice \ '` \ - build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/*/lib*.a \ - `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/thr/' configs/configs/$(*)/libs.txt` -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.thr.js + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavutil/libavutil.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavutil -lavutil \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavformat/libavformat.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavformat -lavformat \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavcodec/libavcodec.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavcodec -lavcodec \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavfilter/libavfilter.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavfilter -lavfilter \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswresample/libswresample.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswresample -lswresample \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswscale/libswscale.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswscale -lswscale \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libfoob/libfoob.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libfoob -lfoob \ + '` \ + \ + `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/thr/' configs/configs/$(*)/libs.txt` \ + -gsource-map $(THRFLAGS) -sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency \ + -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.thr.js if [ -e $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.thr.wasm.map ] ; then \ ./tools/adjust-sourcemap.js $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.thr.wasm.map \ ffmpeg $(FFMPEG_VERSION) \ @@ -489,16 +889,52 @@ dist/libav-$(LIBAVJS_VERSION)-%.dbg.thr.js: build/ffmpeg-$(FFMPEG_VERSION)/build dist/libav-$(LIBAVJS_VERSION)-%.dbg.thr.mjs: build/ffmpeg-$(FFMPEG_VERSION)/build-thr-%/libavformat/libavformat.a \ build/exports.json pre.js build/post.js extern-post.js bindings.c mkdir -p $(@).d - $(EMCC) $(OPTFLAGS) $(EFLAGS) -gsource-map $(ES6FLAGS) $(THRFLAGS) -sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency \ + $(EMCC) $(OPTFLAGS) $(EFLAGS) \ -Ibuild/ffmpeg-$(FFMPEG_VERSION) -Ibuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*) \ `test ! -e configs/configs/$(*)/link-flags.txt || cat configs/configs/$(*)/link-flags.txt` \ bindings.c \ `grep LIBAVJS_WITH_CLI configs/configs/$(*)/link-flags.txt > /dev/null 2>&1 && echo ' \ build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/fftools/*.o \ - build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavdevice/libavdevice.a \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavdevice -lavdevice \ '` \ - build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/*/lib*.a \ - `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/thr/' configs/configs/$(*)/libs.txt` -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.thr.mjs + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavutil/libavutil.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavutil -lavutil \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavformat/libavformat.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavformat -lavformat \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavcodec/libavcodec.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavcodec -lavcodec \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavfilter/libavfilter.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libavfilter -lavfilter \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswresample/libswresample.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswresample -lswresample \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswscale/libswscale.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libswscale -lswscale \ + '` \ + \ + \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libfoob/libfoob.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-thr-$(*)/libfoob -lfoob \ + '` \ + \ + `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/thr/' configs/configs/$(*)/libs.txt` \ + -gsource-map $(ES6FLAGS) $(THRFLAGS) -sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency \ + -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.thr.mjs if [ -e $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.thr.wasm.map ] ; then \ ./tools/adjust-sourcemap.js $(@).d/libav-$(LIBAVJS_VERSION)-$(*).dbg.thr.wasm.map \ ffmpeg $(FFMPEG_VERSION) \ diff --git a/Makefile.m4 b/Makefile.m4 index ae38c1e1..890e0719 100644 --- a/Makefile.m4 +++ b/Makefile.m4 @@ -13,7 +13,7 @@ LIBAVJS_VERSION_SHORT=$(LIBAVJS_VERSION_BASE).$(FFMPEG_VERSION_MAJOR) EMCC=emcc MINIFIER=node_modules/.bin/terser OPTFLAGS=-Oz -NOTHRFLAGS=build/inst/base/lib/libemfiberthreads.a +NOTHRFLAGS=-Lbuild/inst/base/lib -lemfiberthreads THRFLAGS=-pthread ES6FLAGS=-sEXPORT_ES6=1 -sUSE_ES6_IMPORT_META=1 EFLAGS=\ @@ -88,22 +88,38 @@ dist/libav.types.d.ts: build/libav.types.d.ts mkdir -p dist cp $< $@ +# Link rule that checks for a library's existence before linking it +# Use: linkfflib(library name, target inst name) +define([[[linkfflib]]], [[[ \ + `test ! -e build/ffmpeg-$(FFMPEG_VERSION)/build-$2-$(*)/lib$1/lib$1.a || echo ' \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-$2-$(*)/lib$1 -l$1 \ + '` \ +]]]) + # General build rule for any target -# Use: buildrule(target file name, debug infix, target inst name, CFLAGS, target file suffix) +# Use: buildrule(target file name, debug infix, target inst name, extra link flags, target file suffix) define([[[buildrule]]], [[[ dist/libav-$(LIBAVJS_VERSION)-%.$2$1.$5: build/ffmpeg-$(FFMPEG_VERSION)/build-$3-%/libavformat/libavformat.a \ build/exports.json pre.js build/post.js extern-post.js bindings.c mkdir -p $(@).d - $(EMCC) $(OPTFLAGS) $(EFLAGS) $4 \ + $(EMCC) $(OPTFLAGS) $(EFLAGS) \ -Ibuild/ffmpeg-$(FFMPEG_VERSION) -Ibuild/ffmpeg-$(FFMPEG_VERSION)/build-$3-$(*) \ `test ! -e configs/configs/$(*)/link-flags.txt || cat configs/configs/$(*)/link-flags.txt` \ bindings.c \ `grep LIBAVJS_WITH_CLI configs/configs/$(*)/link-flags.txt > /dev/null 2>&1 && echo ' \ build/ffmpeg-$(FFMPEG_VERSION)/build-$3-$(*)/fftools/*.o \ - build/ffmpeg-$(FFMPEG_VERSION)/build-$3-$(*)/libavdevice/libavdevice.a \ + -Lbuild/ffmpeg-$(FFMPEG_VERSION)/build-$3-$(*)/libavdevice -lavdevice \ '` \ - build/ffmpeg-$(FFMPEG_VERSION)/build-$3-$(*)/*/lib*.a \ - `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/$3/' configs/configs/$(*)/libs.txt` -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).$2$1.$5 + linkfflib(avutil, $3) \ + linkfflib(avformat, $3) \ + linkfflib(avcodec, $3) \ + linkfflib(avfilter, $3) \ + linkfflib(swresample, $3) \ + linkfflib(swscale, $3) \ + linkfflib(foob, $3) \ + `test ! -e configs/configs/$(*)/libs.txt || sed 's/@TARGET/$3/' configs/configs/$(*)/libs.txt` \ + $4 \ + -o $(@).d/libav-$(LIBAVJS_VERSION)-$(*).$2$1.$5 if [ -e $(@).d/libav-$(LIBAVJS_VERSION)-$(*).$2$1.wasm.map ] ; then \ ./tools/adjust-sourcemap.js $(@).d/libav-$(LIBAVJS_VERSION)-$(*).$2$1.wasm.map \ ffmpeg $(FFMPEG_VERSION) \