-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathconfig.mk
113 lines (106 loc) · 2.96 KB
/
config.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
# This Makefile fragment sets the following make variables according to the
# current platform:
# ARCH - the Mozilla architecture name, such as x86, x86_64, etc
# FLAG32BIT - 32 or 64
# MARCH - the Mac architecture, such as i386
# OS - linux, mac, or sun
# CFLAGS - appropriate C compiler flags for this platform
# CXXFLAGS - appropriate C++ compiler flags for this platform
# Also, various stanard make variables are overridden if necessary, such as AR
#
# If ARCH is already set, that is used instead of uname -m to get the
# architecture to build. This can be used to build a 32-bit plugin on a 64-bit
# platform, for example: make ARCH=x86
ARCH ?= $(shell uname -m)
# default is 32 bits
FLAG32BIT=32
# Figure out 64-bit platforms, canonicalize ARCH and MARCH
ifeq ($(ARCH),x86_64)
FLAG32BIT=64
endif
ifeq ($(ARCH),sparc)
FLAG32BIT=64
endif
ifeq ($(ARCH),alpha)
FLAG32BIT=64
endif
ifeq ($(ARCH),ia64)
FLAG32BIT=64
endif
ifeq ($(ARCH),athlon)
ARCH=x86
endif
ifeq ($(ARCH),i386)
ARCH=x86
endif
ifeq ($(ARCH),i486)
ARCH=x86
endif
ifeq ($(ARCH),i586)
ARCH=x86
endif
ifeq ($(ARCH),i686)
ARCH=x86
endif
ifeq ($(ARCH),i86pc)
ARCH=x86
endif
ifeq ($(ARCH),Macintosh)
$(error ppc no longer supported)
endif
MARCH=$(ARCH)
ifeq ($(ARCH),x86)
MARCH=i386
endif
# Default to Debug off
DEBUG ?=
ifeq ($(DEBUG),TRUE)
DEBUGCFLAGS= -g
else
DEBUGCFLAGS=
endif
# Set OS as well as CFLAGS, CXX, and other common make variables
ifeq ($(shell uname),Linux)
OS=linux
BASECFLAGS= $(DEBUGCFLAGS) -O2 -fPIC $(INC) -rdynamic -std=c++0x
ARCHCFLAGS= -m$(FLAG32BIT)
ALLARCHCFLAGS= -m$(FLAG32BIT)
#CXX=clang # for better build error messages
endif
ifeq ($(shell uname),Darwin)
OS=mac
BASECFLAGS= $(DEBUGCFLAGS) -O2 -fPIC $(INC) -D__mac -std=c++11 -mmacosx-version-min=10.5 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/
ARCHCFLAGS=-arch $(MARCH)
ALLARCHCFLAGS=-arch i386 -arch x86_64
AR=libtool
ARFLAGS=-static -o
endif
ifeq ($(shell uname),SunOS)
OS=sun
ifeq ($(DEBUG),TRUE)
DEBUGCFLAGS= -g0
endif
#CFLAGS=-fast -g0 -Kpic $(INC) -Bdynamic -noex
# SunC appears to miscompile Socket::writeByte by not incrementing the
# buffer pointer, so no optimization for now
#CFLAGS=-g -Kpic $(INC) -Bdynamic -noex
BASECFLAGS= $(DEBUGCFLAGS) -Kpic -noex -xO1 -xlibmil -xlibmopt -features=tmplife -xbuiltin=%all -mt $(INC)
ARCHCFLAGS=
ALLARCHCFLAGS=
CXX= CC
endif
CFLAGS=$(BASECFLAGS) $(ARCHCFLAGS)
CXXFLAGS = $(CFLAGS)