Skip to content

Commit

Permalink
wip lablgtk via ocamlfind
Browse files Browse the repository at this point in the history
  • Loading branch information
ygrek committed Jul 29, 2024
1 parent ae2c650 commit b6263a5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
18 changes: 11 additions & 7 deletions config/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down
8 changes: 4 additions & 4 deletions config/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 '
Expand Down
2 changes: 1 addition & 1 deletion src/gtk2/gui/guiArt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ let table = [
(* *)
(**********************************************************************************)

open Zlib
open Zlib2

(* Convenient function to load an icon set to customize the GUI *)

Expand Down
6 changes: 3 additions & 3 deletions src/gtk2/gui/x11/systraystubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include <gtk/gtktooltips.h>

#include <stdio.h>
#include <lablgtk2/wrappers.h>
#include <lablgtk2/ml_gdkpixbuf.h>
#include <lablgtk2/ml_gobject.h>
#include <../lablgtk2/wrappers.h>
#include <../lablgtk2/ml_gdkpixbuf.h>
#include <../lablgtk2/ml_gobject.h>

#include <caml/mlvalues.h>
#include <caml/alloc.h>
Expand Down

0 comments on commit b6263a5

Please sign in to comment.