aboutsummaryrefslogtreecommitdiffhomepage
path: root/config/configure.in
blob: bcf32800bbaf0fa72f6624d29e1450d24a9056d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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)