Changeset 2740


Ignore:
Timestamp:
Jun 17, 2013, 3:45:03 PM (8 years ago)
Author:
sam
Message:

build: lol-build now passes flags to configure, and configure now uses
optimisation flag -Os instead of -O3.

Location:
trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/build/build-android

    r1684 r2740  
    55
    66set -e
    7 ./build/lol-build bootstrap android-arm
    8 ./build/lol-build configure android-arm
    9 ./build/lol-build build android-arm
     7./build/lol-build "$@" bootstrap android-arm
     8./build/lol-build "$@" configure android-arm
     9./build/lol-build "$@" build android-arm
    1010
  • trunk/build/build-html

    r2619 r2740  
    55
    66set -e
    7 ./build/lol-build bootstrap emscripten-html
    8 ./build/lol-build configure emscripten-html
    9 ./build/lol-build build emscripten-html
     7./build/lol-build "$@" bootstrap emscripten-html
     8./build/lol-build "$@" configure emscripten-html
     9./build/lol-build "$@" build emscripten-html
    1010
  • trunk/build/build-mingw

    r1518 r2740  
    55
    66set -e
    7 ./build/lol-build bootstrap windows-i386
    8 ./build/lol-build configure windows-i386
    9 ./build/lol-build build windows-i386
     7./build/lol-build "$@" bootstrap windows-i386
     8./build/lol-build "$@" configure windows-i386
     9./build/lol-build "$@" build windows-i386
    1010
  • trunk/build/build-mingw64

    r1518 r2740  
    55
    66set -e
    7 ./build/lol-build bootstrap windows-amd64
    8 ./build/lol-build configure windows-amd64
    9 ./build/lol-build build windows-amd64
     7./build/lol-build "$@" bootstrap windows-amd64
     8./build/lol-build "$@" configure windows-amd64
     9./build/lol-build "$@" build windows-amd64
    1010
  • trunk/build/build-nacl32

    r1518 r2740  
    55
    66set -e
    7 ./build/lol-build bootstrap nacl-i386
    8 ./build/lol-build configure nacl-i386
    9 ./build/lol-build build nacl-i386
     7./build/lol-build "$@" bootstrap nacl-i386
     8./build/lol-build "$@" configure nacl-i386
     9./build/lol-build "$@" build nacl-i386
    1010
  • trunk/build/build-nacl64

    r1518 r2740  
    55
    66set -e
    7 ./build/lol-build bootstrap nacl-amd64
    8 ./build/lol-build configure nacl-amd64
    9 ./build/lol-build build nacl-amd64
     7./build/lol-build "$@" bootstrap nacl-amd64
     8./build/lol-build "$@" configure nacl-amd64
     9./build/lol-build "$@" build nacl-amd64
    1010
  • trunk/build/build-ps3

    r1518 r2740  
    55
    66set -e
    7 ./build/lol-build bootstrap ps3-ppu
    8 ./build/lol-build configure ps3-ppu
    9 ./build/lol-build build ps3-ppu
     7./build/lol-build "$@" bootstrap ps3-ppu
     8./build/lol-build "$@" configure ps3-ppu
     9./build/lol-build "$@" build ps3-ppu
    1010
  • trunk/build/build-raspi

    r1677 r2740  
    55
    66set -e
    7 ./build/lol-build bootstrap raspi-arm
    8 ./build/lol-build configure raspi-arm
    9 ./build/lol-build build raspi-arm
     7./build/lol-build "$@" bootstrap raspi-arm
     8./build/lol-build "$@" configure raspi-arm
     9./build/lol-build "$@" build raspi-arm
    1010
  • trunk/build/lol-build

    r2702 r2740  
    44# Lol Engine build script
    55# Usage:
    6 #   lol-build <action> [<platform>]
     6#   lol-build [<flags>...] <action> [<platform>]
     7#
     8# Supported flags:
     9#  --enable-debug
     10#  --enable-devel
     11#  --enable-release
    712#
    813# Where <action> is one of:
     
    3136set -e
    3237
    33 action="$1"
    34 platform="$2"
     38###############################################################################
     39# Commandline parsing
     40#
     41action=""
     42platform=""
     43configure_flags=""
     44while [ "$#" -gt 0 ]; do
     45    case "$1" in
     46      --enable-debug|--enable-devel|--enable-release)
     47        configure_flags="${configure_flags} $1"
     48        ;;
     49      --*)
     50        echo "E: invalid flag $1"
     51        exit 1
     52        ;;
     53      *)
     54        if [ -z "$action" ]; then
     55            action="$1"
     56        else
     57            platform="$1"
     58        fi
     59        ;;
     60    esac
     61    shift
     62done
    3563
    3664###############################################################################
     
    105133            ;;
    106134    esac
     135}
     136
     137do_configure()
     138{
     139    ./configure ${configure_flags} "$@"
    107140}
    108141
     
    189222            CC="$XCODE/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
    190223            CXX="$XCODE/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
    191             ./configure --host=armv7-apple-darwin10 CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" CC="$CC" CXX="$CXX"
     224            do_configure --host=armv7-apple-darwin10 CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" CC="$CC" CXX="$CXX"
    192225            ;;
    193226        android-arm)
     
    196229            CXXFLAGS="$CXXFLAGS -march=armv5te -mtune=xscale -msoft-float -mthumb -fno-rtti -fno-exceptions"
    197230            LOL_LIBS="$LOL_LIBS -L$ANDROID_NDK_ROOT/sources/cxx-stl/stlport/libs/armeabi -lstlport_shared -lm -fpic -XCClinker -shared -u ANativeActivity_onCreate"
    198             PKG_CONFIG_PATH="$PKG_CONFIG_PATH" ./configure --host=arm-linux-androideabi ac_cv_exeext=.so CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" LOL_LIBS="$LOL_LIBS"
     231            PKG_CONFIG_PATH="$PKG_CONFIG_PATH" do_configure --host=arm-linux-androideabi ac_cv_exeext=.so CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" LOL_LIBS="$LOL_LIBS"
    199232            # FIXME: is this needed?
    200233            # ant debug
     
    203236            ;;
    204237        raspi-arm)
    205             ./configure --host=arm-bcm2708hardfp-linux-gnueabi CPPFLAGS="-I$RASPI_SDK_ROOT/firmware/opt/vc/include -I$RASPI_SDK_ROOT/firmware/opt/vc/include/interface/vcos/pthreads -I$RASPI_SDK_ROOT/chroot/usr/include" LDFLAGS="-L$RASPI_SDK_ROOT/firmware/opt/vc/lib -L$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf -L$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf -Wl,--unresolved-symbols=ignore-in-shared-libs"
     238            do_configure --host=arm-bcm2708hardfp-linux-gnueabi CPPFLAGS="-I$RASPI_SDK_ROOT/firmware/opt/vc/include -I$RASPI_SDK_ROOT/firmware/opt/vc/include/interface/vcos/pthreads -I$RASPI_SDK_ROOT/chroot/usr/include" LDFLAGS="-L$RASPI_SDK_ROOT/firmware/opt/vc/lib -L$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf -L$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf -Wl,--unresolved-symbols=ignore-in-shared-libs"
    206239            ;;
    207240        nacl-i386)
    208             ./configure CXX=i686-nacl-g++ CC=i686-nacl-gcc ac_cv_exeext=.32.nexe --host=i386 CPPFLAGS="-I$NACL_SDK_ROOT/include" LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv"
     241            do_configure CXX=i686-nacl-g++ CC=i686-nacl-gcc ac_cv_exeext=.32.nexe --host=i386 CPPFLAGS="-I$NACL_SDK_ROOT/include" LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv"
    209242            ;;
    210243        nacl-amd64)
    211             ./configure CXX=x86_64-nacl-g++ CC=x86_64-nacl-gcc ac_cv_exeext=.64.nexe --host=x86_64 CPPFLAGS="-I$NACL_SDK_ROOT/include" LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv"
     244            do_configure CXX=x86_64-nacl-g++ CC=x86_64-nacl-gcc ac_cv_exeext=.64.nexe --host=x86_64 CPPFLAGS="-I$NACL_SDK_ROOT/include" LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv"
    212245            ;;
    213246        osx-amd64)
    214247            # HACK: use clang++ because of a memory leak in llvm-g++.
    215             ./configure CXX=clang++ CC=clang
     248            do_configure CXX=clang++ CC=clang
    216249            ;;
    217250        ps3-ppu)
    218             PATH="$PATH" ./configure CXX=ppu-lv2-g++ CC=ppu-lv2-gcc ac_cv_exeext=.elf --host=powerpc
     251            PATH="$PATH" do_configure CXX=ppu-lv2-g++ CC=ppu-lv2-gcc ac_cv_exeext=.elf --host=powerpc
    219252            ;;
    220253        win*-i386|win*-amd64)
     
    240273            CPPFLAGS="$CPPFLAGS -I$PWD/external/libcaca-0.99.beta18/include -DCACA_STATIC"
    241274
    242             PATH="$PATH" PKG_CONFIG_PATH="$PKG_CONFIG_PATH" ./configure $HOSTFLAGS $BUILDFLAGS CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" GTK_LIBS="$GTK_LIBS"
     275            PATH="$PATH" PKG_CONFIG_PATH="$PKG_CONFIG_PATH" do_configure $HOSTFLAGS $BUILDFLAGS CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" GTK_LIBS="$GTK_LIBS"
    243276            ;;
    244277        emscripten-*)
    245             ./configure $HOSTFLAGS $BUILDFLAGS CC=emcc CXX=em++ AR=emar RANLIB=emranlib PKG_CONFIG=/bin/false SDL_CONFIG=/bin/false ac_cv_exeext=".${platform##emscripten-}"
    246             ;;
    247         *)
    248             PATH="$PATH" ./configure CFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS"
     278            do_configure $HOSTFLAGS $BUILDFLAGS CC=emcc CXX=em++ AR=emar RANLIB=emranlib PKG_CONFIG=/bin/false SDL_CONFIG=/bin/false ac_cv_exeext=".${platform##emscripten-}"
     279            ;;
     280        *)
     281            PATH="$PATH" do_configure CFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS"
    249282            ;;
    250283    esac
  • trunk/configure.ac

    r2721 r2740  
    102102
    103103
    104 if test "${enable_debug}" = "yes"; then
    105   AC_DEFINE(LOL_DEBUG, 1, Define to 1 to activate debug)
    106   OPT_CXXFLAGS="-O"
     104dnl  Build mode
     105ac_cv_my_build_mode="devel"
     106if test "x${enable_release}" = "xyes"; then
     107  ac_cv_my_build_mode="release"
     108  CFLAGS=""
     109  LDFLAGS=""
     110  CXXFLAGS=""
     111fi
     112if test "x${enable_devel}" = "xyes"; then
     113  ac_cv_my_build_mode="devel"
     114  CFLAGS=""
     115  LDFLAGS=""
     116  CXXFLAGS=""
     117fi
     118if test "x${enable_debug}" = "xyes"; then
     119  ac_cv_my_build_mode="debug"
     120  CFLAGS=""
     121  LDFLAGS=""
     122  CXXFLAGS=""
     123fi
     124
     125if test "x${ac_cv_my_build_mode}" = "xdebug"; then
     126  AC_DEFINE(LOL_BUILD_DEBUG, 1, Define to 1 to activate debug build)
     127  BUILD_CXXFLAGS="-O -g"
     128elif test "x${ac_cv_my_build_mode}" = "xdevel"; then
     129  AC_DEFINE(LOL_BUILD_DEVEL, 1, Define to 1 to activate development build)
     130  BUILD_CXXFLAGS="-Os -g -ffast-math"
    107131else
    108   OPT_CXXFLAGS="-O3 -ffast-math -fomit-frame-pointer"
    109   OPT_LDFLAGS="-fno-strength-reduce"
    110 fi
    111 
    112 if test "${enable_release}" = "yes"; then
    113   AC_DEFINE(LOL_RELEASE, 1, Define to 1 to activate final release)
    114   REL_CXXFLAGS=""
    115 else
    116   REL_CXXFLAGS="-g"
    117 fi
    118 
    119 if test "${enable_experimental}" = "yes"; then
    120   AC_DEFINE(LOL_EXPERIMENTAL, 1, Define to 1 to activate experimental build)
    121 fi
    122 
    123 # Build documentation?
     132  AC_DEFINE(LOL_BUILD_RELEASE, 1, Define to 1 to activate final release)
     133  BUILD_CXXFLAGS="-Os -ffast-math -fomit-frame-pointer"
     134  BUILD_LDFLAGS="-fno-strength-reduce"
     135fi
     136
     137
     138dnl  Build documentation?
    124139DOXYGEN="no"
    125140LATEX="no"
     
    167182LOL_TRY_CXXFLAGS(-fno-rtti, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"])
    168183
    169 dnl  Optimizations
    170 AM_CXXFLAGS="${AM_CXXFLAGS} ${REL_CXXFLAGS} ${OPT_CXXFLAGS}"
    171 AM_LDFLAGS="${AM_LDFLAGS} ${REL_LDFLAGS} ${OPT_LDFLAGS}"
     184dnl  Build mode specific flags
     185AM_CXXFLAGS="${AM_CXXFLAGS} ${BUILD_CXXFLAGS}"
     186AM_LDFLAGS="${AM_LDFLAGS} ${BUILD_LDFLAGS}"
    172187
    173188dnl  Debug symbols
  • trunk/src/dict.cpp

    r2506 r2740  
    4444    ~DictData()
    4545    {
    46 #if !LOL_RELEASE
     46#if !LOL_BUILD_RELEASE
    4747        if (nentities)
    4848            Log::Error("still %i entities in dict\n", nentities);
     
    140140        }
    141141
    142 #if !LOL_RELEASE
     142#if !LOL_BUILD_RELEASE
    143143    Log::Error("removing unregistered entity %p (%s)\n",
    144144               entity, entity->GetName());
  • trunk/src/entity.cpp

    r2610 r2740  
    3030    m_destroy(0)
    3131{
    32 #if !LOL_RELEASE
     32#if !LOL_BUILD_RELEASE
    3333    m_tickstate = STATE_IDLE;
    3434#endif
     
    4040Entity::~Entity()
    4141{
    42 #if !LOL_RELEASE
     42#if !LOL_BUILD_RELEASE
    4343    if (!m_destroy)
    4444        Log::Error("entity destructor called directly\n");
     
    5454{
    5555    UNUSED(seconds);
    56 #if !LOL_RELEASE
     56#if !LOL_BUILD_RELEASE
    5757    if (m_tickstate != STATE_PRETICK_GAME)
    5858        Log::Error("invalid entity game tick\n");
     
    6464{
    6565    (void)seconds;
    66 #if !LOL_RELEASE
     66#if !LOL_BUILD_RELEASE
    6767    if (m_tickstate != STATE_PRETICK_DRAW)
    6868        Log::Error("invalid entity draw tick\n");
  • trunk/src/entity.h

    r2611 r2740  
    7777    static int const ALLGROUP_END = DRAWGROUP_END;
    7878
    79 #if !LOL_RELEASE
     79#if !LOL_BUILD_RELEASE
    8080    enum
    8181    {
  • trunk/src/image/codec/android-image.cpp

    r2551 r2740  
    5353    if (res < 0)
    5454    {
    55 #if !LOL_RELEASE
     55#if !LOL_BUILD_RELEASE
    5656        Log::Error("JVM environment not found, trying to attach thread\n");
    5757#endif
     
    6060    if (res < 0)
    6161    {
    62 #if !LOL_RELEASE
     62#if !LOL_BUILD_RELEASE
    6363        Log::Error("JVM environment not found, cannot open image %s\n", path);
    6464#endif
     
    7575    if (!bmp)
    7676    {
    77 #if !LOL_RELEASE
     77#if !LOL_BUILD_RELEASE
    7878        Log::Error("could not load %s\n", path);
    7979#endif
     
    112112    if (res < 0)
    113113    {
    114 #if !LOL_RELEASE
     114#if !LOL_BUILD_RELEASE
    115115        Log::Error("JVM environment not found, cannot close image\n");
    116116#endif
  • trunk/src/image/codec/gdiplus-image.cpp

    r2552 r2740  
    5757    if (status != Gdiplus::Ok)
    5858    {
    59 #if !LOL_RELEASE
     59#if !LOL_BUILD_RELEASE
    6060        Log::Error("error %d while initialising GDI+\n", status);
    6161#endif
     
    7272        if (mbstowcs(wpath, pathlist[i].C(), len + 1) == (size_t)-1)
    7373        {
    74 #if !LOL_RELEASE
     74#if !LOL_BUILD_RELEASE
    7575            Log::Error("invalid image name %s\n", pathlist[i].C());
    7676#endif
     
    8787            if (status != Gdiplus::Ok)
    8888            {
    89 #if !LOL_RELEASE
     89#if !LOL_BUILD_RELEASE
    9090                if (status != Gdiplus::InvalidParameter)
    9191                    Log::Error("error %d loading %s\n",
     
    104104    if (!m_bitmap)
    105105    {
    106 #if !LOL_RELEASE
     106#if !LOL_BUILD_RELEASE
    107107        Log::Error("could not load %s\n", path);
    108108#endif
     
    117117                          PixelFormat32bppARGB, &m_bdata) != Gdiplus::Ok)
    118118    {
    119 #if !LOL_RELEASE
     119#if !LOL_BUILD_RELEASE
    120120        Log::Error("could not lock bits in %s\n", path);
    121121#endif
  • trunk/src/image/codec/ios-image.cpp

    r2551 r2740  
    5757    if (!image)
    5858    {
    59 #if !LOL_RELEASE
     59#if !LOL_BUILD_RELEASE
    6060        Log::Error("could not load %s\n", path);
    6161#endif
  • trunk/src/image/codec/sdl-image.cpp

    r2551 r2740  
    6868    if (!m_img)
    6969    {
    70 #if !LOL_RELEASE
     70#if !LOL_BUILD_RELEASE
    7171        Log::Error("could not load image %s\n", path);
    7272#endif
  • trunk/src/ticker.cpp

    r2651 r2740  
    3434        nentities(0),
    3535        frame(0), recording(0), deltatime(0), bias(0), fps(0),
    36 #if LOL_DEBUG
     36#if LOL_BUILD_DEBUG
    3737        keepalive(0),
    3838#endif
     
    4747        ASSERT(nentities == 0,
    4848               "still %i entities in ticker\n", nentities);
    49 #if !LOL_RELEASE
     49#if !LOL_BUILD_RELEASE
    5050        if (autolist)
    5151        {
     
    7777    Timer timer;
    7878    float deltatime, bias, fps;
    79 #if LOL_DEBUG
     79#if LOL_BUILD_DEBUG
    8080    float keepalive;
    8181#endif
     
    163163void *TickerData::GameThreadMain(void * /* p */)
    164164{
    165 #if LOL_DEBUG
     165#if LOL_BUILD_DEBUG
    166166    Log::Info("ticker game thread initialised\n");
    167167#endif
     
    180180    data->drawtick.Push(0);
    181181
    182 #if LOL_DEBUG
     182#if LOL_BUILD_DEBUG
    183183    Log::Info("ticker game thread terminated\n");
    184184#endif
     
    191191void *TickerData::DrawThreadMain(void * /* p */)
    192192{
    193 #if LOL_DEBUG
     193#if LOL_BUILD_DEBUG
    194194    Log::Info("ticker draw thread initialised\n");
    195195#endif
     
    206206    }
    207207
    208 #if LOL_DEBUG
     208#if LOL_BUILD_DEBUG
    209209    Log::Info("ticker draw thread terminated\n");
    210210#endif
     
    269269    }
    270270
    271 #if LOL_DEBUG
     271#if LOL_BUILD_DEBUG
    272272    data->keepalive += data->deltatime;
    273273    if (data->keepalive > 10.f)
     
    291291            if (e->m_ref)
    292292            {
    293 #if !LOL_RELEASE
     293#if !LOL_BUILD_RELEASE
    294294                Log::Error("poking %s\n", e->GetName());
    295295#endif
     
    298298            }
    299299
    300 #if !LOL_RELEASE
     300#if !LOL_BUILD_RELEASE
    301301        if (n)
    302302            Log::Error("%i entities stuck after %i frames, poked %i\n",
     
    359359            if (!e->m_destroy)
    360360            {
    361 #if !LOL_RELEASE
     361#if !LOL_BUILD_RELEASE
    362362                if (e->m_tickstate != Entity::STATE_IDLE)
    363363                    Log::Error("entity %s [%p] not idle for game tick\n",
     
    366366#endif
    367367                e->TickGame(data->deltatime);
    368 #if !LOL_RELEASE
     368#if !LOL_BUILD_RELEASE
    369369                if (e->m_tickstate != Entity::STATE_POSTTICK_GAME)
    370370                    Log::Error("entity %s [%p] missed super game tick\n",
     
    401401            if (!e->m_destroy)
    402402            {
    403 #if !LOL_RELEASE
     403#if !LOL_BUILD_RELEASE
    404404                if (e->m_tickstate != Entity::STATE_IDLE)
    405405                    Log::Error("entity %s [%p] not idle for draw tick\n",
     
    408408#endif
    409409                e->TickDraw(data->deltatime);
    410 #if !LOL_RELEASE
     410#if !LOL_BUILD_RELEASE
    411411                if (e->m_tickstate != Entity::STATE_POSTTICK_DRAW)
    412412                    Log::Error("entity %s [%p] missed super draw tick\n",
  • trunk/test/unit/build.cpp

    r2520 r2740  
    128128    }
    129129
    130 #if !defined LOL_DEBUG
     130#if !defined LOL_BUILD_DEBUG
    131131    LOLUNIT_TEST(FastMath)
    132132    {
Note: See TracChangeset for help on using the changeset viewer.