1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-27 05:10:36 +00:00

textproc/adabrowse: switch build to .gpr to avoid ASIS rebuilds

At least with the upcoming gcc49 and ASIS 2013, I've been seeing gmake
Makefile-based builds trying to rebuild ASIS rather than just use the
provided static library.  I don't know what causes that, but I did notice
that it doesn't happen with GNAT project files.

1) Disregard gmake completely and provide a new build.gpr file
   This will work when gcc-aux is moved to gcc49.
2) Add DOCS option and install the html documentation optionally
3) Relocate LICENSE to make portlint happy
4) Using GPR makes this jobs safe (although the job number might be
   limited to 1 anyway in this case)
This commit is contained in:
John Marino 2014-03-12 23:00:09 +00:00
parent af83d59863
commit c7dba22f72
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=348013
4 changed files with 49 additions and 134 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= adabrowse
PORTVERSION= 4.0.3
PORTREVISION= 1
CATEGORIES= textproc
MASTER_SITES= http://home.datacomm.ch/t_wolf/tw/ada95/adabrowse/
DISTNAME= ${PORTNAME}_${PORTVERSION}_src
@ -10,17 +11,36 @@ DISTNAME= ${PORTNAME}_${PORTVERSION}_src
MAINTAINER= marino@FreeBSD.org
COMMENT= HTML generator for Ada 95 library unit specifications
LICENSE= GPLv2
BUILD_DEPENDS= asis>=2011:${PORTSDIR}/lang/asis \
gnat_util>=2013:${PORTSDIR}/lang/gnat_util
LICENSE= GPLv2
USES= ada gmake
USES= ada
WRKSRC= ${WRKDIR}/${PORTNAME}_${PORTVERSION}
MAKE_ENV= ADA_INCLUDE_PATH=${LOCALBASE}/lib/asis
MAKE_JOBS_UNSAFE=yes
PORTDOCS= *.html *.css
OPTIONS_DEFINE= DOCS
.include <bsd.port.options.mk>
post-extract:
${CP} ${FILESDIR}/ad-* ${FILESDIR}/build.gpr ${WRKSRC}
${RM} ${WRKSRC}/sdefault.adb
do-build:
# Since we only need one C object, just compile it manually rather
# than bring in GPRBuild as a dependency
${MKDIR} ${WRKSRC}/obj
(cd ${WRKSRC}/obj && ${SETENV} ${MAKE_ENV} ada -c -O2 ../util-nl.c)
(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} gnatmake -Pbuild)
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/adabrowse ${STAGEDIR}${PREFIX}/bin/adabrowse
.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${STAGEDIR}/${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/doc/*.html ${WRKSRC}/doc/*.css \
${STAGEDIR}/${DOCSDIR}/
.endif
.include <bsd.port.mk>

View File

@ -0,0 +1,8 @@
-- The FSF GNAT 4.9 Project code is hopelessly too modern for AdaBrowse to
-- hook into it. Just build AdaBrowse without it.
pragma License (GPL);
with AD.Projects.Impl_No;
private package AD.Projects.Impl
renames AD.Projects.Impl_No;

View File

@ -0,0 +1,16 @@
with "asis";
with "gnat_util";
project Build is
for Languages use ("Ada", "C");
for Source_Dirs use (".");
for Object_dir use "obj";
for Exec_Dir use ".";
for Main use ("adabrowse");
package Compiler is
for Default_Switches ("C") use ("-O2");
for Default_Switches ("ada") use ("-O2", "-gnatwa");
end Compiler;
end Build;

View File

@ -1,129 +0,0 @@
--- Makefile.orig 2005-04-28 20:10:20.000000000 +0000
+++ Makefile
@@ -71,7 +71,7 @@
# it has to work with the ancient GNU make 3.77 (distributed with GNAT 3.15p).
GCC_OPTIONS = -O2
-LD_OPTIONS = -lasis
+LD_OPTIONS = -L$(PREFIX)/lib/asis -lasis -L$(PREFIX)/lib/gnat_util -lgnat_util
host := $(shell gcc -dumpmachine)
@@ -79,23 +79,10 @@ RM := rm -f
CP := cp
ADABROWSE := adabrowse
NASTY := nasty
-GET_GCC := get_gcc
EXE :=
CONFIGURE := adconf
PATH_SEP := :
-ifeq "$(findstring mingw32, $(host))" "mingw32"
- # Assume we're on Windows
- RM := cmd.exe /c del
- CP := cmd.exe /c copy
- ADABROWSE := adabrowse.exe
- NASTY := nasty.exe
- GET_GCC := get_gcc.exe
- CONFIGURE := adconf.exe
- EXE := .exe
- PATH_SEP := ;
-endif
-
# GNAT-specific gcc options: enable all warnings, and style checking.
# The style checking flags are nearly as plain "-gnaty", but do not
# check comment format, and do not require explicit specs for all
@@ -104,9 +91,6 @@ endif
GNAT_OPTIONS := -gnatwa -gnaty3abefhiklmprt
-GET_GCC_GEN = get_gcc.o get_gcc.ali
-GET_GCC_FULL = $(GET_GCC_GEN) get_gcc.txt get_gcc.use
-
ifdef GNATSRC
INTERNAL_GNAT_SRC := $(subst \,/,$(subst \\,/,$(GNATSRC)))
@@ -201,14 +185,14 @@ endif
all: ./config/$(CONFIGURE) run-conf
$(MAKE) $(ADABROWSE) \
- ADABROWSE_GCC_LIB=$(dir $(subst \,/,$(shell $(shell ./get_gcc -gcc get_gcc.use) -print-libgcc-file-name)))adainclude \
+ ADABROWSE_GCC_LIB=$(dir $(subst \,/,$(shell ada -print-libgcc-file-name)))adainclude \
ADABROWSE_GNATSRC=$(INTERNAL_GNAT_SRC)
# Configuration stuff. We build an executable adconf, which then figures out
# from its parameters and by trying to compile a certain file whether or not
# we do have project manager support.
-./config/$(CONFIGURE): get_gcc.use ./config/adconf.adb
+./config/$(CONFIGURE): ./config/adconf.adb
cd ./config; gnatmake -q -I.. adconf
# If adconf is called with two argument only (i.e., GNATSRC is not set), it
@@ -223,39 +207,13 @@ all: ./config/$(CONFIGURE) run-conf
run-conf:
cd ./config; \
- ./$(CONFIGURE) $(shell ./get_gcc -gcc get_gcc.use) \
+ ./$(CONFIGURE) ada \
$(ASIS_DIR) \
$(INTERNAL_GNAT_SRC) \
- $(dir $(subst \,/,$(shell $(shell ./get_gcc -gcc get_gcc.use) -print-libgcc-file-name)))adainclude
+ $(dir $(subst \,/,$(shell ada -print-libgcc-file-name)))adainclude
-cd ./config; $(CP) ad-projects-impl.ads ..
-cd ./config; $(CP) ad-projects-impl_yes-get_parent.adb ..
-# All this 'get_gcc' stuff here is GNAT specific: we try to dynamically
-# figure out the name of the gcc used by GNAT. On some systems, it
-# appears that this name is "gnatgcc", not "gcc"!
-
-get_gcc.o :
- gnatmake -q -c -f get_gcc.adb
-
-get_gcc.ali:
- gnatmake -q -c -f get_gcc.adb
-
-$(GET_GCC): get_gcc.o get_gcc.ali get_gcc.adb
- gnatmake -q get_gcc
-
-# Note: the dependency below first ensures that all the files we're
-# going to delete in the rm command actually exist. This is a work-
-# around for Win 2k, where make stops because cmd.exe /c del returns
-# a failure exit code because some files may not exist. However, they
-# must not exist when we run gnatmake, or we won't have the desired
-# output in get_gcc.err. (The trick is that the first line in that
-# file will be the compile command gnatmake uses for get_gcc.adb,
-# which will start with the compiler name.)
-
-get_gcc.use: $(GET_GCC)
- $(RM) $(GET_GCC) $(GET_GCC_GEN)
- gnatmake get_gcc 2>get_gcc.use
-
# Ok, finally we can build adabrowse! The first dependency handles the
# C file in the distribution. All the others may be regenerated.
@@ -271,18 +229,17 @@ endif
$(ADABROWSE): util-nl.o \
ad-setup.ads \
ad-projects-impl.ads ad-projects-impl_yes-get_parent.adb
- gnatmake $(GCC_OPTIONS) adabrowse -cargs $(GNAT_OPTIONS) \
- -largs $(LD_OPTIONS)
+ gnatmake $(GCC_OPTIONS) \
+ -aI$(PREFIX)/include/asis -aO${PREFIX}/lib/asis \
+ -aI$(PREFIX)/include/gnat_util -aO/${PREFIX}/lib/gnat_util \
+ adabrowse -cargs $(GNAT_OPTIONS) -largs $(LD_OPTIONS)
strip $(ADABROWSE)
$(NASTY): nasty.adb
gnatmake nasty -cargs $(GCC_OPTIONS)
-ad-setup.ads: get_gcc.use
- $(shell ./get_gcc -setup get_gcc.use)
-
-util-nl.o: get_gcc.use util-nl.c
- $(shell ./get_gcc -gcc get_gcc.use) -c $(GCC_OPTIONS) util-nl.c
+util-nl.o: util-nl.c
+ ada -c $(GCC_OPTIONS) util-nl.c
clean:
$(RM) $(ADABROWSE) $(NASTY) $(GET_GCC) *.o *.ali