File: configure.ac

package info (click to toggle)
cdcd 0.6.6-13.3
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,768 kB
  • sloc: ansic: 4,891; sh: 2,142; makefile: 17
file content (63 lines) | stat: -rw-r--r-- 1,981 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
dnl Process this file with autoconf to produce a configure script.
AC_INIT([cdcd.c],[0.6.6])
AC_PREREQ([2.69])

AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE

dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_CPP

dnl Checks for libraries.
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.])])

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

dnl Patch to support only Linux
AC_DEFINE([HAVE_CDAUDIO], [1], [Define if cdaudio is available.])
AC_DEFINE([DEFAULT_DEVICE], ["/dev/cdrom"], [Default CDROM device.])

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 if the C library provides the `vasprintf' function.])
AC_DEFINE_UNQUOTED([HAVE_VSNPRINTF], [$have_vsnprintf],
          [True if the C library provides the `vsnprintf' function.])

if test "$have_vasprintf" != 1 && test "$have_vsnprintf" != 1
then
	AC_MSG_ERROR([Your system lacks `vasprintf', `vsnprintf'.
cdcd needs one of them to run.])
fi

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])