################################################################################
# Environment
-#CC = gcc
-#SHELL = /bin/sh
+#CC=gcc
+#SHELL=/bin/sh
# Video output settings
VIDEO=X11
#ARCH=PPC
#ARCH=SPARC
+# Target operating system
+SYS=LINUX
+#SYS=BSD
+#SYS=BEOS
+
# Decoder choice - ?? old decoder will be removed soon
DECODER=old
#DECODER=new
-# !!! don't forget to run this command after changing decoder type !!!
-# touch input/input.c input/input_ctrl.c include/vlc.h include/video_decoder.h
+
+# Debugging mode on or off
+DEBUG=1
#----------------- do not change anything below this line ----------------------
# Configuration pre-processing
################################################################################
-# DEFINE will contain all the constants definitions decided in Makefile
-DEFINE = -DVIDEO_$(VIDEO)
+# Program version - may only be changed by the project leader
+PROGRAM_VERSION = 1.0-dev
+
+# PROGRAM_OPTIONS is an identification string of the compilation options
+PROGRAM_OPTIONS = $(VIDEO) $(ARCH) $(SYS)
+ifneq ($(DEBUG),)
+PROGRAM_OPTIONS += DEBUG
+endif
+
+# PROGRAM_BUILD is a complete identification of the build
+PROGRAM_BUILD = `date -R` $(USER)@`hostname`
+
+# DEFINE will contain some of the constants definitions decided in Makefile,
+# including VIDEO_xx and ARCH_xx. It will be passed to C compiler.
+DEFINE += -DVIDEO_$(VIDEO)
+DEFINE += -DARCH_$(ARCH)
+DEFINE += -DSYS_$(SYS)
+DEFINE += -DPROGRAM_VERSION="\"$(PROGRAM_VERSION)\""
+DEFINE += -DPROGRAM_OPTIONS="\"$(PROGRAM_OPTIONS)\""
+DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\""
+ifneq ($(DEBUG),)
+DEFINE += -DDEBUG
+endif
# video is a lowercase version of VIDEO used for filenames
video = $(shell echo $(VIDEO) | tr 'A-Z' 'a-z')
################################################################################
-# Tunning and other variables
+# Tunning and other variables - do not change anything except if you know
+# exactly what you are doing
################################################################################
-#
-# Transformation for video decompression (Fourier or cosine)
-#
-TRANSFORM=vdec_idct
-#TRANSFORM=vdec_idft
-
#
# C headers directories
#
LIB += -lggi
endif
-# System dependant libraries
-#??LIB += -lXxf86dga
-
#
# C compiler flags: compilation
#
CCFLAGS += -D_GNU_SOURCE
# Optimizations : don't compile debug versions with them
-CCFLAGS += -g
CCFLAGS += -O6
CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
CCFLAGS += -fomit-frame-pointer
#
# Additionnal debugging flags
#
-# Debugging settings: electric fence, debuging symbols and profiling support.
-# Note that electric fence and accurate profiling are quite uncompatible.
-#CCFLAGS += -g
-#CCFLAGS += -pg
-#LCFLAGS += -g
-#LCFLAGS += -pg
-#LIB += -ldmalloc
-#LIB += -lefence
+
+# Debugging support
+ifneq ($(DEBUG),)
+CFLAGS += -g
+#CFLAGS += -pg
+endif
#################################################################################
# Objects and files
#################################################################################
#
-# Objects
+# C Objects
#
interface_obj = interface/main.o \
interface/interface.o \
video_decoder_obj = video_decoder/video_decoder.o \
video_decoder/vdec_motion.o \
- video_decoder/$(TRANSFORM).o
+ video_decoder/vdec_idct.o
endif
misc_obj = misc/mtime.o \
misc/rsc_files.o \
misc/netutils.o
-ifeq ($(ARCH),MMX)
-ifeq ($(DECODER),old)
-ASM_OBJ = video_decoder_ref/idctmmx.o \
- video_output/video_yuv_mmx.o
-else
-ASM_OBJ = video_decoder/idctmmx.o \
- video_output/video_yuv_mmx.o
-endif
-
-endif
-
C_OBJ = $(interface_obj) \
$(input_obj) \
$(audio_output_obj) \
$(vlan_obj) \
$(misc_obj)
+#
+# Assembler Objects
+#
+ifeq ($(ARCH),MMX)
+ifeq ($(DECODER),old)
+ASM_OBJ = video_decoder_ref/idctmmx.o \
+ video_output/video_yuv_mmx.o
+else
+ASM_OBJ = video_decoder/idctmmx.o \
+ video_output/video_yuv_mmx.o
+endif
+endif
+
#
# Other lists of files
#
rm -f vlc gmon.out core
rm -rf dep
+show:
+ @echo "Command line for C objects:"
+ @echo $(CC) $(CCFLAGS) $(CFLAGS) -c -o "<dest.o>" "<src.c>"
+ @echo
+ @echo "Command line for assembler objects:"
+ @echo $(CC) $(CFLAGS) -c -o "<dest.o>" "<src.S>"
+
FORCE:
#
# Real targets
#
vlc: $(C_OBJ) $(ASM_OBJ)
- $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
+ $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
#
# Generic rules (see below)
$(dependancies): %.d: FORCE
@$(MAKE) -s --no-print-directory -f Makefile.dep $@
+$(C_OBJ): %.o: Makefile Makefile.dep
$(C_OBJ): %.o: dep/%.d
-
$(C_OBJ): %.o: %.c
- $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+ @echo "compiling $*.c"
+ @$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+
+$(ASM_OBJ): %.o: Makefile Makefile.dep
$(ASM_OBJ): %.o: %.S
- $(CC) $(CFLAGS) -c -o $@ $<
+ @echo "assembling $*.S"
+ @$(CC) $(CFLAGS) -c -o $@ $<
################################################################################
# Note on generic rules and dependancies
* Program information
*******************************************************************************/
-/* Program options - this part will produce a copyright message with compilation
- * options informations, based on some definines set in the Makefile - do not
- * edit */
-#if defined(VIDEO_X11)
-#define VIDEO_OPTIONS "X11"
-#elif defined(VIDEO_FB)
-#define VIDEO_OPTIONS "Framebuffer"
-#elif defined(VIDEO_GGI)
-#define VIDEO_OPTIONS "GGI"
-#else
-#define VIDEO_OPTIONS ""
-#endif
-#if defined(HAVE_MMX)
-#define ARCH_OPTIONS "MMX"
-#else
-#define ARCH_OPTIONS ""
-#endif
-#define PROGRAM_OPTIONS VIDEO_OPTIONS " " ARCH_OPTIONS
-
/* Program version and copyright message */
-#define PROGRAM_VERSION "1.0-dev"
-#define COPYRIGHT_MESSAGE "VideoLAN Client v" PROGRAM_VERSION " (" __DATE__ ") - " \
- PROGRAM_OPTIONS " - (c)1999-2000 VideoLAN"
+#define COPYRIGHT_MESSAGE "VideoLAN Client v" PROGRAM_VERSION " - (c)1999-2000 VideoLAN"
+#define VERSION_MESSAGE "VideoLAN Client - (c)1999-2000 VideoLAN\n" \
+ "version " PROGRAM_VERSION " ( " PROGRAM_BUILD " )\n" \
+ "compilation options: " PROGRAM_OPTIONS
/*******************************************************************************
* General compilation options
/*******************************************************************************
* Debugging options - define or undefine symbols
*******************************************************************************/
-
-/* General debugging support */
-//#define DEBUG
+#ifdef DEBUG
+/* General debugging support, which depends of the DEBUG define, is determined
+ * in the Makefile */
/* Modules specific debugging - this will produce a lot of output, but can be
* usefull to track a bug */
-/*#define DEBUG_INTF
+#define DEBUG_INTF
#define DEBUG_INPUT
#define DEBUG_AUDIO
-#define DEBUG_VIDEO*/
+#define DEBUG_VIDEO
/* Debugging log file - if defined, a file can be used to store all messages. If
* DEBUG_LOG_ONLY is defined, debug messages will only be printed to the log and
* will not appear on the screen */
-//#define DEBUG_LOG "vlc-debug.log"
-//#define DEBUG_LOG_ONLY
+#define DEBUG_LOG "vlc-debug.log"
+#define DEBUG_LOG_ONLY
+
+#endif
/*******************************************************************************
* General configuration
/* Define to enable messages queues - disabling messages queue can be usefull
* when debugging, since it allows messages which would not otherwise be printed,
* due to a crash, to be printed anyway */
+#ifndef DEBUG
#define INTF_MSG_QUEUE
+#endif
/* Format of the header for debug messages. The arguments following this header
* are the file (char *), the function (char *) and the line (int) in which the
/* General/common options */
{ "help", 0, 0, 'h' },
+ { "version", 0, 0, 'v' },
/* Audio options */
{ "noaudio", 0, 0, OPT_NOAUDIO },
};
/* Short options */
-static const char *psz_shortopts = "hg";
+static const char *psz_shortopts = "hvg";
/*******************************************************************************
* Global variable program_data - this is the one and only, see main.h
static void SetDefaultConfiguration ( void );
static int GetConfiguration ( int i_argc, char *ppsz_argv[], char *ppsz_env[] );
static void Usage ( void );
+static void Version ( void );
static void InitSignalHandler ( void );
static void SignalHandler ( int i_signal );
Usage();
return( -1 );
break;
+ case 'v': /* -v, --version */
+ Version();
+ return( -1 );
+ break;
/* Audio options */
- case OPT_NOAUDIO: /* --noaudio */
+ case OPT_NOAUDIO: /* --noaudio */
p_main->b_audio = 0;
break;
- case OPT_STEREO: /* --stereo */
+ case OPT_STEREO: /* --stereo */
main_PutIntVariable( AOUT_STEREO_VAR, 1 );
break;
- case OPT_MONO: /* --mono */
+ case OPT_MONO: /* --mono */
main_PutIntVariable( AOUT_STEREO_VAR, 0 );
break;
/* Options */
intf_Msg("Options:\n" \
" -h, --help \tprint usage\n" \
+ " -v, --version \tprint program version\n" \
" --noaudio \tdisable audio\n" \
" --stereo, --mono \tstereo/mono audio\n" \
" --novideo \tdisable video\n" \
);
}
+/*******************************************************************************
+ * Version: print complete program version
+ *******************************************************************************
+ * Print complete program version and build number.
+ *******************************************************************************/
+static void Version( void )
+{
+ intf_Msg(VERSION_MESSAGE "\n\n");
+ intf_Msg("This is free software; see the documentation or contact <videolan@via.ecp.fr>\n" \
+ "for use and copying conditions.\n" \
+ "\n" \
+ "This software is protected by the international copyright laws, and is\n" \
+ "provided without any warranty, including the implied warranties of\n" \
+ "merchantibility and fitness for a particular purpose.\n" \
+ );
+}
+
/*******************************************************************************
* InitSignalHandler: system signal handler initialization
*******************************************************************************