From: Andre Noll Date: Thu, 21 Apr 2011 20:56:56 +0000 (+0200) Subject: Merge branch 't/autogen' X-Git-Tag: v0.4.7~16 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=c0dca63e02352cae6a8c241dba4bc0d2c7cde050;hp=5379c6d7b5368100184792219248b48580755aae Merge branch 't/autogen' --- diff --git a/.gitignore b/.gitignore index d3a1fc5e..91c6f858 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,4 @@ web_sync confdefs.h conftest conftest.c -GIT-VERSION-FILE +git-version.h diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index a64d7961..15c38794 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,22 +1,17 @@ -#!/bin/sh - -if test $# -ne 1; then - echo >&2 "usage: $0 " - exit 1 -fi +#!/usr/bin/env bash +(($# > 1)) && { echo >&2 "usage: $0 []"; exit 1; } GVF="$1" -DEF_VER="unnamed_version" +DEF_VER="unnamed_version" LF=' ' # First see if there is a version file (included in release tarballs), # then try git-describe, then default. -if test -f VERSION -then +if [[ -f VERSION ]]; then VN=$(cat VERSION) || VN="$DEF_VER" -elif test -d .git -o -f .git && +elif [[ -d .git || -f .git ]] && VN=$(git describe --abbrev=4 HEAD 2>/dev/null) && case "$VN" in *$LF*) (exit 1) ;; @@ -32,14 +27,12 @@ else fi VN=$(expr "$VN" : v*'\(.*\)') +echo "$VN" -if test -r $GVF -then - VC=$(sed -e 's/^GIT_VERSION = //' <$GVF) -else - VC=unset +[[ -z "$GVF" ]] && exit 0 +if [[ -r "$GVF" ]]; then + VC=$(sed -e 's/^#define GIT_VERSION "//; s/"$//' < "$GVF") + [[ "$VN" == "$VC" ]] && exit 0 fi -test "$VN" = "$VC" || { - echo >&2 "GIT_VERSION = $VN" - echo "GIT_VERSION = $VN" >$GVF -} +echo >&2 "new git version: $VN" +echo "#define GIT_VERSION \"$VN\"" >$GVF diff --git a/Makefile.in b/Makefile.in index 8963adad..8b33aaac 100644 --- a/Makefile.in +++ b/Makefile.in @@ -17,6 +17,8 @@ uname_rs := $(shell uname -rs) cc_version := $(shell $(CC) --version | head -n 1) codename := infinite rollback +GIT_VERSION := $(shell ./GIT-VERSION-GEN git-version.h) + DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W DEBUG_CPPFLAGS += -Wredundant-decls DEBUG_CPPFLAGS += -Wall @@ -59,7 +61,6 @@ CPPFLAGS += @arch_cppflags@ CPPFLAGS += -I/usr/local/include CPPFLAGS += -I$(cmdline_dir) CPPFLAGS += @osl_cppflags@ -CPPFLAGS += -DGIT_VERSION='"$(GIT_VERSION)"' man_pages := $(patsubst %, man/man1/%.1, @executables@) man_pages_in := $(patsubst %, web/%.man.in.html, @executables@) @@ -100,18 +101,12 @@ else Q = endif -.PHONY: dep all clean distclean maintainer-clean install man tarball\ - .FORCE-GIT-VERSION-FILE +.PHONY: dep all clean distclean maintainer-clean install man tarball all: dep @executables@ $(man_pages) dep: $(deps) man: $(man_pages) tarball: $(tarball) -GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE - @./GIT-VERSION-GEN GIT-VERSION-FILE --include GIT-VERSION-FILE -@executables@: GIT-VERSION-FILE - -include $(ggo_dir)/makefile %_command_list.c: %.cmd @@ -309,7 +304,7 @@ $(tarball): $(cmdline_generated) git archive --format=tar --prefix=$(tarball_pfx)/ HEAD \ | tar --delete $(tarball_delete) > $(tarball_pfx).tar mkdir -p $(tarball_pfx)/$(cmdline_dir) - echo $(GIT_VERSION) > $(tarball_pfx)/VERSION + ./GIT-VERSION-GEN > $(tarball_pfx)/VERSION cp -r $(autocrap) $(tarball_pfx) cp -r $(cmdline_generated) $(tarball_pfx)/$(cmdline_dir) tar rf $(tarball_pfx).tar $(tarball_pfx)/* diff --git a/NEWS b/NEWS index e8f847b9..c08197f5 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,9 @@ ------------------------------------------- - configure: improved options for ogg/vorbis/speex. + - The git version reported by --version always matches HEAD. + - The autogen script detects the number of processors and + runs a parallel make if possible. ------------------------------------------ 0.4.6 (2011-03-31) "deterministic entropy" diff --git a/afh.c b/afh.c index c5d7aec2..37d71224 100644 --- a/afh.c +++ b/afh.c @@ -16,6 +16,7 @@ #include "fd.h" #include "afh.h" #include "error.h" +#include "version.h" static struct afh_args_info conf; /** The list of all status items */ diff --git a/audioc.c b/audioc.c index 74fb824c..adcae715 100644 --- a/audioc.c +++ b/audioc.c @@ -16,6 +16,7 @@ #include "net.h" #include "string.h" #include "fd.h" +#include "version.h" INIT_AUDIOC_ERRLISTS; diff --git a/audiod.c b/audiod.c index e5db0cd2..5bc22c81 100644 --- a/audiod.c +++ b/audiod.c @@ -33,6 +33,7 @@ #include "write.h" #include "write_common.h" #include "signal.h" +#include "version.h" /** define the array of error lists needed by para_audiod */ INIT_AUDIOD_ERRLISTS; diff --git a/client_common.c b/client_common.c index a7115fd7..54bb9433 100644 --- a/client_common.c +++ b/client_common.c @@ -25,6 +25,7 @@ #include "client.h" #include "hash.h" #include "buffer_tree.h" +#include "version.h" /** The size of the receiving buffer. */ #define CLIENT_BUFSIZE 4000 diff --git a/command.c b/command.c index 5217f9b4..24ddf789 100644 --- a/command.c +++ b/command.c @@ -37,6 +37,7 @@ #include "afs_command_list.h" #include "sched.h" #include "signal.h" +#include "version.h" /** Commands including options must be shorter than this. */ #define MAX_COMMAND_LEN 32768 diff --git a/fade.c b/fade.c index 5fbd0dd4..41b4a6d7 100644 --- a/fade.c +++ b/fade.c @@ -23,6 +23,7 @@ #include "fd.h" #include "string.h" #include "error.h" +#include "version.h" INIT_FADE_ERRLISTS; static struct fade_args_info conf; diff --git a/filter.c b/filter.c index 1d938c45..0dfc94b1 100644 --- a/filter.c +++ b/filter.c @@ -20,6 +20,7 @@ #include "stdin.h" #include "stdout.h" #include "error.h" +#include "version.h" /** The list of all status items used by para_{server,audiod,gui}. */ const char *status_item_list[] = {STATUS_ITEM_ARRAY}; diff --git a/ggo/audiod.m4 b/ggo/audiod.m4 index 2659b93a..1b500854 100644 --- a/ggo/audiod.m4 +++ b/ggo/audiod.m4 @@ -104,7 +104,7 @@ details=" Check the clock difference between the host running para_server and the local host running para_audiod that many times before starting any stream I/0. Set this to non-zero for non-local - setups if the clocks of these two hosts are not syncronized + setups if the clocks of these two hosts are not synchronized by ntp or similar. " diff --git a/gui.c b/gui.c index 3c1889ca..578eeed0 100644 --- a/gui.c +++ b/gui.c @@ -22,6 +22,7 @@ #include "list.h" #include "sched.h" #include "signal.h" +#include "version.h" /** define the array of error lists needed by para_gui */ INIT_GUI_ERRLISTS; diff --git a/para.h b/para.h index 08eb0ee6..7217486d 100644 --- a/para.h +++ b/para.h @@ -67,22 +67,6 @@ va_end(argp); \ } -/** Version text used by various commands if -V switch was given. */ -#define VERSION_TEXT(prefix) "para_" prefix " " PACKAGE_VERSION \ - " (" GIT_VERSION ": " CODENAME ")" "\n" \ - "Copyright (C) 2011 Andre Noll\n" \ - "This is free software with ABSOLUTELY NO WARRANTY." \ - " See COPYING for details.\n" \ - "Written by Andre Noll.\n" \ - "Report bugs to .\n" - -/** Print out \p VERSION_TEXT and exit if version flag was given. */ -#define HANDLE_VERSION_FLAG(_prefix, _args_info_struct) \ - if (_args_info_struct.version_given) { \ - printf("%s", VERSION_TEXT(_prefix)); \ - exit(EXIT_SUCCESS); \ - } - /** Sent by para_client to initiate the authentication procedure. */ #define AUTH_REQUEST_MSG "auth rsa " /** Sent by para_server for commands that expect a data file. */ diff --git a/recv.c b/recv.c index a737e4cb..ae8a1f66 100644 --- a/recv.c +++ b/recv.c @@ -22,6 +22,7 @@ #include "error.h" #include "stdout.h" #include "buffer_tree.h" +#include "version.h" /** The gengetopt args info struct. */ static struct recv_args_info conf; diff --git a/server.c b/server.c index 35d6f191..4d54f74b 100644 --- a/server.c +++ b/server.c @@ -91,6 +91,7 @@ #include "signal.h" #include "user_list.h" #include "color.h" +#include "version.h" /** Define the array of error lists needed by para_server. */ INIT_SERVER_ERRLISTS; diff --git a/version.h b/version.h new file mode 100644 index 00000000..3b839669 --- /dev/null +++ b/version.h @@ -0,0 +1,17 @@ +#include "git-version.h" +/** Version text used by various commands if -V switch was given. */ +#define VERSION_TEXT(prefix) "para_" prefix " " PACKAGE_VERSION \ + " (" GIT_VERSION ": " CODENAME ")" "\n" \ + "Copyright (C) 2011 Andre Noll\n" \ + "This is free software with ABSOLUTELY NO WARRANTY." \ + " See COPYING for details.\n" \ + "Written by Andre Noll.\n" \ + "Report bugs to .\n" + +/** Print out \p VERSION_TEXT and exit if version flag was given. */ +#define HANDLE_VERSION_FLAG(_prefix, _args_info_struct) \ + if (_args_info_struct.version_given) { \ + printf("%s", VERSION_TEXT(_prefix)); \ + exit(EXIT_SUCCESS); \ + } + diff --git a/web/manual.m4 b/web/manual.m4 index 5926b555..30fe922f 100644 --- a/web/manual.m4 +++ b/web/manual.m4 @@ -1504,9 +1504,9 @@ Forward error correction ~~~~~~~~~~~~~~~~~~~~~~~~ As already mentioned REFERENCE(Streaming protocols, earlier), -paraslash uses forward error correction (FEC) for the unreliable -UDP transport. FEC is a technique which was invented already in -1960 by Reed and Solomon and which is widely used for the parity +paraslash uses forward error correction (FEC) for the unreliable UDP +and DCCP transports. FEC is a technique which was invented already +in 1960 by Reed and Solomon and which is widely used for the parity calculations of storage devices (RAID arrays). It is based on the algebraic concept of finite fields, today called Galois fields, in honour of the mathematician Galois (1811-1832). The FEC implementation diff --git a/write.c b/write.c index b3824a08..571dc4ed 100644 --- a/write.c +++ b/write.c @@ -23,6 +23,7 @@ #include "write_common.h" #include "fd.h" #include "error.h" +#include "version.h" INIT_WRITE_ERRLISTS;