summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZhang <zxpmyth@yahoo.com.cn>2007-07-27 11:19:35 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-07-27 11:19:35 -0600
commit35f35294cd5cc3ca32354b1de0e398ad73c70716 (patch)
tree5f495f0672e26d59a39bbcf8f3f1fc8151a22432 /src
parent0fb0d9715c9bcdcc3437a64a0f03c1c1153e9f29 (diff)
more Mingw32 fixes
Diffstat (limited to 'src')
-rw-r--r--src/glu/sgi/Makefile.mgw35
-rw-r--r--src/glut/glx/Makefile.mgw41
-rw-r--r--src/mesa/Makefile.mgw52
3 files changed, 61 insertions, 67 deletions
diff --git a/src/glu/sgi/Makefile.mgw b/src/glu/sgi/Makefile.mgw
index 43b421e737..d00d97a3b6 100644
--- a/src/glu/sgi/Makefile.mgw
+++ b/src/glu/sgi/Makefile.mgw
@@ -70,30 +70,31 @@
TOOLS_PREFIX = mingw32-
TOP = ../../..
-
LIBDIR = $(TOP)/lib
-GLU_DLL = glu32.dll
-GLU_IMP = libglu32.a
-GLU_DEF = glu.def
+LIB_NAME = glu32
+DLL_EXT = .dll
+IMP_EXT = .a
+LIB_PRE = lib
+STRIP = -s
+
+AR = ar
+ARFLAGS = crus
+DLLTOOL = dlltool
-include $(TOP)/configs/config.mgw
-GL_USING_STDCALL ?= 1
+GLU_DLL = $(LIB_NAME)$(DLL_EXT)
+GLU_IMP = $(LIB_PRE)$(LIB_NAME)$(IMP_EXT)
+GLU_DEF = $(LIB_NAME).def
LDLIBS = -L$(LIBDIR) -lopengl32
-LDFLAGS = -Wl,--out-implib=$(LIBDIR)/$(GLU_IMP) -Wl,--output-def=$(LIBDIR)/$(GLU_DEF)
+LDFLAGS = $(STRIP) -shared -fPIC -Wl,--kill-at
CFLAGS += -DBUILD_GLU32 -D_DLL
-ifeq ($(GL_USING_STDCALL),1)
- LDFLAGS += -Wl,--add-stdcall-alias
-else
- CFLAGS += -DGL_NO_STDCALL
-endif
-CC = gcc
+CC = $(TOOLS_PREFIX)gcc
CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude
-CXX = g++
+CXX = $(TOOLS_PREFIX)g++
CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess
AR = ar
@@ -216,9 +217,9 @@ $(LIBDIR):
mkdir -p $(LIBDIR)
$(LIBDIR)/$(GLU_DLL) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
- g++ -shared -fPIC -o $(LIBDIR)/$(GLU_DLL) $(LDFLAGS) \
- $^ $(LDLIBS)
-
+ $(CXX) $(LDFLAGS) -o $(LIBDIR)/$(GLU_DLL) $^ $(LDLIBS)
+ $(DLLTOOL) --as=as --dllname $(LIB_NAME) --output-def $(LIBDIR)/$(GLU_DEF) $^
+ $(DLLTOOL) --as=as -k --dllname $(LIB_NAME) --output-lib $(LIBDIR)/$(GLU_IMP) --def $(LIBDIR)/$(GLU_DEF)
clean:
diff --git a/src/glut/glx/Makefile.mgw b/src/glut/glx/Makefile.mgw
index ae4eb6addc..9fff2e1503 100644
--- a/src/glut/glx/Makefile.mgw
+++ b/src/glut/glx/Makefile.mgw
@@ -74,35 +74,29 @@ TOP = ../../..
LIBDIR = $(TOP)/lib
-GLUT_DLL = glut32.dll
-GLUT_IMP = libglut32.a
-GLUT_DEF = glut.def
+LIB_NAME = glut32
-include $(TOP)/configs/config.mgw
-GLUT_USING_STDCALL ?= 1
+DLL_EXT = .dll
+IMP_EXT = .a
+LIB_PRE = lib
+STRIP = -s
+AR = ar
+ARFLAGS = crus
+DLLTOOL = dlltool
+GLUT_DLL = $(LIB_NAME)$(DLL_EXT)
+GLUT_IMP = $(LIB_PRE)$(LIB_NAME)$(IMP_EXT)
+GLUT_DEF = $(LIB_NAME).def
LDLIBS = -L$(LIBDIR) -lwinmm -lgdi32 -luser32 -lopengl32 -lglu32
-LDFLAGS = -Wl,--out-implib=$(LIBDIR)/$(GLUT_IMP) -Wl,--output-def=$(LIBDIR)/$(GLUT_DEF)
+LDFLAGS = $(STRIP) -shared -fPIC -Wl,--kill-at
CFLAGS += -DBUILD_GLUT32 -DGLUT_BUILDING_LIB -DMESA -D_DLL
-
-ifeq ($(GL_USING_STDCALL),0)
- CFLAGS += -DGL_NO_STDCALL
-endif
-
-ifeq ($(GLUT_USING_STDCALL),1)
- CFLAGS += -D_STDCALL_SUPPORTED
- LDFLAGS += -Wl,--add-stdcall-alias
-else
- CFLAGS += -DGLUT_NO_STDCALL
-endif
-
CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include
-CC = gcc
-CXX = g++
+CC = $(TOOLS_PREFIX)gcc
+CXX = $(TOOLS_PREFIX)g++
CXXFLAGS = $(CFLAGS)
AR = ar
@@ -189,10 +183,9 @@ $(LIBDIR):
mkdir -p $(LIBDIR)
$(LIBDIR)/$(GLUT_DLL) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
- $(CXX) -shared -fPIC -o $(LIBDIR)/$(GLUT_DLL) $(LDFLAGS) \
- $^ $(LDLIBS)
-
-
+ $(CXX) $(LDFLAGS) -o $(LIBDIR)/$(GLUT_DLL) $^ $(LDLIBS)
+ $(DLLTOOL) --as=as --dllname $(LIB_NAME) --output-def $(LIBDIR)/$(GLUT_DEF) $^
+ $(DLLTOOL) --as=as -k --dllname $(LIB_NAME) --output-lib $(LIBDIR)/$(GLUT_IMP) --def $(LIBDIR)/$(GLUT_DEF)
clean:
-$(call UNLINK,*.o) \ No newline at end of file
diff --git a/src/mesa/Makefile.mgw b/src/mesa/Makefile.mgw
index 3b52834bd1..6244ded876 100644
--- a/src/mesa/Makefile.mgw
+++ b/src/mesa/Makefile.mgw
@@ -69,39 +69,37 @@
# Set this to the prefix of your build tools, i.e. mingw32-
TOOLS_PREFIX = mingw32-
+ifeq ($(ICD),1)
+ LIB_NAME = mesa32
+else
+ LIB_NAME = opengl32
+endif
+DLL_EXT = .dll
+IMP_EXT = .a
+LIB_PRE = lib
+STRIP = -s
+
+AR = ar
+ARFLAGS = crus
+DLLTOOL = dlltool
TOP = ../..
GLIDE ?= $(TOP)/glide3
LIBDIR = $(TOP)/lib
-ifeq ($(ICD),1)
- GL_DLL = mesa32.dll
- GL_IMP = libmesa32.a
-else
- GL_DLL = opengl32.dll
- GL_IMP = libopengl32.a
-endif
-
-GL_DEF = gl.def
-include $(TOP)/configs/config.mgw
-GL_USING_STDCALL ?= 1
+GL_DLL = $(LIB_NAME)$(DLL_EXT)
+GL_IMP = $(LIB_PRE)$(LIB_NAME)$(IMP_EXT)
MESA_LIB = libmesa.a
+CC = $(TOOLS_PREFIX)gcc
LDLIBS = -lgdi32 -luser32 -liberty
-LDFLAGS = -Wl,--out-implib=$(LIBDIR)/$(GL_IMP) -Wl,--output-def=$(LIBDIR)/gl.def
-
-CC = $(TOOLS_PREFIX)gcc
-CFLAGS += -DBUILD_GL32 -D_OPENGL32_ -D_DLL -DMESA_MINWARN -DNDEBUG -D_USRDLL -DGDI_EXPORTS
+LDFLAGS = $(STRIP) -shared -fPIC -Wl,--kill-at
-ifeq ($(GL_USING_STDCALL),1)
- LDFLAGS += -Wl,--add-stdcall-alias
-else
- CFLAGS += -DGL_NO_STDCALL
-endif
+CFLAGS += -DBUILD_GL32 -D_DLL -DMESA_MINWARN
+CFLAGS += -DNDEBUG -DUSE_EXTERNAL_DXTN_LIB=1
-CFLAGS += -DUSE_EXTERNAL_DXTN_LIB=1
ifeq ($(FX),1)
CFLAGS += -I$(GLIDE)/include -DFX
LDLIBS += -L$(GLIDE)/lib -lglide3x
@@ -112,12 +110,11 @@ else
CFLAGS += -DUSE_MGL_NAMESPACE
GL_DEF = drivers/windows/icd/mesa.def
else
- GL_DEF = drivers/windows/gdi/mesa.def
+ GL_DEF = $(LIB_NAME).def
endif
endif
-AR = ar
-ARFLAGS = crus
+
UNLINK = del $(subst /,\,$(1))
ifneq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
@@ -173,14 +170,17 @@ RESOURCE = $(GL_RES:.rc=.res)
.rc.res:
windres -o $@ -Irc -Ocoff $<
+
all: $(LIBDIR) $(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP)
$(LIBDIR):
mkdir -p $(LIBDIR)
$(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP): $(OBJECTS) $(RESOURCE)
- $(CC) -shared -fPIC -o $(LIBDIR)/$(GL_DLL) $(LDFLAGS) \
- $^ $(LDLIBS)
+ $(CC) $(LDFLAGS) -o $(LIBDIR)/$(GL_DLL) $^ $(LDLIBS)
+ $(DLLTOOL) --as=as --dllname $(LIB_NAME) --output-def $(LIBDIR)/$(GL_DEF) $^
+ $(DLLTOOL) --as=as -k --dllname $(LIB_NAME) --output-lib $(LIBDIR)/$(GL_IMP) --def $(LIBDIR)/$(GL_DEF)
+
$(X86_OBJECTS): x86/matypes.h