Commits

Anonymous committed c99c9d6

preliminary automake copied from cherly project

Comments (0)

Files changed (3)

+ifeq ($(shell uname),Linux)
+ARCH = linux
+LIBEXT = so
+else
+ARCH = macosx
+LIBEXT = dylib
+endif
+
+PACKAGE_NAME = v8erl
+OUTLIB = lib$(PACKAGE_NAME).$(LIBEXT)
+
 # erlang
 ERL_ROOT = /opt/local/lib/erlang
 ERL_INC  = $(ERL_ROOT)/usr/include
 CPPSRCS  = $(wildcard src/*.cc)
 CPPOBJS  = $(patsubst %.cc,%.o,$(CPPSRCS))
 
-all: $(CPPOBJS) libv8erl.dylib
+all: $(CPPOBJS) $(OUTLIB)
 
 %.o: %.cc
 	$(CPP) $(CFLAGS) -o $@ $<
 .PHONY: clean
 
 clean:
-	-rm $(CPPOBJS) libv8erl.dylib
+	-rm $(CPPOBJS) $(OUTLIB)
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+
+ifeq ($(shell uname),Linux)
+ARCH = linux
+LIBEXT = so
+else
+ARCH = macosx
+LIBEXT = dylib
+endif
+
+all:
+	(cd src;$(MAKE))
+
+clean:
+	(cd src;$(MAKE) clean)
+
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+ 
+AC_PREREQ(2.60)
+AC_INIT(v8erl, 0.1)
+ 
+# Checks for programs.
+AC_PROG_CXX
+#AC_PATH_PROG(ERL, erl)
+#AC_PATH_PROG(ERLC, erlc)
+ 
+ERLDIR=`awk -F= '/ROOTDIR=/ { print [$]2; exit; }' $ERL`
+AC_SUBST(ERL)
+AC_SUBST(ERLC)
+AC_SUBST(ERLBINDIR)
+AC_SUBST(ERLDIR)
+ 
+ERL_INTERFACE=`ls ${ERLDIR}/lib | grep erl_interface | tail -n 1`
+ 
+ERTSBASE="`$ERL -noshell -noinput -eval 'io:format (\"~s\", [[ \"/\" ++ filename:join (lists:reverse ([ \"erts-\" ++ erlang:system_info (version) | tl (lists:reverse (string:tokens (code:lib_dir (), \"/\"))) ])) ]]).' -s erlang halt `"
+AC_SUBST(ERTSBASE)
+ 
+CPPFLAGS="$CPPFLAGS -I ${ERTSBASE}/include -I ${ERLDIR}/lib/${ERL_INTERFACE}/include -Wall -fPIC -Iinclude"
+ 
+LIBEI="${ERLDIR}/lib/${ERL_INTERFACE}/lib/libei.a"
+AC_SUBST(LIBEI)
+# Checks for header files.
+AC_CHECK_HEADERS([])
+ 
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+ 
+# Checks for library functions.
+AC_HEADER_STDC
+ 
+AC_OUTPUT([src/Makefile Makefile])
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.