2012-01-17 11:32:05 -05:00
dnl Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012
2008-03-16 00:12:42 +00:00
dnl Rocky Bernstein <rocky@gnu.org>
2003-04-25 21:26:47 +00:00
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
2006-03-17 19:36:54 +00:00
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
dnl 02110-1301 USA.
2003-04-25 21:26:47 +00:00
2011-11-24 21:09:31 -05:00
define(RELEASE_NUM, 84)
define(CDIO_VERSION_STR, 0.$1git)
2004-03-20 12:41:23 +00:00
2011-10-21 15:32:57 -04:00
AC_PREREQ(2.67)
2005-02-01 00:31:53 +00:00
2010-03-23 16:20:35 -04:00
AC_INIT([libcdio], [CDIO_VERSION_STR(RELEASE_NUM)], [libcdio-help@gnu.org])
2010-02-09 03:02:28 -05:00
AC_CONFIG_SRCDIR(src/cd-info.c)
2012-01-25 23:28:41 -05:00
AM_INIT_AUTOMAKE([foreign])
2004-10-23 20:55:08 +00:00
2004-02-27 02:35:24 +00:00
AC_CANONICAL_HOST
2003-09-22 01:05:15 +00:00
AM_CONFIG_HEADER(config.h)
2008-06-16 22:36:09 +00:00
AC_CONFIG_MACRO_DIR([m4])
2003-09-22 01:05:15 +00:00
2012-01-17 11:32:05 -05:00
# Enable silent build rules by default (Automake v1.11 or later).
# Disable by either passing --disable-silent-rules to configure or passing V=1 to make
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
[AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2006-11-27 19:31:37 +00:00
LIBCDIO_VERSION_NUM=`echo RELEASE_NUM | cut -d . -f 1 | tr -d a-z`
2004-03-20 12:41:23 +00:00
AC_SUBST(LIBCDIO_VERSION_NUM)
2003-09-22 01:05:15 +00:00
AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
2008-12-06 20:04:23 -05:00
AM_MISSING_PROG(GIT2CL, git2cl, $missing_dir)
2003-09-22 01:05:15 +00:00
AM_MAINTAINER_MODE
2003-03-24 19:01:09 +00:00
AM_SANITY_CHECK
2008-06-19 13:41:40 +00:00
AC_ARG_WITH(cd-drive,
2010-03-23 16:20:35 -04:00
AC_HELP_STRING([--without-cd-drive], [don't build program cd-drive (default with)]),
2004-12-18 21:24:25 +00:00
enable_cd_drive="${withval}", enable_cd_drive=yes)
2008-06-19 13:41:40 +00:00
AC_ARG_WITH(cd-info,
2010-03-23 16:20:35 -04:00
AC_HELP_STRING([--without-cd-info], [don't build program cd-info (default with)]),
2003-09-19 04:39:50 +00:00
enable_cd_info="${withval}", enable_cd_info=yes)
2008-06-19 13:41:40 +00:00
AC_ARG_WITH(cdda-player,
2010-03-23 16:20:35 -04:00
AC_HELP_STRING([--without-cdda-player], [don't build program cdda-player (default with)]),
2005-03-09 03:39:46 +00:00
enable_cdda_player="${withval}", enable_cdda_player=yes)
2008-06-19 13:41:40 +00:00
AC_ARG_WITH(cd-read,
2010-03-23 16:20:35 -04:00
AC_HELP_STRING([--without-cd-read], [don't build program cd-read (default with)]),
2003-09-19 04:39:50 +00:00
enable_cd_read="${withval}", enable_cd_read=yes)
2003-03-30 01:11:56 +00:00
2008-06-19 13:41:40 +00:00
AC_ARG_WITH(iso-info,
2010-03-23 16:20:35 -04:00
AC_HELP_STRING([--without-iso-info], [don't build program iso-info (default with)]),
2004-12-18 21:24:25 +00:00
enable_iso_info="${withval}", enable_iso_info=yes)
2008-06-19 13:41:40 +00:00
AC_ARG_WITH(iso-read,
2010-03-23 16:20:35 -04:00
AC_HELP_STRING([--without-iso-read], [don't build program iso-read (default with)]),
2004-12-18 21:24:25 +00:00
enable_iso_read="${withval}", enable_iso_read=yes)
2008-06-19 13:41:40 +00:00
AC_ARG_WITH(versioned-libs,
2010-03-23 16:20:35 -04:00
AC_HELP_STRING([--without-versioned-libs], [build versioned library symbols (default enabled if you have GNU ld)]),
2004-02-27 02:35:24 +00:00
enable_versioned_libs="${withval}", enable_versioned_libs=yes)
2006-03-30 10:47:51 +00:00
AC_ARG_ENABLE([cxx],
AC_HELP_STRING([--disable-cxx], [Disable C++ bindings (default enabled)]))
AM_CONDITIONAL([ENABLE_CXX_BINDINGS], [test "x$enable_cxx" != "xno"])
2005-09-15 06:36:01 +00:00
2008-06-19 13:41:40 +00:00
AC_ARG_ENABLE(cpp-progs,
2010-03-23 16:20:35 -04:00
AC_HELP_STRING([--enable-cpp-progs], [make C++ example programs (default enabled)]))
2012-02-24 05:16:13 -05:00
AM_CONDITIONAL(ENABLE_CPP, test "x$enable_cpp_progs" = "xyes")
2004-10-28 11:13:40 +00:00
2008-06-19 13:41:40 +00:00
AC_ARG_ENABLE(example-progs,
2008-06-14 22:41:29 +00:00
AC_HELP_STRING([--disable-example-progs], [Don't build libcdio sample programs]))
2008-01-01 03:14:17 +00:00
AM_CONDITIONAL(BUILD_EXAMPLES, test "x$enable_example_progs" != "xno")
2004-11-22 01:03:52 +00:00
dnl We use C
AC_PROG_CC
2007-10-15 04:53:59 +00:00
AM_PROG_CC_C_O
2006-03-30 10:47:51 +00:00
dnl We also use C++ in example programs and for CXX bindings
2004-11-22 01:03:52 +00:00
AC_PROG_CXX
2004-10-28 11:13:40 +00:00
2003-03-24 19:01:09 +00:00
dnl Checks for programs.
2004-11-07 19:26:03 +00:00
AC_AIX
2003-03-24 19:01:09 +00:00
2004-05-04 12:06:40 +00:00
cd_drivers='cdrdao, BIN/CUE, NRG'
2003-06-10 01:19:15 +00:00
2012-02-24 05:16:13 -05:00
if test "x$GCC" != "xyes"; then
2010-03-23 16:20:35 -04:00
AC_MSG_WARN([
*** non GNU CC compiler detected.
*** This package has not been tested very well with non GNU compilers
*** you should try to use 'gcc' for compiling this package.])
2003-03-24 19:01:09 +00:00
else
2003-09-01 22:50:25 +00:00
WARN_CFLAGS="-Wall -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -Wunused -Wpointer-arith -Wwrite-strings -Wnested-externs -Wno-sign-compare"
2003-03-24 19:01:09 +00:00
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)
2012-02-24 05:16:13 -05:00
if test "x$has_option" = "xyes"; then
2003-03-24 19:01:09 +00:00
warning_flags="$warning_flags $option"
fi
unset has_option
unset SAVE_CFLAGS
done
WARNING_FLAGS="$warning_flags"
unset warning_flags
fi
2004-02-28 03:57:41 +00:00
# We use Perl for documentation and regression tests
2005-09-17 01:33:29 +00:00
AC_PATH_PROG(PERL, perl, false)
2003-06-08 13:08:37 +00:00
AC_SUBST(PERL)
2012-02-24 05:16:13 -05:00
AM_CONDITIONAL(HAVE_PERL, test "x$PERL" != "xfalse")
2003-06-08 13:08:37 +00:00
2004-02-28 03:57:41 +00:00
# We use a diff in regression testing
2003-06-08 13:08:37 +00:00
AC_PATH_PROG(DIFF, diff, no)
DIFF_OPTS=
2012-02-24 05:16:13 -05:00
if test "x$DIFF" = "xno"; then
2003-06-08 13:08:37 +00:00
AC_PATH_PROG(DIFF, cmp, no)
else
2004-02-28 03:57:41 +00:00
# Try for GNU diff options.
2003-06-08 13:08:37 +00:00
# MSDOG output uses \r\n rather than \n in tests
for diff_opt in -w --unified ; do
if $DIFF $diff_opt ./configure ./configure > /dev/null 2>&1; then
AC_MSG_RESULT([adding $diff_opt to diff in regression tests])
DIFF_OPTS="$DIFF_OPTS $diff_opt"
fi
done
fi
AC_SUBST(DIFF)
AC_SUBST(DIFF_OPTS)
2003-06-08 12:33:37 +00:00
2006-01-05 21:57:40 +00:00
dnl check for large file support
AC_SYS_LARGEFILE
dnl we need to define _FILE_OFFSET_BITS or _LARGE_FILES on the compiler command
dnl line because otherwise the system headers risk being included before
dnl problems
if test "x$ac_cv_sys_largefiles" = "xyes"; then
if test "x$ac_cv_sys_file_offset_bits" = "x64"; then
LIBCDIO_LARGEFILE_FLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES"
else
LIBCDIO_LARGEFILE_FLAGS="-D_LARGE_FILES"
fi
2012-02-24 05:16:13 -05:00
if test "x$ac_cv_sys_largefile_source" != "xno"; then
2006-01-05 21:57:40 +00:00
LIBCDIO_LARGEFILE_FLAGS="$LIBDDIO_LARGEFILE_FLAGS -D_LARGEFILE_SOURCE=$ac_cv_sys_largefile_source"
fi
CPPFLAGS="$CPPFLAGS $LIBCDIO_LARGEFILE_FLAGS"
fi
2005-03-19 06:42:22 +00:00
AC_DEFINE(LIBCDIO_CONFIG_H, 1,
[Is set when libcdio's config.h has been included. Applications wishing to sue their own config.h values (such as set by the application's configure script can define this before including any of libcdio's headers.])
2003-03-24 19:01:09 +00:00
dnl headers
2004-05-09 17:03:27 +00:00
AC_HEADER_STDC
2007-03-05 11:49:24 +00:00
AC_CHECK_HEADERS(errno.h fcntl.h glob.h limits.h pwd.h)
2008-12-07 06:40:51 -05:00
AC_CHECK_HEADERS(stdarg.h stdbool.h stdio.h sys/cdio.h sys/param.h \
sys/time.h sys/timeb.h sys/utsname.h)
2005-03-07 12:55:12 +00:00
2011-10-20 18:24:10 -04:00
# FreeBSD 4 has getopt in unistd.h. So we include that before
# getopt.h
2005-10-05 09:48:11 +00:00
AC_CHECK_HEADERS(unistd.h getopt.h)
2004-12-18 17:29:32 +00:00
AC_SUBST(SBPCD_H)
AC_SUBST(UCDROM_H)
AC_SUBST(TYPESIZES)
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)
2005-09-15 06:36:01 +00:00
##
## Check for S_ISSOCK() and S_ISLNK() macros
##
AC_MSG_CHECKING(for S_ISLNK() macro)
2009-10-29 10:16:55 -04:00
AC_LINK_IFELSE([AC_LANG_PROGRAM([
2005-09-15 06:36:01 +00:00
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
2008-11-27 21:09:51 +00:00
],[return S_ISLNK(0);])],
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_S_ISLNK, [], [Define this <sys/stat.h> defines S_ISLNK()]) ],
[ AC_MSG_RESULT(no) ])
2005-09-15 06:36:01 +00:00
2008-11-27 21:09:51 +00:00
AC_MSG_CHECKING([for S_ISSOCK() macro])
2009-10-29 10:16:55 -04:00
AC_LINK_IFELSE([AC_LANG_PROGRAM([
2005-09-15 06:36:01 +00:00
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
2008-11-27 21:09:51 +00:00
],[return S_ISSOCK(0);])],
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_S_ISSOCK, [], [Define this <sys/stat.h> defines S_ISSOCK()]) ],
[ AC_MSG_RESULT(no) ])
2005-09-15 06:36:01 +00:00
Patch from Peter Hartley to allow Cross-compiling to mingw32:
- MinGW doesn't have struct timespec, so udf_time.c doesn't compile
(changes lib/udf/udf_time.c, configure.ac, config.h.in)
- The configure test for bitfield ordering uses AC_TRY_RUN and thus
doesn't work when cross-compiling; use sneakiness to try and
determine it at compile time, falling back to the existing runtime
check if the sneakiness doesn't work
(changes configure.ac; tested on x86_64-linux-gnu and i586-mingw32
which are bf_lsbf=1, plus sparc64-linux-gnu which is bf_lsbf=0)
- The configure test for "extern long timezone" needlessly uses
AC_TRY_RUN when in fact AC_LINK_IFELSE is all we need to know, and
that latter works when cross-compiling
(changes configure.ac)
- MinGW sys/stat.h doesn't have the *GRP or *OTH macros, nor S_IFLNK
or S_IFSOCK, nor S_ISUID etc
(changes lib/udf/udf.c and lib/iso9660/xa.c)
- MinGW doesn't have <sys/wait.h>, so even the header-inclusion bit
of the Linux driver doesn't compile unless it's moved inside the
"ifdef HAVE_LINUX_CDROM"
(changes lib/driver/gnu_linux.c)
- Because the man pages cd-info.1 etc depend on the binaries themselves
(for help2man reasons), the configure options --without-cd-info etc
don't actually stop them being compiled. Fixed by only depending on
man pages for programs that are actually built, which also stops
the installation of man pages of programs which aren't themselves
installed
(changes src/Makefile.am)
2008-04-24 07:28:00 +00:00
AC_MSG_CHECKING([for struct timespec])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
],[struct timespec ts;])],
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRUCT_TIMESPEC, [], [Define this if you have struct timespec]) ],
[ AC_MSG_RESULT(no) ])
2003-03-24 19:01:09 +00:00
dnl empty_array_size
AC_MSG_CHECKING([how to create empty arrays])
2008-11-25 02:20:17 +00:00
empty_array_size="xxxx"
2003-03-24 19:01:09 +00:00
AC_TRY_COMPILE([],[struct { int foo; int bar[]; } doo;], empty_array_size="")
2012-02-24 05:16:13 -05:00
if test "x$empty_array_size" = "xxxx"; then
2003-03-24 19:01:09 +00:00
AC_TRY_COMPILE([],[struct { int foo; int bar[0]; } doo;], empty_array_size="0")
fi
2012-02-24 05:16:13 -05:00
if test "x$empty_array_size" = "xxxx"; then
2003-03-24 19:01:09 +00:00
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
2008-06-25 08:01:53 +00:00
dnl Enable the creation of shared libraries under Win32.
AC_LIBTOOL_WIN32_DLL
2004-03-20 03:15:35 +00:00
dnl AM_PROG_LIBTOOL tests whether we have GNU ld
dnl this must come before checking --with-versioned-libs
dnl which requires GNU ld.
AM_PROG_LIBTOOL
2007-08-09 02:19:40 +00:00
2003-03-24 19:01:09 +00:00
dnl system
2003-06-07 01:20:40 +00:00
2004-11-07 19:26:03 +00:00
# FIXME:
# I believe some OS's require -lm, but I don't recall for what function
# When we find it, put it in below instead of "cos".
2005-09-21 01:09:08 +00:00
AC_CHECK_LIB(m, cos, [LIBS="$LIBS -lm"; COS_LIB="-lm"])
2003-03-24 19:01:09 +00:00
CFLAGS="$CFLAGS $WARN_CFLAGS"
2005-09-21 01:09:08 +00:00
AC_SUBST(COS_LIB)
2003-03-24 19:01:09 +00:00
2004-11-16 00:12:24 +00:00
# Do we have GNU ld? If we don't, we can't build versioned symbols.
2012-02-24 05:16:13 -05:00
if test "x$with_gnu_ld" != "xyes"; then
2004-11-16 00:12:24 +00:00
AC_MSG_WARN([I don't see GNU ld. I'm going to assume --without-versioned-libs])
enable_versioned_libs='no'
fi
# We also need GNU make to build versioned symbols.
2012-02-24 05:16:13 -05:00
if test "x$enable_versioned_libs" = "xyes"; then
2004-02-28 03:57:41 +00:00
if test -n "$MAKE" ; then
$MAKE --version 2>/dev/null >/dev/null
if test "$?" -ne 0 ; then
AC_MSG_ERROR(Either set MAKE variable to GNU make or use
--without-versioned-libs option)
fi
else
make --version 2>/dev/null >/dev/null
if test "$?" -ne 0 ; then
AC_MSG_ERROR(Either set MAKE variable to GNU make or use
--without-versioned-libs option)
fi
fi
fi
AM_CONDITIONAL(CYGWIN, test "x$CYGWIN" = "xyes")
2004-12-18 21:24:25 +00:00
AM_CONDITIONAL(BUILD_CD_DRIVE, test "x$enable_cd_drive" = "xyes")
2003-09-19 04:39:50 +00:00
AM_CONDITIONAL(BUILD_CDINFO, test "x$enable_cd_info" = "xyes")
2004-12-18 21:24:25 +00:00
AM_CONDITIONAL(BUILD_CD_READ, test "x$enable_cd_read" = "xyes")
AM_CONDITIONAL(BUILD_ISO_INFO, test "x$enable_iso_info" = "xyes")
AM_CONDITIONAL(BUILD_ISO_READ, test "x$enable_iso_read" = "xyes")
2003-09-19 04:39:50 +00:00
AM_CONDITIONAL(BUILD_CDINFO_LINUX, test "x$enable_cd_info_linux" = "xyes")
2003-03-29 17:32:00 +00:00
AM_CONDITIONAL(BUILD_CDIOTEST, test "x$enable_cdiotest" = "xyes")
2004-02-27 02:35:24 +00:00
AM_CONDITIONAL(BUILD_VERSIONED_LIBS, test "x$enable_versioned_libs" = "xyes")
2004-11-22 01:03:52 +00:00
AM_CONDITIONAL(DISABLE_CPP, test "x$disable_cpp" = "xyes")
2003-03-24 19:01:09 +00:00
dnl Checks for header files.
2004-12-18 17:29:32 +00:00
LIBCDIO_CDDA_LIBS='$(top_builddir)/lib/cdda_interface/libcdio_cdda.la'
2008-06-25 08:01:53 +00:00
LIBCDIO_CFLAGS='-I$(top_srcdir)/lib/driver -I$(top_builddir)/include -I$(top_srcdir)/include/'
2004-12-18 17:29:32 +00:00
LIBCDIO_LIBS='$(top_builddir)/lib/driver/libcdio.la'
2005-10-25 14:16:41 +00:00
LIBCDIO_DEPS="$LIBCDIO_LIBS"
2005-11-10 11:11:15 +00:00
LIBCDIOPP_LIBS='$(top_builddir)/lib/cdio++/libcdio++.la'
2006-03-06 01:34:22 +00:00
LIBISO9660PP_LIBS='$(top_builddir)/lib/cdio++/libiso9660++.la'
2005-03-02 12:49:28 +00:00
LIBISO9660_CFLAGS='-I$(top_srcdir)/lib/iso9660/'
2004-12-18 17:29:32 +00:00
LIBISO9660_LIBS='$(top_builddir)/lib/iso9660/libiso9660.la'
2005-10-23 12:56:40 +00:00
LIBUDF_CFLAGS='-I$(top_srcdir)/lib/udf/'
LIBUDF_LIBS='$(top_builddir)/lib/udf/libudf.la'
2004-12-18 17:29:32 +00:00
AC_SUBST(LIBCDIO_CDDA_LIBS)
2006-03-07 10:46:36 +00:00
AC_SUBST(LIBISO9660PP_LIBS)
2003-03-24 19:01:09 +00:00
AC_SUBST(LIBCDIO_LIBS)
2005-11-10 11:11:15 +00:00
AC_SUBST(LIBCDIOPP_LIBS)
2005-10-25 14:16:41 +00:00
AC_SUBST(LIBCDIO_DEPS)
2003-08-17 05:31:19 +00:00
AC_SUBST(LIBISO9660_LIBS)
2005-10-23 12:56:40 +00:00
AC_SUBST(LIBUDF_LIBS)
2003-03-24 19:01:09 +00:00
2008-06-25 08:01:53 +00:00
dnl Libtool flag for strict linkage
LT_NO_UNDEFINED=
2004-06-27 16:25:16 +00:00
case $host_os in
2004-12-15 01:45:15 +00:00
aix*)
2005-01-27 03:10:06 +00:00
## Don't use AIX driver until starts to really work
## cd_drivers="${cd_drivers}, AIX"
## AC_DEFINE([HAVE_AIX_CDROM], [1],
2012-03-03 08:26:48 -05:00
## [Define 1 if you have AIX CD-ROM support])
2004-12-15 01:45:15 +00:00
;;
2012-04-10 03:29:32 -04:00
darwin6*|darwin7*|darwin8*|darwin9*|darwin10*)
2003-09-15 12:05:10 +00:00
AC_CHECK_HEADERS(IOKit/IOKitLib.h CoreFoundation/CFBase.h,
[have_iokit_h="yes"])
if test "x$have_iokit_h" = "xyes" ; then
AC_DEFINE([HAVE_DARWIN_CDROM], [1],
2012-03-03 08:26:48 -05:00
[Define 1 if you have Darwin OS X-type CD-ROM support])
2005-10-25 14:16:41 +00:00
DARWIN_PKG_LIB_HACK="-Wl,-framework,CoreFoundation -Wl,-framework,IOKit"
2007-08-09 02:19:40 +00:00
dnl Prior to Mac OS X 10.4 (Tiger), DiskArbitration was a private framework.
dnl It's now public, and it's needed to do cd/dvd unmount/eject.
AC_MSG_CHECKING([for DiskArbitration framework])
ac_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation -framework DiskArbitration"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <DiskArbitration/DiskArbitration.h>]], [[]])],
[have_diskarbitration_framework=yes], [have_diskarbitration_framework=no])
LIBS="$ac_save_LIBS"
AC_MSG_RESULT([$have_diskarbitration_framework])
2012-02-24 05:16:13 -05:00
if test "x$have_diskarbitration_framework" = "xyes"; then
2012-03-03 08:26:48 -05:00
AC_DEFINE([HAVE_DISKARBITRATION], 1, [Define 1 if you have the Apple DiskArbitration framework])
2007-08-09 02:19:40 +00:00
DARWIN_PKG_LIB_HACK="$DARWIN_PKG_LIB_HACK -Wl,-framework,DiskArbitration"
fi
2012-04-10 03:29:32 -04:00
case $host_os in
darwin10*)
darwin_10=1
;;
*)
darwin_10=0
;;
esac
AC_DEFINE([DARWIN_10_OR_GREATER], [$darwin_10],
[Define 1 if you have Darwin OS X 10 or greater])
2005-10-25 14:16:41 +00:00
AC_SUBST(DARWIN_PKG_LIB_HACK)
LIBCDIO_LIBS="$LIBCDIO_LIBS $DARWIN_PKG_LIB_HACK"
2003-09-15 12:05:10 +00:00
cd_drivers="${cd_drivers}, Darwin"
fi
2003-09-13 06:25:36 +00:00
;;
2008-11-25 01:57:16 +00:00
linux*|uclinux)
2005-01-08 20:39:40 +00:00
AC_CHECK_HEADERS(linux/version.h linux/major.h)
2003-03-24 19:01:09 +00:00
AC_CHECK_HEADERS(linux/cdrom.h, [have_linux_cdrom_h="yes"])
2012-02-24 05:16:13 -05:00
if test "x$have_linux_cdrom_h" = "xyes"; then
2003-03-24 19:01:09 +00:00
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],
2012-03-03 08:26:48 -05:00
[Define 1 if timeout is in cdrom_generic_command struct])])
2003-06-10 01:19:15 +00:00
AC_DEFINE([HAVE_LINUX_CDROM], [1],
2012-03-03 08:26:48 -05:00
[Define 1 if you have Linux-type CD-ROM support])
2003-09-15 12:05:10 +00:00
cd_drivers="${cd_drivers}, GNU/Linux"
2003-03-24 19:01:09 +00:00
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],
2012-03-03 08:26:48 -05:00
[Define 1 if you have BSDI-type CD-ROM support])
2005-09-18 20:30:33 +00:00
LIBS="$LIBS -ldvd -lcdrom"
2005-03-03 10:34:14 +00:00
LIBCDIO_LIBS="$LIBCDIO_LIBS -lcdrom"
2003-09-15 12:05:10 +00:00
cd_drivers="${cd_drivers}, BSDI"
2003-03-30 12:59:37 +00:00
fi
2003-03-24 19:01:09 +00:00
;;
sunos*|sun*|solaris*)
AC_DEFINE([HAVE_SOLARIS_CDROM], [1],
2012-03-03 08:26:48 -05:00
[Define 1 if you have Solaris CD-ROM support])
2003-09-15 12:05:10 +00:00
cd_drivers="${cd_drivers}, Solaris"
2003-03-24 19:01:09 +00:00
;;
2003-06-07 08:53:16 +00:00
cygwin*)
AC_DEFINE([CYGWIN], [1],
2012-03-03 08:26:48 -05:00
[Define 1 if you are compiling using cygwin])
2003-06-10 01:19:15 +00:00
AC_DEFINE([HAVE_WIN32_CDROM], [1],
2012-03-03 08:26:48 -05:00
[Define 1 if you have MinGW CD-ROM support])
2004-03-10 11:53:10 +00:00
LIBS="$LIBS -lwinmm"
2008-12-28 23:09:25 -05:00
LT_NO_UNDEFINED="-no-undefined"
2003-09-15 12:05:10 +00:00
cd_drivers="${cd_drivers}, MinGW"
2005-10-27 03:03:42 +00:00
AC_DEFINE([NEED_TIMEZONEVAR], [1],
2012-03-03 08:26:48 -05:00
[Define 1 if you need timezone defined to get timzone
2005-10-27 03:03:42 +00:00
defined as a variable. In cygwin it is a function too])
2003-06-07 08:53:16 +00:00
;;
mingw*)
2008-06-25 08:01:53 +00:00
AC_CHECK_HEADERS(windows.h)
2003-06-07 08:53:16 +00:00
AC_DEFINE([MINGW32], [1],
2012-03-03 08:26:48 -05:00
[Define 1 if you are compiling using MinGW])
2012-02-24 05:16:13 -05:00
AC_DEFINE([HAVE_WIN32_CDROM], [1],
2012-03-03 08:26:48 -05:00
[Define 1 if you have MinGW CD-ROM support])
2012-02-24 05:16:13 -05:00
LIBS="$LIBS -lwinmm"
LT_NO_UNDEFINED="-no-undefined"
cd_drivers="${cd_drivers}, MinGW "
## Cross-platform LFS support in MinGW requires an override of off_t
if test "x$enable_largefile" != "xno"; then
AC_MSG_RESULT([enabling support for large files (_FILE_OFFSET_BITS=64)])
LIBCDIO_CFLAGS+=' -D_FILE_OFFSET_BITS=64 -D_OFF_T_DEFINED -D_OFF_T_ -D_off_t=off64_t -Doff_t=off64_t'
LIBISO9660_CFLAGS+=' -D_FILE_OFFSET_BITS=64 -D_OFF_T_DEFINED -D_OFF_T_ -D_off_t=off64_t -Doff_t=off64_t'
fi
joliet_supported="yes"
if test "x$enable_cdda_player" = "xyes"; then
AC_MSG_RESULT([disabling cdda_player (not supported on this platform)])
fi
enable_cdda_player="no"
2003-05-27 02:55:58 +00:00
;;
2011-12-15 23:42:14 -05:00
freebsd4.*|freebsd5.*|freebsd[6-9]*|dragonfly*|kfreebsd*)
2003-10-03 07:54:58 +00:00
AC_DEFINE([HAVE_FREEBSD_CDROM], [1],
2012-03-03 08:26:48 -05:00
[Define 1 if you have FreeBSD CD-ROM support])
2004-05-03 03:22:24 +00:00
LIBS="$LIBS -lcam"
2003-10-03 07:54:58 +00:00
cd_drivers="${cd_drivers}, FreeBSD "
;;
2008-03-27 17:40:50 +00:00
netbsd*)
AC_DEFINE([HAVE_NETBSD_CDROM], [1],
2012-03-03 08:26:48 -05:00
[Define 1 if you have NetBSD CD-ROM support])
2008-03-27 17:40:50 +00:00
# LIBS="$LIBS -lcam"
cd_drivers="${cd_drivers}, NetBSD "
;;
2009-02-08 05:52:49 -05:00
os2*)
AC_DEFINE([HAVE_OS2_CDROM], [1],
2012-03-03 08:26:48 -05:00
[Define 1 if you have OS/2 CD-ROM support])
2009-02-08 05:52:49 -05:00
LT_NO_UNDEFINED="-no-undefined"
LDFLAGS="$LDFLAGS -Zbin-files"
cd_drivers="${cd_drivers}, OS2 "
;;
2003-03-24 19:01:09 +00:00
*)
2004-10-28 11:13:40 +00:00
AC_MSG_WARN([Don't have OS CD-reading support for ${host_os}...])
AC_MSG_WARN([Will use generic support.])
2003-03-24 19:01:09 +00:00
;;
esac
2005-10-27 03:47:32 +00:00
2012-02-24 05:16:13 -05:00
AC_SUBST(LIBCDIO_CFLAGS)
AC_SUBST(LIBISO9660_CFLAGS)
2008-06-25 08:01:53 +00:00
AC_SUBST(LT_NO_UNDEFINED)
2005-10-27 03:47:32 +00:00
AC_MSG_CHECKING(extern long timezone variable)
2011-05-20 17:25:32 -04:00
AC_LINK_IFELSE([AC_LANG_SOURCE([[
2005-10-27 03:47:32 +00:00
#ifdef NEED_TIMEZONEVAR
#define timezonevar 1
#endif
#include <time.h>
extern long timezone;
int main(int argc, char **argv) {
long test_timezone = timezone;
return 0;
}
2011-05-20 17:25:32 -04:00
]])
2005-10-27 03:47:32 +00:00
], [AC_MSG_RESULT(yes);
AC_DEFINE([HAVE_TIMEZONE_VAR], 1,
[Define if you have an extern long timenzone variable.])],
[AC_MSG_RESULT(no)])
dnl
2003-03-24 19:01:09 +00:00
AC_SUBST(LINUX_CDROM_TIMEOUT)
2004-08-19 01:12:27 +00:00
AC_SUBST(DARWIN_PKG_LIB_HACK)
2003-03-24 19:01:09 +00:00
AC_SUBST(HAVE_BSDI_CDROM)
2003-10-03 07:54:58 +00:00
AC_SUBST(HAVE_DARWIN_CDROM)
AC_SUBST(HAVE_FREEBSD_CDROM)
AC_SUBST(HAVE_LINUX_CDROM)
2003-03-24 19:01:09 +00:00
AC_SUBST(HAVE_SOLARIS_CDROM)
2003-05-27 02:55:58 +00:00
AC_SUBST(HAVE_WIN32_CDROM)
2009-02-08 05:52:49 -05:00
AC_SUBST(HAVE_OS2_CDROM)
2003-03-24 19:01:09 +00:00
2004-10-24 11:20:30 +00:00
LIBCDIO_SOURCE_PATH="`pwd`"
2004-11-01 08:35:22 +00:00
AC_DEFINE_UNQUOTED(LIBCDIO_SOURCE_PATH, "$LIBCDIO_SOURCE_PATH",
2004-10-24 11:20:30 +00:00
[Full path to libcdio top_sourcedir.])
AC_SUBST(LIBCDIO_SOURCE_PATH)
2012-02-24 05:16:13 -05:00
AC_CHECK_FUNCS( [chdir drand48 fseeko fseeko64 ftruncate geteuid getgid \
getuid getpwuid gettimeofday lseek64 lstat memcpy memset rand \
seteuid setegid snprintf setenv strndup unsetenv tzset sleep \
_stati64 usleep vsnprintf readlink realpath gmtime_r localtime_r] )
2003-09-19 04:39:50 +00:00
2008-05-31 12:18:33 +00:00
# check for timegm() support
AC_CHECK_FUNC(timegm, AC_DEFINE(HAVE_TIMEGM,1,
2012-03-03 08:26:48 -05:00
[Define 1 if timegm is available]))
2008-05-31 12:18:33 +00:00
2003-09-21 07:43:39 +00:00
AC_CHECK_MEMBER([struct tm.tm_gmtoff],
[AC_DEFINE(HAVE_TM_GMTOFF, 1,
[Define if struct tm has the tm_gmtoff member.])],
,
[#include <time.h>])
2012-02-24 05:16:13 -05:00
if test "x$ac_cv_member_struct_tm_tm_gmtoff" = "xyes"; then
2004-10-30 00:38:43 +00:00
AC_MSG_CHECKING([whether time.h defines daylight and timezone variables])
2008-11-27 21:09:51 +00:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
2004-10-30 00:38:43 +00:00
#include <time.h>
2008-11-27 21:09:51 +00:00
],[return (timezone != 0) + daylight;])],
[AC_DEFINE(HAVE_DAYLIGHT, 1,
2004-10-30 00:38:43 +00:00
[Define if time.h defines extern long timezone and int daylight vars.])
has_daylight=yes
],[has_daylight=no])
2004-10-30 02:55:17 +00:00
AC_MSG_RESULT($has_daylight)
2008-11-27 21:09:51 +00:00
2004-10-30 02:55:17 +00:00
AC_MSG_CHECKING([whether time.h defines tzname variable])
2008-11-27 21:09:51 +00:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
2004-10-30 02:55:17 +00:00
#include <time.h>
2008-11-27 21:09:51 +00:00
],[return (tzname != NULL);])],
[AC_DEFINE(HAVE_TZNAME, 1,
2004-10-30 02:55:17 +00:00
[Define if time.h defines extern extern char *tzname[2] variable])
has_tzname=yes
],[has_tzname=no])
AC_MSG_RESULT($has_tzname)
2004-10-30 00:38:43 +00:00
fi
2004-10-28 11:13:40 +00:00
AC_ARG_ENABLE(joliet,
2007-11-16 13:52:55 +00:00
AS_HELP_STRING([--disable-joliet], [don't include Joliet extension support (default enabled)]),
[enable_joliet=$enableval],
[enable_joliet=yes])
2012-02-24 05:16:13 -05:00
if test "x${enable_joliet}" != "xno"; then
2004-10-28 11:13:40 +00:00
AM_ICONV
2004-10-31 13:58:44 +00:00
AM_LANGINFO_CODESET
2012-02-24 05:16:13 -05:00
if test "x$am_cv_func_iconv" = "xyes"; then
joliet_supported="yes"
fi
if test "x$joliet_supported" = "xyes"; then
2004-10-31 03:10:25 +00:00
AC_DEFINE(HAVE_JOLIET, [1],
2012-03-03 08:26:48 -05:00
[Define 1 if you want ISO-9660 Joliet extension support.
2012-03-04 14:12:09 -05:00
On most platforms, this requires libiconv to be installed.])
2005-02-18 23:49:45 +00:00
HAVE_JOLIET=1
2004-10-28 11:13:40 +00:00
else
2006-10-27 10:43:32 +00:00
AC_MSG_ERROR([You must have iconv installed.])
2004-10-28 11:13:40 +00:00
fi
fi
2004-11-07 19:26:03 +00:00
AC_SUBST(HAVE_JOLIET)
2004-10-28 11:13:40 +00:00
2010-03-23 16:20:35 -04:00
AC_ARG_ENABLE(rock,
AC_HELP_STRING([--enable-rock], [include Rock-Ridge extension support (default enabled)]),
enable_rock=$enableval, enable_rock=no)
2012-02-24 05:16:13 -05:00
if test "x${enable_rock}" != "xno"; then
2005-09-15 06:36:01 +00:00
AC_DEFINE(HAVE_ROCK, [1],
2012-03-03 08:26:48 -05:00
[Define 1 if you want ISO-9660 Rock-Ridge extension support.])
2005-09-15 06:36:01 +00:00
HAVE_ROCK=1
fi
AC_SUBST(HAVE_ROCK)
2012-02-24 05:16:13 -05:00
AM_CONDITIONAL(ENABLE_ROCK, test "x$enable_rock" = "xyes")
2005-09-15 06:36:01 +00:00
2010-03-23 16:20:35 -04:00
AC_ARG_ENABLE(cddb,
AC_HELP_STRING([--enable-cddb], [include CDDB lookups in cd_info (default enabled)]),
enable_cddb=$enableval, enable_cddb=check)
2012-02-24 05:16:13 -05:00
if test "x$enable_cddb" != "xno"; then
2005-09-15 06:36:01 +00:00
PKG_CHECK_MODULES(CDDB, libcddb >= 1.0.1, [
2003-04-20 01:39:23 +00:00
HAVE_CDDB=yes
AC_DEFINE(HAVE_CDDB, [], [Define this if you have libcddb installed])
],
2004-10-28 11:13:40 +00:00
[AC_MSG_WARN([new enough libcddb not found. CDDB access disabled. Get libcddb from http://libcddb.sourceforge.net])
2003-06-01 21:05:45 +00:00
HAVE_CDDB=no])
2003-05-20 08:10:45 +00:00
AC_CHECK_LIB(socket, connect)
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname))
2003-04-14 04:29:24 +00:00
fi
2003-09-01 02:07:52 +00:00
AC_SUBST(CDDB_LIBS)
2003-04-14 04:29:24 +00:00
2012-02-24 05:16:13 -05:00
# We have to disable cdda_player unless we have either ncurses.h or
# curses.h
have_ncurses_h='no'
if test "x$enable_cdda_player" = "xyes"; then
enable_cdda_player='no'
AC_CHECK_HEADERS(ncurses.h,
[enable_cdda_player='yes'; have_ncurses_h='yes'],
[AC_CHECK_HEADERS(curses.h,
[enable_cdda_player='yes'],
[AC_CHECK_HEADERS(ncurses/ncurses.h,
enable_cdda_player='yes')
])])
fi
2005-04-22 01:54:13 +00:00
AC_DEFINE(HAVE_KEYPAD, [], [Define this if your libcurses has keypad])
2012-02-24 05:16:13 -05:00
if test "x$enable_cdda_player" = "xyes"; then
if test "x$have_ncurses_h" = "xyes"; then
2011-11-25 10:22:30 +01:00
AC_CHECK_LIB(ncurses, mvprintw,
[LIBCURSES=ncurses; CDDA_PLAYER_LIBS="$CDDA_PLAYER_LIBS -lncurses"],
AC_CHECK_LIB(curses, mvprintw,
[LIBCURSES=curses;
CDDA_PLAYER_LIBS="$CDDA_PLAYER_LIBS -lcurses"],
[AC_MSG_WARN([Will not build cdda-player - did not find libncurses or libcurses])
enable_cdda_player=no]))
else
AC_CHECK_LIB(curses, mvprintw,
[LIBCURSES=curses;
CDDA_PLAYER_LIBS="$CDDA_PLAYER_LIBS -lcurses"],
[AC_MSG_WARN([Will not build cdda-player - did not find libcurses])])
fi
2012-02-24 05:16:13 -05:00
if test "x$enable_cdda_player" = "xyes"; then
2005-04-22 01:54:13 +00:00
AC_CHECK_LIB($LIBCURSES, keypad, [HAVE_KEYPAD=yes])
fi
2005-03-10 12:47:03 +00:00
fi
2006-11-30 02:22:01 +00:00
AM_CONDITIONAL(BUILD_CDDA_PLAYER, test "x$enable_cdda_player" = "xyes")
2005-03-10 12:47:03 +00:00
AC_SUBST(CDDA_PLAYER_LIBS)
2003-09-19 04:39:50 +00:00
AC_ARG_ENABLE(vcd_info,
2010-03-23 16:20:35 -04:00
AC_HELP_STRING([--enable-vcd-info], [include Video CD Info from libvcd]),
enable_vcd_info=${enableval},
2006-11-30 02:22:01 +00:00
enable_vcd_info=no)
2012-02-24 05:16:13 -05:00
if test "x$enable_vcd_info" = "xyes"; then
2004-12-18 17:29:32 +00:00
PKG_CHECK_MODULES(VCDINFO, libvcdinfo >= 0.7.21,
2003-08-10 02:27:49 +00:00
[AC_DEFINE([HAVE_VCDINFO],1,
[Define this if you have libvcdinfo installed])],
2004-02-25 02:01:05 +00:00
[AC_MSG_WARN(a new enough libvcdinfo not found.
2004-06-19 16:17:09 +00:00
VCD info display in cd-info disabled.
2004-02-25 02:01:05 +00:00
libvcdinfo is part of vcdimager. Get it from http://vcdimager.org)
2004-02-22 09:34:15 +00:00
enable_vcd_info=no])
2003-04-26 14:24:44 +00:00
fi
2003-08-10 02:27:49 +00:00
AC_SUBST(VCDINFO_LIBS)
AC_SUBST(VCDINFO_CFLAGS)
2003-04-26 14:24:44 +00:00
2005-01-31 23:55:23 +00:00
dnl
dnl Newest automake workaround - needed for multi-language manual pages
dnl
AC_SUBST(mkdir_p)
2003-04-20 15:34:31 +00:00
AC_CONFIG_COMMANDS([checks],
2003-04-26 14:24:44 +00:00
[chmod +x test/check_cue.sh; chmod +x test/check_nrg.sh
2003-04-20 15:34:31 +00:00
])
2003-04-19 00:50:39 +00:00
2005-01-31 23:55:23 +00:00
dnl
dnl Output configuration files
dnl
2008-03-09 18:41:27 +00:00
## AC_CONFIG_FILES([ po/Makefile.in\
AC_CONFIG_FILES([
2003-03-24 19:01:09 +00:00
Makefile \
2005-02-19 11:46:00 +00:00
example/C++/Makefile \
2005-11-10 11:11:15 +00:00
example/C++/OO/Makefile \
2003-09-28 22:11:00 +00:00
example/Makefile \
2003-04-19 08:29:13 +00:00
include/Makefile \
include/cdio/Makefile \
2005-11-10 11:11:15 +00:00
include/cdio++/Makefile \
2003-04-22 12:09:08 +00:00
include/cdio/version.h \
2004-10-24 11:20:30 +00:00
doc/doxygen/Doxyfile \
2003-07-28 02:25:37 +00:00
doc/Makefile \
2003-03-24 19:01:09 +00:00
lib/Makefile \
2005-11-10 11:11:15 +00:00
lib/cdio++/Makefile \
2004-12-18 17:29:32 +00:00
lib/driver/Makefile \
lib/iso9660/Makefile \
2005-10-24 03:12:30 +00:00
lib/udf/Makefile \
2005-01-25 11:04:45 +00:00
libcdio.pc \
2006-03-06 22:34:13 +00:00
libcdio++.pc \
2005-01-25 11:04:45 +00:00
libiso9660.pc \
2006-03-06 22:34:13 +00:00
libiso9660++.pc \
2005-10-23 12:56:40 +00:00
libudf.pc \
2005-01-25 02:00:19 +00:00
package/libcdio.spec \
2003-03-24 19:01:09 +00:00
src/Makefile \
2011-11-16 20:36:22 -05:00
test/check_common_fn \
2010-01-20 20:57:43 -05:00
test/data/Makefile \
2009-12-26 11:20:55 -05:00
test/driver/Makefile \
2010-01-20 20:57:43 -05:00
test/driver/bincue.c \
2010-01-23 23:20:12 -05:00
test/driver/cdrdao.c \
2010-01-21 02:58:19 -05:00
test/driver/nrg.c \
2009-07-02 20:26:39 -04:00
test/testgetdevices.c \
2007-08-12 12:41:10 +00:00
test/testisocd2.c \
2008-05-05 23:58:28 +00:00
test/testpregap.c \
2003-04-22 12:09:08 +00:00
test/Makefile \
2003-03-24 19:01:09 +00:00
])
2003-09-14 07:49:12 +00:00
2008-03-09 18:41:27 +00:00
# AC_CONFIG_FILES([po/Makefile])
2006-01-23 04:07:22 +00:00
AC_CONFIG_FILES([test/check_cue.sh], [chmod +x test/check_cue.sh])
AC_CONFIG_FILES([test/check_iso.sh], [chmod +x test/check_iso.sh])
AC_CONFIG_FILES([test/check_nrg.sh], [chmod +x test/check_nrg.sh])
2012-03-04 00:30:58 -05:00
AC_CONFIG_FILES([test/check_udf.sh], [chmod +x test/check_udf.sh])
2003-08-17 05:31:19 +00:00
AC_OUTPUT
2003-04-14 10:03:27 +00:00
2012-03-03 08:26:48 -05:00
AC_MSG_NOTICE([
2010-03-23 16:20:35 -04:00
Using CD-ROM drivers : $cd_drivers
Building cd-info : $(test "x$enable_cd_info" = "xyes" && echo yes || echo no)
Building cd-read : $(test "x$enable_cd_read" = "xyes" && echo yes || echo no)
Building cdda-player : $(test "x$enable_cdda_player" = "xyes" && echo yes || echo no)
Building iso-info : $(test "x$enable_iso_info" = "xyes" && echo yes || echo no)
Building iso-read : $(test "x$enable_iso_read" = "xyes" && echo yes || echo no)
Building C++ programs: $(test "x$enable_cxx" != "xno" && echo yes || echo no)])