ports

morpheus ports
git clone git://git.2f30.org/ports
Log | Files | Refs | LICENSE

gdb.mk (2390B)


      1 # make deps: bash.
      2 TARG = gdb
      3 DEPS = libedit termcap zlib
      4 
      5 <$mkbuild/mk.common-noinst
      6 
      7 gdb:QV:
      8 	export CFLAGS="$CFLAGS $DEPS_CFLAGS"
      9 	export LDFLAGS="$LDFLAGS $DEPS_LDFLAGS"
     10 	# bash dependency: see https://sourceware.org/bugzilla/show_bug.cgi?id=16370
     11 	# fix missing "makeinfo" requirement...
     12 	find . -name 'configure' -exec sed -i 's,MAKEINFO="$MISSING makeinfo",MAKEINFO=true,' '{}' \;
     13 	# remove hardcoded -O2 -g CFLAGS which are *not* overridable (i.e. always appended, taking precedence)
     14 	find . -name 'configure' -exec sed -e 's/CFLAGS="-g -O2"/:/g' -e 's/CFLAGS="-O2"/:/g' -i '{}' \;
     15 	#
     16 	sh ../libibertyfix libiberty
     17 	#
     18 	sh ../gnulibfix gdb/gnulib/import
     19 	#
     20 	mkdir -p build
     21 	cd build
     22 	cp ../../config.cache .
     23 	# fixing implicit declaration in recursively called (by make) configure tests...
     24 	cat ../../gdb-config-add >> config.cache
     25 	# readline and and libiberty have broken checks; but we have to copy config.cache
     26 	# everywhere to get cache.
     27 	for culprit in readline libiberty libdecnumber opcodes readline bfd; do
     28 		mkdir -p $culprit
     29 		cp config.cache $culprit/
     30 	done
     31 	sed -i 's/noconfigdirs=""/noconfigdirs="intl readline"/' ../configure
     32 	# let's use libedit instead of readline and save us from the in-tree compile of the latter...
     33 	cp "${libedit_libdir}/libedit.a" readline/libreadline.a
     34 	archflags=""
     35 	#
     36 	gdbserverflags="--enable-gdbserver=no"
     37 #	gdbserverflags="--enable-gdbserver=yes --disable-inprocess-agent"
     38 #	[ "$WANT_GDBSERVER" = 1 ] &&
     39 #	gdbserverflags=""
     40 	# gdbserver tries to build some .so for inprocess-agent, but it doesnt strip away -static
     41 	# from LDFLAGS, so it tries to link the .so with -shared -static, which can't work
     42 	xconfflags=""
     43 	targets="--enable-64-bit-bfd --enable-targets=x86_64-linux,i386-linux,powerpc-linux,arm-linux,mips-linux,mipsel-linux,microblaze-linux"
     44 	#if [ -n "$CROSS_COMPILE" ] ; then
     45 	xconfflags="--host=${TOOLCHAIN_TRIPLET}"
     46 	targets=""
     47 	#fi
     48 	#
     49 	LDFLAGS="-static $DEPS_LDFLAGS $optldflags" \
     50 	CFLAGS="-Dgnu_fnmatch=fnmatch -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -O0 $DEPS_CFLAGS $optcflags $archflags" \
     51 	../configure -C \
     52 		--prefix="$PREFIX" \
     53 		--mandir="$ROOT/share/man" \
     54 		--disable-shared \
     55 		--enable-static \
     56 		--disable-werror --disable-tls \
     57 		--with-system-zlib=no \
     58 		$gdbserverflags $xconfflags $targets \
     59 		--disable-sim \
     60 		--disable-tui
     61 	make -j$nprocs
     62 
     63 install:QV:
     64 	cd build
     65 	make -j$nprocs install-gdb DESTDIR="$ROOT"