2003-04-21 10:17:50 +00:00
|
|
|
AC_REVISION([$Id: configure.ac,v 1.15 2003/04/21 10:17:50 hvr Exp $])dnl
|
2003-03-24 19:01:09 +00:00
|
|
|
AC_INIT(lib/cdio.c)
|
|
|
|
|
AM_CONFIG_HEADER(config.h)
|
2003-04-19 19:12:06 +00:00
|
|
|
AM_INIT_AUTOMAKE(libcdio, 0.3)
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
|
|
|
AM_SANITY_CHECK
|
|
|
|
|
|
2003-03-30 01:11:56 +00:00
|
|
|
AC_ARG_WITH(cdinfo,
|
2003-03-30 01:31:06 +00:00
|
|
|
[ --without-cdinfo build sample program cdinfo (enabled by default)],
|
|
|
|
|
enable_cdinfo="${withval}", enable_cdinfo=yes)
|
2003-03-30 01:11:56 +00:00
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
dnl Checks for programs.
|
|
|
|
|
AC_PROG_CC
|
|
|
|
|
|
|
|
|
|
if test "x$GCC" != "xyes"
|
|
|
|
|
then
|
|
|
|
|
echo "*** non GNU CC compiler detected."
|
|
|
|
|
echo "*** This package has not been tested very well with non GNU compilers"
|
|
|
|
|
echo "*** you should try to use 'gcc' for compiling this package."
|
|
|
|
|
else
|
|
|
|
|
WARN_CFLAGS="-Wall -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -Wunused -Wpointer-arith -Wwrite-strings -Wnested-externs -Wsign-promo -Wno-sign-compare"
|
|
|
|
|
|
|
|
|
|
for WOPT in $WARN_CFLAGS; do
|
|
|
|
|
SAVE_CFLAGS="$CFLAGS"
|
|
|
|
|
CFLAGS="$CFLAGS $WOPT"
|
|
|
|
|
AC_MSG_CHECKING([whether $CC understands $WOPT])
|
|
|
|
|
AC_TRY_COMPILE([], [], has_option=yes, has_option=no,)
|
|
|
|
|
CFLAGS="$SAVE_CFLAGS"
|
|
|
|
|
AC_MSG_RESULT($has_option)
|
|
|
|
|
if test $has_option = yes; then
|
|
|
|
|
warning_flags="$warning_flags $option"
|
|
|
|
|
fi
|
|
|
|
|
unset has_option
|
|
|
|
|
unset SAVE_CFLAGS
|
|
|
|
|
done
|
|
|
|
|
WARNING_FLAGS="$warning_flags"
|
|
|
|
|
unset warning_flags
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
dnl We use a perl for documentation and regression tests
|
|
|
|
|
AC_PATH_PROG(PERL, perl, no)
|
|
|
|
|
AC_SUBST(PERL)dnl
|
|
|
|
|
|
2003-03-30 01:11:56 +00:00
|
|
|
AM_PATH_LIBPOPT(, [enable_cdinfo=no])
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
|
|
|
dnl headers
|
|
|
|
|
|
|
|
|
|
AC_STDC_HEADERS
|
|
|
|
|
AC_CHECK_HEADERS(stdint.h inttypes.h stdbool.h)
|
|
|
|
|
|
2003-04-14 04:29:24 +00:00
|
|
|
AC_CHECK_HEADER(cddb/cddb.h, ,
|
|
|
|
|
[ AC_MSG_RESULT([*** CDDB support be disabled from cdinfo program])
|
|
|
|
|
enable_cddb=no ],
|
|
|
|
|
)
|
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
dnl compiler
|
|
|
|
|
AC_C_BIGENDIAN
|
|
|
|
|
AC_C_CONST
|
|
|
|
|
AC_C_INLINE
|
|
|
|
|
|
|
|
|
|
dnl ISOC99_PRAGMA
|
|
|
|
|
AC_MSG_CHECKING([whether $CC supports ISOC99 _Pragma()])
|
|
|
|
|
AC_TRY_COMPILE([],[_Pragma("pack(1)")], [
|
|
|
|
|
ISOC99_PRAGMA=yes
|
|
|
|
|
AC_DEFINE(HAVE_ISOC99_PRAGMA, [], [Supports ISO _Pragma() macro])
|
|
|
|
|
],ISOC99_PRAGMA=no)
|
|
|
|
|
AC_MSG_RESULT($ISOC99_PRAGMA)
|
|
|
|
|
|
|
|
|
|
dnl empty_array_size
|
|
|
|
|
AC_MSG_CHECKING([how to create empty arrays])
|
|
|
|
|
|
|
|
|
|
empty_array_size="xxx"
|
|
|
|
|
AC_TRY_COMPILE([],[struct { int foo; int bar[]; } doo;], empty_array_size="")
|
|
|
|
|
|
|
|
|
|
if test "x$empty_array_size" = "xxxx";then
|
|
|
|
|
AC_TRY_COMPILE([],[struct { int foo; int bar[0]; } doo;], empty_array_size="0")
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test "x$empty_array_size" = "xxxx"
|
|
|
|
|
then
|
|
|
|
|
AC_MSG_ERROR([compiler is unable to creaty empty arrays])
|
|
|
|
|
else
|
|
|
|
|
AC_DEFINE_UNQUOTED(EMPTY_ARRAY_SIZE, $empty_array_size,
|
|
|
|
|
[what to put between the brackets for empty arrays])
|
|
|
|
|
changequote(`,')
|
|
|
|
|
msg="[${empty_array_size}]"
|
|
|
|
|
changequote([,])
|
|
|
|
|
AC_MSG_RESULT($msg)
|
|
|
|
|
fi
|
|
|
|
|
dnl empty_array_size
|
|
|
|
|
|
|
|
|
|
dnl bitfield order
|
|
|
|
|
AC_MSG_CHECKING(bitfield ordering in structs)
|
|
|
|
|
AC_TRY_RUN([
|
|
|
|
|
int
|
|
|
|
|
main() {
|
|
|
|
|
struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; }
|
|
|
|
|
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
|
|
|
|
__attribute__((packed))
|
|
|
|
|
#endif
|
|
|
|
|
bf = { 1,1,1,1 };
|
|
|
|
|
if (sizeof (bf) != 1) return 1;
|
|
|
|
|
return *((unsigned char*) &bf) != 0x4b; }
|
|
|
|
|
], bf_lsbf=1, AC_TRY_RUN([
|
|
|
|
|
int
|
|
|
|
|
main() {
|
|
|
|
|
struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; }
|
|
|
|
|
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
|
|
|
|
__attribute__((packed))
|
|
|
|
|
#endif
|
|
|
|
|
bf = { 1,1,1,1 };
|
|
|
|
|
if (sizeof (bf) != 1) return 1;
|
|
|
|
|
return *((unsigned char*) &bf) != 0xa5; }
|
|
|
|
|
], bf_lsbf=0, AC_MSG_ERROR([unsupported bitfield ordering])))
|
|
|
|
|
if test "x$bf_lsbf" = "x1"; then
|
|
|
|
|
AC_MSG_RESULT(LSBF)
|
|
|
|
|
AC_DEFINE(BITFIELD_LSBF, [], [compiler does lsbf in struct bitfields])
|
|
|
|
|
else
|
|
|
|
|
AC_MSG_RESULT(MSBF)
|
|
|
|
|
fi
|
|
|
|
|
dnl
|
|
|
|
|
|
|
|
|
|
dnl system
|
|
|
|
|
AC_CYGWIN
|
|
|
|
|
|
|
|
|
|
LIBS="$LIBS -lm"
|
|
|
|
|
CFLAGS="$CFLAGS $WARN_CFLAGS"
|
|
|
|
|
|
|
|
|
|
AM_CONDITIONAL(CYGWIN, test "x$CYGWIN" = "xyes")
|
2003-03-30 01:11:56 +00:00
|
|
|
AM_CONDITIONAL(BUILD_CDINFO, test "x$enable_cdinfo" = "xyes")
|
2003-03-29 17:32:00 +00:00
|
|
|
AM_CONDITIONAL(BUILD_CDINFO_LINUX, test "x$enable_cdinfo_linux" = "xyes")
|
|
|
|
|
AM_CONDITIONAL(BUILD_CDIOTEST, test "x$enable_cdiotest" = "xyes")
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
|
|
|
AM_PROG_LIBTOOL
|
|
|
|
|
|
|
|
|
|
dnl Checks for header files.
|
|
|
|
|
AC_STDC_HEADERS
|
|
|
|
|
|
|
|
|
|
AC_HAVE_HEADERS( stdbool.h stdlib.h stdint.h stdio.h string.h strings.h linux/version.h sys/cdio.h sys/stat.h sys/types.h )
|
|
|
|
|
|
2003-04-19 08:29:13 +00:00
|
|
|
LIBCDIO_CFLAGS='-I$(top_srcdir)/lib/ -I$(top_srcdir)/include/ -I$(top_srcdir)/include/cdio'
|
2003-03-24 19:01:09 +00:00
|
|
|
LIBCDIO_LIBS='$(top_builddir)/lib/libcdio.la'
|
|
|
|
|
AC_SUBST(LIBCDIO_CFLAGS)
|
|
|
|
|
AC_SUBST(LIBCDIO_LIBS)
|
|
|
|
|
|
2003-03-30 01:31:06 +00:00
|
|
|
ACLOCAL_AMFLAGS='-I .'
|
|
|
|
|
AC_SUBST(ACLOCAL_AMFLAGS)
|
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
case $host_os in
|
|
|
|
|
linux*)
|
|
|
|
|
AC_CHECK_HEADERS(linux/version.h)
|
|
|
|
|
AC_CHECK_HEADERS(linux/cdrom.h, [have_linux_cdrom_h="yes"])
|
|
|
|
|
if test "x$have_linux_cdrom_h" = "xyes" ; then
|
|
|
|
|
AC_TRY_COMPILE(,[
|
|
|
|
|
#include <linux/cdrom.h>
|
|
|
|
|
struct cdrom_generic_command test;
|
|
|
|
|
int has_timeout=sizeof(test.timeout);],
|
|
|
|
|
[AC_DEFINE([HAVE_LINUX_CDROM_TIMEOUT], [1],
|
|
|
|
|
[Define 1 if timeout is in cdrom_generic_command struct])])
|
|
|
|
|
AC_DEFINE([HAVE_LINUX_CDROM], [1],
|
|
|
|
|
[Define 1 if you have Linux-type CD-ROM support])
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
bsdi*)
|
2003-03-30 12:59:37 +00:00
|
|
|
AC_CHECK_HEADERS(dvd.h, [have_bsdi_dvd_h="yes"])
|
|
|
|
|
if test "x$have_bsdi_dvd_h" = "xyes" ; then
|
|
|
|
|
AC_DEFINE([HAVE_BSDI_CDROM], [1],
|
|
|
|
|
[Define 1 if you have BSDI-type CD-ROM support])
|
|
|
|
|
LIBS="$LIBS -ldvd"
|
|
|
|
|
fi
|
2003-03-24 19:01:09 +00:00
|
|
|
;;
|
|
|
|
|
sunos*|sun*|solaris*)
|
|
|
|
|
AC_CHECK_HEADERS(sys/cdio.h)
|
|
|
|
|
AC_DEFINE([HAVE_SOLARIS_CDROM], [1],
|
|
|
|
|
[Define 1 if you have Solaris CD-ROM support])
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
AC_MSG_WARN(Don't have OS CD-reading support for ${host_os}...)
|
|
|
|
|
AC_MSG_WARN(Will use generic support.)
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
AC_SUBST(LINUX_CDROM_TIMEOUT)
|
|
|
|
|
AC_SUBST(HAVE_LINUX_CDROM)
|
|
|
|
|
AC_SUBST(HAVE_BSDI_CDROM)
|
|
|
|
|
AC_SUBST(HAVE_SOLARIS_CDROM)
|
|
|
|
|
|
2003-04-14 04:29:24 +00:00
|
|
|
if test x$enable_cddb = x; then
|
|
|
|
|
AC_ARG_ENABLE(cddb,
|
|
|
|
|
[ --disable-cddb don't include CDDB lookups in cdinfo],
|
|
|
|
|
enable_cddb=no,
|
|
|
|
|
enable_cddb=yes)
|
|
|
|
|
fi
|
|
|
|
|
if test x$enable_cddb = xyes; then
|
|
|
|
|
AC_CHECK_LIB(cddb, cddb_disc_calc_discid,
|
|
|
|
|
[ CDDB_LIB="-lcddb"; ac_have_cddb=yes ])
|
2003-04-20 01:39:23 +00:00
|
|
|
dnl AC_DEFINE([HAVE_CDDB],[],
|
|
|
|
|
dnl [Define this if you have libcddb installed])
|
|
|
|
|
AC_TRY_COMPILE([#include <cddb/cddb.h>],[
|
|
|
|
|
cddb_conn_t *conn;
|
|
|
|
|
cddb_http_enable(conn);
|
|
|
|
|
], [
|
|
|
|
|
HAVE_CDDB=yes
|
|
|
|
|
AC_DEFINE(HAVE_CDDB, [], [Define this if you have libcddb installed])
|
|
|
|
|
],
|
|
|
|
|
AC_MSG_WARN(libcddb library might not be new enough; need version 0.90 or greater),
|
|
|
|
|
HAVE_CDDB=no)
|
2003-04-14 04:29:24 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AC_SUBST(CDDB_LIB)
|
|
|
|
|
|
2003-04-20 15:34:31 +00:00
|
|
|
AC_CONFIG_COMMANDS([checks],
|
2003-04-20 17:24:48 +00:00
|
|
|
[chmod +x tests/check_cue.sh
|
2003-04-20 15:34:31 +00:00
|
|
|
])
|
2003-04-19 00:50:39 +00:00
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
AC_OUTPUT([ \
|
|
|
|
|
Makefile \
|
2003-04-21 10:17:50 +00:00
|
|
|
libcdio.pc \
|
2003-04-19 08:29:13 +00:00
|
|
|
include/Makefile \
|
|
|
|
|
include/cdio/Makefile \
|
2003-04-19 19:12:06 +00:00
|
|
|
include/cdio/cdio.h \
|
2003-03-24 19:01:09 +00:00
|
|
|
lib/Makefile \
|
|
|
|
|
src/Makefile \
|
2003-04-20 15:34:31 +00:00
|
|
|
tests/check_cue.sh \
|
2003-03-24 19:01:09 +00:00
|
|
|
tests/Makefile \
|
|
|
|
|
])
|
2003-04-14 10:03:27 +00:00
|
|
|
|