Fixing build to tolerate some missing dependencies.
Be able to build without nodejs and d8.
This commit is contained in:
24
configure.py
24
configure.py
@ -111,11 +111,14 @@ WIN_LFLAGS64 = [
|
|||||||
'/LIBPATH:"c:/Program Files (x86)/Windows Kits/10/Lib/10.0.19041.0/ucrt/x64"',
|
'/LIBPATH:"c:/Program Files (x86)/Windows Kits/10/Lib/10.0.19041.0/ucrt/x64"',
|
||||||
] + WIN_LIBS
|
] + WIN_LIBS
|
||||||
|
|
||||||
|
WEB_ENABLED = False
|
||||||
PICO_ICE_ENABLED = False
|
PICO_ICE_ENABLED = False
|
||||||
WINDOWS_ENABLED = False
|
|
||||||
|
|
||||||
|
D8_AVAILABLE = False
|
||||||
|
D8 = 'UNSUPPORTED'
|
||||||
|
|
||||||
|
WINDOWS_ENABLED = False
|
||||||
WINTMP = '/UNSUPPORTED'
|
WINTMP = '/UNSUPPORTED'
|
||||||
ARDUINO_CLI = 'UNSUPPORTED'
|
|
||||||
WIN_CL32 = 'UNSUPPORTED'
|
WIN_CL32 = 'UNSUPPORTED'
|
||||||
WIN_CL64 = 'UNSUPPORTED'
|
WIN_CL64 = 'UNSUPPORTED'
|
||||||
WIN_LINK32 = 'UNSUPPORTED'
|
WIN_LINK32 = 'UNSUPPORTED'
|
||||||
@ -123,6 +126,8 @@ WIN_LINK64 = 'UNSUPPORTED'
|
|||||||
WIN_RC32 = 'UNSUPPORTED'
|
WIN_RC32 = 'UNSUPPORTED'
|
||||||
WIN_RC64 = 'UNSUPPORTED'
|
WIN_RC64 = 'UNSUPPORTED'
|
||||||
|
|
||||||
|
ARDUINO_CLI = 'UNSUPPORTED'
|
||||||
|
|
||||||
# Mutable global state.
|
# Mutable global state.
|
||||||
build_files = []
|
build_files = []
|
||||||
output = ''
|
output = ''
|
||||||
@ -169,24 +174,26 @@ def DetectWindowsTools(args):
|
|||||||
|
|
||||||
|
|
||||||
def DetectGenericTools(args):
|
def DetectGenericTools(args):
|
||||||
global D8, NODEJS, PICO_ICE_ENABLED
|
global D8, D8_AVAILABLE, WEB_ENABLED, PICO_ICE_ENABLED
|
||||||
try:
|
try:
|
||||||
D8 = LSQ('${HOME}/src/v8/v8/out/x64.release/d8')
|
D8 = LSQ('${HOME}/src/v8/v8/out/x64.release/d8')
|
||||||
|
D8_AVAILABLE = True
|
||||||
except:
|
except:
|
||||||
if not args.quiet:
|
if not args.quiet:
|
||||||
sys.stderr.write('V8 checkout in $HOME/src/v8 not found, ignoring.\n')
|
sys.stderr.write('V8 checkout in $HOME/src/v8 not found, '
|
||||||
|
'disabling asm.js tests.\n')
|
||||||
try:
|
try:
|
||||||
NODEJS = LSQ('/usr/bin/nodejs')
|
LSQ('/usr/bin/nodejs')
|
||||||
|
WEB_ENABLED = True
|
||||||
except:
|
except:
|
||||||
if not args.quiet:
|
if not args.quiet:
|
||||||
sys.stderr.write('/usr/bin/nodejs not found, required!\n')
|
sys.stderr.write('/usr/bin/nodejs not found, disabling web.\n')
|
||||||
sys.exit(1)
|
|
||||||
try:
|
try:
|
||||||
LSQ('/usr/bin/arm-none-eabi-gcc')
|
LSQ('/usr/bin/arm-none-eabi-gcc')
|
||||||
PICO_ICE_ENABLED = True
|
PICO_ICE_ENABLED = True
|
||||||
except:
|
except:
|
||||||
if not args.quiet:
|
if not args.quiet:
|
||||||
sys.stderr.write('Missing package gcc-arm-none-eabi, pico-ice diabled!\n')
|
sys.stderr.write('Missing package gcc-arm-none-eabi, pico-ice disabled.\n')
|
||||||
|
|
||||||
|
|
||||||
def FastOption():
|
def FastOption():
|
||||||
@ -232,7 +239,6 @@ WIN_RC32 = {WIN_RC32}
|
|||||||
WIN_RC64 = {WIN_RC64}
|
WIN_RC64 = {WIN_RC64}
|
||||||
|
|
||||||
D8 = {D8}
|
D8 = {D8}
|
||||||
NODEJS = {NODEJS}
|
|
||||||
|
|
||||||
WIN_CFLAGS = {' '.join(WIN_CFLAGS)}
|
WIN_CFLAGS = {' '.join(WIN_CFLAGS)}
|
||||||
WIN_LFLAGS32 = {' '.join(WIN_LFLAGS32)}
|
WIN_LFLAGS32 = {' '.join(WIN_LFLAGS32)}
|
||||||
|
|||||||
@ -12,6 +12,9 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
if not WEB_ENABLED:
|
||||||
|
Return()
|
||||||
|
|
||||||
OPTIONS = '-I $src/site'
|
OPTIONS = '-I $src/site'
|
||||||
UE_OPTIONS = OPTIONS + ' -DFORTH=uEForth'
|
UE_OPTIONS = OPTIONS + ' -DFORTH=uEForth'
|
||||||
ESP_OPTIONS = OPTIONS + ' -DFORTH=ESP32forth'
|
ESP_OPTIONS = OPTIONS + ' -DFORTH=ESP32forth'
|
||||||
|
|||||||
15
web/BUILD
15
web/BUILD
@ -12,6 +12,9 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
if not WEB_ENABLED:
|
||||||
|
Return()
|
||||||
|
|
||||||
Importation('$dst/gen/web_boot.js', '$src/web/web_boot.fs', header_mode='web', name='boot')
|
Importation('$dst/gen/web_boot.js', '$src/web/web_boot.fs', header_mode='web', name='boot')
|
||||||
Compile('$dst/gen/dump_web_opcodes', '$src/web/dump_web_opcodes.c')
|
Compile('$dst/gen/dump_web_opcodes', '$src/web/dump_web_opcodes.c')
|
||||||
GenRun('$dst/gen/web_cases.js', '$dst/gen/dump_web_opcodes', 'cases', [])
|
GenRun('$dst/gen/web_cases.js', '$dst/gen/dump_web_opcodes', 'cases', [])
|
||||||
@ -31,21 +34,25 @@ WEB_ITEMS = [
|
|||||||
Copy('$dst/web/script_lite_test.html', '$src/web/script_lite_test.html'),
|
Copy('$dst/web/script_lite_test.html', '$src/web/script_lite_test.html'),
|
||||||
Copy('$dst/web/script_test.html', '$src/web/script_test.html'),
|
Copy('$dst/web/script_test.html', '$src/web/script_test.html'),
|
||||||
Copy('$dst/web/script_test.fs', '$src/web/script_test.fs'),
|
Copy('$dst/web/script_test.fs', '$src/web/script_test.fs'),
|
||||||
|
]
|
||||||
|
|
||||||
|
if D8_AVAILABLE:
|
||||||
|
WEB_ITEMS += [
|
||||||
TestCommand('$dst/tests/web_sanity_test.out',
|
TestCommand('$dst/tests/web_sanity_test.out',
|
||||||
' '.join([
|
' '.join([
|
||||||
'$dst/web/ueforth.js',
|
'$dst/web/ueforth.js',
|
||||||
'$src/tools/check_web_sanity.py',
|
'$src/tools/check_web_sanity.py',
|
||||||
]),
|
]),
|
||||||
'echo "120 3 + . cr bye" | ' + D8 + ' $dst/web/ueforth.js | '
|
'echo "120 3 + . cr bye" | ' + D8 + ' $dst/web/ueforth.js | '
|
||||||
'$src/tools/check_web_sanity.py $dst/tests/web_sanity_test.out'),
|
'$src/tools/check_web_sanity.py ' +
|
||||||
|
'$dst/tests/web_sanity_test.out'),
|
||||||
]
|
]
|
||||||
|
|
||||||
Alias('web', ' '.join(WEB_ITEMS))
|
Alias('web', ' '.join(WEB_ITEMS))
|
||||||
Default('web')
|
Default('web')
|
||||||
|
|
||||||
D8 = '~/src/v8/v8/out/x64.release/d8 $dst/web/ueforth.js'
|
if D8_AVAILABLE:
|
||||||
|
|
||||||
OneShot('d8',
|
OneShot('d8',
|
||||||
'$dst/web/ueforth.js',
|
'$dst/web/ueforth.js',
|
||||||
D8 + ' $in',
|
D8 + ' $dst/web/ueforth.js $in',
|
||||||
pool='console')
|
pool='console')
|
||||||
|
|||||||
Reference in New Issue
Block a user