#Update the package lists
sudo apt-get update
# Install **gcc** (and related dependencies)
sudo apt-get install build-essential
# Install cmake
sudo apt-get install cmake
# Install Python (by default is bundled with Ubuntu)
sudo apt-get install python2.7
# Install node.js
sudo apt-get install nodejs
# Install Java
sudo apt-get install default-jre
# Install git (optional)
sudo apt-get install git-core
- Only install ~1.2+, NOT SDL 2+. Otherwise it won't work :s
I think you can install it from a package, but maybe you will need to compile it.
I think this should do it:
- sudo apt-get install libsdl-image1.2-dev OR
- sudo apt-get install libsdl1.2-dev libsdl1.2debian
- Download source code from sdl website here.
- Extract to folder of your liking
- cd into it
- sudo ./configure
If you use Ubuntu x32 you can probably proceed at running make and make install at this point. If you use Ubuntu x64 you would probably need to fix x11 video reference at this point. Somehow it does not work, so the steps are the following:
- cd /src/video/x11
- nano +166 SDL_x11sym.h (because it is around line 166)
- add #if 0 and #endif wrapper around this part:
#if 0 <- add this!
#ifdef LONG64
SDL_X11_MODULE(IO_32BIT)
SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
#endif
#endif <- add this!
This should do the trick. Let's continue.
- sudo make
- sudo make install
- Grab source file from here
- Extract to folder of your liking
- cd into it
# Fetch the latest registry of available tools.
./emsdk update
# Download and install the latest SDK tools.
./emsdk install latest
# Set up the compiler configuration to point to the "latest" SDK.
./emsdk activate latest
# Linux/Mac OS X only: Set the current Emscripten path
source ./emsdk_env.sh
Now it is time to see if you have any prerequisites missing, lol. If prerequisites are missing (like Java, or node), then the path will be missing essential binaries.
Check if you have command emconfigure. If not, you need to manually add emscripten to the PATH
Add this to ~/.bashrc :
- nano ~/.bashrc
export EMSCRIPTEN=/PATH/TO/emsdk/emscripten/master
export EMSCRIPTEN_ROOT=$EMSCRIPTEN:
export PATH=$PATH:$EMSCRIPTEN:
- source ~/.bashrc
Check that emcc does not return any error. Ideally you should see the following:
INFO root: (Emscripten: Running sanity checks)
WARNING root: no input files
## Point node to nodejs
- Error ex. "Node is missing, blah blah blah".
- Make sure you have node installed. Test it with "nodejs"
- If it works, modify ~/.emscripten and Change NODE_... with "nodejs"
After you are sure that emcc shows no errors or warnings, let's clone em-dosbox. You will need automake & autoconf packages installed
- sudo apt-get install autoconf
- git clone https://github.com/dreamlayers/em-dosbox.git
- cd into em-dosbox
- following commands are better run in bash as root (do exactly as it is listed below)
- sudo -s
- ./autogen.sh
- emconfigure ./configure
- make
If you are lucky, the horror of installation is almost over. In /src/ you should see dosbox.html and dosbox.js files
Now you can try opening dosbox.html in your browser. Better start it as a server: "Remember that the same origin policy prevent access to data files in some browsers when using file:// URLs."
- cd to /src folder
- python -m SimpleHTTPServer
- in browser go to localhost:8000/dropbox.html
Firefox is probably going to lag, but it's better than Chrome which doesn't even load for some reason :s. You can also follow the patches at em-dosbox project's readme.
Next is to change the PYTHON to 'python' inside of src/packager.py. This file tries to use emscripten's file_packager and uses the mysterious PYTHON variable. Since script is going to fail, it's time to open it up and change it
- nano /src/packager.py
- change PYTHON to 'python'
Now we are ready to try running some games!
- As a test I recommend to download "Blocks from Hell" from here. (Do it from under Linux, otherwise it downloads some weird installer)
- place blocks into the /src/ folder so it becomes /src/blocks.
- cd to /src
- Now switch to root in bash: sudo -s
- Run ./packager.py blocks blocks.exe
- It should create blocks.html file
- Go to localhost:8000/blocks.html
If you are lucky, you will be able to play Blocks from Hell! w00t!
Dear, I have a little experience in programming in Linux, but I have a great experience in MSDOS system platform and legacy systems. I'm amazed by the emdosbox and would love to build my old programs and games to run on it. It is more promising than the Chrome NACL.
I already tried several times to install emscripten + in-dosbox and I always get errors when compiling in-dosbox. I tested it on a virtual machine VMware Workstation 10, Ubuntu 14.04 -64bits, 4 Gb ram.
Also tested it on my Macbook Pro running Yosemite, but also had problems and I think I could not install all needed components.
I installed vmware tools and follow the tutorial, but it still fails... Some error appear..
I have some questions:
1 - Is there a version of Ubuntu that shows best for emdosbox? Which is better platform for emdosbox; Ubuntu 32 or 64 bit? what is the best for compiling it?
2 - Is there any virtual machine with Ubuntu running emdosbox compiling successfully where I can download? (Any format virtual VMware, Bochs, Qemu Virtualbox)
3 - other Linux distros, the Debian7 can run and compile the emdosbox or is it better to continue with Ubuntu?
If any "holy soul" provide a VM with emscripten 100% working and compiling emdosbox I will make the party!
But keep trying, if anyone can help in making a tutorial to create a VM and include everything needed to install the emscripten, maybe I can compile emdosbox.
Thanks in advanced and Live long and prosper //