Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 269 lines (204 sloc) 6.288 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)
87a5ac5 @klacke *** empty log message ***
authored
13 ERLBINDIR=`dirname $ERL` ; ERLBINDIR=`dirname $ERLBINDIR`/lib/erlang/bin
28e4c73 @klacke first attempt to run properly under cygwin
authored
14
f674082 @klacke ""
authored
15 AC_SUBST(ERL)
16 AC_SUBST(ERLC)
17
87a5ac5 @klacke *** empty log message ***
authored
18 AC_SUBST(ERLBINDIR)
f674082 @klacke ""
authored
19
177f03b @klacke addded configure option -with-defaultcharset
authored
20 AC_ARG_WITH(default-charset,
21 [ --with-defaultcharset=String specify default charset, i.e UTF-8 ])
22
23
24 if test "x$with_defaultcharset" = "x" ; then
25 DEFAULT_CHARSET=
26 else
27 DEFAULT_CHARSET=${with_defaultcharset}
28 fi
29
30 AC_SUBST(DEFAULT_CHARSET)
31
c9778e0 @klacke added support for 2 additional configure
authored
32
33
34 AC_ARG_WITH(extrainclude,
35 [ --with-extrainclude= dir to include if e.g. pam is installed in some odd place ])
36
37
38 if test "x$with_extrainclude" = "x" ; then
39 EXTRAINCLUDE=
40 else
41 EXTRAINCLUDE=-I${with_extrainclude}
42 fi
43
44 AC_SUBST(EXTRAINCLUDE)
45
46
47
48 AC_ARG_ENABLE(pam, [--disable-pam disables pam auth], EPAM=, EPAM=../priv/epam)
49 AC_SUBST(EPAM)
50
51
52
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
authored
53 dnl ----------------------------------------------------------------------
54 dnl
55 dnl BT_ERL_LIB_VSN figures out version of an erlang application
56 dnl and substitutes it as "APPNAME"_VSN
57 dnl
58
59 AC_DEFUN(BT_ERL_LIB_VSN,
60 [
61 AC_MSG_CHECKING([$1 version])
62 AC_CACHE_VAL(bt_cv_$1_vsn,
63 [bt_cv_$1_vsn="`ls ${ERLDIR} ${ERLDIR}/lib | \
64 awk -F- '/^$1-/ { if ([$]2 > v) v=[$]2; }
65 END { print v; }'`"
66 case "$bt_cv_$1_vsn" in
67 "")
68 AC_MSG_ERROR("Could not figure out version Erlang library: $1")
69 ;;
70 *)
71 ;;
72 esac])
73 translit($1, [a-z], [A-Z])_VSN=$bt_cv_$1_vsn
74 AC_SUBST(translit($1, [a-z], [A-Z])_VSN)dnl
75 AC_MSG_RESULT($bt_cv_$1_vsn)
76 ])dnl
77
78
28e4c73 @klacke first attempt to run properly under cygwin
authored
79 dnl
80 dnl I keep the cugwin dll code in case I later learn how to
81 dnl compile a linked in driver on windows using gcc
82 dnl
f674082 @klacke ""
authored
83
84 case "$target_os" in
0be3c7e @klacke untabified all of yaws
authored
85 *cygwin*)
28e4c73 @klacke first attempt to run properly under cygwin
authored
86
87 ERLDIR=`echo "${ERL}" | sed 's/\/bin\/*erl.*//'`
88 ERL_DLL_LIB="${ERLDIR}/usr/lib/erl_dll.lib"
89 AC_SUBST(ERL_DLL_LIB)
0be3c7e @klacke untabified all of yaws
authored
90 ;;
91 *)
92 ERLDIR=`awk -F= '/ROOTDIR=/ { print [$]2; exit; }' $ERL`;;
f674082 @klacke ""
authored
93 esac
94
28e4c73 @klacke first attempt to run properly under cygwin
authored
95 if test ! -d "$ERLDIR" ; then
0be3c7e @klacke untabified all of yaws
authored
96 AC_MSG_ERROR([Broken Erlang installation, $ERLDIR does not exist!])
f674082 @klacke ""
authored
97 fi
98 AC_SUBST(ERLDIR)
28e4c73 @klacke first attempt to run properly under cygwin
authored
99 AC_SUBST(ERL_DLL_LIB)
f674082 @klacke ""
authored
100
2ae9701 @klacke Added a 'make release' target in the top makefile. he release
authored
101 BT_ERL_LIB_VSN(erts)
102 BT_ERL_LIB_VSN(kernel)
103 BT_ERL_LIB_VSN(stdlib)
104 BT_ERL_LIB_VSN(sasl)
105 BT_ERL_LIB_VSN(mnesia)
106
28e4c73 @klacke first attempt to run properly under cygwin
authored
107 AC_PROG_CC
108 AC_PROG_GCC_TRADITIONAL
f674082 @klacke ""
authored
109
110
28e4c73 @klacke first attempt to run properly under cygwin
authored
111 dnl ===============================================================
112 dnl Checks for programs.
113 dnl ===============================================================
f674082 @klacke ""
authored
114
115
116
28e4c73 @klacke first attempt to run properly under cygwin
authored
117 dnl
118 dnl cygwin code here is broken and not used ....
119 dnl
f674082 @klacke ""
authored
120
121
122 case "$target_os" in
123 *cygwin*)
124 WIN32=win32
0be3c7e @klacke untabified all of yaws
authored
125 cat >> confdefs.h <<\EOF
28e4c73 @klacke first attempt to run properly under cygwin
authored
126 #define WIN32 1
127 EOF
0be3c7e @klacke untabified all of yaws
authored
128 LD_SHARED="gcc -shared"
129 DLL=dll
130 DLL_LIBS="-lc \"$ERL_DLL_LIB\""
131
f674082 @klacke ""
authored
132
0be3c7e @klacke untabified all of yaws
authored
133 EXE=.exe
134 AC_SUBST(EXE)
f674082 @klacke ""
authored
135
0be3c7e @klacke untabified all of yaws
authored
136 DLL=dll
137 AC_SUBST(DLL)
f674082 @klacke ""
authored
138
0be3c7e @klacke untabified all of yaws
authored
139 OBJ=obj
140 AC_SUBST(OBJ)
141 ;;
f674082 @klacke ""
authored
142 *)
143
144
0be3c7e @klacke untabified all of yaws
authored
145 LINKER=$CC
146 AC_SUBST(LINKER)
f674082 @klacke ""
authored
147
0be3c7e @klacke untabified all of yaws
authored
148 AC_SUBST(CFLAGS)
f674082 @klacke ""
authored
149
0be3c7e @klacke untabified all of yaws
authored
150 OUT="-o "
151 AC_SUBST(OUT)
f674082 @klacke ""
authored
152
0be3c7e @klacke untabified all of yaws
authored
153 DLL=so
154 AC_SUBST(DLL)
155 OBJ=o
156 AC_SUBST(OBJ)
f674082 @klacke ""
authored
157
158
0be3c7e @klacke untabified all of yaws
authored
159 ;;
f674082 @klacke ""
authored
160 esac
161
28e4c73 @klacke first attempt to run properly under cygwin
authored
162
163 AC_SUBST(DLL_LIBS)
164
f674082 @klacke ""
authored
165 AC_PROG_MAKE_SET
166 AC_PROG_INSTALL
167
168
6c7d7a4 @klacke configure/latex support and also slightly nicer listdir output by Han…
authored
169 dnl Make LaTeX and related commands configurable
170 dnl
171 dnl We might want to check whether latex is pdflatex and creates
172 dnl PDF instead of DVI without being given -output-format=dvi.
173 dnl However, this at least allows to give the working command at
174 dnl configure time.
175 AC_ARG_VAR([DVILATEX], [(pdf)latex command creating DVI file])
176 AC_CHECK_PROG([DVILATEX], [latex], [latex])
177
178 AC_ARG_VAR([DVIPS], [dvips command])
179 AC_CHECK_PROG([DVIPS], [dvips], [dvips])
180
181 AC_ARG_VAR([PDFLATEX], [(pdf)latex command creating PDF file])
182 AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex])
183
184 AC_ARG_VAR([EPSTOPDF], [epstopdf command])
185 AC_CHECK_PROG([EPSTOPDF], [epstopdf], [epstopdf])
186
187 AS_IF([test "x$DVILATEX" = "xno" || test "x$DVIPS" = "xno"],
188 [AC_SUBST([COND_DVILATEX], ["-"])],
189 [AC_SUBST([COND_DVILATEX], [""])])
190
191 AS_IF([test "x$PDFLATEX" = "xno" || test "x$EPSTOPDF" = "xno"],
192 [AC_SUBST([COND_PDFLATEX], ["-"])],
193 [AC_SUBST([COND_PDFLATEX], [""])])
194
195
7285034 @sstrollo Handle pam include files in different location...
sstrollo authored
196 dnl Sigh, pam headers do not seem to have a standard place. On FreeBSD and
197 dnl Linuces I've seen they are in /usr/include/security, but MacOS has them
198 dnl in /usr/include/pam... I'm to sick of M4 at this very moment to write
199 dnl a test that searches for the files, so hard coded for now...
c9778e0 @klacke added support for 2 additional configure
authored
200 dnl or use --with-extrainclude=....
7285034 @sstrollo Handle pam include files in different location...
sstrollo authored
201 CFLAGS="$CFLAGS -I/usr/include/security"
12471ad @klacke added configure support for sendfile
authored
202 HAVE_SENDFILE=false
7285034 @sstrollo Handle pam include files in different location...
sstrollo authored
203
f674082 @klacke ""
authored
204 case "$target_os" in
0be3c7e @klacke untabified all of yaws
authored
205 *linux*)
206 AC_DEFINE(LINUX)
207 LD_SHARED="gcc -shared"
208 AC_SUBST(LD_SHARED)
209 FPIC=-fpic
210 AC_SUBST(FPIC)
12471ad @klacke added configure support for sendfile
authored
211 HAVE_SENDFILE=true
0be3c7e @klacke untabified all of yaws
authored
212 ;;
213
214 *solaris*)
215 AC_DEFINE(SOLARIS)
216 LD_SHARED="ld -G"
217 AC_SUBST(LD_SHARED)
218 LIBS="$LIBS -lsocket -lnsl -lresolv"
219 AC_SUBST(LIBS)
220 FPIC=-fpic
221 AC_SUBST(FPIC)
222 ;;
223
224 *bsd*)
225 AC_DEFINE(BSD)
226 case "$target_os" in
12471ad @klacke added configure support for sendfile
authored
227 freebsd*)
228 HAVE_SENDFILE=true
229 ;;
0be3c7e @klacke untabified all of yaws
authored
230 bsdi*)
f674082 @klacke ""
authored
231 BSDI=bsdi
0be3c7e @klacke untabified all of yaws
authored
232 AC_DEFINE(BSDI)
233 AC_SUBST(BSDI)
234 ;;
235 esac
236 LD_SHARED="ld -Bshareable"
237 AC_SUBST(LD_SHARED)
238 FPIC=-fpic
239 AC_SUBST(FPIC)
240 ;;
241 *darwin*)
12471ad @klacke added configure support for sendfile
authored
242 HAVE_SENDFILE=true
0be3c7e @klacke untabified all of yaws
authored
243 CFLAGS="$CFLAGS -I/usr/include/pam"
244 LD_SHARED="gcc -bundle -fPIC -flat_namespace -undefined suppress"
245 AC_SUBST(LD_SHARED)
246 FPIC=-fPIC
247 AC_SUBST(FPIC)
248 ;;
249 *cygwin*)
250 AC_PATH_PROG(WERL, werl)
251 AC_SUBST(WERL)
252 AC_DEFINE(WIN32)
253 FPIC=-fpic
254 AC_SUBST(FPIC)
255 AC_SUBST(WIN32)
256 ;;
257 *)
f674082 @klacke ""
authored
258 AC_MSG_RESULT(unknown)
0be3c7e @klacke untabified all of yaws
authored
259 AC_MSG_ERROR(Non-supported target OS!)
260 ;;
f674082 @klacke ""
authored
261 esac
262
12471ad @klacke added configure support for sendfile
authored
263 AC_SUBST(HAVE_SENDFILE)
45a3567 @klacke test case number 1
authored
264 YTOP=`pwd`
265 AC_SUBST(YTOP)
f674082 @klacke ""
authored
266 AC_OUTPUT(include.mk)
45a3567 @klacke test case number 1
authored
267 AC_OUTPUT(test/support/include.mk)
268 AC_OUTPUT(test/support/include.sh)
Something went wrong with that request. Please try again.