Parcourir la source

build: improvements when building as a subproject

legacy
Sam Hocevar il y a 8 ans
Parent
révision
8c3c62bdc0
5 fichiers modifiés avec 64 ajouts et 47 suppressions
  1. +1
    -4
      bootstrap
  2. +31
    -31
      build/autotools/m4/lol-conf.m4
  3. +3
    -3
      build/autotools/m4/lol-subproject.m4
  4. +28
    -8
      configure.ac
  5. +1
    -1
      src/3rdparty/lua

+ 1
- 4
bootstrap Voir le fichier

@@ -56,7 +56,6 @@ fi
auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *([[ ]*\([^] )]*\).*/\1/p' $conffile`"
pkgconfig="`grep '^[ \t]*PKG_PROG_PKG_CONFIG' $conffile >/dev/null 2>&1 && echo yes || echo no`"
libtool="`grep '^[ \t]*A._PROG_LIBTOOL' $conffile >/dev/null 2>&1 && echo yes || echo no`"
header="`grep '^[ \t]*A._CONFIG_HEADER' $conffile >/dev/null 2>&1 && echo yes || echo no`"
makefile="`[ -f Makefile.am ] && echo yes || echo no`"
aclocalflags="`sed -ne 's/^[ \t]*ACLOCAL_AMFLAGS[ \t]*=//p' Makefile.am 2>/dev/null || :`"

@@ -151,9 +150,7 @@ fi

aclocal${amvers} ${aclocalflags}
autoconf${acvers}
if test "$header" = "yes"; then
autoheader${acvers}
fi
autoheader${acvers}
if test "$makefile" = "yes"; then
#add --include-deps if you want to bootstrap with any other compiler than gcc
#automake${amvers} --add-missing --copy --include-deps


+ 31
- 31
build/autotools/m4/lol-conf.m4 Voir le fichier

@@ -35,37 +35,6 @@ AC_LANG_POP(C++)
]) # LOL_AC_INIT


# LOL_AC_SUBST()
# ---------------------
AC_DEFUN([LOL_AC_SUBST], [

dnl How to use the Lol Engine outside this tree
LOL_CFLAGS="$LOL_CFLAGS $SDL_CFLAGS $GL_CFLAGS $EGL_CFLAGS $LIBPNG_CFLAGS"
LOL_LIBS="$LOL_LIBS $SDL_LIBS $GL_LIBS $EGL_LIBS $LIBPNG_LIBS $D3D_LIBS"
LOL_DEPS="${LOL_DEPS} \$(lol_builddir)/src/liblol-core.a"
LOL_DEPS="${LOL_DEPS} \$(lol_builddir)/src/3rdparty/liblol-bullet.a"
LOL_DEPS="${LOL_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)/src"
AM_CPPFLAGS="${AM_CPPFLAGS} -DLOL_CONFIG_SOURCESUBDIR=\\\"\$(subdir)\\\""
AM_CPPFLAGS="${AM_CPPFLAGS} ${LOL_CFLAGS}"
AM_LDFLAGS="${AM_LDFLAGS} ${LOL_DEPS}"
AM_LDFLAGS="${AM_LDFLAGS} ${LOL_LIBS}"

dnl Extra flags
AC_SUBST(LOL_CFLAGS)
AC_SUBST(LOL_LIBS)
AC_SUBST(LOL_DEPS)

AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(AM_LDFLAGS)

]) # LOL_AC_SUBST


# LOL_AC_CHECK()
# ---------------------
AC_DEFUN([LOL_AC_CHECK], [
@@ -269,3 +238,34 @@ LOL_TRY_CXXFLAGS(-Wno-psabi, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wno-psabi"])

]) # LOL_AC_CHECK


# LOL_AC_FINI()
# ---------------------
AC_DEFUN([LOL_AC_FINI], [

dnl How to use the Lol Engine outside this tree
LOL_CFLAGS="$LOL_CFLAGS $SDL_CFLAGS $GL_CFLAGS $EGL_CFLAGS $LIBPNG_CFLAGS"
LOL_LIBS="$LOL_LIBS $SDL_LIBS $GL_LIBS $EGL_LIBS $LIBPNG_LIBS $D3D_LIBS"
LOL_DEPS="${LOL_DEPS} \$(lol_builddir)/src/liblol-core.a"
LOL_DEPS="${LOL_DEPS} \$(lol_builddir)/src/3rdparty/liblol-bullet.a"
LOL_DEPS="${LOL_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)/src"
AM_CPPFLAGS="${AM_CPPFLAGS} -DLOL_CONFIG_SOURCESUBDIR=\\\"\$(subdir)\\\""
AM_CPPFLAGS="${AM_CPPFLAGS} ${LOL_CFLAGS}"
AM_LDFLAGS="${AM_LDFLAGS} ${LOL_DEPS}"
AM_LDFLAGS="${AM_LDFLAGS} ${LOL_LIBS}"

dnl Extra flags
AC_SUBST(LOL_CFLAGS)
AC_SUBST(LOL_LIBS)
AC_SUBST(LOL_DEPS)

AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(AM_LDFLAGS)

]) # LOL_AC_FINI


+ 3
- 3
build/autotools/m4/lol-subproject.m4 Voir le fichier

@@ -17,10 +17,10 @@ AC_DEFUN([LOL_AC_SUBPROJECT], [

dnl
dnl Build and configure Lol Engine before our repository
dnl Ensure $lol_srcdir and $lol_builddir are properly set up
dnl Ensure $lol_srcdir and $lol_builddir are properly set
dnl

ac_configure_args="${ac_configure_args} --disable-test --disable-doc --disable-tutorial --disable-samples --disable-tools"
ac_configure_args="${ac_configure_args} --enable-subproject"
AC_CONFIG_SUBDIRS([lol])
AC_SUBST(lol_srcdir, '${top_srcdir}/lol')
AC_SUBST(lol_builddir, '${top_builddir}/lol')
@@ -31,7 +31,7 @@ dnl

LOL_AC_INIT()
LOL_AC_CHECK()
LOL_AC_SUBST()
LOL_AC_FINI()

]) # LOL_AC_SUBPROJECT


+ 28
- 8
configure.ac Voir le fichier

@@ -27,8 +27,6 @@ AC_SUBST(LOLREMEZ_VERSION)
AC_SUBST(lol_srcdir, '${top_srcdir}')
AC_SUBST(lol_builddir, '${top_builddir}')

AC_CONFIG_HEADER(config.h)

AM_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_CXX
@@ -81,6 +79,9 @@ AC_ARG_ENABLE(release,
AC_ARG_ENABLE(experimental,
[ --enable-experimental experimental build (default no)])

AC_ARG_ENABLE(subproject,
[ --enable-subproject build as a subproject (default no)])

AC_ARG_ENABLE(test,
[ --enable-test build test suite (default yes)])
AC_ARG_ENABLE(tools,
@@ -93,6 +94,23 @@ AC_ARG_ENABLE(doc,
[ --enable-doc build documentation (needs doxygen and LaTeX)])


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_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"
#endif
])
else
AC_MSG_RESULT(no)
fi
fi


dnl Common C headers
AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h stdint.h math.h)
AC_CHECK_HEADERS(fastmath.h unistd.h io.h)
@@ -145,7 +163,7 @@ fi
dnl Build documentation?
DOXYGEN="no"
LATEX="no"
if test "${enable_doc}" != "no"; then
if test "${enable_doc}" != "no" -a "${enable_subproject}" != "yes"; then
AC_PATH_PROG(DOXYGEN, doxygen, no)
if test "${DOXYGEN}" != "no"; then
# Build LaTeX documentation?
@@ -217,17 +235,19 @@ AM_CONDITIONAL(LOL_USE_GTKGL, test "${ac_cv_my_have_gtkgl}" != "no")


dnl Optional features
AM_CONDITIONAL(BUILD_TEST, test "${enable_test}" != "no")
AM_CONDITIONAL(BUILD_TOOLS, test "${enable_tools}" != "no")
AM_CONDITIONAL(BUILD_TUTORIAL, test "${enable_tutorial}" != "no")
AM_CONDITIONAL(BUILD_SAMPLES, test "${enable_samples}" != "no")
AM_CONDITIONAL(BUILD_TEST, test "${enable_test}" != "no" -a "${enable_subproject}" != "yes")
AM_CONDITIONAL(BUILD_TOOLS, test "${enable_tools}" != "no" -a "${enable_subproject}" != "yes")
AM_CONDITIONAL(BUILD_TUTORIAL, test "${enable_tutorial}" != "no" -a "${enable_subproject}" != "yes")
AM_CONDITIONAL(BUILD_SAMPLES, test "${enable_samples}" != "no" -a "${enable_subproject}" != "yes")


dnl Should we ship non-free data?
AM_CONDITIONAL(HAVE_NONFREE, true)


LOL_AC_SUBST()
LOL_AC_FINI()

AC_CONFIG_HEADER(config.h)

AC_CONFIG_FILES(
[Makefile


+ 1
- 1
src/3rdparty/lua

@@ -1 +1 @@
Subproject commit c43cfa79e9f4d065be03e2e612f73c329aea972a
Subproject commit 167fe0b5ef115d637fe44d3592f601b341dc3e7e

Chargement…
Annuler
Enregistrer