Просмотр исходного кода

build: fix submodule behaviour.

wip/kinc
Sam Hocevar 5 лет назад
Родитель
Сommit
8b44ed3003
3 измененных файлов: 18 добавлений и 9 удалений
  1. +1
    -1
      build/autotools/m4/lol-conf.m4
  2. +7
    -5
      build/autotools/m4/lol-subproject.m4
  3. +10
    -3
      configure.ac

+ 1
- 1
build/autotools/m4/lol-conf.m4 Просмотреть файл

@@ -253,7 +253,7 @@ LOL_DEPS="${LOL_DEPS} \$(lol_builddir)/src/liblol-core.a"
LOL_LUA_DEPS="${LOL_LUA_DEPS} \$(lol_builddir)/src/3rdparty/liblol-lua.a"

dnl How to use the Lol Engine inside this tree
AM_CPPFLAGS="${AM_CPPFLAGS} -I\$(lol_srcdir)/lol-core/include"
AM_CPPFLAGS="${AM_CPPFLAGS} -I\$(lol_srcdir)/lol/include"
AM_CPPFLAGS="${AM_CPPFLAGS} -I\$(lol_srcdir)/src"
AM_CPPFLAGS="${AM_CPPFLAGS} -DLOL_CONFIG_SOURCESUBDIR=\\\"\$(subdir)\\\""
AM_CPPFLAGS="${AM_CPPFLAGS} ${LOL_CFLAGS}"


+ 7
- 5
build/autotools/m4/lol-subproject.m4 Просмотреть файл

@@ -15,11 +15,13 @@ dnl
# ---------------------
AC_DEFUN([LOL_AC_SUBPROJECT], [

ac_lol_subproject_dir="$1"
AC_MSG_NOTICE([Configuring Lol Engine in ${ac_lol_subproject_dir}])

dnl
dnl Parse build.config if present
dnl

AC_MSG_WARN([${srcdir}])
ac_lol_configure_args=""
if test -f ${srcdir}/build.config; then
for x in `sed -ne 's,.*<enable_\(@<:@^>@:>@*\)>\(@<:@^<@:>@*\)</enable_@<:@^>@:>@*>.*,\1=\2,p' ${srcdir}/build.config`; do
@@ -38,10 +40,10 @@ dnl Build and configure Lol Engine before our repository
dnl Ensure $lol_srcdir and $lol_builddir are properly set
dnl

ac_configure_args="${ac_configure_args} --enable-subproject ${ac_lol_configure_args} $1"
AC_CONFIG_SUBDIRS([lol])
AC_SUBST(lol_srcdir, '${top_srcdir}/lol')
AC_SUBST(lol_builddir, '${top_builddir}/lol')
ac_configure_args="${ac_configure_args} --enable-subproject ${ac_lol_configure_args}"
AC_CONFIG_SUBDIRS($1)
AC_SUBST(lol_srcdir, '${top_srcdir}/$1')
AC_SUBST(lol_builddir, '${top_builddir}/$1')

dnl
dnl Subprojects use the same macros as us


+ 10
- 3
configure.ac Просмотреть файл

@@ -106,13 +106,20 @@ AC_ARG_ENABLE(doc,

dnl Subproject builds
if test "${enable_subproject}" = "yes"; then
AC_MSG_CHECKING(for a config-lol.h file in the parent project)
if test -f "../config-lol.h"; then
AC_MSG_CHECKING(for parent project)
ac_lol_parent_project_dir=".."
# FIXME: an infinite loop is possible here
while test ! -f "${ac_lol_parent_project_dir}/configure"; do
ac_lol_parent_project_dir="${ac_lol_parent_project_dir}/.."
done
AC_MSG_RESULT(${ac_lol_parent_project_dir})
AC_MSG_CHECKING(for a config-lol.h file in parent project)
if test -f "${ac_lol_parent_project_dir}/config-lol.h"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CONFIG_LOL_H, 1, Define to if parent project provides config-lol.h)
AH_BOTTOM([
#if HAVE_CONFIG_LOL_H
#include "../config-lol.h"
#include "${ac_lol_parent_project_dir}/config-lol.h"
#endif
])
else


Загрузка…
Отмена
Сохранить