File: configure.in

package info (click to toggle)
libggimisc 2.0.1-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,236 kB
  • ctags: 109
  • sloc: sh: 6,595; ansic: 557; makefile: 140
file content (281 lines) | stat: -rw-r--r-- 7,379 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
dnl $Id: configure.in,v 1.11 2001/08/25 16:08:28 skids Exp $
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.13)

AC_INIT(include/ggi/misc.h)

dnl Put the name and version of the package here
AM_INIT_AUTOMAKE(libggimisc,2.0.1,-)

AM_MAINTAINER_MODE
AM_DISABLE_STATIC


dnl ========================================================================
dnl Set some defaults

PATHTAG="pAtHTAg"
TAGLEN="7"
ggimisc_conffile="libggimisc.conf"
ggi_subdir="ggi"

use_debug="yes"

dnl - Targets
build_fbdev_target="auto"
build_svgalib_target="auto"
build_x_target="auto"

dnl ========================================================================
dnl Checks for programs.

dnl Check for C compiler
AC_PROG_CC
dnl Tell the build system that this is a well-written extension from which
dnl it is possible to build Win32 DLLs
AC_LIBTOOL_WIN32_DLL
dnl Configure libtool
AM_PROG_LIBTOOL
dnl Check for the 'install' program
AC_PROG_INSTALL


dnl ========================================================================
dnl User selectable options

AC_ARG_WITH(ggi,
[  --with-ggi=DIR          use the LibGGI installed with prefix DIR
                           (can be used to specify location of LibGII too)],
CFLAGS="$CFLAGS -I$withval/include"
CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib")

AC_ARG_WITH(uninst-ggi,
[  --with-uninst-ggi=DIR   use uninstalled copy of LibGGI found in DIR],
absval=`(cd "$withval"; pwd)`
CFLAGS="$CFLAGS -I$absval/include"
CPPFLAGS="$CPPFLAGS -I$absval/include"
LDFLAGS="$LDFLAGS -L$absval/ggi")

AC_ARG_WITH(uninst-gii,
[  --with-uninst-gii=DIR   use uninstalled copy of LibGII found in DIR],
absval=`(cd "$withval"; pwd)`
CFLAGS="$CFLAGS -I$absval/include"
CPPFLAGS="$CPPFLAGS -I$absval/include"
LDFLAGS="$LDFLAGS -L$absval/gg -L$absval/gii")

AC_ARG_ENABLE(debug,
[  --disable-debug         don't build with run-time debugging (speed freaks)],
use_debug=$enableval)

dnl - TARGETS:
AC_ARG_ENABLE(fbdev,
[  --disable-fbdev             don't build the fbdev target],
build_fbdev_target=$enableval)


AC_ARG_ENABLE(svgalib,
[  --disable-svgalib             don't build the svgalib target],
build_svgalib_target=$enableval)


AC_ARG_ENABLE(x,
[  --disable-x             don't build the X target],
build_x_target=$enableval)



dnl Support the --with-extra-libs and --with-extra-includes command line
dnl options to 'configure'.
GGI_EXTRA_PATHS


dnl ========================================================================
dnl Checks for header files.

dnl Check for standard C headers
AC_HEADER_STDC
dnl - Check for other headers
AC_CHECK_HEADERS(ggi/ggi.h linux/fb.h)

dnl - Must have these extra headers to build.

dnl ========================================================================
dnl Checks for typedefs, structures, and compiler characteristics.

dnl Check if the compiler supports the 'const' keyword, otherwise define
dnl 'const' to empty.
AC_C_CONST
dnl Check if the compiler supports inlining. If it does define 'inline' to
dnl the apropriate keyword, otherwise define it to empty.
AC_C_INLINE

dnl Check for the extension of shared libraries (excluding the dot) and
dnl put it in the @DLLEXT@ Makefile variable.
GGI_DLLEXT

dnl ========================================================================
dnl - Checks for library functions.


dnl ========================================================================
dnl LibGGI must be built

ggi_missing_part=no

AC_CHECK_LIB(ggi,ggiInit,foo=bar,ggi_missing_part=yes)

if test "$ac_cv_header_ggi_ggi_h" != "yes"; then
  ggi_missing_part=yes
fi


dnl ========================================================================
dnl - Checks for target-specific libraries and headers

DISPLAYSUBDIRS=""

dnl Check for the function 'vga_init' in the 'vga' library.
dnl If not found we disable the "svgalib" target.
AC_CHECK_LIB(vga,vga_init, foo=bar, build_svgalib_target="no")


dnl Use AC_PATH_XTRA if you want to build something that uses X
if test "x$build_x_target" != "xno"; then
  AC_PATH_XTRA
    if test "x$no_x" = "xyes"; then
    build_x_target="no"
  fi
fi

dnl If linux/fb.h was not found above we disable the "fbdev" target.
if test "x$ac_cv_header_linux_fb_h" != "xyes"; then
  build_fbdev_target="no"
fi

if test "x$build_fbdev_target" != "xno"; then
    AC_TRY_COMPILE([
#include <linux/fb.h>
],[
int i =  FB_VBLANK_VBLANKING;
],
    foo=bar,
    build_fbdev_target="no")
fi


dnl ========================================================================
dnl - Check for targets

AC_MSG_CHECKING(if we should build fbdev    target)
if test "x$build_fbdev_target" = "xno"; then
  AC_MSG_RESULT(no)
else
  DISPLAYSUBDIRS="$DISPLAYSUBDIRS fbdev"
  build_fbdev_target="yes"
  AC_MSG_RESULT(yes)
fi


AC_MSG_CHECKING(if we should build svgalib  target)
if test "x$build_svgalib_target" = "xno"; then
  AC_MSG_RESULT(no)
else
  DISPLAYSUBDIRS="$DISPLAYSUBDIRS svgalib"
  build_svgalib_target="yes"
  AC_MSG_RESULT(yes)
fi


AC_MSG_CHECKING(if we should build X        target)
if test "x$build_x_target" = "xno"; then
  AC_MSG_RESULT(no)
else
  DISPLAYSUBDIRS="$DISPLAYSUBDIRS X"
  build_x_target="yes"
  AC_MSG_RESULT(yes)
fi




dnl ========================================================================
dnl Finally add some flags

dnl _THREAD_SAFE is used instead of _REENTRANT on some systems
CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE"

if test "x$use_debug" = "xyes"; then
  AC_DEFINE(DEBUG)
  if test "$ac_cv_prog_gcc" = "yes"; then
    CFLAGS="$CFLAGS -g -Wall -Wstrict-prototypes"
  fi
fi


dnl ========================================================================
dnl Write output

AC_SUBST(DISPLAYSUBDIRS)

dnl Bah! autoconf hasn't set prefix to it's default value yet!
test "x$prefix" = xNONE && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

dnl Use static_* to substitute into files where values shouldn't
dnl dynamicly change.  Makefiles need to be able to dynamicly change
dnl paths between build and install and shouldn't use these static_*.
dnl Files that will be installed must always show the final location where
dnl they will reside and should use these static_* values.
dnl Ensure that all static_* are fully expanded.

eval static_libdir="$libdir"
old_val=""
until test "$static_libdir" = "$old_val"; do
	old_val="$static_libdir"
	eval static_libdir="$static_libdir"
done

eval static_sysconfdir="$sysconfdir"
old_val=""
until test "$static_sysconfdir" = "$old_val"; do
      old_val="$static_sysconfdir"
      eval static_sysconfdir="$static_sysconfdir"
done

AC_SUBST(ggi_subdir)
AC_SUBST(static_libdir)
AC_SUBST(static_sysconfdir)
AC_DEFINE_UNQUOTED(GGIMISCTAGLEN,$TAGLEN)
AC_DEFINE_UNQUOTED(GGIMISCPATHTAG,"$PATHTAG")
AC_DEFINE_UNQUOTED(GGIMISCCONFFILE,"$PATHTAG$static_sysconfdir/$ggi_subdir/$ggimisc_conffile")

AM_CONFIG_HEADER(config.h)

AC_OUTPUT(
Makefile
include/Makefile
include/ggi/Makefile
include/ggi/internal/Makefile
ggimisc/Makefile
display/Makefile
display/X/Makefile
display/svgalib/Makefile
display/fbdev/Makefile
demos/Makefile
doc/Makefile
doc/man/Makefile
m4/Makefile
dist/Makefile
dist/rpm/Makefile
dist/rpm/libggimisc.spec
libggimisc.conf
)

if test "$ggi_missing_part" = "yes"; then 
  AC_MSG_WARN([
LibGGI is not properly installed on the system. You need LibGGI for
building the LibGGIMisc extension. Please compile LibGGI first.
])
fi