$(TOUCH)
# NOTE
-# gdb built for target or local-PC
-$(D)/gdb: $(D)/zlib $(D)/libncurses $(ARCHIVE)/gdb-$(GDB_VER).tar.xz | $(TARGETPREFIX)
+# gdb-inline: inline version with platform-specific flags
+$(D)/gdb-inline: $(D)/zlib $(D)/libncurses $(ARCHIVE)/gdb-$(GDB_VER).tar.xz | $(TARGETPREFIX)
$(START_BUILD)
$(REMOVE)/gdb-$(GDB_VER)
$(UNTAR)/gdb-$(GDB_VER).tar.xz
set -e; cd $(BUILD_TMP)/gdb-$(GDB_VER); \
+ export PATH="$(BUILD_TMP):$(CROSS_DIR)/bin:$$PATH"; \
+ export CFLAGS="$(STD_CFLAGS) $(TARGET_EXTRA_CFLAGS) -Wno-error=implicit-function-declaration"; \
+ export CPPFLAGS="$(STD_CFLAGS) $(TARGET_EXTRA_CFLAGS) -Wno-error=implicit-function-declaration"; \
+ export CXXFLAGS="$(STD_CFLAGS) $(TARGET_EXTRA_CFLAGS) -Wno-error=implicit-function-declaration"; \
+ export LDFLAGS="$(TARGET_LDFLAGS) -Wno-error"; \
+ export ARFLAGS=cr; \
+ export PKG_CONFIG_PATH="$(TARGETPREFIX)/lib/pkgconfig:$(TARGETPREFIX)/usr/lib/pkgconfig"; \
./configure \
--build=$(BUILD) \
--host=$(TARGET) \
--target=$(TARGET) \
--prefix= \
- --mandir=$(BUILD_TMP)/.remove \
- --infodir=$(BUILD_TMP)/.remove \
- --datarootdir=$(BUILD_TMP)/.remove \
+ --mandir="$(BUILD_TMP)/.remove" \
+ --infodir="$(BUILD_TMP)/.remove" \
+ --datarootdir="$(BUILD_TMP)/.remove" \
--disable-binutils \
--disable-werror \
+ --disable-sim \
--nfp \
--with-curses \
--with-zlib \
--enable-static; \
$(MAKE) all-gdb; \
- make install-gdb prefix=$(TARGETPREFIX)
- rm -rf $(TARGETPREFIX)/share/gdb/system-gdbinit
- find $(TARGETPREFIX)/share/gdb/syscalls -type f -not -name 'arm-linux.xml' -not -name 'gdb-syscalls.dtd' -print0 | xargs -0 rm --
+ $(MAKE) install-gdb prefix=$(TARGETPREFIX)
+ [ -d $(TARGETPREFIX)/share/gdb ] && rm -rf $(TARGETPREFIX)/share/gdb/system-gdbinit || true
+ [ -d $(TARGETPREFIX)/share/gdb/syscalls ] && find $(TARGETPREFIX)/share/gdb/syscalls -type f -not -name 'arm-linux.xml' -not -name 'gdb-syscalls.dtd' -delete || true
+ $(TARGET)-strip $(TARGETPREFIX)/bin/gdb $(TARGETPREFIX)/bin/gdbserver 2>/dev/null || true
$(REMOVE)/gdb-$(GDB_VER)
$(TOUCH)
TARGETLIB = $(TARGETPREFIX)/lib
TARGETUSRLIB = $(TARGETPREFIX)/usr/lib
-STD_CFLAGS = -pipe $(TARGET_O_CFLAGS) $(TARGET_ABI) $(CXX11_ABI) -g -I$(TARGETPREFIX)/include
+
+# Use DWARF-4 for older GDB versions (HD1 with GDB 7.12), DWARF-5 for modern systems
+ifeq ($(BOXSERIES), hd1)
+ STD_CFLAGS = -pipe $(TARGET_O_CFLAGS) $(TARGET_ABI) $(CXX11_ABI) -gdwarf-4 -I$(TARGETPREFIX)/include
+else
+ STD_CFLAGS = -pipe $(TARGET_O_CFLAGS) $(TARGET_ABI) $(CXX11_ABI) -g -I$(TARGETPREFIX)/include
+endif
+
TARGET_CFLAGS = $(STD_CFLAGS) $(TARGET_EXTRA_CFLAGS)
TARGET_CPPFLAGS = $(STD_CFLAGS)
TARGET_CXXFLAGS = $(STD_CFLAGS)
#Makefile to build NEUTRINO
-N_CFLAGS = -Wall -Wshadow -Wsign-compare
+N_CFLAGS = -Wall -Wshadow -Wsign-compare $(TARGET_ABI) $(CXX11_ABI)
#N_CFLAGS = -Wextra
ifeq ($(BOXSERIES), $(filter $(BOXSERIES), hd2 hd5x hd6x))
N_CFLAGS += -I$(NEUTRINO_OBJDIR)/src/gui
ifeq ($(DEBUG), yes)
- N_CFLAGS += -O0 -g -ggdb3 -rdynamic
+ ifeq ($(BOXSERIES), hd1)
+ N_CFLAGS += -O0 -gdwarf-4 -ggdb3 -rdynamic
+ else
+ N_CFLAGS += -O0 -g -ggdb3 -rdynamic
+ endif
else
N_CFLAGS += $(TARGET_CFLAGS)
endif
# the original build script links against openssl.
# N_LDFLAGS = -L$(TARGETPREFIX)/lib -lcurl -lssl -lcrypto -ldl
-N_LDFLAGS = -lcrypto -ldl -lz $(CORTEX-STRINGS) -L$(TARGETLIB)
+N_LDFLAGS = -lcrypto -ldl -lz $(CORTEX-STRINGS) -L$(TARGETLIB) -lstdc++
ifeq ($(DEBUG), yes)
- N_LDFLAGS += -Wl,-rpath-link,$(TARGETLIB)
+ N_LDFLAGS += -Wl,-rpath-link,$(TARGETLIB) -Wl,--allow-shlib-undefined -Wl,--allow-multiple-definition
else
N_LDFLAGS += -Wl,-O1 -Wl,-rpath-link,$(TARGETLIB) $(TARGET_EXTRA_LDFLAGS)
endif
OBJDUMP=$(TARGET)-objdump \
READELF=$(TARGET)-readelf \
CFLAGS="$(N_CFLAGS)" \
- CPPFLAGS="$(STD_CFLAGS)" \
- CXXFLAGS="$(STD_CFLAGS) -std=c++11" \
+ CPPFLAGS="$(N_CFLAGS)" \
+ CXXFLAGS="$(N_CFLAGS) -std=c++11" \
LDFLAGS="$(N_LDFLAGS)"
GD_VER = 2.2.5
# GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it executes
+ifeq ($(BOXTYPE), coolstream)
+GDB_VER=7.12
+else
GDB_VER=8.0.1
+endif
GETTEXT_VER = 0.19.8.1