Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 291 lines (223 sloc) 7.263 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
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…
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…
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…
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
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 ""
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
121 case "$target_os" in
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 Han…
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
f674082 @klacke ""
authored
203 case "$target_os" in
0be3c7e @klacke untabified all of yaws
authored
204 *linux*)
205 AC_DEFINE(LINUX)
c73cff6 yaws [PATCH] Use $CC instead of gcc
dnz@bk.ru authored
206 LD_SHARED="$CC -shared"
0be3c7e @klacke untabified all of yaws
authored
207 AC_SUBST(LD_SHARED)
208 FPIC=-fpic
209 AC_SUBST(FPIC)
12471ad @klacke added configure support for sendfile
authored
210 HAVE_SENDFILE=true
0be3c7e @klacke untabified all of yaws
authored
211 ;;
212
213 *solaris*)
214 AC_DEFINE(SOLARIS)
215 LD_SHARED="ld -G"
216 AC_SUBST(LD_SHARED)
217 LIBS="$LIBS -lsocket -lnsl -lresolv"
218 AC_SUBST(LIBS)
219 FPIC=-fpic
220 AC_SUBST(FPIC)
221 ;;
222
223 *bsd*)
224 AC_DEFINE(BSD)
225 case "$target_os" in
12471ad @klacke added configure support for sendfile
authored
226 freebsd*)
227 HAVE_SENDFILE=true
228 ;;
0be3c7e @klacke untabified all of yaws
authored
229 bsdi*)
f674082 @klacke ""
authored
230 BSDI=bsdi
0be3c7e @klacke untabified all of yaws
authored
231 AC_DEFINE(BSDI)
232 AC_SUBST(BSDI)
233 ;;
234 esac
5018bcc @vinoski determine gcc flags for 32-bit or 64-bit Erlang on OS X Snow Leopard
vinoski authored
235 LD_SHARED="ld -Bshareable"
0be3c7e @klacke untabified all of yaws
authored
236 AC_SUBST(LD_SHARED)
237 FPIC=-fpic
238 AC_SUBST(FPIC)
239 ;;
240 *darwin*)
10febe6 @vinoski added sendfile check for Darwin, since no sendfile is available on OS…
vinoski authored
241 AC_CHECK_LIB([c],[sendfile],[HAVE_SENDFILE=true])
5018bcc @vinoski determine gcc flags for 32-bit or 64-bit Erlang on OS X Snow Leopard
vinoski authored
242 case "$target_os" in
243 darwin10*)
244 AC_LANG(Erlang)
245 AC_RUN_IFELSE(
246 [AC_LANG_PROGRAM([],[dnl
247 halt(case erlang:system_info(wordsize) of
248 8 -> 0; 4 -> 1 end)])],
249 [AC_MSG_NOTICE(found 64-bit Erlang)
250 CBIT=-m64],
251 [AC_MSG_NOTICE(found 32-bit Erlang)
252 CBIT=-m32])
253 ;;
254 *)
255 CBIT=""
256 ;;
257 esac
258 CFLAGS="$CFLAGS $CBIT -I/usr/include/pam"
259 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
260 AC_SUBST(LD_SHARED)
0be3c7e @klacke untabified all of yaws
authored
261 FPIC=-fPIC
262 AC_SUBST(FPIC)
263 ;;
264 *cygwin*)
265 AC_PATH_PROG(WERL, werl)
266 AC_SUBST(WERL)
267 AC_DEFINE(WIN32)
268 FPIC=-fpic
269 AC_SUBST(FPIC)
270 AC_SUBST(WIN32)
271 ;;
272 *)
f674082 @klacke ""
authored
273 AC_MSG_RESULT(unknown)
0be3c7e @klacke untabified all of yaws
authored
274 AC_MSG_ERROR(Non-supported target OS!)
275 ;;
f674082 @klacke ""
authored
276 esac
277
cd68727 @vinoski add --disable-sendfile option to configure, fix src/Makefile to clean…
vinoski authored
278 AC_ARG_ENABLE(sendfile, AS_HELP_STRING([--disable-sendfile], [disables use of sendfile system call]),
279 [ test "$enableval" = no && HAVE_SENDFILE=false ])
12471ad @klacke added configure support for sendfile
authored
280 AC_SUBST(HAVE_SENDFILE)
45a3567 @klacke test case number 1
authored
281 YTOP=`pwd`
282 AC_SUBST(YTOP)
f674082 @klacke ""
authored
283 AC_OUTPUT(include.mk)
45a3567 @klacke test case number 1
authored
284 AC_OUTPUT(test/support/include.mk)
285 AC_OUTPUT(test/support/include.sh)
47c0c70 @vinoski add pkg-config support contributed by Olivier Girondel
vinoski authored
286
287 dnl pkg-config support
288 . ./vsn.mk
289 AC_SUBST(YAWS_VSN)
290 AC_OUTPUT(yaws.pc)
Something went wrong with that request. Please try again.