From 2b4218212198403eaa91fd99200611276b1f457a Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Thu, 12 Sep 2024 15:48:15 +0900 Subject: Fix clang plugin path lookup --- .gitignore | 1 + Makefile | 3 +++ goatcflags | 23 ----------------------- goatcflags.m4 | 23 +++++++++++++++++++++++ 4 files changed, 27 insertions(+), 23 deletions(-) delete mode 100755 goatcflags create mode 100644 goatcflags.m4 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 deleted file mode 100755 index 973d4f9..0000000 --- a/goatcflags +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# CFLAGS generator for Clang plugin -# Copyright (C) 2024 Nguyễn Gia Phong -# -# This file is part of GoatC. -# -# GoatC is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# GoatC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with GoatC. If not, see . - -printf " -fplugin=goatc.so" -for arg in "$@" -do printf ' -fplugin-arg-goatc-%s' "$arg" -done diff --git a/goatcflags.m4 b/goatcflags.m4 new file mode 100644 index 0000000..7febc49 --- /dev/null +++ b/goatcflags.m4 @@ -0,0 +1,23 @@ +#!/bin/sh +# CFLAGS generator for Clang plugin +# Copyright (C) 2024 Nguyễn Gia Phong +# +# This file is part of GoatC. +# +# GoatC is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GoatC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with GoatC. If not, see . + +printf '%s' '-fplugin=PREFIX/lib/goatc.so' +for arg in "$@" +do printf ' -fplugin-arg-goatc-%s' "$arg" +done -- cgit 1.4.1