]> git.sesse.net Git - vlc/blobdiff - Makefile.opts.in
* ./src/interface/main.c: we no longer segfault if argc == 0.
[vlc] / Makefile.opts.in
index 7121e6db94e2d67565813c4d8ddfb394ae9efda2..52b1ec6e0000b3ff2b696318c4dcd9e92b61ad8f 100644 (file)
@@ -3,31 +3,55 @@
 # (c)1998 VideoLAN
 ###############################################################################
 
+HAVE_MAKEFILE_OPTS = 1
+
 ###############################################################################
 # Configuration
 ###############################################################################
 
-#
-# Compilation options
-#
-DEBUG = @DEBUG@
-STATS = @STATS@
-OPTIMS = @OPTIMS@
-GETOPT = @GETOPT@
+# 
+# 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.
+# 
+PLUGINS :=@PLUGINS@
 
-PLUGINS := @PLUGINS@
-BUILTINS := @BUILTINS@
+# 
+# Built-in modules to build
+# WARNING: do NOT put gtk and gnome together in this rule.
+# 
+BUILTINS :=@BUILTINS@
 
+# 
+# Additional build options
+# 
 SYS = @SYS@
 ALIASES =@ALIASES@
 INSTALL = @INSTALL@
 ARCH = @ARCH@
 
+#
+# Compilation options
+#
+DEBUG = @DEBUG@
+CPROF = @CPROF@
+GPROF = @GPROF@
+OPTIMS = @OPTIMS@
+TUNING = @TUNING@
+RELEASE = @RELEASE@
+
 # 
 # Build environment
 # 
 CC = @CC@
+CFLAGS = @CFLAGS@
 SHELL = @SHELL@
+RANLIB = @RANLIB@
+STRIP = @STRIP@
+MOC = @MOC@
+WINDRES = @WINDRES@
+BCBUILDER = @BCBUILDER@
 
 # 
 # Installation environment
@@ -37,27 +61,85 @@ prefix = @prefix@
 bindir = @bindir@
 datadir = @datadir@
 libdir = @libdir@
+includedir = @includedir@
+
+#
+# CFLAGS for special cases
+#
+vlc_CFLAGS = @vlc_CFLAGS@
+plugins_CFLAGS := @plugins_CFLAGS@
+builtins_CFLAGS := @builtins_CFLAGS@
+
+arts_CFLAGS = @arts_CFLAGS@
+dvd_CFLAGS = @dvd_CFLAGS@
+dvdread_CFLAGS = @dvdread_CFLAGS@
+directx_CFLAGS = @directx_CFLAGS@
+esd_CFLAGS = @esd_CFLAGS@
+ffmpeg_CFLAGS = @ffmpeg_CFLAGS@
+glide_CFLAGS = @glide_CFLAGS@
+gnome_CFLAGS = @gnome_CFLAGS@
+gtk_CFLAGS = @gtk_CFLAGS@
+kde_CFLAGS = @kde_CFLAGS@
+idctaltivec_CFLAGS = @idctaltivec_CFLAGS@
+macosx_CFLAGS = @macosx_CFLAGS@
+mad_CFLAGS = @mad_CFLAGS@
+memcpyaltivec_CFLAGS = @memcpyaltivec_CFLAGS@
+motionaltivec_CFLAGS = @motionaltivec_CFLAGS@
+qt_CFLAGS = @qt_CFLAGS@
+sdl_CFLAGS = @sdl_CFLAGS@
+x11_CFLAGS = @x11_CFLAGS@
+xvideo_CFLAGS = @xvideo_CFLAGS@
 
 #
 # 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@
+vlc_LDFLAGS = @vlc_LDFLAGS@
+plugins_LDFLAGS += @plugins_LDFLAGS@
+builtins_LDFLAGS += @builtins_LDFLAGS@
+
+a52_LDFLAGS = @a52_LDFLAGS@
+aa_LDFLAGS = @aa_LDFLAGS@
+alsa_LDFLAGS = @alsa_LDFLAGS@
+arts_LDFLAGS = @arts_LDFLAGS@
+beos_LDFLAGS = @beos_LDFLAGS@
+chroma_i420_rgb_LDFLAGS = @chroma_i420_rgb_LDFLAGS@
+directx_LDFLAGS = @directx_LDFLAGS@
+dsp_LDFLAGS = @dsp_LDFLAGS@
+dvd_LDFLAGS = @dvd_LDFLAGS@
+dvdread_LDFLAGS = @dvdread_LDFLAGS@
+esd_LDFLAGS = @esd_LDFLAGS@
+filter_distort_LDFLAGS = @filter_distort_LDFLAGS@
+ffmpeg_LDFLAGS = @ffmpeg_LDFLAGS@
+ggi_LDFLAGS = @ggi_LDFLAGS@
+glide_LDFLAGS = @glide_LDFLAGS@
+gnome_LDFLAGS = @gnome_LDFLAGS@
+gtk_LDFLAGS = @gtk_LDFLAGS@
+idctaltivec_LDFLAGS = @idctaltivec_LDFLAGS@
+imdct_LDFLAGS = @imdct_LDFLAGS@
+imdct3dn_LDFLAGS = @imdct3dn_LDFLAGS@
+imdctsse_LDFLAGS = @imdctsse_LDFLAGS@
+ipv4_LDFLAGS = @ipv4_LDFLAGS@
+kde_LDFLAGS = @kde_LDFLAGS@
+lirc_LDFLAGS = @lirc_LDFLAGS@
+macosx_LDFLAGS = @macosx_LDFLAGS@
+mad_LDFLAGS = @mad_LDFLAGS@
+memcpyaltivec_LDFLAGS = @memcpyaltivec_LDFLAGS@
+motionaltivec_LDFLAGS = @motionaltivec_LDFLAGS@
+ncurses_LDFLAGS = @ncurses_LDFLAGS@
+qnx_LDFLAGS = @qnx_LDFLAGS@
+qt_LDFLAGS = @qt_LDFLAGS@
+rc_LDFLAGS = @rc_LDFLAGS@
+sdl_LDFLAGS = @sdl_LDFLAGS@
+vcd_LDFLAGS = @vcd_LDFLAGS@
+vorbis_LDFLAGS = @vorbis_LDFLAGS@
+waveout_LDFLAGS = @waveout_LDFLAGS@
+x11_LDFLAGS = @x11_LDFLAGS@
+xvideo_LDFLAGS = @xvideo_LDFLAGS@
+
+#
+# Other special cases
+#
+NEED_GETOPT = @NEED_GETOPT@
 
 ###############################################################################
 # Configuration pre-processing
@@ -67,11 +149,15 @@ LIB_YUV = @LIB_YUV@
 PROGRAM_OPTIONS = $(SYS) $(ARCH)
 ifeq ($(DEBUG),1)
 PROGRAM_OPTIONS += DEBUG
-DEFINE += -DDEBUG
+CFLAGS += -DDEBUG
 endif
-ifeq ($(STATS),1)
-PROGRAM_OPTIONS += DEBUG
-DEFINE += -DSTATS
+ifeq ($(CPROF),1)
+PROGRAM_OPTIONS += CPROF
+CFLAGS += -DCPROF
+endif
+ifeq ($(GPROF),1)
+PROGRAM_OPTIONS += GPROF
+CFLAGS += -DGPROF
 endif
 
 # PROGRAM_BUILD is a complete identification of the build
@@ -84,17 +170,15 @@ else
 PROGRAM_BUILD = `date` $(USER)@`hostname`
 endif
 
-# PROGRAM_VERSION is the current vlc version
-PROGRAM_VERSION=@VLC_VERSION@
+# On Linux and Solaris, activate 64-bit off_t (by default under BSD)
+CFLAGS += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE
 
-# DEFINE will contain some of the constants definitions decided in Makefile, 
-# including SYS_xx. It will be passed to C compiler.
-DEFINE += -DSYS_$(shell echo $(SYS) | sed 's/-.*//' | tr '[a-z].' '[A-Z]_')
+# Gettext support
+CFLAGS += -DLOCALEDIR=\"$(datadir)/locale\"
 
-# 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
+# Data and plugin location
+CFLAGS += -DDATA_PATH=\"@prefix@/share/videolan\"
+CFLAGS += -DPLUGIN_PATH=\"@prefix@/lib/videolan/vlc\"
 
 ###############################################################################
 # Tuning and other variables - do not change anything except if you know
@@ -104,101 +188,91 @@ endif
 #
 # C headers directories
 #
-INCLUDE += @INCLUDE@
-INCLUDE += -Iinclude -Iextras -I/usr/local/include
-
-#
-# Libraries
-#
-LIB += @LIB@ -L/usr/local/lib
-
-#
-# Libraries needed by built-in modules
-#
-LIB += $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed 's/.*/$$LIB_&/' ; done)
+CFLAGS += -Iinclude -Iextras
 
 #
 # C compiler flags: mainstream compilation
 #
-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
+ifeq ($(RELEASE),1)
+CFLAGS += -DHAVE_RELEASE
 endif
 
 # Optimizations : don't compile debug versions with them
 ifeq ($(OPTIMS),1)
-CFLAGS += -O3
-CFLAGS += -ffast-math -funroll-loops
-CFLAGS += -fomit-frame-pointer
-
-# 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
+CFLAGS += @CFLAGS_OPTIM@
+ifneq ($(DEBUG),1)
+ifneq ($(GPROF),1)
+ifneq ($(CPROF),1)
+CFLAGS += @CFLAGS_OPTIM_NODEBUG@
+endif
 endif
 endif
 
-# Optimizations for PowerPC
 ifneq (,$(findstring powerpc,$(ARCH)))
-CFLAGS += -mmultiple -mhard-float -mstring
+# Optimizations for PowerPC
+CFLAGS += -mmultiple -mhard-float -mstring -mcpu=powerpc
+ifneq (,$(TUNING))
+CFLAGS += -mtune=$(TUNING)
 endif
-
-# Optimizations for Sparc
+else
 ifneq (,$(findstring sparc,$(ARCH)))
+# Optimizations for Sparc
 CFLAGS += -mhard-float
+ifneq (,$(TUNING))
+CFLAGS += -mcpu=$(TUNING)
+endif
+else
+# Generic optimizations
+ifneq (,$(TUNING))
+CFLAGS += -mcpu=$(TUNING)
+endif
+endif
 endif
 
 #end of optimisations
 endif
 
-# Optional MMX optimizations for x86
-ifneq (,$(findstring mmx,$(ARCH)))
-CFLAGS += -DHAVE_MMX
+#
+# C compiler flags: linking
+#
+LDFLAGS += @LDFLAGS@
+LDFLAGS += -Wall
+ifneq ($(DEBUG),1)
+ifneq ($(GPROF),1)
+ifneq ($(CPROF),1)
+#LDFLAGS += -s
+endif
+endif
 endif
 
 #
-# C compiler flags: dependancies
+# C compiler flags: plugins and builtins compilation
 #
-DCFLAGS += $(INCLUDE)
-DCFLAGS += -MM
+vlc_CFLAGS += -D__VLC__
+plugins_CFLAGS += -D__PLUGIN__ -I../../include -I../../extras
+builtins_CFLAGS += -D__BUILTIN__ -I../../include -I../../extras
 
 #
-# C compiler flags: linking
+# Linker flags: plugins and builtins 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
+builtins_LDFLAGS += $(patsubst %,$$%_LDFLAGS,$(BUILTINS))
 
 #
-# Debugging and profiling support (unless optimisations are active)
+# Debugging and profiling support
 #
-ifneq ($(OPTIMS),1)
+ifeq ($(DEBUG),1)
 CFLAGS += -g
 endif
 
+ifeq ($(CPROF),1)
+CFLAGS += -finstrument-functions
+endif
+
+ifeq ($(GPROF),1)
+CFLAGS += -pg
+endif
+
+