File: configure.ac

package info (click to toggle)
libcdaudio 0.99.9-2.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,352 kB
  • ctags: 735
  • sloc: sh: 9,236; ansic: 5,193; makefile: 90
file content (123 lines) | stat: -rw-r--r-- 3,323 bytes parent folder | download
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
dnl Process this file with autoconf to produce a configure script.
AC_INIT(source/cdaudio.c)

LIBCDAUDIO_VERSION_MAJOR=0
LIBCDAUDIO_VERSION_MINOR=99
LIBCDAUDIO_VERSION_MICRO=9
LIBCDAUDIO_VERSION=$LIBCDAUDIO_VERSION_MAJOR.$LIBCDAUDIO_VERSION_MINOR.$LIBCDAUDIO_VERSION_MICRO


PACKAGE=libcdaudio

AM_INIT_AUTOMAKE($PACKAGE, ${LIBCDAUDIO_VERSION})

dnl AC_DEFINE_UNQUOTED(PACKAGE, "\"$PACKAGE\"", [Name of this package.])

dnl AC_DEFINE_UNQUOTED(VERSION, "\"$VERSION\"", [Version of this package.])

AM_CONFIG_HEADER(config.h)

AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AM_C_PROTOTYPES
AM_PROG_CC_STDC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AM_PROG_LIBTOOL

dnl AC_CANONICAL_HOST
dnl AC_ARG_PROGRAM

# We need to change the name of the installed package on some systems,
# so we don't clash with existing system files.  We'll do this by
# prefixing "lib" so it comes out as "libcdaudio.h" and
# "liblibcdaudio.so".

cdaudioname=cdaudio
AC_SUBST(cdaudioname)

threads=no

AC_ARG_ENABLE(threads,
[  --enable-threads        build a thread-safe version of libcdaudio [default=guessed]],
[if test "$enableval" = "yes"
then
        threads=yes
else
        threads=no
fi])

dnl POSIX.4 threads   
if test "$threads" = "yes"
then
        AC_CHECK_LIB(pthread,pthread_create,threads=-lpthread,threads=no)
        if test "$threads" = "no"
        then
                AC_CHECK_LIB(c_r,pthread_create,threads=-lc_r,threads=no)
        fi
fi

case "$host_os" in
  *beos*)
    cdaudioname=libcdaudio
    AC_DEFINE(BEOS_CDAUDIO, , [This symbol will be defined if we are compiling from a BeOS system.  In that case, we will use closesocket() instead of close(), and we won't use shutdown() at all.])
    LIBRARY_LIBS="-lcdaudio $LIBS"
    ;;
  irix*) 
    cdaudioname=libcdaudio
    AC_DEFINE(IRIX_CDAUDIO, , [This symbol will be declared if we're compiling for an Irix system, and we have access to the Irix cdaudio library to do the dirty work.])
    LIBRARY_LIBS="-lcdaudio -lmediad -lds $LIBS"
    ;;
  *solaris*)
    AC_DEFINE(SOLARIS_GETMNTENT, , [Quick fix for Solaris.])
    AC_DEFINE(BROKEN_SOLARIS_LEADOUT, , [Another quick fix.])
    ;;
esac

AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h linux/cdrom.h linux/ucdrom.h sys/cdio.h io/cam/cdrom.h stdarg.h mntent.h sys/mntent.h sys/ucred.h sys/mount.h strings.h)

AC_C_CONST

case "$cross_compiling" in
  yes) 
    echo "You are cross compiling.  You will need to edit config.h and specify the target machine's endianness and word size manually."
    ;;
  no)
    AC_C_BIGENDIAN
    AC_CHECK_SIZEOF(long)
    ;;
esac

AC_HEADER_TIME

AC_PROG_GCC_TRADITIONAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(gethostbyname gethostbyname_r mkdir socket strerror strstr strtol snprintf getmntinfo strtoul)
AC_FUNC_GETMNTENT

if test "$threads" != "no"
then
        AC_DEFINE(HAVE_PTHREAD, , [Define if your system provides POSIX.4 threads.])
        CFLAGS="$CFLAGS -D_REENTRANT"
        LIBRARY_LIB="$threads $LIBRARY_LIB"
        REENTRANT="-D_REENTRANT"
fi
AC_SUBST(REENTRANT)

AC_SUBST(LIBS)
AC_SUBST(LIB_LDADD)
AC_SUBST(LIBCDAUDIO_VERSION)
AC_SUBST(LIBCDAUDIO_VERSION_MAJOR)
AC_SUBST(LIBCDAUDIO_VERSION_MINOR)
AC_SUBST(LIBCDAUDIO_VERSION_MICRO)

AC_OUTPUT([
libcdaudio-config
Makefile 
source/Makefile
source/cdaudio.h], [chmod +x libcdaudio-config])