[Gdal-dev] mingw build

Mario Beauchamp starged at videotron.ca
Fri Sep 16 17:36:09 EDT 2005

Hi Pete,

Pete Nagy wrote:
> I'm trying to build gdal using mingw and cygwin on windows, but I get a
> configure error:
> checking where python Makefiles are... found
> checking Python makefile... C:\Python24/lib/python2.4/config/Makefile
> missing, python disabled.

When I was building GDAL on MinGW, the only way I could get the Python support was by compiling
the gdal module separately. I was using Dev-Cpp and made a makefile that did the job.

I attached it so you (and other folks who may need it) can use it as a base to write your own

Hope this helps.
Mario B.
-------------- next part --------------
# Project: gdalpython
# Makefile created by Dev-C++

CPP  = g++.exe
CC   = gcc.exe
WINDRES = windres.exe
RES  = 
OBJ  = numpydataset.o gdalnumeric.o gdal_wrap.o $(RES)
LINKOBJ  = numpydataset.o gdalnumeric.o gdal_wrap.o $(RES)
LIBS = -mwindows -L../ -lgdal12 -L../../python23/libs -lpython23
INCS = -I../../python23/include -I/local/include
CXXINCS = -I../../python23/include -I/local/include
BIN  = _gdal.dll

.PHONY: all all-before all-after clean clean-custom

all: all-before _gdal.dll all-after

clean: clean-custom
	rm -f $(OBJ) $(BIN)

DLLWRAP=g++ -shared

	$(DLLWRAP) -Wl,$(DEFFILE) -Wl,-out-implib,$(STATICLIB) $(LINKOBJ) $(LIBS) -o $(BIN)

numpydataset.o: numpydataset.cpp
	$(CPP) -c numpydataset.cpp -o numpydataset.o $(CXXFLAGS)

gdalnumeric.o: gdalnumeric.cpp
	$(CPP) -c gdalnumeric.cpp -o gdalnumeric.o $(CXXFLAGS)

gdal_wrap.o: gdal_wrap.c
	$(CC) -c gdal_wrap.c -o gdal_wrap.o $(CFLAGS)

More information about the Gdal-dev mailing list