tests: fix spurious failure on Mac OS X
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 23 Apr 2012 10:47:43 +0000 (12:47 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 23 Apr 2012 12:58:24 +0000 (14:58 +0200)
See automake bug#11306.

* t/lex-libobj.sh: We used to pass LEXLIB='-L /lib' to the ./configure
invocation, to prevent it from explicitly searching for a "lex library".
But the linker on MacOS X 10.5 apparently chokes on that:

  cc -g -O2  -o foo foo.o -L /lib yywrap.o
  ld: file not found: /lib
  collect2: ld returned 1 exit status

So, we now instead pass LEXLIB=' ', which being non-empty is enough
to prevent the search of a "lex library".  And since we are at it,
enhance comments on this non-obvious usage.

Co-authored-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/lex-libobj.sh

index 3bc2981..3f4b860 100755 (executable)
@@ -67,8 +67,13 @@ grep LIBOBJS Makefile # For debugging.
 $MAKE
 $MAKE distclean
 
-# Force "no system lex library".
-./configure LEXLIB='-L /lib'
+# Force "no system lex library".  Setting LEXLIB to a non-empty value
+# ensures that configure won't search for a "lex library", and simply
+# rely on the LEXLIB to provide it, if needed.  So, by setting LEXLIB
+# to a blank but non-empty value we can fool configure into thinking
+# that no system-level library providing a 'yywrap' function is
+# available.  See also discussion on automake bug#11306.
+./configure LEXLIB=' '
 grep LIBOBJS Makefile # For debugging.
 grep '^LIBOBJS *=.*yywrap.*\.o' Makefile # Sanity check.
 $MAKE