delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/18/17:24:14

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <3F91AED7.2010504@cwilson.fastmail.fm>
Date: Sat, 18 Oct 2003 17:21:27 -0400
From: Charles Wilson <cygwin AT cwilson DOT fastmail DOT fm>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Patch for building libcrypt.a as a DLL

--------------010201060606050801020609
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

This should make life a little simpler for those apps that use libtool 
to build DLLs and depend on libcrypt -- since libtool tries very hard to 
ensure that all dependencies of a DLL are themselves DLLs.

Corinna, please consider this patch.

--
Chuck

--------------010201060606050801020609
Content-Type: text/plain;
 name="crypt.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="crypt.diff"

diff -urN crypt-1.0-2-orig/Makefile crypt-1.0-2/Makefile
--- crypt-1.0-2-orig/Makefile	2000-05-21 16:47:40.000000000 -0400
+++ crypt-1.0-2/Makefile	2003-10-18 17:16:59.526728000 -0400
@@ -3,24 +3,45 @@
 CFLAGS=-g -O2
 
 prefix:=/usr
+bindir=$(prefix)/bin
+libdir=$(prefix)/lib
+incdir=$(prefix)/include
+DLLVER=0
+EXE=.exe
 
-all: crypt
+STATICLIB=libcrypt.a
+SHAREDLIB=cygcrypt-$(DLLVER).dll
+IMPORTLIB=libcrypt.dll.a
 
-crypt: crypt.o libcrypt.a
-	$(CC) -o $@ crypt.o libcrypt.a
+APPS=crypt$(EXE)
+LIBS=$(STATICLIB) $(SHAREDLIB)
 
-libcrypt.a: encrypt.o
+all: $(APPS) $(LIBS)
+
+crypt$(EXE): crypt.o $(LIBS)
+	$(CC) -static -o $@ crypt.o -L. -lcrypt
+
+$(STATICLIB): encrypt.o
 	ar rv $@ encrypt.o
 
+$(SHAREDLIB): encrypt.o
+	$(CC) -shared -Wl,--out-implib=$(IMPORTLIB) -Wl,--export-all \
+	$^ -o $@
+
 encrypt.o: encrypt.h
 
 distclean: clean
 
 clean:
-	-rm *.o *.exe *.a
+	-rm *.o *.exe *.a *.dll
 
 install: all
-	install -s crypt.exe $(prefix)/bin
-	install encrypt.h $(prefix)/include/crypt.h
-	install libcrypt.a $(prefix)/lib
+	if [ ! -d $(DESTDIR)$(bindir) ] ; then mkdir -p $(DESTDIR)$(bindir) ; fi
+	if [ ! -d $(DESTDIR)$(libdir) ] ; then mkdir -p $(DESTDIR)$(libdir) ; fi
+	if [ ! -d $(DESTDIR)$(incdir) ] ; then mkdir -p $(DESTDIR)$(incdir) ; fi
+	install -m 755 -s $(APPS)      $(DESTDIR)$(bindir)
+	install -m 644 encrypt.h       $(DESTDIR)$(incdir)/crypt.h
+	install -m 644 $(STATICLIB)    $(DESTDIR)$(libdir)
+	install -m 644 $(IMPORTLIB)    $(DESTDIR)$(libdir)
+	install -m 755 -s $(SHAREDLIB) $(DESTDIR)$(bindir)
 


--------------010201060606050801020609
Content-Type: text/plain; charset=us-ascii

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

- Raw text -


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