File: configure.in

package info (click to toggle)
clanlib0 0.4.4-8
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,400 kB
  • ctags: 6,569
  • sloc: cpp: 45,626; ansic: 1,713; makefile: 695; asm: 250; sh: 48
file content (359 lines) | stat: -rw-r--r-- 10,200 bytes parent folder | download
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
dnl $Id: configure.in,v 1.3 2000/05/01 16:31:43 grumbel Exp $
dnl
dnl Process this file with autoconf to produce a configure script.
dnl

AC_INIT(ascii-logo)

cat ascii-logo

AC_PREFIX_DEFAULT(/usr/local)

dnl --------------------------------------------
dnl Verify the following programs are available:
dnl --------------------------------------------

AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_RANLIB

dnl ----------------------------------------
dnl Search for libraries useful for ClanLib:
dnl ----------------------------------------

AC_CHECK_LIB(z,main,, echo "ClanLib requires zlib to run."; exit 1)
AC_CHECK_LIB(Hermes,main,, echo "ClanLib requires Hermes to run."; exit 1)
AC_CHECK_LIB(ggi,main, GGI=enabled, GGI=disabled)
AC_CHECK_LIB(vga,main, SVGALIB=enabled, SVGALIB=disabled)
AC_CHECK_LIB(ptc,main, PTC=enabled, PTC=disabled)

AC_MSG_CHECKING(for recent linux/fb.h)
AC_EGREP_HEADER(mmio_len, linux/fb.h, echo yes; FBDEV=enabled, echo no; FBDEV=disabled)

AC_CHECK_HEADERS(unistd.h fcntl.h sys/kd.h sys/vt.h)

AC_PATH_X
if test "$no_x" != "yes"; then
	x_includes="-I $x_includes -I $x_includes/X11"
	x_libraries="-L $x_libraries -lX11 -lXext"

	X11=enabled
else
	x_includes=""
	x_libraries=""
    X11=disabled
fi

AC_CHECK_LIB(GL,main, OPENGL=enabled, OPENGL=disabled,-L /usr/X11R6/lib -lX11 -lXext -lm)
AC_CHECK_LIB(Magick,main, Magick=enabled, Magick=disabled,-L /usr/X11R6/lib -lbz2)
AC_CHECK_LIB(Xxf86vm,main, VIDMODE=enabled, VIDMODE=disabled,-L /usr/X11R6/lib -lXxf86vm)

dnl -----------------------------------------------------------------------
dnl Check system endianess: (note: ClanLib is _not_ endian clean right now)
dnl -----------------------------------------------------------------------

AC_C_BIGENDIAN
AC_CHECK_SIZEOF(int, 4)

if test $ac_cv_sizeof_int -eq 8; then
	AC_DEFINE(USE_64BIT)
fi

if test "$ac_cv_c_bigendian" = "yes"; then
	AC_DEFINE(USE_BIG_ENDIAN)
fi

dnl ------------------------------------------------
dnl CL_EXPAND_DIR(VARNAME, DIR)
dnl ------------------------------------------------

dnl expands occurrences of ${prefix} and ${exec_prefix} in the given DIR,
dnl and assigns the resulting string to VARNAME
dnl example: CL_EXPAND_DIR(LOCALEDIR, "$datadir/locale")
dnl eg, then: AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
dnl by Alexandre Oliva 
dnl from http://www.cygnus.com/ml/automake/1998-Aug/0040.html

define([CL_EXPAND_DIR],
[
	$1=$2
	$1=`(
		test "x$prefix" = xNONE && prefix="$ac_default_prefix"
		test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
		eval echo \""[$]$1"\"
	)`
])

CL_EXPAND_DIR(cl_scandir, "$libdir/ClanLib")
AC_DEFINE_UNQUOTED(CL_SCANDIR, "$cl_scandir")

dnl ------------------------------------------------
dnl BBN's macro for checking commandline parameters:
dnl ------------------------------------------------

dnl CHECK_ENABLED(feature,help,define,default)
define([CHECK_ENABLED],
[
  AC_ARG_ENABLE($1,[  $2],
  [
    if test "$enableval" != "no"; then
      $3="enabled"
      AC_DEFINE($3)
      AC_MSG_RESULT([enabled])
    else
      AC_MSG_RESULT([disabled])
    fi
  ],
  [
    if test "$4" = "enabled"; then
      $3="enabled"
      AC_DEFINE($3)
      AC_MSG_RESULT([enabled])
    else
      AC_MSG_RESULT([disabled])
    fi
  ])
])

dnl -----------------------------------------------------
dnl Check commandline parameters to the configure script:
dnl -----------------------------------------------------

AC_MSG_CHECKING(for X11 support)
CHECK_ENABLED(x11,
  [--enable-x11            Enable X11 support],
  USE_X11, $X11)

AC_MSG_CHECKING(for FBDev support)
CHECK_ENABLED(fbdev,
  [--enable-fbdev          Enable FBDev support],
  USE_FBDEV, $FBDEV)

AC_MSG_CHECKING(for GGI support)
CHECK_ENABLED(ggi,
  [--enable-ggi            Enable GGI support],
  USE_GGI, $GGI)

AC_MSG_CHECKING(for OpenGL support)
CHECK_ENABLED(opengl,
  [--enable-opengl            Enable OpenGL support],
  USE_OPENGL, $OPENGL)

AC_MSG_CHECKING(for svgalib support)
CHECK_ENABLED(svgalib,
  [--enable-svgalib        Enable svgalib support],
  USE_SVGALIB, $SVGALIB)

AC_MSG_CHECKING(for OpenPTC support)
CHECK_ENABLED(ptc,
  [--enable-ptc            Enable OpenPTC support],
  USE_PTC, $PTC)

AC_MSG_CHECKING(for VidMode support)
CHECK_ENABLED(vidmode,
  [--enable-vidmode           Enable VidMode support],
  USE_VIDMODE, $VIDMODE)

AC_MSG_CHECKING(for ClanSound support)
CHECK_ENABLED(clansound,
  [--enable-clansound      Enable ClanSound support],
  USE_CLANSOUND, enabled)

AC_MSG_CHECKING(for network support)
CHECK_ENABLED(network,
  [--enable-network        Enable network support],
  USE_NETWORK, enabled)

AC_MSG_CHECKING(for i386 assembly support)
CHECK_ENABLED(asm386,
  [--enable-asm386         Enable i386 assembly support],
  USE_I386, enabled)

AC_MSG_CHECKING(for dynamic loading support)
CHECK_ENABLED(dyn,
  [--enable-dyn            Enable dynamic loading],
  USE_DYN, enabled)

dnl ----------------------------------------------------
dnl Setup libs to be linked with the core library files.
dnl ----------------------------------------------------

libs="-ldl -lz -lHermes -lpthread"

objf_nondyn=""
flag_tty=""

if test "$USE_DYN" != "enabled"; then
	if test "$USE_VIDMODE" = "enabled"; then x_libraries="$x_libraries -lXxf86vm"; fi
	if test "$USE_X11" = "enabled"; then objf_nondyn="\$(OBJF_DISP_X11) $objf_nondyn"; libs="$x_libraries $libs"; fi
	if test "$USE_SVGALIB" = "enabled"; then flag_tty="yes"; objf_nondyn="\$(OBJF_DISP_SVGALIB) $objf_nondyn"; libs="-lvga $libs"; fi
	if test "$USE_OPENGL" = "enabled"; then objf_nondyn="\$(OBJF_DISP_GLX) $objf_nondyn"; libs="$x_libraries $libs -lGL -lGLU"; fi
	if test "$USE_FBDEV" = "enabled"; then flag_tty="yes"; objf_nondyn="\$(OBJF_DISP_FBDEV) $objf_nondyn"; fi
	if test "$USE_GGI" = "enabled"; then objf_nondyn="\$(OBJF_DISP_GGI) $objf_nondyn"; libs="-lggi $libs"; fi
	if test "$USE_PTC" = "enabled"; then objf_nondyn="\$(OBJF_DISP_PTC) $objf_nondyn"; libs="-lptc $libs"; fi
	if test "$USE_CLANSOUND" = "enabled"; then objf_nondyn="\$(OBJF_SOUND_CLANSOUND) $objf_nondyn"; fi
	if test "$USE_NETWORK" = "enabled"; then objf_nondyn="\$(OBJF_NETWORK_UNIX) $objf_nondyn"; fi
	if test "$flag_tty" = "yes"; then objf_nondyn="\$(OBJF_INPUT_TTY) $objf_nondyn"; fi
fi

x_libraries="$x_libraries -lXxf86vm"

AC_SUBST(x_includes)
AC_SUBST(x_libraries)
AC_SUBST(libs)
AC_SUBST(objf_nondyn)

dnl ---------------------------------------------------------------------
dnl Set which extra object files that should be used in case of assembly:
dnl ---------------------------------------------------------------------

generic_assembly=""

if test "$USE_I386" = "enabled"; then
  generic_assembly="$generic_assembly \$(OBJF_INTEL_ASM)"
fi
AC_SUBST(generic_assembly)

dnl --------------------
dnl Check for debug mode
dnl --------------------

AC_MSG_CHECKING(for debug mode)
AC_ARG_ENABLE(debug,[--enable-debug          Enable debugging support],
[

  if test "$enableval" != "no"; then
    comp_mode="-DDEBUG=1 -g"
    AC_MSG_RESULT([enabled])
  else
    comp_mode="-O3"
    AC_MSG_RESULT([*********** <-- DISABLED --> ***********])
  fi
],
[
  comp_mode="-O3"
  AC_MSG_RESULT([********** DISABLED FOR STABLE RELEASE VERSION **********])
])

AC_SUBST(comp_mode)

dnl ------------------------------------------
dnl Figure out which display targets to build:
dnl ------------------------------------------

display_targets=""
input_targets=""
flag_tty=""

if test "$USE_DYN" = "enabled"; then
  if test "$USE_X11" = "enabled"; then
    display_targets="$display_targets Libs/libclan-display-x11.so.\$(D_VERSION_MINOR)"
  fi

  if test "$USE_FBDEV" = "enabled"; then
    display_targets="$display_targets Libs/libclan-display-fbdev.so.\$(D_VERSION_MINOR)";
    flag_tty="yes";
  fi

  if test "$USE_GGI" = "enabled"; then
    display_targets="$display_targets Libs/libclan-display-ggi.so.\$(D_VERSION_MINOR)"
  fi

  if test "$USE_OPENGL" = "enabled"; then
    display_targets="$display_targets Libs/libclan-display-glx.so.\$(D_VERSION_MINOR)"
  fi

  if test "$USE_SVGALIB" = "enabled"; then
    display_targets="$display_targets Libs/libclan-display-svgalib.so.\$(D_VERSION_MINOR)";
    flag_tty="yes";
  fi

  if test "$USE_PTC" = "enabled"; then
    display_targets="$display_targets Libs/libclan-display-ptc.so.\$(D_VERSION_MINOR)"
  fi
  
  if test "$flag_tty"="yes"; then
    input_targets="Libs/libclan-input-tty.so.\$(D_VERSION_MINOR)"
  fi
fi

AC_SUBST(display_targets)
AC_SUBST(input_targets)

dnl ------------------------------------
dnl Check if the sound target is wanted:
dnl ------------------------------------

sound_targets=""

if test "$USE_DYN" = "enabled"; then
  if test "$USE_CLANSOUND" = "enabled"; then
    sound_targets="Libs/libclan-sound.so.\$(D_VERSION_MINOR)"
  fi
fi

AC_SUBST(sound_targets)

dnl --------------------------------------
dnl Check if the network target is wanted:
dnl --------------------------------------

network_targets=""

if test "$USE_DYN" = "enabled"; then
  if test "$USE_NETWORK" = "enabled"; then
    network_targets="Libs/libclan-network.so.\$(D_VERSION_MINOR)"
  fi
fi

AC_SUBST(network_targets)

dnl ---------------------------------
dnl Try to locate perl on the system:
dnl ---------------------------------

AC_MSG_CHECKING(for perl)
if test -x /bin/perl; then
	perl_exec="/bin/perl"
fi
if test -x /usr/bin/perl; then
	perl_exec="/usr/bin/perl"
fi
if test -x /usr/local/bin/perl; then
	perl_exec="/usr/local/bin/perl"
fi
if test "$perl_exec" = ""; then
	perl_exec="/usr/bin/perl"
	AC_MSG_RESULT("no - documentation cannot be compiled")
else
	AC_MSG_RESULT("found at $perl_exec")
fi
AC_SUBST(perl_exec)

dnl ----------------------------
dnl ClanLib version information:
dnl ----------------------------

version_major="0"
version_minor="0.4.4"
cl_version="0,4,4"

AC_SUBST(version_major)
AC_SUBST(version_minor)
AC_SUBST(cl_version)

dnl ---------------------
dnl Finish configuration:
dnl ---------------------

dnl Set installation prefix:
dnl AC_SUBST(prefix)

AC_OUTPUT(Makefile Makefile.conf Makefile.dep Documentation/perceps Documentation/Reference/Makefile clanlib-config)

dnl Set file permissions on perceps:
chmod a+x Documentation/perceps
chmod 755 clanlib-config

make dep > /dev/null 2>&1