#!/bin/bash # This is the configuration file for building WebPerl. # You should edit it according to the comments below. # Remember to reload this file after making changes! (". emperl_config.sh") # You must edit this to point to your Emscripten SDK's emsdk_env.sh. . $HOME/emsdk/emsdk_env.sh # A whitespace-separated list of modules to download and add to the build. # Note: Cpanel::JSON::XS is required for WebPerl! export EMPERL_EXTENSIONS="Cpanel::JSON::XS Devel::StackTrace" # Modules from the above list that have XS code need to be linked statically. # Add them here, separated by whitespace (see also the "static_ext" variable # in https://perl5.git.perl.org/perl.git/blob/HEAD:/Porting/Glossary ). export EMPERL_STATIC_EXT="Cpanel/JSON/XS" # Do not edit (this gets this script's parent directory) BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/.. >/dev/null && pwd )" # Various working directories, you normally don't need to edit these export EMPERL_PERLSRCDIR="$BASEDIR/emperl5" export EMPERL_HOSTPERLDIR="$BASEDIR/work/hostperl" export EMPERL_DOWNLOADDIR="$BASEDIR/work/download" export EMPERL_OUTPUTDIR="$BASEDIR/work/outputperl" # Don't edit the following options unless you know what you're doing! # Note to self: In build.pl, we take advantage of the fact that on Perls >=v5.10.0, "$^V" is the same as the tag name. export EMPERL_PERLVER="v5.28.0" export EMPERL_PREFIX="/opt/perl" export EMPERL_PRELOAD_FILE="$EMPERL_OUTPUTDIR$EMPERL_PREFIX@$EMPERL_PREFIX" export EMPERL_OPTIMIZ="-O2" export EMPERL_LINK_FLAGS="--pre-js common_preamble.js -s EXPORTED_FUNCTIONS=['_main','_emperl_end_perl','_Perl_call_sv','_Perl_call_pv','_Perl_call_method','_Perl_call_argv','_Perl_eval_pv','_Perl_eval_sv','_webperl_eval_perl'] -s EXTRA_EXPORTED_RUNTIME_METHODS=['ccall','cwrap']" # Note: not including "-s SAFE_HEAP=1" in the debug flags because we're building to WebAssembly, which doesn't require alignment #TODO Later: Can some of the SAFE_HEAP functionality (null pointer access I think?) be replaced by the WASM error traps? # http://kripken.github.io/emscripten-site/docs/compiling/WebAssembly.html#binaryen-codegen-options export EMPERL_DEBUG_FLAGS="-s ASSERTIONS=2 -s STACK_OVERFLOW_CHECK=2" # Location and branch of the perl git repository that contains the emperl branch export EMPERL_PERL_REPO="https://github.com/haukex/emperl5.git" export EMPERL_PERL_BRANCH="emperl_$EMPERL_PERLVER" # Enabling this setting causes the local emperl branch to be deleted and re-fetched from the origin. # This is useful during development, when rewrites of the (unpublished!) git history of the branch might happen. export EMPERL_CLOBBER_BRANCH=0