Add option to disable Rock-Ridge support --disable-rock

Add IS_ISSOCK() or S_ISLNK() macros for Rock-Ridge when environment
doesn't have it, e.g. MSYS 1.0.10 with MinGW 3.4.2.

Go over --enable settings. --disable-cpp-progs now works.

Require libcddb 1.0.1 or better
This commit is contained in:
rocky
2005-09-15 06:36:01 +00:00
parent 109df884e5
commit b4b1c4ec6f
11 changed files with 145 additions and 64 deletions

View File

@@ -19,7 +19,7 @@ define(RELEASE_NUM, 76)
define(CDIO_VERSION_STR, 0.$1cvs)
AC_PREREQ(2.52)
AC_REVISION([$Id: configure.ac,v 1.162 2005/07/15 21:40:06 rocky Exp $])dnl
AC_REVISION([$Id: configure.ac,v 1.163 2005/09/15 06:36:01 rocky Exp $])dnl
AC_INIT(libcdio, CDIO_VERSION_STR(RELEASE_NUM))
AC_CONFIG_SRCDIR(src/cd-info.c)
@@ -42,19 +42,19 @@ AM_MAINTAINER_MODE
AM_SANITY_CHECK
AC_ARG_WITH(cd_drive,
[ --without-cd-drive build program cd-drive (enabled by default)],
[ --without-cd-drive don't build program cd-drive (default with)],
enable_cd_drive="${withval}", enable_cd_drive=yes)
AC_ARG_WITH(cd_info,
[ --without-cd-info build program cd-info (enabled by default)],
[ --without-cd-info don't build program cd-info (default with)],
enable_cd_info="${withval}", enable_cd_info=yes)
AC_ARG_WITH(cd_paranoia,
[ --without-cd-paranoia build program cd-paranoia (enabled by default)],
[ --without-cd-paranoia don't build program cd-paranoia (default with)],
enable_cd_paranoia="${withval}", enable_cd_paranoia=yes)
AC_ARG_WITH(cdda_player,
[ --without-cdda-player build program cdda-player (enabled by default)],
[ --without-cdda-player don't build program cdda-player (default with)],
enable_cdda_player="${withval}", enable_cdda_player=yes)
AC_ARG_WITH(cd_paranoia_name,
@@ -64,25 +64,27 @@ CDPARANOIA_NAME="$cd_paranoia_name"
AC_SUBST(CDPARANOIA_NAME)
AC_ARG_WITH(cd_read,
[ --without-cd-read build program cd-read (enabled by default)],
[ --without-cd-read don't build program cd-read (default with)],
enable_cd_read="${withval}", enable_cd_read=yes)
AC_ARG_WITH(iso_info,
[ --without-iso-info build program iso-info (enabled by default)],
[ --without-iso-info don't build program iso-info (default with)],
enable_iso_info="${withval}", enable_iso_info=yes)
AC_ARG_WITH(iso_read,
[ --without-iso-read build program iso-read (enabled by default)],
[ --without-iso-read don't build program iso-read (default with)],
enable_iso_read="${withval}", enable_iso_read=yes)
AC_ARG_WITH(versioned_libs,
[ --without-versioned-libs build versioned library symbols (enabled by default if you have GNU ld)],
[ --without-versioned-libs build versioned library symbols (default enabled if you have GNU ld)],
enable_versioned_libs="${withval}", enable_versioned_libs=yes)
AC_ARG_ENABLE(vcd_info,
[ --disable-cpp don't make C++ example programs],
enable_cpp=no,
enable_cpp=yes)
AC_ARG_ENABLE(cpp_progs,
[ --enable-cpp-progs make C++ example programs (default enabled)],
enable_cpp_progs=no,
enable_cpp_progs=yes)
AM_CONDITIONAL(ENABLE_CPP, test x"$enable_cpp_progs" = "xyes")
dnl We use C
AC_PROG_CC
@@ -217,6 +219,41 @@ int main(int argc, char **argv) {
[AC_MSG_RESULT(no); ac_getopt_long=no])
AM_CONDITIONAL(HAVE_GETOPT_LONG, test x"$ac_getopt_long" = "xyes")
##
## Check for S_ISSOCK() and S_ISLNK() macros
##
AC_MSG_CHECKING(for S_ISLNK() macro)
AC_TRY_RUN([
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
int main(int argc, char **argv) {
int i = S_ISLNK(0);
return 0;
}
], [AC_MSG_RESULT(yes); ac_have_islnk=yes;
AC_DEFINE(HAVE_S_ISLNK, [],
[Define this <sys/stat.h> defines S_ISLNK()])],
[AC_MSG_RESULT(no); ac_have_islnk=no],
[AC_MSG_RESULT(no); ac_have_islnk=no])
AC_MSG_CHECKING(for S_ISSOCK() macro)
AC_TRY_RUN([
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
int main(int argc, char **argv) {
int i = S_ISSOCK(0);
return 0;
}
], [AC_MSG_RESULT(yes); ac_have_islnk=yes;
AC_DEFINE(HAVE_S_ISSOCK, [],
[Define this <sys/stat.h> defines S_ISSOCK()])],
[AC_MSG_RESULT(no); ac_have_issock=no],
[AC_MSG_RESULT(no); ac_have_issock=no])
dnl empty_array_size
AC_MSG_CHECKING([how to create empty arrays])
@@ -471,11 +508,11 @@ fi
if test x$enable_joliet = x; then
AC_ARG_ENABLE(joliet,
[ --disable-joliet don't include Joliet extension support],
enable_joliet=no,
enable_joliet=yes)
[ --enable-joliet include Joliet extension support (default enabled)],
enable_joliet=yes,
enable_joliet=no)
fi
if test x$enable_joliet = xyes; then
if test "${enable_jolet}" != "no" ; then
AM_ICONV
AM_LANGINFO_CODESET
if test "$am_cv_func_iconv" = yes ; then
@@ -489,14 +526,29 @@ if test x$enable_joliet = xyes; then
fi
AC_SUBST(HAVE_JOLIET)
if test x$enable_cddb = x; then
AC_ARG_ENABLE(cddb,
[ --disable-cddb don't include CDDB lookups in cd_info],
enable_cddb=no,
enable_cddb=yes)
if test x$enable_rock = x; then
enable_rock=yes
AC_ARG_ENABLE(rock,
[ --enable-rock include Rock-Ridge extension support (default enabled)],
enable_rock=yes, enable_rock=no)
fi
if test x$enable_cddb = xyes; then
PKG_CHECK_MODULES(CDDB, libcddb >= 0.9.4, [
if test "${enable_rock}" != "no" ; then
AC_DEFINE(HAVE_ROCK, [1],
[Define 1 if you want ISO-9660 Rock-Ridge extension support.])
HAVE_ROCK=1
fi
AC_SUBST(HAVE_ROCK)
AM_CONDITIONAL(ENABLE_ROCK, test x"$enable_rock" = "xyes")
if test x$enable_cddb = x; then
enable_cddb=yes
AC_ARG_ENABLE(cddb,
[ --enable-cddb include CDDB lookups in cd_info (default enabled)],
enable_cddb=yes, enable_cddb=no)
fi
if test x$enable_cddb != "no" ; then
PKG_CHECK_MODULES(CDDB, libcddb >= 1.0.1, [
HAVE_CDDB=yes
AC_DEFINE(HAVE_CDDB, [], [Define this if you have libcddb installed])
],
@@ -526,7 +578,7 @@ AC_SUBST(CDDA_PLAYER_LIBS)
if test x$enable_vcd_info = x; then
AC_ARG_ENABLE(vcd_info,
[ --disable-vcd-info don't include Video CD Info from libvcd],
[ --disable-vcd-info don't include Video CD Info from libvcd],
enable_vcd_info=no,
enable_vcd_info=yes)
fi

View File

@@ -1,4 +1,4 @@
# $Id: Makefile.am,v 1.23 2005/04/30 09:42:37 rocky Exp $
# $Id: Makefile.am,v 1.24 2005/09/15 06:36:01 rocky Exp $
#
# Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
#
@@ -20,7 +20,7 @@
# Sample programs
####################################################
#
if !DISABLE_CPP
if ENABLE_CPP
SUBDIRS = C++
endif
noinst_PROGRAMS = audio cdtext device drives iso1 iso2 iso3 isofuzzy \

View File

@@ -1,5 +1,5 @@
/*
$Id: rock.h,v 1.9 2005/08/27 14:25:58 rocky Exp $
$Id: rock.h,v 1.10 2005/09/15 06:36:01 rocky Exp $
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
@@ -37,6 +37,16 @@
extern "C" {
#endif /* __cplusplus */
/* MSYS 1.0.10 with MinGW 3.4.2 (and perhaps others) don't have
S_ISSOCK() or S_ISLNK() macros, so we'll roll our own. */
#if !defined(HAVE_S_ISSOCK) && !defined(S_ISSOCK)
#define S_ISSOCK(st_mode) ((((st_mode)) & 0170000) == (0140000))
#endif
#if !defined(HAVE_S_ISLNK) && !defined(S_ISLNK)
#define S_ISLNK(st_mode) ((((st_mode)) & 0170000) == (0010000))
#endif
/*! An enumeration for some of the ISO_ROCK_* #defines below. This isn't
really an enumeration one would really use in a program it is to
be helpful in debuggers where wants just to refer to the ISO_ROCK_*

View File

@@ -1,4 +1,4 @@
# $Id: Makefile.am,v 1.6 2005/03/29 01:40:19 rocky Exp $
# $Id: Makefile.am,v 1.7 2005/09/15 06:36:01 rocky Exp $
#
# Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
#
@@ -52,11 +52,17 @@ noinst_HEADERS = iso9660_private.h
lib_LTLIBRARIES = libiso9660.la
if ENABLE_ROCK
rock_src = rock.c
else
rock_src =
endif
libiso9660_la_SOURCES = \
iso9660.c \
iso9660_private.h \
iso9660_fs.c \
rock.c \
$(rock_src) \
xa.c
libiso9660_la_LIBADD = @LIBCDIO_LIBS@

View File

@@ -1,5 +1,5 @@
/*
$Id: iso9660_fs.c,v 1.29 2005/06/07 23:40:53 rocky Exp $
$Id: iso9660_fs.c,v 1.30 2005/09/15 06:36:01 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -52,7 +52,7 @@
#include <stdio.h>
static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.29 2005/06/07 23:40:53 rocky Exp $";
static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.30 2005/09/15 06:36:01 rocky Exp $";
/* Implementation of iso9660_t type */
struct _iso9660_s {
@@ -815,8 +815,14 @@ _iso9660_dir_to_statbuf (iso9660_dir_t *p_iso9660_dir, bool_3way_t b_xa,
{
char rr_fname[256] = "";
int i_rr_fname =
#ifdef HAVE_ROCK
get_rock_ridge_filename(p_iso9660_dir, rr_fname, p_stat);
#else
0;
#endif
if (i_rr_fname > 0) {
if (i_rr_fname > i_fname) {
/* realloc gives valgrind errors */

View File

@@ -1,5 +1,5 @@
/*
$Id: cd-info.c,v 1.142 2005/07/03 23:14:23 rocky Exp $
$Id: cd-info.c,v 1.143 2005/09/15 06:36:01 rocky Exp $
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1996, 1997, 1998 Gerd Knorr <kraxel@bytesex.org>
@@ -443,9 +443,7 @@ print_cddb_info(CdIo_t *p_cdio, track_t i_tracks, track_t i_first_track)
cddb_disc_destroy(p_cddb_disc);
cddb_destroy(p_conn);
#if LIBCDDB_VERSION_NUM >= 1
libcddb_shutdown();
#endif
}
}
#endif

View File

@@ -1,5 +1,5 @@
/*
$Id: cdda-player.c,v 1.35 2005/07/09 15:22:44 rocky Exp $
$Id: cdda-player.c,v 1.36 2005/09/15 06:36:01 rocky Exp $
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
@@ -292,9 +292,7 @@ finish(const char *psz_msg, int rc)
#ifdef HAVE_CDDB
if (p_conn) cddb_destroy(p_conn);
cddb_disc_destroy(p_cddb_disc);
#if LIBCDDB_VERSION_NUM >= 1
libcddb_shutdown();
#endif
#endif /*HAVE_CDDB*/
cdio_destroy (p_cdio);
free (psz_device);

View File

@@ -1,5 +1,5 @@
/*
$Id: cddb.c,v 1.4 2005/07/09 15:22:44 rocky Exp $
$Id: cddb.c,v 1.5 2005/09/15 06:36:01 rocky Exp $
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
@@ -113,6 +113,7 @@ init_cddb(CdIo_t *p_cdio, cddb_conn_t **pp_conn, cddb_disc_t **pp_cddb_disc,
*pp_cddb_disc = cddb_disc_new();
if (!*pp_cddb_disc) {
errmsg("unable to create CDDB disc structure");
cddb_destroy(*pp_conn);
return false;
}
for(i = 0; i < i_tracks; i++) {
@@ -128,6 +129,7 @@ init_cddb(CdIo_t *p_cdio, cddb_conn_t **pp_conn, cddb_disc_t **pp_cddb_disc,
if (!cddb_disc_calc_discid(*pp_cddb_disc)) {
errmsg("libcddb calc discid failed.");
cddb_destroy(*pp_conn);
return false;
}

View File

@@ -1,5 +1,5 @@
/*
$Id: util.c,v 1.49 2005/03/17 09:13:36 rocky Exp $
$Id: util.c,v 1.50 2005/09/15 06:36:01 rocky Exp $
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -470,6 +470,7 @@ print_fs_attrs(iso9660_stat_t *p_statbuf, bool b_rock, bool b_xa,
{
char date_str[30];
#ifdef HAVE_ROCK
if (yep == p_statbuf->rr.b3_rock && b_rock) {
report ( stdout, " %s %3d %d %d [LSN %6lu] %9u",
iso9660_get_rock_attr_str (p_statbuf->rr.st_mode),
@@ -481,7 +482,9 @@ print_fs_attrs(iso9660_stat_t *p_statbuf, bool b_rock, bool b_xa,
? strlen(p_statbuf->rr.psz_symlink)
: (unsigned int) p_statbuf->size );
} else if (b_xa) {
} else
#endif
if (b_xa) {
report ( stdout, " %s %d %d [fn %.2d] [LSN %6lu] ",
iso9660_get_xa_attr_str (p_statbuf->xa.attributes),
uint16_from_be (p_statbuf->xa.user_id),

View File

@@ -1,5 +1,5 @@
#!/bin/sh
#$Id: check_cue.sh.in,v 1.28 2005/04/11 02:36:36 rocky Exp $
#$Id: check_cue.sh.in,v 1.29 2005/09/15 06:36:01 rocky Exp $
# Tests to see that BIN/CUE and cdrdao TOC file iamge reading is correct
# (via cd-info).
@@ -44,28 +44,32 @@ check_result $RC "cd-info TOC test $testnum" "${CD_INFO} $opts"
fname=isofs-m1
testnum='ISO 9660 mode1 CUE'
if test -f ${srcdir}/${fname}.bin ; then
opts="-q --no-device-info --no-disc-mode --cue-file ${srcdir}/${fname}.cue --iso9660"
test_cdinfo "$opts" ${fname}.dump ${srcdir}/${fname}.right
RC=$?
check_result $RC "cd-info Rock-Ridge CUE test $testnum" "${CD_INFO} $opts"
if test -n "@HAVE_ROCK@"; then
opts="-q --no-device-info --no-disc-mode --cue-file ${srcdir}/${fname}.cue --iso9660"
test_cdinfo "$opts" ${fname}.dump ${srcdir}/${fname}.right
RC=$?
check_result $RC "cd-info Rock-Ridge CUE test $testnum" "${CD_INFO} $opts"
opts="-q --no-device-info --no-disc-mode --no-rock-ridge --cue-file ${srcdir}/${fname}.cue --iso9660"
test_cdinfo "$opts" ${fname}.dump ${srcdir}/${fname}-no-rr.right
RC=$?
check_result $RC "cd-info no Rock-Ridge CUE test $testnum" "${CD_INFO} $opts"
opts="-q --no-device-info --no-disc-mode --no-rock-ridge --cue-file ${srcdir}/${fname}.cue --iso9660"
test_cdinfo "$opts" ${fname}.dump ${srcdir}/${fname}-no-rr.right
RC=$?
check_result $RC "cd-info no Rock-Ridge CUE test $testnum" "${CD_INFO} $opts"
fi
else
echo "Don't see CUE file ${srcdir}/${fname}.bin. Test $testnum skipped."
fi
testnum='ISO 9660 mode1 TOC'
if test -f ${srcdir}/${fname}.bin ; then
opts="-q --no-device-info --no-disc-mode --toc-file ${srcdir}/${fname}.toc --iso9660"
test_cdinfo "$opts" ${fname}.dump ${srcdir}/${fname}.right
RC=$?
check_result $RC "cd-info TOC test $testnum" "${CD_INFO} $opts"
else
echo "Don't see TOC file ${srcdir}/${fname}.bin. Test $testnum skipped."
if test -n "@HAVE_ROCK@"; then
testnum='ISO 9660 mode1 TOC'
if test -f ${srcdir}/${fname}.bin ; then
opts="-q --no-device-info --no-disc-mode --toc-file ${srcdir}/${fname}.toc --iso9660"
test_cdinfo "$opts" ${fname}.dump ${srcdir}/${fname}.right
RC=$?
check_result $RC "cd-info TOC test $testnum" "${CD_INFO} $opts"
else
echo "Don't see TOC file ${srcdir}/${fname}.bin. Test $testnum skipped."
fi
fi
fname=vcd_demo

View File

@@ -1,5 +1,5 @@
#!/bin/sh
#$Id: check_iso.sh.in,v 1.9 2005/03/05 23:51:40 rocky Exp $
#$Id: check_iso.sh.in,v 1.10 2005/09/15 06:36:01 rocky Exp $
if test -z $srcdir ; then
srcdir=`pwd`
@@ -24,11 +24,13 @@ test_iso_read "$opts" ${fname} ${srcdir}/../COPYING
RC=$?
check_result $RC 'iso-read basic test' "$ISO_READ $opts"
fname=copying-rr
opts="--quiet ${srcdir}/${fname}.iso --iso9660 "
test_iso_info "$opts" ${fname}.dump ${srcdir}/${fname}.right
RC=$?
check_result $RC 'iso-info Rock Ridge test' "$ISO_INFO $opts"
if test -n "@HAVE_ROCK@"; then
fname=copying-rr
opts="--quiet ${srcdir}/${fname}.iso --iso9660 "
test_iso_info "$opts" ${fname}.dump ${srcdir}/${fname}.right
RC=$?
check_result $RC 'iso-info Rock Ridge test' "$ISO_INFO $opts"
fi
if test -n "@HAVE_JOLIET@" ; then
BASE=`basename $0 .sh`