1 1.30 mrg # $NetBSD: Makefile,v 1.30 2016/10/16 04:37:42 mrg Exp $ 2 1.1 cl 3 1.1 cl .include <bsd.own.mk> 4 1.1 cl 5 1.19 christos MODULE= gdb 6 1.30 mrg GDBDIR= ${.CURDIR}/../../external/gpl3/${EXTERNAL_GDB_SUBDIR} 7 1.30 mrg GNUHOSTDIST= ${GDBDIR}/dist 8 1.1 cl 9 1.1 cl FIND_ARGS= \! \( -type d -name sim -prune \) 10 1.1 cl 11 1.1 cl CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \ 12 1.1 cl --program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," 13 1.1 cl 14 1.1 cl MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q} 15 1.1 cl 16 1.1 cl ALL_TARGET= all-gdb 17 1.1 cl INSTALL_TARGET= install-gdb 18 1.1 cl 19 1.30 mrg .include "${GDBDIR}/Makefile.gdb_arch" 20 1.30 mrg #GDB_MACHINE_ARCH= ${MACHINE_ARCH:C/e?armv[4-7]h?f?/arm/} 21 1.30 mrg 22 1.22 bouyer .include "${.CURDIR}/../Makefile.gmakehost" 23 1.1 cl 24 1.29 christos CCADDFLAGS+= --sysroot=${DESTDIR} -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include 25 1.29 christos LDADDFLAGS+= -L${DESTDIR}/lib -L${DESTDIR}/usr/lib 26 1.28 christos CXXADDFLAGS+= -D__STDC_FORMAT_MACROS 27 1.28 christos CXXADDFLAGS+= -D__STDC_LIMIT_MACROS 28 1.28 christos CXXADDFLAGS+= -D__STDC_CONSTANT_MACROS 29 1.29 christos HOST_CXXFLAGS+= ${CXXADDFLAGS} 30 1.2 nathanw 31 1.2 nathanw NEWCONFIGDIR?= ${.CURDIR}/../.. 32 1.2 nathanw MKNATIVE?= ${.CURDIR}/mknative-gdb 33 1.2 nathanw 34 1.7 uwe # Some configure tests require running a test program, which is not 35 1.7 uwe # possible when cross-building. Provide configure with "cached" 36 1.7 uwe # values in the environment. 37 1.7 uwe MKNATIVE_CONFIGURE_PRESET= \ 38 1.7 uwe ac_cv_prog_cc_cross=yes \ 39 1.7 uwe ac_cv_func_fork_works=yes \ 40 1.7 uwe ac_cv_func_strcoll_works=yes \ 41 1.7 uwe bash_cv_func_ctype_nonascii=yes \ 42 1.7 uwe bash_cv_func_sigsetjmp=present \ 43 1.7 uwe bash_cv_func_strcoll_broken=no \ 44 1.7 uwe bash_cv_must_reinstall_sighandlers=no 45 1.7 uwe 46 1.17 hans # Recent versions of Solaris have ncurses, but they hide the lib in an 47 1.17 hans # odd directory. Prevent configure from finding the ncurses headers, 48 1.17 hans # Solaris curses is sufficient. 49 1.17 hans .if ${BUILD_OSTYPE} == "SunOS" 50 1.17 hans CONFIGURE_ENV+= ac_cv_header_ncurses_h=no \ 51 1.17 hans ac_cv_header_ncurses_ncurses_h=no \ 52 1.17 hans ac_cv_header_ncurses_term_h=no 53 1.17 hans .endif 54 1.17 hans 55 1.8 uwe # Disable sim unless it's known to work (configure's default is to 56 1.8 uwe # enable sim if supported). 57 1.8 uwe CONFIGURE_ARGS_SIM= 58 1.8 uwe .if \ 59 1.9 skrll ${MACHINE_CPU} != "powerpc" && \ 60 1.8 uwe ${MACHINE_CPU} != "powerpc64" 61 1.8 uwe CONFIGURE_ARGS_SIM+= --disable-sim 62 1.8 uwe .endif 63 1.8 uwe 64 1.2 nathanw native-gdb: .native/.configure_done 65 1.2 nathanw @echo 'Extracting GDB configury for a native toolchain.' 66 1.2 nathanw MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} gdb \ 67 1.30 mrg ${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM} \ 68 1.30 mrg ${GDB_MACHINE_ARCH} 69 1.2 nathanw 70 1.2 nathanw .native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile 71 1.3 nathanw mkdir ${.OBJDIR}/.native 2>/dev/null || true 72 1.2 nathanw PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ 73 1.3 nathanw (cd ${.OBJDIR}/.native && ${CONFIGURE_ENV:NC*:NLD*} \ 74 1.2 nathanw CC_FOR_BUILD=${HOST_CC:Q} \ 75 1.2 nathanw CC=${CC:Q}' '${CCADDFLAGS:Q} \ 76 1.2 nathanw CXX=${CXX:Q}' '${CCADDFLAGS:Q} \ 77 1.6 uwe CPP=${CPP:Q}' '-isystem' '${DESTDIR}/usr/include \ 78 1.28 christos CFLAGS= CPPFLAGS= CXXFLAGS=${CXXADDFLAGS:Q} \ 79 1.28 christos LDFLAGS=${LDADDFLAGS:Q} \ 80 1.2 nathanw MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \ 81 1.2 nathanw XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \ 82 1.2 nathanw LIBS=-lintl \ 83 1.7 uwe ${MKNATIVE_CONFIGURE_PRESET} \ 84 1.2 nathanw ${HOST_SH} ${GNUHOSTDIST}/configure \ 85 1.4 nathanw --prefix=/usr \ 86 1.5 lukem --with-separate-debug-dir=/usr/libdata/debug \ 87 1.8 uwe ${CONFIGURE_ARGS_SIM} \ 88 1.2 nathanw --build=`${GNUHOSTDIST}/config.guess` \ 89 1.2 nathanw --host=${MACHINE_GNU_PLATFORM} \ 90 1.2 nathanw --target=${MACHINE_GNU_PLATFORM}) && \ 91 1.7 uwe (cd ${.OBJDIR}/.native && \ 92 1.7 uwe /usr/bin/env ${MKNATIVE_CONFIGURE_PRESET} \ 93 1.7 uwe ${MAKE} configure-host) && \ 94 1.3 nathanw (cd ${.OBJDIR}/.native/bfd && ${MAKE} bfd.h bfdver.h) && \ 95 1.3 nathanw (cd ${.OBJDIR}/.native/gdb && ${MAKE} init.c version.c) 96 1.2 nathanw @touch $@ 97 1.2 nathanw 98 1.2 nathanw clean: clean.native 99 1.2 nathanw clean.native: 100 1.2 nathanw -rm -r -f .native 101