On Tue, Mar 11, 2003 at 03:47:47PM +0100, Lars Gullik Bjønnes wrote: > "Kayvan A. Sylvan" <[EMAIL PROTECTED]> writes: > > | This makes it possible to build lyx on Cygwin with GCC 3.2 (instead > | of requiring that lyx be built with GCC2). > | > | Please apply. > > Note that libtool.m4 is not our file. It is from the libtool package. > And that is where this patch should really go. > > Have any of this been sent to the libtool people?
Today, I sent the patch off to the libtool people. Regardless, I think it should be applied to our own version of the file. At some future date, that version will get supplanted by the latest and greatest from libtool (which should hopefully contain the patch or some variant). In addition, the following patch fixes a problem that is introduced only in the LyX-specific version of the libtool.m4. There are suprious tab characters where spaces should be. This matters because the generated "impgen.c" file, used at the linking stage on Cygwin, will not compile (needing to be hand-massaged). With these patches, LyX on Cygwin now compiles cleanly with the latest Cygwin (GCC-3, XFree86, tetex), requiring no special hacks! ---Kayvan -- Kayvan A. Sylvan | Proud husband of | Father to my kids: Sylvan Associates, Inc. | Laura Isabella Sylvan | Katherine Yelena (8/8/89) http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92)
Index: config/libtool.m4 =================================================================== RCS file: /cvs/lyx/lyx-devel/config/libtool.m4,v retrieving revision 1.5 diff -u -r1.5 libtool.m4 --- config/libtool.m4 2002/08/14 11:24:22 1.5 +++ config/libtool.m4 2003/03/12 21:34:49 @@ -2737,44 +2775,44 @@ # # dll = open(filename, O_RDONLY|O_BINARY); # if (dll < 1) -# return 1; +# return 1; # # dll_name = filename; # # for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; +# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') +# dll_name = filename + i +1; # # pe_header_offset = pe_get32 (dll, 0x3c); # opthdr_ofs = pe_header_offset + 4 + 20; # num_entries = pe_get32 (dll, opthdr_ofs + 92); # # if (num_entries < 1) /* no exports */ -# return 1; +# return 1; # # export_rva = pe_get32 (dll, opthdr_ofs + 96); # export_size = pe_get32 (dll, opthdr_ofs + 100); # nsections = pe_get16 (dll, pe_header_offset + 4 +2); # secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); +# pe_get16 (dll, pe_header_offset + 4 + 16)); # # expptr = 0; # for (i = 0; i < nsections; i++) # { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } +# char sname[8]; +# unsigned long secptr1 = secptr + 40 * i; +# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); +# unsigned long vsize = pe_get32 (dll, secptr1 + 16); +# unsigned long fptr = pe_get32 (dll, secptr1 + 20); +# lseek(dll, secptr1, SEEK_SET); +# read(dll, sname, 8); +# if (vaddr <= export_rva && vaddr+vsize > export_rva) +# { +# expptr = fptr + (export_rva - vaddr); +# if (export_rva + export_size > vaddr + vsize) +# export_size = vsize - (export_rva - vaddr); +# break; +# } # } # # expdata = (unsigned char*)malloc(export_size); @@ -2788,8 +2826,8 @@ # printf ("EXPORTS\n"); # for (i = 0; i<nexp; i++) # { -# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4); -# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i); +# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4); +# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i); # } # # return 0;