-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure.in
687 lines (562 loc) · 19 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
dnl Process this file with autoconf to produce a configure script.
AC_INIT(paragui, 1.1.11)
TOP_BUILDDIR=`pwd`
AC_SUBST(TOP_BUILDDIR)
dnl The minimum SDL version required
SDL_VERSION=1.2.7
dnl we also need libSigC++ (yeah)
SIGC_VERSION=1.2.5
dnl Set various version strings - taken gratefully from the GTk sources
# Making releases:
# MICRO_VERSION += 1;
# INTERFACE_AGE += 1;
# BINARY_AGE += 1;
# if any functions have been added, set INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set BINARY_AGE and INTERFACE_AGE to 0.
PARAGUI_MAJOR_VERSION=1
PARAGUI_MINOR_VERSION=1
PARAGUI_MICRO_VERSION=11
PARAGUI_INTERFACE_AGE=0
PARAGUI_BINARY_AGE=0
PARAGUI_VERSION=$PARAGUI_MAJOR_VERSION.$PARAGUI_MINOR_VERSION.$PARAGUI_MICRO_VERSION
AC_SUBST(PARAGUI_MAJOR_VERSION)
AC_SUBST(PARAGUI_MINOR_VERSION)
AC_SUBST(PARAGUI_MICRO_VERSION)
AC_SUBST(PARAGUI_INTERFACE_AGE)
AC_SUBST(PARAGUI_BINARY_AGE)
AC_SUBST(PARAGUI_VERSION)
# libtool versioning
LT_RELEASE=$PARAGUI_MAJOR_VERSION.$PARAGUI_MINOR_VERSION
LT_CURRENT=`expr $PARAGUI_MICRO_VERSION - $PARAGUI_INTERFACE_AGE`
LT_REVISION=$PARAGUI_INTERFACE_AGE
LT_AGE=`expr $PARAGUI_BINARY_AGE - $PARAGUI_INTERFACE_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
dnl Detect the canonical host and target build environment
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
dnl Setup for automake
AM_INIT_AUTOMAKE(paragui, $PARAGUI_VERSION)
dnl AM_CONFIG_HEADER(include/paraconfig_gnu.h:include/paraconfig_gnu.h.in)
AC_CONFIG_HEADERS(config.h)
AX_PREFIX_CONFIG_H(include/paraconfig_gnu.h, "PG")
dnl Check for tools
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AC_PROG_MAKE_SET
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
AC_EXEEXT
dnl Check for pkgconfig first
AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
dnl Give error and exit if we don't have pkgconfig
if test "x$HAVE_PKGCONFIG" = "xno"; then
AC_MSG_ERROR(you need to have pkgconfig installed !)
fi
dnl Add verbose warnings by default, and allow ANSI compliance checking
AC_ARG_ENABLE(strict-ansi,
[ --enable-strict-ansi Enable strict ANSI compliance build [default=no]],
, enable_strict_ansi=no)
if test x$ac_cv_prog_gcc = xyes; then
CFLAGS="$CFLAGS -Wall"
if test x$enable_strict_ansi = xyes; then
CFLAGS="$CFLAGS -ansi -pedantic"
fi
fi
# check if we should compile support for the GP2X
AC_ARG_ENABLE(gp2x,
[ --enable-gp2x Enable support for the GP2X platform [default=no]],
[gp2x=yes]
)
if test x$gp2x = xyes; then
AC_DEFINE([PARAGUI_GP2X], 1, [Define to 1 if you want support for the GP2X platform.])
fi
# check if we should compile in the colortable
pgcolors=yes
AC_ARG_ENABLE(pgcolors,
AC_HELP_STRING([--enable-pgcolors], [Enable the builtin colortable [default=yes]]),
pgcolors=$enableval, pgcolors=yes)
if test "$pgcolors" = yes; then
AC_MSG_NOTICE([will include builtin colortable.])
AC_DEFINE([ENABLE_PGCOLORS], 1, [Define to 1 if you want to enable the builtin colortable.])
else
AC_MSG_NOTICE([builtin colortable will *NOT* be included.])
fi
dnl enable mpatrol mem profiler
mpatrol=yes
AC_ARG_ENABLE(mpatrol,
[ --enable-mpatrol Enable mpatrol mem profiler [default=no]],
, mpatrol=no)
if test x$mpatrol = xyes; then
have_mpatrol_lib=no
have_mpatrol_include=no
AC_CHECK_LIB(mpatrol, malloc, have_mpatrol_lib=yes, , -lbfd -liberty)
if test x$have_mpatrol_lib = xno; then
AC_MSG_ERROR([*** Unable to find mpatrol library! (http://www.cbmamiga.demon.co.uk/mpatrol)])
fi
AC_CHECK_HEADER(mpatrol.h, [have_mpatrol_include=yes])
if test x$have_mpatrol_include = xno; then
AC_MSG_ERROR([*** Unable to find mpatrol header! (http://www.cbmamiga.demon.co.uk/mpatrol)])
fi
AC_DEFINE([MPATROL_ENABLED], 1, [Define if we enabled mpatrol])
EXTRA_LIBS="$EXTRA_LIBS -lmpatrol -lbfd -liberty"
fi
dnl enable unicode support
unicode=no
AC_ARG_ENABLE(unicode,
AC_HELP_STRING([--enable-unicode], [Enable Unicode support [default=no]]),
unicode=$enableval, unicode=no)
if test "$unicode" = yes; then
AC_MSG_NOTICE([Unicode support is enabled.])
AC_DEFINE([ENABLE_UNICODE], 1, [Define to 1 if Unicode support is enabled.])
YSTRING_LIB="./ystring/libystring.la"
YSTRING_SUBDIR="ystring"
fi
AC_SUBST(YSTRING_LIB)
AC_SUBST(YSTRING_SUBDIR)
AC_ARG_WITH(stlport,[ --with-stlport=DIR use the STLPort library installed with this prefix directory [default $prefix]],
STLPORTPREFIX="$withval", STLPORTPREFIX="no")
AC_ARG_WITH(stlportlib,[ --with-stlportlib=NAME use the specified STLPort library name for linking [autodetect]],
STLPORTLIB="$withval", STLPORTLIB="")
AC_ARG_ENABLE(stlport-debug,[ --enable-stlport-debug Enable the debug mode version of the STLPort library [default no]],
enable_stlport_debug=yes)
AC_ARG_WITH(libstdcpp,[ --with-libstdcpp=NAME library to be used as -lNAME instead of stdc++],
LIBSTDCPP="-l$withval", LIBSTDCPP="-lstdc++")
CROSSCOMPILE=NO
dnl The alpha architecture needs special flags for binary portability
case "$target" in
*-*-cygwin* | *-*-mingw32*)
dnl AM_INIT_AUTOMAKE(xmingw32msvc-paragui, $PARAGUI_VERSION)
if test "$build" != "$target"; then # cross-compiling
# Default cross-compile location
ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
else
# Look for the location of the tools and install there
ac_default_prefix=$BUILD_PREFIX
fi
EXTRA_LIBS="$EXTRA_LIBS -Wl, -u,_WinMain@16"
CROSSCOMPILE=YES
;;
alpha*-*-linux*)
CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
;;
*-*-beos*)
ac_default_prefix=/boot/develop/tools/gnupro
LIBSTDCPP="-lstdc++.r4"
;;
esac
AC_MSG_CHECKING(for the STL library to use)
if test "$STLPORTPREFIX" != "no"; then
if test -z "$STLPORTPREFIX" -o "$STLPORTPREFIX" = "yes"; then
STLPORTPREFIX="$prefix"
fi
INCSTLPORT="$STLPORTPREFIX/include/stlport"
LIBSTLPORT="$STLPORTPREFIX/lib"
dnl config/stlcomp.h is specific for STLPort
if test -f $INCSTLPORT/config/stlcomp.h; then
CPPFLAGS="-I$INCSTLPORT $CPPFLAGS"
STL_CFLAGS="-I$INCSTLPORT"
dnl detecting what stlport library to use is tricky since
dnl it uses a weird naming scheme by appending the compiler
dnl and system dependent suffix (plus, for the debug version,
dnl an additional 'stldebug' suffix). We will use some
dnl heuristics and common sense here. Including explicit name
dnl tests here would be too cumbersome and not flexible.
dnl Should those tests fail to detect the library, specify it
dnl explicitly with the --with-stlportlib=NAME parameter.
if test -n "$STLPORTLIB"; then
LIBSTDCPP="-l$STLPORTLIB"
else
if test -f "$LIBSTLPORT/libstlport.so"; then
LIBSTDCPP="-lstlport"
else
USESTLLIB=""
for l in "$LIBSTLPORT/libstlport*.so"; do
if test -n "$USESTLLIB"; then
continue
fi
LIBNAME="`echo $l | tr '_.' ' '`"
LIBSUFFIX=`echo $LIBNAME | cut -d ' ' -f 2`
LIBTYPE=`echo $LIBNAME | cut -d ' ' -f 3`
if test "$LIBTYPE" = "stldebug" -a "$enable_stlport_debug" != "no"; then
USESTLLIB="-lstlport_${LIBSUFFIX}_stldebug"
elif test "$LIBTYPE" = "so" -a -z "$enable_stlport_debug"; then
USESTLLIB="-lstlport_$LIBSUFFIX"
fi
done
if test -n "$USESTLLIB"; then
LIBSTDCPP="-L$LIBSTLPORT $USESTLLIB"
fi
fi
fi
fi
fi
AC_MSG_RESULT($LIBSTDCPP)
AC_ARG_WITH(libstdcppstatic,[ --with-libstdcppstatic=NAME link NAME statically as stdc++],
LIBSTDCPP="$withval")
AC_SUBST(LIBSTDCPP)
dnl Check for libSigC++
PKG_CHECK_MODULES(SIGC, sigc++-1.2 >= $SIGC_VERSION)
AC_SUBST(SIGC_CFLAGS)
AC_SUBST(SIGC_LIBS)
dnl Check for SDL
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
SDL_LIBS=`sdl-config --libs`
AC_SUBST(SDL_LIBS)
dnl set default prefix to `sdl-config --prefix`
ac_default_prefix=`sdl-config --prefix`
SDL_PREFIX=`sdl-config --prefix`
AC_SUBST(SDL_PREFIX)
ft2test=yes
AC_ARG_ENABLE(ft2test,
[ --disable-ft2test disable the freetype check],
ft2test=no
)
if test "$ft2test" = "yes"; then
dnl Check for freetype2 with a reasonable fallback in case
dnl freetype-config is missing.
have_freetype=no
AC_PATH_PROG(freetype_config,freetype-config,no)
if test "$ac_cv_path_freetype_config" != "no"; then
have_freetype=yes
FREETYPE_CFLAGS="`$ac_cv_path_freetype_config --cflags`"
FREETYPE_LIBS="`$ac_cv_path_freetype_config --libs`"
else
AC_CHECK_LIB(freetype,FT_Init_FreeType,have_freetype=yes)
AC_CHECK_HEADER(ft2build.h,have_ft2build=yes)
if test "$have_ft2build" != "yes"; then
have_freetype="no"
elif test "$have_freetype" = "yes"; then
FREETYPE_LIBS="-lfreetype"
ft2inc="no"
AC_MSG_CHECKING(freetype2 include directory)
if test -d /usr/local/include/freetype2; then
ft2inc="/usr/local/include/freetype2"
elif test -d /usr/include/freetype2; then
ft2inc="/usr/include/freetype2"
fi
AC_MSG_RESULT($ft2inc)
FREETYPE_CFLAGS="-I$ft2inc"
fi
fi
if test x$have_freetype = xno; then
AC_MSG_ERROR([*** Unable to find the FreeType 2 library (http://www.freetype.org/)])
fi
fi
# check name of shared lib SDL_image
SDLIMAGE_LIBS="-lSDL_image $SDL_LIBS"
SDLimage_lib_spec=`echo $SDLIMAGE_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libSDL_image-*.so.*/'`
SDLimage_lib=`ls ${SDLimage_lib_spec} | head -1 | sed 's/.*\/\(.*\)/\1/'`
echo "-- ${SDLimage_lib_spec} -> $SDLimage_lib"
AC_DEFINE_UNQUOTED([SDLIMAGE_LIB], "$SDLimage_lib", [SDL_image shared library])
CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
dnl Check for expat
EXPAT_INCLUDE=""
EXPAT_LIB="-lexpat"
EXPAT_SUBDIR=""
LIBEXPAT="-lexpat"
internalexpat=no
AC_ARG_ENABLE(internalexpat,
[ --enable-internalexpat enable internal expat version],
internalexpat=yes
)
if test x$internalexpat = xno; then
have_expat_lib=no
have_expat_include=no
AC_CHECK_HEADER(expat.h, [have_expat_include=yes])
if test x$have_expat_include = xno; then
AC_MSG_ERROR(
[*** Unable to find expat header file! (http://expat.sourceforge.net)]
[Please install the library and header files if you want to link to the shared library,]
[or run './configure --enable-internalexpat' to compile an internal version of expat.]
)
fi
AC_CHECK_LIB(expat, XML_ParserCreate, have_expat_lib=yes)
if test x$have_expat_lib = xno; then
AC_MSG_ERROR(
[*** Unable to find expat xml library! (http://expat.sourceforge.net)]
[Please install the library and header files if you want to link to the shared library,]
[or run './configure --enable-internalexpat' to compile an internal version of expat.]
)
fi
else
EXPAT_INCLUDE="-I\$(srcdir)/../expat"
EXPAT_LIB="./expat/libexpat.la"
EXPAT_SUBDIR="expat"
LIBEXPAT=""
fi
AC_SUBST(EXPAT_INCLUDE)
AC_SUBST(EXPAT_LIB)
AC_SUBST(EXPAT_SUBDIR)
AC_SUBST(LIBEXPAT)
dnl Check for physfs
PHYSFS_INCLUDE=""
PHYSFS_LIB="-lphysfs"
PHYSFS_SUBDIR=""
LIBPHYSFS="-lphysfs"
internalphysfs=no
AC_ARG_ENABLE(internalphysfs,
[ --enable-internalphysfs enable internal physfs version],
internalphysfs=yes
)
if test x$internalphysfs = xno; then
have_physfs_lib=no
have_physfs_include=no
AC_CHECK_HEADER(physfs.h, [have_physfs_include=yes])
if test x$have_physfs_include = xno; then
AC_MSG_ERROR(
[*** Unable to find PhysFS header file! (http://www.icculus.org/physfs)]
[Please install the library and header files if you want to link to the shared library,]
[or run './configure --enable-internalphysfs' to compile an internal version of physfs.]
)
fi
AC_CHECK_LIB(physfs, PHYSFS_init, have_physfs_lib=yes)
if test x$have_physfs_lib = xno; then
AC_MSG_ERROR(
[*** Unable to find PhysFS library! (http://www.icculus.org/physfs)]
[Please install the library and header files if you want to link to the shared library,]
[or run './configure --enable-internalphysfs' to compile an internal version of physfs.]
)
fi
else
PHYSFS_INCLUDE="-I\$(srcdir)/../physfs"
PHYSFS_LIB="./physfs/libphysfs.la"
PHYSFS_SUBDIR="physfs"
LIBPHYSFS=""
fi
AC_CONFIG_SUBDIRS(src/physfs)
AC_SUBST(PHYSFS_INCLUDE)
AC_SUBST(PHYSFS_LIB)
AC_SUBST(PHYSFS_SUBDIR)
AC_SUBST(LIBPHYSFS)
dnl Check for other files
AC_LANG_CPLUSPLUS
dnl Check for --enable-rtti flag
AC_ARG_ENABLE(rtti,
[ --enable-rtti compile with or without runtime type information],
rtti=$enable_rtti
)
AC_MSG_CHECKING([for rtti])
if test "x$rtti" = xno; then
RTTI_FLAGS="-fno-rtti"
AC_MSG_RESULT([compile with -fno-rtti])
else
RTTI_FLAGS=""
AC_DEFINE([RTTI_ENABLED], 1, [Define if we enabled runtime type infos])
AC_MSG_RESULT([compile with default rtti (no flags)])
fi
dnl Check for --enable-exceptions flag
AC_ARG_ENABLE(exceptions,
[ --enable-exceptions compile with exception handling],
exceptions=$enable_exceptions
)
AC_MSG_CHECKING([for exceptions])
if test "$STL_CFLAGS" != ""; then
AC_MSG_RESULT([using stlport, exceptions required])
AC_DEFINE([EXCEPTIONS_ENABLED], 1, [Define if exceptions are enabled])
elif test "x$mpatrol" = xyes; then
AC_MSG_RESULT([using mpatrol, exceptions required])
AC_DEFINE([EXCEPTIONS_ENABLED], 1, [Define if exceptions are enabled])
else
if test "x$exceptions" = xyes; then
EXCEPTIONS_FLAGS=""
AC_MSG_RESULT([compile with default exceptions (no flags)])
AC_DEFINE([EXCEPTIONS_ENABLED], 1, [Define if exceptions are enabled])
else
EXCEPTIONS_FLAGS="-fno-exceptions"
AC_MSG_RESULT([compile with -fno-exceptions])
fi
fi
dnl Check for --enable-debug flag
AC_ARG_ENABLE(debug,
[ --enable-debug compile without optimizations, and more run-time verbosity],
debug=$enable_debug
)
AC_MSG_CHECKING([for debugging])
if test "x$debug" = xyes; then
CFLAGS="$CFLAGS -DDEBUG -g"
AC_MSG_RESULT([debug flag given])
else
AC_MSG_RESULT([no debugging])
fi
dnl Check for --with-themedir
AC_ARG_WITH(themedir,[ --with-themedir=DIR ParaGUI theme files are in DIR],
PARAGUI_THEMEDIR="$withval", PARAGUI_THEMEDIR=$prefix/share/paragui)
if test "$PARAGUI_THEMEDIR" = "NONE/share/paragui"; then
PARAGUI_THEMEDIR=$SDL_PREFIX/share/paragui
fi
AC_DEFINE_UNQUOTED([PARAGUI_THEMEDIR], "$PARAGUI_THEMEDIR", [default directory for themes])
dnl Check for --enable-vncserver flag
VNCSERVER_LIBS=""
AC_CHECK_HEADER(rfb/rfb.h, [have_vncserver_include=yes])
AC_CHECK_LIB(vncserver, rfbUsage, have_vncserver_lib=yes)
AC_ARG_ENABLE(vncserver,
[ --enable-vncserver compile with or without the integrated vncserver],
vncserver=$enable_vncserver
)
AC_MSG_CHECKING([for vncserver])
if test "x$vncserver" = xno; then
AC_MSG_RESULT([no])
else
if test x$have_vncserver_include = xyes; then
if test x$have_vncserver_lib = xyes; then
AC_DEFINE([HAVE_VNCSERVER], 1, [vnc server library])
VNCSERVER_LIBS="-lvncserver"
fi
fi
AC_MSG_RESULT([yes])
fi
AC_SUBST(VNCSERVER_LIBS)
dnl Check for swig bindings
BINDINGS=""
swig_p=no
python_p=no
ruby_p=no
AC_ARG_ENABLE(python,
[ --enable-python create Python bindings],
[python_p=$enable_python
swig_p=$enable_python]
)
AC_ARG_ENABLE(ruby,
[ --enable-ruby create Ruby bindings],
[ruby_p=$enable_ruby
swig_p=$enable_ruby]
)
AC_ARG_ENABLE(csharp,
[ --enable-csharp create C# (.NET, MONO) bindings],
[csharp_p=$enable_csharp
swig_p=$enable_csharp]
)
if test "x$swig_p" = xyes; then
SWIG=""
AC_PATH_PROG(SWIG, swig, no)
if test "x$SWIG" = xno; then
AC_MSG_ERROR([*** Unable to find swig! (www.swig.org) ***])
fi
AC_SUBST(SWIG)
fi
if test "x$python_p" = xyes; then
AC_PATH_PROG(PYTHON, python, no)
if test "x$PYTHON" = xno; then
AC_MSG_ERROR([*** Unable to find python interpreter! ***])
fi
dnl Check for Python.h
PYTHON_INCLUDE_DIR=""
PYTHON_LIB_DIR=""
have_python_include=no
AC_CHECK_HEADER(python2.2/Python.h, [have_python_include=yes])
PYTHON_INCLUDE_DIR=$prefix/include/python2.2
PYTHON_LIB_DIR=$libdir/python2.2
if test x$have_python_include = xno; then
AC_CHECK_HEADER(python2.1/Python.h, [have_python_include=yes])
PYTHON_INCLUDE_DIR=$prefix/include/python2.1
PYTHON_LIB_DIR=$libdir/python2.1
fi
if test x$have_python_include = xno; then
AC_CHECK_HEADER(python2.0/Python.h, [have_python_include=yes])
PYTHON_INCLUDE_DIR=$prefix/include/python2.0
PYTHON_LIB_DIR=$libdir/python2.0
fi
if test x$have_python_include = xno; then
AC_MSG_ERROR([*** Python.h not found! ***])
fi
AC_SUBST(PYTHON_INCLUDE_DIR)
AC_SUBST(PYTHON_LIB_DIR)
BINDINGS="$BINDINGS python"
fi
if test "x$ruby_p" = xyes; then
AC_PATH_PROG(RUBY, ruby, no)
if test "x$RUBY" = xno; then
AC_MSG_ERROR([*** Unable to find Ruby interpreter! ***])
fi
RUBY_INCLUDE_DIR=[`ruby -e "require 'rbconfig'; puts Config::CONFIG['archdir']"`]
RUBY_INSTALL_DIR=[`ruby -e "require 'rbconfig'; puts Config::CONFIG['sitearchdir']"`]
have_ruby_include=no
AC_CHECK_HEADER($RUBY_INCLUDE_DIR/ruby.h, [have_ruby_include=yes])
if test "x$have_ruby_include" = xno; then
AC_MSG_ERROR([*** ruby.h not found! ***])
fi
AC_SUBST(RUBY_INCLUDE_DIR)
AC_SUBST(RUBY_INSTALL_DIR)
BINDINGS="$BINDINGS ruby"
fi
if test "x$csharp_p" = xyes; then
BINDINGS="$BINDINGS csharp"
fi
AC_SUBST(BINDINGS)
AC_SUBST(SYSTEM_LIBS)
OLDLIBS="$LIBS"
LIBS=""
# Grab all extra libs from SDL_CONFIG to build the static lib list.
# Unfortunately libs like jpeg and png will be missing still so we check
# for those manually.
dnl if test "$SDL_CONFIG" != ""; then
dnl SYSTEM_LIBS=`$SDL_CONFIG --static-libs | sed s:"$($SDL_CONFIG --libs)"::`
dnl fi
AC_CHECK_LIB(jpeg,jpeg_read_header)
AC_CHECK_LIB(tiff,TIFFClose)
AC_CHECK_LIB(png,png_create_read_struct)
dnl SYSTEM_LIBS="$SYSTEM_LIBS $LIBS"
dnl LIBS="$OLDLIBS"
AC_CHECK_FUNCS(vsnprintf)
AC_CHECK_FUNCS(strtok)
AC_CHECK_FUNCS(strdup)
AC_CHECK_HEADER(fnmatch.h,have_fnmatch_h=yes)
if test x$have_fnmatch_h = xyes; then
AC_CHECK_FUNCS(fnmatch)
fi
PARAGUI_CFLAGS="-I$prefix/include/paragui $SIGC_CFLAGS $STL_CFLAGS $FREETYPE_CFLAGS $SDL_CFLAGS $RTTI_FLAGS $EXTRA_FLAGS"
PARAGUI_LIBS="-L$prefix/lib -lparagui $SIGC_LIBS $SDL_LIBS $LIBEXPAT $FREETYPE_LIBS $EXTRA_LIBS $LIBSTDCPP"
AC_SUBST(FREETYPE_LIBS)
CXXFLAGS="$STLPORT_FLAGS $CFLAGS $RTTI_FLAGS $EXCEPTIONS_FLAGS"
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(PARAGUI_CFLAGS)
AC_SUBST(PARAGUI_LIBS)
# lookup the root directory for building RPM's
if test [ -d /usr/src/redhat ]; then
RPM_ROOT=/usr/src/redhat/SOURCES
fi
if test [ -d /usr/src/RPM ]; then
RPM_ROOT=/usr/src/RPM/SOURCES
fi
AC_SUBST(RPM_ROOT)
# Finally create all the generated files
AC_OUTPUT([
Makefile
bindings/Makefile
bindings/csharp/Makefile
bindings/python/Makefile
bindings/ruby/Makefile
data/Makefile
doc/Makefile
doc/paragui.doxy
doc/html/Makefile
doc/html/images/Makefile
doc/txt/Makefile
include/Makefile
sdk/Makefile
src/Makefile
src/core/Makefile
src/draw/Makefile
src/expat/Makefile
src/font/Makefile
src/gp2x/Makefile
src/themes/Makefile
src/widgets/Makefile
src/ystring/Makefile
test/Makefile
test/colorselector/Makefile
test/fireworks/Makefile
test/keyboard/Makefile
paragui.spec
paragui-config
paragui.pc
], [chmod +x paragui-config])