configure.in 3.89 KB
Newer Older
Jack Moffitt's avatar
Jack Moffitt committed
1
2
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/ices.c)
3
AC_PREREQ(2.52)
Jack Moffitt's avatar
Jack Moffitt committed
4
5
6
7
8
9
10
11

AM_INIT_AUTOMAKE(ices,2.0)

AC_PROG_CC
AM_PROG_LIBTOOL

dnl Set some options based on environment

Jack Moffitt's avatar
Jack Moffitt committed
12
13
SOCKET_LIBS=

14
AC_DEFINE(_XOPEN_SOURCE, 500, [Define if you have POSIX and XPG specifications])
Jack Moffitt's avatar
Jack Moffitt committed
15
16
17
if test -z "$GCC"; then
        case $host in 
        *-*-irix*)
18
                DEBUG="-g -signed -D_REENTRANT" 
19
                XIPH_CFLAGS="-O2 -w -signed -D_REENTRANT"
20
                PROFILE="-p -g3 -O2 -signed -D_REENTRANT"
Jack Moffitt's avatar
Jack Moffitt committed
21
		;;
Jack Moffitt's avatar
Jack Moffitt committed
22
        *-*-solaris*)
23
                DEBUG="-v -g -D_REENTRANT"
24
                XIPH_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92 -D_REENTRANT"
25
                PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc -D_REENTRANT"
Jack Moffitt's avatar
Jack Moffitt committed
26
27
		;;
        *)
28
                DEBUG="-g -D_REENTRANT"
29
                XIPH_CFLAGS="-O -D_REENTRANT"
30
                PROFILE="-g -p -D_REENTRANT" 
Jack Moffitt's avatar
Jack Moffitt committed
31
32
33
		;;
        esac
else
34
35
36
37
        AC_DEFINE(_GNU_SOURCE, ,[Define if you have POSIX and GNU specifications])
        XIPH_CFLAGS="-ffast-math -fsigned-char"
        DEBUG="-g"
        PROFILE="-g -pg"
Jack Moffitt's avatar
Jack Moffitt committed
38
39
40
41
42
43
44
45
46
fi

dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC

47
AC_CHECK_HEADER(stdint.h, AC_DEFINE(HAVE_STDINT_H, 1),,)
Jack Moffitt's avatar
Jack Moffitt committed
48
49
50
51
52
53
54

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)

55

Jack Moffitt's avatar
Jack Moffitt committed
56
57
58
59
60
61
62
63
64
65
66
67
68
if test "$have_oss" = yes; then
   OSS_CFLAGS="-DHAVE_OSS"
fi

dnl Check for Sun audio

AC_CHECK_HEADER(sys/audioio.h, have_sun_audio=yes, have_sun_audio=no)
AM_CONDITIONAL(HAVE_SUN_AUDIO,test "$have_sun_audio" = yes)

if test "$have_sun_audio" = yes; then
   SUN_CFLAGS="-DHAVE_SUN_AUDIO"
fi

69
70
71
72
73
74
75
76
77
78
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_CFLAGS="-DHAVE_ALSA"
   ALSA_LIBS="-lasound"
fi

Jack Moffitt's avatar
Jack Moffitt committed
79
80
81
82
83
84
85
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

dnl Check for types

dnl Checks for library functions.

86
87
88
AC_CHECK_LIB(nsl, gethostbyname, LIBS="-lnsl $LIBS",)
AC_CHECK_LIB(socket, socket, LIBS="-lsocket $LIBS",)

Jack Moffitt's avatar
Jack Moffitt committed
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
dnl -- configure options --

AC_ARG_WITH(xml-config,
  [  --with-xml-config=PATH  use xml-config in PATH to find libxml ],
  [if ! test -x "$with_xml_config"
   then
     AC_MSG_ERROR([$with_xml_config cannot be executed])
   fi
   XMLCONFIG="$with_xml_config"]
)
if test -z "$XMLCONFIG"
then
  AC_CHECK_PROGS(XMLCONFIG, [xml2-config xml-config])
fi
if test -n "$XMLCONFIG"
then
105
  XML_LIBS="`$XMLCONFIG --libs`"
106
  XML_CFLAGS="`$XMLCONFIG --cflags`"
107
  LIBS="$LIBS $XML_LIBS"
108
  XIPH_CFLAGS="$XIPH_CFLAGS $XML_CFLAGS"
Jack Moffitt's avatar
Jack Moffitt committed
109
110
111
112
113
  AC_CHECK_FUNC(xmlParseFile,, [AC_MSG_ERROR([There was a problem linking with libxml])])
else
  AC_MSG_ERROR([xml-config could not be found])
fi

114
AM_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!))
115
116
117
LIBS="$LIBS $OGG_LIBS"
XIPH_CFLAGS="$XIPH_CFLAGS $OGG_CFLAGS"

118
AM_PATH_VORBIS(, AC_MSG_ERROR(must have Vorbis installed!))
119
120
121
122
123
124
125
126
127
LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS"
XIPH_CFLAGS="$XIPH_CFLAGS $VORBIS_CFLAGS $VORBISENC_CFLAGS"

ACX_PTHREAD([
     LIBS="$LIBS $PTHREAD_LIBS"
     XIPH_CFLAGS="$XIPH_CFLAGS $PTHREAD_CFLAGS"
     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
     CC="$PTHREAD_CC"
])
128
AM_PATH_SHOUT(, AC_MSG_ERROR(must have libshout installed!))
129
130
LIBS="$LIBS $SHOUT_LIBS"
XIPH_CFLAGS="$XIPH_CFLAGS $SHOUT_CFLAGS"
Jack Moffitt's avatar
Jack Moffitt committed
131
132
133

dnl Make substitutions

134
135
AC_SUBST(OSS_CFLAGS)
AC_SUBST(SUN_CFLAGS)
136
137
AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
138
139
140
AC_SUBST(SOCKET_LIBS)
AC_SUBST(XML_LIBS)
AC_SUBST(SHOUT_LIBS)
141
142
143
144
AC_SUBST(OGG_CFLAGS)
AC_SUBST(VORBIS_CFLAGS)
AC_SUBST(SHOUT_CLFAGS)
AC_SUBST(XML_CFLAGS)
Jack Moffitt's avatar
Jack Moffitt committed
145
146
147
148
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(OPT)
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
149
dnl AC_SUBST(CFLAGS)
Jack Moffitt's avatar
Jack Moffitt committed
150
AC_SUBST(PROFILE)
151
AC_SUBST(XIPH_CFLAGS)
Jack Moffitt's avatar
Jack Moffitt committed
152

153
AC_OUTPUT(Makefile conf/Makefile src/Makefile src/avl/Makefile src/thread/Makefile src/net/Makefile src/log/Makefile src/timing/Makefile)