Change version to GIT.
[ncast.git] / configure.ac
blob3760350c72edfe0ef7074074d652d0a582edbf68
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.59)
5 AC_INIT(ncast, [0.1-git1], [Ben Kibbey <bjk@luxsci.net>])
6 AC_CONFIG_AUX_DIR(build)
7 AC_CANONICAL_TARGET
8 AM_INIT_AUTOMAKE([foreign])
9 AC_PROG_MAKE_SET
10 #AC_LIBTOOL_DLOPEN
11 #AC_DISABLE_STATIC
12 #AC_PROG_LIBTOOL
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.
20 AC_PROG_CC
21 AC_PROG_INSTALL
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.])
35 else
36     AC_CHECK_HEADERS([curl/curl.h],,
37                      [AC_MSG_ERROR([Missing or incomplete libCURL installation.])])
40 AC_CHECK_PTH(,,,,
41              [AC_CHECK_HEADERS([pth.h],, 
42                [AC_MSG_ERROR([Missing or incomplete Pth installation.])])])
44 # Checks for header files.
45 AC_HEADER_STDC
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.
49 AC_C_CONST
50 AC_TYPE_PID_T
51 AC_TYPE_SIZE_T
52 AC_HEADER_TIME
53 AC_HEADER_SYS_WAIT
55 # Checks for library functions.
56 AC_FUNC_FORK
57 AC_FUNC_MALLOC
58 AC_FUNC_REALLOC
59 AC_FUNC_SELECT_ARGTYPES
60 AC_TYPE_SIGNAL
61 AC_FUNC_STAT
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
69     have_ptmx=yes
70 else
71     have_ptmx=no
74 ptmx_works=no
76 if test "x$have_ptmx" = "xyes"; then
77     AC_RUN_IFELSE([\
78                    #include <stdio.h>
79                    #include <sys/types.h>
80                    #include <sys/stat.h>
81                    #include <fcntl.h>
83                    int main()
84                    {
85                        int fd;
87                        if ((fd = open("/dev/ptmx", O_RDWR)) == -1)
88                            exit(1);
90                        if (ptsname(fd) == NULL)
91                            exit(1);
93                        exit(0);
94                    }
95                    ], [ptmx_works=yes], [ptmx_works=no])
97     if test "x$ptmx_works" = "xyes"; then
98         AC_MSG_RESULT([yes])
99         AC_DEFINE([UNIX98], 1, [Define if your system has Unix98 pty support.])
100     else
101         AC_MSG_RESULT([no])
102     fi
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
109     pdir='/dev/ptym'
110     else
111     pdir='/dev'
112     fi
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)
123     fi
126 AM_WITH_DMALLOC
127 AC_CONFIG_FILES([Makefile contrib/Makefile doc/Makefile src/Makefile])
128 AC_OUTPUT