OSDN Git Service

build: ignore new -Wjump-misses-init warnings
[android-x86/external-parted.git] / configure.ac
1 dnl GNU Parted - a library and front end for manipulation hard disk partitions
2 dnl Copyright (C) 1998-2002, 2005-2009 Free Software Foundation, Inc.
3 dnl
4 dnl This file may be modified and/or distributed without restriction.
5
6 AC_PREREQ([2.63])
7 AC_INIT([GNU parted], m4_esyscmd([build-aux/git-version-gen .version]),
8         [bug-parted@gnu.org])
9
10 # When the most recent signed tag is v1.8.8.1,
11 # the above might set e.g., PACKAGE_VERSION='1.8.8.1.1-0bfc'
12
13 AC_CONFIG_SRCDIR([include/parted/parted.h])
14
15 AC_CONFIG_HEADERS([lib/config.h:lib/config.h.in])
16 AC_CONFIG_AUX_DIR([build-aux])
17
18 dnl Versioning
19 dnl Shamelessly pulled straight from glib's configure.in ...
20 dnl Making releases:
21 dnl    PED_MICRO_VERSION += 1;
22 dnl    PED_INTERFACE_AGE += 1;
23 dnl    PED_BINARY_AGE += 1;
24 dnl if any functions have been added, set PED_INTERFACE_AGE to 0.
25 dnl if backwards compatibility has been broken (eg. functions removed,
26 dnl function signatures changed),
27 dnl set PED_BINARY_AGE _and_ PED_INTERFACE_AGE to 0.
28
29 # Derive these numbers from $PACKAGE_VERSION, which is set
30 # when autoconf creates configure (see AC_INIT, above).
31 PED_MAJOR_VERSION=`echo "$PACKAGE_VERSION"|sed 's/\..*//'`
32 PED_MINOR_VERSION=`echo "$PACKAGE_VERSION"|sed 's/^[[0-9]][[0-9]]*\.//;s/\..*//'`
33 case $PACKAGE_VERSION in
34   *.*.*.*.*)
35     PED_MICRO_VERSION=`echo "$PACKAGE_VERSION" \
36       | sed 's/^[^.]*\.[^.]*\.//;s/\..*//'`
37     ;;
38   *) PED_MICRO_VERSION=0;;
39 esac
40
41 PED_INTERFACE_AGE=0
42 PED_BINARY_AGE=0
43 PED_VERSION_SUFFIX=
44 PED_VERSION=$PED_MAJOR_VERSION.$PED_MINOR_VERSION.$PED_MICRO_VERSION$PED_VERSION_SUFFIX
45
46 LT_RELEASE=$PED_MAJOR_VERSION.$PED_MINOR_VERSION
47 LT_CURRENT=`expr $PED_MICRO_VERSION - $PED_INTERFACE_AGE`
48 LT_REVISION=$PED_INTERFACE_AGE
49 LT_AGE=`expr $PED_BINARY_AGE - $PED_INTERFACE_AGE`
50 AC_SUBST([LT_RELEASE])
51 AC_SUBST([LT_CURRENT])
52 AC_SUBST([LT_REVISION])
53 AC_SUBST([LT_AGE])
54
55 AM_INIT_AUTOMAKE([1.11 dist-xz color-tests parallel-tests])
56 AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
57
58 AC_CANONICAL_HOST
59 case "$host_os" in
60         linux*) OS=linux ;;
61         gnu*)   OS=gnu ;;
62         beos*)  OS=beos ;;
63         *)      AC_MSG_ERROR([Unknown or unsupported OS "$host_os".  Only "linux", "gnu" and "beos" are supported in this version of GNU Parted.]) ;;
64 esac
65 AC_SUBST([OS])
66
67 dnl Command-line options
68 AC_ARG_WITH([readline],
69         [  --with-readline         support fancy command line editing], ,
70         with_readline=yes
71 )
72
73 AC_ARG_ENABLE([mtrace],
74         [  --enable-mtrace         enable malloc() debugging], ,
75         enable_mtrace=no
76 )
77 if test "$enable_mtrace" = yes; then
78         AC_DEFINE([ENABLE_MTRACE], [1], [Mtrace malloc() debugging])
79 fi
80
81 AC_SUBST([ENABLE_DEVICE_MAPPER])
82 ENABLE_DEVICE_MAPPER=yes
83 AC_ARG_ENABLE([device-mapper],
84         [  --enable-device-mapper  enable device mapper support [default=yes]],
85         [ENABLE_DEVICE_MAPPER=$enable_device_mapper])
86 if test $ENABLE_DEVICE_MAPPER = yes; then
87         AC_DEFINE([ENABLE_DEVICE_MAPPER],
88                   1, [device mapper (libdevmapper) support])
89 fi
90
91 AC_ARG_ENABLE([selinux],
92         [  --enable-selinux        enable SELinux support [default=no]], ,
93         enable_selinux=no
94 )
95
96 AC_ARG_ENABLE([discover-only],
97         [  --enable-discover-only  support only reading/probing [default=no]], ,
98         enable_discover_only=no
99 )
100 if test "$enable_discover_only" = yes; then
101         AC_DEFINE([DISCOVER_ONLY], [1], [Probing functionality only])
102 fi
103
104 PARTED_LIBS=""
105 AC_ARG_ENABLE([dynamic-loading],
106 [  --enable-dynamic-loading  support dynamic fs libraries [default=yes]], ,
107         if test "$enable_discover_only" = yes; then
108                 enable_dynamic_loading=no
109         else
110                 enable_dynamic_loading=yes
111         fi
112 )
113 if test "$enable_discover_only" = yes -a "$enable_dynamic_loading" = yes; then
114         AC_MSG_ERROR(
115 [You can't use --enable-dynamic-loading and --disable-discover-only together]
116         )
117 fi
118
119 AC_ARG_ENABLE([fs],
120         [  --enable-fs             include filesystem support [default=yes]], ,
121         enable_fs=yes
122 )
123 if test "$enable_fs" = yes; then
124         AC_DEFINE([ENABLE_FS], [1],
125                   [Include file system support.  i.e. libparted/fs_...])
126 fi
127
128 AC_ARG_ENABLE([debug],
129         [  --enable-debug          compile in assertions [default=yes]], ,
130         enable_debug=yes
131 )
132
133 if test "$enable_debug" = yes; then
134         AC_DEFINE([DEBUG], [1], [Enable assertions, etc.])
135 fi
136
137 AC_ARG_ENABLE([read-only],
138         [  --enable-read-only      disable writing (for debugging) [default=no]]
139         , ,
140         enable_read_only=no
141 )
142 if test "$enable_read_only" = yes; then
143         AC_DEFINE([READ_ONLY], [1], [Disable all writing code])
144 fi
145
146 PARTEDLDFLAGS=
147 AC_SUBST([PARTEDLDFLAGS])
148
149 AC_ARG_ENABLE([pc98],
150         [  --enable-pc98          build with pc98 support [default=yes]], ,
151         enable_pc98=yes
152 )
153 if test "$enable_pc98" = yes; then
154         AC_DEFINE([ENABLE_PC98], [1],
155                   [Include PC98 partition tables.  (Sometimes excluded to avoid
156                    collisions with msdos partition tables])
157 fi
158
159 AC_ARG_ENABLE([Werror],
160         [  --enable-Werror         build with gcc -Werror [default=yes]], ,
161         enable_Werror=yes
162 )
163
164 AC_ARG_ENABLE([hfs-extract-fs],
165         [  --enable-hfs-extract-fs Extract special HFS files for debugging [default=no]], ,
166         enable_hfs_extract_fs=no
167 )
168 if test "$enable_hfs_extract_fs" = yes; then
169        AC_DEFINE([HFS_EXTRACT_FS], [1],
170                  [Extract low level special HFS(+) files for debugging purposes
171                   when using the "check" command (NOT FOR PACKAGING)])
172 fi
173
174 dnl make libc threadsafe (not required for us, but useful other users of
175 dnl libparted)
176 AM_CPPFLAGS="$AM_CPPFLAGS -D_REENTRANT"
177
178 dnl Check for programs.
179 AC_ISC_POSIX
180 AC_PROG_CC
181 AC_PROG_GCC_TRADITIONAL
182 AM_PROG_CC_C_O
183
184 gl_EARLY
185 parted_FIND_USABLE_TEST_DIR
186
187 dnl This test must come as early as possible after the compiler configuration
188 dnl tests, because the choice of the file model can (in principle) affect
189 dnl whether functions and headers are available, whether they work, etc.
190 AC_SYS_LARGEFILE
191
192 gl_INIT
193
194 AC_ARG_ENABLE([gcc-warnings],
195   [AS_HELP_STRING([--enable-gcc-warnings],
196                   [turn on lots of GCC warnings (for developers)])],
197   [case $enableval in
198      yes|no) ;;
199      *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
200    esac
201    gl_gcc_warnings=$enableval],
202   [gl_gcc_warnings=no]
203 )
204
205 if test "$gl_gcc_warnings" = yes; then
206   gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
207   AC_SUBST([WERROR_CFLAGS])
208
209   nw=
210   # This, $nw, is the list of warnings we disable.
211   nw="$nw -Wdeclaration-after-statement" # too useful to forbid
212   nw="$nw -Waggregate-return"       # anachronistic
213   nw="$nw -Wlong-long"              # C90 is anachronistic (lib/gethrxtime.h)
214   nw="$nw -Wc++-compat"             # We don't care about C++ compilers
215   nw="$nw -Wundef"                  # Warns on '#if GNULIB_FOO' etc in gnulib
216   nw="$nw -Wtraditional"            # Warns on #elif which we use often
217   nw="$nw -Wcast-qual"              # Too many warnings for now
218   nw="$nw -Wconversion"             # Too many warnings for now
219   nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
220   nw="$nw -Wsign-conversion"        # Too many warnings for now
221   nw="$nw -Wtraditional-conversion" # Too many warnings for now
222   nw="$nw -Wunreachable-code"       # Too many warnings for now
223   nw="$nw -Wpadded"                 # Our structs are not padded
224   nw="$nw -Wredundant-decls"        # openat.h declares e.g., mkdirat
225   nw="$nw -Wlogical-op"             # any use of fwrite provokes this
226   nw="$nw -Wformat-nonliteral"      # who.c and pinky.c strftime uses
227   nw="$nw -Wvla"                    # warnings in gettext.h
228   nw="$nw -Wnested-externs"         # use of XARGMATCH/verify_function__
229   nw="$nw -Wswitch-enum"            # Too many warnings for now
230   nw="$nw -Wswitch-default"         # Too many warnings for now
231   # Too many warnings for now
232   nw="$nw -Wattributes"
233   nw="$nw -Wstrict-prototypes"
234   nw="$nw -Wold-style-definition"
235   nw="$nw -Wpacked"
236   nw="$nw -Wmissing-prototypes"
237   nw="$nw -Wmissing-declarations"
238   nw="$nw -Wmissing-noreturn"
239   # things I might fix soon:
240   nw="$nw -Wfloat-equal"            # sort.c, seq.c
241   nw="$nw -Wmissing-format-attribute" # copy.c
242   nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c
243   nw="$nw -Winline"                 # system.h's readdir_ignoring_dot_and_dotdot
244   nw="$nw -Wstrict-overflow"        # expr.c, pr.c, tr.c, factor.c
245   nw="$nw -Wstack-protector"        # libparted/label/gpt.c
246   # ?? -Wstrict-overflow
247
248   gl_MANYWARN_ALL_GCC([ws])
249   gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
250   for w in $ws; do
251     gl_WARN_ADD([$w])
252   done
253   gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
254   gl_WARN_ADD([-Wno-sign-compare])     # Too many warnings for now
255   gl_WARN_ADD([-Wno-pointer-sign])     # Too many warnings for now
256   gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
257   gl_WARN_ADD([-Wno-unused-macros]) # Too many warnings for now
258
259   # FIXME: investigate these
260   gl_WARN_ADD([-Wno-jump-misses-init])
261
262   # In spite of excluding -Wlogical-op above, it is enabled, as of
263   # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c
264   gl_WARN_ADD([-Wno-logical-op])
265
266   gl_WARN_ADD([-fdiagnostics-show-option])
267
268   AC_SUBST([WARN_CFLAGS])
269
270   AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
271   AC_DEFINE([_FORTIFY_SOURCE], [2],
272     [enable compile-time and run-time bounds-checking, and some warnings])
273   AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
274 fi
275
276
277
278 AC_CHECK_SIZEOF([off_t], [64], [
279         #include <stdio.h>
280         #include <sys/types.h>
281         #include <unistd.h>
282 ])
283
284 AM_ENABLE_SHARED
285 if test "$OS" = linux -a $ac_cv_sizeof_off_t -lt 8; then
286         dnl Need to disable shared libraries, to get llseek() to work.  Long
287         dnl story.  The short story is: lseek() isn't in glibc, so a syscall
288         dnl must be made.  syscalls can't be made from within shared libraries,
289         dnl because of a bug (?) in gcc.
290         AC_MSG_WARN(
291 off_t is less than 8 bytes.  Using llseek syscall, and disabling shared
292 libraries.)
293         AM_DISABLE_SHARED
294 fi
295 AM_PROG_LIBTOOL
296
297 AM_GNU_GETTEXT_VERSION([0.15])
298 AM_GNU_GETTEXT([external])
299 if test "$USE_INCLUDED_LIBINTL" = "yes"; then
300         AC_MSG_ERROR([
301 GNU Parted requires gettext to be installed for compilation -
302 if native language support is desired.  Either disable native language support
303 with:
304         $ ./configure --disable-nls
305 Or install gettext.  GNU gettext is available from
306         http://ftp.gnu.org/gnu/gettext
307 ])
308 fi
309
310 dnl Check for libdl, if we are doing dynamic loading
311 DL_LIBS=""
312 if test "$enable_dynamic_loading" = yes; then
313         AC_CHECK_LIB([dl], [dlopen],
314                 DL_LIBS="-ldl"
315                 PARTED_LIBS="$PARTED_LIBS -ldl"
316                 AC_DEFINE([DYNAMIC_LOADING], [1], [Lazy linking to fs libs]),
317                 AC_MSG_ERROR(
318                         [-ldl not found!  Try using --disable-dynamic-loading]
319                 )
320         )
321 fi
322 AC_SUBST([DL_LIBS])
323
324 dnl Check for libuuid
325 UUID_LIBS=""
326 AC_CHECK_LIB([uuid], [uuid_generate], [UUID_LIBS="-luuid"],
327         [AC_MSG_ERROR(dnl
328 [GNU Parted requires libuuid - a part of the e2fsprogs package (but
329 sometimes distributed separately in uuid-devel or similar)
330 This can probably be found on your distribution's CD or FTP site or at:
331          http://web.mit.edu/tytso/www/linux/e2fsprogs.html
332 Note: if you are using precompiled packages you will also need the development
333 package as well (which may be called e2fsprogs-devel or something similar).
334 If you compile e2fsprogs yourself then you need to do 'make install' and
335 'make install-libs'.])]
336 )
337 AC_SUBST([UUID_LIBS])
338
339 dnl Check for libdevmapper
340 DM_LIBS=
341 if test $ENABLE_DEVICE_MAPPER = yes; then
342   AC_CHECK_LIB([devmapper], [dm_task_create],
343     [DM_LIBS=-ldevmapper],
344     [AC_MSG_ERROR(dnl
345 [libdevmapper could not be found, but is required for the
346 --enable-device-mapper option, which is enabled by default.  Either disable
347 device-mapper support with --disable-device-mapper or download and install
348 device-mapper from:
349         http://sources.redhat.com/dm/
350 Note: if you are using precompiled packages you will need the development
351 package as well (it may be called device-mapper-devel or something similar).]
352     )]
353   )
354 fi
355 AC_SUBST([DM_LIBS])
356
357 dnl Check for SELinux
358 SELINUX_LIBS=""
359 if test "$enable_selinux" = yes; then
360         SELINUX_LIBS="-lselinux -lsepol"
361 fi
362 AC_SUBST([SELINUX_LIBS])
363
364 dnl Check for libreiserfs
365 REISER_LIBS=""
366 if test "$enable_dynamic_loading" = no -a "$enable_discover_only" = no; then
367         OLD_LIBS="$LIBS"
368         AC_CHECK_LIB([dal], [dal_equals],
369                 LIBS="-ldal"
370                 AC_CHECK_LIB([reiserfs], [reiserfs_fs_probe],
371                         REISER_LIBS="-ldal -lreiserfs"
372                         AC_DEFINE([HAVE_LIBREISERFS], [1], [Have libreiserfs])
373                 )
374                 AC_CHECK_LIB([reiserfs], [reiserfs_fs_check],
375                         AC_DEFINE([HAVE_REISERFS_FS_CHECK], [1], [Have reiserfs_fs_check()])
376                 )
377         )
378         LIBS="$OLD_LIBS"
379 fi
380 AC_SUBST([REISER_LIBS])
381
382 dnl Check for termcap
383 if test "$with_readline" = yes; then
384         OLD_LIBS="$LIBS"
385         LIBS=""
386         AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
387                 [PARTED_LIBS="$PARTED_LIBS $LIBS"],
388                 [AC_MSG_ERROR(dnl
389 [termcap could not be found which is required for the
390 --with-readline option (which is enabled by default).  Either disable readline
391 support with --without-readline or download and install termcap from:
392         ftp.gnu.org/gnu/termcap
393 Note: if you are using precompiled packages you will also need the development
394   package as well (which may be called termcap-devel or something similar).
395 Note: (n)curses also seems to work as a substitute for termcap.  This was
396   not found either - but you could try installing that as well.])])
397         LIBS="$OLD_LIBS"
398 fi
399
400 dnl Check for readline
401 dnl NOTE: We need to remove the gl_cv_ignore_unused_libraries flag if we
402 dnl detected one earlier.  libreadline on some platforms (e.g., RHEL and
403 dnl Fedora) is left with
404 if test "$with_readline" = yes; then
405         OLD_LIBS="$LIBS"
406         LIBS="$LIBS $PARTED_LIBS"
407         found_working_libreadline=no
408         AC_CHECK_LIB([readline], [readline],
409                 found_working_libreadline=yes,
410                 AC_MSG_ERROR(
411 [GNU Readline could not be found which is required for the
412 --with-readline (which is enabled by default).  Either disable readline support with
413 --without-readline or downloaded and install it from:
414         ftp.gnu.org/gnu/readline
415 Note: if you are using precompiled packages you will also need the development
416 package as well (which may be called readline-devel or something similar).
417 ])
418                 ,
419                 $PARTED_LIBS
420         )
421         LIBS="$OLD_LIBS $PARTED_LIBS"
422
423         # See if libreadline is too old to be used.
424         # The readline function in Debian's libreadline5 5.0-10 fails to
425         # print to stdout the response (from stdin) to a prompt, when stdout
426         # is redirected, while 5.2-3 works fine.  That failure would cause
427         # several of parted's tests to failure.
428         # The purist approach would be to write a run-test, but that's
429         # not friendly to cross-compilers, so here's a compromise:
430         #
431         # See if libreadline defines one of these symbols:
432         # [this is the list of public symbols that are in 5.2, but not 5.0]
433         #
434         # $ diff -u /tmp/readline-5.[02]|grep '+T.[^_]'
435         # +T rl_vi_rubout
436         # +T rl_variable_value
437         # +T rl_reset_screen_size
438         # +T alloc_history_entry
439         # +T copy_history_entry
440         # +T replace_history_data
441         #
442         # If not, then reject this readline lib.
443         AC_CHECK_LIB([readline], [rl_variable_value],
444                      ,
445                      AC_MSG_ERROR(
446 [Your version of libreadline is too old to be used.
447 Consider upgrading to version 5.2 or newer.])
448                      found_working_libreadline=no,
449                      $PARTED_LIBS)
450
451         if test $found_working_libreadline = yes; then
452                 PARTED_LIBS="-lreadline $PARTED_LIBS"
453                 AC_DEFINE([HAVE_LIBREADLINE], [1], [have readline])
454         fi
455         LIBS="$OLD_LIBS"
456 fi
457
458 AC_SUBST([PARTED_LIBS])
459
460 dnl Check for OS specific libraries
461
462 dnl GNU/Hurd:
463 if test "$OS" = gnu; then
464 dnl libshouldbeinlibc
465         AC_CHECK_LIB([shouldbeinlibc], [vm_deallocate],
466                 OS_LIBS="$OS_LIBS -lshouldbeinlibc",
467                 AC_MSG_ERROR(
468 [GNU Parted requires libshouldbeinlibc when running on
469 GNU/Hurd systems.  It is a standard part of a GNU/Hurd system.]
470                 )
471         )
472
473 dnl libstore may depend on libparted being present.
474 dnl Aren't circular dependencies wonderful?
475         OLD_LIBS="$LIBS"
476         LIBS=
477
478         AC_CHECK_LIB([parted], [ped_device_read])
479
480 dnl libstore
481         AC_CHECK_LIB([store], [store_open],
482                 OS_LIBS="$OS_LIBS -lstore",
483                 AC_MSG_ERROR(
484 [GNU Parted requires libstore when running on GNU/Hurd
485 systems.  It is a standard part of a GNU/Hurd system.]
486                 )
487                 ,
488                 $OS_LIBS $UUID_LIBS $DM_LIBS $LIBS
489         )
490         LIBS="$OLD_LIBS"
491 fi
492
493 dnl BeOS/ZETA/Haiku:
494
495 if test "$OS" = beos; then
496         dnl Include the socket library, as it is a depedency of libuuid
497         dnl and so also of us (due to socket() call in libuuid)
498         OS_LIBS="$OS_LIBS -lsocket"
499 fi
500
501 AC_SUBST([OS_LIBS])
502
503 dnl One day, gettext might support libtool...
504 dnl if test "$USE_INCLUDED_LIBINTL" = "yes"; then
505 dnl     INTLINCS='-I$(top_srcdir)/intl'
506 dnl fi
507 AC_SUBST([INTLINCS])
508
509
510 dnl Checks for header files.
511 AC_CHECK_HEADER([uuid/uuid.h], ,
512         [AC_MSG_ERROR(
513 [GNU Parted requires libuuid - a part of the e2fsprogs package.
514 You seem to have the library installed but not the headers.  These are usually
515 found in a corresponding development package (usually called e2fsprogs-devel).
516 If you can't find one try:
517         http://web.mit.edu/tytso/www/linux/e2fsprogs.html])]
518 )
519
520 AC_CHECK_HEADERS([getopt.h])
521
522 dnl required for libparted/llseek.c  (TODO: make linux-x86 only)
523 if test "$OS" = linux; then
524         AC_CHECK_HEADER([linux/unistd.h])
525 fi
526
527 if test "$with_readline" = yes; then
528         AC_CHECK_HEADERS([readline/readline.h readline/history.h], ,
529                 [AC_MSG_ERROR(
530 [The headers for GNU Readline could not be found which
531 are required for the --with-readline option.  You seem to have the GNU readline
532 library installed but not the headers.  These are usually found in a
533 corresponding development package (usually called readline-devel).  If you can't
534 find one try:
535         ftp.gnu.org/gnu/readline
536 Alternatively you can disable readline support with --without-readline])]
537         )
538 fi
539
540 AC_CHECK_HEADERS([termcap.h])
541
542 if test "$USE_NLS" = yes; then
543         AC_CHECK_HEADERS([wctype.h], ,
544                 [AC_MSG_ERROR(
545 [One or more of the header files that are required for
546 native language support (wctype.h) could not be found.  Either get a newer
547 version of GNU libc and its headers - which can be obtained from:
548         ftp.gnu.org/gnu/glibc
549 Or disable native language support with the --disable-nls option])]
550         )
551 fi
552
553 AC_CHECK_HEADER([execinfo.h], [
554         AC_CHECK_LIB([c], [backtrace], [
555                 AC_DEFINE([HAVE_BACKTRACE], [1], [Has backtrace support])
556                 LDFLAGS="$LDFLAGS -rdynamic"
557         ])
558 ])
559
560 AM_CONDITIONAL([COMPILE_FOR_S390], [test "$host_cpu" = s390 || test "$host_cpu" = s390x])
561 AM_CONDITIONAL([BUILD_LINUX], [test "$OS" = linux])
562
563 dnl check for "check", unit testing library/header
564 PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], have_check=yes, have_check=no)
565 if test "$have_check" != "yes"; then
566     AC_MSG_RESULT([Unable to locate check version 0.9.3 or higher: not building])
567 fi
568 AM_CONDITIONAL([HAVE_CHECK], [test "$have_check" = yes])
569
570 dnl Checks for typedefs, structures and compiler characteristics.
571 AC_PROG_LD
572
573 AC_C_BIGENDIAN
574 AC_C_INLINE
575 AC_C_CONST
576 AC_C_RESTRICT
577
578 dnl Checks for library functions.
579 AC_CHECK_FUNCS([sigaction])
580 AC_CHECK_FUNCS([getuid])
581
582 dnl NOTE: We need to remove the gl_cv_ignore_unused_libraries flag if we
583 dnl detected one earlier.  libreadline on some platforms (e.g., RHEL and
584 dnl Fedora) is left with
585 if test "$with_readline" = yes; then
586         OLD_LIBS="$LIBS"
587         LIBS="$LIBS $PARTED_LIBS -lreadline"
588         AC_CHECK_FUNCS([rl_completion_matches])
589         LIBS="$OLD_LIBS"
590 fi
591
592 AC_CHECK_FUNCS([canonicalize_file_name])
593
594 # CFLAGS="$CFLAGS -W -Wall -Wno-unused -Wno-switch -Wno-format"
595
596 if test "$enable_Werror" = yes; then
597         CFLAGS="$CFLAGS -Werror"
598 fi
599
600 DATE=$(date '+%d %b %Y %H:%M')
601 USER=$(whoami)
602 HOST=$(hostname)
603 BUILDINFO="$USER@$HOST, $DATE"
604 AC_SUBST([BUILDINFO])
605
606 AC_OUTPUT([
607 Makefile
608 lib/Makefile
609 include/Makefile
610 include/parted/Makefile
611 libparted/Makefile
612 libparted/labels/Makefile
613 libparted/fs/Makefile
614 libparted/fs/amiga/Makefile
615 libparted/fs/ext2/Makefile
616 libparted/fs/fat/Makefile
617 libparted/fs/hfs/Makefile
618 libparted/fs/jfs/Makefile
619 libparted/fs/linux_swap/Makefile
620 libparted/fs/ntfs/Makefile
621 libparted/fs/reiserfs/Makefile
622 libparted/fs/ufs/Makefile
623 libparted/fs/xfs/Makefile
624 libparted/tests/Makefile
625 libparted.pc
626 parted/Makefile
627 partprobe/Makefile
628 doc/Makefile
629 doc/C/Makefile
630 doc/pt_BR/Makefile
631 debug/Makefile
632 debug/clearfat/Makefile
633 debug/test/Makefile
634 tests/Makefile
635 po/Makefile.in
636 ])
637
638 echo
639 echo Type \'make\' to compile parted.