2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(ncast, [0.1-git1], [Ben Kibbey <bjk@luxsci.net>])
6 AC_CONFIG_AUX_DIR(build)
8 AM_INIT_AUTOMAKE([foreign])
13 AC_CONFIG_HEADER([config.h])
14 AC_CONFIG_SRCDIR([src/ncast.c])
16 #LIBTOOL="$LIBTOOL --silent"
17 #AC_SUBST(DLOPEN_LIBS, $lt_cv_dlopen_libs)
19 # Checks for programs.
23 # Checks for libraries.
24 AC_CHECK_LIB(ncurses, initscr,,
25 [AC_MSG_ERROR([Missing or incomplete ncurses installation.])])
26 AC_CHECK_LIB(panel, new_panel,,
27 [AC_MSG_ERROR([Missing or incomplete ncurses installation.])])
28 AC_CHECK_LIB(form, new_form,,
29 [AC_MSG_ERROR([Missing or incomplete ncurses installation.])])
31 LIBCURL_CHECK_CONFIG(,, [have_curl=yes], [have_curl=no])
33 if test "x$have_curl" = "xno"; then
34 AC_MSG_ERROR([Missing or incomplete libCURL installation.])
36 AC_CHECK_HEADERS([curl/curl.h],,
37 [AC_MSG_ERROR([Missing or incomplete libCURL installation.])])
41 [AC_CHECK_HEADERS([pth.h],,
42 [AC_MSG_ERROR([Missing or incomplete Pth installation.])])])
44 # Checks for header files.
46 AC_CHECK_HEADERS([fcntl.h paths.h stdlib.h string.h unistd.h getopt.h ncurses.h menu.h panel.h form.h limits.h])
48 # Checks for typedefs, structures, and compiler characteristics.
55 # Checks for library functions.
59 AC_FUNC_SELECT_ARGTYPES
62 AC_CHECK_FUNCS([dup2 isascii mkdir strcasecmp regcomp select strdup strerror vasprintf])
64 AH_TOP([/* Default Shoutcast URL. */
65 #define SHOUTCAST_URL "http://www.shoutcast.com:80"])
67 AC_MSG_CHECKING([for Unix98 pty support])
68 if test -c "/dev/ptmx"; then
76 if test "x$have_ptmx" = "xyes"; then
79 #include <sys/types.h>
87 if ((fd = open("/dev/ptmx", O_RDWR)) == -1)
90 if (ptsname(fd) == NULL)
95 ], [ptmx_works=yes], [ptmx_works=no])
97 if test "x$ptmx_works" = "xyes"; then
99 AC_DEFINE([UNIX98], 1, [Define if your system has Unix98 pty support.])
105 if test "x$have_ptmx" = "xno" -o "x$ptmx_works" = "xno"; then
106 # From the GNU Screen package.
107 AC_MSG_CHECKING([pty ranges])
108 if test -d /dev/ptym; then
114 ptys=`echo $pdir/pty??`
116 if test "$ptys" != "$pdir/pty??" ; then
117 p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
118 p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
120 AC_DEFINE_UNQUOTED([PTY_MAJOR], "$p0", [Pseudo tty ranges.])
121 AC_DEFINE_UNQUOTED([PTY_MINOR], "$p1", [Pseudo tty ranges.])
122 AC_MSG_RESULT($p0 $p1)
127 AC_CONFIG_FILES([Makefile contrib/Makefile doc/Makefile src/Makefile])