# This Makefile detects which version of gtk is installed
# and sets a few variables accordingly.

GTKVERSION = $(shell gtk-config --version)

ifneq (,$(findstring 1.3.,$(GTKVERSION)))
  OK = "gtk-1.3 found."
  GTKDEFINES = -DGTK1_2
  GLIB_CFLAGS = $(shell glib-config --cflags)
  GLIB_LIBS = $(shell glib-config --libs)
else
ifneq (,$(findstring 1.2.,$(GTKVERSION)))
  OK = "gtk-1.2 found."
  GTKDEFINES = -DGTK1_2
  GLIB_CFLAGS = $(shell glib-config --cflags)
  GLIB_LIBS = $(shell glib-config --libs)
else 
ifneq (,$(findstring 1.1.,$(GTKVERSION)))
  OK = "gtk-1.1 found.  You should upgrade to Gtk 1.2"
  GTKDEFINES = -DGTK1_2
  GLIB_CFLAGS = $(shell glib-config --cflags)
  GLIB_LIBS = $(shell glib-config --libs)
else 
all:
ifneq (,$(findstring 1.0.,$(GTKVERSION)))
	@echo Your system seem to be configured to use gtk-1.0.  
	@echo mlgtk 1.2 requires gtk-1.2.
else
	@echo Could not identify your version of gtk.
	@echo Check that gtk is correctly installed or adapt the Makefile.
endif
endif
endif
endif
