configure.in 4.25 KB
Newer Older
Jack Moffitt's avatar
Jack Moffitt committed
1
dnl Process this file with autoconf to produce a configure script.
2
AC_INIT([IceS], 2.0-Beta2, [icecast@xiph.org])
3
AC_PREREQ(2.54)
4
AC_CONFIG_SRCDIR(src/ices.c)
Jack Moffitt's avatar
Jack Moffitt committed
5

6
AM_INIT_AUTOMAKE
7
AM_CONFIG_HEADER(config.h)
8
AM_MAINTAINER_MODE
Jack Moffitt's avatar
Jack Moffitt committed
9
10
11
12
13
14

AC_PROG_CC
AM_PROG_LIBTOOL

dnl Set some options based on environment

15
16
dnl openbsd headers break when _XOPEN_SOURCE is defined but without it seems
dnl to be fine
17
case "$host" in
18
19
   *openbsd*)
   ;;
20
   *) AC_DEFINE(_XOPEN_SOURCE, 600, [Define if you have POSIX and XPG specifications])
21
22
   ;;
esac
23
case "$host" in 
24
25
*-*-irix*)
        DEBUG="-g -signed -D_REENTRANT" 
26
        XIPH_CPPFLAGS="-O2 -w -signed -D_REENTRANT"
27
28
29
        PROFILE="-p -g3 -O2 -signed -D_REENTRANT"
;;
*-*-solaris*)
30
        AC_DEFINE(__EXTENSIONS__, 1, [define to 1 to get resolve header problem on solaris])
31
        DEBUG="-v -g -D_REENTRANT"
32
        XIPH_CPPFLAGS="-xO4 -fast -w -fsimple -native -xcg92 -D_REENTRANT"
33
34
35
36
        PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc -D_REENTRANT"
;;
*)
        DEBUG="-g -D_REENTRANT"
37
        XIPH_CPPFLAGS="-O -D_REENTRANT"
38
39
40
41
        PROFILE="-g -p -D_REENTRANT" 
;;
esac
if test -n "$GCC"; then
42
        AC_DEFINE(_GNU_SOURCE, ,[Define if you have POSIX and GNU specifications])
43
        XIPH_CPPFLAGS="-ffast-math -fsigned-char"
44
45
        DEBUG="-g"
        PROFILE="-g -pg"
Jack Moffitt's avatar
Jack Moffitt committed
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
fi

dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC

dnl Check for OSS

AC_CHECK_HEADER(sys/soundcard.h, have_oss=yes, have_oss=no)
AC_CHECK_HEADER(machine/soundcard.h, have_oss=yes, )
AM_CONDITIONAL(HAVE_OSS,test "$have_oss" = yes)
if test "$have_oss" = yes; then
61
    AC_DEFINE(HAVE_OSS,,[Define to enable OSS input module])
Jack Moffitt's avatar
Jack Moffitt committed
62
63
64
65
fi

dnl Check for Sun audio

66
AC_ARG_ENABLE(sun-audio,
67
68
    AC_HELP_STRING([--disable-sun-audio],
                   [Disable sun audio input (default autodetect)]),
69
70
71
72
73
    enable_sun="$enableval",
    enable_sun=yes
)
if test x$enable_sun = xyes; then
   AC_CHECK_HEADER(sys/audioio.h, have_sun_audio=yes, have_sun_audio=no)
Jack Moffitt's avatar
Jack Moffitt committed
74

75
76
77
   if test "$have_sun_audio" = yes; then
       AC_DEFINE(HAVE_SUN_AUDIO,,[Define to enable sun audio input module])
   fi
Jack Moffitt's avatar
Jack Moffitt committed
78
fi
79
AM_CONDITIONAL(HAVE_SUN_AUDIO,test "$have_sun_audio" = yes)
Jack Moffitt's avatar
Jack Moffitt committed
80

81
82
83
84
85
86
87
dnl Check for ALSA audio

AC_CHECK_HEADER(alsa/asoundlib.h, have_alsa=yes, have_alsa=no)
AM_CONDITIONAL(HAVE_ALSA,test "$have_alsa" = yes)

if test "$have_alsa" = yes; then
   ALSA_LIBS="-lasound"
88
   AC_DEFINE(HAVE_ALSA, ,[Define to enable ALSA input module])
89
90
fi

Jack Moffitt's avatar
Jack Moffitt committed
91
92
93
94
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

dnl Check for types
95
AC_CHECK_TYPES([uint64_t],,AC_ERROR([could not find a uint64_t type]))
Jack Moffitt's avatar
Jack Moffitt committed
96
97
98

dnl Checks for library functions.

99
100
101
dnl deal with xml-config
AC_MSG_RESULT([checking for XML configuration])
AC_ARG_VAR([XMLCONFIG],[XML configuration program])
Jack Moffitt's avatar
Jack Moffitt committed
102
AC_ARG_WITH(xml-config,
103
104
105
106
    [AC_HELP_STRING([--with-xml-config=PATH],
                    [use xml-config in PATH to find libxml])],
    [XMLCONFIG="$withval"],
    [AC_PATH_PROGS(XMLCONFIG, [xml2-config xml-config], "")]
Jack Moffitt's avatar
Jack Moffitt committed
107
)
108
109
if test "x$XMLCONFIG" = "x"; then
    AC_MSG_ERROR([XML configuration could not be found])
Jack Moffitt's avatar
Jack Moffitt committed
110
fi
111
112
if ! test -x "$XMLCONFIG"; then
    AC_MSG_ERROR([$XMLCONFIG cannot be executed])
Jack Moffitt's avatar
Jack Moffitt committed
113
fi
114
115
XML_LIBS="$($XMLCONFIG --libs)"
XML_CFLAGS="$($XMLCONFIG --cflags)"
116
117
118
119
ac_save_LIBS="$LIBS"
ac_save_CFLAGS="$CFLAGS"
LIBS="$XML_LIBS $XIPH_LIBS"
CFLAGS="$XIPH_CFLAGS $XML_CFLAGS"
120
AC_CHECK_FUNC(xmlParseFile,, [AC_MSG_ERROR([There was a problem linking with libxml])])
121
122
123
124
125
126
127
128
129
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
XIPH_VAR_APPEND([XIPH_CFLAGS], [$XML_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS], [$XML_LIBS])

XIPH_PATH_SHOUT(, AC_MSG_ERROR([must have libshout installed!]))
XIPH_VAR_APPEND([XIPH_CPPFLAGS], [$SHOUT_CPPFLAGS])
XIPH_VAR_APPEND([XIPH_CFLAGS], [$SHOUT_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS], [$SHOUT_LIBS])
Jack Moffitt's avatar
Jack Moffitt committed
130

131
132
133
XIPH_PATH_VORBIS(, AC_MSG_ERROR([must have Ogg Vorbis v1.0 installed!]))
XIPH_VAR_APPEND([XIPH_CPPFLAGS], [$VORBIS_CFLAGS $VORBISENC_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS], [$VORBISENC_LIBS $VORBIS_LIBS])
Jack Moffitt's avatar
Jack Moffitt committed
134
135
136

dnl Make substitutions

137
AC_SUBST(ALSA_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
138
AC_SUBST(XML_LIBS)
139
AC_SUBST(XML_CFLAGS)
Jack Moffitt's avatar
Jack Moffitt committed
140
141
142
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(DEBUG)
AC_SUBST(PROFILE)
143
AC_SUBST(XIPH_CFLAGS)
144
145
AC_SUBST(XIPH_CPPFLAGS)
AC_SUBST(XIPH_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
146

147
148
149
150
151
152
AC_OUTPUT(
  Makefile
  conf/Makefile 
  src/Makefile 
   src/log/Makefile 
   src/timing/Makefile
153
   src/thread/Makefile
154
)