diff --git a/configure.ac b/configure.ac index 301acae6..23ef8ffe 100644 --- a/configure.ac +++ b/configure.ac @@ -188,8 +188,8 @@ dnl headers AC_HEADER_STDC AC_CHECK_HEADERS(errno.h fcntl.h glob.h limits.h pwd.h) -AC_CHECK_HEADERS(stdarg.h stdbool.h stdio.h sys/cdio.h sys/param.h) -AC_CHECK_HEADERS(sys/time.h sys/timeb.h) +AC_CHECK_HEADERS(stdarg.h stdbool.h stdio.h sys/cdio.h sys/param.h \ + sys/time.h sys/timeb.h sys/utsname.h) AC_CHECK_HEADERS(ncurses.h curses.h, break, [enable_cdda_player='no']) dnl FreeBSD 4 has getopt in unistd.h. So we include that before @@ -674,7 +674,7 @@ cat > include/cdio/cdio_config.h << EOF version of config.h */ EOF -head -n 233 config.h >> include/cdio/cdio_config.h +head -n 254 config.h >> include/cdio/cdio_config.h ]],[[]]) AC_OUTPUT diff --git a/include/cdio/.gitignore b/include/cdio/.gitignore index a38874ed..8edaa269 100644 --- a/include/cdio/.gitignore +++ b/include/cdio/.gitignore @@ -1,3 +1,4 @@ +/*~ /Makefile /Makefile.in /cdio_config.h diff --git a/test/testgetdevices.c b/test/testgetdevices.c index 61760661..f5d2b535 100644 --- a/test/testgetdevices.c +++ b/test/testgetdevices.c @@ -35,6 +35,10 @@ #ifdef HAVE_STDLIB_H #include #endif +#ifdef HAVE_SYS_UTSNAME_H +#include +#endif + #include static void @@ -79,10 +83,36 @@ main(int argc, const char *argv[]) if (cdio_have_driver(-1) != false) { - printf("Bogus driver number -1 should be regexted\n"); + fprintf(stderr, "Bogus driver number -1 should be regexted\n"); return 5; } +#ifdef HAVE_SYS_UTSNAME_H + { + struct utsname utsname; + if (0 == uname(&utsname)) + { + if (0 == strncmp("Linux", utsname.sysname, sizeof("Linux"))) + { + if (!cdio_have_driver(DRIVER_LINUX)) + { + fprintf(stderr, + "You should have been able to get GNU/Linux driver\n"); + return 6; + } + } + else if (0 == strncmp("Cygwin", utsname.sysname, sizeof("Cygwin"))) + { + if (!cdio_have_driver(DRIVER_WIN32)) + { + fprintf(stderr, + "You should have been able to get Win32 driver\n"); + return 6; + } + } + } + } +#endif if (! (cdio_have_driver(DRIVER_NRG) && cdio_have_driver(DRIVER_BINCUE)) ) { printf("You don't have enough drivers for this test\n");