Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 286 lines (219 sloc) 7.132 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 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
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
297f2c9 @vinoski fix setting of ERTS_MAJOR and ERTS_MINOR
vinoski authored
92 erts_vsn=`ls "${ERLDIR}" | grep ^erts | tail -1 | sed 's/erts-//'`
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
2ae9701 @klacke Added a 'make release' target in the top makefile. he release
authored
98 BT_ERL_LIB_VSN(erts)
99 BT_ERL_LIB_VSN(kernel)
100 BT_ERL_LIB_VSN(stdlib)
101 BT_ERL_LIB_VSN(sasl)
b45c0a4 @klacke dialyzer work
authored
102 BT_ERL_LIB_VSN(ssl)
2ae9701 @klacke Added a 'make release' target in the top makefile. he release
authored
103 BT_ERL_LIB_VSN(mnesia)
104
f5eb9d5 @klacke conditional compile of websockets
authored
105
28e4c73 @klacke first attempt to run properly under cygwin
authored
106 AC_PROG_CC
107 AC_PROG_GCC_TRADITIONAL
f674082 @klacke ""
authored
108
109
28e4c73 @klacke first attempt to run properly under cygwin
authored
110 dnl ===============================================================
111 dnl Checks for programs.
112 dnl ===============================================================
f674082 @klacke ""
authored
113
114
115
116 case "$target_os" in
117 *cygwin*)
118 WIN32=win32
8a5d8e7 @klacke Configure script broken on openbsd due to cygwin weirdness
authored
119 cat >> confdefs.h << EOF
28e4c73 @klacke first attempt to run properly under cygwin
authored
120 #define WIN32 1
121 EOF
c73cff6 yaws [PATCH] Use $CC instead of gcc
dnz@bk.ru authored
122 LD_SHARED="$CC -shared"
0be3c7e @klacke untabified all of yaws
authored
123 DLL=dll
6ed3cb4 @klacke configure woes
authored
124 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
125
f674082 @klacke ""
authored
126
0be3c7e @klacke untabified all of yaws
authored
127 EXE=.exe
128 AC_SUBST(EXE)
f674082 @klacke ""
authored
129
0be3c7e @klacke untabified all of yaws
authored
130 DLL=dll
131 AC_SUBST(DLL)
f674082 @klacke ""
authored
132
0be3c7e @klacke untabified all of yaws
authored
133 OBJ=obj
134 AC_SUBST(OBJ)
135 ;;
f674082 @klacke ""
authored
136 *)
137
138
0be3c7e @klacke untabified all of yaws
authored
139 LINKER=$CC
140 AC_SUBST(LINKER)
f674082 @klacke ""
authored
141
0be3c7e @klacke untabified all of yaws
authored
142 AC_SUBST(CFLAGS)
f674082 @klacke ""
authored
143
0be3c7e @klacke untabified all of yaws
authored
144 OUT="-o "
145 AC_SUBST(OUT)
f674082 @klacke ""
authored
146
0be3c7e @klacke untabified all of yaws
authored
147 DLL=so
148 AC_SUBST(DLL)
149 OBJ=o
150 AC_SUBST(OBJ)
f674082 @klacke ""
authored
151
152
0be3c7e @klacke untabified all of yaws
authored
153 ;;
f674082 @klacke ""
authored
154 esac
155
28e4c73 @klacke first attempt to run properly under cygwin
authored
156
157 AC_SUBST(DLL_LIBS)
158
f674082 @klacke ""
authored
159 AC_PROG_MAKE_SET
160 AC_PROG_INSTALL
161
162
6c7d7a4 @klacke configure/latex support and also slightly nicer listdir output by Hans U...
authored
163 dnl Make LaTeX and related commands configurable
164 dnl
165 dnl We might want to check whether latex is pdflatex and creates
166 dnl PDF instead of DVI without being given -output-format=dvi.
167 dnl However, this at least allows to give the working command at
168 dnl configure time.
169 AC_ARG_VAR([DVILATEX], [(pdf)latex command creating DVI file])
170 AC_CHECK_PROG([DVILATEX], [latex], [latex])
171
172 AC_ARG_VAR([DVIPS], [dvips command])
173 AC_CHECK_PROG([DVIPS], [dvips], [dvips])
174
175 AC_ARG_VAR([PDFLATEX], [(pdf)latex command creating PDF file])
176 AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex])
177
178 AC_ARG_VAR([EPSTOPDF], [epstopdf command])
179 AC_CHECK_PROG([EPSTOPDF], [epstopdf], [epstopdf])
180
181 AS_IF([test "x$DVILATEX" = "xno" || test "x$DVIPS" = "xno"],
182 [AC_SUBST([COND_DVILATEX], ["-"])],
183 [AC_SUBST([COND_DVILATEX], [""])])
184
185 AS_IF([test "x$PDFLATEX" = "xno" || test "x$EPSTOPDF" = "xno"],
186 [AC_SUBST([COND_PDFLATEX], ["-"])],
187 [AC_SUBST([COND_PDFLATEX], [""])])
188
189
7285034 @sstrollo Handle pam include files in different location...
sstrollo authored
190 dnl Sigh, pam headers do not seem to have a standard place. On FreeBSD and
191 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
192 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
193 dnl a test that searches for the files, so hard coded for now...
c9778e0 @klacke added support for 2 additional configure
authored
194 dnl or use --with-extrainclude=....
7285034 @sstrollo Handle pam include files in different location...
sstrollo authored
195 CFLAGS="$CFLAGS -I/usr/include/security"
12471ad @klacke added configure support for sendfile
authored
196 HAVE_SENDFILE=false
7285034 @sstrollo Handle pam include files in different location...
sstrollo authored
197
f674082 @klacke ""
authored
198 case "$target_os" in
0be3c7e @klacke untabified all of yaws
authored
199 *linux*)
200 AC_DEFINE(LINUX)
c73cff6 yaws [PATCH] Use $CC instead of gcc
dnz@bk.ru authored
201 LD_SHARED="$CC -shared"
0be3c7e @klacke untabified all of yaws
authored
202 AC_SUBST(LD_SHARED)
203 FPIC=-fpic
204 AC_SUBST(FPIC)
12471ad @klacke added configure support for sendfile
authored
205 HAVE_SENDFILE=true
0be3c7e @klacke untabified all of yaws
authored
206 ;;
207
208 *solaris*)
209 AC_DEFINE(SOLARIS)
210 LD_SHARED="ld -G"
211 AC_SUBST(LD_SHARED)
212 LIBS="$LIBS -lsocket -lnsl -lresolv"
213 AC_SUBST(LIBS)
214 FPIC=-fpic
215 AC_SUBST(FPIC)
216 ;;
217
218 *bsd*)
219 AC_DEFINE(BSD)
220 case "$target_os" in
12471ad @klacke added configure support for sendfile
authored
221 freebsd*)
222 HAVE_SENDFILE=true
223 ;;
0be3c7e @klacke untabified all of yaws
authored
224 bsdi*)
f674082 @klacke ""
authored
225 BSDI=bsdi
0be3c7e @klacke untabified all of yaws
authored
226 AC_DEFINE(BSDI)
227 AC_SUBST(BSDI)
228 ;;
229 esac
5018bcc @vinoski determine gcc flags for 32-bit or 64-bit Erlang on OS X Snow Leopard
vinoski authored
230 LD_SHARED="ld -Bshareable"
0be3c7e @klacke untabified all of yaws
authored
231 AC_SUBST(LD_SHARED)
232 FPIC=-fpic
233 AC_SUBST(FPIC)
234 ;;
235 *darwin*)
10febe6 @vinoski added sendfile check for Darwin, since no sendfile is available on OS X ...
vinoski authored
236 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
237 case "$target_os" in
238 darwin10*)
239 AC_LANG(Erlang)
240 AC_RUN_IFELSE(
241 [AC_LANG_PROGRAM([],[dnl
242 halt(case erlang:system_info(wordsize) of
243 8 -> 0; 4 -> 1 end)])],
244 [AC_MSG_NOTICE(found 64-bit Erlang)
245 CBIT=-m64],
246 [AC_MSG_NOTICE(found 32-bit Erlang)
247 CBIT=-m32])
248 ;;
249 *)
250 CBIT=""
251 ;;
252 esac
253 CFLAGS="$CFLAGS $CBIT -I/usr/include/pam"
254 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
255 AC_SUBST(LD_SHARED)
0be3c7e @klacke untabified all of yaws
authored
256 FPIC=-fPIC
257 AC_SUBST(FPIC)
258 ;;
259 *cygwin*)
260 AC_PATH_PROG(WERL, werl)
261 AC_SUBST(WERL)
262 AC_DEFINE(WIN32)
263 FPIC=-fpic
264 AC_SUBST(FPIC)
265 AC_SUBST(WIN32)
266 ;;
267 *)
f674082 @klacke ""
authored
268 AC_MSG_RESULT(unknown)
0be3c7e @klacke untabified all of yaws
authored
269 AC_MSG_ERROR(Non-supported target OS!)
270 ;;
f674082 @klacke ""
authored
271 esac
272
cd68727 @vinoski add --disable-sendfile option to configure, fix src/Makefile to clean ya...
vinoski authored
273 AC_ARG_ENABLE(sendfile, AS_HELP_STRING([--disable-sendfile], [disables use of sendfile system call]),
274 [ test "$enableval" = no && HAVE_SENDFILE=false ])
12471ad @klacke added configure support for sendfile
authored
275 AC_SUBST(HAVE_SENDFILE)
45a3567 @klacke test case number 1
authored
276 YTOP=`pwd`
277 AC_SUBST(YTOP)
f674082 @klacke ""
authored
278 AC_OUTPUT(include.mk)
45a3567 @klacke test case number 1
authored
279 AC_OUTPUT(test/support/include.mk)
280 AC_OUTPUT(test/support/include.sh)
47c0c70 @vinoski add pkg-config support contributed by Olivier Girondel
vinoski authored
281
282 dnl pkg-config support
283 . ./vsn.mk
284 AC_SUBST(YAWS_VSN)
285 AC_OUTPUT(yaws.pc)
Something went wrong with that request. Please try again.