From 0c7b5f1c0a5e6c562fb965a07a5b96bab6ba062d Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Sat, 18 Jul 2020 15:18:45 +0200 Subject: [PATCH] Move build file changes to the proper files Fixes #3 --- bfd/Makefile.am | 14 ++++++++++---- bfd/configure.ac | 4 +++- gdb/Makefile.in | 5 ++--- gdb/configure.ac | 8 ++++++++ 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/bfd/Makefile.am b/bfd/Makefile.am index e5bd28f..6977f49 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -52,8 +52,11 @@ ZLIBINC = @zlibinc@ WARN_CFLAGS = @WARN_CFLAGS@ NO_WERROR = @NO_WERROR@ -AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC) +AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC) $(DEPS_CFLAGS) AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DLIBDIR='"$(libdir)"' + +AM_LIBS = $(DEPS_LIBS) + if PLUGINS bfdinclude_HEADERS += $(INCDIR)/plugin-api.h LIBDL = @lt_cv_dlopen_libs@ @@ -397,7 +400,8 @@ BFD32_BACKENDS = \ xcofflink.lo \ xsym.lo \ xtensa-isa.lo \ - xtensa-modules.lo + xtensa-modules.lo \ + pdb.lo BFD32_BACKENDS_CFILES = \ aout-cris.c \ @@ -532,7 +536,8 @@ BFD32_BACKENDS_CFILES = \ xcofflink.c \ xsym.c \ xtensa-isa.c \ - xtensa-modules.c + xtensa-modules.c \ + pdb.c # The .o files needed by all of the 64 bit vectors that are configured into # target_vector in targets.c if configured with --enable-targets=all @@ -706,7 +711,8 @@ SOURCE_HFILES = \ som.h sysdep.h \ version.h vms.h \ wasm-module.h \ - xcofflink.h xsym.h + xcofflink.h xsym.h \ + pdb.h pdb-types.h ## ... and .h files which are in the build tree, minus config.h and bfd.h BUILD_HFILES = \ diff --git a/bfd/configure.ac b/bfd/configure.ac index 7eee83a..a61dc55 100644 --- a/bfd/configure.ac +++ b/bfd/configure.ac @@ -405,7 +405,7 @@ tb= elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo" coffgen="coffgen.lo dwarf2.lo" -coff="cofflink.lo $coffgen" +coff="cofflink.lo $coffgen pdb.lo" ecoff="ecofflink.lo $coffgen" xcoff="xcofflink.lo $coffgen" @@ -1125,4 +1125,6 @@ AC_SUBST(docdir) AC_SUBST(htmldir) AC_SUBST(pdfdir) +PKG_CHECK_MODULES([DEPS], [r_bin r_util]) + AC_OUTPUT diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 8c658d9..07a325d 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -561,7 +561,7 @@ CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR)) DEFS = @DEFS@ GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config \ -DLOCALEDIR="\"$(localedir)\"" $(DEFS) \ - -I/usr/include/libr + @RADARE_CFLAGS@ @LLVM_LDFLAGS@ # MH_CFLAGS, if defined, has host-dependent CFLAGS from the config directory. GLOBAL_CFLAGS = $(MH_CFLAGS) @@ -614,8 +614,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(LIBCTF) $(ZLIB) \ $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \ $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR) \ $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS) \ - -lLLVMDemangle \ - -lr_bin -lr_util + @RADARE_LIBS@ @LLVM_LIBS@ CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) $(LIBCTF) \ $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU) diff --git a/gdb/configure.ac b/gdb/configure.ac index ca0da79..e55e08d 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -2233,4 +2233,12 @@ GDB_AC_TRANSFORM([gcore], [GCORE_TRANSFORM_NAME]) AC_CONFIG_FILES([gcore], [chmod +x gcore]) AC_CONFIG_FILES([Makefile gdb-gdb.gdb gdb-gdb.py doc/Makefile data-directory/Makefile]) +PKG_CHECK_MODULES([RADARE], [r_bin r_util]) + +AC_CHECK_PROG(LLVM_CONFIG_FOUND, llvm-config, yes) +AS_IF([test x"$LLVM_CONFIG_FOUND" != x"yes"], [AC_MSG_ERROR([Please make sure llvm-config is in your PATH.])]) +AC_SUBST([LLVM_CXXFLAGS], [$(llvm-config --cxxflags)]) +AC_SUBST([LLVM_LDFLAGS], [$(llvm-config --ldflags)]) +AC_SUBST([LLVM_LIBS], [$(llvm-config --libs)]) + AC_OUTPUT