On Wednesday 08 May 2013 17:48:17 William S Fulton wrote:




On 4 May 2013 17:46, Geert Janssens <info@kobaltwit.be> wrote:

For all I'll write below, keep in mind that my autoconf knowledge is fairly limited...

 

I'm surprised that pkg-config is causing that much trouble. It's used by the guile sources to build guile. So I would expect any system that ships guile also has a compatible version of pkg-config. (I'm not a Guile core dev, but I have worked on getting guile to compile on Windows for the GnuCash project).

 

I suspect the problems arise from the fact that PGK_CONFIG is inside an if/then construct. I found references that this might cause problems (1).

 

I have rewritten the code a bit to use AS_IF instead of plain if/then/else, as suggested on that page. You can find my patch here:

https://github.com/gjanssens/swig/tree/guile_config_tmp

 

Can you try this and see if the expansion issues go away ? The patch is not complete yet, but I'd like to know if it's worth continuing in this direction.


No real progress, the error message is equally obscure. 


+ autoconf

configure:8954: error: possibly undefined macro: AC_LIB_LINKFLAGS_FROM_LIBS

      If this token and others are legitimate, please use m4_pattern_allow.

      See the Autoconf documentation.


BTW, you can test this by just removing pkg.m4 from your installation (like old versions of pkg-config which don't install any pkg.m4 file). Probably we can just put in a copy of pkg.m4 into Tools/config to solve this problem, but we'd probably have to check that the include paths given to aclocal and ensure our pkg.m4 doesn't override the system's pkg.m4. 


 

 

On Saturday 04 May 2013 00:20:54 William S Fulton wrote:

>

> Some questions:

> - Why was guile-config dropped? It still seems to work okay.

It wasn't working properly when I tried it for guile 2. I'm smarter now than I was when I started this and meanwhile I have found it was mostly used improperly already in the existing configure script. The way guile was installed before 2.0, this didn't cause any issues. But for 2.0 it broke configure. Given that guile in its documentation recommends using pkg-config (2) and not knowing how to invoke guile-config properly for guile 2.0, I decided to go try pkg-config. The guile-config tool is still there in guile 2.0, but I'm not sure if it will remain so.

 

> - Why isn't PKG_PROG_PKG_CONFIG() used instead of AC_PATH_PROG to look

> for pkg config? Surely that macro will know how to look for the

> appropriately named pkg config program. Using it (when a min version is

> given as a parameter) will also give a much more obvious error as to

> what is wrong if the autoconf macros are not available.

This shows my limited autoconf knowledge. The test for pkg-config was copied from the GnuCash project. I now think the GnuCash config file may be due for some updates.

> - Shouldn't we still be using guile-config if pkg-config does not find

> guile. It looks like it provides the same info we require and can

> probably be mapped to the same GUILExxx variables needed for the makefiles.

>

In my most recent patch, I have used the autoconf macros provided by guile (which internally depend on pkg-config).

For guile 1.8, the GUILE_FLAGS macro will call guile-config behind the scenes so in the end with guile 1.8 the relevant information comes from the same source. For guile 2.0 this is no longer true. Clearly the guile developers are moving away from guile-config in favour of pkg-config.

 

So in my opinion getting the pkg-based configuration working properly will be better in the long term.

 

By the way, I won't be available from Sunday till Friday, so future reactions may come only after that.

 

Geert

 

(1) For example in section 3.4 on this page:

http://www.flameeyes.eu/autotools-mythbuster/pkgconfig/pkg_check_modules.html

(2) http://www.gnu.org/software/guile/manual/guile.html#Autoconf-Background


Maybe Guile and GnuCash can get away with having pkg-config properly installed, but SWIG is about a whole lot more languages than Guile and I need it to work on a wider set of configurations. As depending on pkg-config can easily break the autogen.sh stage, I'm going to remove the pkg-config dependency and go back to using guile-config. Maybe it will have problems in the long term, but correctly getting guile detected is not that important. For now, it works and doesn't have any negative side effects on old machines for developers where pkg-config is out of date. The most important thing is for configure to finish successfully so that folk can build SWIG. Of secondary importance is getting a perfect target language detection working, especially given the values can be provided with the --with-guile-xxxx options. I have hence rewritten configure.ac to use guile-config.

Hope you enjoy your break and when you come back, please try it out and I would appreciate it if you could find a way to set the GUILE_SCM_INTERFACE flag in some intelligent way, perhaps by running some guile code to detect scm over gh or using 'guile-config info guileversion' or something else in guile-config that is still supported in the newer versions. Probably you need something like GUILE_MODULE_CHECK in guile.m4. I notice that guile-1.6 doesn't work, even though from what I understand it does have scm support. Perhaps in that case we just check for 1.8 or later.


William



I would have loved to see pkg-config being integrated. I'm pretty sure this can be fixed, like for example by adding pkg.m4. But frankly I don't feel like spending much more energy on that area. Your modified configure script using guile-config works well for both guile 1.8 and guile 2.0, so that should be sufficient. I did fix the matrix example, which inadvertently got broken in your makefile cleanups

 

Regarding guile 1.6 support. This has been dropped. Not because it doesn't have an scm interface (it has), but because it has a different memory management model than guile 1.8 and 2.0 have and several of guile 1.6's procedures have been deprecated in 1.8 and removed in 2.0. Trying to support both may be possible, but results in much more complicated code. I motivated this on this list before that I had no intention to support guile 1.6 anymore.

 

IMO we should add a test in configure.ac to ensure guile is at least 1.8. If not, the guile module of swig should be disabled and a warning issued.

 

Geert