Re: checking for header/library mismatch, rpath problem?

2010-07-01 Thread Peter Breitenlohner

On Tue, 29 Jun 2010, Ralf Wildenhues wrote:


* Peter Breitenlohner wrote on Tue, Jun 29, 2010 at 10:36:32AM CEST:

Here the macro we are using in TeX Live for such tests (C and C++).  Our
purpose is to test properties of libraries that can be either
(1) uninstalled libtool libraries already built when this configure runs,
or (2) installed libraries -- libtool or not.


Good stuff.  Are you willing to turn this into a patch against git
Libtool?  Otherwise we'll put it on our todo list.  You might need
to sign papers though, at least if you're adding test coverage.


Hi Ralf,

see below.


A general set of macros could be LT_USE_LIBTOOL_PUSH and _POP and could
adjust the AC_LANG setting of all configured libtool tags; the pop macro
could reset them to their original state afterwards; that would help for
encapsulation.  Or some better names I can't think of right now.


# _KPSE_USE_LIBTOOL()
# ---
AC_DEFUN([_KPSE_USE_LIBTOOL],
[## $0: Generate a libtool script for use in configure tests
AC_PROVIDE_IFELSE([LT_INIT], ,
  [m4_fatal([$0: requires libtool])])[]dnl
LT_OUTPUT
m4_append([AC_LANG(C)],
[ac_link=./libtool --mode=link --tag=CC $ac_link
])[]dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[m4_append([AC_LANG(C++)],
[ac_link=./libtool --mode=link --tag=CXX $ac_link
])])[]dnl
AC_LANG(_AC_LANG)[]dnl
]) # _KPSE_USE_LIBTOOL


Please feel free to use the basic idea which is simple enough and might not
require paperwork, but I would prefer that you put this on your todo list
and have it handled by someone thoroughly familiar with libtool internals
(which I am certainly not).

Our macro perfectly serves our needs, but probably needs to be improved in
several respects (not counting the PUSH/POP generalization), e.g.,

(1) cover all languages.  Should there be a one-to-one correspondence
between AC_PROG_FOO/AC_LANG(foo)/--tag=FOO?  I am thinking in particular of
ObjC/ObjC++ that might need libtool tags or could use tags CC/CXX. (For TeX
Live we have ObjC/ObjC++ source files but don't have to run test for these
languages.)

(2) There may be subtleties about the ordering of Autoconf macros:
  LT_INIT
  AC_PROG_CXX
has the same effect as
  AC_PROG_CXX
  LT_INIT
but I don't know is if
  LT_INIT
  LT_OUTPUT
  AC_PROG_CXX
also has the same effect as
  LT_INIT
  AC_PROG_CXX
  LT_OUTPUT

Regards
Peter Breitenlohner p...@mppmu.mpg.de



Re: checking for header/library mismatch, rpath problem?

2010-06-29 Thread Ralf Wildenhues
[ please elide autoconf@ from followups, thanks ]

Hi Peter,

* Peter Breitenlohner wrote on Tue, Jun 29, 2010 at 10:36:32AM CEST:
 Here the macro we are using in TeX Live for such tests (C and C++).  Our
 purpose is to test properties of libraries that can be either
 (1) uninstalled libtool libraries already built when this configure runs,
 or (2) installed libraries -- libtool or not.

Good stuff.  Are you willing to turn this into a patch against git
Libtool?  Otherwise we'll put it on our todo list.  You might need
to sign papers though, at least if you're adding test coverage.

A general set of macros could be LT_USE_LIBTOOL_PUSH and _POP and could
adjust the AC_LANG setting of all configured libtool tags; the pop macro
could reset them to their original state afterwards; that would help for
encapsulation.  Or some better names I can't think of right now.

 # _KPSE_USE_LIBTOOL()
 # ---
 AC_DEFUN([_KPSE_USE_LIBTOOL],
 [## $0: Generate a libtool script for use in configure tests
 AC_PROVIDE_IFELSE([LT_INIT], ,
   [m4_fatal([$0: requires libtool])])[]dnl
 LT_OUTPUT
 m4_append([AC_LANG(C)],
 [ac_link=./libtool --mode=link --tag=CC $ac_link
 ])[]dnl
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
 [m4_append([AC_LANG(C++)],
 [ac_link=./libtool --mode=link --tag=CXX $ac_link
 ])])[]dnl
 AC_LANG(_AC_LANG)[]dnl
 ]) # _KPSE_USE_LIBTOOL

Thanks,
Ralf