Changeset 135
- Timestamp:
- 20/09/06 13:56:27 (2 years ago)
- Files:
-
- trunk/bootstrap (modified) (2 diffs)
- trunk/configure.ac (modified) (1 diff)
- trunk/examples/decode_mpeg.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bootstrap
r90 r135 1 1 #! /bin/sh 2 2 3 ## generic bootstrap file for libraries -- Sam Hocevar <sam@zoy.org> 4 ## $Id$ 3 # bootstrap: the ultimate bootstrap/autogen.sh script for autotools projects 4 # Copyright (c) 2002, 2003, 2004, 2005, 2006 Sam Hocevar <sam@zoy.org> 5 # 6 # This program is free software; you can redistribute it and/or 7 # modify it under the terms of the Do What The Fuck You Want To 8 # Public License, Version 2, as published by Sam Hocevar. See 9 # http://sam.zoy.org/wtfpl/COPYING for more details. 10 # 11 # The latest version of this script can be found at the following place: 12 # http://sam.zoy.org/autotools/ 5 13 6 set -x 14 # Die if an error occurs 7 15 set -e 8 16 9 # Get a sane environment, just in case 10 LANG=C 11 export LANG 12 CYGWIN=binmode 13 export CYGWIN 17 # Guess whether we are using configure.ac or configure.in 18 if test -f configure.ac; then 19 conffile="configure.ac" 20 elif test -f configure.in; then 21 conffile="configure.in" 22 else 23 echo "$0: could not find configure.ac or configure.in" 24 exit 1 25 fi 26 27 # Check for needed features 28 auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *( *\([^ )]*\).*/\1/p' $conffile`" 29 libtool="`grep -q '^[ \t]*A._PROG_LIBTOOL' $conffile && echo yes || echo no`" 30 header="`grep -q '^[ \t]*A._CONFIG_HEADER' $conffile && echo yes || echo no`" 31 aclocalflags="`sed -ne 's/^[ \t]*ACLOCAL_AMFLAGS[ \t]*=//p' Makefile.am`" 14 32 15 33 # Check for automake 16 34 amvers="no" 17 if automake-1.8 --version >/dev/null 2>&1; then 18 amvers="-1.8" 19 elif automake-1.7 --version >/dev/null 2>&1; then 20 amvers="-1.7" 21 elif automake-1.6 --version >/dev/null 2>&1; then 22 amvers="-1.6" 23 elif automake-1.5 --version >/dev/null 2>&1; then 24 amvers="-1.5" 25 elif automake --version > /dev/null 2>&1; then 35 for v in "-1.9" "19" "-1.8" "18" "-1.7" "17" "-1.6" "16" "-1.5" "15"; do 36 if automake${v} --version >/dev/null 2>&1; then 37 amvers="${v}" 38 break 39 fi 40 done 41 42 if test "${amvers}" = "no" && automake --version > /dev/null 2>&1; then 26 43 amvers="`automake --version | sed -e '1s/[^0-9]*//' -e q`" 27 44 if expr "$amvers" "<" "1.5" > /dev/null 2>&1; then … … 33 50 34 51 if test "$amvers" = "no"; then 35 set +x36 52 echo "$0: you need automake version 1.5 or later" 37 53 exit 1 38 54 fi 39 55 40 # Check for libtool 41 libtoolize="no" 42 if glibtoolize --version >/dev/null 2>&1; then 43 libtoolize="glibtoolize" 44 elif libtoolize --version >/dev/null 2>&1; then 45 libtoolize="libtoolize" 46 fi 56 # Check for autoconf 57 acvers="no" 58 for v in "" "259" "253"; do 59 if autoconf${v} --version >/dev/null 2>&1; then 60 acvers="${v}" 61 break 62 fi 63 done 47 64 48 if test "$libtoolize" = "no"; then 49 set +x 50 echo "$0: you need libtool" 65 if test "$acvers" = "no"; then 66 echo "$0: you need autoconf" 51 67 exit 1 52 68 fi 53 69 54 # Remove old cruft 55 rm -f aclocal.m4 configure config.guess config.log config.sub config.cache config.h.in config.h compile ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh 56 rm -Rf autom4te.cache 57 (cd autotools && rm -f config.guess config.sub missing mkinstalldirs compile ltmain.sh depcomp install-sh) 70 # Check for libtool 71 if test "$libtool" = "yes"; then 72 libtoolize="no" 73 if glibtoolize --version >/dev/null 2>&1; then 74 libtoolize="glibtoolize" 75 else 76 for v in "16" "15" "" "14"; do 77 if libtoolize${v} --version >/dev/null 2>&1; then 78 libtoolize="libtoolize${v}" 79 break 80 fi 81 done 82 fi 58 83 59 ${libtoolize} --copy --force 60 if test -f "ltmain.sh"; then 61 echo "$0: working around a minor libtool issue"62 mv ltmain.sh autotools/84 if test "$libtoolize" = "no"; then 85 echo "$0: you need libtool" 86 exit 1 87 fi 63 88 fi 64 89 65 aclocal${amvers} 66 autoconf 67 autoheader 68 automake${amvers} --add-missing --copy 90 # Remove old cruft 91 for x in aclocal.m4 configure config.guess config.log config.sub config.cache config.h.in config.h compile libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh; do rm -f $x autotools/$x; if test -n "$auxdir"; then rm -f "$auxdir/$x"; fi; done 92 rm -Rf autom4te.cache 93 if test -n "$auxdir"; then 94 if test ! -d "$auxdir"; then 95 mkdir "$auxdir" 96 fi 97 aclocalflags="${aclocalflags} -I $auxdir" 98 fi 69 99 100 # Explain what we are doing from now 101 set -x 102 103 # Bootstrap package 104 if test "$libtool" = "yes"; then 105 ${libtoolize} --copy --force 106 if test -n "$auxdir" -a ! "$auxdir" = "." -a -f "ltmain.sh"; then 107 echo "$0: working around a minor libtool issue" 108 mv ltmain.sh "$auxdir/" 109 fi 110 fi 111 112 aclocal${amvers} ${aclocalflags} 113 autoconf${acvers} 114 if test "$header" = "yes"; then 115 autoheader${acvers} 116 fi 117 #add --include-deps if you want to bootstrap with any other compiler than gcc 118 #automake${amvers} --add-missing --copy --include-deps 119 automake${amvers} --foreign --add-missing --copy 120 121 # Remove cruft that we no longer want 122 rm -Rf autom4te.cache 123 trunk/configure.ac
r121 r135 57 57 dnl Check for headers 58 58 AC_CHECK_HEADERS(stdint.h inttypes.h) 59 AC_CHECK_FUNCS(gettimeofday) 59 60 60 61 AC_CHECK_HEADERS(sys/socket.h, [ac_have_sys_socket_h=yes]) trunk/examples/decode_mpeg.c
r134 r135 422 422 int i_port = 0; 423 423 char * ipaddress = NULL; 424 #endif 425 #ifdef HAVE_GETTIMEOFDAY 424 426 time_t time_prev = 0; 427 #endif 428 mtime_t i_prev_pcr = 0; /* 33 bits */ 425 429 int i_old_cc = -1; 426 mtime_t i_prev_pcr = 0; /* 33 bits */427 #endif428 430 uint32_t i_bytes = 0; /* bytes transmitted between PCR's */ 429 431 char *filename = NULL; … … 582 584 583 585 printf( "%.2d, PCRpid(%d), ", i_cc, i_pid ); 586 #ifdef HAVE_GETTIMEOFDAY 584 587 if( b_verbose ) 585 588 { … … 599 602 time_prev = time_current; 600 603 } 604 #endif 601 605 if( i_delta <= 0 ) 602 606 printf( "value %lld, previous %lld, delta %lld, bytes %u, ", … … 630 634 { 631 635 mtime_t i_delta; 636 #ifdef HAVE_GETTIMEOFDAY 632 637 struct timeval tv; 638 #endif 633 639 634 640 i_delta = (long long int)p_stream->pid[i_pid].i_pcr - (long long int)i_prev_pcr; … … 643 649 printf( "\n" ); 644 650 651 #ifdef HAVE_GETTIMEOFDAY 645 652 /* Initialize the arrival time */ 646 653 gettimeofday( &tv, NULL ); 647 654 time_prev = (tv.tv_sec*1000) + (tv.tv_usec/1000); 648 655 i_bytes = 0; 656 #endif 649 657 } 650 658 if( b_discontinuity_seen )
