]> git.saurik.com Git - wxWidgets.git/blame - wxPython/wxSWIG/configure.in
moved XML classes to the core
[wxWidgets.git] / wxPython / wxSWIG / configure.in
CommitLineData
c90f71dd
RD
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(Include/swig.h)
3AC_PREREQ(2.0)
4
5# Set name for machine-dependent library files
6AC_SUBST(MACHDEP)
7AC_MSG_CHECKING(MACHDEP)
8if test -z "$MACHDEP"
9then
10 if test -f /usr/lib/NextStep/software_version; then
11 set X `hostinfo | grep 'NeXT Mach.*:' | \
12 sed -e 's/://' -e 's/\./_/'` && \
13 ac_sys_system=next && ac_sys_release=$4
14 MACHDEP="$ac_sys_system$ac_sys_release$ac_sys_cpu"
15 else
16 ac_sys_system=`uname -s`
17 if test "$ac_sys_system" = "AIX" ; then
18 ac_sys_release=`uname -v`
19 else
20 ac_sys_release=`uname -r`
21 fi
22 ac_md_system=`echo $ac_sys_system |
23 tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
24 ac_md_release=`echo $ac_sys_release |
25 tr -d '[/ ]' | sed 's/\..*//'`
26 MACHDEP="$ac_md_system$ac_md_release"
27 fi
28 case MACHDEP in
29 '') MACHDEP=unknown;;
30 esac
31fi
32AC_MSG_RESULT($MACHDEP)
33
34AC_LANG_CPLUSPLUS
35
36dnl Checks for programs.
37AC_PROG_CXX
38AC_PROG_CC
39AC_PROG_RANLIB
40
41AC_SUBST(AR)
42AC_CHECK_PROGS(AR, ar aal, ar)
43
44dnl Checks for header files.
45AC_HEADER_STDC
46dnl Checks for library functions.
47
48AC_FUNC_ALLOCA
49AC_ARG_WITH(lang,[ --with-lang=LANG Set SWIG target language (TCL,TCL8,PYTHON,PERL5,PERL4,GUILE)],[
002b1ea6 50 AC_DEFINE_UNQUOTED(SWIG_LANG,$withval)], [AC_DEFINE(SWIG_LANG,PYTHON)])
c90f71dd
RD
51
52AC_ARG_WITH(doc,[ --with-doc=DOC Set SWIG target documentation method (ASCII,LATEX,HTML,NODOC)], [
53 AC_DEFINE_UNQUOTED(SWIG_DOC,$withval)], [AC_DEFINE(SWIG_DOC,ASCII)])
54
55AC_ARG_WITH(yacc,[ --without-yacc Try to compile without yacc/bison], [
56 YACC="cp parser.cxx.no y.tab.c; cp parser.h.no y.tab.h"
57 AC_SUBST(YACC)
58 YACCFLAGS=""
59 AC_SUBST(YACCFLAGS)
60], [ AC_PROG_YACC
61 YACCFLAGS="-d parser.y"
62 AC_SUBST(YACCFLAGS) ])
63
64# This borrowed from the Python configuration file
65# Set info about shared libraries.
66
67AC_SUBST(SO)
68AC_SUBST(LDSHARED)
69AC_SUBST(CCSHARED)
70AC_SUBST(LINKFORSHARED)
71# SO is the extension of shared libraries `(including the dot!)
72# -- usually .so, .sl on HP-UX
73AC_MSG_CHECKING(SO)
74if test -z "$SO"
75then
76 case $ac_sys_system in
77 hp*|HP*) SO=.sl;;
78 NeXT|next) SO=.a;; # no shared libs on NeXT 3.3 and less
79 *) SO=.so;;
80 esac
81fi
82AC_MSG_RESULT($SO)
83# LDSHARED is the ld *command* used to create shared library
84# -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5
85AC_MSG_CHECKING(LDSHARED)
86if test -z "$LDSHARED"
87then
88 case $ac_sys_system/$ac_sys_release in
89 AIX*) LDSHARED="ld_so_aix";;
90 IRIX*) LDSHARED="ld -shared";;
91 SunOS/4*) LDSHARED="ld";;
92 SunOS/5*) LDSHARED="ld -G";;
93 hp*|HP*) LDSHARED="ld -b";;
94 OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
95 DYNIX/ptx*) LDSHARED="ld -G";;
96 Linux*) LDSHARED="gcc -shared";;
97 FreeBSD*) LDSHARED="ld -Bshareable";;
98 NeXT|next/3*) LDSHARED="ld -u libsys_s";;
99 *) LDSHARED="ld";;
100 esac
101fi
102AC_MSG_RESULT($LDSHARED)
103# CCSHARED are the C *flags* used to create objects to go into a shared
104# library -- this is only needed for a few systems
105AC_MSG_CHECKING(CCSHARED)
106if test -z "$CCSHARED"
107then
108 case $ac_sys_system in
109 hp*|HP*) if test "$GCC" = yes;
110 then CCSHARED="-fpic";
111 else CCSHARED="+z";
112 fi;;
113 Linux*) CCSHARED="-fpic";;
114 FreeBSD*) CCSHARED="-fpic";;
115 esac
116fi
117AC_MSG_RESULT($CCSHARED)
118
119# LINKFORSHARED are the flags passed to the $(CC) command that links
120# the a few executables -- this is only needed for a few systems
121
122AC_MSG_CHECKING(LINKFORSHARED)
123if test -z "$LINKFORSHARED"
124then
125 case $ac_sys_system/$ac_sys_release in
126 AIX*) LINKFORSHARED='-Wl,-bE:$(srcdir)/python.exp -lld';;
127 hp*|HP*)
128 LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
129 Linux*) LINKFORSHARED="-Xlinker -export-dynamic";;
130 next/*) LINKFORSHARED="-u libsys_s";;
131 SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
132 IRIX*/6*) LINKFORSHARED="-all";;
133 esac
134fi
135AC_MSG_RESULT($LINKFORSHARED)
136
137echo ""
138echo "Checking for installed packages."
139echo "Note : None of the following packages are required to compile SWIG"
140echo ""
141
142# Check for specific libraries. Used for SWIG examples
143AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
144AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
145
146# The following three (nsl,inet,socket) are needed on Sequent;
147# the order of checking must be this. Most SVR4 platforms will
148# need -lsocket and -lnsl. However on SGI IRIX 5, these exist but
149# broken. I see no elegant solution (probably CHECK_LIB should be
150# fixed to only add the library if the given entry point is not
151# satisfied without it).
152if test "`uname -s`" != IRIX
153then
154AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
155AC_CHECK_LIB(inet, gethostbyname, [LIBS="-linet $LIBS"], [], -lnsl) # Sequent
156AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
157fi
158
159# check for --with-libm=...
160AC_SUBST(LIBM)
161LIBM=-lm
162AC_ARG_WITH(libm, [ --with-libm=STRING math library], [
163if test "$withval" != yes
164then LIBM=$withval
165else AC_ERROR(proper usage is --with-libm=STRING)
166fi])
167AC_CHECK_LIB(ieee, main, [LIBM="-lieee $LIBM"])
168AC_CHECK_LIB(crypt,crypt, [LIBCRYPT="-lcrypt"])
169AC_SUBST(LIBCRYPT)
170
171# check for --with-libc=...
172AC_SUBST(LIBC)
173AC_ARG_WITH(libc, [ --with-libc=STRING C library], [
174if test "$withval" != yes
175then LIBC=$withval
176else AC_ERROR(proper usage is --with-libc=STRING)
177fi])
178
179#--------------------------------------------------------------------
180# Locate the X11 header files and the X11 library archive. Try
181# the ac_path_x macro first, but if it doesn't find the X stuff
182# (e.g. because there's no xmkmf program) then check through
183# a list of possible directories. Under some conditions the
184# autoconf macro will return an include directory that contains
185# no include files, so double-check its result just to be safe.
186#--------------------------------------------------------------------
187
188AC_PATH_X
189not_really_there=""
190if test "$no_x" = ""; then
191 if test "$x_includes" = ""; then
192 AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
193 else
194 if test ! -r $x_includes/X11/Intrinsic.h; then
195 not_really_there="yes"
196 fi
197 fi
198fi
199if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
200 AC_MSG_CHECKING(for X11 header files)
201 XINCLUDES="# no special path needed"
202 AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope")
203 if test "$XINCLUDES" = nope; then
204 dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/include/X11R4 /usr/X11R5/include /usr/include/X11R5 /usr/openwin/include /usr/X11/include /usr/sww/include /usr/X11R6/include /usr/include/X11R6"
205 for i in $dirs ; do
206 if test -r $i/X11/Intrinsic.h; then
207 AC_MSG_RESULT($i)
208 XINCLUDES=" -I$i"
209 break
210 fi
211 done
212 fi
213else
214 if test "$x_includes" != ""; then
215 XINCLUDES=-I$x_includes
216 else
217 XINCLUDES="# no special path needed"
218 fi
219fi
220if test "$XINCLUDES" = nope; then
221 AC_MSG_RESULT(couldn't find any!)
222 XINCLUDES="# no include files found"
223fi
224
225if test "$no_x" = yes; then
226 AC_MSG_CHECKING(for X11 libraries)
227 XLIBSW=nope
228 dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/X11R6/lib /usr/lib/X11R6 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
229 for i in $dirs ; do
230 if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
231 AC_MSG_RESULT($i)
232 XLIBSW="-L$i -lX11"
233 break
234 fi
235 done
236else
237 if test "$x_libraries" = ""; then
238 XLIBSW=-lX11
239 else
240 XLIBSW="-L$x_libraries -lX11"
241 fi
242fi
243if test "$XLIBSW" = nope ; then
244 AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
245fi
246if test "$XLIBSW" = nope ; then
247 AC_MSG_RESULT(couldn't find any! Using -lX11.)
248 XLIBSW=-lX11
249fi
250
251AC_SUBST(XINCLUDES)
252AC_SUBST(XLIBSW)
253
254#--------------------------------------------------------------------
255# Try to locate the Tcl package
256#--------------------------------------------------------------------
257
258TCLINCLUDE=nope
259TCLLIB=nope
260TCLPACKAGE=nope
261
262AC_ARG_WITH(tcl,[ --with-tcl=path Set location of Tcl package],[
263 TCLPACKAGE="$withval"], [TCLPACKAGE=nope])
264AC_ARG_WITH(tclincl,[ --with-tclincl=path Set location of Tcl include directory],[
265 TCLINCLUDE="-I$withval"], [TCLINCLUDE=nope])
266AC_ARG_WITH(tcllib,[ --with-tcllib=path Set location of Tcl library directory],[
267 TCLLIB="-L$withval"], [TCLLIB=nope])
268
269if test "$TCLINCLUDE" = nope; then
270 if test "$TCLPACKAGE" != nope; then
271 TCLINCLUDE="-I$TCLPACKAGE/include"
272 fi
273fi
274
275if test "$TCLLIB" = nope; then
276 if test "$TCLPACKAGE" != nope; then
277 TCLLIB="-L$TCLPACKAGE/lib"
278 fi
279fi
280
281AC_MSG_CHECKING(for Tcl header files)
282if test "$TCLINCLUDE" = nope; then
283AC_TRY_CPP([#include <tcl.h>], , TCLINCLUDE="nope")
284if test "$TCLINCLUDE" = nope; then
285 dirs="$prefix/include /usr/local/include /usr/include /opt/local/include /home/sci/local/include"
286 for i in $dirs ; do
287 if test -r $i/tcl.h; then
288 AC_MSG_RESULT($i)
289 TCLINCLUDE="-I$i"
290 break
291 fi
292 done
293fi
294if test "$TCLINCLUDE" = nope; then
295 TCLINCLUDE="-I/usr/local/include"
296 AC_MSG_RESULT(not found)
297fi
298else
299 AC_MSG_RESULT($TCLINCLUDE)
300fi
301
302AC_MSG_CHECKING(for Tcl library)
303if test "$TCLLIB" = nope; then
304dirs="$prefix/lib /usr/local/lib /usr/lib /opt/local/lib /home/sci/local/lib"
305for i in $dirs ; do
306 if test -r $i/libtcl.a; then
307 AC_MSG_RESULT($i)
308 TCLLIB="-L$i"
309 break
310 fi
311done
312if test "$TCLLIB" = nope; then
313 AC_MSG_RESULT(not found)
314 TCLLIB="-L/usr/local/lib"
315fi
316else
317AC_MSG_RESULT($TCLLIB)
318fi
319
320AC_SUBST(TCLINCLUDE)
321AC_SUBST(TCLLIB)
322
323#----------------------------------------------------------------
324# Look for Python
325#----------------------------------------------------------------
326
327PYINCLUDE=nope
328PYLIB=nope
329PYPACKAGE=nope
002b1ea6 330PYLINK="-lModules -lPython -lObjects -lParser"
c90f71dd
RD
331
332AC_ARG_WITH(py,[ --with-py=path Set location of Python],[
333 PYPACKAGE="$withval"], [PYPACKAGE=nope])
334AC_ARG_WITH(pyincl,[ --with-pyincl=path Set location of Python include directory],[
335 PYINCLUDE="$withval"], [PYINCLUDE=nope])
336AC_ARG_WITH(pylib,[ --with-pylib=path Set location of Python library directory],[
337 PYLIB="$withval"], [PYLIB=nope])
338
339if test "$PYINCLUDE" = nope; then
340 if test "$PYPACKAGE" != nope; then
341 PYINCLUDE="$PYPACKAGE/include"
342 fi
343fi
344
345if test "$PYLIB" = nope; then
346 if test "$PYPACKAGE" != nope; then
347 PYLIB="$PYPACKAGE/lib"
348 fi
349fi
350
351
352AC_MSG_CHECKING(for Python header files)
353
354dirs="$PYINCLUDE $PYINCLUDE/python1.5 $PYINCLUDE/python1.4 $PYINCLUDE/Py $prefix/include/python1.5 $prefix/include/python1.4 /usr/local/include/python1.5 /usr/include/python1.5 /usr/local/include/python1.4 /usr/include/python1.4 $prefix/include/Py /usr/local/include/Py /usr/include/Py"
355for i in $dirs ; do
356 if test -r $i/Python.h; then
357 AC_MSG_RESULT($i)
358 PYINCLUDE="-I$i"
359 break
360 fi
361done
362if test "$PYINCLUDE" = nope; then
363 PYINCLUDE="-I/usr/local/include/Py"
364 AC_MSG_RESULT(not found)
365fi
366
367AC_MSG_CHECKING(for Python library)
368dirs="$PYLIB $PYLIB/config $PYLIB/lib $PYLIB/python1.5/config $PYLIB/python1.4/config $PYLIB/python/lib $prefix/lib/python1.5/config $prefix/lib/python1.4/config /usr/local/lib/python1.5/config /usr/lib/python1.5 /usr/local/lib/python1.4/config /usr/lib/python1.4 $prefix/lib/python/lib /usr/local/lib/python/lib /usr/lib/python/lib /home/sci/local/lib/python"
369
370for i in $dirs ; do
371 if test -r $i/libpython1.5.a; then
372 AC_MSG_RESULT($i)
373 PYLIB="$i"
374 PYINCLUDE="$PYINCLUDE -I$i"
002b1ea6 375 PYLINK="-lpython1.5"
c90f71dd
RD
376 break
377 fi
378 if test -r $i/libPython.a; then
379 AC_MSG_RESULT($i)
380 PYLIB="$i"
381 PYINCLUDE="$PYINCLUDE -I$i"
382 break
383 fi
384done
385if test "$PYLIB" = nope; then
386 AC_MSG_RESULT(not found)
387 PYLIB="/usr/local/lib/python/lib"
388 PYINCLUDE="$PYINCLUDE -I$PYLIB"
389fi
390
391AC_SUBST(PYINCLUDE)
392AC_SUBST(PYLIB)
393AC_SUBST(PYLINK)
394
395#----------------------------------------------------------------
396# Look for Perl5
397#----------------------------------------------------------------
398
399PERLBIN=nope
400
401AC_ARG_WITH(perl5,[ --with-perl5=path Set location of Perl5 executable],[
402 PERLBIN="$withval"], [PERLBIN=nope])
403
404# First figure out what the name of Perl5 is
405
406if test "$PERLBIN" = nope; then
407AC_CHECK_PROGS(PERL, perl5.004 perl5.003 perl5.002 perl5.001 perl5 perl,nope)
408else
409PERL="$PERLBIN"
410fi
411AC_MSG_CHECKING(for Perl5 header files)
412if test "$PERL" != nope; then
413 PERL5DIR=`($PERL -e 'use Config; print $Config{archlib};') 2>/dev/null`
414 if test "$PERL5DIR" != ""; then
415 dirs="$PERL5DIR $PERL5DIR/CORE"
416 PERL5EXT=none
417 for i in $dirs; do
418 if test -r $i/perl.h; then
419 AC_MSG_RESULT($i)
420 PERL5EXT="$i"
421 break;
422 fi
002b1ea6 423 done
c90f71dd
RD
424 if test "$PERL5EXT" = none; then
425 PERL5EXT="$PERL5DIR/CORE"
426 AC_MSG_RESULT(could not locate perl.h...using $PERL5EXT)
002b1ea6 427 fi
c90f71dd
RD
428 else
429 AC_MSG_RESULT(unable to determine perl5 configuration)
430 PERL5EXT=$PERL5DIR
431 fi
432 else
433 AC_MSG_RESULT(could not figure out how to run perl5)
434 PERL5EXT="/usr/local/lib/perl/archname/5.003/CORE"
435 fi
436
437AC_SUBST(PERL5EXT)
438
002b1ea6 439AC_OUTPUT(Makefile SWIG/Makefile Modules/Makefile Runtime/Makefile swig_lib/tcl/Makefile swig_lib/python/Makefile swig_lib/perl5/Makefile)
c90f71dd
RD
440
441
442
443
444
445