diff --git a/byaccj.spec b/byaccj.spec index ecc37cb..777137e 100644 --- a/byaccj.spec +++ b/byaccj.spec @@ -8,6 +8,8 @@ URL: http://byaccj.sourceforge.net/ Source0: http://sourceforge.net/projects/byaccj/files/byaccj/1.15/byaccj1.15_src.tar.gz +Patch0: honor-ldflags.patch + BuildRequires: gcc BuildRequires: make @@ -28,6 +30,8 @@ Java now! chmod -c -x src/* docs/* sed -i -e 's|-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4||g' src/Makefile +%autopatch -p1 + %build pushd src make yacc CFLAGS="%{optflags}" LDFLAGS="$RPM_LD_FLAGS" diff --git a/honor-ldflags.patch b/honor-ldflags.patch new file mode 100644 index 0000000..4a8402f --- /dev/null +++ b/honor-ldflags.patch @@ -0,0 +1,12 @@ +diff -ruN byaccj1.15.orig/src/Makefile byaccj1.15/src/Makefile +--- byaccj1.15.orig/src/Makefile 2020-11-23 15:20:38.376711773 +0100 ++++ byaccj1.15/src/Makefile 2020-11-23 15:20:58.680671903 +0100 +@@ -75,7 +75,7 @@ + $(CC) -c $(CFLAGS) $(INC) $< -o $@ + + yacc: $(OBJ) +- $(CC) -o yacc $(OBJ) ++ $(CC) -o yacc $(LDFLAGS) $(OBJ) + @echo "done" + + clean: