forked from basho/erlang_js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch adds .mk files for FreeBSD, NetBSD, OpenBSD and DragonFlyBSD. It also patches some nspr files so that nspr builds correctly for the BSDs as well. To workaround the hardcoded invocation of 'make' in rebar.config, the Makefile has been renamed GNUmakefile and a new BSD compatible stub Makefile has been added. Additionally, instead of using make -C, a new Makefile target has been added to both Makefiles, 'c_src' which does the directory change as part of the make rule. This fixes issues where BSD make does not support the -C option. $(MAKE) was not used, because we can not gurantee that the user built the top-level repo (eg riak) by using (g)make instead of calling rebar compile. Also, its unclear if rebar even supports the use of $(MAKE) in hook commands.
- Loading branch information
Showing
13 changed files
with
834 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
all: | ||
$(REBAR) compile | ||
|
||
verbose: | ||
$(REBAR) compile verbose=1 | ||
|
||
clean: c_src_clean | ||
rm -rf tests_ebin docs | ||
$(REBAR) clean | ||
|
||
c_src: | ||
cd c_src; $(MAKE) | ||
|
||
c_src_clean: | ||
cd c_src; $(MAKE) clean | ||
|
||
test: all | ||
@mkdir -p tests_ebin | ||
@cd tests;erl -make | ||
@erl -noshell -boot start_sasl -pa ebin -pa tests_ebin -s erlang_js -eval 'test_suite:test().' -s init stop | ||
@rm -f ebin/test_* ebin/*_tests.erl | ||
|
||
docs: all | ||
@mkdir -p docs | ||
@./build_docs.sh | ||
|
||
.PHONY: c_src docs | ||
|
||
include rebar.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
# This is a stub Makefile that invokes GNU make which will read the GNUmakefile | ||
# instead of this file. This provides compatability on systems where GNU make is | ||
# not the system 'make' (eg. most non-linux UNIXes). | ||
|
||
all: | ||
$(REBAR) compile | ||
@gmake all | ||
|
||
verbose: | ||
$(REBAR) compile verbose=1 | ||
@gmake verbose | ||
|
||
clean: | ||
rm -rf tests_ebin docs | ||
$(REBAR) clean | ||
cd c_src; $(MAKE) clean | ||
|
||
test: all | ||
@mkdir -p tests_ebin | ||
@cd tests;erl -make | ||
@erl -noshell -boot start_sasl -pa ebin -pa tests_ebin -s erlang_js -eval 'test_suite:test().' -s init stop | ||
@rm -f ebin/test_* ebin/*_tests.erl | ||
test: | ||
@gmake test | ||
|
||
docs: all | ||
@mkdir -p docs | ||
@./build_docs.sh | ||
docs: | ||
@gmake docs | ||
|
||
include rebar.mk | ||
c_src: FORCE | ||
@gmake c_src | ||
FORCE: | ||
|
||
c_src_clean: | ||
@gmake c_src_clean | ||
|
||
clean: | ||
@gmake clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- c_src/js.orig/src/config/Dragonfly.mk 1969-12-31 19:00:00.000000000 -0500 | ||
+++ c_src/js/src/config/DragonFly.mk 2011-03-30 20:50:05.000000000 -0400 | ||
@@ -0,0 +1,94 @@ | ||
+# -*- Mode: makefile -*- | ||
+# | ||
+# ***** BEGIN LICENSE BLOCK ***** | ||
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1 | ||
+# | ||
+# The contents of this file are subject to the Mozilla Public License Version | ||
+# 1.1 (the "License"); you may not use this file except in compliance with | ||
+# the License. You may obtain a copy of the License at | ||
+# http://www.mozilla.org/MPL/ | ||
+# | ||
+# Software distributed under the License is distributed on an "AS IS" basis, | ||
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | ||
+# for the specific language governing rights and limitations under the | ||
+# License. | ||
+# | ||
+# The Original Code is Mozilla Communicator client code, released | ||
+# March 31, 1998. | ||
+# | ||
+# The Initial Developer of the Original Code is | ||
+# Netscape Communications Corporation. | ||
+# Portions created by the Initial Developer are Copyright (C) 1998 | ||
+# the Initial Developer. All Rights Reserved. | ||
+# | ||
+# Contributor(s): | ||
+# | ||
+# Alternatively, the contents of this file may be used under the terms of | ||
+# either the GNU General Public License Version 2 or later (the "GPL"), or | ||
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | ||
+# in which case the provisions of the GPL or the LGPL are applicable instead | ||
+# of those above. If you wish to allow use of your version of this file only | ||
+# under the terms of either the GPL or the LGPL, and not to allow others to | ||
+# use your version of this file under the terms of the MPL, indicate your | ||
+# decision by deleting the provisions above and replace them with the notice | ||
+# and other provisions required by the GPL or the LGPL. If you do not delete | ||
+# the provisions above, a recipient may use your version of this file under | ||
+# the terms of any one of the MPL, the GPL or the LGPL. | ||
+# | ||
+# ***** END LICENSE BLOCK ***** | ||
+ | ||
+# | ||
+# Config for FreeBSD/NetBSD/OpenBSD. | ||
+# | ||
+ | ||
+#CC = gcc | ||
+#CCC = g++ | ||
+CFLAGS+= -Wall -Wno-format | ||
+OS_CFLAGS= -DXP_UNIX -DSVR4 | ||
+OS_CFLAGS+= -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE # -DHAVE_LOCALTIME_R | ||
+INTERP_CFLAGS+= `pkg-config --cflags-only-I nspr` | ||
+ | ||
+RANLIB = echo | ||
+MKSHLIB = $(LD) -lm `pkg-config --libs nspr` -shared $(LDFLAGS) $(XMKSHLIBOPTS) | ||
+ | ||
+#.c.o: | ||
+# $(CC) -c -MD $*.d $(CFLAGS) $< | ||
+ | ||
+CPU_ARCH = $(shell uname -m) | ||
+# don't filter in x86-64 architecture | ||
+ifneq (amd64,$(CPU_ARCH)) | ||
+ifeq (86,$(findstring 86,$(CPU_ARCH))) | ||
+CPU_ARCH = x86 | ||
+OS_CFLAGS+= -DX86_LINUX | ||
+ | ||
+ifeq (gcc, $(CC)) | ||
+# if using gcc on x86, check version for opt bug | ||
+# (http://bugzilla.mozilla.org/show_bug.cgi?id=24892) | ||
+GCC_VERSION := $(shell gcc -v 2>&1 | grep version | awk '{ print $$3 }') | ||
+GCC_LIST:=$(sort 2.91.66 $(GCC_VERSION) ) | ||
+ifeq (2.91.66, $(firstword $(GCC_LIST))) | ||
+CFLAGS+= -DGCC_OPT_BUG | ||
+endif | ||
+endif | ||
+endif | ||
+endif | ||
+ | ||
+GFX_ARCH = x | ||
+ | ||
+OS_LIBS = -lm $(LDFLAGS) | ||
+ | ||
+ASFLAGS += -x assembler-with-cpp | ||
+ | ||
+ | ||
+ifeq ($(CPU_ARCH),alpha) | ||
+ | ||
+# Ask the C compiler on alpha linux to let us work with denormalized | ||
+# double values, which are required by the ECMA spec. | ||
+ | ||
+OS_CFLAGS += -mieee | ||
+endif | ||
+ | ||
+JS_EDITLINE = 1 | ||
+ | ||
+OS_CFLAGS += -DHAVE_VA_COPY -DVA_COPY=va_copy | ||
+OS_CFLAGS += -DPIC -fPIC -DJS_HAVE_LONG_LONG -DHAVE_INTTYPES_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
--- c_src.orig/js/src/config/FreeBSD.mk 1969-12-31 19:00:00.000000000 -0500 | ||
+++ c_src/js/src/config/FreeBSD.mk 2011-03-30 20:12:51.000000000 -0400 | ||
@@ -0,0 +1,99 @@ | ||
+# -*- Mode: makefile -*- | ||
+# | ||
+# ***** BEGIN LICENSE BLOCK ***** | ||
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1 | ||
+# | ||
+# The contents of this file are subject to the Mozilla Public License Version | ||
+# 1.1 (the "License"); you may not use this file except in compliance with | ||
+# the License. You may obtain a copy of the License at | ||
+# http://www.mozilla.org/MPL/ | ||
+# | ||
+# Software distributed under the License is distributed on an "AS IS" basis, | ||
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | ||
+# for the specific language governing rights and limitations under the | ||
+# License. | ||
+# | ||
+# The Original Code is Mozilla Communicator client code, released | ||
+# March 31, 1998. | ||
+# | ||
+# The Initial Developer of the Original Code is | ||
+# Netscape Communications Corporation. | ||
+# Portions created by the Initial Developer are Copyright (C) 1998 | ||
+# the Initial Developer. All Rights Reserved. | ||
+# | ||
+# Contributor(s): | ||
+# | ||
+# Alternatively, the contents of this file may be used under the terms of | ||
+# either the GNU General Public License Version 2 or later (the "GPL"), or | ||
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | ||
+# in which case the provisions of the GPL or the LGPL are applicable instead | ||
+# of those above. If you wish to allow use of your version of this file only | ||
+# under the terms of either the GPL or the LGPL, and not to allow others to | ||
+# use your version of this file under the terms of the MPL, indicate your | ||
+# decision by deleting the provisions above and replace them with the notice | ||
+# and other provisions required by the GPL or the LGPL. If you do not delete | ||
+# the provisions above, a recipient may use your version of this file under | ||
+# the terms of any one of the MPL, the GPL or the LGPL. | ||
+# | ||
+# ***** END LICENSE BLOCK ***** | ||
+ | ||
+# | ||
+# Config for all versions of Linux | ||
+# | ||
+ | ||
+CC ?= gcc | ||
+CCC ?= g++ | ||
+CFLAGS += -Wall -Wno-format | ||
+OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R | ||
+ | ||
+RANLIB = echo | ||
+MKSHLIB = $(LD) -shared $(XMKSHLIBOPTS) | ||
+ | ||
+#.c.o: | ||
+# $(CC) -c -MD $*.d $(CFLAGS) $< | ||
+ | ||
+CPU_ARCH = $(shell uname -m) | ||
+# don't filter in x86-64 architecture | ||
+ifneq (x86_64,$(CPU_ARCH)) | ||
+ifeq (86,$(findstring 86,$(CPU_ARCH))) | ||
+CPU_ARCH = x86 | ||
+OS_CFLAGS+= -DX86_LINUX | ||
+ | ||
+ifeq (gcc, $(CC)) | ||
+# if using gcc on x86, check version for opt bug | ||
+# (http://bugzilla.mozilla.org/show_bug.cgi?id=24892) | ||
+GCC_VERSION := $(shell gcc -v 2>&1 | grep version | awk '{ print $$3 }') | ||
+GCC_LIST:=$(sort 2.91.66 $(GCC_VERSION) ) | ||
+ | ||
+ifeq (2.91.66, $(firstword $(GCC_LIST))) | ||
+CFLAGS+= -DGCC_OPT_BUG | ||
+endif | ||
+endif | ||
+endif | ||
+endif | ||
+ | ||
+GFX_ARCH = x | ||
+ | ||
+OS_LIBS = -lm | ||
+ | ||
+ASFLAGS += -x assembler-with-cpp | ||
+ | ||
+ | ||
+ifeq ($(CPU_ARCH),alpha) | ||
+ | ||
+# Ask the C compiler on alpha linux to let us work with denormalized | ||
+# double values, which are required by the ECMA spec. | ||
+ | ||
+OS_CFLAGS += -mieee | ||
+endif | ||
+ | ||
+# Use the editline library to provide line-editing support. | ||
+JS_READLINE = 1 | ||
+ | ||
+OS_CFLAGS += -DHAVE_VA_COPY -DVA_COPY=va_copy | ||
+ | ||
+ifeq ($(CPU_ARCH),sparc64) | ||
+OS_CFLAGS += -DPIC -fPIC | ||
+else | ||
+OS_CFLAGS += -DPIC -fpic | ||
+endif |
Oops, something went wrong.