[go: up one dir, main page]

Menu

[3fac24]: / configure.ac  Maximize  Restore  History

Download this file

115 lines (93 with data), 3.2 kB

dnl Process this file with autoconf to produce a configure script.
PACKAGE=cdcd

MAJOR_VERSION=0
MINOR_VERSION=6
MICRO_VERSION=6
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
AC_INIT([cdcd], [0.6.6])

AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE

dnl Checks for programs.
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_CPP
AC_CANONICAL_HOST

dnl Checks for libraries.
AC_CHECK_LIB(curses, tputs,,
             [AC_MSG_ERROR([cannot find the curses library.
Check the INSTALL file, maybe you can find how to solve the problem.])])
AC_CHECK_LIB(readline, rl_completion_matches,,
             [AC_MSG_ERROR([cannot find GNU libreadline 4.2 or higher.
Check the INSTALL file, maybe you can find how to solve the problem.])])
AC_CHECK_LIB(socket, socket)dnl Needed for Solaris 2.9.

AM_PATH_LIBCDAUDIO(,,[AC_MSG_ERROR([cannot find libcdaudio.
Check the INSTALL file, maybe you can find how to solve the problem.])])

have_libcdaudio=0
have_cdaudio=0

case "$host_os" in
  irix*) 
    default_device=/dev/unspecified
    have_libcdaudio=1
    ;;

  *bsd*)
    default_device=/dev/wcd0a
    have_cdaudio=1
    ;;

  *linux*)
    default_device=/dev/cdrom
    have_cdaudio=1
    ;;

  *solaris*)
    default_device=/dev/c0t1d0s0
    have_cdaudio=1
    ;;
esac

AC_DEFINE_UNQUOTED([HAVE_LIBCDAUDIO], [$have_libcdaudio],
			     [True if we must provide -llibcdaudio (for IRIX).])
AC_DEFINE_UNQUOTED([HAVE_CDAUDIO], [$have_cdaudio],
			  [True if we must provide -lcdaudio.])
AC_DEFINE_UNQUOTED([DEFAULT_DEVICE], ["$default_device"], [Default CDROM device.])

AM_PATH_GLIB_2_0([], [have_glib=1], [have_glib=0])
AC_DEFINE_UNQUOTED([HAVE_GLIB], [$have_glib], [True iff GLib2 can be used.])

dnl Checks for header files.
AC_HEADER_STDC
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([string.h strings.h sys/ptyvar.h])
AC_CHECK_HEADERS([errno.h locale.h malloc.h stdlib.h \
readline/readline.h readline/history.h sys/socket.h unistd.h],, \
[AC_MSG_ERROR([missing header file.])])

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T

dnl Checks for library functions.
AC_FUNC_MALLOC
AC_TYPE_SIGNAL
AC_FUNC_STAT

AC_CHECK_FUNC([vsnprintf], [have_vsnprintf=1], [have_vsnprintf=0])
AC_CHECK_FUNC([vasprintf], [have_vasprintf=1], [have_vasprintf=0])
AC_DEFINE_UNQUOTED([HAVE_VASPRINTF], [$have_vasprintf],
          [True iff the C library provides the `vasprintf' function.])
AC_DEFINE_UNQUOTED([HAVE_VSNPRINTF], [$have_vsnprintf],
          [True iff the C library provides the `vsnprintf' function.])

if test "$have_vasprintf" != 1 && test "$have_vsnprintf" != 1 &&
   test "$have_glib" != 1
then
	AC_MSG_ERROR([Your system lacks `vasprintf', `vsnprintf' and Glib >= 1.1.12.
cdcd needs one of them to run.
Please install Glib version 1.1.12 or higher first.])
fi

if test "$have_vasprintf" != 1 && test "$have_vsnprintf" != 1
then
	# We need Glib.
	maybe_glib_cflags='$(GLIB_CFLAGS)'
	maybe_glib_libs='$(GLIB_LIBS)'
fi
AC_SUBST([maybe_glib_cflags])
AC_SUBST([maybe_glib_libs])

AC_CHECK_FUNCS([setlocale strcasecmp strchr strdup strncasecmp strstr \
strtol strerror],,
[AC_MSG_ERROR([missing function.])])

AC_CHECK_FUNCS([strcasestr])

AC_OUTPUT([Makefile doc/Makefile])