From b6263a5e36ea10ca5067d3bd9adc809d4dd860aa Mon Sep 17 00:00:00 2001 From: ygrek Date: Sun, 28 Jul 2024 23:23:26 -0400 Subject: [PATCH] wip lablgtk via ocamlfind --- config/Makefile.in | 18 +++++++++++------- config/configure.in | 8 ++++---- src/gtk2/gui/guiArt.ml | 2 +- src/gtk2/gui/x11/systraystubs.c | 6 +++--- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/config/Makefile.in b/config/Makefile.in index d7d29ef53..d598b22a2 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -93,7 +93,9 @@ SRC_FILETP=src/networks/fileTP SUBDIRS=$(EXTLIB) $(CDK) $(BITSTRING) $(LIB) $(RSS) $(XML) $(NET) tools \ $(COMMON) $(DRIVER) $(MP3) src/config/$(OS_FILES) -INCLUDES += $(foreach file, $(SUBDIRS), -I $(file)) -I +camlp4 $(NUMS_INCLUDE) +INT_INCLUDES = $(foreach file, $(SUBDIRS), -I $(file)) +EXT_INCLUDES = -I +camlp4 $(NUMS_INCLUDE) +INCLUDES = $(INT_INCLUDES) $(EXT_INCLUDES) CFLAGS:=$(CFLAGS) $(CONFIG_INCLUDES) $(GTKCFLAGS) $(GD_CFLAGS) @@ -658,10 +660,12 @@ install:: opt ifneq ("$(GUI)" , "no") ifeq ("$(GUI)", "newgui2") - SUBDIRS += $(SRC_GUI) $(SRC_GUI)/x11 $(SRC_GUI)/win32 $(ICONS_CHOICE) +lablgtk2 - GTK_LIBS_byte=-ccopt "$(GTKLLIBS)" -cclib "$(GTKLFLAGS)" -I +lablgtk2 $(LABLGL_CMA) lablgtk.cma gtkInit.cmo lablrsvg.cma - GTK_LIBS_opt=-ccopt "$(GTKLLIBS)" -cclib "$(GTKLFLAGS)" -I +lablgtk2 $(LABLGL_CMXA) lablgtk.cmxa gtkInit.cmx lablrsvg.cmxa - GTK_STATIC_LIBS_opt=-ccopt "$(GTKLLIBS)" -cclib "$(GTKLFLAGS)" -I +lablgtk2 lablgtk.cmxa gtkInit.cmx lablrsvg.cmxa + LABLGTK2_FLAGS:=$(shell ocamlfind query -i-format lablgtk2) + EXT_INCLUDES += $(LABLGTK2_FLAGS) + SUBDIRS += $(SRC_GUI) $(SRC_GUI)/x11 $(SRC_GUI)/win32 $(ICONS_CHOICE) + GTK_LIBS_byte=-ccopt "$(GTKLLIBS)" -cclib "$(GTKLFLAGS)" $(LABLGTK2_FLAGS) $(LABLGL_CMA) lablgtk.cma gtkInit.cmo lablrsvg.cma + GTK_LIBS_opt=-ccopt "$(GTKLLIBS)" -cclib "$(GTKLFLAGS)" $(LABLGTK2_FLAGS) $(LABLGL_CMXA) lablgtk.cmxa gtkInit.cmx lablrsvg.cmxa + GTK_STATIC_LIBS_opt=-ccopt "$(GTKLLIBS)" -cclib "$(GTKLFLAGS)" $(LABLGTK2_FLAGS) lablgtk.cmxa gtkInit.cmx lablrsvg.cmxa else SUBDIRS += $(SRC_GUI) $(CONFIGWIN) $(OKEY) $(GPATTERN) $(ICONS_CHOICE) +lablgtk $(SRC_PROGRESS) GTK_LIBS_byte=-I +lablgtk $(LABLGL_CMA) lablgtk.cma @@ -1564,9 +1568,9 @@ resfile.o: depend: $(RESFILE) \ $(PA_ZOG) $(LIB)/http_lexer.ml $(TMPSOURCES) - @$(OCAMLDEP) $(OCAMLDEP_OPTIONS) $(patsubst -I +labl$(GTK),,$(INCLUDES)) *.ml *.mli > .depend + @$(OCAMLDEP) $(OCAMLDEP_OPTIONS) $(INT_INCLUDES) *.ml *.mli > .depend @(for i in $(SUBDIRS); do \ - $(OCAMLDEP) $(OCAMLDEP_OPTIONS) $(patsubst -I +labl$(GTK),,$(INCLUDES)) $$i/*.ml $$i/*.mli >> .depend; \ + $(OCAMLDEP) $(OCAMLDEP_OPTIONS) $(INT_INCLUDES) $$i/*.ml $$i/*.mli >> .depend; \ $(OCAMLPP) $$i/*.mlt >> .depend; \ done) @if test "$(GUI)" = "newgui2"; then \ diff --git a/config/configure.in b/config/configure.in index 3f991556a..6291fc795 100644 --- a/config/configure.in +++ b/config/configure.in @@ -1360,15 +1360,15 @@ if test "$GTK_CONFIG" = "no"; then LABLGTK_CONFIG=no else AC_MSG_CHECKING(for native code $LABLGTK_NAME) - if test -f $OCAMLLIB/$LABLGTK_NAME/lablgtk.$OCAMLLIB_EXT; then + if test -f $OCAMLLIB/../$LABLGTK_NAME/lablgtk.$OCAMLLIB_EXT; then if test "$GUI" = "newgui2"; then - if test -f $OCAMLLIB/$LABLGTK_NAME/lablrsvg.$OCAMLLIB_EXT; then + if test -f $OCAMLLIB/../$LABLGTK_NAME/lablrsvg.$OCAMLLIB_EXT; then AC_MSG_RESULT(yes) LABLGTK_CONFIG=yes else AC_MSG_RESULT(no) LABLGTK_CONFIG=no - if test -f $OCAMLLIB/$LABLGTK_NAME/lablrsvg.cma; then + if test -f $OCAMLLIB/../$LABLGTK_NAME/lablrsvg.cma; then echo "---------------------------------------------------------" echo "lablrsvg is not installed properly. See the INSTALL.txt" echo "file of mldonkey to see how to compile $LABLGTK_NAME. You" @@ -1465,7 +1465,7 @@ if test "$LABLGTK_CONFIG" = "no"; then else MORE_TARGETS="$MORE_TARGETS $GUIS" AC_MSG_CHECKING(GToolbox.popup_menu args) - GTOOLBOX="$OCAMLLIB/$LABLGTK_NAME/gToolbox.mli" + GTOOLBOX="$OCAMLLIB/../$LABLGTK_NAME/gToolbox.mli" grep popup $GTOOLBOX | grep -i button 2> /dev/null && GTOOLBOX_ARGS=new if test "$GTOOLBOX_ARGS" = "new"; then GTOOLBOX_POPUPMENU=' ~button: button ~time: time ' diff --git a/src/gtk2/gui/guiArt.ml b/src/gtk2/gui/guiArt.ml index 0c03b5166..10ca4ba52 100644 --- a/src/gtk2/gui/guiArt.ml +++ b/src/gtk2/gui/guiArt.ml @@ -235,7 +235,7 @@ let table = [ (* *) (**********************************************************************************) -open Zlib +open Zlib2 (* Convenient function to load an icon set to customize the GUI *) diff --git a/src/gtk2/gui/x11/systraystubs.c b/src/gtk2/gui/x11/systraystubs.c index f8fb5e019..3d4e1fbdc 100644 --- a/src/gtk2/gui/x11/systraystubs.c +++ b/src/gtk2/gui/x11/systraystubs.c @@ -25,9 +25,9 @@ #include #include -#include -#include -#include +#include <../lablgtk2/wrappers.h> +#include <../lablgtk2/ml_gdkpixbuf.h> +#include <../lablgtk2/ml_gobject.h> #include #include