Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 314 lines (247 sloc) 8.241 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
3cdb645 @vinoski teach linux build to distinguish 32- and 64-bit erlang
vinoski authored
9 AC_DEFINE_UNQUOTED(CPU_VENDOR_OS, "$host")
f674082 @klacke ""
authored
10
5018bcc @vinoski determine gcc flags for 32-bit or 64-bit Erlang on OS X Snow Leopard
vinoski authored
11 AC_ERLANG_NEED_ERL
f674082 @klacke ""
authored
12 AC_PATH_PROG(ERLC, erlc)
28e4c73 @klacke first attempt to run properly under cygwin
authored
13
f674082 @klacke ""
authored
14 AC_SUBST(ERL)
15 AC_SUBST(ERLC)
16
189188b @klacke rm configure
authored
17 AC_ARG_WITH(defaultcharset,
cd68727 @vinoski add --disable-sendfile option to configure, fix src/Makefile to clean ya...
vinoski authored
18 AS_HELP_STRING([--with-defaultcharset=String], [specify default charset, i.e UTF-8]))
177f03b @klacke addded configure option -with-defaultcharset
authored
19
20
21 if test "x$with_defaultcharset" = "x" ; then
22 DEFAULT_CHARSET=
23 else
24 DEFAULT_CHARSET=${with_defaultcharset}
25 fi
26
27 AC_SUBST(DEFAULT_CHARSET)
28
c9778e0 @klacke added support for 2 additional configure
authored
29
30
31 AC_ARG_WITH(extrainclude,
cd68727 @vinoski add --disable-sendfile option to configure, fix src/Makefile to clean ya...
vinoski authored
32 AS_HELP_STRING([--with-extrainclude=DIR], [dir to include if e.g. pam is installed in some odd place]))
c9778e0 @klacke added support for 2 additional configure
authored
33
34
35 if test "x$with_extrainclude" = "x" ; then
36 EXTRAINCLUDE=
37 else
38 EXTRAINCLUDE=-I${with_extrainclude}
39 fi
40
41 AC_SUBST(EXTRAINCLUDE)
42
43
44
cd68727 @vinoski add --disable-sendfile option to configure, fix src/Makefile to clean ya...
vinoski authored
45 AC_ARG_ENABLE(pam, AS_HELP_STRING([--disable-pam], [disables pam auth]), EPAM=, EPAM=../priv/epam)
c9778e0 @klacke added support for 2 additional configure
authored
46 AC_SUBST(EPAM)
47
48
49
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
authored
50 dnl ----------------------------------------------------------------------
51 dnl
52 dnl BT_ERL_LIB_VSN figures out version of an erlang application
53 dnl and substitutes it as "APPNAME"_VSN
54 dnl
55
f7d5ad8 @klacke configure patch by dnz
authored
56 AC_DEFUN([BT_ERL_LIB_VSN],
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
authored
57 [
58 AC_MSG_CHECKING([$1 version])
59 AC_CACHE_VAL(bt_cv_$1_vsn,
8a5d8e7 @klacke Configure script broken on openbsd due to cygwin weirdness
authored
60 [bt_cv_$1_vsn=`ls "${ERLDIR}" "${ERLDIR}/lib" | \
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
authored
61 awk -F- '/^$1-/ { if ([$]2 > v) v=[$]2; }
8a5d8e7 @klacke Configure script broken on openbsd due to cygwin weirdness
authored
62 END { print v; }'`
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
authored
63 case "$bt_cv_$1_vsn" in
64 "")
65 AC_MSG_ERROR("Could not figure out version Erlang library: $1")
66 ;;
67 *)
68 ;;
69 esac])
70 translit($1, [a-z], [A-Z])_VSN=$bt_cv_$1_vsn
71 AC_SUBST(translit($1, [a-z], [A-Z])_VSN)dnl
72 AC_MSG_RESULT($bt_cv_$1_vsn)
73 ])dnl
74
75
f674082 @klacke ""
authored
76
28e4c73 @klacke first attempt to run properly under cygwin
authored
77
6b56677 @vinoski filter erl output for setting ERLDIR
vinoski authored
78 ERLDIR=`"${ERL}" -noshell -eval 'io:format("~s~n",[[code:root_dir()]]), erlang:halt().' | tail -1`
e7e6404 @jamesleegwu configure ERLBINDIR relative to ERLDIR
jamesleegwu authored
79 ERLBINDIR="${ERLDIR}/bin"
855d191 apparently erl can ?? soon be an executable, canot grep in script
Claes Wikstrom authored
80 ERL_DLL_LIB="${ERLDIR}/usr/lib/erl_dll.lib"
81
f674082 @klacke ""
authored
82
28e4c73 @klacke first attempt to run properly under cygwin
authored
83 if test ! -d "$ERLDIR" ; then
0be3c7e @klacke untabified all of yaws
authored
84 AC_MSG_ERROR([Broken Erlang installation, $ERLDIR does not exist!])
f674082 @klacke ""
authored
85 fi
86 AC_SUBST(ERLDIR)
e7e6404 @jamesleegwu configure ERLBINDIR relative to ERLDIR
jamesleegwu authored
87 AC_SUBST(ERLBINDIR)
28e4c73 @klacke first attempt to run properly under cygwin
authored
88 AC_SUBST(ERL_DLL_LIB)
f674082 @klacke ""
authored
89
35a5c1a @vinoski add configure detection of erts bits support
vinoski authored
90 erts_vsn=`ls "${ERLDIR}" | grep ^erts- | tail -1 | sed 's/erts-//'`
297f2c9 @vinoski fix setting of ERTS_MAJOR and ERTS_MINOR
vinoski authored
91 ERTS_MINOR=`echo $erts_vsn | sed -e 's/^.\.//' -e 's/\..*//'`
92 ERTS_MAJOR=`echo $erts_vsn | sed 's/\..*//'`
f5eb9d5 @klacke conditional compile of websockets
authored
93 AC_SUBST(ERTS_MINOR)
94 AC_SUBST(ERTS_MAJOR)
95
35a5c1a @vinoski add configure detection of erts bits support
vinoski authored
96 if test $ERTS_MAJOR -gt 5 -o '(' $ERTS_MAJOR -eq 5 -a $ERTS_MINOR -gt 6 ')'; then
97 BITS_SUPPORT=true
98 fi
99 AC_SUBST(BITS_SUPPORT)
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)
b45c0a4 @klacke dialyzer work
authored
105 BT_ERL_LIB_VSN(ssl)
2ae9701 @klacke Added a 'make release' target in the top makefile. he release
authored
106 BT_ERL_LIB_VSN(mnesia)
107
f5eb9d5 @klacke conditional compile of websockets
authored
108
28e4c73 @klacke first attempt to run properly under cygwin
authored
109 AC_PROG_CC
110 AC_PROG_GCC_TRADITIONAL
f674082 @klacke ""
authored
111
112
28e4c73 @klacke first attempt to run properly under cygwin
authored
113 dnl ===============================================================
114 dnl Checks for programs.
115 dnl ===============================================================
f674082 @klacke ""
authored
116
117
118
3cdb645 @vinoski teach linux build to distinguish 32- and 64-bit erlang
vinoski authored
119 case "$host_os" in
f674082 @klacke ""
authored
120 *cygwin*)
121 WIN32=win32
8a5d8e7 @klacke Configure script broken on openbsd due to cygwin weirdness
authored
122 cat >> confdefs.h << EOF
28e4c73 @klacke first attempt to run properly under cygwin
authored
123 #define WIN32 1
124 EOF
c73cff6 yaws [PATCH] Use $CC instead of gcc
dnz@bk.ru authored
125 LD_SHARED="$CC -shared"
0be3c7e @klacke untabified all of yaws
authored
126 DLL=dll
6ed3cb4 @klacke configure woes
authored
127 DLL_LIBS="-lc \"$ERL_DLL_LIB\""
5018bcc @vinoski determine gcc flags for 32-bit or 64-bit Erlang on OS X Snow Leopard
vinoski authored
128
f674082 @klacke ""
authored
129
0be3c7e @klacke untabified all of yaws
authored
130 EXE=.exe
131 AC_SUBST(EXE)
f674082 @klacke ""
authored
132
0be3c7e @klacke untabified all of yaws
authored
133 DLL=dll
134 AC_SUBST(DLL)
f674082 @klacke ""
authored
135
0be3c7e @klacke untabified all of yaws
authored
136 OBJ=obj
137 AC_SUBST(OBJ)
138 ;;
f674082 @klacke ""
authored
139 *)
140
141
0be3c7e @klacke untabified all of yaws
authored
142 LINKER=$CC
143 AC_SUBST(LINKER)
f674082 @klacke ""
authored
144
0be3c7e @klacke untabified all of yaws
authored
145 AC_SUBST(CFLAGS)
f674082 @klacke ""
authored
146
0be3c7e @klacke untabified all of yaws
authored
147 OUT="-o "
148 AC_SUBST(OUT)
f674082 @klacke ""
authored
149
0be3c7e @klacke untabified all of yaws
authored
150 DLL=so
151 AC_SUBST(DLL)
152 OBJ=o
153 AC_SUBST(OBJ)
f674082 @klacke ""
authored
154
155
0be3c7e @klacke untabified all of yaws
authored
156 ;;
f674082 @klacke ""
authored
157 esac
158
28e4c73 @klacke first attempt to run properly under cygwin
authored
159
160 AC_SUBST(DLL_LIBS)
161
f674082 @klacke ""
authored
162 AC_PROG_MAKE_SET
163 AC_PROG_INSTALL
164
165
6c7d7a4 @klacke configure/latex support and also slightly nicer listdir output by Hans U...
authored
166 dnl Make LaTeX and related commands configurable
167 dnl
168 dnl We might want to check whether latex is pdflatex and creates
169 dnl PDF instead of DVI without being given -output-format=dvi.
170 dnl However, this at least allows to give the working command at
171 dnl configure time.
172 AC_ARG_VAR([DVILATEX], [(pdf)latex command creating DVI file])
173 AC_CHECK_PROG([DVILATEX], [latex], [latex])
174
175 AC_ARG_VAR([DVIPS], [dvips command])
176 AC_CHECK_PROG([DVIPS], [dvips], [dvips])
177
178 AC_ARG_VAR([PDFLATEX], [(pdf)latex command creating PDF file])
179 AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex])
180
181 AC_ARG_VAR([EPSTOPDF], [epstopdf command])
182 AC_CHECK_PROG([EPSTOPDF], [epstopdf], [epstopdf])
183
184 AS_IF([test "x$DVILATEX" = "xno" || test "x$DVIPS" = "xno"],
185 [AC_SUBST([COND_DVILATEX], ["-"])],
186 [AC_SUBST([COND_DVILATEX], [""])])
187
188 AS_IF([test "x$PDFLATEX" = "xno" || test "x$EPSTOPDF" = "xno"],
189 [AC_SUBST([COND_PDFLATEX], ["-"])],
190 [AC_SUBST([COND_PDFLATEX], [""])])
191
192
7285034 @sstrollo Handle pam include files in different location...
sstrollo authored
193 dnl Sigh, pam headers do not seem to have a standard place. On FreeBSD and
194 dnl Linuces I've seen they are in /usr/include/security, but MacOS has them
47c0c70 @vinoski add pkg-config support contributed by Olivier Girondel
vinoski authored
195 dnl in /usr/include/pam... I'm too sick of M4 at this very moment to write
7285034 @sstrollo Handle pam include files in different location...
sstrollo authored
196 dnl a test that searches for the files, so hard coded for now...
c9778e0 @klacke added support for 2 additional configure
authored
197 dnl or use --with-extrainclude=....
7285034 @sstrollo Handle pam include files in different location...
sstrollo authored
198 CFLAGS="$CFLAGS -I/usr/include/security"
12471ad @klacke added configure support for sendfile
authored
199 HAVE_SENDFILE=false
7285034 @sstrollo Handle pam include files in different location...
sstrollo authored
200
3cdb645 @vinoski teach linux build to distinguish 32- and 64-bit erlang
vinoski authored
201 case "$host_os" in
0be3c7e @klacke untabified all of yaws
authored
202 *linux*)
203 AC_DEFINE(LINUX)
98f8db9 @yrashk Fix configure failing to determine word size on Linux platform.
yrashk authored
204 AC_LANG(Erlang)
3cdb645 @vinoski teach linux build to distinguish 32- and 64-bit erlang
vinoski authored
205 AC_RUN_IFELSE(
206 [AC_LANG_PROGRAM([],[dnl
11b272b @vinoski use {wordsize, external} in configure script
vinoski authored
207 halt(try erlang:system_info({wordsize,external}) of
208 8 -> 0; 4 -> 1
209 catch _:badarg ->
210 case erlang:system_info(wordsize) of
211 8 -> 0; 4 -> 1
212 end end)])],
3cdb645 @vinoski teach linux build to distinguish 32- and 64-bit erlang
vinoski authored
213 [AC_MSG_NOTICE(found 64-bit Erlang)
214 case "$host_cpu" in
215 x86_64) CBIT= ;;
216 *) CBIT=-m64 ;;
217 esac],
218 [AC_MSG_NOTICE(found 32-bit Erlang)
219 case "$host_cpu" in
220 i?86) CBIT= ;;
221 *) CBIT=-m32 ;;
222 esac])
223 CFLAGS="$CFLAGS $CBIT"
224 LD_SHARED="$CC $CBIT -shared"
0be3c7e @klacke untabified all of yaws
authored
225 AC_SUBST(LD_SHARED)
226 FPIC=-fpic
227 AC_SUBST(FPIC)
12471ad @klacke added configure support for sendfile
authored
228 HAVE_SENDFILE=true
0be3c7e @klacke untabified all of yaws
authored
229 ;;
230
231 *solaris*)
232 AC_DEFINE(SOLARIS)
233 LD_SHARED="ld -G"
234 AC_SUBST(LD_SHARED)
235 LIBS="$LIBS -lsocket -lnsl -lresolv"
236 AC_SUBST(LIBS)
237 FPIC=-fpic
238 AC_SUBST(FPIC)
239 ;;
240
241 *bsd*)
242 AC_DEFINE(BSD)
3cdb645 @vinoski teach linux build to distinguish 32- and 64-bit erlang
vinoski authored
243 case "$host_os" in
12471ad @klacke added configure support for sendfile
authored
244 freebsd*)
245 HAVE_SENDFILE=true
246 ;;
0be3c7e @klacke untabified all of yaws
authored
247 bsdi*)
f674082 @klacke ""
authored
248 BSDI=bsdi
0be3c7e @klacke untabified all of yaws
authored
249 AC_DEFINE(BSDI)
250 AC_SUBST(BSDI)
251 ;;
252 esac
5018bcc @vinoski determine gcc flags for 32-bit or 64-bit Erlang on OS X Snow Leopard
vinoski authored
253 LD_SHARED="ld -Bshareable"
0be3c7e @klacke untabified all of yaws
authored
254 AC_SUBST(LD_SHARED)
255 FPIC=-fpic
256 AC_SUBST(FPIC)
257 ;;
258 *darwin*)
98f8db9 @yrashk Fix configure failing to determine word size on Linux platform.
yrashk authored
259 AC_LANG(C)
10febe6 @vinoski added sendfile check for Darwin, since no sendfile is available on OS X ...
vinoski authored
260 AC_CHECK_LIB([c],[sendfile],[HAVE_SENDFILE=true])
3cdb645 @vinoski teach linux build to distinguish 32- and 64-bit erlang
vinoski authored
261 case "$host_os" in
5018bcc @vinoski determine gcc flags for 32-bit or 64-bit Erlang on OS X Snow Leopard
vinoski authored
262 darwin10*)
263 AC_LANG(Erlang)
264 AC_RUN_IFELSE(
265 [AC_LANG_PROGRAM([],[dnl
11b272b @vinoski use {wordsize, external} in configure script
vinoski authored
266 halt(try erlang:system_info({wordsize,external}) of
267 8 -> 0; 4 -> 1
268 catch _:badarg ->
269 case erlang:system_info(wordsize) of
270 8 -> 0; 4 -> 1
271 end end)])],
5018bcc @vinoski determine gcc flags for 32-bit or 64-bit Erlang on OS X Snow Leopard
vinoski authored
272 [AC_MSG_NOTICE(found 64-bit Erlang)
273 CBIT=-m64],
274 [AC_MSG_NOTICE(found 32-bit Erlang)
275 CBIT=-m32])
276 ;;
277 *)
278 CBIT=""
279 ;;
280 esac
281 CFLAGS="$CFLAGS $CBIT -I/usr/include/pam"
282 LD_SHARED="$CC $CBIT -bundle -fPIC -flat_namespace -undefined suppress"
10febe6 @vinoski added sendfile check for Darwin, since no sendfile is available on OS X ...
vinoski authored
283 AC_SUBST(LD_SHARED)
0be3c7e @klacke untabified all of yaws
authored
284 FPIC=-fPIC
285 AC_SUBST(FPIC)
286 ;;
287 *cygwin*)
288 AC_PATH_PROG(WERL, werl)
289 AC_SUBST(WERL)
290 AC_DEFINE(WIN32)
291 FPIC=-fpic
292 AC_SUBST(FPIC)
293 AC_SUBST(WIN32)
294 ;;
295 *)
f674082 @klacke ""
authored
296 AC_MSG_RESULT(unknown)
3cdb645 @vinoski teach linux build to distinguish 32- and 64-bit erlang
vinoski authored
297 AC_MSG_ERROR(Unsupported host OS!)
0be3c7e @klacke untabified all of yaws
authored
298 ;;
f674082 @klacke ""
authored
299 esac
300
cd68727 @vinoski add --disable-sendfile option to configure, fix src/Makefile to clean ya...
vinoski authored
301 AC_ARG_ENABLE(sendfile, AS_HELP_STRING([--disable-sendfile], [disables use of sendfile system call]),
302 [ test "$enableval" = no && HAVE_SENDFILE=false ])
12471ad @klacke added configure support for sendfile
authored
303 AC_SUBST(HAVE_SENDFILE)
45a3567 @klacke test case number 1
authored
304 YTOP=`pwd`
305 AC_SUBST(YTOP)
f674082 @klacke ""
authored
306 AC_OUTPUT(include.mk)
45a3567 @klacke test case number 1
authored
307 AC_OUTPUT(test/support/include.mk)
308 AC_OUTPUT(test/support/include.sh)
47c0c70 @vinoski add pkg-config support contributed by Olivier Girondel
vinoski authored
309
310 dnl pkg-config support
311 . ./vsn.mk
312 AC_SUBST(YAWS_VSN)
313 AC_OUTPUT(yaws.pc)
Something went wrong with that request. Please try again.