2007-07-20 03:15:46 -08:00
|
|
|
|
2009-04-05 04:59:05 -08:00
|
|
|
AC_INIT(ncdu, git, projects@yorhel.nl)
|
2009-04-26 01:54:27 -08:00
|
|
|
AC_CONFIG_SRCDIR([src/global.h])
|
2007-07-20 03:15:46 -08:00
|
|
|
AC_CONFIG_HEADER([config.h])
|
|
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
|
|
2009-10-18 01:55:47 -08:00
|
|
|
# Check for programs.
|
2007-07-20 03:15:46 -08:00
|
|
|
AC_PROG_CC
|
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
|
|
2009-10-18 01:55:47 -08:00
|
|
|
# Check for header files.
|
2009-04-30 01:25:06 -08:00
|
|
|
AC_CHECK_HEADERS(
|
2009-10-18 02:05:36 -08:00
|
|
|
[limits.h stdlib.h string.h sys/time.h sys/types.h sys/stat.h dirent.h unistd.h fnmatch.h ncurses.h locale.h],[],
|
2009-04-30 01:25:06 -08:00
|
|
|
AC_MSG_ERROR([required header file not found]))
|
2007-07-20 03:15:46 -08:00
|
|
|
|
2009-10-18 01:55:47 -08:00
|
|
|
# Check for typedefs, structures, and compiler characteristics.
|
2007-07-20 03:15:46 -08:00
|
|
|
AC_TYPE_OFF_T
|
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
|
AC_STRUCT_ST_BLOCKS
|
2010-05-07 04:17:03 -08:00
|
|
|
AC_CHECK_TYPE([unsigned long long], [],
|
|
|
|
|
[AC_MSG_ERROR([your compiler does not have an unsigned long long type.])])
|
2007-07-20 03:15:46 -08:00
|
|
|
|
2009-10-18 01:55:47 -08:00
|
|
|
# Check for library functions.
|
2009-04-30 01:25:06 -08:00
|
|
|
AC_CHECK_FUNCS(
|
2009-10-18 02:05:36 -08:00
|
|
|
[getcwd gettimeofday memset fnmatch chdir rmdir unlink lstat getcwd setlocale],[],
|
2009-04-30 01:25:06 -08:00
|
|
|
AC_MSG_ERROR([required function missing]))
|
2007-07-20 03:15:46 -08:00
|
|
|
|
2009-10-18 01:55:47 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# 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"; then
|
|
|
|
|
AC_CHECK_LIB([ncursesw],
|
|
|
|
|
[initscr],
|
|
|
|
|
[ncurses=ncursesw],
|
|
|
|
|
[ncurses=ncurses])
|
|
|
|
|
fi
|
|
|
|
|
AC_CHECK_LIB([$ncurses],
|
|
|
|
|
[initscr],
|
|
|
|
|
[LIBS="$LIBS -l$ncurses"],
|
|
|
|
|
[AC_MSG_ERROR($ncurses library is required)])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-07 04:17:03 -08:00
|
|
|
# compll configuration (only zlib is supported currently)
|
|
|
|
|
compll=no
|
|
|
|
|
AC_ARG_WITH([compll],
|
|
|
|
|
AC_HELP_STRING([--with-compll=zlib], [use zlib for in-memory compression (experimental)]),
|
|
|
|
|
[compll=$withval])
|
|
|
|
|
if test "x$compll" != "xno"; then
|
|
|
|
|
AC_CHECK_LIB([z],
|
|
|
|
|
[zlibVersion],
|
|
|
|
|
[AC_CHECK_HEADER([zlib.h], [LIBS="$LIBS -lz"; compll=zlib],
|
|
|
|
|
[if test "x$compll" = "xauto"; then compll=no
|
|
|
|
|
else AC_MSG_ERROR([--with-compll is given, but zlib.h could not be found]); fi])
|
|
|
|
|
],
|
|
|
|
|
[if test "x$compll" = "xauto"; then compll=no
|
|
|
|
|
else AC_MSG_ERROR([--with-compll is given, but no zlib library could not be found]); fi])
|
|
|
|
|
fi
|
|
|
|
|
if test "x$compll" = "xno"; then
|
|
|
|
|
AC_DEFINE([COMPLL_NOLIB], [1], [don't use compll])
|
|
|
|
|
fi
|
|
|
|
|
AM_CONDITIONAL([COMPLL], [test "x$compll" != "xno"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-20 03:15:46 -08:00
|
|
|
AC_OUTPUT([Makefile src/Makefile doc/Makefile])
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "Now type \"make\" and \"make install\" to build and install ncdu"
|