~ubuntu-branches/ubuntu/quantal/mupen64plus/quantal

« back to all changes in this revision

Viewing changes to .pc/xdg-basedir.patch/pre.mk

  • Committer: Bazaar Package Importer
  • Author(s): Sven Eckelmann, Sven Eckelmann, Piotr Ożarowski
  • Date: 2010-05-06 11:34:46 UTC
  • mfrom: (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100506113446-jfcd6uk7waudel82
Tags: 1.5+dfsg1-10
[ Sven Eckelmann ]
* debian/patches:
  - Add rsp_ucode2_reset.patch, Reset status of specific ucode2 hacks after
    starting again
  - Add rsp_hle_bigendian.patch, Fix wrong high level emulation of rsp on big
    endian systems
  - Add rice-crash-vendorstring.patch, Don't crash on long OpenGL vendor
    string (Closes: #580480, LP: #575968)

[ Piotr Ożarowski ]
* DMUA flag set to yes

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
2
# *   Mupen64plus - pre.mk                                                  *
 
3
# *   Mupen64Plus homepage: http://code.google.com/p/mupen64plus/           *
 
4
# *   Copyright (C) 2007-2008 DarkJeztr Tillin9 Richard42                   *
 
5
# *                                                                         *
 
6
# *   This program is free software; you can redistribute it and/or modify  *
 
7
# *   it under the terms of the GNU General Public License as published by  *
 
8
# *   the Free Software Foundation; either version 2 of the License, or     *
 
9
# *   (at your option) any later version.                                   *
 
10
# *                                                                         *
 
11
# *   This program is distributed in the hope that it will be useful,       *
 
12
# *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
13
# *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
14
# *   GNU General Public License for more details.                          *
 
15
# *                                                                         *
 
16
# *   You should have received a copy of the GNU General Public License     *
 
17
# *   along with this program; if not, write to the                         *
 
18
# *   Free Software Foundation, Inc.,                                       *
 
19
# *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.          *
 
20
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
21
 
 
22
# detect system architecture: i386, x86_64, or PPC/PPC64
 
23
UNAME = $(shell uname -m)
 
24
ifeq ("$(UNAME)","x86_64")
 
25
  CPU = X86
 
26
  ifeq ("$(BITS)", "32")
 
27
    ARCH = 64BITS_32
 
28
  else
 
29
    ARCH = 64BITS
 
30
  endif
 
31
endif
 
32
ifneq ("$(filter i%86,$(UNAME))","")
 
33
  CPU = X86
 
34
  ARCH = 32BITS
 
35
endif
 
36
ifeq ("$(UNAME)","ppc")
 
37
  CPU = PPC
 
38
  ARCH = 32BITS
 
39
  NO_ASM = 1
 
40
endif
 
41
ifeq ("$(UNAME)","ppc64")
 
42
  CPU = PPC
 
43
  ARCH = 64BITS
 
44
  NO_ASM = 1
 
45
endif
 
46
 
 
47
# detect operation system. Currently just linux and OSX.
 
48
UNAME = $(shell uname -s)
 
49
ifeq ("$(UNAME)","Linux")
 
50
  OS = LINUX
 
51
endif
 
52
ifeq ("$(UNAME)","linux")
 
53
  OS = LINUX
 
54
endif
 
55
ifeq ("$(UNAME)","Darwin")
 
56
  OS = OSX
 
57
  LDFLAGS += -liconv -lpng
 
58
endif
 
59
 
 
60
ifeq ($(OS),)
 
61
   $(warning OS not supported or detected, using default linux options.)
 
62
   OS = LINUX
 
63
endif
 
64
 
 
65
# test for presence of SDL
 
66
ifeq ($(shell which sdl-config 2>/dev/null),)
 
67
  $(error No SDL development libraries found!)
 
68
endif
 
69
SDL_FLAGS       = $(shell sdl-config --cflags)
 
70
SDL_LIBS        = $(shell sdl-config --libs)
 
71
 
 
72
# test for presence of FreeType
 
73
ifeq ($(shell which freetype-config 2>/dev/null),)
 
74
   $(error freetype-config not installed!)
 
75
endif
 
76
FREETYPE_LIBS   = $(shell freetype-config --libs)
 
77
FREETYPE_FLAGS  = $(shell freetype-config --cflags)
 
78
 
 
79
# set Freetype flags
 
80
FREETYPEINC = $(shell pkg-config --cflags freetype2)
 
81
CFLAGS += $(FREETYPEINC)
 
82
 
 
83
# detect GUI options
 
84
ifeq ($(GUI),)
 
85
  GUI = GTK2
 
86
endif
 
87
 
 
88
# set GTK2 flags and libraries
 
89
# ideally we don't always do this, only when using the Gtk GUI,
 
90
# but too many plugins require it...
 
91
 
 
92
# test for presence of GTK 2.0
 
93
ifeq ($(shell which pkg-config 2>/dev/null),)
 
94
  $(error pkg-config not installed!)
 
95
endif
 
96
ifneq ("$(shell pkg-config gtk+-2.0 --modversion | head -c 2)", "2.")
 
97
  $(error No GTK 2.x development libraries found!)
 
98
endif
 
99
# set GTK flags and libraries
 
100
GTK_FLAGS       = $(shell pkg-config gtk+-2.0 --cflags)
 
101
GTK_LIBS        = $(shell pkg-config gtk+-2.0 --libs)
 
102
GTHREAD_LIBS    = $(shell pkg-config gthread-2.0 --libs)
 
103
 
 
104
# set Qt flags and libraries
 
105
# some distros append -qt4 to the binaries so look for those first
 
106
ifeq ($(GUI), QT4)
 
107
   ifneq ($(USES_QT4),)
 
108
    QMAKE       = ${shell which qmake-qt4 2>/dev/null}
 
109
    ifeq ($(QMAKE),)
 
110
      QMAKE = ${shell which qmake 2>/dev/null}
 
111
    endif
 
112
    ifeq ($(QMAKE),)
 
113
      $(error qmake from Qt not found! Make sure the Qt binaries are in your PATH)
 
114
    endif
 
115
    MOC = $(shell which moc-qt4 2>/dev/null)
 
116
    ifeq ($(MOC),)
 
117
      MOC = $(shell which moc 2>/dev/null)
 
118
    endif
 
119
    ifeq ($(MOC),)
 
120
      $(error moc from Qt not found! Make sure the Qt binaries are in your PATH)
 
121
    endif
 
122
    UIC         = $(shell which uic-qt4 2>/dev/null)
 
123
    ifeq ($(UIC),)
 
124
      UIC = $(shell which uic 2>/dev/null)
 
125
    endif
 
126
    ifeq ($(UIC),)
 
127
      $(error uic from Qt not found! Make sure the Qt binaries are in your PATH)
 
128
    endif
 
129
    RCC         = $(shell which rcc-qt4 2>/dev/null)
 
130
    ifeq ($(RCC),)
 
131
      RCC = $(shell which rcc 2>/dev/null)
 
132
    endif
 
133
    ifeq ($(RCC),)
 
134
      $(error rcc from Qt not found! Make sure the Qt binaries are in your PATH)
 
135
    endif
 
136
    LRELEASE    = $(shell which lrelease-qt4 2>/dev/null)
 
137
    ifeq ($(LRELEASE),)
 
138
      LRELEASE = $(shell which lrelease 2>/dev/null)
 
139
    endif
 
140
    ifeq ($(LRELEASE),)
 
141
      $(error lrelease from Qt not found! Make sure the Qt binaries are in your PATH)
 
142
    endif
 
143
    QT_FLAGS    = $(shell pkg-config QtCore QtGui --cflags)
 
144
    QT_LIBS     = $(shell pkg-config QtCore QtGui --libs)
 
145
    # define Gtk flags when using Qt4 gui so it can load plugins, etc.
 
146
  endif
 
147
endif
 
148
 
 
149
# set base program pointers and flags
 
150
CC      = gcc
 
151
CXX     = g++
 
152
LD      = g++
 
153
ifeq ($(OS),LINUX)
 
154
STRIP   = strip -s
 
155
endif
 
156
ifeq ($(OS),OSX)
 
157
STRIP   = strip -x 
 
158
endif
 
159
RM      = rm
 
160
RM_F    = rm -f
 
161
MV      = mv
 
162
CP      = cp
 
163
MD      = mkdir
 
164
FIND    = find
 
165
PROF    = gprof
 
166
INSTALL = ginstall
 
167
 
 
168
# create SVN version defines
 
169
MUPEN_RELEASE = 1.5
 
170
 
 
171
ifneq ($(RELEASE),)
 
172
  MUPEN_VERSION = $(VER)
 
173
  PLUGIN_VERSION = $(VER)
 
174
else 
 
175
  ifeq ($(shell svn info ./ 2>/dev/null),)
 
176
    MUPEN_VERSION = $(MUPEN_RELEASE)-development
 
177
    PLUGIN_VERSION = $(MUPEN_RELEASE)-development
 
178
  else
 
179
    SVN_REVISION = $(shell svn info ./ 2>/dev/null | sed -n '/^Revision: /s/^Revision: //p')
 
180
    SVN_BRANCH = $(shell svn info ./ 2>/dev/null | sed -n '/^URL: /s/.*mupen64plus.//1p')
 
181
    SVN_DIFFHASH = $(shell svn diff ./ 2>/dev/null | md5sum | sed '/.*/s/ -//;/^d41d8cd98f00b204e9800998ecf8427e/d')
 
182
    MUPEN_VERSION = $(MUPEN_RELEASE)-$(SVN_BRANCH)-r$(SVN_REVISION) $(SVN_DIFFHASH)
 
183
    PLUGIN_VERSION = $(MUPEN_RELEASE)-$(SVN_BRANCH)-r$(SVN_REVISION)
 
184
  endif
 
185
endif
 
186
 
 
187
# set base CFLAGS and LDFLAGS
 
188
CFLAGS += -pipe -O3 -ffast-math -funroll-loops -fexpensive-optimizations -fno-strict-aliasing
 
189
CORE_LDFLAGS += -lz -lm -lpng -lfreetype -ldl
 
190
 
 
191
# set special flags per-system
 
192
ifeq ($(CPU), X86)
 
193
  ifeq ($(ARCH), 64BITS)
 
194
    CFLAGS += -march=athlon64
 
195
  else
 
196
    CFLAGS += -march=i686 -mtune=pentium-m -mmmx -msse
 
197
    ifneq ($(PROFILE), 1)
 
198
      CFLAGS += -fomit-frame-pointer
 
199
    endif
 
200
  endif
 
201
  # tweak flags for 32-bit build on 64-bit system
 
202
  ifeq ($(ARCH), 64BITS_32)
 
203
    CFLAGS += -m32
 
204
    LDFLAGS += -m32 -m elf_i386
 
205
  endif
 
206
endif
 
207
ifeq ($(CPU), PPC)
 
208
  CFLAGS += -mcpu=powerpc -D_BIG_ENDIAN
 
209
endif
 
210
 
 
211
# set CFLAGS, LIBS, and LDFLAGS for external dependencies
 
212
ifeq ($(OS),LINUX)
 
213
  PLUGIN_LDFLAGS        = -Wl,-Bsymbolic -shared
 
214
endif
 
215
ifeq ($(OS),OSX)
 
216
  PLUGIN_LDFLAGS        = -bundle
 
217
endif
 
218
 
 
219
ifeq ($(OS),LINUX)
 
220
  LIBGL_LIBS    = -L/usr/X11R6/lib -lGL -lGLU
 
221
endif
 
222
ifeq ($(OS),OSX)
 
223
  LIBGL_LIBS    = -framework OpenGL
 
224
endif
 
225
 
 
226
# set flags for compile options.
 
227
 
 
228
# set CFLAGS macro for no assembly language if required
 
229
ifeq ($(NO_ASM), 1)
 
230
  CFLAGS += -DNO_ASM
 
231
endif
 
232
 
 
233
# set variables for profiling
 
234
ifeq ($(PROFILE), 1)
 
235
  CFLAGS += -pg -g
 
236
  LDFLAGS += -pg
 
237
  STRIP = true
 
238
else   # set variables for debugging symbols
 
239
  ifeq ($(DBGSYM), 1)
 
240
    CFLAGS += -g
 
241
    STRIP = true
 
242
  endif
 
243
endif
 
244
 
 
245
SO_EXTENSION = so
 
246