summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2019-12-26 16:19:22 +0200
committerAdrian Thurston <thurston@colm.net>2019-12-26 16:20:02 +0200
commit7856bca6a0e5e5e046a07118dda4c7feebbc08e6 (patch)
tree3e46154955ef56a379d432d6368f6039096c445c
parentf08be4173ea6955dda3c48c67bdcb39865133f13 (diff)
downloadcolm-7856bca6a0e5e5e046a07118dda4c7feebbc08e6.tar.gz
some improvements to the --with-colm build option
This flag is not for production building. Bootstrapped build should always be used.
-rw-r--r--colm/Makefile.am11
-rw-r--r--configure.ac15
2 files changed, 21 insertions, 5 deletions
diff --git a/colm/Makefile.am b/colm/Makefile.am
index aafef201..fcb5c39a 100644
--- a/colm/Makefile.am
+++ b/colm/Makefile.am
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-AM_CPPFLAGS = -I$(top_srcdir)/aapl -Iinclude
+AM_CPPFLAGS = -I$(top_srcdir)/aapl
AUTOMAKE_OPTIONS = subdir-objects
@@ -49,8 +49,7 @@ endif
common_CFLAGS = \
-Wall \
- -DPREFIX='"$(prefix)"' \
- -Iinclude
+ -DPREFIX='"$(prefix)"'
libprog_a_SOURCES = \
buffer.h bytecode.h colm.h debug.h dotgen.h fsmcodegen.h fsmgraph.h \
@@ -80,12 +79,16 @@ if EXTERNAL_COLM
# Generate the parser using a single run with an external colm program.
#
BUILD_PARSE_3_WITH = $(EXTERNAL_COLM)/bin/colm$(EXEEXT)
+AM_CPPFLAGS += $(EXTERNAL_INC)
+AM_LDFLAGS = $(EXTERNAL_LIBS)
else
noinst_PROGRAMS = bootstrap0 bootstrap1 bootstrap2
BUILD_PARSE_3_WITH = $(builddir)/bootstrap2$(EXEEXT)
+AM_CPPFLAGS += -Iinclude
+AM_LDFLAGS = -L.
#
# bootstrap0: The input program for bootstrap0 is construced using internal
@@ -183,7 +186,7 @@ colm_CXXFLAGS = $(common_CFLAGS) -DLOAD_COLM
colm_CFLAGS = $(common_CFLAGS)
colm_SOURCES = main.cc loadcolm.cc loadfinal.h version.h
nodist_colm_SOURCES = gen/if3.h gen/if3.cc gen/parse3.c
-colm_LDADD = libprog.a libcolm.la
+colm_LDADD = libprog.a -lcolm
include/colm:
mkdir -p include
diff --git a/configure.ac b/configure.ac
index 5e1b9ee4..8717dd6a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -334,12 +334,23 @@ SED_SUBST="$SED_SUBST -e 's|@CRACK_BIN@|${CRACK_BIN}|g'"
AC_SUBST(CRACK_BIN)
-dnl Skip bootstrap and build using an existing version of colm. Allows us to
+dnl Skip bootstrap process and build using an existing version of colm. Allows us to
dnl break colm without breaking the build of colm.
+dnl
+dnl WARNING: DO NOT USE FOR PRODUCTION BUILD
+dnl
+dnl Only use this when you need to in order to get colm to build. Using an external
+dnl colm program (and library) has the consequence that parsing of patterns and
+dnl constructors in colm programs will also use this external library, since there
+dnl can only be one set of colm functions linked. It's not possible to use the
+dnl external parser for parsing the colm program, then use the internal parser for
+dnl the patterns.
AC_ARG_WITH(colm,
[AC_HELP_STRING([--with-colm], [prefix of colm install to build with, instead of bootstrapping])],
[
EXTERNAL_COLM="$withval"
+ EXTERNAL_INC="-I$withval/include"
+ EXTERNAL_LIBS="-L$withval/lib"
AC_CHECK_FILES(["$EXTERNAL_COLM/bin/colm"], [],
[AC_ERROR(["could not find $EXTERNAL_COLM/bin/colm"])])
],
@@ -348,6 +359,8 @@ AC_ARG_WITH(colm,
AM_CONDITIONAL([EXTERNAL_COLM], [test "x$EXTERNAL_COLM" != x])
AC_SUBST(EXTERNAL_COLM)
+AC_SUBST(EXTERNAL_INC)
+AC_SUBST(EXTERNAL_LIBS)
dnl
dnl Wrap up.