Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure looks for lablgtk in a wrong place, and then disables GUI #107

Open
barracuda156 opened this issue Aug 15, 2024 · 8 comments
Open

Comments

@barracuda156
Copy link
Contributor

@ygrek I have found a reason why lablgtk2 is not found. It sits in /opt/local/lib/ocaml/site-lib/lablgtk2, but configure uses $OCAMLLIB/$LABLGTK_NAME, where OCAMLLIB is defined by ocamlc -where, which gives /opt/local/lib/ocaml. Of course, having the path wrong, configure cannot find it.

This works correctly:

--- config/configure.in	2024-08-07 11:58:06.000000000 +0800
+++ config/configure.in	2024-08-16 06:05:35.000000000 +0800
@@ -257,7 +257,7 @@
 
 touch install-sh
 
-LABLGTK_NAME=lablgtk
+LABLGTK_NAME=lablgtk2
 
 # **********                                                                                  **********
 # **********                    Network and Feature configure switch variables                **********
@@ -1226,15 +1226,15 @@
      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/site-lib/$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/site-lib/$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/site-lib/$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"
@@ -1255,7 +1255,7 @@
   else
      AC_MSG_RESULT(no)
      LABLGTK_CONFIG=no
-     if test -f $OCAMLLIB/$LABLGTK_NAME/lablgtk.cma; then
+     if test -f $OCAMLLIB/site-lib/$LABLGTK_NAME/lablgtk.cma; then
        echo "-------------------------------------------------------------"
        echo "$LABLGTK_NAME is not installed properly. See the INSTALL.txt"
        echo "file of mldonkey to see how to compile $LABLGTK_NAME. You"

After the patch applied, configure finds what it should:

Arguments to configure:  '--enable-option-checking=fatal' '--prefix=/opt/local' '--enable-gnutella2' '--enable-gui=newgui2' '--enable-multinet' '--enable-upnp-natpmp' '--with-libiconv-prefix=/opt/local' 'CC=ccache /opt/local/bin/gcc-mp-14' 'CFLAGS=-pipe -Os -arch ppc' 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc' 'CPPFLAGS=-I/opt/local/include -I/opt/local/lib/ocaml/site-lib/lablgtk2' 'CXX=ccache /opt/local/bin/g++-mp-14' 'CXXFLAGS=-pipe -Os -arch ppc'
checking for gcc... ccache /opt/local/bin/gcc-mp-14
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether ccache /opt/local/bin/gcc-mp-14 accepts -g... yes
checking for ccache /opt/local/bin/gcc-mp-14 option to enable C11 features... none needed
checking how to run the C preprocessor... ccache /opt/local/bin/gcc-mp-14 -E
checking build system type... powerpc-apple-darwin10.0.0d2
checking host system type... powerpc-apple-darwin10.0.0d2
checking for sed... sed

--------------------------------
     Checking system tools.
--------------------------------
checking for ranlib... ranlib
checking for gmake... gmake
checking for make... (cached) gmake
checking if gmake is GNU make ... yes
checking for bzip2... bzip2
checking for gzip... (cached) bzip2
checking for perl... /opt/local/bin/perl
checking for rpmbuild... no
checking for rpm... no
checking for wget... wget
----------------------------------------
     Checking system tools finished.
----------------------------------------

--------------------------------
     Checking OCaml compiler.
--------------------------------
checking for ocamlc.opt... no
checking for ocamlc... ocamlc
checking for camlp4... /opt/local/bin/camlp4
checking for ocamlopt.opt... no
checking for ocamlopt... no
checking for ocamldep... /opt/local/bin/ocamldep
checking for ocamllex.opt... no
checking for ocamllex... /opt/local/bin/ocamllex
checking for ocamlyacc... /opt/local/bin/ocamlyacc
checking for ocamldoc... /opt/local/bin/ocamldoc
checking for ocamlmktop... /opt/local/bin/ocamlmktop
checking for camlp4... (cached) /opt/local/bin/camlp4
checking for camlp4of... /opt/local/bin/camlp4of
-------------------------------------------
     Checking OCaml 4.14.1 finished.
-------------------------------------------
checking ocaml num library... found -I /opt/local/lib/ocaml/site-lib/num

----------------------------------
     Checking system headers.
----------------------------------
checking for ccache /opt/local/bin/gcc-mp-14 option to enable large file support... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... yes
checking for setrlimit... yes
checking for getrlimit... yes
checking for strerror_r... yes
checking for strerror... yes
checking for posix_fallocate... no
checking for byteswap.h... no
checking for sys/utsname.h... yes
checking for arpa/inet.h... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... yes
checking for sys/resource.h... yes
checking for netinet/in_systm.h... yes
checking for netinet/in.h... yes
checking for netinet/ip.h... yes
checking for sys/poll.h... yes
checking for poll... yes
checking for sys/vfs.h... no
checking for sys/statvfs.h... yes
checking for sys/param.h... yes
checking for sys/mount.h... yes
-------------------------------------------
     Checking system headers finished.
-------------------------------------------

-----------------------------------
     Checking system libraries.
-----------------------------------
----- checking zlib (required)
checking for inflate in -lz... yes
checking for zlib.h... yes
checking for zlibVersion in -lz... yes
----- checking bzlib (optional)
checking for bzlib.h... yes
checking for BZ2_bzReadOpen in -lbz2... yes
checking for BZ2_bzlibVersion in -lbz2... yes
----- checking libminiupnpc >= 1.6 (optional)
checking for miniupnpc/miniupnpc.h... yes
checking for upnpDiscover in -lminiupnpc... yes
----- checking libnatpmp >= 20110808 (optional)
checking for natpmp.h... yes
checking for initnatpmp in -lnatpmp... yes
----- checking libmagic (GNU file) (optional)
checking for ccache /opt/local/bin/gcc-mp-14 options needed to detect all undeclared functions... none needed
checking for magic.h... yes
checking for magic_file in -lmagic... yes
checking whether MAGIC_ERROR is declared... yes
----- checking gd (optional)
checking for gdlib-config... no
checking for gd.h... yes
checking for gdImageCreate in -lgd... no
configure: not found, trying another method
checking for gdImageCreate in -lgd... yes
checking for libpng-config... libpng-config
checking for png_create_read_struct  in -lpng... yes
checking for gdImagePng in -lgd... no
configure: not found, trying another method
checking for gdImagePng in -lgd... yes
checking for png support in libgd... yes
checking for png_access_version_number in -lpng... yes
checking for jpeg_CreateCompress in -ljpeg... yes
checking for gdImageJpeg in -lgd... no
configure: not found, trying another method
checking for gdImageJpeg in -lgd... yes
checking for jpeg support in libgd... yes
----- checking iconv (optional)
checking for ld used by GCC... /opt/local/bin/ld
checking if the linker (/opt/local/bin/ld) is GNU ld... no
checking for shared library run path origin... done
checking for iconv... yes
checking how to link with libiconv... -liconv
checking for iconv declaration... 
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for locale_charset... yes
checking for locale_charset in -lcharset... yes
checking for libcharset.h... yes
checking for langinfo.h... yes
checking for locale.h... yes
----- checking thread support (optional, strongly advised)
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE
checking for cc_r... ccache /opt/local/bin/gcc-mp-14
---------------------------------------------
     Checking system libraries finished.
---------------------------------------------

--------------------------------------
     Checking activated networks.
--------------------------------------
checking eDonkey... yes
checking whether the compiler supports GNU C++... yes
checking whether ccache /opt/local/bin/g++-mp-14 accepts -g... yes
checking for ccache /opt/local/bin/g++-mp-14 option to enable C++11 features... none needed
checking for ccache... ccache /opt/local/bin/g++-mp-14
checking eMule SUI... yes
checking whether ccache /opt/local/bin/g++-mp-14 accepts -fno-omit-frame-pointer... yes
checking whether ccache /opt/local/bin/g++-mp-14 accepts -mno-omit-leaf-frame-pointer... no
checking BitTorrent... yes
checking FileTP... yes
checking G2... yes
checking Fasttrack... yes
checking DirectConnect... yes
-----------------------------------------------
     Checking activated networks finished.
-----------------------------------------------
---------------------------------------------------------
Checking the libraries required to build the GTK GUI.
---------------------------------------------------------
checking for GTK+ - version >= 2.4.0... yes
checking for librsvg - version >= 2.4.0... yes
checking for native code lablgtk2... yes
checking GToolbox.popup_menu args... grep: /opt/local/lib/ocaml/lablgtk2/gToolbox.mli: No such file or directory
old
---------------------------------------------------------
End of GTK GUI configuration.
---------------------------------------------------------
configure: creating ./config.status
config.status: creating Makefile.config
config.status: creating mldonkey.rc
config.status: creating ../src/utils/lib/autoconf.ml.new
config.status: creating ../src/utils/lib/gAutoconf.ml.new
config.status: creating ../src/utils/bitstring/bitstring.ml
config.status: creating ../src/utils/lib/magic.ml
config.status: creating ../src/networks/donkey/donkeySui.ml
config.status: creating ../src/daemon/driver/driverGraphics.ml
config.status: creating ../packages/rpm/mldonkey.spec
config.status: creating ../packages/rpm/Makefile
config.status: creating ../packages/slackware/mldonkey.options
config.status: creating config.h

Building dependencies (if it blocks, try 'gmake depend' to see the problem)

Configuring MLDonkey 3.1.7 completed.

Network modules:
 - eDonkey           enabled (eMule SUI enabled)
 - BitTorrent        enabled
 - FileTP (aka wget) enabled
 - Fasttrack         enabled
 - Gnutella                  disabled - unmaintained
 - Gnutella2         enabled (warning: this network module is unmaintained)
 - Direct Connect    enabled
 - Open Napster              disabled - currently not usable
 - Soulseek                  disabled - currently not usable
 - OpenFT                    disabled - currently not usable

Core features:
 - zlib (required)   enabled
 - threads           enabled
 - bzip2             enabled
 - iconv             enabled
 - libmagic          enabled
 - upnp & natpmp     enabled
 - graphical stats   enabled
   - png support     enabled
   - jpg support     enabled


 - GUI support       GTK2 GUI

Compilers:
 - OCaml version     4.14.1 - byte code
 - ccache /opt/local/bin/gcc-mp-14 version       14.2.0
 - ccache /opt/local/bin/g++-mp-14 version       14.2.0


Now execute 'gmake' to start compiling. Good luck!

To compile a static code execute:     gmake mlnet.byte.static
To produce a release tarball execute: gmake release.mlnet.static
To clean the build directory execute: gmake maintainerclean

Compiling CryptoPP.cc can take several minutes, on slow machines up to half an hour.
@ygrek
Copy link
Owner

ygrek commented Aug 16, 2024

yes, but the patch is not good, for different people path will be different. It should use ocamlfind to find deps.

@barracuda156
Copy link
Contributor Author

I know, that is why I did not submit it as a PR.

@ygrek ygrek mentioned this issue Aug 17, 2024
@ygrek
Copy link
Owner

ygrek commented Aug 17, 2024

This will be for the next release. Documented current gui build status in 16e4106

@barracuda156
Copy link
Contributor Author

@ygrek Hmm, somehow this got further broken in 3.2.1, since the patch that worked earlier has no effect now. Not yet sure what went wrong.

@barracuda156
Copy link
Contributor Author

Ah, perhaps just this: da5db50
I.e. I applied the patch to configure.in, but it is not used now :)

@barracuda156
Copy link
Contributor Author

UPD. Yeah, indeed. I just need to patch configure now.

@barracuda156
Copy link
Contributor Author

However, this error #111 is still there, so GTK GUI does not build:

ocamlc -w +a-3-4-6-27-29-32-35-37-41-44-45-48-60-70   -I src/utils/extlib  -I src/utils/cdk  -I src/utils/bitstring  -I src/utils/lib  -I src/utils/ocamlrss  -I src/utils/xml-light  -I src/utils/net  -I tools  -I src/daemon/common  -I src/daemon/driver  -I src/utils/mp3tagui  -I src/config/unix  -I src/gtk2/gui  -I src/gtk2/gui/x11  -I src/gtk2/gui/win32  -I icons/rsvg  -I +lablgtk2  -I src/networks/direct_connect  -I src/networks/fasttrack  -I src/networks/fileTP  -I src/networks/bittorrent  -I src/networks/donkey -I +camlp4 -I /opt/local/lib/ocaml/site-lib/num -c src/gtk2/gui/guiUtf8.ml
File "src/gtk2/gui/guiUtf8.ml", line 180, characters 19-43:
180 | let (_, charset) = Glib.Convert.get_charset ()
                         ^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound module Glib
gmake: *** [Makefile:5443: src/gtk2/gui/guiUtf8.cmo] Error 2
gmake: Leaving directory '/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_mldonkey/mldonkey/work/mldonkey-3-2-1'
Command failed:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_mldonkey/mldonkey/work/mldonkey-3-2-1" && /opt/local/bin/gmake -w all 
Exit code: 2

@ygrek
Copy link
Owner

ygrek commented Sep 30, 2024

UPD. Yeah, indeed. I just need to patch configure now.

patch configure.in and do cd config && autoconf
unbound module glib means path to gtk is not correct i assume

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants