Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
UNAME := $(shell uname -s)

MAKEFILE=Makefile
RELEASE = 0
ifeq ($(UNAME),Darwin)
MAKEFILE=Makefile.osx
MAKEFILE=Makefile.osx
else
RELEASE := $(shell lsb_release -sr)
endif
ifeq ($(RELEASE),11)
MAKEFILE = Makefile.sles
ifneq ($(shell shtool platform | grep -i "suse"),)
MAKEFILE=Makefile.sles
endif
ifneq ($(shell shtool platform | grep -i "centos"),)
MAKEFILE=Makefile.centos
endif
ifneq ($(shell shtool platform | grep -i "linuxmint"),)
MAKEFILE=Makefile.Mint
endif
ifneq ($(shell shtool platform | grep -i "ubuntu"),)
MAKEFILE=Makefile
endif
endif


all:
cd src && make -f$(MAKEFILE)
cp src/silkjs .
Expand Down
16 changes: 12 additions & 4 deletions README
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
QUICKSTART

Currently for Mac OSX Lion x64 and Ubuntu only...
Currently for :
* Mac OSX Lion x64
* Ubuntu 12.04 and higher
* Other Ubuntu-based distributions (including Linux Mint 12 and higher...)

Download and compile :
git clone https://github.com/mschwartz/SilkJS SilkJS
cd SilkJS
make

(See https://github.com/mschwartz/SilkJS/wiki/Build-Instructions for dependent libraries)

Once built:
Installation :
make install
OR
sudo make install

./silkjs httpd/main.js
Once installed, you can launch the demo:
silkjs httpd/main.js

Then point your browser at http://localhost:9090/

Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,24 @@ in JavaScript. Even the CommonJS require() method is written in JavaScript.

(See https://github.com/mschwartz/SilkJS/wiki/Build-Instructions for dependent libraries)

Currently for Mac OSX Lion x64 and Ubuntu only...
Currently for :
* Mac OSX Lion x64
* Ubuntu 12.04 and higher
* Other Ubuntu-based distributions (including Linux Mint 12 and higher...)

Downloading and compilation :

git clone https://github.com/mschwartz/SilkJS SilkJS
cd SilkJS
make

Installation :

make install (OR "sudo make install" for Ubuntu)

Once built:
Once installed, you can launch the demo:

./silkjs httpd/main.js
silkjs httpd/main.js

Then point your browser at http://localhost:9090/

Expand Down
3 changes: 1 addition & 2 deletions httpd/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,11 @@ req = (function() {
});
}
else {
req.data = data;
req.data.post = post;
}
}
}
req.data = data;

return true;
},
getHeader: function(key) {
Expand Down
91 changes: 91 additions & 0 deletions src/Makefile.Mint
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
ARCH := $(shell getconf LONG_BIT)

RELEASE := $(shell lsb_release -sr)

GROUP = sudo

CORE= main.o base64.o global.o console.o process.o net.o fs.o buffer.o v8.o http.o md5.o popen.o linenoise.o async.o time.o

OBJ= mysql.o memcached.o gd.o ncurses.o sem.o logfile.o sqlite3.o xhrhelper.o curl.o ssh2.o sftp.o ftp.o ftplib.o editline.o cairo.o expat.o
#OBJ= memcached.o gd.o ncurses.o sem.o logfile.o sqlite3.o xhrhelper.o curl.o ssh2.o sftp.o ftp.o ftplib.o editline.o cairo.o expat.o

V8DIR= ./v8-read-only

# V8LIB_64 := $(V8DIR)/out/x64.release/obj.target/tools/gyp
# V8LIB_32 := $(V8DIR)/out/ia32.release/obj.target/tools/gyp
V8LIB_64 := $(V8DIR)/out/x64.release/obj.target/tools/gyp
V8LIB_32 := $(V8DIR)/out/ia32.release/obj.target/tools/gyp
V8LIB_DIR := $(V8LIB_$(ARCH))

V8VERSION_64 := x64.release
V8VERSION_32 := ia32.release
V8VERSION := $(V8VERSION_$(ARCH))

V8= $(V8LIB_DIR)/libv8_base.a $(V8LIB_DIR)/libv8_snapshot.a $(V8LIB_DIR)/libv8.so
# V8LIBS = -L$(V8LIB_DIR) -lv8_base -lv8_snapshot
V8LIBS = -L$(V8LIB_DIR) -lv8

INCDIRS= -I$(V8DIR)/include -I/usr/include/mysql

LIBDIRS= -L$(V8LIB_DIR)/

CFLAGS = -fexceptions -fomit-frame-pointer -fdata-sections -ffunction-sections -fno-strict-aliasing -fvisibility=hidden -Wall -W -Wno-ignored-qualifiers -Wno-unused-function -Wno-unused-parameter -Wnon-virtual-dtor -m$(ARCH) -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -fno-strict-aliasing -DNEW_MEMCACHED

%.o: %.cpp SilkJS.h
g++ $(CFLAGS) -c $(INCDIRS) -o $*.o $*.cpp

silkjs: deps $(V8DIR) $(V8) $(CORE) $(OBJ) SilkJS.h Makefile
g++ -o silkjs $(CORE) $(OBJ) $(V8LIBS) -lmysqlclient -lmm -lgd -lncurses -lssl -lpthread -lsqlite3 -lcurl -lssh2 -lmemcached -lcairo -lexpat -ldl -Wl,-rpath=/usr/local/silkjs/src/v8,-rpath=$(V8LIB_DIR)

deps:
sudo apt-get -y install libmm-dev libmysqlclient-dev libmemcached-dev libgd2-xpm-dev libncurses5-dev libsqlite3-dev libcurl4-openssl-dev libssh2-1-dev libcairo2-dev

debug: CFLAGS += -g
debug: silkjs

bootstrap: CFLAGS += -DBOOTSTRAP_SILKJS

bootstrap: $(V8) $(CORE) SilkJS.h Makefile
g++ $(CFLAGS) -o bootstrap-silkjs $(CORE) -L$(V8LIB_DIR)/ -lv8_base -lv8_snapshot -lpthread

perms:
sudo chgrp $(GROUP) /usr/local /usr/local/bin
sudo chmod g+rwx /usr/local /usr/local/bin

install: silkjs perms
@rm -rf /usr/local/silkjs/builtin /usr/local/silkjs/bin /usr/local/silkjs/httpd /usr/local/silkjs/lib /usr/local/silkjs/modules /usr/local/silkjs/walkthrough /usr/local/silkjs/src
@mkdir -p /usr/local/bin /usr/local/silkjs /usr/local/silkjs/src/v8 /usr/local/silkjs/projects /usr/local/silkjs/contrib
cp -rp ../builtin ../examples ../httpd ../lib ../modules ../walkthrough /usr/local/silkjs
cp ../src/*.cpp ../src/*.h /usr/local/silkjs/src
cp -rp $(V8DIR)/include $(V8) /usr/local/silkjs/src/v8
mv /usr/local/silkjs/examples /usr/local/silkjs/bin
chmod 755 /usr/local/silkjs/bin/* /usr/local/silkjs/httpd/main.js
cp silkjs /usr/local/silkjs/bin
ln -sf /usr/local/silkjs/bin/silkjs /usr/local/bin
ln -sf /usr/local/silkjs/httpd/main.js /usr/local/bin/httpd-silk.js

$(V8DIR):
echo "svn checkout"
# svn checkout http://v8.googlecode.com/svn/branches/bleeding_edge/ v8-read-only
svn checkout http://v8.googlecode.com/svn/trunk/ v8-read-only

$(V8):
# cd $(V8DIR) && svn update && make dependencies && GYP_GENERATORS=make make GYPFLAGS="-Dcomponent=shared_library -Dv8_enable_extra_checks=0" -j 4 $(V8VERSION)
cd $(V8DIR) && svn update && make dependencies && GYP_GENERATORS=make make GYPFLAGS="-Dcomponent=shared_library" -j 4 $(V8VERSION)

update:
cd $(V8DIR) && svn update && make dependencies && GYP_GENERATORS=make make $(V8VERSION)
git pull

clean:
rm -rf silkjs *.o

realclean:
rm -rf silkjs *.o v8-read-only

release: silkjs
tar czvfp ~/SilkJS.tgz silkjs examples httpd lib

$(OBJ): SilkJS.h Makefile

$(CORE): SilkJS.h Makefile