slang-users mailing list

[2005 Date Index] [2005 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] mingwdll.diff


John E. Davis wrote:
Should this be called libslang.dll? If so, will
   gcc foo.c -lslang

cause foo to be linked to the dll?  If not, how does one link to this?

First of all I have no experience in unix programming, so I just used
a hint form http://sig9.com/node/35

   $(CPP) $(LINKOBJ) -o "fljed.exe" ... -wslang32.dll

At first I had problems linking to the file libslang.a generated with

   gcc -shared -o libslang.dll $(OBJS) -Wl,--out-implib,libslang.a

Now I tried to make libslang.a/dll again and copied the libslang.a
into the mingw /lib directory.

   $(CPP) $(LINKOBJ) -o "fljed.exe" ... -lslang

compiled and linked (in Dev-Cpp using mingw).
fljed now works with libslang.dll.

Just a question: Why isn't libslang 2.0 named libslang2 ?
Since the licensing of the library has changed between 1.0 and
2.0 someone might need to have both versions installed.

The corrected patch is attached.

(The compilation might also work for CYGWIN32 but I do not have the
time to test it.)

Is there an equivalent to rpath in windows?  How are these libraries
searched during run-time?  I assume that there is some equivalent of
ld.so.

The executable serches for the dll first in its own directory,
then along all directories in the PATH system variable.

Marko
--- /cygdrive/s/jed/slang-2.0.0/src/mkfiles/makefile.all	2005-04-24 18:43:10.000000000 +0200
+++ makefile.all	2005-05-07 20:30:58.390625000 +0200
@@ -259,12 +259,17 @@
 !  elifdef MINGW32 #{{{
 # This Makefile is for the MINGW32 environment
 CC = $(TOOL_PREFIX)gcc
+!   ifdef DLL
+CFLAGS += -DWIN32 -W -Wall -O2 -fno-strength-reduce -DSLANG_DLL=1
+!   else
 CFLAGS += -DWIN32 -W -Wall -O2 -fno-strength-reduce
+!   endif
 P = /#
 O = o # Object extension
 SRCDIR = .# Location of sources
 OBJDIR = gw32objs# Location of objects
-TARGET = $(OBJDIR)/libslang.a
+TGTBASE=$(OBJDIR)\\libslang
+TARGET = $(TGTBASE).a
 COMPILE_CMD = $(CC) -c $(CFLAGS) -o #
 LIBDEPS =
 RM = rm
@@ -398,9 +403,16 @@
 	$(RANLIB) $(TARGET)
 ! elifdef BCC
 	tlib $(TARGET) /P32 /C @$(RSPFILE)
-! elifdef EMX CYGWIN32 MINGW32
+! elifdef EMX CYGWIN32
 	$(AR_CR) $(TARGET) $(OBJS)
 	$(RANLIB) $(TARGET)
+! elifdef MINGW32
+!  ifdef DLL
+	$(CC) -shared -o $(TGTBASE).dll $(OBJS) -Wl,--out-implib,$(TARGET)
+!  else	
+	$(AR_CR) $(TARGET) $(OBJS)
+	$(RANLIB) $(TARGET)
+!  endif
 ! elifdef VC
 # dll support
 !ifdef DLL
_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html

[2005 date index] [2005 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]