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