configure.in 3.44 KB
Newer Older
Jack Moffitt's avatar
Jack Moffitt committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/ices.c)

AM_INIT_AUTOMAKE(ices,2.0)

AC_PROG_CC
AM_PROG_LIBTOOL

dnl Set some options based on environment

if test -z "$GCC"; then
        case $host in 
        *-*-irix*)
                DEBUG="-g -signed" 
                CFLAGS="-O2 -w -signed"
                PROFILE="-p -g3 -O2 -signed"
		;;
        sparc-sun-solaris*)
19
20
21
                DEBUG="-v -g -D_REENTRANT"
                CFLAGS="-xO4 -fast -w -fsimple -native -xcg92 -D_REENTRANT"
                PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc -D_REENTRANT"
Jack Moffitt's avatar
Jack Moffitt committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
				SUN_LIBS="-lnsl -lsocket -lresolv"
		;;
        *)
                DEBUG="-g"
                CFLAGS="-O"
                PROFILE="-g -p" 
		;;
        esac
else
        case $host in 
        *-*-linux*)
                DEBUG="-g -Wall -fsigned-char -D_REENTRANT -D_GNU_SOURCE"
                CFLAGS="-O20 -ffast-math -fsigned-char -D_REENTRANT -D_GNU_SOURCE"
                PROFILE="-Wall -W -pg -g -O20 -ffast-math -fsigned-char -D_REENTRANT -D_GNU_SOURCE"
		;;
        sparc-sun-*)
38
39
40
41
                DEBUG="-g -Wall -fsigned-char -mv8 -D_REENTRANT"
                CFLAGS="-O20 -ffast-math -fsigned-char -mv8 -D_REENTRANT"
                PROFILE="-pg -g -O20 -fsigned-char -mv8 -D_REENTRANT" 
				SUN_LIBS="-lnsl -lsocket -lresolv -D_REENTRANT"
Jack Moffitt's avatar
Jack Moffitt committed
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
		;;
        *)
                DEBUG="-g -Wall -fsigned-char"
                CFLAGS="-O20 -fsigned-char"
                PROFILE="-O20 -g -pg -fsigned-char" 
		;;
        esac
fi

AC_SUBST(SUN_LIBS)

dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC

60
AC_CHECK_HEADER(stdint.h, AC_DEFINE(HAVE_STDINT_H, 1),,)
Jack Moffitt's avatar
Jack Moffitt committed
61
62
63
64
65
66
67

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)

68

Jack Moffitt's avatar
Jack Moffitt committed
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
if test "$have_oss" = yes; then
   OSS_CFLAGS="-DHAVE_OSS"
fi

AC_SUBST(OSS_CFLAGS)

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

AC_SUBST(SUN_CFLAGS)

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

dnl Check for types

dnl Checks for library functions.

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
  LIBS="$LIBS `$XMLCONFIG --libs`"
  CPPFLAGS="$CPPFLAGS `$XMLCONFIG --cflags`"
  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

AM_PATH_OGG(LIBS="$LIBS $OGG_LIBS", AC_MSG_ERROR(must have Ogg installed!))
AM_PATH_VORBIS(LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS", AC_MSG_ERROR(must have Vorbis installed!))
118
AM_PATH_SHOUT(LIBS="$LIBS $SHOUT_LIBS", AC_MSG_ERROR(must have libshout installed!))
Jack Moffitt's avatar
Jack Moffitt committed
119
120
121
122
123
124
125
126
127
128

dnl Make substitutions

AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(OPT)
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(CFLAGS)
AC_SUBST(PROFILE)

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