Ticket #2304: cludgy_build_changes.patch

File cludgy_build_changes.patch, 2.1 KB (added by Doménique, 10 years ago)

Small modifications to the build scripts to get stuff to compile using cmd line tools. Intended solely for demonstration purposes, it's ugly.

  • build/premake/premake4.lua

     
    2828newoption { trigger = "datadir", description = "Directory for data files (typically '/usr/share/games/0ad'); default is ../data/ relative to executable" }
    2929newoption { trigger = "libdir", description = "Directory for libraries (typically '/usr/lib/games/0ad'); default is ./ relative to executable" }
    3030
     31--  ugly hack to use clang
     32premake.gcc.cc  = 'clang'
     33premake.gcc.cxx = 'clang++'
     34
    3135-- Root directory of project checkout relative to this .lua file
    3236rootdir = "../.."
    3337
     
    341345            buildoptions {
    342346                -- Hide symbols in dynamic shared objects by default, for efficiency and for equivalence with
    343347                -- Windows - they should be exported explicitly with __attribute__ ((visibility ("default")))
    344                 "-fvisibility=hidden"
     348                "-fvisibility=hidden",
     349                "-stdlib=libstdc++"
    345350            }
     351            linkoptions {
     352                "-stdlib=libstdc++"
     353            }
    346354        end
    347355
    348356        if _OPTIONS["bindir"] then
  • libraries/osx/build-osx-libs.sh

     
    6060# Define compiler as "gcc" (in case anything expects e.g. gcc-4.2)
    6161# On newer OS X versions, this will be a symbolic link to LLVM GCC
    6262# TODO: don't rely on that
    63 export CC=${CC:="gcc"} CXX=${CXX:="g++"}
     63#export CC=${CC:="gcc"} CXX=${CXX:="g++"}
     64export CC=${CC:="clang"} CXX=${CXX:="clang++"}
    6465
    6566# The various libs offer inconsistent configure options, some allow
    6667# setting sysroot and OS X-specific options, others don't. Adding to
     
    8485CFLAGS="$CFLAGS -arch $ARCH"
    8586# Avoid linker warnings about compiling translation units with different visibility settings
    8687CPPFLAGS="$CPPFLAGS $CFLAGS -fvisibility=hidden"
     88CPPFLAGS="$CPPFLAGS -stdlib=libstdc++" #-lstdc++.6"
    8789LDFLAGS="$LDFLAGS -arch $ARCH"
     90LDFLAGS="$LDFLAGS -stdlib=libstdc++" # -lstdc++.6"
    8891
    8992JOBS=${JOBS:="-j2"}
    9093