added distro support for linux (nw)

This commit is contained in:
Miodrag Milanovic 2015-03-26 14:01:14 +01:00
parent 6c2c891317
commit 5310d041d5
3 changed files with 93 additions and 5 deletions

View File

@ -136,6 +136,50 @@ ifdef PTR64
ARCHITECTURE = x64
endif
PYTHON = @python
CC = @gcc
LD = @g++
#-------------------------------------------------
# distribution may change things
#-------------------------------------------------
ifeq ($(DISTRO),)
DISTRO = generic
else
ifeq ($(DISTRO),debian-stable)
else
ifeq ($(DISTRO),ubuntu-intrepid)
# Force gcc-4.2 on ubuntu-intrepid
CC = @gcc -V 4.2
LD = @g++-4.2
else
ifeq ($(DISTRO),gcc44-generic)
CC = @gcc-4.4
LD = @g++-4.4
else
ifeq ($(DISTRO),gcc45-generic)
CC = @gcc-4.5
LD = @g++-4.5
else
ifeq ($(DISTRO),gcc46-generic)
CC = @gcc-4.6
LD = @g++-4.6
else
ifeq ($(DISTRO),gcc47-generic)
CC = @gcc-4.7
LD = @g++-4.7
else
$(error DISTRO $(DISTRO) unknown)
endif
endif
endif
endif
endif
endif
endif
# extension for executables
EXE =
@ -164,9 +208,6 @@ endif
GENDIR = build/generated
PYTHON = @python
CC = @gcc
LD = @g++
# all sources are under the src/ directory
SRC = src
@ -191,9 +232,9 @@ GENIE=3rdparty/genie/bin/$(OS)/genie
SILENT?=@
PARAMS=
PARAMS=--distro=$(DISTRO)
ifdef TOOLS
PARAMS=--with-tools
PARAMS+= --with-tools
endif
all: $(GENIE) $(TARGETOS)_$(ARCHITECTURE)

View File

@ -69,6 +69,20 @@ newoption {
},
}
newoption {
trigger = "distro",
description = "Choose distribution",
allowed = {
{ "generic", "generic" },
{ "debian-stable", "debian-stable" },
{ "ubuntu-intrepid", "ubuntu-intrepid" },
{ "gcc44-generic", "gcc44-generic" },
{ "gcc45-generic", "gcc45-generic" },
{ "gcc46-generic", "gcc46-generic" },
{ "gcc47-generic", "gcc47-generic" },
},
}
newoption {
trigger = "target",
description = "Building target",
@ -491,6 +505,17 @@ configuration { "linux-*" }
"X11",
"Xinerama",
}
defines
{
"DISTRO=" .. _OPTIONS["distro"] ,
}
if _OPTIONS["distro"]=="debian-stable" then
defines
{
"NO_AFFINITY_NP",
}
end
configuration { "osx*" }

View File

@ -148,6 +148,28 @@ function toolchain(_buildDir)
end
if "linux-gcc" == _OPTIONS["gcc"] then
-- Force gcc-4.2 on ubuntu-intrepid
if _OPTIONS["distro"]=="ubuntu-intrepid" then
premake.gcc.cc = "@gcc -V 4.2"
premake.gcc.cxx = "@g++-4.2"
end
if _OPTIONS["distro"]=="gcc44-generic" then
premake.gcc.cc = "@gcc-4.4"
premake.gcc.cxx = "@g++-4.4"
end
if _OPTIONS["distro"]=="gcc45-generic" then
premake.gcc.cc = "@gcc-4.5"
premake.gcc.cxx = "@g++-4.5"
end
if _OPTIONS["distro"]=="gcc46-generic" then
premake.gcc.cc = "@gcc-4.6"
premake.gcc.cxx = "@g++-4.6"
end
if _OPTIONS["distro"]=="gcc47-generic" then
premake.gcc.cc = "@gcc-4.7"
premake.gcc.cxx = "@g++-4.7"
end
premake.gcc.ar = "ar"
location (_buildDir .. "projects/" .. _ACTION .. "-linux")
end