diff -Naurp librep-0.15.2/Makedefs.in librep-0.15.2-cygwin/Makedefs.in --- librep-0.15.2/Makedefs.in 2001-08-10 03:37:48.000000000 +0100 +++ librep-0.15.2-cygwin/Makedefs.in 2002-07-04 09:26:12.000000000 +0100 @@ -80,7 +80,7 @@ HAVE_UNIX=@HAVE_UNIX@ rep_prog = $(top_builddir)/libtool --mode=execute $(top_builddir)/src/rep COMPILE_ENV = REPLISPDIR=$(top_builddir)/lisp \ REP_DL_LOAD_PATH=$(top_builddir)/src/.libexec \ - REPDOCFILE=$(top_builddir)/DOC + REPDOCFILE=$(top_builddir)/DOC.dbm include $(top_srcdir)/rules.mk rep_LIBTOOL=@LIBTOOL@ diff -Naurp librep-0.15.2/Makefile.in librep-0.15.2-cygwin/Makefile.in --- librep-0.15.2/Makefile.in 2001-08-10 03:37:48.000000000 +0100 +++ librep-0.15.2-cygwin/Makefile.in 2002-07-04 09:26:12.000000000 +0100 @@ -26,7 +26,8 @@ VPATH=@srcdir@ ALL_SUBDIRS = intl src lisp man INSTALL_SUBDIRS = src lisp man -all : build.h rules.mk DOC +all : build.h rules.mk DOC.dbm + chmod a+x libtool for dir in $(ALL_SUBDIRS); do \ [ -d $$dir ] && ( cd $$dir && $(MAKE) $@ ) || exit 1; \ done @@ -48,7 +49,7 @@ install : all installdirs for dir in $(INSTALL_SUBDIRS); do \ ( cd $$dir && $(MAKE) $@ ) || exit 1; \ done - $(INSTALL_DATA) DOC $(DESTDIR)$(repexecdir) + $(INSTALL_DATA) DOC.dbm $(DESTDIR)$(repexecdir) $(INSTALL_SCRIPT) emulate-gnu-tar $(DESTDIR)$(repexecdir) $(INSTALL_SCRIPT) libtool $(DESTDIR)$(repcommonexecdir) $(INSTALL_DATA) rules.mk $(DESTDIR)$(repcommonexecdir) @@ -79,8 +80,8 @@ uninstall : rm -f $(DESTDIR)$(emacssitelispdir)/rep-debugger.el rm -f $(DESTDIR)$(aclocaldir)/rep.m4 -DOC : src/repdoc - src/repdoc DOC `find $(top_srcdir) -name '*.c' -print` +DOC.dbm : src/repdoc + src/repdoc DOC.dbm `find $(top_srcdir) -name '*.c' -print` src/repdoc : ( cd src && $(MAKE) repdoc ) @@ -95,14 +96,14 @@ clean : -for dir in $(ALL_SUBDIRS); do \ [ -d $$dir ] && ( cd $$dir && $(MAKE) $@ ) || exit 1; \ done - rm -f *~ NEWS DOC TAGS build.h + rm -f *~ NEWS DOC.dbm TAGS build.h distclean : -for dir in $(ALL_SUBDIRS); do \ [ -d $$dir ] && ( cd $$dir && $(MAKE) $@ ) || exit 1; \ done rm -f config.cache config.h config.log config.status Makefile libtool - rm -f *~ NEWS DOC TAGS build.h rules.mk librep.spec + rm -f *~ NEWS DOC.dbm TAGS build.h rules.mk librep.spec realclean : distclean diff -Naurp librep-0.15.2/configure librep-0.15.2-cygwin/configure --- librep-0.15.2/configure 2001-10-29 06:19:47.000000000 +0000 +++ librep-0.15.2-cygwin/configure 2002-07-04 09:26:12.000000000 +0100 @@ -963,7 +963,7 @@ repdir='${datadir}/rep' replispdir='${repdir}/${version}/lisp' repexecdir='${libexecdir}/rep/${version}/${host_type}' repcommonexecdir='${libexecdir}/rep/${host_type}' -repdocfile='${repexecdir}/DOC' +repdocfile='${repexecdir}/DOC.dbm' emacssitelispdir='${datadir}/emacs/site-lisp' @@ -3199,7 +3199,8 @@ EOF else $CC -o impgen impgen.c ; fi)~ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' - old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' +# old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' +old_archive_from_expsyms_cmds= # cygwin and mingw dlls have different entry points and sets of symbols # to exclude. @@ -4896,7 +4897,8 @@ old_postuninstall_cmds=$lt_old_postunins old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds +#old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds +old_archive_from_expsyms_cmds= # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds @@ -6250,7 +6252,7 @@ fi if test "$doug_lea_malloc" = "no"; then case ${host} in - *-dec-osf*) + *-dec-osf*|*cygwin*) cat >> confdefs.h <<\EOF #define LIBC_MALLOC 1 EOF diff -Naurp librep-0.15.2/install-aliases librep-0.15.2-cygwin/install-aliases --- librep-0.15.2/install-aliases 2000-12-06 22:17:42.000000000 +0000 +++ librep-0.15.2-cygwin/install-aliases 2002-07-04 09:26:12.000000000 +0100 @@ -74,6 +74,9 @@ dosome () { copy_la_file "${destroot}/${src}${suf}" \ "${destroot}/${dest}${suf}" ;; + .dll) + cp "${destroot}/${src}${suf}" "${destroot}/${dest}${suf}" + ;; *) # make sure links are relative to their own directory local_src=`strip_common_prefix "$dest" "$src"` diff -Naurp librep-0.15.2/mkdll.sh librep-0.15.2-cygwin/mkdll.sh --- librep-0.15.2/mkdll.sh 1970-01-01 00:00:00.000000000 +0000 +++ librep-0.15.2-cygwin/mkdll.sh 2002-07-04 09:26:12.000000000 +0100 @@ -0,0 +1,97 @@ +#!/bin/sh + +# script to generate dll from libtool-generated static archive (.la file) +# invoke with: +# mkdll.sh +# eg: +# mkdll.sh libtest.la -L/usr/local/lib -llocal + +# defaults to using gcc for libraries written in C. +# set the CC env var to use a different compiler driver: eg +# export CC=g++ +# for C++ libraries + +# defaults to using /usr/local as the installation PREFIX +# override this by setting the PREFIX env var: eg +# export PREFIX=/opt/gnome + +archive=$1 +test -f $archive || { echo $(basename $0): $archive not found; exit 1; } + +module=$(echo $(basename $archive) | sed -e 's,^lib,,' -e 's,.la$,,') + +shift +dependency_libs="$@" + +test -n "$CC" || CC=gcc +prefix=${PREFIX:=/usr/local} +case "$DLDIR" in + :) dldir= + ;; + "") dldir=../bin/ + ;; + *) dldir=$DLDIR + ;; +esac +case "$DLPREFIX" in + :) dlprefix= + ;; + "") dlprefix=cyg + ;; + *) dlprefix=$DLPREFIX + ;; +esac +case "$LIBPREFIX" in + :) libprefix= + ;; + "") libprefix=lib + ;; + *) libprefix=$LIBPREFIX + ;; +esac + +# get the static library name +# first look in the .la archive +old_lib=$(sed -ne '/^old_library=/ s,^old_library='\''\(.*\)'\''.*$,\1,p' .libs/$archive) +# if not there, use default name +test -n "$old_lib" || old_lib=${libprefix}${module}.a + + + +# update the archive with the dll and import lib name; fix install dir; remove relink command +# (${prefix}/lib is hard-coded here - edit it if necessary) +libdir=${prefix}/lib +if sed -e 's,^dlname='\'\'',dlname='\'${dlprefix}${module}.dll\'',' \ + -e 's,^library_names='\'\'',library_names='\'${libprefix}${module}.dll.a\'',' \ + -e 's,^libdir='\'\'',libdir='\'$libdir\'',' \ + -e 's,^relink_command=.*$,,' \ + .libs/$archive > .libs/${archive}.tmp +then cat .libs/${archive}.tmp > .libs/${archive} +fi +rm -f .libs/${archive}.tmp + +# update the install archive if it exists +if [ -f .libs/${archive}i ] ; then + if sed -e 's,^dlname='\'\'',dlname='\'${dldir}${dlprefix}${module}.dll\'',' \ + -e 's,^library_names='\'\'',library_names='\'${libprefix}${module}.dll.a\'',' \ + -e 's,^relink_command=.*$,,' \ + .libs/${archive}i > .libs/${archive}i.tmp + then cat .libs/${archive}i.tmp > .libs/${archive}i + fi + rm -f .libs/${archive}i.tmp +fi + + +# report the link command to stdout +eval echo $CC -shared -o .libs/${dlprefix}${module}.dll -Wl,--out-implib=.libs/${libprefix}${module}.dll.a \ +-Wl,--export-all-symbols -Wl,--whole-archive .libs/$old_lib -Wl,--no-whole-archive ${dependency_libs} + +# do the link command - if it fails, remove archive so make knows to re-build it +ret=$(eval $CC -shared -o .libs/${dlprefix}${module}.dll -Wl,--out-implib=.libs/${libprefix}${module}.dll.a -Wl,--export-all-symbols \ +-Wl,--whole-archive .libs/$old_lib -Wl,--no-whole-archive ${dependency_libs} || { rm -f $archive; false; } ) + +# copy the .dll.a file to .dll.aT to keep libtool happy +rm -f .libs/${libprefix}${module}.dll.aT +ln .libs/${libprefix}${module}.dll.a .libs/${libprefix}${module}.dll.aT + +exit $ret --- librep-0.15.2/src/Makefile.in 2001-08-24 04:05:41.000000000 +0100 +++ librep-0.15.2-cygwin/src/Makefile.in 2002-07-04 10:38:26.000000000 +0100 @@ -53,20 +53,27 @@ INTL_OBJS_yes=../intl/*.lo INTL_OBJS_no= INTL_OBJS=$(INTL_OBJS_@USE_INCLUDED_LIBINTL@) +EXEEXT=.exe + all : librep.la $(DL_OBJS) check-dl rep rep-config rep-remote rep-xgettext .libexec -librep.la : $(OBJS) $(LIBOBJS) $(ALLOCA) +librep.def: librep.sym + echo EXPORTS > $@ + cat $< >> $@ + +librep.la : $(OBJS) $(LIBOBJS) $(ALLOCA) librep.def $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) \ -version-info $(libversion) -export-symbols librep.sym \ -o $@ $^ -rpath $(libdir) $(LIBS) $(GMP_LIBS) + PREFIX=$(prefix) sh $(top_srcdir)/mkdll.sh $@ $(LDFLAGS) $(GMP_LIBS) -lcrypt rep : $(REP_OBJS) $(EXTRA_LIBOBJS) librep.la $(LIBTOOL) --mode=link $(CC) -export-dynamic $(CPPFLAGS) $(CFLAGS) -o $@ \ - $(REP_OBJS) librep.la $(EXTRA_LIBOBJS) $(LIBS) $(GMP_LIBS) + $(REP_OBJS) librep.la $(EXTRA_LIBOBJS) $(LIBS) $(LDFLAGS) $(GMP_LIBS) srep : $(REP_OBJS) $(EXTRA_LIBOBJS) librep.la $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(CPPFLAGS) $(CFLAGS) -o $@ \ - $(REP_OBJS) librep.la $(EXTRA_LIBOBJS) $(LIBS) $(GMP_LIBS) + $(REP_OBJS) librep.la $(EXTRA_LIBOBJS) $(LIBS) $(LDFLAGS) $(GMP_LIBS) rep-remote : rep-remote.c @@ -113,11 +120,11 @@ installdirs : mkinstalldirs uninstall : $(LIBTOOL) rm $(DESTDIR)${libdir}/librep.la - $(LIBTOOL) rm $(DESTDIR)${bindir}/rep - $(LIBTOOL) rm $(DESTDIR)${bindir}/repdoc + $(LIBTOOL) rm $(DESTDIR)${bindir}/rep$(EXEEXT) + $(LIBTOOL) rm $(DESTDIR)${bindir}/repdoc$(EXEEXT) rm -f $(DESTDIR)${bindir}/rep-config rm -f $(DESTDIR)${bindir}/rep-xgettext - rm -f $(DESTDIR)${bindir}/rep-remote + rm -f $(DESTDIR)${bindir}/rep-remote$(EXEEXT) for dl in $(DL_DSTS); do \ $(LIBTOOL) rm $(DESTDIR)${repexecdir}/$$dl; \ done @@ -135,24 +142,43 @@ repdoc : repdoc.o sdbm.la : $(SDBM_LOBJS) repsdbm.lo $(rep_DL_LD) $(LDFLAGS) -o $@ $^ + DLPREFIX=":" DLDIR=":" LIBPREFIX=":" PREFIX=$(prefix) sh $(top_srcdir)/mkdll.sh $@ .libs/librep.dll.a $(LDFLAGS) $(GMP_LIBS) gdbm.la : repgdbm.lo $(rep_DL_LD) $(LDFLAGS) -o $@ $^ $(GDBM_LIBS) + DLPREFIX=":" DLDIR=":" LIBPREFIX=":" PREFIX=$(prefix) sh $(top_srcdir)/mkdll.sh $@ .libs/librep.dll.a $(LDFLAGS) $(GMP_LIBS) -lgdbm gettext.la : gettext.lo $(rep_DL_LD) $(LDFLAGS) -o $@ $^ $(INTL_OBJS) + DLPREFIX=":" DLDIR=":" LIBPREFIX=":" PREFIX=$(prefix) sh $(top_srcdir)/mkdll.sh $@ .libs/librep.dll.a $(LDFLAGS) $(GMP_LIBS) $(LIBS) readline.la : readline.lo $(rep_DL_LD) $(LDFLAGS) -o $@ $^ $(READLINE_LIBS) + DLPREFIX=":" DLDIR=":" LIBPREFIX=":" PREFIX=$(prefix) sh $(top_srcdir)/mkdll.sh $@ .libs/librep.dll.a $(LDFLAGS) $(GMP_LIBS) -lreadline safe-interpreter.la : safemach.lo $(rep_DL_LD) $(LDFLAGS) -o $@ $^ + DLPREFIX=":" DLDIR=":" LIBPREFIX=":" PREFIX=$(prefix) sh $(top_srcdir)/mkdll.sh $@ .libs/librep.dll.a $(LDFLAGS) $(GMP_LIBS) sockets.la : sockets.lo $(rep_DL_LD) $(LDFLAGS) -o $@ $^ + DLPREFIX=":" DLDIR=":" LIBPREFIX=":" PREFIX=$(prefix) sh $(top_srcdir)/mkdll.sh $@ .libs/librep.dll.a $(LDFLAGS) $(GMP_LIBS) md5.la : md5.lo rep-md5.lo $(rep_DL_LD) $(LDFLAGS) -o $@ $^ + DLPREFIX=":" DLDIR=":" LIBPREFIX=":" PREFIX=$(prefix) sh $(top_srcdir)/mkdll.sh $@ .libs/librep.dll.a $(LDFLAGS) $(GMP_LIBS) + +record-profile.la : record-profile.lo + $(rep_DL_LD) $(LDFLAGS) -o $@ $^ + DLPREFIX=":" DLDIR=":" LIBPREFIX=":" PREFIX=$(prefix) sh $(top_srcdir)/mkdll.sh $@ .libs/librep.dll.a $(LDFLAGS) $(GMP_LIBS) + +timers.la : timers.lo + $(rep_DL_LD) $(LDFLAGS) -o $@ $^ + DLPREFIX=":" DLDIR=":" LIBPREFIX=":" PREFIX=$(prefix) sh $(top_srcdir)/mkdll.sh $@ .libs/librep.dll.a $(LDFLAGS) $(GMP_LIBS) + +tables.la : tables.lo + $(rep_DL_LD) $(LDFLAGS) -o $@ $^ + DLPREFIX=":" DLDIR=":" LIBPREFIX=":" PREFIX=$(prefix) sh $(top_srcdir)/mkdll.sh $@ .libs/librep.dll.a $(LDFLAGS) $(GMP_LIBS) .libexec : $(DL_OBJS) $(SHELL) $(srcdir)/fake-libexec diff -Naurp librep-0.15.2/src/fake-libexec librep-0.15.2-cygwin/src/fake-libexec --- librep-0.15.2/src/fake-libexec 2001-06-15 06:24:50.000000000 +0100 +++ librep-0.15.2-cygwin/src/fake-libexec 2002-07-04 09:26:12.000000000 +0100 @@ -19,6 +19,7 @@ for f in $libs; do rm -f $dest/$b echo "$src/$b -> $dest/$b" ../mkinstalldirs $dest - ln -s $src/$b $dest/$b +# ln -s $src/$b $dest/$b + cp $src/$b $dest/$b done done diff -Naurp librep-0.15.2/src/numbers.c librep-0.15.2-cygwin/src/numbers.c --- librep-0.15.2/src/numbers.c 2001-10-21 06:24:50.000000000 +0100 +++ librep-0.15.2-cygwin/src/numbers.c 2002-07-04 09:26:12.000000000 +0100 @@ -2804,14 +2804,21 @@ static gmp_randstate_t random_state; static void ensure_random_state (void) { - static rep_bool initialized; + static rep_bool initialized = 0; if (!initialized) { /* Generate the best random numbers up to 128 bits, the maximum allowed by gmp */ +#ifndef __CYGWIN__ gmp_randinit (random_state, GMP_RAND_ALG_DEFAULT, 128); - +#else + /* cygwin gmp aborts when given multiple of 32 here + * (at randraw.c:118) + * so we work around it by only asking for 100 bits + */ + gmp_randinit (random_state, GMP_RAND_ALG_DEFAULT, 100); +#endif /* Initialize to a known seed */ gmp_randseed_ui (random_state, 0);