From: <as...@us...> - 2003-07-09 22:43:19
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1:/tmp/cvs-serv25460 Modified Files: ChangeLog configure.in Log Message: Make compile with GHC 6.00. There are two major changes in the FFI which made me separate everything that has to do with Foreign and Foreign.C into a new file called general/FFI.hs. The file UTFCForeign.hs is now obsolete as its string conversion functions are now in FFI.hs. The nullForeignPtr function is also located here. All files now import FFI instead of Foreign and UTFCForeign. The major changes are: newForeignPtr now takes a pointer to a C function as finalizer. Every destructor function is now defined differently depending on whether the new GHC is used or not. In particular there is now a function called free :: Ptr a -> IO () imported from the Foreign library. In addition to that I defined a function foreignFree which can be used as finalizer to a C data structure. It is equivalent to free if GHC version <=5.04 is used. The second change is that ForeignPtr are no longer accepted as arguments to foreign calls. This change is mainly reflected in c2hs, but also in some files which directly called functions. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- ChangeLog 4 Jul 2003 08:27:00 -0000 1.78 +++ ChangeLog 9 Jul 2003 22:42:42 -0000 1.79 @@ -1,3 +1,71 @@ +2003-07-09 Axel Simon <A....@ke...> + + * c2hs/gen/GBMonad.hs, c2hs/gen/GenBind.hs: Applied the patch I + wrote for c2hs 0.11.5 which created code for ForeignPtrs which is + compatible with the new FFI of GHC 6.0. + + * abstract/Box.chs, abstract/Container.chs, abstract/Misc.chs, + abstract/Object.chs, abstract/Paned.chs, abstract/Range.chs, + abstract/Scale.chs, abstract/Scrollbar.hs, abstract/Separator.hs, + abstract/Widget.chs, buttons/Button.chs, buttons/CheckButton.chs, + buttons/RadioButton.chs, buttons/ToggleButton.chs, + display/AccelLabel.chs, display/Image.chs, display/Label.chs, + display/ProgressBar.chs, display/Statusbar.chs, + embedding/Embedding.hsc, embedding/Plug.chs, embedding/Socket.chs, + entry/Entry.chs, entry/HScale.chs, entry/SpinButton.chs, + entry/VScale.chs, gdk/DrawWindow.hs, gdk/Drawable.chs, + gdk/Events.hsc, gdk/GC.chs, gdk/Gdk.chs, gdk/GdkEnums.chs, + gdk/Keys.chs, gdk/Pixbuf.chs, gdk/Region.chs, general/Enums.chs, + general/General.chs, general/Gtk.hs, general/IconFactory.chs, + general/StockItems.hsc, general/Structs.hsc, general/Style.chs, + glib/GList.chs, glib/GObject.chs, glib/GType.chs, glib/GValue.chs, + glib/GValueTypes.chs, layout/Alignment.chs, + layout/AspectFrame.chs, layout/HBox.chs, layout/HPaned.chs, + layout/Layout.chs, layout/Notebook.chs, layout/Table.chs, + layout/VBox.chs, layout/VPaned.chs, + menuComboToolbar/CheckMenuItem.chs, menuComboToolbar/Combo.chs, + menuComboToolbar/ImageMenuItem.chs, menuComboToolbar/Menu.chs, + menuComboToolbar/MenuBar.chs, menuComboToolbar/MenuItem.chs, + menuComboToolbar/MenuShell.chs, menuComboToolbar/OptionMenu.chs, + menuComboToolbar/RadioMenuItem.chs, + menuComboToolbar/TearoffMenuItem.chs, + menuComboToolbar/Toolbar.chs, misc/Adjustment.chs, misc/Arrow.chs, + misc/Calendar.chs, misc/DrawingArea.chs, misc/EventBox.chs, + misc/HandleBox.chs, misc/Tooltips.chs, misc/Viewport.chs, + multiline/TextBuffer.chs, multiline/TextIter.chs, + multiline/TextMark.chs, multiline/TextTag.chs, + multiline/TextTagTable.chs, multiline/TextView.chs, + ornaments/Frame.chs, ornaments/HSeparator.chs, + ornaments/VSeparator.chs, pango/Markup.hs, pango/PangoLayout.chs, + pango/PangoTypes.chs, pango/Rendering.chs, + scrolling/HScrollbar.chs, scrolling/ScrolledWindow.chs, + scrolling/VScrollbar.chs, signals/HookGenerator.hs, + signals/Signal.chs-boot1, signals/Signal.chs-boot2, + treeList/CellRenderer.hs, treeList/CellRendererPixbuf.chs, + treeList/CellRendererText.chs, treeList/CellRendererToggle.chs, + treeList/ListStore.chs, treeList/StoreValue.hsc, + treeList/TreeModel.chs, treeList/TreeModelSort.chs, + treeList/TreeSelection.chs, treeList/TreeStore.chs, + treeList/TreeView.chs, treeList/TreeViewColumn.chs, + typehier/TypeGenerator.hs, windows/Dialog.chs, + windows/FileSel.chs, windows/Window.chs: Make compile with GHC + 6.00. There are two major changes in the FFI which made me + separate everything that has to do with Foreign and Foreign.C into + a new file called general/FFI.hs. The file UTFCForeign.hs is now + obsolete as its string conversion functions are now in FFI.hs. The + nullForeignPtr function is also located here. All files now import + FFI instead of Foreign and UTFCForeign. The major changes are: + newForeignPtr now takes a pointer to a C function as + finalizer. Every destructor function is now defined differently + depending on whether the new GHC is used or not. In particular + there is now a function called free :: Ptr a -> IO () imported + from the Foreign library. In addition to that I defined a function + foreignFree which can be used as finalizer to a C data + structure. It is equivalent to free if GHC version <=5.04 is + used. The second change is that ForeignPtr are no longer accepted + as arguments to foreign calls. This change is mainly reflected in + c2hs, but also in some files which directly called functions. + 2003-07-04 Axel Simon <A....@ke...> * configure.in mk/config.mk.in mk/library.mk: Turned the Index: configure.in =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/configure.in,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- configure.in 4 Jul 2003 08:27:00 -0000 1.25 +++ configure.in 9 Jul 2003 22:42:43 -0000 1.26 @@ -89,7 +89,12 @@ WIN32=yes; fi; - +dnl determine a temporary directory for c2hs +TMPDIR="/tmp" +if test "$WIN32" = "yes"; then + TMPDIR="C:\TMP" +fi +AC_SUBST(TMPDIR) dnl Check for libraries. @@ -129,6 +134,13 @@ GTKHS_PROG_CHECK_VERSION($GHC_VERSION, -lt, 5.0.2, [ AC_MSG_ERROR([I need the FFI of GHC 5.02 upwards!])]) +dnl Calculate a version number with 3 digits (i.e. 502 for 5.2) +GHC_VERSION_NUMBER=`echo $GHC_VERSION | $SED "s/[[0-9]*\.\([0-9]]*\).*/0\1/"` +GHC_VERSION_NUMBER=`echo $GHC_VERSION_NUMBER | $SED "s/[[0-9]*\([0-9][0-9]]\)/\1/"` +GHC_VERSION_NUMBER=`echo $GHC_VERSION | $SED "s/\([[0-9]]\).*/\1/"`$GHC_VERSION_NUMBER + +C2HSFLAGS="$C2HSFLAGS -C-D__GLASGOW_HASKELL__=$GHC_VERSION_NUMBER" + dnl Check if the ghc compiler can generate dynamic callbacks with more than dnl 4 words worth of arguments. Hopefully one day the compiler will support dnl this. @@ -265,16 +277,16 @@ dnl use the version in the current search path (--with-c2hs-config=yes). dnl The default is to use the built-in version. AC_ARG_WITH(c2hs, - [ --with-c2hs=C2HS-CONFIG use an external C->Haskell installation (slower!)], + [ --with-c2hs=C2HS use an external C->Haskell installation (slower!)], [ case $withval in yes) { BUILT_IN_C2HS=no; - AC_PATH_PROG(C2HS_CONFIG, c2hs-config, notfound) - if test $C2HS_CONFIG = notfound; then + AC_PATH_PROG(C2HS, c2hs, notfound) + if test $C2HS = notfound; then AC_MSG_ERROR([C->Haskell was not found in current search path. Try compiling with the built-in c2hs by omitting - --with-c2hs-config=... when calling ./configure .]) + --with-c2hs=... when calling ./configure .]) fi } ;; no) { @@ -282,10 +294,10 @@ } ;; *) { BUILT_IN_C2HS=no; - AC_CHECK_FILE($withval,C2HS_CONFIG=$withval, + AC_CHECK_FILE($withval,C2HS=$withval, AC_MSG_ERROR([The specified C->Haskell tool was not found. Try compiling with the built-in c2hs by omitting - --with-c2hs-config=... when calling ./configure .])) + --with-c2hs=... when calling ./configure .])) } ;; esac ],[BUILT_IN_C2HS=yes]) @@ -316,31 +328,13 @@ dnl Find C->Haskell and check its version. dnl Check the version of c2hs AC_CACHE_CHECK([c2hs version], c2hs_version, [ - c2hs_version=`$C2HS_CONFIG --version | $SED "s/[\([0-9.]*\) .*]/\1/"`; + c2hs_version=`$C2HS --version | $SED "s/[[^0-9.]*\([0-9.]*\) .*]/\1/"`; ]) - GTKHS_PROG_CHECK_VERSION($c2hs_version, -lt, 0.8.0, - AC_MSG_ERROR([You need C->Haskell version 0.8.0 upwards! + GTKHS_PROG_CHECK_VERSION($c2hs_version, -lt, 0.11.6, + AC_MSG_ERROR([You need C->Haskell version 0.11.6 upwards! ** Download from \"http://www.cse.unsw.edu.au/~chak/haskell/c2hs/\". **])) - GTKHS_PROG_CHECK_VERSION($c2hs_version, -lt, 0.10.13, - AC_MSG_WARN([ - ************************************************************* - * You may run into problems with this version of C->Haskell.* - * If c2hs stumbles over VARARG macros edit * - * c2hs/toplevel/C2HSConfig.hs by changing the line * - * cppopts = "" * - * to * - * cppopts = "-x c" * - * and recompile and reinstall c2hs. This problem is fixed * - * in version 0.10.13 and above. * - *************************************************************])) dnl C->Haskell configuration. - C2HS=`$C2HS_CONFIG --c2hs`; fi - -dnl C2HS_CFLAGS="`$C2HS_CONFIG --cflags`" -dnl AC_MSG_RESULT([Notice: C->Haskell induced compile time options: `$C2HS_CONFIG --cflags`]) -dnl LIBS="`$C2HS_CONFIG --libs` $LIBS" -dnl AC_MSG_RESULT([Notice: C->Haskell induced link time options: `$C2HS_CONFIG --libs`]) # Read the version file VERSION=`cat $TOP/VERSION` |