2018-05-01 03:04:34 +03:00
|
|
|
# $NetBSD: Makefile,v 1.35 2018/05/01 00:04:35 christos Exp $
|
2003-10-26 04:06:27 +03:00
|
|
|
|
2018-05-01 03:04:34 +03:00
|
|
|
.include <bsd.init.mk>
|
2003-10-26 04:06:27 +03:00
|
|
|
|
2011-09-26 06:36:19 +04:00
|
|
|
MODULE= gdb
|
2016-10-16 07:37:42 +03:00
|
|
|
GDBDIR= ${.CURDIR}/../../external/gpl3/${EXTERNAL_GDB_SUBDIR}
|
|
|
|
GNUHOSTDIST= ${GDBDIR}/dist
|
2003-10-26 04:06:27 +03:00
|
|
|
|
|
|
|
FIND_ARGS= \! \( -type d -name sim -prune \)
|
|
|
|
|
|
|
|
CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \
|
|
|
|
--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-,"
|
|
|
|
|
|
|
|
MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
|
|
|
|
|
|
|
|
ALL_TARGET= all-gdb
|
|
|
|
INSTALL_TARGET= install-gdb
|
|
|
|
|
2016-10-16 07:37:42 +03:00
|
|
|
.include "${GDBDIR}/Makefile.gdb_arch"
|
|
|
|
#GDB_MACHINE_ARCH= ${MACHINE_ARCH:C/e?armv[4-7]h?f?/arm/}
|
|
|
|
|
2012-10-01 23:27:04 +04:00
|
|
|
.include "${.CURDIR}/../Makefile.gmakehost"
|
2017-11-29 01:25:16 +03:00
|
|
|
BUILD_MAKE=${TOOL_GMAKE}
|
|
|
|
|
|
|
|
BINENV= /usr/bin/env -i
|
|
|
|
|
|
|
|
|
2017-11-29 07:24:35 +03:00
|
|
|
MKNATIVE_ENV= ${BINENV} ${CONFIGURE_ENV:NC*:NLD*:Nam_cv_func_iconv*} \
|
2017-11-29 01:25:16 +03:00
|
|
|
CC_FOR_BUILD=${HOST_CC:Q} \
|
2017-11-29 06:33:01 +03:00
|
|
|
CXX_FOR_BUILD=${HOST_CXX:Q} \
|
|
|
|
CFLAGS_FOR_BUILD="-I${TOOLDIR}/include" \
|
2017-11-29 01:25:16 +03:00
|
|
|
CC=${CC:Q}' '${CCADDFLAGS:Q} \
|
2017-11-29 06:33:01 +03:00
|
|
|
CXX=${CXX:Q}' '${CCADDFLAGS:Q}' '${CXXADDFLAGS:Q} \
|
|
|
|
CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \
|
|
|
|
CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS= \
|
|
|
|
AS=${AS:Q} AWK=${TOOL_AWK:Q} LD=${LD:Q} \
|
2017-11-29 01:25:16 +03:00
|
|
|
MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
|
2017-11-29 06:33:01 +03:00
|
|
|
NM=${NM:Q} OBJDUMP=${OBJDUMP:Q} \
|
2017-11-29 01:25:16 +03:00
|
|
|
XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
|
|
|
|
LIBS=-lintl \
|
|
|
|
${MKNATIVE_CONFIGURE_PRESET}
|
|
|
|
|
|
|
|
MKENV_BUILD_MAKE=${MKNATIVE_ENV} ${BUILD_MAKE}
|
2003-10-26 04:06:27 +03:00
|
|
|
|
2016-10-14 17:41:59 +03:00
|
|
|
CCADDFLAGS+= --sysroot=${DESTDIR} -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include
|
|
|
|
LDADDFLAGS+= -L${DESTDIR}/lib -L${DESTDIR}/usr/lib
|
2016-10-12 21:43:40 +03:00
|
|
|
CXXADDFLAGS+= -D__STDC_FORMAT_MACROS
|
|
|
|
CXXADDFLAGS+= -D__STDC_LIMIT_MACROS
|
|
|
|
CXXADDFLAGS+= -D__STDC_CONSTANT_MACROS
|
2016-10-14 17:41:59 +03:00
|
|
|
HOST_CXXFLAGS+= ${CXXADDFLAGS}
|
2006-05-29 23:11:57 +04:00
|
|
|
|
|
|
|
NEWCONFIGDIR?= ${.CURDIR}/../..
|
|
|
|
MKNATIVE?= ${.CURDIR}/mknative-gdb
|
|
|
|
|
2006-11-24 04:48:57 +03:00
|
|
|
# Some configure tests require running a test program, which is not
|
|
|
|
# possible when cross-building. Provide configure with "cached"
|
|
|
|
# values in the environment.
|
|
|
|
MKNATIVE_CONFIGURE_PRESET= \
|
|
|
|
ac_cv_prog_cc_cross=yes \
|
|
|
|
ac_cv_func_fork_works=yes \
|
|
|
|
ac_cv_func_strcoll_works=yes \
|
|
|
|
bash_cv_func_ctype_nonascii=yes \
|
|
|
|
bash_cv_func_sigsetjmp=present \
|
|
|
|
bash_cv_func_strcoll_broken=no \
|
|
|
|
bash_cv_must_reinstall_sighandlers=no
|
|
|
|
|
2017-11-29 07:24:35 +03:00
|
|
|
CONFIGURE_ENV+= am_cv_func_iconv=no
|
2017-07-01 15:23:09 +03:00
|
|
|
|
2010-05-09 03:18:44 +04:00
|
|
|
# Recent versions of Solaris have ncurses, but they hide the lib in an
|
|
|
|
# odd directory. Prevent configure from finding the ncurses headers,
|
|
|
|
# Solaris curses is sufficient.
|
|
|
|
.if ${BUILD_OSTYPE} == "SunOS"
|
|
|
|
CONFIGURE_ENV+= ac_cv_header_ncurses_h=no \
|
|
|
|
ac_cv_header_ncurses_ncurses_h=no \
|
|
|
|
ac_cv_header_ncurses_term_h=no
|
|
|
|
.endif
|
|
|
|
|
2006-11-24 05:09:01 +03:00
|
|
|
# Disable sim unless it's known to work (configure's default is to
|
|
|
|
# enable sim if supported).
|
|
|
|
CONFIGURE_ARGS_SIM=
|
|
|
|
.if \
|
2006-11-25 19:06:04 +03:00
|
|
|
${MACHINE_CPU} != "powerpc" && \
|
2006-11-24 05:09:01 +03:00
|
|
|
${MACHINE_CPU} != "powerpc64"
|
|
|
|
CONFIGURE_ARGS_SIM+= --disable-sim
|
|
|
|
.endif
|
|
|
|
|
2006-05-29 23:11:57 +04:00
|
|
|
native-gdb: .native/.configure_done
|
|
|
|
@echo 'Extracting GDB configury for a native toolchain.'
|
2017-11-29 01:25:16 +03:00
|
|
|
MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} gdb \
|
2016-10-16 07:37:42 +03:00
|
|
|
${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM} \
|
|
|
|
${GDB_MACHINE_ARCH}
|
2006-05-29 23:11:57 +04:00
|
|
|
|
|
|
|
.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
|
2006-05-30 08:22:40 +04:00
|
|
|
mkdir ${.OBJDIR}/.native 2>/dev/null || true
|
2006-05-29 23:11:57 +04:00
|
|
|
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
2017-11-29 01:25:16 +03:00
|
|
|
(cd ${.OBJDIR}/.native && \
|
|
|
|
${MKNATIVE_ENV} ${HOST_SH} ${GNUHOSTDIST}/configure \
|
2006-07-03 02:15:14 +04:00
|
|
|
--prefix=/usr \
|
2006-07-21 15:23:02 +04:00
|
|
|
--with-separate-debug-dir=/usr/libdata/debug \
|
2006-11-24 05:09:01 +03:00
|
|
|
${CONFIGURE_ARGS_SIM} \
|
2006-05-29 23:11:57 +04:00
|
|
|
--build=`${GNUHOSTDIST}/config.guess` \
|
|
|
|
--host=${MACHINE_GNU_PLATFORM} \
|
2017-11-29 01:25:16 +03:00
|
|
|
--target=${MACHINE_GNU_PLATFORM})
|
|
|
|
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
2006-11-24 04:48:57 +03:00
|
|
|
(cd ${.OBJDIR}/.native && \
|
2017-11-29 01:25:16 +03:00
|
|
|
${MKENV_BUILD_MAKE} configure-host) && \
|
|
|
|
(cd ${.OBJDIR}/.native/bfd && \
|
|
|
|
${MKENV_BUILD_MAKE} bfd.h bfdver.h) && \
|
|
|
|
(cd ${.OBJDIR}/.native/gdb && \
|
|
|
|
${MKENV_BUILD_MAKE} init.c version.c)
|
2006-05-29 23:11:57 +04:00
|
|
|
@touch $@
|
|
|
|
|
|
|
|
clean: clean.native
|
|
|
|
clean.native:
|
|
|
|
-rm -r -f .native
|