2 # Process this file with autoconf to produce a configure script.
4 m4_define(my_version, [m4_esyscmd([tr -d '\n' < version])])
7 AC_INIT([smenu],[my_version],[p.gen.progs@gmail.com])
8 AC_CONFIG_SRCDIR([smenu.c])
9 AC_CONFIG_HEADERS([config.h])
10 AC_CONFIG_AUX_DIR([build-aux])
11 AM_INIT_AUTOMAKE([no-dist-gzip dist-bzip2 foreign -Wall])
12 AM_SILENT_RULES([yes])
14 # Checks for programs.
15 AC_USE_SYSTEM_EXTENSIONS
22 AC_SEARCH_LIBS([tgetent], [tinfo curses ncursesw ncurses], [HAVE_CURSES=True])
24 # clock_gettime is in librt on *-*-osf5.1 and on glibc < 2.17, so add -lrt
25 AC_SEARCH_LIBS([clock_gettime], [rt], [
26 AC_DEFINE([HAVE_CLOCK_GETTIME],1,
27 [Define to 1 if you have the `clock_gettime' function])])
29 # Checks for libraries.
31 # Checks for header files.
32 AC_CHECK_INCLUDES_DEFAULT
35 AC_CHECK_HEADERS([fcntl.h limits.h langinfo.h locale.h stdint.h stdlib.h \
36 string.h sys/ioctl.h sys/time.h termios.h unistd.h wchar.h])
38 # Checks for typedefs, structures, and compiler characteristics.
41 # Checks for library functions.
44 AC_CHECK_FUNCS([mblen memset nl_langinfo pathconf regcomp setlocale])
45 AC_CHECK_FUNCS([strchr strrchr strspn strcasecmp])
50 *freebsd*|*dragonfly*)
51 CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS"
55 CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS"
59 CPPFLAGS="-D_NETBSD_SOURCE $CPPFLAGS"
63 CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
67 AC_CONFIG_FILES([Makefile])