Andrew Benton wrote:
> On 09/08/10 05:13, Bruce Dubbs wrote:
>> 雷智 wrote:
>>> Hi,
>>> make all-recursive
>>> make[1]: Entering directory `/blfs-sources/cvs-1.11.23'
>>> Making all in lib
>>> make[2]: Entering directory `/blfs-sources/cvs-1.11.23/lib'
>>> gcc -DHAVE_CONFIG_H -I. -I.. -I../src -g -O2 -MT getline.o -MD -MP -MF
>>> .deps/getline.Tpo -c -o getline.o getline.c
>>> In file included from getline.c:25:
>>> getline.h:15: error: conflicting types for ‘getline’
>>> /usr/include/stdio.h:651: note: previous declaration of ‘getline’ was
>>> here
>>> getline.c:158: error: conflicting types for ‘getline’
>>> /usr/include/stdio.h:651: note: previous declaration of ‘getline’ was
>>> here
>>> make[2]: *** [getline.o] Error 1
>>> make[2]: Leaving directory `/blfs-sources/cvs-1.11.23/lib'
>>> make[1]: *** [all-recursive] Error 1
>>> make[1]: Leaving directory `/blfs-sources/cvs-1.11.23'
>>> make: *** [all] Error 2
>> I don't have time to do it, but edit lib/getline.h and change getline to
>> get_line (one place).
>>
>> Then find all the .c programs that call getline and change those to
>> get_line.
>
> sed -i 's/getline /get_line /' lib/getline.{c,h}
It might work, but that changes more than what is needed.
$ cat getline.c
getline.c getline.h getline.o
bdu...@lfs6:/usr/src/cvs/cvs-1.11.23/lib$ cat getline.h
#ifndef _getline_h_
#define _getline_h_ 1
#include <stdio.h>
#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
#define __PROTO(args) args
#else
#define __PROTO(args) ()
#endif /* GCC. */
#define GETLINE_NO_LIMIT -1
int
getline __PROTO ((char **_lineptr, size_t *_n, FILE *_stream));
int
getline_safe __PROTO ((char **_lineptr, size_t *_n, FILE *_stream,
int limit));
int
getstr __PROTO ((char **_lineptr, size_t *_n, FILE *_stream,
int _terminator, int _offset, int limit));
#endif /* _getline_h_ */
You would also have to change the filename.
-- Bruce
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page