Here is a good, self-contained patch, touching only the build mechanism. Please apply, and "cvs add" config/cygwin.m4
-- 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)
? config/cygwin.m4 Index: ChangeLog =================================================================== RCS file: /cvs/lyx/lyx-devel/ChangeLog,v retrieving revision 1.924 diff -u -r1.924 ChangeLog --- ChangeLog 2003/03/08 13:47:20 1.924 +++ ChangeLog 2003/03/13 01:00:11 @@ -1,3 +1,7 @@ +2003-03-12 Kayvan Sylvan <[EMAIL PROTECTED]> + + * autogen.sh (ACINCLUDE_FILES): Added cygwin.m4 + 2003-03-08 Lars Gullik Bjønnes <[EMAIL PROTECTED]> * add bogus entry Index: autogen.sh =================================================================== RCS file: /cvs/lyx/lyx-devel/autogen.sh,v retrieving revision 1.43 diff -u -r1.43 autogen.sh --- autogen.sh 2003/02/11 13:07:37 1.43 +++ autogen.sh 2003/03/13 01:00:11 @@ -4,7 +4,7 @@ AUTOHEADER="autoheader" AUTOMAKE="automake -a -c --foreign" AUTOCONF="autoconf" -ACINCLUDE_FILES="lyxinclude.m4 libtool.m4 codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4 progtest.m4 xforms.m4 qt.m4 gtk--.m4 gnome--.m4 gnome.m4 pspell.m4 pkg.m4" +ACINCLUDE_FILES="lyxinclude.m4 libtool.m4 codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4 progtest.m4 xforms.m4 qt.m4 gtk--.m4 gnome--.m4 gnome.m4 pspell.m4 cygwin.m4 pkg.m4" # Discover what version of autoconf we are using. autoversion=`$AUTOCONF --version | head -n 1` Index: config/ChangeLog =================================================================== RCS file: /cvs/lyx/lyx-devel/config/ChangeLog,v retrieving revision 1.95 diff -u -r1.95 ChangeLog --- config/ChangeLog 2003/03/10 19:18:42 1.95 +++ config/ChangeLog 2003/03/13 01:00:42 @@ -1,3 +1,15 @@ +2003-03-12 Kayvan Sylvan <[EMAIL PROTECTED]> + + * configure.ac configure.in: Add the CHECK_WITH_CYGWIN macro call. + + * Makefile.am: add cygwin.m4 to EXTRA_DIST + + * cygwin.m4: Add CHECK_WITH_CYGWIN function to encapuslate + some checks for Win32 GCC based on info from the following URL: + http://bugzilla.gnome.org/showattachment.cgi?attach_id=12253 + + * libtool.m4: TAB to SPACE fixes. Now impgen.c compiles on Cygwin. + 2003-03-10 Lars Gullik Bjønnes <[EMAIL PROTECTED]> * pspell.m4: simplify pspell checking even more Index: config/Makefile.am =================================================================== RCS file: /cvs/lyx/lyx-devel/config/Makefile.am,v retrieving revision 1.7 diff -u -r1.7 Makefile.am --- config/Makefile.am 2003/02/18 18:00:51 1.7 +++ config/Makefile.am 2003/03/13 01:00:42 @@ -4,4 +4,4 @@ lyxinclude.m4 lyxinclude25x.m4 lyxinclude213.m4 \ glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4 progtest.m4 \ qt.m4 gtk--.m4 gnome--.m4 gnome.m4 pkg.m4 xforms.m4 pspell.m4 \ - relyx_configure.ac relyx_configure.in + relyx_configure.ac relyx_configure.in cygwin.m4 Index: config/configure.ac =================================================================== RCS file: /cvs/lyx/lyx-devel/config/configure.ac,v retrieving revision 1.32 diff -u -r1.32 configure.ac --- config/configure.ac 2003/03/10 14:28:14 1.32 +++ config/configure.ac 2003/03/13 01:00:42 @@ -131,6 +131,9 @@ ### Check if we want pspell libraries CHECK_WITH_PSPELL +### Check for some Cygwin-specific details. +CHECK_WITH_CYGWIN + ### Check for X libraries # The real thing. AC_PATH_XTRA Index: config/configure.in =================================================================== RCS file: /cvs/lyx/lyx-devel/config/configure.in,v retrieving revision 1.25 diff -u -r1.25 configure.in --- config/configure.in 2003/03/10 14:28:14 1.25 +++ config/configure.in 2003/03/13 01:00:43 @@ -134,6 +134,9 @@ ### Check if we want pspell libraries CHECK_WITH_PSPELL +### Check for some Cygwin-specific details. +CHECK_WITH_CYGWIN + ### Check for X libraries # The real thing. AC_PATH_XTRA 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/13 01:00:58 @@ -2737,44 +2737,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 +2788,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;
# Macro added for some Cygwin-specific support -*- sh -*- # @author@: Kayvan Sylvan AC_DEFUN(CHECK_WITH_CYGWIN, [ case $host_os in cygwin* | mingw* | pw32* ) if test "$GCC" = yes; then # Ensure MSVC-compatible struct packing convention. # Depends on GCC version. gcc2 uses -fnative-struct while # gcc3 uses -mms-bitfields. # msnative_struct='' AC_MSG_CHECKING([how to get MSVC-compatible struct packing]) case `$CC --version | sed -e 's,\..*,.,' -e q` in 2.) if $CC -v --help 2>/dev/null | grep fnative-struct > /dev/null; then msnative_struct='-fnative-struct' fi ;; *) if $CC -v --help 2>/dev/null | grep ms-bitfields > /dev/null; then msnative_struct='-mms-bitfields' fi ;; esac if test x"$msnative_struct" = x; then AC_MSG_RESULT([no way]) AC_MSG_WARN([produced libraries might be incompatible with MSVC libs]) else CXXFLAGS="$CXXFLAGS $msnative_struct" AC_MSG_RESULT([${msnative_struct}]) fi fi # Export all symbols to Win32 DLL using MinGW 2.0 ld. WIN32_LD_EXPORT_ALL_SYMBOLS='' AC_MSG_CHECKING([whether ld accepts --export-all-symbols]) if $LD --help 2>&1 | egrep 'export-all-symbols' > /dev/null; then WIN32_LD_EXPORT_ALL_SYMBOLS='-Wl,--export-all-symbols' AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi if test x"$WIN32_LD_EXPORT_ALL_SYMBOLS" != x; then LDFLAGS="$LDFLAGS $WIN32_LD_EXPORT_ALL_SYMBOLS" fi ;; esac ])