From 7b2524ec0c036a3aab8e97e77c8a94b3dc12fe82 Mon Sep 17 00:00:00 2001 From: Victor Westerhuis Date: Sat, 4 Dec 2021 01:26:36 +0100 Subject: 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. --- src/Makefile.am | 3 ++- src/main.cc | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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 ); } -- cgit v1.2.1