]> icculus.org git repositories - icculus/xz.git/blob - configure.ac
Introduced compatibility with systems that have pre-C99
[icculus/xz.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 ###############################################################################
5 #
6 #   Copyright (C) 2007 Lasse Collin
7 #
8 #   This library is free software; you can redistribute it and/or
9 #   modify it under the terms of the GNU Lesser General Public
10 #   License as published by the Free Software Foundation; either
11 #   version 2.1 of the License, or (at your option) any later version.
12 #
13 #   This library is distributed in the hope that it will be useful,
14 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 #   Lesser General Public License for more details.
17 #
18 ###############################################################################
19
20 # NOTE: Don't add useless checks. autoscan detects this and that, but don't
21 # let it confuse you. For example, we don't care about checking for behavior
22 # of malloc(), stat(), or lstat(), since we don't use those functions in
23 # a way that would cause the problems the autoconf macros check.
24
25 AC_PREREQ(2.61)
26
27 # [LZMA] instead of [LZMA utils] since I prefer to have lzma-version.tar.gz
28 # instead of lzma-utils-version.tar.gz.
29 AC_INIT([LZMA], [4.42.3alpha], [lasse.collin@tukaani.org])
30
31 AC_CONFIG_SRCDIR([src/liblzma/common/common.h])
32 AC_CONFIG_HEADER([config.h])
33
34 echo
35 echo "LZMA Utils $PACKAGE_VERSION"
36
37 echo
38 echo "System type:"
39 # This is needed to know if assembler optimizations can be used.
40 AC_CANONICAL_HOST
41
42 echo
43 echo "Configure options:"
44
45 # Enable/disable debugging code:
46 AC_MSG_CHECKING([if debugging code should be compiled])
47 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging code.]),
48         [], enable_debug=no)
49 if test "x$enable_debug" = xyes; then
50         CFLAGS="-g $CFLAGS"
51         AC_MSG_RESULT([yes])
52 else
53         AC_DEFINE(NDEBUG, 1, [Define to disable debugging code.])
54         AC_MSG_RESULT([no])
55 fi
56
57 # Enable/disable the encoder components:
58 AC_MSG_CHECKING([if encoder components should be built])
59 AC_ARG_ENABLE(encoder, AC_HELP_STRING([--disable-encoder],
60                 [Do not build the encoder components.]),
61         [], enable_encoder=yes)
62 if test "x$enable_encoder" = xyes; then
63         AC_DEFINE([HAVE_ENCODER], 1,
64                 [Define to 1 if encoder components are enabled.])
65         AC_MSG_RESULT([yes])
66 else
67         AC_MSG_RESULT([no])
68 fi
69 AM_CONDITIONAL(COND_MAIN_ENCODER, test "x$enable_encoder" = xyes)
70
71 # Enable/disable the decoder components:
72 AC_MSG_CHECKING([if decoder components should be built])
73 AC_ARG_ENABLE(decoder, AC_HELP_STRING([--disable-decoder],
74                 [Do not build the decoder components.]),
75         [], enable_decoder=yes)
76 if test "x$enable_decoder" = xyes; then
77         AC_DEFINE([HAVE_DECODER], 1,
78                 [Define to 1 if decoder components are enabled.])
79         AC_MSG_RESULT([yes])
80 else
81         AC_MSG_RESULT([no])
82         if test "x$enable_encoder" = xno; then
83                 AC_MSG_ERROR([Do not disable both encoder and decoder.])
84         fi
85 fi
86 AM_CONDITIONAL(COND_MAIN_DECODER, test "x$enable_decoder" = xyes)
87
88 # Filters
89 AC_MSG_CHECKING([which filters to build])
90 AC_ARG_ENABLE(filters, AC_HELP_STRING([--enable-filters=],
91                 [Comma-separated list of filters to build. Default=all.
92                 Filters used in encoding are needed also in decoding.
93                 Available filters: copy subblock x86 powerpc ia64
94                 arm armthumb sparc delta lzma]),
95                 [], [enable_filters=copy,subblock,x86,powerpc,ia64,arm,armthumb,sparc,delta,lzma])
96 enable_filters=`echo "$enable_filters" | sed 's/,/ /g'`
97 enable_filters_copy=no
98 enable_filters_subblock=no
99 enable_filters_x86=no
100 enable_filters_powerpc=no
101 enable_filters_ia64=no
102 enable_filters_arm=no
103 enable_filters_armthumb=no
104 enable_filters_sparc=no
105 enable_filters_delta=no
106 enable_filters_lzma=no
107 enable_simple_filters=no
108 if test "x$enable_filters" = xno || test "x$enable_filters" = x; then
109         AC_MSG_RESULT([])
110         AC_MSG_ERROR([Please enable at least one filter.])
111 else
112         for arg in $enable_filters
113         do
114                 case $arg in
115                         copy)
116                                 enable_filters_copy=yes
117                                 AC_DEFINE([HAVE_FILTER_COPY], 1,
118                                         [Define to 1 if support for the
119                                         Copy filter is enabled.])
120                                 ;;
121                         subblock)
122                                 enable_filters_subblock=yes
123                                 AC_DEFINE([HAVE_FILTER_SUBBLOCK], 1,
124                                         [Define to 1 if support for the
125                                         Subblock filter is enabled.])
126                                 ;;
127                         x86)
128                                 enable_filters_x86=yes
129                                 enable_simple_filters=yes
130                                 AC_DEFINE([HAVE_FILTER_X86], 1,
131                                         [Define to 1 if support for the
132                                         x86 (BCJ) filter is enabled.])
133                                 ;;
134                         powerpc)
135                                 enable_filters_powerpc=yes
136                                 enable_simple_filters=yes
137                                 AC_DEFINE([HAVE_FILTER_POWERPC], 1,
138                                         [Define to 1 if support for the
139                                         PowerPC filter is enabled.])
140                                 ;;
141                         ia64)
142                                 enable_filters_ia64=yes
143                                 enable_simple_filters=yes
144                                 AC_DEFINE([HAVE_FILTER_IA64], 1,
145                                         [Define to 1 if support for the
146                                         IA64 filter is enabled.])
147                                 ;;
148                         arm)
149                                 enable_filters_arm=yes
150                                 enable_simple_filters=yes
151                                 AC_DEFINE([HAVE_FILTER_ARM], 1,
152                                         [Define to 1 if support for the
153                                         ARM filter is enabled.])
154                                 ;;
155                         armthumb)
156                                 enable_filters_armthumb=yes
157                                 enable_simple_filters=yes
158                                 AC_DEFINE([HAVE_FILTER_ARMTHUMB], 1,
159                                         [Define to 1 if support for the
160                                         ARMThumb filter is enabled.])
161                                 ;;
162                         sparc)
163                                 enable_filters_sparc=yes
164                                 enable_simple_filters=yes
165                                 AC_DEFINE([HAVE_FILTER_SPARC], 1,
166                                         [Define to 1 if support for the
167                                         SPARC filter is enabled.])
168                                 ;;
169                         delta)
170                                 enable_filters_delta=yes
171                                 AC_DEFINE([HAVE_FILTER_DELTA], 1,
172                                         [Define to 1 if support for the
173                                         Delta filter is enabled.])
174                                 ;;
175                         lzma)
176                                 enable_filters_lzma=yes
177                                 AC_DEFINE([HAVE_FILTER_LZMA], 1,
178                                         [Define to 1 if support for the
179                                         LZMA filter is enabled.])
180                                 ;;
181                         *)
182                                 AC_MSG_RESULT([])
183                                 AC_MSG_ERROR([unknown filter: $arg])
184                                 ;;
185                 esac
186         done
187         AC_MSG_RESULT([$enable_filters])
188 fi
189 if test "x$enable_simple_filters" = xyes ; then
190         AC_DEFINE([HAVE_FILTER_SIMPLE], 1, [Define to 1 if support for any
191                 of the so called simple filters is enabled.])
192 fi
193 AM_CONDITIONAL(COND_FILTER_COPY, test "x$enable_filters_copy" = xyes)
194 AM_CONDITIONAL(COND_FILTER_SUBBLOCK, test "x$enable_filters_subblock" = xyes)
195 AM_CONDITIONAL(COND_FILTER_X86, test "x$enable_filters_x86" = xyes)
196 AM_CONDITIONAL(COND_FILTER_POWERPC, test "x$enable_filters_powerpc" = xyes)
197 AM_CONDITIONAL(COND_FILTER_IA64, test "x$enable_filters_ia64" = xyes)
198 AM_CONDITIONAL(COND_FILTER_ARM, test "x$enable_filters_arm" = xyes)
199 AM_CONDITIONAL(COND_FILTER_ARMTHUMB, test "x$enable_filters_armthumb" = xyes)
200 AM_CONDITIONAL(COND_FILTER_SPARC, test "x$enable_filters_sparc" = xyes)
201 AM_CONDITIONAL(COND_FILTER_DELTA, test "x$enable_filters_delta" = xyes)
202 AM_CONDITIONAL(COND_FILTER_LZMA, test "x$enable_filters_lzma" = xyes)
203 AM_CONDITIONAL(COND_MAIN_SIMPLE, test "x$enable_simple_filters" = xyes)
204
205 # Which match finders should be enabled:
206 AC_MSG_CHECKING([which match finders to build])
207 AC_ARG_ENABLE(match-finders, AC_HELP_STRING([--enable-match-finders=],
208                 [Comma-separated list of match finders to build. Default=all.
209                 At least one match finder is required for encoding with
210                 the LZMA filter.
211                 Available match finders: hc3 hc4 bt2 bt3 bt4]), [],
212         [enable_match_finders=hc3,hc4,bt2,bt3,bt4])
213 enable_match_finders=`echo "$enable_match_finders" | sed 's/,/ /g'`
214 enable_match_finders_hc3=no
215 enable_match_finders_hc4=no
216 enable_match_finders_bt2=no
217 enable_match_finders_bt3=no
218 enable_match_finders_bt4=no
219 if test "x$enable_encoder" = xyes && test "x$enable_filters_lzma" = xyes ; then
220         for arg in $enable_match_finders
221                 do
222                 case $arg in
223                         hc3) enable_match_finders_hc3=yes ;;
224                         hc4) enable_match_finders_hc4=yes ;;
225                         bt2) enable_match_finders_bt2=yes ;;
226                         bt3) enable_match_finders_bt3=yes ;;
227                         bt4) enable_match_finders_bt4=yes ;;
228                         *)
229                                 AC_MSG_RESULT([])
230                                 AC_MSG_ERROR([unknown match finder: $arg])
231                                 ;;
232                 esac
233         done
234         AC_MSG_RESULT([$enable_match_finders])
235 else
236         AC_MSG_RESULT([(none because not building the LZMA encoder)])
237 fi
238 AM_CONDITIONAL(COND_MF_HC3, test "x$enable_match_finders_hc3" = xyes)
239 AM_CONDITIONAL(COND_MF_HC4, test "x$enable_match_finders_hc4" = xyes)
240 AM_CONDITIONAL(COND_MF_BT2, test "x$enable_match_finders_bt2" = xyes)
241 AM_CONDITIONAL(COND_MF_BT3, test "x$enable_match_finders_bt3" = xyes)
242 AM_CONDITIONAL(COND_MF_BT4, test "x$enable_match_finders_bt4" = xyes)
243
244 # Which integrity checks to build
245 AC_MSG_CHECKING([which integrity checks to build])
246 AC_ARG_ENABLE(checks, AC_HELP_STRING([--enable-checks=],
247                 [Comma-separated list of integrity checks to build.
248                 Default=all. Available integrity checks: crc32 crc64 sha256]),
249                 [], [enable_checks=crc32,crc64,sha256])
250 enable_checks=`echo "$enable_checks" | sed 's/,/ /g'`
251 enable_checks_crc32=no
252 enable_checks_crc64=no
253 enable_checks_sha256=no
254 if test "x$enable_checks" = xno || test "x$enable_checks" = x; then
255         AC_MSG_RESULT([(none)])
256 else
257         for arg in $enable_checks
258         do
259                 case $arg in
260                         crc32)
261                                 enable_checks_crc32=yes
262                                 AC_DEFINE([HAVE_CHECK_CRC32], 1,
263                                         [Define to 1 if CRC32 support
264                                         is enabled.])
265                                 ;;
266                         crc64)
267                                 enable_checks_crc64=yes
268                                 AC_DEFINE([HAVE_CHECK_CRC64], 1,
269                                         [Define to 1 if CRC64 support
270                                         is enabled.])
271                                 ;;
272                         sha256)
273                                 enable_checks_sha256=yes
274                                 AC_DEFINE([HAVE_CHECK_SHA256], 1,
275                                         [Define to 1 if SHA256 support
276                                         is enabled.])
277                                 ;;
278                         *)
279                                 AC_MSG_RESULT([])
280                                 AC_MSG_ERROR([unknown integrity check: $arg])
281                                 ;;
282                 esac
283         done
284         AC_MSG_RESULT([$enable_checks])
285 fi
286 if test "x$enable_checks_crc32" = xno ; then
287         AC_MSG_ERROR([For now, the CRC32 check must always be enabled.])
288 fi
289 AM_CONDITIONAL(COND_CHECK_CRC32, test "x$enable_checks_crc32" = xyes)
290 AM_CONDITIONAL(COND_CHECK_CRC64, test "x$enable_checks_crc64" = xyes)
291 AM_CONDITIONAL(COND_CHECK_SHA256, test "x$enable_checks_sha256" = xyes)
292
293 # Assembler optimizations
294 AC_MSG_CHECKING([if assembler optimizations should be used])
295 AC_ARG_ENABLE(assembler, AC_HELP_STRING([--disable-assembler],
296                 [Do not use assembler optimizations even if such exist
297                 for the architecture.]),
298                 [], [enable_assembler=yes])
299 if test "x$enable_assembler" = xyes; then
300         case $host_cpu in
301                 i?86)   enable_assembler=x86 ;;
302                 *)      enable_assembler=no ;;
303         esac
304 fi
305 case $enable_assembler in
306         x86|no) ;;
307         *)
308                 AC_MSG_RESULT([])
309                 AC_MSG_ERROR([--enable-assembler accepts only \`yes', \`no', or \`x86'.])
310                 ;;
311 esac
312 AC_MSG_RESULT([$enable_assembler])
313 AM_CONDITIONAL(COND_ASM_X86, test "x$enable_assembler" = xx86)
314
315 # Size optimization
316 AC_MSG_CHECKING([if small size is preferred over speed])
317 AC_ARG_ENABLE(small, AC_HELP_STRING([--enable-small],
318                 [Omit precomputed tables to make liblzma a few kilobytes
319                 smaller. This will increase startup time of applications
320                 slightly, because the tables need to be computed first.]),
321                 [], [enable_small=no])
322 if test "x$enable_small" = xyes; then
323         AC_DEFINE([HAVE_SMALL], 1, [Define to 1 if optimizing for size.])
324 elif test "x$enable_small" != xno; then
325         AC_MSG_RESULT([])
326         AC_MSG_ERROR([--enable-small accepts only \`yes' or \`no'])
327 fi
328 AC_MSG_RESULT([$enable_small])
329 AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
330
331 echo
332 echo "Initializing Automake:"
333
334 # There's no C++ or Fortran in LZMA Utils:
335 CXX=no
336 F77=no
337
338 AM_INIT_AUTOMAKE
339
340 AC_USE_SYSTEM_EXTENSIONS
341
342 ###############################################################################
343 # Checks for programs.
344 ###############################################################################
345
346 AM_PROG_CC_C_O
347 AM_PROG_AS
348 AC_PROG_LN_S
349
350 echo
351 echo "Threading support:"
352 ACX_PTHREAD
353 CC="$PTHREAD_CC"
354
355 echo
356 echo "Initializing Libtool:"
357 AC_PROG_LIBTOOL
358
359
360 ###############################################################################
361 # Checks for libraries.
362 ###############################################################################
363
364 echo
365 echo "Initializing gettext:"
366 AM_GNU_GETTEXT_VERSION([0.16.1])
367 AM_GNU_GETTEXT([external])
368
369 ###############################################################################
370 # Checks for header files.
371 ###############################################################################
372
373 echo
374 echo "System headers and functions:"
375
376 # There is currently no workarounds in this package if some of
377 # these headers are missing.
378 AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h],
379         [],
380         [AC_MSG_ERROR([Required header file(s) are missing.])])
381
382 # If any of these headers are missing, things should still work correctly:
383 AC_CHECK_HEADERS([assert.h errno.h byteswap.h sys/param.h sys/sysctl.h],
384         [], [], [
385 #ifdef HAVE_SYS_PARAM_H
386 #       include <sys/param.h>
387 #endif
388 ])
389
390
391 ###############################################################################
392 # Checks for typedefs, structures, and compiler characteristics.
393 ###############################################################################
394
395 AC_C_INLINE
396 AC_C_RESTRICT
397
398 AC_HEADER_STDBOOL
399
400 AC_TYPE_UINT8_T
401 AC_TYPE_INT32_T
402 AC_TYPE_UINT32_T
403 AC_TYPE_INT64_T
404 AC_TYPE_UINT64_T
405 AC_TYPE_UINTPTR_T
406
407 AC_CHECK_SIZEOF([unsigned long])
408 AC_CHECK_SIZEOF([size_t])
409
410 # The command line tool can copy high resolution timestamps if such
411 # information is availabe in struct stat. Otherwise one second accuracy
412 # is used. Most systems seem to have st_xtim but BSDs have st_xtimespec.
413 AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec, struct stat.st_mtim.tv_nsec,
414         struct stat.st_atimespec.tv_nsec, struct stat.st_mtimespec.tv_nsec])
415
416 # It is very unlikely that you want to build liblzma without
417 # large file support.
418 AC_SYS_LARGEFILE
419
420 # At the moment, the only endian-dependent part should be the integrity checks.
421 AC_C_BIGENDIAN
422
423
424 ###############################################################################
425 # Checks for library functions.
426 ###############################################################################
427
428 # Gnulib replacements as needed
429 gl_GETOPT
430
431 # Functions that are not mandatory i.e. we have alternatives for them
432 # or we can just drop some functionality:
433 AC_CHECK_FUNCS([memcpy memmove memset futimes futimesat])
434
435 # Check how to find out the amount of physical memory in the system. The
436 # lzma command line tool uses this to automatically limits its memory usage.
437 # - sysconf() gives all the needed info on GNU+Linux and Solaris.
438 # - BSDs use sysctl().
439 AC_MSG_CHECKING([how to detect the amount of physical memory])
440 AC_COMPILE_IFELSE([
441 #include <unistd.h>
442 int
443 main()
444 {
445         long i;
446         i = sysconf(_SC_PAGESIZE);
447         i = sysconf(_SC_PHYS_PAGES);
448         return 0;
449 }
450 ], [
451         AC_DEFINE([HAVE_PHYSMEM_SYSCONF], 1,
452                 [Define to 1 if the amount of physical memory can be detected
453                 with sysconf(_SC_PAGESIZE) and sysconf(_SC_PHYS_PAGES).])
454         AC_MSG_RESULT([sysconf])
455 ], [
456 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
457 #include <sys/types.h>
458 #ifdef HAVE_SYS_PARAM_H
459 #       include <sys/param.h>
460 #endif
461 #include <sys/sysctl.h>
462 int
463 main()
464 {
465         int name[2] = { CTL_HW, HW_PHYSMEM };
466         unsigned long mem;
467         size_t mem_ptr_size = sizeof(mem);
468         sysctl(name, 2, &mem, &mem_ptr_size, NULL, NULL);
469         return 0;
470 }
471 ]])], [
472         AC_DEFINE([HAVE_PHYSMEM_SYSCTL], 1,
473                 [Define to 1 if the amount of physical memory can be detected
474                 with sysctl().])
475         AC_MSG_RESULT([sysctl])
476 ], [
477         AC_MSG_RESULT([unknown])
478 ])])
479
480 # Check how to find out the number of available CPU cores in the system.
481 # sysconf(_SC_NPROCESSORS_ONLN) works on most systems, except that BSDs
482 # use sysctl().
483 AC_MSG_CHECKING([how to detect the number of available CPU cores])
484 AC_COMPILE_IFELSE([
485 #include <unistd.h>
486 int
487 main()
488 {
489         long i;
490         i = sysconf(_SC_NPROCESSORS_ONLN);
491         return 0;
492 }
493 ], [
494         AC_DEFINE([HAVE_NCPU_SYSCONF], 1,
495                 [Define to 1 if the number of available CPU cores can be
496                 detected with sysconf(_SC_NPROCESSORS_ONLN).])
497         AC_MSG_RESULT([sysconf])
498 ], [
499 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
500 #include <sys/types.h>
501 #ifdef HAVE_SYS_PARAM_H
502 #       include <sys/param.h>
503 #endif
504 #include <sys/sysctl.h>
505 int
506 main()
507 {
508         int name[2] = { CTL_HW, HW_NCPU };
509         int cpus;
510         size_t cpus_size = sizeof(cpus);
511         sysctl(name, 2, &cpus, &cpus_size, NULL, NULL);
512         return 0;
513 }
514 ]])], [
515         AC_DEFINE([HAVE_NCPU_SYSCTL], 1,
516                 [Define to 1 if the number of available CPU cores can be
517                 detected with sysctl().])
518         AC_MSG_RESULT([sysctl])
519 ], [
520         AC_MSG_RESULT([unknown])
521 ])])
522
523
524 ###############################################################################
525 # If using GCC, set some additional CFLAGS:
526 ###############################################################################
527
528 Wno_uninitialized=no
529
530 if test -n "$GCC" ; then
531         echo
532         echo "GCC extensions:"
533         gl_VISIBILITY
534         if test -n "$CFLAG_VISIBILITY" ; then
535                 CFLAGS="$CFLAG_VISIBILITY $CFLAGS"
536         fi
537
538         # -Wno-uninitialized is needed with -Werror with SHA256 code
539         # to omit a bogus warning.
540         AC_MSG_CHECKING([if $CC accepts -Wno-uninitialized])
541         OLD_CFLAGS="$CFLAGS"
542         CFLAGS="$CFLAGS -Wno-uninitialized"
543         AC_COMPILE_IFELSE([void foo(void) { }], [Wno_uninitialized=yes])
544         CFLAGS="$OLD_CFLAGS"
545         AC_MSG_RESULT([$Wno_uninitialized])
546
547         # Enable as much warnings as possible. These commented warnings won't
548         # work for LZMA Utils though:
549         #   * -Wunreachable-code breaks several assert(0) cases, which are
550         #     backed up with "return LZMA_PROG_ERROR".
551         #   * -Wcast-qual would break various things where we need a non-const
552         #     pointer although we don't modify anything through it.
553         #   * -Wcast-align breaks optimized CRC32 and CRC64 implementation
554         #     on some architectures (not on x86), where this warning is bogus,
555         #     because we take care of correct alignment.
556         #   * -Winline, -Wdisabled-optimization, -Wunsafe-loop-optimizations
557         #     don't seem so useful here; at least the last one gives some
558         #     warnings which are not bugs.
559         #
560         # The flags are in reverse order below so they end up in "beautiful"
561         # order on the actual command line.
562         for NEW_FLAG in \
563                         -Wredundant-decls \
564                         -Wmissing-noreturn \
565                         -Wmissing-declarations \
566                         -Wmissing-prototypes \
567                         -Wold-style-definition \
568                         -Wstrict-prototypes \
569                         -Waggregate-return \
570                         -Wwrite-strings \
571                         -Wbad-function-cast \
572                         -Wpointer-arith \
573                         -Wshadow \
574                         -Wfloat-equal \
575                         -Wstrict-aliasing=2 \
576                         -Winit-self \
577                         -Wformat=2 \
578                         -Wextra \
579                         -Wall \
580                         -pedantic \
581                         -std=c99
582         do
583                 AC_MSG_CHECKING([if $CC accepts $NEW_FLAG])
584                 OLD_CFLAGS="$CFLAGS"
585                 CFLAGS="$NEW_FLAG $CFLAGS"
586                 AC_COMPILE_IFELSE([void foo(void) { }], [
587                         AC_MSG_RESULT([yes])
588                 ], [
589                         CFLAGS="$OLD_CFLAGS"
590                         AC_MSG_RESULT([no])
591                 ])
592         done
593
594         AC_ARG_ENABLE([werror],
595                 AC_HELP_STRING([--enable-werror], [Enable -Werror to abort
596                         compilation on all compiler warnings.]),
597                 [], [enable_werror=no])
598         if test "x$enable_werror" = "xyes"; then
599                 CFLAGS="-Werror $CFLAGS"
600         fi
601 fi
602
603 AM_CONDITIONAL([COND_WNO_UNINITIALIZED], test "x$Wno_uninitialized" = "xyes")
604
605
606 ###############################################################################
607 # Create the makefiles and config.h
608 ###############################################################################
609
610 echo
611
612 # Don't build the lib directory at all if we don't need any replacement
613 # functions.
614 AM_CONDITIONAL([COND_GNULIB], test -n "$LIBOBJS")
615
616 AC_CONFIG_FILES([
617         Doxyfile
618         Makefile
619         po/Makefile.in
620         lib/Makefile
621         src/Makefile
622         src/liblzma/lzma.pc
623         src/liblzma/Makefile
624         src/liblzma/api/Makefile
625         src/liblzma/common/Makefile
626         src/liblzma/check/Makefile
627         src/liblzma/lz/Makefile
628         src/liblzma/lzma/Makefile
629         src/liblzma/simple/Makefile
630         src/liblzma/subblock/Makefile
631         src/liblzma/rangecoder/Makefile
632         src/lzma/Makefile
633         src/lzmadec/Makefile
634         src/scripts/Makefile
635         tests/Makefile
636 ])
637
638 AC_OUTPUT