summaryrefslogtreecommitdiff
path: root/configure.in
blob: c4ee13e3e33371764904ca32e0ff8226580c5924 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

AC_INIT(ncdu, git, projects@yorhel.nl)
AC_CONFIG_SRCDIR([src/global.h])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE

# Check for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB

# Check for header files.
AC_CHECK_HEADERS(
  [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],[],
  AC_MSG_ERROR([required header file not found]))

# Check for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
AC_SYS_LARGEFILE
AC_STRUCT_ST_BLOCKS

# Check for library functions.
AC_CHECK_FUNCS(
  [getcwd gettimeofday memset fnmatch chdir rmdir unlink lstat getcwd setlocale],[],
  AC_MSG_ERROR([required function missing]))



# 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)])



AC_OUTPUT([Makefile src/Makefile doc/Makefile])

echo ""
echo "Now type \"make\" and \"make install\" to build and install ncdu"