Index: cdrkit/CMakeLists.txt diff -c cdrkit/CMakeLists.txt:1.1.1.1 cdrkit/CMakeLists.txt:1.2 *** cdrkit/CMakeLists.txt:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/CMakeLists.txt Wed Jul 1 12:56:01 2009 *************** *** 1,3 **** --- 1,4 ---- + cmake_minimum_required(VERSION 2.6) PROJECT (cdrkit C) SUBDIRS(include genisoimage wodim libedc libhfs_iso libparanoia icedax libusal librols libunls readom netscsid 3rd-party/dirsplit) Index: cdrkit/genisoimage/CMakeLists.txt diff -c cdrkit/genisoimage/CMakeLists.txt:1.1.1.1 cdrkit/genisoimage/CMakeLists.txt:1.3 *** cdrkit/genisoimage/CMakeLists.txt:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/genisoimage/CMakeLists.txt Wed Jul 1 13:06:55 2009 *************** *** 1,9 **** PROJECT (MKISOFS C) ! INCLUDE(../include/AddScgBits.cmake) INCLUDE(../include/AddSchilyBits.cmake) ! INCLUDE_DIRECTORIES(../include ../libhfs_iso ../wodim ${CMAKE_BINARY_DIR}) INCLUDE(CheckIncludeFiles) CHECK_INCLUDE_FILES("magic.h" USE_MAGIC) --- 1,9 ---- PROJECT (MKISOFS C) ! cmake_minimum_required(VERSION 2.6) INCLUDE(../include/AddScgBits.cmake) INCLUDE(../include/AddSchilyBits.cmake) ! INCLUDE_DIRECTORIES(../include ../libhfs_iso ../wodim ../libusal ${CMAKE_BINARY_DIR}) INCLUDE(CheckIncludeFiles) CHECK_INCLUDE_FILES("magic.h" USE_MAGIC) *************** *** 23,28 **** --- 23,32 ---- ENDIF(USE_LIBICONV) ENDIF(HAVE_ICONV_H) + IF(USE_LIBREGEX) + LIST(APPEND EXTRA_LIBS "regex") + ENDIF(USE_LIBREGEX) + ADD_DEFINITIONS(-DUSE_LARGEFILES -DABORT_DEEP_ISO_ONLY -DAPPLE_HYB -DUDF -DDVD_VIDEO -DSORTING -DHAVE_CONFIG_H -DUSE_LIBSCHILY -DUSE_SCG -DJIGDO_TEMPLATE) SET(MKISOFS_MOST_SRCS apple.c boot.c desktop.c dvd_file.c dvd_reader.c eltorito.c exclude.c files.c fnmatch.c hash.c ifo_read.c joliet.c mac_label.c match.c multi.c name.c rock.c scsi.c stream.c tree.c udf.c vms.c volume.c write.c boot-alpha.c boot-hppa.c boot-mips.c md5.c jte.c rsync.c boot-mipsel.c endian.c sha1.c checksum.c ) *************** *** 39,45 **** LINK_DIRECTORIES(../libhfs_iso ../librols ../libusal ../libunls ../wodim) ADD_EXECUTABLE (genisoimage genisoimage.c ${MKISOFS_MOST_SRCS}) ! TARGET_LINK_LIBRARIES(genisoimage wodimstuff hfs_iso ${MAGICLIBS} c unls z bz2 ${EXTRA_LIBICONV} ${EXTRA_LIBS}) # common lib set and genisoimage source parts for the rest LINK_LIBRARIES(wodimstuff ${EXTRA_LIBS} unls ${EXTRA_LIBICONV} ) --- 43,49 ---- LINK_DIRECTORIES(../libhfs_iso ../librols ../libusal ../libunls ../wodim) ADD_EXECUTABLE (genisoimage genisoimage.c ${MKISOFS_MOST_SRCS}) ! TARGET_LINK_LIBRARIES(genisoimage wodimstuff hfs_iso ${MAGICLIBS} unls z bz2 ${EXTRA_LIBICONV} ${EXTRA_LIBS}) # common lib set and genisoimage source parts for the rest LINK_LIBRARIES(wodimstuff ${EXTRA_LIBS} unls ${EXTRA_LIBICONV} ) Index: cdrkit/genisoimage/apple.c diff -c cdrkit/genisoimage/apple.c:1.1.1.1 cdrkit/genisoimage/apple.c:1.2 *** cdrkit/genisoimage/apple.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/genisoimage/apple.c Wed Jul 1 12:56:01 2009 *************** *** 53,59 **** --- 53,61 ---- #include #include #include + #ifdef HAVE_NETINET_IN_H #include + #endif #include "apple.h" #include Index: cdrkit/genisoimage/defaults.h diff -c cdrkit/genisoimage/defaults.h:1.1.1.1 cdrkit/genisoimage/defaults.h:1.2 *** cdrkit/genisoimage/defaults.h:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/genisoimage/defaults.h Wed Jul 1 12:56:01 2009 *************** *** 72,78 **** #define SYSTEM_ID_DEFAULT "AIX" #endif ! #if defined(_WIN) || defined(__CYGWIN32__) || defined(__CYGWIN__) #define SYSTEM_ID_DEFAULT "Win32" #endif /* _WIN */ --- 72,78 ---- #define SYSTEM_ID_DEFAULT "AIX" #endif ! #if defined(_WIN) || defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__MINGW32__) #define SYSTEM_ID_DEFAULT "Win32" #endif /* _WIN */ Index: cdrkit/genisoimage/genisoimage.c diff -c cdrkit/genisoimage/genisoimage.c:1.1.1.1 cdrkit/genisoimage/genisoimage.c:1.2 *** cdrkit/genisoimage/genisoimage.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/genisoimage/genisoimage.c Wed Jul 1 12:56:01 2009 *************** *** 83,90 **** --- 83,94 ---- #ifdef USE_ICONV #include + #ifdef HAVE_LOCALCHARSET_H + #include + #elif defined(HAVE_LANGINFO_H) #include #endif + #endif struct directory *root = NULL; int path_ind; *************** *** 139,145 **** int gui = 0; int all_files = 1; /* New default is to include all files */ int follow_links = 0; ! #ifdef IS_CYGWIN int cache_inodes = 0; /* Do not cache inodes on Cygwin by default */ #else int cache_inodes = 1; /* Cache inodes if OS has unique inodes */ --- 143,149 ---- int gui = 0; int all_files = 1; /* New default is to include all files */ int follow_links = 0; ! #if defined(IS_CYGWIN) || defined(__MINGW32__) int cache_inodes = 0; /* Do not cache inodes on Cygwin by default */ #else int cache_inodes = 1; /* Cache inodes if OS has unique inodes */ *************** *** 1834,1840 **** } break; } ! case OPTION_UID: rationalize++; use_RockRidge++; --- 1838,1845 ---- } break; } ! ! #ifndef __MINGW32__ case OPTION_UID: rationalize++; use_RockRidge++; *************** *** 1872,1878 **** } break; } ! case OPTION_FILEMODE: rationalize++; use_RockRidge++; --- 1877,1884 ---- } break; } ! #endif /* __MINGW32__ */ ! case OPTION_FILEMODE: rationalize++; use_RockRidge++; *************** *** 2523,2528 **** --- 2529,2535 ---- setlocale(LC_CTYPE, ""); if (icharset == NULL && iconv_possible) { + #ifdef HAVE_LANGINFO_H char *charset = nl_langinfo(CODESET); /* set to detected value but only if it is not pure US-ASCII */ if(charset) { /* workaround for SunOS, iconv is case-sensitive */ *************** *** 2531,2539 **** for(t=charset;*t!='\0';t++) *t=tolower(*t); } ! if(strcmp(charset, "ansi_x3.4-1968") != 0) ! icharset = charset; if(icharset && verbose > 0) fprintf(stderr, "I: -input-charset not specified, using %s (detected in locale settings)\n", --- 2538,2549 ---- for(t=charset;*t!='\0';t++) *t=tolower(*t); } ! #else ! const char *charset = locale_charset(); ! #endif if(strcmp(charset, "ansi_x3.4-1968") != 0) ! /* this is bad -- the const should not be cast away unless it is unavoidable */ ! icharset = (char *)charset; if(icharset && verbose > 0) fprintf(stderr, "I: -input-charset not specified, using %s (detected in locale settings)\n", *************** *** 2550,2556 **** #endif if (icharset == NULL) { ! #if (defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__DJGPP__)) && !defined(IS_CYGWIN_1) in_nls = load_unls("cp437"); #else in_nls = load_unls("iso8859-1"); --- 2560,2566 ---- #endif if (icharset == NULL) { ! #if (defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__DJGPP__) || defined(__MINGW32__)) && !defined(IS_CYGWIN_1) in_nls = load_unls("cp437"); #else in_nls = load_unls("iso8859-1"); *************** *** 2626,2631 **** --- 2636,2643 ---- #endif } } + + #ifdef HAVE_UID_T_AND_GID_T /* We don't need root privilleges anymore. */ #ifdef HAVE_SETREUID if (setreuid(-1, getuid()) < 0) *************** *** 2644,2650 **** exit(1); } #endif ! #ifdef no_more_needed #ifdef __NetBSD__ --- 2656,2662 ---- exit(1); } #endif ! #endif /* HAVE_UID_T_AND_GID_T */ #ifdef no_more_needed #ifdef __NetBSD__ Index: cdrkit/genisoimage/genisoimage.h diff -c cdrkit/genisoimage/genisoimage.h:1.1.1.1 cdrkit/genisoimage/genisoimage.h:1.2 *** cdrkit/genisoimage/genisoimage.h:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/genisoimage/genisoimage.h Wed Jul 1 12:56:01 2009 *************** *** 67,75 **** --- 67,80 ---- * XXX we know a secure way to let autoconf ckeck for fseeko()/ftello() * XXX without defining FILE_OFFSETBITS to 64 in confdefs.h */ + #ifdef __MINGW32__ + # define fseek fseeko64 + # define ftell ftello64 + #else # define fseek fseeko # define ftell ftello #endif + #endif #ifndef HAVE_LSTAT #ifndef VMS Index: cdrkit/genisoimage/joliet.c diff -c cdrkit/genisoimage/joliet.c:1.1.1.1 cdrkit/genisoimage/joliet.c:1.2 *** cdrkit/genisoimage/joliet.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/genisoimage/joliet.c Wed Jul 1 12:56:01 2009 *************** *** 259,265 **** size_t outleft = size; iconv(inls->iconv_d, NULL, NULL, NULL, NULL); ! if(iconv(inls->iconv_d, &inptr, &inleft, &outptr, &outleft) == (size_t)-1 && errno == EILSEQ) { fprintf(stderr, "Incorrectly encoded string (%s) " "encountered.\nPossibly creating an invalid " --- 259,266 ---- size_t outleft = size; iconv(inls->iconv_d, NULL, NULL, NULL, NULL); ! if(iconv(inls->iconv_d, (const char **)&inptr, &inleft, &outptr, ! &outleft) == (size_t)-1 && errno == EILSEQ) { fprintf(stderr, "Incorrectly encoded string (%s) " "encountered.\nPossibly creating an invalid " *************** *** 394,400 **** tmp_ptr = tmp; iconv(inls->iconv_d, NULL, NULL, NULL, NULL); ! iconv(inls->iconv_d, &string_ptr, &string_len, &tmp_ptr, &tmp_len); /* --- 395,401 ---- tmp_ptr = tmp; iconv(inls->iconv_d, NULL, NULL, NULL, NULL); ! iconv(inls->iconv_d, (const char **)&string_ptr, &string_len, &tmp_ptr, &tmp_len); /* Index: cdrkit/genisoimage/scsi.c diff -c cdrkit/genisoimage/scsi.c:1.1.1.1 cdrkit/genisoimage/scsi.c:1.2 *** cdrkit/genisoimage/scsi.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/genisoimage/scsi.c Wed Jul 1 12:56:01 2009 *************** *** 144,155 **** --- 144,157 ---- char *buf; /* ignored, bit OS/2 ASPI layer needs memory which */ /* has been allocated by scsi_getbuf() */ + #ifdef USE_SCSI_REMOTE /* * Call usal_remote() to force loading the remote SCSI transport library * code that is located in librusal instead of the dummy remote routines * that are located inside libusal. */ usal_remote(); + #endif cdr_defaults(&path, NULL, NULL, NULL); /* path, debug, verboseopen */ Index: cdrkit/genisoimage/tree.c diff -c cdrkit/genisoimage/tree.c:1.1.1.1 cdrkit/genisoimage/tree.c:1.2 *** cdrkit/genisoimage/tree.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/genisoimage/tree.c Wed Jul 1 12:56:01 2009 *************** *** 241,248 **** int lstat_filter(char *path, struct stat *st) { int result = lstat(path, st); ! if (result >= 0 && rationalize) stat_fix(st); return (result); --- 241,252 ---- int lstat_filter(char *path, struct stat *st) { + #ifdef __MINGW32__ + int result = stat(path, st); + #else int result = lstat(path, st); ! #endif ! if (result >= 0 && rationalize) stat_fix(st); return (result); *************** *** 1551,1557 **** return (0); } /* print a warning but don't spam too much */ ! if (S_ISREG(lstatbuf.st_mode) && (lstatbuf.st_size >= (off_t)0xFFFFFFFF)) { static int udf_warned; if( !allow_limited_size || verbose>1) --- 1555,1561 ---- return (0); } /* print a warning but don't spam too much */ ! if (S_ISREG(lstatbuf.st_mode) && ((UInt64_t)lstatbuf.st_size >= (UInt64_t)0xFFFFFFFF)) { static int udf_warned; if( !allow_limited_size || verbose>1) *************** *** 2681,2686 **** --- 2685,2691 ---- if (fstatbuf.st_ctime == 0) { time(¤t_time); + #ifdef HAVE_UID_T_AND_GID_T if (rationalize_uid) fstatbuf.st_uid = uid_to_use; else *************** *** 2689,2694 **** --- 2694,2704 ---- fstatbuf.st_gid = gid_to_use; else fstatbuf.st_gid = getgid(); + #else + fstatbuf.st_uid = 0; + fstatbuf.st_gid = 0; + #endif + fstatbuf.st_ctime = current_time; fstatbuf.st_mtime = current_time; fstatbuf.st_atime = current_time; Index: cdrkit/genisoimage/write.c diff -c cdrkit/genisoimage/write.c:1.1.1.1 cdrkit/genisoimage/write.c:1.2 *** cdrkit/genisoimage/write.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/genisoimage/write.c Wed Jul 1 12:56:01 2009 *************** *** 1043,1049 **** ((p = strstr(dpnt->whole_name, "VIDEO_TS")) != 0)&& strcmp(p, "VIDEO_TS") == 0) { ! int maxlen = strlen(dpnt->whole_name)-8; if (maxlen > (sizeof (dvd_path)-1)) maxlen = sizeof (dvd_path)-1; strncpy(dvd_path, dpnt->whole_name, maxlen); --- 1043,1049 ---- ((p = strstr(dpnt->whole_name, "VIDEO_TS")) != 0)&& strcmp(p, "VIDEO_TS") == 0) { ! int maxlen = strlen(dpnt->whole_name) - 9; /* subtract /VIDEO_TS */ if (maxlen > (sizeof (dvd_path)-1)) maxlen = sizeof (dvd_path)-1; strncpy(dvd_path, dpnt->whole_name, maxlen); Index: cdrkit/genisoimage/diag/dump.c diff -c cdrkit/genisoimage/diag/dump.c:1.1.1.1 cdrkit/genisoimage/diag/dump.c:1.2 *** cdrkit/genisoimage/diag/dump.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/genisoimage/diag/dump.c Wed Jul 1 12:56:01 2009 *************** *** 72,78 **** #ifdef USE_V7_TTY static struct sgttyb savetty; static struct sgttyb newtty; ! #else static struct termios savetty; static struct termios newtty; #endif --- 72,78 ---- #ifdef USE_V7_TTY static struct sgttyb savetty; static struct sgttyb newtty; ! #elif defined(HAVE_TERMIOS_H) static struct termios savetty; static struct termios newtty; #endif *************** *** 94,101 **** #else #ifdef TCSANOW if (tcsetattr(STDIN_FILENO, TCSANOW, &savetty) == -1) { ! #else if (ioctl(STDIN_FILENO, TCSETAF, &savetty) == -1) { #endif #endif #ifdef USE_LIBSCHILY --- 94,103 ---- #else #ifdef TCSANOW if (tcsetattr(STDIN_FILENO, TCSANOW, &savetty) == -1) { ! #elif defined(HAVE_SYS_IOCTL_H) if (ioctl(STDIN_FILENO, TCSETAF, &savetty) == -1) { + #else + if (FALSE) { #endif #endif #ifdef USE_LIBSCHILY *************** *** 115,122 **** #else #ifdef TCSANOW if (tcsetattr(STDIN_FILENO, TCSANOW, &newtty) == -1) { ! #else if (ioctl(STDIN_FILENO, TCSETAF, &newtty) == -1) { #endif #endif #ifdef USE_LIBSCHILY --- 117,126 ---- #else #ifdef TCSANOW if (tcsetattr(STDIN_FILENO, TCSANOW, &newtty) == -1) { ! #elif defined(HAVE_SYS_IOCTL_H) if (ioctl(STDIN_FILENO, TCSETAF, &newtty) == -1) { + #else + if (FALSE) { #endif #endif #ifdef USE_LIBSCHILY *************** *** 334,346 **** /* * Now setup the keyboard for single character input. */ ! #ifdef USE_V7_TTY if (ioctl(STDIN_FILENO, TIOCGETP, &savetty) == -1) { #else #ifdef TCSANOW if (tcgetattr(STDIN_FILENO, &savetty) == -1) { ! #else if (ioctl(STDIN_FILENO, TCGETA, &savetty) == -1) { #endif #endif #ifdef USE_LIBSCHILY --- 338,352 ---- /* * Now setup the keyboard for single character input. */ ! #if defined(HAVE_SYS_IOCTL_H) && defined(USE_V7_TTY) if (ioctl(STDIN_FILENO, TIOCGETP, &savetty) == -1) { #else #ifdef TCSANOW if (tcgetattr(STDIN_FILENO, &savetty) == -1) { ! #elif defined(HAVE_SYS_IOCTL_H) if (ioctl(STDIN_FILENO, TCGETA, &savetty) == -1) { + #else + if (FALSE) { #endif #endif #ifdef USE_LIBSCHILY *************** *** 350,360 **** exit(1); #endif } newtty = savetty; #ifdef USE_V7_TTY newtty.sg_flags &= ~(ECHO|CRMOD); newtty.sg_flags |= CBREAK; ! #else newtty.c_lflag &= ~ICANON; newtty.c_lflag &= ~ECHO; newtty.c_cc[VMIN] = 1; --- 356,370 ---- exit(1); #endif } + + #if defined(USE_V7_TTY) || defined(HAVE_TERMIOS_H) newtty = savetty; + #endif + #ifdef USE_V7_TTY newtty.sg_flags &= ~(ECHO|CRMOD); newtty.sg_flags |= CBREAK; ! #elif defined(HAVE_TERMIOS_H) newtty.c_lflag &= ~ICANON; newtty.c_lflag &= ~ECHO; newtty.c_cc[VMIN] = 1; Index: cdrkit/genisoimage/diag/isodump.c diff -c cdrkit/genisoimage/diag/isodump.c:1.1.1.1 cdrkit/genisoimage/diag/isodump.c:1.2 *** cdrkit/genisoimage/diag/isodump.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/genisoimage/diag/isodump.c Wed Jul 1 12:56:01 2009 *************** *** 189,195 **** #ifdef USE_V7_TTY static struct sgttyb savetty; static struct sgttyb newtty; ! #else static struct termios savetty; static struct termios newtty; #endif --- 189,195 ---- #ifdef USE_V7_TTY static struct sgttyb savetty; static struct sgttyb newtty; ! #elif defined(HAVE_TERMIOS_H) static struct termios savetty; static struct termios newtty; #endif *************** *** 202,209 **** #else #ifdef TCSANOW if (tcsetattr(STDIN_FILENO, TCSANOW, &savetty) == -1) { ! #else if (ioctl(STDIN_FILENO, TCSETAF, &savetty) == -1) { #endif #endif #ifdef USE_LIBSCHILY --- 202,211 ---- #else #ifdef TCSANOW if (tcsetattr(STDIN_FILENO, TCSANOW, &savetty) == -1) { ! #elif defined(HAVE_SYS_IOCTL_H) if (ioctl(STDIN_FILENO, TCSETAF, &savetty) == -1) { + #else + if (FALSE) { #endif #endif #ifdef USE_LIBSCHILY *************** *** 223,230 **** #else #ifdef TCSANOW if (tcsetattr(STDIN_FILENO, TCSANOW, &newtty) == -1) { ! #else if (ioctl(STDIN_FILENO, TCSETAF, &newtty) == -1) { #endif #endif #ifdef USE_LIBSCHILY --- 225,234 ---- #else #ifdef TCSANOW if (tcsetattr(STDIN_FILENO, TCSANOW, &newtty) == -1) { ! #elif defined(HAVE_SYS_IOCTL_H) if (ioctl(STDIN_FILENO, TCSETAF, &newtty) == -1) { + #else + if (FALSE) { #endif #endif #ifdef USE_LIBSCHILY *************** *** 625,632 **** #else #ifdef TCSANOW if (tcgetattr(STDIN_FILENO, &savetty) == -1) { ! #else if (ioctl(STDIN_FILENO, TCGETA, &savetty) == -1) { #endif #endif #ifdef USE_LIBSCHILY --- 629,638 ---- #else #ifdef TCSANOW if (tcgetattr(STDIN_FILENO, &savetty) == -1) { ! #elif defined(HAVE_SYS_IOCTL_H) if (ioctl(STDIN_FILENO, TCGETA, &savetty) == -1) { + #else + if (FALSE) { #endif #endif #ifdef USE_LIBSCHILY *************** *** 636,646 **** exit(1); #endif } newtty = savetty; #ifdef USE_V7_TTY newtty.sg_flags &= ~(ECHO|CRMOD); newtty.sg_flags |= CBREAK; ! #else newtty.c_lflag &= ~ICANON; newtty.c_lflag &= ~ECHO; newtty.c_cc[VMIN] = 1; --- 642,656 ---- exit(1); #endif } + + #if defined(USE_V7_TTY) || defined(HAVE_TERMIOS_H) newtty = savetty; + #endif + #ifdef USE_V7_TTY newtty.sg_flags &= ~(ECHO|CRMOD); newtty.sg_flags |= CBREAK; ! #elif defined(HAVE_TERMIOS_H) newtty.c_lflag &= ~ICANON; newtty.c_lflag &= ~ECHO; newtty.c_cc[VMIN] = 1; Index: cdrkit/genisoimage/diag/isoinfo.c diff -c cdrkit/genisoimage/diag/isoinfo.c:1.1.1.1 cdrkit/genisoimage/diag/isoinfo.c:1.2 *** cdrkit/genisoimage/diag/isoinfo.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/genisoimage/diag/isoinfo.c Wed Jul 1 12:56:01 2009 *************** *** 66,72 **** #include ! #if defined(__CYGWIN32__) || defined(__EMX__) || defined(__DJGPP__) #include /* for setmode() prototype */ #endif --- 66,72 ---- #include ! #if defined(__CYGWIN32__) || defined(__MINGW32__) || defined(__EMX__) || defined(__DJGPP__) #include /* for setmode() prototype */ #endif *************** *** 633,639 **** int extent, len, tlen; unsigned char buff[2048]; ! #if defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__EMX__) || defined(__DJGPP__) setmode(fileno(stdout), O_BINARY); #endif --- 633,639 ---- int extent, len, tlen; unsigned char buff[2048]; ! #if defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__EMX__) || defined(__DJGPP__) || defined(__MINGW32__) setmode(fileno(stdout), O_BINARY); #endif *************** *** 871,877 **** init_unls(); /* Initialize UNICODE tables */ init_unls_file(charset); if (charset == NULL) { ! #if (defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__DJGPP__)) && !defined(IS_CYGWIN_1) unls = load_unls("cp437"); #else unls = load_unls("iso8859-1"); --- 871,877 ---- init_unls(); /* Initialize UNICODE tables */ init_unls_file(charset); if (charset == NULL) { ! #if (defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__DJGPP__) || defined(__MINGW32__)) && !defined(IS_CYGWIN_1) unls = load_unls("cp437"); #else unls = load_unls("iso8859-1"); Index: cdrkit/icedax/CMakeLists.txt diff -c cdrkit/icedax/CMakeLists.txt:1.1.1.1 cdrkit/icedax/CMakeLists.txt:1.3 *** cdrkit/icedax/CMakeLists.txt:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/icedax/CMakeLists.txt Wed Jul 1 13:06:56 2009 *************** *** 1,5 **** PROJECT (icedax C) ! INCLUDE_DIRECTORIES(../include ../wodim ../libparanoia ${CMAKE_BINARY_DIR}) include(../include/AddScgBits.cmake) include(../include/AddSchilyBits.cmake) include(../include/AddNetworkBits.cmake) --- 1,5 ---- PROJECT (icedax C) ! INCLUDE_DIRECTORIES(../include ../wodim ../libparanoia ../libusal ${CMAKE_BINARY_DIR}) include(../include/AddScgBits.cmake) include(../include/AddSchilyBits.cmake) include(../include/AddNetworkBits.cmake) *************** *** 29,34 **** SET_TARGET_PROPERTIES(icedax PROPERTIES SKIP_BUILD_RPATH TRUE) INSTALL(TARGETS icedax DESTINATION bin) ! INSTALL(PROGRAMS pitchplay readmult cdda2mp3 cdda2ogg DESTINATION bin) INSTALL(FILES cdda2ogg.1 icedax.1 pitchplay.1 readmult.1 list_audio_tracks.1 DESTINATION ${MANSUBDIR}/man1) --- 29,34 ---- SET_TARGET_PROPERTIES(icedax PROPERTIES SKIP_BUILD_RPATH TRUE) INSTALL(TARGETS icedax DESTINATION bin) ! INSTALL(PROGRAMS pitchplay readmult cdda2ogg DESTINATION bin) INSTALL(FILES cdda2ogg.1 icedax.1 pitchplay.1 readmult.1 list_audio_tracks.1 DESTINATION ${MANSUBDIR}/man1) Index: cdrkit/icedax/icedax.c diff -c cdrkit/icedax/icedax.c:1.1.1.1 cdrkit/icedax/icedax.c:1.2 *** cdrkit/icedax/icedax.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/icedax/icedax.c Wed Jul 1 12:56:01 2009 *************** *** 96,102 **** #include #include #include ! #if defined (HAVE_SETPRIORITY) #include #endif #include --- 96,102 ---- #include #include #include ! #if defined (HAVE_SETPRIORITY) && defined(HAVE_SYS_RESOURCE_H) #include #endif #include *************** *** 496,502 **** return; /* end of child or single process */ } ! if (global.have_forked == 1) { #ifdef DEBUG_CLEANUP fprintf(stderr, "Parent wait for child death, \n"); --- 496,502 ---- return; /* end of child or single process */ } ! #ifdef HAVE_FORK if (global.have_forked == 1) { #ifdef DEBUG_CLEANUP fprintf(stderr, "Parent wait for child death, \n"); *************** *** 523,528 **** --- 523,529 ---- fprintf(stderr, "\nW Parent child death, state:%d\n", chld_return_status); #endif } + #endif /* HAVE_FORK */ #ifdef GPROF rename("gmon.out", "gmon.child"); *************** *** 573,578 **** --- 574,580 ---- va_end(marker); + #ifdef HAVE_KILL if (child_pid >= 0) { if (child_pid == 0) { pid_t ppid; *************** *** 586,591 **** --- 588,594 ---- kill(child_pid, SIGINT); } } + #endif exit (1); } *************** *** 988,994 **** } } #else ! #if defined(__CYGWIN32__) /* * NOTE: Base.h from Cygwin-B20 has a second typedef for BOOL. --- 991,997 ---- } } #else ! #if defined(__CYGWIN32__) || defined(__MINGW32__) /* * NOTE: Base.h from Cygwin-B20 has a second typedef for BOOL. *************** *** 1075,1080 **** --- 1078,1084 ---- #if defined DEBUG_CLEANUP fprintf( stderr, "SIGPIPE received from %s\n.", child_pid == 0 ? "Child" : "Parent"); #endif + #ifdef HAVE_KILL if (child_pid == 0) { pid_t ppid; /* *************** *** 1086,1091 **** --- 1090,1096 ---- } else { kill(child_pid, SIGINT); } + #endif exit(SIGPIPE_ERROR); } *************** *** 1568,1573 **** --- 1573,1579 ---- if ( SaveBuffer ( p->data + current_offset/4, how_much, &nSamplesDone) ) { + #ifdef HAVE_KILL if (global.have_forked == 1) { pid_t ppid; /* *************** *** 1577,1582 **** --- 1583,1589 ---- if (ppid > 1) kill(ppid, SIGINT); } + #endif exit(WRITE_ERROR); } *************** *** 2466,2476 **** #define SETSIGHAND(PROC, SIG, SIGNAME) if (signal(SIG, PROC) == SIG_ERR) \ { fprintf(stderr, "cannot set signal %s handler\n", SIGNAME); exit(SETSIG_ERROR); } SETSIGHAND(exit_wrapper, SIGINT, "SIGINT") - SETSIGHAND(exit_wrapper, SIGQUIT, "SIGQUIT") SETSIGHAND(exit_wrapper, SIGTERM, "SIGTERM") SETSIGHAND(exit_wrapper, SIGHUP, "SIGHUP") ! SETSIGHAND(set_nonforked, SIGPIPE, "SIGPIPE") /* setup interface and open cdrom device */ /* request sychronization facilities and shared memory */ --- 2473,2484 ---- #define SETSIGHAND(PROC, SIG, SIGNAME) if (signal(SIG, PROC) == SIG_ERR) \ { fprintf(stderr, "cannot set signal %s handler\n", SIGNAME); exit(SETSIG_ERROR); } SETSIGHAND(exit_wrapper, SIGINT, "SIGINT") SETSIGHAND(exit_wrapper, SIGTERM, "SIGTERM") + #ifdef HAVE_SIGHUP SETSIGHAND(exit_wrapper, SIGHUP, "SIGHUP") ! SETSIGHAND(exit_wrapper, SIGQUIT, "SIGQUIT") SETSIGHAND(set_nonforked, SIGPIPE, "SIGPIPE") + #endif /* setup interface and open cdrom device */ /* request sychronization facilities and shared memory */ Index: cdrkit/icedax/interface.c diff -c cdrkit/icedax/interface.c:1.1.1.1 cdrkit/icedax/interface.c:1.2 *** cdrkit/icedax/interface.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/icedax/interface.c Wed Jul 1 12:56:01 2009 *************** *** 52,58 **** --- 52,60 ---- #include #include + #ifdef HAVE_SYS_IOCTL_H #include + #endif #include *************** *** 599,610 **** --- 601,614 ---- priv_on(); needroot(0); needgroup(0); + #ifdef USE_SCSI_REMOTE /* * Call usal_remote() to force loading the remote SCSI transport library * code that is located in librusal instead of the dummy remote routines * that are located inside libusal. */ usal_remote(); + #endif if (pdev_name != NULL && ((strncmp(pdev_name, "HELP", 4) == 0) || (strncmp(pdev_name, "help", 4) == 0))) { *************** *** 618,625 **** --- 622,633 ---- int err = geterrno(); errmsgno(err, "%s%sCannot open SCSI driver.\n", errstr, errstr[0]?". ":""); + #ifdef HAVE_UID_T_GID_T errmsgno(EX_BAD, "For possible targets try 'wodim -scanbus'.%s\n", geteuid() ? " Make sure you are root.":""); + #else + errmsgno(EX_BAD, "For possible targets try 'wodim -scanbus'.\n"); + #endif priv_off(); dontneedgroup(); dontneedroot(); Index: cdrkit/icedax/ioctl.c diff -c cdrkit/icedax/ioctl.c:1.1.1.1 cdrkit/icedax/ioctl.c:1.2 *** cdrkit/icedax/ioctl.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/icedax/ioctl.c Wed Jul 1 12:56:01 2009 *************** *** 31,37 **** --- 31,39 ---- #include #include + #ifdef HAVE_SYS_IOCTL_H #include + #endif #include #include #include Index: cdrkit/icedax/semshm.c diff -c cdrkit/icedax/semshm.c:1.1.1.1 cdrkit/icedax/semshm.c:1.2 *** cdrkit/icedax/semshm.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/icedax/semshm.c Wed Jul 1 12:56:01 2009 *************** *** 64,69 **** --- 64,70 ---- #include #include #include + #include #if defined(HAVE_SEMGET) && defined(USE_SEMAPHORES) #include Index: cdrkit/icedax/setuid.c diff -c cdrkit/icedax/setuid.c:1.1.1.1 cdrkit/icedax/setuid.c:1.2 *** cdrkit/icedax/setuid.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/icedax/setuid.c Wed Jul 1 12:56:01 2009 *************** *** 43,52 **** --- 43,54 ---- /*#define DEBUG*/ /* True at return from initsecurity */ + #ifdef HAVE_UID_T_GID_T static uid_t real_uid = (uid_t) (-1); static uid_t effective_uid = (uid_t) (-1); static gid_t real_gid = (gid_t) (-1); static gid_t effective_gid = (gid_t) (-1); + #endif /* HAVE_UID_T_GID_T */ /* Run this at the beginning of the program to initialize this code and to drop privileges before someone uses them to shoot us in the foot. *************** *** 54,59 **** --- 56,62 ---- void initsecurity() { + #ifdef HAVE_UID_T_GID_T int leffective_uid; alarm(0); /* can be inherited from parent process */ *************** *** 70,75 **** --- 73,79 ---- effective_gid = getegid(); dontneedroot(); dontneedgroup(); + #endif /* HAVE_UID_T_GID_T */ } /* Temporarily gain root privileges. */ *************** *** 82,87 **** --- 86,92 ---- void needroot(int necessary) { + #ifdef HAVE_UID_T_GID_T #ifdef DEBUG fprintf(stderr, "call to needroot (_euid_=%d, uid=%d), current=%d/%d, pid=%d\n", effective_uid, real_uid, geteuid(), getuid(), getpid()); *************** *** 121,132 **** --- 126,139 ---- fprintf(stderr, "exit of needroot (_euid_=%d, uid=%d), current=%d/%d, pid=%d\n", effective_uid, real_uid, geteuid(), getuid(), getpid()); #endif + #endif /* HAVE_UID_T_GID_T */ } /* Temporarily drop root privileges. */ void dontneedroot() { + #ifdef HAVE_UID_T_GID_T #ifdef DEBUG fprintf(stderr, "call to dontneedroot (_euid_=%d, uid=%d), current=%d/%d, pid=%d\n", effective_uid, real_uid, geteuid(), getuid(), getpid()); *************** *** 160,171 **** --- 167,180 ---- #endif exit(PERM_ERROR); } + #endif /* HAVE_UID_T_GID_T */ } /* Permanently drop root privileges. */ void neverneedroot() { + #ifdef HAVE_UID_T_GID_T #ifdef DEBUG fprintf(stderr, "call to neverneedroot (_euid_=%d, uid=%d), current=%d/%d, pid=%d\n", effective_uid, real_uid, geteuid(), getuid(), getpid()); *************** *** 205,216 **** --- 214,227 ---- fprintf(stderr, "exit of neverneedroot (_euid_=%d, uid=%d), current=%d/%d, pid=%d\n", effective_uid, real_uid, geteuid(), getuid(), getpid()); #endif + #endif /* HAVE_UID_T_GID_T */ } /* Temporarily gain group privileges. */ void needgroup(int necessary) { + #ifdef HAVE_UID_T_GID_T #ifdef DEBUG fprintf(stderr, "call to needgroup (egid=%d, gid=%d), current=%d/%d, pid=%d\n", effective_gid, real_gid, getegid(), getgid(), getpid()); *************** *** 239,250 **** --- 250,263 ---- fprintf(stderr, "Fatal error: did not get group privilege.\n"); exit(PERM_ERROR); } + #endif /* HAVE_UID_T_GID_T */ } /* Temporarily drop group privileges. */ void dontneedgroup() { + #ifdef HAVE_UID_T_GID_T #ifdef DEBUG fprintf(stderr, "call to dontneedgroup (egid=%d, gid=%d), current=%d/%d, pid=%d\n", effective_gid, real_gid, getegid(), getgid(), getpid()); *************** *** 275,286 **** --- 288,301 ---- fprintf(stderr, "exit if dontneedgroup (egid=%d, gid=%d), current=%d/%d, pid=%d\n", effective_gid, real_gid, getegid(), getgid(), getpid()); #endif + #endif /* HAVE_UID_T_GID_T */ } /* Permanently drop group privileges. */ void neverneedgroup() { + #ifdef HAVE_UID_T_GID_T #ifdef DEBUG fprintf(stderr, "call to neverneedgroup (egid=%d, gid=%d), current=%d/%d, pid=%d\n", effective_gid, real_gid, getegid(), getgid(), getpid()); *************** *** 312,317 **** --- 327,333 ---- exit(PERM_ERROR); } effective_gid = real_gid; + #endif /* HAVE_UID_T_GID_T */ } #if defined (HPUX) Index: cdrkit/icedax/sndconfig.c diff -c cdrkit/icedax/sndconfig.c:1.1.1.1 cdrkit/icedax/sndconfig.c:1.2 *** cdrkit/icedax/sndconfig.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/icedax/sndconfig.c Wed Jul 1 12:56:01 2009 *************** *** 18,26 **** #include #include #include #include ! #if !defined __CYGWIN32__ # include #endif #include --- 18,28 ---- #include #include #include + #ifdef HAVE_SYS_IOCTL_H #include + #endif ! #if !(defined(__CYGWIN32__) || defined(__MINGW32__)) # include #endif #include *************** *** 52,58 **** #include "sndconfig.h" #ifdef ECHO_TO_SOUNDCARD ! # if defined(__CYGWIN32__) # include # include "mmsystem.h" # endif --- 54,60 ---- #include "sndconfig.h" #ifdef ECHO_TO_SOUNDCARD ! # if defined(__CYGWIN32__) || defined(__MINGW32__) # include # include "mmsystem.h" # endif *************** *** 85,95 **** return 0; } ! # if defined __CYGWIN32__ static HWAVEOUT DeviceID; # define WAVEHDRS 3 static WAVEHDR wavehdr[WAVEHDRS]; static unsigned lastwav = 0; static int check_winsound_caps(int bits, double rate, int channels); --- 87,105 ---- return 0; } ! # if defined __CYGWIN32__ || defined __MINGW32__ static HWAVEOUT DeviceID; + #ifndef __MINGW32__ # define WAVEHDRS 3 + #else + # define WAVEHDRS 75 + #endif static WAVEHDR wavehdr[WAVEHDRS]; static unsigned lastwav = 0; + #ifdef __MINGW32__ + static unsigned wavehdrinuse = 0; + static HANDLE waveOutEvent; + #endif static int check_winsound_caps(int bits, double rate, int channels); *************** *** 127,132 **** --- 137,159 ---- return result; } + + #ifdef __MINGW32__ + static void CALLBACK waveOutProc(HWAVEOUT hwo, + UINT uMsg, + DWORD dwInstance, + DWORD dwParam1, + DWORD dwParam2) + { + if (uMsg == WOM_DONE) { + if (wavehdrinuse) { + wavehdrinuse--; + SetEvent(waveOutEvent); + } + } + } + #endif + # endif /* defined CYGWIN */ #endif /* defined ECHO_TO_SOUNDCARD */ *************** *** 252,258 **** # endif } # else /* SUN audio */ ! # if defined(__CYGWIN32__) /* Windows sound info */ MMRESULT mmres; --- 279,285 ---- # endif } # else /* SUN audio */ ! # if defined(__CYGWIN32__) || defined(__MINGW32__) /* Windows sound info */ MMRESULT mmres; *************** *** 281,287 **** --- 308,319 ---- wavform.nBlockAlign = global.channels * (wavform.wBitsPerSample / 8); DeviceID = 0; + #ifdef __MINGW32__ + waveOutEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + mmres = waveOutOpen(&DeviceID, WAVE_MAPPER, &wavform, (DWORD)&waveOutProc, 0, CALLBACK_FUNCTION); + #else mmres = waveOutOpen(&DeviceID, WAVE_MAPPER, &wavform, (unsigned long)WIN_CallBack, 0, CALLBACK_FUNCTION); + #endif if (mmres) { char erstr[329]; *************** *** 316,322 **** --- 348,358 ---- } wavehdr[i].dwLoops = 0; + #ifdef __MINGW32__ + wavehdr[i].dwFlags |= WHDR_DONE; + #else wavehdr[i].dwFlags = WHDR_DONE; + #endif wavehdr[i].dwBufferLength = 0; } } *************** *** 463,469 **** int fl; #endif ! #if defined ECHO_TO_SOUNDCARD && !defined __CYGWIN32__ && !defined __EMX__ global.soundcard_fd = open(snd_device, O_WRONLY #ifdef linux /* Linux BUG: the sound driver open() blocks, if the device is in use. */ --- 499,505 ---- int fl; #endif ! #if defined ECHO_TO_SOUNDCARD && !defined __CYGWIN32__ && !defined __MINGW32__ && !defined __EMX__ global.soundcard_fd = open(snd_device, O_WRONLY #ifdef linux /* Linux BUG: the sound driver open() blocks, if the device is in use. */ *************** *** 489,496 **** return 0; #else ! # if defined __CYGWIN32__ waveOutReset(0); return waveOutClose(DeviceID); # else /* !Cygwin32 */ --- 525,535 ---- return 0; #else ! # if defined __CYGWIN32__ || defined __MINGW32__ waveOutReset(0); + #ifdef __MINGW32__ + CloseHandle(waveOutEvent); + #endif return waveOutClose(DeviceID); # else /* !Cygwin32 */ *************** *** 518,526 **** { int result = 0; #ifdef ECHO_TO_SOUNDCARD ! #if defined __CYGWIN32__ MMRESULT mmres; wavehdr[lastwav].dwBufferLength = todo; memcpy(wavehdr[lastwav].lpData, buffer, todo); --- 557,572 ---- { int result = 0; #ifdef ECHO_TO_SOUNDCARD ! #if defined __CYGWIN32__ || defined __MINGW32__ MMRESULT mmres; + #ifdef __MINGW32__ + while (wavehdrinuse >= WAVEHDRS) { + WaitForSingleObject(waveOutEvent, INFINITE); + ResetEvent(waveOutEvent); + } + wavehdrinuse++; + #endif wavehdr[lastwav].dwBufferLength = todo; memcpy(wavehdr[lastwav].lpData, buffer, todo); Index: cdrkit/icedax/toc.c diff -c cdrkit/icedax/toc.c:1.1.1.1 cdrkit/icedax/toc.c:1.2 *** cdrkit/icedax/toc.c:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/icedax/toc.c Wed Jul 1 12:56:01 2009 *************** *** 45,51 **** --- 45,53 ---- #include #include #include + #ifdef HAVE_SYS_IOCTL_H #include + #endif #define CD_TEXT #define CD_EXTRA Index: cdrkit/include/AddNetworkBits.cmake diff -c cdrkit/include/AddNetworkBits.cmake:1.1.1.1 cdrkit/include/AddNetworkBits.cmake:1.2 *** cdrkit/include/AddNetworkBits.cmake:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/include/AddNetworkBits.cmake Wed Jul 1 12:56:01 2009 *************** *** 6,16 **** INCLUDE(CheckCSourceCompiles) SET(TESTSRC " #include #include ! int main(int argc, char **argv) { ! return socket(AF_INET, SOCK_STREAM, 0); } ") --- 6,19 ---- INCLUDE(CheckCSourceCompiles) SET(TESTSRC " + #ifdef _WIN32 + #include + #else #include #include ! #endif int main(int argc, char **argv) { ! return 0; /* socket(AF_INET, SOCK_STREAM, 0); */ } ") *************** *** 18,38 **** CHECK_C_SOURCE_COMPILES("${TESTSRC}" USE_LIBC_SOCKET) IF(NOT USE_LIBC_SOCKET) ! ! LIST(APPEND EXTRA_LIBS socket) ! ! SET(CMAKE_REQUIRED_LIBRARIES socket) ! CHECK_C_SOURCE_COMPILES("${TESTSRC}" USE_LIBSOCKET) IF(NOT USE_LIBSOCKET) ! MESSAGE(FATAL_ERROR "No working socket(...) found in libc or libsocket") ENDIF(NOT USE_LIBSOCKET) ENDIF(NOT USE_LIBC_SOCKET) SET(TESTSRC " #include #include #include int main(int argc, char **argv) { struct hostent *h = gethostbyname(argv[0]); --- 21,52 ---- CHECK_C_SOURCE_COMPILES("${TESTSRC}" USE_LIBC_SOCKET) IF(NOT USE_LIBC_SOCKET) ! IF(WIN32) ! SET(CMAKE_REQUIRED_LIBRARIES ws2_32) ! CHECK_C_SOURCE_COMPILES("${TESTSRC}" USE_LIBSOCKET) ! IF(USE_LIBSOCKET) ! LIST(APPEND EXTRA_LIBS ws2_32) ! ENDIF(USE_LIBSOCKET) ! #SET(USE_LIBSOCKET TRUE) ! ELSE(WIN32) ! LIST(APPEND EXTRA_LIBS socket) ! SET(CMAKE_REQUIRED_LIBRARIES socket) ! CHECK_C_SOURCE_COMPILES("${TESTSRC}" USE_LIBSOCKET) ! ENDIF(WIN32) IF(NOT USE_LIBSOCKET) ! MESSAGE(FATAL_ERROR "No working socket(...) found in libc or libsocket") ENDIF(NOT USE_LIBSOCKET) ENDIF(NOT USE_LIBC_SOCKET) SET(TESTSRC " + #ifdef _WIN32 + #include + #else #include #include #include + #endif int main(int argc, char **argv) { struct hostent *h = gethostbyname(argv[0]); *************** *** 40,46 **** } ") ! CHECK_C_SOURCE_COMPILES("${TESTSRC}" USE_LIBC_NLS) IF(NOT USE_LIBC_NLS) SET(CMAKE_REQUIRED_LIBRARIES nls) CHECK_C_SOURCE_COMPILES("${TESTSRC}" USE_LIBNLS) --- 54,71 ---- } ") ! IF(WIN32) ! # actuall, ws2_32.lib/.dll provide the gethostbyname functionality: ! SET(CMAKE_REQUIRED_LIBRARIES ws2_32) ! CHECK_C_SOURCE_COMPILES("${TESTSRC}" USE_LIBC_NLS) ! IF(USE_LIBC_NLS) ! LIST(APPEND EXTRA_LIBS ws2_32) ! ENDIF(USE_LIBC_NLS) ! ELSE(WIN32) ! SET(CMAKE_REQUIRED_LIBRARIES nls) ! CHECK_C_SOURCE_COMPILES("${TESTSRC}" USE_LIBC_NLS) ! ENDIF(WIN32) ! IF(NOT USE_LIBC_NLS) SET(CMAKE_REQUIRED_LIBRARIES nls) CHECK_C_SOURCE_COMPILES("${TESTSRC}" USE_LIBNLS) Index: cdrkit/include/AddScgBits.cmake diff -c cdrkit/include/AddScgBits.cmake:1.1.1.1 cdrkit/include/AddScgBits.cmake:1.2 *** cdrkit/include/AddScgBits.cmake:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/include/AddScgBits.cmake Wed Jul 1 12:56:01 2009 *************** *** 27,49 **** INCLUDE(CheckCSourceCompiles) - SET(TESTSRC " - #include - #include - - int main(int argc, char **argv) { - return socket(AF_INET, SOCK_STREAM, 0); - } - ") - - SET(CMAKE_REQUIRED_LIBRARIES ) - CHECK_C_SOURCE_COMPILES("${TESTSRC}" LIBC_SOCKET) - - IF(NOT LIBC_SOCKET) - LIST(APPEND EXTRA_LIBS -lsocket) - #MESSAGE("Using libsocket for socket functions") - ENDIF(NOT LIBC_SOCKET) - SET(TESTSRC " #include --- 27,32 ---- *************** *** 58,65 **** CHECK_C_SOURCE_COMPILES("${TESTSRC}" LIBC_SCHED) IF(NOT LIBC_SCHED) ! LIST(APPEND EXTRA_LIBS -lrt) ! #MESSAGE("Using librt for realtime functions") ENDIF(NOT LIBC_SCHED) ENDIF(NOT GUARD_SCGCONFIG) --- 41,50 ---- CHECK_C_SOURCE_COMPILES("${TESTSRC}" LIBC_SCHED) IF(NOT LIBC_SCHED) ! IF(NOT WIN32) ! LIST(APPEND EXTRA_LIBS -lrt) ! #MESSAGE("Using librt for realtime functions") ! ENDIF(NOT WIN32) ENDIF(NOT LIBC_SCHED) ENDIF(NOT GUARD_SCGCONFIG) Index: cdrkit/include/CMakeLists.txt diff -c cdrkit/include/CMakeLists.txt:1.1.1.1 cdrkit/include/CMakeLists.txt:1.2 *** cdrkit/include/CMakeLists.txt:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/include/CMakeLists.txt Wed Jul 1 12:56:01 2009 *************** *** 74,79 **** --- 74,82 ---- CHECK_INCLUDE_FILES("sys/types.h;sys/dkio.h" HAVE_SYS_DKIO_H) CHECK_INCLUDE_FILES("sys/types.h;sun/dkio.h" HAVE_SUN_DKIO_H) CHECK_INCLUDE_FILES("iconv.h" HAVE_ICONV_H) + CHECK_INCLUDE_FILES("localcharset.h" HAVE_LOCALCHARSET_H) + CHECK_INCLUDE_FILES("langinfo.h" HAVE_LANGINFO_H) + CHECK_INCLUDE_FILES("netinet/in.h" HAVE_NETINET_IN_H) INCLUDE(CheckCSourceCompiles) *************** *** 109,123 **** SET(CMAKE_REQUIRED_LIBRARIES ) SET(TESTSRC " #include int main() { return ( (int) drand48() ) ; } ") CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_DRAND48) SET(TESTSRC " #include ! int main() { return ( (int) drand() ) ; } ") ! CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_DRAND) SET(TESTSRC " #include #include --- 112,213 ---- SET(CMAKE_REQUIRED_LIBRARIES ) SET(TESTSRC " + #include + int main() { ; return 0; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" MAJOR_IN_SYSMACROS) + SET(TESTSRC " + #include + int main() { uid_t u = 0; gid_t g = 0; return 0; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_UID_T_AND_GID_T) + SET(TESTSRC " + #include + int main() { caddr_t a = 0; return 0; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_CADDR_T) + SET(TESTSRC " + #include + int main() { nlink_t a = 0; return 0; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_NLINK_T) + SET(TESTSRC " + #include + int main() { int s = SIGHUP; return 0; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_SIGHUP) + SET(TESTSRC " + #include + int main() { return ( (int) fork() ) ; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_FORK) + SET(TESTSRC " + #include + #include + int main() { return ( setreuid(-1, -1) ) ; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_SETREUID) + SET(TESTSRC " + #include + #include + int main() { return ( seteuid(-1) ) ; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_SETEUID) + SET(TESTSRC " + #include + #include + int main() { return ( setuid(-1) ) ; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_SETUID) + SET(TESTSRC " + #include + #include + int main() { return ( setregid(-1, -1) ) ; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_SETREGID) + SET(TESTSRC " + #include + #include + int main() { return ( setegid(-1) ) ; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_SETEGID) + SET(TESTSRC " + #include + #include + int main() { return ( setgid(-1) ) ; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_SETGID) + SET(TESTSRC " + #include + int main() { int r = sbrk(0); return 0; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_SBRK) + SET(TESTSRC " + #include + int main() { return 0; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_SMMAP) + SET(TESTSRC " + #include + #include + int main() { void * r = shmat(0, NULL, 0); return 0; } + ") + CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_SHMAT) + SET(TESTSRC " #include int main() { return ( (int) drand48() ) ; } ") CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_DRAND48) SET(TESTSRC " #include ! int main() { return ( rand() ) ; } ! ") ! CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_RAND) ! SET(TESTSRC " ! #include ! int main() { return ( nice(0) ) ; } ") ! CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_NICE) SET(TESTSRC " #include #include *************** *** 166,170 **** --- 256,278 ---- ") CHECK_C_SOURCE_COMPILES("${TESTSRC}" HAVE_DYN_ARRAYS) + SET(TESTSRC " + #include + #include + int main(int argc, char **argv) { int r = regexec(NULL, NULL, 0, NULL, 0); return r; } + ") + SET(CMAKE_REQUIRED_LIBRARIES ) + CHECK_C_SOURCE_COMPILES("${TESTSRC}" USE_LIBC_REGEX) + + IF(NOT USE_LIBC_REGEX) + SET(CMAKE_REQUIRED_LIBRARIES regex) + CHECK_C_SOURCE_COMPILES("${TESTSRC}" USE_LIBREGEX) + IF(USE_LIBREGEX) + LIST(APPEND EXTRA_LIBS regex) + ELSE(USE_LIBREGEX) + MESSAGE(FATAL_ERROR "No working regex(...) found in libc or libregex") + ENDIF(USE_LIBREGEX) + ENDIF(NOT USE_LIBC_REGEX) + CONFIGURE_FILE( xconfig.h.in xconfig.h) Index: cdrkit/include/libport.h diff -c cdrkit/include/libport.h:1.1.1.1 cdrkit/include/libport.h:1.2 *** cdrkit/include/libport.h:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/include/libport.h Wed Jul 1 12:56:01 2009 *************** *** 61,66 **** --- 61,71 ---- #endif #endif + #ifdef __MINGW32__ + #include + #define pipe(x) _pipe(x, 512, O_BINARY) + #endif + #ifndef HOST_NAME_MAX #ifdef HAVE_SYS_PARAM_H #include /* Include various defs needed with some OS */ *************** *** 117,122 **** --- 122,131 ---- extern int rename(const char *old, const char *new); #endif + #ifdef __MINGW32__ + #define sleep(sec) usleep(sec * 1000000) + #endif + #ifdef __cplusplus } #endif Index: cdrkit/include/standard.h diff -c cdrkit/include/standard.h:1.1.1.1 cdrkit/include/standard.h:1.2 *** cdrkit/include/standard.h:1.1.1.1 Wed Jul 1 12:26:51 2009 --- cdrkit/include/standard.h Wed Jul 1 12:56:01 2009 *************** *** 113,119 **** --- 113,121 ---- typedef int void; # endif #else + # ifndef VOID typedef void VOID; + # endif #endif #if defined(_INCL_SYS_TYPES_H) || defined(off_t) Index: cdrkit/include/timedefs.h diff -c cdrkit/include/timedefs.h:1.1.1.1 cdrkit/include/timedefs.h:1.2 *** cdrkit/include/timedefs.h:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/include/timedefs.h Wed Jul 1 12:56:01 2009 *************** *** 72,78 **** extern "C" { #endif ! #if defined(__CYGWIN32__) || defined(__EMX__) || defined(__linux__) || defined(__DJGPP__) /* * Cygnus defines struct timeval in sys/time.h but not timerclear * timerclear is defined in windows32/Sockets.h ??? --- 72,78 ---- extern "C" { #endif ! #if defined(__CYGWIN32__) || defined(__EMX__) || defined(__linux__) || defined(__DJGPP__) || defined(__MINGW32__) /* * Cygnus defines struct timeval in sys/time.h but not timerclear * timerclear is defined in windows32/Sockets.h ??? Index: cdrkit/include/ttydefs.h diff -c cdrkit/include/ttydefs.h:1.1.1.1 cdrkit/include/ttydefs.h:1.2 *** cdrkit/include/ttydefs.h:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/include/ttydefs.h Wed Jul 1 12:56:01 2009 *************** *** 68,74 **** # define TCGETS TCGETA # define TCSETSW TCSETAW # endif ! # else # define USE_V7_TTY # endif #endif --- 68,74 ---- # define TCGETS TCGETA # define TCSETSW TCSETAW # endif ! # elif defined(HAVE_SYS_IOCTL_H) # define USE_V7_TTY # endif #endif *************** *** 79,85 **** #endif #ifndef TCSANOW ! # if !defined(TCGETS) || !defined(TCSETSW) # define USE_V7_TTY # endif #endif --- 79,85 ---- #endif #ifndef TCSANOW ! # if (!defined(TCGETS) || !defined(TCSETSW)) && defined(HAVE_SYS_IOCTL_H) # define USE_V7_TTY # endif #endif *************** *** 97,103 **** #include #endif ! #if !defined(TIOCGWINSZ) && ! defined(TIOCGSIZE) # ifndef _INCL_SYS_IOCTl_H # include # define _INCL_SYS_IOCTL_H --- 97,103 ---- #include #endif ! #if !defined(TIOCGWINSZ) && ! defined(TIOCGSIZE) && defined(HAVE_SYS_IOCTL_H) # ifndef _INCL_SYS_IOCTl_H # include # define _INCL_SYS_IOCTL_H Index: cdrkit/include/unixstd.h diff -c cdrkit/include/unixstd.h:1.1.1.1 cdrkit/include/unixstd.h:1.2 *** cdrkit/include/unixstd.h:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/include/unixstd.h Wed Jul 1 12:56:01 2009 *************** *** 113,119 **** #define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif ! #if !defined(HAVE_UNISTD_H) || !defined(_POSIX_VERSION) /* * Maybe we need a lot more definitions here... * It is not clear whether we should have prototyped definitions. --- 113,119 ---- #define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif ! #if !(defined(HAVE_UNISTD_H) && defined(_POSIX_VERSION)) && !defined(__MINGW32__) /* * Maybe we need a lot more definitions here... * It is not clear whether we should have prototyped definitions. Index: cdrkit/include/utypes.h diff -c cdrkit/include/utypes.h:1.1.1.1 cdrkit/include/utypes.h:1.2 *** cdrkit/include/utypes.h:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/include/utypes.h Wed Jul 1 12:56:01 2009 *************** *** 392,397 **** --- 392,401 ---- #define OFF_T_MIN TYPE_MINVAL(off_t) #define OFF_T_MAX TYPE_MAXVAL(off_t) + #ifndef HAVE_UID_T_AND_GID_T + typedef int uid_t; + typedef int gid_t; + #endif #define UID_T_MIN TYPE_MINVAL(uid_t) #define UID_T_MAX TYPE_MAXVAL(uid_t) *************** *** 407,412 **** --- 411,419 ---- #define TIME_T_MIN TYPE_MINVAL(time_t) #define TIME_T_MAX TYPE_MAXVAL(time_t) + #ifndef HAVE_CADDR_T + typedef char * caddr_t; + #endif #define CADDR_T_MIN TYPE_MINVAL(caddr_t) #define CADDR_T_MAX TYPE_MAXVAL(caddr_t) *************** *** 425,430 **** --- 432,440 ---- #define INO_T_MIN TYPE_MINVAL(ino_t) #define INO_T_MAX TYPE_MAXVAL(ino_t) + #ifndef HAVE_NLINK_T + typedef unsigned short nlink_t; + #endif #define NLINK_T_MIN TYPE_MINVAL(nlink_t) #define NLINK_T_MAX TYPE_MAXVAL(nlink_t) Index: cdrkit/include/xconfig.h.in diff -c cdrkit/include/xconfig.h.in:1.1.1.1 cdrkit/include/xconfig.h.in:1.2 *** cdrkit/include/xconfig.h.in:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/include/xconfig.h.in Wed Jul 1 12:56:01 2009 *************** *** 88,94 **** #cmakedefine HAVE_SYS_MMAN_H /* to use definitions for mmap()/madvise()... from sys/mman.h */ ! #define MAJOR_IN_SYSMACROS 1 /* if we should include sys/sysmacros.h to get major()/minor()/makedev() */ #cmakedefine HAVE_SYS_DKIO_H #cmakedefine HAVE_SUN_DKIO_H #cmakedefine HAVE_POLL_H --- 88,97 ---- #cmakedefine HAVE_SYS_MMAN_H /* to use definitions for mmap()/madvise()... from sys/mman.h */ ! ! #cmakedefine MAJOR_IN_SYSMACROS ! /* check if we should include sys/sysmacros.h to get major()/minor()/makedev() */ ! #cmakedefine HAVE_SYS_DKIO_H #cmakedefine HAVE_SUN_DKIO_H #cmakedefine HAVE_POLL_H *************** *** 111,116 **** --- 114,126 ---- /* BeOS has inet_ntoa() in */ #cmakedefine HAVE_ICONV_H + /* check whether iconv.h is available */ + + #cmakedefine HAVE_LOCALCHARSET_H + /* check whether langinfo.h is available */ + + #cmakedefine HAVE_LANGINFO_H + /* check whether langinfo.h is available */ /* * Convert to SCHILY name *************** *** 132,143 **** #cmakedefine HAVE_MLOCKALL /* working mlockall() is present in libc */ #define HAVE_FLOCK 1 /* *BSD flock() is present in libc */ ! #define HAVE_SETREUID 1 /* setreuid() is present in libc */ ! #define HAVE_SETEUID 1 /* seteuid() is present in libc */ ! #define HAVE_SETUID 1 /* setuid() is present in libc */ ! #define HAVE_SETREGID 1 /* setregid() is present in libc */ ! #define HAVE_SETEGID 1 /* setegid() is present in libc */ ! #define HAVE_SETGID 1 /* setgid() is present in libc */ #define HAVE_TCGETATTR 1 /* tcgetattr() is present in libc */ #define HAVE_TCSETATTR 1 /* tcsetattr() is present in libc */ #define HAVE_GETHOSTID 1 /* gethostid() is present in libc */ --- 142,159 ---- #cmakedefine HAVE_MLOCKALL /* working mlockall() is present in libc */ #define HAVE_FLOCK 1 /* *BSD flock() is present in libc */ ! #cmakedefine HAVE_SETREUID ! /* setreuid() is present in libc */ ! #cmakedefine HAVE_SETEUID ! /* seteuid() is present in libc */ ! #cmakedefine HAVE_SETUID ! /* setuid() is present in libc */ ! #cmakedefine HAVE_SETREGID ! /* setregid() is present in libc */ ! #cmakedefine HAVE_SETEGID ! /* setegid() is present in libc */ ! #cmakedefine HAVE_SETGID ! /* setgid() is present in libc */ #define HAVE_TCGETATTR 1 /* tcgetattr() is present in libc */ #define HAVE_TCSETATTR 1 /* tcsetattr() is present in libc */ #define HAVE_GETHOSTID 1 /* gethostid() is present in libc */ *************** *** 147,169 **** #define HAVE_POLL 1 /* poll() is present in libc */ #define HAVE_SELECT 1 /* select() is present in libc */ #define HAVE_LCHOWN 1 /* lchown() is present in libc */ ! #define HAVE_SBRK 1 /* sbrk() is present in libc */ #define HAVE_VA_COPY 1 /* va_copy() is present in varargs.h/stdarg.h */ #define HAVE_DUP2 1 /* dup2() is present in libc */ #define HAVE_GETCWD 1 /* POSIX getcwd() is present in libc */ ! #define HAVE_SMMAP 1 /* may map anonymous memory to get shared mem */ ! #define HAVE_SHMAT 1 /* shmat() is present in libc */ #define HAVE_SEMGET 1 /* semget() is present in libc */ #define HAVE_LSTAT 1 /* lstat() is present in libc */ #define HAVE_READLINK 1 /* readlink() is present in libc */ #define HAVE_RENAME 1 /* rename() is present in libc */ #cmakedefine HAVE_RAND ! /* rand() is present in libc */ #cmakedefine HAVE_DRAND48 ! /* drand48() is present in libc */ #define HAVE_SETPRIORITY 1 /* setpriority() is present in libc */ ! #define HAVE_NICE 1 /* nice() is present in libc */ #define HAVE_UNAME 1 /* uname() is present in libc */ #define HAVE_SNPRINTF 1 /* snprintf() is present in libc */ #define HAVE_STRCASECMP 1 /* strcasecmp() is present in libc */ --- 163,194 ---- #define HAVE_POLL 1 /* poll() is present in libc */ #define HAVE_SELECT 1 /* select() is present in libc */ #define HAVE_LCHOWN 1 /* lchown() is present in libc */ ! ! #cmakedefine HAVE_SBRK ! /* check if sbrk() is present in libc */ ! #define HAVE_VA_COPY 1 /* va_copy() is present in varargs.h/stdarg.h */ #define HAVE_DUP2 1 /* dup2() is present in libc */ #define HAVE_GETCWD 1 /* POSIX getcwd() is present in libc */ ! ! #cmakedefine HAVE_SMMAP ! /* check whether may map anonymous memory to get shared mem */ ! ! #cmakedefine HAVE_SHMAT ! /* check whether shmat() is present in libc */ ! #define HAVE_SEMGET 1 /* semget() is present in libc */ #define HAVE_LSTAT 1 /* lstat() is present in libc */ #define HAVE_READLINK 1 /* readlink() is present in libc */ #define HAVE_RENAME 1 /* rename() is present in libc */ #cmakedefine HAVE_RAND ! /* check whether rand() is present in libc */ #cmakedefine HAVE_DRAND48 ! /* check whether drand48() is present in libc */ #define HAVE_SETPRIORITY 1 /* setpriority() is present in libc */ ! #cmakedefine HAVE_NICE ! /* check whether nice() is present in libc */ #define HAVE_UNAME 1 /* uname() is present in libc */ #define HAVE_SNPRINTF 1 /* snprintf() is present in libc */ #define HAVE_STRCASECMP 1 /* strcasecmp() is present in libc */ *************** *** 172,178 **** #define HAVE_SIGSET 1 /* sigset() is present in libc (POSIX) */ #define HAVE_NANOSLEEP 1 /* nanosleep() is present in libc */ #define HAVE_USLEEP 1 /* usleep() is present in libc */ ! #define HAVE_FORK 1 /* fork() is present in libc */ #define HAVE_ALLOCA 1 /* alloca() is present (else use malloc())*/ #define HAVE_VALLOC 1 /* valloc() is present in libc (else use malloc())*/ --- 197,209 ---- #define HAVE_SIGSET 1 /* sigset() is present in libc (POSIX) */ #define HAVE_NANOSLEEP 1 /* nanosleep() is present in libc */ #define HAVE_USLEEP 1 /* usleep() is present in libc */ ! ! #cmakedefine HAVE_SIGHUP ! /* check whether signup is available -- it's not on mingw */ ! ! #cmakedefine HAVE_FORK ! /* check whether fork() is present in libc */ ! #define HAVE_ALLOCA 1 /* alloca() is present (else use malloc())*/ #define HAVE_VALLOC 1 /* valloc() is present in libc (else use malloc())*/ *************** *** 255,260 **** --- 286,299 ---- #define HAVE_LONGLONG 1 /* Compiler defines long long type */ + #cmakedefine HAVE_UID_T_AND_GID_T + /* Check whether uid_t and gid_t are available (from sys/types.h) */ + + #cmakedefine HAVE_CADDR_T + /* Check whether caddr_t is available (from sys/types.h) */ + + #cmakedefine HAVE_NLINK_T + /* Check whether nlink_t is available (from sys/types.h) */ /* * Critical on some of Debian architectures (EB) */ Index: cdrkit/librols/fexec.c diff -c cdrkit/librols/fexec.c:1.1.1.1 cdrkit/librols/fexec.c:1.2 *** cdrkit/librols/fexec.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/librols/fexec.c Wed Jul 1 12:56:01 2009 *************** *** 31,36 **** --- 31,37 ---- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MINGW32__ #include #include #include *************** *** 419,421 **** --- 420,424 ---- ev++; } } + + #endif /* __MINGW32__ */ Index: cdrkit/librols/spawn.c diff -c cdrkit/librols/spawn.c:1.1.1.1 cdrkit/librols/spawn.c:1.2 *** cdrkit/librols/spawn.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/librols/spawn.c Wed Jul 1 12:56:01 2009 *************** *** 31,36 **** --- 31,37 ---- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __MINGW32__ #include #include #include *************** *** 168,170 **** --- 169,173 ---- return (WEXITSTATUS(status)); } + + #endif /* __MINGW32__ */ Index: cdrkit/librols/stdio/schilyio.h diff -c cdrkit/librols/stdio/schilyio.h:1.1.1.1 cdrkit/librols/stdio/schilyio.h:1.2 *** cdrkit/librols/stdio/schilyio.h:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/librols/stdio/schilyio.h Wed Jul 1 12:56:01 2009 *************** *** 55,62 **** --- 55,67 ---- * If HAVE_LARGEFILES is defined, it is guaranteed that fseeko()/ftello() * both are available. */ + #ifdef __MINGW32__ + # define fseek fseeko64 + # define ftell ftello64 + #else # define fseek fseeko # define ftell ftello + #endif #else /* !HAVE_LARGEFILES */ /* Index: cdrkit/libusal/CMakeLists.txt diff -c cdrkit/libusal/CMakeLists.txt:1.1.1.1 cdrkit/libusal/CMakeLists.txt:1.2 *** cdrkit/libusal/CMakeLists.txt:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/libusal/CMakeLists.txt Wed Jul 1 13:06:56 2009 *************** *** 1,5 **** PROJECT (LIBSCG C) ! INCLUDE_DIRECTORIES(../include ${CMAKE_BINARY_DIR}) include(../include/AddScgBits.cmake) ADD_DEFINITIONS(-DUSE_RCMD_RSH) --- 1,5 ---- PROJECT (LIBSCG C) ! INCLUDE_DIRECTORIES(../include ../libusal ${CMAKE_BINARY_DIR}) include(../include/AddScgBits.cmake) ADD_DEFINITIONS(-DUSE_RCMD_RSH) Index: cdrkit/libusal/scsi-remote.c diff -c cdrkit/libusal/scsi-remote.c:1.1.1.1 cdrkit/libusal/scsi-remote.c:1.2 *** cdrkit/libusal/scsi-remote.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/libusal/scsi-remote.c Wed Jul 1 12:56:02 2009 *************** *** 86,92 **** * On Cygwin, there are no privilleged ports. * On UNIX, rcmd() uses privilleged port that only work for root. */ ! #ifdef IS_CYGWIN #define privport_ok() (1) #else #ifdef HAVE_GETPPRIV --- 86,92 ---- * On Cygwin, there are no privilleged ports. * On UNIX, rcmd() uses privilleged port that only work for root. */ ! #if defined(IS_CYGWIN) || defined(__MINGW32__) #define privport_ok() (1) #else #ifdef HAVE_GETPPRIV Index: cdrkit/libusal/scsi-wnt.c diff -c cdrkit/libusal/scsi-wnt.c:1.1.1.1 cdrkit/libusal/scsi-wnt.c:1.2 *** cdrkit/libusal/scsi-wnt.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/libusal/scsi-wnt.c Wed Jul 1 12:56:02 2009 *************** *** 94,99 **** --- 94,103 ---- }; #define usallocal(p) ((struct usal_local *)((p)->local)) + #if !defined(offsetof) && defined(__MINGW32__) + #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) + #endif + /* * Local variables */ Index: cdrkit/libusal/scsihack.c diff -c cdrkit/libusal/scsihack.c:1.1.1.1 cdrkit/libusal/scsihack.c:1.2 *** cdrkit/libusal/scsihack.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/libusal/scsihack.c Wed Jul 1 12:56:02 2009 *************** *** 60,66 **** --- 60,68 ---- #include #include #include + #ifdef HAVE_SYS_IOCTL_H #include + #endif #include #include #include *************** *** 234,240 **** #include "scsi-beos.c" #endif ! #ifdef __CYGWIN32__ #define SCSI_IMPL /* Yep, we support WNT and W9? */ #include "scsi-wnt.c" #endif --- 236,242 ---- #include "scsi-beos.c" #endif ! #if defined(__CYGWIN32__) || defined(__MINGW32__) #define SCSI_IMPL /* Yep, we support WNT and W9? */ #include "scsi-wnt.c" #endif Index: cdrkit/libusal/scsiopen.c diff -c cdrkit/libusal/scsiopen.c:1.1.1.1 cdrkit/libusal/scsiopen.c:1.2 *** cdrkit/libusal/scsiopen.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/libusal/scsiopen.c Wed Jul 1 12:56:02 2009 *************** *** 294,300 **** --- 294,302 ---- printf("Supported SCSI transports for this platform:\n"); SCGO_HELP(usalp, f); + #ifdef USE_SCSI_REMOTE usal_remote()->usalo_help(usalp, f); + #endif usal_sfree(usalp); } return (0); Index: cdrkit/libusal/scsitransp.c diff -c cdrkit/libusal/scsitransp.c:1.1.1.1 cdrkit/libusal/scsitransp.c:1.2 *** cdrkit/libusal/scsitransp.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/libusal/scsitransp.c Wed Jul 1 12:56:02 2009 *************** *** 171,183 **** extern usal_ops_t usal_std_ops; usalp->ops = &usal_std_ops; ! if (device && strncmp(device, "REMOTE", 6) == 0) { ops = usal_remote(); if (ops != NULL) usalp->ops = ops; } ! ret = SCGO_OPEN(usalp, device); if (ret < 0) return (ret); --- 171,183 ---- extern usal_ops_t usal_std_ops; usalp->ops = &usal_std_ops; ! #ifdef USE_SCSI_REMOTE if (device && strncmp(device, "REMOTE", 6) == 0) { ops = usal_remote(); if (ops != NULL) usalp->ops = ops; } ! #endif ret = SCGO_OPEN(usalp, device); if (ret < 0) return (ret); Index: cdrkit/libusal/usal/scsitransp.h diff -c cdrkit/libusal/usal/scsitransp.h:1.1.1.1 cdrkit/libusal/usal/scsitransp.h:1.2 *** cdrkit/libusal/usal/scsitransp.h:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/libusal/usal/scsitransp.h Wed Jul 1 12:56:02 2009 *************** *** 34,39 **** --- 34,41 ---- #ifndef _SCG_SCSITRANSP_H #define _SCG_SCSITRANSP_H + #include + #ifdef __cplusplus extern "C" { #endif *************** *** 246,252 **** --- 248,259 ---- /* * From scsi-remote.c: */ + #if defined(HAVE_FORK) && defined(HAVE_SOCKETPAIR) && defined(HAVE_DUP2) && defined(HAVE_NETDB_H) && defined(HAVE_RCMD) + #ifndef USE_SCSI_REMOTE + #define USE_SCSI_REMOTE 1 + #endif extern usal_ops_t *usal_remote(void); + #endif /* * From scsihelp.c: Index: cdrkit/netscsid/CMakeLists.txt diff -c cdrkit/netscsid/CMakeLists.txt:1.1.1.1 cdrkit/netscsid/CMakeLists.txt:1.2 *** cdrkit/netscsid/CMakeLists.txt:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/netscsid/CMakeLists.txt Wed Jul 1 13:06:56 2009 *************** *** 1,5 **** PROJECT (netscsid C) ! INCLUDE_DIRECTORIES(../include ../wodim ${CMAKE_BINARY_DIR} ) INCLUDE(../include/AddScgBits.cmake) INCLUDE(../include/AddSchilyBits.cmake) INCLUDE(../include/AddNetworkBits.cmake) --- 1,5 ---- PROJECT (netscsid C) ! INCLUDE_DIRECTORIES(../include ../wodim ../libusal ${CMAKE_BINARY_DIR} ) INCLUDE(../include/AddScgBits.cmake) INCLUDE(../include/AddSchilyBits.cmake) INCLUDE(../include/AddNetworkBits.cmake) Index: cdrkit/netscsid/netscsid.c diff -c cdrkit/netscsid/netscsid.c:1.1.1.1 cdrkit/netscsid/netscsid.c:1.2 *** cdrkit/netscsid/netscsid.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/netscsid/netscsid.c Wed Jul 1 12:56:02 2009 *************** *** 50,56 **** --- 50,58 ---- #include /* BSD-4.2 & Linux need this for MAXHOSTNAMELEN */ #endif #include + #ifdef HAVE_PWD_H #include + #endif #include #include *************** *** 60,66 **** --- 62,72 ---- #include #include + #ifdef __MINGW32__ + #include + #else #include + #endif #ifdef HAVE_ARPA_INET_H #include /* BeOS does not have */ #endif /* but inet_ntaoa() is in */ Index: cdrkit/readom/CMakeLists.txt diff -c cdrkit/readom/CMakeLists.txt:1.1.1.1 cdrkit/readom/CMakeLists.txt:1.2 *** cdrkit/readom/CMakeLists.txt:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/readom/CMakeLists.txt Wed Jul 1 13:06:56 2009 *************** *** 1,5 **** PROJECT (READECD C) ! INCLUDE_DIRECTORIES(../include ../wodim ${CMAKE_BINARY_DIR}) INCLUDE(../include/AddScgBits.cmake) INCLUDE(../include/AddSchilyBits.cmake) --- 1,5 ---- PROJECT (READECD C) ! INCLUDE_DIRECTORIES(../include ../wodim ../libusal ${CMAKE_BINARY_DIR}) INCLUDE(../include/AddScgBits.cmake) INCLUDE(../include/AddSchilyBits.cmake) Index: cdrkit/readom/readom.c diff -c cdrkit/readom/readom.c:1.1.1.1 cdrkit/readom/readom.c:1.2 *** cdrkit/readom/readom.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/readom/readom.c Wed Jul 1 12:56:02 2009 *************** *** 371,383 **** } if (dev || scanbus) { char errstr[80]; ! /* * Call usal_remote() to force loading the remote SCSI transport * library code that is located in librusal instead of the dummy * remote routines that are located inside libusal. */ usal_remote(); if (dev != NULL && ((strncmp(dev, "HELP", 4) == 0) || (strncmp(dev, "help", 4) == 0))) { --- 371,384 ---- } if (dev || scanbus) { char errstr[80]; ! #ifdef USE_SCSI_REMOTE /* * Call usal_remote() to force loading the remote SCSI transport * library code that is located in librusal instead of the dummy * remote routines that are located inside libusal. */ usal_remote(); + #endif if (dev != NULL && ((strncmp(dev, "HELP", 4) == 0) || (strncmp(dev, "help", 4) == 0))) { *************** *** 388,395 **** --- 389,400 ---- int err = geterrno(); errmsgno(err, "%s%sCannot open SCSI driver.\n", errstr, errstr[0]?". ":""); + #ifdef HAVE_UID_T_AND_GID_T errmsgno(EX_BAD, "For possible targets try 'wodim -scanbus'.%s\n", geteuid() ? " Make sure you are root.":""); + #else + errmsgno(EX_BAD, "For possible targets try 'wodim -scanbus'.\n"); + #endif errmsgno(EX_BAD, "For possible transport specifiers try 'wodim dev=help'.\n"); exit(err); } *************** *** 434,439 **** --- 439,445 ---- priv_set(PRIV_OFF, PRIV_INHERITABLE, PRIV_FILE_DAC_READ, PRIV_NET_PRIVADDR, PRIV_SYS_DEVICES, NULL); #endif + #ifdef HAVE_UID_T_AND_GID_T /* * This is only for OS that do not support fine grained privs. */ *************** *** 452,458 **** #endif #endif comerr("Panic cannot set back effective uid.\n"); ! /* code to use SCG */ if (scanbus) { --- 458,464 ---- #endif #endif comerr("Panic cannot set back effective uid.\n"); ! #endif /* HAVE_UID_T_GID_T */ /* code to use SCG */ if (scanbus) { Index: cdrkit/wodim/CMakeLists.txt diff -c cdrkit/wodim/CMakeLists.txt:1.1.1.1 cdrkit/wodim/CMakeLists.txt:1.3 *** cdrkit/wodim/CMakeLists.txt:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/wodim/CMakeLists.txt Wed Jul 1 13:06:56 2009 *************** *** 1,7 **** PROJECT (CDRECORD C) ! INCLUDE_DIRECTORIES(../include ../libedc ${CMAKE_BINARY_DIR}) INCLUDE(../include/AddScgBits.cmake) include(../include/AddSchilyBits.cmake) #AUX_SOURCE_DIRECTORY(. CDRECORD_SRCS) SET(CDRECORD_SRCS wodim.c audiosize.c auinfo.c cdr_drv.c cdtext.c clone.c crc16.c cue.c diskid.c drv_7501.c drv_jvc.c drv_mmc.c drv_philips.c drv_simul.c drv_sony.c fifo.c isosize.c scsi_cdr_mmc4.c scsi_mmc4.c sector.c subchan.c wm_packet.c wm_session.c wm_track.c xio.c) --- 1,8 ---- PROJECT (CDRECORD C) ! INCLUDE_DIRECTORIES(../include ../libedc ../libusal ${CMAKE_BINARY_DIR}) INCLUDE(../include/AddScgBits.cmake) include(../include/AddSchilyBits.cmake) + include(../include/AddNetworkBits.cmake) #AUX_SOURCE_DIRECTORY(. CDRECORD_SRCS) SET(CDRECORD_SRCS wodim.c audiosize.c auinfo.c cdr_drv.c cdtext.c clone.c crc16.c cue.c diskid.c drv_7501.c drv_jvc.c drv_mmc.c drv_philips.c drv_simul.c drv_sony.c fifo.c isosize.c scsi_cdr_mmc4.c scsi_mmc4.c sector.c subchan.c wm_packet.c wm_session.c wm_track.c xio.c) Index: cdrkit/wodim/drv_jvc.c diff -c cdrkit/wodim/drv_jvc.c:1.1.1.1 cdrkit/wodim/drv_jvc.c:1.2 *** cdrkit/wodim/drv_jvc.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/wodim/drv_jvc.c Wed Jul 1 12:56:02 2009 *************** *** 50,55 **** --- 50,56 ---- #include #include #include + #include #include #include Index: cdrkit/wodim/drv_mmc.c diff -c cdrkit/wodim/drv_mmc.c:1.1.1.1 cdrkit/wodim/drv_mmc.c:1.2 *** cdrkit/wodim/drv_mmc.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/wodim/drv_mmc.c Wed Jul 1 12:56:02 2009 *************** *** 50,55 **** --- 50,56 ---- #include #include #include + #include #include #include Index: cdrkit/wodim/scsi_cdr.c diff -c cdrkit/wodim/scsi_cdr.c:1.1.1.1 cdrkit/wodim/scsi_cdr.c:1.2 *** cdrkit/wodim/scsi_cdr.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/wodim/scsi_cdr.c Wed Jul 1 12:56:02 2009 *************** *** 61,66 **** --- 61,68 ---- #include #include + #include + #include "scsimmc.h" #include "wodim.h" #include "scsi_scan.h" *************** *** 1279,1284 **** --- 1281,1290 ---- unsigned char sense_table[18]; int i; + #ifndef HAVE_FORK + background = FALSE; + #endif + printf("scsi_format: preparing\n"); fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); *************** *** 1298,1303 **** --- 1304,1311 ---- ret = (usal_cmd(usalp)); printf("scsi_format: post processing %d\n", ret); if (ret == -1) return ret; + + #ifdef HAVE_FORK if (background) { if ((pid=fork()) == (pid_t)-1) perror ("- [unable to fork()]"); *************** *** 1312,1317 **** --- 1320,1327 ---- } } } + #endif + printf("Formating in progress: 0.00 %% done."); sleep(20); i = 0; Index: cdrkit/wodim/scsi_scan.c diff -c cdrkit/wodim/scsi_scan.c:1.1.1.1 cdrkit/wodim/scsi_scan.c:1.2 *** cdrkit/wodim/scsi_scan.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/wodim/scsi_scan.c Wed Jul 1 12:56:02 2009 *************** *** 234,243 **** --- 234,245 ---- if(fd>=0 && 0==fstat(fd, &statbuf)) { if(statbuf.st_mode&S_IRUSR) perms[0]= 'r'; if(statbuf.st_mode&S_IWUSR) perms[1]= 'w'; + #ifndef __MINGW32__ if(statbuf.st_mode&S_IRGRP) perms[2]= 'r'; if(statbuf.st_mode&S_IWGRP) perms[3]= 'w'; if(statbuf.st_mode&S_IROTH) perms[4]= 'r'; if(statbuf.st_mode&S_IWOTH) perms[5]= 'w'; + #endif } getdev(usalp, FALSE); if(usalp->inq->type == INQ_ROMD || usalp->inq->type == INQ_WORM) { Index: cdrkit/wodim/wodim.c diff -c cdrkit/wodim/wodim.c:1.1.1.1 cdrkit/wodim/wodim.c:1.2 *** cdrkit/wodim/wodim.c:1.1.1.1 Wed Jul 1 12:26:52 2009 --- cdrkit/wodim/wodim.c Wed Jul 1 12:56:02 2009 *************** *** 37,42 **** --- 37,45 ---- */ #include + #ifdef __MINGW32__ + #include + #endif #include #include #include *************** *** 61,66 **** --- 64,70 ---- #ifdef HAVE_PRIV_H #include #endif + #include #include "xio.h" *************** *** 307,314 **** _wildcard(&argc, &argv); #endif save_args(argc, argv); oeuid = geteuid(); /* Remember saved set uid */ ! fillbytes(track, sizeof (track), '\0'); for (i = 0; i < MAX_TRACK+2; i++) track[i].track = track[i].trackno = i; --- 311,319 ---- _wildcard(&argc, &argv); #endif save_args(argc, argv); + #ifdef HAVE_UID_T_AND_GID_T oeuid = geteuid(); /* Remember saved set uid */ ! #endif fillbytes(track, sizeof (track), '\0'); for (i = 0; i < MAX_TRACK+2; i++) track[i].track = track[i].trackno = i; *************** *** 388,400 **** printf("Waiting for data on stdin...\n"); wait_input(); } ! /* * Call usal_remote() to force loading the remote SCSI transport library * code that is located in librusal instead of the dummy remote routines * that are located inside libusal. */ usal_remote(); if (dev != NULL && ((strncmp(dev, "HELP", 4) == 0) || (strncmp(dev, "help", 4) == 0))) { --- 393,406 ---- printf("Waiting for data on stdin...\n"); wait_input(); } ! #ifdef USE_SCSI_REMOTE /* * Call usal_remote() to force loading the remote SCSI transport library * code that is located in librusal instead of the dummy remote routines * that are located inside libusal. */ usal_remote(); + #endif if (dev != NULL && ((strncmp(dev, "HELP", 4) == 0) || (strncmp(dev, "help", 4) == 0))) { *************** *** 453,458 **** --- 459,465 ---- PRIV_FILE_DAC_READ, PRIV_PROC_LOCK_MEMORY, PRIV_PROC_PRIOCNTL, PRIV_NET_PRIVADDR, PRIV_SYS_DEVICES, NULL); #endif + #ifdef HAVE_SETUID /* * This is only for OS that do not support fine grained privs. * *************** *** 471,476 **** --- 478,484 ---- #endif comerr("Panic cannot set back effective uid.\n"); } + #endif /* HAVE_SETUID */ #ifdef __linux__ /* get the rawio capability */ *************** *** 1489,1495 **** --- 1497,1505 ---- (dp->cdr_cmdflags & F_DUMMY)?"dummy":"real", gracetime); flush(); signal(SIGINT, intr); + #ifdef HAVE_SIGHUP signal(SIGHUP, intr); + #endif signal(SIGTERM, intr); for (i = gracetime; --i >= 0; ) { *************** *** 1498,1504 **** --- 1508,1516 ---- printf("\n"); excdr(SIGINT, &exargs); signal(SIGINT, SIG_DFL); + #ifdef HAVE_KILL kill(getpid(), SIGINT); + #endif /* * In case kill() did not work ;-) */ *************** *** 1513,1522 **** --- 1525,1538 ---- printf(" Operation starts."); flush(); signal(SIGINT, SIG_DFL); + #ifdef HAVE_SIGHUP signal(SIGHUP, SIG_DFL); + #endif signal(SIGTERM, SIG_DFL); signal(SIGINT, intfifo); + #ifdef HAVE_SIGHUP signal(SIGHUP, intfifo); + #endif signal(SIGTERM, intfifo); printf("\n"); *************** *** 3899,3906 **** --- 3915,3924 ---- scsi_start_stop_unit(usalp, 1, 0, immed); wait_unit_ready(usalp, 120); usalp->silent++; + #ifdef HAVE_SETEUID if(geteuid() == 0) /* EB: needed? Not allowed for non-root, that is sure. */ rezero_unit(usalp); /* Is this needed? Not supported by some drvives */ + #endif usalp->silent--; test_unit_ready(usalp); scsi_start_stop_unit(usalp, 1, 0, immed); *************** *** 4279,4285 **** #else /* _POSIX_PRIORITY_SCHEDULING */ ! #ifdef __CYGWIN32__ /* * Win32 specific priority settings. */ --- 4297,4303 ---- #else /* _POSIX_PRIORITY_SCHEDULING */ ! #if defined(__CYGWIN32__) || defined(__MINGW32__) /* * Win32 specific priority settings. */ *************** *** 4299,4305 **** --- 4317,4325 ---- * is used by COM/OLE2, I guess it is class on C++ * We man need to #undef 'interface' */ + #ifndef __MINGW32__ #define BOOL WBOOL /* This is the Win BOOL */ + #endif #define format __format /* Avoid format parameter hides global ... */ #include #undef format