]> git.wh0rd.org Git - elf2flt.git/commitdiff
Symlink required binutils/BFD headers to local dir
authorAlexey Neyman <stilor@att.net>
Mon, 27 Feb 2017 09:20:10 +0000 (01:20 -0800)
committerAlexey Neyman <stilor@att.net>
Fri, 17 Mar 2017 23:15:00 +0000 (16:15 -0700)
... to minimize the chance of clashes with system headers.

Also, remove the -lcygwin from Makefile.in: this breaks canadian
build on cygwin, as it tries to pass -lcygwin into non-Cygwin host
CC. This chunk pre-dates the addition of -lc into configure.ac and
passing -lc should be sufficient (it works for me).

Signed-off-by: Alexey Neyman <stilor@att.net>
Makefile.in
configure
configure.ac

index a6feea67594dfd25f25522aa0763984f6f887468..cfad06ca5fbd55a660c31a97f4916db7208071e6 100644 (file)
@@ -14,7 +14,9 @@ CPU = @target_cpu@
 TARGET = @target_alias@
 SYMBOL_PREFIX = @SYMBOL_PREFIX@
 CFLAGS = @CFLAGS@
-INCLUDES = -I$(srcdir) @bfd_include_dir@ @binutils_include_dir@ @zlib_include_dir@
+INCLUDES = -I$(srcdir) -Ibfd-headers @zlib_include_dir@
+BFD_INCLUDE_DIR = @bfd_include_dir@
+BINUTILS_INCLUDE_DIR = @binutils_include_dir@
 CPPFLAGS = @CPPFLAGS@ $(DEFS) $(INCLUDES)
 LDFLAGS = @LDFLAGS@
 LDLIBS = @LIBS@
@@ -38,11 +40,6 @@ ifneq (,$(findstring mingw32,$(HOST)))
    LDLIBS += -lws2_32
 endif
 
-# force link order under cygwin to avoid getopts / libiberty clash
-ifneq ($(strip $(shell gcc -v 2>&1 | grep "cygwin")),)
-   LDLIBS := -lcygwin $(LDLIBS)
-endif
-
 LDFILE= elf2flt.ld
 ifeq ($(strip $(CPU)),e1)
 SRC_LDFILE= $(srcdir)/$(CPU)-elf2flt.ld
@@ -102,6 +99,7 @@ check: check-flthdr
 
 clean:
        -rm -f $(PROGS) *.$(OBJEXT) .deps
+       -rm -rf bfd-headers
 
 distclean: clean
        -rm -f Makefile config.log config.status config.cache ld-elf2flt
@@ -121,5 +119,16 @@ install:
        $(INSTALL) -m 644 $(SRC_LDFILE) $(DESTDIR)$(target_libdir)/$(LDFILE)
 
 sinclude .deps
-.deps:
+.deps: bfd-headers/.stamp
        $(CC) -MM $(CPPFLAGS) $(srcdir)/*.c > .deps
+
+
+bfd-headers/.stamp:
+       rm -rf bfd-headers
+       mkdir bfd-headers
+       ln -sf $(BFD_INCLUDE_DIR)/bfd.h bfd-headers/bfd.h
+       for f in ansidecl filenames hashtab libiberty symcat; do \
+               ln -sf $(BINUTILS_INCLUDE_DIR)/$$f.h bfd-headers/$$f.h || exit 1; \
+       done
+       ln -sf $(BINUTILS_INCLUDE_DIR)/elf bfd-headers/elf
+       touch $@
index 3a4e8d6d89d9ffadb4e943c75f2ec089839fb868..bb8e33f9cb28bc447dbbf6202a0232c1466c8948 100755 (executable)
--- a/configure
+++ b/configure
@@ -3931,12 +3931,12 @@ fi
 
 bfd_include_dir=
 if test "$ac_bfd_include_dir" != "NONE"; then
-  bfd_include_dir="-I$ac_bfd_include_dir"
+  bfd_include_dir=$(cd "$ac_bfd_include_dir" && pwd)
 fi
 
 binutils_include_dir=
 if test "$ac_binutils_include_dir" != "NONE"; then
-  binutils_include_dir="-I$ac_binutils_include_dir"
+  binutils_include_dir=$(cd "$ac_binutils_include_dir" && pwd)
 fi
 
 zlib_include_dir=
index 60028948ffe3cdd807fd0e70b84b21d865bfa002..d6b4119eb18a7c605171d2ecdd6d3b4252500511 100644 (file)
@@ -135,12 +135,12 @@ fi
 
 bfd_include_dir=
 if test "$ac_bfd_include_dir" != "NONE"; then
-  bfd_include_dir="-I$ac_bfd_include_dir"
+  bfd_include_dir=$(cd "$ac_bfd_include_dir" && pwd)
 fi
 
 binutils_include_dir=
 if test "$ac_binutils_include_dir" != "NONE"; then
-  binutils_include_dir="-I$ac_binutils_include_dir"
+  binutils_include_dir=$(cd "$ac_binutils_include_dir" && pwd)
 fi
 
 zlib_include_dir=