Closes https://github.com/pyodide/pyodide/issues/604

This creates an installable `pyodide-build` Python package that we can also upload to PyPi under https://pypi.org/project/pyodide-build/ (currently uploaded the dev version to reserve the name).

There is also the identically named `pyodide-build` CLI command which replaces `bin/pyodide`.

The short term goals is to use fewer hacks with `PATH` and `PYTHONPATH`. Long term goal make it a user facing interface for building packages instead of the Makefile.
Create an installable pyodide-build package. Closes https://github.com/pyodide/pyodide/issues/604

This creates an installable `pyodide-build` Python package that we can also upload to PyPi under https://pypi.org/project/pyodide-build/ (currently uploaded the dev version to reserve the name).

There is also the identically named `pyodide-build` CLI command which replaces `bin/pyodide`.

The short term goals is to use fewer hacks with `PATH` and `PYTHONPATH`. Long term goal make it a user facing interface for building packages instead of the Makefile.
--- b/config.sub
+++ b/config.sub
@@ -118,7 +118,8 @@
   linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
   knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
   kopensolaris*-gnu* | cloudabi*-eabi* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
+  storm-chaos* | os2-emx* | rtmk-nova* | \
+  emscripten)
     os=-$maybe_os
     basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -377,6 +378,7 @@
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| wasm32 \
 	| avr-* | avr32-* \
 	| ba-* \
 	| be32-* | be64-* \
@@ -527,6 +529,9 @@
 	asmjs)
 		basic_machine=asmjs-unknown
 		;;
+	wasm32)
+		basic_machine=wasm32-unknown
+		;;   
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
@@ -1522,6 +1527,8 @@
 			;;
 		esac
 		;;
+	-emscripten)
+		;;
 	-nacl*)
 		;;
 	-ios)
--- a/configure
+++ b/configure
@@ -3274,6 +3274,9 @@ then
 	*-*-vxworks*)
 	    ac_sys_system=VxWorks
 	    ;;
+	wasm32-*-*)
+		ac_sys_system=Emscripten
+		;;
 	*)
 		# for now, limit cross builds to known configurations
 		MACHDEP="unknown"
@@ -3324,6 +3327,9 @@ if test "$cross_compiling" = yes; then
 	*-*-vxworks*)
 		_host_cpu=$host_cpu
 		;;
+	wasm32-*-*)
+		_host_cpu=
+		;;
 	*)
 		# for now, limit cross builds to known configurations
 		MACHDEP="unknown"
--- a/configure.ac
+++ b/configure.ac
@@ -382,6 +382,9 @@ then
 	*-*-vxworks*)
 	    ac_sys_system=VxWorks
 	    ;;
+	wasm32-*-*)
+		ac_sys_system=Emscripten
+		;;
 	*)
 		# for now, limit cross builds to known configurations
 		MACHDEP="unknown"
@@ -430,6 +433,8 @@ if test "$cross_compiling" = yes; then
 		;;
 	*-*-vxworks*)
 		_host_cpu=$host_cpu
+	wasm32-*-*)
+		_host_cpu=
 		;;
 	*)
 		# for now, limit cross builds to known configurations

--- b/config.sub
+++ b/config.sub
@@ -118,7 +118,8 @@
   linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
   knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
   kopensolaris*-gnu* | cloudabi*-eabi* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
+  storm-chaos* | os2-emx* | rtmk-nova* | \
+  emscripten)
     os=-$maybe_os
     basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -377,6 +378,7 @@
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| wasm32 \
 	| avr-* | avr32-* \
 	| ba-* \
 	| be32-* | be64-* \
@@ -527,6 +529,9 @@
 	asmjs)
 		basic_machine=asmjs-unknown
 		;;
+	wasm32)
+		basic_machine=wasm32-unknown
+		;;   
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
@@ -1522,6 +1527,8 @@
 			;;
 		esac
 		;;
+	-emscripten)
+		;;
 	-nacl*)
 		;;
 	-ios)
--- a/configure
+++ b/configure
@@ -3274,6 +3274,9 @@ then
 	*-*-vxworks*)
 	    ac_sys_system=VxWorks
 	    ;;
+	wasm32-*-*)
+		ac_sys_system=Emscripten
+		;;
 	*)
 		# for now, limit cross builds to known configurations
 		MACHDEP="unknown"
@@ -3324,6 +3327,9 @@ if test "$cross_compiling" = yes; then
 	*-*-vxworks*)
 		_host_cpu=$host_cpu
 		;;
+	wasm32-*-*)
+		_host_cpu=
+		;;
 	*)
 		# for now, limit cross builds to known configurations
 		MACHDEP="unknown"
--- a/configure.ac
+++ b/configure.ac
@@ -382,6 +382,9 @@ then
 	*-*-vxworks*)
 	    ac_sys_system=VxWorks
 	    ;;
+	wasm32-*-*)
+		ac_sys_system=Emscripten
+		;;
 	*)
 		# for now, limit cross builds to known configurations
 		MACHDEP="unknown"
@@ -430,6 +433,8 @@ if test "$cross_compiling" = yes; then
 		;;
 	*-*-vxworks*)
 		_host_cpu=$host_cpu
+	wasm32-*-*)
+		_host_cpu=
 		;;
 	*)
 		# for now, limit cross builds to known configurations
