3737 echo " $CONFIG_STATUS exists and is newer than $REF_FILE . ./configure will NOT be run."
3838fi
3939
40+ # we define here "all" emscripten flags in order to allow native builds (like libpglite)
41+ EXPORTED_RUNTIME_METHODS=" addFunction,removeFunction,FS,MEMFS"
42+ PGLITE_EMSCRIPTEN_FLAGS=" -sWASM_BIGINT \
43+ -sSUPPORT_LONGJMP=emscripten \
44+ -sFORCE_FILESYSTEM=1 \
45+ -sNO_EXIT_RUNTIME=0 -sENVIRONMENT=node,web,worker \
46+ -sMAIN_MODULE=2 -sMODULARIZE=1 -sEXPORT_ES6=1 \
47+ -sEXPORT_NAME=Module -sALLOW_TABLE_GROWTH -sALLOW_MEMORY_GROWTH \
48+ -sERROR_ON_UNDEFINED_SYMBOLS=0 \
49+ -sEXPORTED_RUNTIME_METHODS=$EXPORTED_RUNTIME_METHODS \
50+ -sTOTAL_MEMORY=32MB \
51+ --embed-file $( pwd) /other/PGPASSFILE@/home/web_user/.pgpass"
52+
4053# Step 1: configure the project
4154if [ " $RUN_CONFIGURE " = true ]; then
42- LDFLAGS=" -sWASM_BIGINT -sUSE_PTHREADS=0" CFLAGS=" ${PGLITE_CFLAGS} -sWASM_BIGINT -fpic -sENVIRONMENT=node,web,worker -sSUPPORT_LONGJMP=emscripten -Wno-declaration-after-statement -Wno-macro-redefined -Wno-unused-function -Wno-missing-prototypes -Wno-incompatible-pointer-types" emconfigure ./configure ac_cv_exeext=.cjs --disable-spinlocks --disable-largefile --without-llvm --without-pam --disable-largefile --with-openssl=no --without-readline --without-icu --with-includes=$INSTALL_PREFIX /include:$INSTALL_PREFIX /include/libxml2 --with-libraries=$INSTALL_PREFIX /lib --with-uuid=ossp --with-zlib --with-libxml --with-libxslt --with-template=emscripten --prefix=$INSTALL_FOLDER || { echo ' error: emconfigure failed' ; exit 11; }
55+ LDFLAGS=" -sWASM_BIGINT -sUSE_PTHREADS=0" \
56+ LDFLAGS_SL=" -sSIDE_MODULE=1" \
57+ LDFLAGS_EX=$PGLITE_EMSCRIPTEN_FLAGS \
58+ CFLAGS=" ${PGLITE_CFLAGS} -sWASM_BIGINT -fpic -sENVIRONMENT=node,web,worker -sSUPPORT_LONGJMP=emscripten -Wno-declaration-after-statement -Wno-macro-redefined -Wno-unused-function -Wno-missing-prototypes -Wno-incompatible-pointer-types" emconfigure ./configure ac_cv_exeext=.js --host aarch64-unknown-linux-gnu --disable-spinlocks --disable-largefile --without-llvm --without-pam --disable-largefile --with-openssl=no --without-readline --without-icu --with-includes=$INSTALL_PREFIX /include:$INSTALL_PREFIX /include/libxml2:$( pwd) /pglite/includes --with-libraries=$INSTALL_PREFIX /lib --with-uuid=ossp --with-zlib --with-libxml --with-libxslt --with-template=emscripten --prefix=$INSTALL_FOLDER || { echo ' error: emconfigure failed' ; exit 11; }
4359else
4460 echo " Warning: configure has not been run because RUN_CONFIGURE=${RUN_CONFIGURE} "
4561fi
@@ -49,7 +65,7 @@ emmake make PORTNAME=emscripten -j || { echo 'error: emmake make PORTNAME=emscri
4965emmake make PORTNAME=emscripten install || { echo ' error: emmake make PORTNAME=emscripten install' ; exit 22; }
5066
5167# Step 3.1: make all contrib extensions - do not install
52- emmake make PORTNAME=emscripten LDFLAGS_SL= " -sSIDE_MODULE=1 " -C contrib/ -j || { echo ' error: emmake make PORTNAME=emscripten -C contrib/ -j' ; exit 31; }
68+ emmake make PORTNAME=emscripten -C contrib/ -j || { echo ' error: emmake make PORTNAME=emscripten -C contrib/ -j' ; exit 31; }
5369# Step 3.2: make dist contrib extensions - this will create an archive for each extension
5470emmake make PORTNAME=emscripten -C contrib/ dist || { echo ' error: emmake make PORTNAME=emscripten -C contrib/ dist' ; exit 32; }
5571# the above will also create a file with the imports that each extension needs - we pass these as input in the next step for emscripten to keep alive
@@ -58,20 +74,18 @@ emmake make PORTNAME=emscripten -C contrib/ dist || { echo 'error: emmake make P
5874SAVE_PATH=$PATH
5975PATH=$PATH :$INSTALL_FOLDER /bin
6076emmake make OPTFLAGS=" " PORTNAME=emscripten -j -C pglite || { echo ' error: emmake make OPTFLAGS="" PORTNAME=emscripten -j -C pglite' ; exit 41; }
61- emmake make OPTFLAGS=" " PORTNAME=emscripten LDFLAGS_SL= " -sSIDE_MODULE=1 " - C pglite/ dist || { echo ' error: make OPTFLAGS="" PORTNAME=emscripten LDFLAGS_SL="-sSIDE_MODULE=1" -C pglite/ dist ' ; exit 42; }
77+ emmake make OPTFLAGS=" " PORTNAME=emscripten - C pglite/ dist || { echo ' error: make OPTFLAGS="" PORTNAME=emscripten -C pglite/ dist ' ; exit 42; }
6278PATH=$SAVE_PATH
6379
6480# Step 5: make and install pglite
65- # we define here "all" emscripten flags in order to allow native builds (like libpglite)
6681EXPORTED_RUNTIME_METHODS=" MEMFS,IDBFS,FS,setValue,getValue,UTF8ToString,stringToNewUTF8,stringToUTF8OnStack,addFunction,removeFunction"
6782PGLITE_EMSCRIPTEN_FLAGS=" -sWASM_BIGINT \
6883-sSUPPORT_LONGJMP=emscripten \
6984-sFORCE_FILESYSTEM=1 \
7085-sNO_EXIT_RUNTIME=1 -sENVIRONMENT=node,web,worker \
7186-sMAIN_MODULE=2 -sMODULARIZE=1 -sEXPORT_ES6=1 \
7287-sEXPORT_NAME=Module -sALLOW_TABLE_GROWTH -sALLOW_MEMORY_GROWTH \
73- -sERROR_ON_UNDEFINED_SYMBOLS=1 \
88+ -sERROR_ON_UNDEFINED_SYMBOLS=0 \
7489-sEXPORTED_RUNTIME_METHODS=$EXPORTED_RUNTIME_METHODS "
75-
7690# Building pglite itself needs to be the last step because of the PRELOAD_FILES parameter (a list of files and folders) need to be available.
7791PGLITE_CFLAGS=" $PGLITE_CFLAGS $PGLITE_EMSCRIPTEN_FLAGS " emmake make PORTNAME=emscripten -j -C src/backend/ install-pglite || { echo ' emmake make OPTFLAGS="" PORTNAME=emscripten -j -C pglite' ; exit 51; }
0 commit comments