Message-ID: <42AE557F.5070508 at rftp.com> Date: Mon, 13 Jun 2005 20:56:47 -0700 From: Robert Roessler Organization: Robert's High-performance Software MIME-Version: 1.0 To: Jacques Garrigue CC: lablgtk at math.nagoya-u.ac.jp Subject: Re: New lablgtk2 snapshot References: <20050613.210716.25991716.garrigue at math.nagoya-u.ac.jp> In-Reply-To: <20050613.210716.25991716.garrigue at math.nagoya-u.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Jacques Garrigue wrote: > There is a new snapshot of lablgtk2 at > http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html > ftp://ftp.kurims.kyoto-u.ac.jp/pub/lang/olabl/lablgtk2-20050613.tar.gz > > It contains only a few enhancements and bug fixes, but some people may > need them. Thanks for getting this out to us non-CVS-privileged types! :) I had some difficulties doing the build (with MSVC 7.1 and MinGW make on Windows XP SP2) ... I have some suggestions, observations, and bug reports regarding "config.make.nt" and "src/Makefile" (applying also to the previous snapshot) as well as what I believe to be required minor changes to 9 .c and .h files (all relating to the newly exported helper functions). config.make.nt ============== As a personal preference, I define USE_CC=1 and CC=cl; this is background that may help in interpreting my later comments. A suggestion: change the LIBDIR definition from LIBDIR=`$(CAMLC) -where` to LIBDIR="`$(CAMLC) -where`" While this does require matching "unquoting" changes in src/Makefile, it fixes some build problems when OCaml is installed in a path containing spaces (e.g., "e:/usr/local/Objective Caml"). src/Makefile ============ As the MinGW make I use insists on interpreting Microsoft-style "/" switches as paths (???), changing the MKLIB and MKDLL definitions to use the "-" form for switches helps *me*, but may or may not be of use to anyone else - but shouldn't hurt, since MSVC accepts either form. MKLIB = lib /nologo /debugtype:CV /out: MKDLL = link /nologo /dll "`$(CAMLC) -where`/ocamlrun.lib" "$(GTKLIBPATH)" /out: become MKLIB = lib -nologo -debugtype:CV -out: MKDLL = link -nologo -dll $(LIBDIR)/ocamlrun.lib "$(GTKLIBPATH)" -out: I prefer the second CFLAGS definition: CFLAGS = -O -DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS $(GTKCFLAGS) becomes CFLAGS =-nologo -O1 -G6 -GF -DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS $(GTKCFLAGS) As for the rules which build the two object file versions from C source, they could easily BOTH use CCOMPILER (rather than just .c$(XO))... and I usually specify statically linked (WRT the C runtime) builds to avoid the dependency. .c$(XO): $(CCOMPILER) $< .c.d.obj: $(COMPILER) -verbose -ccopt "/MD -DCAML_DLL /Fo$@ $(CFLAGS)" $< becomes .c$(XO): $(CCOMPILER) -MT $(CFLAGS) $< .c.d$(XO): $(CCOMPILER) -MT -DCAML_DLL -Fo$@ $(CFLAGS) $< Finally (for the Makefile), the set of changes required by the change to LIBDIR need to happen... they are all in the "install*" rule(s), and all just consist of removing the quotes from the LIBDIR-derived vars: INSTALLDIR, BINDIR, and DLLDIR. src/{ml_gdk.h,ml_glib.c,ml_gobject.h,ml_gtk.h,ml_gtk.c,ml_pango.h,ml_gtklist.c,ml_gtkpack.c,ml_gtktext.c} ========================================================================================================= These files all (AFAICT) require changes as part of the "exporting helper functions" changes. All of the .h changes are adding CAMLprim specifiers on Val_ funcs which had either "external" or no specifier. All of the .c changes are removing a "static" specifier from Make_..._val macro invocations. src/ml_gdk.h ============ extern value Val_GdkFont (GdkFont *); CAMLprim value Val_GdkFont (GdkFont *); extern value Val_GdkRegion (GdkRegion *); /* finalizer is destroy! */ CAMLprim value Val_GdkRegion (GdkRegion *); /* finalizer is destroy! */ extern int OptFlags_GdkModifier_val (value); extern int Flags_GdkModifier_val (value); extern int Flags_Event_mask_val (value); CAMLprim int OptFlags_GdkModifier_val (value); CAMLprim int Flags_GdkModifier_val (value); CAMLprim int Flags_Event_mask_val (value); extern int Flags_GdkDragAction_val (value); CAMLprim int Flags_GdkDragAction_val (value); src/ml_gobject.h ================ value Val_GClosure (GClosure *); CAMLprim value Val_GClosure (GClosure *); src/ml_gtk.h ============ value Val_GtkObject_sink (GtkObject *w); CAMLprim value Val_GtkObject_sink (GtkObject *w); src/ml_pango.h ============== value Val_PangoFontDescription_new(PangoFontDescription* it); CAMLprim value Val_PangoFontDescription_new(PangoFontDescription* it); src/ml_glib.c ============= static Make_Flags_val(Io_condition_val) Make_Flags_val(Io_condition_val) src/ml_gtk.c ============ static Make_Flags_val (Dest_defaults_val) static Make_Flags_val (Target_flags_val) Make_Flags_val (Dest_defaults_val) Make_Flags_val (Target_flags_val) static Make_OptFlags_val (Accel_flag_val) Make_OptFlags_val (Accel_flag_val) src/ml_gtklist.c ================ static Make_Flags_val (Button_action_val) Make_Flags_val (Button_action_val) src/ml_gtkpack.c ================ static Make_Flags_val (Attach_options_val) Make_Flags_val (Attach_options_val) src/ml_gtktext.c ================ static Make_OptFlags_val(Text_search_flag_val) Make_OptFlags_val(Text_search_flag_val) Obviously, I have the edited files... :) If anyone requests it, I can email them... they are also posted on my site in http://www.rftp.com/lablgtk2-20050613/src/ I will leave them there for a few days. Robert Roessler robertr@rftp.com http://www.rftp.com