This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Help redifining the LD make production


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@hda.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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]