cygwin/mingw improvements
cd-info: list drivers and exit when --version requested.
This commit is contained in:
@@ -15,7 +15,7 @@ dnl along with this program; if not, write to the Free Software
|
|||||||
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
dnl 02111-1307, USA.
|
dnl 02111-1307, USA.
|
||||||
|
|
||||||
AC_REVISION([$Id: configure.ac,v 1.23 2003/06/01 21:05:45 rocky Exp $])dnl
|
AC_REVISION([$Id: configure.ac,v 1.24 2003/06/07 01:20:40 rocky Exp $])dnl
|
||||||
AC_INIT(lib/cdio.c)
|
AC_INIT(lib/cdio.c)
|
||||||
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER(config.h)
|
||||||
AM_INIT_AUTOMAKE(libcdio, 0.61)
|
AM_INIT_AUTOMAKE(libcdio, 0.61)
|
||||||
@@ -143,7 +143,10 @@ fi
|
|||||||
dnl
|
dnl
|
||||||
|
|
||||||
dnl system
|
dnl system
|
||||||
|
|
||||||
|
dnl test for non-Unix variants
|
||||||
AC_CYGWIN
|
AC_CYGWIN
|
||||||
|
AC_MINGW32
|
||||||
|
|
||||||
LIBS="$LIBS -lm"
|
LIBS="$LIBS -lm"
|
||||||
CFLAGS="$CFLAGS $WARN_CFLAGS"
|
CFLAGS="$CFLAGS $WARN_CFLAGS"
|
||||||
@@ -196,9 +199,10 @@ int has_timeout=sizeof(test.timeout);],
|
|||||||
AC_DEFINE([HAVE_SOLARIS_CDROM], [1],
|
AC_DEFINE([HAVE_SOLARIS_CDROM], [1],
|
||||||
[Define 1 if you have Solaris CD-ROM support])
|
[Define 1 if you have Solaris CD-ROM support])
|
||||||
;;
|
;;
|
||||||
mingw*)
|
mingw*|cygwin*)
|
||||||
AC_DEFINE([HAVE_WIN32_CDROM], [1],
|
AC_DEFINE([HAVE_WIN32_CDROM], [1],
|
||||||
[Define 1 if you have cywin MinGW CD-ROM support])
|
[Define 1 if you have cywin MinGW CD-ROM support])
|
||||||
|
LIBS="$LIBS -lwinmm -mwindows"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
AC_MSG_WARN(Don't have OS CD-reading support for ${host_os}...)
|
AC_MSG_WARN(Don't have OS CD-reading support for ${host_os}...)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: cd-info.c,v 1.5 2003/06/01 21:05:45 rocky Exp $
|
$Id: cd-info.c,v 1.6 2003/06/07 01:20:40 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
||||||
Copyright (C) 1996,1997,1998 Gerd Knorr <kraxel@bytesex.org>
|
Copyright (C) 1996,1997,1998 Gerd Knorr <kraxel@bytesex.org>
|
||||||
@@ -261,6 +261,7 @@ struct arguments
|
|||||||
#endif
|
#endif
|
||||||
uint32_t debug_level;
|
uint32_t debug_level;
|
||||||
int silent;
|
int silent;
|
||||||
|
bool version_only;
|
||||||
source_image_t source_image;
|
source_image_t source_image;
|
||||||
} opts;
|
} opts;
|
||||||
|
|
||||||
@@ -356,7 +357,7 @@ struct poptOption optionsTable[] = {
|
|||||||
{"quiet", 'q', POPT_ARG_NONE, &opts.silent, 0,
|
{"quiet", 'q', POPT_ARG_NONE, &opts.silent, 0,
|
||||||
"show only critical messages"},
|
"show only critical messages"},
|
||||||
|
|
||||||
{"version", 'V', POPT_ARG_NONE, NULL, OP_VERSION,
|
{"version", 'V', POPT_ARG_NONE, &opts.version_only, 0,
|
||||||
"display version and copyright information and exit"},
|
"display version and copyright information and exit"},
|
||||||
POPT_AUTOHELP {NULL, 0, 0, NULL, 0}
|
POPT_AUTOHELP {NULL, 0, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
@@ -447,16 +448,29 @@ parse_options (poptContext optCon)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_version (void)
|
print_version (bool version_only)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
driver_id_t driver_id;
|
||||||
|
|
||||||
printf( _("CD Info %s | (c) 2003 Gerd Knorr, Heiko Ei<45>feldt & R. Bernstein\n\
|
printf( _("CD Info %s | (c) 2003 Gerd Knorr, Heiko Ei<45>feldt & R. Bernstein\n\
|
||||||
This is free software; see the source for copying conditions.\n\
|
This is free software; see the source for copying conditions.\n\
|
||||||
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
|
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
|
||||||
PARTICULAR PURPOSE.\n\
|
PARTICULAR PURPOSE.\n\
|
||||||
"),
|
"),
|
||||||
CDINFO_VERSION);
|
CDINFO_VERSION);
|
||||||
|
|
||||||
|
if (version_only) {
|
||||||
|
for (driver_id=DRIVER_UNKNOWN+1; driver_id<=MAX_DRIVER; driver_id++) {
|
||||||
|
if (cdio_have_driver(driver_id)) {
|
||||||
|
printf("driver: %s\n", cdio_driver_describe(driver_id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exit(100);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
@@ -736,7 +750,9 @@ cddb_discid()
|
|||||||
/* CDIO logging routines */
|
/* CDIO logging routines */
|
||||||
|
|
||||||
static cdio_log_handler_t gl_default_cdio_log_handler = NULL;
|
static cdio_log_handler_t gl_default_cdio_log_handler = NULL;
|
||||||
|
#ifdef HAVE_CDDB
|
||||||
static cddb_log_handler_t gl_default_cddb_log_handler = NULL;
|
static cddb_log_handler_t gl_default_cddb_log_handler = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_log_handler (cdio_log_level_t level, const char message[])
|
_log_handler (cdio_log_level_t level, const char message[])
|
||||||
@@ -974,7 +990,9 @@ main(int argc, const char *argv[])
|
|||||||
poptContext optCon = poptGetContext (NULL, argc, argv, optionsTable, 0);
|
poptContext optCon = poptGetContext (NULL, argc, argv, optionsTable, 0);
|
||||||
|
|
||||||
gl_default_cdio_log_handler = cdio_log_set_handler (_log_handler);
|
gl_default_cdio_log_handler = cdio_log_set_handler (_log_handler);
|
||||||
|
#ifdef HAVE_CDDB
|
||||||
gl_default_cddb_log_handler = cddb_log_set_handler (_log_handler);
|
gl_default_cddb_log_handler = cddb_log_set_handler (_log_handler);
|
||||||
|
#endif
|
||||||
|
|
||||||
program_name = strrchr(argv[0],'/');
|
program_name = strrchr(argv[0],'/');
|
||||||
program_name = program_name ? program_name+1 : strdup(argv[0]);
|
program_name = program_name ? program_name+1 : strdup(argv[0]);
|
||||||
@@ -1002,7 +1020,7 @@ main(int argc, const char *argv[])
|
|||||||
be reflected in `arguments'. */
|
be reflected in `arguments'. */
|
||||||
parse_options(optCon);
|
parse_options(optCon);
|
||||||
|
|
||||||
print_version();
|
print_version(opts.version_only);
|
||||||
|
|
||||||
switch (opts.source_image) {
|
switch (opts.source_image) {
|
||||||
case IMAGE_UNKNOWN:
|
case IMAGE_UNKNOWN:
|
||||||
|
|||||||
Reference in New Issue
Block a user