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

Building the C runtime in a git clone #198

Open
okellogg opened this issue Jan 3, 2019 · 0 comments
Open

Building the C runtime in a git clone #198

okellogg opened this issue Jan 3, 2019 · 0 comments

Comments

@okellogg
Copy link

okellogg commented Jan 3, 2019

Hi,

The INSTALL instructions and the ANTLR3C: Building From Source page assume that the configure script exists, which is not the case when building from a git clone.

Here is how I managed to build antlr3 runtime/C on an x86_64 system running current OpenSuSE Tumbleweed:

  • Applied the patch to runtime/C/Makefile.am shown below.
    Reason: automake was complaining about the source files being in
    the src subdirectory with option subdir-objects disabled.
  • Executed the following Linux commands:
    autoheader
    aclocal
    libtoolize
    automake --add-missing --copy
    autoconf
    ./configure --enable-64bit

At the ./configure I did need the --enable-64bit argument, otherwise I would get

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Iinclude -m32 -O2 -Wall -MT src/antlr3baserecognizer.lo -MD -MP -MF src/.deps/antlr3baserecognizer.Tpo -c src/antlr3baserecognizer.c -o src/antlr3baserecognizer.o
In file included from /usr/include/features.h:452,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from include/antlr3defs.h:252,
                 from include/antlr3baserecognizer.h:39,
                 from src/antlr3baserecognizer.c:9:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:645: src/antlr3baserecognizer.lo] Error 1

Here is the patch to Makefile.am that I used:

diff --git a/runtime/C/Makefile.am b/runtime/C/Makefile.am
index 9867f7e..d7cba2a 100644
--- a/runtime/C/Makefile.am
+++ b/runtime/C/Makefile.am
@@ -1,4 +1,4 @@
-AUTOMAKE_OPTIONS = gnu
+AUTOMAKE_OPTIONS = subdir-objects
 AM_LIBTOOLFLAGS =
 ## --silent
 ACLOCAL_AMFLAGS = -I m4
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

1 participant