1dnl (PD) 2001 The Bitzi Corporation
2dnl Please see file COPYING or http://bitzi.com/publicdomain
3dnl for more info.
4dnl
5dnl $Id: configure.in,v 1.18 2004/02/03 01:25:53 mayhemchaos Exp $
6AC_INIT(src/bitcollider.c)
7VERSION="0.6.0"
8AM_INIT_AUTOMAKE(bitcollider, "$VERSION")
9
10CFLAGS="-Wall -g -O3"
11
12dnl Canonicalize host.
13AC_CANONICAL_HOST
14case "${host_cpu}-${host_os}" in
15  *-beos*)    os=beos; LIBS='-lbe -lroot' ;;
16  *-cygwin*)  os=cygwin; LIBS='-lwinmm' ;;
17  *-freebsd*) os=freebsd ;;
18  *-darwin*)  os=darwin ;;
19  *-irix*)    os=irix; CXXFLAGS="$CFLAGS -fsquangle";
20                       LIBS='-lcdaudio -lmediad -lds' ;;
21  *-linux*)   os=linux ;;
22  *-netbsd*)  os=netbsd ;;
23  *-openbsd*) os=openbsd ;;
24  *-os2_emx*) os=os2 ;;
25  *-solaris*) os=solaris; LIBS='-lsocket -lnsl' ;;
26  *-qnx*)     os=qnx; LIBS='-lsocket' ;;
27  *)          AC_MSG_RESULT([WARNING: unknown system]) ;;
28esac
29if test x$os = xdarwin; then
30    AC_DEFINE(DARWIN, 1, Are we on Darwin?)
31else
32    AC_DEFINE(DARWIN, 0, Are we on Darwin?)
33fi
34AC_SUBST(DARWIN)
35
36dnl Checks for programs.
37AC_PROG_AWK
38AC_PROG_CC
39AC_LIBLTDL_CONVENIENCE
40AC_SUBST(INCLTDL)
41AC_SUBST(LIBLTDL)
42AC_LIBTOOL_DLOPEN
43AM_PROG_LIBTOOL
44AC_SUBST(LIBTOOL_DEPS)
45AC_PROG_INSTALL
46AC_C_BIGENDIAN
47AC_CHECK_SIZEOF(long)
48
49dnl Checks for libraries.
50
51dnl Checks for header files.
52
53dnl Checks for typedefs, structures, and compiler characteristics.
54
55dnl AC_CHECK_LIB(db, db_create, have_db="yes", have_db="no")
56dnl if test "$have_db" = "yes"; then
57dnl      AC_DEFINE(USE_BDB, 1, "[Berkeley DB Support]")
58dnl      BDB_LIBS="-ldb"
59dnl      AC_SUBST(BDB_LIBS)
60dnl      AC_MSG_RESULT([compiling caching support])
61dnl fi
62BDB_LIBS=""
63AC_SUBST(BDB_LIBS)
64
65AC_CHECK_LIB(ogg, ogg_sync_init, have_ogg="yes", have_ogg="no")
66AC_CHECK_LIB(vorbisfile, ov_info, have_vorbis="yes",have_vorbis="no",
67             -lvorbis -logg)
68
69VORBIS_SUB=""
70if test "$have_ogg" = "yes"; then
71  if test "$have_vorbis" = "yes"; then
72     AC_DEFINE(USE_VORBIS, 1, "[ogg/vorbis support]")
73     VORBIS_LIBS="-lvorbisfile -lvorbis -logg"
74     VORBIS_SUB="vorbis"
75     AC_SUBST(VORBIS_LIBS)
76     AC_MSG_RESULT([compiling ogg/vorbis support])
77  fi
78fi
79AC_SUBST(VORBIS_SUB)
80
81if test "${prefix}" = "NONE"; then
82  prefix="/usr/local"
83fi
84
85AC_SUBST(CFLAGS)
86AC_DEFINE_UNQUOTED(PREFIX, "${prefix}", "PREFIX")
87AM_CONFIG_HEADER(config.h)
88AC_CONFIG_SUBDIRS(libltdl)
89AC_OUTPUT(Makefile lib/Makefile src/Makefile vorbis/Makefile wav/Makefile image/Makefile video/Makefile, echo timestamp > stamp-h)
90