Newer
Older
AC_INIT(ncdu, 1.10g, projects@yorhel.nl)
AC_CONFIG_SRCDIR([src/global.h])
AM_INIT_AUTOMAKE([foreign subdir-objects])
PKG_PROG_PKG_CONFIG
[limits.h sys/time.h sys/types.h sys/stat.h dirent.h unistd.h fnmatch.h ncurses.h],[],
# Check for typedefs, structures, and compiler characteristics.
[getcwd gettimeofday fnmatch chdir rmdir unlink lstat],[],
# Look for ncurses library to link to
ncurses=auto
AC_ARG_WITH([ncurses],
AC_HELP_STRING([--with-ncurses], [compile/link with ncurses library] ),
[ncurses=ncurses])
AC_ARG_WITH([ncursesw],
AC_HELP_STRING([--with-ncursesw], [compile/link with wide-char ncurses library @<:@default@:>@]),
[ncurses=ncursesw])
if test "$ncurses" = "auto" -o "$ncurses" = "ncursesw"; then
PKG_CHECK_MODULES([NCURSES], [ncursesw], [LIBS="$LIBS $NCURSES_LIBS"; ncurses=ncursesw],
[AC_CHECK_LIB([ncursesw],
[initscr],
[LIBS="$LIBS -lncursesw"; ncurses=ncursesw],
[ncurses=ncurses])
])
PKG_CHECK_MODULES([NCURSES], [ncurses], [LIBS="$LIBS $NCURSES_LIBS"],
[AC_CHECK_LIB([ncurses],
[initscr],
[LIBS="$LIBS -lncurses"],
[AC_MSG_ERROR(ncurses library is required)])
])
AC_OUTPUT([Makefile])