]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
lex tests: fix spurious link errors on Solaris
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 28 Jun 2011 10:23:48 +0000 (12:23 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 28 Jun 2011 10:24:26 +0000 (12:24 +0200)
On Solaris 10, linking of lex-generated programs was failing in a
couple of lex tests with errors like this:
  g++ -g -O2 -o joe joe.o -ll
  Undefined symbol     first referenced in file
  yywrap()             joe.o
  ld: fatal: Symbol referencing errors. No output written to joe
  collect2: ld returned 1 exit status
This change fixes it, also fixing at once potential problems for
systems that don't have a "lex library" (this happens for example
when cross-compiling from GNU/Linux to MinGW).

* tests/lex-depend-cxx.test (joe.ll, moe.l++): Define a dummy
`yywrap()' function.
* tests/lex-clean-cxx.test (mainfoo.cc, mainbar.cpp, mainbaz.c++,
mainqux.cxx): Likewise.

ChangeLog
tests/lex-clean-cxx.test
tests/lex-depend-cxx.test

index 611126dfbda6fd5eaea51e938d99209fe0dcc3cc..0553c958587fc2a15d08284a35754caa5e76cd82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2011-06-28   Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       lex tests: fix spurious link errors on Solaris
+       On Solaris 10, linking of lex-generated programs was failing in a
+       couple of lex tests with errors like this:
+         g++ -g -O2 -o joe joe.o -ll
+         Undefined symbol     first referenced in file
+         yywrap()             joe.o
+         ld: fatal: Symbol referencing errors. No output written to joe
+         collect2: ld returned 1 exit status
+       This change fixes it, also fixing at once potential problems for
+       systems that don't have a "lex library" (this happens for example
+       when cross-compiling from GNU/Linux to MinGW).
+       * tests/lex-depend-cxx.test (joe.ll, moe.l++): Define a dummy
+       `yywrap()' function.
+       * tests/lex-clean-cxx.test (mainfoo.cc, mainbar.cpp, mainbaz.c++,
+       mainqux.cxx): Likewise.
+
 2011-06-23   Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        docs: avoid a footnote, some related rewordings and improvements
index 340097748a3ae4d0ba57a67e599475b8ca5810d2..3f566c466c68d377a58d62b9207b9e11f081e251 100755 (executable)
@@ -64,6 +64,10 @@ cp parsefoo.lxx parsebar.ll
 cat > mainfoo.cc << 'END'
 // This file should contain valid C++ but invalid C.
 using namespace std;
+int yywrap (void)
+{
+  return 1;
+}
 int main (int argc, char **argv)
 {
   extern int yylex (void);
index 860a96f3a111ab010dbceb83eefafcd5b9b73723..9b5416d61d0094634d20c50b258b349eb366e09a 100755 (executable)
@@ -53,6 +53,10 @@ cat > joe.ll << 'END'
 .
 %%
 #include "my-hdr.hxx"
+int yywrap (void)
+{
+  return 1;
+}
 int main (int argc, char **argv)
 {
   printf("Hello, World!\n");