From: Duncan C. <dun...@us...> - 2004-12-20 03:31:08
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31844 Modified Files: ChangeLog configure.ac Makefile.am Log Message: Make --disable-gnome and --disable-libglade work again. Do not #include<gtk/gtkversion.h> in config.h, instead define GTK_CHECK_VERSION macro directly. Also add hack to stop harmless warnings about clashing symbols. Use per-library / per-program search paths. Drop use of BUILDSOURCES. Index: configure.ac =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/configure.ac,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- configure.ac 17 Dec 2004 21:21:38 -0000 1.13 +++ configure.ac 20 Dec 2004 03:30:58 -0000 1.14 @@ -32,7 +32,14 @@ AC_CANONICAL_HOST AM_CONFIG_HEADER(config.h) -AH_TOP([#include<gtk/gtkversion.h>]) +AH_TOP([ +/* Hack to suppress warnings that these symbols clash with + the ones from ghc's version of config.h */ +#undef /**/ PACKAGE_NAME +#undef /**/ PACKAGE_STRING +#undef /**/ PACKAGE_TARNAME +#undef /**/ PACKAGE_VERSION +]) dnl Checks for programs. AM_PROG_CC_C_O @@ -48,6 +55,7 @@ AC_PATH_PROG(SED,gnused) AC_PATH_PROG(SED,gsed) AC_PATH_PROG(SED,sed) +AC_PATH_PROG(CUT,cut) AC_PATH_PROG(TAR,tar) AC_PATH_PROG(TOUCH,touch) AC_PROG_RANLIB @@ -191,12 +199,12 @@ dnl Optimise Haskell by default and give sufficient space. if test -z "$HCFLAGS"; then - HCFLAGS=" -O -H180m " + HCFLAGS="-O -H180m" fi dnl Check whether to use a local package file. AC_ARG_WITH(pkgconf, - [ --with-pkgconf=FILE GHC package file to install packages], + [ --with-pkgconf=FILE GHC package file to install packages], [PKGCONF=$withval;],[PKGCONF=;]) dnl Check for pkg-config which holds information about all Gtk related @@ -240,6 +248,7 @@ [ENABLE_LIBGLADE=$enableval],[ENABLE_LIBGLADE=yes]) AC_MSG_RESULT($ENABLE_LIBGLADE) +AM_CONDITIONAL(ENABLE_LIBGLADE, test x$ENABLE_LIBGLADE = xyes) dnl Check if user wants the various gnome modules. Defaults to yes. AC_MSG_CHECKING([whether to build gnome bindings]) @@ -249,12 +258,17 @@ [ENABLE_GNOME=$enableval],[ENABLE_GNOME=yes]) AC_MSG_RESULT($ENABLE_GNOME) +AM_CONDITIONAL(ENABLE_GNOME, test x$ENABLE_GNOME = xyes) + +dnl Check if user wants the Mozilla's browser engine widget. Defaults to yes. +AC_MSG_CHECKING([whether to build mozembed bindings]) AC_ARG_ENABLE(mozilla, [ --disable-mozilla do not generate bindings for the Mozilla display widget], [ENABLE_MOZEMBED=$enableval],[ENABLE_MOZEMBED=yes]) AC_MSG_RESULT($ENABLE_MOZEMBED) +AM_CONDITIONAL(ENABLE_MOZEMBED, test x$ENABLE_MOZEMBED = xyes) dnl Check for the GTK&Co libraries. Use the special PKG_CHECK_MODULES dnl macro from the pkg-config program. @@ -277,6 +291,24 @@ dnl Haskell types for the available C types. CREATE_TYPES="$CREATE_TYPES `$PKG_CONFIG gtk+-2.0 --atleast-version=2.2 && echo gtk-2.2`" CREATE_TYPES="$CREATE_TYPES `$PKG_CONFIG gtk+-2.0 --atleast-version=2.4 && echo gtk-2.4`" +CREATE_TYPES="$CREATE_TYPES `$PKG_CONFIG gtk+-2.0 --atleast-version=2.6 && echo gtk-2.6`" + +dnl Also allow us to conditionally compile binding to the new Gtk+ APIs. +GTK_VERSION=`$PKG_CONFIG gtk+-2.0 --modversion` +GTK_MAJOR_VERSION=`echo $GTK_VERSION | $CUT -d. -f1` +GTK_MINOR_VERSION=`echo $GTK_VERSION | $CUT -d. -f2` +GTK_MICRO_VERSION=`echo $GTK_VERSION | $CUT -d. -f3` +AC_DEFINE_UNQUOTED(GTK_MAJOR_VERSION, ($GTK_MAJOR_VERSION), [Gtk major version number]) +AC_DEFINE_UNQUOTED(GTK_MINOR_VERSION, ($GTK_MINOR_VERSION), [Gtk minor version number]) +AC_DEFINE_UNQUOTED(GTK_MICRO_VERSION, ($GTK_MICRO_VERSION), [Gtk minor patch level]) +AH_BOTTOM([ +/* Allow code to be compiled differently for different versions of GTK+ */ +#define GTK_CHECK_VERSION(major,minor,micro) \ + (GTK_MAJOR_VERSION > (major) || \ + (GTK_MAJOR_VERSION == (major) && GTK_MINOR_VERSION > (minor)) || \ + (GTK_MAJOR_VERSION == (major) && GTK_MINOR_VERSION == (minor) && \ + GTK_MICRO_VERSION >= (micro))) +]) dnl The configuration program for GTK is kind of stupid in that it dnl lists directories which don't exist. ghc-pkg in ghc 5.04 or greater @@ -340,7 +372,7 @@ AC_SUBST(MOZEMBED_LIBEXTRA_CQ) AC_ARG_WITH(hidir, - [ --with-hidir=DIR specify install dir for .hi files], + [ --with-hidir=DIR specify install dir for .hi files], [hidir=$withval], [hidir=$libdir/hi]) AC_SUBST(hidir) @@ -487,17 +519,8 @@ AC_SUBST(C2HSFLAGS) AC_SUBST(EXTRA_HFILES) dnl Versionitis -dnl AC_SUBST(GTK_MAJOR_VERSION) -dnl AC_SUBST(GTK_MINOR_VERSION) -dnl AC_SUBST(GTK_MICRO_VERSION) -AC_SUBST(GTK_VERSION_2_2) -AC_SUBST(GTK_VERSION_2_4) -AC_SUBST(DISABLE_DEPRECATED) AC_SUBST(CREATE_TYPES) dnl Optional packages -dnl AC_SUBST(ENABLE_OPENGL) -AC_SUBST(ENABLE_LIBGLADE) -AC_SUBST(ENABLE_GNOME) AC_SUBST(SOURCEVIEW_CFLAGS) AC_SUBST(SOURCEVIEW_LIBS) AC_SUBST(LIBGLADE_CFLAGS) Index: Makefile.am =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/Makefile.am,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- Makefile.am 18 Dec 2004 20:48:01 -0000 1.28 +++ Makefile.am 20 Dec 2004 03:30:58 -0000 1.29 @@ -7,21 +7,10 @@ $(GTK_CFLAGS) $(SOURCEVIEW_CFLAGS) \ $(LIBGLADE_CFLAGS) $(GCONF_CFLAGS) \ $(MOZEMBED_CFLAGS)) +nobase_hi_SCRIPTS = #hack 'til gtk uses it # Build c2hs before anything else. -SOURCEDIRS = gtk/general gtk/glib gtk/pango gtk/treeList gtk/multiline \ - gtk/gdk gtk/abstract gtk/display gtk/entry gtk/misc gtk/multiline \ - gtk/ornaments gtk/scrolling gtk/treeList gtk/selectors gtk/embedding \ - gtk/layout gtk/menuComboToolbar gtk/buttons gtk/windows \ - tools/hierarchyGen tools/callbackGen tools/apicoverage \ - tools/c2hs/base/admin tools/c2hs/base/errors \ - tools/c2hs/base/general tools/c2hs/base/graphs \ - tools/c2hs/base/state tools/c2hs/base/syms \ - tools/c2hs/base/syntax tools/c2hs/base/sysdep tools/c2hs/c \ - tools/c2hs/chs tools/c2hs/gen tools/c2hs/state tools/c2hs/toplevel \ - mogul glade gconf sourceview mozembed - EXTRA_DIST = \ tools/callbackGen/Signal.chs-boot1 \ tools/callbackGen/Signal.chs-boot2 \ @@ -39,13 +28,20 @@ HSC = hsc2hs # all packages and applications -lib_LIBRARIES = \ - libHSgtk.a \ - libHSmogul.a \ - libHSglade.a \ +lib_LIBRARIES = \ + libHSgtk.a \ + libHSmogul.a +if ENABLE_LIBGLADE +lib_LIBRARIES += libHSglade.a +endif +if ENABLE_GNOME +lib_LIBRARIES += \ libHSgconf.a \ - libHSsourceview.a \ - libHSmozembed.a + libHSsourceview.a +endif +if ENABLE_MOZEMBED +lib_LIBRARIES += libHSmozembed.a +endif noinst_PROGRAMS = \ tools/hierarchyGen/TypeGenerator \ @@ -68,6 +64,7 @@ tools_hierarchyGen_TypeGenerator_MAIN = \ $(tools_hierarchyGen_TypeGenerator_SOURCES) tools_hierarchyGen_TypeGenerator_PACKAGEDEPS = +tools_hierarchyGen_TypeGenerator_SOURCESDIRS = tools/hierarchyGen tools_hierarchyGen_TypeGenerator_SOURCES = \ tools/hierarchyGen/TypeGen.hs # Fix automake - the subdir-objects option doesn't work here. @@ -87,6 +84,7 @@ tools_callbackGen_HookGenerator_MAIN = \ $(tools_callbackGen_HookGenerator_SOURCES) tools_callbackGen_HookGenerator_PACKAGEDEPS = +tools_callbackGen_HookGenerator_SOURCESDIRS = tools/callbackGen tools_callbackGen_HookGenerator_SOURCES = \ tools/callbackGen/HookGenerator.hs am_tools_callbackGen_HookGenerator_OBJECTS = $(addsuffix .$(OBJEXT),\ @@ -114,6 +112,7 @@ tools_apicoverage_Exclude_MAIN = \ $(tools_apicoverage_Exclude_SOURCES) tools_apicoverage_Exclude_PACKAGEDEPS = +tools_apicoverage_Exclude_SOURCESDIRS = tools/apicoverage tools_apicoverage_Exclude_SOURCES = \ tools/apicoverage/Exclude.hs am_tools_apicoverage_Exclude_OBJECTS = $(addsuffix .$(OBJEXT),\ @@ -134,6 +133,13 @@ tools_c2hs_c2hsLocal_HEADER = tools_c2hs_c2hsLocal_HCFLAGS = +tools_c2hs_c2hsLocal_SOURCESDIRS = \ + tools/c2hs/base/admin tools/c2hs/base/errors \ + tools/c2hs/base/general tools/c2hs/base/graphs \ + tools/c2hs/base/state tools/c2hs/base/syms \ + tools/c2hs/base/syntax tools/c2hs/base/sysdep tools/c2hs/c \ + tools/c2hs/chs tools/c2hs/gen tools/c2hs/state tools/c2hs/toplevel + tools_c2hs_c2hsLocal_SOURCES = \ tools/c2hs/base/admin/BaseVersion.hs \ tools/c2hs/base/admin/Common.hs \ @@ -218,6 +224,12 @@ libHSgtk_a_CFLAGS = $(filter-out -I% -D%,$(GTK_CFLAGS)) libHSgtk_a_CPPFLAGS = $(filter -I% -D%,$(GTK_CFLAGS)) +libHSgtk_a_SOURCESDIRS = \ + gtk/glib gtk/general gtk/pango gtk/treeList gtk/multiline gtk/gdk \ + gtk/abstract gtk/display gtk/entry gtk/misc gtk/multiline \ + gtk/ornaments gtk/scrolling gtk/treeList gtk/selectors gtk/embedding \ + gtk/layout gtk/menuComboToolbar gtk/buttons gtk/windows + libHSgtk_a_SOURCES = \ gtk/general/Hierarchy.chs \ gtk/general/Signal.chs \ @@ -425,7 +437,9 @@ libHSmogul_a_LIBS = libHSmogul_a_HCFLAGS = libHSmogul_a_CFLAGS = -libHSmogul_a_CPPFLAGS = $(CPPFLAGS) +libHSmogul_a_CPPFLAGS = + +libHSmogul_a_SOURCESDIRS = $(libHSgtk_a_SOURCESDIRS) mogul libHSmogul_a_SOURCES = \ mogul/GetWidget.hs \ @@ -435,8 +449,6 @@ mogul/TreeList.hs \ mogul/WidgetTable.hs -libHSmogul_a_DEPENDENCIES = libHSgtk.a - am_libHSmogul_a_OBJECTS = \ $(addsuffix .$(OBJEXT),$(basename $(basename $(libHSmogul_a_SOURCES)))) @@ -458,6 +470,8 @@ # ################################################################################ +if ENABLE_LIBGLADE + libHSglade_a_NAME = libHSglade.a $(libHSglade_a_NAME) : NAME = libHSglade_a @@ -470,14 +484,14 @@ libHSglade_a_CFLAGS = $(filter-out -I% -D%,$(GTK_CFLAGS) $(LIBGLADE_CFLAGS)) libHSglade_a_CPPFLAGS = $(filter -I% -D%,$(GTK_CFLAGS) $(LIBGLADE_CFLAGS)) +libHSglade_a_SOURCESDIRS = $(libHSgtk_a_SOURCESDIRS) glade + libHSglade_a_SOURCES = \ glade/GladeType.chs \ glade/Glade.chs glade_GladeType_hs_HCFLAGS = -fglasgow-exts -libHSglade_a_DEPENDENCIES = libHSgtk.a - glade/GladeType.chs : $(srcdir)/tools/hierarchyGen/hierarchy.list \ $(srcdir)/tools/hierarchyGen/TypeGenerator \ $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template @@ -516,11 +530,15 @@ -include libHSglade_a.deps $(libHSglade_a_CHSFILES:.chs=.dep) endif +endif #ENABLE_LIBGLADE + # # gconf package # ################################################################################ +if ENABLE_GNOME + libHSgconf_a_NAME = libHSgconf.a $(libHSgconf_a_NAME) : NAME = libHSgconf_a @@ -533,14 +551,14 @@ libHSgconf_a_CFLAGS = $(filter-out -I% -D%,$(GTK_CFLAGS) $(GCONF_CFLAGS)) libHSgconf_a_CPPFLAGS = $(filter -I% -D%,$(GTK_CFLAGS) $(GCONF_CFLAGS)) +libHSgconf_a_SOURCESDIRS = $(libHSgtk_a_SOURCESDIRS) gconf + libHSgconf_a_SOURCES = \ gconf/System/Gnome/GConf/GConfType.chs \ gconf/System/Gnome/GConf/GConfValue.chs \ gconf/System/Gnome/GConf/GConfClient.chs \ gconf/System/Gnome/GConf.hs -libHSgconf_a_DEPENDENCIES = libHSgtk.a - gconf/System/Gnome/GConf/GConfType.chs : \ $(srcdir)/tools/hierarchyGen/hierarchy.list \ $(srcdir)/tools/hierarchyGen/TypeGenerator \ @@ -568,7 +586,7 @@ $(filter %.hs,$(libHSgconf_a_BUILDSOURCES)) \ $(filter %.hs,$(libHSgconf_a_SOURCES)) -nobase_hi_SCRIPTS = $(libHSgconf_a_HSFILES:.hs=.hi) +nobase_hi_SCRIPTS += $(libHSgconf_a_HSFILES:.hs=.hi) MOSTLYCLEANFILES += $(am_libHSgconf_a_OBJECTS) MOSTLYCLEANFILES += $(libHSgconf_a_HSFILES:.hs=.hi) @@ -585,11 +603,15 @@ -include libHSgconf_a.deps $(libHSgconf_a_CHSFILES:.chs=.dep) endif +endif #ENABLE_GNOME + # # sourceview package # ################################################################################ +if ENABLE_GNOME + libHSsourceview_a_NAME = libHSsourceview.a $(libHSsourceview_a_NAME) : NAME = libHSsourceview_a @@ -602,6 +624,8 @@ libHSsourceview_a_CFLAGS = $(filter-out -I% -D%,$(GTK_CFLAGS) $(SOURCEVIEW_CFLAGS)) libHSsourceview_a_CPPFLAGS = $(filter -I% -D%,$(GTK_CFLAGS) $(SOURCEVIEW_CFLAGS)) -Isourceview +libHSsourceview_a_SOURCESDIRS = $(libHSgtk_a_SOURCESDIRS) sourceview + libHSsourceview_a_SOURCES = \ sourceview/SourceViewType.chs \ sourceview/SourceBuffer.chs \ @@ -618,8 +642,6 @@ sourceview_SourceViewType_hs_HCFLAGS = -fglasgow-exts sourceview_SourceTagStyle_hs_HCFLAGS = -fglasgow-exts -libHSsourceview_a_DEPENDENCIES = libHSgtk.a - sourceview/SourceViewType.chs : \ $(srcdir)/tools/hierarchyGen/hierarchy.list \ $(srcdir)/tools/hierarchyGen/TypeGenerator \ @@ -660,11 +682,15 @@ -include libHSsourceview_a.deps $(libHSsourceview_a_CHSFILES:.chs=.dep) endif +endif #ENABLE_GNOME + # # mozembed package # ################################################################################ +if ENABLE_MOZEMBED + libHSmozembed_a_NAME = libHSmozembed.a $(libHSmozembed_a_NAME) : NAME = libHSmozembed_a @@ -677,13 +703,14 @@ libHSmozembed_a_CFLAGS = $(filter-out -I% -D%,$(GTK_CFLAGS) $(MOZEMBED_CFLAGS)) libHSmozembed_a_CPPFLAGS = $(filter -I% -D%,$(GTK_CFLAGS) $(MOZEMBED_CFLAGS)) +libHSmozembed_a_SOURCESDIRS = $(libHSgtk_a_SOURCESDIRS) mozembed + libHSmozembed_a_SOURCES = \ mozembed/Graphics/UI/Gtk/MozEmbedType.chs \ mozembed/Graphics/UI/Gtk/MozEmbed.chs mozembed_Graphics_UI_Gtk_MozEmbedType_hs_HCFLAGS = -fglasgow-exts -libHSmozembed_a_DEPENDENCIES = libHSgtk.a mozembed/Graphics/UI/Gtk/MozEmbedType.chs : \ $(srcdir)/tools/hierarchyGen/hierarchy.list \ @@ -726,12 +753,6 @@ -include libHSmozembed_a.deps $(libHSmozembed_a_CHSFILES:.chs=.dep) endif - -# All generated source files go here. -BUILDSOURCES = $(libHSgtk_a_BUILDSOURCES) \ - $(libHSglade_a_BUILDSOURCES) \ - $(libHSgconf_a_BUILDSOURCES) \ - $(libHSsourceview_a_BUILDSOURCES) \ - $(libHSmozembed_a_BUILDSOURCES) +endif #ENABLE_MOZEMBED include mk/common.mk Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.261 retrieving revision 1.262 diff -u -d -r1.261 -r1.262 --- ChangeLog 18 Dec 2004 20:48:07 -0000 1.261 +++ ChangeLog 20 Dec 2004 03:30:58 -0000 1.262 @@ -1,3 +1,29 @@ +2004-12-19 Duncan Coutts <du...@co...> + + * configure.ac: add support for conditionals in Makefile.am so that + --disable-gnome, --disable-libglade will work again. + Instead of doing #include<gtk/gtkversion.h> in config.h just define the + GTK_CHECK_VERSION in config.h. It's a simple macro and it means that + now config.h does not depend on any -I include paths so can be used in + any module. Also added hack to stop warnings about PACKAGE_* variables + clashing with the ones from ghc's version of config.h. + + * gtk/treeList/TreeView.chs.pp: do not #include<gtk/gtkversion.h>, + the GTK_CHECK_VERSION macro is now defined in config.h + + * mk/common.mk: include config.h when building .precomp files since + config.h has the *_DISABLE_DEPRECATED #defines which modify the gtk + headers. Also, use a per-library search path. Possibly controversial, + revert it if you don't like the idea. + + * Makefile.am: Use per-library / per-program search paths. Make the + glade, gconf, sourceview and mozembed packages build conditionally on + ENABLE_* variables set by ./configure --disable-*. Also, ditch the use + of BUILDSOURCES, having re-read the automake manual I concluded it's + not helpful. + + * tools/callbackGen/HookGenerator.hs: remove support for pre-5.04 ghc. + 2004-12-18 Duncan Coutts <du...@co...> * tools/c2hs/toplevel/Main.hs: remove performance debuging output when |