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.
9 AC_INIT(include/parted/parted.h)
12 dnl Shamelessly pulled straight from glib's configure.in ...
14 dnl PED_MICRO_VERSION += 1;
15 dnl PED_INTERFACE_AGE += 1;
16 dnl PED_BINARY_AGE += 1;
17 dnl if any functions have been added, set PED_INTERFACE_AGE to 0.
18 dnl if backwards compatibility has been broken (eg. functions removed,
19 dnl function signatures changed),
20 dnl set PED_BINARY_AGE _and_ PED_INTERFACE_AGE to 0.
27 PED_VERSION=$PED_MAJOR_VERSION.$PED_MINOR_VERSION.$PED_MICRO_VERSION$PED_VERSION_SUFFIX
29 LT_RELEASE=$PED_MAJOR_VERSION.$PED_MINOR_VERSION
30 LT_CURRENT=`expr $PED_MICRO_VERSION - $PED_INTERFACE_AGE`
31 LT_REVISION=$PED_INTERFACE_AGE
32 LT_AGE=`expr $PED_BINARY_AGE - $PED_INTERFACE_AGE`
42 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
44 AM_CONFIG_HEADER(config.h)
51 *) AC_MSG_ERROR([Unknown or unsupported OS "$host_os". Only "linux", "gnu" and "beos" are supported in this version of GNU Parted.]) ;;
55 dnl Command-line options
57 [ --with-readline support fancy command line editing], ,
62 [ --enable-mtrace enable malloc() debugging], ,
65 if test "$enable_mtrace" = yes; then
66 AC_DEFINE(ENABLE_MTRACE, 1, [Mtrace malloc() debugging])
69 AC_ARG_ENABLE(device-mapper,
70 [ --enable-device-mapper enable device mapper support [default=no]], ,
71 enable_device_mapper=no
73 if test "$enable_device_mapper" = yes; then
74 AC_DEFINE(ENABLE_DEVICE_MAPPER, 1, [device mapper (libdevmapper) support])
77 AC_ARG_ENABLE(selinux,
78 [ --enable-selinux enable SELinux support [default=no]], ,
82 AC_ARG_ENABLE(discover-only,
83 [ --enable-discover-only support only reading/probing [default=no]], ,
84 enable_discover_only=no
86 if test "$enable_discover_only" = yes; then
87 AC_DEFINE(DISCOVER_ONLY, 1, [Probing functionality only])
91 AC_ARG_ENABLE(dynamic-loading,
92 [ --enable-dynamic-loading support dynamic fs libraries [default=yes]], ,
93 if test "$enable_discover_only" = yes; then
94 enable_dynamic_loading=no
96 enable_dynamic_loading=yes
99 if test "$enable_discover_only" = yes -a "$enable_dynamic_loading" = yes; then
101 [You can't use --enable-dynamic-loading and --disable-discover-only together]
106 [ --enable-fs include filesystem support [default=yes]], ,
109 if test "$enable_fs" = yes; then
110 AC_DEFINE(ENABLE_FS, 1,
111 [Include file system support. i.e. libparted/fs_...])
115 [ --enable-debug compile in assertions [default=yes]], ,
119 if test "$enable_debug" = yes; then
120 AC_DEFINE(DEBUG, 1, [Enable assertions, etc.])
123 AC_ARG_ENABLE(read-only,
124 [ --enable-read-only disable writing (for debugging) [default=no]]
128 if test "$enable_read_only" = yes; then
129 AC_DEFINE(READ_ONLY, 1, [Disable all writing code])
133 AC_SUBST(PARTEDLDFLAGS)
136 [ --enable-pc98 build with pc98 support [default=yes]], ,
139 if test "$enable_pc98" = yes; then
140 AC_DEFINE(ENABLE_PC98, 1,
141 [Include PC98 partition tables. (Sometimes excluded to avoid
142 collisions with msdos partition tables])
145 AC_ARG_ENABLE(Werror,
146 [ --enable-Werror build with gcc -Werror [default=yes]], ,
150 AC_ARG_ENABLE(hfs-extract-fs,
151 [ --enable-hfs-extract-fs Extract special HFS files for debugging [default=no]], ,
152 enable_hfs_extract_fs=no
154 if test "$enable_hfs_extract_fs" = yes; then
155 AC_DEFINE(HFS_EXTRACT_FS, 1,
156 [Extract low level special HFS(+) files for debugging purposes
157 when using the "check" command (NOT FOR PACKAGING)])
160 dnl make libc threadsafe (not required for us, but useful other users of
162 CFLAGS="$CFLAGS -D_REENTRANT"
164 dnl Check for programs.
167 AC_PROG_GCC_TRADITIONAL
171 dnl This test must come as early as possible after the compiler configuration
172 dnl tests, because the choice of the file model can (in principle) affect
173 dnl whether functions and headers are available, whether they work, etc.
176 CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=${ac_cv_sys_file_offset_bits}"
177 AC_CHECK_SIZEOF(off_t, 64, [
179 #include <sys/types.h>
184 if test "$OS" = linux -a $ac_cv_sizeof_off_t -lt 8; then
185 dnl Need to disable shared libraries, to get llseek() to work. Long
186 dnl story. The short story is: lseek() isn't in glibc, so a syscall
187 dnl must be made. syscalls can't be made from within shared libraries,
188 dnl because of a bug (?) in gcc.
190 off_t is less than 8 bytes. Using llseek syscall, and disabling shared
197 ALL_LINGUAS="ca cs da de es fr gl id it ja nl nn hu pl pt pt_BR ru sv tr uk vi zh_CN zh_TW"
198 AM_GNU_GETTEXT_VERSION([0.12.1])
199 AM_GNU_GETTEXT([external])
200 CFLAGS="$CFLAGS -DLOCALEDIR=\"\\\"$datadir/locale\\\"\""
201 if test "$USE_INCLUDED_LIBINTL" = "yes"; then
203 GNU Parted requires gettext to be installed for compilation -
204 if native language support is desired. Either disable native language support
206 $ ./configure --disable-nls
207 Or install gettext. GNU gettext is available from
208 http://ftp.gnu.org/gnu/gettext
213 dnl Check for libdl, if we are doing dynamic loading
215 if test "$enable_dynamic_loading" = yes; then
216 AC_CHECK_LIB(dl, dlopen,
218 PARTED_LIBS="$PARTED_LIBS -ldl"
219 AC_DEFINE(DYNAMIC_LOADING, 1, [Lazy linking to fs libs]),
221 [-ldl not found! Try using --disable-dynamic-loading]
228 dnl Check for libuuid
230 AC_CHECK_LIB(uuid, uuid_generate, UUID_LIBS="-luuid",
232 GNU Parted requires libuuid - a part of the e2fsprogs package (but
233 sometimes distributed separately in uuid-devel or similar)
234 This can probably be found on your distribution's CD or FTP site or at:
235 http://web.mit.edu/tytso/www/linux/e2fsprogs.html
236 Note: if you are using precompiled packages you will also need the development
237 package as well (which may be called e2fsprogs-devel or something similar).
238 If you compile e2fsprogs yourself then you need to do 'make install' and
245 dnl Check for libdevmapper
247 if test "$enable_device_mapper" = yes; then
248 AC_CHECK_LIB(devmapper, dm_task_create,
249 DM_LIBS="-ldevmapper",
251 [libdevmapper not found! Try using --disable-device-mapper]
258 dnl Check for SELinux
260 if test "$enable_selinux" = yes; then
261 SELINUX_LIBS="-lselinux -lsepol"
263 AC_SUBST(SELINUX_LIBS)
265 dnl Check for libreiserfs
267 if test "$enable_dynamic_loading" = no -a "$enable_discover_only" = no; then
269 AC_CHECK_LIB(dal, dal_equals,
271 AC_CHECK_LIB(reiserfs, reiserfs_fs_probe,
272 REISER_LIBS="-ldal -lreiserfs"
273 AC_DEFINE(HAVE_LIBREISERFS, 1, [Have libreiserfs])
275 AC_CHECK_LIB(reiserfs, reiserfs_fs_check,
276 AC_DEFINE(HAVE_REISERFS_FS_CHECK, 1, [Have reiserfs_fs_check()])
281 AC_SUBST(REISER_LIBS)
283 dnl Check for termcap
284 if test "$with_readline" = yes; then
287 AC_SEARCH_LIBS(tgetent, ncurses curses termcap termlib,
288 PARTED_LIBS="$PARTED_LIBS $LIBS",
290 termcap could not be found which is required for the
291 --with-readline option (which is enabled by default). Either disable readline
292 support with --without-readline or download and install termcap from:
293 ftp.gnu.org/gnu/termcap
294 Note: if you are using precompiled packages you will also need the development
295 package as well (which may be called termcap-devel or something similar).
296 Note: (n)curses also seems to work as a substitute for termcap. This was
297 not found either - but you could try installing that as well.
304 dnl Check for readline
305 if test "$with_readline" = yes; then
307 LIBS="$LIBS $PARTED_LIBS"
308 AC_CHECK_LIB(readline, readline,
309 PARTED_LIBS="-lreadline $PARTED_LIBS"
310 AC_DEFINE(HAVE_LIBREADLINE, 1, [have readline]),
312 GNU Readline could not be found which is required for the
313 --with-readline (which is enabled by default). Either disable readline support with
314 --without-readline or downloaded and install it from:
315 ftp.gnu.org/gnu/readline
316 Note: if you are using precompiled packages you will also need the development
317 package as well (which may be called readline-devel or something similar).
325 AC_SUBST(PARTED_LIBS)
327 dnl Check for OS specific libraries
330 if test "$OS" = gnu; then
331 CFLAGS="$CFLAGS -D_GNU_SOURCE=1"
333 dnl libshouldbeinlibc
334 AC_CHECK_LIB(shouldbeinlibc, vm_deallocate,
335 OS_LIBS="$OS_LIBS -lshouldbeinlibc",
337 GNU Parted requires libshouldbeinlibc when running on
338 GNU/Hurd systems. It is a standard part of a GNU/Hurd system.
343 dnl libstore may depend on libparted being present.
344 dnl Aren't circular dependencies wonderful?
348 AC_CHECK_LIB(parted, ped_device_read)
351 AC_CHECK_LIB(store, store_open,
352 OS_LIBS="$OS_LIBS -lstore",
354 GNU Parted requires libstore when running on GNU/Hurd
355 systems. It is a standard part of a GNU/Hurd system.
358 $OS_LIBS $UUID_LIBS $DM_LIBS $LIBS
365 if test "$OS" = beos; then
366 dnl Include the socket library, as it is a depedency of libuuid
367 dnl and so also of us (due to socket() call in libuuid)
368 OS_LIBS="$OS_LIBS -lsocket"
373 dnl One day, gettext might support libtool...
374 dnl if test "$USE_INCLUDED_LIBINTL" = "yes"; then
375 dnl INTLINCS='-I$(top_srcdir)/intl'
380 dnl Checks for header files.
381 AC_CHECK_HEADER(uuid/uuid.h, ,
383 GNU Parted requires libuuid - a part of the e2fsprogs package.
384 You seem to have the library installed but not the headers. These are usually
385 found in a corresponding development package (usually called e2fsprogs-devel).
386 If you can't find one try:
387 http://web.mit.edu/tytso/www/linux/e2fsprogs.html
392 AC_CHECK_HEADERS(getopt.h)
394 dnl required for libparted/llseek.c (TODO: make linux-x86 only)
395 if test "$OS" = linux; then
396 AC_CHECK_HEADER(linux/unistd.h)
399 if test "$with_readline" = yes; then
400 AC_CHECK_HEADERS(readline/readline.h readline/history.h, ,
402 The headers for GNU Readline could not be found which
403 are required for the --with-readline option. You seem to have the GNU readline
404 library installed but not the headers. These are usually found in a
405 corresponding development package (usually called readline-devel). If you can't
407 ftp.gnu.org/gnu/readline
408 Alternatively you can disable readline support with --without-readline
414 AC_CHECK_HEADERS(termcap.h)
416 if test "$USE_NLS" = yes; then
417 AC_CHECK_HEADERS(wctype.h, ,
419 One or more of the header files that are required for
420 native language support (wctype.h) could not be found. Either get a newer
421 version of GNU libc and its headers - which can be obtained from:
422 ftp.gnu.org/gnu/glibc
423 Or disable native language support with the --disable-nls option
429 AC_CHECK_HEADER([execinfo.h], [
430 AC_CHECK_LIB(c, backtrace, [
431 AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support])
432 LDFLAGS="$LDFLAGS -rdynamic"
436 dnl check for "check", unit testing library/header
437 PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], have_check=yes, have_check=no)
438 if test "$have_scintilla" != "yes"; then
439 AC_MSG_RESULT([Unable to locate check version 0.9.3 or higher: not building])
441 AM_CONDITIONAL([HAVE_CHECK], [test "$have_check" = yes])
443 dnl Checks for typedefs, structures and compiler characteristics.
452 dnl Checks for library functions.
453 AC_CHECK_FUNCS(sigaction)
454 AC_CHECK_FUNCS(getuid)
456 if test "$with_readline" = yes; then
458 LIBS="$LIBS $PARTED_LIBS -lreadline"
459 AC_CHECK_FUNCS(rl_completion_matches)
464 CFLAGS=-D_GNU_SOURCE=1
465 AC_CHECK_FUNCS(canonicalize_file_name)
468 CFLAGS="$CFLAGS -W -Wall -Wno-unused -Wno-switch -Wno-format"
470 if test "$enable_Werror" = yes; then
471 CFLAGS="$CFLAGS -Werror"
474 DATE=$(date '+%d %b %Y %H:%M')
477 BUILDINFO="$USER@$HOST, $DATE"
483 include/parted/Makefile
485 libparted/labels/Makefile
486 libparted/fs/Makefile
487 libparted/fs/amiga/Makefile
488 libparted/fs/ext2/Makefile
489 libparted/fs/fat/Makefile
490 libparted/fs/hfs/Makefile
491 libparted/fs/jfs/Makefile
492 libparted/fs/linux_swap/Makefile
493 libparted/fs/ntfs/Makefile
494 libparted/fs/reiserfs/Makefile
495 libparted/fs/ufs/Makefile
496 libparted/fs/xfs/Makefile
497 libparted/tests/Makefile
505 debug/clearfat/Makefile
512 echo Type \'make\' to compile parted.