Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 306 lines (238 sloc) 7.853 kb
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
klacke authored
1 DNA define([AC_CACHE_LOAD], )dnl
f674082 @klacke ""
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 ""
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 ""
klacke authored
12 AC_PATH_PROG(ERL, erl)
13 AC_PATH_PROG(ERLC, erlc)
8054c71 @klacke cygwin build patch by Davide marques
klacke authored
14 ERLBINDIR=`dirname "$ERL"` ; ERLBINDIR=`dirname "$ERLBINDIR"`/lib/erlang/bin
28e4c73 @klacke first attempt to run properly under cygwin
klacke authored
15
f674082 @klacke ""
klacke authored
16 AC_SUBST(ERL)
17 AC_SUBST(ERLC)
18
87a5ac5 @klacke *** empty log message ***
klacke authored
19 AC_SUBST(ERLBINDIR)
f674082 @klacke ""
klacke authored
20
189188b @klacke rm configure
klacke authored
21 AC_ARG_WITH(defaultcharset,
cd68727 @vinoski add --disable-sendfile option to configure, fix src/Makefile to clean…
vinoski authored
22 AS_HELP_STRING([--with-defaultcharset=String], [specify default charset, i.e UTF-8]))
177f03b @klacke addded configure option -with-defaultcharset
klacke 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
klacke authored
33
34
35 AC_ARG_WITH(extrainclude,
cd68727 @vinoski add --disable-sendfile option to configure, fix src/Makefile to clean…
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
klacke 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…
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
klacke authored
50 AC_SUBST(EPAM)
51
52
53
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
klacke 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
klacke authored
60 AC_DEFUN([BT_ERL_LIB_VSN],
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
klacke 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
klacke authored
64 [bt_cv_$1_vsn=`ls "${ERLDIR}" "${ERLDIR}/lib" | \
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
klacke authored
65 awk -F- '/^$1-/ { if ([$]2 > v) v=[$]2; }
8a5d8e7 @klacke Configure script broken on openbsd due to cygwin weirdness
klacke authored
66 END { print v; }'`
fdfd9e3 @klacke cvs fixes + install scripts gentoo/suse/redhat
klacke 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 ""
klacke authored
80
28e4c73 @klacke first attempt to run properly under cygwin
klacke authored
81
855d191 apparently erl can ?? soon be an executable, canot grep in script
Claes Wikstrom authored
82 ERLDIR=`"${ERL}" -noshell -eval 'io:format("~s",[[code:root_dir()]]), erlang:halt().'`
83 ERL_DLL_LIB="${ERLDIR}/usr/lib/erl_dll.lib"
84
f674082 @klacke ""
klacke authored
85
28e4c73 @klacke first attempt to run properly under cygwin
klacke authored
86 if test ! -d "$ERLDIR" ; then
0be3c7e @klacke untabified all of yaws
klacke authored
87 AC_MSG_ERROR([Broken Erlang installation, $ERLDIR does not exist!])
f674082 @klacke ""
klacke authored
88 fi
89 AC_SUBST(ERLDIR)
28e4c73 @klacke first attempt to run properly under cygwin
klacke authored
90 AC_SUBST(ERL_DLL_LIB)
f674082 @klacke ""
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
klacke 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
klacke 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
klacke authored
107 BT_ERL_LIB_VSN(ssl)
2ae9701 @klacke Added a 'make release' target in the top makefile. he release
klacke authored
108 BT_ERL_LIB_VSN(mnesia)
109
f5eb9d5 @klacke conditional compile of websockets
klacke authored
110
28e4c73 @klacke first attempt to run properly under cygwin
klacke authored
111 AC_PROG_CC
112 AC_PROG_GCC_TRADITIONAL
f674082 @klacke ""
klacke authored
113
114
28e4c73 @klacke first attempt to run properly under cygwin
klacke authored
115 dnl ===============================================================
116 dnl Checks for programs.
117 dnl ===============================================================
f674082 @klacke ""
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 ""
klacke authored
122 *cygwin*)
123 WIN32=win32
8a5d8e7 @klacke Configure script broken on openbsd due to cygwin weirdness
klacke authored
124 cat >> confdefs.h << EOF
28e4c73 @klacke first attempt to run properly under cygwin
klacke 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
klacke authored
128 DLL=dll
6ed3cb4 @klacke configure woes
klacke 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 ""
klacke authored
131
0be3c7e @klacke untabified all of yaws
klacke authored
132 EXE=.exe
133 AC_SUBST(EXE)
f674082 @klacke ""
klacke authored
134
0be3c7e @klacke untabified all of yaws
klacke authored
135 DLL=dll
136 AC_SUBST(DLL)
f674082 @klacke ""
klacke authored
137
0be3c7e @klacke untabified all of yaws
klacke authored
138 OBJ=obj
139 AC_SUBST(OBJ)
140 ;;
f674082 @klacke ""
klacke authored
141 *)
142
143
0be3c7e @klacke untabified all of yaws
klacke authored
144 LINKER=$CC
145 AC_SUBST(LINKER)
f674082 @klacke ""
klacke authored
146
0be3c7e @klacke untabified all of yaws
klacke authored
147 AC_SUBST(CFLAGS)
f674082 @klacke ""
klacke authored
148
0be3c7e @klacke untabified all of yaws
klacke authored
149 OUT="-o "
150 AC_SUBST(OUT)
f674082 @klacke ""
klacke authored
151
0be3c7e @klacke untabified all of yaws
klacke authored
152 DLL=so
153 AC_SUBST(DLL)
154 OBJ=o
155 AC_SUBST(OBJ)
f674082 @klacke ""
klacke authored
156
157
0be3c7e @klacke untabified all of yaws
klacke authored
158 ;;
f674082 @klacke ""
klacke authored
159 esac
160
28e4c73 @klacke first attempt to run properly under cygwin
klacke authored
161
162 AC_SUBST(DLL_LIBS)
163
f674082 @klacke ""
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 Han…
klacke 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
klacke 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
klacke 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
klacke authored
204 *linux*)
205 AC_DEFINE(LINUX)
3cdb645 @vinoski teach linux build to distinguish 32- and 64-bit erlang
vinoski authored
206 AC_RUN_IFELSE(
207 [AC_LANG_PROGRAM([],[dnl
208 halt(case erlang:system_info(wordsize) of
209 8 -> 0; 4 -> 1 end)])],
210 [AC_MSG_NOTICE(found 64-bit Erlang)
211 case "$host_cpu" in
212 x86_64) CBIT= ;;
213 *) CBIT=-m64 ;;
214 esac],
215 [AC_MSG_NOTICE(found 32-bit Erlang)
216 case "$host_cpu" in
217 i?86) CBIT= ;;
218 *) CBIT=-m32 ;;
219 esac])
220 CFLAGS="$CFLAGS $CBIT"
221 LD_SHARED="$CC $CBIT -shared"
0be3c7e @klacke untabified all of yaws
klacke authored
222 AC_SUBST(LD_SHARED)
223 FPIC=-fpic
224 AC_SUBST(FPIC)
12471ad @klacke added configure support for sendfile
klacke authored
225 HAVE_SENDFILE=true
0be3c7e @klacke untabified all of yaws
klacke authored
226 ;;
227
228 *solaris*)
229 AC_DEFINE(SOLARIS)
230 LD_SHARED="ld -G"
231 AC_SUBST(LD_SHARED)
232 LIBS="$LIBS -lsocket -lnsl -lresolv"
233 AC_SUBST(LIBS)
234 FPIC=-fpic
235 AC_SUBST(FPIC)
236 ;;
237
238 *bsd*)
239 AC_DEFINE(BSD)
3cdb645 @vinoski teach linux build to distinguish 32- and 64-bit erlang
vinoski authored
240 case "$host_os" in
12471ad @klacke added configure support for sendfile
klacke authored
241 freebsd*)
242 HAVE_SENDFILE=true
243 ;;
0be3c7e @klacke untabified all of yaws
klacke authored
244 bsdi*)
f674082 @klacke ""
klacke authored
245 BSDI=bsdi
0be3c7e @klacke untabified all of yaws
klacke authored
246 AC_DEFINE(BSDI)
247 AC_SUBST(BSDI)
248 ;;
249 esac
5018bcc @vinoski determine gcc flags for 32-bit or 64-bit Erlang on OS X Snow Leopard
vinoski authored
250 LD_SHARED="ld -Bshareable"
0be3c7e @klacke untabified all of yaws
klacke authored
251 AC_SUBST(LD_SHARED)
252 FPIC=-fpic
253 AC_SUBST(FPIC)
254 ;;
255 *darwin*)
10febe6 @vinoski added sendfile check for Darwin, since no sendfile is available on OS…
vinoski authored
256 AC_CHECK_LIB([c],[sendfile],[HAVE_SENDFILE=true])
3cdb645 @vinoski teach linux build to distinguish 32- and 64-bit erlang
vinoski authored
257 case "$host_os" in
5018bcc @vinoski determine gcc flags for 32-bit or 64-bit Erlang on OS X Snow Leopard
vinoski authored
258 darwin10*)
259 AC_LANG(Erlang)
260 AC_RUN_IFELSE(
261 [AC_LANG_PROGRAM([],[dnl
262 halt(case erlang:system_info(wordsize) of
263 8 -> 0; 4 -> 1 end)])],
264 [AC_MSG_NOTICE(found 64-bit Erlang)
265 CBIT=-m64],
266 [AC_MSG_NOTICE(found 32-bit Erlang)
267 CBIT=-m32])
268 ;;
269 *)
270 CBIT=""
271 ;;
272 esac
273 CFLAGS="$CFLAGS $CBIT -I/usr/include/pam"
274 LD_SHARED="$CC $CBIT -bundle -fPIC -flat_namespace -undefined suppress"
10febe6 @vinoski added sendfile check for Darwin, since no sendfile is available on OS…
vinoski authored
275 AC_SUBST(LD_SHARED)
0be3c7e @klacke untabified all of yaws
klacke authored
276 FPIC=-fPIC
277 AC_SUBST(FPIC)
278 ;;
279 *cygwin*)
280 AC_PATH_PROG(WERL, werl)
281 AC_SUBST(WERL)
282 AC_DEFINE(WIN32)
283 FPIC=-fpic
284 AC_SUBST(FPIC)
285 AC_SUBST(WIN32)
286 ;;
287 *)
f674082 @klacke ""
klacke authored
288 AC_MSG_RESULT(unknown)
3cdb645 @vinoski teach linux build to distinguish 32- and 64-bit erlang
vinoski authored
289 AC_MSG_ERROR(Unsupported host OS!)
0be3c7e @klacke untabified all of yaws
klacke authored
290 ;;
f674082 @klacke ""
klacke authored
291 esac
292
cd68727 @vinoski add --disable-sendfile option to configure, fix src/Makefile to clean…
vinoski authored
293 AC_ARG_ENABLE(sendfile, AS_HELP_STRING([--disable-sendfile], [disables use of sendfile system call]),
294 [ test "$enableval" = no && HAVE_SENDFILE=false ])
12471ad @klacke added configure support for sendfile
klacke authored
295 AC_SUBST(HAVE_SENDFILE)
45a3567 @klacke test case number 1
klacke authored
296 YTOP=`pwd`
297 AC_SUBST(YTOP)
f674082 @klacke ""
klacke authored
298 AC_OUTPUT(include.mk)
45a3567 @klacke test case number 1
klacke authored
299 AC_OUTPUT(test/support/include.mk)
300 AC_OUTPUT(test/support/include.sh)
47c0c70 @vinoski add pkg-config support contributed by Olivier Girondel
vinoski authored
301
302 dnl pkg-config support
303 . ./vsn.mk
304 AC_SUBST(YAWS_VSN)
305 AC_OUTPUT(yaws.pc)
Something went wrong with that request. Please try again.