Magic Mailing List |
|
From: R. Timothy Edwards (tim AT stravinsky DOT jhuapl.edu) Date: Fri Nov 24 2000 - 11:47:47 EST
I've received several emails from people who failed to compile magic 7.1 under RedHat Linux 7.0. It looks as though the new RedHat redistributed the balance of SYSV-isms vs. BSD-isms. To make magic compile, it appears to be necessary to remove "-DSYSV" from the DFLAGS, otherwise the magic compile dies on trying to include <string.h> with references to parse errors on "memcpy", etc.: . . . In file included from CIFrdtech.c:40: /usr/include/string.h:245: warning: conflicting types for built-in function `memcpy' /usr/include/string.h:248: parse error before `0' /usr/include/string.h:248: warning: conflicting types for built-in function `memset' /usr/include/string.h:255: parse error before `(' . . . It would appear that the solution is to reconsider Linux either as a BSD-UNIX with SYSV-like deviations, or a SYSV-UNIX with BSD-like deviations. If one takes the former approach, then it is necessary to remove the -DSYSV and make sure that all occurrences of #ifdef SYSV become #if defined(SYSV) || defined(linux) and all occurences of #ifndef SYSV become #if !defined(SYSV) && !defined(linux) This needs to be done in plot/plotInt.h line 30, textio/textioInt.h line51, and textio/txInput.c lines 473, 512, 518, 546, 552, 570, 597, and 638. Additionally, textio/txInput.c needs the following addition up at the top of the file (say, line 51): #ifdef linux #include <termios.h> #endif There is some fallout from not including <string.h> (or alternatively, <strings.h>) wherein the compiler doesn't get the function prototypes for all the string functions and spews out lots of warning messages about pointer casts. This is better than generating parse errors, but there must be a "correct" solution. Opinions? ---Tim
|
|