![Ricardo Martincoski](/assets/img/avatar_default.png)
Well-formed patch fails to apply - patch v2.6: Hunk #1 FAILED at 1. Hunk #2 FAILED at 23. - patch v2.6.1: can't find file to patch at input line 11 Perhaps you used the wrong -p or --strip option? [snip] No file to patch. Skipping patch. 2 out of 2 hunks ignored Patch failed! Please fix 0001-fix-makefile.patch! Old versions of the tool "patch" cannot handle spaces in filenames. The same does not occur using "patch" v2.7 or any later. Workaround: when a file with space in the name needs to be patched, one or two hooks must be used. A pre-patch or post-extract hook renames the file to replace spaces with underscores. The patch file must be generated using diff between two source-trees that have the file renamed with spaces replaced by underscores. A post-patch hook could rename the file to its original name if needed. Fixes: http://autobuild.buildroot.net/results/8ff/8ff91ab8e52000eb34dd8f662520cf1b31490cf5/ http://autobuild.buildroot.net/results/ea7/ea77d6b23aca0cb1cf527e6c16ddf5eba957a69c/ Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Bernd Kuhls <bernd.kuhls@t-online.de> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
41 lines
1.3 KiB
Diff
41 lines
1.3 KiB
Diff
Various makefile fixes to allow cross compilation
|
|
|
|
Partly ported from
|
|
http://anonscm.debian.org/cgit/pkg-games/libsoil.git/tree/debian/patches/linking_correctly.patch
|
|
|
|
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
|
diff -uNr soil.org/projects/makefile/alternate_Makefile.txt soil/projects/makefile/alternate_Makefile.txt
|
|
--- soil.org/projects/makefile/alternate_Makefile.txt 2008-07-07 18:13:28.000000000 +0200
|
|
+++ soil/projects/makefile/alternate_Makefile.txt 2015-11-07 11:15:04.140106336 +0100
|
|
@@ -1,8 +1,8 @@
|
|
MAKE = make
|
|
-CC = gcc
|
|
-INSTALL_FILE = install -p -o root -g root -m 644
|
|
-INSTALL_DIR = install -p -o root -g root -d
|
|
-LN = ln -s
|
|
+CC = $(GCC)
|
|
+INSTALL_FILE = $(INSTALL) -m 644
|
|
+INSTALL_DIR = $(INSTALL) -d
|
|
+LN = ln -sf
|
|
RM = rm -fv
|
|
CFLAGS += -c -O2 -Wall
|
|
LDFLAGS +=
|
|
@@ -23,13 +23,13 @@
|
|
all: $(OFILES) lib
|
|
|
|
%.o: %.c
|
|
- $(CC) $(CFLAGS) $< -o $@
|
|
+ $(CC) $(CFLAGS) -c -fPIC $< -o $@
|
|
|
|
lib: $(OFILES)
|
|
# create static library
|
|
- ar -cvq $(LIBNAME).a $(OFILES)
|
|
+ $(AR) -cvq $(LIBNAME).a $(OFILES)
|
|
# create shared library
|
|
- gcc -shared -Wl,-soname,$(LIBNAME).so.$(MAJOR) -o $(LIBNAME).so.$(VERSION) $(OFILES)
|
|
+ $(CC) -shared -Wl,-soname,$(LIBNAME).so.$(MAJOR) -o $(LIBNAME).so.$(VERSION) $(OFILES) -lGL -lm
|
|
|
|
install:
|
|
$(INSTALL_DIR) $(DESTDIR)/$(INCLUDEDIR)
|