mpegdemux-0.1.4/0000755000000000000000000000000011413411735013505 5ustar00rootroot00000000000000mpegdemux-0.1.4/src/0000755000000000000000000000000011413411735014274 5ustar00rootroot00000000000000mpegdemux-0.1.4/src/Makefile.inc0000644000000000000000000000315411413352377016515 0ustar00rootroot00000000000000# src/Makefile.inc rel := src DCL += $(rel)/config.h DIRS += $(rel) DIST += $(rel)/Makefile.inc $(rel)/config.h.in $(rel)/config.tc # ---------------------------------------------------------------------- $(rel)/%.o: $(rel)/%.c $(QP)echo " CC $@" $(QR)$(CC) -c -o $@ $(CFLAGS_DEFAULT) $< # ---------------------------------------------------------------------- # mpegdemux MPEGDEMUX_BAS := \ buffer \ getopt \ message \ mpegdemux \ mpeg_demux \ mpeg_list \ mpeg_parse \ mpeg_remux \ mpeg_scan MPEGDEMUX_SRC := $(foreach f,$(MPEGDEMUX_BAS),$(rel)/$(f).c) MPEGDEMUX_OBJ := $(foreach f,$(MPEGDEMUX_BAS),$(rel)/$(f).o) MPEGDEMUX_HDR := $(foreach f,$(MPEGDEMUX_BAS),$(rel)/$(f).h) MPEGDEMUX_MAN1 := $(rel)/mpegdemux.1 MPEGDEMUX_BIN := $(rel)/mpegdemux$(EXEEXT) MPEGDEMUX_SDP := $(MPEGDEMUX_HDR) $(rel)/config.h MPEGDEMUX_BDP := $(MPEGDEMUX_OBJ) BIN += $(MPEGDEMUX_BIN) MAN1 += $(MPEGDEMUX_MAN1) CLN += $(MPEGDEMUX_BIN) $(MPEGDEMUX_OBJ) DIST += $(MPEGDEMUX_SRC) $(MPEGDEMUX_HDR) $(MPEGDEMUX_MAN1) $(rel)/buffer.o: $(rel)/buffer.c $(MPEGDEMUX_SDP) $(rel)/getopt.o: $(rel)/getopt.c $(MPEGDEMUX_SDP) $(rel)/message.o: $(rel)/message.c $(MPEGDEMUX_SDP) $(rel)/mpegdemux.o: $(rel)/mpegdemux.c $(MPEGDEMUX_SDP) $(rel)/mpeg_parse.o: $(rel)/mpeg_parse.c $(MPEGDEMUX_SDP) $(rel)/mpeg_list.o: $(rel)/mpeg_list.c $(MPEGDEMUX_SDP) $(rel)/mpeg_demux.o: $(rel)/mpeg_demux.c $(MPEGDEMUX_SDP) $(rel)/mpeg_remux.o: $(rel)/mpeg_remux.c $(MPEGDEMUX_SDP) $(rel)/mpeg_scan.o: $(rel)/mpeg_scan.c $(MPEGDEMUX_SDP) $(rel)/mpegdemux$(EXEEXT): $(MPEGDEMUX_BDP) $(QP)echo " LD $@" $(QR)$(LD) -o $@ $(LDFLAGS) $(MPEGDEMUX_OBJ) $(LIBS) mpegdemux-0.1.4/src/buffer.c0000644000000000000000000000554711145070233015720 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/buffer.c * * Created: 2003-04-08 by Hampa Hug * * Copyright: (C) 2003-2009 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #include "config.h" #include #include "buffer.h" void mpeg_buf_init (mpeg_buffer_t *buf) { buf->buf = NULL; buf->max = 0; buf->cnt = 0; } void mpeg_buf_free (mpeg_buffer_t *buf) { free (buf->buf); buf->buf = NULL; buf->cnt = 0; buf->max = 0; } void mpeg_buf_clear (mpeg_buffer_t *buf) { buf->cnt = 0; } int mpeg_buf_set_max (mpeg_buffer_t *buf, unsigned max) { if (buf->max == max) { return (0); } if (max == 0) { free (buf->buf); buf->max = 0; buf->cnt = 0; return (0); } buf->buf = realloc (buf->buf, max); if (buf->buf == NULL) { buf->max = 0; buf->cnt = 0; return (1); } buf->max = max; if (buf->cnt > max) { buf->cnt = max; } return (0); } int mpeg_buf_set_cnt (mpeg_buffer_t *buf, unsigned cnt) { if (cnt > buf->max) { if (mpeg_buf_set_max (buf, cnt)) { return (1); } } buf->cnt = cnt; return (0); } int mpeg_buf_read (mpeg_buffer_t *buf, mpeg_demux_t *mpeg, unsigned cnt) { if (mpeg_buf_set_cnt (buf, cnt)) { return (1); } buf->cnt = mpegd_read (mpeg, buf->buf, cnt); if (buf->cnt != cnt) { return (1); } return (0); } int mpeg_buf_write (mpeg_buffer_t *buf, FILE *fp) { if (buf->cnt > 0) { if (fwrite (buf->buf, 1, buf->cnt, fp) != buf->cnt) { return (1); } } return (0); } int mpeg_buf_write_clear (mpeg_buffer_t *buf, FILE *fp) { if (buf->cnt > 0) { if (fwrite (buf->buf, 1, buf->cnt, fp) != buf->cnt) { buf->cnt = 0; return (1); } } buf->cnt = 0; return (0); } mpegdemux-0.1.4/src/buffer.h0000644000000000000000000000401411145070233015711 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/buffer.h * * Created: 2003-04-08 by Hampa Hug * * Copyright: (C) 2003-2009 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #ifndef MPEGDEMUX_BUFFER_H #define MPEGDEMUX_BUFFER_H 1 #include "config.h" #include "mpeg_parse.h" typedef struct { unsigned char *buf; unsigned cnt; unsigned max; } mpeg_buffer_t; void mpeg_buf_init (mpeg_buffer_t *buf); void mpeg_buf_free (mpeg_buffer_t *buf); void mpeg_buf_clear (mpeg_buffer_t *buf); int mpeg_buf_set_max (mpeg_buffer_t *buf, unsigned max); int mpeg_buf_set_cnt (mpeg_buffer_t *buf, unsigned cnt); int mpeg_buf_read (mpeg_buffer_t *buf, mpeg_demux_t *mpeg, unsigned cnt); int mpeg_buf_write (mpeg_buffer_t *buf, FILE *fp); int mpeg_buf_write_clear (mpeg_buffer_t *buf, FILE *fp); #endif mpegdemux-0.1.4/src/config.h.in0000644000000000000000000000333611400752603016322 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/config.h.in * * Created: 2003-02-02 by Hampa Hug * * Copyright: (C) 2003-2010 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #ifndef MPEGDEMUX_CONFIG_H #define MPEGDEMUX_CONFIG_H 1 #define _POSIX_C_SOURCE 1 #undef MPEGDEMUX_LARGE_FILE #undef MPEGDEMUX_VERSION_MAJ #undef MPEGDEMUX_VERSION_MIN #undef MPEGDEMUX_VERSION_MIC #undef MPEGDEMUX_VERSION_STR #ifdef MPEGDEMUX_LARGE_FILE #define _FILE_OFFSET_BITS 64 #endif #undef HAVE_INTTYPES_H #endif mpegdemux-0.1.4/src/config.tc0000644000000000000000000000334711413352377016106 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/config.tc * * Created: 2010-05-29 by Hampa Hug * * Copyright: (C) 2010 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #ifndef MPEGDEMUX_CONFIG_H #define MPEGDEMUX_CONFIG_H 1 #define MPEGDEMUX_VERSION_MAJ %MPEGDEMUX_VERSION_MAJ% #define MPEGDEMUX_VERSION_MIN %MPEGDEMUX_VERSION_MIN% #define MPEGDEMUX_VERSION_MIC %MPEGDEMUX_VERSION_MIC% #define MPEGDEMUX_VERSION_STR "%MPEGDEMUX_VERSION_STR%" #undef MPEGDEMUX_LARGE_FILE #undef HAVE_INTTYPES_H #endif mpegdemux-0.1.4/src/getopt.c0000644000000000000000000001364011400752703015745 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/getopt.c * * Created: 2010-05-30 by Hampa Hug * * Copyright: (C) 2010 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #include #include #include #include #include "getopt.h" static int opt_cmp (const mpegd_option_t *opt1, const mpegd_option_t *opt2) { int c1, c2; c1 = (opt1->name1 <= 255) ? tolower (opt1->name1) : opt1->name1; c2 = (opt2->name1 <= 255) ? tolower (opt2->name1) : opt2->name1; if (c1 < c2) { return (-1); } else if (c1 > c2) { return (1); } else if (opt1->name1 < opt2->name1) { return (1); } else if (opt1->name1 > opt2->name1) { return (-1); } return (0); } static unsigned opt_get_width (const mpegd_option_t *opt) { unsigned n; if (opt->optdesc == NULL) { return (0); } n = 0; if (opt->name1 <= 255) { n += 2; if (opt->name2 != NULL) { n += 2; } } if (opt->name2 != NULL) { n += 2 + strlen (opt->name2); } if (opt->argdesc != NULL) { n += 1 + strlen (opt->argdesc); } return (n); } static unsigned opt_max_width (const mpegd_option_t *opt) { unsigned i, n, w; w = 0; i = 0; while (opt[i].name1 >= 0) { n = opt_get_width (&opt[i]); if (n > w) { w = n; } i += 1; } return (w); } static void sort_options (mpegd_option_t *opt) { unsigned i, j; mpegd_option_t tmp; if (opt[0].name1 < 0) { return; } i = 1; while (opt[i].name1 >= 0) { if (opt_cmp (&opt[i], &opt[i - 1]) >= 0) { i += 1; continue; } j = i - 1; tmp = opt[i]; opt[i] = opt[j]; while ((j > 0) && (opt_cmp (&tmp, &opt[j - 1]) < 0)) { opt[j] = opt[j - 1]; j -= 1; } opt[j] = tmp; i += 1; } } static void print_option (const mpegd_option_t *opt, unsigned w) { unsigned n; n = 0; if (opt->name1 <= 255) { printf (" -%c", opt->name1); n += 2; if (opt->name2 != NULL) { printf (", "); n += 2; } } else { printf (" "); } if (opt->name2 != NULL) { printf ("--%s", opt->name2); n += 2 + strlen (opt->name2); } if (opt->argdesc != NULL) { printf (" %s", opt->argdesc); n += 1 + strlen (opt->argdesc); } while (n < w) { fputc (' ', stdout); n += 1; } printf ("%s\n", opt->optdesc); } void mpegd_getopt_help (const char *tag, const char *usage, mpegd_option_t *opt) { unsigned w; sort_options (opt); w = opt_max_width (opt); if (tag != NULL) { printf ("%s\n\n", tag); } if (usage != NULL) { printf ("%s\n", usage); } while (opt->name1 >= 0) { print_option (opt, w + 2); opt += 1; } } static mpegd_option_t *find_option_name1 (mpegd_option_t *opt, int name1) { while (opt->name1 >= 0) { if (opt->name1 == name1) { return (opt); } opt += 1; } return (NULL); } static mpegd_option_t *find_option_name2 (mpegd_option_t *opt, const char *name2) { while (opt->name1 >= 0) { if (strcmp (opt->name2, name2) == 0) { return (opt); } opt += 1; } return (NULL); } int mpegd_getopt (int argc, char **argv, char ***optarg, mpegd_option_t *opt) { mpegd_option_t *ret; static int atend = 0; static int index1 = -1; static int index2 = -1; static const char *curopt = NULL; if (index1 < 0) { atend = 0; index1 = 0; index2 = 1; curopt = NULL; } if (atend) { if (index2 >= argc) { return (GETOPT_DONE); } index1 = index2; index2 += 1; *optarg = argv + index1; return (0); } if ((curopt == NULL) || (*curopt == 0)) { if (index2 >= argc) { return (GETOPT_DONE); } index1 = index2; index2 += 1; curopt = argv[index1]; if ((curopt[0] != '-') || (curopt[1] == 0)) { *optarg = argv + index1; curopt = NULL; return (0); } if (curopt[1] == '-') { if (curopt[2] == 0) { atend = 1; if (index2 >= argc) { return (GETOPT_DONE); } index1 = index2; index2 += 1; *optarg = argv + index1; return (0); } ret = find_option_name2 (opt, curopt + 2); if (ret == NULL) { fprintf (stderr, "%s: unknown option (%s)\n", argv[0], curopt ); return (GETOPT_UNKNOWN); } if ((index2 + ret->argcnt) > argc) { fprintf (stderr, "%s: missing option argument (%s)\n", argv[0], curopt ); return (GETOPT_MISSING); } *optarg = argv + index2; index2 += ret->argcnt; curopt = NULL; return (ret->name1); } curopt += 1; } ret = find_option_name1 (opt, *curopt); if (ret == NULL) { fprintf (stderr, "%s: unknown option (-%c)\n", argv[0], *curopt ); return (GETOPT_UNKNOWN); } if ((index2 + ret->argcnt) > argc) { fprintf (stderr, "%s: missing option argument (-%c)\n", argv[0], *curopt ); return (GETOPT_MISSING); } *optarg = argv + index2; index2 += ret->argcnt; curopt += 1; return (ret->name1); } mpegdemux-0.1.4/src/getopt.h0000644000000000000000000000354711400752703015757 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/getopt.h * * Created: 2010-05-30 by Hampa Hug * * Copyright: (C) 2010 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #ifndef MPEGDEMUX_GETOPT_H #define MPEGDEMUX_GETOPT_H 1 #define GETOPT_DONE -1 #define GETOPT_UNKNOWN -2 #define GETOPT_MISSING -3 typedef struct { short name1; unsigned short argcnt; const char *name2; const char *argdesc; const char *optdesc; } mpegd_option_t; void mpegd_getopt_help (const char *tag, const char *usage, mpegd_option_t *opt); int mpegd_getopt (int argc, char **argv, char ***arg, mpegd_option_t *opt); #endif mpegdemux-0.1.4/src/message.c0000644000000000000000000000466211145070233016070 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/message.c * * Created: 2003-02-02 by Hampa Hug * * Copyright: (C) 2003-2009 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #include "config.h" #include #include #include #include "message.h" static unsigned msg_level = MSG_DEBUG; void msg_set_level (unsigned level) { msg_level = level; } unsigned msg_get_level (void) { return msg_level; } void prt_msg_va (unsigned level, const char *msg, va_list va) { if (level <= msg_level) { vfprintf (stderr, msg, va); fflush (stderr); } } void prt_message (unsigned level, const char *msg, ...) { va_list va; if (level <= msg_level) { va_start (va, msg); prt_msg_va (level, msg, va); va_end (va); } } void prt_err (const char *msg, ...) { va_list va; if (MSG_ERR <= msg_level) { va_start (va, msg); prt_msg_va (MSG_ERR, msg, va); va_end (va); } } void prt_msg (const char *msg, ...) { va_list va; if (MSG_MSG <= msg_level) { va_start (va, msg); prt_msg_va (MSG_MSG, msg, va); va_end (va); } } void prt_deb (const char *msg, ...) { va_list va; if (MSG_DEBUG <= msg_level) { va_start (va, msg); prt_msg_va (MSG_DEBUG, msg, va); va_end (va); } } mpegdemux-0.1.4/src/message.h0000644000000000000000000000346011145070233016070 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/message.h * * Created: 2003-02-02 by Hampa Hug * * Copyright: (C) 2003-2009 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #ifndef MPEGDEMUX_MESSAGE_H #define MPEGDEMUX_MESSAGE_H 1 #include "config.h" #define MSG_ERR 0 #define MSG_MSG 1 #define MSG_INFO 2 #define MSG_DEBUG 3 void msg_set_level (unsigned level); unsigned msg_get_level (void); void prt_message (unsigned level, const char *msg, ...); void prt_err (const char *msg, ...); void prt_msg (const char *msg, ...); void prt_deb (const char *msg, ...); #endif mpegdemux-0.1.4/src/mpeg_demux.c0000644000000000000000000001257211400047122016570 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/mpeg_demux.c * * Created: 2003-02-02 by Hampa Hug * * Copyright: (C) 2003-2010 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #include "config.h" #include #include #include #include "message.h" #include "buffer.h" #include "mpeg_parse.h" #include "mpeg_demux.h" #include "mpegdemux.h" static FILE *fp[512]; static mpeg_buffer_t packet = { NULL, 0, 0 }; static int mpeg_demux_copy_spu (mpeg_demux_t *mpeg, FILE *fp, unsigned cnt) { static unsigned spucnt = 0; static int half = 0; unsigned i, n; unsigned char buf[8]; unsigned long long pts; if (half) { mpegd_read (mpeg, buf, 1); if (fwrite (buf, 1, 1, fp) != 1) { return (1); } spucnt = (spucnt << 8) + buf[0]; half = 0; spucnt -= 2; cnt -= 1; } while (cnt > 0) { if (spucnt == 0) { pts = mpeg->packet.pts; for (i = 0; i < 8; i++) { buf[7 - i] = pts & 0xff; pts = pts >> 8; } if (fwrite (buf, 1, 8, fp) != 8) { return (1); } if (cnt == 1) { mpegd_read (mpeg, buf, 1); if (fwrite (buf, 1, 1, fp) != 1) { return (1); } spucnt = buf[0]; half = 1; return (0); } mpegd_read (mpeg, buf, 2); if (fwrite (buf, 1, 2, fp) != 2) { return (1); } spucnt = (buf[0] << 8) + buf[1]; if (spucnt < 2) { return (1); } spucnt -= 2; cnt -= 2; } n = (cnt < spucnt) ? cnt : spucnt; mpeg_copy (mpeg, fp, n); cnt -= n; spucnt -= n; } return (0); } static FILE *mpeg_demux_open (mpeg_demux_t *mpeg, unsigned sid, unsigned ssid) { FILE *fp; char *name; unsigned seq; if (par_demux_name == NULL) { fp = (FILE *) mpeg->ext; } else { seq = (sid == 0xbd) ? ((sid << 8) + ssid) : sid; name = mpeg_get_name (par_demux_name, seq); fp = fopen (name, "wb"); if (fp == NULL) { prt_err ("can't open stream file (%s)\n", name); if (sid == 0xbd) { par_substream[ssid] &= ~PAR_STREAM_SELECT; } else { par_stream[sid] &= ~PAR_STREAM_SELECT; } free (name); return (NULL); } free (name); } if ((sid == 0xbd) && par_dvdsub) { if (fwrite ("SPU ", 1, 4, fp) != 4) { fclose (fp); return (NULL); } } return (fp); } static int mpeg_demux_system_header (mpeg_demux_t *mpeg) { return (0); } static int mpeg_demux_packet (mpeg_demux_t *mpeg) { unsigned sid, ssid; unsigned fpi; unsigned cnt; int r; sid = mpeg->packet.sid; ssid = mpeg->packet.ssid; if (mpeg_stream_excl (sid, ssid)) { return (0); } cnt = mpeg->packet.offset; fpi = sid; /* select substream in private stream 1 (AC3 audio) */ if (sid == 0xbd) { fpi = 256 + ssid; cnt += 1; if (par_dvdac3) { cnt += 3; } } if (cnt > mpeg->packet.size) { prt_msg ("demux: AC3 packet too small (sid=%02x size=%u)\n", sid, mpeg->packet.size ); return (1); } if (fp[fpi] == NULL) { fp[fpi] = mpeg_demux_open (mpeg, sid, ssid); if (fp[fpi] == NULL) { return (1); } } if (cnt > 0) { mpegd_skip (mpeg, cnt); } cnt = mpeg->packet.size - cnt; if ((sid == 0xbd) && par_dvdsub) { return (mpeg_demux_copy_spu (mpeg, fp[fpi], cnt)); } r = 0; if (mpeg_buf_read (&packet, mpeg, cnt)) { prt_msg ("demux: incomplete packet (sid=%02x size=%u/%u)\n", sid, packet.cnt, cnt ); if (par_drop) { mpeg_buf_clear (&packet); return (1); } r = 1; } if (mpeg_buf_write_clear (&packet, fp[fpi])) { r = 1; } return (r); } static int mpeg_demux_pack (mpeg_demux_t *mpeg) { return (0); } static int mpeg_demux_end (mpeg_demux_t *mpeg) { return (0); } int mpeg_demux (FILE *inp, FILE *out) { unsigned i; int r; mpeg_demux_t *mpeg; for (i = 0; i < 512; i++) { fp[i] = NULL; } mpeg = mpegd_open_fp (NULL, inp, 0); if (mpeg == NULL) { return (1); } mpeg->mpeg_system_header = &mpeg_demux_system_header; mpeg->mpeg_pack = &mpeg_demux_pack; mpeg->mpeg_packet = &mpeg_demux_packet; mpeg->mpeg_packet_check = &mpeg_packet_check; mpeg->mpeg_end = &mpeg_demux_end; mpeg->ext = out; r = mpegd_parse (mpeg); mpegd_close (mpeg); for (i = 0; i < 512; i++) { if ((fp[i] != NULL) && (fp[i] != out)) { fclose (fp[i]); } } return (r); } mpegdemux-0.1.4/src/mpeg_demux.h0000644000000000000000000000303511145070233016574 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/mpeg_demux.h * * Created: 2003-02-02 by Hampa Hug * * Copyright: (C) 2003-2009 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #ifndef MPEGDEMUX_MPEG_DEMUX_H #define MPEGDEMUX_MPEG_DEMUX_H 1 #include "config.h" int mpeg_demux (FILE *inp, FILE *out); #endif mpegdemux-0.1.4/src/mpeg_list.c0000644000000000000000000001113511400752636016430 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/mpeg_list.c * * Created: 2003-02-02 by Hampa Hug * * Copyright: (C) 2003-2010 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #include "config.h" #include #include #include #include "message.h" #include "mpeg_parse.h" #include "mpeg_list.h" #include "mpegdemux.h" static unsigned long long skip_ofs = 0; static unsigned long skip_cnt = 0; static void mpeg_list_print_skip (FILE *fp) { if (skip_cnt > 0) { fprintf (fp, "%08" PRIxMAX ": skip %lu\n", (uintmax_t) skip_ofs, skip_cnt ); skip_cnt = 0; } } static int mpeg_list_skip (mpeg_demux_t *mpeg) { if (skip_cnt == 0) { skip_ofs = mpeg->ofs; } skip_cnt += 1; return (0); } static int mpeg_list_system_header (mpeg_demux_t *mpeg) { FILE *fp; if (par_no_shdr) { return (0); } fp = (FILE *) mpeg->ext; mpeg_list_print_skip (fp); fprintf (fp, "%08" PRIxMAX ": system header[%lu]: " "size=%u fixed=%d csps=%d\n", (uintmax_t) mpeg->ofs, mpeg->shdr_cnt - 1, mpeg->shdr.size, mpeg->shdr.fixed, mpeg->shdr.csps ); return (0); } static int mpeg_list_packet (mpeg_demux_t *mpeg) { FILE *fp; unsigned sid, ssid; if (par_no_packet) { return (0); } sid = mpeg->packet.sid; ssid = mpeg->packet.ssid; if (mpeg_stream_excl (sid, ssid)) { return (0); } fp = (FILE *) mpeg->ext; mpeg_list_print_skip (fp); fprintf (fp, "%08" PRIxMAX ": packet[%lu]: sid=%02x", (uintmax_t) mpeg->ofs, mpeg->streams[sid].packet_cnt - 1, sid ); if (sid == 0xbd) { fprintf (fp, "[%02x]", ssid); } else { fputs (" ", fp); } if (mpeg->packet.type == 1) { fputs (" MPEG1", fp); } else if (mpeg->packet.type == 2) { fputs (" MPEG2", fp); } else { fputs (" UNKWN", fp); } fprintf (fp, " size=%u", mpeg->packet.size); if (mpeg->packet.have_pts || mpeg->packet.have_dts) { fprintf (fp, " pts=%" PRIuMAX "[%.4f] dts=%" PRIuMAX "[%.4f]", (uintmax_t) mpeg->packet.pts, (double) mpeg->packet.pts / 90000.0, (uintmax_t) mpeg->packet.dts, (double) mpeg->packet.dts / 90000.0 ); } fputs ("\n", fp); return (0); } static int mpeg_list_pack (mpeg_demux_t *mpeg) { FILE *fp; if (par_no_pack) { return (0); } fp = (FILE *) mpeg->ext; mpeg_list_print_skip (fp); fprintf (fp, "%08" PRIxMAX ": pack[%lu]: " "type=%u scr=%" PRIuMAX "[%.4f] mux=%lu[%.2f] stuff=%u\n", (uintmax_t) mpeg->ofs, mpeg->pack_cnt - 1, mpeg->pack.type, (uintmax_t) mpeg->pack.scr, (double) mpeg->pack.scr / 90000.0, mpeg->pack.mux_rate, 50.0 * mpeg->pack.mux_rate, mpeg->pack.stuff ); fflush (fp); return (0); } static int mpeg_list_end (mpeg_demux_t *mpeg) { FILE *fp; if (par_no_end) { return (0); } fp = (FILE *) mpeg->ext; mpeg_list_print_skip (fp); fprintf (fp, "%08" PRIxMAX ": end\n", (uintmax_t) mpeg->ofs); return (0); } int mpeg_list (FILE *inp, FILE *out) { int r; mpeg_demux_t *mpeg; mpeg = mpegd_open_fp (NULL, inp, 0); if (mpeg == NULL) { return (1); } skip_cnt = 0; skip_ofs = 0; mpeg->ext = out; mpeg->mpeg_skip = &mpeg_list_skip; mpeg->mpeg_system_header = &mpeg_list_system_header; mpeg->mpeg_pack = &mpeg_list_pack; mpeg->mpeg_packet = &mpeg_list_packet; mpeg->mpeg_packet_check = &mpeg_packet_check; mpeg->mpeg_end = &mpeg_list_end; r = mpegd_parse (mpeg); mpeg_list_print_skip (out); mpeg_print_stats (mpeg, out); mpegd_close (mpeg); return (r); } mpegdemux-0.1.4/src/mpeg_list.h0000644000000000000000000000303211145070233016422 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/mpeg_list.h * * Created: 2003-02-02 by Hampa Hug * * Copyright: (C) 2003-2009 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #ifndef MPEGDEMUX_MPEG_LIST_H #define MPEGDEMUX_MPEG_LIST_H 1 #include "config.h" int mpeg_list (FILE *inp, FILE *out); #endif mpegdemux-0.1.4/src/mpeg_parse.c0000644000000000000000000002757311145070233016574 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/mpeg_parse.c * * Created: 2003-02-01 by Hampa Hug * * Copyright: (C) 2003-2009 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #include "config.h" #include #include #include "message.h" #include "mpeg_parse.h" mpeg_demux_t *mpegd_open_fp (mpeg_demux_t *mpeg, FILE *fp, int close) { if (mpeg == NULL) { mpeg = malloc (sizeof (mpeg_demux_t)); if (mpeg == NULL) { return (NULL); } mpeg->free = 1; } else { mpeg->free = 0; } mpeg->fp = fp; mpeg->close = close; mpeg->ofs = 0; mpeg->buf_i = 0; mpeg->buf_n = 0; mpeg->ext = NULL; mpeg->mpeg_skip = NULL; mpeg->mpeg_system_header = NULL; mpeg->mpeg_packet = NULL; mpeg->mpeg_packet_check = NULL; mpeg->mpeg_pack = NULL; mpeg->mpeg_end = NULL; mpegd_reset_stats (mpeg); return (mpeg); } mpeg_demux_t *mpegd_open (mpeg_demux_t *mpeg, const char *fname) { FILE *fp; fp = fopen (fname, "rb"); if (fp == NULL) { return (NULL); } mpeg = mpegd_open_fp (mpeg, fp, 1); return (mpeg); } void mpegd_close (mpeg_demux_t *mpeg) { if (mpeg->close) { fclose (mpeg->fp); } if (mpeg->free) { free (mpeg); } } void mpegd_reset_stats (mpeg_demux_t *mpeg) { unsigned i; mpeg->shdr_cnt = 0; mpeg->pack_cnt = 0; mpeg->packet_cnt = 0; mpeg->end_cnt = 0; mpeg->skip_cnt = 0; for (i = 0; i < 256; i++) { mpeg->streams[i].packet_cnt = 0; mpeg->streams[i].size = 0; mpeg->substreams[i].packet_cnt = 0; mpeg->substreams[i].size = 0; } } static int mpegd_buffer_fill (mpeg_demux_t *mpeg) { unsigned i, n; size_t r; if ((mpeg->buf_i > 0) && (mpeg->buf_n > 0)) { for (i = 0; i < mpeg->buf_n; i++) { mpeg->buf[i] = mpeg->buf[mpeg->buf_i + i]; } } mpeg->buf_i = 0; n = MPEG_DEMUX_BUFFER - mpeg->buf_n; if (n > 0) { r = fread (mpeg->buf + mpeg->buf_n, 1, n, mpeg->fp); if (r < 0) { return (1); } mpeg->buf_n += (unsigned) r; } return (0); } static int mpegd_need_bits (mpeg_demux_t *mpeg, unsigned n) { n = (n + 7) / 8; if (n > mpeg->buf_n) { mpegd_buffer_fill (mpeg); } if (n > mpeg->buf_n) { return (1); } return (0); } unsigned long mpegd_get_bits (mpeg_demux_t *mpeg, unsigned i, unsigned n) { unsigned long r; unsigned long v, m; unsigned b_i, b_n; unsigned char *buf; if (mpegd_need_bits (mpeg, i + n)) { return (0); } buf = mpeg->buf + mpeg->buf_i; r = 0; /* aligned bytes */ if (((i | n) & 7) == 0) { i = i / 8; n = n / 8; while (n > 0) { r = (r << 8) | buf[i]; i += 1; n -= 1; } return (r); } while (n > 0) { b_n = 8 - (i & 7); if (b_n > n) { b_n = n; } b_i = 8 - (i & 7) - b_n; m = (1 << b_n) - 1; v = (buf[i >> 3] >> b_i) & m; r = (r << b_n) | v; i += b_n; n -= b_n; } return (r); } int mpegd_skip (mpeg_demux_t *mpeg, unsigned n) { size_t r; mpeg->ofs += n; if (n <= mpeg->buf_n) { mpeg->buf_i += n; mpeg->buf_n -= n; return (0); } n -= mpeg->buf_n; mpeg->buf_i = 0; mpeg->buf_n = 0; while (n > 0) { if (n <= MPEG_DEMUX_BUFFER) { r = fread (mpeg->buf, 1, n, mpeg->fp); } else { r = fread (mpeg->buf, 1, MPEG_DEMUX_BUFFER, mpeg->fp); } if (r <= 0) { return (1); } n -= (unsigned) r; } return (0); } unsigned mpegd_read (mpeg_demux_t *mpeg, void *buf, unsigned n) { unsigned ret; unsigned i; unsigned char *tmp; tmp = (unsigned char *) buf; i = (n < mpeg->buf_n) ? n : mpeg->buf_n; ret = i; if (i > 0) { memcpy (tmp, &mpeg->buf[mpeg->buf_i], i); tmp += i; mpeg->buf_i += i; mpeg->buf_n -= i; n -= i; } if (n > 0) { ret += fread (tmp, 1, n, mpeg->fp); } mpeg->ofs += ret; return (ret); } int mpegd_set_offset (mpeg_demux_t *mpeg, unsigned long long ofs) { if (ofs == mpeg->ofs) { return (0); } if (ofs > mpeg->ofs) { return (mpegd_skip (mpeg, (unsigned long) (ofs - mpeg->ofs))); } return (1); } static int mpegd_seek_header (mpeg_demux_t *mpeg) { unsigned long long ofs; while (mpegd_get_bits (mpeg, 0, 24) != 1) { ofs = mpeg->ofs + 1; if (mpeg->mpeg_skip != NULL) { if (mpeg->mpeg_skip (mpeg)) { return (1); } } if (mpegd_set_offset (mpeg, ofs)) { return (1); } mpeg->skip_cnt += 1; } return (0); } static int mpegd_parse_system_header (mpeg_demux_t *mpeg) { unsigned long long ofs; mpeg->shdr.size = mpegd_get_bits (mpeg, 32, 16) + 6; mpeg->shdr.fixed = mpegd_get_bits (mpeg, 78, 1); mpeg->shdr.csps = mpegd_get_bits (mpeg, 79, 1); mpeg->shdr_cnt += 1; ofs = mpeg->ofs + mpeg->shdr.size; if (mpeg->mpeg_system_header != NULL) { if (mpeg->mpeg_system_header (mpeg)) { return (1); } } mpegd_set_offset (mpeg, ofs); return (0); } static int mpegd_parse_packet1 (mpeg_demux_t *mpeg, unsigned i) { unsigned val; unsigned long long tmp; mpeg->packet.type = 1; if (mpegd_get_bits (mpeg, i, 2) == 0x01) { i += 16; } val = mpegd_get_bits (mpeg, i, 8); if ((val & 0xf0) == 0x20) { tmp = mpegd_get_bits (mpeg, i + 4, 3); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 8, 15); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 24, 15); mpeg->packet.have_pts = 1; mpeg->packet.pts = tmp; i += 40; } else if ((val & 0xf0) == 0x30) { tmp = mpegd_get_bits (mpeg, i + 4, 3); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 8, 15); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 24, 15); mpeg->packet.have_pts = 1; mpeg->packet.pts = tmp; tmp = mpegd_get_bits (mpeg, i + 44, 3); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 48, 15); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 64, 15); mpeg->packet.have_dts = 1; mpeg->packet.dts = tmp; i += 80; } else if (val == 0x0f) { i += 8; } mpeg->packet.offset = i / 8; return (0); } static int mpegd_parse_packet2 (mpeg_demux_t *mpeg, unsigned i) { unsigned pts_dts_flag; unsigned cnt; unsigned long long tmp; mpeg->packet.type = 2; pts_dts_flag = mpegd_get_bits (mpeg, i + 8, 2); cnt = mpegd_get_bits (mpeg, i + 16, 8); if (pts_dts_flag == 0x02) { if (mpegd_get_bits (mpeg, i + 24, 4) == 0x02) { tmp = mpegd_get_bits (mpeg, i + 28, 3); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 32, 15); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 48, 15); mpeg->packet.have_pts = 1; mpeg->packet.pts = tmp; } } else if ((pts_dts_flag & 0x03) == 0x03) { if (mpegd_get_bits (mpeg, i + 24, 4) == 0x03) { tmp = mpegd_get_bits (mpeg, i + 28, 3); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 32, 15); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 48, 15); mpeg->packet.have_pts = 1; mpeg->packet.pts = tmp; } if (mpegd_get_bits (mpeg, i + 64, 4) == 0x01) { tmp = mpegd_get_bits (mpeg, i + 68, 3); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 72, 15); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 88, 15); mpeg->packet.have_dts = 1; mpeg->packet.dts = tmp; } } i += 8 * (cnt + 3); mpeg->packet.offset = i / 8; return (0); } static int mpegd_parse_packet (mpeg_demux_t *mpeg) { unsigned i; unsigned sid, ssid; unsigned long long ofs; mpeg->packet.type = 0; sid = mpegd_get_bits (mpeg, 24, 8); ssid = 0; mpeg->packet.sid = sid; mpeg->packet.ssid = ssid; mpeg->packet.size = mpegd_get_bits (mpeg, 32, 16) + 6; mpeg->packet.offset = 6; mpeg->packet.have_pts = 0; mpeg->packet.pts = 0; mpeg->packet.have_dts = 0; mpeg->packet.dts = 0; i = 48; if (((sid >= 0xc0) && (sid < 0xf0)) || (sid == 0xbd)) { while (mpegd_get_bits (mpeg, i, 8) == 0xff) { if (i > (48 + 16 * 8)) { break; } i += 8; } if (mpegd_get_bits (mpeg, i, 2) == 0x02) { if (mpegd_parse_packet2 (mpeg, i)) { return (1); } } else { if (mpegd_parse_packet1 (mpeg, i)) { return (1); } } } else if (sid == 0xbe) { mpeg->packet.type = 1; } if (sid == 0xbd) { ssid = mpegd_get_bits (mpeg, 8 * mpeg->packet.offset, 8); mpeg->packet.ssid = ssid; } if ((mpeg->mpeg_packet_check != NULL) && mpeg->mpeg_packet_check (mpeg)) { if (mpegd_skip (mpeg, 1)) { return (1); } } else { mpeg->packet_cnt += 1; mpeg->streams[sid].packet_cnt += 1; mpeg->streams[sid].size += mpeg->packet.size - mpeg->packet.offset; if (sid == 0xbd) { mpeg->substreams[ssid].packet_cnt += 1; mpeg->substreams[ssid].size += mpeg->packet.size - mpeg->packet.offset; } ofs = mpeg->ofs + mpeg->packet.size; if (mpeg->mpeg_packet != NULL) { if (mpeg->mpeg_packet (mpeg)) { return (1); } } mpegd_set_offset (mpeg, ofs); } return (0); } static int mpegd_parse_pack (mpeg_demux_t *mpeg) { unsigned sid; unsigned long long ofs; if (mpegd_get_bits (mpeg, 32, 4) == 0x02) { mpeg->pack.type = 1; mpeg->pack.scr = mpegd_get_bits (mpeg, 36, 3); mpeg->pack.scr = (mpeg->pack.scr << 15) | mpegd_get_bits (mpeg, 40, 15); mpeg->pack.scr = (mpeg->pack.scr << 15) | mpegd_get_bits (mpeg, 56, 15); mpeg->pack.mux_rate = mpegd_get_bits (mpeg, 73, 22); mpeg->pack.stuff = 0; mpeg->pack.size = 12; } else if (mpegd_get_bits (mpeg, 32, 2) == 0x01) { mpeg->pack.type = 2; mpeg->pack.scr = mpegd_get_bits (mpeg, 34, 3); mpeg->pack.scr = (mpeg->pack.scr << 15) | mpegd_get_bits (mpeg, 38, 15); mpeg->pack.scr = (mpeg->pack.scr << 15) | mpegd_get_bits (mpeg, 54, 15); mpeg->pack.mux_rate = mpegd_get_bits (mpeg, 80, 22); mpeg->pack.stuff = mpegd_get_bits (mpeg, 109, 3); mpeg->pack.size = 14 + mpeg->pack.stuff; } else { mpeg->pack.type = 0; mpeg->pack.scr = 0; mpeg->pack.mux_rate = 0; mpeg->pack.size = 4; } ofs = mpeg->ofs + mpeg->pack.size; mpeg->pack_cnt += 1; if (mpeg->mpeg_pack != NULL) { if (mpeg->mpeg_pack (mpeg)) { return (1); } } mpegd_set_offset (mpeg, ofs); mpegd_seek_header (mpeg); if (mpegd_get_bits (mpeg, 0, 32) == MPEG_SYSTEM_HEADER) { if (mpegd_parse_system_header (mpeg)) { return (1); } mpegd_seek_header (mpeg); } while (mpegd_get_bits (mpeg, 0, 24) == MPEG_PACKET_START) { sid = mpegd_get_bits (mpeg, 24, 8); if ((sid == 0xba) || (sid == 0xb9) || (sid == 0xbb)) { break; } else { mpegd_parse_packet (mpeg); } mpegd_seek_header (mpeg); } return (0); } int mpegd_parse (mpeg_demux_t *mpeg) { unsigned long long ofs; while (1) { if (mpegd_seek_header (mpeg)) { return (0); } switch (mpegd_get_bits (mpeg, 0, 32)) { case MPEG_PACK_START: if (mpegd_parse_pack (mpeg)) { return (1); } break; case MPEG_END_CODE: mpeg->end_cnt += 1; ofs = mpeg->ofs + 4; if (mpeg->mpeg_end != NULL) { if (mpeg->mpeg_end (mpeg)) { return (1); } } if (mpegd_set_offset (mpeg, ofs)) { return (1); } break; default: ofs = mpeg->ofs + 1; if (mpeg->mpeg_skip != NULL) { if (mpeg->mpeg_skip (mpeg)) { return (1); } } if (mpegd_set_offset (mpeg, ofs)) { return (0); } break; } } return (0); } mpegdemux-0.1.4/src/mpeg_parse.h0000644000000000000000000000756211145070233016575 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/mpeg_parse.h * * Created: 2003-02-01 by Hampa Hug * * Copyright: (C) 2003-2009 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #ifndef MPEG_PARSE_H #define MPEG_PARSE_H 1 #include "config.h" #include #define MPEG_DEMUX_BUFFER 4096 #define MPEG_END_CODE 0x01b9 #define MPEG_PACK_START 0x01ba #define MPEG_SYSTEM_HEADER 0x01bb #define MPEG_PACKET_START 0x0001 typedef struct { unsigned long packet_cnt; unsigned long long size; } mpeg_stream_info_t; typedef struct { unsigned size; int fixed; int csps; } mpeg_shdr_t; typedef struct { unsigned type; unsigned sid; unsigned ssid; unsigned size; unsigned offset; char have_pts; unsigned long long pts; char have_dts; unsigned long long dts; } mpeg_packet_t; typedef struct { unsigned size; unsigned type; unsigned long long scr; unsigned long mux_rate; unsigned stuff; } mpeg_pack_t; typedef struct mpeg_demux_t { int close; int free; FILE *fp; unsigned long long ofs; unsigned buf_i; unsigned buf_n; unsigned char buf[MPEG_DEMUX_BUFFER]; mpeg_shdr_t shdr; mpeg_packet_t packet; mpeg_pack_t pack; unsigned long shdr_cnt; unsigned long pack_cnt; unsigned long packet_cnt; unsigned long end_cnt; unsigned long skip_cnt; mpeg_stream_info_t streams[256]; mpeg_stream_info_t substreams[256]; void *ext; int (*mpeg_skip) (struct mpeg_demux_t *mpeg); int (*mpeg_pack) (struct mpeg_demux_t *mpeg); int (*mpeg_system_header) (struct mpeg_demux_t *mpeg); int (*mpeg_packet) (struct mpeg_demux_t *mpeg); int (*mpeg_packet_check) (struct mpeg_demux_t *mpeg); int (*mpeg_end) (struct mpeg_demux_t *mpeg); } mpeg_demux_t; mpeg_demux_t *mpegd_open_fp (mpeg_demux_t *mpeg, FILE *fp, int close); mpeg_demux_t *mpegd_open (mpeg_demux_t *mpeg, const char *fname); void mpegd_close (mpeg_demux_t *mpeg); void mpegd_reset_stats (mpeg_demux_t *mpeg); unsigned long mpegd_get_bits (mpeg_demux_t *mpeg, unsigned i, unsigned n); int mpegd_skip (mpeg_demux_t *mpeg, unsigned n); /*!*************************************************************************** * @short Read from the mpeg stream * @return The number of bytes read *****************************************************************************/ unsigned mpegd_read (mpeg_demux_t *mpeg, void *buf, unsigned n); int mpegd_set_offset (mpeg_demux_t *mpeg, unsigned long long ofs); int mpegd_parse (mpeg_demux_t *mpeg); #endif mpegdemux-0.1.4/src/mpeg_remux.c0000644000000000000000000001210111400047122016572 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/mpeg_remux.c * * Created: 2003-02-02 by Hampa Hug * * Copyright: (C) 2003-2010 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #include "config.h" #include #include #include #include #include "message.h" #include "buffer.h" #include "mpeg_parse.h" #include "mpeg_remux.h" #include "mpegdemux.h" #define mpeg_ext_fp(mpeg) ((FILE *)(mpeg)->ext) static mpeg_buffer_t shdr = { NULL, 0, 0 }; static mpeg_buffer_t pack = { NULL, 0, 0 }; static mpeg_buffer_t packet = { NULL, 0, 0 }; static unsigned sequence = 0; static int mpeg_remux_next_fp (mpeg_demux_t *mpeg) { char *fname; FILE *fp; fp = (FILE *) mpeg->ext; if (fp != NULL) { fclose (fp); mpeg->ext = NULL; } fname = mpeg_get_name (par_demux_name, sequence); if (fname == NULL) { return (1); } sequence += 1; fp = fopen (fname, "wb"); free (fname); if (fp == NULL) { return (1); } mpeg->ext = fp; return (0); } static int mpeg_remux_skip (mpeg_demux_t *mpeg) { if (par_remux_skipped == 0) { return (0); } if (mpeg_copy (mpeg, (FILE *) mpeg->ext, 1)) { return (1); } return (0); } static int mpeg_remux_system_header (mpeg_demux_t *mpeg) { if (par_no_shdr && (mpeg->shdr_cnt > 1)) { return (0); } if (mpeg_buf_write_clear (&pack, mpeg_ext_fp (mpeg))) { return (1); } if (mpeg_buf_read (&shdr, mpeg, mpeg->shdr.size)) { return (1); } if (mpeg_buf_write_clear (&shdr, mpeg_ext_fp (mpeg))) { return (1); } return (0); } static int mpeg_remux_packet (mpeg_demux_t *mpeg) { int r; unsigned sid, ssid; sid = mpeg->packet.sid; ssid = mpeg->packet.ssid; if (mpeg_stream_excl (sid, ssid)) { return (0); } r = 0; if (mpeg_buf_read (&packet, mpeg, mpeg->packet.size)) { prt_msg ("remux: incomplete packet (sid=%02x size=%u/%u)\n", sid, packet.cnt, mpeg->packet.size ); if (par_drop) { mpeg_buf_clear (&packet); return (1); } r = 1; } if (packet.cnt >= 4) { packet.buf[3] = par_stream_map[sid]; if ((sid == 0xbd) && (packet.cnt > mpeg->packet.offset)) { packet.buf[mpeg->packet.offset] = par_substream_map[ssid]; } } if (mpeg_buf_write_clear (&pack, mpeg_ext_fp (mpeg))) { return (1); } if (mpeg_buf_write_clear (&packet, mpeg_ext_fp (mpeg))) { return (1); } return (r); } static int mpeg_remux_pack (mpeg_demux_t *mpeg) { if (mpeg_buf_read (&pack, mpeg, mpeg->pack.size)) { return (1); } if (par_empty_pack) { if (mpeg_buf_write_clear (&pack, mpeg_ext_fp (mpeg))) { return (1); } } return (0); } static int mpeg_remux_end (mpeg_demux_t *mpeg) { if (par_no_end) { return (0); } if (mpeg_copy (mpeg, (FILE *) mpeg->ext, 4)) { return (1); } if (par_split) { if (mpeg_remux_next_fp (mpeg)) { return (1); } } return (0); } int mpeg_remux (FILE *inp, FILE *out) { int r; mpeg_demux_t *mpeg; mpeg = mpegd_open_fp (NULL, inp, 0); if (mpeg == NULL) { return (1); } if (par_split) { mpeg->ext = NULL; sequence = 0; if (mpeg_remux_next_fp (mpeg)) { return (1); } } else { mpeg->ext = out; } mpeg->mpeg_skip = mpeg_remux_skip; mpeg->mpeg_system_header = mpeg_remux_system_header; mpeg->mpeg_pack = mpeg_remux_pack; mpeg->mpeg_packet = mpeg_remux_packet; mpeg->mpeg_packet_check = mpeg_packet_check; mpeg->mpeg_end = mpeg_remux_end; mpeg_buf_init (&shdr); mpeg_buf_init (&pack); mpeg_buf_init (&packet); r = mpegd_parse (mpeg); if (par_no_end) { unsigned char buf[4]; buf[0] = (MPEG_END_CODE >> 24) & 0xff; buf[1] = (MPEG_END_CODE >> 16) & 0xff; buf[2] = (MPEG_END_CODE >> 8) & 0xff; buf[3] = MPEG_END_CODE & 0xff; if (fwrite (buf, 1, 4, (FILE *) mpeg->ext) != 4) { r = 1; } } if (par_split) { fclose ((FILE *) mpeg->ext); mpeg->ext = NULL; } mpegd_close (mpeg); mpeg_buf_free (&shdr); mpeg_buf_free (&pack); mpeg_buf_free (&packet); return (r); } mpegdemux-0.1.4/src/mpeg_remux.h0000644000000000000000000000303511145070233016612 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/mpeg_remux.h * * Created: 2003-02-02 by Hampa Hug * * Copyright: (C) 2003-2009 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #ifndef MPEGDEMUX_MPEG_REMUX_H #define MPEGDEMUX_MPEG_REMUX_H 1 #include "config.h" int mpeg_remux (FILE *inp, FILE *out); #endif mpegdemux-0.1.4/src/mpeg_scan.c0000644000000000000000000001023411400752636016400 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/mpeg_scan.c * * Created: 2003-02-07 by Hampa Hug * * Copyright: (C) 2003-2010 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #include "config.h" #include #include #include #include "message.h" #include "mpeg_parse.h" #include "mpeg_scan.h" #include "mpegdemux.h" static unsigned long long pts1[256]; static unsigned long long pts2[256]; static int mpeg_scan_system_header (mpeg_demux_t *mpeg) { return (0); } static int mpeg_scan_packet (mpeg_demux_t *mpeg) { FILE *fp; int skip; unsigned sid, ssid; unsigned long long ofs; sid = mpeg->packet.sid; ssid = mpeg->packet.ssid; if (mpeg_stream_excl (sid, ssid)) { return (0); } fp = (FILE *) mpeg->ext; ofs = mpeg->ofs; if (mpegd_set_offset (mpeg, ofs + mpeg->packet.size)) { fprintf (fp, "%08" PRIxMAX ": sid=%02x ssid=%02x incomplete packet\n", (uintmax_t) ofs, sid, ssid ); } skip = 0; if (sid == 0xbd) { if (mpeg->substreams[ssid].packet_cnt > 1) { if (!par_first_pts) { return (0); } if (!mpeg->packet.have_pts) { return (0); } if (mpeg->packet.pts >= pts2[ssid]) { return (0); } } if (mpeg->packet.pts < pts2[ssid]) { pts2[ssid] = mpeg->packet.pts; } } else { if (mpeg->streams[sid].packet_cnt > 1) { if (!par_first_pts) { return (0); } if (!mpeg->packet.have_pts) { return (0); } if (mpeg->packet.pts >= pts1[sid]) { return (0); } } if (mpeg->packet.pts < pts1[sid]) { pts1[sid] = mpeg->packet.pts; } } fprintf (fp, "%08" PRIxMAX ": sid=%02x", (uintmax_t) ofs, sid); if (sid == 0xbd) { fprintf (fp, "[%02x]", ssid); } else { fputs (" ", fp); } if (mpeg->packet.type == 1) { fputs (" MPEG1", fp); } else if (mpeg->packet.type == 2) { fputs (" MPEG2", fp); } else { fputs (" UNKWN", fp); } if (mpeg->packet.have_pts) { fprintf (fp, " pts=%" PRIuMAX "[%.4f]", (uintmax_t) mpeg->packet.pts, (double) mpeg->packet.pts / 90000.0 ); } fputs ("\n", fp); fflush (fp); return (0); } static int mpeg_scan_pack (mpeg_demux_t *mpeg) { return (0); } static int mpeg_scan_end (mpeg_demux_t *mpeg) { FILE *fp; fp = (FILE *) mpeg->ext; if (!par_no_end) { fprintf (fp, "%08" PRIxMAX ": end code\n", (uintmax_t) mpeg->ofs ); } return (0); } int mpeg_scan (FILE *inp, FILE *out) { int r; unsigned i; mpeg_demux_t *mpeg; for (i = 0; i < 256; i++) { pts1[i] = ~(unsigned long long) 0; pts2[i] = ~(unsigned long long) 0; } mpeg = mpegd_open_fp (NULL, inp, 0); if (mpeg == NULL) { return (1); } mpeg->ext = out; mpeg->mpeg_system_header = &mpeg_scan_system_header; mpeg->mpeg_pack = &mpeg_scan_pack; mpeg->mpeg_packet = &mpeg_scan_packet; mpeg->mpeg_packet_check = &mpeg_packet_check; mpeg->mpeg_end = &mpeg_scan_end; r = mpegd_parse (mpeg); mpeg_print_stats (mpeg, out); mpegd_close (mpeg); return (r); } mpegdemux-0.1.4/src/mpeg_scan.h0000644000000000000000000000303211145070233016373 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/mpeg_scan.h * * Created: 2003-02-07 by Hampa Hug * * Copyright: (C) 2003-2009 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #ifndef MPEGDEMUX_MPEG_SCAN_H #define MPEGDEMUX_MPEG_SCAN_H 1 #include "config.h" int mpeg_scan (FILE *inp, FILE *out); #endif mpegdemux-0.1.4/src/mpegdemux.10000644000000000000000000001473111145566275016373 0ustar00rootroot00000000000000.TH MPEGDEMUX 1 "2009-02-13" "HH" "mpegdemux" .SH NAME mpegdemux \- MPEG1/2 system stream demultiplexer .SH SYNOPSIS .BI mpegdemux " [options] [input [output]]" .SH DESCRIPTION .BR mpegdemux (1) is an MPEG1/MPEG2 system stream demultiplexer. It can be used to list the contents of an MPEG system stream and to extract elementary streams. .BR mpegdemux (1) has four primary modes of operation: .TP scan In this mode the MPEG system stream is scanned for elementary streams. .TP list In this mode the contents of an MPEG system stream are listed in a textual form. This is useful to get an overview of what's in an MPEG file .TP demux In this mode elementary streams are extracted from an MPEG system stream. The system stream packet structure is dissolved in the process. Typically each extracted stream is written to its own file. .TP remux This is like demux, except that the MPEG system stream structure is left intact. This means that the output is again an MPEG system stream with all but the selected elementary streams removed. .SH OPTIONS .TP .B -a, --ac3 AC3 sound packets in DVD MPEG2 streams have a 3 byte header that is neither part of the MPEG specification nor of the AC3 specification. When this option is used, these 3 bytes are removed to produce a correct AC3 stream. Note that this option applies to all selected substreams without checking whether they actually contain an AC3 elementary stream. \ .TP .BI "-b, --base-name " name When demultiplexing more than one stream, the output file names can be set using this option. To generate the output file name for a stream, every # character in \fIname\fR is replaced by a hex digit of the stream id. For example, to extract all video streams in one go, use something like $ mpegdemux -d -b video_##.m1v -s 0xc0-0xcf src.mpg to get files video_c0.m1v, video_c1.m1v, ... \ .TP .B -c --scan Scan a system stream for elementary streams. This is the default mode. All streams and substreams are automatically selected when using this option. \ .TP .B -d, --demux Demultiplex an MPEG system stream. The demultiplexed streams are written to the output file unless the \fB--base-name\fR option is used. If the \fB--base-name\fR option is not used, only one stream can be demultiplexed (if more streams are specified, they will be randomly interleaved in the output file). \ .TP .B -D, --no-drop Don't drop incomplete packets in demuxing and remuxing mode. \ .TP .B -e, --no-end Don't print end codes in listing mode. Additionally, in remuxing mode, make sure that there is exactly one end code at the end of the stream. \ .TP .B -E, --empty-packs When streams are removed during remuxing, packs can become empty. Including these empty packs in the output is pointless and therefore is not done by default. Use this option to force inclusion of all packs. \ .TP .B -F, --first-pts In scan mode, in addition to each stream's first packet, also list the packet with the lowest presentation time stamp. \ .TP .B -h, --no-system-headers Don't print system headers in listing mode. Additionally, in remuxing mode, don't repeat system headers. \ .TP .BI "-i, --invalid " spec Select invalid streams. Packets of invalid streams are not recognized as packets and their contents are parsed as MPEG system stream data rather than being skipped. This is useful for broken/incomplete streams. The syntax for \fIspec\fR is the same as for \fB-s\fR. Additionally, if \fIspec\fR is "-" then all streams that have not yet been selected by \fB-s\fR are made invalid. \ .TP .B -k, --no-packs Don't print packs in listing mode. \ .TP .B "-K, --remux-skipped" Copy bytes that are skipped while looking for a start code. \ .TP .B -l, --list List the system headers, packs and packets in an MPEG system stream. \ .TP .BI "-m, --packet-max-size " size Set the maximum packet size to \fIsize\fR. Packets in the input stream that are larger are considered invalid. As with the \fB-i\fR option, the packet is not simply skipped but parsed as MPEG system stream data. \ .TP .BI "-p, --substream " spec This option selects private substreams. Whenever Private Stream 1 (0xbd) is selected using \fB-s\fR, the substreams within that private stream can be selected using \fB-p\fR. The syntax for \fIspec\fR is the same as for \fB-s\fR. \ .TP .BI "-P, --substream-map " "id1 id2" Remap substream \fIid1\fR to \fIid2\fR when remuxing. \ .TP .B -r, --remux Remultiplex an MPEG system stream. The output MPEG system stream is written to the output file. Many options control what is copied from the input to the output and what is discarded. \ .TP .BI "-s, --streams " spec This option selects streams. \fIspec\fR specifies the stream IDs in the following form: [+|-][-]{/[+|-][-]} where id is either a numeric stream ID or one of \fBall\fR or \fBnone\fR. A "-" in front of an ID range means exclusion. For example the spec -s 0xc0-0xcf/-0xc2 selects all video streams (0xc0 - 0xcf) except stream 0xc2. \ .TP .BI "-S, --stream-map " "id1 id2" Remap stream \fIid1\fR to \fIid2\fR when remuxing. \ .TP .B -t, --no-packets Don't print packets in listing mode. \ .TP .B -u, --spu This option is used to extract DVD subtitles. It is necessary because the subtitle streams on DVD don't contain all the timing information (the time stamps in the packet headers are required). If this option is used during demultiplexing, the output files for all substreams are written in the following format: "SPU " (4 bytes) PTS (8 bytes, MSB first) .br SPU packet PTS (8 bytes) .br SPU packet and so on \ .TP .B -x, --split Split the remuxed stream at sequence boundaries. This option is only meaningful in remuxing mode. It can not be used together with the \fB-e\fR option. The individual sequences are written to files whose name was set with the \fB-b\fR option. \ .TP .B --help Print usage information \ .TP .B --version Print version information .SH EXAMPLES Scan a system stream for elementary streams: $ mpegdemux -c -v src.mpg List the contents of an MPEG system stream: $ mpegdemux -l -k -s all -p all src.mpg Extract the first video stream: $ mpegdemux -d -s 0xe0 src.mpg dst.m1v Extract all audio streams: $ mpegdemux -d -s 0xc0-0xdf -b audio_##.mpa src.mpg Remove the second video stream: $ mpegdemux -r -s all/-0xc1 -p all src.mpg dst.mpg Extract the first AC3 audio stream from a DVD MPEG2 system stream: $ mpegdemux -d -s 0xbd -p 0x80 --ac3 src.mpg dst.ac3 Exchange the first and the second audio stream: $ mpegdemux -r -s all -p all -S 0xc0 0xc1 -S 0xc1 0xc0 src.mpg dst.mpg .SH SEE ALSO .BR mplex "(1)" .SH AUTHOR Hampa Hug mpegdemux-0.1.4/src/mpegdemux.c0000644000000000000000000002701211400752703016434 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/mpegdemux.c * * Created: 2003-02-01 by Hampa Hug * * Copyright: (C) 2003-2010 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #include "config.h" #include #include #include #include #include "getopt.h" #include "message.h" #include "mpeg_parse.h" #include "mpeg_list.h" #include "mpeg_demux.h" #include "mpeg_remux.h" #include "mpeg_scan.h" #include "mpegdemux.h" static unsigned par_mode = PAR_MODE_SCAN; static FILE *par_inp = NULL; static FILE *par_out = NULL; unsigned char par_stream[256]; unsigned char par_substream[256]; unsigned char par_stream_map[256]; unsigned char par_substream_map[256]; int par_no_shdr = 0; int par_no_pack = 0; int par_no_packet = 0; int par_no_end = 0; int par_empty_pack = 0; int par_remux_skipped = 0; int par_split = 0; int par_drop = 1; int par_scan = 0; int par_first_pts = 0; int par_dvdac3 = 0; int par_dvdsub = 0; char *par_demux_name = NULL; unsigned par_packet_max = 0; static mpegd_option_t opts[] = { { '?', 0, "help", NULL, "Print usage information" }, { 'a', 0, "ac3", NULL, "Assume DVD AC3 headers in private streams" }, { 'b', 1, "base-name", "name", "Set the base name for demuxed streams" }, { 'c', 0, "scan", NULL, "Scan the stream [default]" }, { 'd', 0, "demux", NULL, "Demultiplex streams" }, { 'D', 0, "no-drop", NULL, "Don't drop incomplete packets" }, { 'e', 0, "no-end", NULL, "Don't list end codes [no]" }, { 'E', 0, "empty-packs", NULL, "Remux empty packs [no]" }, { 'F', 0, "first-pts", NULL, "Print packet with lowest PTS [no]" }, { 'h', 0, "no-system-headers", NULL, "Don't list system headers" }, { 'i', 1, "invalid", "id", "Select invalid streams [none]" }, { 'k', 0, "no-packs", NULL, "Don't list packs" }, { 'K', 0, "remux-skipped", NULL, "Copy skipped bytes when remuxing [no]" }, { 'l', 0, "list", NULL, "List the stream contents" }, { 'm', 1, "packet-max-size", "int", "Set the maximum packet size [0]" }, { 'p', 1, "substream", "id", "Select substreams [none]" }, { 'P', 2, "substream-map", "id1 id2", "Remap substream id1 to id2" }, { 'r', 0, "remux", NULL, "Copy modified input to output" }, { 's', 1, "stream", "id", "Select streams [none]" }, { 'S', 2, "stream-map", "id1 id2", "Remap stream id1 to id2" }, { 't', 0, "no-packets", NULL, "Don't list packets" }, { 'u', 0, "spu", NULL, "Assume DVD subtitles in private streams" }, { 'V', 0, "version", NULL, "Print version information" }, { 'x', 0, "split", NULL, "Split sequences while remuxing [no]" }, { -1, 0, NULL, NULL, NULL } }; static void print_help (void) { mpegd_getopt_help ( "mpegdemux: demultiplex MPEG1/2 system streams", "usage: mpegdemux [options] [input [output]]", opts ); fflush (stdout); } static void print_version (void) { fputs ( "mpegdemux version " MPEGDEMUX_VERSION_STR "\n\n" "Copyright (C) 2003-2010 Hampa Hug \n", stdout ); } static char *str_clone (const char *str) { char *ret; ret = malloc (strlen (str) + 1); if (ret == NULL) { return (NULL); } strcpy (ret, str); return (ret); } static const char *str_skip_white (const char *str) { while ((*str == ' ') || (*str == '\t')) { str += 1; } return (str); } static int str_get_streams (const char *str, unsigned char stm[256], unsigned msk) { unsigned i; int incl; char *tmp; unsigned stm1, stm2; incl = 1; while (*str != 0) { str = str_skip_white (str); if (*str == '+') { str += 1; incl = 1; } else if (*str == '-') { str += 1; incl = 0; } else { incl = 1; } if (strncmp (str, "all", 3) == 0) { str += 3; stm1 = 0; stm2 = 255; } else if (strncmp (str, "none", 4) == 0) { str += 4; stm1 = 0; stm2 = 255; incl = !incl; } else { stm1 = (unsigned) strtoul (str, &tmp, 0); if (tmp == str) { return (1); } str = tmp; if (*str == '-') { str += 1; stm2 = (unsigned) strtoul (str, &tmp, 0); if (tmp == str) { return (1); } str = tmp; } else { stm2 = stm1; } } if (incl) { for (i = stm1; i <= stm2; i++) { stm[i] |= msk; } } else { for (i = stm1; i <= stm2; i++) { stm[i] &= ~msk; } } str = str_skip_white (str); if (*str == '/') { str += 1; } } return (0); } char *mpeg_get_name (const char *base, unsigned sid) { unsigned n; unsigned dig; char *ret; if (base == NULL) { base = "stream_##.dat"; } n = 0; while (base[n] != 0) { n += 1; } n += 1; ret = (char *) malloc (n); if (ret == NULL) { return (NULL); } while (n > 0) { n -= 1; ret[n] = base[n]; if (ret[n] == '#') { dig = sid % 16; sid = sid / 16; if (dig < 10) { ret[n] = '0' + dig; } else { ret[n] = 'a' + dig - 10; } } } return (ret); } int mpeg_stream_excl (unsigned char sid, unsigned char ssid) { if ((par_stream[sid] & PAR_STREAM_SELECT) == 0) { return (1); } if (sid == 0xbd) { if ((par_substream[ssid] & PAR_STREAM_SELECT) == 0) { return (1); } } return (0); } /* check if packet is valid. returns 0 if it is. */ int mpeg_packet_check (mpeg_demux_t *mpeg) { if ((par_packet_max > 0) && (mpeg->packet.size > par_packet_max)) { return (1); } if (par_stream[mpeg->packet.sid] & PAR_STREAM_INVALID) { return (1); } return (0); } void mpeg_print_stats (mpeg_demux_t *mpeg, FILE *fp) { unsigned i; fprintf (fp, "System headers: %lu\n" "Packs: %lu\n" "Packets: %lu\n" "End codes: %lu\n" "Skipped: %lu bytes\n", mpeg->shdr_cnt, mpeg->pack_cnt, mpeg->packet_cnt, mpeg->end_cnt, mpeg->skip_cnt ); for (i = 0; i < 256; i++) { if (mpeg->streams[i].packet_cnt > 0) { fprintf (fp, "Stream %02x: " "%lu packets / %" PRIuMAX " bytes\n", i, mpeg->streams[i].packet_cnt, (uintmax_t) mpeg->streams[i].size ); } } for (i = 0; i < 256; i++) { if (mpeg->substreams[i].packet_cnt > 0) { fprintf (fp, "Substream %02x: " "%lu packets / %" PRIuMAX " bytes\n", i, mpeg->substreams[i].packet_cnt, (uintmax_t) mpeg->substreams[i].size ); } } fflush (fp); } int mpeg_copy (mpeg_demux_t *mpeg, FILE *fp, unsigned n) { unsigned char buf[4096]; unsigned i, j; while (n > 0) { i = (n < 4096) ? n : 4096; j = mpegd_read (mpeg, buf, i); if (j > 0) { if (fwrite (buf, 1, j, fp) != j) { return (1); } } if (i != j) { return (1); } n -= i; } return (0); } int main (int argc, char **argv) { unsigned i; int r; unsigned id1, id2; char **optarg; for (i = 0; i < 256; i++) { par_stream[i] = 0; par_substream[i] = 0; par_stream_map[i] = i; par_substream_map[i] = i; } while (1) { r = mpegd_getopt (argc, argv, &optarg, opts); if (r == GETOPT_DONE) { break; } if (r < 0) { return (1); } switch (r) { case '?': print_help(); return (0); case 'a': par_dvdac3 = 1; break; case 'b': if (par_demux_name != NULL) { free (par_demux_name); } par_demux_name = str_clone (optarg[0]); break; case 'c': par_mode = PAR_MODE_SCAN; for (i = 0; i < 256; i++) { par_stream[i] |= PAR_STREAM_SELECT; par_substream[i] |= PAR_STREAM_SELECT; } break; case 'd': par_mode = PAR_MODE_DEMUX; break; case 'D': par_drop = 0; break; case 'e': par_no_end = 1; break; case 'E': par_empty_pack = 1; break; case 'F': par_first_pts = 1; break; case 'h': par_no_shdr = 1; break; case 'i': if (strcmp (optarg[0], "-") == 0) { for (i = 0; i < 256; i++) { if (par_stream[i] & PAR_STREAM_SELECT) { par_stream[i] &= ~PAR_STREAM_INVALID; } else { par_stream[i] |= PAR_STREAM_INVALID; } } } else { if (str_get_streams (optarg[0], par_stream, PAR_STREAM_INVALID)) { prt_err ("%s: bad stream id (%s)\n", argv[0], optarg[0]); return (1); } } break; case 'k': par_no_pack = 1; break; case 'K': par_remux_skipped = 1; break; case 'l': par_mode = PAR_MODE_LIST; break; case 'm': par_packet_max = (unsigned) strtoul (optarg[0], NULL, 0); break; case 'p': if (str_get_streams (optarg[0], par_substream, PAR_STREAM_SELECT)) { prt_err ("%s: bad substream id (%s)\n", argv[0], optarg[0]); return (1); } break; case 'P': id1 = (unsigned) strtoul (optarg[0], NULL, 0); id2 = (unsigned) strtoul (optarg[1], NULL, 0); par_substream_map[id1 & 0xff] = id2 & 0xff; break; case 'r': par_mode = PAR_MODE_REMUX; break; case 's': if (str_get_streams (optarg[0], par_stream, PAR_STREAM_SELECT)) { prt_err ("%s: bad stream id (%s)\n", argv[0], optarg[0]); return (1); } break; case 'S': id1 = (unsigned) strtoul (optarg[0], NULL, 0); id2 = (unsigned) strtoul (optarg[1], NULL, 0); par_stream_map[id1 & 0xff] = id2 & 0xff; break; case 't': par_no_packet = 1; break; case 'u': par_dvdsub = 1; break; case 'V': print_version(); return (0); case 'x': par_split = 1; break; case 0: if (par_inp == NULL) { if (strcmp (optarg[0], "-") == 0) { par_inp = stdin; } else { par_inp = fopen (optarg[0], "rb"); } if (par_inp == NULL) { prt_err ( "%s: can't open input file (%s)\n", argv[0], optarg[0] ); return (1); } } else if (par_out == NULL) { if (strcmp (optarg[0], "-") == 0) { par_out = stdout; } else { par_out = fopen (optarg[0], "wb"); } if (par_out == NULL) { prt_err ( "%s: can't open output file (%s)\n", argv[0], optarg[0] ); return (1); } } else { prt_err ("%s: too many files (%s)\n", argv[0], optarg[0] ); return (1); } break; default: return (1); } } if (par_inp == NULL) { par_inp = stdin; } if (par_out == NULL) { par_out = stdout; } switch (par_mode) { case PAR_MODE_SCAN: r = mpeg_scan (par_inp, par_out); break; case PAR_MODE_LIST: r = mpeg_list (par_inp, par_out); break; case PAR_MODE_REMUX: r = mpeg_remux (par_inp, par_out); break; case PAR_MODE_DEMUX: r = mpeg_demux (par_inp, par_out); break; default: r = 1; break; } if (r) { return (1); } return (0); } mpegdemux-0.1.4/src/mpegdemux.h0000644000000000000000000000525511400752603016445 0ustar00rootroot00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: src/mpegdemux.h * * Created: 2003-02-01 by Hampa Hug * * Copyright: (C) 2003-2010 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #ifndef MPEGDEMUX_H #define MPEGDEMUX_H 1 #include "config.h" #ifdef HAVE_INTTYPES_H #include #else typedef unsigned long uintmax_t; #define PRIuMAX "lu" #define PRIxMAX "lx" #endif #define PAR_STREAM_SELECT 0x01 #define PAR_STREAM_INVALID 0x02 #define PAR_MODE_SCAN 0 #define PAR_MODE_LIST 1 #define PAR_MODE_REMUX 2 #define PAR_MODE_DEMUX 3 extern unsigned char par_stream[256]; extern unsigned char par_substream[256]; extern unsigned char par_stream_map[256]; extern unsigned char par_substream_map[256]; extern unsigned char par_invalid[256]; extern int par_no_shdr; extern int par_no_pack; extern int par_no_packet; extern int par_no_end; extern int par_empty_pack; extern int par_remux_skipped; extern int par_split; extern int par_drop; extern int par_scan; extern int par_first_pts; extern int par_dvdac3; extern int par_dvdsub; extern char *par_demux_name; char *mpeg_get_name (const char *base, unsigned sid); int mpeg_stream_excl (unsigned char sid, unsigned char ssid); int mpeg_packet_check (mpeg_demux_t *mpeg); void mpeg_print_stats (mpeg_demux_t *mpeg, FILE *fp); int mpeg_copy (mpeg_demux_t *mpeg, FILE *fp, unsigned n); #endif mpegdemux-0.1.4/AUTHORS0000644000000000000000000000003307631642244014561 0ustar00rootroot00000000000000Hampa Hug mpegdemux-0.1.4/COPYING0000644000000000000000000004310410526767625014562 0ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. mpegdemux-0.1.4/ChangeLog0000644000000000000000000004257111413411636015270 0ustar00rootroot00000000000000commit 5e7243c2a23a09e8029554cf40e732f4d315c15d Author: Hampa Hug Date: 2010-07-02 18:28:14 +0200 Update for version 0.1.4 commit 728b20355125bda8807ae7dd49c603e354b0c4b3 Author: Hampa Hug Date: 2010-07-02 14:01:03 +0200 Add a make file for DOS This is a make file for Turbo C / Turbo C++ / Borland C++ for DOS. commit 38ed3cc761c655ec647935e3c0fde8eac149336e Author: Hampa Hug Date: 2010-05-31 17:29:53 +0200 configure: Regenerate with autoconf 2.65 commit db57644308dd23900a27a0e3ee384ccf9ecd257d Author: Hampa Hug Date: 2010-05-31 17:29:07 +0200 Add a new command line option parser The new command line option parser supports combining single character options (-ab is equivalent to -a -b). commit 0bf510b84ac9d40520a4040532fad5d45d3b38d9 Author: Hampa Hug Date: 2010-05-31 17:28:30 +0200 Use C99 printf format macros for 64 bit integers commit 79dd582e0ff273945462e9a0a6f0495d9cab23cf Author: Hampa Hug Date: 2010-05-31 17:28:03 +0200 Check for inttypes.h and use it if available commit 139964ca1346dcd740e25f20f0ab90383ae7ce80 Author: Hampa Hug Date: 2010-05-29 07:11:54 +0200 Support executable file extensions commit b8d5d78784797351d0a63658ddccf7960835addb Author: Hampa Hug Date: 2010-05-29 01:14:26 +0200 Check the return value of fwrite() commit fc39a250fe0f65666f2bf807073e3ba3670b35df Author: Hampa Hug Date: 2010-03-15 09:06:13 +0100 configure: Rebuild with autoconf 2.64 commit bce40579e63c9e42921d4b45692028807ce4233d Author: Hampa Hug Date: 2010-03-15 09:05:33 +0100 configure: Remove "git" from version string commit 5875734f9366f2b2f2b2f958710bde29fbdce859 Author: Hampa Hug Date: 2009-07-28 01:11:52 +0200 New non-recursive build system commit c26469b77f16278ff555b8841ff391cb552c72e8 Author: Hampa Hug Date: 2009-02-15 18:28:55 +0000 Update for version 0.1.3 commit e2b6c39a593068923d0ce188572647985a28863e Author: Hampa Hug Date: 2009-02-14 16:09:33 +0000 Sort the command line options in the man page and help text commit 7fb4dc9a43f3bcf4dad4b198ead727d6374806fd Author: Hampa Hug Date: 2009-02-13 11:47:34 +0000 Remove obsolete file commit 7211c8cd6905907a6d3e88506745c5b4e6008d1d Author: Hampa Hug Date: 2009-02-13 11:46:24 +0000 Add "make dist" target commit 950188be33f9752d24f4613fba9992988250c585 Author: Hampa Hug Date: 2009-02-12 18:55:23 +0000 Fix all file header comments This patch removes all subversion keywords and makes the formatting of file header comments more consistent. This is purely cosmetics. commit a5f89342bee7a22ff3898b96b32920b7dfcde414 Author: Hampa Hug Date: 2008-12-29 21:42:03 +0000 Clarify that the -a and -u options apply to all substreams commit dcf2c23b86bb9d96b275c4f29bef711457199f82 Author: Hampa Hug Date: 2008-12-29 21:40:50 +0000 Check the packet size when demuxing (based on patch by Bas Zoetekouw) commit 4ebc5b981f290de9d19d1c614c1fe336137b5f17 Author: Hampa Hug Date: 2008-10-24 23:14:44 +0000 Define _POSIX_C_SOURCE in config.h commit 9522f059aa7a9afba4f635152909109225692482 Author: Hampa Hug Date: 2007-12-08 01:26:24 +0000 Don't strip binaries by default commit 20062f71ffb2a487e2c1cb1cb667dfd22a1c9ca1 Author: Hampa Hug Date: 2007-01-02 12:05:00 +0000 Added new option -K to copy skipped bytes when remuxing. commit fb880ec9612bbadf51a23cb689c6fb4d1af0e981 Author: Hampa Hug Date: 2007-01-02 11:40:05 +0000 Reversed the removal of str_clone() because strdup() is not in ISO C. commit 2fb9d7ffee76ed56cae8d5f06b43bb33d3c96bf9 Author: Hampa Hug Date: 2007-01-02 11:28:09 +0000 Changed indentation. This is all cosmetics. commit 2dc5c163aba68cdedde6ba591c988844f060dde4 Author: Hampa Hug Date: 2006-11-16 04:56:53 +0000 Updated. commit f7d67c718563717d80126cda08ffc4a1fd089ae3 Author: Hampa Hug Date: 2006-07-15 21:21:24 +0000 Added autogen.sh script. commit ffe1f1e1180384bfae0282891e11d82719b175eb Author: Hampa Hug Date: 2006-07-15 21:21:08 +0000 Added new autoconf variable datarootdir. commit bdffbc0f1e8548d5bf14a94d0e8d0083876ed53b Author: Hampa Hug Date: 2006-07-15 21:20:39 +0000 - Removed useless test for size of long long. - Modified info output a bit. commit ef3fd865da249dda6e9d98674673424042532a3d Author: Hampa Hug Date: 2006-07-15 21:19:49 +0000 Updated. commit c9584e8388427b21778cebb4cf46a47343dbdf8f Author: Hampa Hug Date: 2006-07-15 21:19:16 +0000 Don't gzip compress man page. commit 624a19ff83b870403216dd59bce58a2c563dd8cb Author: Hampa Hug Date: 2005-04-24 01:06:13 +0000 - Added new options "-S" and "-P" to remap streams and substreams. - Some cleanups. commit c28104581174807b747bc204079001edaf40628b Author: Hampa Hug Date: 2005-03-25 19:05:24 +0000 Made build process less verbose. commit b09c8a52fe14fd5ea7a933a6d65de4d8501f1ea5 Author: Hampa Hug Date: 2005-03-25 19:05:09 +0000 Fixed a typo. commit 1d52b5624e045ebf6b52ddbd5269b17599cd8f85 Author: Hampa Hug Date: 2005-03-25 19:04:27 +0000 Renamed inclusion guard. commit 1d3edd60145385273fcea4eea81b8b91960a1674 Author: Hampa Hug Date: 2005-01-12 02:58:06 +0000 Removed --verbose option from the man page. commit 0018c5db6e68a6968b579a0679eb69b04c4d2f9e Author: Hampa Hug Date: 2004-10-12 02:43:50 +0000 - Cleaned up stream selection code. - Added new option -m to set a packet size limit. commit 60376f10b05fa892046433481625884a8b3d76d1 Author: Hampa Hug Date: 2004-09-19 07:16:57 +0000 Updated for version 0.1.2. commit e6682dfa225d300a6aab373631dccf5e8ddbccb7 Author: Hampa Hug Date: 2004-09-19 07:16:45 +0000 Changed ULL suffix to (unsigned long long) cast. commit d82c9b3134226c106234419682ee0c7c7eb684f3 Author: Hampa Hug Date: 2004-09-19 06:04:27 +0000 Updated for version 0.1.1. commit 5c4fb9cdf062207d59dc7c042f386edaf7f91d7f Author: Hampa Hug Date: 2004-04-08 18:57:31 +0000 Added a new command line option (-F, --first-pts) to list the packet with the lowest PTS in scan mode. commit 64259c56ec45f77750fc07314cac13abba91d29f Author: Hampa Hug Date: 2004-01-14 11:10:53 +0000 This is a verbatim copy of the GPL. commit c1a85197966b620cfcf3db40fbd64ce3373dbd51 Author: Hampa Hug Date: 2004-01-02 18:20:15 +0000 Made the transition from CVS to SVN. This is the first subversion commit. commit e38fcfaf638b6d59d5da8d975106a257bfe8ec83 Author: Hampa Hug Date: 2003-12-30 10:54:00 +0000 Forgot to save. commit 92b3c9f88680afe6a67f69c6a1584445d9c41dc1 Author: Hampa Hug Date: 2003-12-30 10:52:35 +0000 Added simple inversion for invalid streams. commit 5b84ec103969971bb3cbd26a1f4536c9bd207bba Author: Hampa Hug Date: 2003-10-21 04:41:11 +0000 Updated version handling. commit e28ae941d3a249e201c9cf2c595abe6159866b56 Author: Hampa Hug Date: 2003-10-21 04:39:51 +0000 Forgot to write SPU header if output file was specified with -o instead of -b. commit ce367d4b54da0fe8edd04429145c0ec1663a6307 Author: Hampa Hug Date: 2003-09-10 17:05:00 +0000 Streams can now be declared invalid. commit 254d89657a0196fe177bb086cf7b13c39998a9ca Author: Hampa Hug Date: 2003-08-10 21:56:33 +0000 Updated for version 0.1.1. commit 7b90e2ffd871660b3216de9689961a79ac78c954 Author: Hampa Hug Date: 2003-08-10 21:35:13 +0000 Updated for version 0.1.0. commit e204e6f0ed873fdbb76c82bf34fabe547421637d Author: Hampa Hug Date: 2003-08-02 11:11:25 +0000 Modified text output. commit 5c7c30eaa564b485cfd8d816bc511f103e689322 Author: Hampa Hug Date: 2003-08-02 11:11:02 +0000 Increased buffer size to 4KB. commit d69ceff9f679928e4fc30d5c95e8795591ba0088 Author: Hampa Hug Date: 2003-07-28 06:13:10 +0000 Added PTS/DTS fields to packet_t. Overhauled packet parsing. commit 88b4ee2946a6dd6ce254f752068f9ed1e7972756 Author: Hampa Hug Date: 2003-07-28 06:12:20 +0000 Only print PTS/DTS if we have them. commit 30d15991ec29e8e2793936ed70da2062530047f9 Author: Hampa Hug Date: 2003-07-28 06:11:50 +0000 Print packet type as string. commit 832673e8f3cc566f1dde2cbfab2743baff4d1eb7 Author: Hampa Hug Date: 2003-07-12 12:21:15 +0000 Fixed a typo. commit e92b2cc610333bdcd75d78b97a5d4a6ae0b98c65 Author: Hampa Hug Date: 2003-07-12 12:18:03 +0000 Updated. commit 178308ce0eb3ab89d6f7ae870d1eab2030b61900 Author: Hampa Hug Date: 2003-07-12 12:14:59 +0000 File aclocal.m4 is now longer needed. commit 89202e7004b507a69c52e6cc4932311875dc9736 Author: Hampa Hug Date: 2003-07-12 12:09:09 +0000 Substreams can now be demuxed into individual files. commit 8f263e7afeea3a5948dd4942a98bc484f764f132 Author: Hampa Hug Date: 2003-07-12 11:32:49 +0000 Removed one byte too many in AC3 streams. commit 11a04dd3e803d120a766dd8db6729d1d37965362 Author: Hampa Hug Date: 2003-06-07 18:55:47 +0000 Sequences can now be split while remuxing. commit 661c35d1dd9bd1c3cabbe65e67bd963fe3e918a4 Author: Hampa Hug Date: 2003-06-07 04:20:14 +0000 Also list end codes when scanning. commit 842c968083693adad3660ae62f40bfe8b72ba98f Author: Hampa Hug Date: 2003-04-09 00:51:03 +0000 Updated for version 0.0.5. commit eebb2f22b7f587454ff65cb8a8f79e5af030cc81 Author: Hampa Hug Date: 2003-04-09 00:47:21 +0000 Updated for version 0.0.4. commit c13fd7768fb230de09a0ad77b88754d2c351e77a Author: Hampa Hug Date: 2003-04-08 23:21:11 +0000 Report all skipped bytes. commit 7898694387b2682c714d100b961254b8bbd33be6 Author: Hampa Hug Date: 2003-04-08 23:20:59 +0000 List skipped bytes. commit 39aa6db308e453ffe840e449376499bcedeb1667 Author: Hampa Hug Date: 2003-04-08 22:03:26 +0000 Disallow stream ID 0xbb. commit 9509371697d533bc1da7e5119ca9bed3bcdf9d9c Author: Hampa Hug Date: 2003-04-08 19:19:30 +0000 Report incomplete packets and number of end codes. commit bf201723b20ead98c7f0fabbed93fc448a9da49e Author: Hampa Hug Date: 2003-04-08 19:01:58 +0000 Incomplete packets are now dropped by default. Lots of other small changes. commit 92858df49f8d2ea26e5fb2656894812c52c578f2 Author: Hampa Hug Date: 2003-04-03 18:09:54 +0000 Count skipped bytes correctly. commit 7c585398e324c2c1367e2012afec325e295d986e Author: Hampa Hug Date: 2003-03-26 08:23:37 +0000 Added AC_PREREQ(). commit 7f2c800e1740ec267749a76f62aa192737357373 Author: Hampa Hug Date: 2003-03-08 21:12:26 +0000 Flush output in scan mode. commit 4239f45b079274be38a845d976f69a426fc1f5d5 Author: Hampa Hug Date: 2003-03-08 08:43:40 +0000 Compile time is now fixed during configure. commit e12970b6a771564577337eeb96185a125ca9e83f Author: Hampa Hug Date: 2003-03-08 08:23:32 +0000 Always print statistics when listing or scanning. Removed parameter --verbose. commit cb3c88150c1a9633c69d2c946116a88afcd25658 Author: Hampa Hug Date: 2003-03-08 08:19:35 +0000 Remux packs that contain a system header. commit c88351bbeda498b47e3a557b1f8febc5a12a8e4d Author: Hampa Hug Date: 2003-03-08 08:19:17 +0000 Updated for version 0.0.4. commit 96d5a34afedd125aaf7a5de7dd591af6020bb7da Author: Hampa Hug Date: 2003-03-08 06:50:33 +0000 Updated for version 0.0.3. commit b17e7ad21312356ecf2289245ceaceb817d57a93 Author: Hampa Hug Date: 2003-03-07 08:16:10 +0000 Massive reshuffling. Fixed a serious stream syntax bug. Changed many command line parameters. commit 0c0aed8be1e7ce3d072ab62254d4cd4c2eec7369 Author: Hampa Hug Date: 2003-03-07 08:15:26 +0000 Added new scanning mode. commit efe1bf2aa5f774748c927cd87f1ef4b0bc203191 Author: Hampa Hug Date: 2003-03-06 13:37:42 +0000 Bugfixes. commit 4ef83418b0fa21d391ba03aa8430778055b124a3 Author: Hampa Hug Date: 2003-03-06 13:02:01 +0000 Updated for version 0.0.3. commit a581dbbc9d69cfd433f6048cb438293aad9170ec Author: Hampa Hug Date: 2003-03-06 12:57:26 +0000 Updated for version 0.0.2. commit 7741ffba4d139a97933ad908b78a0c9f5cbc99a5 Author: Hampa Hug Date: 2003-03-06 12:53:53 +0000 Fixed help text (option -p was used twice). commit 56257e991d29c2e156466a8834d446795c7ef881 Author: Hampa Hug Date: 2003-03-06 12:53:35 +0000 The man page now deserves its name. commit 209eaf752e7a3718adb5cd7c42c9fb29048889fb Author: Hampa Hug Date: 2003-03-06 12:53:08 +0000 Hacked up a short readme. commit 21774eac6bd450629438bfbce143b1ba677b3cf3 Author: Hampa Hug Date: 2003-03-06 12:52:52 +0000 Fixed email address. commit d57233235ec6c91dc164e57d12f46d8a3fcf8e64 Author: Hampa Hug Date: 2003-03-05 13:30:55 +0000 Fixed help text again. commit d2dad913f605c7deab31f119bc71d1b5c6e6af9a Author: Hampa Hug Date: 2003-03-05 12:21:39 +0000 Demuxed streams are now written to the output file by default. commit ce5c145d7eac5b5e0101141d38ff082d8375d397 Author: Hampa Hug Date: 2003-03-05 12:21:09 +0000 Fixed help message. commit 3b38a31f8c4c084e292b5043f8652b76c1259963 Author: Hampa Hug Date: 2003-03-05 10:35:17 +0000 Added option --empty-packs. Empty packs are no longer remuxed by default. commit 20904d21fb503809fde59938e626e2320449f3b0 Author: Hampa Hug Date: 2003-03-05 07:43:59 +0000 Can now demux DVD subtitles. commit afaf33c0d8bb4ae888d30e041bf8ff9fa8782cf0 Author: Hampa Hug Date: 2003-03-02 11:19:49 +0000 All files now include config.h. Added large file support. commit ae0301ff4e6f967f4a36a1dcf721ad5563a39b01 Author: Hampa Hug Date: 2003-03-02 11:19:28 +0000 Remove substream ID from private streams. commit 96efd460df1f706946e4ff19e617f0295b5b15f0 Author: Hampa Hug Date: 2003-02-08 07:11:56 +0000 Support continuing after an end code. commit 0822f2ccc8db2a98160f0c5e1448cbb942a3d90f Author: Hampa Hug Date: 2003-02-05 03:00:54 +0000 Optimized the case of aligned bytes. commit 31c49190fdeef49a78a908b39350233a35b92ed7 Author: Hampa Hug Date: 2003-02-05 02:48:08 +0000 mpegd_set_offset() now returns an error. Seeking headers is always forced. commit 7bac38b90c8831674dad609129034e6520e725ad Author: Hampa Hug Date: 2003-02-04 22:16:17 +0000 A lot of restructuring and redefining. commit aa5224debe57d855e51e6ce7a71ea97f19ff158f Author: Hampa Hug Date: 2003-02-04 17:10:22 +0000 Massive changes to command line parameters and substream handling. commit da7b4f47d23b157dc85e942efaa3fb3731901725 Author: Hampa Hug Date: 2003-02-04 03:25:19 +0000 Implemented demuxing of AC3 audio streams and substreams. commit d04bb3983e87016e3a908c819f9607d1899ebacd Author: Hampa Hug Date: 2003-02-04 02:48:25 +0000 Fixed a serious bug in buffer handling. commit c5418fe837773de62663bf72f7ba91ec6ca88535 Author: Hampa Hug Date: 2003-02-04 02:48:11 +0000 Modified --demux parameter. Output file base name is now set separately. commit 9176930f6cdf626f39181589f1f11ce7e065c556 Author: Hampa Hug Date: 2003-02-03 20:58:34 +0000 A lot of fixes for mpeg2. commit 0144239944a7bc0c0a2a0eff8475d1b99c22a4e6 Author: Hampa Hug Date: 2003-02-03 16:16:31 +0000 Added number of skipped bytes to statistics. commit c207b5b8d8816ad12fc8dbae68701f58ff0122d9 Author: Hampa Hug Date: 2003-02-02 21:19:50 +0000 Added man page prototype. commit 4269e8b70af0ecaa192c887049987fae2310b83c Author: Hampa Hug Date: 2003-02-02 21:14:49 +0000 Added stream statistics to parser. commit 6fafff6089e1e1eed49162610c18992e609d69ab Author: Hampa Hug Date: 2003-02-02 21:14:31 +0000 Removed unneeded tests for header files. commit 617115eb98e1d9aa7fcb2445690e5b6261b0795b Author: Hampa Hug Date: 2003-02-02 20:34:20 +0000 Updated for version 0.0.2. commit 9965dd06a997859c0e5ca03ccf701b72ac4eb55c Author: Hampa Hug Date: 2003-02-02 20:31:24 +0000 Added copyright message. commit a87134b8bd13f3bbf1fc19a863938ee7379660a3 Author: Hampa Hug Date: 2003-02-02 20:26:12 +0000 Initial revision mpegdemux-0.1.4/INSTALL0000644000000000000000000002230711233432070014535 0ustar00rootroot00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. mpegdemux-0.1.4/Makefile.in0000644000000000000000000001115511233432070015550 0ustar00rootroot00000000000000# Makefile prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ etcdir = @sysconfdir@ incdir = @includedir@ libdir = @libdir@ mandir = @mandir@ datarootdir = @datarootdir@ datadir = @datadir@ srcdir := @srcdir@ VPATH = $(srcdir) ifeq "$(V)" "1" QP = @\# QR = else QP = @ QR = @ endif all: all2 AR := @AR@ RANLIB := @RANLIB@ INSTALL := @INSTALL@ INSTALL_PROGRAM := @INSTALL@ BIN := BINS := ETC := MAN1 := MAN2 := MAN3 := SHARE := CLN := DCL := DIRS := TARGETS := DIST := include Makefile.inc MANA := $(MAN1) $(MAN2) $(MAN3) MANT := $(foreach f,$(MANA),$(f).txt $(f).ps) CLN += $(MANT) all2: subdirs $(TARGETS) subdirs: ifneq "$(DIRS)" "" $(QR)for f in $(DIRS) ; do \ if test -d "$$f" ; then continue ; fi ; \ if test x$(V) != x1 ; then echo " MKDIR $$f" ; fi ; \ mkdir -p "$$f" ; \ done endif clean: ifneq "$(CLN)" "" $(QR)for f in $(CLN) ; do \ if test x$(V) != x1 ; then echo " RM $$f" ; fi ; \ rm -f "$$f" ; \ done endif distclean: clean ifneq "$(DCL)" "" $(QR)for f in $(DCL) ; do \ if test x$(V) != x1 ; then echo " RM $$f" ; fi ; \ rm -f "$$f" ; \ done endif man: $(MANT) install: install-bin install-bins install-etc install-man install-share install-extra install-bin: ifneq "$(BIN)" "" $(QP)echo " MKDIR $(bindir)" $(QR)$(INSTALL) -d -m 755 $(DESTDIR)$(bindir) $(QR)for f in $(BIN) ; do \ dst=$(DESTDIR)$(bindir)/`basename "$$f"` ; \ if test x$(V) != x1 ; then echo " CP $$dst" ; fi ; \ $(INSTALL_PROGRAM) -m 755 "$$f" "$$dst" ; \ done endif install-bins: ifneq "$(BINS)" "" $(QP)echo " MKDIR $(bindir)" $(QR)$(INSTALL) -d -m 755 $(DESTDIR)$(bindir) $(QR)for f in $(BINS) ; do \ dst=$(DESTDIR)$(bindir)/`basename "$$f"` ; \ if test x$(V) != x1 ; then echo " CP $$dst" ; fi ; \ $(INSTALL) -m 755 "$$f" "$$dst" ; \ done endif install-etc: ifneq "$(ETC)" "" $(QP)echo " MKDIR $(DESTDIR)$(etcdir)" $(QR)$(INSTALL) -d -m 755 $(DESTDIR)$(etcdir) $(QR)for f in $(ETC) ; do \ dst=$(DESTDIR)$(etcdir)/`basename "$$f"` ; \ if test x$(V) != x1 ; then echo " CP $$dst" ; fi ; \ $(INSTALL) -m 644 "$$f" "$$dst" ; \ done endif install-man: ifneq "$(MAN1)" "" $(QP)echo " MKDIR $(mandir)/man1" $(QR)$(INSTALL) -d -m 755 $(DESTDIR)$(mandir)/man1 $(QR)for f in $(MAN1) ; do \ dst=$(DESTDIR)$(mandir)/man1/`basename "$$f"` ; \ if test x$(V) != x1 ; then echo " CP $$dst" ; fi ; \ $(INSTALL) -m 644 "$(srcdir)/$$f" "$$dst" ; \ done endif install-share: ifneq "$(SHARE)" "" $(QP)echo " MKDIR $(DESTDIR)$(datadir)" $(QR)$(INSTALL) -d -m 755 $(DESTDIR)$(datadir) $(QR)for f in $(SHARE) ; do \ dst=$(DESTDIR)$(datadir)/`basename "$$f"` ; \ if test x$(V) != x1 ; then echo " CP $$dst" ; fi ; \ $(INSTALL) -m 644 "$$f" "$$dst" ; \ done endif install-extra: dist: dist-dist dist-contrib dist-extra dist-version $(QP)echo " TAR $(distdir).tar" $(QR)( cd "$(distdir)"/.. && \ tar -cvf "$(distdir).tar" `basename "$(distdir)"` > /dev/null ) $(QP)echo " GZIP $(distdir).tar.gz" $(QR)rm -f "$(distdir).tar.gz" $(QR)gzip -9 "$(distdir).tar" dist-dist: ifneq "$(DIST)" "" $(QP)echo " MKDIR $(distdir)" $(QR)mkdir -p "$(distdir)" $(QR)for f in $(DIST) ; do \ if test -f "$$f" ; then \ src=$$f ; \ elif test -f "$(srcdir)/$$f" ; then \ src=$(srcdir)/$$f ; \ else \ if test x$(V) != x1 ; then echo " SKIP $$f" ; fi ; \ continue ; \ fi ; \ if test x$(V) != x1 ; then echo " CP $$f" ; fi ; \ dir=$(distdir)/`dirname "$$f"` ; \ mkdir -p "$$dir" ; \ cp -p "$$src" "$$dir" ; \ done endif dist-contrib: $(QR)if test -d "$(srcdir)/contrib" ; then \ ( cd "$(srcdir)/contrib" && find . -type f -print ) |\ while read src ; do \ test -f "$(distdir)/contrib/$$src" && continue ; \ test x$(V) != x1 && echo " CP $$src" ; \ dir=`dirname "$(distdir)/contrib/$$src"` ; \ mkdir -p "$$dir" ; \ cp -p "$(srcdir)/contrib/$$src" "$$dir" ; \ done ; \ fi dist-extra: # ---------------------------------------------------------------------- %.o: %.c $(QP)echo " CC $@" $(QR)$(CC) -c $(CFLAGS_DEFAULT) -o $@ $< %.o: %.cxx $(QP)echo " CXX $@" $(QR)$(CXX) -c $(CXXFLAGS_DEFAULT) -o $@ $< %.o: %.cpp $(QP)echo " CXX $@" $(QR)$(CXX) -c $(CXXFLAGS_DEFAULT) -o $@ $< %.a: $(QP)echo " AR $@" $(QR)rm -f $@ $(QR)$(AR) -rc $@ $^ $(QP)echo " RANLIB $@" $(QR)$(RANLIB) $@ %.1.ps: %.1 $(QP)echo " MAN $@" $(QR)groff -Tps -mandoc < $< > $@ %.1.man: %.1 $(QP)echo " MAN $@" $(QR)troff -Tlatin1 -mandoc < $< | grotty -c > $@ %.1.txt: %.1 $(QP)echo " MAN $@" $(QR)troff -Tlatin1 -mandoc < $< | grotty -c -b -o -u > $@ mpegdemux-0.1.4/Makefile.inc.in0000644000000000000000000000300611413352377016327 0ustar00rootroot00000000000000# Makefile.inc etcdir = @sysconfdir@ datarootdir = @datarootdir@ datadir = @datadir@ CC = @CC@ LD = @CC@ LN_S = @LN_S@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL@ CFLAGS = @CFLAGS@ CFLAGS_DEFAULT = $(CFLAGS) -Isrc LDFLAGS = @LDFLAGS@ LDFLAGS_DEFAULT = $(LDFLAGS) EXEEXT := @EXEEXT@ LIBS = @LIBS@ ifneq "$(srcdir)" "." CFLAGS_DEFAULT += -I$(srcdir)/src endif MPEGDEMUX_VERSION_MAJ := @MPEGDEMUX_VERSION_MAJ@ MPEGDEMUX_VERSION_MIN := @MPEGDEMUX_VERSION_MIN@ MPEGDEMUX_VERSION_MIC := @MPEGDEMUX_VERSION_MIC@ MPEGDEMUX_VERSION_STR := @MPEGDEMUX_VERSION_STR@ distdir := mpegdemux-$(MPEGDEMUX_VERSION_STR) # ---------------------------------------------------------------------- DCL += Makefile Makefile.inc configure config.log config.status DIST += AUTHORS COPYING ChangeLog INSTALL \ Makefile.in Makefile.inc.in Makefile.tc \ NEWS README TODO autogen.sh \ configure configure.in install-sh # ---------------------------------------------------------------------- include $(srcdir)/src/Makefile.inc TARGETS += $(BIN) $(BINS) $(ETC) $(SHARE) # ---------------------------------------------------------------------- %: %.sh $(QP)echo " SED $@" $(QR)rm -f $@ $(QR)sed -e "s/%MPEGDEMUX_VERSION_STR/$(MPEGDEMUX_VERSION_STR)/g" < $< > $@ $(QR)chmod a+x $@ install-extra: dist-extra: dist-version: $(QP)echo " GEN version" $(QR)echo "mpegdemux $(MPEGDEMUX_VERSION_MAJ) $(MPEGDEMUX_VERSION_MIN) $(MPEGDEMUX_VERSION_MIC) $(MPEGDEMUX_VERSION_STR)" \ > "$(distdir)/version" mpegdemux-0.1.4/Makefile.tc0000644000000000000000000000333511413352377015564 0ustar00rootroot00000000000000# Makefile.tc # Makefile for Turbo C / Turbo C++ / Borland C++ MODEL=l CC = tcc OPT = -O -Z- -G- -d # Turbo C and Turbo C++ miscompile with -Z. SRC = src OUT = out CFLAGS = -m$(MODEL) $(OPT) -I$(SRC) LD = $(CC) LDFLAGS = -m$(MODEL) all: $(OUT)\\mpgdemux.exe dirs: MKDIR $(OUT) clean: DEL $(OUT)\\*.EXE DEL $(OUT)\\*.OBJ HDR = \ $(SRC)\\mpegdemux.h \ $(SRC)\\buffer.h \ $(SRC)\\config.h \ $(SRC)\\getopt.h \ $(SRC)\\message.h \ $(SRC)\\mpeg_demux.h \ $(SRC)\\mpeg_list.h \ $(SRC)\\mpeg_parse.h \ $(SRC)\\mpeg_remux.h \ $(SRC)\\mpeg_scan.h OBJ = \ $(OUT)\\mpegdemux.obj \ $(OUT)\\buffer.obj \ $(OUT)\\getopt.obj \ $(OUT)\\message.obj \ $(OUT)\\mpeg_demux.obj \ $(OUT)\\mpeg_list.obj \ $(OUT)\\mpeg_parse.obj \ $(OUT)\\mpeg_remux.obj \ $(OUT)\\mpeg_scan.obj $(OUT)\\mpegdemux.obj: $(SRC)\\mpegdemux.c $(HDR) $(CC) $(CFLAGS) -c -o$*.obj $(SRC)\\mpegdemux.c $(OUT)\\buffer.obj: $(SRC)\\buffer.c $(HDR) $(CC) $(CFLAGS) -c -o$*.obj $(SRC)\\buffer.c $(OUT)\\getopt.obj: $(SRC)\\getopt.c $(HDR) $(CC) $(CFLAGS) -c -o$*.obj $(SRC)\\getopt.c $(OUT)\\message.obj: $(SRC)\\message.c $(HDR) $(CC) $(CFLAGS) -c -o$*.obj $(SRC)\\message.c $(OUT)\\mpeg_demux.obj: $(SRC)\\mpeg_demux.c $(HDR) $(CC) $(CFLAGS) -c -o$*.obj $(SRC)\\mpeg_demux.c $(OUT)\\mpeg_list.obj: $(SRC)\\mpeg_list.c $(HDR) $(CC) $(CFLAGS) -c -o$*.obj $(SRC)\\mpeg_list.c $(OUT)\\mpeg_parse.obj: $(SRC)\\mpeg_parse.c $(HDR) $(CC) $(CFLAGS) -c -o$*.obj $(SRC)\\mpeg_parse.c $(OUT)\\mpeg_remux.obj: $(SRC)\\mpeg_remux.c $(HDR) $(CC) $(CFLAGS) -c -o$*.obj $(SRC)\\mpeg_remux.c $(OUT)\\mpeg_scan.obj: $(SRC)\\mpeg_scan.c $(HDR) $(CC) $(CFLAGS) -c -o$*.obj $(SRC)\\mpeg_scan.c $(OUT)\\mpgdemux.exe: $(OBJ) $(LD) $(LDFLAGS) -e$*.exe @&&! $(OBJ) ! mpegdemux-0.1.4/NEWS0000644000000000000000000000203711413411636014206 0ustar00rootroot000000000000000.1.4 2010-07-02 * A new non-recursive build system. * A new command line option parser. Command line options are unchanged but multiple options can now be grouped together. * Bugfixes 0.1.3 2009-02-15 r106 * A packet size limit can now be specified to avoid losing large parts of broken streams. * Mpegdemux can now remap stream IDs. * In remuxing mode skipped bytes can now be copied to the new stream. 0.1.2 2004-09-19 r81 * Streams can now be declared invalid * Implemented splitting system stream at end codes when remuxing * Made the transition from CVS to SVN * Bugfixes 0.1.1 2003-08-10 r61 * Dummy release 0.1.0 2003-08-10 r60 * Bugfixes * Private substreams can now be demultiplexed into separate files 0.0.4 2003-04-09 r46 * Bugfixes * Better handling of skipped bytes * Incomplete packets can now be dropped 0.0.3 2003-03-08 r33 * New scan mode * System stream syntax bug fix * Some changes to the command line parametrs 0.0.2 2003-03-06 r28 * Lots of changes 0.0.1 2003-02-02 r1 * First version mpegdemux-0.1.4/README0000644000000000000000000000251207703776473014411 0ustar00rootroot00000000000000mpegdemux ========= Mpegdemux is an MPEG1/MPEG2 system stream demultiplexer. It can be used to list the contents of an MPEG system stream and to extract elementary streams. Mpegdemux has four primary modes of operation: - scan. In this mode the MPEG system stream is scanned for elementary streams. The first packet of each elementary stream is reported. - list. In this mode the contents of an MPEG system stream are listed in a textual form. This is useful to get an overview of what's in an MPEG file - demux. In this mode elementary streams are extracted from an MPEG system stream. The system stream packet structure is dissolved in the process. Typically each extracted stream is written to its own file. - remux. This is like demux, except that the MPEG system stream structure is left intact. This means that the output is again an MPEG system stream with all but the selected elementary streams removed. Examples ======== Get an overview of the elementary streams contained in an MPEG system stream: $ mpegdemux -l -k -s all -p all src.mpg Extract the first video stream: $ mpegdemux -d -s 0xe0 src.mpg dst.m1v Extract all audio streams: $ mpegdemux -d -s 0xc0-0xdf -b audio_##.mpa src.mpg Remove the second video stream: $ mpegdemux -r -s all/-0xc1 -p all src.mpg dst.mpg enjoy, Hampa Hug /dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error ERROR [LINENO LOG_FD] # --------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with status $?, using 1 if that was 0. as_fn_error () { as_status=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="mpegdemux" ac_unique_file="Makefile.in" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS EGREP GREP CPP MPEGDEMUX_LARGE_FILE LN_S SET_MAKE RANLIB AR INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MPEGDEMUX_VERSION_STR MPEGDEMUX_VERSION_MIC MPEGDEMUX_VERSION_MIN MPEGDEMUX_VERSION_MAJ target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_largefile ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error "unrecognized option: \`$ac_option' Try \`$0 --help' for more information." ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-largefile Disable large file support Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers src/config.h" #----------------------------------------------------------------------------- # package version { $as_echo "$as_me:${as_lineno-$LINENO}: checking package version" >&5 $as_echo_n "checking package version... " >&6; } if test ! -r "$srcdir/version" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: file 'version' not found in source directory" >&5 $as_echo "file 'version' not found in source directory" >&6; } exit 1 fi read p MPEGDEMUX_VERSION_MAJ MPEGDEMUX_VERSION_MIN MPEGDEMUX_VERSION_MIC dstr r < "$srcdir/version" MPEGDEMUX_VERSION_STR=$dstr if test "x$dstr" = "xscm" ; then if test -d "$srcdir/.svn" ; then tmp=svninfo.$$.tmp svn info "$srcdir" > "$tmp" 2> /dev/null date=`date "+%Y-%m-%d"` rev="" while read a b c d e ; do case "$a$b$c$d" in "Revision:"*) rev="$b" ;; "LastChangedDate:"*) date="$d" ;; esac done < "$tmp" rm -f "$tmp" test -n "$rev" && rev="-r$rev" date=`echo "$date" | sed -e "s/-//g"` MPEGDEMUX_VERSION_STR="$date$rev" elif test -d "$srcdir/.git" ; then tmp=gitlog.$$.tmp ( cd "$srcdir" && git log -1 --date=iso --pretty="format:%h %cd" HEAD ) > "$tmp" 2> /dev/null read hash date time rest < "$tmp" rm -f "$tmp" if test -n "$date" -a -n "$hash" ; then date=`echo "$date" | sed -e "s/-//g"` MPEGDEMUX_VERSION_STR="$date-$hash" fi fi elif test "x$dstr" = "x" ; then MPEGDEMUX_VERSION_STR="$MPEGDEMUX_VERSION_MAJ.$MPEGDEMUX_VERSION_MIN.$MPEGDEMUX_VERSION_MIC" fi cat >>confdefs.h <<_ACEOF #define MPEGDEMUX_VERSION_MAJ $MPEGDEMUX_VERSION_MAJ _ACEOF cat >>confdefs.h <<_ACEOF #define MPEGDEMUX_VERSION_MIN $MPEGDEMUX_VERSION_MIN _ACEOF cat >>confdefs.h <<_ACEOF #define MPEGDEMUX_VERSION_MIC $MPEGDEMUX_VERSION_MIC _ACEOF cat >>confdefs.h <<_ACEOF #define MPEGDEMUX_VERSION_STR "$MPEGDEMUX_VERSION_STR" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MPEGDEMUX_VERSION_STR ($MPEGDEMUX_VERSION_MAJ.$MPEGDEMUX_VERSION_MIN.$MPEGDEMUX_VERSION_MIC)" >&5 $as_echo "$MPEGDEMUX_VERSION_STR ($MPEGDEMUX_VERSION_MAJ.$MPEGDEMUX_VERSION_MIN.$MPEGDEMUX_VERSION_MIC)" >&6; } #----------------------------------------------------------------------------- # programs ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "no acceptable C compiler found in \$PATH See \`config.log' for more details." "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { as_fn_set_status 77 as_fn_error "C compiler cannot create executables See \`config.log' for more details." "$LINENO" 5; }; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot compute suffix of object files: cannot compile See \`config.log' for more details." "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do for ac_t in install-sh install.sh shtool; do if test -f "$ac_dir/$ac_t"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/$ac_t -c" break 2 fi done done if test -z "$ac_aux_dir"; then as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' case "$INSTALL" in .*) d=`dirname "$INSTALL"` f=`basename "$INSTALL"` INSTALL=`cd "$d" && pwd`/"$f" ;; esac # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else case $AR in [\\/]* | ?:[\\/]*) ac_cv_path_AR="$AR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_AR" && ac_cv_path_AR="ar" ;; esac fi AR=$ac_cv_path_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi #----------------------------------------------------------------------------- # arguments # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; opt_large=$enableval fi if test "$opt_large" = "no" ; then MPEGDEMUX_LARGE_FILE=0 else $as_echo "#define MPEGDEMUX_LARGE_FILE 1" >>confdefs.h MPEGDEMUX_LARGE_FILE=1 fi #----------------------------------------------------------------------------- # header files ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in inttypes.h do : ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" if test "x$ac_cv_header_inttypes_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H 1 _ACEOF fi done #----------------------------------------------------------------------------- # output ac_config_files="$ac_config_files Makefile Makefile.inc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error ERROR [LINENO LOG_FD] # --------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with status $?, using 1 if that was 0. as_fn_error () { as_status=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Makefile.inc") CONFIG_FILES="$CONFIG_FILES Makefile.inc" ;; *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || as_fn_error "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit $? fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi #----------------------------------------------------------------------------- # status echo "" echo "mpegdemux $MPEGDEMUX_VERSION_STR is now configured:" echo " CC: $CC $CFLAGS" echo " LD: $CC $LDFLAGS" echo "" echo " prefix: $prefix" mpegdemux-0.1.4/configure.in0000644000000000000000000001070711400752603016021 0ustar00rootroot00000000000000#***************************************************************************** #* mpegdemux * #***************************************************************************** #***************************************************************************** #* File name: configure.in * #* Created: 2003-02-01 by Hampa Hug * #* Copyright: (C) 2003-2010 Hampa Hug * #***************************************************************************** #***************************************************************************** #* This program is free software. You can redistribute it and / or modify it * #* under the terms of the GNU General Public License version 2 as published * #* by the Free Software Foundation. * #* * #* This program is distributed in the hope that it will be useful, but * #* WITHOUT ANY WARRANTY, without even the implied warranty of * #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * #* Public License for more details. * #***************************************************************************** AC_PREREQ(2.50) AC_INIT(mpegdemux) AC_CONFIG_SRCDIR(Makefile.in) AC_CONFIG_HEADER(src/config.h) #----------------------------------------------------------------------------- # package version AC_MSG_CHECKING([package version]) if test ! -r "$srcdir/version" ; then AC_MSG_RESULT([file 'version' not found in source directory]) exit 1 fi read p MPEGDEMUX_VERSION_MAJ MPEGDEMUX_VERSION_MIN MPEGDEMUX_VERSION_MIC dstr r < "$srcdir/version" MPEGDEMUX_VERSION_STR=$dstr if test "x$dstr" = "xscm" ; then if test -d "$srcdir/.svn" ; then tmp=svninfo.$$.tmp svn info "$srcdir" > "$tmp" 2> /dev/null date=`date "+%Y-%m-%d"` rev="" while read a b c d e ; do case "$a$b$c$d" in "Revision:"*) rev="$b" ;; "LastChangedDate:"*) date="$d" ;; esac done < "$tmp" rm -f "$tmp" test -n "$rev" && rev="-r$rev" date=`echo "$date" | sed -e "s/-//g"` MPEGDEMUX_VERSION_STR="$date$rev" elif test -d "$srcdir/.git" ; then tmp=gitlog.$$.tmp ( cd "$srcdir" && git log -1 --date=iso --pretty="format:%h %cd" HEAD ) > "$tmp" 2> /dev/null read hash date time rest < "$tmp" rm -f "$tmp" if test -n "$date" -a -n "$hash" ; then date=`echo "$date" | sed -e "s/-//g"` MPEGDEMUX_VERSION_STR="$date-$hash" fi fi elif test "x$dstr" = "x" ; then MPEGDEMUX_VERSION_STR="$MPEGDEMUX_VERSION_MAJ.$MPEGDEMUX_VERSION_MIN.$MPEGDEMUX_VERSION_MIC" fi AC_SUBST(MPEGDEMUX_VERSION_MAJ) AC_SUBST(MPEGDEMUX_VERSION_MIN) AC_SUBST(MPEGDEMUX_VERSION_MIC) AC_SUBST(MPEGDEMUX_VERSION_STR) AC_DEFINE_UNQUOTED(MPEGDEMUX_VERSION_MAJ, $MPEGDEMUX_VERSION_MAJ) AC_DEFINE_UNQUOTED(MPEGDEMUX_VERSION_MIN, $MPEGDEMUX_VERSION_MIN) AC_DEFINE_UNQUOTED(MPEGDEMUX_VERSION_MIC, $MPEGDEMUX_VERSION_MIC) AC_DEFINE_UNQUOTED(MPEGDEMUX_VERSION_STR, "$MPEGDEMUX_VERSION_STR") AC_MSG_RESULT([$MPEGDEMUX_VERSION_STR ($MPEGDEMUX_VERSION_MAJ.$MPEGDEMUX_VERSION_MIN.$MPEGDEMUX_VERSION_MIC)]) #----------------------------------------------------------------------------- # programs AC_PROG_CC AC_PROG_INSTALL case "$INSTALL" in .*) d=`dirname "$INSTALL"` f=`basename "$INSTALL"` INSTALL=`cd "$d" && pwd`/"$f" ;; esac AC_PATH_PROG(AR, ar, ar) AC_PROG_RANLIB AC_PROG_MAKE_SET AC_PROG_LN_S #----------------------------------------------------------------------------- # arguments AC_ARG_ENABLE(largefile, AC_HELP_STRING([--disable-largefile], [Disable large file support]), opt_large=$enableval ) if test "$opt_large" = "no" ; then MPEGDEMUX_LARGE_FILE=0 else AC_DEFINE(MPEGDEMUX_LARGE_FILE) MPEGDEMUX_LARGE_FILE=1 fi AC_SUBST(MPEGDEMUX_LARGE_FILE) #----------------------------------------------------------------------------- # header files AC_HEADER_STDC AC_CHECK_HEADERS(inttypes.h) #----------------------------------------------------------------------------- # output AC_OUTPUT(Makefile Makefile.inc) #----------------------------------------------------------------------------- # status echo "" echo "mpegdemux $MPEGDEMUX_VERSION_STR is now configured:" echo " CC: $CC $CFLAGS" echo " LD: $CC $LDFLAGS" echo "" echo " prefix: $prefix" mpegdemux-0.1.4/install-sh0000755000000000000000000003253711233432070015516 0ustar00rootroot00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: mpegdemux-0.1.4/version0000644000000000000000000000003011413411735015106 0ustar00rootroot00000000000000mpegdemux 0 1 4 0.1.4