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

AM_INIT_AUTOMAKE(icecast,2.0)

AC_PROG_CC
AC_CANONICAL_HOST
AM_PROG_LIBTOOL

dnl Set some options based on environment

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

Jack Moffitt's avatar
Jack Moffitt committed
14 15 16
if test -z "$GCC"; then
        case $host in 
        *-*-irix*)
Jack Moffitt's avatar
Jack Moffitt committed
17 18 19
                DEBUG="-g -signed -D_REENTRANT" 
                CFLAGS="-O2 -w -signed -D_REENTRANT"
                PROFILE="-p -g3 -O2 -signed -D_REENTRANT"
Jack Moffitt's avatar
Jack Moffitt committed
20
		;;
Jack Moffitt's avatar
Jack Moffitt committed
21
        *-*-solaris*)
22 23 24
                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
25
		SOCKET_LIBS="-lnsl -lsocket -lresolv"
Jack Moffitt's avatar
Jack Moffitt committed
26 27
		;;
        *)
Jack Moffitt's avatar
Jack Moffitt committed
28 29 30
                DEBUG="-g -D_REENTRANT"
                CFLAGS="-O -D_REENTRANT"
                PROFILE="-g -p -D_REENTRANT"
Jack Moffitt's avatar
Jack Moffitt committed
31 32 33 34 35 36 37 38 39
		;;
        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"
		;;
40
        sparc-sun-solaris*)
41 42 43
                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" 
Jack Moffitt's avatar
Jack Moffitt committed
44
		SOCKET_LIBS="-lnsl -lsocket -lresolv"
Jack Moffitt's avatar
Jack Moffitt committed
45
		;;
46 47 48 49 50 51
	*-pc-solaris*)
                DEBUG="-g -Wall -fsigned-char -D_REENTRANT"
                CFLAGS="-O20 -ffast-math -fsigned-char -D_REENTRANT"
                PROFILE="-pg -g -O20 -fsigned-char -D_REENTRANT" 
		SOCKET_LIBS="-lnsl -lsocket -lresolv"
		;;
Jack Moffitt's avatar
Jack Moffitt committed
52
        *)
Jack Moffitt's avatar
Jack Moffitt committed
53 54 55
                DEBUG="-g -Wall -fsigned-char -D_REENTRANT"
                CFLAGS="-O20 -fsigned-char -D_REENTRANT"
                PROFILE="-O20 -g -pg -fsigned-char -D_REENTRANT" 
Jack Moffitt's avatar
Jack Moffitt committed
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
		;;
        esac
fi

dnl Checks for programs.

dnl Checks for libraries.

dnl IPV6
AC_SEARCH_LIBS(inet_pton, socket, AC_DEFINE(HAVE_IPV6, 1, [Define if you have IPV6 support]))
AC_SEARCH_LIBS(getipnodebyname, nsl,
  AC_DEFINE(HAVE_GETIPNODEBYNAME, 1, 
  [Define if you have the getipnodebyname function])
)

dnl Checks for header files.
AC_HEADER_STDC

74
AC_CHECK_HEADER(stdint.h, AC_DEFINE(HAVE_STDINT_H, 1),,)
75 76
AC_CHECK_HEADER(pwd.h, AC_DEFINE(CHUID, 1),,)
AC_CHECK_HEADER(unistd.h, AC_DEFINE(CHROOT, 1),,)
77

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

dnl Check for types

dnl Checks for library functions.

dnl -- configure options --

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
AC_ARG_WITH(xslt-config,
  [ --with-xslt-config=PATH  use xslt-config in PATH to find libxslt ],
  [if ! test -x "$with_xslt_config"
   then
     AC_MSG_ERROR([$with_xslt_config cannot be executed])
   fi
   XSLTCONFIG="$with_xslt_config"]
)
if test -z "$XSLTCONFIG"
then
  AC_CHECK_PROGS(XSLTCONFIG, [xslt-config])
fi
if test -n "$XSLTCONFIG"
then
  XSLT_LIBS="`$XSLTCONFIG --libs`"
  XSLT_CFLAGS="`$XSLTCONFIG --cflags`"
  save_LIBS="$LIBS"
  save_CFLAGS="$CFLAGS"
  LIBS="$LIBS $XSLT_LIBS"
  CFLAGS="$CFLAGS $XSLT_CFLAGS"
  AC_CHECK_FUNC(xsltParseStylesheetFile,, [AC_MSG_ERROR([There was a problem linking with libxslt])])
  LIBS="$save_LIBS"
  CFLAGS="$save_CFLAGS"
  save_LIBS=
  save_CFLAGS=
else
  AC_MSG_ERROR([xslt-config could not be found])
fi

Jack Moffitt's avatar
Jack Moffitt committed
116 117 118 119 120 121 122 123 124 125 126 127 128 129
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
Jack Moffitt's avatar
Jack Moffitt committed
130
  XML_LIBS="`$XMLCONFIG --libs`"
Jack Moffitt's avatar
Jack Moffitt committed
131
  XML_CFLAGS="`$XMLCONFIG --cflags`"
132
  save_LIBS="$LIBS"
Jack Moffitt's avatar
Jack Moffitt committed
133
  save_CFLAGS="$CFLAGS"
134
  LIBS="$LIBS $XML_LIBS"
Jack Moffitt's avatar
Jack Moffitt committed
135
  CFLAGS="$CFLAGS $XML_CFLAGS"
Jack Moffitt's avatar
Jack Moffitt committed
136
  AC_CHECK_FUNC(xmlParseFile,, [AC_MSG_ERROR([There was a problem linking with libxml])])
137
  LIBS="$save_LIBS"
Jack Moffitt's avatar
Jack Moffitt committed
138
  CFLAGS="$save_CFLAGS"
139
  save_LIBS=
Jack Moffitt's avatar
Jack Moffitt committed
140
  save_CFLAGS=
Jack Moffitt's avatar
Jack Moffitt committed
141 142 143 144
else
  AC_MSG_ERROR([xml-config could not be found])
fi

Jack Moffitt's avatar
Jack Moffitt committed
145 146
AM_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!))
AM_PATH_VORBIS(, AC_MSG_ERROR(must have Vorbis installed!))
Jack Moffitt's avatar
Jack Moffitt committed
147 148 149

dnl Make substitutions

150
AC_SUBST(XSLT_CFLAGS)
Jack Moffitt's avatar
Jack Moffitt committed
151 152 153
AC_SUBST(XML_CFLAGS)
AC_SUBST(OGG_CFLAGS)
AC_SUBST(VORBIS_CFLAGS)
154
AC_SUBST(XSLT_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
155 156 157 158
AC_SUBST(XML_LIBS)
AC_SUBST(OGG_LIBS)
AC_SUBST(VORBIS_LIBS)
AC_SUBST(SOCKET_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
159 160 161 162 163 164 165
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(OPT)
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(CFLAGS)
AC_SUBST(PROFILE)

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