2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([psh], [0.18.0], [myzhang1029@hotmail.com])
6 AC_CONFIG_SRCDIR([src/main.c], [lib/util.c])
7 AC_CONFIG_HEADERS([config.h])
8 AM_INIT_AUTOMAKE([subdir-objects])
10 # Code to select a backend
16 cygwin*|darwin*|linux*|bsd*)
20 AC_MSG_ERROR(["Currently unsupported host system: $host_os"])
24 AM_CONDITIONAL([POSIX], [test "$posix_backend" = "true"])
25 AM_CONDITIONAL([GENERIC], [test "$generic_backend" = "true"])
27 # Checks for programs.
31 # Checks for libraries.
32 AC_SEARCH_LIBS([readline],
35 AC_DEFINE_UNQUOTED([HAVE_READLINE_GNU], [1], [Define to 1 if GNU libreadline is found])
36 AC_DEFINE_UNQUOTED([HAVE_READLINE], [1], [Define to 1 if libreadline is found])
38 [AC_SEARCH_LIBS([readline],
41 AC_DEFINE_UNQUOTED([HAVE_READLINE_ALTS], [1], [Define to 1 if alternative readline implementations are found])
42 AC_DEFINE_UNQUOTED([HAVE_READLINE], [1], [Define to 1 if libreadline is found])
45 [No libreadline or libedit, disabling readline. If yout think this is a mistake, try adding its path to CFLAGS and LDFLAGS.])
49 AC_SEARCH_LIBS([history_list],
51 [AC_DEFINE_UNQUOTED([HAVE_WORKING_HISTORY], [1],
52 [Define to 1 if working libhistory if found])
54 [AC_MSG_WARN([No libhistory, disabling history. If you think this is a mistake, try adding its path to CFLAGS and LDFLAGS.])])
56 # Checks for header files.
57 AC_CHECK_HEADERS([fcntl.h stddef.h stdint.h stdlib.h string.h unistd.h readline/readline.h readline/history.h])
59 # Checks for typedefs, structures, and compiler characteristics.
64 # Checks for library functions.
69 AC_OUTPUT([Makefile lib/Makefile src/Makefile src/backends/posix2/Makefile])