Makefile.opts.in 5.71 KB
Newer Older
Sam Hocevar's avatar
 
Sam Hocevar committed
1 2 3 4 5 6 7 8 9
###############################################################################
# vlc (VideoLAN Client) options Makefile
# (c)1998 VideoLAN
###############################################################################

###############################################################################
# Configuration
###############################################################################

Sam Hocevar's avatar
 
Sam Hocevar committed
10 11 12 13 14 15
# 
# Plugins to build
# WARNING: if you do not have a dynamic loader on your platform, remove
# the plugins in this line and put them as built-ins, otherwise your
# application won't be able to load them.
# 
Sam Hocevar's avatar
 
Sam Hocevar committed
16
PLUGINS :=@PLUGINS@
Sam Hocevar's avatar
 
Sam Hocevar committed
17 18 19 20 21

# 
# Built-in modules to build
# WARNING: do NOT put gtk and gnome together in this rule.
# 
Sam Hocevar's avatar
 
Sam Hocevar committed
22
BUILTINS :=@BUILTINS@
Sam Hocevar's avatar
 
Sam Hocevar committed
23

Sam Hocevar's avatar
 
Sam Hocevar committed
24 25 26
# 
# Additional build options
# 
Sam Hocevar's avatar
 
Sam Hocevar committed
27 28 29 30 31
SYS = @SYS@
ALIASES =@ALIASES@
INSTALL = @INSTALL@
ARCH = @ARCH@

Sam Hocevar's avatar
 
Sam Hocevar committed
32 33 34 35 36
#
# Compilation options
#
DEBUG = @DEBUG@
STATS = @STATS@
37
TRACE = @TRACE@
Sam Hocevar's avatar
 
Sam Hocevar committed
38
PROFILING = @PROFILING@
Sam Hocevar's avatar
 
Sam Hocevar committed
39 40 41
OPTIMS = @OPTIMS@
GETOPT = @GETOPT@

Sam Hocevar's avatar
 
Sam Hocevar committed
42 43 44 45
# 
# Build environment
# 
CC = @CC@
Sam Hocevar's avatar
 
Sam Hocevar committed
46
CFLAGS = @CFLAGS@
Sam Hocevar's avatar
 
Sam Hocevar committed
47
SHELL = @SHELL@
Sam Hocevar's avatar
 
Sam Hocevar committed
48
RANLIB = @RANLIB@
Sam Hocevar's avatar
 
Sam Hocevar committed
49
MOC = @MOC@
Sam Hocevar's avatar
 
Sam Hocevar committed
50 51 52 53 54 55 56 57 58

# 
# Installation environment
# 
exec_prefix = @exec_prefix@
prefix = @prefix@
bindir = @bindir@
datadir = @datadir@
libdir = @libdir@
Sam Hocevar's avatar
 
Sam Hocevar committed
59
includedir = @includedir@
Sam Hocevar's avatar
 
Sam Hocevar committed
60

Sam Hocevar's avatar
 
Sam Hocevar committed
61 62 63 64 65 66
#
# Libraries for special cases
#
LIB_ALSA = @LIB_ALSA@
LIB_BEOS = @LIB_BEOS@
LIB_DARWIN = @LIB_DARWIN@
Sam Hocevar's avatar
 
Sam Hocevar committed
67
LIB_DVD = @LIB_DVD@
Sam Hocevar's avatar
 
Sam Hocevar committed
68 69 70 71 72 73 74 75 76 77 78
LIB_ESD = @LIB_ESD@
LIB_GGI = @LIB_GGI@
LIB_GLIDE = @LIB_GLIDE@
LIB_GNOME = @LIB_GNOME@
LIB_GTK = @LIB_GTK@
LIB_IDCTALTIVEC = @LIB_IDCTALTIVEC@
LIB_MACOSX = @LIB_MACOSX@
LIB_NCURSES = @LIB_NCURSES@
LIB_QT = @LIB_QT@
LIB_TS = @LIB_TS@
LIB_SDL = @LIB_SDL@
Sam Hocevar's avatar
 
Sam Hocevar committed
79
LIB_DIRECTX = @LIB_DIRECTX@
Sam Hocevar's avatar
 
Sam Hocevar committed
80 81 82
LIB_X11 = @LIB_X11@
LIB_XVIDEO = @LIB_XVIDEO@
LIB_YUV = @LIB_YUV@
Sam Hocevar's avatar
 
Sam Hocevar committed
83

Sam Hocevar's avatar
 
Sam Hocevar committed
84 85 86
#
# CFLAGS for special cases
#
Sam Hocevar's avatar
 
Sam Hocevar committed
87
CFLAGS_DVD = @CFLAGS_DVD@
Sam Hocevar's avatar
 
Sam Hocevar committed
88
CFLAGS_GTK = @CFLAGS_GTK@
Sam Hocevar's avatar
 
Sam Hocevar committed
89
CFLAGS_SDL = @CFLAGS_SDL@
Sam Hocevar's avatar
 
Sam Hocevar committed
90 91
CFLAGS_X11 = @CFLAGS_X11@

Sam Hocevar's avatar
 
Sam Hocevar committed
92 93 94 95 96
#
# Other special cases
#
LOCAL_LIBDVDCSS = @LOCAL_LIBDVDCSS@

Sam Hocevar's avatar
 
Sam Hocevar committed
97 98 99 100 101 102 103 104 105 106
###############################################################################
# Configuration pre-processing
###############################################################################

# PROGRAM_OPTIONS is an identification string of the compilation options
PROGRAM_OPTIONS = $(SYS) $(ARCH)
ifeq ($(DEBUG),1)
PROGRAM_OPTIONS += DEBUG
DEFINE += -DDEBUG
endif
107 108 109 110
ifeq ($(TRACE),1)
PROGRAM_OPTIONS += TRACE
DEFINE += -DTRACE
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
111 112 113 114
ifeq ($(PROFILING),1)
PROGRAM_OPTIONS += PROFILING
DEFINE += -DPROFILING
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
115
ifeq ($(STATS),1)
116
PROGRAM_OPTIONS += STATS
Sam Hocevar's avatar
 
Sam Hocevar committed
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
DEFINE += -DSTATS
endif

# PROGRAM_BUILD is a complete identification of the build
# (we can't use fancy options with date since OSes like Solaris
# or FreeBSD have strange date implementations)
ifeq ($(SYS),beos)
# XXX: beos does not support hostname (how lame...)
PROGRAM_BUILD = `date` $(USER)
else
PROGRAM_BUILD = `date` $(USER)@`hostname`
endif

# PROGRAM_VERSION is the current vlc version
PROGRAM_VERSION=@VLC_VERSION@
Sam Hocevar's avatar
 
Sam Hocevar committed
132
LIBDVDCSS_VERSION=@LIBDVDCSS_VERSION@
Sam Hocevar's avatar
 
Sam Hocevar committed
133 134 135

# DEFINE will contain some of the constants definitions decided in Makefile, 
# including SYS_xx. It will be passed to C compiler.
Sam Hocevar's avatar
 
Sam Hocevar committed
136 137
DEFINE_CONSTANTS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
DEFINE += $(DEFINE_CONSTANTS)
Sam Hocevar's avatar
 
Sam Hocevar committed
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154

# On Linux activate 64-bit off_t (by default under BSD)
ifneq (,$(findstring linux,$(SYS)))
DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
endif

###############################################################################
# Tuning and other variables - do not change anything except if you know
# exactly what you are doing
###############################################################################

#
# C headers directories
#
INCLUDE += @INCLUDE@
INCLUDE += -Iinclude -Iextras -I/usr/local/include

Sam Hocevar's avatar
 
Sam Hocevar committed
155 156 157 158 159 160 161 162
#
# Libraries needed by built-in modules
#
ifneq (,$(BUILTINS))
LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
LIB += $(LIB_BUILTINS)
endif

Sam Hocevar's avatar
 
Sam Hocevar committed
163 164 165
#
# Libraries
#
Sam Hocevar's avatar
 
Sam Hocevar committed
166 167 168 169 170
ifeq (1,$(LOCAL_LIBDVDCSS))
ifneq (,$(findstring dvd,$(BUILTINS)))
LIB += lib/libdvdcss.a
endif
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
171

Sam Hocevar's avatar
 
Sam Hocevar committed
172
ifneq (,$(findstring mingw32,$(SYS)))
Sam Hocevar's avatar
 
Sam Hocevar committed
173
LIB += -lws2_32 -lnetapi32
Sam Hocevar's avatar
 
Sam Hocevar committed
174 175
endif

Sam Hocevar's avatar
 
Sam Hocevar committed
176
LIB += -L/usr/local/lib @LIB@
Sam Hocevar's avatar
 
Sam Hocevar committed
177 178 179 180

#
# C compiler flags: mainstream compilation
#
Sam Hocevar's avatar
 
Sam Hocevar committed
181
DEFINE += @DEFINE@
Sam Hocevar's avatar
 
Sam Hocevar committed
182 183 184 185 186 187 188 189 190 191 192 193 194 195
CFLAGS += $(DEFINE) $(INCLUDE)
CFLAGS += -Wall -Winline
CFLAGS += -D_REENTRANT
CFLAGS += -D_GNU_SOURCE

# flags needed for clean beos compilation
ifeq ($(SYS),beos)
CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
endif

ifneq (,$(findstring darwin,$(SYS)))
CFLAGS += -traditional-cpp
endif

Sam Hocevar's avatar
 
Sam Hocevar committed
196
ifneq (,$(findstring mingw32,$(SYS)))
Sam Hocevar's avatar
 
Sam Hocevar committed
197 198 199
CFLAGS += -fnative-struct
endif

Sam Hocevar's avatar
 
Sam Hocevar committed
200 201 202 203
# Optimizations : don't compile debug versions with them
ifeq ($(OPTIMS),1)
CFLAGS += -O3
CFLAGS += -ffast-math -funroll-loops
204
ifneq ($(DEBUG),1)
Sam Hocevar's avatar
 
Sam Hocevar committed
205
ifneq ($(PROFILING),1)
Sam Hocevar's avatar
 
Sam Hocevar committed
206
CFLAGS += -fomit-frame-pointer
207
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
208
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244

# Optimizations for x86 familiy
ifneq (,$(findstring 86,$(ARCH)))
# Optional Pentium Pro optimizations
ifneq (,$(findstring ppro,$(ARCH)))
CFLAGS += -march=pentiumpro -mcpu=pentiumpro
else
CFLAGS += -march=pentium -mcpu=pentium
endif
endif

# Optimizations for PowerPC
ifneq (,$(findstring powerpc,$(ARCH)))
CFLAGS += -mmultiple -mhard-float -mstring
endif

# Optimizations for Sparc
ifneq (,$(findstring sparc,$(ARCH)))
CFLAGS += -mhard-float
endif

#end of optimisations
endif

#
# C compiler flags: dependancies
#
DCFLAGS += $(INCLUDE)
DCFLAGS += -MM

#
# C compiler flags: linking
#
LCFLAGS += @LCFLAGS@ $(LIB)
LCFLAGS += -Wall
#LCFLAGS += -s
Sam Hocevar's avatar
 
Sam Hocevar committed
245
ifneq (,$(findstring mingw32,$(SYS)))
Gildas Bazin's avatar
 
Gildas Bazin committed
246
LCFLAGS += -mwindows -Xlinker --force-exe-suffix
Sam Hocevar's avatar
 
Sam Hocevar committed
247
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
248

Sam Hocevar's avatar
 
Sam Hocevar committed
249 250 251 252
#
# C compiler flags: plugin compilation
#
ifneq (,$(findstring mingw32,$(SYS)))
Sam Hocevar's avatar
 
Sam Hocevar committed
253
PCFLAGS += -fnative-struct
Sam Hocevar's avatar
 
Sam Hocevar committed
254 255 256 257 258 259 260 261 262
else
PCFLAGS += -fPIC
endif

#
# C compiler flags: plugin linking
#
PLCFLAGS += @PLCFLAGS@

Sam Hocevar's avatar
 
Sam Hocevar committed
263
#
264
# Debugging and profiling support
Sam Hocevar's avatar
 
Sam Hocevar committed
265
#
266
ifeq ($(DEBUG),1)
Sam Hocevar's avatar
 
Sam Hocevar committed
267 268 269
CFLAGS += -g
endif

Sam Hocevar's avatar
 
Sam Hocevar committed
270 271 272 273
ifeq ($(PROFILING),1)
CFLAGS += -pg
endif