Commit 6c1ec292 authored by yoogx's avatar yoogx
Browse files

* Use gprbuild instead of gnatmake

        For openaadl/ocarina#238
parent e054ad56
......@@ -30,6 +30,7 @@ AC_CHECK_PROG(GNATCLEAN, gnatclean, gnatclean)
AC_CHECK_PROG(GNATLS, gnatls, gnatls)
AC_EXEEXT
AM_PATH_PYTHON
AM_GPRBUILD
dnl we need a GNU flavoured sed
AC_CHECK_PROG(HAVE_GNUSED,gnused,yes,no)
......@@ -60,11 +61,11 @@ PATH_KIND=`$GNATLS -v 2>&1 \
case ${PATH_KIND} in
"WINDOWS" | "UNIX" )
AC_MSG_RESULT($PATH_KIND)
;;
;;
* )
AC_MSG_WARN([gnatls ("$GNATLS") uses an unknown path kind: "${PATH_KIND}. Assuming UNIX path"])
PATH_KIND=UNIX
;;
AC_MSG_WARN([gnatls ("$GNATLS") uses an unknown path kind: "${PATH_KIND}. Assuming UNIX path"])
PATH_KIND=UNIX
;;
esac
AC_SUBST(PATH_KIND)
......@@ -212,26 +213,26 @@ AS_HELP_STRING([--with-ocarina-runtimes=x], [enumerate runtimes]),
do
case ${R} in
all )
for P in aadlib polyorb-hi-ada polyorb-hi-c
for P in aadlib polyorb-hi-ada polyorb-hi-c
do
if test -d ${root}/resources/runtime/${P}
then
RUNTIME_LIST="${RUNTIME_LIST}${P} "
if test -d ${root}/resources/runtime/${P}
then
RUNTIME_LIST="${RUNTIME_LIST}${P} "
else
AC_MSG_ERROR([runtime ${P} not found])
fi
fi
done
AM_CONDITIONAL(AADLIB, true)
AM_CONDITIONAL(PO_HI_ADA, true)
AM_CONDITIONAL(PO_HI_C, true)
;;
AM_CONDITIONAL(PO_HI_C, true)
;;
none )
AM_CONDITIONAL(AADLIB, false)
AM_CONDITIONAL(PO_HI_ADA, false)
AM_CONDITIONAL(PO_HI_C, false)
;;
AM_CONDITIONAL(PO_HI_ADA, false)
AM_CONDITIONAL(PO_HI_C, false)
;;
aadlib )
if test -d ${root}/resources/runtime/${R}
......@@ -240,43 +241,43 @@ AS_HELP_STRING([--with-ocarina-runtimes=x], [enumerate runtimes]),
else
AC_MSG_ERROR([runtime ${R} not found])
fi
AM_CONDITIONAL(AADLIB, true)
;;
AM_CONDITIONAL(AADLIB, true)
;;
pok )
pok )
if test -d ${root}/resources/runtime/${R}
then
RUNTIME_LIST="${RUNTIME_LIST}${R} "
else
AC_MSG_ERROR([runtime ${R} not found])
fi
AM_CONDITIONAL(POK, true)
;;
AM_CONDITIONAL(POK, true)
;;
polyorb-hi-ada )
polyorb-hi-ada )
if test -d ${root}/resources/runtime/${R}
then
RUNTIME_LIST="${RUNTIME_LIST}${R} "
else
AC_MSG_ERROR([runtime ${R} not found])
fi
AM_CONDITIONAL(PO_HI_ADA, true)
;;
AM_CONDITIONAL(PO_HI_ADA, true)
;;
polyorb-hi-c )
polyorb-hi-c )
if test -d ${root}/resources/runtime/${R}
then
RUNTIME_LIST="${RUNTIME_LIST}${R} "
else
AC_MSG_ERROR([runtime ${R} not found])
fi
AM_CONDITIONAL(PO_HI_C, true)
;;
AM_CONDITIONAL(PO_HI_C, true)
;;
* )
AC_MSG_ERROR([unknown runtime ${R}])
;;
* )
AC_MSG_ERROR([unknown runtime ${R}])
;;
esac
done
RUNTIME_LIST=`echo "$RUNTIME_LIST" | sed 's/ $//'`
......@@ -287,7 +288,7 @@ AS_HELP_STRING([--with-ocarina-runtimes=x], [enumerate runtimes]),
do
if test -d ${root}/resources/runtime/${P}
then
RUNTIME_LIST="${RUNTIME_LIST}${P} "
RUNTIME_LIST="${RUNTIME_LIST}${P} "
fi
done
......@@ -406,42 +407,42 @@ dnl may, one day, be edited automatically to remove
dnl some entries.
AC_OUTPUT([
Makefile
doc/Makefile
doc/real/Makefile
examples/Makefile
examples/real/Makefile
examples/real/lib/Makefile
examples/real/resources/Makefile
examples/real/safety/Makefile
examples/real/security/Makefile
projects/Makefile
projects-distrib/Makefile
resources/Makefile
resources/behavioural_properties/Makefile
resources/runtime/Makefile
resources/runtime/aadl_xml/Makefile
resources/runtime/alloy/Makefile
resources/runtime/cheddar/Makefile
resources/runtime/lnt/Makefile
resources/runtime/python/Makefile
projects/ocarina.gpr
projects-distrib/ocarina/ocarina_core.gpr
src/main/Makefile
src/config/ocarina-configuration.adb
src/frontends/Makefile
src/config/Makefile
src/core/Makefile
src/transfo/Makefile
src/backends/Makefile
src/python/Makefile
src/Makefile
support/Makefile
support/strip_wrapper.sh
tools/Makefile
tools/gendoc.py
tools/compare.py
ocarina-config
Makefile
doc/Makefile
doc/real/Makefile
examples/Makefile
examples/real/Makefile
examples/real/lib/Makefile
examples/real/resources/Makefile
examples/real/safety/Makefile
examples/real/security/Makefile
projects/Makefile
projects-distrib/Makefile
resources/Makefile
resources/behavioural_properties/Makefile
resources/runtime/Makefile
resources/runtime/aadl_xml/Makefile
resources/runtime/alloy/Makefile
resources/runtime/cheddar/Makefile
resources/runtime/lnt/Makefile
resources/runtime/python/Makefile
projects/ocarina.gpr
projects-distrib/ocarina/ocarina_core.gpr
src/main/Makefile
src/config/ocarina-configuration.adb
src/frontends/Makefile
src/config/Makefile
src/core/Makefile
src/transfo/Makefile
src/backends/Makefile
src/python/Makefile
src/Makefile
support/Makefile
support/strip_wrapper.sh
tools/Makefile
tools/gendoc.py
tools/compare.py
ocarina-config
])
AC_MSG_NOTICE(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
......
......@@ -95,7 +95,7 @@ PARALLEL_GNATMAKE_FLAGS = -j4
all-local: $(BUILD_DIRS) maybe-generate-tree-files $(PYTHON_TARGET) $(BUILD_STAMPS)
$(BUILD_STAMPS): %-build:
$(INIT_ADA_PROJECT_PATH) $(GNATMAKE_FOR_TARGET) \
$(INIT_ADA_PROJECT_PATH) $(GPRBUILD) \
$(PARALLEL_GNATMAKE_FLAGS) -P $* $(GNATFLAGS) $(GNAT_LIB_FLAGS) \
-XABS_SRC_DIR="$(PL_DEP_ABS_SRC_DIR)" \
-XABS_BUILD_DIR="$(PL_DEP_ABS_BUILD_DIR)" \
......@@ -148,7 +148,7 @@ build-mknodes:
if [ -f $(MKNODES_SRC_DIR)/mknodes.gpr ]; then \
mkdir -p $(MKNODES_BUILD_DIR)/objects; \
$(INIT_ADA_PROJECT_PATH) \
$(GNATMAKE) -P $(MKNODES_SRC_DIR)/mknodes.gpr \
$(GPRBUILD) -P $(MKNODES_SRC_DIR)/mknodes.gpr \
-XABS_SRC_DIR="$(PL_DEP_ABS_SRC_DIR)" \
-XABS_BUILD_DIR="$(PL_DEP_ABS_BUILD_DIR)" \
$(AP_FLAGS) \
......
......@@ -248,3 +248,54 @@ AC_MSG_RESULT($HAVE_GNATMAKE_APDIR)
AM_CONDITIONAL(HAS_GNATMAKE_APDIR, [test "x$HAVE_GNATMAKE_APDIR" = "xyes"])
AC_SUBST(HAVE_GNATMAKE_APDIR)
])
dnl AM_GPRBUILD
dnl adapted from GtkAda
AC_DEFUN(AM_GPRBUILD,
[
AC_PATH_PROG(GPRBUILD, gprbuild, no)
AC_PATH_PROG(GPRINSTALL, gprinstall, no)
if test x$GPRBUILD = xno ; then
AC_MSG_ERROR(I could not find gprbuild. .)
fi
AC_MSG_CHECKING(that your gnat compiler works with a simple example)
rm -f conftest.adb
cat << EOF > conftest.adb
with Ada.Text_IO;
procedure Conftest is
Conftest_Ok : Ada.Text_IO.File_Type;
begin
Ada.Text_IO.Create (File => Conftest_Ok,
Name => "$conftest_ok");
Ada.Text_IO.Close (Conftest_Ok);
end Conftest;
EOF
cat <<EOF > conftest.gpr
project Conftest is
for Main use ("conftest.adb");
for Source_Files use ("conftest.adb");
end Conftest;
EOF
$GPRBUILD -q -P conftest.gpr > /dev/null
rm -f auto.cgpr b__conftest.*
if ( test ! -x conftest ) then
AC_MSG_RESULT(no)
AC_MSG_ERROR($GPRBUILD test failed at compile time! Check your configuration.)
fi
./conftest
if ( test ! -f $conftest_ok ) then
AC_MSG_RESULT(no)
AC_MSG_ERROR($GPRBUILD test failed at run time! Check your configuration.)
fi
AC_MSG_RESULT(yes)
])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment