delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/10/13/11:15:59

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Date: Wed, 13 Oct 2010 17:15:45 +0200
Message-ID: <AANLkTi=3d=-DuL8xTHcg=L861zZv=xCZH=iy=DHU=hpN@mail.gmail.com>
Subject: Finding the SONAME for bzip2
From: Al <oss DOT elmar AT googlemail DOT com>
To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hello,

I want to adapt the Makefile of bzip2 for cygwin and I want to
understand enough of what I am doing.

This are the lines of interest from the Linux Makefile:

BIGFILES=3D-D_FILE_OFFSET_BITS=3D64
CFLAGS+=3D-fpic -fPIC -Wall -Winline $(BIGFILES)
SOEXT=3Dso
SONAME=3Dlibbz2.${SOEXT}.1
SOLDFLAGS=3D-shared -Wl,-soname -Wl,$(SONAME)

$(CC) $(LDFLAGS) $(SOLDFLAGS) -o libbz2.${SOEXT}.1.0.5 $(OBJS)
$(CC) $(LDFLAGS) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.${SOEXT}.1.0.5


What would by the appropriate adaption for Cygwin?

I would try with this as a bare minimum, but then I loose all the versionin=
g:

CFLAGS+=3D-Wall
SONAME=3D
SOLDFLAGS=3D-shared

$(CC) $(LDFLAGS) $(SOLDFLAGS) -o cygbz2.dll $(OBJS)
$(CC) $(LDFLAGS) $(CFLAGS) -o bzip2-shared bzip2.c cygbz2.dll

Then the cygwin doc [1] suggests some other flags but no soname at all:

gcc -shared -o cyg${module}.dll \
    -Wl,--out-implib=3Dlib${module}.dll.a \
    -Wl,--export-all-symbols \
    -Wl,--enable-auto-import \
    -Wl,--whole-archive ${old_libs} \
    -Wl,--no-whole-archive ${dependency_libs}

Al

[1] http://www.cygwin.com/cygwin-ug-net/dll.html

--=20
Caution crosser: =A0Runnig Gentoo/Prefix on Cygwin/Vista.
All stupid questions are related to that context.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019