Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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