# porting eJScript



## freethread (Jun 15, 2012)

eJScript is an EcmaScript v5 interpreter for using as system and web server side scripting. It's actually at version 2.0.0 with new features. I've compiled and been using version 1.1.2 for several months now, the only one that doesn't need modification to build/install on FreeBSD. For version 2.0.0 the compiling process is changed, however I'm trying to make it compile and install somewhere, my choice for 1.1.2 was /usr/local/ejscript, it creates 1.1.2 under that position and installs there, for version 2.0.0 it will create 2.0.0.

My goal is to have it installed in the FreeBSD way (using right directories as in hier(7)) with some exceptions, not to make the port, this is too complicated for me. I'm writing down all the steps (file changes/creation in the source) to compile and install it (work in progress). If anyone is interested in this project and want to write a port contact me by PM (any help appreciated, anyways), thanks.

P.S. I started today, so actually it doesn't compile.


----------



## wblock@ (Jun 15, 2012)

Do the port, there is a lot of stuff in the ports system that actually makes it easier than building, patching, and handling dependencies by hand.

Porter's Handbook


----------



## freethread (Jun 15, 2012)

wblock@ said:
			
		

> Do the port, there is a lot of stuff in the ports system that actually makes it easier than building, patching, and handling dependencies by hand.
> 
> Porter's Handbook



Yes, I know, thanks. I read that but I have zero experience with Unix tools and the specific FreeBSD environment and habits (= I understood the 1%).

It now compiled with very few modifications, well I compiled the configurator but doing this it also compiled the whole eJScript tools, libraries and modules.

```
.
.
.
gmake[1]: Leaving directory `/usr/ports-custom/lang/ejscript/ejs-2.0.0'

You can now use Ejscript or use "bit" to customize and re-build Ejscript, via:

    freebsd-x86-debug/bin/bit configure build
```


----------



## freethread (Jun 16, 2012)

It seems it works. I'm still playing with configuration/compiling options to tune it for my needs (system scripting). I'm also thinking about making a port but really I don't know how to start. This program build its own configurator (not autoconf/automake), there is no documentation about how to configure/compile/install so I'm not sure my customization is good.

The essentials of what I've done is:


Create the platform specific make file. I duplicated the Linux makefile, compared with the Solaris makefile (FreeBSD is in the middle, in my thoughts) and modified the compilation/linking flags. There is also a shell file that do the same operatios as an alternative compiling method, I didn't create it.
 Modified few sources to include some headers and compile some parts as in OS X and not Linux (kQueue vs epoll).

Before starting the compilation some environment variables must be set (PATH, LD_LIBRARY_PATH and EJSPATH) otherwise js core modules will not be compiled (and you will not be noticed at the end of compilation, you only see a 'file not found' here and there while compiling). This could be different if eJScript is alredy installed (port updating) in that case the environment variables must be set so take precedence over the already installed eJScript executables and modules.

Now, I dont know how to set this in a port Makefile, I write the port if anyone helps.


----------

