#!/usr/bin/make -f include ../source.mk builddir = obj_$$(printf '%s' $@ | sed 's/^[^_]*_//') abi_ver = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | sed 's/[.].*//') legacy_abi_ver = $$(($(abi_ver) - 1)) CFLAGS = -Os -g common_opts = \ --without-ada \ --without-tests \ --with-pkg-config-libdir='/usr/lib/$(OPK_HOST_ARCH)/pkgconfig' \ --enable-pc-files \ --with-shared \ --with-cxx-shared \ --without-debug \ --without-profile \ --with-termlib=tinfo \ --with-ticlib=tic \ --disable-termcap \ --enable-symlinks \ --enable-const build_ncurses_opts = $(common_opts) \ --with-install-prefix="$${PWD}/dest-ncurses" \ --without-progs \ --enable-overwrite build_ncursesw_opts = $(common_opts) \ --with-install-prefix="$${PWD}/dest-ncursesw" \ --includedir=/usr/include/ncursesw \ --disable-overwrite \ --enable-widec build_ncurses_legacy_opts = $(build_ncurses_opts) \ --with-install-prefix="$${PWD}/dest-ncurses-legacy" \ --with-abi-version=$(legacy_abi_ver) build_ncursesw_legacy_opts = $(build_ncursesw_opts) \ --with-install-prefix="$${PWD}/dest-ncursesw-legacy" \ --with-abi-version=$(legacy_abi_ver) nop: @: build_ncurses build_ncursesw build_ncurses_legacy build_ncursesw_legacy: CFLAGS='$(CFLAGS)' oh-autoconfigure -B $(builddir) -- $($@_opts) oh-autobuild -B $(builddir) touch $@ build: build_ncurses build_ncursesw build_ncurses_legacy build_ncursesw_legacy install: build (cd obj_ncurses_legacy && make install.libs) (cd obj_ncursesw_legacy && make install.libs) (cd obj_ncurses && make install.libs) (cd obj_ncursesw && make install) rm dest*/usr/lib/$(OPK_HOST_ARCH)/*.a mv dest-ncursesw/usr/bin/clear dest-ncursesw/usr/bin/clear.ncurses mv dest-ncursesw/usr/bin/reset dest-ncursesw/usr/bin/reset.ncurses rm dest*/usr/bin/ncurses*-config rm dest-ncursesw/usr/share/man/man1/ncurses*-config.1 rm dest-ncurses/usr/lib/$(OPK_HOST_ARCH)/libtinfo.* rm dest-ncurses/usr/lib/$(OPK_HOST_ARCH)/libtic.* rm dest-ncurses-legacy/usr/lib/$(OPK_HOST_ARCH)/libtinfo.* rm dest-ncurses-legacy/usr/lib/$(OPK_HOST_ARCH)/libtic.* @# Extract a few individual terminal type definitions. This would be @# hard to do with oh-installfiles. @# terminfo-linux mkdir -p terminfo-linux.data/usr/lib/ ln -sf ../share/terminfo terminfo-linux.data/usr/lib/terminfo mkdir -p terminfo-linux.data/usr/share/terminfo/l/ mv dest-ncursesw/usr/share/terminfo/l/linux \ terminfo-linux.data/usr/share/terminfo/l/linux set -e; for d in dest*; do \ oh-fixperms -d "$${d}"; \ oh-strip -k -d "$${d}"; \ done OPK_PACKAGES="\ libncurses.$(abi_ver) \ libncurses++.$(abi_ver) \ libncurses.$(abi_ver)-dev \ ncurses-dbg \ " oh-installfiles -d dest-ncurses OPK_PACKAGES="\ libncursesw.$(abi_ver) \ libncurses++w.$(abi_ver) \ libtinfo.$(abi_ver) \ libncurses.$(abi_ver)-dev \ ncurses-dbg \ " oh-installfiles -d dest-ncursesw OPK_PACKAGES="\ libncurses.$(legacy_abi_ver) \ libncurses++.$(legacy_abi_ver) \ libncurses.$(legacy_abi_ver)-dev \ ncurses-dbg \ " oh-installfiles -d dest-ncurses-legacy OPK_PACKAGES="\ libncursesw.$(legacy_abi_ver) \ libncurses++w.$(legacy_abi_ver) \ libtinfo.$(legacy_abi_ver) \ libncurses.$(legacy_abi_ver)-dev \ ncurses-dbg \ " oh-installfiles -d dest-ncursesw-legacy oh-shlibdeps # Remove self-dependencies. set -e; for f in *.substvars; do p="$${f%.substvars}"; \ mv "$${f}" "$${f}.orig"; \ sed "s/ $${p},//" "$${f}.orig" >"$${f}"; \ done