Add autoconf files for better cross-platform compilation

This commit is contained in:
sergey-miryanov
2010-02-04 20:37:00 +05:00
parent f993cd95b1
commit 96efbce2e7
6 changed files with 6563 additions and 16 deletions

5
.gitignore vendored
View File

@@ -1,2 +1,7 @@
doc doc
config.log
config.status
autom4te.cache
Makefile
priv/Makefile

View File

@@ -1,6 +1,12 @@
ERL=erl ERL=@ERL@
ERL_KERNEL=@ERLANG_LIB_DIR_kernel@
ERL_STDLIB=@ERLANG_LIB_DIR_stdlib@
ERL_CRYPTO=@ERLANG_LIB_DIR_crypto@
ERL_COMPILER=@ERLANG_LIB_DIR_compiler@
ERL_HIPE=@ERLANG_LIB_DIR_hipe@
ERL_SYNTAX_TOOLS=@ERLANG_LIB_DIR_syntax_tools@
OTP_TOP=/usr/lib/erlang/lib OTP_TOP=/usr/lib/erlang/lib
PLT_SRC=$(OTP_TOP)/kernel-2.12.5/ebin $(OTP_TOP)/stdlib-1.15.5/ebin/ $(OTP_TOP)/crypto-1.5.3/ebin $(OTP_TOP)/compiler-4.5.5/ebin $(OTP_TOP)/hipe-3.6.9/ebin/ $(OTP_TOP)/syntax_tools-1.5.6/ebin $(OTP_TOP)/hipe-3.6.9/ebin ebin PLT_SRC=$(ERL_KERNEL)/ebin $(ERL_STDLIB)/ebin/ $(ERL_CRYPTO)/ebin $(ERL_COMPILER)/ebin $(ERL_HIPE)/ebin/ $(ERL_SYNTAX_TOOLS)/ebin ebin
all: compile docs all: compile docs

6489
configure vendored Executable file

File diff suppressed because it is too large Load Diff

45
configure.ac Normal file
View File

@@ -0,0 +1,45 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AC_CONFIG_SRCDIR([priv/erl_comm.c])
#AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
## Checks for libraries.
## FIXME: Replace `main' with a function in `-lei':
#AC_CHECK_LIB([ei], [main])
## FIXME: Replace `main' with a function in `-lerl_interface':
#AC_CHECK_LIB([erl_interface], [main])
## FIXME: Replace `main' with a function in `-lsqlite3':
#AC_CHECK_LIB([sqlite3], [main])
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([bzero strstr])
AC_ERLANG_NEED_ERLC
AC_ERLANG_SUBST_ROOT_DIR
AC_ERLANG_SUBST_LIB_DIR
AC_ERLANG_CHECK_LIB(erl_interface)
AC_ERLANG_CHECK_LIB(kernel)
AC_ERLANG_CHECK_LIB(stdlib)
AC_ERLANG_CHECK_LIB(crypto)
AC_ERLANG_CHECK_LIB(compiler)
AC_ERLANG_CHECK_LIB(hipe)
AC_ERLANG_CHECK_LIB(syntax_tools)
AC_CONFIG_FILES([Makefile
priv/Makefile])
AC_OUTPUT

View File

@@ -1,14 +0,0 @@
GCC=gcc
LDFLAGS=-shared -L/usr/local/lib -lsqlite3 -bundle -flat_namespace -undefined suppress -fPIC -lerl_interface -L/usr/local/lib/erlang/lib/erl_interface-3.6.1/lib -lei
SRCS=sqlite3_drv.c sqlite3_drv.h
OUTPUT=sqlite3_drv.so
CFLAGS=-o ../ebin/${OUTPUT} -I/usr/local/lib/erlang/usr/include/ -I/usr/local/lib/erlang/lib/erl_interface-3.6.1/include/ -arch x86_64
all: ../ebin/${OUTPUT}
../ebin/${OUTPUT}: sqlite3_drv.c sqlite3_drv.h
${GCC} sqlite3_drv.c ${LDFLAGS} ${CFLAGS}
clean:
rm -rf ${OUTPUT}

16
priv/Makefile.in Normal file
View File

@@ -0,0 +1,16 @@
ERL_INTERFACE=@ERLANG_LIB_DIR_erl_interface@
ERL_ROOT=@ERLANG_ROOT_DIR@
GCC=gcc
LDFLAGS=-shared -L/usr/lib -lsqlite3 -undefined -fPIC -lerl_interface -L$(ERL_INTERFACE)/lib -lei
SRCS=sqlite3_drv.c sqlite3_drv.h
OUTPUT=sqlite3_drv.so
CFLAGS=-o ../ebin/${OUTPUT} -I$(ERL_ROOT)/usr/include/ -I$(ERL_INTERFACE)/include/
all: ../ebin/${OUTPUT}
../ebin/${OUTPUT}: sqlite3_drv.c sqlite3_drv.h
${GCC} sqlite3_drv.c ${LDFLAGS} ${CFLAGS}
clean:
rm -rf ../ebin/${OUTPUT}