bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

readline dynamic library configuration for cygwin


From: Eric Blake
Subject: readline dynamic library configuration for cygwin
Date: Sat, 06 Aug 2005 16:12:09 -0600
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As requested by the readline package, here is a patch that enables dynamic
library compilation on cygwin, and should cause no change to other
platforms.  The patch is against readline-5.1-alpha1, but should work with
little modification on readline-5.0 (as it is based on the cygwin-local
patch already used by the cygwin developers).

Background: On cygwin, (actually, Windows in general), the dynamic library
suffix must be .dll (not .so, and no numbers), and symlinks to dynamic
libraries don't work, so the version number of a .dll must appear prior to
the .dll suffix to distinguish API incompatible changes if the older
version is to remain around.  Also, the .dll must be in the PATH, so .dlls
are generally placed in $(bindir), not $(libdir).  However, for linking
against a .dll, the compiler looks for an export library in $(libdir),
rather than the .dll itself.  Furthermore, cygwin prefers the prefix
cyg<name><vers>.dll over lib<name><vers>.dll, so that both cygwin and
mingw32 binaries can coexist in the same $(bindir), but uses
lib<name>.dll.a for the export library (so that programs being compiled
against readline always get the latest version when using -lreadline).

Historically, cygwin has already released API incompatible versions of
readline as cygreadline4.dll (4.x series, cygwin 1.3.x), cygreadline5.dll
(4.x series, cygwin 1.5.x), and cygreadline6.dll (5.x series, cygwin
1.5.x).  Because API changes in both readline and in cygwin itself can
break compatibility, the dll version has exceeded the readline major
version number.

About the patch: To accomodate cyg<name><vers>.dll, it was necessary to
add SHLIB_LIBPRE to change the spelling of a library prefix; and
SHLIB_DLLVERSION which defaults to SHLIB_MAJOR, but can be overridden on
cygwin by setting $DLLVERSION in the environment before configuring.  I
documented the effects of setting DLLVERSION in INSTALL, even though it
only affects cygwin compilation.  I also changed the meaning of
SHLIB_LIBVERSION to include the leading dot if it is wanted, rather than
including the dot in SHARED_READLINE (all users have been updated),
because the cygwin spelling is the first case where the spelling does not
want a leading dot before the version number.

Both support/shobj-conf and shlib-install have sections added for cygwin,
then shlib/Makefile.in and configure.in are updated to propogate the new
variables in shobj-conf.  shlib/Makefile.in is also patched to pass
$(bindir) on to shlib-install, since cygwin needs to know both bindir and
libdir.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC9TW484KuGfSFAYARAphPAJ9b00EMnlYkdHkaSbdT+c9k/fu6agCfc5Ln
MSue9Ui7fQcSakp2CeuDlRQ=
=BH3l
-----END PGP SIGNATURE-----
diff -ubr readline-5.1-alpha1.orig/INSTALL readline-5.1-alpha1/INSTALL
--- readline-5.1-alpha1.orig/INSTALL    2005-08-04 06:56:47.483250000 -0600
+++ readline-5.1-alpha1/INSTALL 2005-08-06 16:00:49.451625000 -0600
@@ -238,22 +238,35 @@
 SHLIB_LIBS     Any additional libraries that shared libraries should be
                linked against when they are created.
 
+SHLIB_LIBPRE   The prefix to use when generating the filename of the shared
+               library, defaults to `lib'.  Many systems use `lib'; Cygwin
+               uses `cyg'.
+
 SHLIB_LIBSUFF  The suffix to add to `libreadline' and `libhistory' when
                generating the filename of the shared library.  Many systems
                use `so'; HP-UX uses `sl'.
 
-SHLIB_LIBVERSION The string to append to the filename to indicate the version
-               of the shared library.  It should begin with $(SHLIB_LIBSUFF),
+SHLIB_LIBVERSION The string to append to the filename `libreadline' or
+               `libhistory' to indicate the version of the shared library.
+               It should usually begin with `.', then $(SHLIB_LIBSUFF),
                and possibly include version information that allows the
                run-time loader to load the version of the shared library
                appropriate for a particular program.  Systems using shared
                libraries similar to SunOS 4.x use major and minor library
                version numbers; for those systems a value of
-               `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is appropriate.
-               Systems based on System V Release 4 don't use minor version
-               numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems.
+               `.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is
+               appropriate.  Systems based on System V Release 4 don't use
+               minor version numbers; use `.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+               on those systems.
+
                Other Unix versions use different schemes.
 
+SHLIB_DLLVERSION On Cygwin, the version number for shared libraries that
+               determines API compatibility between both readline and
+               Cygwin upgrades.  Unused elsewhere.  Defaults to
+               $(SHLIB_MAJOR), but can be overridden at configure time by
+               defining DLLVERSION in the environment.
+
 SHLIB_STATUS   Set this to `supported' when you have defined the other
                necessary variables.  Make uses this to determine whether
                or not shared library creation should be attempted.  If
diff -ubr readline-5.1-alpha1.orig/README readline-5.1-alpha1/README
--- readline-5.1-alpha1.orig/README     2005-08-04 06:56:47.530125000 -0600
+++ readline-5.1-alpha1/README  2005-08-06 16:06:19.295375000 -0600
@@ -102,22 +102,35 @@
 SHLIB_LIBS     Any additional libraries that shared libraries should be
                linked against when they are created.
 
+SHLIB_LIBPRE   The prefix to use when generating the filename of the shared
+               library, defaults to `lib'.  Many systems use `lib'; Cygwin
+               uses `cyg'.
+
 SHLIB_LIBSUFF  The suffix to add to `libreadline' and `libhistory' when
                generating the filename of the shared library.  Many systems
                use `so'; HP-UX uses `sl'.
 
-SHLIB_LIBVERSION The string to append to the filename to indicate the version
-               of the shared library.  It should begin with $(SHLIB_LIBSUFF),
+SHLIB_LIBVERSION The string to append to the filename `libreadline' or
+               `libhistory' to indicate the version of the shared library.
+               It should usually begin with `.', then $(SHLIB_LIBSUFF),
                and possibly include version information that allows the
                run-time loader to load the version of the shared library
                appropriate for a particular program.  Systems using shared
                libraries similar to SunOS 4.x use major and minor library
                version numbers; for those systems a value of
-               `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is appropriate.
-               Systems based on System V Release 4 don't use minor version
-               numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems.
+               `.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is
+               appropriate.  Systems based on System V Release 4 don't use
+               minor version numbers; use `.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+               on those systems.
+
                Other Unix versions use different schemes.
 
+SHLIB_DLLVERSION On Cygwin, the version number for shared libraries that
+               determines API compatibility between both readline and
+               Cygwin upgrades.  Unused elsewhere.  Defaults to
+               $(SHLIB_MAJOR), but can be overridden at configure time by
+               defining DLLVERSION in the environment.
+
 SHLIB_STATUS   Set this to `supported' when you have defined the other
                necessary variables.  Make uses this to determine whether
                or not shared library creation should be attempted.
diff -ubr readline-5.1-alpha1.orig/configure.in readline-5.1-alpha1/configure.in
--- readline-5.1-alpha1.orig/configure.in       2005-08-04 06:56:47.139500000 
-0600
+++ readline-5.1-alpha1/configure.in    2005-08-06 15:09:09.264125000 -0600
@@ -224,8 +224,10 @@
         AC_SUBST(SHOBJ_STATUS)
        AC_SUBST(SHLIB_STATUS)
        AC_SUBST(SHLIB_XLDFLAGS)
+       AC_SUBST(SHLIB_LIBPRE)
        AC_SUBST(SHLIB_LIBSUFF)
        AC_SUBST(SHLIB_LIBVERSION)
+       AC_SUBST(SHLIB_DLLVERSION)
        AC_SUBST(SHLIB_LIBS)
         AC_MSG_RESULT($SHLIB_STATUS)
 
diff -ubr readline-5.1-alpha1.orig/shlib/Makefile.in 
readline-5.1-alpha1/shlib/Makefile.in
--- readline-5.1-alpha1.orig/shlib/Makefile.in  2005-08-04 06:56:47.545750000 
-0600
+++ readline-5.1-alpha1/shlib/Makefile.in       2005-08-06 14:50:56.545375000 
-0600
@@ -54,6 +54,7 @@
 exec_prefix = @exec_prefix@
 includedir = @includedir@
 libdir = @libdir@
+bindir = @bindir@
 datadir = @datadir@
 localedir = $(datadir)/locale
 
@@ -84,9 +85,11 @@
 
 SHLIB_XLDFLAGS = @LDFLAGS@ @SHLIB_XLDFLAGS@
 SHLIB_LIBS = @SHLIB_LIBS@
+SHLIB_LIBPRE = @SHLIB_LIBPRE@
 SHLIB_LIBSUFF = @SHLIB_LIBSUFF@
 
 SHLIB_LIBVERSION = @SHLIB_LIBVERSION@
+SHLIB_DLLVERSION = @SHLIB_DLLVERSION@
 
 SHLIB_STATUS = @SHLIB_STATUS@
 
@@ -111,8 +114,8 @@
 
 # The name of the main library target.
 
-SHARED_READLINE = libreadline.$(SHLIB_LIBVERSION)
-SHARED_HISTORY = libhistory.$(SHLIB_LIBVERSION)
+SHARED_READLINE = $(SHLIB_LIBPRE)readline$(SHLIB_LIBVERSION)
+SHARED_HISTORY = $(SHLIB_LIBPRE)history$(SHLIB_LIBVERSION)
 SHARED_LIBS = $(SHARED_READLINE) $(SHARED_HISTORY)
 
 # The C code source files for this library.
@@ -174,15 +177,16 @@
 
 installdirs: $(topdir)/support/mkdirs
        -$(SHELL) $(topdir)/support/mkdirs $(DESTDIR)$(libdir)
+       -$(SHELL) $(topdir)/support/mkdirs $(DESTDIR)$(bindir)
 
 install: installdirs $(SHLIB_STATUS)
-       $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d 
$(DESTDIR)$(libdir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY)
-       $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d 
$(DESTDIR)$(libdir) -i "$(INSTALL_DATA)" $(SHARED_READLINE)
+       $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d 
$(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" 
$(SHARED_HISTORY)
+       $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d 
$(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" 
$(SHARED_READLINE)
        @echo install: you may need to run ldconfig
 
 uninstall:
-       $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d 
$(DESTDIR)$(libdir) -U $(SHARED_HISTORY)
-       $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d 
$(DESTDIR)$(libdir) -U $(SHARED_READLINE)
+       $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d 
$(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_HISTORY)
+       $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d 
$(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_READLINE)
        @echo uninstall: you may need to run ldconfig
 
 clean mostlyclean:     force
diff -ubr readline-5.1-alpha1.orig/support/shlib-install 
readline-5.1-alpha1/support/shlib-install
--- readline-5.1-alpha1.orig/support/shlib-install      2005-08-04 
06:56:47.561375000 -0600
+++ readline-5.1-alpha1/support/shlib-install   2005-08-06 13:58:14.092250000 
-0600
@@ -3,7 +3,7 @@
 # shlib-install - install a shared library and do any necessary host-specific
 #                post-installation configuration (like ldconfig)
 #
-# usage: shlib-install [-D] -O host_os -d installation-dir -i install-prog 
[-U] library
+# usage: shlib-install [-D] -O host_os -d installation-dir -b bin-dir -i 
install-prog [-U] library
 #
 # Chet Ramey
 # address@hidden
@@ -23,6 +23,7 @@
        case "$1" in
        -O)     shift; host_os="$1"; shift ;;
        -d)     shift; INSTALLDIR="$1"; shift ;;
+       -b)     shift; BINDIR="$1"; shift ;;
        -i)     shift; INSTALLPROG="$1" ; shift ;;
        -D)     echo=echo ; shift ;;
        -U)     uninstall=true ; shift ;;
@@ -64,11 +65,29 @@
 # post-install/uninstall
 
 # HP-UX and Darwin/MacOS X require that a shared library have execute 
permission
+# Cygwin installs both a dll (which must go in bindir) and an implicit link
+# library (in libdir)
 case "$host_os" in
 hpux*|darwin*|macosx*)
        if [ -z "$uninstall" ]; then
                chmod 555 ${INSTALLDIR}/${LIBNAME}
        fi ;;
+cygwin*)
+       IMPLIBNAME=`echo ${LIBNAME} \
+               | sed -e 's,^cyg,lib,' -e 's,[0-9]*.dll$,.dll.a,'`
+       if [ -z "$uninstall" ]; then
+               ${echo} $RM ${BINDIR}/${LIBNAME}.${OLDSUFF}
+               if [ -f "$BINDIR/$LIBNAME" ]; then
+                       ${echo} $MV $BINDIR/$LIBNAME $BINDIR/$LIBNAME.$OLDSUFF
+               fi
+               ${echo} $MV ${INSTALLDIR}/${LIBNAME} ${BINDIR}/${LIBNAME}
+               ${echo} chmod a+x ${BINDIR}/${LIBNAME}
+               ${echo} eval ${INSTALLPROG} ${LIBNAME}.a \
+                       ${INSTALLDIR}/${IMPLIBNAME}
+       else
+               ${echo} ${RM} ${BINDIR}/${LIBNAME}
+               ${echo} ${RM} ${INSTALLDIR}/${IMPLIBNAME}
+       fi ;;
 *)     ;;
 esac
 
@@ -163,6 +182,12 @@
        fi
        ;;
 
+cygwin*)
+       # Links to .dlls don't work.  Hence shobj-conf used DLLVERSION.dll
+       # instead of so.SHLIB_MAJOR.SHLIB_MINOR.  The postinstall above
+       # took care of everything else.
+       ;;
+
 *)     ;;
 esac
 
diff -ubr readline-5.1-alpha1.orig/support/shobj-conf 
readline-5.1-alpha1/support/shobj-conf
--- readline-5.1-alpha1.orig/support/shobj-conf 2005-08-04 06:56:47.561375000 
-0600
+++ readline-5.1-alpha1/support/shobj-conf      2005-08-06 15:03:02.389125000 
-0600
@@ -41,9 +41,11 @@
 
 SHLIB_XLDFLAGS=
 SHLIB_LIBS=
+SHLIB_LIBPRE='lib'
 SHLIB_LIBSUFF='so'
 
-SHLIB_LIBVERSION='$(SHLIB_LIBSUFF)'
+SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF)'
+SHLIB_DLLVERSION='$(SHLIB_MAJOR)'
 
 PROGNAME=`basename $0`
 USAGE="$PROGNAME [-C compiler] -c host_cpu -o host_os -v host_vendor"
@@ -64,7 +66,7 @@
        SHOBJ_LD=/usr/bin/ld
        SHOBJ_LDFLAGS='-assert pure-text'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
        ;;
 
 sunos4*)
@@ -72,7 +74,7 @@
        SHOBJ_LD=/usr/bin/ld
        SHOBJ_LDFLAGS='-assert pure-text'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
        ;;
 
 sunos5*-*gcc*|solaris2*-*gcc*)
@@ -88,7 +90,7 @@
        fi
 
 #      SHLIB_XLDFLAGS='-R $(libdir)'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 sunos5*|solaris2*)
@@ -97,7 +99,7 @@
        SHOBJ_LDFLAGS='-G -dy -z text -i -h $@'
 
 #      SHLIB_XLDFLAGS='-R $(libdir)'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 # All versions of Linux or the semi-mythical GNU Hurd.
@@ -107,7 +109,7 @@
        SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
 
        SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ 
$(SHLIB_MINOR)`'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
        ;;
 
 freebsd2* | netbsd*)
@@ -116,7 +118,7 @@
        SHOBJ_LDFLAGS='-x -Bshareable'
 
        SHLIB_XLDFLAGS='-R$(libdir)'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
        ;;
 
 # FreeBSD-3.x ELF
@@ -128,12 +130,12 @@
                SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
 
                SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
-               SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+               SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        else
                SHOBJ_LDFLAGS='-shared'
 
                SHLIB_XLDFLAGS='-R$(libdir)'
-               SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+               
SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
        fi
        ;;
 
@@ -146,7 +148,7 @@
 
        SHOBJ_LD='${CC}'
 
-       SHLIB_LIBVERSION='$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)'
+       SHLIB_LIBVERSION='.$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)'
        SHLIB_LIBSUFF='dylib'
 
        case "${host_os}" in
@@ -167,7 +169,7 @@
        SHOBJ_LDFLAGS='-shared'
 
        SHLIB_XLDFLAGS='-R$(libdir)'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
        ;;
 
 bsdi2*)
@@ -206,7 +208,7 @@
        SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
 
        SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
        ;;
 
 osf*-*gcc*)
@@ -215,7 +217,7 @@
        SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
 
        SHLIB_XLDFLAGS='-rpath $(libdir)'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 osf*)
@@ -223,7 +225,7 @@
        SHOBJ_LDFLAGS='-shared -soname $@ -expect_unresolved "*"'
 
        SHLIB_XLDFLAGS='-rpath $(libdir)'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 aix4.[2-9]*-*gcc*)             # lightly tested by address@hidden
@@ -234,7 +236,7 @@
 
        SHLIB_XLDFLAGS='-bM:SRE'
        SHLIB_LIBS='-lcurses -lc'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 aix4.[2-9]*)
@@ -245,7 +247,7 @@
 
        SHLIB_XLDFLAGS='-bM:SRE'
        SHLIB_LIBS='-lcurses -lc'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 #
@@ -257,7 +259,7 @@
        SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
 
        SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 irix[56]*)
@@ -269,7 +271,7 @@
        SHOBJ_LDFLAGS='-shared -no_unresolved -soname $@'
 
        SHLIB_XLDFLAGS='-rpath $(libdir)'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 hpux9*-*gcc*)
@@ -280,7 +282,7 @@
 
        SHLIB_XLDFLAGS='-Wl,+b,$(libdir)'
        SHLIB_LIBSUFF='sl'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 hpux9*)
@@ -298,7 +300,7 @@
 #
 #      SHLIB_XLDFLAGS='+b $(libdir)'
 #      SHLIB_LIBSUFF='sl'
-#      SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'      
+#      SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'     
 
        ;;
 
@@ -312,7 +314,7 @@
 
        SHLIB_XLDFLAGS='-Wl,+h,$@ -Wl,+b,$(libdir)'
        SHLIB_LIBSUFF='sl'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 hpux10*)
@@ -330,7 +332,7 @@
 #
 #      SHLIB_XLDFLAGS='+b $(libdir)'
 #      SHLIB_LIBSUFF='sl'
-#      SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'      
+#      SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'     
 
        ;;
 
@@ -343,7 +345,7 @@
 
        SHLIB_XLDFLAGS='-Wl,+b,$(libdir)'
        SHLIB_LIBSUFF='sl'
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 hpux11*)
@@ -361,7 +363,7 @@
 #
 #      SHLIB_XLDFLAGS='+b $(libdir)'
 #      SHLIB_LIBSUFF='sl'
-#      SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'      
+#      SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'     
 
        ;;
 
@@ -370,7 +372,7 @@
        SHOBJ_LDFLAGS='-shared -h $@'
        SHOBJ_LD='${CC}'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 sysv4*)
@@ -378,7 +380,7 @@
        SHOBJ_LD=ld
        SHOBJ_LDFLAGS='-dy -z text -G -h $@'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 sco3.2v5*-*gcc*)
@@ -386,7 +388,7 @@
        SHOBJ_LD='${CC}'
        SHOBJ_LDFLAGS='-shared'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 sco3.2v5*)
@@ -394,7 +396,7 @@
        SHOBJ_LD=ld
        SHOBJ_LDFLAGS='-G -b elf -dy -z text -h $@'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 sysv5uw7*-*gcc*)
@@ -402,7 +404,7 @@
        SHOBJ_LD='${CC}'
        SHOBJ_LDFLAGS='-shared'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 sysv5uw7*)
@@ -410,7 +412,7 @@
        SHOBJ_LD=ld
        SHOBJ_LDFLAGS='-G -dy -z text -h $@'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 sysv5UnixWare*-*gcc*)
@@ -418,7 +420,7 @@
        SHOBJ_LD='${CC}'
        SHOBJ_LDFLAGS='-shared'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 sysv5UnixWare*)
@@ -426,7 +428,7 @@
        SHOBJ_LD=ld
        SHOBJ_LDFLAGS='-G -dy -z text -h $@'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 sysv5OpenUNIX*-*gcc*)
@@ -434,7 +436,7 @@
        SHOBJ_LD='${CC}'
        SHOBJ_LDFLAGS='-shared'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 sysv5OpenUNIX*)
@@ -442,7 +444,7 @@
        SHOBJ_LD=ld
        SHOBJ_LDFLAGS='-G -dy -z text -h $@'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 dgux*-*gcc*)
@@ -450,7 +452,7 @@
        SHOBJ_LD='${CC}'
        SHOBJ_LDFLAGS='-shared'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 dgux*)
@@ -458,7 +460,7 @@
        SHOBJ_LD=ld
        SHOBJ_LDFLAGS='-G -dy -h $@'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 msdos*)
@@ -466,6 +468,23 @@
        SHLIB_STATUS=unsupported
        ;;
 
+cygwin*)
+       SHOBJ_LD='$(CC)'
+       SHOBJ_LDFLAGS='-shared -Wl,--enable-auto-import 
-Wl,--enable-auto-image-base -Wl,--export-all -Wl,--out-implib=$(@).a'
+       SHLIB_LIBPRE='cyg'
+       SHLIB_LIBSUFF='dll'
+       SHLIB_LIBVERSION='$(SHLIB_DLLVERSION).$(SHLIB_LIBSUFF)'
+       SHLIB_LIBS=-lcurses
+
+       # For official cygwin releases, DLLVERSION will be defined in the
+       # environment of configure, and will be incremented any time the API
+       # changes in a non-backwards compatible manner.  Otherwise, it is just
+       # SHLIB_MAJOR.
+       if [ -n "$DLLVERSION" ] ; then
+               SHLIB_DLLVERSION="$DLLVERSION"
+       fi
+       ;;
+
 #
 # Rely on correct gcc configuration for everything else
 #
@@ -474,7 +493,7 @@
        SHOBJ_LD='${CC}'
        SHOBJ_LDFLAGS='-shared'
 
-       SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
+       SHLIB_LIBVERSION='.$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
        ;;
 
 *)
@@ -493,8 +512,10 @@
 
 echo SHLIB_XLDFLAGS=\'"$SHLIB_XLDFLAGS"\'
 echo SHLIB_LIBS=\'"$SHLIB_LIBS"\'
+echo SHLIB_LIBPRE=\'"$SHLIB_LIBPRE"\'
 echo SHLIB_LIBSUFF=\'"$SHLIB_LIBSUFF"\'
 echo SHLIB_LIBVERSION=\'"$SHLIB_LIBVERSION"\'
+echo SHLIB_DLLVERSION=\'"$SHLIB_DLLVERSION"\'
 
 echo SHOBJ_STATUS=\'"$SHOBJ_STATUS"\'
 echo SHLIB_STATUS=\'"$SHLIB_STATUS"\'

reply via email to

[Prev in Thread] Current Thread [Next in Thread]