~ubuntu-branches/ubuntu/natty/jasper/natty

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
dnl ****************************************************************************
dnl Copyright (c) 2001-2003 Michael David Adams.
dnl All rights reserved.
dnl
dnl The complete licensing terms for this software can be found in the file
dnl named "LICENSE" in this software distribution.
dnl ****************************************************************************

dnl The package name.
define(AC_JAS_NAME, jasper)

dnl ************************************************************
dnl Package version information.
dnl ************************************************************

dnl The major, minor, and micro version numbers of the package.
define(AC_JAS_MAJOR_VERSION, 1)
define(AC_JAS_MINOR_VERSION, 701)
define(AC_JAS_MICRO_VERSION, 0)

dnl The package version.
define(AC_JAS_VERSION,
  AC_JAS_MAJOR_VERSION.AC_JAS_MINOR_VERSION.AC_JAS_MICRO_VERSION)

dnl ************************************************************
dnl RPM version information.
dnl ************************************************************

define(AC_JAS_RPM_RELEASE, 1)

dnl ************************************************************
dnl Dynamically-linked library version information (for Libtool).
dnl ************************************************************

dnl Guidelines for updating these definitions:
dnl 1) If the library source code has changed at all since the last update,
dnl then increment REVISION.
dnl 2) If any interfaces have been added, removed, or changed since the last
dnl update, increment CURRENT, and set REVISION to zero.
dnl 3) If any interfaces have been added since the last public release, then
dnl increment AGE.
dnl 4) If any interfaces have been removed since the last public release, then
dnl set AGE to zero.

dnl The most recent interface number that this library implements.
define(AC_JAS_LT_CURRENT, 1)

dnl The implementation number of the current interface.
define(AC_JAS_LT_REVISION, 0)

dnl The difference between the newest and oldest interfaces that this library
dnl implements.  In other words, the library implements all of the interface
dnl numbers in the range from current - age to current.
define(AC_JAS_LT_AGE, 0)

dnl The release number of the library.
define(AC_JAS_LT_RELEASE, AC_JAS_MAJOR_VERSION.AC_JAS_MINOR_VERSION)

dnl ****************************************************************************
dnl NOTHING BELOW THIS LINE SHOULD REQUIRE MODIFICATION (IDEALLY :-)
dnl ****************************************************************************

dnl Initialize autoconf.
AC_INIT(AC_JAS_NAME, AC_JAS_VERSION)
AC_PREREQ(2.57)
AC_CONFIG_SRCDIR(README)
dnl Note: Avoid the temptation to call the auxiliary directory "aux" because
dnl Microsoft Windows will barf if you try to use "aux" as a directory name. :-(
AC_CONFIG_AUX_DIR(acaux)

# Detect the canonical host and target build environment.
# Note: This precedes automake initialization to avoid warnings.
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET

# Initialize automake.
AM_INIT_AUTOMAKE

# Initialize version information parameters.
JAS_MAJOR_VERSION=AC_JAS_MAJOR_VERSION
JAS_MINOR_VERSION=AC_JAS_MINOR_VERSION
JAS_MICRO_VERSION=AC_JAS_MICRO_VERSION
JAS_VERSION=AC_JAS_VERSION
AC_SUBST(JAS_MAJOR_VERSION)
AC_SUBST(JAS_MINOR_VERSION)
AC_SUBST(JAS_MICRO_VERSION)
AC_SUBST(JAS_VERSION)
AC_DEFINE_UNQUOTED(JAS_VERSION, "$JAS_VERSION")
JAS_RPM_RELEASE=AC_JAS_RPM_RELEASE
AC_SUBST(JAS_RPM_RELEASE)

# Initialize version information for libtool.
LT_RELEASE=AC_JAS_LT_RELEASE
LT_CURRENT=AC_JAS_LT_CURRENT
LT_REVISION=AC_JAS_LT_REVISION
LT_AGE=AC_JAS_LT_AGE
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

# Indicate a configure-based build is being used.
AC_DEFINE(JAS_CONFIGURE)

############################################################
# Configuration header file.
############################################################

AH_TEMPLATE([DEBUG_OVERFLOW], [Debugging overflow detection])
AH_TEMPLATE([JAS_CONFIGURE], [JasPer configure])
AH_TEMPLATE([JAS_VERSION], [JasPer version])
AH_TEMPLATE([DEBUG_MEMALLOC], [Debugging memory allocator])
AH_TEMPLATE([DEBUG], [Extra debugging support])
AH_TEMPLATE([HAVE_VLA], [Have variable length arrays])

AH_TOP([
/* Avoid problems due to multiple inclusion. */
#ifndef JAS_CONFIG_H
#define JAS_CONFIG_H

/* This preprocessor symbol identifies the version of JasPer. */
#undef	JAS_VERSION
/* If configure is being used, this symbol will be defined automatically
  at this point in the configuration header file. */

/* The preprocessor symbol JAS_WIN_MSVC_BUILD should not be defined
  unless the JasPer software is being built under Microsoft Windows
  using Microsoft Visual C. */
#ifndef	JAS_WIN_MSVC_BUILD
/* A configure-based build is being used. */

])

AH_BOTTOM([
#else
/* A configure-based build is not being used. */
#include <jasper/jas_config2.h>
#endif

#endif
])

############################################################
# Checks for programs.
############################################################

AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB

AM_DISABLE_SHARED
AC_PROG_LIBTOOL

AC_PATH_XTRA

AC_MSG_CHECKING(whether variable-length arrays are supported)
AC_TRY_COMPILE([], [
	int n; int foo[n];
],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_VLA)],
AC_MSG_RESULT(no))

############################################################
# Check for the IJG JPEG library.
############################################################

# Allow the user to explicitly specify whether the JPEG library is present.
AC_ARG_ENABLE(libjpeg,
[  --disable-libjpeg    Force the IJG JPEG library to be ignored],
[
case "${enableval}" in
yes)
	ENABLE_LIBJPEG=yes;;
no)
	ENABLE_LIBJPEG=no;;
*)
	AC_MSG_ERROR(bad value ${enableval} for --disable-libjpeg)
	;;
esac
], ENABLE_LIBJPEG=yes)

HAVE_LIBJPEG=no
if test $ENABLE_LIBJPEG = yes; then
	# Check for the JPEG library.
	AC_CHECK_LIB(jpeg, jpeg_destroy, HAVE_LIBJPEG=yes, HAVE_LIBJPEG=no)
	if test $HAVE_LIBJPEG = yes; then
		LIBS="$LIBS -ljpeg"
	fi
fi
AM_CONDITIONAL(HAVE_LIBJPEG, test $HAVE_LIBJPEG = yes)

############################################################
# Check for OpenGL libraries.
############################################################

AC_ARG_WITH(glut-include-dir,
[  --with-glut-include-dir=DIR    Set GLUT include directory.],
[
	case "$withval" in
	/*)
		CFLAGS="$CFLAGS -I$withval"
		CPPFLAGS="$CPPFLAGS -I$withval";;
	*)
		AC_MSG_ERROR(--with-glut-include-dir requires absolute path)
		;;
	esac
],
)
AC_ARG_WITH(glut-lib-dir,
[  --with-glut-lib-dir=DIR        Set GLUT library directory.],
[
	case "$withval" in
	/*)
		LIBS="$LIBS -L$withval";;
	*)
		AC_MSG_ERROR(--with-glut-lib-dir requires absolute path)
		;;
	esac
],
)

AC_ARG_ENABLE(opengl,
[  --disable-opengl    Disable use of OpenGL. ],
[
	case "$enableval" in
	yes)
		ENABLE_OPENGL=yes;;
	no)
		ENABLE_OPENGL=no;;
	*)
		AC_MSG_ERROR(bad value ${enableval} for --disable-libjpeg)
		;;
	esac
],
ENABLE_OPENGL=yes)

HAVE_OPENGL=no
OPENGL_LIBS=""
if test $ENABLE_OPENGL = yes; then
	if test $HAVE_OPENGL = no; then
		TMPLIBS="-lglut -lGL -lGLU $X_PRE_LIBS -lX11 -lXmu -lXi -lXext -lXt $X_EXTRA_LIBS $X_LIBS"
		AC_CHECK_LIB(glut, glutInit, [HAVE_OPENGL=yes;
		  OPENGL_LIBS=$TMPLIBS], HAVE_OPENGL=no, $TMPLIBS)
	fi
	AC_CHECK_HEADER(GL/glut.h,, [HAVE_OPENGL=no; OPENGL_LIBS="";])
fi

AM_CONDITIONAL(HAVE_OPENGL, test $HAVE_OPENGL = yes)
AC_SUBST(OPENGL_LIBS)
AC_MSG_CHECKING([whether OpenGL libraries and headers were detected])
AC_MSG_RESULT($HAVE_OPENGL)

############################################################
# Check for other libraries.
############################################################

# Check for the math library.
AC_CHECK_LIB(m, main)

############################################################
# Check for header files.
############################################################

AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h unistd.h stdint.h stdbool.h io.h windows.h sys/types.h stdlib.h stddef.h)

############################################################
# Check for typedefs, structures, and compiler characteristics.
############################################################

AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(unsigned short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(unsigned long long)
dnl AC_CHECK_TYPE(bool, int)
AC_CHECK_TYPE(uchar, unsigned char)
AC_CHECK_TYPE(ushort, unsigned short)
AC_CHECK_TYPE(uint, unsigned int)
AC_CHECK_TYPE(ulong, unsigned long)
AC_CHECK_TYPE(longlong, long long)
AC_CHECK_TYPE(ulonglong, unsigned long long)
AC_CHECK_TYPE(ssize_t, int)

############################################################
# Checks for library functions.
############################################################

AC_FUNC_VPRINTF

############################################################
# Enable/disable special memory allocator for debugging.
############################################################

AC_ARG_ENABLE(dmalloc,
[  --enable-dmalloc    use special memory allocator for debugging],
[
case "${enableval}" in
yes)
	AC_DEFINE(DEBUG_MEMALLOC)
	;;
no)
	;;
*)
	AC_MSG_ERROR(bad value ${enableval} for --enable-dmalloc)
	;;
esac
], )

############################################################
# Enable/disable extra code for debugging.
############################################################

AC_ARG_ENABLE(debug,
[  --enable-debug    add extra code for debugging],
[
case "${enableval}" in
yes)
	debug=true
	AC_DEFINE(DEBUG)
	AC_DEFINE(DEBUG_OVERFLOW)
	if test "$GCC" = yes; then
		CFLAGS="-g -O0"
	fi
	;;
no)
	debug=false
	;;
*)
	AC_MSG_ERROR(bad value ${enableval} for --enable-debug)
	;;
esac
], [debug=false])

if test "$GCC" = yes; then
	CFLAGS="$CFLAGS -W -Wall -Wno-long-long -Wformat -Wmissing-prototypes -Wstrict-prototypes -pedantic"
fi

############################################################
# Generate the configuration header file.
############################################################

AM_CONFIG_HEADER(src/libjasper/include/jasper/jas_config.h)

############################################################
# Generate the makefiles.
############################################################

AC_OUTPUT([
Makefile
src/Makefile
src/appl/Makefile
src/libjasper/Makefile
src/libjasper/base/Makefile
src/libjasper/bmp/Makefile
src/libjasper/include/Makefile
src/libjasper/include/jasper/Makefile
src/libjasper/jp2/Makefile
src/libjasper/jpc/Makefile
src/libjasper/jpg/Makefile
src/libjasper/mif/Makefile
src/libjasper/pgx/Makefile
src/libjasper/pnm/Makefile
src/libjasper/ras/Makefile
src/msvc/Makefile
jasper.spec
])