summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Westerhuis <victor@westerhu.is>2021-12-04 01:26:36 +0100
committerVictor Westerhuis <victor@westerhu.is>2021-12-04 01:26:36 +0100
commit7b2524ec0c036a3aab8e97e77c8a94b3dc12fe82 (patch)
treeb65c2c7c176ece0910409e15d75ff01e2a489227
parentbb487b1368b65a1f30fe3a59fd0c7d84bdcc483b (diff)
downloadcolm-7b2524ec0c036a3aab8e97e77c8a94b3dc12fe82.tar.gz
Honor includedir and libdir settings
They are usually direct subdirectories of the prefix, but they can be different, for example in Debian's multiarch scheme.
-rw-r--r--src/Makefile.am3
-rw-r--r--src/main.cc6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 6953a93c..09da4c47 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -52,7 +52,8 @@ endif
common_CFLAGS = \
-Wall \
- -DPREFIX='"$(prefix)"'
+ -DINCLUDEDIR='"$(includedir)"' \
+ -DLIBDIR='"$(libdir)"'
libprog_a_SOURCES = \
buffer.h bytecode.h colm.h debug.h dotgen.h fsmcodegen.h fsmgraph.h \
diff --git a/src/main.cc b/src/main.cc
index 3a1db38c..06647497 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -481,9 +481,9 @@ void compileOutput()
else {
sprintf( command,
COMPILE_COMMAND_STRING
- " -I" PREFIX "/include"
- " -L" PREFIX "/lib"
- " -Wl,-rpath," PREFIX "/lib",
+ " -I" INCLUDEDIR
+ " -L" LIBDIR
+ " -Wl,-rpath," LIBDIR,
compiler, cflags,
binaryFn, intermedFn );
}