- Add stage support

- Use options helpers
- Fix a problem when PYTHON and BUNDLED_READLINE options are active

PR:		ports/183048
Submitted by:	Luca Pizzamiglio <luca.pizzamiglio@gmail.com> (maintainer)
This commit is contained in:
Danilo Egea Gondolfo 2013-10-17 17:59:36 +00:00
parent 9674cdcd35
commit 7d1e04c08a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=330660
2 changed files with 46 additions and 74 deletions

View File

@ -18,17 +18,16 @@ USES= iconv gmake
GNU_CONFIGURE= yes
CONFIGURE_ENV= CONFIGURED_M4=m4 CONFIGURED_BISON=byacc
CONFIGURE_ARGS= --program-suffix=${PORTVERSION:S/.//g} \
--with-gdb-datadir=${PREFIX}/share/gdb${PORTVERSION:S/.//g} \
--with-gdb-datadir=${STAGEDIR}${PREFIX}/share/gdb${PORTVERSION:S/.//g} \
${ICONV_CONFIGURE_ARG} \
--without-libunwind-ia64 \
--enable-targets=all
CFLAGS:= ${CFLAGS:C/ +$//} # blanks at EOL creep in sometimes
CFLAGS+= -DRL_NO_COMPAT
EXCLUDE= dejagnu expect sim texinfo intl
EXTRACT_AFTER_ARGS= ${EXCLUDE:S/^/--exclude /}
VER= ${PORTVERSION:S/.//g}
VER= ${PORTVERSION:S/.//g}
PLIST_SUB= VER=${VER}
MAN1= gdb${VER}.1
EXTRACT_AFTER_ARGS= ${EXCLUDE:S/^/--exclude /}
ONLY_FOR_ARCHS= i386 amd64 powerpc powerpc64 # untested elsewhere, might work
@ -38,67 +37,39 @@ OPTIONS_SINGLE= READLINE
BASE_READLINE_DESC= from base system(EXPERIMENTAL)
BUNDLED_READLINE_DESC= from gdb distfile
PORT_READLINE_DESC= from devel/readline port
GDB_LINK_DESC= Create the gdb link
TUI_DESC= Text User Interface enabled
GDB_LINK_DESC= Create the gdb link
TUI_DESC= Text User Interface enabled
OPTIONS_DEFAULT= THREADS TUI GDB_LINK PORT_READLINE
NO_STAGE= yes
# Activating the plist
OPTIONS_SUB=yes
DEBUG_CFLAGS= -g
EXPAT_CONFIGURE_ON= --with-expat=yes
EXPAT_CONFIGURE_OFF= --without-expat
EXPAT_LIB_DEPENDS= expat:${PORTSDIR}/textproc/expat2
TUI_CONFIGURE_ENABLE= tui
PYTHON_CONFIGURE_ON= --with-python=${PYTHON_CMD}
PYTHON_CONFIGURE_OFF= --without-python
PORT_READLINE_USES= readline:port
BASE_READLINE_USES= readline
BASE_READLINE_CFLAGS= -D_rl_echoing_p=readline_echoing_p
BUNDLED_READLINE_CONFIGURE_OFF= --with-system-readline
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MGDB_LINK}
PLIST_SUB+= GDB_LINK=""
.else
PLIST_SUB+= GDB_LINK="@comment "
.endif
.if ${PORT_OPTIONS:MTUI}
CONFIGURE_ARGS+= --enable-tui
PLIST_SUB+= TUI_LINK=""
.else
CONFIGURE_ARGS+= --disable-tui
PLIST_SUB+= TUI_LINK="@comment "
.endif
.if empty(PORT_OPTIONS:MBUNDLED_READLINE)
EXCLUDE+= readline
CONFIGURE_ARGS+= --with-system-readline
.endif
.if ${PORT_OPTIONS:MBASE_READLINE}
CFLAGS+= -D_rl_echoing_p=readline_echoing_p
USES+= readline
.endif
.if ${PORT_OPTIONS:MPORT_READLINE}
USES+= readline:port
.endif
.if ${PORT_OPTIONS:MPYTHON}
USE_PYTHON= 2.5-2.7
CONFIGURE_ARGS+= --with-python=${PYTHON_CMD}
PLIST_SUB+= PYTHON=""
.else
CONFIGURE_ARGS+= --without-python
PLIST_SUB+= PYTHON="@comment "
.endif
.include <bsd.port.pre.mk>
.if ${PORT_OPTIONS:MTHREADS}
EXTRA_PATCHES= ${FILESDIR}/extrapatch-gdb-configure.tgt ${FILESDIR}/extrapatch-gdb-Makefile.in
.endif
.if ${PORT_OPTIONS:MDEBUG}
CFLAGS+= -g
.endif
.if ${PORT_OPTIONS:MEXPAT}
LIB_DEPENDS+= expat:${PORTSDIR}/textproc/expat2
CONFIGURE_ARGS+= --with-expat=yes
.else
CONFIGURE_ARGS+= --without-expat
.endif
.if ${ARCH} == "amd64"
CONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL}
.endif
@ -111,13 +82,13 @@ post-patch:
.endif
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb ${PREFIX}/bin/gdb${VER}
${INSTALL_MAN} ${WRKSRC}/gdb/gdb.1 ${MAN1PREFIX}/man/man1/gdb${VER}.1
${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb ${STAGEDIR}${PREFIX}/bin/gdb${VER}
${INSTALL_MAN} ${WRKSRC}/gdb/gdb.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/gdb${VER}.1
.if ${PORT_OPTIONS:MTUI}
${LN} -sf ${PREFIX}/bin/gdb${VER} ${PREFIX}/bin/gdbtui${VER}
${LN} -sf ${STAGEDIR}${PREFIX}/bin/gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdbtui${VER}
.endif
.if ${PORT_OPTIONS:MGDB_LINK}
${LN} -sf gdb${VER} ${PREFIX}/bin/gdb
${LN} -sf gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdb
.endif
.if ${PORT_OPTIONS:MPYTHON}
(cd ${WRKSRC}/gdb; ${GMAKE} install-python )
@ -126,9 +97,9 @@ do-install:
post-install:
.if ${PORT_OPTIONS:MPYTHON}
${CHMOD} u+w ${PREFIX}/share/gdb${VER}/python/gdb/*.py*
${CHMOD} u+w ${PREFIX}/share/gdb${VER}/python/gdb/command/*.py*
${CHMOD} u+w ${PREFIX}/share/gdb${VER}/python/gdb/function/*.py*
${CHMOD} u+w ${STAGEDIR}${PREFIX}/share/gdb${VER}/python/gdb/*.py*
${CHMOD} u+w ${STAGEDIR}${PREFIX}/share/gdb${VER}/python/gdb/command/*.py*
${CHMOD} u+w ${STAGEDIR}${PREFIX}/share/gdb${VER}/python/gdb/function/*.py*
.endif
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View File

@ -1,19 +1,20 @@
%%GDB_LINK%%bin/gdb
bin/gdb%%VER%%
%%TUI_LINK%%bin/gdbtui%%VER%%
%%PYTHON%%share/gdb%%VER%%/python/gdb/__init__.py
%%PYTHON%%share/gdb%%VER%%/python/gdb/types.py
%%PYTHON%%share/gdb%%VER%%/python/gdb/printing.py
%%PYTHON%%share/gdb%%VER%%/python/gdb/prompt.py
%%PYTHON%%share/gdb%%VER%%/python/gdb/command/__init__.py
%%PYTHON%%share/gdb%%VER%%/python/gdb/command/pretty_printers.py
%%PYTHON%%share/gdb%%VER%%/python/gdb/command/prompt.py
%%PYTHON%%share/gdb%%VER%%/python/gdb/command/explore.py
%%PYTHON%%share/gdb%%VER%%/python/gdb/command/type_printers.py
%%PYTHON%%share/gdb%%VER%%/python/gdb/function/__init__.py
%%PYTHON%%share/gdb%%VER%%/python/gdb/function/strfns.py
%%PYTHON%%@dirrm share/gdb%%VER%%/python/gdb/function
%%PYTHON%%@dirrm share/gdb%%VER%%/python/gdb/command
%%PYTHON%%@dirrm share/gdb%%VER%%/python/gdb
%%PYTHON%%@dirrm share/gdb%%VER%%/python
%%PYTHON%%@dirrm share/gdb%%VER%%
%%TUI%%bin/gdbtui%%VER%%
man/man1/gdb%%VER%%.1.gz
%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/__init__.py
%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/types.py
%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/printing.py
%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/prompt.py
%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/command/__init__.py
%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/command/pretty_printers.py
%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/command/prompt.py
%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/command/explore.py
%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/command/type_printers.py
%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/function/__init__.py
%%PYTHON%%%%DATADIR%%%%VER%%/python/gdb/function/strfns.py
%%PYTHON%%@dirrmtry %%DATADIR%%%%VER%%/python/gdb/function
%%PYTHON%%@dirrmtry %%DATADIR%%%%VER%%/python/gdb/command
%%PYTHON%%@dirrmtry %%DATADIR%%%%VER%%/python/gdb
%%PYTHON%%@dirrmtry %%DATADIR%%%%VER%%/python
%%PYTHON%%@dirrmtry %%DATADIR%%%%VER%%