delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/02/24/15:41:12

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: Peter Dufault <dufault AT hda DOT com>
Message-Id: <200002242051.PAA01850@hda.hda.com>
Subject: Help redifining the LD make production
To: cygwin AT sourceware DOT cygnus DOT com
Date: Thu, 24 Feb 2000 15:51:12 -0500 (EST)
X-Mailer: ELM [version 2.4ME+ PL61 (25)]
MIME-Version: 1.0

I need help redefining the LD make production for the native CYGWIN
tools so that they will work "properly" under WINE (which needs relocable
exe's).  I've figured out that this unfortunate script will do what I want:

-- Start rlink:
#!/bin/sh
# This creates a relocateable .exe that works under wine as a single
# script easily replacing a "gcc" line in a Makefile.
#
# This script is stupid.  Just look at how it uses what should
# be Makefile args, etc.
#
# This unfortunate script can be kicked off from within a GNUmakefile as:
#	rlink "$@" "$^" "$(LDADD)"

BINPREF=i586-cygwin32-
AS=${BINPREF}as
DLLTOOL="${BINPREF}dlltool -k --as ${AS}"
LINKER=${BINPREF}gcc
NM=${BINPREF}nm

# rlink $@ "$^" "$(LDADD)"

EXE=$1
LDARGS=$2
LDADD=$3

(echo EXPORTS > ${EXE}.exp) ||
(${NM} ${LDARGS} | sed -n "/^........ [DT] _/s/^........ [DT] _/ /p" >> ${EXE}.exp) &&
(${DLLTOOL} --dllname ${EXE}  --output-exp ${EXE}.e --def ${EXE}.exp) &&
(${LINKER}  ${CFLAGS} -o ${EXE} -Wl,--base-file,${EXE}.b ./${EXE}.e ${LDARGS} -s ${LDADD}) &&
(${DLLTOOL} --dllname ${EXE} \
	--base-file ${EXE}.b --output-exp ./${EXE}.e --def ${EXE}.exp) &&
(${LINKER}  ${CFLAGS} -o ${EXE} ${EXE}.e ${LDARGS} -s ${LDADD}) &&
(rm -f ${EXE}.e ${EXE}.b ${EXE}.exp)
exit $?
-- End rlink.

However, I can't figure out the "right way to do it", that is,
I can't figure out where I change one or two things and have this
sort of script (it doesn't have to be this, and I know it might have
something to do with "dllwrap") apply across the board.

Can anyone tell me how to do this properly?
I've crawled through some Makefile.in's and some Makefile.am's
and darned if I can figure out where to redefine the load production.

Peter
--
Peter Dufault (dufault AT hda DOT com)   Realtime development, Machine control,
HD Associates, Inc.               Fail-Safe systems, Agency approval

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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