1 dnl GNU Parted - a library and front end for manipulation hard disk partitions
2 dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2006, 2007
3 dnl Free Software Foundation, Inc.
5 dnl This file may be modified and/or distributed without restriction.
8 AC_INIT([GNU parted],[1.8.3],[bug-parted@gnu.org])
10 AC_CONFIG_SRCDIR(include/parted/parted.h)
12 AC_CONFIG_HEADERS([lib/config.h:lib/config.h.in])
13 AC_CONFIG_AUX_DIR(build-aux)
16 dnl Shamelessly pulled straight from glib's configure.in ...
18 dnl PED_MICRO_VERSION += 1;
19 dnl PED_INTERFACE_AGE += 1;
20 dnl PED_BINARY_AGE += 1;
21 dnl if any functions have been added, set PED_INTERFACE_AGE to 0.
22 dnl if backwards compatibility has been broken (eg. functions removed,
23 dnl function signatures changed),
24 dnl set PED_BINARY_AGE _and_ PED_INTERFACE_AGE to 0.
31 PED_VERSION=$PED_MAJOR_VERSION.$PED_MINOR_VERSION.$PED_MICRO_VERSION$PED_VERSION_SUFFIX
33 LT_RELEASE=$PED_MAJOR_VERSION.$PED_MINOR_VERSION
34 LT_CURRENT=`expr $PED_MICRO_VERSION - $PED_INTERFACE_AGE`
35 LT_REVISION=$PED_INTERFACE_AGE
36 LT_AGE=`expr $PED_BINARY_AGE - $PED_INTERFACE_AGE`
42 # Ensure that the PED_*-specified version is the same as the literal
43 # in the AC_INIT line, above.
44 test $PACKAGE_VERSION = $PED_VERSION ||
45 AC_MSG_ERROR(configure.ac: version mismatch: $PACKAGE_VERSION != $PED_VERSION)
47 AM_INIT_AUTOMAKE([1.10 dist-bzip2])
54 *) AC_MSG_ERROR([Unknown or unsupported OS "$host_os". Only "linux", "gnu" and "beos" are supported in this version of GNU Parted.]) ;;
58 dnl Command-line options
60 [ --with-readline support fancy command line editing], ,
65 [ --enable-mtrace enable malloc() debugging], ,
68 if test "$enable_mtrace" = yes; then
69 AC_DEFINE(ENABLE_MTRACE, 1, [Mtrace malloc() debugging])
72 AC_ARG_ENABLE(device-mapper,
73 [ --enable-device-mapper enable device mapper support [default=no]], ,
74 enable_device_mapper=no
76 if test "$enable_device_mapper" = yes; then
77 AC_DEFINE(ENABLE_DEVICE_MAPPER, 1, [device mapper (libdevmapper) support])
80 AC_ARG_ENABLE(selinux,
81 [ --enable-selinux enable SELinux support [default=no]], ,
85 AC_ARG_ENABLE(discover-only,
86 [ --enable-discover-only support only reading/probing [default=no]], ,
87 enable_discover_only=no
89 if test "$enable_discover_only" = yes; then
90 AC_DEFINE(DISCOVER_ONLY, 1, [Probing functionality only])
94 AC_ARG_ENABLE(dynamic-loading,
95 [ --enable-dynamic-loading support dynamic fs libraries [default=yes]], ,
96 if test "$enable_discover_only" = yes; then
97 enable_dynamic_loading=no
99 enable_dynamic_loading=yes
102 if test "$enable_discover_only" = yes -a "$enable_dynamic_loading" = yes; then
104 [You can't use --enable-dynamic-loading and --disable-discover-only together]
109 [ --enable-fs include filesystem support [default=yes]], ,
112 if test "$enable_fs" = yes; then
113 AC_DEFINE(ENABLE_FS, 1,
114 [Include file system support. i.e. libparted/fs_...])
118 [ --enable-debug compile in assertions [default=yes]], ,
122 if test "$enable_debug" = yes; then
123 AC_DEFINE(DEBUG, 1, [Enable assertions, etc.])
126 AC_ARG_ENABLE(read-only,
127 [ --enable-read-only disable writing (for debugging) [default=no]]
131 if test "$enable_read_only" = yes; then
132 AC_DEFINE(READ_ONLY, 1, [Disable all writing code])
136 AC_SUBST(PARTEDLDFLAGS)
139 [ --enable-pc98 build with pc98 support [default=yes]], ,
142 if test "$enable_pc98" = yes; then
143 AC_DEFINE(ENABLE_PC98, 1,
144 [Include PC98 partition tables. (Sometimes excluded to avoid
145 collisions with msdos partition tables])
148 AC_ARG_ENABLE(Werror,
149 [ --enable-Werror build with gcc -Werror [default=yes]], ,
153 AC_ARG_ENABLE(hfs-extract-fs,
154 [ --enable-hfs-extract-fs Extract special HFS files for debugging [default=no]], ,
155 enable_hfs_extract_fs=no
157 if test "$enable_hfs_extract_fs" = yes; then
158 AC_DEFINE(HFS_EXTRACT_FS, 1,
159 [Extract low level special HFS(+) files for debugging purposes
160 when using the "check" command (NOT FOR PACKAGING)])
163 dnl make libc threadsafe (not required for us, but useful other users of
165 AM_CPPFLAGS="$AM_CPPFLAGS -D_REENTRANT"
167 dnl Check for programs.
170 AC_PROG_GCC_TRADITIONAL
175 dnl This test must come as early as possible after the compiler configuration
176 dnl tests, because the choice of the file model can (in principle) affect
177 dnl whether functions and headers are available, whether they work, etc.
182 AC_CHECK_SIZEOF(off_t, 64, [
184 #include <sys/types.h>
189 if test "$OS" = linux -a $ac_cv_sizeof_off_t -lt 8; then
190 dnl Need to disable shared libraries, to get llseek() to work. Long
191 dnl story. The short story is: lseek() isn't in glibc, so a syscall
192 dnl must be made. syscalls can't be made from within shared libraries,
193 dnl because of a bug (?) in gcc.
195 off_t is less than 8 bytes. Using llseek syscall, and disabling shared
201 AM_GNU_GETTEXT_VERSION([0.15])
202 AM_GNU_GETTEXT([external])
203 if test "$USE_INCLUDED_LIBINTL" = "yes"; then
205 GNU Parted requires gettext to be installed for compilation -
206 if native language support is desired. Either disable native language support
208 $ ./configure --disable-nls
209 Or install gettext. GNU gettext is available from
210 http://ftp.gnu.org/gnu/gettext
215 dnl Check for libdl, if we are doing dynamic loading
217 if test "$enable_dynamic_loading" = yes; then
218 AC_CHECK_LIB(dl, dlopen,
220 PARTED_LIBS="$PARTED_LIBS -ldl"
221 AC_DEFINE(DYNAMIC_LOADING, 1, [Lazy linking to fs libs]),
223 [-ldl not found! Try using --disable-dynamic-loading]
230 dnl Check for libuuid
232 AC_CHECK_LIB(uuid, uuid_generate, UUID_LIBS="-luuid",
234 GNU Parted requires libuuid - a part of the e2fsprogs package (but
235 sometimes distributed separately in uuid-devel or similar)
236 This can probably be found on your distribution's CD or FTP site or at:
237 http://web.mit.edu/tytso/www/linux/e2fsprogs.html
238 Note: if you are using precompiled packages you will also need the development
239 package as well (which may be called e2fsprogs-devel or something similar).
240 If you compile e2fsprogs yourself then you need to do 'make install' and
247 dnl Check for libdevmapper
249 if test "$enable_device_mapper" = yes; then
250 AC_CHECK_LIB(devmapper, dm_task_create,
251 DM_LIBS="-ldevmapper",
253 [libdevmapper not found! Try using --disable-device-mapper]
260 dnl Check for SELinux
262 if test "$enable_selinux" = yes; then
263 SELINUX_LIBS="-lselinux -lsepol"
265 AC_SUBST(SELINUX_LIBS)
267 dnl Check for libreiserfs
269 if test "$enable_dynamic_loading" = no -a "$enable_discover_only" = no; then
271 AC_CHECK_LIB(dal, dal_equals,
273 AC_CHECK_LIB(reiserfs, reiserfs_fs_probe,
274 REISER_LIBS="-ldal -lreiserfs"
275 AC_DEFINE(HAVE_LIBREISERFS, 1, [Have libreiserfs])
277 AC_CHECK_LIB(reiserfs, reiserfs_fs_check,
278 AC_DEFINE(HAVE_REISERFS_FS_CHECK, 1, [Have reiserfs_fs_check()])
283 AC_SUBST(REISER_LIBS)
285 dnl Check for termcap
286 if test "$with_readline" = yes; then
289 AC_SEARCH_LIBS(tgetent, tinfo ncurses curses termcap termlib,
290 PARTED_LIBS="$PARTED_LIBS $LIBS",
292 termcap could not be found which is required for the
293 --with-readline option (which is enabled by default). Either disable readline
294 support with --without-readline or download and install termcap from:
295 ftp.gnu.org/gnu/termcap
296 Note: if you are using precompiled packages you will also need the development
297 package as well (which may be called termcap-devel or something similar).
298 Note: (n)curses also seems to work as a substitute for termcap. This was
299 not found either - but you could try installing that as well.
306 dnl Check for readline
307 dnl NOTE: We need to remove the gl_cv_ignore_unused_libraries flag if we
308 dnl detected one earlier. libreadline on some platforms (e.g., RHEL and
309 dnl Fedora) is left with
310 if test "$with_readline" = yes; then
311 OLD_LDFLAGS="$LDFLAGS"
312 LDFLAGS="$(echo $LDFLAGS | sed -e 's/-Wl,--as-needed//g' | sed -e 's/-Wl,-z,ignore//g' | sed -e 's/-z\ ignore//g')"
314 LIBS="$LIBS $PARTED_LIBS"
315 AC_CHECK_LIB(readline, readline,
316 PARTED_LIBS="-lreadline $PARTED_LIBS"
317 AC_DEFINE(HAVE_LIBREADLINE, 1, [have readline]),
319 GNU Readline could not be found which is required for the
320 --with-readline (which is enabled by default). Either disable readline support with
321 --without-readline or downloaded and install it from:
322 ftp.gnu.org/gnu/readline
323 Note: if you are using precompiled packages you will also need the development
324 package as well (which may be called readline-devel or something similar).
330 LDFLAGS="$OLD_LDFLAGS"
333 AC_SUBST(PARTED_LIBS)
335 dnl Check for OS specific libraries
338 if test "$OS" = gnu; then
339 dnl libshouldbeinlibc
340 AC_CHECK_LIB(shouldbeinlibc, vm_deallocate,
341 OS_LIBS="$OS_LIBS -lshouldbeinlibc",
343 GNU Parted requires libshouldbeinlibc when running on
344 GNU/Hurd systems. It is a standard part of a GNU/Hurd system.
349 dnl libstore may depend on libparted being present.
350 dnl Aren't circular dependencies wonderful?
354 AC_CHECK_LIB(parted, ped_device_read)
357 AC_CHECK_LIB(store, store_open,
358 OS_LIBS="$OS_LIBS -lstore",
360 GNU Parted requires libstore when running on GNU/Hurd
361 systems. It is a standard part of a GNU/Hurd system.
364 $OS_LIBS $UUID_LIBS $DM_LIBS $LIBS
371 if test "$OS" = beos; then
372 dnl Include the socket library, as it is a depedency of libuuid
373 dnl and so also of us (due to socket() call in libuuid)
374 OS_LIBS="$OS_LIBS -lsocket"
379 dnl One day, gettext might support libtool...
380 dnl if test "$USE_INCLUDED_LIBINTL" = "yes"; then
381 dnl INTLINCS='-I$(top_srcdir)/intl'
386 dnl Checks for header files.
387 AC_CHECK_HEADER(uuid/uuid.h, ,
389 GNU Parted requires libuuid - a part of the e2fsprogs package.
390 You seem to have the library installed but not the headers. These are usually
391 found in a corresponding development package (usually called e2fsprogs-devel).
392 If you can't find one try:
393 http://web.mit.edu/tytso/www/linux/e2fsprogs.html
398 AC_CHECK_HEADERS(getopt.h)
400 dnl required for libparted/llseek.c (TODO: make linux-x86 only)
401 if test "$OS" = linux; then
402 AC_CHECK_HEADER(linux/unistd.h)
405 if test "$with_readline" = yes; then
406 AC_CHECK_HEADERS(readline/readline.h readline/history.h, ,
408 The headers for GNU Readline could not be found which
409 are required for the --with-readline option. You seem to have the GNU readline
410 library installed but not the headers. These are usually found in a
411 corresponding development package (usually called readline-devel). If you can't
413 ftp.gnu.org/gnu/readline
414 Alternatively you can disable readline support with --without-readline
420 AC_CHECK_HEADERS(termcap.h)
422 if test "$USE_NLS" = yes; then
423 AC_CHECK_HEADERS(wctype.h, ,
425 One or more of the header files that are required for
426 native language support (wctype.h) could not be found. Either get a newer
427 version of GNU libc and its headers - which can be obtained from:
428 ftp.gnu.org/gnu/glibc
429 Or disable native language support with the --disable-nls option
435 AC_CHECK_HEADER([execinfo.h], [
436 AC_CHECK_LIB(c, backtrace, [
437 AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support])
438 LDFLAGS="$LDFLAGS -rdynamic"
442 dnl check for "check", unit testing library/header
443 PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], have_check=yes, have_check=no)
444 if test "$have_check" != "yes"; then
445 AC_MSG_RESULT([Unable to locate check version 0.9.3 or higher: not building])
447 AM_CONDITIONAL([HAVE_CHECK], [test "$have_check" = yes])
449 dnl Checks for typedefs, structures and compiler characteristics.
458 dnl Checks for library functions.
459 AC_CHECK_FUNCS(sigaction)
460 AC_CHECK_FUNCS(getuid)
462 dnl NOTE: We need to remove the gl_cv_ignore_unused_libraries flag if we
463 dnl detected one earlier. libreadline on some platforms (e.g., RHEL and
464 dnl Fedora) is left with
465 if test "$with_readline" = yes; then
466 OLD_LDFLAGS="$LDFLAGS"
467 LDFLAGS="$(echo $LDFLAGS | sed -e 's/-Wl,--as-needed//g' | sed -e 's/-Wl,-z,ignore//g' | sed -e 's/-z\ ignore//g')"
469 LIBS="$LIBS $PARTED_LIBS -lreadline"
470 AC_CHECK_FUNCS(rl_completion_matches)
472 LDFLAGS="$OLD_LDFLAGS"
475 AC_CHECK_FUNCS(canonicalize_file_name)
477 # CFLAGS="$CFLAGS -W -Wall -Wno-unused -Wno-switch -Wno-format"
479 if test "$enable_Werror" = yes; then
480 CFLAGS="$CFLAGS -Werror"
483 DATE=$(date '+%d %b %Y %H:%M')
486 BUILDINFO="$USER@$HOST, $DATE"
493 include/parted/Makefile
495 libparted/labels/Makefile
496 libparted/fs/Makefile
497 libparted/fs/amiga/Makefile
498 libparted/fs/ext2/Makefile
499 libparted/fs/fat/Makefile
500 libparted/fs/hfs/Makefile
501 libparted/fs/jfs/Makefile
502 libparted/fs/linux_swap/Makefile
503 libparted/fs/ntfs/Makefile
504 libparted/fs/reiserfs/Makefile
505 libparted/fs/ufs/Makefile
506 libparted/fs/xfs/Makefile
507 libparted/tests/Makefile
515 debug/clearfat/Makefile
522 echo Type \'make\' to compile parted.