Generating SDL_gfx.dll without MSVC

Hello,

I’m using mingw in cygwin. I’ve been wrestling with dll creation
using dlltool with no avail. SDL_gfx documentation only facilitates
creation of .dll’s with Visual C. Any help would be much appreciated.

Thanks,
Chris.

I’m using mingw in cygwin. I’ve been wrestling with dll creation
using dlltool with no avail. SDL_gfx documentation only facilitates
creation of .dll’s with Visual C. Any help would be much appreciated.

I have a similar problem.
I’m trying to compile SDL_gfx with Dev-Cpp (mingw32), but I haven’t found
a way.
I think I should compile with xmingw…

elhja

elhja wrote:

I’m using mingw in cygwin. I’ve been wrestling with dll creation
using dlltool with no avail. SDL_gfx documentation only facilitates
creation of .dll’s with Visual C. Any help would be much appreciated.

I have a similar problem.
I’m trying to compile SDL_gfx with Dev-Cpp (mingw32), but I haven’t found
a way.
I think I should compile with xmingw…

elhja


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I can’t send the makefile for a couple of hours, but I hacked together a
working makefile that builds both static and dynamic libs. I’ll try to
get it out in about 4 hours or so (it’s 9:00 AM here and I’m going to be
back home at around 1:00 PM).

  • brian

I can’t send the makefile for a couple of hours, but I hacked together a
working makefile that builds both static and dynamic libs. I’ll try to
get it out in about 4 hours or so (it’s 9:00 AM here and I’m going to be
back home at around 1:00 PM).

  • brian

Great!

I would like to understand what I was missing!

Thanks again!!

elhja

Sorry it took so long to get this out.

Of note in this makefile:

  • You will have to change the path on line 5 to match where you want the
    library installed.
  • You will have to change the CFLAGS to match your system.

Let me know if you have any questions.

Brian Kropf wrote:

elhja wrote:

I’m using mingw in cygwin. I’ve been wrestling with dll creation
using dlltool with no avail. SDL_gfx documentation only facilitates
creation of .dll’s with Visual C. Any help would be much appreciated.

I have a similar problem.
I’m trying to compile SDL_gfx with Dev-Cpp (mingw32), but I haven’t found
a way.
I think I should compile with xmingw…

elhja


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I can’t send the makefile for a couple of hours, but I hacked together
a working makefile that builds both static and dynamic libs. I’ll try
to get it out in about 4 hours or so (it’s 9:00 AM here and I’m going
to be back home at around 1:00 PM).

  • brian


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…
Name: Makefile
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20041228/fdf8d1d8/attachment.asc

Thanks Brian, I’ll include the Makefile in the next version of SDL_gfx.
Cheers AndreasOn Tue, 2004-12-28 at 18:45 -0500, Brian Kropf wrote:

Sorry it took so long to get this out.

Of note in this makefile:

  • You will have to change the path on line 5 to match where you want
    the library installed.
  • You will have to change the CFLAGS to match your system.

Let me know if you have any questions.

Brian Kropf wrote:

elhja wrote:

I’m using mingw in cygwin. I’ve been wrestling with dll creation
using dlltool with no avail. SDL_gfx documentation only facilitates
creation of .dll’s with Visual C. Any help would be much appreciated.

I have a similar problem.
I’m trying to compile SDL_gfx with Dev-Cpp (mingw32), but I haven’t found
a way.
I think I should compile with xmingw…

elhja


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I can’t send the makefile for a couple of hours, but I hacked
together a working makefile that builds both static and dynamic
libs. I’ll try to get it out in about 4 hours or so (it’s 9:00 AM
here and I’m going to be back home at around 1:00 PM).

  • brian


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

plain text document attachment (Makefile)
CC = gcc
AR=ar rc
RANLIB=ranlib

prefix=c:/dev/local
bin_dir=$(prefix)/bin
include_dir=$(prefix)/include
lib_dir=$(prefix)/lib

CFLAGS = -O3 -march=athlon-xp -mmmx -msse -m3dnow -DBUILD_DLL -DWIN32 -Ic:/dev/local/include/SDL
LIBS = -Lc:/dev/local/lib -lSDL

OBJS = SDL_framerate.o SDL_gfxPrimitives.o SDL_imageFilter.o SDL_rotozoom.o

STATIC_LIB=libSDL_gfx.a
IMPORT_LIB=libSDL_gfx.dll.a
SHARED_LIB=SDL_gfx.dll

all: $(STATIC_LIB) $(SHARED_LIB)

$(STATIC_LIB): $(OBJS)
$(AR) $@ $^
$(RANLIB) $@

$(SHARED_LIB): $(OBJS)
gcc -s -shared -o $@ $^ -Wl,–enable-auto-import,–export-all -Wl,–out-implib=$(IMPORT_LIB) $(LIBS)

test: $(SHARED_LIB) $(STATIC_LIB) Test/TestFramerate.exe Test/TestFonts.exe Test/TestGfxPrimitives.exe Test/TestImageFilter.exe Test/TestRotozoom.exe

Test/TestFramerate.exe: Test/TestFramerate.c
gcc -c $^ -o Test/TestFramerate.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL
gcc -o $@ Test/TestFramerate.o $(CFLAGS) -L…/ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL

Test/TestFonts.exe: Test/TestFonts.c
gcc -c $^ -o Test/TestFonts.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL
gcc -o $@ Test/TestFonts.o $(CFLAGS) -L…/ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL

Test/TestGfxPrimitives.exe: Test/TestGfxPrimitives.c
gcc -c $^ -o Test/TestGfxPrimitives.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL
gcc -o $@ Test/TestGfxPrimitives.o $(CFLAGS) -L…/ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL

Test/TestImageFilter.exe: Test/TestImageFilter.c
gcc -c $^ -o Test/TestImageFilter.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL
gcc -o $@ Test/TestImageFilter.o $(CFLAGS) -L…/ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL

Test/TestRotozoom.exe: Test/TestRotozoom.c
gcc -c $^ -o Test/TestRotozoom.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL
gcc -o $@ Test/TestRotozoom.o $(CFLAGS) -L…/ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL

install: $(STATIC_LIB) $(SHARED_LIB)
cp $(STATIC_LIB) $(SHARED_LIB) $(IMPORT_LIB) $(lib_dir)
cp SDL_framerate.h SDL_gfxPrimitives.h SDL_imageFilter.h SDL_rotozoom.h $(include_dir)/SDL

uninstall:
rm -f $(lib_dir)/$(STATIC_LIB)
rm -f $(lib_dir)/$(SHARED_LIB)
rm -f $(lib_dir)/$(IMPORT_LIB)
rm -f $(include_dir)/SDL/SDL_framerate.h
rm -f $(include_dir)/SDL/SDL_gfxPrimitives.h
rm -f $(include_dir)/SDL/SDL_imageFilter.h
rm -f $(include_dir)/SDL/SDL_rotozoom.h

clean:
rm -f *.o .a .dll
rm -f Test/
.o Test/
.exe


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl