fdisk / configure.ac

AC_PREREQ(2.50)
AC_INIT(fdisk, 0.9.2, [bug-fdisk@gnu.org])
AC_CONFIG_AUX_DIR(autotools)

AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AM_GNU_GETTEXT_VERSION([0.14.5])
AM_GNU_GETTEXT([external])

AM_MAINTAINER_MODE

dnl set some basic variables
BUILD_DATE="`date '+%D'`"
AC_DEFINE_UNQUOTED(BUILD_DATE, "$BUILD_DATE", [The date of the build.])

# Check for programs.
AC_PROG_AWK
AC_LANG_C
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S

# Check headers.
AC_CHECK_HEADERS([ctype.h errno.h stdio.h getopt.h stdarg.h string.h \
		 stdlib.h unistd.h parted/parted.h])

# Check for library functions.
#AC_CHECK_FUNCS([])

# Check for LFS
AC_SYS_LARGEFILE
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=${ac_cv_sys_file_offset_bits}"

dnl libparted
# hack
LIBS="$LIBS -ldl"
CHECK_LIBPARTED([1.7.0], ,
                       AC_MSG_ERROR([*** libparted >= 1.7.0 not installed - please install first ***]))

AC_SUBST(PARTED_LIBS)


dnl ncurses
CHECK_CURSES(have_curses=true , have_curses=false)
AC_SUBST(CURSES_LIBS)

dnl Check if we have check... FIXME: Running autogen requires check installed

AM_PATH_CHECK(, have_check=true, have_check=false)
AM_CONDITIONAL(MAKE_TESTS, test x$have_check = xtrue)
AM_CONDITIONAL(MAKE_CFDISK, test x$have_curses = xtrue)

dnl Check how to create the {g,l}fdisk links
AC_MSG_CHECKING([how to create links])
rm -f test00 test01
touch test00
ln -s test00 test01 || :
SYMLINK=""
SYMLINKFROM="fdisk"
if test -L test01; then
	SYMLINK="ln -s"
else
	SYMLINKFROM="${sbindir}/fdisk"
	rm -f test01
	ln test00 test01 || :
	if test -e test01; then
		SYMLINK="ln"
	else
		SYMLINK="cp"
	fi
fi
AC_MSG_RESULT($SYMLINK)
AC_SUBST(SYMLINK)
AC_SUBST(SYMLINKFROM)
rm -f test00 test01

MKINSTALLDIRS="$PWD/autotools/mkinstalldirs"
AC_SUBST(MKINSTALLDIRS)

AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile tests/Makefile po/Makefile.in])
AC_OUTPUT
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.