Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 182 lines (133 sloc) 3.265 kb
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
authored
1 DNA define([AC_CACHE_LOAD], )dnl
f674082 @klacke ""
authored
2 dnl define([AC_CACHE_SAVE], )dnl
3
4 AC_INIT(Makefile)
5
6
7 dnl work out who the cpu, vendor and OS are
8 AC_CANONICAL_SYSTEM
9 AC_DEFINE_UNQUOTED(CPU_VENDOR_OS, "$target")
10
11 AC_PATH_PROG(ERL, erl)
12 AC_PATH_PROG(ERLC, erlc)
13 AC_SUBST(ERL)
14 AC_SUBST(ERLC)
15
16
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
authored
17 dnl ----------------------------------------------------------------------
18 dnl
19 dnl BT_ERL_LIB_VSN figures out version of an erlang application
20 dnl and substitutes it as "APPNAME"_VSN
21 dnl
22
23 AC_DEFUN(BT_ERL_LIB_VSN,
24 [
25 AC_MSG_CHECKING([$1 version])
26 AC_CACHE_VAL(bt_cv_$1_vsn,
27 [bt_cv_$1_vsn="`ls ${ERLDIR} ${ERLDIR}/lib | \
28 awk -F- '/^$1-/ { if ([$]2 > v) v=[$]2; }
29 END { print v; }'`"
30 case "$bt_cv_$1_vsn" in
31 "")
32 AC_MSG_ERROR("Could not figure out version Erlang library: $1")
33 ;;
34 *)
35 ;;
36 esac])
37 translit($1, [a-z], [A-Z])_VSN=$bt_cv_$1_vsn
38 AC_SUBST(translit($1, [a-z], [A-Z])_VSN)dnl
39 AC_MSG_RESULT($bt_cv_$1_vsn)
40 ])dnl
41
42
43
44
45
f674082 @klacke ""
authored
46
47 case "$target_os" in
48 *cygwin*)
49 ERLDIR=`echo ${ERL} | sed 's/\/erts.*//'`
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
authored
50 ERL_DLL_LIB=`./scripts/ntpath.sh ${ERLDIR}/usr/lib/erl_dll.lib`
f674082 @klacke ""
authored
51 AC_SUBST(ERL_DLL_LIB)
52 ;;
53 *)
54 ERLDIR=`awk -F= '/ROOTDIR=/ { print [$]2; exit; }' $ERL`;;
55 esac
56
57 if test ! -d $ERLDIR ; then
58 AC_MSG_ERROR([Broken Erlang installation, $ERLDIR does not exist!])
59 fi
60 AC_SUBST(ERLDIR)
61
62
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
authored
63 BT_ERL_LIB_VSN(erl_interface)
f674082 @klacke ""
authored
64
65 ERL_INTERFACE_LIB=${ERLDIR}/lib/erl_interface-${ERL_INTERFACE_VSN}/lib
66 case $target_os in
67 *cygwin*)
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
authored
68 ERL_INTERFACE_LIBS=`./scripts/ntpath.sh "$ERL_INTERFACE_LIB/erl_interface.lib $ERL_INTERFACE_LIB/ei.lib"`;;
f674082 @klacke ""
authored
69 *)
70 ERL_INTERFACE_LIBS="-lerl_interface -lei ";;
71 esac
72
73
74
75
76 ERL_INTERFACE_INCLUDE=${ERLDIR}/lib/erl_interface-${ERL_INTERFACE_VSN}/include
77 AC_SUBST(ERL_INTERFACE_LIB)dnl
78 AC_SUBST(ERL_INTERFACE_LIBS)dnl
79 AC_SUBST(ERL_INTERFACE_INCLUDE)dnl
80
81
82
83 dnl ===============================================================
84 dnl Checks for programs.
85 dnl ===============================================================
86
87 case "$target_os" in
88 *cygwin*)
89 WIN32=win32
90 AC_DEFINE(WIN32)
91 AC_SUBST(WIN32)
92
93 STRIP=echo
94 AC_SUBST(STRIP)
95
96 OUT="/out:"
97 AC_SUBST(OUT)
98
99 AC_SUBST(MATHLIB)
100
101 EXE=.exe
102 AC_SUBST(EXE)
103
104 DLL=dll
105 AC_SUBST(DLL)
106
107 OBJ=obj
108 AC_SUBST(OBJ)
109 ;;
110 *)
111 AC_PROG_CC
112 AC_PROG_GCC_TRADITIONAL
113
114 STRIP=strip
115 AC_SUBST(STRIP)
116
117 LINKER=$CC
118 AC_SUBST(LINKER)
119
120 AC_SUBST(CFLAGS)
121
122 OUT="-o "
123 AC_SUBST(OUT)
124
125 MATHLIB=-lm
126 AC_SUBST(MATHLIB)
127
128 DLL=so
129 AC_SUBST(DLL)
130
131 OBJ=o
132 AC_SUBST(OBJ)
133
134 FPIC=-fpic
135 AC_SUBST(FPIC)
136
137 ;;
138 esac
139
140 AC_PROG_MAKE_SET
141 AC_PROG_INSTALL
142
143
144 case "$target_os" in
145 *linux*)
146 AC_DEFINE(LINUX)
147 LD_SHARED="ld -shared"
148 AC_SUBST(LD_SHARED)
149 ;;
150
151 *solaris*)
152 AC_DEFINE(SOLARIS)
153 LD_SHARED="ld -G"
154 AC_SUBST(LD_SHARED)
155 LIBS="$LIBS -lsocket -lnsl -lresolv"
156 AC_SUBST(LIBS)
157 ;;
158
159 *bsd*)
160 AC_DEFINE(BSD)
161 case "$target_os" in
162 bsdi*)
163 BSDI=bsdi
164 AC_DEFINE(BSDI)
165 AC_SUBST(BSDI)
166 ;;
167 esac
168 LD_SHARED="ld -Bshareable"
169 AC_SUBST(LD_SHARED)
170 ;;
171 *cygwin*)
172 ;;
173 *)
174 AC_MSG_RESULT(unknown)
175 AC_MSG_ERROR(Non-supported target OS!)
176 ;;
177 esac
178
179
180
181 AC_OUTPUT(include.mk)
Something went wrong with that request. Please try again.