-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathconfigure.in
47 lines (36 loc) · 1.37 KB
/
configure.in
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(cherly, 0.0.1)
# Checks for programs.
AC_PROG_CC
AC_PATH_PROG(ERL, erl)
AC_PATH_PROG(ERLC, erlc)
#
AC_ARG_WITH(judy,
[ --with-judy=<path> prefix of Judy installation. e.g. /usr/local or /usr],
[JUDY_PREFIX=$with_judy],
[JUDY_PREFIX=/usr/local])
AC_SUBST(JUDY_PREFIX)
JUDY_LIBS="-L${JUDY_PREFIX}/lib -lJudy"
JUDY_CFLAGS="-I${JUDY_PREFIX}/include"
AC_SUBST(JUDY_LIBS)
AC_SUBST(JUDY_CFLAGS)
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 -I./"
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([c/Makefile erl/Makefile Makefile])