Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 271 lines (207 sloc) 6.566 kb
fdfd9e3 Claes Wikstrom cvs fixes + install scripts gentoo/suse/redhat
authored
1 DNA define([AC_CACHE_LOAD], )dnl
f674082 Claes Wikstrom ""
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
11 AC_PATH_PROG(ERL, erl)
12 AC_PATH_PROG(ERLC, erlc)
8054c71 Claes Wikstrom cygwin build patch by Davide marques
authored
13 ERLBINDIR=`dirname "$ERL"` ; ERLBINDIR=`dirname "$ERLBINDIR"`/lib/erlang/bin
28e4c73 Claes Wikstrom first attempt to run properly under cygwin
authored
14
f674082 Claes Wikstrom ""
authored
15 AC_SUBST(ERL)
16 AC_SUBST(ERLC)
17
87a5ac5 Claes Wikstrom *** empty log message ***
authored
18 AC_SUBST(ERLBINDIR)
f674082 Claes Wikstrom ""
authored
19
177f03b Claes Wikstrom addded configure option -with-defaultcharset
authored
20 AC_ARG_WITH(default-charset,
cd68727 Steve Vinoski add --disable-sendfile option to configure, fix src/Makefile to clean ya...
vinoski authored
21 AS_HELP_STRING([--with-defaultcharset=String], [specify default charset, i.e UTF-8]))
177f03b Claes Wikstrom addded configure option -with-defaultcharset
authored
22
23
24 if test "x$with_defaultcharset" = "x" ; then
25 DEFAULT_CHARSET=
26 else
27 DEFAULT_CHARSET=${with_defaultcharset}
28 fi
29
30 AC_SUBST(DEFAULT_CHARSET)
31
c9778e0 Claes Wikstrom added support for 2 additional configure
authored
32
33
34 AC_ARG_WITH(extrainclude,
cd68727 Steve Vinoski add --disable-sendfile option to configure, fix src/Makefile to clean ya...
vinoski authored
35 AS_HELP_STRING([--with-extrainclude=DIR], [dir to include if e.g. pam is installed in some odd place]))
c9778e0 Claes Wikstrom added support for 2 additional configure
authored
36
37
38 if test "x$with_extrainclude" = "x" ; then
39 EXTRAINCLUDE=
40 else
41 EXTRAINCLUDE=-I${with_extrainclude}
42 fi
43
44 AC_SUBST(EXTRAINCLUDE)
45
46
47
cd68727 Steve Vinoski add --disable-sendfile option to configure, fix src/Makefile to clean ya...
vinoski authored
48 AC_ARG_ENABLE(pam, AS_HELP_STRING([--disable-pam], [disables pam auth]), EPAM=, EPAM=../priv/epam)
c9778e0 Claes Wikstrom added support for 2 additional configure
authored
49 AC_SUBST(EPAM)
50
51
52
fdfd9e3 Claes Wikstrom cvs fixes + install scripts gentoo/suse/redhat
authored
53 dnl ----------------------------------------------------------------------
54 dnl
55 dnl BT_ERL_LIB_VSN figures out version of an erlang application
56 dnl and substitutes it as "APPNAME"_VSN
57 dnl
58
59 AC_DEFUN(BT_ERL_LIB_VSN,
60 [
61 AC_MSG_CHECKING([$1 version])
62 AC_CACHE_VAL(bt_cv_$1_vsn,
8a5d8e7 Claes Wikstrom Configure script broken on openbsd due to cygwin weirdness
authored
63 [bt_cv_$1_vsn=`ls "${ERLDIR}" "${ERLDIR}/lib" | \
fdfd9e3 Claes Wikstrom cvs fixes + install scripts gentoo/suse/redhat
authored
64 awk -F- '/^$1-/ { if ([$]2 > v) v=[$]2; }
8a5d8e7 Claes Wikstrom Configure script broken on openbsd due to cygwin weirdness
authored
65 END { print v; }'`
fdfd9e3 Claes Wikstrom cvs fixes + install scripts gentoo/suse/redhat
authored
66 case "$bt_cv_$1_vsn" in
67 "")
68 AC_MSG_ERROR("Could not figure out version Erlang library: $1")
69 ;;
70 *)
71 ;;
72 esac])
73 translit($1, [a-z], [A-Z])_VSN=$bt_cv_$1_vsn
74 AC_SUBST(translit($1, [a-z], [A-Z])_VSN)dnl
75 AC_MSG_RESULT($bt_cv_$1_vsn)
76 ])dnl
77
78
28e4c73 Claes Wikstrom first attempt to run properly under cygwin
authored
79 dnl
80 dnl I keep the cugwin dll code in case I later learn how to
81 dnl compile a linked in driver on windows using gcc
82 dnl
f674082 Claes Wikstrom ""
authored
83
84 case "$target_os" in
0be3c7e Claes Wikstrom untabified all of yaws
authored
85 *cygwin*)
28e4c73 Claes Wikstrom first attempt to run properly under cygwin
authored
86
87 ERLDIR=`echo "${ERL}" | sed 's/\/bin\/*erl.*//'`
88 ERL_DLL_LIB="${ERLDIR}/usr/lib/erl_dll.lib"
89 AC_SUBST(ERL_DLL_LIB)
0be3c7e Claes Wikstrom untabified all of yaws
authored
90 ;;
91 *)
92 ERLDIR=`awk -F= '/ROOTDIR=/ { print [$]2; exit; }' $ERL`;;
f674082 Claes Wikstrom ""
authored
93 esac
94
28e4c73 Claes Wikstrom first attempt to run properly under cygwin
authored
95 if test ! -d "$ERLDIR" ; then
0be3c7e Claes Wikstrom untabified all of yaws
authored
96 AC_MSG_ERROR([Broken Erlang installation, $ERLDIR does not exist!])
f674082 Claes Wikstrom ""
authored
97 fi
98 AC_SUBST(ERLDIR)
28e4c73 Claes Wikstrom first attempt to run properly under cygwin
authored
99 AC_SUBST(ERL_DLL_LIB)
f674082 Claes Wikstrom ""
authored
100
2ae9701 Claes Wikstrom 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)
105 BT_ERL_LIB_VSN(mnesia)
106
28e4c73 Claes Wikstrom first attempt to run properly under cygwin
authored
107 AC_PROG_CC
108 AC_PROG_GCC_TRADITIONAL
f674082 Claes Wikstrom ""
authored
109
110
28e4c73 Claes Wikstrom first attempt to run properly under cygwin
authored
111 dnl ===============================================================
112 dnl Checks for programs.
113 dnl ===============================================================
f674082 Claes Wikstrom ""
authored
114
115
116
117 case "$target_os" in
118 *cygwin*)
119 WIN32=win32
8a5d8e7 Claes Wikstrom Configure script broken on openbsd due to cygwin weirdness
authored
120 cat >> confdefs.h << EOF
28e4c73 Claes Wikstrom first attempt to run properly under cygwin
authored
121 #define WIN32 1
122 EOF
0be3c7e Claes Wikstrom untabified all of yaws
authored
123 LD_SHARED="gcc -shared"
124 DLL=dll
6ed3cb4 Claes Wikstrom configure woes
authored
125 DLL_LIBS="-lc \"$ERL_DLL_LIB\""
0be3c7e Claes Wikstrom untabified all of yaws
authored
126
f674082 Claes Wikstrom ""
authored
127
0be3c7e Claes Wikstrom untabified all of yaws
authored
128 EXE=.exe
129 AC_SUBST(EXE)
f674082 Claes Wikstrom ""
authored
130
0be3c7e Claes Wikstrom untabified all of yaws
authored
131 DLL=dll
132 AC_SUBST(DLL)
f674082 Claes Wikstrom ""
authored
133
0be3c7e Claes Wikstrom untabified all of yaws
authored
134 OBJ=obj
135 AC_SUBST(OBJ)
136 ;;
f674082 Claes Wikstrom ""
authored
137 *)
138
139
0be3c7e Claes Wikstrom untabified all of yaws
authored
140 LINKER=$CC
141 AC_SUBST(LINKER)
f674082 Claes Wikstrom ""
authored
142
0be3c7e Claes Wikstrom untabified all of yaws
authored
143 AC_SUBST(CFLAGS)
f674082 Claes Wikstrom ""
authored
144
0be3c7e Claes Wikstrom untabified all of yaws
authored
145 OUT="-o "
146 AC_SUBST(OUT)
f674082 Claes Wikstrom ""
authored
147
0be3c7e Claes Wikstrom untabified all of yaws
authored
148 DLL=so
149 AC_SUBST(DLL)
150 OBJ=o
151 AC_SUBST(OBJ)
f674082 Claes Wikstrom ""
authored
152
153
0be3c7e Claes Wikstrom untabified all of yaws
authored
154 ;;
f674082 Claes Wikstrom ""
authored
155 esac
156
28e4c73 Claes Wikstrom first attempt to run properly under cygwin
authored
157
158 AC_SUBST(DLL_LIBS)
159
f674082 Claes Wikstrom ""
authored
160 AC_PROG_MAKE_SET
161 AC_PROG_INSTALL
162
163
6c7d7a4 Claes Wikstrom configure/latex support and also slightly nicer listdir output by Hans U...
authored
164 dnl Make LaTeX and related commands configurable
165 dnl
166 dnl We might want to check whether latex is pdflatex and creates
167 dnl PDF instead of DVI without being given -output-format=dvi.
168 dnl However, this at least allows to give the working command at
169 dnl configure time.
170 AC_ARG_VAR([DVILATEX], [(pdf)latex command creating DVI file])
171 AC_CHECK_PROG([DVILATEX], [latex], [latex])
172
173 AC_ARG_VAR([DVIPS], [dvips command])
174 AC_CHECK_PROG([DVIPS], [dvips], [dvips])
175
176 AC_ARG_VAR([PDFLATEX], [(pdf)latex command creating PDF file])
177 AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex])
178
179 AC_ARG_VAR([EPSTOPDF], [epstopdf command])
180 AC_CHECK_PROG([EPSTOPDF], [epstopdf], [epstopdf])
181
182 AS_IF([test "x$DVILATEX" = "xno" || test "x$DVIPS" = "xno"],
183 [AC_SUBST([COND_DVILATEX], ["-"])],
184 [AC_SUBST([COND_DVILATEX], [""])])
185
186 AS_IF([test "x$PDFLATEX" = "xno" || test "x$EPSTOPDF" = "xno"],
187 [AC_SUBST([COND_PDFLATEX], ["-"])],
188 [AC_SUBST([COND_PDFLATEX], [""])])
189
190
7285034 Sebastian Strollo Handle pam include files in different location...
sstrollo authored
191 dnl Sigh, pam headers do not seem to have a standard place. On FreeBSD and
192 dnl Linuces I've seen they are in /usr/include/security, but MacOS has them
47c0c70 Steve Vinoski add pkg-config support contributed by Olivier Girondel
vinoski authored
193 dnl in /usr/include/pam... I'm too sick of M4 at this very moment to write
7285034 Sebastian Strollo Handle pam include files in different location...
sstrollo authored
194 dnl a test that searches for the files, so hard coded for now...
c9778e0 Claes Wikstrom added support for 2 additional configure
authored
195 dnl or use --with-extrainclude=....
7285034 Sebastian Strollo Handle pam include files in different location...
sstrollo authored
196 CFLAGS="$CFLAGS -I/usr/include/security"
12471ad Claes Wikstrom added configure support for sendfile
authored
197 HAVE_SENDFILE=false
7285034 Sebastian Strollo Handle pam include files in different location...
sstrollo authored
198
f674082 Claes Wikstrom ""
authored
199 case "$target_os" in
0be3c7e Claes Wikstrom untabified all of yaws
authored
200 *linux*)
201 AC_DEFINE(LINUX)
202 LD_SHARED="gcc -shared"
203 AC_SUBST(LD_SHARED)
204 FPIC=-fpic
205 AC_SUBST(FPIC)
12471ad Claes Wikstrom added configure support for sendfile
authored
206 HAVE_SENDFILE=true
0be3c7e Claes Wikstrom untabified all of yaws
authored
207 ;;
208
209 *solaris*)
210 AC_DEFINE(SOLARIS)
211 LD_SHARED="ld -G"
212 AC_SUBST(LD_SHARED)
213 LIBS="$LIBS -lsocket -lnsl -lresolv"
214 AC_SUBST(LIBS)
215 FPIC=-fpic
216 AC_SUBST(FPIC)
217 ;;
218
219 *bsd*)
220 AC_DEFINE(BSD)
221 case "$target_os" in
12471ad Claes Wikstrom added configure support for sendfile
authored
222 freebsd*)
223 HAVE_SENDFILE=true
224 ;;
0be3c7e Claes Wikstrom untabified all of yaws
authored
225 bsdi*)
f674082 Claes Wikstrom ""
authored
226 BSDI=bsdi
0be3c7e Claes Wikstrom untabified all of yaws
authored
227 AC_DEFINE(BSDI)
228 AC_SUBST(BSDI)
229 ;;
230 esac
231 LD_SHARED="ld -Bshareable"
232 AC_SUBST(LD_SHARED)
233 FPIC=-fpic
234 AC_SUBST(FPIC)
235 ;;
236 *darwin*)
10febe6 Steve Vinoski added sendfile check for Darwin, since no sendfile is available on OS X ...
vinoski authored
237 AC_CHECK_LIB([c],[sendfile],[HAVE_SENDFILE=true])
0be3c7e Claes Wikstrom untabified all of yaws
authored
238 CFLAGS="$CFLAGS -I/usr/include/pam"
239 LD_SHARED="gcc -bundle -fPIC -flat_namespace -undefined suppress"
10febe6 Steve Vinoski added sendfile check for Darwin, since no sendfile is available on OS X ...
vinoski authored
240 AC_SUBST(LD_SHARED)
0be3c7e Claes Wikstrom untabified all of yaws
authored
241 FPIC=-fPIC
242 AC_SUBST(FPIC)
243 ;;
244 *cygwin*)
245 AC_PATH_PROG(WERL, werl)
246 AC_SUBST(WERL)
247 AC_DEFINE(WIN32)
248 FPIC=-fpic
249 AC_SUBST(FPIC)
250 AC_SUBST(WIN32)
251 ;;
252 *)
f674082 Claes Wikstrom ""
authored
253 AC_MSG_RESULT(unknown)
0be3c7e Claes Wikstrom untabified all of yaws
authored
254 AC_MSG_ERROR(Non-supported target OS!)
255 ;;
f674082 Claes Wikstrom ""
authored
256 esac
257
cd68727 Steve Vinoski add --disable-sendfile option to configure, fix src/Makefile to clean ya...
vinoski authored
258 AC_ARG_ENABLE(sendfile, AS_HELP_STRING([--disable-sendfile], [disables use of sendfile system call]),
259 [ test "$enableval" = no && HAVE_SENDFILE=false ])
12471ad Claes Wikstrom added configure support for sendfile
authored
260 AC_SUBST(HAVE_SENDFILE)
45a3567 Claes Wikstrom test case number 1
authored
261 YTOP=`pwd`
262 AC_SUBST(YTOP)
f674082 Claes Wikstrom ""
authored
263 AC_OUTPUT(include.mk)
45a3567 Claes Wikstrom test case number 1
authored
264 AC_OUTPUT(test/support/include.mk)
265 AC_OUTPUT(test/support/include.sh)
47c0c70 Steve Vinoski add pkg-config support contributed by Olivier Girondel
vinoski authored
266
267 dnl pkg-config support
268 . ./vsn.mk
269 AC_SUBST(YAWS_VSN)
270 AC_OUTPUT(yaws.pc)
Something went wrong with that request. Please try again.