Makefile.opts.in 5.11 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 39 40
OPTIMS = @OPTIMS@
GETOPT = @GETOPT@

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

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

Sam Hocevar's avatar
 
Sam Hocevar committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
#
# Libraries for special cases
#
LIB_ALSA = @LIB_ALSA@
LIB_BEOS = @LIB_BEOS@
LIB_DARWIN = @LIB_DARWIN@
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@
LIB_X11 = @LIB_X11@
LIB_XVIDEO = @LIB_XVIDEO@
LIB_YUV = @LIB_YUV@
Sam Hocevar's avatar
 
Sam Hocevar committed
79

Sam Hocevar's avatar
 
Sam Hocevar committed
80 81 82 83 84 85
#
# CFLAGS for special cases
#
CFLAGS_GTK = @CFLAGS_GTK@
CFLAGS_X11 = @CFLAGS_X11@

Sam Hocevar's avatar
 
Sam Hocevar committed
86 87 88 89 90 91 92 93 94 95
###############################################################################
# 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
96 97 98 99
ifeq ($(TRACE),1)
PROGRAM_OPTIONS += TRACE
DEFINE += -DTRACE
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
100
ifeq ($(STATS),1)
101
PROGRAM_OPTIONS += STATS
Sam Hocevar's avatar
 
Sam Hocevar committed
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
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@

# 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
120
DEFINE += -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
Sam Hocevar's avatar
 
Sam Hocevar committed
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140

# 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

#
# Libraries
#
Sam Hocevar's avatar
 
Sam Hocevar committed
141
LIB += @LIB@ -L/usr/local/lib
Sam Hocevar's avatar
 
Sam Hocevar committed
142

Sam Hocevar's avatar
 
Sam Hocevar committed
143 144 145 146
ifneq (,$(findstring mingw32,$(SYS)))
LIB += -lws2_32
endif

Sam Hocevar's avatar
 
Sam Hocevar committed
147 148 149
#
# Libraries needed by built-in modules
#
Sam Hocevar's avatar
 
Sam Hocevar committed
150
ifneq (,$(BUILTINS))
Sam Hocevar's avatar
 
Sam Hocevar committed
151
LIB += $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
Sam Hocevar's avatar
 
Sam Hocevar committed
152
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
153 154 155 156

#
# C compiler flags: mainstream compilation
#
Sam Hocevar's avatar
 
Sam Hocevar committed
157
DEFINE += @DEFINE@
Sam Hocevar's avatar
 
Sam Hocevar committed
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
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

# Optimizations : don't compile debug versions with them
ifeq ($(OPTIMS),1)
CFLAGS += -O3
CFLAGS += -ffast-math -funroll-loops
176
ifneq ($(DEBUG),1)
Sam Hocevar's avatar
 
Sam Hocevar committed
177
CFLAGS += -fomit-frame-pointer
178
endif
Sam Hocevar's avatar
 
Sam Hocevar committed
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 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

# 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

# Optional MMX optimizations for x86
ifneq (,$(findstring mmx,$(ARCH)))
CFLAGS += -DHAVE_MMX
endif

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

#
# C compiler flags: linking
#
LCFLAGS += @LCFLAGS@ $(LIB)
LCFLAGS += -Wall
#LCFLAGS += -s

ifeq ($(SYS),beos)
LCFLAGS += -Xlinker -soname=_APP_
else
ifneq (,$(findstring qnx,$(SYS)))
LCFLAGS += -Xlinker -export-dynamic
else
ifneq (,$(findstring darwin,$(SYS)))
LCFLAGS += -dyn
else
LCFLAGS += --export-dynamic
endif
endif
endif

#
236
# Debugging and profiling support
Sam Hocevar's avatar
 
Sam Hocevar committed
237
#
238
ifeq ($(DEBUG),1)
Sam Hocevar's avatar
 
Sam Hocevar committed
239 240 241
CFLAGS += -g
endif