summary refs log tree commit diff
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2024-09-12 15:48:15 +0900
committerNguyễn Gia Phong <cnx@loang.net>2024-09-12 15:48:15 +0900
commit2b4218212198403eaa91fd99200611276b1f457a (patch)
treecaae727a18585ac06ab43c046caa5061ca69a95c
parent0ac8c3aa841212a193bcf027025521f7adf71255 (diff)
downloadgoatc-2b4218212198403eaa91fd99200611276b1f457a.tar.gz
Fix clang plugin path lookup
-rw-r--r--.gitignore1
-rw-r--r--Makefile3
-rw-r--r--[-rwxr-xr-x]goatcflags.m4 (renamed from goatcflags)2
3 files changed, 5 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 3eb7487..ac52743 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 a.out
 goatc.so
+goatcflags.m4
diff --git a/Makefile b/Makefile
index 37f2fb0..c0b4a39 100644
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,9 @@ all: $(LIB)
 goatc.so: goatc.cc
 	${CXX} ${CXXFLAGS} $< ${LDLIBS} -o $@ -shared ${LDFLAGS}
 
+goatcflags: goatcflags.m4
+	m4 -D PREFIX=${PREFIX} $< > $@
+
 install: $(INSTALLED_LIB) $(INSTALLED_BIN)
 
 ${DESTDIR}${PREFIX}/lib/%: %
diff --git a/goatcflags b/goatcflags.m4
index 973d4f9..7febc49 100755..100644
--- a/goatcflags
+++ b/goatcflags.m4
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with GoatC.  If not, see <https://www.gnu.org/licenses/>.
 
-printf " -fplugin=goatc.so"
+printf '%s' '-fplugin=PREFIX/lib/goatc.so'
 for arg in "$@"
 do printf ' -fplugin-arg-goatc-%s' "$arg"
 done