aboutsummaryrefslogtreecommitdiffhomepage
path: root/config/configure.in
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2011-10-11 15:05:38 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2011-10-11 15:05:38 +0200
commit1efec3952b780cc675ae111313017c3b91d20a01 (patch)
tree8a2d77b52e2c558976c8d2d362edf8837e2066ea /config/configure.in
downloaderlang-slang-fork-1efec3952b780cc675ae111313017c3b91d20a01.tar.gz
initial commit based on erlang-slang 1.0 release (debian tar ball)
Diffstat (limited to 'config/configure.in')
-rw-r--r--config/configure.in89
1 files changed, 89 insertions, 0 deletions
diff --git a/config/configure.in b/config/configure.in
new file mode 100644
index 0000000..1c3ac53
--- /dev/null
+++ b/config/configure.in
@@ -0,0 +1,89 @@
+dnl Process this file with autoconf to produce a configure script.
+
+dnl while debugging configure.in
+dnl it's good to disable the cache
+
+dnl define([AC_CACHE_LOAD], )dnl
+dnl define([AC_CACHE_SAVE], )dnl
+
+AC_INIT(../src/slang.erl)
+
+AC_CONFIG_AUX_DIR(`pwd`)
+
+dnl work out who the cpu, vendor and OS are
+AC_CANONICAL_SYSTEM
+AC_DEFINE_UNQUOTED(CPU_VENDOR_OS, "$target")
+
+dnl ===============================================================
+dnl Checks for programs.
+dnl ===============================================================
+
+
+
+
+AC_ARG_WITH(slang-include, [ --with-slang-include=DIR installed slang library],
+ SLANG_INCLUDE=$withval,
+ if test "x$SLANG_INCLUDE" = x; then
+ SLANG_INCLUDE=/usr/include/slang
+ fi
+ echo using $SLANG_INCLUDE
+ )
+
+AC_SUBST(SLANG_INCLUDE)
+
+case "$target_os" in
+ *cygwin*)
+ :
+ dnl fix this later
+ ;;
+ linux*)
+ AC_DEFINE(LINUX)
+ LD_SHARED="ld -shared"
+ ;;
+ *bsd*)
+ AC_DEFINE(BSD)
+ LD_SHARED="ld -Bshareable"
+ ;;
+ *solaris*)
+ AC_DEFINE(SOLARIS)
+ LD_SHARED="ld -G"
+ ;;
+ *)
+ LD_SHARED="ld -shared"
+ ;;
+esac
+
+AC_SUBST(LD_SHARED)
+
+
+AC_DEFUN(BT_REQUIRE_PATH_PROG,
+[
+ AC_PATH_PROG($1, $2, no, $3)
+ case [$]$1 in
+ /*)
+ # Ok
+ ;;
+ no)
+ # Not found
+ AC_MSG_ERROR("$1 not found in path!")
+ ;;
+ *)
+ # Not an absoluet path
+ AC_MSG_ERROR("Could not find absolute path to $1")
+ ;;
+ esac
+])dnl
+
+
+BT_REQUIRE_PATH_PROG(ERL, erl)
+BT_REQUIRE_PATH_PROG(ERLC, erlc)
+
+echo ERL $ERL
+
+ERLDIR=`awk -F= '/ROOTDIR=/ { print [$]2; exit; }' $ERL`
+AC_SUBST(ERLDIR)
+
+
+AC_OUTPUT(../include.mk)
+
+