streamripper-1.64.6.orig/0000755000175000017500000000000011166165654013347 5ustar abiabistreamripper-1.64.6.orig/Makefile.in0000644000175000017500000012124211164273416015410 0ustar abiabi# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @SUBDIR_LIBMAD_TRUE@am__append_1 = -I@abs_top_srcdir@/libmad-0.15.1b bin_PROGRAMS = streamripper$(EXEEXT) EXTRA_PROGRAMS = streamripper$(EXEEXT) ictest$(EXEEXT) \ cstreamripper$(EXEEXT) @USE_INCLUDED_ARGV_TRUE@am__append_2 = lib/argv.c subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure COPYING INSTALL \ THANKS config.guess config.rpath config.sub depcomp install-sh \ ltconfig ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/cf_curses.m4 \ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/glib-2.0.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/ogg.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/m4/sr_locale_charset.m4 \ $(top_srcdir)/m4/type_socklen_t.m4 $(top_srcdir)/m4/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_cstreamripper_OBJECTS = cstreamripper.$(OBJEXT) cstreamripper_OBJECTS = $(am_cstreamripper_OBJECTS) cstreamripper_DEPENDENCIES = lib/libstreamripper.a am_ictest_OBJECTS = ictest.$(OBJEXT) ictest_OBJECTS = $(am_ictest_OBJECTS) ictest_LDADD = $(LDADD) am__streamripper_SOURCES_DIST = console/streamripper.c lib/argv.c @USE_INCLUDED_ARGV_TRUE@am__objects_1 = argv.$(OBJEXT) am_streamripper_OBJECTS = streamripper.$(OBJEXT) $(am__objects_1) streamripper_OBJECTS = $(am_streamripper_OBJECTS) streamripper_DEPENDENCIES = lib/libstreamripper.a DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(cstreamripper_SOURCES) $(ictest_SOURCES) \ $(streamripper_SOURCES) DIST_SOURCES = $(cstreamripper_SOURCES) $(ictest_SOURCES) \ $(am__streamripper_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FAAD_LIBS = @FAAD_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBCHARSET = @LIBCHARSET@ LIBIBERTY_LIBS = @LIBIBERTY_LIBS@ LIBICONV = @LIBICONV@ LIBMAD = @LIBMAD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OGG_CFLAGS = @OGG_CFLAGS@ OGG_LIBS = @OGG_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREADLIBS = @THREADLIBS@ VERSION = @VERSION@ VORBISENC_LIBS = @VORBISENC_LIBS@ VORBISFILE_LIBS = @VORBISFILE_LIBS@ VORBIS_CFLAGS = @VORBIS_CFLAGS@ VORBIS_LIBS = @VORBIS_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # if SUBDIR_GLIB # MAYBE_GLIB = glib-2.16.6 # AM_CPPFLAGS += -I@abs_top_srcdir@/glib-2.16.6/glib # AM_CPPFLAGS += -I@abs_top_srcdir@/glib-2.16.6 # endif #if SUBDIR_CDK # MAYBE_CDK = cdk-5.0-20060507 #endif AM_CPPFLAGS = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @GLIB_CFLAGS@ \ $(am__append_1) -I@abs_top_srcdir@/lib @SUBDIR_LIBMAD_TRUE@MAYBE_LIBMAD = libmad-0.15.1b # SUBDIRS = $(MAYBE_LIBMAD) $(MAYBE_CDK) $(MAYBE_GLIB) lib # SUBDIRS = $(MAYBE_LIBMAD) $(MAYBE_CDK) lib SUBDIRS = $(MAYBE_LIBMAD) lib ictest_SOURCES = \ lib/ictest.c streamripper_SOURCES = console/streamripper.c $(am__append_2) cstreamripper_SOURCES = \ console/cstreamripper.c libmad_manifest = \ libmad-0.15.1b/README \ libmad-0.15.1b/configure.ac \ libmad-0.15.1b/aclocal.m4 \ libmad-0.15.1b/mad.h \ libmad-0.15.1b/Makefile.am \ libmad-0.15.1b/Makefile.in \ libmad-0.15.1b/config.h.in \ libmad-0.15.1b/libmad.list.in \ libmad-0.15.1b/configure \ libmad-0.15.1b/COPYING \ libmad-0.15.1b/INSTALL \ libmad-0.15.1b/TODO \ libmad-0.15.1b/config.guess \ libmad-0.15.1b/config.sub \ libmad-0.15.1b/depcomp \ libmad-0.15.1b/install-sh \ libmad-0.15.1b/ltmain.sh \ libmad-0.15.1b/missing \ libmad-0.15.1b/mkinstalldirs \ libmad-0.15.1b/version.c \ libmad-0.15.1b/fixed.c \ libmad-0.15.1b/bit.c \ libmad-0.15.1b/timer.c \ libmad-0.15.1b/stream.c \ libmad-0.15.1b/frame.c \ libmad-0.15.1b/synth.c \ libmad-0.15.1b/decoder.c \ libmad-0.15.1b/layer12.c \ libmad-0.15.1b/layer3.c \ libmad-0.15.1b/huffman.c \ libmad-0.15.1b/version.h \ libmad-0.15.1b/fixed.h \ libmad-0.15.1b/bit.h \ libmad-0.15.1b/timer.h \ libmad-0.15.1b/stream.h \ libmad-0.15.1b/frame.h \ libmad-0.15.1b/synth.h \ libmad-0.15.1b/decoder.h \ libmad-0.15.1b/global.h \ libmad-0.15.1b/layer12.h \ libmad-0.15.1b/layer3.h \ libmad-0.15.1b/huffman.h \ libmad-0.15.1b/D.dat \ libmad-0.15.1b/imdct_s.dat \ libmad-0.15.1b/qc_table.dat \ libmad-0.15.1b/rq_table.dat \ libmad-0.15.1b/sf_table.dat \ libmad-0.15.1b/imdct_l_arm.S \ libmad-0.15.1b/minimad.c \ libmad-0.15.1b/mad.h.sed \ libmad-0.15.1b/CHANGES \ libmad-0.15.1b/COPYRIGHT \ libmad-0.15.1b/CREDITS \ libmad-0.15.1b/VERSION libmad_dont_need_these = \ libmad-0.15.1b/msvc++/Makefile.am \ libmad-0.15.1b/msvc++/Makefile.in \ libmad-0.15.1b/msvc++/mad.h \ libmad-0.15.1b/msvc++/config.h \ libmad-0.15.1b/msvc++/libmad.dsp tre072_manifest = \ tre-0.7.2/m4/tre_prog_cc_optimizations.m4 \ tre-0.7.2/m4/ax_check_sign.m4 \ tre-0.7.2/m4/Makefile.am \ tre-0.7.2/m4/Makefile.in \ tre-0.7.2/m4/vl_prog_cc_warnings.m4 \ tre-0.7.2/m4/ac_libtool_tags.m4 \ tre-0.7.2/m4/ax_decl_wchar_max.m4 \ tre-0.7.2/m4/ax_check_funcs_comp.m4 \ tre-0.7.2/po/Makevars \ tre-0.7.2/po/fi.po \ tre-0.7.2/po/LINGUAS \ tre-0.7.2/po/en@boldquot.header \ tre-0.7.2/po/en@quot.header \ tre-0.7.2/po/Rules-quot \ tre-0.7.2/po/remove-potcdate.sin \ tre-0.7.2/po/boldquot.sed \ tre-0.7.2/po/POTFILES.in \ tre-0.7.2/po/tre.pot \ tre-0.7.2/po/insert-header.sin \ tre-0.7.2/po/quot.sed \ tre-0.7.2/po/Makefile.in.in \ tre-0.7.2/doc/tre-api.html \ tre-0.7.2/doc/default.css \ tre-0.7.2/doc/Makefile.am \ tre-0.7.2/doc/Makefile.in \ tre-0.7.2/doc/agrep.1.in \ tre-0.7.2/doc/tre-syntax.html \ tre-0.7.2/lib/tre-config.h.in \ tre-0.7.2/lib/regex.h \ tre-0.7.2/lib/tre-filter.c \ tre-0.7.2/lib/tre-filter.h \ tre-0.7.2/lib/tre-match-approx.c \ tre-0.7.2/lib/README \ tre-0.7.2/lib/tre-match-utils.h \ tre-0.7.2/lib/xmalloc.c \ tre-0.7.2/lib/xmalloc.h \ tre-0.7.2/lib/tre-parse.c \ tre-0.7.2/lib/tre-parse.h \ tre-0.7.2/lib/tre-match-backtrack.c \ tre-0.7.2/lib/tre-internal.h \ tre-0.7.2/lib/regerror.c \ tre-0.7.2/lib/tre-compile.c \ tre-0.7.2/lib/tre-compile.h \ tre-0.7.2/lib/Makefile.am \ tre-0.7.2/lib/Makefile.in \ tre-0.7.2/lib/tre-match-parallel.c \ tre-0.7.2/lib/gettext.h \ tre-0.7.2/lib/tre-ast.c \ tre-0.7.2/lib/tre-ast.h \ tre-0.7.2/lib/tre-mem.c \ tre-0.7.2/lib/tre-mem.h \ tre-0.7.2/lib/regcomp.c \ tre-0.7.2/lib/regexec.c \ tre-0.7.2/lib/tre-stack.c \ tre-0.7.2/lib/tre-stack.h \ tre-0.7.2/src/Makefile.am \ tre-0.7.2/src/Makefile.in \ tre-0.7.2/src/agrep.c \ tre-0.7.2/NEWS \ tre-0.7.2/TODO \ tre-0.7.2/LICENSE \ tre-0.7.2/aclocal.m4 \ tre-0.7.2/tests/test-str-source.c \ tre-0.7.2/tests/randtest.c \ tre-0.7.2/tests/retest.c \ tre-0.7.2/tests/Makefile.am \ tre-0.7.2/tests/Makefile.in \ tre-0.7.2/tests/build-tests.sh \ tre-0.7.2/tests/bench.c \ tre-0.7.2/utils/compile \ tre-0.7.2/utils/depcomp \ tre-0.7.2/utils/build-rpm.sh \ tre-0.7.2/utils/ltmain.sh \ tre-0.7.2/utils/config.guess \ tre-0.7.2/utils/config.rpath \ tre-0.7.2/utils/install-sh \ tre-0.7.2/utils/autogen.sh \ tre-0.7.2/utils/config.sub \ tre-0.7.2/utils/missing \ tre-0.7.2/utils/mkinstalldirs \ tre-0.7.2/utils/Makefile.am \ tre-0.7.2/utils/Makefile.in \ tre-0.7.2/win32/tre-config.h \ tre-0.7.2/win32/retest.dsp \ tre-0.7.2/win32/config.h \ tre-0.7.2/win32/tre.def \ tre-0.7.2/win32/tre.dsp \ tre-0.7.2/win32/tre.dsw \ tre-0.7.2/README \ tre-0.7.2/THANKS \ tre-0.7.2/configure \ tre-0.7.2/configure.ac \ tre-0.7.2/tre.spec.in \ tre-0.7.2/Makefile.am \ tre-0.7.2/Makefile.in \ tre-0.7.2/config.h.in \ tre-0.7.2/python/example.py \ tre-0.7.2/python/tre-python.c \ tre-0.7.2/python/setup.py \ tre-0.7.2/AUTHORS \ tre-0.7.2/INSTALL \ tre-0.7.2/tre.pc.in \ tre-0.7.2/ABOUT-NLS \ tre-0.7.2/ChangeLog \ tre-0.7.2/COPYING tre070_manifest = \ tre-0.7.0/m4/tre_prog_cc_optimizations.m4 \ tre-0.7.0/m4/ax_check_sign.m4 \ tre-0.7.0/m4/Makefile.am \ tre-0.7.0/m4/Makefile.in \ tre-0.7.0/m4/vl_prog_cc_warnings.m4 \ tre-0.7.0/m4/ac_libtool_tags.m4 \ tre-0.7.0/m4/ax_decl_wchar_max.m4 \ tre-0.7.0/m4/ax_check_funcs_comp.m4 \ tre-0.7.0/po/Makevars \ tre-0.7.0/po/fi.po \ tre-0.7.0/po/LINGUAS \ tre-0.7.0/po/en@boldquot.header \ tre-0.7.0/po/en@quot.header \ tre-0.7.0/po/Rules-quot \ tre-0.7.0/po/remove-potcdate.sin \ tre-0.7.0/po/boldquot.sed \ tre-0.7.0/po/POTFILES.in \ tre-0.7.0/po/fi.gmo \ tre-0.7.0/po/tre.pot \ tre-0.7.0/po/insert-header.sin \ tre-0.7.0/po/stamp-po \ tre-0.7.0/po/quot.sed \ tre-0.7.0/po/Makefile.in.in \ tre-0.7.0/doc/tre-api.html \ tre-0.7.0/doc/tre-syntax.html \ tre-0.7.0/lib/tre-config.h.in \ tre-0.7.0/lib/regex.h \ tre-0.7.0/lib/tre-match-approx.c \ tre-0.7.0/lib/README \ tre-0.7.0/lib/tre-match-utils.h \ tre-0.7.0/lib/xmalloc.c \ tre-0.7.0/lib/xmalloc.h \ tre-0.7.0/lib/tre-match-backtrack.c \ tre-0.7.0/lib/tre-internal.h \ tre-0.7.0/lib/regerror.c \ tre-0.7.0/lib/tre-compile.c \ tre-0.7.0/lib/Makefile.am \ tre-0.7.0/lib/Makefile.in \ tre-0.7.0/lib/tre-match-parallel.c \ tre-0.7.0/lib/gettext.h \ tre-0.7.0/lib/tre-mem.c \ tre-0.7.0/lib/tre-mem.h \ tre-0.7.0/lib/regcomp.c \ tre-0.7.0/lib/regexec.c \ tre-0.7.0/src/Makefile.am \ tre-0.7.0/src/Makefile.in \ tre-0.7.0/src/agrep.c \ tre-0.7.0/NEWS \ tre-0.7.0/TODO \ tre-0.7.0/LICENSE \ tre-0.7.0/aclocal.m4 \ tre-0.7.0/tests/test-str-source.c \ tre-0.7.0/tests/randtest.c \ tre-0.7.0/tests/retest.c \ tre-0.7.0/tests/Makefile.am \ tre-0.7.0/tests/Makefile.in \ tre-0.7.0/tests/bench.c \ tre-0.7.0/tests/test-approx.c \ tre-0.7.0/utils/compile \ tre-0.7.0/utils/depcomp \ tre-0.7.0/utils/build-rpm.sh \ tre-0.7.0/utils/ltmain.sh \ tre-0.7.0/utils/config.guess \ tre-0.7.0/utils/config.rpath \ tre-0.7.0/utils/install-sh \ tre-0.7.0/utils/autogen.sh \ tre-0.7.0/utils/config.sub \ tre-0.7.0/utils/missing \ tre-0.7.0/utils/mkinstalldirs \ tre-0.7.0/utils/Makefile.am \ tre-0.7.0/utils/Makefile.in \ tre-0.7.0/win32/tre-config.h \ tre-0.7.0/win32/retest.dsp \ tre-0.7.0/win32/config.h \ tre-0.7.0/win32/tre.def \ tre-0.7.0/win32/tre.dsp \ tre-0.7.0/win32/tre.dsw \ tre-0.7.0/README \ tre-0.7.0/THANKS \ tre-0.7.0/configure \ tre-0.7.0/configure.ac \ tre-0.7.0/tre.spec.in \ tre-0.7.0/Makefile.am \ tre-0.7.0/Makefile.in \ tre-0.7.0/config.h.in \ tre-0.7.0/python \ tre-0.7.0/python/setup.py.in \ tre-0.7.0/AUTHORS \ tre-0.7.0/INSTALL \ tre-0.7.0/tre.pc.in \ tre-0.7.0/ABOUT-NLS \ tre-0.7.0/ChangeLog \ tre-0.7.0/COPYING man_MANS = \ streamripper.1 lib_manifest = \ lib/Makefile.am \ lib/Makefile.in \ lib/config.h.in \ lib/argv.c \ lib/cbuf2.c \ lib/cbuf2.h \ lib/charmaps.h \ lib/charset.c \ lib/charset.h \ lib/compat.h \ lib/config.h \ lib/confw32.h \ lib/debug.c \ lib/debug.h \ lib/errors.c \ lib/errors.h \ lib/external.c \ lib/external.h \ lib/filelib.c \ lib/filelib.h \ lib/findsep2.c \ lib/findsep.c \ lib/findsep.h \ lib/http.c \ lib/http.h \ lib/iconvert.c \ lib/ictest.c \ lib/list.h \ lib/mchar.c \ lib/mchar.h \ lib/parse.c \ lib/parse.h \ lib/prefs.c \ lib/prefs.h \ lib/relaylib.c \ lib/relaylib.h \ lib/rip_manager.c \ lib/rip_manager.h \ lib/ripaac.c \ lib/ripogg.c \ lib/ripogg.h \ lib/ripstream.c \ lib/ripstream.h \ lib/socklib.c \ lib/socklib.h \ lib/srconfig.h \ lib/srtypes.h \ lib/threadlib.c \ lib/threadlib.h \ lib/uce_dirent.h \ lib/utf8.c \ lib/utf8.h EXTRA_DIST = \ config.rpath \ CHANGES \ parse_rules.txt \ fake_external_metadata.pl \ fetch_external_metadata.pl \ $(lib_manifest) \ $(libmad_manifest) \ $(man_MANS) DIST_SUBDIRS = streamripper_LDADD = \ lib/libstreamripper.a \ @FAAD_LIBS@ \ @LIBMAD@ \ @THREADLIBS@ \ @LTLIBICONV@ @LIBCHARSET@ \ @LIBIBERTY_LIBS@ \ @OGG_LIBS@ @VORBIS_LIBS@ \ @GLIB_LIBS@ # @CDK_LIBS@ cstreamripper_LDADD = \ lib/libstreamripper.a \ @FAAD_LIBS@ \ @LIBMAD@ \ @THREADLIBS@ \ @LTLIBICONV@ @LIBCHARSET@ \ @LIBIBERTY_LIBS@ \ @OGG_LIBS@ @VORBIS_LIBS@ \ @GLIB_LIBS@ # @CDK_LIBS@ ACLOCAL_AMFLAGS = -I m4 all: all-recursive .SUFFIXES: .SUFFIXES: .c .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) cstreamripper$(EXEEXT): $(cstreamripper_OBJECTS) $(cstreamripper_DEPENDENCIES) @rm -f cstreamripper$(EXEEXT) $(LINK) $(cstreamripper_OBJECTS) $(cstreamripper_LDADD) $(LIBS) ictest$(EXEEXT): $(ictest_OBJECTS) $(ictest_DEPENDENCIES) @rm -f ictest$(EXEEXT) $(LINK) $(ictest_OBJECTS) $(ictest_LDADD) $(LIBS) streamripper$(EXEEXT): $(streamripper_OBJECTS) $(streamripper_DEPENDENCIES) @rm -f streamripper$(EXEEXT) $(LINK) $(streamripper_OBJECTS) $(streamripper_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cstreamripper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ictest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/streamripper.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` cstreamripper.o: console/cstreamripper.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cstreamripper.o -MD -MP -MF $(DEPDIR)/cstreamripper.Tpo -c -o cstreamripper.o `test -f 'console/cstreamripper.c' || echo '$(srcdir)/'`console/cstreamripper.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/cstreamripper.Tpo $(DEPDIR)/cstreamripper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='console/cstreamripper.c' object='cstreamripper.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cstreamripper.o `test -f 'console/cstreamripper.c' || echo '$(srcdir)/'`console/cstreamripper.c cstreamripper.obj: console/cstreamripper.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cstreamripper.obj -MD -MP -MF $(DEPDIR)/cstreamripper.Tpo -c -o cstreamripper.obj `if test -f 'console/cstreamripper.c'; then $(CYGPATH_W) 'console/cstreamripper.c'; else $(CYGPATH_W) '$(srcdir)/console/cstreamripper.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/cstreamripper.Tpo $(DEPDIR)/cstreamripper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='console/cstreamripper.c' object='cstreamripper.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cstreamripper.obj `if test -f 'console/cstreamripper.c'; then $(CYGPATH_W) 'console/cstreamripper.c'; else $(CYGPATH_W) '$(srcdir)/console/cstreamripper.c'; fi` ictest.o: lib/ictest.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ictest.o -MD -MP -MF $(DEPDIR)/ictest.Tpo -c -o ictest.o `test -f 'lib/ictest.c' || echo '$(srcdir)/'`lib/ictest.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ictest.Tpo $(DEPDIR)/ictest.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/ictest.c' object='ictest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ictest.o `test -f 'lib/ictest.c' || echo '$(srcdir)/'`lib/ictest.c ictest.obj: lib/ictest.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ictest.obj -MD -MP -MF $(DEPDIR)/ictest.Tpo -c -o ictest.obj `if test -f 'lib/ictest.c'; then $(CYGPATH_W) 'lib/ictest.c'; else $(CYGPATH_W) '$(srcdir)/lib/ictest.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ictest.Tpo $(DEPDIR)/ictest.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/ictest.c' object='ictest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ictest.obj `if test -f 'lib/ictest.c'; then $(CYGPATH_W) 'lib/ictest.c'; else $(CYGPATH_W) '$(srcdir)/lib/ictest.c'; fi` streamripper.o: console/streamripper.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT streamripper.o -MD -MP -MF $(DEPDIR)/streamripper.Tpo -c -o streamripper.o `test -f 'console/streamripper.c' || echo '$(srcdir)/'`console/streamripper.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/streamripper.Tpo $(DEPDIR)/streamripper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='console/streamripper.c' object='streamripper.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o streamripper.o `test -f 'console/streamripper.c' || echo '$(srcdir)/'`console/streamripper.c streamripper.obj: console/streamripper.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT streamripper.obj -MD -MP -MF $(DEPDIR)/streamripper.Tpo -c -o streamripper.obj `if test -f 'console/streamripper.c'; then $(CYGPATH_W) 'console/streamripper.c'; else $(CYGPATH_W) '$(srcdir)/console/streamripper.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/streamripper.Tpo $(DEPDIR)/streamripper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='console/streamripper.c' object='streamripper.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o streamripper.obj `if test -f 'console/streamripper.c'; then $(CYGPATH_W) 'console/streamripper.c'; else $(CYGPATH_W) '$(srcdir)/console/streamripper.c'; fi` argv.o: lib/argv.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT argv.o -MD -MP -MF $(DEPDIR)/argv.Tpo -c -o argv.o `test -f 'lib/argv.c' || echo '$(srcdir)/'`lib/argv.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/argv.Tpo $(DEPDIR)/argv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/argv.c' object='argv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o argv.o `test -f 'lib/argv.c' || echo '$(srcdir)/'`lib/argv.c argv.obj: lib/argv.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT argv.obj -MD -MP -MF $(DEPDIR)/argv.Tpo -c -o argv.obj `if test -f 'lib/argv.c'; then $(CYGPATH_W) 'lib/argv.c'; else $(CYGPATH_W) '$(srcdir)/lib/argv.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/argv.Tpo $(DEPDIR)/argv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/argv.c' object='argv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o argv.obj `if test -f 'lib/argv.c'; then $(CYGPATH_W) 'lib/argv.c'; else $(CYGPATH_W) '$(srcdir)/lib/argv.c'; fi` install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-info: install-info-recursive install-man: install-man1 install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-binPROGRAMS \ clean-generic ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ distclean distclean-compile distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: streamripper-1.64.6.orig/config.guess0000755000175000017500000011262507472606712015676 0ustar abiabi#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-10-05' # This file 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi dummy=dummy-$$ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int dummy(){}" > $dummy.c ; for c in cc gcc c89 ; do ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # Determine the machine/vendor (is the vendor relevant). case "${UNAME_MACHINE}" in amiga) machine=m68k-unknown ;; arm32) machine=arm-unknown ;; atari*) machine=m68k-atari ;; sun3*) machine=m68k-sun ;; mac68k) machine=m68k-apple ;; macppc) machine=powerpc-apple ;; hp3[0-9][05]) machine=m68k-hp ;; ibmrt|romp-ibm) machine=romp-ibm ;; sparc*) machine=`uname -p`-unknown ;; *) machine=${UNAME_MACHINE}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE}" in i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; 2-1307) UNAME_MACHINE="alphaev68" ;; esac fi rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy \ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*X-MP:*:*:*) echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i386-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in big) echo mips-unknown-linux-gnu && exit 0 ;; little) echo mipsel-unknown-linux-gnu && exit 0 ;; esac ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. ld_supported_targets=`cd /; ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build cat >$dummy.c < #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 printf ("%s-pc-linux-gnu\n", argv[1]); # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif #else printf ("%s-pc-linux-gnuaout\n", argv[1]); #endif return 0; } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) if test "${UNAME_MACHINE}" = "x86pc"; then UNAME_MACHINE=pc fi echo `uname -p`-${UNAME_MACHINE}-nto-qnx exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[KW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: streamripper-1.64.6.orig/console/0000755000175000017500000000000011164273725015006 5ustar abiabistreamripper-1.64.6.orig/console/streamripper.c0000644000175000017500000005176111154756620017700 0ustar abiabi/* streamripper.c * This little app should be seen as a demo for how to use the stremripper lib. * The only file you need from the /lib dir is rip_mananger.h, and perhapes * util.h (for stuff like formating the number of bytes). * * the two functions of interest are main() for how to call rip_mananger_start * and rip_callback, which is a how you find out whats going on with the rip. * the rest of this file is really just boring command line parsing code. * and a signal handler for when the user hits CTRL+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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if WIN32 //#define sleep Sleep #include #else #include #endif #include #include #include #include #include #include #include "srtypes.h" #include "rip_manager.h" #include "prefs.h" #include "mchar.h" #include "filelib.h" #include "debug.h" /***************************************************************************** * Private functions *****************************************************************************/ static void print_usage (FILE* stream); static void print_status (RIP_MANAGER_INFO *rmi); static void catch_sig (int code); static void parse_arguments (STREAM_PREFS *prefs, int argc, char **argv); static void rip_callback (RIP_MANAGER_INFO* rmi, int message, void *data); static void parse_extended_options (STREAM_PREFS *prefs, char *rule); static void verify_splitpoint_rules (STREAM_PREFS *prefs); static void print_to_console (char* fmt, ...); /***************************************************************************** * Private variables *****************************************************************************/ static char m_buffer_chars[] = {'\\', '|', '/', '-', '*'}; /* for formating */ //static RIP_MANAGER_INFO m_curinfo; /* from the rip_manager callback */ static BOOL m_started = FALSE; static BOOL m_alldone = FALSE; static BOOL m_got_sig = FALSE; static BOOL m_dont_print = FALSE; static BOOL m_print_stderr = FALSE; time_t m_stop_time = 0; /* main() * parse the aguments, tell the rip_mananger to start, we get in rip * status from our rip_callback function. m_opt was set from parse args * and contains all the various things one can do with the rip_mananger * like a relay server, auto-reconnects, output dir's stuff like that. * * Notice the crappy while loop, this is because the streamripper lib * is asyncrouns (spelling?) only. It probably should have a blocking * call as well, but i needed this for window'd apps. */ int main (int argc, char *argv[]) { int ret; time_t temp_time; STREAM_PREFS prefs; RIP_MANAGER_INFO *rmi = 0; sr_set_locale (); signal (SIGINT, catch_sig); signal (SIGTERM, catch_sig); parse_arguments (&prefs, argc, argv); print_to_console ("Connecting...\n"); rip_manager_init (); /* Launch the ripping thread */ if ((ret = rip_manager_start (&rmi, &prefs, rip_callback)) != SR_SUCCESS) { fprintf(stderr, "Couldn't connect to %s\n", prefs.url); exit(1); } /* * The m_got_sig thing is because you can't call into a thread * (i.e. rip_manager_stop) from a signal handler.. or at least not * in FreeBSD 3.4, i don't know about linux or NT. */ while (!m_got_sig && !m_alldone) { sleep(1); time(&temp_time); if (m_stop_time && (temp_time >= m_stop_time)) { print_to_console ("\nTime to stop is here, bailing\n"); break; } } print_to_console ("shutting down\n"); rip_manager_stop (rmi); rip_manager_cleanup (); return 0; } void catch_sig(int code) { print_to_console ("\n"); if (!m_started) exit(2); m_got_sig = TRUE; } /* In 1.63 I have changed two things: sending output to stdout instead of stderr, and adding fflush as per the sticky in the forum. */ static void print_to_console (char* fmt, ...) { va_list argptr; if (!m_dont_print) { va_start (argptr, fmt); if (m_print_stderr) { vfprintf (stderr, fmt, argptr); fflush (stderr); } else { vfprintf (stdout, fmt, argptr); fflush (stdout); } va_end (argptr); } } /* * This is to handle RM_UPDATE messages from rip_callback(), and more * importantly the RIP_MANAGER_INFO struct. Most of the code here * is for handling the pretty formating stuff otherwise it could be * much smaller. */ void print_status (RIP_MANAGER_INFO *rmi) { STREAM_PREFS *prefs = rmi->prefs; char status_str[128]; char filesize_str[64]; static int buffering_tick = 0; BOOL static printed_fullinfo = FALSE; if (m_dont_print) return; if (printed_fullinfo && rmi->filename[0]) { switch(rmi->status) { case RM_STATUS_BUFFERING: buffering_tick++; if (buffering_tick == 5) buffering_tick = 0; sprintf(status_str,"buffering - %c ", m_buffer_chars[buffering_tick]); print_to_console ("[%14s] %.50s\r", status_str, rmi->filename); break; case RM_STATUS_RIPPING: if (rmi->track_count < prefs->dropcount) { strcpy(status_str, "skipping... "); } else { strcpy(status_str, "ripping... "); } format_byte_size(filesize_str, rmi->filesize); print_to_console ("[%14s] %.50s [%7s]\r", status_str, rmi->filename, filesize_str); break; case RM_STATUS_RECONNECTING: strcpy(status_str, "re-connecting.."); print_to_console ("[%14s]\r", status_str); break; } } if (!printed_fullinfo) { print_to_console ("stream: %s\n" "server name: %s\n", rmi->streamname, rmi->server_name); if (rmi->http_bitrate > 0) { print_to_console ("declared bitrate: %d\n", rmi->http_bitrate); } if (rmi->meta_interval != NO_META_INTERVAL) { print_to_console ("meta interval: %d\n", rmi->meta_interval); } if (GET_MAKE_RELAY(prefs->flags)) { print_to_console ("relay port: %d\n" "[%14s]\r", prefs->relay_port, "getting track name... "); } printed_fullinfo = TRUE; } } /* * This will get called whenever anything interesting happens with the * stream. Interesting are progress updates, error's, when the rip * thread stops (RM_DONE) starts (RM_START) and when we get a new track. * * for the most part this function just checks what kind of message we got * and prints out stuff to the screen. */ void rip_callback (RIP_MANAGER_INFO* rmi, int message, void *data) { ERROR_INFO *err; switch(message) { case RM_UPDATE: print_status (rmi); break; case RM_ERROR: err = (ERROR_INFO*)data; fprintf(stderr, "\nerror %d [%s]\n", err->error_code, err->error_str); m_alldone = TRUE; break; case RM_DONE: print_to_console ("bye..\n"); m_alldone = TRUE; break; case RM_NEW_TRACK: print_to_console ("\n"); break; case RM_STARTED: m_started = TRUE; break; } } /* Usage should be printed to stdout when it is not an error http://www.gnu.org/prep/standards/standards.html */ static void print_usage (FILE* stream) { fprintf(stream, "Usage: streamripper URL [OPTIONS]\n"); fprintf(stream, "Opts: -h - Print this listing\n"); fprintf(stream, " -v - Print version info and quit\n"); fprintf(stream, " -a [file] - Rip to single file, default name is timestamped\n"); fprintf(stream, " -A - Don't write individual tracks\n"); fprintf(stream, " -d dir - The destination directory\n"); fprintf(stream, " -D pattern - Write files using specified pattern\n"); fprintf(stream, " -s - Don't create a directory for each stream\n"); fprintf(stream, " -r [[ip:]port] - Create relay server on base ip:port, default port 8000\n"); fprintf(stream, " -R #connect - Max connections to relay, default 1, -R 0 is no limit\n"); fprintf(stream, " -L file - Create a relay playlist file\n"); fprintf(stream, " -z - Don't scan for free ports if base port is not avail\n"); fprintf(stream, " -p url - Use HTTP proxy server at \n"); fprintf(stream, " -o (always|never|larger|version) - When to write tracks in complete\n"); fprintf(stream, " -t - Don't overwrite tracks in incomplete\n"); fprintf(stream, " -c - Don't auto-reconnect\n"); fprintf(stream, " -l seconds - Number of seconds to run, otherwise runs forever\n"); fprintf(stream, " -M megabytes - Stop ripping after this many megabytes\n"); fprintf(stream, " -q [start] - Add sequence number to output file\n"); fprintf(stream, " -u useragent - Use a different UserAgent than \"Streamripper\"\n"); fprintf(stream, " -w rulefile - Parse metadata using rules in file.\n"); fprintf(stream, " -m timeout - Number of seconds before force-closing stalled conn\n"); fprintf(stream, " -k count - Leave tracks in incomplete\n"); #if !defined (WIN32) fprintf(stream, " -I interface - Rip from specified interface (e.g. eth0)\n"); #endif fprintf(stream, " -T - Truncate duplicated tracks in incomplete\n"); fprintf(stream, " -E command - Run external command to fetch metadata\n"); fprintf(stream, " --quiet - Don't print ripping status to console\n"); fprintf(stream, " --stderr - Print ripping status to stderr (old behavior)\n"); fprintf(stream, " --debug - Save debugging trace\n"); fprintf(stream, "ID3 opts (mp3/aac/nsv): [The default behavior is adding ID3V2.3 only]\n"); fprintf(stream, " -i - Don't add any ID3 tags to output file\n"); fprintf(stream, " --with-id3v1 - Add ID3V1 tags to output file\n"); fprintf(stream, " --without-id3v2 - Don't add ID3V2 tags to output file\n"); fprintf(stream, "Splitpoint opts (mp3 only):\n"); fprintf(stream, " --xs-none - Don't search for silence\n"); fprintf(stream, " --xs-offset=num - Shift relative to metadata (msec)\n"); fprintf(stream, " --xs-padding=num:num - Add extra to prev:next track (msec)\n"); fprintf(stream, " --xs-search-window=num:num - Search window relative to metadata (msec)\n"); fprintf(stream, " --xs-silence-length=num - Expected length of silence (msec)\n"); fprintf(stream, " --xs2 - Use new algorithm for silence detection\n"); fprintf(stream, "Codeset opts:\n"); fprintf(stream, " --codeset-filesys=codeset - Specify codeset for the file system\n"); fprintf(stream, " --codeset-id3=codeset - Specify codeset for id3 tags\n"); fprintf(stream, " --codeset-metadata=codeset - Specify codeset for metadata\n"); fprintf(stream, " --codeset-relay=codeset - Specify codeset for the relay stream\n"); } /* * Bla, boring agument parsing crap, only reason i didn't use getopt * (which i did for an earlyer version) is because i couldn't find a good * port of it under Win32.. there probably is one, maybe i didn't look * hard enough. */ static void parse_arguments (STREAM_PREFS* prefs, int argc, char **argv) { int i; char *c; if (argc < 2) { print_usage (stdout); exit(2); } // Get URL strncpy (prefs->url, argv[1], MAX_URL_LEN); // Load prefs prefs_load (); prefs_get_stream_prefs (prefs, prefs->url); prefs_save (); // Parse arguments for (i = 1; i < argc; i++) { if (argv[i][0] != '-') continue; c = strchr ("dDEfIklLmMopRuw", argv[i][1]); if (c != NULL) { if ((i == (argc-1)) || (argv[i+1][0] == '-')) { fprintf(stderr, "option %s requires an argument\n", argv[i]); exit(1); } } switch (argv[i][1]) { case 'a': /* Create single file output + cue sheet */ OPT_FLAG_SET (prefs->flags, OPT_SINGLE_FILE_OUTPUT, 1); prefs->showfile_pattern[0] = 0; if (i == (argc-1) || argv[i+1][0] == '-') break; i++; strncpy (prefs->showfile_pattern, argv[i], SR_MAX_PATH); break; case 'A': OPT_FLAG_SET (prefs->flags, OPT_INDIVIDUAL_TRACKS, 0); break; case 'c': OPT_FLAG_SET (prefs->flags, OPT_AUTO_RECONNECT, 0); break; case 'd': i++; strncpy(prefs->output_directory, argv[i], SR_MAX_PATH); break; case 'D': i++; strncpy(prefs->output_pattern, argv[i], SR_MAX_PATH); break; case 'E': OPT_FLAG_SET (prefs->flags, OPT_EXTERNAL_CMD, 1); i++; strncpy(prefs->ext_cmd, argv[i], SR_MAX_PATH); break; case 'f': i++; fprintf (stderr, "Error: -f dropstring option is obsolete. " "Please use -w parse_rules instead.\n"); exit (1); case 'h': case '?': print_usage (stdout); exit(0); break; case 'i': OPT_FLAG_SET(prefs->flags, OPT_ADD_ID3V1, 0); OPT_FLAG_SET(prefs->flags, OPT_ADD_ID3V2, 0); break; case 'I': i++; strncpy(prefs->if_name, argv[i], SR_MAX_PATH); break; case 'k': i++; prefs->dropcount = atoi(argv[i]); break; case 'l': i++; time(&m_stop_time); m_stop_time += atoi(argv[i]); break; case 'L': i++; strncpy(prefs->pls_file, argv[i], SR_MAX_PATH); break; case 'm': i++; prefs->timeout = atoi(argv[i]); break; case 'M': i++; prefs->maxMB_rip_size = atoi(argv[i]); OPT_FLAG_SET(prefs->flags, OPT_CHECK_MAX_BYTES, 1); break; case 'o': i++; prefs->overwrite = string_to_overwrite_opt (argv[i]); if (prefs->overwrite == OVERWRITE_UNKNOWN) { fprintf (stderr, "Error: -o option requires an argument\n"); exit (1); } break; case 'p': i++; strncpy(prefs->proxyurl, argv[i], MAX_URL_LEN); break; case 'P': i++; fprintf (stderr, "Error: -P prefix option is obsolete. " "Please use -D pattern instead.\n"); exit (1); case 'q': OPT_FLAG_SET(prefs->flags, OPT_COUNT_FILES, 1); prefs->count_start = -1; /* -1 means auto-detect */ if (i == (argc-1) || argv[i+1][0] == '-') break; i++; prefs->count_start = atoi(argv[i]); break; case 'r': OPT_FLAG_SET(prefs->flags, OPT_MAKE_RELAY, 1); if (i == (argc-1) || argv[i+1][0] == '-') break; i++; c = strstr(argv[i], ":"); if (NULL == c) { prefs->relay_port = atoi(argv[i]); } else { *c = '\0'; strncpy(prefs->relay_ip, argv[i], SR_MAX_PATH); prefs->relay_port = atoi(++c); } break; case 'R': i++; prefs->max_connections = atoi(argv[i]); break; case 's': OPT_FLAG_SET(prefs->flags, OPT_SEPARATE_DIRS, 0); break; case 't': OPT_FLAG_SET(prefs->flags, OPT_KEEP_INCOMPLETE, 1); break; case 'T': OPT_FLAG_SET(prefs->flags, OPT_TRUNCATE_DUPS, 1); break; case 'u': i++; strncpy(prefs->useragent, argv[i], MAX_USERAGENT_STR); break; case 'v': printf("Streamripper %s\n", SRVERSION); exit(0); case 'w': i++; strncpy(prefs->rules_file, argv[i], SR_MAX_PATH); break; case 'z': OPT_FLAG_SET(prefs->flags, OPT_SEARCH_PORTS, 0); prefs->max_port = prefs->relay_port+1000; break; case '-': parse_extended_options (prefs, &argv[i][2]); break; } } /* Need to verify that splitpoint rules were sane */ verify_splitpoint_rules (prefs); /* Verify that first parameter is URL */ if (argv[1][0] == '-') { fprintf(stderr, "*** The first parameter MUST be the URL\n\n"); exit(2); } } static void parse_extended_options (STREAM_PREFS* prefs, char* rule) { int x,y; /* Version */ if (!strcmp(rule,"version")) { printf("Streamripper %s\n", SRVERSION); exit(0); } /* Logging options */ if (!strcmp(rule,"debug")) { debug_enable(); return; } if (!strcmp(rule,"stderr")) { m_print_stderr = TRUE; return; } if (!strcmp(rule,"quiet")) { m_dont_print = TRUE; return; } /* Splitpoint options */ if ((!strcmp(rule,"xs-none")) || (!strcmp(rule,"xs_none"))) { prefs->sp_opt.xs = 0; debug_printf ("Disable silence detection"); return; } if (!strcmp(rule,"xs2")) { prefs->sp_opt.xs = 2; debug_printf ("Setting xs2\n"); return; } if ((1==sscanf(rule,"xs-min-volume=%d",&x)) || (1==sscanf(rule,"xs_min_volume=%d",&x))) { prefs->sp_opt.xs_min_volume = x; debug_printf ("Setting minimum volume to %d\n",x); return; } if ((1==sscanf(rule,"xs-silence-length=%d",&x)) || (1==sscanf(rule,"xs_silence_length=%d",&x))) { prefs->sp_opt.xs_silence_length = x; debug_printf ("Setting silence length to %d\n",x); return; } if ((2==sscanf(rule,"xs-search-window=%d:%d",&x,&y)) || (2==sscanf(rule,"xs_search_window=%d:%d",&x,&y))) { prefs->sp_opt.xs_search_window_1 = x; prefs->sp_opt.xs_search_window_2 = y; debug_printf ("Setting search window to (%d:%d)\n",x,y); return; } if ((1==sscanf(rule,"xs-offset=%d",&x)) || (1==sscanf(rule,"xs_offset=%d",&x))) { prefs->sp_opt.xs_offset = x; debug_printf ("Setting silence offset to %d\n",x); return; } if ((2==sscanf(rule,"xs-padding=%d:%d",&x,&y)) || (2==sscanf(rule,"xs_padding=%d:%d",&x,&y))) { prefs->sp_opt.xs_padding_1 = x; prefs->sp_opt.xs_padding_2 = y; debug_printf ("Setting file output padding to (%d:%d)\n",x,y); return; } /* id3 options */ if (!strcmp(rule,"with-id3v2")) { OPT_FLAG_SET(prefs->flags,OPT_ADD_ID3V2,1); return; } if (!strcmp(rule,"without-id3v2")) { OPT_FLAG_SET(prefs->flags,OPT_ADD_ID3V2,0); return; } if (!strcmp(rule,"with-id3v1")) { OPT_FLAG_SET(prefs->flags,OPT_ADD_ID3V1,1); return; } if (!strcmp(rule,"without-id3v1")) { OPT_FLAG_SET(prefs->flags,OPT_ADD_ID3V1,0); return; } /* codeset options */ x = strlen("codeset-filesys="); if (!strncmp(rule,"codeset-filesys=",x)) { strncpy (prefs->cs_opt.codeset_filesys, &rule[x], MAX_CODESET_STRING); debug_printf ("Setting filesys codeset to %s\n", prefs->cs_opt.codeset_filesys); return; } x = strlen("codeset-id3="); if (!strncmp(rule,"codeset-id3=",x)) { strncpy (prefs->cs_opt.codeset_id3, &rule[x], MAX_CODESET_STRING); debug_printf ("Setting id3 codeset to %s\n", prefs->cs_opt.codeset_id3); return; } x = strlen("codeset-metadata="); if (!strncmp(rule,"codeset-metadata=",x)) { strncpy (prefs->cs_opt.codeset_metadata, &rule[x], MAX_CODESET_STRING); debug_printf ("Setting metadata codeset to %s\n", prefs->cs_opt.codeset_metadata); return; } x = strlen("codeset-relay="); if (!strncmp(rule,"codeset-relay=",x)) { strncpy (prefs->cs_opt.codeset_relay, &rule[x], MAX_CODESET_STRING); debug_printf ("Setting relay codeset to %s\n", prefs->cs_opt.codeset_relay); return; } /* All rules failed */ fprintf (stderr, "Can't parse command option: --%s\n", rule); exit (-1); } static void verify_splitpoint_rules (STREAM_PREFS *prefs) { #if defined (commentout) /* This is still not complete, but the warning causes people to wonder what is going on. */ fprintf (stderr, "Warning: splitpoint sanity check not yet complete.\n"); #endif /* xs_silence_length must be non-negative and divisible by two */ if (prefs->sp_opt.xs_silence_length < 0) { prefs->sp_opt.xs_silence_length = 0; } if (prefs->sp_opt.xs_silence_length % 2) { prefs->sp_opt.xs_silence_length ++; } /* search_window values must be non-negative */ if (prefs->sp_opt.xs_search_window_1 < 0) { prefs->sp_opt.xs_search_window_1 = 0; } if (prefs->sp_opt.xs_search_window_2 < 0) { prefs->sp_opt.xs_search_window_2 = 0; } /* if silence_length is 0, then search window should be zero */ if (prefs->sp_opt.xs_silence_length == 0) { prefs->sp_opt.xs_search_window_1 = 0; prefs->sp_opt.xs_search_window_2 = 0; } /* search_window values must be longer than silence_length */ if (prefs->sp_opt.xs_search_window_1 + prefs->sp_opt.xs_search_window_2 < prefs->sp_opt.xs_silence_length) { /* if this happens, disable search */ prefs->sp_opt.xs_search_window_1 = 0; prefs->sp_opt.xs_search_window_2 = 0; prefs->sp_opt.xs_silence_length = 0; } /* search window lengths must be at least 1/2 of silence_length */ if (prefs->sp_opt.xs_search_window_1 < prefs->sp_opt.xs_silence_length) { prefs->sp_opt.xs_search_window_1 = prefs->sp_opt.xs_silence_length; } if (prefs->sp_opt.xs_search_window_2 < prefs->sp_opt.xs_silence_length) { prefs->sp_opt.xs_search_window_2 = prefs->sp_opt.xs_silence_length; } } streamripper-1.64.6.orig/console/cstreamripper.c0000644000175000017500000000747310644067107020042 0ustar abiabi/* cstreamripper.c * Curses front end for streamripper * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "srconfig.h" #include #include #include #include #include "sr_cdk.h" /* GCS FIX: need to set HAVE_XCURSES as needed */ #ifdef HAVE_XCURSES char *XCursesProgramName = "scroll_ex"; #endif //#include "srtypes.h" //#include "rip_manager.h" //#include "mchar.h" //#include "filelib.h" //#include "debug.h" int main (int argc, char* argv[]) { /* Declare variables. */ CDKSCREEN *cdkscreen = 0; CDKSCROLL *scrollList = 0; WINDOW *cursesWin = 0; char *title = "Pick a file"; char **list_items; int count; char *mesg[5], temp[256]; int selection; CDK_PARAMS params; CDKparseParams (argc, argv, ¶ms, "cs:t:" CDK_CLI_PARAMS); /* GCS FIX: Only set if not defined by env */ /* GCS FIX: This constant is only defined for ncurses */ #if defined (NCURSES_VERSION) ESCDELAY = 50; #endif /* Set up CDK. */ cursesWin = initscr (); /* GCS FIX: Not all curses implementations support this */ use_default_colors(); cdkscreen = initCDKScreen (cursesWin); /* Set up CDK Colors. */ initCDKColor (); /* Set up list */ list_items = (char**) malloc (sizeof(char*)*20); list_items[0] = "Hello world"; list_items[1] = "Goodbye world"; count = 2; /* Use the current diretory list to fill the radio list. */ // count = CDKgetDirectoryContents (".", &item); /* Create the scrolling list. */ scrollList = newCDKScroll (cdkscreen, CENTER, /* X posn */ 3, /* Y posn */ RIGHT, /* Scroll location */ -3, /* Height */ 0, /* Width */ "", /* Title */ list_items, /* List of items */ count, /* Number of items in list */ FALSE, /* Leading number? */ A_REVERSE, /* Display attributes */ TRUE, /* Box around list? */ FALSE); /* Shadow? */ /* Is the scrolling list null? */ if (scrollList == 0) { /* Exit CDK. */ destroyCDKScreen (cdkscreen); endCDK (); /* Print out a message and exit. */ printf ("Oops. Could not make scrolling list. Is the window too small?\n"); exit (EXIT_FAILURE); } { int pos = 1; nodelay (cursesWin,TRUE); drawCDKScroll (scrollList, pos); // setCDKScrollPosition (scrollList, 10); // drawCDKScroll (scrollList, 1); refreshCDKScreen (cdkscreen); while (1) { int p = getch(); if (p == ERR) { /* GCS FIX usleep() only defined for unix */ //usleep (100); } else if (p == 'q') { break; } else if (p == 'j') { if (++pos >= count) pos = count-1; setCDKScrollPosition (scrollList, pos); drawCDKScroll (scrollList, 1); /* GCS FIX usleep() only defined for unix */ //usleep (10); } else if (p == 'k') { if (--pos < 0) pos = 0; setCDKScrollPosition (scrollList, pos); drawCDKScroll (scrollList, 1); /* GCS FIX usleep() only defined for unix */ //usleep (10); } } } /* Clean up. */ // CDKfreeStrings (item); destroyCDKScroll (scrollList); destroyCDKScreen (cdkscreen); endCDK (); exit (EXIT_SUCCESS); } streamripper-1.64.6.orig/install-sh0000644000175000017500000002201710246375447015353 0ustar abiabi#!/bin/sh # install - install a program, script, or datafile scriptversion=2004-12-17.09 # 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. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= 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: -c (ignored) -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. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; 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 for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi 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 "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # 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: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # 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 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $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 "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 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. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: streamripper-1.64.6.orig/COPYING0000644000175000017500000004307607332700524014403 0ustar abiabi GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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 Library 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 Appendix: 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) 19yy 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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 Library General Public License instead of this License. streamripper-1.64.6.orig/config.sub0000755000175000017500000006725407472606712015350 0ustar abiabi#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-10-05' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dsp16xx \ | fr30 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | m32r | m68000 | m68k | m88k | mcore \ | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el | mips64vr4300 \ | mips64vr4300el | mips64vr5000 | mips64vr5000el \ | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ | mipsisa32 \ | mn10200 | mn10300 \ | ns16k | ns32k \ | openrisc \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | s390 | s390x \ | sh | sh[34] | sh[34]eb | shbe | shle \ | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ | stormy16 | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 \ | we32k \ | x86 | xscale \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alphapca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c54x-* \ | clipper-* | cray2-* | cydra-* \ | d10v-* | d30v-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | m32r-* \ | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | s390-* | s390x-* \ | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ | sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \ | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ | v850-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | ymp) basic_machine=ymp-cray os=-unicos ;; cray2) basic_machine=cray2-cray os=-unicos ;; [cjt]90) basic_machine=${basic_machine}-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux-gnu ;; mips*-linux*) basic_machine=mips-unknown os=-linux-gnu ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=t3e-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; windows32) basic_machine=i386-pc os=-windows32-msvcrt ;; xmp) basic_machine=xmp-cray os=-unicos ;; xps | xps100) basic_machine=xps100-honeywell ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; mips) if [ x$os = x-linux-gnu ]; then basic_machine=mips-unknown else basic_machine=mips-mips fi ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh3eb | sh4eb) basic_machine=sh-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; c4x*) basic_machine=c4x-none os=-coff ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto*) os=-nto-qnx ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: streamripper-1.64.6.orig/README0000644000175000017500000005163511154767114014235 0ustar abiabiSTREAMRIPPER(1) STREAMRIPPER(1) NAME streamripper - rip shoutcast radio streams to mp3 files SYNOPSIS streamripper URL [options] DESCRIPTION Streamripper records shoutcast and icecast compatible streams, in their native format. The following formats are supported: mp3, nsv, aac, and ogg. The meta data within the stream are interpreted to determine the beginning and end of each song, and stores the songs on your hard disk as individual files. In addition, streamripper includes a relay server for listening to the station while you are recording. OPTIONS -h Print help and exit -v Print version info and quit -d dir The destination directory Select a different base directory for ripping, just in case you dont want to dump tons of mp3s into whatever directory your at. -s Dont create a directory for each stream Normally streamripper will make a directory with the same name as the stream to place the tracks into, this disables that. -D pattern Use a pattern to format the output file names This option tells streamripper how to form the filenames. If -D is used, the options -s and -P will be ignored. If the pattern represents an absolute path, the -d option will also be ignored. If both -D and -q are specified, -q will only be used to set the start count if a %q token is included. By default the output files are put in a directory that has the same name as the stream, and files are formed from the artist and title. But you can override this behavior and create the output files as you like. The output file names are generated by substituting tokens with values that depend on the stream, track, or environment. The following tokens can be used for substitution. %S Stream %A Artist %T Title %a Album %D Date and time (per song) %d Date and time (per execution) %q Sequence number (automatic detection) %Nq Sequence number (starting from number N) %% Percent sign Note On windows you may be required to supply an extra % because the symbol is consumed by the shell. Therefore, you would put "%%S/%%A/%%T" instead of "%S/%A/%T". The extension (such as .mp3) is appended automatically. The tokens %D and %d differ because %D gives a unique timestamp for each song, whereas %d gives a unique timestamp each time streamripper is run. The tokens %q and %Nq differ because %q tries to figure out the correct sequence number from the existing files, wherease %Nq does not. The N is your starting number. For example %32q means start numbering at 32. -r [base port] Create a relay server on base port, defaults to port 8000 Creates a relay server on base port. if base port is not specified it defaults to 8000, otherwise whatever you entered for base port. Note that if the -z option is not used, it will keep trying higher ports if the port is unavailable. -R num_conn Maximum connections to relay stream In addition to creating a relay server, you can also control how many clients are allowed to simultaneously connect. The default is 1 client, but if you specify the -R option you can increase this number to clients. If is set to 0, the number of connections is limited only by your processor and network speed. The -R option has no effect if -r was not used to create a relay stream. -z Dont scan for free ports if base port is not available Disables the "scan for free port" feature. Use it if your paranoid, or dont like ports being open. -p url Use HTTP proxy server at If you are behind a proxy server, use the -p flag to specify its url. You can also use the http_proxy environment variable to specify your proxy server. -a [pattern] Rip to single file The default mode of operation is to separate the each track into a separate file. But sometimes this is not what you want. Sometimes you want the stream recorded to a single (big) file without splitting into tracks. The -a option does this. If you use -a without including the [pattern], a timestamped filename will automatically be used. The pattern can be used in a manner similar to the -D flag, but generally only %S, %q and %d are useful. -A Dont create individual tracks The default mode of operation is to create one file for each track. But sometimes you dont want these files. For example, you might prefer a single file (using the -a option), or you want to use streamripper as a relay (using the -r option), without creating these files. Using the -A option, the individual files for each track are not created. -o (always | never | larger | version) Overwrite tracks in complete directory When streamripper rips tracks they are put into the incomplete directory until they are finished. Normally, they are then moved into the complete directory. However, when the track is already there, can use this option to tell streamripper what you want to do. There are three choices: always, never, and larger. If you dont include any of the -o options on the command line, the default is "-o larger" for version through 1.63.4, and "-o version" starting with 1.64.5. If you use the "-o never" option, this tells streamripper to never overwrite any existing file in the complete directory. If you use the "-o always" option, this tells streamripper to always overwrite any existing file in the complete directory. If you use the "-o larger" option, this tells streamripper to overwrite an existing file in the complete directory if the newer file is larger. If you use the "-o version" option, this tells streamripper to keep both versions, renaming the existing file. -t Dont overwrite tracks in incomplete directory Normally streamripper writes the files in the incomplete directory, and then moves it to the base directory (the complete directory) when it is done. If the file with the name of the track already exists in incomplete, it will overwrite the old track. When you use the -t flag, however, this will tell streamripper to backup the existing file in incomplete (appending a version number), and then create the new file. This is useful for streams that dont have meta-data. Because these streams only have a single file, reconnects will cause overwriting the existing file, which is not desired. -T Truncate completed tracks in incomplete directory When you are not overwriting files in the complete folder, the duplicate files will normally stay in the incomplete folder. This option tells streamripper to truncate the files to zero bytes in the incomplete folder if they are a duplicate. -c Dont auto-reconnect Normally streamripper will be very aggressive and try to re-connect to a dropped stream. This option disables this behavior. -l seconds Run for a predetermined length of time, in seconds Usually, streamripper runs until it crashes. Or rather, I meant to say that it runs until you kill it, yes, Im sure thats what I meant. But you can instead tell streamripper to run for a certain length of time, and then exit using this flag. -M megabytes Stop ripping after this many megabytes Use this flag to tell streamripper to rip a certain number of megabytes, then stop. As of version 1.64.5, megabytes are defined as 2^20 bytes. -q [start] Add sequence number to output filenames When the files are copied from incomplete to complete, the filename can be prepended with a sequence number (beginning with 0000). This can be used to, for example, show the order that the files were created. If desired, a starting count can be used with -q to begin the sequence at any number you like. -i Dont add ID3 tags to output file Mp3 files have two different kinds of header information which describe the contents of the file: ID3V1 and ID3V2. By default, only ID3V2 is included in the mp3 files generated by streamripper. If you use the option, then neither are included. --with-id3v1 Add ID3V1 tags to output file --without-id3v2 Dont add ID3V2 tags to output file -k count Specify the number of files to leave in the incomplete directory. Usually you start ripping in the middle of the song, so the default is to leave one file in the incomplete. But sometimes you want to discard extra tracks generated by a stream, because they are advertisements, the station intro, broken songs, etc. Conversely, some streams always start you at the beginning of a complete song. In this case, you could specify "-k 0" to save the first song. -m timeout Timeout to restart connection Some streams will "hang", which means they havent disconnected, but they arent sending any data. When this happens, if you used the -m flag, streamripper will shut down the stream and reconnect after seconds of inactivity. -u useragent Use a different UserAgent than "Streamripper" In the http request, streamripper includes a string that identifies what kind of program is requesting the connection. By default it is the string "Streamripper/1.x". Here you can decide to identify yourself as a different agent if you like. -w parse_file Use customized parsing rules This tells streamripper to use custom meta-data parsing rules. Without this flag, streamripper will use its built-in parsing rules. There are two cases where you want to do this. In the first case, you are using a stream that changes the meta data within a song. Usually this is a thank-you notice or possibly an advertisement for an upcoming show. When this happens, the current track will become split into fragments. To prevent this, you can tell streamripper to ignore meta-data. The second case you might want to use this is if the artist and title information is sent in an unusual format. For example, they might be separated by a comma instead of a hyphen, or there might be an extra advertisement attached to the end of the meta-data string. In this case, you can tell streamripper how it should identify the title, artist, album and track from the metadata string using regular expressions. See the file parse_rules.txt, which is included in your distribution, for examples of the parse rules. -E external_command Use external command to get track information Some streams do not send artist or title information using metadata, but instead send this information using other means. For example, some streams update the current artist and title using html or xml. Another example is icecast 1.x, which sends metadata through a UDP socket. Streamripper can get artist and title information from these kinds of streams using a helper application, specified using the -E option. The helper application works by finding the title and artist, and writing it to stdout. Streamripper reads the output of the helper program, and splits the tracks accordingly. To help you in creating external commands to use with streamripper, please look at the example file fetch_external_metadata.pl, which is included in your distribution. --debug Save debugging log This creates a file called "gcs.txt" that contains all sorts of debugging information. --quiet Quiet operation Dont write any text to the console, except error messages --stderr Write output to stderr instead of stdout --xs_silence_length=num Set silence duration The volume must be less than xsd_min_volume for a period of time greater than this. --xs_search_window=num:num Set search window duration This is how long to search for the silence. 1st number is msec before nominal center, 2nd number is msecs after nominal track change position. --xs_offset=num Set offset from center of silence window --xs_padding=num:num Set amount to pad before and after splitpoint. The 1st number is the number of msec to add to the end of each song. The 2nd number is the number of msec to add to the beginning of each song. --xs-none Dont search for silent spot This is a shorthand for the following combination of options: --xs-search-window=0:0 --xs-silence-lenghth=0 --xs-offset=0 --xs-padding=0:0. Note, however, that streamripper will still decode the stream in the region near the meta-data change, in order to split at an exact mp3 frame boundary. --xs2 Use capisces new algorithm (Apr 2008) for silence detection. --codeset-filesys=codeset Tells streamripper what codeset to use for the file names when it writes to your hard drive. --codeset-id3=codeset Tells streamripper what codeset to use for the id3 information. --codeset-metadata=codeset Tells streamripper what codeset is being used for metadata in the stream coming from the network. --codeset-relay=codeset Tells streamripper what codeset to use for metadata that it sends to your player on the relay stream. GETTING STARTED The easiest way to get started is to find the URL of a stream you want to rip, usually I find the URL by loading it up in winamp or xmms and querying for the source URL (right click on the playlist). Once you have the URL you can begin ripping. For example: streamripper http://205.188.245.132:8038 This would rip Monkey Radio (as of 1/10/2001), it places the tracks into two directorys one called "Monkey Radio" and a sub-directory "Monkey Radio/incomplete" the incomplete directory is for tracks that streamripper does not know the begging or end of. The first and last tracks your rip for instance, would be in incomplete. LISTENING TO THE RELAY You can listen to the stream while you are ripping by creating a relay server. This is done by using the -r option. streamripper http://205.188.245.132:8038 -r When streamripper starts it will display what port its relaying the stream on. It defaults to 8000 but you can choose another port. To listen to your relay server, open up XMMS or Winamp and enter your machine name with the port as you would any other stream. For example, if you are using the default relay stream, you would want to open up this URL: http://localhost:8000 However, if you are ripping an ogg stream, you usually need to tell the player that the stream is ogg, which can be done by appending ".ogg" to the stream URL. http://localhost:8000/.ogg Similarly, if you want to watch an nsv stream while you rip, you need to tell the player that the stream is nsv, which can be done by appending ";stream.nsv" to the URL. http://localhost:8000/;stream.nsv SPLITPOINT DETECTION Streamripper automatically splits tracks based on detection of a silent near the meta interval where the track changes. However, this method is imperfect, and sometimes the track splitting occurs is too early or too late. These options will fine tune the track splitting capabilities for streams that use cross-fading, which causes streamrippers automatic silence detection routine to fail. Various --xs flags can be used to add an offset for streams that have a meta interval that comes too early or too late, to add extra padding to the beginning and end of each song, and to decide where the length of the search window and silence window. Default splitting The default spitting algorithm is used when no silent point can be found. Suppose you have a meta-int with track change information at the time "mi" (see figure below). If the xs_offset is positive, the track separation point "ts" is later the "mi" point. If xs_offset is negative, "ts" is earlier than "mi". Once "ts" is determined, a user-defined "prepad" and "postpad" are used to determine where the next track begins "ntb", and where the previous track ends "pte". The interval between "ntb" and "pte" will be copied to both songs. /mi | | /ts |-----------| xs_offset | | | /ntb | /pte |---------|---------| prepad postpad Silence separation Splitting based on silence separation is similar to default splitting, only slightly more complex. Again, suppose you have a meta-int with track change information at the time "mi" (see figure below). A search window "search_win" is determined by the xs_offset, pre_sw, and post_sw field. The beginning of the search window is at: mi xs_offset - pre_sw and the end of the search window is at: mi xs_offset + post_sw. If there is a silent interval of length "silence_win" within the "search_win", the center of "silence_win" is selected as the track separation point "ts". Once "ts" is determined, a user-defined "prepad" and "postpad" are used to determine where the next track begins "ntb", and where the previous track ends "pte". The interval between "ntb" and "pte" will be copied to both songs. /mi | |-----------| xs_offset | | ts\ | |-------+-|---------| *search_win pre_sw | post_sw | |---+---| *silence_win | /ntb | /pte |-------------|---------| prepad postpad USAGE EXAMPLES Rip from a stream: streamripper URL Rip from a stream for one hour: streamripper URL -l 3600 Rip the stream, putting the mp3 files into the directory /my/music/stream1: streamripper URL -d /my/music/stream1 -s Rip the stream, creating a single file and dont create individual tracks: streamripper URL -a -A Rip from a stream and create a relay stream at port 9000: streamripper URL -r 9000 Rip from a stream, creating a relay stream at port 8000, and allowing twenty clients to connect: streamripper URL -r -R 20 SPLITPOINT USAGE EXAMPLES Each of my songs contain about 5 seconds of the previous song. How can I fix this? streamripper URL --xs_offset=5000 Each of my songs contain about 5 seconds of the next song. How can I fix? streamripper URL --xs_offset=-5000 Each of my songs contain between 5 and 10 seconds of the previous song, but it depends on the song. How can I include all of this zone within both songs, and edit them later? streamripper URL --xs_offset=7500 --xs_padding=2500:2500 RESOURCES Please check out the following web sites. Linked to the streamripper home page is a forum that can can be used to chat and ask questions. Streamripper home page: http://streamripper.sourceforge.net/ Sourceforge project page http://sourceforge.net/projects/streamripper Shoutcast http://www.shoutcast.com Icecast http://www.icecast.org COPYING Copyright 2000-2002 Jon Clegg, 2004-2009 Gregory C. Sharp. Free use of this software is granted under the terms of the GNU General Public License (GPL). 03/08/2009 STREAMRIPPER(1) streamripper-1.64.6.orig/ltconfig0000755000175000017500000026776507472606712015131 0ustar abiabi#! /bin/sh # ltconfig - Create a system-specific libtool. # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This file 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A lot of this script is taken from autoconf-2.10. # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} echo=echo if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec "$SHELL" "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null`} case X$UNAME in *-DOS) PATH_SEPARATOR=';' ;; *) PATH_SEPARATOR=':' ;; esac fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi if test "X${echo_test_string+set}" != "Xset"; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then break fi done fi if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running ltconfig again with it. ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf "%s\n"' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # Cool, printf works : elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # The name of this program. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` # Constants: PROGRAM=ltconfig PACKAGE=libtool VERSION=1.3.3 TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)" ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' rm="rm -f" help="Try \`$progname --help' for more information." # Global variables: default_ofile=libtool can_build_shared=yes enable_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). enable_static=yes enable_fast_install=yes enable_dlopen=unknown enable_win32_dll=no ltmain= silent= srcdir= ac_config_guess= ac_config_sub= host= nonopt= ofile="$default_ofile" verify_host=yes with_gcc=no with_gnu_ld=no need_locks=yes ac_ext=c objext=o libext=a exeext= cache_file= old_AR="$AR" old_CC="$CC" old_CFLAGS="$CFLAGS" old_CPPFLAGS="$CPPFLAGS" old_LDFLAGS="$LDFLAGS" old_LD="$LD" old_LN_S="$LN_S" old_LIBS="$LIBS" old_NM="$NM" old_RANLIB="$RANLIB" old_DLLTOOL="$DLLTOOL" old_OBJDUMP="$OBJDUMP" old_AS="$AS" # Parse the command line options. args= prev= for option do case "$option" in -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then eval "$prev=\$option" prev= continue fi case "$option" in --help) cat <&2 echo "$help" 1>&2 exit 1 ;; *) if test -z "$ltmain"; then ltmain="$option" elif test -z "$host"; then # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then # echo "$progname: warning \`$option' is not a valid host type" 1>&2 # fi host="$option" else echo "$progname: too many arguments" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac done if test -z "$ltmain"; then echo "$progname: you must specify a LTMAIN file" 1>&2 echo "$help" 1>&2 exit 1 fi if test ! -f "$ltmain"; then echo "$progname: \`$ltmain' does not exist" 1>&2 echo "$help" 1>&2 exit 1 fi # Quote any args containing shell metacharacters. ltconfig_args= for arg do case "$arg" in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ltconfig_args="$ltconfig_args '$arg'" ;; *) ltconfig_args="$ltconfig_args $arg" ;; esac done # A relevant subset of AC_INIT. # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 5 compiler messages saved in config.log # 6 checking for... messages and results if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>>./config.log # NLS nuisances. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test -n "$cache_file" && test -r "$cache_file"; then echo "loading cache $cache_file within ltconfig" . $cache_file fi if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi if test -z "$srcdir"; then # Assume the source directory is the same one as the path to LTMAIN. srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` test "$srcdir" = "$ltmain" && srcdir=. fi trap "$rm conftest*; exit 1" 1 2 15 if test "$verify_host" = yes; then # Check for config.guess and config.sub. ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/config.guess; then ac_aux_dir=$ac_dir break fi done if test -z "$ac_aux_dir"; then echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 echo "$help" 1>&2 exit 1 fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub # Make sure we can run config.sub. if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : else echo "$progname: cannot run $ac_config_sub" 1>&2 echo "$help" 1>&2 exit 1 fi echo $ac_n "checking host system type""... $ac_c" 1>&6 host_alias=$host case "$host_alias" in "") if host_alias=`$SHELL $ac_config_guess`; then : else echo "$progname: cannot guess host type; you must specify one" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac host=`$SHELL $ac_config_sub $host_alias` echo "$ac_t$host" 1>&6 # Make sure the host verified. test -z "$host" && exit 1 elif test -z "$host"; then echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 echo "$help" 1>&2 exit 1 else host_alias=$host fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case "$host_os" in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` case "$host_os" in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "${COLLECT_NAMES+set}" != set; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR cru $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= # Set a sane default for `AR'. test -z "$AR" && AR=ar # Set a sane default for `OBJDUMP'. test -z "$OBJDUMP" && OBJDUMP=objdump # If RANLIB is not set, then run the test. if test "${RANLIB+set}" != "set"; then result=no echo $ac_n "checking for ranlib... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then RANLIB="ranlib" result="ranlib" break fi done IFS="$save_ifs" echo "$ac_t$result" 1>&6 fi if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi # Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$AS" && AS=as # Check to see if we are using GCC. if test "$with_gcc" != yes || test -z "$CC"; then # If CC is not set, then try to find GCC or a usable CC. if test -z "$CC"; then echo $ac_n "checking for gcc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then CC="gcc" break fi done IFS="$save_ifs" if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi fi # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". if test -z "$CC"; then echo $ac_n "checking for cc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" cc_rejected=no for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/cc || test -f $dir/cc$ac_exeext; then if test "$dir/cc" = "/usr/ucb/cc"; then cc_rejected=yes continue fi CC="cc" break fi done IFS="$save_ifs" if test $cc_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same name, so the bogon will be chosen # first if we set CC to just the name; use the full file name. shift set dummy "$dir/cc" "$@" shift CC="$@" fi fi if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$CC"; then echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 exit 1 fi fi # Now see if the compiler is really GCC. with_gcc=no echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 echo "$progname:581: checking whether we are using GNU C" >&5 $rm conftest.c cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then with_gcc=yes fi $rm conftest.c echo "$ac_t$with_gcc" 1>&6 fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" echo $ac_n "checking for object suffix... $ac_c" 1>&6 $rm conftest* echo 'int i = 1;' > conftest.c echo "$progname:603: checking for object suffix" >& 5 if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c) ;; *) objext=`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* echo "$ac_t$objext" 1>&6 echo $ac_n "checking for executable suffix... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_exeext="no" $rm conftest* echo 'main () { return 0; }' > conftest.c echo "$progname:629: checking for executable suffix" >& 5 if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c | *.err | *.$objext ) ;; *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* fi if test "X$ac_cv_exeext" = Xno; then exeext="" else exeext="$ac_cv_exeext" fi echo "$ac_t$ac_cv_exeext" 1>&6 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 pic_flag= special_shlib_compile_flags= wl= link_static_flag= no_builtin_flag= if test "$with_gcc" = yes; then wl='-Wl,' link_static_flag='-static' case "$host_os" in beos* | irix5* | irix6* | osf3* | osf4*) # PIC is the default for these OSes. ;; aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # we not sure about C++ programs. link_static_flag="$link_static_flag ${wl}-lC" ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. pic_flag='-m68020 -resident32 -malways-restore-a4' ;; sysv4*MP*) if test -d /usr/nec; then pic_flag=-Kconform_pic fi ;; *) pic_flag='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case "$host_os" in aix3* | aix4*) # All AIX code is PIC. link_static_flag='-bnso -bI:/lib/syscalls.exp' ;; hpux9* | hpux10* | hpux11*) # Is there a better link_static_flag that works with the bundled CC? wl='-Wl,' link_static_flag="${wl}-a ${wl}archive" pic_flag='+Z' ;; irix5* | irix6*) wl='-Wl,' link_static_flag='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; osf3* | osf4*) # All OSF/1 code is PIC. wl='-Wl,' link_static_flag='-non_shared' ;; sco3.2v5*) pic_flag='-Kpic' link_static_flag='-dn' special_shlib_compile_flags='-belf' ;; solaris*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; sunos4*) pic_flag='-PIC' link_static_flag='-Bstatic' wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; uts4*) pic_flag='-pic' link_static_flag='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then pic_flag='-Kconform_pic' link_static_flag='-Bstatic' fi ;; *) can_build_shared=no ;; esac fi if test -n "$pic_flag"; then echo "$ac_t$pic_flag" 1>&6 # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $pic_flag -DPIC" echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then # Append any warnings to the config.log. cat conftest.err 1>&5 case "$host_os" in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then they # create non-PIC objects. So, if there were any warnings, we assume that # PIC is not supported. if test -s conftest.err; then echo "$ac_t"no 1>&6 can_build_shared=no pic_flag= else echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" fi ;; *) echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" ;; esac else # Append any errors to the config.log. cat conftest.err 1>&5 can_build_shared=no pic_flag= echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else echo "$ac_t"none 1>&6 fi # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 $rm -r conftest 2>/dev/null mkdir conftest cd conftest $rm conftest* echo "int some_variable = 0;" > conftest.c mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.o" echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then echo "$ac_t"no 1>&6 compiler_c_o=no else echo "$ac_t"yes 1>&6 compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&5 compiler_c_o=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_o_lo=no else echo "$ac_t"yes 1>&6 compiler_o_lo=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_o_lo=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$ac_t$hard_links" 1>&6 $rm conftest* if test "$hard_links" = no; then echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 need_locks=warn fi else need_locks=no fi if test "$with_gcc" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_rtti_exceptions=no else echo "$ac_t"yes 1>&6 compiler_rtti_exceptions=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_rtti_exceptions=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # Check for any special shared library compilation flags. if test -n "$special_shlib_compile_flags"; then echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : else echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 can_build_shared=no fi fi echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 $rm conftest* echo 'main(){return(0);}' > conftest.c save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $link_static_flag" echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then echo "$ac_t$link_static_flag" 1>&6 else echo "$ac_t"none 1>&6 link_static_flag= fi LDFLAGS="$save_LDFLAGS" $rm conftest* if test -z "$LN_S"; then # Check to see if we can use ln -s, or we need hard links. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 $rm conftest.dat if ln -s X conftest.dat 2>/dev/null; then $rm conftest.dat LN_S="ln -s" else LN_S=ln fi if test "$LN_S" = "ln -s"; then echo "$ac_t"yes 1>&6 else echo "$ac_t"no 1>&6 fi fi # Make sure LD is an absolute path. if test -z "$LD"; then ac_prog=ld if test "$with_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 echo "$progname:991: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we are not using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld... $ac_c" 1>&6 echo "$progname:1015: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 echo "$progname:1018: checking for non-GNU ld" >&5 fi if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" fi if test -n "$LD"; then echo "$ac_t$LD" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$LD"; then echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 exit 1 fi fi # Check to see if it really is or is not GNU ld. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then with_gnu_ld=yes else with_gnu_ld=no fi echo "$ac_t$with_gnu_ld" 1>&6 # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. case "$host_os" in cygwin* | mingw*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$with_gcc" != yes; then with_gnu_ld=no fi ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case "$host_os" in aix3* | aix4*) # On AIX, the GNU linker is very broken ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols' archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ _lt_hint=1; for symbol in `cat $export_symbols`; do echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; _lt_hint=`expr 1 + \$_lt_hint`; done~ test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' ;; netbsd*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' # can we support soname and/or expsyms with a.out? -oliva fi ;; solaris*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case "$host_os" in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$with_gcc" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4*) hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' hardcode_libdir_separator=':' if test "$with_gcc" = yes; then collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi shared_flag='-shared' else shared_flag='${wl}-bM:SRE' hardcode_direct=yes fi allow_undefined_flag=' ${wl}-berok' archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' case "$host_os" in aix4.[01]|aix4.[01].*) # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on always_export_symbols=yes ;; esac ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs' fix_srcfile_path='`cygpath -w $srcfile`' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case "$host_os" in hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$with_gcc" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF fi hardcode_libdir_flag_spec='${wl}-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; openbsd*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' ;; osf3* | osf4*) if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case "$host_os" in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec ;then # archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs' archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; *) ld_shlibs=no ;; esac fi echo "$ac_t$ld_shlibs" 1>&6 test "$ld_shlibs" = no && can_build_shared=no if test -z "$NM"; then echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 case "$NM" in [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -B" break elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -p" break else NM=${NM="$ac_dir/nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$NM" && NM=nm ;; esac echo "$ac_t$NM" 1>&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Define system-specific variables. case "$host_os" in aix*) symcode='[BCDT]' ;; cygwin* | mingw*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" ;; irix*) symcode='[BCDEGRST]' ;; solaris*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[ABCDGISTW]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no $rm conftest* cat > conftest.c <&5 if { (eval echo $progname:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm if { echo "$progname:1596: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.c #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' cat <> conftest.c #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c cat <<\EOF >> conftest.c {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$objext conftstm.$objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo $progname:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi LIBS="$save_LIBS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else global_symbol_pipe= fi done if test "$pipe_works" = yes; then echo "${ac_t}ok" 1>&6 else echo "${ac_t}failed" 1>&6 fi if test -z "$global_symbol_pipe"; then global_symbol_to_cdecl= fi # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$ac_t$hardcode_action" 1>&6 reload_flag= reload_cmds='$LD$reload_flag -o $output$reload_objs' echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 # PORTME Some linkers may need a different reload flag. reload_flag='-r' echo "$ac_t$reload_flag" 1>&6 test -n "$reload_flag" && reload_flag=" $reload_flag" # PORTME Fill in your ld.so characteristics library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" file_magic_cmd= file_magic_test_file= deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [regex]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 case "$host_os" in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4*) version_type=linux # AIX has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. # We preserve .a as extension for shared libraries though AIX4.2 # and later linker supports .so library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' shlibpath_var=LIBPATH deplibs_check_method=pass_all ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH deplibs_check_method=pass_all lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; bsdi4*) version_type=linux library_names_spec='${libname}.so$major ${libname}.so' soname_spec='${libname}.so' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw*) version_type=windows need_version=no need_lib_prefix=no if test "$with_gcc" = yes; then library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' else library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' fi dynamic_linker='Win32 ld.exe' deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' file_magic_cmd='${OBJDUMP} -f' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case "$version_type" in freebsd-elf*) deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so*` library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) deplibs_check_method=unknown library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac finish_cmds='PATH="\$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH case "$host_os" in freebsd2* | freebsd3.[01]*) shlibpath_overrides_runpath=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so.$major' library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' case "$host_os" in irix5*) libsuff= shlibsuff= # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case "$LD" in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /lib${libsuff}/libc.so*` deplibs_check_method='pass_all' ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` if test -f /lib/ld.so.1; then dynamic_linker='GNU ld.so' else # Only the GNU ld.so supports shared libraries on MkLinux. case "$host_cpu" in powerpc*) dynamic_linker=no ;; *) dynamic_linker='Linux ld.so' ;; esac fi ;; netbsd*) version_type=sunos if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH ;; openbsd*) version_type=sunos if test "$with_gnu_ld" = yes; then need_lib_prefix=no need_version=no fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method='file_magic COFF format alpha shared library' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so deplibs_check_method='pass_all' sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" file_magic_cmd=/usr/bin/file file_magic_test_file=/lib/libc.so ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case "$host_vendor" in ncr) deplibs_check_method='pass_all' ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so*` ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac echo "$ac_t$dynamic_linker" 1>&6 test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 # Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in # configure.in, otherwise build static only libraries. case "$host_os" in cygwin* | mingw* | os2*) if test x$can_build_shared = xyes; then test x$enable_win32_dll = xno && can_build_shared=no echo "checking if package supports dlls... $can_build_shared" 1>&6 fi ;; esac if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then case "$deplibs_check_method" in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) test "$enable_shared" = yes && enable_static=no ;; esac echo "$ac_t$enable_shared" 1>&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "checking whether to build static libraries... $enable_static" 1>&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi echo $ac_n "checking for objdir... $ac_c" 1>&6 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null echo "$ac_t$objdir" 1>&6 if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then lt_cv_dlopen=no lt_cv_dlopen_libs= echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo "$progname:2170: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 echo "$progname:2207: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else dlopen(); #endif ; return 0; } EOF if { (eval echo $progname:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_dlopen=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 echo "$progname:2251: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 echo "$progname:2288: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else shl_load(); #endif ; return 0; } EOF if { (eval echo $progname:2315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_shl_load=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 echo "$progname:2333: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 fi fi fi fi fi fi if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes fi case "$lt_cv_dlopen" in dlopen) for ac_hdr in dlfcn.h; do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "$progname:2395: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; EOF ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo $progname:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi done if test "x$ac_cv_header_dlfcn_h" = xyes; then CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" fi eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2433: checking whether a program can dlopen itself" >&5 if test "${lt_cv_dlopen_self+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "$lt_cv_dlopen_self" = yes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2506: checking whether a statically linked program can dlopen itself" >&5 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self_static=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self_static=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self_static=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 fi ;; esac case "$lt_cv_dlopen_self" in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case "$lt_cv_dlopen_self_static" in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Copy echo and quote the copy, instead of the original, because it is # used later. ltecho="$echo" if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then ltecho="$CONFIG_SHELL \$0 --fallback-echo" fi LTSHELL="$SHELL" LTCONFIG_VERSION="$VERSION" # Only quote variables if we're using ltmain.sh. case "$ltmain" in *.sh) # Now quote all the things that may contain metacharacters. for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case "$var" in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case "$ltecho" in *'\$0 --fallback-echo"') ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac trap "$rm \"$ofile\"; exit 1" 1 2 15 echo "creating $ofile" $rm "$ofile" cat < "$ofile" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Gordon Matzigkeit , 1996 # # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi ### BEGIN LIBTOOL CONFIG EOF cfgfile="$ofile" ;; *) # Double-quote the variables that need it (for aesthetics). for var in old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do eval "$var=\\\"\$var\\\"" done # Just create a config file. cfgfile="$ofile.cfg" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 echo "creating $cfgfile" $rm "$cfgfile" cat < "$cfgfile" # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) EOF ;; esac cat <> "$cfgfile" # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ # LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ # NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ # DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ # $0$ltconfig_args # # Compiler and other test output produced by $progname, useful for # debugging $progname, is in ./config.log if it exists. # The version of $progname that generated this script. LTCONFIG_VERSION=$LTCONFIG_VERSION # Shell to use when invoking shell scripts. SHELL=$LTSHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$ltecho # The archiver. AR=$AR # The default C compiler. CC=$CC # The linker used to build libraries. LD=$LD # Whether we need hard or soft links. LN_S=$LN_S # A BSD-compatible nm program. NM=$NM # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$reload_flag reload_cmds=$reload_cmds # How to pass a linker flag through the compiler. wl=$wl # Object file suffix (normally "o"). objext="$objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$pic_flag # Does compiler simultaneously support -c and -o options? compiler_c_o=$compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$compiler_o_lo # Must we lock files when doing compilation ? need_locks=$need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$library_names_spec # The coded name of the library, if different from the real name. soname_spec=$soname_spec # Commands used to build and install an old-style archive. RANLIB=$RANLIB old_archive_cmds=$old_archive_cmds old_postinstall_cmds=$old_postinstall_cmds old_postuninstall_cmds=$old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$old_archive_from_new_cmds # Commands used to build and install a shared archive. archive_cmds=$archive_cmds archive_expsym_cmds=$archive_expsym_cmds postinstall_cmds=$postinstall_cmds postuninstall_cmds=$postuninstall_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$global_symbol_to_cdecl # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Compile-time system search path for libraries sys_lib_search_path_spec=$sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$exclude_expsyms # Symbols that must always be exported. include_expsyms=$include_expsyms EOF case "$ltmain" in *.sh) echo '### END LIBTOOL CONFIG' >> "$ofile" echo >> "$ofile" case "$host_os" in aix3*) cat <<\EOF >> "$ofile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "${COLLECT_NAMES+set}" != set; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # Append the ltmain.sh script. sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) chmod +x "$ofile" ;; *) # Compile the libtool program. echo "FIXME: would compile $ltmain" ;; esac test -n "$cache_file" || exit 0 # AC_CACHE_SAVE trap '' 1 2 15 cat > confcache <<\EOF # 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. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # 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. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: streamripper-1.64.6.orig/missing0000644000175000017500000002466610041125257014743 0ustar abiabi#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2003-09-02.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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, 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: streamripper-1.64.6.orig/m4/0000755000175000017500000000000011164273725013664 5ustar abiabistreamripper-1.64.6.orig/m4/iconv.m40000644000175000017500000000665310121436027015242 0ustar abiabi# iconv.m4 serial AM4 (gettext-0.11.3) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) streamripper-1.64.6.orig/m4/type_socklen_t.m40000644000175000017500000000440010754167267017155 0ustar abiabi##### http://autoconf-archive.cryp.to/type_socklen_t.html # # SYNOPSIS # # TYPE_SOCKLEN_T # # DESCRIPTION # # Check whether sys/socket.h defines type socklen_t. Please note that # some systems require sys/types.h to be included before sys/socket.h # can be compiled. # # LAST MODIFICATION # # 2005-01-11 # # COPYLEFT # # Copyright (c) 2005 Lars Brinkhoff # # 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, the respective Autoconf Macro's copyright # owner gives unlimited permission to copy, distribute and modify the # configure scripts that are the output of Autoconf when processing # the Macro. You need not follow the terms of the GNU General Public # License when using or distributing such scripts, even though # portions of the text of the Macro appear in them. The GNU General # Public License (GPL) does govern all other use of the material that # constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the # Autoconf Macro released by the Autoconf Macro Archive. When you # make and distribute a modified version of the Autoconf Macro, you # may extend this special exception to the GPL to apply to your # modified version as well. AC_DEFUN([TYPE_SOCKLEN_T], [AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, [ AC_TRY_COMPILE( [#include #include ], [socklen_t len = 42; return 0;], ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no) ]) if test $ac_cv_type_socklen_t != yes; then AC_DEFINE(socklen_t, int, [Substitute for socklen_t]) fi ]) streamripper-1.64.6.orig/m4/lib-ld.m40000644000175000017500000000626010121436027015261 0ustar abiabi# lib-ld.m4 serial 1 (gettext-0.11) dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl Subroutines of libtool.m4, dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then acl_cv_prog_gnu_ld=yes else acl_cv_prog_gnu_ld=no fi]) with_gnu_ld=$acl_cv_prog_gnu_ld ]) dnl From libtool-1.4. Sets the variable LD. AC_DEFUN([AC_LIB_PROG_LD], [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(acl_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) streamripper-1.64.6.orig/m4/codeset.m40000644000175000017500000000157610121436027015551 0ustar abiabi# codeset.m4 serial AM1 (gettext-0.10.40) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET);], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ]) streamripper-1.64.6.orig/m4/ogg.m40000644000175000017500000000663610745040701014703 0ustar abiabi# Configure paths for libogg # Jack Moffitt 10-21-2000 # Shamelessly stolen from Owen Taylor and Manish Singh dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS dnl AC_DEFUN([XIPH_PATH_OGG], [dnl dnl Get the cflags and libraries dnl AC_ARG_WITH(ogg,[ --with-ogg=PFX Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="") AC_ARG_WITH(ogg-libraries,[ --with-ogg-libraries=DIR Directory where libogg library is installed (optional)], ogg_libraries="$withval", ogg_libraries="") AC_ARG_WITH(ogg-includes,[ --with-ogg-includes=DIR Directory where libogg header files are installed (optional)], ogg_includes="$withval", ogg_includes="") AC_ARG_ENABLE(oggtest, [ --disable-oggtest Do not try to compile and run a test Ogg program],, enable_oggtest=yes) if test "x$ogg_libraries" != "x" ; then OGG_LIBS="-L$ogg_libraries" elif test "x$ogg_prefix" != "x" ; then OGG_LIBS="-L$ogg_prefix/lib" elif test "x$prefix" != "xNONE" ; then OGG_LIBS="-L$prefix/lib" fi OGG_LIBS="$OGG_LIBS -logg" if test "x$ogg_includes" != "x" ; then OGG_CFLAGS="-I$ogg_includes" elif test "x$ogg_prefix" != "x" ; then OGG_CFLAGS="-I$ogg_prefix/include" elif test "x$prefix" != "xNONE"; then OGG_CFLAGS="-I$prefix/include" fi AC_MSG_CHECKING(for Ogg) no_ogg="" if test "x$enable_oggtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $OGG_CFLAGS" LIBS="$LIBS $OGG_LIBS" dnl dnl Now check if the installed Ogg is sufficiently new. dnl rm -f conf.oggtest AC_TRY_RUN([ #include #include #include #include int main () { system("touch conf.oggtest"); return 0; } ],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi if test "x$no_ogg" = "x" ; then AC_MSG_RESULT(yes) ifelse([$1], , :, [$1]) else AC_MSG_RESULT(no) if test -f conf.oggtest ; then : else echo "*** Could not run Ogg test program, checking why..." CFLAGS="$CFLAGS $OGG_CFLAGS" LIBS="$LIBS $OGG_LIBS" AC_TRY_LINK([ #include #include ], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding Ogg or finding the wrong" echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means Ogg was incorrectly installed" echo "*** or that you have moved Ogg since it was installed." ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi OGG_CFLAGS="" OGG_LIBS="" ifelse([$2], , :, [$2]) fi AC_SUBST(OGG_CFLAGS) AC_SUBST(OGG_LIBS) rm -f conf.oggtest ]) streamripper-1.64.6.orig/m4/glib-2.0.m40000644000175000017500000001764210714753311015344 0ustar abiabi# Configure paths for GLIB # Owen Taylor 1997-2001 dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or dnl gthread is specified in MODULES, pass to pkg-config dnl AC_DEFUN([AM_PATH_GLIB_2_0], [dnl dnl Get the cflags and libraries from pkg-config dnl AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], , enable_glibtest=yes) pkg_config_args=glib-2.0 for module in . $4 do case "$module" in gmodule) pkg_config_args="$pkg_config_args gmodule-2.0" ;; gmodule-no-export) pkg_config_args="$pkg_config_args gmodule-no-export-2.0" ;; gobject) pkg_config_args="$pkg_config_args gobject-2.0" ;; gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done PKG_PROG_PKG_CONFIG([0.7]) no_glib="" if test "x$PKG_CONFIG" = x ; then no_glib=yes PKG_CONFIG=no fi min_glib_version=ifelse([$1], ,2.0.0,$1) AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" enable_glibtest=no fi if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then : else no_glib=yes fi fi if test x"$no_glib" = x ; then GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" dnl dnl Now check if the installed GLIB is sufficiently new. (Also sanity dnl checks the results of pkg-config to some extent) dnl rm -f conf.glibtest AC_TRY_RUN([ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.glibtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_glib_version"); exit(1); } if ((glib_major_version != $glib_config_major_version) || (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || (glib_micro_version != GLIB_MICRO_VERSION)) { printf("*** GLIB header files (version %d.%d.%d) do not match\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", glib_major_version, glib_minor_version, glib_micro_version); } else { if ((glib_major_version > major) || ((glib_major_version == major) && (glib_minor_version > minor)) || ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", glib_major_version, glib_minor_version, glib_micro_version); printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" AC_TRY_LINK([ #include #include ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" GLIB_GENMARSHAL="" GOBJECT_QUERY="" GLIB_MKENUMS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_GENMARSHAL) AC_SUBST(GOBJECT_QUERY) AC_SUBST(GLIB_MKENUMS) rm -f conf.glibtest ]) streamripper-1.64.6.orig/m4/pkg.m40000644000175000017500000001214510745041215014701 0ustar abiabi# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$PKG_CONFIG"; then if test -n "$$1"; then pkg_cv_[]$1="$$1" else PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) fi else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` else $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES streamripper-1.64.6.orig/m4/lib-link.m40000644000175000017500000005563310121436027015627 0ustar abiabi# lib-link.m4 serial 3 (gettext-0.11.3) dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes undefine([Name]) undefine([NAME]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. If found, it dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" LIBS="$LIBS $LIB[]NAME" AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) undefine([Name]) undefine([NAME]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, dnl hardcode_direct, hardcode_minus_L, dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec. AC_DEFUN([AC_LIB_RPATH], [ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH([lib$1-prefix], [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib$1-prefix don't search for lib$1 in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) streamripper-1.64.6.orig/m4/vorbis.m40000644000175000017500000001040410745040663015426 0ustar abiabi# Configure paths for libvorbis # Jack Moffitt 10-21-2000 # Shamelessly stolen from Owen Taylor and Manish Singh # thomasvs added check for vorbis_bitrate_addblock which is new in rc3 dnl XIPH_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS dnl AC_DEFUN([XIPH_PATH_VORBIS], [dnl dnl Get the cflags and libraries dnl AC_ARG_WITH(vorbis,[ --with-vorbis=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="") AC_ARG_WITH(vorbis-libraries,[ --with-vorbis-libraries=DIR Directory where libvorbis library is installed (optional)], vorbis_libraries="$withval", vorbis_libraries="") AC_ARG_WITH(vorbis-includes,[ --with-vorbis-includes=DIR Directory where libvorbis header files are installed (optional)], vorbis_includes="$withval", vorbis_includes="") AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes) if test "x$vorbis_libraries" != "x" ; then VORBIS_LIBS="-L$vorbis_libraries" elif test "x$vorbis_prefix" != "x" ; then VORBIS_LIBS="-L$vorbis_prefix/lib" elif test "x$prefix" != "xNONE"; then VORBIS_LIBS="-L$prefix/lib" fi VORBIS_LIBS="$VORBIS_LIBS -lvorbis -lm" VORBISFILE_LIBS="-lvorbisfile" VORBISENC_LIBS="-lvorbisenc" if test "x$vorbis_includes" != "x" ; then VORBIS_CFLAGS="-I$vorbis_includes" elif test "x$vorbis_prefix" != "x" ; then VORBIS_CFLAGS="-I$vorbis_prefix/include" elif test "x$prefix" != "xNONE"; then VORBIS_CFLAGS="-I$prefix/include" fi AC_MSG_CHECKING(for Vorbis) no_vorbis="" if test "x$enable_vorbistest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $VORBIS_CFLAGS $OGG_CFLAGS" LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS" dnl dnl Now check if the installed Vorbis is sufficiently new. dnl rm -f conf.vorbistest AC_TRY_RUN([ #include #include #include #include #include int main () { vorbis_block vb; vorbis_dsp_state vd; vorbis_info vi; vorbis_info_init (&vi); vorbis_encode_init (&vi, 2, 44100, -1, 128000, -1); vorbis_analysis_init (&vd, &vi); vorbis_block_init (&vd, &vb); /* this function was added in 1.0rc3, so this is what we're testing for */ vorbis_bitrate_addblock (&vb); system("touch conf.vorbistest"); return 0; } ],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi if test "x$no_vorbis" = "x" ; then AC_MSG_RESULT(yes) ifelse([$1], , :, [$1]) else AC_MSG_RESULT(no) if test -f conf.vorbistest ; then : else echo "*** Could not run Vorbis test program, checking why..." CFLAGS="$CFLAGS $VORBIS_CFLAGS" LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS" AC_TRY_LINK([ #include #include ], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding Vorbis or finding the wrong" echo "*** version of Vorbis. If it is not finding Vorbis, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means Vorbis was incorrectly installed" echo "*** or that you have moved Vorbis since it was installed." ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi VORBIS_CFLAGS="" VORBIS_LIBS="" VORBISFILE_LIBS="" VORBISENC_LIBS="" ifelse([$2], , :, [$2]) fi AC_SUBST(VORBIS_CFLAGS) AC_SUBST(VORBIS_LIBS) AC_SUBST(VORBISFILE_LIBS) AC_SUBST(VORBISENC_LIBS) rm -f conf.vorbistest ]) streamripper-1.64.6.orig/m4/lib-prefix.m40000644000175000017500000001175510121436027016164 0ustar abiabi# lib-prefix.m4 serial 1 (gettext-0.11) dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/lib"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) streamripper-1.64.6.orig/m4/cf_curses.m40000644000175000017500000044713511130037273016105 0ustar abiabidnl --------------------------------------------------------------------------- dnl This code is ripped off from lynx. Thanks Thomas! --Greg dnl --------------------------------------------------------------------------- dnl Copyright 1997-2007,2008 by Thomas E. Dickey dnl dnl Permission to use, copy, modify, and distribute this software and its dnl documentation for any purpose and without fee is hereby granted, dnl provided that the above copyright notice appear in all copies and that dnl both that copyright notice and this permission notice appear in dnl supporting documentation, and that the name of the above listed dnl copyright holder(s) not be used in advertising or publicity pertaining dnl to distribution of the software without specific, written prior dnl permission. dnl dnl THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD dnl TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY dnl AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE dnl LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- dnl CF_ADD_CFLAGS version: 7 updated: 2004/04/25 17:48:30 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl The second parameter if given makes this macro verbose. dnl dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily dnl confused by the quotes (which require backslashes to keep them usable). AC_DEFUN([CF_ADD_CFLAGS], [ cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $1 do case $cf_fix_cppflags in no) case $cf_add_cflags in #(vi -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi case $cf_add_cflags in -D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in *$cf_add_cflags) #(vi ;; *) #(vi cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; *) cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac ;; yes) cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi if test -n "$cf_new_extra_cppflags" ; then ifelse($2,,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_INCDIR version: 9 updated: 2008/02/09 13:15:34 dnl ------------- dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's dnl redundant. We don't normally need to add -I/usr/local/include for gcc, dnl but old versions (and some misinstalled ones) need that. To make things dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to dnl the include-path). AC_DEFUN([CF_ADD_INCDIR], [ if test -n "$1" ; then for cf_add_incdir in $1 do while test $cf_add_incdir != /usr/include do if test -d $cf_add_incdir then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" AC_TRY_COMPILE([#include ], [printf("Hello")], [], [cf_have_incdir=yes]) CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then CF_VERBOSE(adding $cf_add_incdir to include-path) ifelse($2,,CPPFLAGS,$2)="-I$cf_add_incdir $ifelse($2,,CPPFLAGS,[$]$2)" cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi fi done done fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_LIBDIR version: 6 updated: 2008/02/09 13:15:34 dnl ------------- dnl Adds to the library-path dnl dnl Some machines have trouble with multiple -L options. dnl dnl $1 is the (list of) directory(s) to add dnl $2 is the optional name of the variable to update (default LDFLAGS) dnl AC_DEFUN([CF_ADD_LIBDIR], [ if test -n "$1" ; then for cf_add_libdir in $1 do if test $cf_add_libdir = /usr/lib ; then : elif test -d $cf_add_libdir then cf_have_libdir=no if test -n "$LDFLAGS$LIBS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_libdir in $LDFLAGS $LIBS ; do if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then cf_have_libdir=yes; break fi done fi if test "$cf_have_libdir" = no ; then CF_VERBOSE(adding $cf_add_libdir to library-path) ifelse($2,,LDFLAGS,$2)="-L$cf_add_libdir $ifelse($2,,LDFLAGS,[$]$2)" fi fi done fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_OPTIONAL_PATH version: 1 updated: 2007/07/29 12:33:33 dnl -------------------- dnl Add an optional search-path to the compile/link variables. dnl See CF_WITH_PATH dnl dnl $1 = shell variable containing the result of --with-XXX=[DIR] dnl $2 = module to look for. AC_DEFUN([CF_ADD_OPTIONAL_PATH],[ case "$1" in #(vi no) #(vi ;; yes) #(vi ;; *) CF_ADD_SEARCHPATH([$1], [AC_MSG_ERROR(cannot find $2 under $1)]) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_SEARCHPATH version: 4 updated: 2007/07/29 13:35:20 dnl ----------------- dnl Set $CPPFLAGS and $LDFLAGS with the directories given via the parameter. dnl They can be either the common root of include- and lib-directories, or the dnl lib-directory (to allow for things like lib64 directories). dnl See also CF_FIND_LINKAGE. dnl dnl $1 is the list of colon-separated directory names to search. dnl $2 is the action to take if a parameter does not yield a directory. AC_DEFUN([CF_ADD_SEARCHPATH], [ for cf_searchpath in `echo "$1" | tr : ' '`; do if test -d $cf_searchpath/include; then CF_ADD_INCDIR($cf_searchpath/include) elif test -d $cf_searchpath/../include ; then CF_ADD_INCDIR($cf_searchpath/../include) ifelse([$2],,,[else $2]) fi if test -d $cf_searchpath/lib; then CF_ADD_LIBDIR($cf_searchpath/lib) elif test -d $cf_searchpath ; then CF_ADD_LIBDIR($cf_searchpath) ifelse([$2],,,[else $2]) fi done ]) dnl --------------------------------------------------------------------------- dnl CF_ADD_SUBDIR_PATH version: 2 updated: 2007/07/29 10:12:59 dnl ------------------ dnl Append to a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result dnl $2 = the package name dnl $3 = the subdirectory, e.g., bin, include or lib dnl $4 = the directory under which we will test for subdirectories dnl $5 = a directory that we do not want $4 to match AC_DEFUN([CF_ADD_SUBDIR_PATH], [ test "$4" != "$5" && \ test -d "$4" && \ ifelse([$5],NONE,,[(test $5 = NONE || test -d $5) &&]) { test -n "$verbose" && echo " ... testing for $3-directories under $4" test -d $4/$3 && $1="[$]$1 $4/$3" test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" test -d $4/$3/$2/$3 && $1="[$]$1 $4/$3/$2/$3" test -d $4/$2/$3 && $1="[$]$1 $4/$2/$3" test -d $4/$2/$3/$2 && $1="[$]$1 $4/$2/$3/$2" } ])dnl dnl --------------------------------------------------------------------------- dnl CF_ALT_CHAR_SET version: 6 updated: 1998/11/18 14:45:34 dnl --------------- dnl Check for existence of alternate-character-set support in curses, so we dnl can decide to use it for box characters. dnl AC_DEFUN([CF_ALT_CHAR_SET], [ AC_MSG_CHECKING([if curses supports alternate-character set]) AC_CACHE_VAL(cf_cv_alt_char_set,[ for mapname in acs_map _acs_map do AC_TRY_LINK([ #include <${cf_cv_ncurses_header-curses.h}> ],[chtype x = $mapname['l']; $mapname['m'] = 0], [cf_cv_alt_char_set=$mapname break], [cf_cv_alt_char_set=no]) done ]) AC_MSG_RESULT($cf_cv_alt_char_set) test $cf_cv_alt_char_set != no && AC_DEFINE_UNQUOTED(ALT_CHAR_SET,$cf_cv_alt_char_set) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34 dnl ---------------- dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES' dnl in the sharutils 4.2 distribution. AC_DEFUN([CF_ANSI_CC_CHECK], [ AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[ cf_cv_ansi_cc=no cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX -Aa -D_HPUX_SOURCE # SVR4 -Xc # UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) for cf_arg in "-DCC_HAS_PROTOS" \ "" \ -qlanglvl=ansi \ -std1 \ -Ae \ "-Aa -D_HPUX_SOURCE" \ -Xc do CF_ADD_CFLAGS($cf_arg) AC_TRY_COMPILE( [ #ifndef CC_HAS_PROTOS #if !defined(__STDC__) || (__STDC__ != 1) choke me #endif #endif ],[ int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);};], [cf_cv_ansi_cc="$cf_arg"; break]) done CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" ]) if test "$cf_cv_ansi_cc" != "no"; then if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then CF_ADD_CFLAGS($cf_cv_ansi_cc) else AC_DEFINE(CC_HAS_PROTOS) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54 dnl --------------- dnl For programs that must use an ANSI compiler, obtain compiler options that dnl will make it recognize prototypes. We'll do preprocessor checks in other dnl macros, since tools such as unproto can fake prototypes, but only part of dnl the preprocessor. AC_DEFUN([CF_ANSI_CC_REQD], [AC_REQUIRE([CF_ANSI_CC_CHECK]) if test "$cf_cv_ansi_cc" = "no"; then AC_MSG_ERROR( [Your compiler does not appear to recognize prototypes. You have the following choices: a. adjust your compiler options b. get an up-to-date compiler c. use a wrapper such as unproto]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 dnl -------------- dnl Allow user to disable a normally-on option. AC_DEFUN([CF_ARG_DISABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31 dnl ------------- dnl Allow user to enable a normally-off option. AC_DEFUN([CF_ARG_ENABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_OPTION version: 3 updated: 1997/10/18 14:42:41 dnl ------------- dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus dnl values. dnl dnl Parameters: dnl $1 = option name dnl $2 = help-string dnl $3 = action to perform if option is not default dnl $4 = action if perform if option is default dnl $5 = default option value (either 'yes' or 'no') AC_DEFUN([CF_ARG_OPTION], [AC_ARG_ENABLE($1,[$2],[test "$enableval" != ifelse($5,no,yes,no) && enableval=ifelse($5,no,no,yes) if test "$enableval" != "$5" ; then ifelse($3,,[ :]dnl ,[ $3]) ifelse($4,,,[ else $4]) fi],[enableval=$5 ifelse($4,,,[ $4 ])dnl ])])dnl dnl --------------------------------------------------------------------------- dnl CF_BOOL_DEFS version: 3 updated: 1998/04/27 20:32:33 dnl ------------ dnl Check if curses.h defines TRUE/FALSE (it does under SVr4). AC_DEFUN([CF_BOOL_DEFS], [ AC_MSG_CHECKING(if TRUE/FALSE are defined) AC_CACHE_VAL(cf_cv_bool_defs,[ AC_TRY_COMPILE([ #include <${cf_cv_ncurses_header-curses.h}> #include ],[int x = TRUE, y = FALSE], [cf_cv_bool_defs=yes], [cf_cv_bool_defs=no])]) AC_MSG_RESULT($cf_cv_bool_defs) if test "$cf_cv_bool_defs" = no ; then AC_DEFINE(TRUE,(1)) AC_DEFINE(FALSE,(0)) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_BUILD_CC version: 6 updated: 2006/10/14 15:23:15 dnl ----------- dnl If we're cross-compiling, allow the user to override the tools and their dnl options. The configure script is oriented toward identifying the host dnl compiler, etc., but we need a build compiler to generate parts of the dnl source. dnl dnl $1 = default for $CPPFLAGS dnl $2 = default for $LIBS AC_DEFUN([CF_BUILD_CC],[ AC_REQUIRE([CF_PROG_EXT]) if test "$cross_compiling" = yes ; then # defaults that we might want to override : ${BUILD_CFLAGS:=''} : ${BUILD_CPPFLAGS:='ifelse([$1],,,[$1])'} : ${BUILD_LDFLAGS:=''} : ${BUILD_LIBS:='ifelse([$2],,,[$2])'} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'} AC_ARG_WITH(build-cc, [ --with-build-cc=XXX the build C compiler ($BUILD_CC)], [BUILD_CC="$withval"], [AC_CHECK_PROGS(BUILD_CC, gcc cc cl)]) AC_MSG_CHECKING(for native build C compiler) AC_MSG_RESULT($BUILD_CC) AC_MSG_CHECKING(for native build C preprocessor) AC_ARG_WITH(build-cpp, [ --with-build-cpp=XXX the build C preprocessor ($BUILD_CPP)], [BUILD_CPP="$withval"], [BUILD_CPP='${BUILD_CC} -E']) AC_MSG_RESULT($BUILD_CPP) AC_MSG_CHECKING(for native build C flags) AC_ARG_WITH(build-cflags, [ --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)], [BUILD_CFLAGS="$withval"]) AC_MSG_RESULT($BUILD_CFLAGS) AC_MSG_CHECKING(for native build C preprocessor-flags) AC_ARG_WITH(build-cppflags, [ --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)], [BUILD_CPPFLAGS="$withval"]) AC_MSG_RESULT($BUILD_CPPFLAGS) AC_MSG_CHECKING(for native build linker-flags) AC_ARG_WITH(build-ldflags, [ --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)], [BUILD_LDFLAGS="$withval"]) AC_MSG_RESULT($BUILD_LDFLAGS) AC_MSG_CHECKING(for native build linker-libraries) AC_ARG_WITH(build-libs, [ --with-build-libs=XXX the build libraries (${BUILD_LIBS})], [BUILD_LIBS="$withval"]) AC_MSG_RESULT($BUILD_LIBS) # this assumes we're on Unix. BUILD_EXEEXT= BUILD_OBJEXT=o : ${BUILD_CC:='${CC}'} if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then AC_MSG_ERROR([Cross-build requires two compilers. Use --with-build-cc to specify the native compiler.]) fi else : ${BUILD_CC:='${CC}'} : ${BUILD_CPP:='${CPP}'} : ${BUILD_CFLAGS:='${CFLAGS}'} : ${BUILD_CPPFLAGS:='${CPPFLAGS}'} : ${BUILD_LDFLAGS:='${LDFLAGS}'} : ${BUILD_LIBS:='${LIBS}'} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'} fi AC_SUBST(BUILD_CC) AC_SUBST(BUILD_CPP) AC_SUBST(BUILD_CFLAGS) AC_SUBST(BUILD_CPPFLAGS) AC_SUBST(BUILD_LDFLAGS) AC_SUBST(BUILD_LIBS) AC_SUBST(BUILD_EXEEXT) AC_SUBST(BUILD_OBJEXT) ])dnl dnl --------------------------------------------------------------------------- dnl CF_BUNDLED_INTL version: 12 updated: 2005/06/21 18:24:28 dnl --------------- dnl Top-level macro for configuring an application with a bundled copy of dnl the intl and po directories for gettext. dnl dnl $1 specifies either Makefile or makefile, defaulting to the former. dnl $2 if nonempty sets the option to --enable-nls rather than to --disable-nls dnl dnl Sets variables which can be used to substitute in makefiles: dnl INTLDIR_MAKE - to make ./intl directory dnl MSG_DIR_MAKE - to make ./po directory dnl SUB_MAKEFILE - list of makefiles in ./intl, ./po directories dnl Defines dnl HAVE_LIBGETTEXT_H if we're using ./intl dnl dnl Environment: dnl ALL_LINGUAS if set, lists the root names of the ".po" files. dnl CONFIG_H assumed to be "config.h" dnl VERSION may be set, otherwise extract from "VERSION" file. dnl AC_DEFUN([CF_BUNDLED_INTL],[ cf_makefile=ifelse($1,,Makefile,$1) dnl Set of available languages (based on source distribution). Note that dnl setting $LINGUAS overrides $ALL_LINGUAS. Some environments set $LINGUAS dnl rather than $LC_ALL test -z "$ALL_LINGUAS" && ALL_LINGUAS=`test -d $srcdir/po && cd $srcdir/po && echo *.po|sed -e 's/\.po//g' -e 's/*//'` # Allow override of "config.h" definition: : ${CONFIG_H=config.h} AC_SUBST(CONFIG_H) if test -z "$VERSION" ; then if test -f $srcdir/VERSION ; then VERSION=`sed -e '2,$d' $srcdir/VERSION|cut -f1` else VERSION=unknown fi fi AC_SUBST(VERSION) AM_GNU_GETTEXT(,,,[$2]) INTLDIR_MAKE= MSG_DIR_MAKE= SUB_MAKEFILE= dnl this updates SUB_MAKEFILE and MSG_DIR_MAKE: CF_OUR_MESSAGES($1) if test "$USE_INCLUDED_LIBINTL" = yes ; then if test "$nls_cv_force_use_gnu_gettext" = yes ; then : elif test "$nls_cv_use_gnu_gettext" = yes ; then : else INTLDIR_MAKE="#" fi if test -z "$INTLDIR_MAKE"; then AC_DEFINE(HAVE_LIBGETTEXT_H) for cf_makefile in \ $srcdir/intl/Makefile.in \ $srcdir/intl/makefile.in do if test -f "$cf_makefile" ; then SUB_MAKEFILE="$SUB_MAKEFILE `echo \"${cf_makefile}\"|sed -e 's,^'$srcdir/',,' -e 's/\.in$//'`:${cf_makefile}" break fi done fi else INTLDIR_MAKE="#" if test "$USE_NLS" = yes ; then AC_CHECK_HEADERS(libintl.h) fi fi if test -z "$INTLDIR_MAKE" ; then CPPFLAGS="-I../intl $CPPFLAGS" fi dnl FIXME: we use this in lynx (the alternative is a spurious dependency upon dnl GNU make) if test "$BUILD_INCLUDED_LIBINTL" = yes ; then GT_YES="#" GT_NO= else GT_YES= GT_NO="#" fi AC_SUBST(INTLDIR_MAKE) AC_SUBST(MSG_DIR_MAKE) AC_SUBST(GT_YES) AC_SUBST(GT_NO) dnl FIXME: the underlying AM_GNU_GETTEXT macro either needs some fixes or a dnl little documentation. It doesn't define anything so that we can ifdef our dnl own code, except ENABLE_NLS, which is too vague to be of any use. if test "$USE_INCLUDED_LIBINTL" = yes ; then if test "$nls_cv_force_use_gnu_gettext" = yes ; then AC_DEFINE(HAVE_GETTEXT) elif test "$nls_cv_use_gnu_gettext" = yes ; then AC_DEFINE(HAVE_GETTEXT) fi if test -n "$nls_cv_header_intl" ; then AC_DEFINE(HAVE_LIBINTL_H) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59 dnl -------------- dnl Check if we're accidentally using a cache from a different machine. dnl Derive the system name, as a check for reusing the autoconf cache. dnl dnl If we've packaged config.guess and config.sub, run that (since it does a dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM dnl which is useful in cross-compiles. dnl dnl Note: we would use $ac_config_sub, but that is one of the places where dnl autoconf 2.5x broke compatibility with autoconf 2.13 AC_DEFUN([CF_CHECK_CACHE], [ if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then ifelse([$1],,[AC_CANONICAL_HOST],[$1]) system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" if test -z "$system_name" ; then system_name="`(hostname) 2>/dev/null`" fi fi test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name") AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) test -z "$system_name" && system_name="$cf_cv_system_name" test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name) if test ".$system_name" != ".$cf_cv_system_name" ; then AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) AC_MSG_ERROR("Please remove config.cache and try again.") fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_CFLAGS version: 2 updated: 2001/12/30 19:09:58 dnl --------------- dnl Conditionally add to $CFLAGS and $CPPFLAGS values which are derived from dnl a build-configuration such as imake. These have the pitfall that they dnl often contain compiler-specific options which we cannot use, mixed with dnl preprocessor options that we usually can. AC_DEFUN([CF_CHECK_CFLAGS], [ CF_VERBOSE(checking additions to CFLAGS) cf_check_cflags="$CFLAGS" cf_check_cppflags="$CPPFLAGS" CF_ADD_CFLAGS($1,yes) if test "$cf_check_cflags" != "$CFLAGS" ; then AC_TRY_LINK([#include ],[printf("Hello world");],, [CF_VERBOSE(test-compile failed. Undoing change to \$CFLAGS) if test "$cf_check_cppflags" != "$CPPFLAGS" ; then CF_VERBOSE(but keeping change to \$CPPFLAGS) fi CFLAGS="$cf_check_flags"]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_ERRNO version: 9 updated: 2001/12/30 18:03:23 dnl -------------- dnl Check for data that is usually declared in or , e.g., dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it dnl ourselves. dnl dnl $1 = the name to check AC_DEFUN([CF_CHECK_ERRNO], [ AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ AC_TRY_COMPILE([ #ifdef HAVE_STDLIB_H #include #endif #include #include #include ], [long x = (long) $1], [cf_cv_dcl_$1=yes], [cf_cv_dcl_$1=no]) ]) if test "$cf_cv_dcl_$1" = no ; then CF_UPPER(cf_result,decl_$1) AC_DEFINE_UNQUOTED($cf_result) fi # It's possible (for near-UNIX clones) that the data doesn't exist CF_CHECK_EXTERN_DATA($1,int) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23 dnl -------------------- dnl Check for existence of external data in the current set of libraries. If dnl we can modify it, it's real enough. dnl $1 = the name to check dnl $2 = its type AC_DEFUN([CF_CHECK_EXTERN_DATA], [ AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[ AC_TRY_LINK([ #undef $1 extern $2 $1; ], [$1 = 2], [cf_cv_have_$1=yes], [cf_cv_have_$1=no]) ]) if test "$cf_cv_have_$1" = yes ; then CF_UPPER(cf_result,have_$1) AC_DEFINE_UNQUOTED($cf_result) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_FUNCDECL version: 6 updated: 1999/03/30 12:24:31 dnl ----------------- dnl Check if a function is declared by including a set of include files. dnl Invoke the corresponding actions according to whether it is found or not. dnl dnl Gcc (unlike other compilers) will only warn about the miscast assignment dnl in the first test, but most compilers will oblige with an error in the dnl second test. dnl dnl CF_CHECK_FUNCDECL(INCLUDES, FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) AC_DEFUN([CF_CHECK_FUNCDECL], [ AC_MSG_CHECKING([for $2 declaration]) AC_CACHE_VAL(ac_cv_func_decl_$2, [AC_TRY_COMPILE([$1], [#ifndef ${ac_func} extern int ${ac_func}(); #endif],[ AC_TRY_COMPILE([$1], [#ifndef ${ac_func} int (*p)() = ${ac_func}; #endif],[ eval "ac_cv_func_decl_$2=yes"],[ eval "ac_cv_func_decl_$2=no"])],[ eval "ac_cv_func_decl_$2=yes"])]) if eval "test \"`echo '$ac_cv_func_'decl_$2`\" = yes"; then AC_MSG_RESULT(yes) ifelse([$3], , :, [$3]) else AC_MSG_RESULT(no) ifelse([$4], , , [$4 ])dnl fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_FUNCDECLS version: 4 updated: 1999/03/30 12:24:31 dnl ------------------ dnl Check if functions are declared by including a set of include files. dnl and define DECL_XXX if not. dnl dnl CF_CHECK_FUNCDECLS(INCLUDES, FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) AC_DEFUN([CF_CHECK_FUNCDECLS], [for ac_func in $2 do CF_CHECK_FUNCDECL([$1], $ac_func, [$3], [ CF_UPPER(ac_tr_func,DECL_$ac_func) AC_DEFINE_UNQUOTED($ac_tr_func) $4])dnl done ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_IPV6 version: 3 updated: 2004/01/22 17:38:22 dnl ------------- dnl Check for IPV6 configuration. AC_DEFUN([CF_CHECK_IPV6],[ CF_FIND_IPV6_TYPE CF_FIND_IPV6_LIBS CF_FUNC_GETADDRINFO if test "$cf_cv_getaddrinfo" != "yes"; then if test "$cf_cv_ipv6type" != "linux"; then AC_MSG_WARN( [You must get working getaddrinfo() function, or you can specify "--disable-ipv6"]) else AC_MSG_WARN( [The getaddrinfo() implementation on your system seems be buggy. You should upgrade your system library to the newest version of GNU C library (aka glibc).]) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_SSL_X509 version: 3 updated: 2008/01/06 14:56:47 dnl ----------------- dnl Check for X509 support in the SSL library. AC_DEFUN([CF_CHECK_SSL_X509],[ AC_MSG_CHECKING(for X509 support) AC_TRY_LINK(CF__SSL_HEAD [ #include ], [X509_verify_cert_error_string(X509_STORE_CTX_get_error(NULL))], [cf_x509_support=yes], [cf_x509_support=no]) AC_MSG_RESULT($cf_x509_support) if test "$cf_x509_support" = yes ; then AC_DEFINE(USE_X509_SUPPORT) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_TYPE version: 2 updated: 2008/01/06 14:56:47 dnl ------------- dnl Add a 3rd parameter to AC_CHECK_TYPE, working around autoconf 2.5x's dnl deliberate incompatibility. dnl $1 = name of type to check for dnl $2 = default type dnl $3 = additional #include's and related preprocessor lines. ifdef([m4_HAS_AC_CT_FOURARGS], [m4_undefine([m4_HAS_AC_CT_FOURARGS])])dnl ifelse(m4_PACKAGE_VERSION, [fnord_acsalt], [], [ifdef([m4_version_compare],[m4_define([m4_HAS_AC_CT_FOURARGS])])])dnl AC_DEFUN([CF_CHECK_TYPE], [ ifdef([m4_HAS_AC_CT_FOURARGS],[ AC_CHECK_TYPE([$1],ac_cv_type_$1=yes,ac_cv_type_$1=no,[$3]) ],[ AC_MSG_CHECKING(for $1) AC_TRY_COMPILE([ #if STDC_HEADERS #include #include #endif $3 ],[ static $1 dummy; if (sizeof(dummy)) return 0; else return 1;], ac_cv_type_$1=yes, ac_cv_type_$1=no) AC_MSG_RESULT($ac_cv_type_$1) ])dnl if test $ac_cv_type_$1 = no; then AC_DEFINE($1, $2) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_COLOR_CURSES version: 6 updated: 2002/10/27 18:21:42 dnl --------------- dnl Check if curses supports color. (Note that while SVr3 curses supports dnl color, it does this differently from SVr4 curses; more work would be needed dnl to accommodate SVr3). dnl AC_DEFUN([CF_COLOR_CURSES], [ AC_MSG_CHECKING(if curses supports color attributes) AC_CACHE_VAL(cf_cv_color_curses,[ AC_TRY_LINK([ #include <${cf_cv_ncurses_header-curses.h}> ], [chtype x = COLOR_BLUE; has_colors(); start_color(); #ifndef NCURSES_BROKEN wbkgd(curscr, getbkgd(stdscr)); /* X/Open XPG4 aka SVr4 Curses */ #endif ], [cf_cv_color_curses=yes], [cf_cv_color_curses=no]) ]) AC_MSG_RESULT($cf_cv_color_curses) if test $cf_cv_color_curses = yes ; then AC_DEFINE(COLOR_CURSES) test ".$cf_cv_ncurses_broken" != .yes && AC_DEFINE(HAVE_GETBKGD) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURSES_CONFIG version: 2 updated: 2006/10/29 11:06:27 dnl ---------------- dnl Tie together the configure-script macros for curses. It may be ncurses, dnl but unless asked, we do not make a special search for ncurses. However, dnl still check for the ncurses version number, for use in other macros. AC_DEFUN([CF_CURSES_CONFIG], [ CF_CURSES_CPPFLAGS CF_NCURSES_VERSION CF_CURSES_LIBS ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURSES_CPPFLAGS version: 9 updated: 2006/02/04 19:44:43 dnl ------------------ dnl Look for the curses headers. AC_DEFUN([CF_CURSES_CPPFLAGS],[ AC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[ cf_cv_curses_incdir=no case $host_os in #(vi hpux10.*) #(vi test -d /usr/include/curses_colr && \ cf_cv_curses_incdir="-I/usr/include/curses_colr" ;; sunos3*|sunos4*) test -d /usr/5lib && \ test -d /usr/5include && \ cf_cv_curses_incdir="-I/usr/5include" ;; esac ]) test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS" CF_CURSES_HEADER CF_TERM_HEADER ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURSES_FUNCS version: 13 updated: 2007/04/28 09:15:55 dnl --------------- dnl Curses-functions are a little complicated, since a lot of them are macros. AC_DEFUN([CF_CURSES_FUNCS], [ AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl AC_REQUIRE([CF_XOPEN_CURSES]) AC_REQUIRE([CF_CURSES_TERM_H]) for cf_func in $1 do CF_UPPER(cf_tr_func,$cf_func) AC_MSG_CHECKING(for ${cf_func}) CF_MSG_LOG(${cf_func}) AC_CACHE_VAL(cf_cv_func_$cf_func,[ eval cf_result='$ac_cv_func_'$cf_func if test ".$cf_result" != ".no"; then AC_TRY_LINK([ #ifdef HAVE_XCURSES #include char * XCursesProgramName = "test"; #else #include <${cf_cv_ncurses_header-curses.h}> #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) #include #else #if defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) #include #else #ifdef HAVE_TERM_H #include #endif #endif #endif #endif], [ #ifndef ${cf_func} long foo = (long)(&${cf_func}); ${cf_cv_main_return-return}(foo == 0); #endif ], [cf_result=yes], [cf_result=no]) fi eval 'cf_cv_func_'$cf_func'=$cf_result' ]) # use the computed/retrieved cache-value: eval 'cf_result=$cf_cv_func_'$cf_func AC_MSG_RESULT($cf_result) if test $cf_result != no; then AC_DEFINE_UNQUOTED(HAVE_${cf_tr_func}) fi done ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURSES_HEADER version: 1 updated: 2005/12/31 13:28:25 dnl ---------------- dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common dnl variations of ncurses' installs. dnl dnl See also CF_NCURSES_HEADER, which sets the same cache variable. AC_DEFUN([CF_CURSES_HEADER],[ AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[ cf_cv_ncurses_header=none for cf_header in \ curses.h \ ncurses.h \ ncurses/curses.h \ ncurses/ncurses.h do AC_TRY_COMPILE([#include <${cf_header}>], [initscr(); tgoto("?", 0,0)], [cf_cv_ncurses_header=$cf_header; break],[]) done ]) if test "$cf_cv_ncurses_header" = none ; then AC_MSG_ERROR(No curses header-files found) fi # cheat, to get the right #define's for HAVE_NCURSES_H, etc. AC_CHECK_HEADERS($cf_cv_ncurses_header) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURSES_LIBS version: 27 updated: 2008/03/23 14:48:54 dnl -------------- dnl Look for the curses libraries. Older curses implementations may require dnl termcap/termlib to be linked as well. Call CF_CURSES_CPPFLAGS first. AC_DEFUN([CF_CURSES_LIBS],[ AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl AC_MSG_CHECKING(if we have identified curses libraries) AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], [initscr(); tgoto("?", 0,0)], cf_result=yes, cf_result=no) AC_MSG_RESULT($cf_result) if test "$cf_result" = no ; then case $host_os in #(vi freebsd*) #(vi AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"]) ;; hpux10.*) #(vi AC_CHECK_LIB(cur_colr,initscr,[ LIBS="-lcur_colr $LIBS" ac_cv_func_initscr=yes ],[ AC_CHECK_LIB(Hcurses,initscr,[ # HP's header uses __HP_CURSES, but user claims _HP_CURSES. LIBS="-lHcurses $LIBS" CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS" ac_cv_func_initscr=yes ])]) ;; linux*) # Suse Linux does not follow /usr/lib convention CF_ADD_LIBDIR(/lib) ;; sunos3*|sunos4*) if test -d /usr/5lib ; then CF_ADD_LIBDIR(/usr/5lib) LIBS="$LIBS -lcurses -ltermcap" fi ac_cv_func_initscr=yes ;; esac if test ".$ac_cv_func_initscr" != .yes ; then cf_save_LIBS="$LIBS" cf_term_lib="" cf_curs_lib="" if test ".${cf_cv_ncurses_version-no}" != .no then cf_check_list="ncurses curses cursesX" else cf_check_list="cursesX curses ncurses" fi # Check for library containing tgoto. Do this before curses library # because it may be needed to link the test-case for initscr. AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[ for cf_term_lib in $cf_check_list termcap termlib unknown do AC_CHECK_LIB($cf_term_lib,tgoto,[break]) done ]) # Check for library containing initscr test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" for cf_curs_lib in $cf_check_list xcurses jcurses unknown do AC_CHECK_LIB($cf_curs_lib,initscr,[break]) done test $cf_curs_lib = unknown && AC_MSG_ERROR(no curses library found) LIBS="-l$cf_curs_lib $cf_save_LIBS" if test "$cf_term_lib" = unknown ; then AC_MSG_CHECKING(if we can link with $cf_curs_lib library) AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], [initscr()], [cf_result=yes], [cf_result=no]) AC_MSG_RESULT($cf_result) test $cf_result = no && AC_MSG_ERROR(Cannot link curses library) elif test "$cf_curs_lib" = "$cf_term_lib" ; then : elif test "$cf_term_lib" != predefined ; then AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries) AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], [initscr(); tgoto((char *)0, 0, 0);], [cf_result=no], [ LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS" AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], [initscr()], [cf_result=yes], [cf_result=error]) ]) AC_MSG_RESULT($cf_result) fi fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURSES_TERM_H version: 6 updated: 2003/11/06 19:59:57 dnl ---------------- dnl SVr4 curses should have term.h as well (where it puts the definitions of dnl the low-level interface). This may not be true in old/broken implementations, dnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4 dnl running with Solaris 2.5.1). AC_DEFUN([CF_CURSES_TERM_H], [ AC_CACHE_CHECK(for term.h, cf_cv_term_header,[ AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl # If we found , look for , but always look # for if we do not find the variant. for cf_header in \ `echo ${cf_cv_ncurses_header-curses.h} | sed -e 's%/.*%/%'`term.h \ term.h do AC_TRY_COMPILE([ #include <${cf_cv_ncurses_header-curses.h}> #include <${cf_header}>], [WINDOW *x], [cf_cv_term_header=$cf_header break], [cf_cv_term_header=no]) done ]) case $cf_cv_term_header in #(vi term.h) #(vi AC_DEFINE(HAVE_TERM_H) ;; ncurses/term.h) AC_DEFINE(HAVE_NCURSES_TERM_H) ;; ncursesw/term.h) AC_DEFINE(HAVE_NCURSESW_TERM_H) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURS_PERFORMANCE version: 3 updated: 1998/04/27 20:32:33 dnl ------------------- dnl Solaris 2.x curses provides a "performance" tradeoff according to whether dnl CURS_PERFORMANCE is defined. If defined, the implementation defines macros dnl that access the WINDOW structure. Otherwise, function calls are used. AC_DEFUN([CF_CURS_PERFORMANCE], [ AC_MSG_CHECKING([for curses performance tradeoff]) AC_CACHE_VAL(cf_cv_curs_performance,[ cf_cv_curs_performance=no AC_TRY_COMPILE([ #include <${cf_cv_ncurses_header-curses.h}>],[ #if defined(wbkgdset) && defined(clearok) && defined(getbkgd) int x = ERR; #else int x = ; /* force an error */ #endif ],[ AC_TRY_COMPILE([ #define CURS_PERFORMANCE #include <${cf_cv_ncurses_header-curses.h}>],[ #if defined(wbkgdset) && defined(clearok) && defined(getbkgd) int x = ; /* force an error */ #else int x = ERR; #endif ],[cf_cv_curs_performance=yes])])]) AC_MSG_RESULT($cf_cv_curs_performance) test $cf_cv_curs_performance = yes && AC_DEFINE(CURS_PERFORMANCE) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURS_TOUCHLINE version: 2 updated: 2001/05/13 13:42:46 dnl ----------------- dnl Check for the flavor of the touchline function, to distinguish between BSD dnl and SYSV. This is needed on NetBSD 1.5 which has a partial implementation dnl of SVR4 curses. AC_DEFUN([CF_CURS_TOUCHLINE],[ AC_CACHE_CHECK(for curses touchline function,cf_cv_curs_touchline,[ AC_TRY_LINK([ #include <${cf_cv_ncurses_header-curses.h}>], [touchline(stdscr, 1,2,3);], [cf_cv_curs_touchline=bsd], [AC_TRY_LINK([ #include <${cf_cv_ncurses_header-curses.h}>], [touchline(stdscr, 1,2);], [cf_cv_curs_touchline=sysv], [cf_cv_curs_touchline=bsd])])]) case "$cf_cv_curs_touchline" in #(vi bsd) #(vi AC_DEFINE(HAVE_BSD_TOUCHLINE) ;; sysv) AC_DEFINE(HAVE_SYSV_TOUCHLINE) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_DEFINE_PROG version: 3 updated: 2002/10/27 18:21:42 dnl -------------- dnl Check for a program in the given list $3, defining the corresponding dnl program variable $2. dnl AC_DEFUN([CF_DEFINE_PROG],[ AC_MSG_CHECKING(for $1) AC_CACHE_VAL(cf_cv_$2,[ cf_cv_$2=unknown for cv_path in $3 do if test -f $cv_path ; then cf_cv_$2=$cv_path break fi done ]) AC_MSG_RESULT($cf_cv_$2) AC_DEFINE_UNQUOTED($2,"$cf_cv_$2") ])dnl dnl --------------------------------------------------------------------------- dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52 dnl ---------- dnl "dirname" is not portable, so we fake it with a shell script. AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl dnl --------------------------------------------------------------------------- dnl CF_DISABLE_ECHO version: 10 updated: 2003/04/17 22:27:11 dnl --------------- dnl You can always use "make -n" to see the actual options, but it's hard to dnl pick out/analyze warning messages when the compile-line is long. dnl dnl Sets: dnl ECHO_LT - symbol to control if libtool is verbose dnl ECHO_LD - symbol to prefix "cc -o" lines dnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o) dnl SHOW_CC - symbol to put before explicit "cc -c" lines dnl ECHO_CC - symbol to put before any "cc" line dnl AC_DEFUN([CF_DISABLE_ECHO],[ AC_MSG_CHECKING(if you want to see long compiling messages) CF_ARG_DISABLE(echo, [ --disable-echo display "compiling" commands], [ ECHO_LT='--silent' ECHO_LD='@echo linking [$]@;' RULE_CC=' @echo compiling [$]<' SHOW_CC=' @echo compiling [$]@' ECHO_CC='@' ],[ ECHO_LT='' ECHO_LD='' RULE_CC='# compiling' SHOW_CC='# compiling' ECHO_CC='' ]) AC_MSG_RESULT($enableval) AC_SUBST(ECHO_LT) AC_SUBST(ECHO_LD) AC_SUBST(RULE_CC) AC_SUBST(SHOW_CC) AC_SUBST(ECHO_CC) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39 dnl -------- dnl Check if 'errno' is declared in AC_DEFUN([CF_ERRNO], [ CF_CHECK_ERRNO(errno) ])dnl dnl --------------------------------------------------------------------------- dnl CF_FANCY_CURSES version: 4 updated: 2002/10/27 18:21:42 dnl --------------- AC_DEFUN([CF_FANCY_CURSES], [ AC_MSG_CHECKING(if curses supports fancy attributes) AC_CACHE_VAL(cf_cv_fancy_curses,[ AC_TRY_LINK([ #include <${cf_cv_ncurses_header-curses.h}> ], [attrset(A_UNDERLINE|A_BOLD|A_REVERSE); wattrset(stdscr, A_BLINK|A_DIM); attroff(A_BOLD); keypad(stdscr,TRUE); ], [cf_cv_fancy_curses=yes], [cf_cv_fancy_curses=no]) ]) AC_MSG_RESULT($cf_cv_fancy_curses) test $cf_cv_fancy_curses = yes && AC_DEFINE(FANCY_CURSES) ])dnl dnl --------------------------------------------------------------------------- dnl CF_FIND_IPV6_LIBS version: 7 updated: 2007/07/29 13:35:20 dnl ----------------- dnl Based on the IPV6 stack type, look for the corresponding library. AC_DEFUN([CF_FIND_IPV6_LIBS],[ AC_REQUIRE([CF_FIND_IPV6_TYPE]) cf_ipv6lib=none cf_ipv6dir=none AC_MSG_CHECKING(for IPv6 library if required) case $cf_cv_ipv6type in #(vi solaris) #(vi ;; inria) #(vi ;; kame) #(vi dnl http://www.kame.net/ cf_ipv6lib=inet6 cf_ipv6dir=v6 ;; linux-glibc) #(vi ;; linux-libinet6) #(vi dnl http://www.v6.linux.or.jp/ cf_ipv6lib=inet6 cf_ipv6dir=inet6 ;; toshiba) #(vi cf_ipv6lib=inet6 cf_ipv6dir=v6 ;; v6d) #(vi cf_ipv6lib=v6 cf_ipv6dir=v6 ;; zeta) cf_ipv6lib=inet6 cf_ipv6dir=v6 ;; esac AC_MSG_RESULT($cf_ipv6lib) if test "$cf_ipv6lib" != "none"; then AC_TRY_LINK([ #include #include #include #include ], [getaddrinfo(0, 0, 0, 0)],,[ CF_HEADER_PATH(cf_search,$cf_ipv6dir) for cf_incdir in $cf_search do cf_header=$cf_incdir/netinet/ip6.h if test -f $cf_header then CF_ADD_INCDIR($cf_incdir) test -n "$verbose" && echo " ... found $cf_header" 1>&AC_FD_MSG break fi test -n "$verbose" && echo " ... tested $cf_header" 1>&AC_FD_MSG done ]) CF_FIND_LIBRARY([$cf_ipv6lib],[$cf_ipv6dir],[ #include #include #include #include ], [getaddrinfo(0, 0, 0, 0)], [getaddrinfo], noexit) if test $cf_found_library = no ; then AC_MSG_ERROR( [No $cf_ipv6lib library found, cannot continue. You must fetch lib$cf_ipv6lib.a from an appropriate IPv6 kit and compile beforehand.]) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_FIND_IPV6_TYPE version: 5 updated: 2001/10/11 20:46:17 dnl ----------------- AC_DEFUN([CF_FIND_IPV6_TYPE],[ AC_CACHE_CHECK(ipv6 stack type, cf_cv_ipv6type, [ cf_cv_ipv6type=unknown for i in solaris inria kame linux-glibc linux-libinet6 toshiba v6d zeta do case $i in #(vi solaris) #(vi if test "SunOS" = "`uname -s`" then if test -f /usr/include/netinet/ip6.h then cf_cv_ipv6type=$i fi fi ;; inria) #(vi dnl http://www.kame.net/ AC_EGREP_CPP(yes, [ #include #ifdef IPV6_INRIA_VERSION yes #endif], [cf_cv_ipv6type=$i]) ;; kame) #(vi dnl http://www.kame.net/ AC_EGREP_CPP(yes, [ #include #ifdef __KAME__ yes #endif], [cf_cv_ipv6type=$i]) ;; linux-glibc) #(vi dnl http://www.v6.linux.or.jp/ AC_EGREP_CPP(yes, [ #include #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 yes #endif], [cf_cv_ipv6type=$i]) ;; linux-libinet6) #(vi dnl http://www.v6.linux.or.jp/ if test -d /usr/inet6 then cf_cv_ipv6type=$i elif test -f /usr/include/netinet/ip6.h then cf_cv_ipv6type=$i fi ;; toshiba) #(vi AC_EGREP_CPP(yes, [ #include #ifdef _TOSHIBA_INET6 yes #endif], [cf_cv_ipv6type=$i]) ;; v6d) #(vi AC_EGREP_CPP(yes, [ #include #ifdef __V6D__ yes #endif], [cf_cv_ipv6type=$i]) ;; zeta) AC_EGREP_CPP(yes, [ #include #ifdef _ZETA_MINAMI_INET6 yes #endif], [cf_cv_ipv6type=$i]) ;; esac if test "$cf_cv_ipv6type" != "unknown"; then break fi done ]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54 dnl --------------- dnl Look for a non-standard library, given parameters for AC_TRY_LINK. We dnl prefer a standard location, and use -L options only if we do not find the dnl library in the standard library location(s). dnl $1 = library name dnl $2 = library class, usually the same as library name dnl $3 = includes dnl $4 = code fragment to compile/link dnl $5 = corresponding function-name dnl $6 = flag, nonnull if failure should not cause an error-exit dnl dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had dnl to use a -L option. AC_DEFUN([CF_FIND_LIBRARY], [ eval 'cf_cv_have_lib_'$1'=no' cf_libdir="" AC_CHECK_FUNC($5, eval 'cf_cv_have_lib_'$1'=yes',[ cf_save_LIBS="$LIBS" AC_MSG_CHECKING(for $5 in -l$1) LIBS="-l$1 $LIBS" AC_TRY_LINK([$3],[$4], [AC_MSG_RESULT(yes) eval 'cf_cv_have_lib_'$1'=yes' ], [AC_MSG_RESULT(no) CF_LIBRARY_PATH(cf_search,$2) for cf_libdir in $cf_search do AC_MSG_CHECKING(for -l$1 in $cf_libdir) LIBS="-L$cf_libdir -l$1 $cf_save_LIBS" AC_TRY_LINK([$3],[$4], [AC_MSG_RESULT(yes) eval 'cf_cv_have_lib_'$1'=yes' break], [AC_MSG_RESULT(no) LIBS="$cf_save_LIBS"]) done ]) ]) eval 'cf_found_library=[$]cf_cv_have_lib_'$1 ifelse($6,,[ if test $cf_found_library = no ; then AC_MSG_ERROR(Cannot link $1 library) fi ]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_FIND_LINKAGE version: 12 updated: 2007/07/29 20:13:53 dnl --------------- dnl Find a library (specifically the linkage used in the code fragment), dnl searching for it if it is not already in the library path. dnl See also CF_ADD_SEARCHPATH. dnl dnl Parameters (4-on are optional): dnl $1 = headers for library entrypoint dnl $2 = code fragment for library entrypoint dnl $3 = the library name without the "-l" option or ".so" suffix. dnl $4 = action to perform if successful (default: update CPPFLAGS, etc) dnl $5 = action to perform if not successful dnl $6 = module name, if not the same as the library name dnl $7 = extra libraries dnl dnl Sets these variables: dnl $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found dnl $cf_cv_header_path_$3 - include-directory if needed dnl $cf_cv_library_path_$3 - library-directory if needed dnl $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3 AC_DEFUN([CF_FIND_LINKAGE],[ # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these # will be set on completion of the AC_TRY_LINK below. cf_cv_header_path_$3= cf_cv_library_path_$3= CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)]) AC_TRY_LINK([$1],[$2], cf_cv_find_linkage_$3=yes,[ cf_cv_find_linkage_$3=no CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)]) cf_save_CPPFLAGS="$CPPFLAGS" cf_test_CPPFLAGS="$CPPFLAGS" CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6])) for cf_cv_header_path_$3 in $cf_search do if test -d $cf_cv_header_path_$3 ; then CF_VERBOSE(... testing $cf_cv_header_path_$3) CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_$3" AC_TRY_COMPILE([$1],[$2],[ CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3) cf_cv_find_linkage_$3=maybe cf_test_CPPFLAGS="$CPPFLAGS" break],[ CPPFLAGS="$cf_save_CPPFLAGS" ]) fi done if test "$cf_cv_find_linkage_$3" = maybe ; then CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)]) cf_save_LIBS="$LIBS" cf_save_LDFLAGS="$LDFLAGS" ifelse([$6],,,[ CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-l$3 $7 $cf_save_LIBS" AC_TRY_LINK([$1],[$2],[ CF_VERBOSE(... found $3 library in system) cf_cv_find_linkage_$3=yes]) CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" ]) if test "$cf_cv_find_linkage_$3" != yes ; then CF_LIBRARY_PATH(cf_search,$3) for cf_cv_library_path_$3 in $cf_search do if test -d $cf_cv_library_path_$3 ; then CF_VERBOSE(... testing $cf_cv_library_path_$3) CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-l$3 $7 $cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3" AC_TRY_LINK([$1],[$2],[ CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3) cf_cv_find_linkage_$3=yes cf_cv_library_file_$3="-l$3" break],[ CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS" ]) fi done LIBS="$cf_save_LIBS" CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi else cf_cv_find_linkage_$3=no fi ],$7) if test "$cf_cv_find_linkage_$3" = yes ; then ifelse([$4],,[ CF_ADD_INCDIR($cf_cv_header_path_$3) CF_ADD_LIBDIR($cf_cv_library_path_$3) LIBS="-l$3 $LIBS" ],[$4]) else ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_FIONBIO version: 2 updated: 1998/02/24 06:51:46 dnl ---------- dnl Check for availability of fcntl versus ioctl(,FIONBIO,). Lynx uses this dnl for Sequent (ptx), and it is needed for OS/2 EMX. AC_DEFUN([CF_FIONBIO], [ AC_CACHE_CHECK(if we should use fcntl or ioctl,cf_cv_fionbio,[ AC_TRY_LINK([ #include #include ],[ int ret = ioctl(0, FIONBIO, (char *)0); ],[cf_cv_fionbio=ioctl],[ AC_TRY_LINK([ #include #if HAVE_FCNTL_H #include #else #if HAVE_SYS_FCNTL_H #include #endif #endif],[ int ret = fcntl(0, F_SETFL, O_NONBLOCK); ], [cf_cv_fionbio=fcntl], [cf_cv_fionbio=unknown])]) ]) test "$cf_cv_fionbio" = "fcntl" && AC_DEFINE(USE_FCNTL) ])dnl dnl --------------------------------------------------------------------------- dnl CF_FUNC_CURSES_VERSION version: 4 updated: 2007/04/28 09:15:55 dnl ---------------------- dnl Solaris has a data item 'curses_version', which confuses AC_CHECK_FUNCS. dnl It's a character string "SVR4", not documented. AC_DEFUN([CF_FUNC_CURSES_VERSION], [ AC_CACHE_CHECK(for function curses_version, cf_cv_func_curses_version,[ AC_TRY_RUN([ #include <${cf_cv_ncurses_header-curses.h}> int main() { char temp[1024]; sprintf(temp, "%s\n", curses_version()); ${cf_cv_main_return-return}(0); }] ,[cf_cv_func_curses_version=yes] ,[cf_cv_func_curses_version=no] ,[cf_cv_func_curses_version=unknown]) rm -f core]) test "$cf_cv_func_curses_version" = yes && AC_DEFINE(HAVE_CURSES_VERSION) ]) dnl --------------------------------------------------------------------------- dnl CF_FUNC_GETADDRINFO version: 6 updated: 2007/04/28 09:15:55 dnl ------------------- dnl Look for a working version of getaddrinfo(), for IPV6 support. AC_DEFUN([CF_FUNC_GETADDRINFO],[ AC_CACHE_CHECK(working getaddrinfo, cf_cv_getaddrinfo,[ AC_TRY_RUN([ #include #include #include #include #include #define expect(a,b) if (strcmp(a,b) != 0) goto bad int main() { int passive, gaierr, inet4 = 0, inet6 = 0; struct addrinfo hints, *ai, *aitop; char straddr[INET6_ADDRSTRLEN], strport[16]; for (passive = 0; passive <= 1; passive++) { memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_flags = passive ? AI_PASSIVE : 0; hints.ai_socktype = SOCK_STREAM; if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) { (void)gai_strerror(gaierr); goto bad; } for (ai = aitop; ai; ai = ai->ai_next) { if (ai->ai_addr == NULL || ai->ai_addrlen == 0 || getnameinfo(ai->ai_addr, ai->ai_addrlen, straddr, sizeof(straddr), strport, sizeof(strport), NI_NUMERICHOST|NI_NUMERICSERV) != 0) { goto bad; } switch (ai->ai_family) { case AF_INET: expect(strport, "54321"); if (passive) { expect(straddr, "0.0.0.0"); } else { expect(straddr, "127.0.0.1"); } inet4++; break; case AF_INET6: expect(strport, "54321"); if (passive) { expect(straddr, "::"); } else { expect(straddr, "::1"); } inet6++; break; case AF_UNSPEC: goto bad; break; default: /* another family support? */ break; } } } if (!(inet4 == 0 || inet4 == 2)) goto bad; if (!(inet6 == 0 || inet6 == 2)) goto bad; if (aitop) freeaddrinfo(aitop); ${cf_cv_main_return-return}(0); bad: if (aitop) freeaddrinfo(aitop); ${cf_cv_main_return-return}(1); } ], [cf_cv_getaddrinfo=yes], [cf_cv_getaddrinfo=no], [cf_cv_getaddrinfo=unknown]) ]) if test "$cf_cv_getaddrinfo" = yes ; then AC_DEFINE(HAVE_GAI_STRERROR) AC_DEFINE(HAVE_GETADDRINFO) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_FUNC_LSTAT version: 2 updated: 1997/09/07 13:00:21 dnl ------------- dnl A conventional existence-check for 'lstat' won't work with the Linux dnl version of gcc 2.7.0, since the symbol is defined only within dnl as an inline function. dnl dnl So much for portability. AC_DEFUN([CF_FUNC_LSTAT], [ AC_MSG_CHECKING(for lstat) AC_CACHE_VAL(ac_cv_func_lstat,[ AC_TRY_LINK([ #include #include ], [lstat(".", (struct stat *)0)], [ac_cv_func_lstat=yes], [ac_cv_func_lstat=no]) ]) AC_MSG_RESULT($ac_cv_func_lstat ) if test $ac_cv_func_lstat = yes; then AC_DEFINE(HAVE_LSTAT) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_FUNC_SIGACTION version: 2 updated: 1999/07/28 06:09:35 dnl ----------------- dnl Check if we have the sigaction function and related structures. AC_DEFUN([CF_FUNC_SIGACTION],[ AC_CACHE_CHECK(for sigaction and structs,cf_cv_func_sigaction,[ AC_TRY_LINK([ #include #include ], [struct sigaction act; act.sa_handler = SIG_DFL; #ifdef SA_RESTART act.sa_flags |= SA_RESTART; #endif /* SA_RESTART */ sigaction(1, &act, 0); ], [cf_cv_func_sigaction=yes], [cf_cv_func_sigaction=no]) ]) test "$cf_cv_func_sigaction" = yes && AC_DEFINE(HAVE_SIGACTION) ])dnl dnl --------------------------------------------------------------------------- dnl CF_FUNC_WAIT version: 2 updated: 1997/10/21 19:45:33 dnl ------------ dnl Test for the presence of , 'union wait', arg-type of 'wait()' dnl and/or 'waitpid()'. dnl dnl Note that we cannot simply grep for 'union wait' in the wait.h file, dnl because some Posix systems turn this on only when a BSD variable is dnl defined. dnl dnl I don't use AC_HEADER_SYS_WAIT, because it defines HAVE_SYS_WAIT_H, which dnl would conflict with an attempt to test that header directly. dnl AC_DEFUN([CF_FUNC_WAIT], [ AC_REQUIRE([CF_UNION_WAIT]) if test $cf_cv_type_unionwait = yes; then AC_MSG_CHECKING(if union wait can be used as wait-arg) AC_CACHE_VAL(cf_cv_arg_union_wait,[ AC_TRY_COMPILE($cf_wait_headers, [union wait x; wait(&x)], [cf_cv_arg_union_wait=yes], [cf_cv_arg_union_wait=no]) ]) AC_MSG_RESULT($cf_cv_arg_union_wait) test $cf_cv_arg_union_wait = yes && AC_DEFINE(WAIT_USES_UNION) AC_MSG_CHECKING(if union wait can be used as waitpid-arg) AC_CACHE_VAL(cf_cv_arg_union_waitpid,[ AC_TRY_COMPILE($cf_wait_headers, [union wait x; waitpid(0, &x, 0)], [cf_cv_arg_union_waitpid=yes], [cf_cv_arg_union_waitpid=no]) ]) AC_MSG_RESULT($cf_cv_arg_union_waitpid) test $cf_cv_arg_union_waitpid = yes && AC_DEFINE(WAITPID_USES_UNION) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_ATTRIBUTES version: 11 updated: 2007/07/29 09:55:12 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary dnl to documentation, unrecognized directives cause older compilers to barf. AC_DEFUN([CF_GCC_ATTRIBUTES], [ if test "$GCC" = yes then cat > conftest.i < conftest.$ac_ext <&AC_FD_CC case $cf_attribute in scanf|printf) cat >conftest.h <conftest.h <>confdefs.h fi done else fgrep define conftest.i >>confdefs.h fi rm -rf conftest* fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_VERSION version: 4 updated: 2005/08/27 09:53:42 dnl -------------- dnl Find version of gcc AC_DEFUN([CF_GCC_VERSION],[ AC_REQUIRE([AC_PROG_CC]) GCC_VERSION=none if test "$GCC" = yes ; then AC_MSG_CHECKING(version of $CC) GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown AC_MSG_RESULT($GCC_VERSION) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_WARNINGS version: 22 updated: 2007/07/29 09:55:12 dnl --------------- dnl Check if the compiler supports useful warning options. There's a few that dnl we don't use, simply because they're too noisy: dnl dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x) dnl -Wredundant-decls (system headers make this too noisy) dnl -Wtraditional (combines too many unrelated messages, only a few useful) dnl -Wwrite-strings (too noisy, but should review occasionally). This dnl is enabled for ncurses using "--enable-const". dnl -pedantic dnl dnl Parameter: dnl $1 is an optional list of gcc warning flags that a particular dnl application might want to use, e.g., "no-unused" for dnl -Wno-unused dnl Special: dnl If $with_ext_const is "yes", add a check for -Wwrite-strings dnl AC_DEFUN([CF_GCC_WARNINGS], [ AC_REQUIRE([CF_GCC_VERSION]) CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) cat > conftest.$ac_ext <],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_cv_gnu_source=no], [cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" AC_TRY_COMPILE([#include ],[ #ifdef _XOPEN_SOURCE make an error #endif], [cf_cv_gnu_source=no], [cf_cv_gnu_source=yes]) CPPFLAGS="$cf_save" ]) ]) test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" ])dnl dnl --------------------------------------------------------------------------- dnl CF_HEADER_PATH version: 8 updated: 2002/11/10 14:46:59 dnl -------------- dnl Construct a search-list for a nonstandard header-file AC_DEFUN([CF_HEADER_PATH], [CF_SUBDIR_PATH($1,$2,include) test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { test -d $includedir && $1="[$]$1 $includedir" test -d $includedir/$2 && $1="[$]$1 $includedir/$2" } test "$oldincludedir" != NONE && \ test "$oldincludedir" != "/usr/include" && \ test -d "$oldincludedir" && { test -d $oldincludedir && $1="[$]$1 $oldincludedir" test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2" } ])dnl dnl --------------------------------------------------------------------------- dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23 dnl --------------- dnl Insert text into the help-message, for readability, from AC_ARG_WITH. AC_DEFUN([CF_HELP_MESSAGE], [AC_DIVERT_HELP([$1])dnl ])dnl dnl --------------------------------------------------------------------------- dnl CF_INET_ADDR version: 4 updated: 1999/03/30 12:24:31 dnl ------------ dnl For Lynx, check if the libraries we have found give us inet_aton, or dnl inet_addr. If not, try to find the latter function with -lbind or dnl -lresolv, and put that on the end of the libraries, i.e., after the network dnl libraries. dnl dnl FIXME: the inner cases will probably need work on the header files. AC_DEFUN([CF_INET_ADDR],[ AC_CACHE_CHECK(for inet_aton function,cf_cv_have_inet_aton,[ AC_TRY_LINK([#include #include #include #include ],[inet_aton(0, (struct in_addr *)0)], [cf_cv_have_inet_aton=yes], [cf_cv_have_inet_aton=no])]) if test "$cf_cv_have_inet_aton" = yes ; then AC_DEFINE(HAVE_INET_ATON) else AC_CACHE_CHECK(for inet_addr function,cf_cv_have_inet_addr,[ AC_TRY_LINK([#include #include #include #include ],[inet_addr(0)], [cf_cv_have_inet_addr=yes], [cf_cv_have_inet_addr=no])]) if test "$cf_cv_have_inet_addr" = no ; then AC_CACHE_CHECK(for library with inet_addr,cf_cv_lib_inet_addr,[ cf_save_LIBS="$LIBS" for cf_inetlib in -lbind -lresolv do LIBS="$cf_save_LIBS $cf_inetlib" AC_TRY_LINK([#include #include #include #include ],[inet_addr(0)], [cf_cv_lib_inet_addr=$cf_inetlib], [cf_cv_lib_inet_addr=no]) LIBS="$cf_save_LIBS" test "$cf_cv_lib_inet_addr" != no && break done ]) if test "$cf_cv_lib_inet_addr" != no ; then LIBS="$LIBS $cf_cv_lib_inet_addr" else AC_MSG_WARN(Unable to find library for inet_addr function) fi fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_INTEL_COMPILER version: 3 updated: 2005/08/06 18:37:29 dnl ----------------- dnl Check if the given compiler is really the Intel compiler for Linux. It dnl tries to imitate gcc, but does not return an error when it finds a mismatch dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK. dnl dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from dnl the wrappers for gcc and g++ warnings. dnl dnl $1 = GCC (default) or GXX dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_INTEL_COMPILER],[ ifelse($2,,INTEL_COMPILER,[$2])=no if test "$ifelse($1,,[$1],GCC)" = yes ; then case $host_os in linux*|gnu*) AC_MSG_CHECKING(if this is really Intel ifelse($1,GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse($3,,CFLAGS,[$3])" ifelse($3,,CFLAGS,[$3])="$ifelse($3,,CFLAGS,[$3]) -no-gcc" AC_TRY_COMPILE([],[ #ifdef __INTEL_COMPILER #else make an error #endif ],[ifelse($2,,INTEL_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" ],[]) ifelse($3,,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse($2,,INTEL_COMPILER,[$2])) ;; esac fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_LARGEFILE version: 7 updated: 2007/06/02 11:58:50 dnl ------------ dnl Add checks for large file support. AC_DEFUN([CF_LARGEFILE],[ ifdef([AC_FUNC_FSEEKO],[ AC_SYS_LARGEFILE if test "$enable_largefile" != no ; then AC_FUNC_FSEEKO # Normally we would collect these definitions in the config.h, # but (like _XOPEN_SOURCE), some environments rely on having these # defined before any of the system headers are included. Another # case comes up with C++, e.g., on AIX the compiler compiles the # header files by themselves before looking at the body files it is # told to compile. For ncurses, those header files do not include # the config.h test "$ac_cv_sys_large_files" != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES " test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE " test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits " AC_CACHE_CHECK(whether to use struct dirent64, cf_cv_struct_dirent64,[ AC_TRY_COMPILE([ #include #include ],[ /* if transitional largefile support is setup, this is true */ extern struct dirent64 * readdir(DIR *); struct dirent64 *x = readdir((DIR *)0); struct dirent *y = readdir((DIR *)0); int z = x - y; ], [cf_cv_struct_dirent64=yes], [cf_cv_struct_dirent64=no]) ]) test "$cf_cv_struct_dirent64" = yes && AC_DEFINE(HAVE_STRUCT_DIRENT64) fi ]) ]) dnl --------------------------------------------------------------------------- dnl CF_LASTLOG version: 4 updated: 2002/10/27 23:21:42 dnl ---------- dnl Check for header defining _PATH_LASTLOG, or failing that, see if the lastlog dnl file exists. AC_DEFUN([CF_LASTLOG], [ AC_CHECK_HEADERS(lastlog.h paths.h) AC_CACHE_CHECK(for lastlog path,cf_cv_path_lastlog,[ AC_TRY_COMPILE([ #include #ifdef HAVE_LASTLOG_H #include #else #ifdef HAVE_PATHS_H #include #endif #endif],[char *path = _PATH_LASTLOG], [cf_cv_path_lastlog="_PATH_LASTLOG"], [if test -f /usr/adm/lastlog ; then cf_cv_path_lastlog=/usr/adm/lastlog else cf_cv_path_lastlog=no fi]) ]) test $cf_cv_path_lastlog != no && AC_DEFINE(USE_LASTLOG) ])dnl dnl --------------------------------------------------------------------------- dnl CF_LIBRARY_PATH version: 7 updated: 2002/11/10 14:46:59 dnl --------------- dnl Construct a search-list for a nonstandard library-file AC_DEFUN([CF_LIBRARY_PATH], [CF_SUBDIR_PATH($1,$2,lib)])dnl dnl --------------------------------------------------------------------------- dnl CF_LOCALE version: 4 updated: 2003/02/16 08:16:04 dnl --------- dnl Check if we have setlocale() and its header, dnl The optional parameter $1 tells what to do if we do have locale support. AC_DEFUN([CF_LOCALE], [ AC_MSG_CHECKING(for setlocale()) AC_CACHE_VAL(cf_cv_locale,[ AC_TRY_LINK([#include ], [setlocale(LC_ALL, "")], [cf_cv_locale=yes], [cf_cv_locale=no]) ]) AC_MSG_RESULT($cf_cv_locale) test $cf_cv_locale = yes && { ifelse($1,,AC_DEFINE(LOCALE),[$1]) } ])dnl dnl --------------------------------------------------------------------------- dnl CF_MSG_LOG version: 4 updated: 2007/07/29 09:55:12 dnl ---------- dnl Write a debug message to config.log, along with the line number in the dnl configure script. AC_DEFUN([CF_MSG_LOG],[ echo "${as_me-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_BROKEN version: 6 updated: 1998/04/27 20:32:34 dnl ----------------- dnl Check for pre-1.9.9g ncurses (among other problems, the most obvious is dnl that color combinations don't work). AC_DEFUN([CF_NCURSES_BROKEN], [ AC_REQUIRE([CF_NCURSES_VERSION]) if test "$cf_cv_ncurses_version" != no ; then AC_MSG_CHECKING(for obsolete/broken version of ncurses) AC_CACHE_VAL(cf_cv_ncurses_broken,[ AC_TRY_COMPILE([ #include <${cf_cv_ncurses_header-curses.h}>],[ #if defined(NCURSES_VERSION) && defined(wgetbkgd) make an error #else int x = 1 #endif ], [cf_cv_ncurses_broken=no], [cf_cv_ncurses_broken=yes]) ]) AC_MSG_RESULT($cf_cv_ncurses_broken) if test "$cf_cv_ncurses_broken" = yes ; then AC_MSG_WARN(hmm... you should get an up-to-date version of ncurses) AC_DEFINE(NCURSES_BROKEN) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_CC_CHECK version: 4 updated: 2007/07/29 10:39:05 dnl ------------------- dnl Check if we can compile with ncurses' header file dnl $1 is the cache variable to set dnl $2 is the header-file to include dnl $3 is the root name (ncurses or ncursesw) AC_DEFUN([CF_NCURSES_CC_CHECK],[ AC_TRY_COMPILE([ ]ifelse($3,ncursesw,[ #define _XOPEN_SOURCE_EXTENDED #undef HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */ #define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */ ])[ #include <$2>],[ #ifdef NCURSES_VERSION ]ifelse($3,ncursesw,[ #ifndef WACS_BSSB make an error #endif ])[ printf("%s\n", NCURSES_VERSION); #else #ifdef __NCURSES_H printf("old\n"); #else make an error #endif #endif ] ,[$1=$2] ,[$1=no]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_CONFIG version: 4 updated: 2006/10/28 14:36:12 dnl ----------------- dnl Tie together the configure-script macros for ncurses. dnl Prefer the "-config" script from ncurses 5.6, to simplify analysis. dnl Allow that to be overridden using the $NCURSES_CONFIG environment variable. dnl dnl $1 is the root library name (default: "ncurses") AC_DEFUN([CF_NCURSES_CONFIG], [ cf_ncuconfig_root=ifelse($1,,ncurses,$1) echo "Looking for ${cf_ncuconfig_root}-config" AC_PATH_PROGS(NCURSES_CONFIG,${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config,none) if test "$NCURSES_CONFIG" != none ; then cf_cv_ncurses_header=curses.h CPPFLAGS="`$NCURSES_CONFIG --cflags` $CPPFLAGS" LIBS="`$NCURSES_CONFIG --libs` $LIBS" dnl like CF_NCURSES_CPPFLAGS AC_DEFINE(NCURSES) dnl like CF_NCURSES_LIBS CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root) AC_DEFINE_UNQUOTED($cf_nculib_ROOT) dnl like CF_NCURSES_VERSION cf_cv_ncurses_version=`$NCURSES_CONFIG --version` else CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1)) CF_NCURSES_LIBS(ifelse($1,,ncurses,$1)) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_CPPFLAGS version: 19 updated: 2007/07/29 13:35:20 dnl ------------------- dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting dnl the CPPFLAGS variable so we can include its header. dnl dnl The header files may be installed as either curses.h, or ncurses.h (would dnl be obsolete, except that some packagers prefer this name to distinguish it dnl from a "native" curses implementation). If not installed for overwrite, dnl the curses.h file would be in an ncurses subdirectory (e.g., dnl /usr/include/ncurses), but someone may have installed overwriting the dnl vendor's curses. Only very old versions (pre-1.9.2d, the first autoconf'd dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in dnl the header. dnl dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header dnl is already in the include-path, don't even bother with this, since we cannot dnl easily determine which file it is. In this case, it has to be . dnl dnl The optional parameter gives the root name of the library, in case it is dnl not installed as the default curses library. That is how the dnl wide-character version of ncurses is installed. AC_DEFUN([CF_NCURSES_CPPFLAGS], [AC_REQUIRE([CF_WITH_CURSES_DIR]) AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl cf_ncuhdr_root=ifelse($1,,ncurses,$1) test -n "$cf_cv_curses_dir" && \ test "$cf_cv_curses_dir" != "no" && { \ CF_ADD_INCDIR($cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root) } AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[ cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" for cf_header in $cf_header_list do CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1) test "$cf_cv_ncurses_h" != no && break done ]) CF_NCURSES_HEADER CF_TERM_HEADER # some applications need this, but should check for NCURSES_VERSION AC_DEFINE(NCURSES) CF_NCURSES_VERSION ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_HEADER version: 2 updated: 2008/03/23 14:48:54 dnl ----------------- dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common dnl variations of ncurses' installs. dnl dnl See also CF_CURSES_HEADER, which sets the same cache variable. AC_DEFUN([CF_NCURSES_HEADER],[ if test "$cf_cv_ncurses_h" != no ; then cf_cv_ncurses_header=$cf_cv_ncurses_h else AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[ test -n "$verbose" && echo CF_HEADER_PATH(cf_search,$cf_ncuhdr_root) test -n "$verbose" && echo search path $cf_search cf_save2_CPPFLAGS="$CPPFLAGS" for cf_incdir in $cf_search do CF_ADD_INCDIR($cf_incdir) for cf_header in \ ncurses.h \ curses.h do CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1) if test "$cf_cv_ncurses_h2" != no ; then cf_cv_ncurses_h2=$cf_incdir/$cf_header test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&AC_FD_MSG break fi test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG done CPPFLAGS="$cf_save2_CPPFLAGS" test "$cf_cv_ncurses_h2" != no && break done test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found) ]) CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2) cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header fi CF_ADD_INCDIR($cf_1st_incdir) fi # Set definitions to allow ifdef'ing for ncurses.h case $cf_cv_ncurses_header in # (vi *ncurses.h) AC_DEFINE(HAVE_NCURSES_H) ;; esac case $cf_cv_ncurses_header in # (vi ncurses/curses.h|ncurses/ncurses.h) AC_DEFINE(HAVE_NCURSES_NCURSES_H) ;; ncursesw/curses.h|ncursesw/ncurses.h) AC_DEFINE(HAVE_NCURSESW_NCURSES_H) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_LIBS version: 13 updated: 2007/07/29 10:29:20 dnl --------------- dnl Look for the ncurses library. This is a little complicated on Linux, dnl because it may be linked with the gpm (general purpose mouse) library. dnl Some distributions have gpm linked with (bsd) curses, which makes it dnl unusable with ncurses. However, we don't want to link with gpm unless dnl ncurses has a dependency, since gpm is normally set up as a shared library, dnl and the linker will record a dependency. dnl dnl The optional parameter gives the root name of the library, in case it is dnl not installed as the default curses library. That is how the dnl wide-character version of ncurses is installed. AC_DEFUN([CF_NCURSES_LIBS], [AC_REQUIRE([CF_NCURSES_CPPFLAGS]) cf_nculib_root=ifelse($1,,ncurses,$1) # This works, except for the special case where we find gpm, but # ncurses is in a nonstandard location via $LIBS, and we really want # to link gpm. cf_ncurses_LIBS="" cf_ncurses_SAVE="$LIBS" AC_CHECK_LIB(gpm,Gpm_Open, [AC_CHECK_LIB(gpm,initscr, [LIBS="$cf_ncurses_SAVE"], [cf_ncurses_LIBS="-lgpm"])]) case $host_os in #(vi freebsd*) # This is only necessary if you are linking against an obsolete # version of ncurses (but it should do no harm, since it's static). if test "$cf_nculib_root" = ncurses ; then AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"]) fi ;; esac LIBS="$cf_ncurses_LIBS $LIBS" if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) then CF_ADD_LIBDIR($cf_cv_curses_dir/lib) LIBS="-l$cf_nculib_root $LIBS" else CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root, [#include <${cf_cv_ncurses_header-curses.h}>], [initscr()], initscr) fi if test -n "$cf_ncurses_LIBS" ; then AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS) cf_ncurses_SAVE="$LIBS" for p in $cf_ncurses_LIBS ; do q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` if test "$q" != "$LIBS" ; then LIBS="$q" fi done AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) LIBS="$cf_ncurses_SAVE"]) fi CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root) AC_DEFINE_UNQUOTED($cf_nculib_ROOT) ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_VERSION version: 12 updated: 2007/04/28 09:15:55 dnl ------------------ dnl Check for the version of ncurses, to aid in reporting bugs, etc. dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS. We don't use dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi. AC_DEFUN([CF_NCURSES_VERSION], [ AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[ cf_cv_ncurses_version=no cf_tempfile=out$$ rm -f $cf_tempfile AC_TRY_RUN([ #include <${cf_cv_ncurses_header-curses.h}> #include int main() { FILE *fp = fopen("$cf_tempfile", "w"); #ifdef NCURSES_VERSION # ifdef NCURSES_VERSION_PATCH fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); # else fprintf(fp, "%s\n", NCURSES_VERSION); # endif #else # ifdef __NCURSES_H fprintf(fp, "old\n"); # else make an error # endif #endif ${cf_cv_main_return-return}(0); }],[ cf_cv_ncurses_version=`cat $cf_tempfile`],,[ # This will not work if the preprocessor splits the line after the # Autoconf token. The 'unproto' program does that. cat > conftest.$ac_ext < #undef Autoconf #ifdef NCURSES_VERSION Autoconf NCURSES_VERSION #else #ifdef __NCURSES_H Autoconf "old" #endif ; #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out" AC_TRY_EVAL(cf_try) if test -f conftest.out ; then cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%'` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" rm -f conftest.out fi ]) rm -f $cf_tempfile ]) test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES) ])dnl dnl --------------------------------------------------------------------------- dnl CF_NETLIBS version: 4 updated: 1999/12/23 15:20:39 dnl ---------- dnl After checking for functions in the default $LIBS, make a further check dnl for the functions that are netlib-related (these aren't always in the dnl libc, etc., and have to be handled specially because there are conflicting dnl and broken implementations. dnl Common library requirements (in order): dnl -lresolv -lsocket -lnsl dnl -lnsl -lsocket dnl -lsocket dnl -lbsd AC_DEFUN([CF_NETLIBS],[ cf_test_netlibs=no AC_MSG_CHECKING(for network libraries) AC_CACHE_VAL(cf_cv_netlibs,[ AC_MSG_RESULT(working...) cf_cv_netlibs="" cf_test_netlibs=yes AC_CHECK_FUNCS(gethostname,,[ CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[ CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])]) # # FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but # I don't know the entrypoints - 97/7/22 TD # AC_HAVE_LIBRARY(inet,cf_cv_netlibs="-linet $cf_cv_netlibs") AC_CHECK_LIB(inet, main, cf_cv_netlibs="-linet $cf_cv_netlibs") # if test "$ac_cv_func_lsocket" != no ; then AC_CHECK_FUNCS(socket,,[ CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[ CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])]) fi # AC_CHECK_FUNCS(gethostbyname,,[ CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)]) # AC_CHECK_FUNCS(strcasecmp,,[ CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)]) ]) LIBS="$LIBS $cf_cv_netlibs" test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG ])dnl dnl --------------------------------------------------------------------------- dnl CF_NGROUPS version: 3 updated: 2001/12/27 07:55:07 dnl ---------- dnl Check for the symbol NGROUPS AC_DEFUN([CF_NGROUPS], [ AC_MSG_CHECKING(if NGROUPS is defined) AC_CACHE_VAL(cf_cv_ngroups,[ AC_TRY_COMPILE([ #if HAVE_SYS_PARAM_H #include #endif #if HAVE_LIMITS_H #include #endif ],[int x = NGROUPS], [cf_cv_ngroups=yes], [AC_TRY_COMPILE([ #if HAVE_SYS_PARAM_H #include #endif #if HAVE_LIMITS_H #include #endif ],[int x = NGROUPS_MAX], [cf_cv_ngroups=NGROUPS_MAX], [cf_cv_ngroups=no]) ]) AC_MSG_RESULT($cf_cv_ngroups) ]) if test "$cf_cv_ngroups" = no ; then AC_DEFINE(NGROUPS,16) elif test "$cf_cv_ngroups" = NGROUPS_MAX ; then AC_DEFINE(NGROUPS,NGROUPS_MAX) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05 dnl ------------------ dnl see CF_WITH_NO_LEAKS AC_DEFUN([CF_NO_LEAKS_OPTION],[ AC_MSG_CHECKING(if you want to use $1 for testing) AC_ARG_WITH($1, [$2], [AC_DEFINE($3)ifelse([$4],,[ $4 ]) : ${with_cflags:=-g} : ${with_no_leaks:=yes} with_$1=yes], [with_$1=]) AC_MSG_RESULT(${with_$1:-no}) case .$with_cflags in #(vi .*-g*) case .$CFLAGS in #(vi .*-g*) #(vi ;; *) CF_ADD_CFLAGS([-g]) ;; esac ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_NSS_COMPAT version: 2 updated: 2008/03/23 14:48:54 dnl ------------- dnl Check for NSS compatible SSL libraries dnl $1 = the [optional] directory in which the library may be found AC_DEFUN([CF_NSS_COMPAT],[ check=`pkg-config --version 2>/dev/null` if test -n "$check" ; then cf_ssl_library=`pkg-config --libs nss` cf_ssl_cflags=`pkg-config --cflags nss` else # Without pkg-config, we'll kludge in some defaults cf_ssl_library="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl" cf_ssl_cflags="-I/usr/include/nss3 -I/usr/include/nspr4" fi cf_ssl_library="-lnss_compat_ossl $cf_ssl_library" case "$1" in #(vi no) #(vi cf_ssl_root= ;; yes) #(vi AC_CHECK_LIB(nss_compat_ossl, SSL_get_version,[],[ cf_ssl_root=/usr/local/nss_compat_ossl if test -d $cf_ssl_root ; then CF_VERBOSE(assume it is in $cf_ssl_root) cf_ssl_library="-L$cf_ssl_root/lib $cf_ssl_library" else AC_MSG_ERROR(cannot find NSS compilant libraries) fi ], [-lnss_compat_ossl]) ;; *) if test -d $1 ; then if test -d $1/include ; then cf_ssl_root=$1 elif test -d $1/../include ; then cf_ssl_root=$1/.. else AC_MSG_ERROR(cannot find NSS compilant library under $1) fi cf_ssl_library="-L$cf_ssl_root/lib $cf_ssl_library" else AC_MSG_WARN(expected a directory: $1) fi ;; esac LIBS="$cf_ssl_library $LIBS" cf_ssl_subincs=yes if test -n "$cf_ssl_root" ; then if test -d $cf_ssl_root/include ; then cf_ssl_cflags="-I$cf_ssl_root/include $cf_ssl_cflags" test -d $cf_ssl_root/include/nss_compat_ossl || cf_ssl_subincs=no fi fi CF_ADD_CFLAGS($cf_ssl_cflags) if test "$cf_ssl_subincs" = yes ; then AC_MSG_CHECKING(for NSS compilant include directory) AC_TRY_COMPILE([ #include #include ], [SSL_shutdown((SSL *)0)], [cf_ssl_incl=yes], [cf_ssl_incl=no]) AC_MSG_RESULT($cf_ssl_incl) test "$cf_ssl_incl" = yes && AC_DEFINE(USE_NSS_COMPAT_INCL) fi AC_MSG_CHECKING(if we can link to NSS compilant library) AC_TRY_LINK([ #include #ifdef USE_NSS_COMPAT_INCL #include #else #include #endif ], [SSL_shutdown((SSL *)0)], [cf_ssl_library=yes], [cf_ssl_library=no]) AC_MSG_RESULT($cf_ssl_library) if test "$cf_ssl_library" = yes ; then AC_DEFINE(USE_SSL) AC_DEFINE(USE_X509_SUPPORT) else AC_MSG_ERROR(Cannot link with NSS compilant libraries) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_OUR_MESSAGES version: 7 updated: 2004/09/12 19:45:55 dnl --------------- dnl Check if we use the messages included with this program dnl dnl $1 specifies either Makefile or makefile, defaulting to the former. dnl dnl Sets variables which can be used to substitute in makefiles: dnl MSG_DIR_MAKE - to make ./po directory dnl SUB_MAKEFILE - makefile in ./po directory (see CF_BUNDLED_INTL) dnl AC_DEFUN([CF_OUR_MESSAGES], [ cf_makefile=ifelse($1,,Makefile,$1) use_our_messages=no if test "$USE_NLS" = yes ; then if test -d $srcdir/po ; then AC_MSG_CHECKING(if we should use included message-library) AC_ARG_ENABLE(included-msgs, [ --disable-included-msgs use included messages, for i18n support], [use_our_messages=$enableval], [use_our_messages=yes]) fi AC_MSG_RESULT($use_our_messages) fi MSG_DIR_MAKE="#" if test "$use_our_messages" = yes then SUB_MAKEFILE="$SUB_MAKEFILE po/$cf_makefile.in:$srcdir/po/$cf_makefile.inn" MSG_DIR_MAKE= fi AC_SUBST(MSG_DIR_MAKE) AC_SUBST(SUB_MAKEFILE) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PATHSEP version: 3 updated: 2001/01/12 01:23:53 dnl ---------- dnl Provide a value for the $PATH and similar separator AC_DEFUN([CF_PATHSEP], [ case $cf_cv_system_name in os2*) PATHSEP=';' ;; *) PATHSEP=':' ;; esac ifelse($1,,,[$1=$PATHSEP]) AC_SUBST(PATHSEP) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PATH_PROG version: 6 updated: 2004/01/26 20:58:41 dnl ------------ dnl Check for a given program, defining corresponding symbol. dnl $1 = environment variable, which is suffixed by "_PATH" in the #define. dnl $2 = program name to find. dnl $3 = optional list of additional program names to test. dnl dnl If there is more than one token in the result, #define the remaining tokens dnl to $1_ARGS. We need this for 'install' in particular. dnl dnl FIXME: we should allow this to be overridden by environment variables dnl AC_DEFUN([CF_PATH_PROG],[ test -z "[$]$1" && $1=$2 AC_PATH_PROGS($1,[$]$1 $2 $3,[$]$1) cf_path_prog="" cf_path_args="" IFS="${IFS= }"; cf_save_ifs="$IFS" case $host_os in #(vi os2*) #(vi IFS="${IFS};" ;; *) IFS="${IFS}:" ;; esac for cf_temp in $ac_cv_path_$1 do if test -z "$cf_path_prog" ; then if test "$with_full_paths" = yes ; then CF_PATH_SYNTAX(cf_temp,break) cf_path_prog="$cf_temp" else cf_path_prog="`basename $cf_temp`" fi elif test -z "$cf_path_args" ; then cf_path_args="$cf_temp" else cf_path_args="$cf_path_args $cf_temp" fi done IFS="$cf_save_ifs" if test -n "$cf_path_prog" ; then CF_MSG_LOG(defining path for ${cf_path_prog}) AC_DEFINE_UNQUOTED($1_PATH,"$cf_path_prog") test -n "$cf_path_args" && AC_DEFINE_UNQUOTED($1_ARGS,"$cf_path_args") fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_PATH_SYNTAX version: 12 updated: 2008/03/23 14:45:59 dnl -------------- dnl Check the argument to see that it looks like a pathname. Rewrite it if it dnl begins with one of the prefix/exec_prefix variables, and then again if the dnl result begins with 'NONE'. This is necessary to work around autoconf's dnl delayed evaluation of those symbols. AC_DEFUN([CF_PATH_SYNTAX],[ if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".[$]$1" in #(vi .\[$]\(*\)*|.\'*\'*) #(vi ;; ..|./*|.\\*) #(vi ;; .[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX ;; .\[$]{*prefix}*) #(vi eval $1="[$]$1" case ".[$]$1" in #(vi .NONE/*) $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; #(vi .no|.NONE/*) $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` ;; *) ifelse($2,,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_PDCURSES_X11 version: 8 updated: 2008/03/23 14:48:54 dnl --------------- dnl Configure for PDCurses' X11 library AC_DEFUN([CF_PDCURSES_X11],[ AC_REQUIRE([CF_X_ATHENA]) AC_PATH_PROGS(XCURSES_CONFIG,xcurses-config,none) if test "$XCURSES_CONFIG" != none ; then CPPFLAGS="`$XCURSES_CONFIG --cflags` $CPPFLAGS" LIBS="`$XCURSES_CONFIG --libs` $LIBS" cf_cv_lib_XCurses=yes else LDFLAGS="$LDFLAGS $X_LIBS" CF_CHECK_CFLAGS($X_CFLAGS) AC_CHECK_LIB(X11,XOpenDisplay, [LIBS="-lX11 $LIBS"],, [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS]) AC_CACHE_CHECK(for XCurses library,cf_cv_lib_XCurses,[ LIBS="-lXCurses $LIBS" AC_TRY_LINK([ #include char *XCursesProgramName = "test"; ],[XCursesExit();], [cf_cv_lib_XCurses=yes], [cf_cv_lib_XCurses=no]) ]) fi if test $cf_cv_lib_XCurses = yes ; then AC_DEFINE(UNIX) AC_DEFINE(XCURSES) AC_DEFINE(HAVE_XCURSES) else AC_MSG_ERROR(Cannot link with XCurses) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_POSIX_C_SOURCE version: 6 updated: 2005/07/14 20:25:10 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl dnl POSIX.1-1990 _POSIX_SOURCE dnl POSIX.1-1990 and _POSIX_SOURCE and dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2 dnl Bindings Option dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L dnl X/Open 2000 _POSIX_C_SOURCE=200112L dnl dnl Parameters: dnl $1 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_POSIX_C_SOURCE], [ cf_POSIX_C_SOURCE=ifelse($1,,199506L,$1) cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE) CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE) AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ CF_MSG_LOG(if the symbol is already defined go no further) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE make an error #endif], [cf_cv_posix_c_source=no], [cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in #(vi .[[12]]??*) #(vi cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; .2) #(vi cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; .*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then AC_TRY_COMPILE([#include ],[ #ifdef _POSIX_SOURCE make an error #endif],[], cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE") fi CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" CF_MSG_LOG(if the second compile does not leave our definition intact error) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE make an error #endif],, [cf_cv_posix_c_source=no]) CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" ]) ]) if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" if test "$cf_cv_cc_u_d_options" = yes ; then cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \ sed -e 's/-D/-U/g' -e 's/=[[^ ]]*//g'` CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source" fi CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_CC_U_D version: 1 updated: 2005/07/14 16:59:30 dnl -------------- dnl Check if C (preprocessor) -U and -D options are processed in the order dnl given rather than by type of option. Some compilers insist on apply all dnl of the -U options after all of the -D options. Others allow mixing them, dnl and may predefine symbols that conflict with those we define. AC_DEFUN([CF_PROG_CC_U_D], [ AC_CACHE_CHECK(if $CC -U and -D options work together,cf_cv_cc_u_d_options,[ cf_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS" AC_TRY_COMPILE([],[ #ifndef U_D_OPTIONS make an undefined-error #endif #ifdef D_U_OPTIONS make a defined-error #endif ],[ cf_cv_cc_u_d_options=yes],[ cf_cv_cc_u_d_options=no]) CPPFLAGS="$cf_save_CPPFLAGS" ]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18 dnl ----------- dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX. AC_DEFUN([CF_PROG_EXT], [ AC_REQUIRE([CF_CHECK_CACHE]) case $cf_cv_system_name in os2*) CFLAGS="$CFLAGS -Zmt" CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" CXXFLAGS="$CXXFLAGS -Zmt" # autoconf's macro sets -Zexe and suffix both, which conflict:w LDFLAGS="$LDFLAGS -Zmt -Zcrtdll" ac_cv_exeext=.exe ;; esac AC_EXEEXT AC_OBJEXT PROG_EXT="$EXEEXT" AC_SUBST(PROG_EXT) test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") ])dnl dnl --------------------------------------------------------------------------- dnl CF_RECHECK_FUNC version: 3 updated: 2000/10/18 19:29:13 dnl --------------- dnl Re-check on a function to see if we can pick it up by adding a library. dnl $1 = function to check dnl $2 = library to check in dnl $3 = environment to update (e.g., $LIBS) dnl $4 = what to do if this fails dnl dnl This uses 'unset' if the shell happens to support it, but leaves the dnl configuration variable set to 'unknown' if not. This is a little better dnl than the normal autoconf test, which gives misleading results if a test dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is dnl used (autoconf does not distinguish between a null token and one that is dnl set to 'no'). AC_DEFUN([CF_RECHECK_FUNC],[ AC_CHECK_LIB($2,$1,[ CF_UPPER(cf_tr_func,$1) AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func) ac_cv_func_$1=yes if test "$cf_used_lib_$2" != yes ; then cf_used_lib_$2=yes; $3="-l$2 [$]$3"; fi],[ ac_cv_func_$1=unknown unset ac_cv_func_$1 2>/dev/null $4], [[$]$3]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_BROKEN version: 3 updated: 1997/11/23 14:49:44 dnl ---------------- dnl Check for broken definition of 'remove()'. This is (in particular) broken dnl on the older version of SCO (I'd cite version if I knew where to look) by dnl having #define remove to __unlink, which appears in no library. dnl dnl Fortuitously, we can combine this with a more general test: do we have dnl 'unlink()' but no 'remove()'. Note, however, that we cannot simply #define dnl remove to unlink, but have to make a fallback function. dnl AC_DEFUN([CF_REMOVE_BROKEN], [ AC_MSG_CHECKING(for broken/missing definition of remove) AC_CACHE_VAL(cf_cv_baddef_remove,[ AC_TRY_LINK( [#include ], [remove("dummy")], [cf_cv_baddef_remove=no], [AC_TRY_LINK( [#include int __unlink(name) { return unlink(name); } ], [remove("dummy")], [cf_cv_baddef_remove=yes], [cf_cv_baddef_remove=unknown]) ]) ]) AC_MSG_RESULT($cf_cv_baddef_remove) test "$cf_cv_baddef_remove" != no && AC_DEFINE(NEED_REMOVE) ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_DEFINE version: 2 updated: 2005/07/09 16:12:18 dnl ---------------- dnl Remove all -U and -D options that refer to the given symbol from a list dnl of C compiler options. This works around the problem that not all dnl compilers process -U and -D options from left-to-right, so a -U option dnl cannot be used to cancel the effect of a preceding -D option. dnl dnl $1 = target (which could be the same as the source variable) dnl $2 = source (including '$') dnl $3 = symbol to remove define([CF_REMOVE_DEFINE], [ # remove $3 symbol from $2 $1=`echo "$2" | \ sed -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[[ ]]/ /g' \ -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- dnl CF_SET_ERRNO version: 3 updated: 2007/04/28 09:15:55 dnl ------------ dnl Check if 'errno' is declared in a fashion that lets us set it. AC_DEFUN([CF_SET_ERRNO], [ AC_CACHE_CHECK(if we can set errno,cf_cv_set_errno,[ AC_TRY_RUN([ #include int main() { errno = 255; ${cf_cv_main_return-return}(errno != 255); }], [cf_cv_set_errno=yes], [cf_cv_set_errno=no], [AC_TRY_LINK( [#include ], [errno = 255], [cf_cv_set_errno=maybe], [cf_cv_set_errno=no])]) ]) test "$cf_cv_set_errno" != no && AC_DEFINE(CAN_SET_ERRNO) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SIGWINCH version: 1 updated: 2006/04/02 16:41:09 dnl ----------- dnl Use this macro after CF_XOPEN_SOURCE, but do not require it (not all dnl programs need this test). dnl dnl This is really a MacOS X 10.4.3 workaround. Defining _POSIX_C_SOURCE dnl forces SIGWINCH to be undefined (breaks xterm, ncurses). Oddly, the struct dnl winsize declaration is left alone - we may revisit this if Apple choose to dnl break that part of the interface as well. AC_DEFUN([CF_SIGWINCH], [ AC_CACHE_CHECK(if SIGWINCH is defined,cf_cv_define_sigwinch,[ AC_TRY_COMPILE([ #include #include ],[int x = SIGWINCH], [cf_cv_define_sigwinch=yes], [AC_TRY_COMPILE([ #undef _XOPEN_SOURCE #undef _POSIX_SOURCE #undef _POSIX_C_SOURCE #include #include ],[int x = SIGWINCH], [cf_cv_define_sigwinch=maybe], [cf_cv_define_sigwinch=no]) ]) ]) if test "$cf_cv_define_sigwinch" = maybe ; then AC_CACHE_CHECK(for actual SIGWINCH definition,cf_cv_fixup_sigwinch,[ cf_cv_fixup_sigwinch=unknown cf_sigwinch=32 while test $cf_sigwinch != 1 do AC_TRY_COMPILE([ #undef _XOPEN_SOURCE #undef _POSIX_SOURCE #undef _POSIX_C_SOURCE #include #include ],[ #if SIGWINCH != $cf_sigwinch make an error #endif int x = SIGWINCH], [cf_cv_fixup_sigwinch=$cf_sigwinch break]) cf_sigwinch=`expr $cf_sigwinch - 1` done ]) if test "$cf_cv_fixup_sigwinch" != unknown ; then CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch" fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_SIZECHANGE version: 8 updated: 2000/11/04 12:22:16 dnl ------------- dnl Check for definitions & structures needed for window size-changing dnl FIXME: check that this works with "snake" (HP-UX 10.x) AC_DEFUN([CF_SIZECHANGE], [ AC_REQUIRE([CF_STRUCT_TERMIOS]) AC_CACHE_CHECK(declaration of size-change, cf_cv_sizechange,[ cf_cv_sizechange=unknown cf_save_CPPFLAGS="$CPPFLAGS" for cf_opts in "" "NEED_PTEM_H" do CPPFLAGS="$cf_save_CPPFLAGS" test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts" AC_TRY_COMPILE([#include #ifdef HAVE_TERMIOS_H #include #else #ifdef HAVE_TERMIO_H #include #endif #endif #ifdef NEED_PTEM_H /* This is a workaround for SCO: they neglected to define struct winsize in * termios.h -- it's only in termio.h and ptem.h */ #include #include #endif #if !defined(sun) || !defined(HAVE_TERMIOS_H) #include #endif ],[ #ifdef TIOCGSIZE struct ttysize win; /* FIXME: what system is this? */ int y = win.ts_lines; int x = win.ts_cols; #else #ifdef TIOCGWINSZ struct winsize win; int y = win.ws_row; int x = win.ws_col; #else no TIOCGSIZE or TIOCGWINSZ #endif /* TIOCGWINSZ */ #endif /* TIOCGSIZE */ ], [cf_cv_sizechange=yes], [cf_cv_sizechange=no]) CPPFLAGS="$cf_save_CPPFLAGS" if test "$cf_cv_sizechange" = yes ; then echo "size-change succeeded ($cf_opts)" >&AC_FD_CC test -n "$cf_opts" && cf_cv_sizechange="$cf_opts" break fi done ]) if test "$cf_cv_sizechange" != no ; then AC_DEFINE(HAVE_SIZECHANGE) case $cf_cv_sizechange in #(vi NEED*) AC_DEFINE_UNQUOTED($cf_cv_sizechange ) ;; esac fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_SLANG_CPPFLAGS version: 8 updated: 2008/03/23 14:48:54 dnl ----------------- dnl Look for the slang header files in the standard places, adjusting the dnl CPPFLAGS variable. dnl AC_DEFUN([CF_SLANG_CPPFLAGS], [ AC_CACHE_CHECK(for slang header file,cf_cv_slang_header,[ AC_TRY_COMPILE([#include ], [printf("%s\n", SLANG_VERSION)], [cf_cv_slang_header=predefined],[ CF_HEADER_PATH(cf_search,slang) for cf_incdir in $cf_search do for cf_header in \ slang.h do echo trying $cf_incdir/$cf_header 1>&AC_FD_CC if egrep "SLANG_VERSION" $cf_incdir/$cf_header 1>&AC_FD_CC 2>&1; then cf_cv_slang_header=$cf_incdir/$cf_header break fi done test -n "$cf_cv_slang_header" && break done test -z "$cf_cv_slang_header" && AC_MSG_ERROR(not found) ])]) AC_DEFINE(USE_SLANG) CF_DIRNAME(cf_incdir,$cf_cv_slang_header) case $cf_cv_slang_header in # (vi predefined) # (vi ;; *) CF_ADD_INCDIR($cf_incdir) ;; esac # There's an unofficial set of patches for slang that gives it some limited # UTF8 capability. Unfortunately it won't compile unless one defines UTF8. AC_CACHE_CHECK(if we must define UTF8,cf_cv_slang_utf8,[ AC_TRY_COMPILE([ #include ], [SLtt_get_screen_size()], [cf_cv_slang_utf8=no], [ AC_TRY_COMPILE([ #define UTF8 #include ], [SLtt_get_screen_size()], [cf_cv_slang_utf8=yes], [cf_cv_slang_utf8=unknown])]) ]) if test "$cf_cv_slang_utf8" = yes ; then AC_DEFINE(UTF8) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_SLANG_LIBS version: 7 updated: 2002/09/17 19:03:38 dnl ------------- dnl Look for the slang library. AC_DEFUN([CF_SLANG_LIBS], [ cf_slang_LIBS1="$LIBS" CF_TERMCAP_LIBS cf_slang_LIBS2="$LIBS" AC_CHECK_FUNC(acos,,[CF_RECHECK_FUNC(acos,m,LIBS)]) case $host_os in #(vi os2*) CF_FIND_LIBRARY(video,video, [#include ], [v_init()], v_init) ;; esac CF_FIND_LIBRARY(slang,slang, [#include ], [SLtt_get_screen_size()], SLtt_get_screen_size) cf_slang_LIBS3="$LIBS" AC_MSG_CHECKING(if we can link slang without termcap) if test -n "`echo $cf_slang_LIBS1 | sed -e 's/ //g'`" ; then cf_exclude=`echo ".$cf_slang_LIBS2" | sed -e "s%$cf_slang_LIBS1%%" -e 's%^.%%'` else cf_exclude="$cf_slang_LIBS2" fi LIBS=`echo ".$cf_slang_LIBS3" | sed -e "s%$cf_exclude%%" -e 's%^.%%'` AC_TRY_LINK([#include ], [SLtt_get_screen_size()], [cf_result=yes], [cf_result=no]) AC_MSG_RESULT($cf_result) test $cf_result = no && LIBS="$cf_slang_LIBS3" ])dnl dnl --------------------------------------------------------------------------- dnl CF_SLANG_UNIX_DEFS version: 3 updated: 2000/05/20 11:59:59 dnl ------------------ dnl Slang's header files rely on some predefined symbols to declare variables dnl that we might find useful. This check is needed, because those symbols dnl are generally not available. AC_DEFUN([CF_SLANG_UNIX_DEFS], [ AC_REQUIRE([CF_SLANG_CPPFLAGS]) AC_REQUIRE([CF_SLANG_LIBS]) AC_CACHE_CHECK(if we must tell slang this is UNIX,cf_cv_slang_unix,[ AC_TRY_LINK([#include ], [ #ifdef REAL_UNIX_SYSTEM make an error #else extern int SLang_TT_Baud_Rate; SLang_TT_Baud_Rate = 1 #endif ], [cf_cv_slang_unix=yes], [cf_cv_slang_unix=no]) ]) test $cf_cv_slang_unix = yes && AC_DEFINE(REAL_UNIX_SYSTEM) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SOCKS version: 6 updated: 2008/03/23 14:48:54 dnl -------- dnl Check for socks library dnl $1 = the [optional] directory in which the library may be found AC_DEFUN([CF_SOCKS],[ CF_ADD_OPTIONAL_PATH($1, [socks library]) CF_FIND_LINKAGE([ #include ],[ Raccept((char *)0) ], socks, cf_cv_have_socks=yes, cf_cv_have_socks=no) if test "$cf_cv_have_socks" = yes ; then AC_DEFINE(SOCKS) AC_DEFINE(accept,Raccept) AC_DEFINE(bind,Rbind) AC_DEFINE(connect,Rconnect) AC_DEFINE(getpeername,Rgetpeername) AC_DEFINE(getsockname,Rgetsockname) AC_DEFINE(listen,Rlisten) AC_DEFINE(recvfrom,Rrecvfrom) AC_DEFINE(select,Rselect) CF_ADD_INCDIR($cf_cv_header_path_socks) CF_ADD_LIBDIR($cf_cv_library_path_socks) LIBS="$LIBS -lsocks" else AC_MSG_ERROR(cannot link with socks library) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_SOCKS5 version: 10 updated: 2008/03/23 14:48:54 dnl --------- dnl Check for socks5 configuration dnl $1 = the [optional] directory in which the library may be found AC_DEFUN([CF_SOCKS5],[ CF_ADD_OPTIONAL_PATH($1, [socks5 library]) LIBS="$LIBS -lsocks5" AC_DEFINE(USE_SOCKS5) AC_DEFINE(SOCKS) AC_MSG_CHECKING(if the socks library uses socks4 prefix) cf_use_socks4=error AC_TRY_LINK([ #include ],[ Rinit((char *)0)], [AC_DEFINE(USE_SOCKS4_PREFIX) cf_use_socks4=yes], [AC_TRY_LINK([#include ], [SOCKSinit((char *)0)], [cf_use_socks4=no], [AC_MSG_ERROR(Cannot link with socks5 library)])]) AC_MSG_RESULT($cf_use_socks4) if test "$cf_use_socks4" = "yes" ; then AC_DEFINE(accept,Raccept) AC_DEFINE(bind,Rbind) AC_DEFINE(connect,Rconnect) AC_DEFINE(getpeername,Rgetpeername) AC_DEFINE(getsockname,Rgetsockname) AC_DEFINE(listen,Rlisten) AC_DEFINE(recvfrom,Rrecvfrom) AC_DEFINE(select,Rselect) else AC_DEFINE(accept,SOCKSaccept) AC_DEFINE(getpeername,SOCKSgetpeername) AC_DEFINE(getsockname,SOCKSgetsockname) AC_DEFINE(recvfrom,SOCKSrecvfrom) fi AC_MSG_CHECKING(if socks5p.h is available) AC_TRY_COMPILE([ #define INCLUDE_PROTOTYPES #include ],[ init((char *)0)], [cf_use_socks5p_h=yes], [cf_use_socks5p_h=no]) AC_MSG_RESULT($cf_use_socks5p_h) test "$cf_use_socks5p_h" = yes && AC_DEFINE(INCLUDE_PROTOTYPES) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SRAND version: 8 updated: 2007/04/22 12:01:07 dnl -------- dnl Check for functions similar to srand() and rand(). lrand48() and random() dnl return a 31-bit value, while rand() returns a value less than RAND_MAX dnl which usually is only 16-bits. dnl dnl On MirOS, use arc4random_push() and arc4random(). dnl Some systems support an asymmetric variation of this interface. AC_DEFUN([CF_SRAND],[ AC_CACHE_CHECK(for random-integer functions, cf_cv_srand_func,[ cf_cv_srand_func=unknown for cf_func in arc4random_push/arc4random arc4random_stir/arc4random srandom/random srand48/lrand48 srand/rand do CF_SRAND_PARSE($cf_func,cf_srand_func,cf_rand_func) AC_TRY_LINK([ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_LIMITS_H #include #endif ],[long seed = 1; $cf_srand_func(seed); seed = $cf_rand_func()], [cf_cv_srand_func=$cf_func break]) done ]) if test "$cf_cv_srand_func" != unknown ; then AC_CACHE_CHECK(for range of random-integers, cf_cv_rand_max,[ case $cf_cv_srand_func in srand/rand) cf_cv_rand_max=RAND_MAX cf_rand_max=16 ;; */arc4random) cf_cv_rand_max=0xFFFFFFFFUL cf_rand_max=32 ;; *) cf_cv_rand_max=INT_MAX cf_rand_max=31 ;; esac AC_TRY_COMPILE([ #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_LIMITS_H #include #endif ],[long x = $cf_cv_rand_max],, [cf_cv_rand_max="(1L<<$cf_rand_max)-1"]) ]) CF_SRAND_PARSE($cf_func,cf_srand_func,cf_rand_func) CF_UPPER(cf_rand_max,ifelse($1,,my_,$1)rand_max) AC_DEFINE_UNQUOTED(ifelse($1,,my_,$1)srand,$cf_srand_func) AC_DEFINE_UNQUOTED(ifelse($1,,my_,$1)rand, $cf_rand_func) AC_DEFINE_UNQUOTED([$]cf_rand_max, $cf_cv_rand_max) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_SRAND_PARSE version: 1 updated: 2007/04/22 12:01:07 dnl -------------- dnl Parse the loop variable for CF_SRAND, with a workaround for asymmetric dnl variations. define([CF_SRAND_PARSE],[ $2=`echo $1 | sed -e 's%/.*%%'` $3=`echo $1 | sed -e 's%.*/%%'` case [$]$2 in #(vi arc4random_stir) $2='(void)' ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_SSL version: 12 updated: 2008/01/06 14:56:47 dnl ------ dnl Check for ssl library dnl $1 = the [optional] directory in which the library may be found AC_DEFUN([CF_SSL],[ CF_ADD_OPTIONAL_PATH([$1], [ssl library]) CF_FIND_LINKAGE(CF__SSL_HEAD, CF__SSL_BODY, ssl, cf_cv_have_ssl=yes, cf_cv_have_ssl=no, openssl, [-lcrypto]) if test "$cf_cv_have_ssl" = yes ; then if test -n "$cf_cv_header_path_ssl" ; then AC_DEFINE(USE_SSL) case $cf_cv_header_path_ssl in */openssl) AC_DEFINE(USE_OPENSSL_INCL) ;; esac case $cf_cv_header_path_ssl in /usr/include/openssl) ;; *) CF_ADD_INCDIR($cf_cv_header_path_ssl) ;; esac fi if test -n "$cf_cv_library_path_ssl" ; then CF_ADD_LIBDIR($cf_cv_library_path_ssl) fi LIBS="-lssl -lcrypto $LIBS" CF_CHECK_SSL_X509 fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_STRIP_G_OPT version: 3 updated: 2002/12/21 19:25:52 dnl -------------- dnl Remove "-g" option from the compiler options AC_DEFUN([CF_STRIP_G_OPT], [$1=`echo ${$1} | sed -e 's%-g %%' -e 's%-g$%%'`])dnl dnl --------------------------------------------------------------------------- dnl CF_STRIP_O_OPT version: 3 updated: 2001/02/02 19:06:08 dnl -------------- dnl Remove "-O" option from the compiler options AC_DEFUN([CF_STRIP_O_OPT],[ $1=`echo ${$1} | sed -e 's/-O[[1-9]]\? //' -e 's/-O[[1-9]]\?$//'` ])dnl dnl --------------------------------------------------------------------------- dnl CF_STRUCT_TERMIOS version: 5 updated: 2000/11/04 12:22:46 dnl ----------------- dnl Some machines require _POSIX_SOURCE to completely define struct termios. dnl If so, define SVR4_TERMIO AC_DEFUN([CF_STRUCT_TERMIOS],[ AC_CHECK_HEADERS( \ termio.h \ termios.h \ unistd.h \ ) if test "$ISC" = yes ; then AC_CHECK_HEADERS( sys/termio.h ) fi if test "$ac_cv_header_termios_h" = yes ; then case "$CFLAGS $CPPFLAGS" in *-D_POSIX_SOURCE*) termios_bad=dunno ;; *) termios_bad=maybe ;; esac if test "$termios_bad" = maybe ; then AC_MSG_CHECKING(whether termios.h needs _POSIX_SOURCE) AC_TRY_COMPILE([#include ], [struct termios foo; int x = foo.c_iflag], termios_bad=no, [ AC_TRY_COMPILE([ #define _POSIX_SOURCE #include ], [struct termios foo; int x = foo.c_iflag], termios_bad=unknown, termios_bad=yes AC_DEFINE(SVR4_TERMIO)) ]) AC_MSG_RESULT($termios_bad) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_SUBDIR_PATH version: 5 updated: 2007/07/29 09:55:12 dnl -------------- dnl Construct a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result dnl $2 = the package name dnl $3 = the subdirectory, e.g., bin, include or lib AC_DEFUN([CF_SUBDIR_PATH], [$1="" CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix) CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE) CF_ADD_SUBDIR_PATH($1,$2,$3,/usr/local,$prefix) CF_ADD_SUBDIR_PATH($1,$2,$3,/opt,$prefix) CF_ADD_SUBDIR_PATH($1,$2,$3,[$]HOME,$prefix) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SUBST version: 4 updated: 2006/06/17 12:33:03 dnl -------- dnl Shorthand macro for substituting things that the user may override dnl with an environment variable. dnl dnl $1 = long/descriptive name dnl $2 = environment variable dnl $3 = default value AC_DEFUN([CF_SUBST], [AC_CACHE_VAL(cf_cv_subst_$2,[ AC_MSG_CHECKING(for $1 (symbol $2)) CF_SUBST_IF([-z "[$]$2"], [$2], [$3]) cf_cv_subst_$2=[$]$2 AC_MSG_RESULT([$]$2) ]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SUBST_IF version: 2 updated: 2006/06/17 12:33:03 dnl ----------- dnl Shorthand macro for substituting things that the user may override dnl with an environment variable. dnl dnl $1 = condition to pass to "test" dnl $2 = environment variable dnl $3 = value if the test succeeds dnl $4 = value if the test fails AC_DEFUN([CF_SUBST_IF], [ if test $1 ; then $2=$3 ifelse($4,,,[else $2=$4]) fi AC_SUBST($2) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SYSTEM_MAIL_FLAGS version: 3 updated: 1998/11/18 14:45:34 dnl -------------------- AC_DEFUN([CF_SYSTEM_MAIL_FLAGS], [ AC_MSG_CHECKING([system mail flags]) AC_CACHE_VAL(cf_cv_system_mail_flags,[ case $cf_cv_SYSTEM_MAIL in */mmdf/*) [cf_cv_system_mail_flags="-mlruxto,cc\\\\*"] ;; *) [cf_cv_system_mail_flags="-t -oi"] esac ]) AC_MSG_RESULT($cf_cv_system_mail_flags) AC_DEFINE_UNQUOTED(SYSTEM_MAIL_FLAGS, "$cf_cv_system_mail_flags") ])dnl dnl --------------------------------------------------------------------------- dnl CF_SYSV_UTMP version: 5 updated: 2001/12/27 12:55:07 dnl ------------ dnl Check if this is a SYSV flavor of UTMP AC_DEFUN([CF_SYSV_UTMP], [ AC_CACHE_CHECK(if $cf_cv_have_utmp is SYSV flavor,cf_cv_sysv_utmp,[ test "$cf_cv_have_utmp" = "utmp" && cf_prefix="ut" || cf_prefix="utx" AC_TRY_LINK([ #include #include <${cf_cv_have_utmp}.h>],[ struct $cf_cv_have_utmp x; set${cf_prefix}ent (); get${cf_prefix}id(&x); put${cf_prefix}line(&x); end${cf_prefix}ent();], [cf_cv_sysv_utmp=yes], [cf_cv_sysv_utmp=no]) ]) test $cf_cv_sysv_utmp = yes && AC_DEFINE(USE_SYSV_UTMP) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SYS_ERRLIST version: 6 updated: 2001/12/30 13:03:23 dnl -------------- dnl Check for declaration of sys_nerr and sys_errlist in one of stdio.h and dnl errno.h. Declaration of sys_errlist on BSD4.4 interferes with our dnl declaration. Reported by Keith Bostic. AC_DEFUN([CF_SYS_ERRLIST], [ CF_CHECK_ERRNO(sys_nerr) CF_CHECK_ERRNO(sys_errlist) ])dnl dnl --------------------------------------------------------------------------- dnl CF_TAR_OPTIONS version: 2 updated: 2005/08/24 20:15:11 dnl -------------- dnl This is just a list of the most common tar options, allowing for variants dnl that can operate with the "-" standard input/output option. AC_DEFUN([CF_TAR_OPTIONS], [ case ifelse($1,,tar,$1) in *pax|*pax$EXEEXT) TAR_UP_OPTIONS="-w" TAR_DOWN_OPTIONS="-r" TAR_PIPE_OPTIONS="" TAR_FILE_OPTIONS="-f" ;; *star|*star$EXEEXT) TAR_UP_OPTIONS="-c -f" TAR_DOWN_OPTIONS="-x -U -f" TAR_PIPE_OPTIONS="-" TAR_FILE_OPTIONS="" ;; *tar|*tar$EXEEXT) # FIXME: some versions of tar require, some don't allow the "-" TAR_UP_OPTIONS="-cf" TAR_DOWN_OPTIONS="-xf" TAR_PIPE_OPTIONS="-" TAR_FILE_OPTIONS="" ;; esac AC_SUBST(TAR_UP_OPTIONS) AC_SUBST(TAR_DOWN_OPTIONS) AC_SUBST(TAR_FILE_OPTIONS) AC_SUBST(TAR_PIPE_OPTIONS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_TERMCAP_LIBS version: 11 updated: 2006/10/28 15:15:38 dnl --------------- dnl Look for termcap libraries, or the equivalent in terminfo. dnl dnl The optional parameter may be "ncurses", "ncursesw". AC_DEFUN([CF_TERMCAP_LIBS], [ AC_CACHE_VAL(cf_cv_termlib,[ cf_cv_termlib=none AC_TRY_LINK([],[char *x=(char*)tgoto("",0,0)], [AC_TRY_LINK([],[int x=tigetstr("")], [cf_cv_termlib=terminfo], [cf_cv_termlib=termcap]) CF_VERBOSE(using functions in predefined $cf_cv_termlib LIBS) ],[ ifelse([$1],,,[ case "$1" in # (vi ncurses*) CF_NCURSES_CONFIG($1) cf_cv_termlib=terminfo ;; esac ]) if test "$cf_cv_termlib" = none; then # FreeBSD's linker gives bogus results for AC_CHECK_LIB, saying that # tgetstr lives in -lcurses when it is only an unsatisfied extern. cf_save_LIBS="$LIBS" for cf_lib in curses ncurses termlib termcap do LIBS="-l$cf_lib $cf_save_LIBS" for cf_func in tigetstr tgetstr do AC_MSG_CHECKING(for $cf_func in -l$cf_lib) AC_TRY_LINK([],[int x=$cf_func("")],[cf_result=yes],[cf_result=no]) AC_MSG_RESULT($cf_result) if test "$cf_result" = yes ; then if test "$cf_func" = tigetstr ; then cf_cv_termlib=terminfo else cf_cv_termlib=termcap fi break fi done test "$cf_result" = yes && break done test "$cf_result" = no && LIBS="$cf_save_LIBS" fi if test "$cf_cv_termlib" = none; then # allow curses library for broken AIX system. AC_CHECK_LIB(curses, initscr, [LIBS="$LIBS -lcurses" cf_cv_termlib=termcap]) AC_CHECK_LIB(termcap, tgoto, [LIBS="$LIBS -ltermcap" cf_cv_termlib=termcap]) fi ]) if test "$cf_cv_termlib" = none; then AC_MSG_WARN([Cannot find -ltermlib, -lcurses, or -ltermcap]) fi ])])dnl dnl --------------------------------------------------------------------------- dnl CF_TERMIO_AND_CURSES version: 3 updated: 2000/12/31 19:47:37 dnl -------------------- dnl Check if including termio.h with dies like on sysv68 dnl FIXME: this is too Lynx-specific AC_DEFUN([CF_TERMIO_AND_CURSES], [ AC_CACHE_CHECK(if we can include termio.h with curses,cf_cv_termio_and_curses,[ cf_save_CFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H -I. -I${srcdir-.} -I${srcdir-.}/src -I${srcdir-.}/WWW/Library/Implementation" touch lynx_cfg.h AC_TRY_COMPILE([ #include <$1> #include ], [putchar(0x0a)], [cf_cv_termio_and_curses=yes], [cf_cv_termio_and_curses=no]) CPPFLAGS="$cf_save_CFLAGS" rm -f lynx_cfg.h ]) test $cf_cv_termio_and_curses = yes && AC_DEFINE(TERMIO_AND_CURSES) ])dnl dnl --------------------------------------------------------------------------- dnl CF_TERMIO_AND_TERMIOS version: 2 updated: 1997/08/28 20:22:00 dnl --------------------- dnl Check if including both termio.h and termios.h die like on DG.UX AC_DEFUN([CF_TERMIO_AND_TERMIOS], [ AC_MSG_CHECKING([termio.h and termios.h]) AC_CACHE_VAL(cf_cv_termio_and_termios,[ AC_TRY_COMPILE([ #if HAVE_TERMIO_H #include #endif #if HAVE_TERMIOS_H #include #endif ], [putchar (0x0a)], [cf_cv_termio_and_termios=yes], [cf_cv_termio_and_termios=no])]) AC_MSG_RESULT($cf_cv_termio_and_termios) test $cf_cv_termio_and_termios = no && AC_DEFINE(TERMIO_AND_TERMIOS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_TERM_HEADER version: 1 updated: 2005/12/31 13:26:39 dnl -------------- dnl Look for term.h, which is part of X/Open curses. It defines the interface dnl to terminfo database. Usually it is in the same include-path as curses.h, dnl but some packagers change this, breaking various applications. AC_DEFUN([CF_TERM_HEADER],[ AC_CACHE_CHECK(for terminfo header, cf_cv_term_header,[ case ${cf_cv_ncurses_header} in #(vi */ncurses.h|*/ncursesw.h) #(vi cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[[^.]]*\.h$%term.h%'` ;; *) cf_term_header=term.h ;; esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do AC_TRY_COMPILE([#include #include <${cf_cv_ncurses_header-curses.h}> #include <$cf_test> ],[int x = auto_left_margin],[ cf_cv_term_header="$cf_test"],[ cf_cv_term_header=unknown ]) test "$cf_cv_term_header" != unknown && break done ]) # Set definitions to allow ifdef'ing to accommodate subdirectories case $cf_cv_term_header in # (vi *term.h) AC_DEFINE(HAVE_TERM_H) ;; esac case $cf_cv_term_header in # (vi ncurses/term.h) #(vi AC_DEFINE(HAVE_NCURSES_TERM_H) ;; ncursesw/term.h) AC_DEFINE(HAVE_NCURSESW_TERM_H) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_TM_GMTOFF version: 2 updated: 1997/08/28 23:57:55 dnl ------------ dnl Check if the tm-struct defines the '.tm_gmtoff' member (useful in decoding dnl dates). AC_DEFUN([CF_TM_GMTOFF], [ AC_MSG_CHECKING([for tm.tm_gmtoff]) AC_CACHE_VAL(cf_cv_tm_gmtoff,[ AC_TRY_COMPILE([ #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif ],[ struct tm foo; long bar = foo.tm_gmtoff], [cf_cv_tm_gmtoff=yes], [cf_cv_tm_gmtoff=no])]) AC_MSG_RESULT($cf_cv_tm_gmtoff) test $cf_cv_tm_gmtoff = no && AC_DEFINE(DONT_HAVE_TM_GMTOFF) ])dnl dnl --------------------------------------------------------------------------- dnl CF_TTYTYPE version: 4 updated: 2002/10/27 18:21:42 dnl ---------- AC_DEFUN([CF_TTYTYPE], [ AC_MSG_CHECKING(if ttytype is declared in curses library) AC_CACHE_VAL(cf_cv_have_ttytype,[ AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>], [char *x = &ttytype[1]; *x = 1], [cf_cv_have_ttytype=yes], [cf_cv_have_ttytype=no]) ]) AC_MSG_RESULT($cf_cv_have_ttytype) test $cf_cv_have_ttytype = yes && AC_DEFINE(HAVE_TTYTYPE) ])dnl dnl --------------------------------------------------------------------------- dnl CF_UNION_WAIT version: 5 updated: 1997/11/23 14:49:44 dnl ------------- dnl Check to see if the BSD-style union wait is declared. Some platforms may dnl use this, though it is deprecated in favor of the 'int' type in Posix. dnl Some vendors provide a bogus implementation that declares union wait, but dnl uses the 'int' type instead; we try to spot these by checking for the dnl associated macros. dnl dnl Ahem. Some implementers cast the status value to an int*, as an attempt to dnl use the macros for either union wait or int. So we do a check compile to dnl see if the macros are defined and apply to an int. dnl dnl Sets: $cf_cv_type_unionwait dnl Defines: HAVE_TYPE_UNIONWAIT AC_DEFUN([CF_UNION_WAIT], [ AC_REQUIRE([CF_WAIT_HEADERS]) AC_MSG_CHECKING([for union wait]) AC_CACHE_VAL(cf_cv_type_unionwait,[ AC_TRY_LINK($cf_wait_headers, [int x; int y = WEXITSTATUS(x); int z = WTERMSIG(x); wait(&x); ], [cf_cv_type_unionwait=no echo compiles ok w/o union wait 1>&AC_FD_CC ],[ AC_TRY_LINK($cf_wait_headers, [union wait x; #ifdef WEXITSTATUS int y = WEXITSTATUS(x); #endif #ifdef WTERMSIG int z = WTERMSIG(x); #endif wait(&x); ], [cf_cv_type_unionwait=yes echo compiles ok with union wait and possibly macros too 1>&AC_FD_CC ], [cf_cv_type_unionwait=no])])]) AC_MSG_RESULT($cf_cv_type_unionwait) test $cf_cv_type_unionwait = yes && AC_DEFINE(HAVE_TYPE_UNIONWAIT) ])dnl dnl --------------------------------------------------------------------------- dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59 dnl -------- dnl Make an uppercase version of a variable dnl $1=uppercase($2) AC_DEFUN([CF_UPPER], [ $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- dnl CF_UTF8_LIB version: 4 updated: 2003/03/01 18:36:42 dnl ----------- dnl Check for multibyte support, and if not found, utf8 compatibility library AC_DEFUN([CF_UTF8_LIB], [ AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[ cf_save_LIBS="$LIBS" AC_TRY_LINK([ #include ],[putwc(0,0);], [cf_cv_utf8_lib=yes], [LIBS="-lutf8 $LIBS" AC_TRY_LINK([ #include ],[putwc(0,0);], [cf_cv_utf8_lib=add-on], [cf_cv_utf8_lib=no]) LIBS="$cf_save_LIBS" ])]) # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between # ncurses/ncursesw: if test "$cf_cv_utf8_lib" = "add-on" ; then AC_DEFINE(HAVE_LIBUTF8_H) LIBS="-lutf8 $LIBS" fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_UTMP version: 9 updated: 2008/01/25 17:18:00 dnl ------- dnl Check for UTMP/UTMPX headers AC_DEFUN([CF_UTMP], [ AC_REQUIRE([CF_LASTLOG]) AC_CACHE_CHECK(for utmp implementation,cf_cv_have_utmp,[ cf_cv_have_utmp=no for cf_header in utmpx utmp ; do cf_utmp_includes=" #include #include <${cf_header}.h> #define getutent getutxent #ifdef USE_LASTLOG #include /* may conflict with utmpx.h on Linux */ #endif " AC_TRY_COMPILE([$cf_utmp_includes], [struct $cf_header x; char *name = x.ut_name; /* utmp.h and compatible definitions */ ], [cf_cv_have_utmp=$cf_header break], [ AC_TRY_COMPILE([$cf_utmp_includes], [struct $cf_header x; char *name = x.ut_user; /* utmpx.h must declare this */ ], [cf_cv_have_utmp=$cf_header break ])]) done ]) if test $cf_cv_have_utmp != no ; then AC_DEFINE(HAVE_UTMP) test $cf_cv_have_utmp = utmpx && AC_DEFINE(UTMPX_FOR_UTMP) CF_UTMP_UT_HOST CF_UTMP_UT_SYSLEN CF_UTMP_UT_NAME CF_UTMP_UT_XSTATUS CF_UTMP_UT_XTIME CF_UTMP_UT_SESSION CF_SYSV_UTMP fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_UTMP_UT_HOST version: 7 updated: 2007/03/13 19:17:11 dnl --------------- dnl Check if UTMP/UTMPX struct defines ut_host member AC_DEFUN([CF_UTMP_UT_HOST], [ if test $cf_cv_have_utmp != no ; then AC_MSG_CHECKING(if ${cf_cv_have_utmp}.ut_host is declared) AC_CACHE_VAL(cf_cv_have_utmp_ut_host,[ AC_TRY_COMPILE([ #include #include <${cf_cv_have_utmp}.h>], [struct $cf_cv_have_utmp x; char *y = &x.ut_host[0]], [cf_cv_have_utmp_ut_host=yes], [cf_cv_have_utmp_ut_host=no]) ]) AC_MSG_RESULT($cf_cv_have_utmp_ut_host) test $cf_cv_have_utmp_ut_host != no && AC_DEFINE(HAVE_UTMP_UT_HOST) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_UTMP_UT_NAME version: 4 updated: 2007/03/13 19:17:11 dnl --------------- dnl Check if UTMP/UTMPX struct defines ut_name member AC_DEFUN([CF_UTMP_UT_NAME], [ if test $cf_cv_have_utmp != no ; then AC_CACHE_CHECK(if ${cf_cv_have_utmp}.ut_name is declared,cf_cv_have_utmp_ut_name,[ cf_cv_have_utmp_ut_name=no cf_utmp_includes=" #include #include <${cf_cv_have_utmp}.h> #define getutent getutxent #ifdef USE_LASTLOG #include /* may conflict with utmpx.h on Linux */ #endif " for cf_header in ut_name ut_user ; do AC_TRY_COMPILE([$cf_utmp_includes], [struct $cf_cv_have_utmp x; char *name = x.$cf_header; ], [cf_cv_have_utmp_ut_name=$cf_header break]) done ]) case $cf_cv_have_utmp_ut_name in #(vi no) #(vi AC_MSG_ERROR(Cannot find declaration for ut.ut_name) ;; ut_user) AC_DEFINE(ut_name,ut_user) ;; esac fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_UTMP_UT_SESSION version: 5 updated: 2007/03/13 19:17:11 dnl ------------------ dnl Check if UTMP/UTMPX struct defines ut_session member AC_DEFUN([CF_UTMP_UT_SESSION], [ if test $cf_cv_have_utmp != no ; then AC_CACHE_CHECK(if ${cf_cv_have_utmp}.ut_session is declared, cf_cv_have_utmp_ut_session,[ AC_TRY_COMPILE([ #include #include <${cf_cv_have_utmp}.h>], [struct $cf_cv_have_utmp x; long y = x.ut_session], [cf_cv_have_utmp_ut_session=yes], [cf_cv_have_utmp_ut_session=no]) ]) if test $cf_cv_have_utmp_ut_session != no ; then AC_DEFINE(HAVE_UTMP_UT_SESSION) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_UTMP_UT_SYSLEN version: 1 updated: 2008/01/25 17:18:00 dnl ----------------- dnl Check if UTMP/UTMPX struct defines ut_syslen member AC_DEFUN([CF_UTMP_UT_SYSLEN], [ if test $cf_cv_have_utmp != no ; then AC_MSG_CHECKING(if ${cf_cv_have_utmp}.ut_syslen is declared) AC_CACHE_VAL(cf_cv_have_utmp_ut_syslen,[ AC_TRY_COMPILE([ #include #include <${cf_cv_have_utmp}.h>], [struct $cf_cv_have_utmp x; int y = x.ut_syslen], [cf_cv_have_utmp_ut_syslen=yes], [cf_cv_have_utmp_ut_syslen=no]) ]) AC_MSG_RESULT($cf_cv_have_utmp_ut_syslen) test $cf_cv_have_utmp_ut_syslen != no && AC_DEFINE(HAVE_UTMP_UT_SYSLEN) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_UTMP_UT_XSTATUS version: 3 updated: 2001/12/27 12:55:07 dnl ------------------ dnl Check for known variants on the UTMP/UTMPX struct's exit-status as reported dnl by various people: dnl dnl ut_exit.__e_exit (HPUX 11 - David Ellement, also in glibc2) dnl ut_exit.e_exit (SVR4) dnl ut_exit.ut_e_exit (os390 - Greg Smith) dnl ut_exit.ut_exit (Tru64 4.0f - Jeremie Petit, 4.0e - Tomas Vanhala) dnl dnl Note: utmp_xstatus is not a conventional compatibility definition in the dnl system header files. AC_DEFUN([CF_UTMP_UT_XSTATUS], [ if test $cf_cv_have_utmp != no ; then AC_CACHE_CHECK(for exit-status in $cf_cv_have_utmp,cf_cv_have_utmp_ut_xstatus,[ for cf_result in \ ut_exit.__e_exit \ ut_exit.e_exit \ ut_exit.ut_e_exit \ ut_exit.ut_exit do AC_TRY_COMPILE([ #include #include <${cf_cv_have_utmp}.h>], [struct $cf_cv_have_utmp x; long y = x.$cf_result = 0], [cf_cv_have_utmp_ut_xstatus=$cf_result break], [cf_cv_have_utmp_ut_xstatus=no]) done ]) if test $cf_cv_have_utmp_ut_xstatus != no ; then AC_DEFINE(HAVE_UTMP_UT_XSTATUS) AC_DEFINE_UNQUOTED(ut_xstatus,$cf_cv_have_utmp_ut_xstatus) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_UTMP_UT_XTIME version: 7 updated: 2007/03/13 19:17:11 dnl ---------------- dnl Check if UTMP/UTMPX struct defines ut_xtime member AC_DEFUN([CF_UTMP_UT_XTIME], [ if test $cf_cv_have_utmp != no ; then AC_CACHE_CHECK(if ${cf_cv_have_utmp}.ut_xtime is declared, cf_cv_have_utmp_ut_xtime,[ AC_TRY_COMPILE([ #include #include <${cf_cv_have_utmp}.h>], [struct $cf_cv_have_utmp x; long y = x.ut_xtime = 0], [cf_cv_have_utmp_ut_xtime=yes], [AC_TRY_COMPILE([ #include #include <${cf_cv_have_utmp}.h>], [struct $cf_cv_have_utmp x; long y = x.ut_tv.tv_sec], [cf_cv_have_utmp_ut_xtime=define], [cf_cv_have_utmp_ut_xtime=no]) ]) ]) if test $cf_cv_have_utmp_ut_xtime != no ; then AC_DEFINE(HAVE_UTMP_UT_XTIME) if test $cf_cv_have_utmp_ut_xtime = define ; then AC_DEFINE(ut_xtime,ut_tv.tv_sec) fi fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_VARARGS version: 3 updated: 1998/12/10 20:06:29 dnl ---------- dnl Check for ANSI stdarg.h vs varargs.h. Note that some systems include dnl within . AC_DEFUN([CF_VARARGS], [ AC_CHECK_HEADERS(stdarg.h varargs.h) AC_MSG_CHECKING(for standard varargs) AC_CACHE_VAL(cf_cv_ansi_varargs,[ AC_TRY_COMPILE([ #if HAVE_STDARG_H #include #else #if HAVE_VARARGS_H #include #endif #endif ], [return 0;} int foo(char *fmt,...){va_list args;va_start(args,fmt);va_end(args)], [cf_cv_ansi_varargs=yes], [cf_cv_ansi_varargs=no]) ]) AC_MSG_RESULT($cf_cv_ansi_varargs) test $cf_cv_ansi_varargs = yes && AC_DEFINE(ANSI_VARARGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 dnl ---------- dnl Use AC_VERBOSE w/o the warnings AC_DEFUN([CF_VERBOSE], [test -n "$verbose" && echo " $1" 1>&AC_FD_MSG CF_MSG_LOG([$1]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WAIT_HEADERS version: 2 updated: 1997/10/21 19:45:33 dnl --------------- dnl Build up an expression $cf_wait_headers with the header files needed to dnl compile against the prototypes for 'wait()', 'waitpid()', etc. Assume it's dnl Posix, which uses and , but allow SVr4 variation dnl with . AC_DEFUN([CF_WAIT_HEADERS], [ AC_HAVE_HEADERS(sys/wait.h) cf_wait_headers="#include " if test $ac_cv_header_sys_wait_h = yes; then cf_wait_headers="$cf_wait_headers #include " else AC_HAVE_HEADERS(wait.h) AC_HAVE_HEADERS(waitstatus.h) if test $ac_cv_header_wait_h = yes; then cf_wait_headers="$cf_wait_headers #include " fi if test $ac_cv_header_waitstatus_h = yes; then cf_wait_headers="$cf_wait_headers #include " fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WIDEC_CURSES version: 3 updated: 2001/11/18 20:52:38 dnl --------------- dnl Check for curses implementations that can handle wide-characters AC_DEFUN([CF_WIDEC_CURSES], [ AC_CACHE_CHECK(if curses supports wide characters,cf_cv_widec_curses,[ AC_TRY_LINK([ #include #include <${cf_cv_ncurses_header-curses.h}>],[ wchar_t temp[2]; wchar_t wch = 'A'; temp[0] = wch; waddnwstr(stdscr, temp, 1); ], [cf_cv_widec_curses=yes], [cf_cv_widec_curses=no]) ]) if test "$cf_cv_widec_curses" = yes ; then AC_DEFINE(WIDEC_CURSES) # This is needed on Tru64 5.0 to declare mbstate_t AC_CACHE_CHECK(if we must include wchar.h to declare mbstate_t,cf_cv_widec_mbstate,[ AC_TRY_COMPILE([ #include #include <${cf_cv_ncurses_header-curses.h}>], [mbstate_t state], [cf_cv_widec_mbstate=no], [AC_TRY_COMPILE([ #include #include #include <${cf_cv_ncurses_header-curses.h}>], [mbstate_t state], [cf_cv_widec_mbstate=yes], [cf_cv_widec_mbstate=unknown])])]) if test "$cf_cv_widec_mbstate" = yes ; then AC_DEFINE(NEED_WCHAR_H) fi if test "$cf_cv_widec_mbstate" != unknown ; then AC_DEFINE(HAVE_MBSTATE_T) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_BZLIB version: 4 updated: 2007/07/29 13:19:54 dnl ------------- dnl Check for libbz2 aka "bzlib" dnl dnl $1 = optional path for headers/library AC_DEFUN([CF_WITH_BZLIB],[ CF_ADD_OPTIONAL_PATH($1) CF_FIND_LINKAGE([ #include #include ],[ BZ2_bzopen("name","mode") ],bz2,,,bzlib) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_CURSES_DIR version: 2 updated: 2002/11/10 14:46:59 dnl ------------------ dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses dnl libraries. AC_DEFUN([CF_WITH_CURSES_DIR],[ AC_ARG_WITH(curses-dir, [ --with-curses-dir=DIR directory in which (n)curses is installed], [CF_PATH_SYNTAX(withval) cf_cv_curses_dir=$withval], [cf_cv_curses_dir=no]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_DBMALLOC version: 6 updated: 2006/12/16 14:24:05 dnl ---------------- dnl Configure-option for dbmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. AC_DEFUN([CF_WITH_DBMALLOC],[ CF_NO_LEAKS_OPTION(dbmalloc, [ --with-dbmalloc test: use Conor Cahill's dbmalloc library], [USE_DBMALLOC]) if test "$with_dbmalloc" = yes ; then AC_CHECK_HEADER(dbmalloc.h, [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse($1,,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_DMALLOC version: 6 updated: 2006/12/16 14:24:05 dnl --------------- dnl Configure-option for dmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. AC_DEFUN([CF_WITH_DMALLOC],[ CF_NO_LEAKS_OPTION(dmalloc, [ --with-dmalloc test: use Gray Watson's dmalloc library], [USE_DMALLOC]) if test "$with_dmalloc" = yes ; then AC_CHECK_HEADER(dmalloc.h, [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse($1,,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_PATH version: 8 updated: 2007/05/13 13:16:35 dnl ------------ dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just dnl defaulting to yes/no. dnl dnl $1 = option name dnl $2 = help-text dnl $3 = environment variable to set dnl $4 = default value, shown in the help-message, must be a constant dnl $5 = default value, if it's an expression & cannot be in the help-message dnl AC_DEFUN([CF_WITH_PATH], [AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),, ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl if ifelse($5,,true,[test -n "$5"]) ; then CF_PATH_SYNTAX(withval) fi $3="$withval" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_ZLIB version: 3 updated: 2007/07/29 13:19:54 dnl ------------ dnl check for libz aka "zlib" AC_DEFUN([CF_WITH_ZLIB],[ CF_ADD_OPTIONAL_PATH($1) CF_FIND_LINKAGE([ #include ],[ gzopen("name","mode") ],z,,,zlib) ])dnl dnl --------------------------------------------------------------------------- dnl CF_XOPEN_CURSES version: 8 updated: 2003/11/07 19:47:46 dnl --------------- dnl Test if we should define X/Open source for curses, needed on Digital Unix dnl 4.x, to see the extended functions, but breaks on IRIX 6.x. dnl dnl The getbegyx() check is needed for HPUX, which omits legacy macros such dnl as getbegy(). The latter is better design, but the former is standard. AC_DEFUN([CF_XOPEN_CURSES], [ AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl AC_CACHE_CHECK(if we must define _XOPEN_SOURCE_EXTENDED,cf_cv_need_xopen_extension,[ AC_TRY_LINK([ #include #include <${cf_cv_ncurses_header-curses.h}>],[ long x = winnstr(stdscr, "", 0); int x1, y1; getbegyx(stdscr, y1, x1)], [cf_cv_need_xopen_extension=no], [AC_TRY_LINK([ #define _XOPEN_SOURCE_EXTENDED #include #include <${cf_cv_ncurses_header-curses.h}>],[ long x = winnstr(stdscr, "", 0); int x1, y1; getbegyx(stdscr, y1, x1)], [cf_cv_need_xopen_extension=yes], [cf_cv_need_xopen_extension=unknown])])]) test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" ])dnl dnl --------------------------------------------------------------------------- dnl CF_XOPEN_SOURCE version: 25 updated: 2007/01/29 18:36:38 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, dnl without losing the common non-POSIX features. dnl dnl Parameters: dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_XOPEN_SOURCE],[ AC_REQUIRE([CF_PROG_CC_U_D]) cf_XOPEN_SOURCE=ifelse($1,,500,$1) cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2) case $host_os in #(vi aix[[45]]*) #(vi CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE" ;; freebsd*) #(vi # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" ;; hpux*) #(vi CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" ;; irix[[56]].*) #(vi CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" ;; linux*|gnu*|k*bsd*-gnu) #(vi CF_GNU_SOURCE ;; mirbsd*) #(vi # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks ;; netbsd*) #(vi # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; osf[[45]]*) #(vi CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" ;; nto-qnx*) #(vi CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE" ;; sco*) #(vi # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; solaris*) #(vi CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" ;; *) AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ AC_TRY_COMPILE([#include ],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_cv_xopen_source=no], [cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" AC_TRY_COMPILE([#include ],[ #ifdef _XOPEN_SOURCE make an error #endif], [cf_cv_xopen_source=no], [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) CPPFLAGS="$cf_save" ]) ]) if test "$cf_cv_xopen_source" != no ; then CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) test "$cf_cv_cc_u_d_options" = yes && \ CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source" fi CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; esac ]) dnl --------------------------------------------------------------------------- dnl CF_X_ATHENA version: 12 updated: 2004/06/15 21:14:41 dnl ----------- dnl Check for Xaw (Athena) libraries dnl dnl Sets $cf_x_athena according to the flavor of Xaw which is used. AC_DEFUN([CF_X_ATHENA], [AC_REQUIRE([CF_X_TOOLKIT]) cf_x_athena=${cf_x_athena-Xaw} AC_MSG_CHECKING(if you want to link with Xaw 3d library) withval= AC_ARG_WITH(Xaw3d, [ --with-Xaw3d link with Xaw 3d library]) if test "$withval" = yes ; then cf_x_athena=Xaw3d AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi AC_MSG_CHECKING(if you want to link with neXT Athena library) withval= AC_ARG_WITH(neXtaw, [ --with-neXtaw link with neXT Athena library]) if test "$withval" = yes ; then cf_x_athena=neXtaw AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi AC_MSG_CHECKING(if you want to link with Athena-Plus library) withval= AC_ARG_WITH(XawPlus, [ --with-XawPlus link with Athena-Plus library]) if test "$withval" = yes ; then cf_x_athena=XawPlus AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi AC_CHECK_LIB(Xext,XextCreateExtension, [LIBS="-lXext $LIBS"]) cf_x_athena_lib="" CF_X_ATHENA_CPPFLAGS($cf_x_athena) CF_X_ATHENA_LIBS($cf_x_athena) ])dnl dnl --------------------------------------------------------------------------- dnl CF_X_ATHENA_CPPFLAGS version: 2 updated: 2002/10/09 20:00:37 dnl -------------------- dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw. AC_DEFUN([CF_X_ATHENA_CPPFLAGS], [ cf_x_athena_root=ifelse($1,,Xaw,$1) cf_x_athena_include="" for cf_path in default \ /usr/contrib/X11R6 \ /usr/contrib/X11R5 \ /usr/lib/X11R5 \ /usr/local do if test -z "$cf_x_athena_include" ; then cf_save="$CPPFLAGS" cf_test=X11/$cf_x_athena_root/SimpleMenu.h if test $cf_path != default ; then CPPFLAGS="-I$cf_path/include $cf_save" AC_MSG_CHECKING(for $cf_test in $cf_path) else AC_MSG_CHECKING(for $cf_test) fi AC_TRY_COMPILE([ #include #include <$cf_test>],[], [cf_result=yes], [cf_result=no]) AC_MSG_RESULT($cf_result) if test "$cf_result" = yes ; then cf_x_athena_include=$cf_path break else CPPFLAGS="$cf_save" fi fi done if test -z "$cf_x_athena_include" ; then AC_MSG_WARN( [Unable to successfully find Athena header files with test program]) elif test "$cf_x_athena_include" != default ; then CPPFLAGS="$CPPFLAGS -I$cf_x_athena_include" fi ]) dnl --------------------------------------------------------------------------- dnl CF_X_ATHENA_LIBS version: 7 updated: 2008/03/23 14:46:03 dnl ---------------- dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw. AC_DEFUN([CF_X_ATHENA_LIBS], [AC_REQUIRE([CF_X_TOOLKIT]) cf_x_athena_root=ifelse($1,,Xaw,$1) cf_x_athena_lib="" for cf_path in default \ /usr/contrib/X11R6 \ /usr/contrib/X11R5 \ /usr/lib/X11R5 \ /usr/local do for cf_lib in \ "-l$cf_x_athena_root -lXmu" \ "-l$cf_x_athena_root -lXpm -lXmu" \ "-l${cf_x_athena_root}_s -lXmu_s" do if test -z "$cf_x_athena_lib" ; then cf_save="$LIBS" cf_test=XawSimpleMenuAddGlobalActions if test $cf_path != default ; then LIBS="-L$cf_path/lib $cf_lib $LIBS" AC_MSG_CHECKING(for $cf_lib in $cf_path) else LIBS="$cf_lib $LIBS" AC_MSG_CHECKING(for $cf_test in $cf_lib) fi AC_TRY_LINK([],[$cf_test()], [cf_result=yes], [cf_result=no]) AC_MSG_RESULT($cf_result) if test "$cf_result" = yes ; then cf_x_athena_lib="$cf_lib" break fi LIBS="$cf_save" fi done done if test -z "$cf_x_athena_lib" ; then AC_MSG_ERROR( [Unable to successfully link Athena library (-l$cf_x_athena_root) with test program]) fi CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena) AC_DEFINE_UNQUOTED($cf_x_athena_LIBS) ]) dnl --------------------------------------------------------------------------- dnl CF_X_TOOLKIT version: 12 updated: 2008/03/23 15:04:54 dnl ------------ dnl Check for X Toolkit libraries dnl AC_DEFUN([CF_X_TOOLKIT], [ AC_REQUIRE([AC_PATH_XTRA]) AC_REQUIRE([CF_CHECK_CACHE]) # SYSTEM_NAME=`echo "$cf_cv_system_name"|tr ' ' -` cf_have_X_LIBS=no LDFLAGS="$X_LIBS $LDFLAGS" CF_CHECK_CFLAGS($X_CFLAGS) AC_CHECK_FUNC(XOpenDisplay,,[ AC_CHECK_LIB(X11,XOpenDisplay, [LIBS="-lX11 $LIBS"],, [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])]) AC_CHECK_FUNC(XtAppInitialize,,[ AC_CHECK_LIB(Xt, XtAppInitialize, [AC_DEFINE(HAVE_LIBXT) cf_have_X_LIBS=Xt LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"],, [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])]) if test $cf_have_X_LIBS = no ; then AC_MSG_WARN( [Unable to successfully link X Toolkit library (-lXt) with test program. You will have to check and add the proper libraries by hand to makefile.]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF__ICONV_BODY version: 2 updated: 2007/07/26 17:35:47 dnl -------------- dnl Test-code needed for iconv compile-checks define([CF__ICONV_BODY],[ iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);] )dnl dnl --------------------------------------------------------------------------- dnl CF__ICONV_HEAD version: 1 updated: 2007/07/26 15:57:03 dnl -------------- dnl Header-files needed for iconv compile-checks define([CF__ICONV_HEAD],[ #include #include ] )dnl dnl --------------------------------------------------------------------------- dnl CF__INTL_BODY version: 1 updated: 2007/07/26 17:35:47 dnl ------------- dnl Test-code needed for libintl compile-checks dnl $1 = parameter 2 from AM_WITH_NLS define([CF__INTL_BODY],[ bindtextdomain ("", ""); return (int) gettext ("") ifelse([$1], need-ngettext, [ + (int) ngettext ("", "", 0)], []) [ + _nl_msg_cat_cntr] ]) dnl --------------------------------------------------------------------------- dnl CF__INTL_HEAD version: 1 updated: 2007/07/26 17:35:47 dnl ------------- dnl Header-files needed for libintl compile-checks define([CF__INTL_HEAD],[ #include extern int _nl_msg_cat_cntr; ])dnl dnl --------------------------------------------------------------------------- dnl CF__SSL_BODY version: 2 updated: 2008/04/13 10:56:06 dnl ------------ dnl Body for test-compile of SSL code. define([CF__SSL_BODY],[ #ifdef USE_GNUTLS_FUNCS gnutls_global_init(); #else SSL_shutdown((SSL *)0) #endif ])dnl dnl --------------------------------------------------------------------------- dnl CF__SSL_HEAD version: 2 updated: 2008/04/13 10:56:06 dnl ------------ dnl Headers for test-compile of SSL code. define([CF__SSL_HEAD],[ #include #if defined(USE_OPENSSL_INCL) #include #elif defined(USE_GNUTLS_FUNCS) #include #elif defined(USE_GNUTLS_INCL) #include #else #include #endif ])dnl dnl --------------------------------------------------------------------------- dnl jm_GLIBC21 version: 3 updated: 2002/10/27 23:21:42 dnl ---------- dnl Inserted as requested by gettext 0.10.40 dnl File from /usr/share/aclocal dnl glibc21.m4 dnl ==================== dnl serial 2 dnl dnl Test for the GNU C Library, version 2.1 or newer. dnl From Bruno Haible. AC_DEFUN([jm_GLIBC21], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, ac_cv_gnu_library_2_1, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2_1=yes, ac_cv_gnu_library_2_1=no) ] ) AC_SUBST(GLIBC21) GLIBC21="$ac_cv_gnu_library_2_1" ] ) streamripper-1.64.6.orig/m4/sr_locale_charset.m40000644000175000017500000000265010125444105017571 0ustar abiabidnl Copyright (C) 2004 Gregory C. Sharp, modified from Xplanet dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl This macro defines "HAVE_LOCALE_CHARSET" if you have dnl the header file and locale_charset() and -lcharset. AC_DEFUN([SR_FIND_LOCALE_CHARSET], [ sr_find_locale_charset=yes if test $am_cv_langinfo_codeset = yes; then sr_find_locale_charset=no fi if test $sr_find_locale_charset = yes; then AC_CHECK_LIB(charset,locale_charset, sr_find_locale_charset=yes, sr_find_locale_charset=no) fi if test $sr_find_locale_charset = yes; then AC_CHECK_DECL([locale_charset], sr_find_locale_charset=yes, sr_find_locale_charset=no, [#include ]) fi if test $sr_find_locale_charset = yes; then AC_DEFINE(HAVE_LOCALE_CHARSET, 1, [Define if you have locale_charset() in .]) LIBCHARSET="-lcharset" AC_SUBST(LIBCHARSET) fi ]) AC_DEFUN([SR_TEST_DECL], [ AC_CHECK_DECL([aspell_mutable_container_add], echo aspell_mutable_container_add found, echo aspell_mutable_container_add not found, [#include ]) ]) streamripper-1.64.6.orig/config.rpath0000755000175000017500000003343410121436024015644 0ustar abiabi#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2002 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a shlibext= host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix3* | aix4* | aix5*) wl='-Wl,' ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6*) wl='-Wl,' ;; linux*) echo '__INTEL_COMPILER' > conftest.$ac_ext if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null then : else # Intel icc wl='-Qoption,ld,' fi ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) if test "x$host_vendor" = xsni; then wl='-LD' else wl='-Wl,' fi ;; esac fi hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then case "$host_os" in aix3* | aix4* | aix5*) # On AIX, the GNU linker is very broken ld_shlibs=no ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac fi if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=yes ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9* | hpux10* | hpux11*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. ;; irix5* | irix6*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) if test "x$host_vendor" = xsno; then hardcode_direct=yes # is this really true??? else hardcode_direct=no # Motorola manual says yes, but my tests say they lie fi ;; sysv4.3*) ;; sysv5*) hardcode_libdir_flag_spec= ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4.2uw2*) hardcode_direct=yes hardcode_minus_L=no ;; sysv5uw7* | unixware7*) ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics libname_spec='lib$name' sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case "$host_os" in aix3*) shlibext=so ;; aix4* | aix5*) shlibext=so ;; amigaos*) shlibext=ixlibrary ;; beos*) shlibext=so ;; bsdi4*) shlibext=so sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" ;; cygwin* | mingw* | pw32*) case $GCC,$host_os in yes,cygwin*) shlibext=dll.a ;; yes,mingw*) shlibext=dll sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` ;; yes,pw32*) shlibext=dll ;; *) shlibext=dll ;; esac ;; darwin* | rhapsody*) shlibext=dylib ;; freebsd1*) ;; freebsd*) shlibext=so ;; gnu*) shlibext=so ;; hpux9* | hpux10* | hpux11*) shlibext=sl ;; irix5* | irix6*) shlibext=so case "$host_os" in irix5*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 ") libsuff= shlibsuff= ;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ;; linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) ;; linux-gnu*) shlibext=so ;; netbsd*) shlibext=so ;; newsos6) shlibext=so ;; openbsd*) shlibext=so ;; os2*) libname_spec='$name' shlibext=dll ;; osf3* | osf4* | osf5*) shlibext=so sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) shlibext=so ;; solaris*) shlibext=so ;; sunos4*) shlibext=so ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) shlibext=so case "$host_vendor" in motorola) sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; uts4*) shlibext=so ;; dgux*) shlibext=so ;; sysv4*MP*) if test -d /usr/nec; then shlibext=so fi ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < at Secunia Research for finding buffer overflows. "bl4" multiple patches: metadata parsing, parse rules, integer overflow of bytes ripped, bitrate display. THANKS (1.62 & 1.63) --------------------- "Chris Rohlf" for finding buffer overflow. "nn" for adding checks on disk full, improved parsing of parse rules file. "Max Mutrix" for fixing two problems with the relay lib and a fix for id3 on 64-bit systems. "Andrew Neitsch" for a patch that parses year and track information from metadata. "Yoav" for a patch to parse streaming Apache headers "capisce" for the improved silence detection algorithm (--xs2 option) THANKS (1.61) --------------------- "ASk" fix id3v2 parsing problem "Ulf Harnhammer" from the Debian Security Audit Project for finding buffer overflows. "John Spray" for $http_proxy patch. "Les Smithson" for -M flag. "Obiguan" for -T flag. "Martin Bockwinkel" for -P flag. "Michael Ablassmeier" help with identifying memory crashes. "Daniel Potts" a nice patch to support relay connections from clients that don't want metadata. "9EUvY5gQPB4=" patch for id3 genre. "bd" for -L flag that creates a relay server pls file. "Albert Bachmann" For new metadata rules which let you choose which files to save or delete. "Daniel Lord" patch for overwriting complete files when bigger. "Chris Pearson" partial fix for overflows using the -M flag. "isverg" a patch for when the default skin is blank in sripper.ini. THANKS (1.60) --------------------- "Mauricio" for fix of http header parsing bug. "Laetitia" for fix of relay skipping bug. "Marcin Garski" for file permissions patch. "Josh Lehan" for multi-client relay patch, fix for port wandering, -m flag for auto-closing connection, and -k flag to avoid saving broken songs after connect. "Mike Frysinger" for a patch to control streaming for multiple ethernet interfaces. "Michael Ablassmeier" for the man page, debian maintenance and other stuff. "darrick" for fixing the CTRL-C bug. THANKS (up to v.1.54) --------------------- Oddsock for his Streamripper32 Win32 version and ID3 addition. Felix for the file counting and date/time directory addition. Mark Lacas for OSX porting. Robin P. Blanchard - FreeBSD compatability Jeff Lexington for the spanish translation. -------------------- If we have forgotten to list you here, or if you don't want to be listed here, contact Greg Sharp . streamripper-1.64.6.orig/Makefile.am0000644000175000017500000002327511146420774015407 0ustar abiabi## Process this file with automake to produce Makefile.in AM_CPPFLAGS = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @GLIB_CFLAGS@ if SUBDIR_LIBMAD MAYBE_LIBMAD = libmad-0.15.1b AM_CPPFLAGS += -I@abs_top_srcdir@/libmad-0.15.1b endif # if SUBDIR_GLIB # MAYBE_GLIB = glib-2.16.6 # AM_CPPFLAGS += -I@abs_top_srcdir@/glib-2.16.6/glib # AM_CPPFLAGS += -I@abs_top_srcdir@/glib-2.16.6 # endif #if SUBDIR_CDK # MAYBE_CDK = cdk-5.0-20060507 #endif AM_CPPFLAGS += -I@abs_top_srcdir@/lib # SUBDIRS = $(MAYBE_LIBMAD) $(MAYBE_CDK) $(MAYBE_GLIB) lib # SUBDIRS = $(MAYBE_LIBMAD) $(MAYBE_CDK) lib SUBDIRS = $(MAYBE_LIBMAD) lib bin_PROGRAMS = streamripper if WANT_CSTREAMRIPPER ## bin_PROGRAMS += cstreamripper endif EXTRA_PROGRAMS = streamripper ictest cstreamripper ictest_SOURCES = \ lib/ictest.c streamripper_SOURCES = \ console/streamripper.c cstreamripper_SOURCES = \ console/cstreamripper.c if USE_INCLUDED_ARGV streamripper_SOURCES += lib/argv.c endif libmad_manifest = \ libmad-0.15.1b/README \ libmad-0.15.1b/configure.ac \ libmad-0.15.1b/aclocal.m4 \ libmad-0.15.1b/mad.h \ libmad-0.15.1b/Makefile.am \ libmad-0.15.1b/Makefile.in \ libmad-0.15.1b/config.h.in \ libmad-0.15.1b/libmad.list.in \ libmad-0.15.1b/configure \ libmad-0.15.1b/COPYING \ libmad-0.15.1b/INSTALL \ libmad-0.15.1b/TODO \ libmad-0.15.1b/config.guess \ libmad-0.15.1b/config.sub \ libmad-0.15.1b/depcomp \ libmad-0.15.1b/install-sh \ libmad-0.15.1b/ltmain.sh \ libmad-0.15.1b/missing \ libmad-0.15.1b/mkinstalldirs \ libmad-0.15.1b/version.c \ libmad-0.15.1b/fixed.c \ libmad-0.15.1b/bit.c \ libmad-0.15.1b/timer.c \ libmad-0.15.1b/stream.c \ libmad-0.15.1b/frame.c \ libmad-0.15.1b/synth.c \ libmad-0.15.1b/decoder.c \ libmad-0.15.1b/layer12.c \ libmad-0.15.1b/layer3.c \ libmad-0.15.1b/huffman.c \ libmad-0.15.1b/version.h \ libmad-0.15.1b/fixed.h \ libmad-0.15.1b/bit.h \ libmad-0.15.1b/timer.h \ libmad-0.15.1b/stream.h \ libmad-0.15.1b/frame.h \ libmad-0.15.1b/synth.h \ libmad-0.15.1b/decoder.h \ libmad-0.15.1b/global.h \ libmad-0.15.1b/layer12.h \ libmad-0.15.1b/layer3.h \ libmad-0.15.1b/huffman.h \ libmad-0.15.1b/D.dat \ libmad-0.15.1b/imdct_s.dat \ libmad-0.15.1b/qc_table.dat \ libmad-0.15.1b/rq_table.dat \ libmad-0.15.1b/sf_table.dat \ libmad-0.15.1b/imdct_l_arm.S \ libmad-0.15.1b/minimad.c \ libmad-0.15.1b/mad.h.sed \ libmad-0.15.1b/CHANGES \ libmad-0.15.1b/COPYRIGHT \ libmad-0.15.1b/CREDITS \ libmad-0.15.1b/VERSION libmad_dont_need_these = \ libmad-0.15.1b/msvc++/Makefile.am \ libmad-0.15.1b/msvc++/Makefile.in \ libmad-0.15.1b/msvc++/mad.h \ libmad-0.15.1b/msvc++/config.h \ libmad-0.15.1b/msvc++/libmad.dsp tre072_manifest = \ tre-0.7.2/m4/tre_prog_cc_optimizations.m4 \ tre-0.7.2/m4/ax_check_sign.m4 \ tre-0.7.2/m4/Makefile.am \ tre-0.7.2/m4/Makefile.in \ tre-0.7.2/m4/vl_prog_cc_warnings.m4 \ tre-0.7.2/m4/ac_libtool_tags.m4 \ tre-0.7.2/m4/ax_decl_wchar_max.m4 \ tre-0.7.2/m4/ax_check_funcs_comp.m4 \ tre-0.7.2/po/Makevars \ tre-0.7.2/po/fi.po \ tre-0.7.2/po/LINGUAS \ tre-0.7.2/po/en@boldquot.header \ tre-0.7.2/po/en@quot.header \ tre-0.7.2/po/Rules-quot \ tre-0.7.2/po/remove-potcdate.sin \ tre-0.7.2/po/boldquot.sed \ tre-0.7.2/po/POTFILES.in \ tre-0.7.2/po/tre.pot \ tre-0.7.2/po/insert-header.sin \ tre-0.7.2/po/quot.sed \ tre-0.7.2/po/Makefile.in.in \ tre-0.7.2/doc/tre-api.html \ tre-0.7.2/doc/default.css \ tre-0.7.2/doc/Makefile.am \ tre-0.7.2/doc/Makefile.in \ tre-0.7.2/doc/agrep.1.in \ tre-0.7.2/doc/tre-syntax.html \ tre-0.7.2/lib/tre-config.h.in \ tre-0.7.2/lib/regex.h \ tre-0.7.2/lib/tre-filter.c \ tre-0.7.2/lib/tre-filter.h \ tre-0.7.2/lib/tre-match-approx.c \ tre-0.7.2/lib/README \ tre-0.7.2/lib/tre-match-utils.h \ tre-0.7.2/lib/xmalloc.c \ tre-0.7.2/lib/xmalloc.h \ tre-0.7.2/lib/tre-parse.c \ tre-0.7.2/lib/tre-parse.h \ tre-0.7.2/lib/tre-match-backtrack.c \ tre-0.7.2/lib/tre-internal.h \ tre-0.7.2/lib/regerror.c \ tre-0.7.2/lib/tre-compile.c \ tre-0.7.2/lib/tre-compile.h \ tre-0.7.2/lib/Makefile.am \ tre-0.7.2/lib/Makefile.in \ tre-0.7.2/lib/tre-match-parallel.c \ tre-0.7.2/lib/gettext.h \ tre-0.7.2/lib/tre-ast.c \ tre-0.7.2/lib/tre-ast.h \ tre-0.7.2/lib/tre-mem.c \ tre-0.7.2/lib/tre-mem.h \ tre-0.7.2/lib/regcomp.c \ tre-0.7.2/lib/regexec.c \ tre-0.7.2/lib/tre-stack.c \ tre-0.7.2/lib/tre-stack.h \ tre-0.7.2/src/Makefile.am \ tre-0.7.2/src/Makefile.in \ tre-0.7.2/src/agrep.c \ tre-0.7.2/NEWS \ tre-0.7.2/TODO \ tre-0.7.2/LICENSE \ tre-0.7.2/aclocal.m4 \ tre-0.7.2/tests/test-str-source.c \ tre-0.7.2/tests/randtest.c \ tre-0.7.2/tests/retest.c \ tre-0.7.2/tests/Makefile.am \ tre-0.7.2/tests/Makefile.in \ tre-0.7.2/tests/build-tests.sh \ tre-0.7.2/tests/bench.c \ tre-0.7.2/utils/compile \ tre-0.7.2/utils/depcomp \ tre-0.7.2/utils/build-rpm.sh \ tre-0.7.2/utils/ltmain.sh \ tre-0.7.2/utils/config.guess \ tre-0.7.2/utils/config.rpath \ tre-0.7.2/utils/install-sh \ tre-0.7.2/utils/autogen.sh \ tre-0.7.2/utils/config.sub \ tre-0.7.2/utils/missing \ tre-0.7.2/utils/mkinstalldirs \ tre-0.7.2/utils/Makefile.am \ tre-0.7.2/utils/Makefile.in \ tre-0.7.2/win32/tre-config.h \ tre-0.7.2/win32/retest.dsp \ tre-0.7.2/win32/config.h \ tre-0.7.2/win32/tre.def \ tre-0.7.2/win32/tre.dsp \ tre-0.7.2/win32/tre.dsw \ tre-0.7.2/README \ tre-0.7.2/THANKS \ tre-0.7.2/configure \ tre-0.7.2/configure.ac \ tre-0.7.2/tre.spec.in \ tre-0.7.2/Makefile.am \ tre-0.7.2/Makefile.in \ tre-0.7.2/config.h.in \ tre-0.7.2/python/example.py \ tre-0.7.2/python/tre-python.c \ tre-0.7.2/python/setup.py \ tre-0.7.2/AUTHORS \ tre-0.7.2/INSTALL \ tre-0.7.2/tre.pc.in \ tre-0.7.2/ABOUT-NLS \ tre-0.7.2/ChangeLog \ tre-0.7.2/COPYING tre070_manifest = \ tre-0.7.0/m4/tre_prog_cc_optimizations.m4 \ tre-0.7.0/m4/ax_check_sign.m4 \ tre-0.7.0/m4/Makefile.am \ tre-0.7.0/m4/Makefile.in \ tre-0.7.0/m4/vl_prog_cc_warnings.m4 \ tre-0.7.0/m4/ac_libtool_tags.m4 \ tre-0.7.0/m4/ax_decl_wchar_max.m4 \ tre-0.7.0/m4/ax_check_funcs_comp.m4 \ tre-0.7.0/po/Makevars \ tre-0.7.0/po/fi.po \ tre-0.7.0/po/LINGUAS \ tre-0.7.0/po/en@boldquot.header \ tre-0.7.0/po/en@quot.header \ tre-0.7.0/po/Rules-quot \ tre-0.7.0/po/remove-potcdate.sin \ tre-0.7.0/po/boldquot.sed \ tre-0.7.0/po/POTFILES.in \ tre-0.7.0/po/fi.gmo \ tre-0.7.0/po/tre.pot \ tre-0.7.0/po/insert-header.sin \ tre-0.7.0/po/stamp-po \ tre-0.7.0/po/quot.sed \ tre-0.7.0/po/Makefile.in.in \ tre-0.7.0/doc/tre-api.html \ tre-0.7.0/doc/tre-syntax.html \ tre-0.7.0/lib/tre-config.h.in \ tre-0.7.0/lib/regex.h \ tre-0.7.0/lib/tre-match-approx.c \ tre-0.7.0/lib/README \ tre-0.7.0/lib/tre-match-utils.h \ tre-0.7.0/lib/xmalloc.c \ tre-0.7.0/lib/xmalloc.h \ tre-0.7.0/lib/tre-match-backtrack.c \ tre-0.7.0/lib/tre-internal.h \ tre-0.7.0/lib/regerror.c \ tre-0.7.0/lib/tre-compile.c \ tre-0.7.0/lib/Makefile.am \ tre-0.7.0/lib/Makefile.in \ tre-0.7.0/lib/tre-match-parallel.c \ tre-0.7.0/lib/gettext.h \ tre-0.7.0/lib/tre-mem.c \ tre-0.7.0/lib/tre-mem.h \ tre-0.7.0/lib/regcomp.c \ tre-0.7.0/lib/regexec.c \ tre-0.7.0/src/Makefile.am \ tre-0.7.0/src/Makefile.in \ tre-0.7.0/src/agrep.c \ tre-0.7.0/NEWS \ tre-0.7.0/TODO \ tre-0.7.0/LICENSE \ tre-0.7.0/aclocal.m4 \ tre-0.7.0/tests/test-str-source.c \ tre-0.7.0/tests/randtest.c \ tre-0.7.0/tests/retest.c \ tre-0.7.0/tests/Makefile.am \ tre-0.7.0/tests/Makefile.in \ tre-0.7.0/tests/bench.c \ tre-0.7.0/tests/test-approx.c \ tre-0.7.0/utils/compile \ tre-0.7.0/utils/depcomp \ tre-0.7.0/utils/build-rpm.sh \ tre-0.7.0/utils/ltmain.sh \ tre-0.7.0/utils/config.guess \ tre-0.7.0/utils/config.rpath \ tre-0.7.0/utils/install-sh \ tre-0.7.0/utils/autogen.sh \ tre-0.7.0/utils/config.sub \ tre-0.7.0/utils/missing \ tre-0.7.0/utils/mkinstalldirs \ tre-0.7.0/utils/Makefile.am \ tre-0.7.0/utils/Makefile.in \ tre-0.7.0/win32/tre-config.h \ tre-0.7.0/win32/retest.dsp \ tre-0.7.0/win32/config.h \ tre-0.7.0/win32/tre.def \ tre-0.7.0/win32/tre.dsp \ tre-0.7.0/win32/tre.dsw \ tre-0.7.0/README \ tre-0.7.0/THANKS \ tre-0.7.0/configure \ tre-0.7.0/configure.ac \ tre-0.7.0/tre.spec.in \ tre-0.7.0/Makefile.am \ tre-0.7.0/Makefile.in \ tre-0.7.0/config.h.in \ tre-0.7.0/python \ tre-0.7.0/python/setup.py.in \ tre-0.7.0/AUTHORS \ tre-0.7.0/INSTALL \ tre-0.7.0/tre.pc.in \ tre-0.7.0/ABOUT-NLS \ tre-0.7.0/ChangeLog \ tre-0.7.0/COPYING man_MANS = \ streamripper.1 lib_manifest = \ lib/Makefile.am \ lib/Makefile.in \ lib/config.h.in \ lib/argv.c \ lib/cbuf2.c \ lib/cbuf2.h \ lib/charmaps.h \ lib/charset.c \ lib/charset.h \ lib/compat.h \ lib/config.h \ lib/confw32.h \ lib/debug.c \ lib/debug.h \ lib/errors.c \ lib/errors.h \ lib/external.c \ lib/external.h \ lib/filelib.c \ lib/filelib.h \ lib/findsep2.c \ lib/findsep.c \ lib/findsep.h \ lib/http.c \ lib/http.h \ lib/iconvert.c \ lib/ictest.c \ lib/list.h \ lib/mchar.c \ lib/mchar.h \ lib/parse.c \ lib/parse.h \ lib/prefs.c \ lib/prefs.h \ lib/relaylib.c \ lib/relaylib.h \ lib/rip_manager.c \ lib/rip_manager.h \ lib/ripaac.c \ lib/ripogg.c \ lib/ripogg.h \ lib/ripstream.c \ lib/ripstream.h \ lib/socklib.c \ lib/socklib.h \ lib/srconfig.h \ lib/srtypes.h \ lib/threadlib.c \ lib/threadlib.h \ lib/uce_dirent.h \ lib/utf8.c \ lib/utf8.h EXTRA_DIST = \ config.rpath \ CHANGES \ parse_rules.txt \ fake_external_metadata.pl \ fetch_external_metadata.pl \ $(lib_manifest) \ $(libmad_manifest) \ $(man_MANS) DIST_SUBDIRS = streamripper_LDADD = \ lib/libstreamripper.a \ @FAAD_LIBS@ \ @LIBMAD@ \ @THREADLIBS@ \ @LTLIBICONV@ @LIBCHARSET@ \ @LIBIBERTY_LIBS@ \ @OGG_LIBS@ @VORBIS_LIBS@ \ @GLIB_LIBS@ # @CDK_LIBS@ cstreamripper_LDADD = \ lib/libstreamripper.a \ @FAAD_LIBS@ \ @LIBMAD@ \ @THREADLIBS@ \ @LTLIBICONV@ @LIBCHARSET@ \ @LIBIBERTY_LIBS@ \ @OGG_LIBS@ @VORBIS_LIBS@ \ @GLIB_LIBS@ # @CDK_LIBS@ ACLOCAL_AMFLAGS = -I m4 streamripper-1.64.6.orig/streamripper.10000644000175000017500000005014611154766765016163 0ustar abiabi.\" Title: streamripper .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 .\" Date: 03/08/2009 .\" Manual: .\" Source: .\" .TH "STREAMRIPPER" "1" "03/08/2009" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .SH "NAME" streamripper \- rip shoutcast radio streams to mp3 files .SH "SYNOPSIS" \fIstreamripper\fR URL [options] .sp .SH "DESCRIPTION" Streamripper records shoutcast and icecast compatible streams, in their native format\&. The following formats are supported: mp3, nsv, aac, and ogg\&. The meta data within the stream are interpreted to determine the beginning and end of each song, and stores the songs on your hard disk as individual files\&. In addition, streamripper includes a relay server for listening to the station while you are recording\&. .sp .SH "OPTIONS" .PP \-h .RS 4 Print help and exit .RE .PP \-v .RS 4 Print version info and quit .RE .PP \-d dir .RS 4 The destination directory .RE Select a different base directory for ripping, just in case you don\'t want to dump tons of mp3\'s into whatever directory your at\&. .PP \-s .RS 4 Don\'t create a directory for each stream .RE Normally streamripper will make a directory with the same name as the stream to place the tracks into, this disables that\&. .PP \-D pattern .RS 4 Use a pattern to format the output file names .RE This option tells streamripper how to form the filenames\&. If \-D is used, the options \-s and \-P will be ignored\&. If the pattern represents an absolute path, the \-d option will also be ignored\&. If both \-D and \-q are specified, \-q will only be used to set the start count if a %q token is included\&. .sp By default the output files are put in a directory that has the same name as the stream, and files are formed from the artist and title\&. But you can override this behavior and create the output files as you like\&. The output file names are generated by substituting tokens with values that depend on the stream, track, or environment\&. The following tokens can be used for substitution\&. .sp .sp .RS 4 .nf %S Stream %A Artist %T Title %a Album %D Date and time (per song) %d Date and time (per execution) %q Sequence number (automatic detection) %Nq Sequence number (starting from number N) %% Percent sign .fi .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br Note On windows you may be required to supply an extra \fI%\fR because the symbol is consumed by the shell\&. Therefore, you would put "%%S/%%A/%%T" instead of "%S/%A/%T"\&. .sp The extension (such as \&.mp3) is appended automatically\&. .sp The tokens %D and %d differ because %D gives a unique timestamp for each song, whereas %d gives a unique timestamp each time streamripper is run\&. .sp The tokens %q and %Nq differ because %q tries to figure out the correct sequence number from the existing files, wherease %Nq does not\&. The N is your starting number\&. For example %32q means start numbering at 32\&. .PP \-r [base port] .RS 4 Create a relay server on base port, defaults to port 8000 .RE Creates a relay server on base port\&. if base port is not specified it defaults to 8000, otherwise whatever you entered for base port\&. Note that if the \-z option is not used, it will keep trying higher ports if the port is unavailable\&. .PP \-R num_conn .RS 4 Maximum connections to relay stream .RE In addition to creating a relay server, you can also control how many clients are allowed to simultaneously connect\&. The default is 1 client, but if you specify the \-R option you can increase this number to clients\&. If is set to 0, the number of connections is limited only by your processor and network speed\&. The \-R option has no effect if \-r was not used to create a relay stream\&. .PP \-z .RS 4 Don\'t scan for free ports if base port is not available .RE Disables the "scan for free port" feature\&. Use it if your paranoid, or don\'t like ports being open\&. .PP \-p url .RS 4 Use HTTP proxy server at .RE If you are behind a proxy server, use the \-p flag to specify its url\&. You can also use the http_proxy environment variable to specify your proxy server\&. .PP \-a [pattern] .RS 4 Rip to single file .RE The default mode of operation is to separate the each track into a separate file\&. But sometimes this is not what you want\&. Sometimes you want the stream recorded to a single (big) file without splitting into tracks\&. The \-a option does this\&. If you use \-a without including the [pattern], a timestamped filename will automatically be used\&. .sp The pattern can be used in a manner similar to the \-D flag, but generally only %S, %q and %d are useful\&. .PP \-A .RS 4 Don\'t create individual tracks .RE The default mode of operation is to create one file for each track\&. But sometimes you don\'t want these files\&. For example, you might prefer a single file (using the \-a option), or you want to use streamripper as a relay (using the \-r option), without creating these files\&. Using the \-A option, the individual files for each track are not created\&. .PP \-o (always | never | larger | version) .RS 4 Overwrite tracks in complete directory .RE When streamripper rips tracks they are put into the incomplete directory until they are finished\&. Normally, they are then moved into the complete directory\&. However, when the track is already there, can use this option to tell streamripper what you want to do\&. There are three choices: always, never, and larger\&. If you don\'t include any of the \-o options on the command line, the default is "\-o larger" for version through 1\&.63\&.4, and "\-o version" starting with 1\&.64\&.5\&. .sp If you use the "\-o never" option, this tells streamripper to never overwrite any existing file in the complete directory\&. .sp If you use the "\-o always" option, this tells streamripper to always overwrite any existing file in the complete directory\&. .sp If you use the "\-o larger" option, this tells streamripper to overwrite an existing file in the complete directory if the newer file is larger\&. .sp If you use the "\-o version" option, this tells streamripper to keep both versions, renaming the existing file\&. .PP \-t .RS 4 Don\'t overwrite tracks in incomplete directory .RE Normally streamripper writes the files in the incomplete directory, and then moves it to the base directory (the complete directory) when it is done\&. If the file with the name of the track already exists in incomplete, it will overwrite the old track\&. When you use the \-t flag, however, this will tell streamripper to backup the existing file in incomplete (appending a version number), and then create the new file\&. .sp This is useful for streams that don\'t have meta\-data\&. Because these streams only have a single file, reconnects will cause overwriting the existing file, which is not desired\&. .PP \-T .RS 4 Truncate completed tracks in incomplete directory .RE When you are not overwriting files in the complete folder, the duplicate files will normally stay in the incomplete folder\&. This option tells streamripper to truncate the files to zero bytes in the incomplete folder if they are a duplicate\&. .PP \-c .RS 4 Don\'t auto\-reconnect .RE Normally streamripper will be very aggressive and try to re\-connect to a dropped stream\&. This option disables this behavior\&. .PP \-l seconds .RS 4 Run for a predetermined length of time, in seconds .RE Usually, streamripper runs until it crashes\&. Or rather, I meant to say that it runs until you kill it, yes, I\'m sure that\'s what I meant\&. But you can instead tell streamripper to run for a certain length of time, and then exit using this flag\&. .PP \-M megabytes .RS 4 Stop ripping after this many megabytes .RE Use this flag to tell streamripper to rip a certain number of megabytes, then stop\&. As of version 1\&.64\&.5, megabytes are defined as 2^20 bytes\&. .PP \-q [start] .RS 4 Add sequence number to output filenames .RE When the files are copied from incomplete to complete, the filename can be prepended with a sequence number (beginning with 0000)\&. This can be used to, for example, show the order that the files were created\&. If desired, a starting count can be used with \-q to begin the sequence at any number you like\&. .PP \-i .RS 4 Don\'t add ID3 tags to output file .RE Mp3 files have two different kinds of header information which describe the contents of the file: ID3V1 and ID3V2\&. By default, only ID3V2 is included in the mp3 files generated by streamripper\&. If you use the option, then neither are included\&. .PP \-\-with\-id3v1 .RS 4 Add ID3V1 tags to output file .RE .PP \-\-without\-id3v2 .RS 4 Don\'t add ID3V2 tags to output file .RE .PP \-k count .RS 4 Specify the number of files to leave in the incomplete directory\&. .RE Usually you start ripping in the middle of the song, so the default is to leave one file in the incomplete\&. But sometimes you want to discard extra tracks generated by a stream, because they are advertisements, the station intro, broken songs, etc\&. Conversely, some streams always start you at the beginning of a complete song\&. In this case, you could specify "\-k 0" to save the first song\&. .PP \-m timeout .RS 4 Timeout to restart connection .RE Some streams will "hang", which means they haven\'t disconnected, but they aren\'t sending any data\&. When this happens, if you used the \-m flag, streamripper will shut down the stream and reconnect after seconds of inactivity\&. .PP \-u useragent .RS 4 Use a different UserAgent than "Streamripper" .RE In the http request, streamripper includes a string that identifies what kind of program is requesting the connection\&. By default it is the string "Streamripper/1\&.x"\&. Here you can decide to identify yourself as a different agent if you like\&. .PP \-w parse_file .RS 4 Use customized parsing rules .RE This tells streamripper to use custom meta\-data parsing rules\&. Without this flag, streamripper will use its built\-in parsing rules\&. .sp There are two cases where you want to do this\&. In the first case, you are using a stream that changes the meta data within a song\&. Usually this is a thank\-you notice or possibly an advertisement for an upcoming show\&. When this happens, the current track will become split into fragments\&. To prevent this, you can tell streamripper to ignore meta\-data\&. .sp The second case you might want to use this is if the artist and title information is sent in an unusual format\&. For example, they might be separated by a comma instead of a hyphen, or there might be an extra advertisement attached to the end of the meta\-data string\&. In this case, you can tell streamripper how it should identify the title, artist, album and track from the metadata string using regular expressions\&. .sp See the file parse_rules\&.txt, which is included in your distribution, for examples of the parse rules\&. .PP \-E external_command .RS 4 Use external command to get track information .RE Some streams do not send artist or title information using metadata, but instead send this information using other means\&. For example, some streams update the current artist and title using html or xml\&. Another example is icecast 1\&.x, which sends metadata through a UDP socket\&. .sp Streamripper can get artist and title information from these kinds of streams using a helper application, specified using the \-E option\&. The helper application works by finding the title and artist, and writing it to stdout\&. Streamripper reads the output of the helper program, and splits the tracks accordingly\&. .sp To help you in creating external commands to use with streamripper, please look at the example file fetch_external_metadata\&.pl, which is included in your distribution\&. .PP \-\-debug .RS 4 Save debugging log .RE This creates a file called "gcs\&.txt" that contains all sorts of debugging information\&. .PP \-\-quiet .RS 4 Quiet operation .RE Don\'t write any text to the console, except error messages .PP \-\-stderr .RS 4 Write output to stderr instead of stdout .RE .PP \-\-xs_silence_length=num .RS 4 Set silence duration .RE The volume must be less than xsd_min_volume for a period of time greater than this\&. .PP \-\-xs_search_window=num:num .RS 4 Set search window duration .RE This is how long to search for the silence\&. 1st number is msec before nominal center, 2nd number is msecs after nominal track change position\&. .PP \-\-xs_offset=num .RS 4 Set offset from center of silence window .RE .PP \-\-xs_padding=num:num .RS 4 Set amount to pad before and after splitpoint\&. The 1st number is the number of msec to add to the end of each song\&. The 2nd number is the number of msec to add to the beginning of each song\&. .RE .PP \-\-xs\-none .RS 4 Don\'t search for silent spot .RE This is a shorthand for the following combination of options: \-\-xs\-search\-window=0:0 \-\-xs\-silence\-lenghth=0 \-\-xs\-offset=0 \-\-xs\-padding=0:0\&. Note, however, that streamripper will still decode the stream in the region near the meta\-data change, in order to split at an exact mp3 frame boundary\&. .PP \-\-xs2 .RS 4 Use capisce\'s new algorithm (Apr 2008) for silence detection\&. .RE .PP \-\-codeset\-filesys=codeset .RS 4 Tells streamripper what codeset to use for the file names when it writes to your hard drive\&. .RE .PP \-\-codeset\-id3=codeset .RS 4 Tells streamripper what codeset to use for the id3 information\&. .RE .PP \-\-codeset\-metadata=codeset .RS 4 Tells streamripper what codeset is being used for metadata in the stream coming from the network\&. .RE .PP \-\-codeset\-relay=codeset .RS 4 Tells streamripper what codeset to use for metadata that it sends to your player on the relay stream\&. .RE .SH "GETTING STARTED" The easiest way to get started is to find the URL of a stream you want to rip, usually I find the URL by loading it up in winamp or xmms and querying for the source URL (right click on the playlist)\&. Once you have the URL you can begin ripping\&. For example: .sp .sp .RS 4 .nf streamripper http://205\&.188\&.245\&.132:8038 .fi .RE .sp .RS 4 .nf .fi .RE This would rip Monkey Radio (as of 1/10/2001), it places the tracks into two directory\'s one called "Monkey Radio" and a sub\-directory "Monkey Radio/incomplete" the incomplete directory is for tracks that streamripper does not know the begging or end of\&. The first and last tracks your rip for instance, would be in incomplete\&. .sp .SH "LISTENING TO THE RELAY" You can listen to the stream while you are ripping by creating a relay server\&. This is done by using the \-r option\&. .sp .sp .RS 4 .nf streamripper http://205\&.188\&.245\&.132:8038 \-r .fi .RE .sp .RS 4 .nf .fi .RE When streamripper starts it will display what port it\'s relaying the stream on\&. It defaults to 8000 but you can choose another port\&. To listen to your relay server, open up XMMS or Winamp and enter your machine name with the port as you would any other stream\&. For example, if you are using the default relay stream, you would want to open up this URL: .sp .sp .RS 4 .nf http://localhost:8000 .fi .RE .sp .RS 4 .nf .fi .RE However, if you are ripping an ogg stream, you usually need to tell the player that the stream is ogg, which can be done by appending "\&.ogg" to the stream URL\&. .sp .sp .RS 4 .nf http://localhost:8000/\&.ogg .fi .RE .sp .RS 4 .nf .fi .RE Similarly, if you want to watch an nsv stream while you rip, you need to tell the player that the stream is nsv, which can be done by appending ";stream\&.nsv" to the URL\&. .sp .sp .RS 4 .nf http://localhost:8000/;stream\&.nsv .fi .RE .SH "SPLITPOINT DETECTION" Streamripper automatically splits tracks based on detection of a silent near the meta interval where the track changes\&. However, this method is imperfect, and sometimes the track splitting occurs is too early or too late\&. These options will fine tune the track splitting capabilities for streams that use cross\-fading, which causes streamripper\'s automatic silence detection routine to fail\&. .sp Various \-\-xs flags can be used to add an offset for streams that have a meta interval that comes too early or too late, to add extra padding to the beginning and end of each song, and to decide where the length of the search window and silence window\&. .sp .SS "Default splitting" The default spitting algorithm is used when no silent point can be found\&. Suppose you have a meta\-int with track change information at the time "mi" (see figure below)\&. .sp If the xs_offset is positive, the track separation point "ts" is later the "mi" point\&. If xs_offset is negative, "ts" is earlier than "mi"\&. Once "ts" is determined, a user\-defined "prepad" and "postpad" are used to determine where the next track begins "ntb", and where the previous track ends "pte"\&. The interval between "ntb" and "pte" will be copied to both songs\&. .sp .sp .RS 4 .nf /mi | | /ts |\-\-\-\-\-\-\-\-\-\-\-| xs_offset | | | /ntb | /pte |\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-| prepad postpad .fi .RE .SS "Silence separation" Splitting based on silence separation is similar to default splitting, only slightly more complex\&. Again, suppose you have a meta\-int with track change information at the time "mi" (see figure below)\&. .sp A search window "search_win" is determined by the xs_offset, pre_sw, and post_sw field\&. The beginning of the search window is at: mi xs_offset \- pre_sw and the end of the search window is at: mi xs_offset + post_sw\&. .sp If there is a silent interval of length "silence_win" within the "search_win", the center of "silence_win" is selected as the track separation point "ts"\&. .sp Once "ts" is determined, a user\-defined "prepad" and "postpad" are used to determine where the next track begins "ntb", and where the previous track ends "pte"\&. The interval between "ntb" and "pte" will be copied to both songs\&. .sp .sp .RS 4 .nf /mi | |\-\-\-\-\-\-\-\-\-\-\-| xs_offset | | ts\e | |\-\-\-\-\-\-\-+\-|\-\-\-\-\-\-\-\-\-| *search_win pre_sw | post_sw | |\-\-\-+\-\-\-| *silence_win | /ntb | /pte |\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-| prepad postpad .fi .RE .SH "USAGE EXAMPLES" Rip from a stream: .sp .sp .RS 4 .nf streamripper URL .fi .RE .sp .RS 4 .nf .fi .RE Rip from a stream for one hour: .sp .sp .RS 4 .nf streamripper URL \-l 3600 .fi .RE .sp .RS 4 .nf .fi .RE Rip the stream, putting the mp3 files into the directory /my/music/stream1: .sp .sp .RS 4 .nf streamripper URL \-d /my/music/stream1 \-s .fi .RE .sp .RS 4 .nf .fi .RE Rip the stream, creating a single file and don\'t create individual tracks: .sp .sp .RS 4 .nf streamripper URL \-a \-A .fi .RE .sp .RS 4 .nf .fi .RE Rip from a stream and create a relay stream at port 9000: .sp .sp .RS 4 .nf streamripper URL \-r 9000 .fi .RE .sp .RS 4 .nf .fi .RE Rip from a stream, creating a relay stream at port 8000, and allowing twenty clients to connect: .sp .sp .RS 4 .nf streamripper URL \-r \-R 20 .fi .RE .SH "SPLITPOINT USAGE EXAMPLES" Each of my songs contain about 5 seconds of the previous song\&. How can I fix this? .sp .sp .RS 4 .nf streamripper URL \-\-xs_offset=5000 .fi .RE .sp .RS 4 .nf .fi .RE Each of my songs contain about 5 seconds of the next song\&. How can I fix? .sp .sp .RS 4 .nf streamripper URL \-\-xs_offset=\-5000 .fi .RE .sp .RS 4 .nf .fi .RE Each of my songs contain between 5 and 10 seconds of the previous song, but it depends on the song\&. How can I include all of this zone within both songs, and edit them later? .sp .sp .RS 4 .nf streamripper URL \-\-xs_offset=7500 \-\-xs_padding=2500:2500 .fi .RE .SH "RESOURCES" Please check out the following web sites\&. Linked to the streamripper home page is a forum that can can be used to chat and ask questions\&. .PP Streamripper home page: .RS 4 http://streamripper\&.sourceforge\&.net/ .RE .PP Sourceforge project page .RS 4 http://sourceforge\&.net/projects/streamripper .RE .PP Shoutcast .RS 4 http://www\&.shoutcast\&.com .RE .PP Icecast .RS 4 http://www\&.icecast\&.org .RE .SH "COPYING" Copyright \(co 2000\-2002 Jon Clegg, \(co 2004\-2009 Gregory C\&. Sharp\&. Free use of this software is granted under the terms of the GNU General Public License (GPL)\&. .sp streamripper-1.64.6.orig/ltmain.sh0000644000175000017500000032554307472606712015203 0ustar abiabi# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun ltconfig. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then echo "$modename: not configured to build any kind of library" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" # Parse our command line options once, thoroughly. while test $# -gt 0 do arg="$1" shift case "$arg" in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case "$prev" in execute_dlfiles) eval "$prev=\"\$$prev \$arg\"" ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case "$arg" in --help) show_help=yes ;; --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" exit 0 ;; --config) sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0 exit 0 ;; --debug) echo "$progname: enabling shell trace mode" set -x ;; --dry-run | -n) run=: ;; --features) echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit 0 ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --quiet | --silent) show=: ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit 1 ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then case "$nonopt" in *cc | *++ | gcc* | *-gcc*) mode=link for arg do case "$arg" in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit 1 fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case "$mode" in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= lastarg= srcfile="$nonopt" suppress_output= user_target=no for arg do # Accept any command-line options. case "$arg" in -o) if test "$user_target" != "no"; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi user_target=next ;; -static) build_old_libs=yes continue ;; esac case "$user_target" in next) # The next one is the -o target name user_target=yes continue ;; yes) # We got the output file user_target=set libobj="$arg" continue ;; esac # Accept the current argument as the source file. lastarg="$srcfile" srcfile="$arg" # Aesthetically quote the previous argument. # Backslashify any backslashes, double quotes, and dollar signs. # These are the only characters that are still specially # interpreted inside of double-quoted scrings. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly in scan # sets, so we specify it separately. case "$lastarg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) lastarg="\"$lastarg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi done case "$user_target" in set) ;; no) # Get the name of the library object. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; *) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSfmso]' case "$libobj" in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case "$libobj" in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit 1 ;; esac if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit 1 fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $libobj" else removelist="$libobj" fi $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until ln "$0" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $pic_flag -DPIC $srcfile" if test "$build_old_libs" = yes; then lo_libobj="$libobj" dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$libobj"; then dir="$objdir" else dir="$dir/$objdir" fi libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` if test -d "$dir"; then $show "$rm $libobj" $run $rm $libobj else $show "$mkdir $dir" $run $mkdir $dir status=$? if test $status -ne 0 && test ! -d $dir; then exit $status fi fi fi if test "$compiler_o_lo" = yes; then output_obj="$libobj" command="$command -o $output_obj" elif test "$compiler_c_o" = yes; then output_obj="$obj" command="$command -o $output_obj" fi $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else test -n "$output_obj" && $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed, then go on to compile the next one if test x"$output_obj" != x"$libobj"; then $show "$mv $output_obj $libobj" if $run $mv $output_obj $libobj; then : else error=$? $run $rm $removelist exit $error fi fi # If we have no pic_flag, then copy the object into place and finish. if test -z "$pic_flag" && test "$build_old_libs" = yes; then # Rename the .lo from within objdir to obj if test -f $obj; then $show $rm $obj $run $rm $obj fi $show "$mv $libobj $obj" if $run $mv $libobj $obj; then : else error=$? $run $rm $removelist exit $error fi # Now arrange that obj and lo_libobj become the same file $show "$LN_S $obj $lo_libobj" if $run $LN_S $obj $lo_libobj; then exit 0 else error=$? $run $rm $removelist exit $error fi fi # Allow error messages only from the first compilation. suppress_output=' >/dev/null 2>&1' fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then command="$base_compile $srcfile" if test "$compiler_c_o" = yes; then command="$command -o $obj" output_obj="$obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed if test x"$output_obj" != x"$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Create an invalid libtool object if no PIC, so that we do not # accidentally link it into a program. if test "$build_libtool_libs" != yes; then $show "echo timestamp > $libobj" $run eval "echo timestamp > \$libobj" || exit $? else # Move the .lo from within objdir $show "$mv $libobj $lo_libobj" if $run $mv $libobj $lo_libobj; then : else error=$? $run $rm $removelist exit $error fi fi fi # Unlock the critical section if it was locked if test "$need_locks" != no; then $rm "$lockfile" fi exit 0 ;; # libtool link mode link) modename="$modename: link" C_compiler="$CC" # save it, to compile generated C sources CC="$nonopt" case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invokation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes # This is a source program that is used to create dlls on Windows # Don't remove nor modify the starting and closing comments # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ # This is a source program that is used to create import libraries # on Windows for dlls which lack them. Don't remove nor modify the # starting and closing comments # /* impgen.c starts here */ # /* Copyright (C) 1999 Free Software Foundation, Inc. # # This file is part of GNU libtool. # # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # */ # # #include /* for printf() */ # #include /* for open(), lseek(), read() */ # #include /* for O_RDONLY, O_BINARY */ # #include /* for strdup() */ # # static unsigned int # pe_get16 (fd, offset) # int fd; # int offset; # { # unsigned char b[2]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 2); # return b[0] + (b[1]<<8); # } # # static unsigned int # pe_get32 (fd, offset) # int fd; # int offset; # { # unsigned char b[4]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 4); # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # static unsigned int # pe_as32 (ptr) # void *ptr; # { # unsigned char *b = ptr; # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # int # main (argc, argv) # int argc; # char *argv[]; # { # int dll; # unsigned long pe_header_offset, opthdr_ofs, num_entries, i; # unsigned long export_rva, export_size, nsections, secptr, expptr; # unsigned long name_rvas, nexp; # unsigned char *expdata, *erva; # char *filename, *dll_name; # # filename = argv[1]; # # dll = open(filename, O_RDONLY|O_BINARY); # if (!dll) # return 1; # # dll_name = filename; # # for (i=0; filename[i]; i++) # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') # dll_name = filename + i +1; # # pe_header_offset = pe_get32 (dll, 0x3c); # opthdr_ofs = pe_header_offset + 4 + 20; # num_entries = pe_get32 (dll, opthdr_ofs + 92); # # if (num_entries < 1) /* no exports */ # return 1; # # export_rva = pe_get32 (dll, opthdr_ofs + 96); # export_size = pe_get32 (dll, opthdr_ofs + 100); # nsections = pe_get16 (dll, pe_header_offset + 4 +2); # secptr = (pe_header_offset + 4 + 20 + # pe_get16 (dll, pe_header_offset + 4 + 16)); # # expptr = 0; # for (i = 0; i < nsections; i++) # { # char sname[8]; # unsigned long secptr1 = secptr + 40 * i; # unsigned long vaddr = pe_get32 (dll, secptr1 + 12); # unsigned long vsize = pe_get32 (dll, secptr1 + 16); # unsigned long fptr = pe_get32 (dll, secptr1 + 20); # lseek(dll, secptr1, SEEK_SET); # read(dll, sname, 8); # if (vaddr <= export_rva && vaddr+vsize > export_rva) # { # expptr = fptr + (export_rva - vaddr); # if (export_rva + export_size > vaddr + vsize) # export_size = vsize - (export_rva - vaddr); # break; # } # } # # expdata = (unsigned char*)malloc(export_size); # lseek (dll, expptr, SEEK_SET); # read (dll, expdata, export_size); # erva = expdata - export_rva; # # nexp = pe_as32 (expdata+24); # name_rvas = pe_as32 (expdata+32); # # printf ("EXPORTS\n"); # for (i = 0; i&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test $# -gt 0; do arg="$1" shift # If the previous option needs an argument, assign it. if test -n "$prev"; then case "$prev" in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case "$prev" in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case "$arg" in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit 1 fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case "$arg" in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi prevarg="$arg" case "$arg" in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: not more than one -exported-symbols argument allowed" exit 1 fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case "$dir" in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 absdir="$dir" fi dir="$absdir" ;; esac case " $deplibs " in *" $arg "*) ;; *) deplibs="$deplibs $arg";; esac case " $lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir";; esac case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2*) dllsearchdir=`cd "$dir" && pwd || echo "$dir"` case ":$dllsearchpath:" in ::) dllsearchpath="$dllsearchdir";; *":$dllsearchdir:"*) ;; *) dllsearchpath="$dllsearchpath:$dllsearchdir";; esac ;; esac ;; -l*) if test "$arg" = "-lc"; then case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) # These systems don't actually have c library (as such) continue ;; esac elif test "$arg" = "-lm"; then case "$host" in *-*-cygwin* | *-*-beos*) # These systems don't actually have math library (as such) continue ;; esac fi deplibs="$deplibs $arg" ;; -module) module=yes continue ;; -no-undefined) allow_undefined=no continue ;; -o) prev=output ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case "$dir" in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # If we have no pic_flag, then this is the same as -all-static. if test -z "$pic_flag" && test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac ;; *.o | *.obj | *.a | *.lib) # A standard object. objs="$objs $arg" ;; *.lo) # A library object. if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` prev= fi libobjs="$libobjs $arg" ;; *.la) # A libtool-controlled library. dlname= libdir= library_names= old_library= # Check to see that this really is a libtool archive. if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2 exit 1 fi # If the library was installed with an old release of libtool, # it will not redefine variable installed. installed=yes # Read the .la file # If there is no directory component, then add one. case "$arg" in */* | *\\*) . $arg ;; *) . ./$arg ;; esac # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$arg'" 1>&2 exit 1 fi # Find the relevant object directory and library name. name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'` if test "X$installed" = Xyes; then dir="$libdir" else dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$arg"; then dir="$objdir" else dir="$dir/$objdir" fi fi if test -n "$dependency_libs"; then # Extract -R and -L from dependency_libs temp_deplibs= for deplib in $dependency_libs; do case "$deplib" in -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'` case " $rpath $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; -L*) case "$compile_command $temp_deplibs " in *" $deplib "*) ;; *) temp_deplibs="$temp_deplibs $deplib";; esac temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'` case " $lib_search_path " in *" $temp_dir "*) ;; *) lib_search_path="$lib_search_path $temp_dir";; esac ;; *) temp_deplibs="$temp_deplibs $deplib";; esac done dependency_libs="$temp_deplibs" fi if test -z "$libdir"; then # It is a libtool convenience library, so add in its objects. convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$deplibs$dependency_libs" compile_command="$compile_command $dir/$old_library$dependency_libs" finalize_command="$finalize_command $dir/$old_library$dependency_libs" continue fi # This library was specified with -dlopen. if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking statically, # we need to preload. prev=dlprefiles else # We should not create a dependency on this library, but we # may need any libraries it requires. compile_command="$compile_command$dependency_libs" finalize_command="$finalize_command$dependency_libs" prev= continue fi fi # The library was specified with -dlpreopen. if test "$prev" = dlprefiles; then # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then dlprefiles="$dlprefiles $dir/$old_library" else dlprefiles="$dlprefiles $dir/$linklib" fi prev= fi if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then link_against_libtool_libs="$link_against_libtool_libs $arg" if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi # We need an absolute path. case "$dir" in [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 absdir="$dir" fi ;; esac # This is the magic to use -rpath. # Skip directories that are in the system default run-time # search path, unless they have been requested with -R. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac lib_linked=yes case "$hardcode_action" in immediate | unsupported) if test "$hardcode_direct" = no; then compile_command="$compile_command $dir/$linklib" deplibs="$deplibs $dir/$linklib" case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2*) dllsearchdir=`cd "$dir" && pwd || echo "$dir"` if test -n "$dllsearchpath"; then dllsearchpath="$dllsearchpath:$dllsearchdir" else dllsearchpath="$dllsearchdir" fi ;; esac elif test "$hardcode_minus_L" = no; then case "$host" in *-*-sunos*) compile_shlibpath="$compile_shlibpath$dir:" ;; esac case "$compile_command " in *" -L$dir "*) ;; *) compile_command="$compile_command -L$dir";; esac compile_command="$compile_command -l$name" deplibs="$deplibs -L$dir -l$name" elif test "$hardcode_shlibpath_var" = no; then case ":$compile_shlibpath:" in *":$dir:"*) ;; *) compile_shlibpath="$compile_shlibpath$dir:";; esac compile_command="$compile_command -l$name" deplibs="$deplibs -l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then compile_command="$compile_command $absdir/$linklib" deplibs="$deplibs $absdir/$linklib" elif test "$hardcode_minus_L" = yes; then case "$compile_command " in *" -L$absdir "*) ;; *) compile_command="$compile_command -L$absdir";; esac compile_command="$compile_command -l$name" deplibs="$deplibs -L$absdir -l$name" elif test "$hardcode_shlibpath_var" = yes; then case ":$compile_shlibpath:" in *":$absdir:"*) ;; *) compile_shlibpath="$compile_shlibpath$absdir:";; esac compile_command="$compile_command -l$name" deplibs="$deplibs -l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit 1 fi # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then finalize_command="$finalize_command $libdir/$linklib" elif test "$hardcode_minus_L" = yes; then case "$finalize_command " in *" -L$libdir "*) ;; *) finalize_command="$finalize_command -L$libdir";; esac finalize_command="$finalize_command -l$name" elif test "$hardcode_shlibpath_var" = yes; then case ":$finalize_shlibpath:" in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:";; esac finalize_command="$finalize_command -l$name" else # We cannot seem to hardcode it, guess we'll fake it. case "$finalize_command " in *" -L$dir "*) ;; *) finalize_command="$finalize_command -L$libdir";; esac finalize_command="$finalize_command -l$name" fi else # Transform directly to old archives if we don't build new libraries. if test -n "$pic_flag" && test -z "$old_library"; then $echo "$modename: cannot find static library for \`$arg'" 1>&2 exit 1 fi # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_command="$compile_command $dir/$linklib" finalize_command="$finalize_command $dir/$linklib" else case "$compile_command " in *" -L$dir "*) ;; *) compile_command="$compile_command -L$dir";; esac compile_command="$compile_command -l$name" case "$finalize_command " in *" -L$dir "*) ;; *) finalize_command="$finalize_command -L$dir";; esac finalize_command="$finalize_command -l$name" fi fi # Add in any libraries that this one depends upon. compile_command="$compile_command$dependency_libs" finalize_command="$finalize_command$dependency_libs" continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac ;; esac # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" case "$output" in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; *.a | *.lib) if test -n "$link_against_libtool_libs"; then $echo "$modename: error: cannot link libtool libraries into archives" 1>&2 exit 1 fi if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" ;; *.la) # Make sure we only generate libraries of the form `libNAME.la'. case "$outputname" in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi if test -n "$objs"; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 exit 1 fi # How the heck are we supposed to write a wrapper for a shared library? if test -n "$link_against_libtool_libs"; then $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2 exit 1 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test $# -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. libext=al oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi dependency_libs="$deplibs" if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit 1 fi current="$2" revision="$3" age="$4" # Check that each of the things are valid numbers. case "$current" in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case "$revision" in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case "$age" in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac if test $age -gt $current; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 fi # Calculate the version variables. major= versuffix= verstring= case "$version_type" in none) ;; irix) major=`expr $current - $age + 1` versuffix="$major.$revision" verstring="sgi$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test $loop != 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="sgi$major.$iface:$verstring" done ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test $loop != 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; windows) # Like Linux, but with '-' rather than '.', since we only # want one extension on Windows 95. major=`expr $current - $age` versuffix="-$major-$age-$revision" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= verstring="0.0" if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi dependency_libs="$deplibs" case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *) # Add libc to deplibs on all other systems. deplibs="$deplibs -lc" ;; esac fi # Create the output directory, or remove our outputs if we need to. if test -d $output_objdir; then $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* else $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi if test "$build_libtool_libs" = yes; then # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case "$deplibs_check_method" in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behaviour. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | sed 's/.* -> //'` case "$potliblink" in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | sed 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: This library needs some functionality provided by $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | grep . >/dev/null; then echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" echo "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Ensure that we have .o objects for linkers which dislike .lo # (e.g. aix) incase we are running --disable-static for obj in $libobjs; do oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"` if test ! -f $oldobj; then $show "${LN_S} $obj $oldobj" $run ${LN_S} $obj $oldobj || exit $? fi done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols eval cmds=\"$export_symbols_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case "$xlib" in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linkopts="$linkopts $flag" fi # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else eval cmds=\"$archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; *.lo | *.o | *.obj) if test -n "$link_against_libtool_libs"; then $echo "$modename: error: cannot link libtool libraries into objects" 1>&2 exit 1 fi if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case "$output" in *.lo) if test -n "$objs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case "$xlib" in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" output="$obj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "echo timestamp > $libobj" $run eval "echo timestamp > $libobj" || exit $? exit 0 fi if test -n "$pic_flag"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" else # Just create a symlink. $show $rm $libobj $run $rm $libobj $show "$LN_S $obj $libobj" $run $LN_S $obj $libobj || exit $? fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 ;; # Anything else should be a program. *) if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$compile_rpath " in *" $libdir "*) ;; *) compile_rpath="$compile_rpath $libdir" ;; esac case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the binary in the object directory, then wrap it. if test ! -d $output_objdir; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi fi if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case "$dlsyms" in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`echo "$arg" | sed -e 's%^.*/%%'` $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = {\ " sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr_t) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case "$host" in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit 1 ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case "$dir" in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case "$0" in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`echo $output|sed 's,.exe$,,'` ;; esac $rm $output trap "$rm $output; exit 1" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: link_against_libtool_libs='$link_against_libtool_libs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then echo >> $output "\ program=lt-'$outputname' progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if (cd \"\$thisdir\" && eval \$relink_command); then : else $rm \"\$progdir/\$file\" exit 1 fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else echo >> $output "\ program='$outputname$exeext' progdir=\"\$thisdir/$objdir\" " fi echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in *-*-cygwin* | *-*-mingw | *-*-os2*) # win32 systems need to use the prog path for dll # lookup to work $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ # Export the path to the program. PATH=\"\$progdir:\$PATH\" export PATH exec \$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " chmod +x $output fi exit 0 ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case "$xlib" in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else # Ensure that we have .o objects in place incase we decided # not to build a shared library, and have fallen back to building # static libs even though --disable-static was passed! for oldobj in $oldobjs; do if test ! -f $oldobj; then obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"` $show "${LN_S} $obj $oldobj" $run ${LN_S} $obj $oldobj || exit $? fi done eval cmds=\"$old_archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case "$output" in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" if test -n "$xrpath"; then temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" done dependency_libs="$temp_xrpath $dependency_libs" fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i fi $rm $output $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$dlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Directory that this library needs to be installed in: libdir='$install_libdir'\ " done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $? ;; esac exit 0 ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case "$arg" in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit 1 fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test $# -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 fi fi case "$destdir" in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case "$file" in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case "$file" in *.a | *.lib) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi library_names= old_library= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/" test "X$dir" = "X$file/" && dir= dir="$dir$objdir" # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift # Install the shared library and build the symlinks. $show "$install_prog$stripme $dir/$realname $destdir/$realname" $run eval "$install_prog$stripme $dir/$realname $destdir/$realname" || exit $? if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case "$destfile" in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.o | *.obj) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit 0 ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then link_against_libtool_libs= relink_command= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Check the variables that should have been set. if test -z "$link_against_libtool_libs"; then $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 exit 1 fi finalize=yes for lib in $link_against_libtool_libs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case "$lib" in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`" if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec $SHELL $0 --finish$current_libdirs exit 1 fi exit 0 ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. eval cmds=\"$finish_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do echo " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" echo "more information, such as the ld(1) and ld.so(8) manual pages." echo "----------------------------------------------------------------------" exit 0 ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit 1 fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit 1 fi dir= case "$file" in *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit 1 fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case "$file" in -*) ;; *) # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then # Export the shlibpath_var. eval "export $shlibpath_var" # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now actually exec the command. eval "exec \$cmd$args" $echo "$modename: cannot exec \$cmd$args" exit 1 else # Display what would be done. eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" $echo "$cmd$args" exit 0 fi ;; # libtool uninstall mode uninstall) modename="$modename: uninstall" rm="$nonopt" files= for arg do case "$arg" in -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit 1 fi for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` rmfiles="$file" case "$name" in *.la) # Possibly a libtool archive, so verify it. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $dir/$n" done test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" $show "$rm $rmfiles" $run $rm $rmfiles if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. eval cmds=\"$old_postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi ;; *.lo) if test "$build_old_libs" = yes; then oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` rmfiles="$rmfiles $dir/$oldobj" fi $show "$rm $rmfiles" $run $rm $rmfiles ;; *) $show "$rm $rmfiles" $run $rm $rmfiles ;; esac done exit 0 ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit 1 ;; esac $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit 1 fi # test -z "$show_help" # We need to display help for each of the modes. case "$mode" in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --version print version information MODE must be one of the following: compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE." exit 0 ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac echo $echo "Try \`$modename --help' for more information about other modes." exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: streamripper-1.64.6.orig/CHANGES0000644000175000017500000005455211164266574014356 0ustar abiabiNew for 1.64.6 ------------------------------------ Mon Mar 30 21:10:13 EDT 2009 * Fix bug which creates corrupted id3v2 tags * Remove trailing periods for stream name New for 1.64.5 ------------------------------------ Sun Mar 8 12:08:15 EDT 2009 * Change default values for - localhost from "localhost" to "127.0.0.1" - splitpoint padding from 300 ms to 0 ms - metadata and relay codeset (if UTF-8) to ISO-8859-1 - id3 codeset to UTF-16 - "keep files in incomplete" from false to true * Fix parse rules to properly tag artists with "-" in their name (#540543) * Fix bitrate & metadata reporting in console (#1957248) * Fix integer overflow on bytes read (#1261305) * Option for stopping based on megabytes ripped now uses MiB instead of MB * Support splitting based on empty StreamTitle= strings 2648664 New for 1.64.4 ------------------------------------ Mon Feb 16 21:27:29 EST 2009 * Fix problem where corrupt ogg files are being created * Robustify metadata parsing for Limecast servers * Fix buffer overflow bug with substitution rules (#2492422) * Fix file creation bug when "/" is in stream name (#2533980) * Disable creating cue file for ogg streams * Fix problem skipping extra track on ogg streams New for 1.64.3 ------------------------------------ Sun Dec 28 20:14:14 EST 2008 * Windows: Fix socket timeout problem * Fix bug where ogg streams with repeated metadata were being split (#1804582,1953084) New for 1.64.2 ------------------------------------ Mon, Dec 22, 2008 * Windows: Fix packaging error (missing dll) New for 1.64.1 ------------------------------------ Sat, Dec 13, 2008 * Plugin: Streamripper can now load zipped skins * Plugin: Streamripper skins can be (slightly) configured to use different image regions. This fixes the "extra pixel" bug. * Streamripper again skips leading dots "." when making files & directories * Fix problem with control characters in metadata * Fix crash when splitting without padding and without search window * Workaround problem with ogg streams which don't send any metadata * Streamripper now respects user timeout in more situations * Add --xs-none option New for 1.64.0 ------------------------------------ Wed Nov 19 09:00:06 EST 2008 * Security patch for CVE-2008-4829, multiple buffer overflows in http.c that could result in remote exploit * Fix winamp plugin failure when requested skin (from prefs file) does not exist New for 1.64.0-beta-2 (windows only) ------------------------------------ Sat 10-25-2008 * Patch glib 2.16 to support win9x * Fix a memory leak in PCRE parsing New for 1.64.0-beta-1 (unix only) --------------------------------- Sun Oct 12 23:03:39 EDT 2008 * Transition from TRE (or native regex) to glib PCRE * Update windows glib version to custom build of 2.16.5 * Add Florian Stoehr's patch for better http header compatibility * Fix erroneous display of -68 error on unix * Better character substitution for invalid charset conversions New for 1.63.5 -------------- Sun Jun 15 17:11:42 EDT 2008 * Add "-o version" option to keep multiple versions of completed files (#1795423 and #1294878) * The new default overwriting behavior is "-o version" * Showfiles are now versioned rather than being silently overwritten * Plugin: fix crash clicking on RLY button before stream is loaded * Fix problem ripping mp3 streams which have a URL that ends in ".ogg" * Fix build problem for libmad-0.15.1b on gcc 4.3 New for 1.63.4 -------------- Sunday, June 1, 2008 * Fix problem where invalid metadata characters caused metadata to be lost * Windows: fix problem saving prefs file in paths with non-ascii characters * Usage information is now sent to stdout instead of stderr * Probable fix for bug where http_proxy is not respected New for 1.63.3 -------------- Saturday, May 24, 2008 * Fix bug where a single byte was written to both files when splitting aac or nsv streams * Plugin: add dialog box for manually loading the URL New for 1.63.2 -------------- Sunday, May 18, 2008 * Plugin: send icyx:// URLs from winamp to wstreamripper New for 1.63.1 -------------- Sun May 4 13:42:27 EDT 2008 * Fix bug where redirected URLs with text/html were not being redirected * Fix bug with command line parsing (-A, -c, -s, -z) New for 1.63.0 -------------- Sat May 3 14:31:11 EDT 2008 * Add --stderr option for frontends which expect output on stderr New for 1.63-beta-8 -------------- Sun Apr 27 14:57:21 EDT 2008 * Add Yoav's patch for parsing bitrates from streaming Apache headers * Activate capisce's patch for improved silence detection (use --xs2) * Add missing options, versioning to preferences file * Console versions (win & unix) send output to stdout instead of stderr * Console versions (win & unix) now fflush their output * Fix a bug in beta-5 where multiple tracks with identical cooked metadata were not coalesced into a single track * Change meaning of -k option. Now is the number of files to leave in incomplete. This makes it easier to rip streams where the first file is known to be complete (#1821814) * Fix bug which disables options when specified in preference file and in command line New for 1.63-beta-7 -------------- Sunday, April 6, 2008 * Remove wstreamripper from taskbar & alt-tab when used as plugin * Move wstreamripper to top when winamp is activated * Activate winamp when user clicks on wstreamripper * Updates to windows uninstaller New for 1.63-beta-6 -------------- Thursday, April 3, 2008 * Fix crashes in winamp plugin * Fix problem where plugin didn't remember if it was enabled New for 1.63-beta-5 -------------- Sunday, March 30, 2008 * Remove global variables for stream data to allow multi-rip applications * Internal string processing now uses UTF-8 instead of wide characters * Create a shared library, streamripper.dll, on windows which is shared by streamripper.exe and wstreamripper.exe * Fix problem reported in forum to allow pct-escaping of username, password * Fix delay in sending meta-data to relay stream * Add Andrew Neitsch's patch for parsing year & track from metadata New for 1.63-beta-4 -------------- Monday, Feb 11, 2008 * Fix crash on CTRL-C when reconnecting (#764599) * Improve responsivity of CTRL-C on unix * Remove dead code New for 1.63-beta-3 -------------- Sun 01-27-2008 * Fix problem when not ripping individual tracks * Plugin: no longer saves unused sripper.ini to Winamp folder * Plugin: once again default output directory is the desktop New for 1.63-beta-2 -------------- Sunday, January 13, 2008 * New installer for windows * Plugin: streamripper now runs as a separate process from winamp * Plugin: a few things probably don't work yet * Cue file now uses relative path for filename * Add patch from nn to detect full disk condition * Add patch from nn for improved parsing of parse rules file (#1825475) * Add patch from Max Mutrux fixing two problems with the relay lib and a fix for id3 on 64-bit systems New for 1.63-beta-1 -------------- Sat 10-20-2007 * Use glib library * Add preference file processing * Reject connections to content-type text/html * Plugin: fix problem where geometry sometimes gets located outside screen New for 1.62.2 -------------- Sun Aug 12 17:02:22 EDT 2007 * Fix buffer overflow in http header parsing New for 1.62.1 -------------- Sat May 26 15:33:12 EDT 2007 * Fix problem with -E flag New for 1.62.0 -------------- Sat May 19 11:12:27 EDT 2007 * Cue file was writing garbage for title and artist New for 1.62-beta-7 ------------------- Sun May 13 15:48:13 EDT 2007 * Zero out id3v2 padding New for 1.62-beta-6 ------------------- Sun Apr 29 11:54:36 EDT 2007 * Really fix problem with -q flag New for 1.62-beta-5 ------------------- Sat Apr 28 14:34:54 EDT 2007 * Fix problem with -q flag * Fix problem where pre-padding could be truncated New for 1.62-beta-4 ------------------- Sun 04-15-2007 * Remove shadowed RIP_MANAGER_OPTIONS structure * Fix error in thread exit of relay stream * Fix memory bug in parse rules initialization * Fix problem executing substitution rule * Plugin: fix adding tracks to winamp New for 1.62-beta-3 ------------------- Sun 03-25-2007 * Plugin: Various GUI fixes * Plugin: Fix memory error during registry parsing * Plugin: Eliminate repeated loading of sripper.ini each time options dialogs created * Plugin: Fix problem with id3 checkboxes always being set New for 1.62-beta-2 ------------------- Sat Mar 10 21:14:13 EST 2007 * Make not adding id3v1 the default * Add id3v1/id3v2 GUI to winamp plugin * Add codeset options to windows * Add codeset GUI to winamp plugin * Upgrade windows iconv to 1.11 * Force UTF-16 for id3 when any flavor of UCS-2 or UTF-16 spec'd * Remove warning for E2BIG iconv conversion New for 1.62-beta-1 ------------------- Sun Feb 11 17:07:31 EST 2007 * New codeset options - codesets for metadata, id3, filesystem and relay are independently selectable * Id3v1 and id3v2 are now independently selectable New for 1.61.27 --------------- Saturday, September 09, 2006 * Fix bug that caused extra garbage between id3v2 and first frame. * Fix bug that truncated last byte of last frame in mp3 files. New for 1.61.26 --------------- Thu Aug 24 21:50:47 EDT 2006 * Fix for security problem CVE-2006-3124, buffer overflow in http header parsing that could result in remote exploit New for 1.61.25 --------------- Sunday, August 13, 2006 * Fix bug where -s flag was ignored when used with -a flag * Plugin: Add popup menu with history of recent URL's * Plugin: Fix problem with "old way of retrieving track" * Plugin: Fix problem not finding desktop folder on Windows 98 New for 1.61.24 --------------- Sun Jul 2 14:14:38 EDT 2006 * Fix bug where external program wasn't being killed when reconnecting New for 1.61.23 --------------- June 18, 2006 * Plugin: Fix problem where streamripper can't find winamp directory * Plugin: Add STREAMRIPPER_WINAMP_HOME environment variable * Plugin: Fix sorting problem with skin list * Plugin: Add uninstaller * Plugin: Installer no longer overwrites parse_rules.txt New for 1.61.22 --------------- Fri Jun 2 10:17:53 EDT 2006 * Docking now works in modern skins * Docking now works when windowshading winamp * Debugging winamp plugin through STREAMRIPPER_DEBUG environment variable New for 1.61.21 --------------- Sun 05-28-2006 * Fix winamp crash caused by reference to debug file New for 1.61.20 --------------- Sat 05-27-2006 * Fix problem writing to \\net\paths on windows * Fix problem with options getting reset in winamp plugin * Fix rendering problem with skin preview in winamp plugin * Fix docking problem in winamp plugin New for 1.61.19 --------------- Sat 03-25-2006 * Add support for pls and m3u parsing * Upgrade to TRE version 0.7.2 * Add configuration switch: --without-ogg, for compiling streamripper on systems that don't have ogg/vorbis libraries. New for 1.61.18 --------------- Sun Mar 5 19:39:24 EST 2006 * Add support for ogg file splitting * Add support for ogg relay * Return an ICY response header instead of HTTP response header. This fixes problems with Windows media player classic (#1189504). * Winamp relay now adds /;stream.nsv or /.ogg for NSV and OGG streams. * Add izverg's patch for when default skin is blank in sripper.ini. New for 1.61.17 --------------- Tue 11-22-2005 * Fix memory leak * Fix for proxy authentication without password (#1338203) * Check http_proxy environment variable for proxy url New for 1.61.16 --------------- Sat Nov 12 01:18:06 EST 2005 * Use external program for reading metadata * Possible fix for proxy authentication without password (#1338203) * Change splitting behavior when song is too short to do silence detection * Resize winamp plugin gui to make it more visible New for 1.61.15 --------------- Fri 10-21-2005 * Fix a problem where streamripper aborts with SR_ERROR_BUFFER_EMPTY * Improve splitting code to add correct amount of padding * Add winamp plugin GUI for -k flag New for 1.61.14 --------------- Thu Sep 22 23:06:55 EDT 2005 * Fix deadlock when not using relay server New for 1.61.13 --------------- Sun Sep 18 18:50:51 EDT 2005 * Fix new relay stream problem with streams that don't have metadata. New for 1.61.12 --------------- Sun Sep 18 17:32:45 EDT 2005 * Major rewrite internal buffering code * Burst on connect for relay streams (128k burst) * Now can use patterns with -a flag * Fix problem using absolute paths with -a flag (#1254632) * Fix broken mp3 frames in split files (#525936) Note, however, we still have broken initial frame with -a flag * Partial fix for overflow using -M flag (see bug #1261305) * Fix wrong default overwriting behavior (#1269511) * Fix a couple of memory errors New for 1.61.11 --------------- Sun 08-07-2005 * Implement new output file naming code for windows * Perform stripping separately on stream, artist, title, album * Always strip trailing period (see bug #1202516), note that this is not a complete fix because directories could be created by %A for example * Add Daniel Lord's patch for overwrite-when-larger * Modify DL's patch to support three states: always-overwrite, never-overwrite, and overwrite-when-larger * Fix bug reported in forum about malformed regular expressions * Update winamp plugin gui for output file naming * Update winamp plugin to install and use parse_rules.txt New for 1.61.10 --------------- Fri Jul 8 02:05:22 EDT 2005 * Fix problem with -q flag always using 0000 New for 1.61.9 -------------- Mon Jun 27 08:16:04 EDT 2005 * Add patch from Albert for metadata restriction rules * New -D flag for output file patterns * The -q flag now autodetects the correct number to start with * The -q flag now takes an optional starting number * Remove support for -P prefix, it is now a fatal error * Using -f dropstring option is now a fatal error * Under development, new buffering code New for 1.61.8 -------------- Sat Apr 23 22:20:02 EDT 2005 * Add bd's patch for creating a relay server pls file * Fix FreeBSD 4.10 configuration problem because of broken wchar support. (half of #1024627) * Fix problem on FreeBSD & MacOSX caused by non-POSIX compliant default parsing rules (#1096005) * Fix compile problems on Solaris 9 (#1116304) New for 1.61.7 -------------- Sun Apr 10 15:58:07 EDT 2005 * Fix memory bug in relay lib New for 1.61.6 -------------- Sun Apr 10 10:41:51 EDT 2005 * Add Daniel Potts' fix that cures relay artifacts for clients who don't request meta-data * Fix relay artifacts on streams that don't have meta-data at all * Fix two memory bugs that caused crashes on debian * Change id3 genre from 0x00 (blues) to 0xff (unknown) New for 1.61.5 -------------- Sat 03-26-2005 * Add -A flag: suppress individual files * Add --quiet flag: no ripping status sent to console * Fix bug #1108854, windows directory ending in periods * Change unix directory name rectification to replace only leading periods instead of all periods New for 1.61.4 -------------- Wed Feb 23 00:51:11 EST 2005 * Fix for relay stream popping on xmms * Add Les's patch for the -M flag. * Add Obiguan's patch for the -T flag. * Add Aussie's patch for the -P flag. * Upgrades for new version of autoconf * Fix incorrect size field in id3v2 tag New for 1.61.3 -------------- Sat 12-11-2004 * Fix bug introduced in 1.61.2, whereby url referral (Location: header) stopped working * Fix problem with using regular expressions to drop metadata * Some code realignment in main ripping loop New for 1.61.2 -------------- Sat 12-04-2004 * Identify different stream types: mp3, ogg, aac, & nsv * Save stream types with correct file extensions * Don't do silence splitting on ogg, aac & nsv * Support "ice-" style http headers used by some icecast2 servers New for 1.61.1 -------------- * Use regular expression matching for metadata parsing * New option -w parse-rules-file * Remove -f dropstring option (use -w instead) * Improvements to unicode support * Improved support for icecast2 servers * Fix incorrect song title on first track * Very preliminary support for ogg streams * Remove vestigial DEBUG functions New for 1.61.0 -------------- * Add signal handler to SIGTERM. * Fix for SR_ERROR_NOT_SHOUTCAST_STREAM when \r\n\r\n exists before icy portion of header. * Add check for -lsem to configure script * Increase streamripper relay buffer size to fix streamripper relay noises when relay client connects early. New for 1.60.13 --------------- Aug 21, 2004 (GCS) * Fix skips in relay stream * Add frame numbers & FILE attribute to cue files * Fix file permissions on UNIX New for 1.60.12 --------------- * Add -R option to limit number of clients connected to relay * Autodetect streamripper as server * Fix bug in command line parsing with -I flag New for 1.60.11 --------------- Thu Jul 8 23:55:38 EDT 2004 (GCS) * Possible fix for frameoffset != READSIZE problem New for 1.60.10 --------------- Sat Jun 5 12:53:36 EDT 2004 (GCS) * Fix streamripper hang when not using -r flag * Fix error codes not being propagated from socklib * Add error check in rip_manager::myrecv for incompletely received buffers (to fix SR_ERROR_INVALID_METADATA messages) New for 1.60.9 -------------- * Apply Josh Lehan's patch: - Multiple relay streams - Fix wandering port problem - New flag "-m" for auto-closing connection - New flag "-k" to avoid saving broken songs after connect * Add debug information for frameoffset == READSIZE problem New for 1.60.8 -------------- * Fix a bug which caused the -d flag to fail on unix. * New flag "--debug" to turn on debugging New for 1.60.7 -------------- Mon May 17 00:09:40 EDT 2004 (GCS) * Send metadata to relay stream * Add plugin gui prop page for splitpoints options * Fix crash when bitrate==0 * Fix crash when no metadata * Mike Frysinger's patch to rip from specified interface New for 1.60.6 -------------- 2004/05/09 (GCS) * Re-fix crashes on very long file names, because the previous fix didn't work in some cases * Add plugin gui options: rip to single file, specify relay port * Fix plugin gui bug with skin preview * Add -h option (display help) New for 1.60.5 -------------- 2004/04/26 (GCS) * Upgrade to libmad version 0.15.1b (windows) * Improvements to -a flag New for 1.60.4 -------------- 2004/04/22 (GCS) * Fix program termination condition to exit properly on certain errors. New for 1.60.3 -------------- * Upgrade to libmad version 0.15.1b (unix) * Upgrade autoconf & automake New for 1.60.2 -------------- * Fix bug with -t flag * Initial implementation -a flag (rip to single file) New for 1.60.1 -------------- * Rip streams even if they don't have an icy-name New for 1.60 ------------ 2004/04/04 (GCS - gregsharp@users.sourceforge.net) * No changes. New for 1.60-pre3 ----------------- 2004/03/27 (GCS - gregsharp@users.sourceforge.net) * Fix the bug: error -22 [SR_ERROR_BUFFER_EMPTY] New for 1.60-pre2 ----------------- 2004/03/24 (GCS - gregsharp@users.sourceforge.net) * Add Johannes Buettner's drop patch * Fixes for compiling winamp 2 plugin New for 1.60-pre1 ----------------- 2004/03/10 (GCS - gregsharp@users.sourceforge.net) * Track splitting enhancements - see readme_xfade.txt * Partial multibyte character support * Fix crashes on very long file names * Fix crashes on control characters in meta data * New flag "-t" to prevent overwriting files in the incomplete directory new in cvs ---------- 2003/09/25: * Added support for HTTP "Basic" authorization. Works with DigitallyImported.com. (lib/types.h, lib/http.c) -Colin D. Bennett * Fixed a couple of tiny memory leaks in the usage of b64enc(), the returned buffer allocated as 'string' in b64enc wasn't being freed, and the 'authbuf' malloc'd in httplib_construct_sc_request for the proxy authorization wasn't freed. (lib/http.c) -Colin D. Bennett new in 1.30b (win32 & nix) -------------- * Added option to never overwrite files in the incomplete directory * UserAgent fix for picky streams (fakes winamp) * Fix for "INVALID_TRACK_SEPARATION" message. * Options dialog now has tabs w/ WinXP look and feel (if you have XP) * Proxy field now understands auth (user:pass@server:port) format. * pretty massive changes to handling of threads, might use slightly less CPU usage under windows, should use MUCH less under *nix (once the *nix backport is done) * Fixed moves files from incomplete to main directory Changes in 1.0.4 ---------------- * Fixed mpglib stuff. Changes in 1.0.3 ---------------- * Removed live365 ripping (legal reasons) Changes in 1.0.2 ---------------- * Merged back in with Win32 build, fixed live365.com ripping * fixed thread creation timing bug, would happen on some linux machines, sometimes. * fixed bug that would cause divide by zero when mpglib failed very (very) badly * Trims track names, for some reason some track names contained \r's Changes in 1.0.1 ---------------- * ported to win32 and made a winamp plug-in * made all socket I/O non blocking * should quite faster now Changes in 1.0b ---------------- * Finds silence between tracks by decoding the MP3 with mpglib * Rips live365 streams * Creates shoutcast relay server for listening for listening to streams * Separates incomplete tracks * Uses cvs @ sourceforge.net * supports icecast mount points * proxy support * More.. much much more.. Changes in 0.7.0 ---------------- * Started playing around with cvs at sourceforge.net Changes in 0.7.0b ---------------- * Split up streamripper_lib into ripper.c and sockets.c * Made start_ripping asynchronous via threads. This is mainly due to problems with people implementing the library under a windowed environment. it should be quite easy to make a GUI frontend now * Added a -o option via request. this creates a directory after the the stream name and puts the tracks in there, pretty nifty * MPEG 2.5 frames are now handles correctly, this caused "too many errors in mp3 data" errors before * Errors in the mp3 data do not stop the ripping anymore. * added -n option via request. this waits until the next track before ripping to avoid getting a half done tracks * Uses automake now, doh Changes in 0.6.4 ---------------- * new code to process options due to win32 not supported getopt * compiles under win32 :) Changes in 0.6.3 ---------------- * outputs stream data to stdout for use with mpg123 * rips shoutcast streams without meta data Changes in 0.6.0 ---------------- * added pretty counting byte status * checks mp3 header, starts and ends file at valid positions * traps signals and exists gracefully * takes host names, not just ip's. * merged in changes from Mike Baker * works with meta intervals other then 8192 * quite mode, don't actually record anything. Changes in 0.5.0b ---------------- * Fixed RedHat 6.1 compile bug Changes in 0.5.0a ---------------- * Initial release. streamripper-1.64.6.orig/configure.ac0000644000175000017500000002744211164266627015646 0ustar abiabidnl Process this file with autoconf to produce a configure script. dnl --------------------- dnl I found a great tutorial on autoconf: dnl http://mi.eng.cam.ac.uk/~er258/code/autoconf/index.html dnl --------------------- dnl These macros create entries in config.h dnl AC_CHECK_HEADERS, AC_CHECK_TYPES, AC_CHECK_FUNCS dnl These macros do not dnl AC_CHECK_LIB: prepends the library to LIBS dnl AC_CHECK_FUNC: defines a shell variable AC_PREREQ(2.59) AC_INIT(streamripper,1.64.6) AM_INIT_AUTOMAKE AC_CONFIG_HEADERS([lib/config.h]) dnl Checks for programs. AC_PROG_CC if test -n "$GCC"; then CFLAGS="$CFLAGS -Wall" fi AC_PROG_INSTALL AC_PROG_RANLIB dnl test for inline AC_C_INLINE dnl Checks for libraries. dnl Replace `main' with a function in -lm: AC_CHECK_LIB(m, main) dnl Yummy alloca() AC_FUNC_ALLOCA dnl Configure options AC_ARG_WITH(included-libmad, [ --with-included-libmad use the libmad library included with streamripper]) dnl AC_ARG_WITH(included-glib, dnl [ --with-included-glib use the glib library included with streamripper]) dnl AC_ARG_WITH(included-tre, dnl [ --with-included-tre use the tre library included with streamripper]) AC_ARG_WITH(included-argv, [ --with-included-argv use argv.c included with streamripper]) dnl AC_ARG_WITH(included-cdk, dnl [ --with-included-cdk use the cdk library included with streamripper]) AC_ARG_WITH(curses, [ --with-curses(=XXX) compile curses front-end (XXX is curses (default), ncurses, ncursesw, pdcurses or slang)]) CPPFLAGS="-D__UNIX__" AC_SUBST(CPPFLAGS) dnl -------- Tests for using included glib ------ dnl use_included_glib=no dnl if test "x$with_included_glib" = xyes; then dnl if test ! -d glib-2.16.6; then dnl AC_MSG_ERROR([Using included glib not available from tarball.]) dnl fi dnl use_included_glib=yes dnl GLIB_LIBS="glib-2.16.6/glib/.libs/libglib-2.0.a" dnl AC_CONFIG_SUBDIRS(glib-2.16.6) dnl else dnl AM_PATH_GLIB_2_0(2.16.0,,AC_MSG_ERROR([Glib 2.16 or greater required])) dnl fi dnl AM_CONDITIONAL(SUBDIR_GLIB, test "x$with_included_glib" = xyes) AM_PATH_GLIB_2_0(2.16.0,,AC_MSG_ERROR([Glib 2.16 or greater required])) dnl -------- Tests for using included libmad ------ LIBMAD="" AC_SUBST(LIBMAD) use_included_libmad=yes if test "x$with_included_libmad" != xyes; then sr_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-Ilib -D__UNIX__" AC_SUBST(CPPFLAGS) AC_CHECK_LIB(mad, mad_stream_buffer, use_included_libmad=no, use_included_libmad=yes) CPPFLAGS="$sr_save_CPPFLAGS" AC_SUBST(CPPFLAGS) fi AM_CONDITIONAL(SUBDIR_LIBMAD, test "$use_included_libmad" = yes) if test "$use_included_libmad" = yes; then LIBMAD="libmad-0.15.1b/.libs/libmad.a" AC_SUBST(LIBMAD) AC_CONFIG_SUBDIRS(libmad-0.15.1b) else LIBMAD=-lmad AC_SUBST(LIBMAD) fi dnl -------- Tests for threading library ---------- THREADLIBS=no AC_CHECK_LIB(pthread,pthread_create,THREADLIBS="-lpthread",) if test "$THREADLIBS" = no; then AC_CHECK_LIB(c_r,pthread_create,THREADLIBS="-pthread",) fi if test "$THREADLIBS" = no; then AC_CHECK_LIB(dce,pthread_create,THREADLIBS="-ldce",) fi if test "$THREADLIBS" = no; then AC_CHECK_LIB(pthreads,pthread_create,THREADLIBS="-lpthreads",) fi if test "$THREADLIBS" = no; then AC_MSG_ERROR(Your system doesn't seem to support posix threads) exit fi AC_SUBST(THREADLIBS) dnl Socklen TYPE_SOCKLEN_T dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(unistd.h) dnl -------- Tests for wchar support --------- dnl Wchar support is either all or nothing. All the following dnl must be present: dnl 1) Working wchar in C library dnl 2) Regular expression library with wide character support dnl 3) iconv library dnl It seems that it could be in wchar.h, stddef.h, or builtin AC_CHECK_HEADERS(wchar.h) AC_CHECK_HEADERS(wctype.h) AC_CHECK_TYPES([wchar_t],[],[],[ #if HAVE_WCHAR_H #include #endif #if STDC_HEADERS #include #endif ]) dnl -- More wide character madness. dnl FreeBSD doesn't have an iswcntrl() AC_CHECK_FUNCS(iswcntrl) dnl Linux is missing vswprintf prototype AC_CHECK_FUNCS(vswprintf) AC_FUNC_MBRTOWC dnl -------- Check for iconv & related AM_ICONV AM_LANGINFO_CODESET SR_FIND_LOCALE_CHARSET dnl -------- Check for wchar support dnl This is will be used and updated in the regex test below have_wchar=no if test "$ac_cv_type_wchar_t" = yes; then if test "$ac_cv_func_mbrtowc" = yes; then if test "$ac_cv_func_iswcntrl" = yes; then if test "$am_cv_func_iconv" = yes; then have_wchar=yes fi fi fi fi dnl -------- Tests for regular expressions --------- dnl Preference: dnl 1) Use system tre if installed dnl 2a) If we don't have wchar, use system regex dnl 2b) If we have wchar, and system regex has regwcomp, use system regex dnl 3) Use included tre dnl Note: If using included tre, it's not easy to know whether or not dnl it will compile with regwcomp() or not. We will assume it does. dnl Note: Solaris now has a regwcomp() in system regex. Is it compatible? dnl LIBREGEX="" dnl AC_SUBST(LIBREGEX) dnl use_included_tre=no dnl if test "$with_included_tre" = "yes"; then dnl use_included_tre=yes dnl else dnl AC_CHECK_LIB(tre,regwcomp) dnl if test "$ac_cv_lib_tre_regwcomp" = "no"; then dnl if test "$have_wchar" = "yes"; then dnl if test "$with_included_tre" = "no"; then dnl AC_CHECK_FUNC(regwcomp,,have_wchar=no) dnl else dnl AC_CHECK_FUNC(regwcomp,,use_included_tre=yes) dnl fi dnl fi dnl if test "$have_wchar" = "no"; then dnl AC_CHECK_LIB(tre,regcomp) dnl if test "$ac_cv_lib_tre_regcomp" = "no"; then dnl if test "$with_included_tre" = "no"; then dnl AC_CHECK_FUNC(regcomp,,AC_MSG_ERROR([cannot find regular expression library])) dnl else dnl AC_CHECK_FUNC(regcomp,use_included_tre=no) dnl fi dnl fi dnl fi dnl fi dnl fi dnl AM_CONDITIONAL(SUBDIR_TRE, test "$use_included_tre" = yes) dnl if test "$use_included_tre" = "yes"; then dnl LIBREGEX="tre-0.7.2/lib/.libs/libtre.a" dnl AC_SUBST(LIBREGEX) dnl AC_CONFIG_SUBDIRS(tre-0.7.2) dnl fi dnl -------- WCHAR support revisited dnl if test "$have_wchar" = yes; then dnl AC_DEFINE(HAVE_WCHAR_SUPPORT,1,[Define to 1 if you have wide characters, iconv, and regwcomp]) dnl fi dnl -------- Tests for using libiberty or argv.c use_included_argv=yes if test "x$with_included_argv" != xyes; then AC_CHECK_LIB(iberty, buildargv, use_included_argv=no, use_included_argv=yes) fi AM_CONDITIONAL(USE_INCLUDED_ARGV, test "$use_included_argv" = yes) if test "$use_included_argv" = yes; then LIBIBERTY_LIBS="" AC_SUBST(LIBIBERTY_LIBS) else LIBIBERTY_LIBS="-liberty" AC_SUBST(LIBIBERTY_LIBS) fi dnl -------- Tests for using faad2 ------ AC_SUBST(FAAD_LIBS) AC_CHECK_LIB(faad,NeAACDecDecode2,[ FAAD_LIBS="-lfaad" AC_DEFINE(HAVE_FAAD,1,[Define to 1 if you have faad2 libraries installed]) ], AC_DEFINE(HAVE_FAAD,0,[Define to 1 if you have faad2 libraries installed])) AC_SUBST(FAAD_LIBS) dnl -------- Tests for curses ------ if test x$with_curses = xyes || test x$with_curses = x ; then found_curses=no if test x$found_curses = xno; then AC_CHECK_LIB(ncurses , initscr, [ found_curses=yes with_curses=ncurses ]) fi if test x$found_curses = xno; then AC_CHECK_LIB(curses , initscr, [ found_curses=yes with_curses=curses ]) fi if test x$found_curses = xno; then AC_CHECK_LIB(ncursesw, initscr, [ found_curses=yes with_curses=ncursesw ]) fi if test x$found_curses = xno; then AC_CHECK_LIB(pdcurses, initscr, [ found_curses=yes with_curses=pdcurses ]) fi if test x$found_curses = xno; then with_curses=no fi fi case x$with_curses in xcurses) CF_WITH_CURSES_DIR AC_MSG_NOTICE([Request for curses]) ;; xncurses) CF_WITH_CURSES_DIR AC_MSG_NOTICE([Request for ncurses]) ;; xncursesw) CF_WITH_CURSES_DIR AC_MSG_NOTICE([Request for ncursesw]) ;; xpdcurses) AC_MSG_NOTICE([Request for pdncurses]) ;; xno) AC_MSG_NOTICE([Request no curses]) ;; esac dnl << GCS -- left off debugging here >> dnl exit dnl -------- Tests for using included cdk ------ dnl CDK_LIBS="" dnl use_included_cdk=no dnl use_cdk=no dnl if test "$with_included_cdk" = "yes"; then dnl use_included_cdk=yes dnl use_cdk=yes dnl CDK_LIBS="-lcdk -lncurses" dnl AC_DEFINE(HAVE_CDK,1,[Define to 1 if you have cdk libraries installed]) dnl else dnl dnl LDFLAGS="$LDFLAGS -L/usr/local/lib" dnl dnl INCLUDES="$INCLUDES -I/usr/local/include" dnl AC_CHECK_LIB(cdk,initCDKScreen,[ dnl use_cdk=yes dnl CDK_LIBS="-lcdk -lncurses" dnl AC_DEFINE(HAVE_CDK,1,[Define to 1 if you have cdk libraries installed]) dnl ],[],[-lncurses]) dnl fi dnl AM_CONDITIONAL(SUBDIR_CDK, test "x$use_included_cdk" = "xyes") dnl AC_SUBST(CDK_LIBS) AM_CONDITIONAL([WANT_CSTREAMRIPPER],[test x$use_cdk != xno]) dnl -------- Tests for using ogg/vorbis ------ AC_SUBST(VORBIS_CFLAGS) AC_SUBST(VORBIS_LIBS) AC_SUBST(OGG_CFLAGS) AC_SUBST(OGG_LIBS) sr_have_ogg=no XIPH_PATH_OGG([ XIPH_PATH_VORBIS([ AC_SUBST(OGG_CFLAGS) AC_SUBST(OGG_LIBS) AC_SUBST(VORBIS_CFLAGS) AC_SUBST(VORBIS_LIBS) AC_DEFINE(HAVE_OGG_VORBIS,1,[Define to 1 if you have both the ogg and vorbis libraries installed]) sr_have_ogg=yes ], AC_DEFINE(HAVE_OGG_VORBIS,0,[Define to 1 if you have both the ogg and vorbis libraries installed]))], AC_DEFINE(HAVE_OGG_VORBIS,0,[Define to 1 if you have both the ogg and vorbis libraries installed]) ) dnl -------- Check for semaphore library ------ AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(sem, sem_init,)) dnl Solaris needs this: -lrt AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(rt, sem_init,)) dnl -------- Check for integer sizes ------ dnl uint32_t vs. u_int32_t dnl ISO C 99 requires uint32_t, but u_int32_t is more common(?) AC_CHECK_HEADERS(stdint.h) AC_CHECK_HEADERS(inttypes.h) AC_CHECK_TYPES([uint32_t, u_int32_t]) dnl (maybe these are needed in the future) dnl AC_CHECK_SIZEOF(short) dnl AC_CHECK_SIZEOF(int) dnl AC_CHECK_SIZEOF(long) dnl Sockets header needed on Solaris AC_CHECK_HEADERS(sys/sockio.h) dnl -- GCS: Taken from distcc -- dnl The following test taken from the cvs sources via Samba: dnl If we can't find connect, try looking in -lsocket, -lnsl, and -linet. dnl The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has dnl libsocket.so which has a bad implementation of gethostbyname (it dnl only looks in /etc/hosts), so we only look for -lsocket if we need dnl it. AC_CHECK_FUNCS(connect) if test x"$ac_cv_func_connect" = x"no"; then case "$LIBS" in *-lnsl*) ;; *) AC_CHECK_LIB(nsl_s, printf) ;; esac case "$LIBS" in *-lnsl*) ;; *) AC_CHECK_LIB(nsl, printf) ;; esac case "$LIBS" in *-lsocket*) ;; *) AC_CHECK_LIB(socket, connect) ;; esac case "$LIBS" in *-linet*) ;; *) AC_CHECK_LIB(inet, connect) ;; esac dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value dnl has been cached. if test x"$ac_cv_lib_socket_connect" = x"yes" || test x"$ac_cv_lib_inet_connect" = x"yes"; then dnl ac_cv_func_connect=yes dnl don't! it would cause AC_CHECK_FUNC to succeed next time configure is run AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()]) fi fi dnl (GCS: I don't think I need these) dnl AC_CHECK_LIB(resolv, hstrerror, , , [-lnsl -lsocket]) dnl AC_CHECK_LIB(resolv, inet_aton, , , [-lnsl -lsocket]) dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T dnl Checks for library functions. AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(mkdir socket strerror strstr) AC_OUTPUT(lib/Makefile Makefile) cat <) use this switch. streamripper-1.64.6.orig/lib/0000755000175000017500000000000011164273726014113 5ustar abiabistreamripper-1.64.6.orig/lib/errors.c0000644000175000017500000001363311007362121015561 0ustar abiabi/* errors.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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include #if !defined (WIN32) #include #include #include #endif #include "filelib.h" #include "socklib.h" #include "http.h" #include "mchar.h" #include "findsep.h" #include "relaylib.h" #include "rip_manager.h" #include "ripstream.h" #include "threadlib.h" #include "debug.h" #include "compat.h" #include "parse.h" /****************************************************************************** * Private Vars *****************************************************************************/ static char m_error_str[NUM_ERROR_CODES][MAX_ERROR_STR]; #define SET_ERR_STR(str, code) strncpy(m_error_str[code], str, MAX_ERROR_STR); /****************************************************************************** * Public functions *****************************************************************************/ void errors_init (void) { SET_ERR_STR("SR_SUCCESS", 0x00); SET_ERR_STR("SR_ERROR_CANT_FIND_TRACK_SEPERATION", 0x01); SET_ERR_STR("SR_ERROR_DECODE_FAILURE", 0x02); SET_ERR_STR("SR_ERROR_INVALID_URL", 0x03); SET_ERR_STR("SR_ERROR_WIN32_INIT_FAILURE", 0x04); SET_ERR_STR("Could not connect to the stream. Try checking that the stream is up\n" "and that your proxy settings are correct.", 0x05); SET_ERR_STR("SR_ERROR_CANT_RESOLVE_HOSTNAME", 0x06); SET_ERR_STR("SR_ERROR_RECV_FAILED", 0x07); SET_ERR_STR("SR_ERROR_SEND_FAILED", 0x08); SET_ERR_STR("SR_ERROR_PARSE_FAILURE", 0x09); SET_ERR_STR("SR_ERROR_NO_RESPONSE_HEADER: Server is not a shoutcast stream", 0x0a); SET_ERR_STR("Server returned an unknown error code", 0x0b); SET_ERR_STR("SR_ERROR_NO_META_INTERVAL", 0x0c); SET_ERR_STR("SR_ERROR_INVALID_PARAM", 0x0d); SET_ERR_STR("SR_ERROR_NO_HTTP_HEADER", 0x0e); SET_ERR_STR("SR_ERROR_CANT_GET_LIVE365_ID", 0x0f); SET_ERR_STR("SR_ERROR_CANT_ALLOC_MEMORY", 0x10); SET_ERR_STR("SR_ERROR_CANT_FIND_IP_PORT", 0x11); SET_ERR_STR("SR_ERROR_CANT_FIND_MEMBERNAME", 0x12); SET_ERR_STR("SR_ERROR_CANT_FIND_TRACK_NAME", 0x13); SET_ERR_STR("SR_ERROR_NULL_MEMBER_NAME", 0x14); SET_ERR_STR("SR_ERROR_CANT_FIND_TIME_TAG", 0x15); SET_ERR_STR("SR_ERROR_BUFFER_EMPTY", 0x16); SET_ERR_STR("SR_ERROR_BUFFER_FULL", 0x17); SET_ERR_STR("SR_ERROR_CANT_INIT_XAUDIO", 0x18); SET_ERR_STR("SR_ERROR_BUFFER_TOO_SMALL", 0x19); SET_ERR_STR("SR_ERROR_CANT_CREATE_THREAD", 0x1A); SET_ERR_STR("SR_ERROR_CANT_FIND_MPEG_HEADER", 0x1B); SET_ERR_STR("SR_ERROR_INVALID_METADATA", 0x1C); SET_ERR_STR("SR_ERROR_NO_TRACK_INFO", 0x1D); SET_ERR_STR("SR_EEROR_CANT_FIND_SUBSTR", 0x1E); SET_ERR_STR("SR_ERROR_CANT_BIND_ON_PORT", 0x1F); SET_ERR_STR("SR_ERROR_HOST_NOT_CONNECTED", 0x20); SET_ERR_STR("HTTP:404 Not Found", 0x21); SET_ERR_STR("HTTP:401 Unauthorized", 0x22); SET_ERR_STR("HTTP:502 Bad Gateway", 0x23); // Connection Refused SET_ERR_STR("SR_ERROR_CANT_CREATE_FILE", 0x24); SET_ERR_STR("SR_ERROR_CANT_WRITE_TO_FILE", 0x25); SET_ERR_STR("SR_ERROR_CANT_CREATE_DIR", 0x26); SET_ERR_STR("HTTP:400 Bad Request ", 0x27); // Server Full SET_ERR_STR("SR_ERROR_CANT_SET_SOCKET_OPTIONS", 0x28); SET_ERR_STR("SR_ERROR_SOCK_BASE", 0x29); SET_ERR_STR("SR_ERROR_INVALID_DIRECTORY", 0x2a); SET_ERR_STR("SR_ERROR_FAILED_TO_MOVE_FILE", 0x2b); SET_ERR_STR("SR_ERROR_CANT_LOAD_MPGLIB", 0x2c); SET_ERR_STR("SR_ERROR_CANT_INIT_MPGLIB", 0x2d); SET_ERR_STR("SR_ERROR_CANT_UNLOAD_MPGLIB", 0x2e); SET_ERR_STR("SR_ERROR_PCM_BUFFER_TO_SMALL", 0x2f); SET_ERR_STR("SR_ERROR_CANT_DECODE_MP3", 0x30); SET_ERR_STR("SR_ERROR_SOCKET_CLOSED", 0x31); SET_ERR_STR("Due to legal reasons Streamripper can no longer work with Live365(tm).\r\n" "See streamripper.sourceforge.net for more on this matter.", 0x32); SET_ERR_STR("The maximum number of bytes ripped has been reached", 0x33); SET_ERR_STR("SR_ERROR_CANT_WAIT_ON_THREAD", 0x34); SET_ERR_STR("SR_ERROR_CANT_CREATE_EVENT", 0x35); SET_ERR_STR("SR_ERROR_NOT_SHOUTCAST_STREAM", 0x36); SET_ERR_STR("HTTP:407 - Proxy Authentication Required", 0x37); SET_ERR_STR("HTTP:403 - Access Forbidden (try changing the UserAgent)", 0x38); SET_ERR_STR("The output directory length is too long", 0x39); SET_ERR_STR("SR_ERROR_PROGRAM_ERROR", 0x3a); SET_ERR_STR("SR_ERROR_TIMEOUT", 0x3b); SET_ERR_STR("SR_ERROR_SELECT_FAILED", 0x3c); SET_ERR_STR("SR_ERROR_RESERVED_WINDOW_EMPTY", 0x3d); SET_ERR_STR("SR_ERROR_CANT_BIND_ON_INTERFACE", 0x3e); SET_ERR_STR("SR_ERROR_NO_OGG_PAGES_FOR_RELAY", 0x3f); SET_ERR_STR("SR_ERROR_CANT_PARSE_PLS", 0x40); SET_ERR_STR("SR_ERROR_CANT_PARSE_M3U", 0x41); SET_ERR_STR("SR_ERROR_CANT_CREATE_SOCKET", 0x42); SET_ERR_STR("SR_ERROR_CREATE_PIPE_FAILED", 0x43); } char* errors_get_string (error_code code) { if (code > 0 || code < -NUM_ERROR_CODES) return NULL; return m_error_str[-code]; } streamripper-1.64.6.orig/lib/config.h.in0000644000175000017500000001224511164273456016142 0ustar abiabi/* lib/config.h.in. Generated from configure.ac by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Whether the system has connect() */ #undef HAVE_CONNECT /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have faad2 libraries installed */ #undef HAVE_FAAD /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `iswcntrl' function. */ #undef HAVE_ISWCNTRL /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET /* Define to 1 if you have the `inet' library (-linet). */ #undef HAVE_LIBINET /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `nsl_s' library (-lnsl_s). */ #undef HAVE_LIBNSL_S /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT /* Define to 1 if you have the `sem' library (-lsem). */ #undef HAVE_LIBSEM /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define if you have locale_charset() in . */ #undef HAVE_LOCALE_CHARSET /* Define to 1 if mbrtowc and mbstate_t are properly declared. */ #undef HAVE_MBRTOWC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have both the ogg and vorbis libraries installed */ #undef HAVE_OGG_VORBIS /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if the system has the type `uint32_t'. */ #undef HAVE_UINT32_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `u_int32_t'. */ #undef HAVE_U_INT32_T /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the `vswprintf' function. */ #undef HAVE_VSWPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if the system has the type `wchar_t'. */ #undef HAVE_WCHAR_T /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `unsigned int' if does not define. */ #undef size_t /* Substitute for socklen_t */ #undef socklen_t streamripper-1.64.6.orig/lib/list.h0000644000175000017500000001773710353576106015253 0ustar abiabi#ifndef __LIST_H__ #define __LIST_H__ /* GCS: I ripped this off from the linux kernel. Minor modifications. */ #if defined (WIN32) #define inline __inline #endif /* #define prefetch(a) (a) */ #define prefetch(a) 0 /* * Simple doubly linked list implementation. * * Some of the internal functions ("__xxx") are useful when * manipulating whole lists rather than single entries, as * sometimes we already know the next/prev entries and we can * generate better code by using them directly rather than * using the generic single-entry routines. */ struct list_head { struct list_head *next, *prev; }; typedef struct list_head LIST; #define LIST_HEAD_INIT(name) { &(name), &(name) } #define LIST_HEAD(name) \ struct list_head name = LIST_HEAD_INIT(name) #define INIT_LIST_HEAD(ptr) do { \ (ptr)->next = (ptr); (ptr)->prev = (ptr); \ } while (0) /* * Insert a new entry between two known consecutive entries. * * This is only for internal list manipulation where we know * the prev/next entries already! */ static inline void __list_add(struct list_head *new, struct list_head *prev, struct list_head *next) { next->prev = new; new->next = next; new->prev = prev; prev->next = new; } /** * list_add - add a new entry * @new: new entry to be added * @head: list head to add it after * * Insert a new entry after the specified head. * This is good for implementing stacks. */ static inline void list_add(struct list_head *new, struct list_head *head) { __list_add(new, head, head->next); } /** * list_add_tail - add a new entry * @new: new entry to be added * @head: list head to add it before * * Insert a new entry before the specified head. * This is useful for implementing queues. */ static inline void list_add_tail(struct list_head *new, struct list_head *head) { __list_add(new, head->prev, head); } /* * Delete a list entry by making the prev/next entries * point to each other. * * This is only for internal list manipulation where we know * the prev/next entries already! */ static inline void __list_del(struct list_head *prev, struct list_head *next) { next->prev = prev; prev->next = next; } /** * list_del - deletes entry from list. * @entry: the element to delete from the list. * Note: list_empty on entry does not return true after this, the entry is in an undefined state. */ static inline void list_del(struct list_head *entry) { __list_del(entry->prev, entry->next); entry->next = (void *) 0; entry->prev = (void *) 0; } /** * list_del_init - deletes entry from list and reinitialize it. * @entry: the element to delete from the list. */ static inline void list_del_init(struct list_head *entry) { __list_del(entry->prev, entry->next); INIT_LIST_HEAD(entry); } /** * list_move - delete from one list and add as another's head * @list: the entry to move * @head: the head that will precede our entry */ static inline void list_move(struct list_head *list, struct list_head *head) { __list_del(list->prev, list->next); list_add(list, head); } /** * list_move_tail - delete from one list and add as another's tail * @list: the entry to move * @head: the head that will follow our entry */ static inline void list_move_tail(struct list_head *list, struct list_head *head) { __list_del(list->prev, list->next); list_add_tail(list, head); } /** * list_empty - tests whether a list is empty * @head: the list to test. */ static inline int list_empty(struct list_head *head) { return head->next == head; } static inline void __list_splice(struct list_head *list, struct list_head *head) { struct list_head *first = list->next; struct list_head *last = list->prev; struct list_head *at = head->next; first->prev = head; head->next = first; last->next = at; at->prev = last; } /** * list_splice - join two lists * @list: the new list to add. * @head: the place to add it in the first list. */ static inline void list_splice(struct list_head *list, struct list_head *head) { if (!list_empty(list)) __list_splice(list, head); } /** * list_splice_init - join two lists and reinitialise the emptied list. * @list: the new list to add. * @head: the place to add it in the first list. * * The list at @list is reinitialised */ static inline void list_splice_init(struct list_head *list, struct list_head *head) { if (!list_empty(list)) { __list_splice(list, head); INIT_LIST_HEAD(list); } } /** * list_entry - get the struct for this entry * @ptr: the &struct list_head pointer. * @type: the type of the struct this is embedded in. * @member: the name of the list_struct within the struct. */ #define list_entry(ptr, type, member) \ ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) /** * list_for_each - iterate over a list * @pos: the &struct list_head to use as a loop counter. * @head: the head for your list. */ #define list_for_each(pos, head) \ for (pos = (head)->next, prefetch(pos->next); pos != (head); \ pos = pos->next, prefetch(pos->next)) /** * list_for_each_prev - iterate over a list backwards * @pos: the &struct list_head to use as a loop counter. * @head: the head for your list. */ #define list_for_each_prev(pos, head) \ for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \ pos = pos->prev, prefetch(pos->prev)) /** * list_for_each_safe - iterate over a list safe against removal of list entry * @pos: the &struct list_head to use as a loop counter. * @n: another &struct list_head to use as temporary storage * @head: the head for your list. */ #define list_for_each_safe(pos, n, head) \ for (pos = (head)->next, n = pos->next; pos != (head); \ pos = n, n = pos->next) /** * list_for_each_entry - iterate over list of given type * @pos: the type * to use as a loop counter. * @type: the type of the struct this is embedded in. * @head: the head for your list. * @member: the name of the list_struct within the struct. */ #if defined (commentout) #define list_for_each_entry(pos, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member), \ prefetch(pos->member.next); \ &pos->member != (head); \ pos = list_entry(pos->member.next, typeof(*pos), member), \ prefetch(pos->member.next)) #endif #define list_for_each_entry(pos, type, head, member) \ for (pos = list_entry((head)->next, type, member), \ prefetch(pos->member.next); \ &pos->member != (head); \ pos = list_entry(pos->member.next, type, member), \ prefetch(pos->member.next)) /** * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry * @pos: the type * to use as a loop counter. * @type: the type of the struct this is embedded in. * @n: another type * to use as temporary storage * @head: the head for your list. * @member: the name of the list_struct within the struct. */ #if defined (commentout) #define list_for_each_entry_safe(pos, n, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member), \ n = list_entry(pos->member.next, typeof(*pos), member); \ &pos->member != (head); \ pos = n, n = list_entry(n->member.next, typeof(*n), member)) #endif #define list_for_each_entry_safe(pos, type, n, head, member) \ for (pos = list_entry((head)->next, type, member), \ n = list_entry(pos->member.next, type, member); \ &pos->member != (head); \ pos = n, n = list_entry(n->member.next, type, member)) /** * list_for_each_entry_continue - iterate over list of given type * continuing after existing point * @pos: the type * to use as a loop counter. * @head: the head for your list. * @member: the name of the list_struct within the struct. */ #define list_for_each_entry_continue(pos, head, member) \ for (pos = list_entry(pos->member.next, typeof(*pos), member), \ prefetch(pos->member.next); \ &pos->member != (head); \ pos = list_entry(pos->member.next, typeof(*pos), member), \ prefetch(pos->member.next)) #endif streamripper-1.64.6.orig/lib/Makefile.in0000644000175000017500000003740011164273416016160 0ustar abiabi# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @SUBDIR_LIBMAD_TRUE@am__append_1 = -I@abs_top_srcdir@/libmad-0.15.1b subdir = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/cf_curses.m4 \ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/glib-2.0.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/ogg.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/m4/sr_locale_charset.m4 \ $(top_srcdir)/m4/type_socklen_t.m4 $(top_srcdir)/m4/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libstreamripper_a_AR = $(AR) $(ARFLAGS) libstreamripper_a_LIBADD = am_libstreamripper_a_OBJECTS = cbuf2.$(OBJEXT) charset.$(OBJEXT) \ debug.$(OBJEXT) errors.$(OBJEXT) external.$(OBJEXT) \ filelib.$(OBJEXT) findsep.$(OBJEXT) findsep2.$(OBJEXT) \ http.$(OBJEXT) iconvert.$(OBJEXT) mchar.$(OBJEXT) \ parse.$(OBJEXT) prefs.$(OBJEXT) relaylib.$(OBJEXT) \ rip_manager.$(OBJEXT) ripaac.$(OBJEXT) ripogg.$(OBJEXT) \ ripstream.$(OBJEXT) socklib.$(OBJEXT) threadlib.$(OBJEXT) \ utf8.$(OBJEXT) libstreamripper_a_OBJECTS = $(am_libstreamripper_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libstreamripper_a_SOURCES) DIST_SOURCES = $(libstreamripper_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FAAD_LIBS = @FAAD_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBCHARSET = @LIBCHARSET@ LIBIBERTY_LIBS = @LIBIBERTY_LIBS@ LIBICONV = @LIBICONV@ LIBMAD = @LIBMAD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OGG_CFLAGS = @OGG_CFLAGS@ OGG_LIBS = @OGG_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREADLIBS = @THREADLIBS@ VERSION = @VERSION@ VORBISENC_LIBS = @VORBISENC_LIBS@ VORBISFILE_LIBS = @VORBISFILE_LIBS@ VORBIS_CFLAGS = @VORBIS_CFLAGS@ VORBIS_LIBS = @VORBIS_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # if SUBDIR_GLIB # MAYBE_GLIB = glib-2.16.6 # AM_CPPFLAGS += -I@abs_top_srcdir@/glib-2.16.6/glib # AM_CPPFLAGS += -I@abs_top_srcdir@/glib-2.16.6 # endif AM_CPPFLAGS = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @GLIB_CFLAGS@ \ $(am__append_1) -I@abs_top_srcdir@/lib noinst_LIBRARIES = libstreamripper.a libstreamripper_a_SOURCES = \ cbuf2.c \ charset.c \ debug.c \ errors.c \ external.c \ filelib.c \ findsep.c \ findsep2.c \ http.c \ iconvert.c \ mchar.c \ parse.c \ prefs.c \ relaylib.c \ rip_manager.c \ ripaac.c \ ripogg.c \ ripstream.c \ socklib.c \ threadlib.c \ utf8.c \ cbuf2.h \ charmaps.h \ charset.h \ compat.h \ debug.h \ errors.h \ external.h \ filelib.h \ findsep.h \ http.h \ list.h \ mchar.h \ parse.h \ prefs.h \ relaylib.h \ rip_manager.h \ ripogg.h \ ripstream.h \ socklib.h \ srconfig.h \ threadlib.h \ srtypes.h \ uce_dirent.h \ utf8.h all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status lib/config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libstreamripper.a: $(libstreamripper_a_OBJECTS) $(libstreamripper_a_DEPENDENCIES) -rm -f libstreamripper.a $(libstreamripper_a_AR) libstreamripper.a $(libstreamripper_a_OBJECTS) $(libstreamripper_a_LIBADD) $(RANLIB) libstreamripper.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cbuf2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errors.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/external.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filelib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findsep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findsep2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconvert.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mchar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prefs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/relaylib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rip_manager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ripaac.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ripogg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ripstream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socklib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadlib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) config.h installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: streamripper-1.64.6.orig/lib/charset.c0000644000175000017500000002576710405100510015702 0ustar abiabi/* * Copyright (C) 2001 Edmund Grimley Evans * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * See the corresponding header file for a description of the functions * that this file provides. * * This was first written for Ogg Vorbis but could be of general use. * * The only deliberate assumption about data sizes is that a short has * at least 16 bits, but this code has only been tested on systems with * 8-bit char, 16-bit short and 32-bit int. */ #ifndef HAVE_ICONV /* should be ifdef USE_CHARSET_CONVERT */ #include #include "charset.h" #include "charmaps.h" /* * This is like the standard strcasecmp, but it does not depend * on the locale. Locale-dependent functions can be dangerous: * we once had a bug involving strcasecmp("iso", "ISO") in a * Turkish locale! * * (I'm not really sure what the official standard says * about the sign of strcasecmp("Z", "["), but usually * we're only interested in whether it's zero.) */ static int ascii_strcasecmp(const char *s1, const char *s2) { char c1, c2; for (;; s1++, s2++) { if (!*s1 || !*s1) break; if (*s1 == *s2) continue; c1 = *s1; if ('a' <= c1 && c1 <= 'z') c1 += 'A' - 'a'; c2 = *s2; if ('a' <= c2 && c2 <= 'z') c2 += 'A' - 'a'; if (c1 != c2) break; } return (unsigned char)*s1 - (unsigned char)*s2; } /* * UTF-8 equivalents of the C library's wctomb() and mbtowc(). */ int utf8_mbtowc(int *pwc, const char *s, size_t n) { unsigned char c; int wc, i, k; if (!n || !s) return 0; c = *s; if (c < 0x80) { if (pwc) *pwc = c; return c ? 1 : 0; } else if (c < 0xc2) return -1; else if (c < 0xe0) { if (n >= 2 && (s[1] & 0xc0) == 0x80) { if (pwc) *pwc = ((c & 0x1f) << 6) | (s[1] & 0x3f); return 2; } else return -1; } else if (c < 0xf0) k = 3; else if (c < 0xf8) k = 4; else if (c < 0xfc) k = 5; else if (c < 0xfe) k = 6; else return -1; if (n < k) return -1; wc = *s++ & ((1 << (7 - k)) - 1); for (i = 1; i < k; i++) { if ((*s & 0xc0) != 0x80) return -1; wc = (wc << 6) | (*s++ & 0x3f); } if (wc < (1 << (5 * k - 4))) return -1; if (pwc) *pwc = wc; return k; } int utf8_wctomb(char *s, int wc1) { unsigned int wc = wc1; if (!s) return 0; if (wc < (1 << 7)) { *s++ = wc; return 1; } else if (wc < (1 << 11)) { *s++ = 0xc0 | (wc >> 6); *s++ = 0x80 | (wc & 0x3f); return 2; } else if (wc < (1 << 16)) { *s++ = 0xe0 | (wc >> 12); *s++ = 0x80 | ((wc >> 6) & 0x3f); *s++ = 0x80 | (wc & 0x3f); return 3; } else if (wc < (1 << 21)) { *s++ = 0xf0 | (wc >> 18); *s++ = 0x80 | ((wc >> 12) & 0x3f); *s++ = 0x80 | ((wc >> 6) & 0x3f); *s++ = 0x80 | (wc & 0x3f); return 4; } else if (wc < (1 << 26)) { *s++ = 0xf8 | (wc >> 24); *s++ = 0x80 | ((wc >> 18) & 0x3f); *s++ = 0x80 | ((wc >> 12) & 0x3f); *s++ = 0x80 | ((wc >> 6) & 0x3f); *s++ = 0x80 | (wc & 0x3f); return 5; } else if (wc < (1 << 31)) { *s++ = 0xfc | (wc >> 30); *s++ = 0x80 | ((wc >> 24) & 0x3f); *s++ = 0x80 | ((wc >> 18) & 0x3f); *s++ = 0x80 | ((wc >> 12) & 0x3f); *s++ = 0x80 | ((wc >> 6) & 0x3f); *s++ = 0x80 | (wc & 0x3f); return 6; } else return -1; } /* * The charset "object" and methods. */ struct charset { int max; int (*mbtowc)(void *table, int *pwc, const char *s, size_t n); int (*wctomb)(void *table, char *s, int wc); void *map; }; int charset_mbtowc(struct charset *charset, int *pwc, const char *s, size_t n) { return (*charset->mbtowc)(charset->map, pwc, s, n); } int charset_wctomb(struct charset *charset, char *s, int wc) { return (*charset->wctomb)(charset->map, s, wc); } int charset_max(struct charset *charset) { return charset->max; } /* * Implementation of UTF-8. */ static int mbtowc_utf8(void *map, int *pwc, const char *s, size_t n) { return utf8_mbtowc(pwc, s, n); } static int wctomb_utf8(void *map, char *s, int wc) { return utf8_wctomb(s, wc); } /* * Implementation of US-ASCII. * Probably on most architectures this compiles to less than 256 bytes * of code, so we can save space by not having a table for this one. */ static int mbtowc_ascii(void *map, int *pwc, const char *s, size_t n) { int wc; if (!n || !s) return 0; wc = (unsigned char)*s; if (wc & ~0x7f) return -1; if (pwc) *pwc = wc; return wc ? 1 : 0; } static int wctomb_ascii(void *map, char *s, int wc) { if (!s) return 0; if (wc & ~0x7f) return -1; *s = wc; return 1; } /* * Implementation of ISO-8859-1. * Probably on most architectures this compiles to less than 256 bytes * of code, so we can save space by not having a table for this one. */ static int mbtowc_iso1(void *map, int *pwc, const char *s, size_t n) { int wc; if (!n || !s) return 0; wc = (unsigned char)*s; if (wc & ~0xff) return -1; if (pwc) *pwc = wc; return wc ? 1 : 0; } static int wctomb_iso1(void *map, char *s, int wc) { if (!s) return 0; if (wc & ~0xff) return -1; *s = wc; return 1; } /* * Implementation of any 8-bit charset. */ struct map { const unsigned short *from; struct inverse_map *to; }; static int mbtowc_8bit(void *map1, int *pwc, const char *s, size_t n) { struct map *map = map1; unsigned short wc; if (!n || !s) return 0; wc = map->from[(unsigned char)*s]; if (wc == 0xffff) return -1; if (pwc) *pwc = (int)wc; return wc ? 1 : 0; } /* * For the inverse map we use a hash table, which has the advantages * of small constant memory requirement and simple memory allocation, * but the disadvantage of slow conversion in the worst case. * If you need real-time performance while letting a potentially * malicious user define their own map, then the method used in * linux/drivers/char/consolemap.c would be more appropriate. */ struct inverse_map { unsigned char first[256]; unsigned char next[256]; }; /* * The simple hash is good enough for this application. * Use the alternative trivial hashes for testing. */ #define HASH(i) ((i) & 0xff) /* #define HASH(i) 0 */ /* #define HASH(i) 99 */ static struct inverse_map *make_inverse_map(const unsigned short *from) { struct inverse_map *to; char used[256]; int i, j, k; to = (struct inverse_map *)malloc(sizeof(struct inverse_map)); if (!to) return 0; for (i = 0; i < 256; i++) to->first[i] = to->next[i] = used[i] = 0; for (i = 255; i >= 0; i--) if (from[i] != 0xffff) { k = HASH(from[i]); to->next[i] = to->first[k]; to->first[k] = i; used[k] = 1; } /* Point the empty buckets at an empty list. */ for (i = 0; i < 256; i++) if (!to->next[i]) break; if (i < 256) for (j = 0; j < 256; j++) if (!used[j]) to->first[j] = i; return to; } int wctomb_8bit(void *map1, char *s, int wc1) { struct map *map = map1; unsigned short wc = wc1; int i; if (!s) return 0; if (wc1 & ~0xffff) return -1; if (1) /* Change 1 to 0 to test the case where malloc fails. */ if (!map->to) map->to = make_inverse_map(map->from); if (map->to) { /* Use the inverse map. */ i = map->to->first[HASH(wc)]; for (;;) { if (map->from[i] == wc) { *s = i; return 1; } if (!(i = map->to->next[i])) break; } } else { /* We don't have an inverse map, so do a linear search. */ for (i = 0; i < 256; i++) if (map->from[i] == wc) { *s = i; return 1; } } return -1; } /* * The "constructor" charset_find(). */ struct charset charset_utf8 = { 6, &mbtowc_utf8, &wctomb_utf8, 0 }; struct charset charset_iso1 = { 1, &mbtowc_iso1, &wctomb_iso1, 0 }; struct charset charset_ascii = { 1, &mbtowc_ascii, &wctomb_ascii, 0 }; struct charset *charset_find(const char *code) { int i; /* Find good (MIME) name. */ for (i = 0; names[i].bad; i++) if (!ascii_strcasecmp(code, names[i].bad)) { code = names[i].good; break; } /* Recognise some charsets for which we avoid using a table. */ if (!ascii_strcasecmp(code, "UTF-8")) return &charset_utf8; if (!ascii_strcasecmp(code, "US-ASCII")) return &charset_ascii; if (!ascii_strcasecmp(code, "ISO-8859-1")) return &charset_iso1; /* Look for a mapping for a simple 8-bit encoding. */ for (i = 0; maps[i].name; i++) if (!ascii_strcasecmp(code, maps[i].name)) { if (!maps[i].charset) { maps[i].charset = (struct charset *)malloc(sizeof(struct charset)); if (maps[i].charset) { struct map *map = (struct map *)malloc(sizeof(struct map)); if (!map) { free(maps[i].charset); maps[i].charset = 0; } else { maps[i].charset->max = 1; maps[i].charset->mbtowc = &mbtowc_8bit; maps[i].charset->wctomb = &wctomb_8bit; maps[i].charset->map = map; map->from = maps[i].map; map->to = 0; /* inverse mapping is created when required */ } } } return maps[i].charset; } return 0; } /* * Function to convert a buffer from one encoding to another. * Invalid bytes are replaced by '#', and characters that are * not available in the target encoding are replaced by '?'. * Each of TO and TOLEN may be zero, if the result is not needed. * The output buffer is null-terminated, so it is all right to * use charset_convert(fromcode, tocode, s, strlen(s), &t, 0). */ int charset_convert(const char *fromcode, const char *tocode, const char *from, size_t fromlen, char **to, size_t *tolen) { int ret = 0; struct charset *charset1, *charset2; char *tobuf, *p, *newbuf; int i, j, wc; charset1 = charset_find(fromcode); charset2 = charset_find(tocode); if (!charset1 || !charset2 ) return -1; tobuf = (char *)malloc(fromlen * charset2->max + 1); if (!tobuf) return -2; for (p = tobuf; fromlen; from += i, fromlen -= i, p += j) { i = charset_mbtowc(charset1, &wc, from, fromlen); if (!i) i = 1; else if (i == -1) { i = 1; wc = '#'; ret = 2; } j = charset_wctomb(charset2, p, wc); if (j == -1) { if (!ret) ret = 1; j = charset_wctomb(charset2, p, '?'); if (j == -1) j = 0; } } if (tolen) *tolen = p - tobuf; *p++ = '\0'; if (to) { newbuf = realloc(tobuf, p - tobuf); *to = newbuf ? newbuf : tobuf; } else free(tobuf); return ret; } #endif /* USE_CHARSET_ICONV */ streamripper-1.64.6.orig/lib/ripogg.c0000644000175000017500000005052511164223237015545 0ustar abiabi/* ripogg.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., 675 Mass Ave, Cambridge, MA 02139, USA. * * This file is adapted from ogginfo.c of the vorbis-tools project. * Copyright 2002 Michael Smith * Licensed under the GNU GPL, distributed with this program. */ #include "srconfig.h" #include #include #include #include #include #include "srtypes.h" #include "cbuf2.h" #include "ripogg.h" #include "utf8.h" #include "list.h" #include "debug.h" #include "mchar.h" #if (HAVE_OGG_VORBIS) #include #include #include #define CHUNK 4500 // #define CHUNK 1 #define _(a) (a) struct vorbis_release { char *vendor_string; char *desc; } releases[] = { {"Xiphophorus libVorbis I 20000508", "1.0 beta 1 or beta 2"}, {"Xiphophorus libVorbis I 20001031", "1.0 beta 3"}, {"Xiphophorus libVorbis I 20010225", "1.0 beta 4"}, {"Xiphophorus libVorbis I 20010615", "1.0 rc1"}, {"Xiphophorus libVorbis I 20010813", "1.0 rc2"}, {"Xiphophorus libVorbis I 20011217", "1.0 rc3"}, {"Xiphophorus libVorbis I 20011231", "1.0 rc3"}, {"Xiph.Org libVorbis I 20020717", "1.0"}, {"Xiph.Org libVorbis I 20030909", "1.0.1"}, {NULL, NULL}, }; /* TODO: * * - detect violations of muxing constraints * - detect granulepos 'gaps' (possibly vorbis-specific). (seperate from * serial-number gaps) */ typedef struct { stream_processor *streams; int allocated; int used; int in_headers; } stream_set; typedef struct { vorbis_info vi; vorbis_comment vc; ogg_int64_t bytes; ogg_int64_t lastgranulepos; ogg_int64_t firstgranulepos; int doneheaders; } misc_vorbis_info; /***************************************************************************** * Private Vars *****************************************************************************/ //static int printinfo = 1; //static int printwarn = 1; //static int verbose = 1; //static int flawed; //static ogg_sync_state ogg_sync; //static ogg_page page; //static stream_processor stream; //static char* ogg_curr_header; //static int ogg_curr_header_len; #define CONSTRAINT_PAGE_AFTER_EOS 1 #define CONSTRAINT_MUXING_VIOLATED 2 /***************************************************************************** * Functions *****************************************************************************/ static void warn(char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stdout, format, ap); va_end(ap); } /* Return 1 if the page is a header page */ static int vorbis_process (RIP_MANAGER_INFO* rmi, stream_processor *stream, ogg_page *page, TRACK_INFO* ti) { ogg_packet packet; misc_vorbis_info *inf = stream->data; int i, header=0; int k; ogg_stream_pagein(&stream->os, page); if (inf->doneheaders < 3) header = 1; while (ogg_stream_packetout(&stream->os, &packet) > 0) { if (inf->doneheaders < 3) { if (vorbis_synthesis_headerin(&inf->vi, &inf->vc, &packet) < 0) { warn(_("Warning: Could not decode vorbis header " "packet - invalid vorbis stream (%d)\n"), stream->num); continue; } inf->doneheaders++; if (inf->doneheaders == 3) { if(ogg_page_granulepos(page) != 0 || ogg_stream_packetpeek(&stream->os, NULL) == 1) warn(_("Warning: Vorbis stream %d does not have headers " "correctly framed. Terminal header page contains " "additional packets or has non-zero granulepos\n"), stream->num); debug_printf("Vorbis headers parsed for stream %d, " "information follows...\n", stream->num); debug_printf("Version: %d\n", inf->vi.version); k = 0; while(releases[k].vendor_string) { if(!strcmp(inf->vc.vendor, releases[k].vendor_string)) { debug_printf("Vendor: %s (%s)\n", inf->vc.vendor, releases[k].desc); break; } k++; } if(!releases[k].vendor_string) debug_printf("Vendor: %s\n", inf->vc.vendor); debug_printf("Channels: %d\n", inf->vi.channels); debug_printf("Rate: %ld\n\n", inf->vi.rate); if(inf->vi.bitrate_nominal > 0) debug_printf("Nominal bitrate: %f kb/s\n", (double)inf->vi.bitrate_nominal / 1000.0); else debug_printf("Nominal bitrate not set\n"); if(inf->vi.bitrate_upper > 0) debug_printf("Upper bitrate: %f kb/s\n", (double)inf->vi.bitrate_upper / 1000.0); else debug_printf("Upper bitrate not set\n"); if(inf->vi.bitrate_lower > 0) debug_printf("Lower bitrate: %f kb/s\n", (double)inf->vi.bitrate_lower / 1000.0); else debug_printf("Lower bitrate not set\n"); if(inf->vc.comments > 0) debug_printf ("User comments section follows...\n"); for(i=0; i < inf->vc.comments; i++) { char *sep = strchr(inf->vc.user_comments[i], '='); char *decoded; int j; int broken = 0; unsigned char *val; int bytes; int remaining; if(sep == NULL) { warn(_("Warning: Comment %d in stream %d is invalidly " "formatted, does not contain '=': \"%s\"\n"), i, stream->num, inf->vc.user_comments[i]); continue; } for(j=0; j < sep-inf->vc.user_comments[i]; j++) { if(inf->vc.user_comments[i][j] < 0x20 || inf->vc.user_comments[i][j] > 0x7D) { warn(_("Warning: Invalid comment fieldname in " "comment %d (stream %d): \"%s\"\n"), i, stream->num, inf->vc.user_comments[i]); broken = 1; break; } } if(broken) continue; val = (unsigned char*) inf->vc.user_comments[i]; j = sep-inf->vc.user_comments[i]+1; while(j < inf->vc.comment_lengths[i]) { remaining = inf->vc.comment_lengths[i] - j; if((val[j] & 0x80) == 0) bytes = 1; else if((val[j] & 0x40) == 0x40) { if((val[j] & 0x20) == 0) bytes = 2; else if((val[j] & 0x10) == 0) bytes = 3; else if((val[j] & 0x08) == 0) bytes = 4; else if((val[j] & 0x04) == 0) bytes = 5; else if((val[j] & 0x02) == 0) bytes = 6; else { warn(_("Warning: Illegal UTF-8 sequence in " "comment %d (stream %d): length " "marker wrong\n"), i, stream->num); broken = 1; break; } } else { warn(_("Warning: Illegal UTF-8 sequence in comment " "%d (stream %d): length marker wrong\n"), i, stream->num); broken = 1; break; } if(bytes > remaining) { warn(_("Warning: Illegal UTF-8 sequence in comment " "%d (stream %d): too few bytes\n"), i, stream->num); broken = 1; break; } switch(bytes) { case 1: /* No more checks needed */ break; case 2: if((val[j+1] & 0xC0) != 0x80) broken = 1; if((val[j] & 0xFE) == 0xC0) broken = 1; break; case 3: if(!((val[j] == 0xE0 && val[j+1] >= 0xA0 && val[j+1] <= 0xBF && (val[j+2] & 0xC0) == 0x80) || (val[j] >= 0xE1 && val[j] <= 0xEC && (val[j+1] & 0xC0) == 0x80 && (val[j+2] & 0xC0) == 0x80) || (val[j] == 0xED && val[j+1] >= 0x80 && val[j+1] <= 0x9F && (val[j+2] & 0xC0) == 0x80) || (val[j] >= 0xEE && val[j] <= 0xEF && (val[j+1] & 0xC0) == 0x80 && (val[j+2] & 0xC0) == 0x80))) broken = 1; if(val[j] == 0xE0 && (val[j+1] & 0xE0) == 0x80) broken = 1; break; case 4: if(!((val[j] == 0xF0 && val[j+1] >= 0x90 && val[j+1] <= 0xBF && (val[j+2] & 0xC0) == 0x80 && (val[j+3] & 0xC0) == 0x80) || (val[j] >= 0xF1 && val[j] <= 0xF3 && (val[j+1] & 0xC0) == 0x80 && (val[j+2] & 0xC0) == 0x80 && (val[j+3] & 0xC0) == 0x80) || (val[j] == 0xF4 && val[j+1] >= 0x80 && val[j+1] <= 0x8F && (val[j+2] & 0xC0) == 0x80 && (val[j+3] & 0xC0) == 0x80))) broken = 1; if(val[j] == 0xF0 && (val[j+1] & 0xF0) == 0x80) broken = 1; break; /* 5 and 6 aren't actually allowed at this point*/ case 5: broken = 1; break; case 6: broken = 1; break; } if(broken) { warn(_("Warning: Illegal UTF-8 sequence in comment " "%d (stream %d): invalid sequence\n"), i, stream->num); broken = 1; break; } j += bytes; } if(!broken) { if(utf8_decode(sep+1, &decoded) < 0) { warn(_("Warning: Failure in utf8 decoder. This " "should be impossible\n")); continue; } *sep = 0; debug_printf ("\t%s=%s\n", inf->vc.user_comments[i], decoded); /* GCS FIX: Need case insensitive compare */ if (!strcmp(inf->vc.user_comments[i],"artist") || !strcmp(inf->vc.user_comments[i],"ARTIST") || !strcmp(inf->vc.user_comments[i],"Artist")) { /* GCS FIX: This is a bit funky, maybe I need to get rid of the ogg built-in utf8 decoder */ gstring_from_string (rmi, ti->artist, MAX_TRACK_LEN, decoded, CODESET_LOCALE); } else if (!strcmp(inf->vc.user_comments[i],"title") || !strcmp(inf->vc.user_comments[i],"TITLE") || !strcmp(inf->vc.user_comments[i],"Title")) { /* GCS FIX: This is a bit funky, maybe I need to get rid of the ogg built-in utf8 decoder */ gstring_from_string (rmi, ti->title, MAX_TRACK_LEN, decoded, CODESET_LOCALE); ti->have_track_info = 1; } else if (!strcmp(inf->vc.user_comments[i],"album") || !strcmp(inf->vc.user_comments[i],"ALBUM") || !strcmp(inf->vc.user_comments[i],"Album")) { /* GCS FIX: This is a bit funky, maybe I need to get rid of the ogg built-in utf8 decoder */ gstring_from_string (rmi, ti->album, MAX_TRACK_LEN, decoded, CODESET_LOCALE); } else if (!strcmp(inf->vc.user_comments[i],"tracknumber") || !strcmp(inf->vc.user_comments[i],"TRACKNUMBER") || !strcmp(inf->vc.user_comments[i],"Tracknumber")) { /* GCS FIX: This is a bit funky, maybe I need to get rid of the ogg built-in utf8 decoder */ gstring_from_string (rmi, ti->track_p, MAX_TRACK_LEN, decoded, CODESET_LOCALE); } free(decoded); } } /* Done looping through vorbis comments. If we didn't find a title, give a default title. */ if (!ti->have_track_info) { strncpy (ti->title, "Title Unknown", MAX_TRACK_LEN); ti->have_track_info = 1; } } } } if(!header) { ogg_int64_t gp = ogg_page_granulepos(page); if(gp > 0) { if(gp < inf->lastgranulepos) #ifdef _WIN32 warn(_("Warning: granulepos in stream %d decreases from %I64d to %I64d" ), stream->num, inf->lastgranulepos, gp); #else warn(_("Warning: granulepos in stream %d decreases from %lld to %lld" ), stream->num, inf->lastgranulepos, gp); #endif inf->lastgranulepos = gp; } else { warn(_("Negative granulepos on vorbis stream outside of headers. This file was created by a buggy encoder\n")); } if(inf->firstgranulepos < 0) { /* Not set yet */ } inf->bytes += page->header_len + page->body_len; } return header; } static void vorbis_end(stream_processor *stream) { misc_vorbis_info *inf = stream->data; long minutes, seconds; double bitrate, time; /* This should be lastgranulepos - startgranulepos, or something like that*/ time = (double)inf->lastgranulepos / inf->vi.rate; minutes = (long)time / 60; seconds = (long)time - minutes*60; bitrate = inf->bytes*8 / time / 1000.0; #ifdef _WIN32 debug_printf ("Vorbis stream %d:\n" "\tTotal data length: %I64d bytes\n" "\tPlayback length: %ldm:%02lds\n" "\tAverage bitrate: %f kbps\n", stream->num,inf->bytes, minutes, seconds, bitrate); #else debug_printf ("Vorbis stream %d:\n" "\tTotal data length: %lld bytes\n" "\tPlayback length: %ldm:%02lds\n" "\tAverage bitrate: %f kbps\n", stream->num,inf->bytes, minutes, seconds, bitrate); #endif vorbis_comment_clear(&inf->vc); vorbis_info_clear(&inf->vi); free(stream->data); } static void vorbis_start(stream_processor *stream) { misc_vorbis_info *info; stream->type = "vorbis"; stream->process_end = vorbis_end; stream->data = calloc(1, sizeof(misc_vorbis_info)); info = stream->data; vorbis_comment_init(&info->vc); vorbis_info_init(&info->vi); } void rip_ogg_process_chunk (RIP_MANAGER_INFO* rmi, LIST* page_list, const char* buf, u_long size, TRACK_INFO* ti) { OGG_PAGE_LIST* ol; int header; int ret; char *buffer; // static ogg_int64_t written = 0; // static unsigned int written = 0; // static int ogg_page2 = 0; INIT_LIST_HEAD (page_list); debug_printf ("-- rip_ogg_process_chunk (%d)\n", size); buffer = ogg_sync_buffer (&rmi->ogg_sync, size); memcpy (buffer, buf, size); ogg_sync_wrote (&rmi->ogg_sync, size); do { switch (ret = ogg_sync_pageout (&rmi->ogg_sync, &rmi->ogg_pg)) { case -1: /* -1 if we were not properly synced and had to skip some bytes */ debug_printf ("Hole in ogg, skipping bytes\n"); break; case 0: /* 0 if we need more data to verify a page */ debug_printf ("Ogg needs more data\n"); break; case 1: /* 1 if we have a page */ debug_printf ("Found an ogg page!\n"); /* Do stuff needed for decoding vorbis */ if (ogg_page_bos (&rmi->ogg_pg)) { int rc; ogg_packet packet; ogg_stream_init (&rmi->stream.os, ogg_page_serialno (&rmi->ogg_pg)); ogg_stream_pagein (&rmi->stream.os, &rmi->ogg_pg); rc = ogg_stream_packetout(&rmi->stream.os, &packet); if (rc <= 0) { printf ("Warning: Invalid header page, no packet found\n"); // null_start (&rmi->stream); exit (1); } else if (packet.bytes >= 7 && memcmp(packet.packet, "\001vorbis", 7)==0) { vorbis_start (&rmi->stream); } } header = vorbis_process (rmi, &rmi->stream, &rmi->ogg_pg, ti); if (ogg_page_eos (&rmi->ogg_pg)) { vorbis_end (&rmi->stream); } /* Create ogg page boundary struct */ ol = (OGG_PAGE_LIST*) malloc (sizeof(OGG_PAGE_LIST)); if (!ol) { printf ("Malloc error\n"); exit (1); } ol->m_page_len = rmi->ogg_pg.header_len + rmi->ogg_pg.body_len; ol->m_page_flags = 0; /* ***************************************************** Create header buffer for relay stream. A pointer to the header buffer will attached to all pages after page 2. If a relay connects in the middle of a song, we send the header to the relay. Finally, the memory for the header is freed when the last page of the song is ejected from the cbuf. ** ******************************************************/ if (ogg_page_bos (&rmi->ogg_pg)) { /* First page in song */ ol->m_page_flags |= OGG_PAGE_BOS; ol->m_header_buf_ptr = 0; ol->m_header_buf_len = 0; rmi->ogg_curr_header = (char*) malloc (ol->m_page_len); rmi->ogg_curr_header_len = ol->m_page_len; memcpy (rmi->ogg_curr_header, rmi->ogg_pg.header, rmi->ogg_pg.header_len); memcpy (rmi->ogg_curr_header+rmi->ogg_pg.header_len, rmi->ogg_pg.body, rmi->ogg_pg.body_len); } else if (header) { /* Second or third page in song */ ol->m_page_flags |= OGG_PAGE_2; ol->m_header_buf_ptr = 0; ol->m_header_buf_len = 0; rmi->ogg_curr_header = (char*) realloc (rmi->ogg_curr_header, rmi->ogg_curr_header_len + ol->m_page_len); memcpy (rmi->ogg_curr_header+rmi->ogg_curr_header_len, rmi->ogg_pg.header, rmi->ogg_pg.header_len); memcpy (rmi->ogg_curr_header + rmi->ogg_curr_header_len + rmi->ogg_pg.header_len, rmi->ogg_pg.body, rmi->ogg_pg.body_len); rmi->ogg_curr_header_len += ol->m_page_len; } else if (!ogg_page_eos (&rmi->ogg_pg)) { /* Middle pages in song */ ol->m_header_buf_ptr = rmi->ogg_curr_header; ol->m_header_buf_len = rmi->ogg_curr_header_len; } else { /* Last page in song */ ol->m_page_flags |= OGG_PAGE_EOS; ol->m_header_buf_ptr = rmi->ogg_curr_header; ol->m_header_buf_len = rmi->ogg_curr_header_len; rmi->ogg_curr_header = 0; rmi->ogg_curr_header_len = 0; } debug_printf ("OGG_PAGE\n" " header_len = %d\n" " body_len = %d\n" " serial no = %d\n" " page no = %d\n" " bos? = %d\n" " eos? = %d\n", rmi->ogg_pg.header_len, rmi->ogg_pg.body_len, ogg_page_serialno (&rmi->ogg_pg), ogg_page_pageno (&rmi->ogg_pg), ogg_page_bos (&rmi->ogg_pg), ogg_page_eos (&rmi->ogg_pg)); list_add_tail (&(ol->m_list), page_list); break; } } while (ret != 0); debug_printf ("OGG_SYNC state:\n" " storage = %d\n" " fill = %d\n" " returned = %d\n" " unsynced = %d\n" " headerbytes = %d\n" " bodybytes = %d\n", rmi->ogg_sync.storage, rmi->ogg_sync.fill, rmi->ogg_sync.returned, rmi->ogg_sync.unsynced, rmi->ogg_sync.headerbytes, rmi->ogg_sync.bodybytes); // return 1; } void rip_ogg_get_current_header (RIP_MANAGER_INFO* rmi, char** ptr, int* len) { *ptr = rmi->ogg_curr_header; *len = rmi->ogg_curr_header_len; } void rip_ogg_init (RIP_MANAGER_INFO* rmi) { ogg_sync_init (&rmi->ogg_sync); memset (&rmi->stream, 0, sizeof(stream_processor)); rmi->ogg_curr_header = 0; rmi->ogg_curr_header_len = 0; } #else /* HAVE_OGG_VORBIS == 0 */ void rip_ogg_process_chunk (RIP_MANAGER_INFO* rmi, LIST* page_list, const char* buf, u_long size, TRACK_INFO* ti) { INIT_LIST_HEAD (page_list); } void rip_ogg_get_current_header (RIP_MANAGER_INFO* rmi, char** ptr, int* len) { *ptr = 0; *len = 0; } void rip_ogg_init (RIP_MANAGER_INFO* rmi) { } #endif /* HAVE_OGG_VORBIS */ streamripper-1.64.6.orig/lib/config.h0000644000175000017500000001302411164273454015527 0ustar abiabi/* lib/config.h. Generated from config.h.in by configure. */ /* lib/config.h.in. Generated from configure.ac by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ /* #undef CRAY_STACKSEG_END */ /* Define to 1 if using `alloca.c'. */ /* #undef C_ALLOCA */ /* Define to 1 if you have `alloca', as a function or macro. */ #define HAVE_ALLOCA 1 /* Define to 1 if you have and it should be used (not on Ultrix). */ #define HAVE_ALLOCA_H 1 /* Whether the system has connect() */ #define HAVE_CONNECT 1 /* Define to 1 if you have the header file, and it defines `DIR'. */ #define HAVE_DIRENT_H 1 /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ /* #undef HAVE_DOPRNT */ /* Define to 1 if you have faad2 libraries installed */ #define HAVE_FAAD 1 /* Define if you have the iconv() function. */ #define HAVE_ICONV 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the `iswcntrl' function. */ #define HAVE_ISWCNTRL 1 /* Define if you have and nl_langinfo(CODESET). */ #define HAVE_LANGINFO_CODESET 1 /* Define to 1 if you have the `inet' library (-linet). */ /* #undef HAVE_LIBINET */ /* Define to 1 if you have the `m' library (-lm). */ #define HAVE_LIBM 1 /* Define to 1 if you have the `nsl' library (-lnsl). */ /* #undef HAVE_LIBNSL */ /* Define to 1 if you have the `nsl_s' library (-lnsl_s). */ /* #undef HAVE_LIBNSL_S */ /* Define to 1 if you have the `rt' library (-lrt). */ #define HAVE_LIBRT 1 /* Define to 1 if you have the `sem' library (-lsem). */ /* #undef HAVE_LIBSEM */ /* Define to 1 if you have the `socket' library (-lsocket). */ /* #undef HAVE_LIBSOCKET */ /* Define if you have locale_charset() in . */ /* #undef HAVE_LOCALE_CHARSET */ /* Define to 1 if mbrtowc and mbstate_t are properly declared. */ #define HAVE_MBRTOWC 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `mkdir' function. */ #define HAVE_MKDIR 1 /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ /* Define to 1 if you have both the ogg and vorbis libraries installed */ #define HAVE_OGG_VORBIS 1 /* Define to 1 if you have the `socket' function. */ #define HAVE_SOCKET 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strstr' function. */ #define HAVE_STRSTR 1 /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_SYS_DIR_H */ /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_SYS_NDIR_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_SOCKIO_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if the system has the type `uint32_t'. */ #define HAVE_UINT32_T 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if the system has the type `u_int32_t'. */ #define HAVE_U_INT32_T 1 /* Define to 1 if you have the `vprintf' function. */ #define HAVE_VPRINTF 1 /* Define to 1 if you have the `vswprintf' function. */ #define HAVE_VSWPRINTF 1 /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 /* Define to 1 if the system has the type `wchar_t'. */ #define HAVE_WCHAR_T 1 /* Define to 1 if you have the header file. */ #define HAVE_WCTYPE_H 1 /* Define as const if the declaration of iconv() needs const. */ #define ICONV_CONST /* Name of package */ #define PACKAGE "streamripper" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ #define PACKAGE_NAME "streamripper" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "streamripper 1.64.6" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "streamripper" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.64.6" /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ /* #undef STACK_DIRECTION */ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ #define VERSION "1.64.6" /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif /* Define to `unsigned int' if does not define. */ /* #undef size_t */ /* Substitute for socklen_t */ /* #undef socklen_t */ streamripper-1.64.6.orig/lib/rip_manager.c0000644000175000017500000004230711164223364016542 0ustar abiabi/* rip_manager.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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /****************************************************************************** * Rip Manager API * * Callback Function * void (*status_callback)(RIP_MANAGER_INFO* rmi, * int message, void *data)); * Functions * void rip_manager_init (void); * error_code rip_manager_start (RIP_MANAGER_INFO **rmi, * STREAM_PREFS *prefs, RIP_MANAGER_CALLBACK status_callback); * void rip_manager_stop (RIP_MANAGER_INFO *rmi); * void rip_manager_cleanup (void); * *****************************************************************************/ #include #include #include #include #include #include #if !defined (WIN32) #include #include #include #endif #include "errors.h" #include "filelib.h" #include "socklib.h" #include "mchar.h" #include "findsep.h" #include "relaylib.h" #include "rip_manager.h" #include "ripstream.h" #include "threadlib.h" #include "debug.h" #include "compat.h" #include "parse.h" #include "http.h" /****************************************************************************** * Private functions *****************************************************************************/ static void ripthread (void *thread_arg); static void post_status (RIP_MANAGER_INFO* rmi, int status); static error_code start_ripping (RIP_MANAGER_INFO* rmi); void destroy_subsystems (RIP_MANAGER_INFO* rmi); /****************************************************************************** * Private Vars *****************************************************************************/ static const char* overwrite_opt_strings[] = { "", // UNKNOWN "always", "never", "larger", "version" }; /****************************************************************************** * Public functions *****************************************************************************/ void rip_manager_init (void) { errors_init (); socklib_init(); } /* Create a RMI structure and start the ripping thread */ error_code rip_manager_start (RIP_MANAGER_INFO **rmip, STREAM_PREFS *prefs, RIP_MANAGER_CALLBACK status_callback) { RIP_MANAGER_INFO* rmi; #if __UNIX__ int rc; #endif if (!prefs || !rmip) { return SR_ERROR_INVALID_PARAM; } rmi = (*rmip) = (RIP_MANAGER_INFO*) malloc (sizeof(RIP_MANAGER_INFO)); memset (rmi, 0, sizeof(RIP_MANAGER_INFO)); rmi->prefs = prefs; rmi->started_sem = threadlib_create_sem(); register_codesets (rmi, &prefs->cs_opt); /* From select() man page: On systems that lack pselect() reliable (and more portable) signal trapping can be achieved using the self-pipe trick (where a signal handler writes a byte to a pipe whose other end is mon- itored by select() in the main program. */ #if __UNIX__ rc = pipe (rmi->abort_pipe); if (rc != 0) { return SR_ERROR_CREATE_PIPE_FAILED; } #endif rmi->status_callback = status_callback; rmi->bytes_ripped = 0; rmi->megabytes_ripped = 0; rmi->write_data = 1; /* Initialize the parsing rules */ /* GCS FIX: parser_free() would need to be freed by the caller. But he has no cleanup routine to call! */ init_metadata_parser (rmi, prefs->rules_file); /* Start the ripping thread */ debug_printf ("Pre ripthread: %s\n", rmi->prefs->url); rmi->started = 1; return threadlib_beginthread (&rmi->hthread_ripper, ripthread, (void*) rmi); } void rip_manager_stop (RIP_MANAGER_INFO *rmi) { // Make sure this function isn't getting called twice if (!rmi->started) { debug_printf ("rip_manager_stop() called while not started\n"); return; } /* Write to pipe so ripping thread will exit select() */ #if __UNIX__ debug_printf ("Writing to abort_pipe.\n"); write (rmi->abort_pipe[1], "0", 1); #endif // Make sure the ripping started before we try to stop debug_printf ("Waiting for m_started_sem...\n"); threadlib_waitfor_sem(&rmi->started_sem); rmi->started = 0; // Causes the code running in the thread to bail debug_printf ("Closing stream_sock...\n"); socklib_close(&rmi->stream_sock); // Kill external process if (rmi->ep) { debug_printf ("Close external\n"); close_external (&rmi->ep); } // blocks until everything is ok and closed debug_printf ("Waiting for hthread_ripper to close...\n"); threadlib_waitforclose(&rmi->hthread_ripper); debug_printf ("Destroying subsystems...\n"); destroy_subsystems (rmi); debug_printf ("Destroying m_started_sem\n"); threadlib_destroy_sem(&rmi->started_sem); debug_printf ("Done with rip_manager_stop\n"); /* Close pipes */ #if __UNIX__ debug_printf ("Closing abort_pipe.\n"); close (rmi->abort_pipe[0]); close (rmi->abort_pipe[1]); #endif } void rip_manager_cleanup (void) { socklib_cleanup(); } /****************************************************************************** * Private functions *****************************************************************************/ static void post_error (RIP_MANAGER_INFO* rmi, error_code err) { ERROR_INFO err_info; err_info.error_code = err; strcpy(err_info.error_str, errors_get_string (err)); debug_printf ("post_error: %d %s\n", err_info.error_code, err_info.error_str); rmi->status_callback (rmi, RM_ERROR, &err_info); } static void post_status (RIP_MANAGER_INFO* rmi, int status) { if (status != 0) rmi->status = status; rmi->status_callback (rmi, RM_UPDATE, 0); } static void compose_console_string (RIP_MANAGER_INFO *rmi, TRACK_INFO* ti) { mchar console_string[SR_MAX_PATH]; msnprintf (console_string, SR_MAX_PATH, m_S m_(" - ") m_S, ti->artist, ti->title); string_from_gstring (rmi, rmi->filename, SR_MAX_PATH, console_string, CODESET_LOCALE); } /* * This is called by ripstream when we get a new track. * most logic is handled by filelib_start() so we just * make sure there are no bad characters in the name and * update via the callback */ error_code rip_manager_start_track (RIP_MANAGER_INFO *rmi, TRACK_INFO* ti) { int ret; #if defined (commmentout) /* GCS FIX -- here is where i would compose the incomplete filename */ char* trackname = ti->raw_metadata; debug_printf("rip_manager_start_track: %s\n", trackname); if (rmi->write_data && (ret = filelib_start(trackname)) != SR_SUCCESS) { return ret; } #endif rmi->write_data = ti->save_track; if (rmi->write_data && (ret = filelib_start (rmi, ti)) != SR_SUCCESS) { return ret; } rmi->filesize = 0; /* Compose the string for the console output */ compose_console_string (rmi, ti); rmi->filename[SR_MAX_PATH-1] = '\0'; rmi->status_callback (rmi, RM_NEW_TRACK, (void*) rmi->filename); post_status(rmi, 0); return SR_SUCCESS; } /* Ok, the end_track()'s function is actually to move * tracks out from the incomplete directory. It does * get called, but only after the 2nd track is played. * the first track is *never* complete. */ error_code rip_manager_end_track (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti) { mchar mfullpath[SR_MAX_PATH]; char fullpath[SR_MAX_PATH]; if (rmi->write_data) { filelib_end (rmi, ti, rmi->prefs->overwrite, GET_TRUNCATE_DUPS(rmi->prefs->flags), mfullpath); } post_status(rmi, 0); string_from_gstring (rmi, fullpath, SR_MAX_PATH, mfullpath, CODESET_FILESYS); rmi->status_callback (rmi, RM_TRACK_DONE, (void*)fullpath); return SR_SUCCESS; } error_code rip_manager_put_data (RIP_MANAGER_INFO *rmi, char *buf, int size) { int ret; if (GET_INDIVIDUAL_TRACKS(rmi->prefs->flags)) { if (rmi->write_data) { ret = filelib_write_track (rmi, buf, size); if (ret != SR_SUCCESS) { debug_printf ("filelib_write_track returned: %d\n",ret); return ret; } } } rmi->filesize += size; /* This is used by the GUI */ rmi->bytes_ripped += size; /* This is used to determine when to quit */ while (rmi->bytes_ripped >= 1048576) { rmi->bytes_ripped -= 1048576; rmi->megabytes_ripped++; } return SR_SUCCESS; } char * client_relay_header_generate (RIP_MANAGER_INFO* rmi, int icy_meta_support) { int ret; char *headbuf; headbuf = (char *) malloc (MAX_HEADER_LEN); ret = http_construct_sc_response (&rmi->http_info, headbuf, MAX_HEADER_LEN, icy_meta_support); if (ret != SR_SUCCESS) { headbuf[0] = 0; } return headbuf; } void client_relay_header_release (char *ch) { free (ch); } static void debug_ripthread (RIP_MANAGER_INFO* rmi) { debug_printf ("------ RIP_MANAGER_INFO -------\n"); debug_printf ("streamname = %s\n", rmi->streamname); debug_printf ("server_name = %s\n", rmi->server_name); debug_printf ("bitrate = %d\n", rmi->bitrate); debug_printf ("meta_interval = %d\n", rmi->meta_interval); debug_printf ("filename = %s\n", rmi->filename); debug_printf ("filesize = %d\n", rmi->filesize); debug_printf ("status = %d\n", rmi->status); debug_printf ("track_count = %d\n", rmi->track_count); debug_printf ("external_process = %p\n", rmi->ep); } static void ripthread (void *thread_arg) { error_code ret; RIP_MANAGER_INFO* rmi = (RIP_MANAGER_INFO*) thread_arg; debug_ripthread (rmi); debug_stream_prefs (rmi->prefs); /* Connect to remote server */ ret = start_ripping (rmi); if (ret != SR_SUCCESS) { debug_printf ("Ripthread did start_ripping()\n"); threadlib_signal_sem (&rmi->started_sem); post_error (rmi, ret); goto DONE; } rmi->status_callback (rmi, RM_STARTED, (void *)NULL); post_status (rmi, RM_STATUS_BUFFERING); debug_printf ("Ripthread did initialization\n"); threadlib_signal_sem(&rmi->started_sem); while (TRUE) { debug_printf ("Gonna ripstream_rip\n"); ret = ripstream_rip(rmi); debug_printf ("Did ripstream_rip\n"); if (!rmi->started) { break; } else if (rmi->megabytes_ripped >= rmi->prefs->maxMB_rip_size && GET_CHECK_MAX_BYTES (rmi->prefs->flags)) { /* GCS Aug 23, 2003: bytes_ripped can still overflow */ socklib_close (&rmi->stream_sock); destroy_subsystems (rmi); //post_error (rmi, SR_ERROR_MAX_BYTES_RIPPED); break; } else if (ret == SR_SUCCESS_BUFFERING) { post_status (rmi, RM_STATUS_BUFFERING); /* Fall through */ } else if (ret == SR_ERROR_CANT_DECODE_MP3) { post_error (rmi, ret); continue; } else if ((ret == SR_ERROR_RECV_FAILED || ret == SR_ERROR_TIMEOUT || ret == SR_ERROR_NO_TRACK_INFO || ret == SR_ERROR_SELECT_FAILED) && GET_AUTO_RECONNECT (rmi->prefs->flags)) { /* Try to reconnect */ post_status (rmi, RM_STATUS_RECONNECTING); while (rmi->started) { socklib_close(&rmi->stream_sock); if (rmi->ep) { debug_printf ("Close external\n"); close_external (&rmi->ep); } destroy_subsystems (rmi); ret = start_ripping (rmi); if (ret == SR_SUCCESS) break; Sleep(1000); } if (!rmi->started) { break; } /* Fall through */ } else if (ret == SR_ERROR_ABORT_PIPE_SIGNALLED) { /* Normal exit condition CTRL-C on unix */ destroy_subsystems (rmi); break; } else if (ret != SR_SUCCESS) { destroy_subsystems (rmi); post_error (rmi, ret); break; } /* All systems go. Caller should update GUI that it is ripping */ if (rmi->filesize > 0) { post_status (rmi, RM_STATUS_RIPPING); } } // We get here when there was either a fatal error // or we we're not auto-reconnecting and the stream just stopped // or when we have been told to stop, via the rmi->started flag DONE: rmi->status_callback (rmi, RM_DONE, 0); rmi->started = 0; debug_printf ("ripthread() exiting!\n"); } void destroy_subsystems (RIP_MANAGER_INFO* rmi) { ripstream_clear (rmi); relaylib_stop (rmi); /* GCS Feb 17,2008. The socklib_cleanup() is done at program shutdown, not rip_manager shutdown. */ // socklib_cleanup(); filelib_shutdown (rmi); } static int create_pls_file (RIP_MANAGER_INFO* rmi) { FILE *fid; if ('\0' == rmi->prefs->relay_ip[0]) { fprintf(stderr, "can not determine relaying ip, pass ip to -r \n"); return -1; } fid = fopen (rmi->prefs->pls_file, "w"); if (NULL == fid) { fprintf(stderr, "could not create playlist file '%s': %d '%s'\n", rmi->prefs->pls_file, errno, strerror(errno)); } else { fprintf(fid, "[playlist]\n"); fprintf(fid, "NumberOfEntries=1\n"); fprintf(fid, "File1=http://%s:%d\n", rmi->prefs->relay_ip, rmi->prefs->relay_port); fclose(fid); } return 0; } static error_code start_ripping (RIP_MANAGER_INFO* rmi) { STREAM_PREFS* prefs = rmi->prefs; error_code ret; const char *pproxy = prefs->proxyurl[0] ? prefs->proxyurl : NULL; debug_printf ("start_ripping: checkpoint 1\n"); /* If proxy URL not spec'd on command line (or plugin field), check the environment variable */ if (!pproxy) { char const *env_http_proxy = getenv ("http_proxy"); if (env_http_proxy) { pproxy = env_http_proxy; debug_printf ("Getting proxy from $http_proxy: %s\n", pproxy); } } debug_printf ("start_ripping: checkpoint 2\n"); /* Connect to the stream */ ret = http_sc_connect (rmi, &rmi->stream_sock, prefs->url, pproxy, &rmi->http_info, prefs->useragent, prefs->if_name); if (ret != SR_SUCCESS) { debug_printf ("http_sc_connect() returned error\n"); goto RETURN_ERR; } /* If the icy_name exists, but is empty, set to a bogus name so that we can create the directory correctly, etc. */ if (strlen(rmi->http_info.icy_name) == 0) { strcpy (rmi->http_info.icy_name, "Streamripper_rips"); } /* Set the ripinfo struct from the data we now know about the * stream, this info are things like server name, type, * bitrate etc.. */ rmi->meta_interval = rmi->http_info.meta_interval; rmi->http_bitrate = rmi->http_info.icy_bitrate; rmi->detected_bitrate = -1; rmi->bitrate = -1; strcpy (rmi->streamname, rmi->http_info.icy_name); strcpy (rmi->server_name, rmi->http_info.server); /* Initialize file writing code. */ ret = filelib_init (rmi, GET_INDIVIDUAL_TRACKS(rmi->prefs->flags), GET_COUNT_FILES(rmi->prefs->flags), rmi->prefs->count_start, GET_KEEP_INCOMPLETE(rmi->prefs->flags), GET_SINGLE_FILE_OUTPUT(rmi->prefs->flags), rmi->http_info.content_type, rmi->prefs->output_directory, rmi->prefs->output_pattern, rmi->prefs->showfile_pattern, GET_SEPARATE_DIRS(rmi->prefs->flags), GET_DATE_STAMP(rmi->prefs->flags), rmi->http_info.icy_name); if (ret != SR_SUCCESS) { debug_printf ("filelib_init() returned error\n"); goto RETURN_ERR; } /* Start up external program to get metadata. */ rmi->ep = 0; if (GET_EXTERNAL_CMD(rmi->prefs->flags)) { debug_printf ("Spawn external: %s\n", rmi->prefs->ext_cmd); rmi->ep = spawn_external (rmi->prefs->ext_cmd); if (rmi->ep) { debug_printf ("Spawn external succeeded\n"); } else { debug_printf ("Spawn external failed\n"); } } /* Allocate buffers for ripstream */ strcpy(rmi->no_meta_name, rmi->http_info.icy_name); rmi->getbuffer = 0; ripstream_clear (rmi); ret = ripstream_init(rmi); if (ret != SR_SUCCESS) { ripstream_clear (rmi); goto RETURN_ERR; } /* Launch relay server threads */ if (GET_MAKE_RELAY (rmi->prefs->flags)) { u_short new_port = 0; ret = relaylib_start (rmi, GET_SEARCH_PORTS(rmi->prefs->flags), rmi->prefs->relay_port, rmi->prefs->max_port, &new_port, rmi->prefs->if_name, rmi->prefs->max_connections, rmi->prefs->relay_ip, rmi->http_info.meta_interval != NO_META_INTERVAL); if (ret != SR_SUCCESS) { goto RETURN_ERR; } rmi->prefs->relay_port = new_port; /* Create pls file with address of relay stream */ if (0 != rmi->prefs->pls_file[0]) { create_pls_file (rmi); } } /* Done. */ post_status (rmi, RM_STATUS_BUFFERING); return SR_SUCCESS; RETURN_ERR: socklib_close(&rmi->stream_sock); return ret; } /* Winamp plugin needs to get content type */ int rip_manager_get_content_type (RIP_MANAGER_INFO* rmi) { return rmi->http_info.content_type; } enum OverwriteOpt string_to_overwrite_opt (char* str) { int i; for (i = 0; i < 5; i++) { if (strcmp(str, overwrite_opt_strings[i]) == 0) { return i; } } return OVERWRITE_UNKNOWN; } const char* overwrite_opt_to_string (enum OverwriteOpt oo) { return overwrite_opt_strings[(int) oo]; } streamripper-1.64.6.orig/lib/http.h0000644000175000017500000000147410764562236015253 0ustar abiabi#ifndef __HTTP_H__ #define __HTTP_H__ #include "rip_manager.h" #include "srtypes.h" error_code http_parse_sc_header(const char* url, char *header, SR_HTTP_HEADER *info); error_code http_construct_sc_request(const char *url, const char* proxyurl, char *buffer, char *useragent); error_code http_construct_page_request(const char *url, BOOL proxyformat, char *buffer); error_code http_construct_sc_response(SR_HTTP_HEADER *info, char *header, int size, int icy_meta_support); error_code inet_get_webpage_alloc(HSOCKET *sock, const char *url, const char *proxyurl, char **buffer, unsigned long *size); error_code http_sc_connect (RIP_MANAGER_INFO* rmi, HSOCKET *sock, const char *url, const char *proxyurl, SR_HTTP_HEADER *info, char *useragent, char *if_name); #endif //__HTTP_H__ streamripper-1.64.6.orig/lib/debug.c0000644000175000017500000000615011004740701015330 0ustar abiabi/* debug.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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include "srtypes.h" #include "threadlib.h" #include "rip_manager.h" #include "mchar.h" #include "debug.h" #if WIN32 #define vsnprintf _vsnprintf #define vswprintf _vsnwprintf #else /* This prototype is missing in some systems */ int vswprintf (wchar_t * ws, size_t n, const wchar_t * format, va_list arg); #endif /***************************************************************************** * Public functions *****************************************************************************/ #define DEBUG_BUF_LEN 2048 int debug_on = 0; FILE* gcsfp = 0; static HSEM m_debug_lock; static char* debug_filename = 0; static char filename_buf[SR_MAX_PATH]; static char* default_filename = "gcs.txt"; static int debug_initialized = 0; void debug_set_filename (char* filename) { sr_strncpy (filename_buf, filename, SR_MAX_PATH); debug_filename = filename_buf; } void debug_enable (void) { debug_on = 1; if (!debug_filename) { debug_filename = default_filename; } } void debug_open (void) { if (!debug_on) return; if (!gcsfp) { gcsfp = fopen(debug_filename, "a"); if (!gcsfp) { debug_on = 0; } } } void debug_close (void) { if (!debug_on) return; if (gcsfp) { fclose(gcsfp); gcsfp = 0; } } void debug_printf (char* fmt, ...) { int was_open = 1; va_list argptr; if (!debug_on) { return; } if (!debug_initialized) { m_debug_lock = threadlib_create_sem(); threadlib_signal_sem(&m_debug_lock); } threadlib_waitfor_sem (&m_debug_lock); va_start (argptr, fmt); if (!gcsfp) { was_open = 0; debug_open(); if (!gcsfp) return; } if (!debug_initialized) { debug_initialized = 1; fprintf (gcsfp, "=========================\n"); fprintf (gcsfp, "STREAMRIPPER " SRPLATFORM " " SRVERSION "\n"); } vfprintf (gcsfp, fmt, argptr); fflush (gcsfp); va_end (argptr); if (!was_open) { debug_close (); } threadlib_signal_sem (&m_debug_lock); } void debug_print_error (void) { #if defined (WIN32) LPVOID lpMsgBuf; FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &lpMsgBuf, 0, NULL ); debug_printf ("%s", lpMsgBuf); LocalFree (lpMsgBuf); #endif } streamripper-1.64.6.orig/lib/threadlib.c0000644000175000017500000000367710755655513016235 0ustar abiabi/* threadlib.c - jonclegg@yahoo.com * really bad threading library from hell * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if WIN32 #include #include #elif __UNIX__ #include #elif __BEOS__ #include #endif #include #include #include "srtypes.h" #include "threadlib.h" #include "debug.h" /****************************************************************************** * Public functions *****************************************************************************/ error_code threadlib_beginthread (THREAD_HANDLE *thread, void (*callback)(void *), void* arg) { BeginThread (*thread, callback, arg); //if (thread->thread_handle == NULL) // don't feel like porting this // return SR_ERROR_CANT_CREATE_THREAD; return SR_SUCCESS; } void threadlib_waitforclose (THREAD_HANDLE *thread) { WaitForThread (*thread); } HSEM threadlib_create_sem () { HSEM s; SemInit (s); return s; } error_code threadlib_waitfor_sem (HSEM *e) { if (!e) return SR_ERROR_INVALID_PARAM; SemWait (*e); return SR_SUCCESS; } error_code threadlib_signal_sem(HSEM *e) { if (!e) return SR_ERROR_INVALID_PARAM; SemPost (*e); return SR_SUCCESS; } void threadlib_destroy_sem (HSEM *e) { DestroyThread (*e); } streamripper-1.64.6.orig/lib/http.c0000644000175000017500000006156311121044655015237 0ustar abiabi/* 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include "compat.h" #include "srtypes.h" #include "socklib.h" #include "http.h" #include "mchar.h" /* for substrn_until, etc. */ #include "debug.h" /****************************************************************************** * Function prototypes *****************************************************************************/ static char* make_auth_header(const char *header_name, const char *username, const char *password); static char* b64enc(const char *buf, int size); static error_code http_get_pls (RIP_MANAGER_INFO* rmi, HSOCKET *sock, SR_HTTP_HEADER *info); static error_code http_get_m3u (RIP_MANAGER_INFO* rmi, HSOCKET *sock, SR_HTTP_HEADER *info); static error_code http_get_sc_header(RIP_MANAGER_INFO* rmi, const char* url, HSOCKET *sock, SR_HTTP_HEADER *info); static error_code http_parse_url(const char *url, URLINFO *urlinfo); /****************************************************************************** * Private Vars *****************************************************************************/ #define MAX_PLS_LEN 8192 #define MAX_M3U_LEN 8192 /****************************************************************************** * Public functions *****************************************************************************/ /* Connect to a shoutcast type stream, leaves when it's about to get the header info */ error_code http_sc_connect (RIP_MANAGER_INFO* rmi, HSOCKET *sock, const char *url, const char *proxyurl, SR_HTTP_HEADER *info, char *useragent, char *if_name) { char headbuf[MAX_HEADER_LEN]; URLINFO url_info; int ret; while (1) { debug_printf ("***** URL = %s *****\n", url); debug_printf("http_sc_connect(): calling http_parse_url\n"); if (proxyurl) { debug_printf ("***** PROXY = %s *****\n", proxyurl); if ((ret = http_parse_url (proxyurl, &url_info)) != SR_SUCCESS) { return ret; } } else if ((ret = http_parse_url (url, &url_info)) != SR_SUCCESS) { return ret; } debug_printf("http_sc_connect(): calling socklib_init\n"); if ((ret = socklib_init()) != SR_SUCCESS) return ret; debug_printf ("http_sc_connect(): calling socklib_open" " host=%s, port=%d\n", url_info.host, url_info.port); ret = socklib_open (sock, url_info.host, url_info.port, if_name, rmi->prefs->timeout); if (ret != SR_SUCCESS) { return ret; } debug_printf("http_sc_connect(): calling http_construct_sc_request\n"); ret = http_construct_sc_request (url, proxyurl, headbuf, useragent); if (ret != SR_SUCCESS) { return ret; } debug_printf("http_sc_connect(): calling socklib_sendall\n"); ret = socklib_sendall (sock, headbuf, strlen(headbuf)); if (ret < 0) { return ret; } debug_printf("http_sc_connect(): calling http_get_sc_header\n"); if ((ret = http_get_sc_header(rmi, url, sock, info)) != SR_SUCCESS) return ret; if (*info->http_location) { /* RECURSIVE CASE */ debug_printf ("Redirecting: %s\n", info->http_location); url = info->http_location; return http_sc_connect (rmi, sock, info->http_location, proxyurl, info, useragent, if_name); } else { break; } } return SR_SUCCESS; } /****************************************************************************** * Private functions *****************************************************************************/ /* See http://www.ietf.org/rfc/rfc3986.txt */ static void unescape_pct_encoding (char* s) { char* d = s; char c[3]; while (*s) { if (*s == '%' && isxdigit(*(s+1)) && isxdigit(*(s+2))) { c[0] = *(s+1); c[1] = *(s+2); c[2] = 0; *d++ = (char) strtol (c, 0, 16); s += 3; } else { *d++ = *s++; } } *d = 0; } /* * Parse's a url as in http://host:port/path or host/path, etc.. * and now http://username:password@server:4480 */ static error_code http_parse_url(const char *url, URLINFO *urlinfo) { int ret; char *s; debug_printf ("http_parse_url: %s\n", url); /* if we have a proto, just skip it. should we care about the proto? like fail if it's not http? */ s = strstr(url, "://"); if (s) url = s + strlen("://"); memcpy(urlinfo->path, (void *)"/\0", 2); /* search for a login '@' token */ if (strchr(url, '@') != NULL) { ret = sscanf(url, "%1023[^:]:%1023[^@]", urlinfo->username, urlinfo->password); if (ret < 1) { return SR_ERROR_PARSE_FAILURE; } else if (ret == 1) { urlinfo->password[0] = '\0'; } url = strchr(url, '@') + 1; debug_printf ("Username (escaped): %s\n", urlinfo->username); debug_printf ("Password (escaped): %s\n", urlinfo->password); unescape_pct_encoding (urlinfo->username); unescape_pct_encoding (urlinfo->password); debug_printf ("Username (unescaped): %s\n", urlinfo->username); debug_printf ("Password (unescaped): %s\n", urlinfo->password); } else { urlinfo->username[0] = '\0'; urlinfo->password[0] = '\0'; } /* search for a port seperator */ if (strchr(url, ':') != NULL) { debug_printf ("Branch 1 (%s)\n", url); ret = sscanf(url, "%511[^:]:%hu/%252s", urlinfo->host, (short unsigned int*)&urlinfo->port, urlinfo->path+1); if (urlinfo->port < 1) return SR_ERROR_PARSE_FAILURE; ret -= 1; } else { debug_printf ("Branch 2 (%s)\n", url); urlinfo->port = 80; ret = sscanf(url, "%511[^/]/%252s", urlinfo->host, urlinfo->path+1); } if (ret < 1) return SR_ERROR_INVALID_URL; return SR_SUCCESS; } error_code http_construct_sc_request(const char *url, const char* proxyurl, char *buffer, char *useragent) { int ret; URLINFO ui; URLINFO proxyui; char myurl[MAX_URL_LEN]; if ((ret = http_parse_url(url, &ui)) != SR_SUCCESS) return ret; if (proxyurl) { sprintf(myurl, "http://%s:%d%s", ui.host, ui.port, ui.path); if ((ret = http_parse_url(proxyurl, &proxyui)) != SR_SUCCESS) return ret; } else { strcpy(myurl, ui.path); } #if defined (commentout) /* This is the old header */ snprintf(buffer, MAX_HEADER_LEN + MAX_HOST_LEN + SR_MAX_PATH, "GET %s HTTP/1.0\r\n" "Host: %s:%d\r\n" "User-Agent: %s\r\n" "Icy-MetaData:1\r\n", myurl, ui.host, ui.port, useragent[0] ? useragent : "Streamripper/1.x"); #endif /* This is the header suggested Florian Stoehr */ snprintf(buffer, MAX_HEADER_LEN + MAX_HOST_LEN + SR_MAX_PATH, "GET %s HTTP/1.1\r\n" "Accept: */*\r\n" "Cache-Control: no-cache\r\n" "User-Agent: %s\r\n" "Icy-Metadata: 1\r\n" "Connection: close\r\n" "Host: %s:%d\r\n", myurl, useragent[0] ? useragent: "Streamripper/1.x", ui.host, ui.port); // http authentication (not proxy, see below for that) if (ui.username[0] && ui.password[0]) { char *authbuf = make_auth_header("Authorization", ui.username, ui.password); strcat(buffer, authbuf); free(authbuf); } #if defined (commentout) // proxy auth stuff if (proxyurl && proxyui.username[0] && proxyui.password[0]) { char *authbuf = make_auth_header("Proxy-Authorization", proxyui.username, proxyui.password); strcat(buffer, authbuf); free(authbuf); } #endif /* GCS Testing... Proxy authentication w/o password bug */ if (proxyurl && proxyui.username[0]) { char *authbuf = make_auth_header("Proxy-Authorization", proxyui.username, proxyui.password); strcat(buffer, authbuf); free(authbuf); } strcat(buffer, "\r\n"); debug_printf ("SC REQUEST:\n%s", buffer); return SR_SUCCESS; } // Make the 'Authorization: Basic xxxxxx\r\n' or 'Proxy-Authorization...' // headers for the HTTP request. static char* make_auth_header (const char *header_name, const char *username, const char *password) { char *authbuf = malloc(strlen(header_name) + strlen(username) + strlen(password) + MAX_URI_STRING); char *auth64; sprintf(authbuf, "%s:%s", username, password); auth64 = b64enc(authbuf, strlen(authbuf)); sprintf(authbuf, "%s: Basic %s\r\n", header_name, auth64); free(auth64); return authbuf; } // Here we pretend we're IE 5, hehe error_code http_construct_page_request (const char *url, BOOL proxyformat, char *buffer) { int ret; URLINFO ui; char myurl[MAX_URL_LEN]; if ((ret = http_parse_url(url, &ui)) != SR_SUCCESS) return ret; if (proxyformat) sprintf(myurl, "http://%s:%d%s", ui.host, ui.port, ui.path); else strcpy(myurl, ui.path); snprintf(buffer, MAX_HEADER_LEN + MAX_HOST_LEN + SR_MAX_PATH, "GET %s HTTP/1.0\r\n" "Host: %s:%d\r\n" "Accept: */*\r\n" "Accept-Language: en-us\r\n" "Accept-Encoding: gzip, deflate\r\n" "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\r\n" "Connection: Keep-Alive\r\n\r\n", myurl, ui.host, ui.port); return SR_SUCCESS; } /* Return 1 if a match was found, 0 if not found */ int extract_header_value (char *header, char *dest, char *match, int maxlen) { char* start = (char *)strstr(header, match); if (start) { subnstr_until(start+strlen(match), "\n", dest, maxlen); return 1; } else { return 0; } } error_code http_parse_sc_header (const char *url, char *header, SR_HTTP_HEADER *info) { int rc; char *start; char versionbuf[64]; char stempbr[MAX_ICY_STRING]; URLINFO url_info; int url_path_len; int content_type_by_url; if (!header || !info) return SR_ERROR_INVALID_PARAM; /* Parse the url here, before doing memset, because in the recursive case, it is the location referrer */ rc = http_parse_url (url, &url_info); if (rc != SR_SUCCESS) return rc; memset(info, 0, sizeof(SR_HTTP_HEADER)); debug_printf("http header:\n%s\n", header); // Get the ICY code. start = (char *)strstr(header, "ICY "); if (!start) { start = (char *)strstr(header, "HTTP/1."); if (!start) { debug_printf ("Failed to find ICY or HTTP\n"); return SR_ERROR_NO_RESPONSE_HEADER; } } start = strstr(start, " ") + 1; sscanf(start, "%i", &info->icy_code); if (info->icy_code >= 400) { switch (info->icy_code) { case 400: return SR_ERROR_HTTP_400_ERROR; case 404: return SR_ERROR_HTTP_404_ERROR; case 401: return SR_ERROR_HTTP_401_ERROR; case 403: return SR_ERROR_HTTP_403_ERROR; case 407: return SR_ERROR_HTTP_407_ERROR; case 502: return SR_ERROR_HTTP_502_ERROR; default: return SR_ERROR_NO_ICY_CODE; } } // read generic headers extract_header_value(header, info->http_location, "Location:", sizeof(info->http_location)); extract_header_value(header, info->server, "Server:", sizeof(info->server)); rc = extract_header_value(header, info->icy_name, "icy-name:", sizeof(info->icy_name)); if (rc == 0) { /* Icecast 2.0.1 */ rc = extract_header_value(header, info->icy_name, "ice-name:", sizeof(info->icy_name)); } info->have_icy_name = rc; extract_header_value(header, info->icy_url, "icy-url:", sizeof(info->icy_url)); rc = extract_header_value(header, stempbr, "icy-br:", sizeof(stempbr)); if (rc) { info->icy_bitrate = atoi(stempbr); } /* interpret the content type from http header */ rc = extract_header_value(header, stempbr, "Content-Type:", sizeof(stempbr)); if (rc == 0) { rc = extract_header_value(header, stempbr, "content-type:", sizeof(stempbr)); } if (rc == 0) { info->content_type = CONTENT_TYPE_UNKNOWN; } else if (strstr(stempbr,"audio/mpeg")) { info->content_type = CONTENT_TYPE_MP3; } else if (strstr(stempbr,"video/nsv")) { info->content_type = CONTENT_TYPE_NSV; } else if (strstr(stempbr,"misc/ultravox")) { info->content_type = CONTENT_TYPE_ULTRAVOX; } else if (strstr(stempbr,"application/ogg")) { info->content_type = CONTENT_TYPE_OGG; } else if (strstr(stempbr,"audio/aac")) { info->content_type = CONTENT_TYPE_AAC; } else if (strstr(stempbr,"audio/x-scpls")) { info->content_type = CONTENT_TYPE_PLS; } else if (strstr(stempbr,"text/html")) { if (!info->http_location[0]) { return SR_ERROR_NO_RESPONSE_HEADER; } } else { info->content_type = CONTENT_TYPE_UNKNOWN; } /* Look at url for more content type hints */ url_path_len = strlen(url_info.path); content_type_by_url = CONTENT_TYPE_UNKNOWN; if (url_path_len >= 4) { if (!strcmp (&url_info.path[url_path_len-4], ".aac")) { content_type_by_url = CONTENT_TYPE_AAC; } else if (!strcmp (&url_info.path[url_path_len-4], ".ogg")) { content_type_by_url = CONTENT_TYPE_OGG; } else if (!strcmp (&url_info.path[url_path_len-4], ".mp3")) { content_type_by_url = CONTENT_TYPE_MP3; } else if (!strcmp (&url_info.path[url_path_len-4], ".nsv")) { content_type_by_url = CONTENT_TYPE_NSV; } else if (!strcmp (&url_info.path[url_path_len-4], ".pls")) { content_type_by_url = CONTENT_TYPE_PLS; } else if (!strcmp (&url_info.path[url_path_len-4], ".m3u")) { content_type_by_url = CONTENT_TYPE_M3U; } } // Try to guess the server // Check for Streamripper relay if ((start = (char *)strstr(header, "[relay stream]")) != NULL) { strcpy(info->server, "Streamripper relay server"); } // Check for Shoutcast else if ((start = (char *)strstr(header, "SHOUTcast")) != NULL) { strcpy(info->server, "SHOUTcast/"); if ((start = (char *)strstr(start, "Server/")) != NULL) { sscanf(start, "Server/%63[^<]<", versionbuf); strcat(info->server, versionbuf); } } // Check for Icecast 2 else if ((start = (char *)strstr(header, "Icecast 2")) != NULL) { /* aac on icecast 2.0-2.1 declares content type of audio/mpeg */ /* In addition, there is at least one stream with a url radioorenovscotia.ogg, but is actually audio/mpeg */ if (info->content_type == CONTENT_TYPE_MP3 && content_type_by_url != CONTENT_TYPE_UNKNOWN && content_type_by_url != CONTENT_TYPE_OGG) { info->content_type = content_type_by_url; } } // Check for Icecast 1 else if ((start = (char *)strstr(header, "icecast")) != NULL) { if (!info->server[0]) { strcpy(info->server, "icecast/"); if ((start = (char *)strstr(start, "version ")) != NULL) { sscanf(start, "version %63[^<]<", versionbuf); strcat(info->server, versionbuf); } } // icecast 1.x headers. extract_header_value(header, info->icy_url, "x-audiocast-server-url:", sizeof(info->icy_url)); rc = extract_header_value(header, info->icy_name, "x-audiocast-name:", sizeof(info->icy_name)); info->have_icy_name |= rc; extract_header_value(header, info->icy_genre, "x-audiocast-genre:", sizeof(info->icy_genre)); rc = extract_header_value(header, stempbr, "x-audiocast-bitrate:", sizeof(stempbr)); if (rc) { info->icy_bitrate = atoi(stempbr); } } // Check for Apache else if (((start = (char *)strstr(header, "Apache")) != NULL) && ((start = (char *)strstr(header, "x-audiocast-name")) != NULL)) { // Streaming straight from apache with audiocast headers extract_header_value(header, info->icy_url, "x-audiocast-server-url:", sizeof(info->icy_url)); rc = extract_header_value(header, info->icy_name, "x-audiocast-name:", sizeof(info->icy_name)); info->have_icy_name |= rc; extract_header_value(header, info->icy_genre, "x-audiocast-genre:", sizeof(info->icy_genre)); rc = extract_header_value(header, stempbr, "x-audiocast-bitrate:", sizeof(stempbr)); if (rc) { info->icy_bitrate = atoi(stempbr); } } /* Last chance to deduce content type */ if (info->content_type == CONTENT_TYPE_UNKNOWN) { if (content_type_by_url == CONTENT_TYPE_UNKNOWN) { info->content_type = CONTENT_TYPE_MP3; } else { info->content_type = content_type_by_url; } } debug_printf ("Deduced content type: %d\n", info->content_type); // Make sure we don't have any CRLF's at the end of our strings trim(info->icy_url); trim(info->icy_genre); trim(info->icy_name); trim(info->http_location); trim(info->server); //get the meta interval start = (char*)strstr(header, "icy-metaint:"); if (start) { sscanf(start, "icy-metaint:%i", &info->meta_interval); if (info->meta_interval < 1) { info->meta_interval = NO_META_INTERVAL; #if defined (commentout) /* GCS: I don't think we want an error here. */ return SR_ERROR_NO_META_INTERVAL; #endif } } else { info->meta_interval = NO_META_INTERVAL; } return SR_SUCCESS; } /* * Constructs a HTTP response header from the SR_HTTP_HEADER struct, if data is null it is not * added to the header */ error_code http_construct_sc_response(SR_HTTP_HEADER *info, char *header, int size, int icy_meta_support) { char *buf = (char *)malloc(size); #if defined (commentout) char* test_header = "HTTP/1.0 200 OK\r\n" "Content-Type: application/ogg\r\n" "ice-audio-info: ice-samplerate=44100\r\n" "ice-bitrate: Quality 0\r\n" "ice-description: This is my server desription\r\n" "ice-genre: Rock\r\n" "ice-name: This is my server desription\r\n" "ice-private: 0\r\n" "ice-public: 1\r\n" "ice-url: http://www.oddsock.org\r\n" "Server: Icecast 2.0.1\r\n\r\n"; #endif if (!info || !header || size < 1) return SR_ERROR_INVALID_PARAM; memset(header, 0, size); #if defined (commentout) /* GCS - try this */ strcpy (header, test_header); return SR_SUCCESS; #endif /* GCS: The code used to give HTTP instead of ICY for the response header, like this: sprintf(buf, "HTTP/1.0 200 OK\r\n"); */ sprintf (buf, "ICY 200 OK\r\n"); strcat(header, buf); if (info->http_location[0]) { sprintf(buf, "Location:%s\r\n", info->http_location); strcat(header, buf); } if (info->server[0]) { sprintf(buf, "Server:%s\r\n", info->server); strcat(header, buf); } #if defined (commentout) if (info->icy_name[0]) { sprintf(buf, "icy-name:%s\r\n", info->icy_name); strcat(header, buf); } #endif if (info->have_icy_name) { sprintf(buf, "icy-name:%s\r\n", info->icy_name); strcat(header, buf); } if (info->icy_url[0]) { sprintf(buf, "icy-url:%s\r\n", info->icy_url); strcat(header, buf); } if (info->icy_bitrate) { sprintf(buf, "icy-br:%d\r\n", info->icy_bitrate); strcat(header, buf); } if (info->icy_genre[0]) { sprintf(buf, "icy-genre:%s\r\n", info->icy_genre); strcat(header, buf); } if ((info->meta_interval > 0) && icy_meta_support) { sprintf(buf, "icy-metaint:%d\r\n", info->meta_interval); strcat(header, buf); } switch (info->content_type) { case CONTENT_TYPE_MP3: sprintf (buf, "Content-Type: audio/mpeg\r\n"); strcat(header, buf); break; case CONTENT_TYPE_NSV: sprintf (buf, "Content-Type: video/nsv\r\n"); strcat(header, buf); break; case CONTENT_TYPE_OGG: sprintf (buf, "Content-Type: application/ogg\r\n"); strcat(header, buf); break; case CONTENT_TYPE_ULTRAVOX: sprintf (buf, "Content-Type: misc/ultravox\r\n"); strcat(header, buf); break; case CONTENT_TYPE_AAC: sprintf (buf, "Content-Type: audio/aac\r\n"); strcat(header, buf); break; } free(buf); strcat(header, "\r\n"); debug_printf ("Constructed response header:\n"); debug_printf ("%s", header); return SR_SUCCESS; } /* [playlist] numberofentries=1 File1=http://localhost:8000/ Title1=(#1 - 530/18385) GCS hit radio Length1=-1 Version=2 */ static error_code http_get_pls (RIP_MANAGER_INFO* rmi, HSOCKET *sock, SR_HTTP_HEADER *info) { int s, bytes; error_code rc; char buf[MAX_PLS_LEN]; char location_buf[MAX_PLS_LEN]; char title_buf[MAX_PLS_LEN]; debug_printf ("Reading pls\n"); bytes = socklib_recvall (rmi, sock, buf, MAX_PLS_LEN, rmi->prefs->timeout); if (bytes < SR_SUCCESS) return bytes; if (bytes == 0 || bytes == MAX_PLS_LEN) { debug_printf("Failed in getting PLS (%d bytes)\n", bytes); return SR_ERROR_CANT_PARSE_PLS; } buf[bytes] = 0; debug_printf ("Parsing pls\n"); debug_printf ("%s\n", buf); debug_printf ("---\n"); rc = SR_ERROR_CANT_PARSE_PLS; for (s = 1; s <= 99; s++) { char buf1[20]; int num_scanned, used, total, open; int best_open = 0; sprintf (buf1, "File%d=", s); if (!extract_header_value (buf, location_buf, buf1, sizeof(location_buf))) { break; } if (s == 1) { sr_strncpy (info->http_location, location_buf, MAX_HOST_LEN); rc = SR_SUCCESS; } sprintf (buf1, "Title%d=", s); if (!extract_header_value (buf, title_buf, buf1, sizeof(title_buf))) { break; } num_scanned = sscanf (title_buf, "(#%*[0-9] - %d/%d",&used,&total); if (num_scanned != 2) { break; } open = total - used; if (open > best_open) { sr_strncpy (info->http_location, location_buf, MAX_HOST_LEN); best_open = open; } } sr_strncpy (info->http_location, location_buf, MAX_HOST_LEN); return rc; } /* #EXTM3U #EXTINF:111,3rd Bass - Al z A-B-Cee z mp3/3rd Bass/3rd bass - Al z A-B-Cee z.mp3 */ static error_code http_get_m3u (RIP_MANAGER_INFO* rmi, HSOCKET *sock, SR_HTTP_HEADER *info) { int bytes; char buf[MAX_M3U_LEN]; char* p; debug_printf ("Reading m3u\n"); bytes = socklib_recvall (rmi, sock, buf, MAX_M3U_LEN, rmi->prefs->timeout); if (bytes < SR_SUCCESS) return bytes; if (bytes == 0 || bytes == MAX_M3U_LEN) { debug_printf("Failed in getting M3U (%d bytes)\n", bytes); return SR_ERROR_CANT_PARSE_M3U; } buf[bytes] = 0; debug_printf ("Parsing m3u\n"); debug_printf ("%s\n", buf); debug_printf ("---\n"); for (p = strtok (buf,"\n"); p!= 0; p = strtok (0, "\n")) { size_t len; if (p[0] == '#') { continue; } len = strlen (p); if (len > 4 && !strcmp (&p[len-4], ".mp3")) { continue; } sr_strncpy (info->http_location, p, MAX_HOST_LEN); debug_printf ("Redirecting from M3U to: %s\n", p); return SR_SUCCESS; } debug_printf ("Failed parsing M3U\n"); return SR_ERROR_CANT_PARSE_M3U; } static error_code http_get_sc_header(RIP_MANAGER_INFO* rmi, const char* url, HSOCKET *sock, SR_HTTP_HEADER *info) { int ret; char headbuf[MAX_HEADER_LEN] = {'\0'}; ret = socklib_read_header (rmi, sock, headbuf, MAX_HEADER_LEN); if (ret != SR_SUCCESS) { debug_printf ("socklib_read_header failed\n"); return ret; } if ((ret = http_parse_sc_header(url, headbuf, info)) != SR_SUCCESS) { debug_printf ("http_parse_sc_header failed\n"); return ret; } if (info->content_type == CONTENT_TYPE_PLS) { ret = http_get_pls (rmi, sock, info); if (ret != SR_SUCCESS) { debug_printf ("http_get_pls failed\n"); return ret; } } else if (info->content_type == CONTENT_TYPE_M3U) { ret = http_get_m3u (rmi, sock, info); if (ret != SR_SUCCESS) { debug_printf ("http_get_m3u failed\n"); return ret; } } return SR_SUCCESS; } // taken from: // Copyright (c) 2000 Virtual Unlimited B.V. // Author: Bob Deblier // thanks bob ;) #define CHARS_PER_LINE 72 static char* b64enc(const char *inbuf, int size) { /* encode 72 characters per line */ static const char* to_b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; int div = size / 3; int rem = size % 3; int chars = div*4 + rem + 1; int newlines = (chars + CHARS_PER_LINE - 1) / CHARS_PER_LINE; const char* data = inbuf; char* string = (char*) malloc(chars + newlines + 1 + 100); if (string) { register char* buf = string; chars = 0; /*@+charindex@*/ while (div > 0) { buf[0] = to_b64[ (data[0] >> 2) & 0x3f]; buf[1] = to_b64[((data[0] << 4) & 0x30) + ((data[1] >> 4) & 0xf)]; buf[2] = to_b64[((data[1] << 2) & 0x3c) + ((data[2] >> 6) & 0x3)]; buf[3] = to_b64[ data[2] & 0x3f]; data += 3; buf += 4; div--; chars += 4; if (chars == CHARS_PER_LINE) { chars = 0; *(buf++) = '\n'; } } switch (rem) { case 2: buf[0] = to_b64[ (data[0] >> 2) & 0x3f]; buf[1] = to_b64[((data[0] << 4) & 0x30) + ((data[1] >> 4) & 0xf)]; buf[2] = to_b64[ (data[1] << 2) & 0x3c]; buf[3] = '='; buf += 4; chars += 4; break; case 1: buf[0] = to_b64[ (data[0] >> 2) & 0x3f]; buf[1] = to_b64[ (data[0] << 4) & 0x30]; buf[2] = '='; buf[3] = '='; buf += 4; chars += 4; break; } /* *(buf++) = '\n'; This would result in a buffer overrun */ *buf = '\0'; } return string; } streamripper-1.64.6.orig/lib/parse.c0000644000175000017500000004236711164223257015377 0ustar abiabi/* parse.c * metadata parsing routines * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include "srconfig.h" #include "mchar.h" #include "debug.h" #include "srtypes.h" /***************************************************************************** * Private global variables *****************************************************************************/ #define MAX_RULE_SIZE 2048 #define MAX_SUBMATCHES 24 #define PARSERULE_CMD_MATCH 0x01 #define PARSERULE_CMD_SUBST 0x02 #define PARSERULE_SKIP 0x01 #define PARSERULE_GLOBAL 0x02 #define PARSERULE_ICASE 0x04 #define PARSERULE_SAVE 0x08 #define PARSERULE_EXCLUDE 0x10 static Parse_Rule m_default_rule_list[] = { { PARSERULE_CMD_MATCH, PARSERULE_SKIP, 0, 0, 0, 0, 0, 0, "^A suivre:", "" }, { PARSERULE_CMD_SUBST, PARSERULE_ICASE, 0, 0, 0, 0, 0, 0, "[[:space:]]*-?[[:space:]]*mp3pro$", "" }, { PARSERULE_CMD_MATCH, PARSERULE_ICASE, 1, 2, 0, 0, 0, 0, "^[[:space:]]*(.*?[^-[:space:]])[[:space:]]+-[[:space:]]+(.*)[[:space:]]*$", "" }, { PARSERULE_CMD_MATCH, PARSERULE_ICASE, 1, 2, 0, 0, 0, 0, "^[[:space:]]*([^-]*[^-[:space:]])[[:space:]]*-[[:space:]]*(.*)[[:space:]]*$", "" }, { 0x00, 0x00, 0, 0, 0, 0, 0, 0, "", "" } }; // static Parse_Rule* m_global_rule_list = m_default_rule_list; /***************************************************************************** * Public functions *****************************************************************************/ #if !defined (USE_GLIB_REGEX) static int sr_regcomp (Parse_Rule* pr, mchar* rule_string, int cflags) { /* GCS FIX: Use PCRE for utf8 */ return regcomp(pr->reg, rule_string, cflags); } #endif #if !defined (USE_GLIB_REGEX) static int mregexec (const regex_t* preg, const mchar* string, size_t nmatch, regmatch_t pmatch[], int eflags) { /* GCS FIX: Use PCRE for utf8 */ return regexec (preg, string, nmatch, pmatch, eflags); } #endif /* Returns 1 if successful, 0 if failure */ static int compile_rule (Parse_Rule* pr, mchar* rule_string) { #if defined (USE_GLIB_REGEX) GError *error = NULL; pr->reg = g_regex_new (rule_string, 0, 0, &error); if (error) { debug_printf ("Error g_regex_new: %s\n", error->message); g_error_free (error); return 0; } return 1; #else int rc; int cflags; pr->reg = (regex_t*) malloc (sizeof(regex_t)); if (!pr->reg) return 0; cflags = REG_EXTENDED; if (pr->flags & PARSERULE_ICASE) { cflags |= REG_ICASE; } rc = sr_regcomp(pr, rule_string, cflags); if (rc != 0) { free(pr->reg); return 0; } return 1; #endif } static void use_default_rules (RIP_MANAGER_INFO* rmi) { Parse_Rule* rulep; /* set global rule list to default */ rmi->parse_rules = (Parse_Rule*) malloc (sizeof(m_default_rule_list)); memcpy (rmi->parse_rules, m_default_rule_list, sizeof(m_default_rule_list)); /* compile regular expressions */ for (rulep = rmi->parse_rules; rulep->cmd; rulep++) { compile_rule (rulep, rulep->match); } } #if defined (USE_GLIB_REGEX) static void copy_rule_result (mchar* dest, GMatchInfo* match_info, int idx) { gchar* match = g_match_info_fetch (match_info, idx); if (!match) return; debug_printf ("copy_rule_result: idx=%d\n", idx); if (idx > 0 && idx <= MAX_SUBMATCHES) { mstrncpy (dest, match, MAX_METADATA_LEN); } } #else static void copy_rule_result (mchar* dest, mchar* query_string, regmatch_t* pmatch, int idx) { debug_printf ("copy_rule_result: idx=%d\n", idx); if (idx > 0 && idx <= MAX_SUBMATCHES) { mstrncpy (dest, query_string + pmatch[idx].rm_so, pmatch[idx].rm_eo - pmatch[idx].rm_so + 1); } } #endif /* Return 1 if successful, or 0 for failure */ static int parse_flags (Parse_Rule* pr, char* flags) { char flag1; while ((flag1 = *flags++)) { int* tag = 0; switch (flag1) { case 'e': pr->flags |= PARSERULE_SKIP; if (pr->cmd != PARSERULE_CMD_MATCH) return 0; break; case 'g': /* GCS FIX: Not yet implemented */ pr->flags |= PARSERULE_GLOBAL; break; case 'i': pr->flags |= PARSERULE_ICASE; break; case 's': pr->flags |= PARSERULE_SAVE; if (pr->cmd != PARSERULE_CMD_MATCH) return 0; break; case 'x': pr->flags |= PARSERULE_EXCLUDE; if (pr->cmd != PARSERULE_CMD_MATCH) return 0; break; case 'A': tag = &pr->artist_idx; break; case 'C': tag = &pr->album_idx; break; case 'N': tag = &pr->trackno_idx; break; case 'T': tag = &pr->title_idx; break; case 'Y': tag = &pr->year_idx; break; case 0: case '\n': case '\r': return 1; default: return 0; } if (tag) { int rc; int nchar; int idx = 0; if (pr->cmd != PARSERULE_CMD_MATCH) return 0; rc = sscanf (flags, "%d%n", &idx, &nchar); if (rc == 0 || idx > MAX_SUBMATCHES) { return 0; } flags += nchar; *tag = idx; } } return 1; } static char* parse_escaped_string (char* outbuf, char* inbuf) { int escaped = 0; while (1) { switch (*outbuf++ = *inbuf++) { case '\\': escaped = !escaped; break; case '/': if (!escaped){ *(--outbuf) = 0; return inbuf; } break; case 0: return 0; break; default: escaped = 0; break; } } /* Never get here */ return 0; } /* This mega-function reads in the rules file, and loads all the rules into the rmi->parse_rules data structure */ void init_metadata_parser (RIP_MANAGER_INFO* rmi, char* rules_file) { FILE* fp; int ri; /* Rule index */ int rn; /* Number of rules allocated */ if (!rules_file || !*rules_file) { use_default_rules (rmi); return; } fp = fopen (rules_file, "r"); if (!fp) { use_default_rules (rmi); return; } rmi->parse_rules = 0; ri = rn = 0; while (1) { char rule_buf[MAX_RULE_SIZE]; char match_buf[MAX_RULE_SIZE]; char subst_buf[MAX_RULE_SIZE]; mchar w_match_buf[MAX_RULE_SIZE]; mchar w_subst_buf[MAX_RULE_SIZE]; char* rbp; char* rp; int got_command; int rc; /* Allocate memory for rule, if necessary. */ /* If there are no more rules in the file, */ /* this rule will become the sentinel null rule */ if (ri+1 != rn) { rmi->parse_rules = realloc (rmi->parse_rules, (ri+1) * sizeof(Parse_Rule)); memset (&rmi->parse_rules[ri], 0, sizeof(Parse_Rule)); rn = ri+1; } /* Get next line from file */ rp = fgets (rule_buf,2048,fp); if (!rp) break; /* Skip leading whitespace */ rbp = rule_buf; while (*rbp && isspace(*rbp)) rbp++; if (!*rbp) continue; /* Get command */ got_command = 0; switch (*rbp++) { case 'm': got_command = 1; rmi->parse_rules[ri].cmd = PARSERULE_CMD_MATCH; break; case 's': got_command = 1; rmi->parse_rules[ri].cmd = PARSERULE_CMD_SUBST; break; case '#': got_command = 0; break; default: got_command = 0; printf ("Warning: malformed command in rules file:\n%s\n", rule_buf); break; } if (!got_command) continue; /* Skip past fwd slash */ if (*rbp++ != '/') { printf ("Warning: malformed command in rules file:\n%s\n", rule_buf); continue; } /* Parse match string */ rbp = parse_escaped_string (match_buf, rbp); debug_printf ("match_buf=%s\n", match_buf); if (!rbp) { printf ("Warning: malformed command in rules file:\n%s\n", rule_buf); continue; } /* Parse subst string */ if (rmi->parse_rules[ri].cmd == PARSERULE_CMD_SUBST) { rbp = parse_escaped_string (subst_buf, rbp); debug_printf ("subst_buf=%s\n", subst_buf); if (!rbp) { printf ("Warning: malformed command in rules file:\n%s\n", rule_buf); continue; } } /* Parse flags */ rc = parse_flags (&rmi->parse_rules[ri], rbp); if (!rc) { printf ("Warning: malformed command in rules file:\n%s\n", rule_buf); continue; } /* Compile the rule */ debug_printf ("Compiling the rule\n"); gstring_from_string (rmi, w_match_buf, MAX_RULE_SIZE, match_buf, CODESET_UTF8); if (!compile_rule(&rmi->parse_rules[ri], w_match_buf)) { printf ("Warning: malformed regular expression:\n%s\n", match_buf); continue; } /* Copy rule strings */ debug_printf ("Copying rule string (1)\n"); debug_mprintf (m_("String is ") m_S m_("\n"), w_match_buf); rmi->parse_rules[ri].match = mstrdup(w_match_buf); debug_printf ("Copying rule string (2)\n"); if (rmi->parse_rules[ri].cmd == PARSERULE_CMD_SUBST) { debug_printf ("Copying rule string (3)\n"); gstring_from_string (rmi, w_subst_buf, MAX_RULE_SIZE, subst_buf, CODESET_UTF8); debug_printf ("Copying rule string (4)\n"); rmi->parse_rules[ri].subst = mstrdup(w_subst_buf); debug_printf ("Copying rule string (5)\n"); } debug_printf ("End of loop\n"); ri++; } fclose(fp); } void compose_metadata (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti) { int num_bytes; unsigned char num_16_bytes; mchar w_composed_metadata[MAX_METADATA_LEN+1]; if (ti->have_track_info) { if (ti->artist[0]) { msnprintf (w_composed_metadata, MAX_METADATA_LEN, m_("StreamTitle='") m_S m_(" - ") m_S m_("';"), ti->artist, ti->title); } else { msnprintf (w_composed_metadata, MAX_METADATA_LEN, m_("StreamTitle='") m_S m_("';"), ti->title); } } else { debug_printf ("No track info when composing relay metadata\n"); } debug_printf ("Converting relay string to char\n"); num_bytes = string_from_gstring (rmi, &ti->composed_metadata[1], MAX_METADATA_LEN, w_composed_metadata, CODESET_RELAY); ti->composed_metadata[MAX_METADATA_LEN] = 0; // note, not LEN-1 num_16_bytes = (num_bytes + 15) / 16; ti->composed_metadata[0] = num_16_bytes; } void parse_metadata (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti) { int i; int eflags; int rc; int matched; mchar query_string[MAX_TRACK_LEN]; Parse_Rule* rulep; /* Has any m/.../s rule matched? */ BOOL save_track_matched = FALSE; /* Has any m/.../x rule matched? */ BOOL exclude_track_matched = FALSE; ti->artist[0] = 0; ti->title[0] = 0; ti->album[0] = 0; ti->composed_metadata[0] = 0; ti->save_track = TRUE; /* Loop through rules, if we find a matching rule, then use it */ /* For now, only default rules supported with ascii regular expressions. */ debug_printf ("Converting query string to wide\n"); gstring_from_string (rmi, query_string, MAX_TRACK_LEN, ti->raw_metadata, CODESET_METADATA); for (rulep = rmi->parse_rules; rulep->cmd; rulep++) { #if !defined (USE_GLIB_REGEX) regmatch_t pmatch[MAX_SUBMATCHES+1]; #endif eflags = 0; if (rulep->cmd == PARSERULE_CMD_MATCH) { debug_mprintf (m_("Testing match rule: ") m_S m_(" vs. ") m_S m_("\n"), query_string, rulep->match); if (rulep->flags & PARSERULE_SKIP) { #if defined (USE_GLIB_REGEX) rc = g_regex_match (rulep->reg, query_string, 0, NULL); matched = rc; #else rc = mregexec (rulep->reg, query_string, 0, NULL, eflags); matched = !rc; #endif if (!matched) { continue; } /* GCS FIX: We need to return to the caller that the metadata should be dropped. */ debug_printf ("Skip rule matched\n"); ti->save_track = FALSE; ti->have_track_info = 0; return; } else if (rulep->flags & PARSERULE_SAVE) { #if defined (USE_GLIB_REGEX) rc = g_regex_match (rulep->reg, query_string, 0, NULL); matched = rc; #else rc = mregexec (rulep->reg, query_string, 0, NULL, eflags); matched = !rc; #endif if (!matched) { if (!save_track_matched) ti->save_track = FALSE; continue; } if (!exclude_track_matched) { ti->save_track = TRUE; save_track_matched = TRUE; } } else if (rulep->flags & PARSERULE_EXCLUDE) { #if defined (USE_GLIB_REGEX) rc = g_regex_match (rulep->reg, query_string, 0, NULL); matched = rc; #else rc = mregexec (rulep->reg, query_string, 0, NULL, eflags); matched = !rc; #endif if (matched && !save_track_matched) { /* Rule matched => Exclude track */ ti->save_track = FALSE; exclude_track_matched = TRUE; } } else { #if defined (USE_GLIB_REGEX) GMatchInfo* match_info; gint nmatch; rc = g_regex_match (rulep->reg, query_string, 0, &match_info); if (rc == 0) { /* Didn't match rule. */ continue; } nmatch = g_match_info_get_match_count (match_info); debug_printf ("Got %d matches\n", nmatch); for (i = 0; i < nmatch; i++) { gchar* match = g_match_info_fetch (match_info, i); debug_printf ("[%d] = %s\n", i, match); g_free (match); } copy_rule_result (ti->artist, match_info, rulep->artist_idx); copy_rule_result (ti->title, match_info, rulep->title_idx); copy_rule_result (ti->album, match_info, rulep->album_idx); copy_rule_result (ti->track_p, match_info, rulep->trackno_idx); copy_rule_result (ti->year, match_info, rulep->year_idx); g_match_info_free (match_info); #else eflags = 0; rc = mregexec (rulep->reg, query_string, MAX_SUBMATCHES+1, pmatch, eflags); if (rc != 0) { /* Didn't match rule. */ continue; } for (i = 0; i < MAX_SUBMATCHES+1; i++) { debug_printf ("pmatch[%d]: (so,eo) = (%d,%d)\n", i, pmatch[i].rm_so, pmatch[i].rm_eo); } copy_rule_result (ti->artist, query_string, pmatch, rulep->artist_idx); copy_rule_result (ti->title, query_string, pmatch, rulep->title_idx); copy_rule_result (ti->album, query_string, pmatch, rulep->album_idx); copy_rule_result (ti->track_p, query_string, pmatch, rulep->trackno_idx); copy_rule_result (ti->year, query_string, pmatch, rulep->year_idx); #endif ti->have_track_info = 1; compose_metadata (rmi, ti); debug_mprintf (m_("Parsed track info.\n") m_("ARTIST: ") m_S m_("\n") m_("TITLE: ") m_S m_("\n") m_("ALBUM: ") m_S m_("\n") m_("TRACK: ") m_S m_("\n") m_("YEAR: ") m_S m_("\n"), ti->artist, ti->title, ti->album, ti->track_p, ti->year); return; } } else if (rulep->cmd == PARSERULE_CMD_SUBST) { #if defined (USE_GLIB_REGEX) GMatchInfo* match_info; gint start_pos, end_pos; gchar *tmp, *subst_string; debug_mprintf (m_("Testing subst rule: ") m_S m_(" vs. ") m_S m_("\n"), query_string, rulep->match); rc = g_regex_match (rulep->reg, query_string, 0, &match_info); if (rc == 0) { /* Didn't match rule. */ continue; } rc = g_match_info_fetch_pos (match_info, 0, &start_pos, &end_pos); if (!rc) { debug_printf ("g_match_info_fetch_pos returned 0\n"); g_match_info_free (match_info); continue; } debug_printf ("Matched at (%d,%d)\n", start_pos, end_pos); if (start_pos == -1) { g_match_info_free (match_info); continue; } tmp = g_strndup (query_string, start_pos); tmp[start_pos] = 0; subst_string = g_strconcat (tmp, rulep->subst, &tmp[end_pos], NULL); g_free (tmp); g_match_info_free (match_info); mstrncpy (query_string, subst_string, MAX_TRACK_LEN); #else mchar subst_string[MAX_TRACK_LEN]; int used, left; debug_mprintf (m_("Testing subst rule: ") m_S m_(" vs. ") m_S m_("\n"), query_string, rulep->match); rc = mregexec (rulep->reg, query_string, 1, pmatch, eflags); if (rc != 0) { /* Didn't match rule. */ continue; } /* Update the query string and continue. */ debug_printf ("Matched at (%d,%d)\n", pmatch[0].rm_so, pmatch[0].rm_eo); mstrncpy (subst_string, query_string, pmatch[0].rm_so + 1); debug_mprintf (m_("(1) subst_string = ") m_S m_("\n"), subst_string); used = pmatch[0].rm_so; left = MAX_TRACK_LEN - used; mstrncpy (subst_string + used, rulep->subst, left); debug_mprintf (m_("(2) subst_string = ") m_S m_("\n"), subst_string); used += mstrlen (rulep->subst); left = MAX_TRACK_LEN - used; mstrncpy (subst_string + used, query_string + pmatch[0].rm_eo, left); debug_mprintf (m_("(3) subst_string = ") m_S m_("\n"), subst_string); mstrncpy (query_string, subst_string, MAX_TRACK_LEN); debug_mprintf (m_("(4) query_string = ") m_S m_("\n"), query_string); #endif } } debug_printf ("Fell through while parsing data...\n"); mstrncpy (ti->title, query_string, MAX_TRACK_LEN); ti->have_track_info = 1; compose_metadata (rmi, ti); } void parser_free (RIP_MANAGER_INFO* rmi) { free (rmi->parse_rules); rmi->parse_rules = 0; } streamripper-1.64.6.orig/lib/rip_manager.h0000644000175000017500000001230011164266627016546 0ustar abiabi/* rip_manager.h * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __RIP_MANANGER_H__ #define __RIP_MANANGER_H__ #include "external.h" #include "prefs.h" #include "srtypes.h" #include "errors.h" #include "compat.h" #define SRVERSION "1.64.6" #if defined (WIN32) #define SRPLATFORM "windows" #else #define SRPLATFORM "unix" #endif // Messages for status_callback hook in rip_manager_init() // used for notifing to client whats going on *DO NOT* call // rip_mananger_start or rip_mananger_stop from // these functions!!! it will cause a deadlock #define RM_UPDATE 0x01 // returns a pointer RIP_MANAGER_INFO struct #define RM_ERROR 0x02 // returns the error code #define RM_DONE 0x03 // NULL #define RM_STARTED 0x04 // NULL #define RM_NEW_TRACK 0x05 // Name of the new track #define RM_TRACK_DONE 0x06 // pull path of the track completed // RM_OUTPUT_DIR is now OBSOLETE #define RM_OUTPUT_DIR 0x07 // Full path of the output directory // The following are the possible status values for RIP_MANAGER_INFO #define RM_STATUS_BUFFERING 0x01 #define RM_STATUS_RIPPING 0x02 #define RM_STATUS_RECONNECTING 0x03 // Rip manager flags options #define OPT_AUTO_RECONNECT 0x00000001 // reconnect automatically if dropped #define OPT_SEPARATE_DIRS 0x00000002 // create a directory named after the server #define OPT_SEARCH_PORTS 0x00000008 // relay server should search for a open port #define OPT_MAKE_RELAY 0x00000010 // don't make a relay server #define OPT_COUNT_FILES 0x00000020 // add a index counter to the filenames #define OPT_OBSOLETE 0x00000040 // Used to be OPT_ADD_ID3, now ignored #define OPT_DATE_STAMP 0x00000100 // add a date stamp to the output directory #define OPT_CHECK_MAX_BYTES 0x00000200 // use the maxMB_rip_size value to know how much to rip #define OPT_KEEP_INCOMPLETE 0x00000400 // overwrite files in the incomplete directory, add counter instead #define OPT_SINGLE_FILE_OUTPUT 0x00000800 // enable ripping to single file #define OPT_TRUNCATE_DUPS 0x00001000 // truncate file in the incomplete directory already present in complete #define OPT_INDIVIDUAL_TRACKS 0x00002000 // should we write the individual tracks? #define OPT_EXTERNAL_CMD 0x00004000 // use external command to get metadata? #define OPT_ADD_ID3V1 0x00008000 // Add ID3V1 #define OPT_ADD_ID3V2 0x00010000 // Add ID3V2 #define OPT_FLAG_ISSET(flags, opt) ((flags & opt) > 0) // #define OPT_FLAG_SET(flags, opt) (flags =| opt) #define OPT_FLAG_SET(flags, opt, val) (val ? (flags |= opt) : (flags &= (~opt))) #define GET_AUTO_RECONNECT(flags) (OPT_FLAG_ISSET(flags, OPT_AUTO_RECONNECT)) #define GET_SEPARATE_DIRS(flags) (OPT_FLAG_ISSET(flags, OPT_SEPARATE_DIRS)) #define GET_SEARCH_PORTS(flags) (OPT_FLAG_ISSET(flags, OPT_SEARCH_PORTS)) #define GET_MAKE_RELAY(flags) (OPT_FLAG_ISSET(flags, OPT_MAKE_RELAY)) #define GET_COUNT_FILES(flags) (OPT_FLAG_ISSET(flags, OPT_COUNT_FILES)) // #define GET_ADD_ID3(flags) (OPT_FLAG_ISSET(flags, OPT_ADD_ID3)) #define GET_DATE_STAMP(flags) (OPT_FLAG_ISSET(flags, OPT_DATE_STAMP)) #define GET_CHECK_MAX_BYTES(flags) (OPT_FLAG_ISSET(flags, OPT_CHECK_MAX_BYTES)) #define GET_KEEP_INCOMPLETE(flags) (OPT_FLAG_ISSET(flags, OPT_KEEP_INCOMPLETE)) #define GET_SINGLE_FILE_OUTPUT(flags) (OPT_FLAG_ISSET(flags, OPT_SINGLE_FILE_OUTPUT)) #define GET_TRUNCATE_DUPS(flags) (OPT_FLAG_ISSET(flags, OPT_TRUNCATE_DUPS)) #define GET_INDIVIDUAL_TRACKS(flags) (OPT_FLAG_ISSET(flags, OPT_INDIVIDUAL_TRACKS)) #define GET_EXTERNAL_CMD(flags) (OPT_FLAG_ISSET(flags, OPT_EXTERNAL_CMD)) #define GET_ADD_ID3V1(flags) (OPT_FLAG_ISSET(flags, OPT_ADD_ID3V1)) #define GET_ADD_ID3V2(flags) (OPT_FLAG_ISSET(flags, OPT_ADD_ID3V2)) /* Public functions */ char *rip_manager_get_error_str(int code); //u_short rip_mananger_get_relay_port(); void set_rip_manager_options_defaults (STREAM_PREFS *m_opt); void rip_manager_init (void); error_code rip_manager_start (RIP_MANAGER_INFO **rmi, STREAM_PREFS *prefs, RIP_MANAGER_CALLBACK status_callback); void rip_manager_stop (RIP_MANAGER_INFO *rmi); void rip_manager_cleanup (void); error_code rip_manager_start_track (RIP_MANAGER_INFO *rmi, TRACK_INFO* ti); error_code rip_manager_end_track (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti); error_code rip_manager_put_data (RIP_MANAGER_INFO *rmi, char *buf, int size); char* client_relay_header_generate (RIP_MANAGER_INFO* rmi, int icy_meta_support); void client_relay_header_release (char *ch); const char* overwrite_opt_to_string (enum OverwriteOpt oo); enum OverwriteOpt string_to_overwrite_opt (char* str); int rip_manager_get_content_type (RIP_MANAGER_INFO* rmi); #endif //__RIP_MANANGER_H__ streamripper-1.64.6.orig/lib/debug.h0000644000175000017500000000207310767105164015352 0ustar abiabi/* debug.h * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __DEBUG_H__ #define __DEBUG_H__ #include "srtypes.h" #include "time.h" #include #define debug_mprintf debug_printf void debug_open (void); void debug_set_filename (char* filename); void debug_close (void); void debug_printf (char* fmt, ...); //void debug_mprintf (mchar* fmt, ...); void debug_enable (void); void debug_print_error (void); #endif streamripper-1.64.6.orig/lib/prefs.c0000644000175000017500000007240311154752714015402 0ustar abiabi/* prefs.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., 675 Mass Ave, Cambridge, MA 02139, USA. * * REFS * http://www.gtkbook.com/tutorial.php?page=keyfile */ #include #include #include #include #include #include "rip_manager.h" #include "mchar.h" #include "prefs.h" #include "debug.h" /****************************************************************************** * Private variables *****************************************************************************/ #define DEFAULT_USER_AGENT ("streamripper/" SRVERSION) static GKeyFile *m_key_file = NULL; enum PrefsVersion { PREFS_VERSION_1_63_BETA_2, PREFS_VERSION_1_63_BETA_8, PREFS_VERSION_1_63_4, PREFS_VERSION_1_64_5 }; static const char* prefs_version_strings[] = { "", /* None = "1.63-beta-2" */ "1.63-beta-8", /* Change dropcount from 0 to 1 */ "1.63.4", /* Change overwrite from larger to version */ "1.64.5", /* Change localost from localhost to 127.0.0.1 Change id3 codeset to UTF-16 Change metadata and relay codesets from UTF-8 to iso-8859-1 Change splitpoint padding from 300 to 0. */ 0 }; /* Preference file versions */ #define PREFS_VERSION_CURRENT "1.64.5" /****************************************************************************** * Private function protoypes *****************************************************************************/ static enum PrefsVersion string_to_prefs_version (char* str); static gchar* prefs_get_config_dir (void); static void prefs_get_global_defaults (GLOBAL_PREFS* global_prefs); static void prefs_get_stream_defaults (STREAM_PREFS* prefs); static void prefs_get_stream_prefs_keyfile (STREAM_PREFS* prefs, char* group); static void prefs_set_stream_prefs_keyfile (STREAM_PREFS* prefs, STREAM_PREFS* default_prefs, char* group); static void prefs_get_wstreamripper_defaults (WSTREAMRIPPER_PREFS* prefs); static int prefs_get_string (char* dest, gsize dest_size, char* group, char* key); static int prefs_get_int (int *dest, char *group, char *key); static int prefs_get_ulong (u_long *dest, char *group, char *key); static int prefs_get_long (long *dest, char *group, char *key); static void prefs_set_string (char* group, char* key, char* value); static void prefs_set_integer (char* group, char* key, gint value); /****************************************************************************** * Private Vars *****************************************************************************/ /****************************************************************************** * Public functions *****************************************************************************/ /* Return 0 if the user doesn't have a preference file yet, and non-zero if he does. This is used by the winamp plugin to override the default output directory. */ int prefs_load (void) { gboolean rc; GKeyFileFlags flags; GError *error = NULL; gchar* prefs_dir; gchar* prefs_fn; GLOBAL_PREFS global_prefs; prefs_dir = prefs_get_config_dir (); prefs_fn = g_build_filename (prefs_dir, "streamripper.ini", NULL); debug_printf ("prefs_fn [utf8] = %s\n", prefs_fn); if (!m_key_file) { debug_printf ("Trying g_key_file_new()...\n"); m_key_file = g_key_file_new (); if (!m_key_file) { debug_printf ("Error creating key file with g_key_file_new()\n"); } } flags = G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS; rc = g_key_file_load_from_file (m_key_file, prefs_fn, flags, &error); debug_printf ("g_key_file_load_from_file returned %d\n", rc); if (error) { debug_printf ("Error with g_key_file_load_from_data: %s\n", error->message); g_error_free (error); } /* Make sure a full set of global preferences are created in keyfile */ prefs_get_global_prefs (&global_prefs); prefs_set_global_prefs (&global_prefs); /* Silently update preferences on version change */ if (rc) { int rc1; int padding; u_long tmp_u_long; char overwrite_str[128]; char codeset_str[MAX_CODESET_STRING]; char localhost_str[SR_MAX_PATH]; debug_printf ("Updating prefs %d\n", string_to_prefs_version (global_prefs.version)); switch (string_to_prefs_version (global_prefs.version)) { case PREFS_VERSION_1_63_BETA_2: /* Silently update dropcount */ rc1 = prefs_get_ulong (&tmp_u_long, "stream defaults", "dropcount"); if (!rc1 || tmp_u_long == 0) { prefs_set_integer ("stream defaults", "dropcount", 1); } /* Fall through */ case PREFS_VERSION_1_63_BETA_8: /* Silently update overwrite behavior */ rc1 = prefs_get_string (overwrite_str, 128, "stream defaults", "over_write_complete"); if (!rc1 || !strcmp (overwrite_str, "larger")) { prefs_set_string ("stream defaults", "over_write_complete", "version"); } /* Fall through */ case PREFS_VERSION_1_63_4: /* Silently update localhost to 127.0.0.1 */ rc1 = prefs_get_string (localhost_str, SR_MAX_PATH, "wstreamripper", "localhost"); if (!rc1 || !strcmp (overwrite_str, "localhost")) { prefs_set_string ("wstreamripper", "localhost", "127.0.0.1"); } /* Silently update id3 codeset to UTF-16 for all values*/ prefs_set_string ("stream defaults", "codeset_id3", "UTF-16"); /* Silently update metadata and relay codeset if UTF-8 */ rc1 = prefs_get_string (codeset_str, MAX_CODESET_STRING, "stream defaults", "codeset_metadata"); if (!rc1 || !strcmp (codeset_str, "UTF-8")) { prefs_set_string ("stream defaults", "codeset_metadata", "ISO-8859-1"); } rc1 = prefs_get_string (codeset_str, MAX_CODESET_STRING, "stream defaults", "codeset_relay"); if (!rc1 || !strcmp (codeset_str, "UTF-8")) { prefs_set_string ("stream defaults", "codeset_relay", "ISO-8859-1"); } /* Silently update padding */ prefs_get_int (&padding, "stream defaults", "xs_padding_1"); if (!rc1 || padding == 300) { prefs_set_integer ("stream defaults", "xs_padding_1", 0); } prefs_get_int (&padding, "stream defaults", "xs_padding_2"); if (!rc1 || padding == 300) { prefs_set_integer ("stream defaults", "xs_padding_2", 0); } /* Silently update keep_incomplete */ prefs_set_integer ("stream defaults", "keep_incomplete", 1); /* Fall through */ case PREFS_VERSION_1_64_5: default: /* Prefs version is up to date -- do nothing */ break; } } /* Update to current version */ prefs_set_string ("sripper", "version", PREFS_VERSION_CURRENT); g_free (prefs_fn); g_free (prefs_dir); return (int) rc; } void prefs_save (void) { FILE* fp; GError *error = NULL; gchar* prefs_dir; gchar* prefs_fn; gchar* keyfile_contents; gsize keyfile_contents_len; debug_printf ("Saving preferences.\n"); prefs_dir = prefs_get_config_dir (); if (g_mkdir_with_parents (prefs_dir, 0755)) { debug_printf ("Couldn't make config dir: %s\n", prefs_dir); g_free (prefs_dir); return; } prefs_fn = g_build_filename (prefs_dir, "streamripper.ini", NULL); g_free (prefs_dir); debug_printf ("Filename: %s\n", prefs_fn); /* Insert from prefs into keyfile */ // prefs_copy_to_keyfile (prefs); /* Convert entire keyfile to a string */ keyfile_contents = g_key_file_to_data (m_key_file, &keyfile_contents_len, &error); if (error) { debug_printf ("Error with g_key_file_to_data: %s\n", error->message); g_error_free (error); g_free (prefs_fn); return; } /* Write to file */ /* RMK: We use glib string encoding for conversion of the filename rather than --codeset-filesys here. */ fp = g_fopen (prefs_fn, "w"); if (fp) { debug_printf ("Writing, len = %d\n", keyfile_contents_len); fwrite (keyfile_contents, 1, keyfile_contents_len, fp); fclose (fp); } else { debug_printf ("Error opening prefs file for write\n"); } g_free (keyfile_contents); g_free (prefs_fn); } void prefs_get_global_prefs (GLOBAL_PREFS *global_prefs) { prefs_get_global_defaults (global_prefs); prefs_get_string (global_prefs->version, MAX_VERSION_LEN, "sripper", "version"); prefs_get_string (global_prefs->url, MAX_URL_LEN, "sripper", "url"); prefs_get_stream_prefs (&global_prefs->stream_prefs, "stream defaults"); } void prefs_set_global_prefs (GLOBAL_PREFS *global_prefs) { /* Don't set version. This is done in prefs_load() so we can patch old versions of prefs. */ prefs_set_string ("sripper", "version", global_prefs->version); prefs_set_string ("sripper", "url", global_prefs->url); prefs_set_stream_prefs_keyfile (&global_prefs->stream_prefs, 0, "stream defaults"); } void prefs_get_wstreamripper_prefs (WSTREAMRIPPER_PREFS *prefs) { int i, p; char* group = "wstreamripper"; prefs_get_wstreamripper_defaults (prefs); if (!m_key_file) return; prefs_get_string (prefs->default_skin, SR_MAX_PATH, group, "default_skin"); prefs_get_int (&prefs->m_enabled, group, "enabled"); prefs_get_long (&prefs->oldpos_x, group, "window_x"); prefs_get_long (&prefs->oldpos_y, group, "window_y"); prefs_get_string (prefs->localhost, SR_MAX_PATH, group, "localhost"); prefs_get_int (&prefs->m_add_finished_tracks_to_playlist, group, "add_tracks_to_playlist"); prefs_get_int (&prefs->m_start_minimized, group, "start_minimized"); prefs_get_int (&prefs->use_old_playlist_ret, group, "use_old_playlist_ret"); /* Get history */ for (i = 0, p = 0; i < RIPLIST_LEN; i++) { char profile_name[128]; sprintf (profile_name, "riplist%d", i); prefs_get_string (prefs->riplist[p], SR_MAX_PATH, group, profile_name); if (prefs->riplist[p][0]) { p++; } } } void prefs_set_wstreamripper_prefs (WSTREAMRIPPER_PREFS *prefs) { int i, p; char* group = "wstreamripper"; if (!m_key_file) return; prefs_set_string (group, "default_skin", prefs->default_skin); prefs_set_integer (group, "enabled", prefs->m_enabled); prefs_set_integer (group, "window_x", prefs->oldpos_x); prefs_set_integer (group, "window_y", prefs->oldpos_y); prefs_set_string (group, "localhost", prefs->localhost); prefs_set_integer (group, "add_tracks_to_playlist", prefs->m_add_finished_tracks_to_playlist); prefs_set_integer (group, "start_minimized", prefs->m_start_minimized); prefs_set_integer (group, "use_old_playlist_ret", prefs->use_old_playlist_ret); /* Set history */ for (i = 0, p = 0; i < RIPLIST_LEN; i++) { if (prefs->riplist[i][0]) { char profile_name[128]; sprintf (profile_name, "riplist%d", p); prefs_set_string (group, profile_name, prefs->riplist[i]); p++; } } } void prefs_get_stream_prefs (STREAM_PREFS* prefs, char* label) { /* Be careful here. The label might be prefs->url, so we don't want to overwrite it while we are loading. */ gchar* label_copy = strdup (label); gchar* group = 0; if (strcmp (label, "stream defaults")) { gsize i, length; gchar** group_list; /* Look through groups for matching URL */ group_list = g_key_file_get_groups (m_key_file, &length); for (i = 0; i < length; i++) { gchar* value; if (!strcmp (label_copy, group_list[i])) { group = g_strdup (group_list[i]); break; /* Found matching label */ } value = g_key_file_get_string (m_key_file, group_list[i], "url", 0); if (value) { if (!strcmp (label_copy, value)) { group = g_strdup (group_list[i]); g_free (value); break; /* Found matching URL */ } g_free (value); } } g_strfreev (group_list); } /* Copy default values */ prefs_get_stream_defaults (prefs); prefs_get_stream_prefs_keyfile (prefs, "stream defaults"); /* Copy stream-specific values */ if (group) { prefs_get_stream_prefs_keyfile (prefs, group); g_free (group); } /* If no stream-specific values found, set url to input value */ if (!group && strcmp (label, "stream defaults")) { strcpy (prefs->url, label_copy); } g_free (label_copy); // printf ("Home dir is: %s\n", g_get_home_dir()); // printf ("Config dir is: %s\n", g_get_user_config_dir ()); // printf ("Data dir is: %s\n", g_get_user_data_dir ()); } void prefs_set_stream_prefs (STREAM_PREFS* prefs, char* label) { if (!label) { /* GCS FIX: Here I should assign a new (unused) label */ return; } prefs_set_stream_prefs_keyfile (prefs, 0, label); } /* GCS: This is not quite complete, missing splitting & codesets */ void debug_stream_prefs (STREAM_PREFS* prefs) { debug_printf ("label = %s\n", prefs->label); debug_printf ("url = %s\n", prefs->url); debug_printf ("proxyurl = %s\n", prefs->proxyurl); debug_printf ("output_directory = %s\n", prefs->output_directory); debug_printf ("output_pattern = %s\n", prefs->output_pattern); debug_printf ("showfile_pattern = %s\n", prefs->showfile_pattern); debug_printf ("if_name = %s\n", prefs->if_name); debug_printf ("rules_file = %s\n", prefs->rules_file); debug_printf ("pls_file = %s\n", prefs->pls_file); debug_printf ("relay_ip = %s\n", prefs->relay_ip); debug_printf ("ext_cmd = %s\n", prefs->ext_cmd); debug_printf ("useragent = %s\n", prefs->useragent); debug_printf ("relay_port = %d\n", prefs->relay_port); debug_printf ("max_port = %d\n", prefs->max_port); debug_printf ("max_connections = %d\n", prefs->max_connections); debug_printf ("maxMB_rip_size = %d\n", prefs->maxMB_rip_size); debug_printf ("auto_reconnect = %d\n", OPT_FLAG_ISSET (prefs->flags, OPT_AUTO_RECONNECT)); debug_printf ("make_relay = %d\n", OPT_FLAG_ISSET (prefs->flags, OPT_MAKE_RELAY)); debug_printf ("add_id3v1 = %d\n", OPT_FLAG_ISSET (prefs->flags, OPT_ADD_ID3V1)); debug_printf ("add_id3v2 = %d\n", OPT_FLAG_ISSET (prefs->flags, OPT_ADD_ID3V2)); debug_printf ("check_max_bytes = %d\n", OPT_FLAG_ISSET (prefs->flags, OPT_CHECK_MAX_BYTES)); debug_printf ("keep_incomplete = %d\n", OPT_FLAG_ISSET (prefs->flags, OPT_KEEP_INCOMPLETE)); debug_printf ("rip_individual_tracks = %d\n", OPT_FLAG_ISSET (prefs->flags, OPT_INDIVIDUAL_TRACKS)); debug_printf ("rip_single_file = %d\n", OPT_FLAG_ISSET (prefs->flags, OPT_SINGLE_FILE_OUTPUT)); debug_printf ("use_ext_cmd = %d\n", OPT_FLAG_ISSET (prefs->flags, OPT_EXTERNAL_CMD)); debug_printf ("timeout = %d\n", prefs->timeout); debug_printf ("dropcount = %d\n", prefs->dropcount); debug_printf ("count_start = %d\n", prefs->count_start); debug_printf ("overwrite = %s\n", overwrite_opt_to_string(prefs->overwrite)); }; /****************************************************************************** * Private functions *****************************************************************************/ static enum PrefsVersion string_to_prefs_version (char* str) { int i = 0; /* If there is no version string, then the version is "1.63-beta-2". */ if (!str) return 0; while (prefs_version_strings[i]) { if (strcmp(str, prefs_version_strings[i]) == 0) { return i; } i++; } return 0; } /* Calling routine must free returned string */ static gchar* prefs_get_config_dir (void) { return g_build_filename (g_get_user_config_dir(), "streamripper", NULL); } static void prefs_get_global_defaults (GLOBAL_PREFS* global_prefs) { memset (global_prefs, 0, sizeof(GLOBAL_PREFS)); } static void prefs_get_stream_defaults (STREAM_PREFS* prefs) { debug_printf ("- set_rip_manager_options_defaults -\n"); // prefs->url[0] = 0; prefs->proxyurl[0] = 0; strcpy(prefs->output_directory, "./"); prefs->output_pattern[0] = 0; prefs->showfile_pattern[0] = 0; prefs->if_name[0] = 0; prefs->rules_file[0] = 0; prefs->pls_file[0] = 0; prefs->relay_ip[0] = 0; prefs->relay_port = 8000; prefs->max_port = 18000; prefs->max_connections = 1; prefs->maxMB_rip_size = 0; prefs->flags = OPT_AUTO_RECONNECT | OPT_SEPARATE_DIRS | OPT_SEARCH_PORTS | /* OPT_ADD_ID3V1 | -- removed starting 1.62-beta-2 */ OPT_ADD_ID3V2 | OPT_INDIVIDUAL_TRACKS; strcpy(prefs->useragent, DEFAULT_USER_AGENT); // Defaults for splitpoint - times are in ms prefs->sp_opt.xs = 1; prefs->sp_opt.xs_min_volume = 1; prefs->sp_opt.xs_silence_length = 1000; prefs->sp_opt.xs_search_window_1 = 6000; prefs->sp_opt.xs_search_window_2 = 6000; prefs->sp_opt.xs_offset = 0; prefs->sp_opt.xs_padding_1 = 0; /* Changed from 300 to 0 vers. 1.64.5 */ prefs->sp_opt.xs_padding_2 = 0; /* Changed from 300 to 0 vers. 1.64.5 */ prefs->timeout = 15; prefs->dropcount = 1; /* Changed from 0 to 1 in version 1.63-beta-8 */ // Defaults for codeset memset (&prefs->cs_opt, 0, sizeof(CODESET_OPTIONS)); set_codesets_default (&prefs->cs_opt); prefs->count_start = 0; prefs->overwrite = OVERWRITE_VERSION; prefs->ext_cmd[0] = 0; } static void prefs_get_wstreamripper_defaults (WSTREAMRIPPER_PREFS* prefs) { int i; strcpy(prefs->default_skin, DEFAULT_SKINFILE); prefs->m_enabled = 1; prefs->oldpos_x = 0; prefs->oldpos_y = 0; /* Changed from "localhost" to 127.0.0.1 in version 1.64.5 */ strcpy (prefs->localhost, "127.0.0.1"); prefs->m_add_finished_tracks_to_playlist = 0; prefs->m_start_minimized = 0; prefs->use_old_playlist_ret = 0; for (i = 0; i < RIPLIST_LEN; i++) { prefs->riplist[i][0] = 0; } } /* Return 0 if value not found, 1 if value found */ static int prefs_get_string (char* dest, gsize dest_size, char* group, char* key) { GError *error = NULL; gchar *value; value = g_key_file_get_string (m_key_file, group, key, &error); if (error) { /* Key doesn't exist, do nothing */ g_error_free (error); return 0; } if (g_strlcpy (dest, value, dest_size) >= dest_size) { /* Value too long, silently truncate */ } g_free (value); return 1; } static void prefs_get_ushort (u_short *dest, char *group, char *key) { GError *error = NULL; gint value; value = g_key_file_get_integer (m_key_file, group, key, &error); if (error) { /* Key doesn't exist, do nothing */ g_error_free (error); return; } if (value < 0 || value > G_MAXUSHORT) { /* Bad value, silently ignore (?) */ return; } *dest = (u_short) value; } /* Return 0 if value not found, 1 if value found */ static int prefs_get_ulong (u_long *dest, char *group, char *key) { GError *error = NULL; gint value; value = g_key_file_get_integer (m_key_file, group, key, &error); if (error) { /* Key doesn't exist, do nothing */ g_error_free (error); return 0; } if (value < 0) { /* Bad value, silently ignore (?) */ return 0; } *dest = (u_long) value; return 1; } /* Return 0 if value not found, 1 if value found */ static int prefs_get_long (long *dest, char *group, char *key) { GError *error = NULL; gint value; value = g_key_file_get_integer (m_key_file, group, key, &error); if (error) { /* Key doesn't exist, do nothing */ g_error_free (error); return 0; } *dest = (long) value; return 1; } /* Return 0 if value not found, 1 if value found */ static int prefs_get_int (int *dest, char *group, char *key) { GError *error = NULL; gint value; value = g_key_file_get_integer (m_key_file, group, key, &error); if (error) { /* Key doesn't exist, do nothing */ g_error_free (error); return 0; } *dest = (u_long) value; return 1; } static void prefs_set_string (char* group, char* key, char* value) { g_key_file_set_string (m_key_file, group, key, value); } static void prefs_set_integer (char* group, char* key, gint value) { g_key_file_set_integer (m_key_file, group, key, value); } static void prefs_get_stream_prefs_keyfile (STREAM_PREFS* prefs, char* group) { u_long temp; char overwrite_str[128]; if (!m_key_file) return; prefs_get_string (prefs->url, MAX_URL_LEN, group, "url"); prefs_get_string (prefs->proxyurl, MAX_URL_LEN, group, "proxy"); prefs_get_string (prefs->output_directory, SR_MAX_PATH, group, "output_dir"); prefs_get_string (prefs->output_pattern, SR_MAX_PATH, group, "output_pattern"); prefs_get_string (prefs->showfile_pattern, SR_MAX_PATH, group, "showfile_pattern"); prefs_get_string (prefs->if_name, SR_MAX_PATH, group, "if_name"); prefs_get_string (prefs->rules_file, SR_MAX_PATH, group, "rules_file"); prefs_get_string (prefs->pls_file, SR_MAX_PATH, group, "pls_file"); prefs_get_string (prefs->relay_ip, SR_MAX_PATH, group, "relay_ip"); prefs_get_string (prefs->useragent, MAX_USERAGENT_STR, group, "useragent"); prefs_get_string (prefs->ext_cmd, SR_MAX_PATH, group, "ext_cmd"); prefs_get_ushort (&prefs->relay_port, group, "relay_port"); prefs_get_ushort (&prefs->max_port, group, "max_port"); prefs_get_ulong (&prefs->max_connections, group, "max_connections"); prefs_get_ulong (&prefs->maxMB_rip_size, group, "maxMB_bytes"); prefs_get_ulong (&prefs->maxMB_rip_size, group, "maxMB_bytes"); prefs_get_ulong (&prefs->dropcount, group, "dropcount"); /* Overwrite */ if (prefs_get_string (overwrite_str, 128, group, "over_write_complete")) { prefs->overwrite = string_to_overwrite_opt (overwrite_str); } /* Flags */ if (prefs_get_ulong (&temp, group, "auto_reconnect")) { OPT_FLAG_SET (prefs->flags, OPT_AUTO_RECONNECT, temp); } if (prefs_get_ulong (&temp, group, "separate_dirs")) { OPT_FLAG_SET (prefs->flags, OPT_SEPARATE_DIRS, temp); } if (prefs_get_ulong (&temp, group, "make_relay")) { OPT_FLAG_SET (prefs->flags, OPT_MAKE_RELAY, temp); } if (prefs_get_ulong (&temp, group, "add_numeric_prefix")) { OPT_FLAG_SET (prefs->flags, OPT_COUNT_FILES, temp); } if (prefs_get_ulong (&temp, group, "add_id3")) { /* Obsolete */ OPT_FLAG_SET (prefs->flags, OPT_ADD_ID3V1, temp); OPT_FLAG_SET (prefs->flags, OPT_ADD_ID3V2, temp); } if (prefs_get_ulong (&temp, group, "add_date_stamp")) { OPT_FLAG_SET (prefs->flags, OPT_DATE_STAMP, temp); } if (prefs_get_ulong (&temp, group, "check_max_bytes")) { OPT_FLAG_SET (prefs->flags, OPT_CHECK_MAX_BYTES, temp); } if (prefs_get_ulong (&temp, group, "keep_incomplete")) { OPT_FLAG_SET (prefs->flags, OPT_KEEP_INCOMPLETE, temp); } if (prefs_get_ulong (&temp, group, "rip_single_file")) { OPT_FLAG_SET (prefs->flags, OPT_SINGLE_FILE_OUTPUT, temp); } if (prefs_get_ulong (&temp, group, "truncate_incomplete_when_in_complete")) { OPT_FLAG_SET (prefs->flags, OPT_TRUNCATE_DUPS, temp); } if (prefs_get_ulong (&temp, group, "rip_individual_tracks")) { OPT_FLAG_SET (prefs->flags, OPT_INDIVIDUAL_TRACKS, temp); } if (prefs_get_ulong (&temp, group, "use_ext_cmd")) { OPT_FLAG_SET (prefs->flags, OPT_EXTERNAL_CMD, temp); } if (prefs_get_ulong (&temp, group, "add_id3v1")) { OPT_FLAG_SET (prefs->flags, OPT_ADD_ID3V1, temp); } if (prefs_get_ulong (&temp, group, "add_id3v2")) { OPT_FLAG_SET (prefs->flags, OPT_ADD_ID3V2, temp); } /* Splitpoint options */ prefs_get_int (&prefs->sp_opt.xs, group, "xs"); prefs_get_int (&prefs->sp_opt.xs_offset, group, "xs_offset"); prefs_get_int (&prefs->sp_opt.xs_silence_length, group, "xs_silence_length"); prefs_get_int (&prefs->sp_opt.xs_search_window_1, group, "xs_search_window_1"); prefs_get_int (&prefs->sp_opt.xs_search_window_2, group, "xs_search_window_2"); prefs_get_int (&prefs->sp_opt.xs_padding_1, group, "xs_padding_1"); prefs_get_int (&prefs->sp_opt.xs_padding_2, group, "xs_padding_2"); /* Codesets */ prefs_get_string (prefs->cs_opt.codeset_metadata, MAX_CODESET_STRING, group, "codeset_metadata"); prefs_get_string (prefs->cs_opt.codeset_relay, MAX_CODESET_STRING, group, "codeset_relay"); prefs_get_string (prefs->cs_opt.codeset_id3, MAX_CODESET_STRING, group, "codeset_id3"); prefs_get_string (prefs->cs_opt.codeset_filesys, MAX_CODESET_STRING, group, "codeset_filesys"); } /* gp = global preferences */ static void prefs_set_stream_prefs_keyfile (STREAM_PREFS* prefs, STREAM_PREFS* gp, char* group) { if (!m_key_file) return; if (!gp || !strcmp(prefs->url, gp->url)) { prefs_set_string (group, "url", prefs->url); } if (!gp || !strcmp(prefs->proxyurl, gp->proxyurl)) { prefs_set_string (group, "proxy", prefs->proxyurl); } if (!gp || !strcmp(prefs->output_directory, gp->output_directory)) { prefs_set_string (group, "output_dir", prefs->output_directory); } if (!gp || !strcmp(prefs->output_pattern, gp->output_pattern)) { prefs_set_string (group, "output_pattern", prefs->output_pattern); } if (!gp || !strcmp(prefs->showfile_pattern, gp->showfile_pattern)) { prefs_set_string (group, "showfile_pattern", prefs->showfile_pattern); } if (!gp || !strcmp(prefs->if_name, gp->if_name)) { prefs_set_string (group, "if_name", prefs->if_name); } if (!gp || !strcmp(prefs->rules_file, gp->rules_file)) { prefs_set_string (group, "rules_file", prefs->rules_file); } if (!gp || !strcmp(prefs->pls_file, gp->pls_file)) { prefs_set_string (group, "pls_file", prefs->pls_file); } if (!gp || !strcmp(prefs->relay_ip, gp->relay_ip)) { prefs_set_string (group, "relay_ip", prefs->relay_ip); } /* User agent is treated differently. */ if (!gp || !strcmp(prefs->useragent, gp->useragent)) { if (strcmp(prefs->useragent, DEFAULT_USER_AGENT)) { prefs_set_string (group, "useragent", prefs->useragent); } else { prefs_set_string (group, "useragent", ""); } } if (!gp || !strcmp(prefs->ext_cmd, gp->ext_cmd)) { prefs_set_string (group, "ext_cmd", prefs->ext_cmd); } prefs_set_integer (group, "relay_port", prefs->relay_port); prefs_set_integer (group, "max_port", prefs->max_port); prefs_set_integer (group, "max_connections", prefs->max_connections); prefs_set_integer (group, "maxMB_bytes", prefs->maxMB_rip_size); prefs_set_integer (group, "maxMB_bytes", prefs->maxMB_rip_size); prefs_set_integer (group, "dropcount", prefs->dropcount); /* Overwrite */ g_key_file_set_string (m_key_file, group, "over_write_complete", overwrite_opt_to_string(prefs->overwrite)); /* Flags */ prefs_set_integer (group, "auto_reconnect", OPT_FLAG_ISSET (prefs->flags, OPT_AUTO_RECONNECT)); prefs_set_integer (group, "separate_dirs", OPT_FLAG_ISSET (prefs->flags, OPT_SEPARATE_DIRS)); prefs_set_integer (group, "make_relay", OPT_FLAG_ISSET (prefs->flags, OPT_MAKE_RELAY)); prefs_set_integer (group, "add_numeric_prefix", OPT_FLAG_ISSET (prefs->flags, OPT_COUNT_FILES)); prefs_set_integer (group, "add_date_stamp", OPT_FLAG_ISSET (prefs->flags, OPT_DATE_STAMP)); prefs_set_integer (group, "check_max_bytes", OPT_FLAG_ISSET (prefs->flags, OPT_CHECK_MAX_BYTES)); prefs_set_integer (group, "keep_incomplete", OPT_FLAG_ISSET (prefs->flags, OPT_KEEP_INCOMPLETE)); prefs_set_integer (group, "rip_single_file", OPT_FLAG_ISSET (prefs->flags, OPT_SINGLE_FILE_OUTPUT)); prefs_set_integer (group, "truncate_incomplete_when_in_complete", OPT_FLAG_ISSET (prefs->flags, OPT_TRUNCATE_DUPS)); prefs_set_integer (group, "rip_individual_tracks", OPT_FLAG_ISSET (prefs->flags, OPT_INDIVIDUAL_TRACKS)); prefs_set_integer (group, "use_ext_cmd", OPT_FLAG_ISSET (prefs->flags, OPT_EXTERNAL_CMD)); prefs_set_integer (group, "add_id3v1", OPT_FLAG_ISSET (prefs->flags, OPT_ADD_ID3V1)); prefs_set_integer (group, "add_id3v2", OPT_FLAG_ISSET (prefs->flags, OPT_ADD_ID3V2)); /* Splitpoint options */ prefs_set_integer (group, "xs", prefs->sp_opt.xs); prefs_set_integer (group, "xs_offset", prefs->sp_opt.xs_offset); prefs_set_integer (group, "xs_silence_length", prefs->sp_opt.xs_silence_length); prefs_set_integer (group, "xs_search_window_1", prefs->sp_opt.xs_search_window_1); prefs_set_integer (group, "xs_search_window_2", prefs->sp_opt.xs_search_window_2); prefs_set_integer (group, "xs_padding_1", prefs->sp_opt.xs_padding_1); prefs_set_integer (group, "xs_padding_2", prefs->sp_opt.xs_padding_2); /* Codesets */ if (!gp || !strcmp(prefs->cs_opt.codeset_metadata, gp->cs_opt.codeset_metadata)) { prefs_set_string (group, "codeset_metadata", prefs->cs_opt.codeset_metadata); } if (!gp || !strcmp(prefs->cs_opt.codeset_relay, gp->cs_opt.codeset_relay)) { prefs_set_string (group, "codeset_relay", prefs->cs_opt.codeset_relay); } if (!gp || !strcmp(prefs->cs_opt.codeset_id3, gp->cs_opt.codeset_id3)) { prefs_set_string (group, "codeset_id3", prefs->cs_opt.codeset_id3); } if (!gp || !strcmp(prefs->cs_opt.codeset_filesys, gp->cs_opt.codeset_filesys)) { prefs_set_string (group, "codeset_filesys", prefs->cs_opt.codeset_filesys); } } streamripper-1.64.6.orig/lib/errors.h0000644000175000017500000000742111007362140015565 0ustar abiabi#ifndef __ERRORS_H__ #define __ERRORS_H__ #include "srtypes.h" typedef int error_code; //////////////////////////////////////////////// // StreamRipper Codes //////////////////////////////////////////////// // JCBUG -- no way to make custom error strings for http errors, also errors // are not organized at all, should have space to insert in places. // /* ************** IMPORTANT IF YOU ADD ERROR CODES!!!! ***********************/ #define NUM_ERROR_CODES ((0x44)+1) /* ************** IMPORTANT IF YOU ADD ERROR CODES!!!! ***********************/ #define SR_SUCCESS 0x00 #define SR_SUCCESS_BUFFERING 0x01 #define SR_ERROR_CANT_FIND_TRACK_SEPERATION - 0x01 #define SR_ERROR_DECODE_FAILURE - 0x02 #define SR_ERROR_INVALID_URL - 0x03 #define SR_ERROR_WIN32_INIT_FAILURE - 0x04 #define SR_ERROR_CONNECT_FAILED - 0x05 #define SR_ERROR_CANT_RESOLVE_HOSTNAME - 0x06 #define SR_ERROR_RECV_FAILED - 0x07 #define SR_ERROR_SEND_FAILED - 0x08 #define SR_ERROR_PARSE_FAILURE - 0x09 #define SR_ERROR_NO_RESPONSE_HEADER - 0x0a #define SR_ERROR_NO_ICY_CODE - 0x0b #define SR_ERROR_NO_META_INTERVAL - 0x0c #define SR_ERROR_INVALID_PARAM - 0x0d #define SR_ERROR_NO_HTTP_HEADER - 0x0e #define SR_ERROR_CANT_GET_LIVE365_ID - 0x0f #define SR_ERROR_CANT_ALLOC_MEMORY - 0x10 #define SR_ERROR_CANT_FIND_IP_PORT - 0x11 #define SR_ERROR_CANT_FIND_MEMBERNAME - 0x12 #define SR_ERROR_CANT_FIND_TRACK_NAME - 0x13 #define SR_ERROR_NULL_MEMBER_NAME - 0x14 #define SR_ERROR_CANT_FIND_TIME_TAG - 0x15 #define SR_ERROR_BUFFER_EMPTY - 0x16 #define SR_ERROR_BUFFER_FULL - 0x17 #define SR_ERROR_CANT_INIT_XAUDIO - 0x18 #define SR_ERROR_BUFFER_TOO_SMALL - 0x19 #define SR_ERROR_CANT_CREATE_THREAD - 0x1A #define SR_ERROR_CANT_FIND_MPEG_HEADER - 0x1B #define SR_ERROR_INVALID_METADATA - 0x1C #define SR_ERROR_NO_TRACK_INFO - 0x1D #define SR_EEROR_CANT_FIND_SUBSTR - 0x1E #define SR_ERROR_CANT_BIND_ON_PORT - 0x1F #define SR_ERROR_HOST_NOT_CONNECTED - 0x20 #define SR_ERROR_HTTP_404_ERROR - 0x21 #define SR_ERROR_HTTP_401_ERROR - 0x22 #define SR_ERROR_HTTP_502_ERROR - 0x23 // Connection Refused #define SR_ERROR_CANT_CREATE_FILE - 0x24 #define SR_ERROR_CANT_WRITE_TO_FILE - 0x25 #define SR_ERROR_CANT_CREATE_DIR - 0x26 #define SR_ERROR_HTTP_400_ERROR - 0x27 // Server Full #define SR_ERROR_CANT_SET_SOCKET_OPTIONS - 0x28 #define SR_ERROR_SOCK_BASE - 0x29 #define SR_ERROR_INVALID_DIRECTORY - 0x2a #define SR_ERROR_FAILED_TO_MOVE_FILE - 0x2b #define SR_ERROR_CANT_LOAD_MPGLIB - 0x2c #define SR_ERROR_CANT_INIT_MPGLIB - 0x2d #define SR_ERROR_CANT_UNLOAD_MPGLIB - 0x2e #define SR_ERROR_PCM_BUFFER_TO_SMALL - 0x2f #define SR_ERROR_CANT_DECODE_MP3 - 0x30 #define SR_ERROR_SOCKET_CLOSED - 0x31 #define SR_ERROR_LIVE365 - 0x32 #define SR_ERROR_MAX_BYTES_RIPPED - 0x33 #define SR_ERROR_CANT_WAIT_ON_THREAD - 0x34 #define SR_ERROR_CANT_CREATE_EVENT - 0x35 #define SR_ERROR_NOT_SHOUTCAST_STREAM - 0x36 #define SR_ERROR_HTTP_407_ERROR - 0x37 #define SR_ERROR_HTTP_403_ERROR - 0x38 #define SR_ERROR_DIR_PATH_TOO_LONG - 0x39 #define SR_ERROR_PROGRAM_ERROR - 0x3a #define SR_ERROR_TIMEOUT - 0x3b #define SR_ERROR_SELECT_FAILED - 0x3c #define SR_ERROR_REQUIRED_WINDOW_EMPTY - 0x3d // Not an error #define SR_ERROR_CANT_BIND_ON_INTERFACE - 0x3e #define SR_ERROR_NO_OGG_PAGES_FOR_RELAY - 0x3f #define SR_ERROR_CANT_PARSE_PLS - 0x40 #define SR_ERROR_CANT_PARSE_M3U - 0x41 #define SR_ERROR_CANT_CREATE_SOCKET - 0x42 #define SR_ERROR_CREATE_PIPE_FAILED - 0x43 #define SR_ERROR_ABORT_PIPE_SIGNALLED - 0x44 // Not an error typedef struct ERROR_INFOst { char error_str[MAX_ERROR_STR]; error_code error_code; } ERROR_INFO; void errors_init (void); char* errors_get_string (error_code code); #endif streamripper-1.64.6.orig/lib/ictest.c0000644000175000017500000000057110561454307015551 0ustar abiabi#include #include #include #include #include #include int main (int argc, char* argv[]) { wchar_t buf[1024]; setlocale (LC_CTYPE, ""); swprintf (buf, 1024, L"%ls", L"HiHi"); printf ("%d wide chars in arg\n", wcslen(L"HiHi")); printf ("%d wide chars in buf\n", wcslen(buf)); return 0; } streamripper-1.64.6.orig/lib/compat.h0000644000175000017500000000722611025302115015533 0ustar abiabi/* compat.h * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __COMPAT_H__ #define __COMPAT_H__ #if WIN32 #include #include #include #else #include #include #include #include #include #include #endif // // This file handles all portablity issues with streamripper // // File Routines ////////////////////////////////////////// #ifdef WIN32 #define FHANDLE HANDLE #define OpenFile(_filename_) CreateFile(_filename_, GENERIC_READ, \ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, \ FILE_ATTRIBUTE_NORMAL, NULL) // #define CloseFile(_fhandle_) CloseHandle(_fhandle_) #define TruncateFile(_filename_) \ CloseFile(CreateFile(_filename_, GENERIC_WRITE, \ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, \ TRUNCATE_EXISTING, \ FILE_ATTRIBUTE_NORMAL, NULL)) //#define MoveFile(_oldfile_, _newfile_) MoveFile(_oldfile_, _newfile_) #define INVALID_FHANDLE INVALID_HANDLE_VALUE #define close _close #elif __UNIX__ #define FHANDLE int // #define OpenFile(_filename_) open(_filename_, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) // #define CloseFile(_fhandle_) close(_fhandle_) // #define TruncateFile(_filename_) CloseFile(open(_filename_, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) // #define MoveFile(_oldfile_, _newfile_) rename(_oldfile_, _newfile_) // #define DeleteFile(_file_) (!unlink(_file_)) #define INVALID_FHANDLE -1 #endif // Thread Routines #if WIN32 #define THREAD_HANDLE HANDLE #define BeginThread(_thandle_, callback, arg) \ {_thandle_ = (THREAD_HANDLE)_beginthread((void*) callback, 0, (void*) arg);} #define WaitForThread(_thandle_) WaitForSingleObject(_thandle_, INFINITE); #define DestroyThread(_thandle_) CloseHandle(_thandle_) #define HSEM HANDLE #define SemInit(_s_) {_s_ = CreateEvent(NULL, TRUE, FALSE, NULL);} #define SemWait(_s_) {WaitForSingleObject(_s_, INFINITE); ResetEvent(_s_);} #define SemPost(_s_) SetEvent(_s_) #define SemDestroy(_s_) CloseHandle(_s_) #define sleep(x) Sleep(1000*x) #elif __UNIX__ #define THREAD_HANDLE pthread_t #define BeginThread(_thandle_, callback, arg) \ pthread_create(&_thandle_, NULL, \ (void *)callback, (void *)arg) #define WaitForThread(_thandle_) pthread_join(_thandle_, NULL) #define DestroyThread(_thandle_) // is there one for unix? #define HSEM sem_t #define SemInit(_s_) sem_init(&(_s_), 0, 0) #define SemWait(_s_) sem_wait(&(_s_)) #define SemPost(_s_) sem_post(&(_s_)) #define SemDestroy(_s_) sem_destroy(&(_s_)) #define Sleep(x) usleep(1000*x) #endif // Socket Routines ////////////////////////////////////////// #if WIN32 //#define EAGAIN WSAEWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK #elif __UNIX__ #define closesocket close #define SOCKET_ERROR -1 #define WSACleanup() #endif // Other stuff ////////////////////////////////////////// #if WIN32 #define snprintf _snprintf #endif #endif // __COMPAT_H__ streamripper-1.64.6.orig/lib/relaylib.h0000644000175000017500000000360710756140762016074 0ustar abiabi/* relaylib.h * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __RELAYLIB_H__ #define __RELAYLIB_H__ #include "srtypes.h" #include "errors.h" #include "compat.h" /***************************************************************************** * Global variables *****************************************************************************/ //extern RELAY_LIST* g_relay_list; //extern unsigned long g_relay_list_len; //extern HSEM g_relay_list_sem; /***************************************************************************** * Function prototypes *****************************************************************************/ error_code relaylib_set_response_header(char *http_header); error_code relaylib_start (RIP_MANAGER_INFO* rmi, BOOL search_ports, u_short relay_port, u_short max_port, u_short *port_used, char *if_name, int max_connections, char *relay_ip, int have_metadata); //error_code relaylib_start(RIP_MANAGER_INFO* rmi); error_code relaylib_send(char *data, int len, int accept_new, int is_meta); void relaylib_stop (RIP_MANAGER_INFO* rmi); BOOL relaylib_isrunning(); error_code relaylib_send_meta_data(char *track); void relaylib_disconnect (RIP_MANAGER_INFO* rmi, RELAY_LIST* prev, RELAY_LIST* ptr); #endif //__RELAYLIB__ streamripper-1.64.6.orig/lib/mchar.h0000644000175000017500000000244111164223124015342 0ustar abiabi#ifndef __MCHAR_H__ #define __MCHAR_H__ #include "srtypes.h" #define m_(x) x #define m_S "%s" #define m_C "%c" #define m_s "%s" #define m_c "%c" char *subnstr_until(const char *str, char *until, char *newstr, int maxlen); char *left_str(char *str, int len); char *format_byte_size(char *str, long size); void trim(char *str); void sr_strncpy(char* dst, char* src, int n); void sr_set_locale (void); void set_codesets_default (CODESET_OPTIONS* cs_opt); void register_codesets (RIP_MANAGER_INFO* rmi, CODESET_OPTIONS* cs_opt); int gstring_from_string (RIP_MANAGER_INFO* rmi, mchar* m, int mlen, char* c, int codeset_type); int string_from_gstring (RIP_MANAGER_INFO* rmi, char* c, int clen, mchar* m, int codeset_type); mchar* mstrdup (mchar* src); mchar* mstrcpy (mchar* dest, const mchar* src); int msnprintf (mchar* dest, size_t n, const mchar* fmt, ...); void mstrncpy (mchar* dst, mchar* src, int n); size_t mstrlen (mchar* s); mchar* mstrchr (const mchar* ws, mchar wc); mchar* mstrrchr (const mchar* ws, mchar wc); mchar* mstrncat (mchar* ws1, const mchar* ws2, size_t n); int mstrcmp (const mchar* ws1, const mchar* ws2); long int mtol (const mchar* string); int is_id3_unicode (RIP_MANAGER_INFO* mchar_cs); gchar* utf8_string_from_string (char* src, char* codeset); #endif /*__MCHAR_H__*/ streamripper-1.64.6.orig/lib/argv.c0000644000175000017500000002033510666641711015220 0ustar abiabi/* Create and destroy argument vectors (argv's) Copyright (C) 1992, 2001 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Libiberty 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Create and destroy argument vectors. An argument vector is simply an array of string pointers, terminated by a NULL pointer. */ #if defined (commentout) #include "ansidecl.h" #include "libiberty.h" #endif #include "config.h" #if HAVE_ALLOCA_H # include #elif defined __GNUC__ # define alloca __builtin_alloca #elif defined _AIX # define alloca __alloca #elif defined _MSC_VER # include # define alloca _alloca #else # include # ifdef __cplusplus extern "C" # endif void *alloca (size_t); #endif void freeargv (char **vector); #define ISBLANK(ch) ((ch) == ' ' || (ch) == '\t') /* Routines imported from standard C runtime libraries. */ #ifdef ANSI_PROTOTYPES #include #include #include #else /* !ANSI_PROTOTYPES */ #if !defined _WIN32 || defined __GNUC__ extern char *memcpy (); /* Copy memory region */ extern int strlen (); /* Count length of string */ extern char *malloc (); /* Standard memory allocater */ extern char *realloc (); /* Standard memory reallocator */ extern void free (); /* Free malloc'd memory */ extern char *strdup (); /* Duplicate a string */ #endif #endif /* ANSI_PROTOTYPES */ #ifndef NULL #define NULL 0 #endif #ifndef EOS #define EOS '\0' #endif #define INITIAL_MAXARGC 8 /* Number of args + NULL in initial argv */ /* @deftypefn Extension char** dupargv (char **@var{vector}) Duplicate an argument vector. Simply scans through @var{vector}, duplicating each argument until the terminating @code{NULL} is found. Returns a pointer to the argument vector if successful. Returns @code{NULL} if there is insufficient memory to complete building the argument vector. @end deftypefn */ char ** dupargv (argv) char **argv; { int argc; char **copy; if (argv == NULL) return NULL; /* the vector */ for (argc = 0; argv[argc] != NULL; argc++); copy = (char **) malloc ((argc + 1) * sizeof (char *)); if (copy == NULL) return NULL; /* the strings */ for (argc = 0; argv[argc] != NULL; argc++) { int len = strlen (argv[argc]); copy[argc] = malloc (sizeof (char *) * (len + 1)); if (copy[argc] == NULL) { freeargv (copy); return NULL; } strcpy (copy[argc], argv[argc]); } copy[argc] = NULL; return copy; } /* @deftypefn Extension void freeargv (char **@var{vector}) Free an argument vector that was built using @code{buildargv}. Simply scans through @var{vector}, freeing the memory for each argument until the terminating @code{NULL} is found, and then frees @var{vector} itself. @end deftypefn */ void freeargv (vector) char **vector; { register char **scan; if (vector != NULL) { for (scan = vector; *scan != NULL; scan++) { free (*scan); } free (vector); } } /* @deftypefn Extension char** buildargv (char *@var{sp}) Given a pointer to a string, parse the string extracting fields separated by whitespace and optionally enclosed within either single or double quotes (which are stripped off), and build a vector of pointers to copies of the string for each field. The input string remains unchanged. The last element of the vector is followed by a @code{NULL} element. All of the memory for the pointer array and copies of the string is obtained from @code{malloc}. All of the memory can be returned to the system with the single function call @code{freeargv}, which takes the returned result of @code{buildargv}, as it's argument. Returns a pointer to the argument vector if successful. Returns @code{NULL} if @var{sp} is @code{NULL} or if there is insufficient memory to complete building the argument vector. If the input is a null string (as opposed to a @code{NULL} pointer), then buildarg returns an argument vector that has one arg, a null string. @end deftypefn The memory for the argv array is dynamically expanded as necessary. In order to provide a working buffer for extracting arguments into, with appropriate stripping of quotes and translation of backslash sequences, we allocate a working buffer at least as long as the input string. This ensures that we always have enough space in which to work, since the extracted arg is never larger than the input string. The argument vector is always kept terminated with a @code{NULL} arg pointer, so it can be passed to @code{freeargv} at any time, or returned, as appropriate. */ char **buildargv (input) const char *input; { char *arg; char *copybuf; int squote = 0; int dquote = 0; int bsquote = 0; int argc = 0; int maxargc = 0; char **argv = NULL; char **nargv; if (input != NULL) { copybuf = (char *) alloca (strlen (input) + 1); /* Is a do{}while to always execute the loop once. Always return an argv, even for null strings. See NOTES above, test case below. */ do { /* Pick off argv[argc] */ while (ISBLANK (*input)) { input++; } if ((maxargc == 0) || (argc >= (maxargc - 1))) { /* argv needs initialization, or expansion */ if (argv == NULL) { maxargc = INITIAL_MAXARGC; nargv = (char **) malloc (maxargc * sizeof (char *)); } else { maxargc *= 2; nargv = (char **) realloc (argv, maxargc * sizeof (char *)); } if (nargv == NULL) { if (argv != NULL) { freeargv (argv); argv = NULL; } break; } argv = nargv; argv[argc] = NULL; } /* Begin scanning arg */ arg = copybuf; while (*input != EOS) { if (ISBLANK (*input) && !squote && !dquote && !bsquote) { break; } else { if (bsquote) { bsquote = 0; *arg++ = *input; } else if (*input == '\\') { bsquote = 1; } else if (squote) { if (*input == '\'') { squote = 0; } else { *arg++ = *input; } } else if (dquote) { if (*input == '"') { dquote = 0; } else { *arg++ = *input; } } else { if (*input == '\'') { squote = 1; } else if (*input == '"') { dquote = 1; } else { *arg++ = *input; } } input++; } } *arg = EOS; argv[argc] = strdup (copybuf); if (argv[argc] == NULL) { freeargv (argv); argv = NULL; break; } argc++; argv[argc] = NULL; while (ISBLANK (*input)) { input++; } } while (*input != EOS); } return (argv); } #ifdef MAIN /* Simple little test driver. */ static const char *const tests[] = { "a simple command line", "arg 'foo' is single quoted", "arg \"bar\" is double quoted", "arg \"foo bar\" has embedded whitespace", "arg 'Jack said \\'hi\\'' has single quotes", "arg 'Jack said \\\"hi\\\"' has double quotes", "a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9", /* This should be expanded into only one argument. */ "trailing-whitespace ", "", NULL }; int main () { char **argv; const char *const *test; char **targs; for (test = tests; *test != NULL; test++) { printf ("buildargv(\"%s\")\n", *test); if ((argv = buildargv (*test)) == NULL) { printf ("failed!\n\n"); } else { for (targs = argv; *targs != NULL; targs++) { printf ("\t\"%s\"\n", *targs); } printf ("\n"); } freeargv (argv); } return 0; } #endif /* MAIN */ streamripper-1.64.6.orig/lib/filelib.h0000644000175000017500000000664111025302115015656 0ustar abiabi/* filelib.h * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __FILELIB_H__ #define __FILELIB_H__ #include "srtypes.h" #include "errors.h" #if WIN32 #include #include #endif #if WIN32 #define PATH_SLASH m_('\\') #define PATH_SLASH_STR m_("\\") #else #define PATH_SLASH m_('/') #define PATH_SLASH_STR m_("/") #endif /* Pathname support. Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1995. Licence: GNU LGPL */ /* ISSLASH(C) tests whether C is a directory separator character. IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, it may be concatenated to a directory pathname. */ #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define ISSLASH(C) ((C) == m_('/') || (C) == m_('\\')) # define HAS_DEVICE(P) \ ((((P)[0] >= m_('A') && (P)[0] <= m_('Z')) \ || ((P)[0] >= m_('a') && (P)[0] <= m_('z'))) \ && (P)[1] == m_(':')) /* GCS: This is not correct, because it could be c:foo which is relative */ /* # define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) */ # define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) #else /* Unix */ # define ISSLASH(C) ((C) == m_('/')) # define HAS_DEVICE(P) (0) # define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) #endif #define SR_MIN_FILENAME 54 /* For files in incomplete */ #define SR_MIN_COMPLETEDIR 10 /* For dir with radio station name */ #define SR_DATE_LEN 11 #define SR_MIN_COMPLETE_W_DATE (SR_MIN_COMPLETEDIR+SR_DATE_LEN) /* Directory lengths, including trailing slash */ #define SR_MAX_INCOMPLETE (SR_MAX_PATH-SR_MIN_FILENAME) #define SR_MAX_COMPLETE (SR_MAX_INCOMPLETE-strlen("incomplete/")) #define SR_MAX_BASE (SR_MAX_COMPLETE-SR_MIN_COMPLETEDIR-strlen("/")) #define SR_MAX_BASE_W_DATE (SR_MAX_BASE-SR_MIN_COMPLETE_W_DATE) error_code filelib_init (RIP_MANAGER_INFO* rmi, BOOL do_individual_tracks, BOOL do_count, int count_start, BOOL keep_incomplete, BOOL do_show_file, int content_type, char* output_directory, char* output_pattern, char* showfile_pattern, int get_separate_dirs, int get_date_stamp, char* icy_name); error_code filelib_start (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti); error_code filelib_write_track (RIP_MANAGER_INFO* rmi, char *buf, u_long size); error_code filelib_write_show (RIP_MANAGER_INFO* rmi, char *buf, u_long size); error_code filelib_write_cue (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti, int secs); error_code filelib_end (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti, enum OverwriteOpt overwrite, BOOL truncate_dup, mchar *fullpath); void filelib_shutdown (RIP_MANAGER_INFO* rmi); #endif //FILELIB streamripper-1.64.6.orig/lib/filelib.c0000644000175000017500000012074511164223303015660 0ustar abiabi/* filelib.c * library routines for file operations * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include "compat.h" #include "filelib.h" #include "mchar.h" #include "debug.h" #include #include #include "glib.h" #include "glib/gstdio.h" #include "uce_dirent.h" #define TEMP_STR_LEN (SR_MAX_PATH*2) /***************************************************************************** * Private Functions *****************************************************************************/ static error_code device_split (gchar* dirname, gchar* device, gchar* path); static error_code mkdir_if_needed (RIP_MANAGER_INFO* rmi, gchar *str); static error_code mkdir_recursive (RIP_MANAGER_INFO* rmi, gchar *str, int make_last); static void close_file (FHANDLE* fp); static void close_files (RIP_MANAGER_INFO* rmi); static error_code filelib_write (FHANDLE fp, char *buf, u_long size); static BOOL file_exists (RIP_MANAGER_INFO* rmi, gchar *filename); static void trim_filename (RIP_MANAGER_INFO* rmi, gchar* out, gchar *filename); static void trim_mp3_suffix (RIP_MANAGER_INFO* rmi, gchar *filename); static error_code filelib_open_for_write (RIP_MANAGER_INFO* rmi, FHANDLE* fp, gchar *filename); static void parse_and_subst_dir (RIP_MANAGER_INFO* rmi, gchar* pattern_head, gchar* pattern_tail, gchar* opat_path, int is_for_showfile); static void parse_and_subst_pat (RIP_MANAGER_INFO* rmi, gchar* newfile, TRACK_INFO* ti, gchar* directory, gchar* pattern, gchar* extension); static void set_default_pattern (RIP_MANAGER_INFO* rmi, BOOL get_separate_dirs, BOOL do_count); static error_code set_output_directory (RIP_MANAGER_INFO* rmi, gchar* global_output_directory, gchar* global_output_pattern, gchar* output_pattern, gchar* output_directory, gchar* default_pattern, gchar* default_pattern_tail, int get_separate_dirs, int get_date_stamp, int is_for_showfile ); static error_code sr_getcwd (RIP_MANAGER_INFO* rmi, gchar* dirbuf); static error_code add_trailing_slash (gchar *str); static int get_next_sequence_number (RIP_MANAGER_INFO* rmi, gchar* fn_base); static void fill_date_buf (RIP_MANAGER_INFO* rmi, gchar* datebuf, int datebuf_len); static error_code filelib_open_showfiles (RIP_MANAGER_INFO* rmi); static void move_file (RIP_MANAGER_INFO* rmi, gchar* new_filename, gchar* old_filename); static gchar* replace_invalid_chars (gchar *str); static void remove_trailing_periods (gchar *str); static BOOL new_file_is_better (RIP_MANAGER_INFO* rmi, gchar *oldfile, gchar *newfile); static void delete_file (RIP_MANAGER_INFO* rmi, gchar* filename); static void truncate_file (RIP_MANAGER_INFO* rmi, gchar* filename); static void filelib_rename_versioned (gchar** new_fn, RIP_MANAGER_INFO* rmi, gchar* directory, gchar* fnbase, gchar* extension); /***************************************************************************** * Public Functions *****************************************************************************/ error_code filelib_init (RIP_MANAGER_INFO* rmi, BOOL do_individual_tracks, BOOL do_count, int count_start, BOOL keep_incomplete, BOOL do_show_file, int content_type, char* output_directory, /* Locale encoded - from command line */ char* output_pattern, /* Locale encoded - from command line */ char* showfile_pattern, /* Locale encoded - from command line */ int get_separate_dirs, int get_date_stamp, char* icy_name) { FILELIB_INFO* fli = &rmi->filelib_info; gchar tmp_output_directory[SR_MAX_PATH]; gchar tmp_output_pattern[SR_MAX_PATH]; gchar tmp_showfile_pattern[SR_MAX_PATH]; fli->m_file = INVALID_FHANDLE; fli->m_show_file = INVALID_FHANDLE; fli->m_cue_file = INVALID_FHANDLE; fli->m_count = do_count ? count_start : -1; fli->m_keep_incomplete = keep_incomplete; memset(&fli->m_output_directory, 0, SR_MAX_PATH); fli->m_show_name[0] = 0; fli->m_do_show = do_show_file; fli->m_do_individual_tracks = do_individual_tracks; fli->m_track_no = 1; debug_printf ("FILELIB_INIT: output_directory=%s\n", output_directory ? output_directory : ""); debug_printf ("FILELIB_INIT: output_pattern=%s\n", output_pattern ? output_pattern : ""); debug_printf ("FILELIB_INIT: showfile_pattern=%s\n", showfile_pattern ? showfile_pattern : ""); debug_printf ("converting output_directory\n"); gstring_from_string (rmi, tmp_output_directory, SR_MAX_PATH, output_directory, CODESET_LOCALE); debug_printf ("converting output_pattern\n"); gstring_from_string (rmi, tmp_output_pattern, SR_MAX_PATH, output_pattern, CODESET_LOCALE); debug_printf ("converting showfile_pattern\n"); gstring_from_string (rmi, tmp_showfile_pattern, SR_MAX_PATH, showfile_pattern, CODESET_LOCALE); debug_printf ("converting icy_name\n"); gstring_from_string (rmi, fli->m_icy_name, SR_MAX_PATH, icy_name, CODESET_METADATA); debug_printf ("Converted output directory: len=%d\n", mstrlen (tmp_output_directory)); mstrcpy (fli->m_stripped_icy_name, fli->m_icy_name); debug_printf ("Replacing invalid chars in stripped_icy_name\n"); replace_invalid_chars (fli->m_stripped_icy_name); debug_printf (" %s\n", fli->m_stripped_icy_name); debug_printf ("Removing trailing periods\n"); remove_trailing_periods (fli->m_stripped_icy_name); debug_printf (" %s\n", fli->m_stripped_icy_name); switch (content_type) { case CONTENT_TYPE_MP3: fli->m_extension = m_(".mp3"); break; case CONTENT_TYPE_NSV: case CONTENT_TYPE_ULTRAVOX: fli->m_extension = m_(".nsv"); break; case CONTENT_TYPE_OGG: fli->m_extension = m_(".ogg"); break; case CONTENT_TYPE_AAC: fli->m_extension = m_(".aac"); break; default: fprintf (stderr, "Error (wrong suggested content type: %d)\n", content_type); return SR_ERROR_PROGRAM_ERROR; } /* Initialize session date */ fill_date_buf (rmi, fli->m_session_datebuf, DATEBUF_LEN); /* Set up the proper pattern if we're using -q and -s flags */ set_default_pattern (rmi, get_separate_dirs, do_count); /* Get the path to the "parent" directory. This is the directory that contains the incomplete dir and the show files. It might not contain the complete files if an output_pattern was specified. */ set_output_directory (rmi, fli->m_output_directory, fli->m_output_pattern, tmp_output_pattern, tmp_output_directory, fli->m_default_pattern, m_("%A - %T"), get_separate_dirs, get_date_stamp, 0); debug_mprintf (m_("m_output_directory: ") m_S m_("\n"), fli->m_output_directory); debug_mprintf (m_("m_output_pattern: ") m_S m_("\n"), fli->m_output_pattern); msnprintf (fli->m_incomplete_directory, SR_MAX_PATH, m_S m_S m_C, fli->m_output_directory, m_("incomplete"), PATH_SLASH); /* Recursively make the output directory & incomplete directory */ if (fli->m_do_individual_tracks) { debug_mprintf (m_("Trying to make output_directory: ") m_S m_("\n"), fli->m_output_directory); mkdir_recursive (rmi, fli->m_output_directory, 1); /* Next, make the incomplete directory */ if (fli->m_do_individual_tracks) { debug_mprintf (m_("Trying to make incomplete_directory: ") m_S m_("\n"), fli->m_incomplete_directory); mkdir_if_needed (rmi, fli->m_incomplete_directory); } } /* Compute the amount of remaining path length for the filenames */ fli->m_max_filename_length = SR_MAX_PATH - mstrlen(fli->m_incomplete_directory); /* Get directory and pattern of showfile */ if (do_show_file) { if (*tmp_showfile_pattern) { trim_mp3_suffix (rmi, tmp_showfile_pattern); if (mstrlen(fli->m_show_name) > SR_MAX_PATH - 5) { return SR_ERROR_DIR_PATH_TOO_LONG; } } set_output_directory (rmi, fli->m_showfile_directory, fli->m_showfile_pattern, tmp_showfile_pattern, tmp_output_directory, fli->m_default_showfile_pattern, m_(""), get_separate_dirs, get_date_stamp, 1); mkdir_recursive (rmi, fli->m_showfile_directory, 1); filelib_open_showfiles (rmi); } return SR_SUCCESS; } error_code filelib_start (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti) { FILELIB_INFO* fli = &rmi->filelib_info; gchar newfile[TEMP_STR_LEN]; gchar fnbase[TEMP_STR_LEN]; gchar fnbase1[TEMP_STR_LEN]; if (!fli->m_do_individual_tracks) return SR_SUCCESS; close_file (&fli->m_file); /* Compose and trim filename (not including directory) */ msnprintf (fnbase1, TEMP_STR_LEN, m_S m_(" - ") m_S, ti->artist, ti->title); trim_filename (rmi, fnbase, fnbase1); msnprintf (newfile, TEMP_STR_LEN, m_S m_S m_S, fli->m_incomplete_directory, fnbase, fli->m_extension); if (fli->m_keep_incomplete) { filelib_rename_versioned (0, rmi, fli->m_incomplete_directory, fnbase, fli->m_extension); } mstrcpy (fli->m_incomplete_filename, newfile); return filelib_open_for_write (rmi, &fli->m_file, newfile); } error_code filelib_write_cue (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti, int secs) { FILELIB_INFO* fli = &rmi->filelib_info; int rc; char buf1[MAX_TRACK_LEN]; char buf2[MAX_TRACK_LEN]; if (!fli->m_do_show) return SR_SUCCESS; if (!fli->m_cue_file) return SR_SUCCESS; rc = snprintf (buf2, MAX_TRACK_LEN, " TRACK %02d AUDIO\n", fli->m_track_no++); filelib_write (fli->m_cue_file, buf2, rc); string_from_gstring (rmi, buf1, MAX_TRACK_LEN, ti->title, CODESET_ID3); rc = snprintf (buf2, MAX_TRACK_LEN, " TITLE \"%s\"\n", buf1); filelib_write (fli->m_cue_file, buf2, rc); string_from_gstring (rmi, buf1, MAX_TRACK_LEN, ti->artist, CODESET_ID3); rc = snprintf (buf2, MAX_TRACK_LEN, " PERFORMER \"%s\"\n", buf1); filelib_write (fli->m_cue_file, buf2, rc); rc = snprintf (buf2, MAX_TRACK_LEN, " INDEX 01 %02d:%02d:00\n", secs / 60, secs % 60); filelib_write (fli->m_cue_file, buf2, rc); return SR_SUCCESS; } error_code filelib_write_track (RIP_MANAGER_INFO* rmi, char *buf, u_long size) { FILELIB_INFO* fli = &rmi->filelib_info; return filelib_write (fli->m_file, buf, size); } error_code filelib_write_show (RIP_MANAGER_INFO* rmi, char *buf, u_long size) { FILELIB_INFO* fli = &rmi->filelib_info; error_code rc; debug_printf ("Testing to write showfile\n"); if (!fli->m_do_show) { return SR_SUCCESS; } debug_printf ("Trying to write showfile\n"); rc = filelib_write (fli->m_show_file, buf, size); if (rc != SR_SUCCESS) { fli->m_do_show = 0; } return rc; } // Moves the file from incomplete to complete directory // fullpath is an output parameter error_code filelib_end (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti, enum OverwriteOpt overwrite, BOOL truncate_dup, gchar *fullpath) { FILELIB_INFO* fli = &rmi->filelib_info; BOOL ok_to_write = TRUE; gchar new_path[TEMP_STR_LEN]; gchar* new_fnbase; gchar* new_dir; if (!fli->m_do_individual_tracks) return SR_SUCCESS; close_file (&fli->m_file); /* Construct filename for completed file */ parse_and_subst_pat (rmi, new_path, ti, fli->m_output_directory, fli->m_output_pattern, fli->m_extension); /* Build up the output directory */ mkdir_recursive (rmi, new_path, 0); // If we are over writing existing tracks debug_printf ("overwrite flag is %d\n", overwrite); switch (overwrite) { case OVERWRITE_ALWAYS: ok_to_write = TRUE; break; case OVERWRITE_NEVER: if (file_exists (rmi, new_path)) { ok_to_write = FALSE; } else { ok_to_write = TRUE; } break; case OVERWRITE_LARGER: /* Smart overwriting -- only overwrite if new file is bigger */ ok_to_write = new_file_is_better (rmi, new_path, fli->m_incomplete_filename); break; case OVERWRITE_VERSION: default: new_dir = g_path_get_dirname (new_path); new_fnbase = g_path_get_basename (new_path); trim_mp3_suffix (rmi, new_fnbase); filelib_rename_versioned (0, rmi, new_dir, new_fnbase, fli->m_extension); g_free (new_dir); g_free (new_fnbase); ok_to_write = TRUE; } if (ok_to_write) { if (file_exists (rmi, new_path)) { delete_file (rmi, new_path); } move_file (rmi, new_path, fli->m_incomplete_filename); } else { if (truncate_dup && file_exists (rmi, fli->m_incomplete_filename)) { truncate_file (rmi, fli->m_incomplete_filename); } } if (fullpath) { mstrcpy (fullpath, new_path); } if (fli->m_count != -1) fli->m_count++; return SR_SUCCESS; } void filelib_shutdown (RIP_MANAGER_INFO* rmi) { close_files (rmi); } /***************************************************************************** * Private Functions *****************************************************************************/ // For now we're not going to care. If it makes it good. it not, will know // When we try to create a file in the path. static error_code mkdir_if_needed (RIP_MANAGER_INFO* rmi, gchar *str) { char s[SR_MAX_PATH]; string_from_gstring (rmi, s, SR_MAX_PATH, str, CODESET_FILESYS); debug_printf ("mkdir = %s -> %s\n", str, s); #if WIN32 mkdir (s); #else mkdir (s, 0777); #endif return SR_SUCCESS; } /* Recursively make directories. If make_last == 1, then the final substring (after the last '/') is considered a directory rather than a file name */ static error_code mkdir_recursive (RIP_MANAGER_INFO* rmi, gchar *str, int make_last) { gchar buf[SR_MAX_PATH]; gchar* p = buf; gchar q; buf[0] = 0; while ((q = *p++ = *str++) != 0) { if (ISSLASH(q)) { *p = 0; mkdir_if_needed (rmi, buf); } } if (make_last) { mkdir_if_needed (rmi, str); } return SR_SUCCESS; } /* This sets the value for m_default_pattern and m_default_showfile_pattern, using the -q & -s flags. This function cannot overflow these static buffers. */ static void set_default_pattern (RIP_MANAGER_INFO* rmi, BOOL get_separate_dirs, BOOL do_count) { FILELIB_INFO* fli = &rmi->filelib_info; /* Set up m_default_pattern */ fli->m_default_pattern[0] = 0; if (get_separate_dirs) { mstrcpy (fli->m_default_pattern, m_("%S") PATH_SLASH_STR); } if (do_count) { if (fli->m_count < 0) { mstrncat (fli->m_default_pattern, m_("%q_"), SR_MAX_PATH); } else { msnprintf (&fli->m_default_pattern[mstrlen(fli->m_default_pattern)], SR_MAX_PATH - mstrlen(fli->m_default_pattern), m_("%%%dq_"), fli->m_count); } } mstrncat (fli->m_default_pattern, m_("%A - %T"), SR_MAX_PATH); /* Set up m_default_showfile_pattern */ fli->m_default_showfile_pattern[0] = 0; if (get_separate_dirs) { mstrcpy (fli->m_default_showfile_pattern, m_("%S") PATH_SLASH_STR); } mstrncat (fli->m_default_showfile_pattern, m_("sr_program_%d"), SR_MAX_PATH); } /* This function sets the value of m_output_directory or m_showfile_directory. */ static error_code set_output_directory (RIP_MANAGER_INFO* rmi, gchar* global_output_directory, gchar* global_output_pattern, gchar* output_pattern, gchar* output_directory, gchar* default_pattern, gchar* default_pattern_tail, int get_separate_dirs, int get_date_stamp, int is_for_showfile ) { error_code ret; gchar opat_device[3]; gchar odir_device[3]; gchar cwd_device[3]; gchar* device; gchar opat_path[SR_MAX_PATH]; gchar odir_path[SR_MAX_PATH]; gchar cwd_path[SR_MAX_PATH]; gchar cwd[SR_MAX_PATH]; gchar pattern_head[SR_MAX_PATH]; gchar pattern_tail[SR_MAX_PATH]; /* Initialize strings */ cwd[0] = 0; odir_device[0] = 0; opat_device[0] = 0; odir_path[0] = 0; opat_path[0] = 0; ret = sr_getcwd (rmi, cwd); if (ret != SR_SUCCESS) return ret; if (!output_pattern || !(*output_pattern)) { output_pattern = default_pattern; } /* Get the device. It can be empty. */ if (output_directory && *output_directory) { device_split (output_directory, odir_device, odir_path); debug_printf ("devicesplit: %d -> %d %d\n", mstrlen (output_directory), mstrlen (odir_device), mstrlen (odir_path)); } device_split (output_pattern, opat_device, opat_path); device_split (cwd, cwd_device, cwd_path); if (*opat_device) { device = opat_device; } else if (*odir_device) { device = odir_device; } else { /* No device */ device = m_(""); } /* Generate the output file pattern. */ if (IS_ABSOLUTE_PATH(opat_path)) { cwd_path[0] = 0; odir_path[0] = 0; debug_printf ("Got opat_path absolute path\n"); } else if (IS_ABSOLUTE_PATH(odir_path)) { cwd_path[0] = 0; debug_printf ("Got odir_path absolute path\n"); } if (*odir_path) { ret = add_trailing_slash(odir_path); if (ret != SR_SUCCESS) return ret; } if (*cwd_path) { ret = add_trailing_slash(cwd_path); if (ret != SR_SUCCESS) return ret; } if (mstrlen(device) + mstrlen(cwd_path) + mstrlen(opat_path) + mstrlen(odir_path) > SR_MAX_PATH-1) { return SR_ERROR_DIR_PATH_TOO_LONG; } /* Fill in %S and %d patterns */ msnprintf (pattern_head, SR_MAX_PATH, m_S m_S m_S, device, cwd_path, odir_path); debug_printf ("Composed pattern head (%d) <- (%d,%d,%d)\n", mstrlen(pattern_head), mstrlen(device), mstrlen(cwd_path), mstrlen(odir_path)); parse_and_subst_dir (rmi, pattern_head, pattern_tail, opat_path, is_for_showfile); /* In case there is no %A, no %T, etc., use the default pattern */ if (!*pattern_tail) { mstrcpy (pattern_tail, default_pattern_tail); } /* Set the global variables */ mstrcpy (global_output_directory, pattern_head); add_trailing_slash (global_output_directory); mstrcpy (global_output_pattern, pattern_tail); return SR_SUCCESS; } /* Parse & substitute the output pattern. What we're trying to get is everything up to the pattern specifiers that change from track to track: %A, %T, %a, %D, %q, or %Q. If %S or %d appear before this, substitute in. If it's for the showfile, then we don't advance pattern_head If there is no %A, no %T, etc. */ static void parse_and_subst_dir (RIP_MANAGER_INFO* rmi, gchar* pattern_head, gchar* pattern_tail, gchar* opat_path, int is_for_showfile) { FILELIB_INFO* fli = &rmi->filelib_info; int opi = 0; unsigned int phi = 0; int ph_base_len; int op_tail_idx; phi = mstrlen(pattern_head); opi = 0; ph_base_len = phi; op_tail_idx = opi; while (phi < SR_MAX_BASE) { if (ISSLASH(opat_path[opi])) { pattern_head[phi++] = PATH_SLASH; opi++; ph_base_len = phi; op_tail_idx = opi; continue; } if (opat_path[opi] == 0) { /* This means there are no artist/title info in the filename. In this case, we fall back on the default pattern. */ if (!is_for_showfile) { ph_base_len = phi; op_tail_idx = opi; } break; } if (opat_path[opi] != m_('%')) { pattern_head[phi++] = opat_path[opi++]; continue; } /* If we got here, we have a '%' */ switch (opat_path[opi+1]) { case m_('%'): pattern_head[phi++]=m_('%'); opi+=2; continue; case m_('S'): /* append stream name */ mstrncpy (&pattern_head[phi], fli->m_stripped_icy_name, SR_MAX_BASE-phi); phi = mstrlen (pattern_head); opi+=2; continue; case m_('d'): /* append date info */ mstrncpy (&pattern_head[phi], fli->m_session_datebuf, SR_MAX_BASE-phi); phi = mstrlen (pattern_head); opi+=2; continue; case m_('0'): case m_('1'): case m_('2'): case m_('3'): case m_('4'): case m_('5'): case m_('6'): case m_('7'): case m_('8'): case m_('9'): case m_('a'): case m_('A'): case m_('D'): case m_('q'): case m_('T'): /* These are track specific patterns */ break; case 0: /* This means there are no artist/title info in the filename. In this case, we fall back on the default pattern. */ pattern_head[phi++] = opat_path[opi++]; if (!is_for_showfile) { ph_base_len = phi; op_tail_idx = opi; } break; default: /* This is an illegal pattern, so copy the '%' and continue */ pattern_head[phi++] = opat_path[opi++]; continue; } /* If we got to here, it means that we hit something like %A or %T */ break; } /* Terminate the pattern_head string */ pattern_head[ph_base_len] = 0; mstrcpy (pattern_tail, &opat_path[op_tail_idx]); } static void fill_date_buf (RIP_MANAGER_INFO* rmi, gchar* datebuf, int datebuf_len) { char tmp[DATEBUF_LEN]; time_t now = time(NULL); strftime (tmp, datebuf_len, "%Y_%m_%d_%H_%M_%S", localtime(&now)); gstring_from_string (rmi, datebuf, DATEBUF_LEN, tmp, CODESET_FILESYS); } static error_code add_trailing_slash (gchar *str) { int len = mstrlen(str); if (len >= SR_MAX_PATH-1) return SR_ERROR_DIR_PATH_TOO_LONG; if (!ISSLASH(str[mstrlen(str)-1])) mstrncat (str, PATH_SLASH_STR, SR_MAX_PATH); return SR_SUCCESS; } /* Split off the device */ static error_code device_split (gchar* dirname, gchar* device, gchar* path ) { int di; if (HAS_DEVICE(dirname)) { device[0] = dirname[0]; device[1] = dirname[1]; device[2] = 0; di = 2; } else { device[0] = 0; di = 0; } mstrcpy (path, &dirname[di]); return SR_SUCCESS; } static error_code sr_getcwd (RIP_MANAGER_INFO* rmi, gchar* dirbuf) { char db[SR_MAX_PATH]; #if defined (WIN32) if (!_getcwd (db, SR_MAX_PATH)) { debug_printf ("getcwd returned zero?\n"); return SR_ERROR_DIR_PATH_TOO_LONG; } #else if (!getcwd (db, SR_MAX_PATH)) { debug_printf ("getcwd returned zero?\n"); return SR_ERROR_DIR_PATH_TOO_LONG; } #endif gstring_from_string (rmi, dirbuf, SR_MAX_PATH, db, CODESET_FILESYS); return SR_SUCCESS; } static void close_file (FHANDLE* fp) { if (*fp != INVALID_FHANDLE) { #if defined WIN32 CloseHandle (*fp); #else close (*fp); #endif *fp = INVALID_FHANDLE; } } static void close_files (RIP_MANAGER_INFO* rmi) { FILELIB_INFO* fli = &rmi->filelib_info; close_file (&fli->m_file); close_file (&fli->m_show_file); close_file (&fli->m_cue_file); } static BOOL file_exists (RIP_MANAGER_INFO* rmi, gchar *filename) { FHANDLE f; char fn[SR_MAX_PATH]; string_from_gstring (rmi, fn, SR_MAX_PATH, filename, CODESET_FILESYS); #if defined (WIN32) f = CreateFile (fn, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); #else f = open (fn, O_RDONLY); #endif if (f == INVALID_FHANDLE) { return FALSE; } close_file (&f); return TRUE; } /* It's a bit touch and go here. My artist substitution might be into a directory, in which case I don't have enough room for a legit file name */ /* Also, what about versioning of completed filenames? */ /* If (TRACK_INFO* ti) is NULL, that means we're being called for the showfile, and therefore some parts don't apply */ static void parse_and_subst_pat (RIP_MANAGER_INFO* rmi, gchar* newfile, TRACK_INFO* ti, gchar* directory, gchar* pattern, gchar* extension) { FILELIB_INFO* fli = &rmi->filelib_info; gchar stripped_artist[SR_MAX_PATH]; gchar stripped_title[SR_MAX_PATH]; gchar stripped_album[SR_MAX_PATH]; gchar temp[DATEBUF_LEN]; gchar datebuf[DATEBUF_LEN]; int opi = 0; int nfi = 0; int done; gchar* pat = pattern; /* Reserve 5 bytes: 4 for the .mp3 extension, and 1 for null char */ int MAX_FILEBASELEN = SR_MAX_PATH-5; mstrcpy (newfile, directory); opi = 0; nfi = mstrlen(newfile); done = 0; /* Strip artist, title, album */ debug_printf ("parse_and_subst_pat: stripping\n"); if (ti) { mstrncpy (stripped_artist, ti->artist, SR_MAX_PATH); mstrncpy (stripped_title, ti->title, SR_MAX_PATH); mstrncpy (stripped_album, ti->album, SR_MAX_PATH); replace_invalid_chars (stripped_artist); replace_invalid_chars (stripped_title); replace_invalid_chars (stripped_album); } debug_printf ("parse_and_subst_pat: substitute pattern\n"); while (nfi < MAX_FILEBASELEN) { if (pat[opi] == 0) { done = 1; break; } if (pat[opi] != m_('%')) { newfile[nfi++] = pat[opi++]; newfile[nfi] = 0; continue; } /* If we got here, we have a '%' */ switch (pat[opi+1]) { case m_('%'): newfile[nfi++] = m_('%'); newfile[nfi] = 0; opi+=2; continue; case m_('S'): /* stream name */ /* GCS FIX: Not sure here */ mstrncat (newfile, fli->m_stripped_icy_name, MAX_FILEBASELEN-nfi); nfi = mstrlen (newfile); opi+=2; continue; case m_('d'): /* append date info */ mstrncat (newfile, fli->m_session_datebuf, MAX_FILEBASELEN-nfi); nfi = mstrlen (newfile); opi+=2; continue; case m_('D'): /* current timestamp */ fill_date_buf (rmi, datebuf, DATEBUF_LEN); mstrncat (newfile, datebuf, MAX_FILEBASELEN-nfi); nfi = mstrlen (newfile); opi+=2; continue; case m_('a'): /* album */ if (!ti) goto illegal_pattern; mstrncat (newfile, stripped_album, MAX_FILEBASELEN-nfi); nfi = mstrlen (newfile); opi+=2; continue; case m_('A'): /* artist */ if (!ti) goto illegal_pattern; mstrncat (newfile, stripped_artist, MAX_FILEBASELEN-nfi); nfi = mstrlen (newfile); opi+=2; continue; case m_('q'): /* automatic sequence number */ msnprintf (temp, DATEBUF_LEN, m_("%04d"), get_next_sequence_number (rmi, newfile)); mstrncat (newfile, temp, MAX_FILEBASELEN-nfi); nfi = mstrlen (newfile); opi+=2; continue; case m_('T'): /* title */ if (!ti) goto illegal_pattern; mstrncat (newfile, stripped_title, MAX_FILEBASELEN-nfi); nfi = mstrlen (newfile); opi+=2; continue; case 0: /* The pattern ends in '%', but that's ok. */ newfile[nfi++] = pat[opi++]; newfile[nfi] = 0; done = 1; break; case m_('0'): case m_('1'): case m_('2'): case m_('3'): case m_('4'): case m_('5'): case m_('6'): case m_('7'): case m_('8'): case m_('9'): { /* Get integer */ int ai = 0; gchar ascii_buf[7]; /* max 6 chars */ while (isdigit (pat[opi+1+ai]) && ai < 6) { ascii_buf[ai] = pat[opi+1+ai]; ai ++; } ascii_buf[ai] = 0; /* If we got a q, get starting number */ if (pat[opi+1+ai] == m_('q')) { if (fli->m_count == -1) { fli->m_count = mtol(ascii_buf); } msnprintf (temp, DATEBUF_LEN, m_("%04d"), fli->m_count); mstrncat (newfile, temp, MAX_FILEBASELEN-nfi); nfi = mstrlen (newfile); opi+=ai+2; continue; } /* Otherwise, no 'q', so drop through to default case */ } default: illegal_pattern: /* Illegal pattern, but that's ok. */ newfile[nfi++] = pat[opi++]; newfile[nfi] = 0; continue; } } /* Pop on the extension */ /* GCS FIX - is SR_MAX_PATH right here? */ debug_printf ("parse_and_subst_pat: pop on the extension\n"); mstrncat (newfile, extension, SR_MAX_PATH); } static long get_file_size (RIP_MANAGER_INFO* rmi, gchar *filename) { FILE* fp; long len; char fn[SR_MAX_PATH]; string_from_gstring (rmi, fn, SR_MAX_PATH, filename, CODESET_FILESYS); fp = fopen (fn, "r"); if (!fp) return 0; if (fseek (fp, 0, SEEK_END)) { fclose(fp); return 0; } len = ftell (fp); if (len < 0) { fclose(fp); return 0; } fclose (fp); return len; } /* * Added by Daniel Lord 29.06.2005 to only overwrite files with better * captures, modified by GCS to get file size from file system */ static BOOL new_file_is_better (RIP_MANAGER_INFO* rmi, gchar *oldfile, gchar *newfile) { long oldfilesize=0; long newfilesize=0; oldfilesize = get_file_size (rmi, oldfile); newfilesize = get_file_size (rmi, newfile); /* * simple size check for now. Newfile should have at least 1Meg. Else it's * not very usefull most of the time. */ /* GCS: This isn't quite true for low bitrate streams. */ #if defined (commentout) if (newfilesize <= 524288) { debug_printf("NFB: newfile smaller as 524288\n"); return FALSE; } #endif if (oldfilesize == -1) { /* make sure we get the file in case of errors */ debug_printf("NFB: could not get old filesize\n"); return TRUE; } if (oldfilesize == newfilesize) { debug_printf("NFB: Size Match\n"); return FALSE; } if (newfilesize < oldfilesize) { debug_printf("NFB:newfile bigger as oldfile\n"); return FALSE; } debug_printf ("NFB:oldfilesize = %li, newfilesize = %li, " "overwriting file\n", oldfilesize, newfilesize); return TRUE; } static void truncate_file (RIP_MANAGER_INFO* rmi, gchar* filename) { char fn[SR_MAX_PATH]; string_from_gstring (rmi, fn, SR_MAX_PATH, filename, CODESET_FILESYS); debug_printf ("Trying to truncate file: %s\n", fn); #if defined WIN32 CloseHandle (CreateFile(fn, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, TRUNCATE_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)); #else close (open (fn, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)); #endif } static void move_file (RIP_MANAGER_INFO* rmi, gchar* new_filename, gchar* old_filename) { char old_fn[SR_MAX_PATH]; char new_fn[SR_MAX_PATH]; string_from_gstring (rmi, old_fn, SR_MAX_PATH, old_filename, CODESET_FILESYS); string_from_gstring (rmi, new_fn, SR_MAX_PATH, new_filename, CODESET_FILESYS); #if defined WIN32 MoveFile(old_fn, new_fn); #else rename (old_fn, new_fn); #endif } static void delete_file (RIP_MANAGER_INFO* rmi, gchar* filename) { char fn[SR_MAX_PATH]; string_from_gstring (rmi, fn, SR_MAX_PATH, filename, CODESET_FILESYS); #if defined WIN32 DeleteFile (fn); #else unlink (fn); #endif } static error_code filelib_open_for_write (RIP_MANAGER_INFO* rmi, FHANDLE* fp, gchar* filename) { char fn[SR_MAX_PATH]; string_from_gstring (rmi, fn, SR_MAX_PATH, filename, CODESET_FILESYS); debug_printf ("Trying to create file: %s\n", fn); #if WIN32 *fp = CreateFile (fn, GENERIC_WRITE, // open for reading FILE_SHARE_READ, // share for reading NULL, // no security CREATE_ALWAYS, // existing file only FILE_ATTRIBUTE_NORMAL, // normal file NULL); // no attr. template if (*fp == INVALID_FHANDLE) { int r = GetLastError(); r = strlen(fn); printf ("ERROR creating file: %s\n",filename); return SR_ERROR_CANT_CREATE_FILE; } #else /* For unix, we need to convert to char, and just open. http://mail.nl.linux.org/linux-utf8/2001-02/msg00103.html */ *fp = open (fn, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (*fp == INVALID_FHANDLE) { /* GCS FIX -- need error message here! */ // printf ("ERROR creating file: %s\n",filename); return SR_ERROR_CANT_CREATE_FILE; } #endif return SR_SUCCESS; } static error_code filelib_write (FHANDLE fp, char *buf, u_long size) { if (!fp) { debug_printf("filelib_write: fp = 0\n"); return SR_ERROR_CANT_WRITE_TO_FILE; } #if WIN32 { BOOL rc; DWORD bytes_written = 0; rc = WriteFile(fp, buf, size, &bytes_written, NULL); if (rc == 0) { debug_print_error(); debug_printf("filelib_write: WriteFile rc = 0\n"); debug_printf("size = %d, bytes_written = %d\n", size, bytes_written); return SR_ERROR_CANT_WRITE_TO_FILE; } } #else if (write(fp, buf, size) == -1) return SR_ERROR_CANT_WRITE_TO_FILE; #endif return SR_SUCCESS; } /* This function takes in a directory, filename base, and extension, and renames any existing file "${directory}/${fnbase}${extensions}" to a file of the form "${directory}/${fnbase} (${n}}${extensions}" The new name for the file is returned in new_fn (if new_fn is not 0). */ static void filelib_rename_versioned (gchar** new_fn, RIP_MANAGER_INFO* rmi, gchar* directory, gchar* fnbase, gchar* extension) { /* Compose and trim filename (not including directory) */ gint n = 1; gchar* tgt_file = g_strdup_printf ("%s%s", fnbase, extension); gchar* tgt_path = g_build_filename (directory, tgt_file, NULL); g_free (tgt_file); if (new_fn) { *new_fn = 0; } if (!file_exists (rmi, tgt_path)) { debug_printf ("filelib_rename_versioned: tgt_path doesn't exist (%s)\n", tgt_path); g_free (tgt_path); return; } for (n = 1; n <= G_MAXINT; n++) { gchar *ren_file, *ren_path; ren_file = g_strdup_printf ("%s (%d)%s", fnbase, n, extension); ren_path = g_build_filename (directory, ren_file, NULL); if (file_exists (rmi, ren_path)) { g_free (ren_file); g_free (ren_path); continue; } /* GCS FIX: This should check for ENAMETOOLONG and other errors */ debug_printf ("filelib_rename_versioned: moving file (%s)->(%s)\n", tgt_path, ren_path); move_file (rmi, ren_path, tgt_path); g_free (ren_file); if (new_fn) { *new_fn = ren_path; } else { g_free (ren_path); } break; } g_free (tgt_path); } static void filelib_adjust_cuefile (RIP_MANAGER_INFO* rmi, gchar* new_show_name, gchar* new_cue_name) { gchar* tmp_fn; gint fd; FILE *fp_in, *fp_out; GError *error = NULL; char cue_buf[1024]; gchar mcue_buf[1024]; gchar* show_fnbase; int rc; /* Create temporary file */ fd = g_file_open_tmp ("streamripper-XXXXXX", &tmp_fn, &error); if (!fd || error) { debug_printf ("Error with g_file_open_tmp\n"); if (tmp_fn) g_free (tmp_fn); return; } close (fd); /* Open temporary file as FILE* */ fp_out = g_fopen (tmp_fn, "w"); if (!fp_out) { debug_printf ("Error with g_fopen (%s)\n", tmp_fn); if (tmp_fn) g_free (tmp_fn); return; } /* Open input file as FILE* */ fp_in = g_fopen (new_cue_name, "r"); if (!fp_in) { debug_printf ("Error with g_fopen (%s)\n", new_cue_name); if (tmp_fn) g_free (tmp_fn); fclose (fp_out); return; } debug_printf ("Adjusting cue file=%s\n", tmp_fn); /* Write renamed mp3 showfile to output file */ show_fnbase = g_path_get_basename (new_show_name); rc = msnprintf (mcue_buf, 1024, m_("FILE \"") m_S m_("\" MP3\n"), show_fnbase); g_free (show_fnbase); rc = string_from_gstring (rmi, cue_buf, 1024, mcue_buf, CODESET_FILESYS); fwrite (cue_buf, 1, rc, fp_out); /* Skip line in input file */ fgets (cue_buf, 1024, fp_in); /* Copy remaining bytes from input file to output file */ while (1) { rc = fgetc (fp_in); if (rc == EOF) { break; } fputc (rc, fp_out); } fclose (fp_in); fclose (fp_out); /* Delete previous cue file */ delete_file (rmi, new_cue_name); /* Move temp file to new cue file */ move_file (rmi, new_cue_name, tmp_fn); g_free (tmp_fn); } static error_code filelib_open_showfiles (RIP_MANAGER_INFO* rmi) { FILELIB_INFO* fli = &rmi->filelib_info; int rc; gchar mcue_buf[1024]; char cue_buf[1024]; gchar* basename; gchar *new_dir, *new_fnbase; gchar *new_show_name, *new_cue_name; parse_and_subst_pat (rmi, fli->m_show_name, 0, fli->m_showfile_directory, fli->m_showfile_pattern, fli->m_extension); parse_and_subst_pat (rmi, fli->m_cue_name, 0, fli->m_showfile_directory, fli->m_showfile_pattern, m_(".cue")); /* Rename previously ripped files with same name */ new_dir = g_path_get_dirname (fli->m_show_name); new_fnbase = g_path_get_basename (fli->m_show_name); trim_mp3_suffix (rmi, new_fnbase); filelib_rename_versioned (&new_show_name, rmi, new_dir, new_fnbase, fli->m_extension); filelib_rename_versioned (&new_cue_name, rmi, new_dir, new_fnbase, m_(".cue")); if (new_show_name && new_cue_name) { /* Rewrite previous cue file to point to renamed mp3 showfile */ debug_printf ("Trying to adjust cuefile\n"); filelib_adjust_cuefile (rmi, new_show_name, new_cue_name); } if (new_show_name) g_free (new_show_name); if (new_cue_name) g_free (new_cue_name); g_free (new_dir); g_free (new_fnbase); /* Open cue file, write header */ if (rmi->http_info.content_type != CONTENT_TYPE_OGG) { rc = filelib_open_for_write (rmi, &fli->m_cue_file, fli->m_cue_name); if (rc != SR_SUCCESS) { fli->m_do_show = 0; return rc; } /* Write cue header here */ /* GCS Nov 29, 2007 - As suggested on the forum, the cue file should use relative path. */ basename = mstrrchr (fli->m_show_name, PATH_SLASH); if (basename) { basename++; } else { basename = fli->m_show_name; } debug_mprintf (m_("show_name: ") m_S m_(", basename: ") m_S m_("\n"), fli->m_show_name, basename); rc = msnprintf (mcue_buf, 1024, m_("FILE \"") m_S m_("\" MP3\n"), basename); rc = string_from_gstring (rmi, cue_buf, 1024, mcue_buf, CODESET_FILESYS); rc = filelib_write (fli->m_cue_file, cue_buf, rc); if (rc != SR_SUCCESS) { fli->m_do_show = 0; return rc; } } /* Open show file */ rc = filelib_open_for_write (rmi, &fli->m_show_file, fli->m_show_name); if (rc != SR_SUCCESS) { fli->m_do_show = 0; return rc; } return rc; } /* GCS: This should get only the name, not the directory */ static void trim_filename (RIP_MANAGER_INFO* rmi, gchar* out, gchar *filename) { FILELIB_INFO* fli = &rmi->filelib_info; long maxlen = fli->m_max_filename_length; mstrncpy (out, filename, MAX_TRACK_LEN); replace_invalid_chars (out); out[maxlen-4] = 0; // -4 = make room for ".mp3" } static void trim_mp3_suffix (RIP_MANAGER_INFO* rmi, gchar *filename) { FILELIB_INFO* fli = &rmi->filelib_info; gchar* suffix_ptr; if (mstrlen(filename) <= 4) return; suffix_ptr = filename + mstrlen(filename) - 4; // -4 for ".mp3" if (mstrcmp (suffix_ptr, fli->m_extension) == 0) { *suffix_ptr = 0; } } /* GCS FIX: This may not work with filesystem charsets where 0-9 are not ascii compatible? */ static int get_next_sequence_number (RIP_MANAGER_INFO* rmi, gchar* fn_base) { int rc; int di = 0; int edi = 0; int seq; gchar dir_name[SR_MAX_PATH]; gchar fn_prefix[SR_MAX_PATH]; char dname[SR_MAX_PATH]; char fnp[SR_MAX_PATH]; DIR* dp; struct dirent* de; /* Get directory from fn_base */ while (fn_base[di]) { if (ISSLASH(fn_base[di])) { edi = di; } di++; } mstrncpy (dir_name, fn_base, SR_MAX_PATH); dir_name[edi] = 0; /* Get fn prefix from fn_base */ fn_prefix[0] = 0; mstrcpy (fn_prefix, &fn_base[edi+1]); rc = string_from_gstring (rmi, dname, SR_MAX_PATH, dir_name, CODESET_FILESYS); rc = string_from_gstring (rmi, fnp, SR_MAX_PATH, fn_prefix, CODESET_FILESYS); /* Look through directory for a filenames that match prefix */ if ((dp = opendir (dname)) == 0) { return 0; } seq = 0; while ((de = readdir (dp)) != 0) { if (strncmp(de->d_name, fnp, strlen(fnp)) == 0) { if (isdigit(de->d_name[strlen(fnp)])) { int this_seq = atoi(&de->d_name[strlen(fnp)]); if (seq <= this_seq) { seq = this_seq + 1; } } } } closedir (dp); return seq; } static gchar* replace_invalid_chars (gchar *str) { gchar invalid_chars[] = m_("\\/:*?\"<>|~"); gchar replacement = m_('-'); gchar *oldstr = str; gchar *newstr = str; if (!str) return NULL; /* Skip leading "." */ for (;*oldstr; oldstr++) { if (*oldstr != '.') { break; } } for (;*oldstr; oldstr++) { if (g_ascii_iscntrl (*oldstr)) { /* Do nothing -- skip control characters without replacement */ } else if (mstrchr(invalid_chars, *oldstr) == NULL) { /* Ordinary case -- copy */ *newstr++ = *oldstr; } else { /* Replace case -- append replacement char */ *newstr++ = replacement; } } *newstr = '\0'; return str; } static void remove_trailing_periods (gchar *str) { gchar* s = str + strlen (str); while (--s >= str && *s == '.') { *s = 0; } } streamripper-1.64.6.orig/lib/utf8.h0000644000175000017500000000165310355525656015162 0ustar abiabi /* * Convert a string between UTF-8 and the locale's charset. * Invalid bytes are replaced by '#', and characters that are * not available in the target encoding are replaced by '?'. * * If the locale's charset is not set explicitly then it is * obtained using nl_langinfo(CODESET), where available, the * environment variable CHARSET, or assumed to be US-ASCII. * * Return value of conversion functions: * * -1 : memory allocation failed * 0 : data was converted exactly * 1 : valid data was converted approximately (using '?') * 2 : input was invalid (but still converted, using '#') * 3 : unknown encoding (but still converted, using '?') */ #ifndef __UTF8_H #define __UTF8_H #ifdef __cplusplus extern "C" { #endif void convert_set_charset(const char *charset); int utf8_encode(const char *from, char **to); int utf8_decode(const char *from, char **to); #ifdef __cplusplus } #endif #endif /* __UTF8_H */ streamripper-1.64.6.orig/lib/findsep.h0000644000175000017500000000255311004727134015707 0ustar abiabi/* findsep.h * library routines for find silent points in mp3 data * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __FINDSEP_H__ #define __FINDSEP_H__ #include "srtypes.h" #include "errors.h" error_code findsep_silence (const char* mpgbuf, long mpgsize, long len_to_sw, long searchwindow, long silence_length, long padding1, long padding2, u_long* pos1, u_long* pos2 ); error_code findsep_silence_2 (const char* mpgbuf, long mpgsize, long len_to_sw, long searchwindow, long silence_length, long padding1, long padding2, u_long* pos1, u_long* pos2 ); error_code find_bitrate (unsigned long* bitrate, const char* mpgbuf, long mpgsize); #endif //__FINDSEP_H__ streamripper-1.64.6.orig/lib/ripstream.c0000644000175000017500000011077311164262615016271 0ustar abiabi/* ripstream.c * buffer stream data, when a track changes decodes the audio and * finds a silent point to split the track * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #ifndef _WIN32 #include #include #endif #include "srtypes.h" #include "cbuf2.h" #include "findsep.h" #include "mchar.h" #include "parse.h" #include "rip_manager.h" #include "ripstream.h" #include "debug.h" #include "filelib.h" #include "relaylib.h" #include "socklib.h" #include "external.h" #include "ripogg.h" /***************************************************************************** * Private functions *****************************************************************************/ static error_code find_sep (RIP_MANAGER_INFO* rmi, u_long* pos1, u_long* pos2); static error_code start_track_mp3 (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti); static error_code end_track_mp3 (RIP_MANAGER_INFO* rmi, u_long pos1, u_long pos2, TRACK_INFO* ti); static error_code end_track_ogg (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti); static void compute_cbuf2_size (RIP_MANAGER_INFO* rmi, SPLITPOINT_OPTIONS *sp_opt, int bitrate, int meta_interval); static int ms_to_bytes (int ms, int bitrate); static int bytes_to_secs (unsigned int bytes, int bitrate); static void clear_track_info (TRACK_INFO* ti); static int ripstream_recvall (RIP_MANAGER_INFO* rmi, char* buffer, int size); static error_code get_track_from_metadata (RIP_MANAGER_INFO* rmi, int size, char *newtrack); static error_code get_stream_data (RIP_MANAGER_INFO* rmi, char *data_buf, char *track_buf); static error_code ripstream_rip_mp3 (RIP_MANAGER_INFO* rmi); static error_code ripstream_rip_ogg (RIP_MANAGER_INFO* rmi); /***************************************************************************** * Private structs *****************************************************************************/ typedef struct ID3V1st { char tag[3]; char songtitle[30]; char artist[30]; char album[30]; char year[4]; char comment[30]; char genre; } ID3V1Tag; typedef struct ID3V2framest { char id[4]; int size; char pad[3]; } ID3V2frame; /****************************************************************************** * Public functions *****************************************************************************/ error_code ripstream_init (RIP_MANAGER_INFO* rmi) { rmi->track_count = 0; /* GCS RMK: Ripchunk_size is the metaint size, or default size if stream doesn't have meta data */ rmi->cue_sheet_bytes = 0; rmi->getbuffer_size = (rmi->meta_interval == NO_META_INTERVAL) ? DEFAULT_META_INTERVAL : rmi->meta_interval; clear_track_info (&rmi->old_track); clear_track_info (&rmi->new_track); clear_track_info (&rmi->current_track); rmi->ripstream_first_time_through = 1; if ((rmi->getbuffer = malloc (rmi->getbuffer_size)) == NULL) return SR_ERROR_CANT_ALLOC_MEMORY; return SR_SUCCESS; } void ripstream_clear(RIP_MANAGER_INFO* rmi) { debug_printf ("RIPSTREAM_CLEAR\n"); if (rmi->getbuffer) {free(rmi->getbuffer); rmi->getbuffer = NULL;} rmi->getbuffer_size = 0; rmi->find_silence = -1; rmi->cbuf2_size = 0; cbuf2_destroy (&rmi->cbuf2); clear_track_info (&rmi->old_track); clear_track_info (&rmi->new_track); clear_track_info (&rmi->current_track); rmi->ripstream_first_time_through = 1; rmi->no_meta_name[0] = '\0'; rmi->track_count = 0; } static BOOL is_track_changed (RIP_MANAGER_INFO* rmi) { TRACK_INFO *old = &rmi->old_track; TRACK_INFO *cur = &rmi->current_track; /* We test the parsed fields instead of raw_metadata because the parse rules may have stripped garbage out, causing the resulting track info to be the same. */ if (!strcmp(old->artist, cur->artist) && !strcmp(old->title, cur->title) && !strcmp(old->album, cur->album) && !strcmp(old->track_p, cur->track_p) && !strcmp(old->year, cur->year)) { return 0; } /* Otherwise, there was a change. */ return 1; } static void debug_track_info (TRACK_INFO* ti, char* tag) { debug_mprintf (m_("----- TRACK_INFO ") m_s m_("\n") m_("HAVETI: %d\n") m_("RAW_MD: ") m_s m_("\n") m_("ARTIST: ") m_S m_("\n") m_("TITLE: ") m_S m_("\n") m_("ALBUM: ") m_S m_("\n") m_("TRACK_P:") m_S m_("\n") m_("TRACK_A:") m_S m_("\n") m_("YEAR: ") m_S m_("\n") m_("SAVE: %d\n"), tag, ti->have_track_info, ti->raw_metadata, ti->artist, ti->title, ti->album, ti->track_p, ti->track_a, ti->year, ti->save_track); } static void clear_track_info (TRACK_INFO* ti) { ti->have_track_info = 0; ti->raw_metadata[0] = 0; ti->artist[0] = 0; ti->title[0] = 0; ti->album[0] = 0; ti->track_p[0] = 0; ti->track_a[0] = 0; ti->year[0] = 0; ti->composed_metadata[0] = 0; ti->save_track = TRUE; } static void copy_track_info (TRACK_INFO* dest, TRACK_INFO* src) { dest->have_track_info = src->have_track_info; strcpy (dest->raw_metadata, src->raw_metadata); mstrcpy (dest->artist, src->artist); mstrcpy (dest->title, src->title); mstrcpy (dest->album, src->album); mstrcpy (dest->track_p, src->track_p); mstrcpy (dest->track_a, src->track_a); mstrcpy (dest->year, src->year); strcpy (dest->composed_metadata, src->composed_metadata); dest->save_track = src->save_track; } /**** The main loop for ripping ****/ error_code ripstream_rip (RIP_MANAGER_INFO* rmi) { if (rmi->http_info.content_type == CONTENT_TYPE_OGG) { return ripstream_rip_ogg (rmi); } else { return ripstream_rip_mp3 (rmi); } } /****************************************************************************** * Private functions *****************************************************************************/ static error_code ripstream_rip_ogg (RIP_MANAGER_INFO* rmi) { int ret; int real_ret = SR_SUCCESS; u_long extract_size; /* get the data from the stream */ debug_printf ("RIPSTREAM_RIP_OGG: top of loop\n"); ret = get_stream_data (rmi, rmi->getbuffer, rmi->current_track.raw_metadata); if (ret != SR_SUCCESS) { debug_printf("get_stream_data bad return code: %d\n", ret); return ret; } if (rmi->ripstream_first_time_through) { /* Allocate circular buffer */ rmi->detected_bitrate = -1; rmi->bitrate = -1; rmi->getbuffer_size = 1024; rmi->cbuf2_size = 128; ret = cbuf2_init (&rmi->cbuf2, rmi->http_info.content_type, GET_MAKE_RELAY(rmi->prefs->flags), rmi->getbuffer_size, rmi->cbuf2_size); if (ret != SR_SUCCESS) return ret; rmi->ogg_track_state = 0; /* Warm up the ogg decoding routines */ rip_ogg_init (rmi); /* Done! */ rmi->ripstream_first_time_through = 0; } /* Copy the data into cbuffer. This calls rip_ogg_process_chunk, which sets TRACK_INFO. */ clear_track_info (&rmi->current_track); ret = cbuf2_insert_chunk (rmi, &rmi->cbuf2, rmi->getbuffer, rmi->getbuffer_size, rmi->http_info.content_type, &rmi->current_track); if (ret != SR_SUCCESS) { debug_printf("start_track had bad return code %d\n", ret); return ret; } ret = filelib_write_show (rmi, rmi->getbuffer, rmi->getbuffer_size); if (ret != SR_SUCCESS) { debug_printf("filelib_write_show had bad return code: %d\n", ret); return ret; } #if defined (commentout) /* If we have unwritten pages for the current track, write them */ if (rmi->ogg_have_track) { do { error_code ret; unsigned long amt_filled; int got_eos; ret = cbuf2_ogg_peek_song (&rmi->cbuf2, rmi->getbuffer, rmi->getbuffer_size, &amt_filled, &got_eos); debug_printf ("^^^ogg_peek: %d %d\n", amt_filled, got_eos); if (ret != SR_SUCCESS) { debug_printf ("cbuf2_ogg_peek_song: %d\n", ret); return ret; } if (amt_filled == 0) { /* No more pages */ break; } ret = rip_manager_put_data (rmi, rmi->getbuffer, amt_filled); if (ret != SR_SUCCESS) { debug_printf ("rip_manager_put_data(#1): %d\n",ret); return ret; } if (got_eos) { //end_track_ogg (rmi, &rmi->old_track); rmi->ogg_have_track = 0; //break; } } while (1); } debug_track_info (&rmi->current_track, "current"); /* If we got a new track, then start a new file */ if (rmi->current_track.have_track_info) { ret = rip_manager_start_track (rmi, &rmi->current_track); if (ret != SR_SUCCESS) { debug_printf ("rip_manager_start_track failed(#1): %d\n",ret); return ret; } filelib_write_cue (rmi, &rmi->current_track, 0); copy_track_info (&rmi->old_track, &rmi->current_track); rmi->ogg_have_track = 1; } #endif debug_printf ("ogg_track_state[a] = %d\n", rmi->ogg_track_state); /* If we have unwritten pages for the current track, write them */ if (rmi->ogg_track_state == 1) { do { error_code ret; unsigned long amt_filled; int got_eos; ret = cbuf2_ogg_peek_song (&rmi->cbuf2, rmi->getbuffer, rmi->getbuffer_size, &amt_filled, &got_eos); debug_printf ("^^^ogg_peek: %d %d\n", amt_filled, got_eos); if (ret != SR_SUCCESS) { debug_printf ("cbuf2_ogg_peek_song: %d\n", ret); return ret; } if (amt_filled == 0) { /* No more pages */ break; } ret = rip_manager_put_data (rmi, rmi->getbuffer, amt_filled); if (ret != SR_SUCCESS) { debug_printf ("rip_manager_put_data(#1): %d\n",ret); return ret; } if (got_eos) { rmi->ogg_track_state = 2; break; } } while (1); } debug_printf ("ogg_track_state[b] = %d\n", rmi->ogg_track_state); debug_track_info (&rmi->current_track, "current"); /* If we got a new track, then (maybe) start a new file */ if (rmi->current_track.have_track_info) { if (is_track_changed (rmi)) { if (rmi->ogg_track_state == 2) { end_track_ogg (rmi, &rmi->old_track); } ret = rip_manager_start_track (rmi, &rmi->current_track); if (ret != SR_SUCCESS) { debug_printf ("rip_manager_start_track failed(#1): %d\n",ret); return ret; } copy_track_info (&rmi->old_track, &rmi->current_track); } rmi->ogg_track_state = 1; } /* If buffer almost full, advance the buffer */ if (cbuf2_get_free(&rmi->cbuf2) < rmi->getbuffer_size) { debug_printf ("cbuf2_get_free < getbuffer_size\n"); extract_size = rmi->getbuffer_size - cbuf2_get_free(&rmi->cbuf2); ret = cbuf2_advance_ogg (rmi, &rmi->cbuf2, rmi->getbuffer_size); if (ret != SR_SUCCESS) { debug_printf("cbuf2_advance_ogg had bad return code %d\n", ret); return ret; } } return real_ret; } static error_code ripstream_rip_mp3 (RIP_MANAGER_INFO* rmi) { int ret; int real_ret = SR_SUCCESS; u_long extract_size; /* get the data & meta-data from the stream */ debug_printf ("RIPSTREAM_RIP_MP3: top of loop\n"); ret = get_stream_data(rmi, rmi->getbuffer, rmi->current_track.raw_metadata); if (ret != SR_SUCCESS) { debug_printf("get_stream_data bad return code: %d\n", ret); return ret; } /* First time through, need to determine the bitrate. The bitrate is needed to do the track splitting parameters properly in seconds. See the readme file for details. */ /* GCS FIX: For VBR streams, the header value may be more reliable. */ if (rmi->ripstream_first_time_through) { unsigned long test_bitrate; debug_printf("Querying stream for bitrate - first time.\n"); if (rmi->http_info.content_type == CONTENT_TYPE_MP3) { find_bitrate(&test_bitrate, rmi->getbuffer, rmi->getbuffer_size); rmi->detected_bitrate = test_bitrate / 1000; debug_printf("Detected bitrate: %d\n",rmi->detected_bitrate); } else { rmi->detected_bitrate = 0; } if (rmi->detected_bitrate == 0) { /* Couldn't decode from mp3. If http header reported a bitrate, we'll use that. Otherwise we use 24. */ if (rmi->http_bitrate > 0) rmi->bitrate = rmi->http_bitrate; else rmi->bitrate = 24; } else { rmi->bitrate = rmi->detected_bitrate; } compute_cbuf2_size (rmi, &rmi->prefs->sp_opt, rmi->bitrate, rmi->getbuffer_size); ret = cbuf2_init (&rmi->cbuf2, rmi->http_info.content_type, GET_MAKE_RELAY(rmi->prefs->flags), rmi->getbuffer_size, rmi->cbuf2_size); if (ret != SR_SUCCESS) return ret; } if (rmi->ep) { /* If getting metadata from external process, check for update */ clear_track_info (&rmi->current_track); read_external (rmi, rmi->ep, &rmi->current_track); } else { /* Otherwise, apply parse rules to raw metadata */ if (rmi->current_track.have_track_info) { parse_metadata (rmi, &rmi->current_track); } else { clear_track_info (&rmi->current_track); } } /* Copy the data into cbuffer */ ret = cbuf2_insert_chunk (rmi, &rmi->cbuf2, rmi->getbuffer, rmi->getbuffer_size, rmi->http_info.content_type, &rmi->current_track); if (ret != SR_SUCCESS) { debug_printf("cbuf2_insert_chunk had bad return code %d\n", ret); return ret; } ret = filelib_write_show (rmi, rmi->getbuffer, rmi->getbuffer_size); if (ret != SR_SUCCESS) { debug_printf("filelib_write_show had bad return code: %d\n", ret); return ret; } /* Set the track number */ if (rmi->current_track.track_p[0]) { mstrcpy (rmi->current_track.track_a, rmi->current_track.track_p); } else { msnprintf (rmi->current_track.track_a, MAX_HEADER_LEN, m_("%d"), rmi->track_count + 1); } /* First time through, so start a track. */ if (rmi->ripstream_first_time_through) { int ret; debug_printf ("First time through...\n"); if (!rmi->current_track.have_track_info) { strcpy (rmi->current_track.raw_metadata, rmi->no_meta_name); } msnprintf (rmi->current_track.track_a, MAX_HEADER_LEN, m_("0")); ret = start_track_mp3 (rmi, &rmi->current_track); if (ret != SR_SUCCESS) { debug_printf ("start_track_mp3 failed(#1): %d\n",ret); return ret; } rmi->ripstream_first_time_through = 0; copy_track_info (&rmi->old_track, &rmi->current_track); } /* Check for track change. */ debug_printf ("rmi->current_track.have_track_info = %d\n", rmi->current_track.have_track_info); if (rmi->current_track.have_track_info && is_track_changed(rmi)) { /* Set m_find_silence equal to the number of additional blocks needed until we can do silence separation. */ debug_printf ("VERIFIED TRACK CHANGE (find_silence = %d)\n", rmi->find_silence); copy_track_info (&rmi->new_track, &rmi->current_track); if (rmi->find_silence < 0) { if (rmi->mic_to_cb_end > 0) { rmi->find_silence = rmi->mic_to_cb_end; } else { rmi->find_silence = 0; } } } debug_track_info (&rmi->old_track, "old"); debug_track_info (&rmi->new_track, "new"); debug_track_info (&rmi->current_track, "current"); if (rmi->find_silence == 0) { /* Find separation point */ u_long pos1, pos2; debug_printf ("m_find_silence == 0\n"); ret = find_sep (rmi, &pos1, &pos2); if (ret == SR_ERROR_REQUIRED_WINDOW_EMPTY) { /* If this happens, the previous song should be truncated to zero bytes. */ pos1 = -1; pos2 = 0; } else if (ret != SR_SUCCESS) { debug_printf("find_sep had bad return code %d\n", ret); return ret; } /* Write out previous track */ ret = end_track_mp3 (rmi, pos1, pos2, &rmi->old_track); if (ret != SR_SUCCESS) real_ret = ret; rmi->cue_sheet_bytes += pos2; /* Start next track */ ret = start_track_mp3 (rmi, &rmi->new_track); if (ret != SR_SUCCESS) real_ret = ret; rmi->find_silence = -1; copy_track_info (&rmi->old_track, &rmi->new_track); } if (rmi->find_silence >= 0) rmi->find_silence --; /* If buffer almost full, dump extra to current song. */ if (cbuf2_get_free(&rmi->cbuf2) < rmi->getbuffer_size) { u_long curr_song; debug_printf ("cbuf2_get_free < getbuffer_size\n"); extract_size = rmi->getbuffer_size - cbuf2_get_free(&rmi->cbuf2); ret = cbuf2_extract(rmi, &rmi->cbuf2, rmi->getbuffer, extract_size, &curr_song); if (ret != SR_SUCCESS) { debug_printf("cbuf2_extract had bad return code %d\n", ret); return ret; } /* Post to caller */ if (curr_song < extract_size) { u_long curr_song_bytes = extract_size - curr_song; rmi->cue_sheet_bytes += curr_song_bytes; ret = rip_manager_put_data (rmi, &rmi->getbuffer[curr_song], curr_song_bytes); if (ret != SR_SUCCESS) { debug_printf ("rip_manager_put_data returned: %d\n",ret); return ret; } } } return real_ret; } static error_code find_sep (RIP_MANAGER_INFO* rmi, u_long* pos1, u_long* pos2) { SPLITPOINT_OPTIONS* sp_opt = &rmi->prefs->sp_opt; int rw_start, rw_end, sw_sil; int ret; debug_printf ("*** Finding separation point\n"); /* First, find the search region w/in cbuffer. */ rw_start = rmi->cbuf2.item_count - rmi->rw_start_to_cb_end; if (rw_start < 0) { return SR_ERROR_REQUIRED_WINDOW_EMPTY; } rw_end = rmi->cbuf2.item_count - rmi->rw_end_to_cb_end; if (rw_end < 0) { return SR_ERROR_REQUIRED_WINDOW_EMPTY; } debug_printf ("search window (bytes): [%d,%d] within %d\n", rw_start, rw_end, rmi->cbuf2.item_count); if (rmi->http_info.content_type != CONTENT_TYPE_MP3) { sw_sil = (rw_end + rw_start) / 2; debug_printf ("(not mp3) taking middle: sw_sil=%d\n", sw_sil); *pos1 = rw_start + sw_sil - 1; *pos2 = rw_start + sw_sil; } else { int bufsize = rw_end - rw_start; char* buf = (char*) malloc (bufsize); ret = cbuf2_peek_rgn (&rmi->cbuf2, buf, rw_start, bufsize); if (ret != SR_SUCCESS) { debug_printf ("PEEK FAILED: %d\n", ret); free(buf); return ret; } debug_printf ("PEEK OK\n"); /* Find silence point */ if (sp_opt->xs == 2) { ret = findsep_silence_2 (buf, bufsize, rmi->rw_start_to_sw_start, sp_opt->xs_search_window_1 + sp_opt->xs_search_window_2, sp_opt->xs_silence_length, sp_opt->xs_padding_1, sp_opt->xs_padding_2, pos1, pos2); } else { ret = findsep_silence (buf, bufsize, rmi->rw_start_to_sw_start, sp_opt->xs_search_window_1 + sp_opt->xs_search_window_2, sp_opt->xs_silence_length, sp_opt->xs_padding_1, sp_opt->xs_padding_2, pos1, pos2); } *pos1 += rw_start; *pos2 += rw_start; free(buf); } return SR_SUCCESS; } // pos1 is pos of last byte in previous track // pos2 is pos of first byte in next track // These positions are relative to cbuf2->read_index static error_code end_track_mp3 (RIP_MANAGER_INFO* rmi, u_long pos1, u_long pos2, TRACK_INFO* ti) { int ret; char *buf; /* GCS pos1 is byte position. Here we convert it into a "count". */ pos1++; /* I think pos can be zero if the silence is right at the beginning i.e. it is a bug in s.r. */ buf = (char*) malloc (pos1); /* First, dump the part only in prev track */ ret = cbuf2_peek (&rmi->cbuf2, buf, pos1); if (ret != SR_SUCCESS) goto BAIL; /* Let cbuf know about the start of the next track */ cbuf2_set_next_song (&rmi->cbuf2, pos2); /* Write that out to the current file GCS FIX: m_bytes_ripped is incorrect when there is padding */ if ((ret = rip_manager_put_data (rmi, buf, pos1)) != SR_SUCCESS) goto BAIL; /* Add id3v1 if requested */ if (GET_ADD_ID3V1(rmi->prefs->flags)) { ID3V1Tag id3v1; memset (&id3v1, '\000',sizeof(id3v1)); strncpy (id3v1.tag, "TAG", strlen("TAG")); string_from_gstring (rmi, id3v1.artist, sizeof(id3v1.artist), ti->artist, CODESET_ID3); string_from_gstring (rmi, id3v1.songtitle, sizeof(id3v1.songtitle), ti->title, CODESET_ID3); string_from_gstring (rmi, id3v1.album, sizeof(id3v1.album), ti->album, CODESET_ID3); string_from_gstring (rmi, id3v1.year, sizeof(id3v1.year), ti->year, CODESET_ID3); id3v1.genre = (char) 0xFF; // see http://www.id3.org/id3v2.3.0.html#secA ret = rip_manager_put_data (rmi, (char *)&id3v1, sizeof(id3v1)); if (ret != SR_SUCCESS) { goto BAIL; } } /* Only save this track if we've skipped over enough cruft at the beginning of the stream */ debug_printf ("Current track number %d (skipping if less than %d)\n", rmi->track_count, rmi->prefs->dropcount); if (rmi->track_count >= rmi->prefs->dropcount) if ((ret = rip_manager_end_track (rmi, ti)) != SR_SUCCESS) goto BAIL; BAIL: free(buf); return ret; } #define HEADER_SIZE 1600 // Write data to a new frame, using tag_name e.g. TPE1, and increment // *sent with the number of bytes written static error_code write_id3v2_frame(RIP_MANAGER_INFO* rmi, char* tag_name, mchar* data, int charset, int *sent) { int ret; int rc; char bigbuf[HEADER_SIZE] = ""; ID3V2frame id3v2frame; #ifndef WIN32 __uint32_t framesize = 0; #else unsigned long int framesize = 0; #endif memset(&id3v2frame, '\000', sizeof(id3v2frame)); strncpy(id3v2frame.id, tag_name, 4); id3v2frame.pad[2] = charset; rc = string_from_gstring (rmi, bigbuf, HEADER_SIZE, data, CODESET_ID3); framesize = htonl (rc+1); ret = rip_manager_put_data (rmi, (char *)&(id3v2frame.id), 4); if (ret != SR_SUCCESS) return ret; *sent += 4; ret = rip_manager_put_data (rmi, (char *)&(framesize), sizeof(framesize)); if (ret != SR_SUCCESS) return ret; *sent += sizeof(framesize); ret = rip_manager_put_data (rmi, (char *)&(id3v2frame.pad), 3); if (ret != SR_SUCCESS) return ret; *sent += 3; ret = rip_manager_put_data (rmi, bigbuf, rc); if (ret != SR_SUCCESS) return ret; *sent += rc; return SR_SUCCESS; } static error_code start_track_mp3 (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti) { int ret; int i; unsigned int secs; debug_printf ("calling rip_manager_start_track(#2)\n"); ret = rip_manager_start_track (rmi, ti); if (ret != SR_SUCCESS) { debug_printf ("rip_manager_start_track failed(#2): %d\n",ret); return ret; } /* Dump to artist/title to cue sheet */ secs = bytes_to_secs (rmi->cue_sheet_bytes, rmi->bitrate); ret = filelib_write_cue (rmi, ti, secs); if (ret != SR_SUCCESS) return ret; /* Oddsock's ID3 stuff, (oddsock@oddsock.org) */ if (GET_ADD_ID3V2(rmi->prefs->flags)) { char bigbuf[HEADER_SIZE] = ""; int header_size = HEADER_SIZE; char header1[6] = "ID3\x03\0\0"; int sent = 0; int id3_charset; memset(bigbuf, '\000', sizeof(bigbuf)); /* Write header */ ret = rip_manager_put_data (rmi, header1, 6); if (ret != SR_SUCCESS) return ret; for (i = 0; i < 4; i++) { char x = (header_size >> (3-i)*7) & 0x7F; ret = rip_manager_put_data (rmi, (char *)&x, 1); if (ret != SR_SUCCESS) return ret; } /* ID3 V2.3 is only defined for ISO-8859-1 and UCS-2 If user specifies another codeset, we will use it, and report ISO-8859-1 in the encoding field */ id3_charset = is_id3_unicode(rmi); /* Lead performer */ ret = write_id3v2_frame(rmi, "TPE1", ti->artist, id3_charset, &sent); /* Title */ ret = write_id3v2_frame(rmi, "TIT2", ti->title, id3_charset, &sent); /* Encoded by */ ret = write_id3v2_frame(rmi, "TENC", m_("Ripped with Streamripper"), id3_charset, &sent); /* Album */ ret = write_id3v2_frame(rmi, "TALB", ti->album, id3_charset, &sent); /* Track */ ret = write_id3v2_frame(rmi, "TRCK", ti->track_a, id3_charset, &sent); /* Year */ ret = write_id3v2_frame(rmi, "TYER", ti->year, id3_charset, &sent); /* Zero out padding */ memset (bigbuf, '\000', sizeof(bigbuf)); /* Pad up to header_size */ ret = rip_manager_put_data (rmi, bigbuf, HEADER_SIZE-sent); if (ret != SR_SUCCESS) return ret; } if (!rmi->ripstream_first_time_through) { rmi->track_count ++; debug_printf ("Changed track count to %d\n", rmi->track_count); } return SR_SUCCESS; } // Only save this track if we've skipped over enough cruft // at the beginning of the stream static error_code end_track_ogg (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti) { error_code ret; debug_printf ("Current track number %d (skipping if less than %d)\n", rmi->track_count, rmi->prefs->dropcount); if (rmi->track_count >= rmi->prefs->dropcount) { ret = rip_manager_end_track (rmi, ti); } else { ret = SR_SUCCESS; } rmi->track_count ++; return ret; } #if defined (commentout) /* GCS: This converts either positive or negative ms to blocks, and must work for rounding up and rounding down */ static int ms_to_blocks (int ms, int bitrate, int round_up) { int ms_abs = ms > 0 ? ms : -ms; int ms_sign = ms > 0 ? 1 : 0; int bits = ms_abs * bitrate; int bits_per_block = 8 * rmi->getbuffer_size; int blocks = bits / bits_per_block; if (bits % bits_per_block > 0) { if (!(round_up ^ ms_sign)) { blocks++; } } if (!ms_sign) { blocks = -blocks; } return blocks; } #endif /* Simpler routine, rounded toward zero */ static int ms_to_bytes (int ms, int bitrate) { int bits = ms * bitrate; if (bits > 0) return bits / 8; else return -((-bits)/8); } /* Assume positive, round toward zero */ static int bytes_to_secs (unsigned int bytes, int bitrate) { /* divided by 125 because 125 = 1000 / 8 */ int secs = (bytes / bitrate) / 125; return secs; } /* -------------------------------------------------------------------------- Buffering for silence splitting & padding We may flush the circular buffer as soon as anything that needs to go into the next song has passed. For simplicity, we also buffer up to the latest point that can go into the next song. This is called the "required window." The "required window" is part that is decoded, even though we don't need volume data for all of it. We simply mark the frame boundaries so we don't chop any frames. The circular buffer is a bit bigger than the required window. This includes all of the stuff which cannot be flushed out of the cbuf, because cbuf is flushed in blocks. Some abbreviations: mic meta inf change cb cbuf2, aka circular buffer rw required window sw search window This is the complete picture: A---------A---------A----+----B---------B meta intervals /mic meta-inf change (A to B) +--->| /mi meta-inf point | |---+-----+------+---| search window | | | | |---+---| |---+---| silence length | | |-------------| |-----| prepad postpad |--------------------------------| required window |---------| minimum rw (1 meta int, includes sw, need not be aligned to metadata) |---------------------------------------| cbuf |<-------------+ mic_to_sw_start (usu neg) +---->| mic_to_sw_end (usu pos) |<-----------------------+ mic_to_rw_start +------>| mic_to_rw_end |<----------------------------+ mic_to_cb_start +-------->| mic_to_cb_end ------------------------------------------------------------------------*/ static void compute_cbuf2_size (RIP_MANAGER_INFO* rmi, SPLITPOINT_OPTIONS *sp_opt, int bitrate, int meta_interval) { long sws, sl; long mi_to_mic; long prepad, postpad; long offset; long rw_len; long mic_to_sw_start, mic_to_sw_end; long mic_to_rw_start, mic_to_rw_end; long mic_to_cb_start, mic_to_cb_end; int xs_silence_length; int xs_search_window_1; int xs_search_window_2; int xs_offset; int xs_padding_1; int xs_padding_2; debug_printf ("---------------------------------------------------\n"); debug_printf ("xs: %d\n", sp_opt->xs); debug_printf ("xs_search_window: %d,%d\n", sp_opt->xs_search_window_1,sp_opt->xs_search_window_2); debug_printf ("xs_silence_length: %d\n", sp_opt->xs_silence_length); debug_printf ("xs_padding: %d,%d\n", sp_opt->xs_padding_1, sp_opt->xs_padding_2); debug_printf ("xs_offset: %d\n", sp_opt->xs_offset); debug_printf ("---------------------------------------------------\n"); debug_printf ("bitrate = %d, meta_inf = %d\n", bitrate, meta_interval); debug_printf ("---------------------------------------------------\n"); /* If xs-none, clear out the other xs options */ if (sp_opt->xs == 0){ xs_silence_length = 0; xs_search_window_1 = 0; xs_search_window_2 = 0; xs_offset = 0; xs_padding_1 = 0; xs_padding_2 = 0; } else { xs_silence_length = sp_opt->xs_silence_length; xs_search_window_1 = sp_opt->xs_search_window_1; xs_search_window_2 = sp_opt->xs_search_window_2; xs_offset = sp_opt->xs_offset; xs_padding_1 = sp_opt->xs_padding_1; xs_padding_2 = sp_opt->xs_padding_2; } /* mi_to_mic is the "half of a meta-inf" from the meta inf change to the previous (non-changed) meta inf */ mi_to_mic = meta_interval / 2; debug_printf ("mi_to_mic: %d\n", mi_to_mic); /* compute the search window size (sws) */ sws = ms_to_bytes (xs_search_window_1, bitrate) + ms_to_bytes (xs_search_window_2, bitrate); debug_printf ("sws: %d\n", sws); /* compute the silence length (sl) */ sl = ms_to_bytes (xs_silence_length, bitrate); debug_printf ("sl: %d\n", sl); /* compute padding */ prepad = ms_to_bytes (xs_padding_1, bitrate); postpad = ms_to_bytes (xs_padding_2, bitrate); debug_printf ("padding: %d %d\n", prepad, postpad); /* compute offset */ offset = ms_to_bytes (xs_offset,bitrate); debug_printf ("offset: %d\n", offset); /* compute interval from mi to search window */ mic_to_sw_start = - mi_to_mic + offset - ms_to_bytes(xs_search_window_1,bitrate); mic_to_sw_end = - mi_to_mic + offset + ms_to_bytes(xs_search_window_2,bitrate); debug_printf ("mic_to_sw_start: %d\n", mic_to_sw_start); debug_printf ("mic_to_sw_end: %d\n", mic_to_sw_end); /* compute interval from mi to required window */ mic_to_rw_start = mic_to_sw_start + sl / 2 - prepad; if (mic_to_rw_start > mic_to_sw_start) { mic_to_rw_start = mic_to_sw_start; } mic_to_rw_end = mic_to_sw_end - sl / 2 + postpad; if (mic_to_rw_end < mic_to_sw_end) { mic_to_rw_end = mic_to_sw_end; } debug_printf ("mic_to_rw_start: %d\n", mic_to_rw_start); debug_printf ("mic_to_rw_end: %d\n", mic_to_rw_end); /* if rw is not long enough, make it longer */ rw_len = mic_to_rw_end - mic_to_rw_start; if (rw_len < meta_interval) { long start_extra = (meta_interval - rw_len) / 2; long end_extra = meta_interval - start_extra; mic_to_rw_start -= start_extra; mic_to_rw_end += end_extra; debug_printf ("mic_to_rw_start (2): %d\n", mic_to_rw_start); debug_printf ("mic_to_rw_end (2): %d\n", mic_to_rw_end); } /* This code replaces the 3 cases (see OBSOLETE in gcs_notes.txt) */ mic_to_cb_start = mic_to_rw_start; mic_to_cb_end = mic_to_rw_end; if (mic_to_cb_start > -meta_interval) { mic_to_cb_start = -meta_interval; } if (mic_to_cb_end < 0) { mic_to_cb_end = 0; } /* Convert to chunks & compute cbuf size */ mic_to_cb_end = (mic_to_cb_end + (meta_interval-1)) / meta_interval; mic_to_cb_start = -((-mic_to_cb_start + (meta_interval-1)) / meta_interval); rmi->cbuf2_size = - mic_to_cb_start + mic_to_cb_end; if (rmi->cbuf2_size < 3) { rmi->cbuf2_size = 3; } debug_printf ("mic_to_cb_start: %d\n", mic_to_cb_start * meta_interval); debug_printf ("mic_to_cb_end: %d\n", mic_to_cb_end * meta_interval); debug_printf ("CBUF2 (BLOCKS): %d:%d -> %d\n", mic_to_cb_start, mic_to_cb_end, rmi->cbuf2_size); /* Set some global variables to be used by splitting algorithm */ rmi->mic_to_cb_end = mic_to_cb_end; rmi->rw_start_to_cb_end = mic_to_cb_end * meta_interval - mic_to_rw_start; rmi->rw_end_to_cb_end = mic_to_cb_end * meta_interval - mic_to_rw_end; rmi->rw_start_to_sw_start = xs_padding_1 - xs_silence_length / 2; if (rmi->rw_start_to_sw_start < 0) { rmi->rw_start_to_sw_start = 0; } debug_printf ("m_mic_to_cb_end: %d\n", rmi->mic_to_cb_end); debug_printf ("m_rw_start_to_cb_end: %d\n", rmi->rw_start_to_cb_end); debug_printf ("m_rw_end_to_cb_end: %d\n", rmi->rw_end_to_cb_end); debug_printf ("m_rw_start_to_sw_start: %d\n", rmi->rw_start_to_sw_start); } /* GCS: This used to be myrecv in rip_manager.c */ static int ripstream_recvall (RIP_MANAGER_INFO* rmi, char* buffer, int size) { int ret; ret = socklib_recvall (rmi, &rmi->stream_sock, buffer, size, rmi->prefs->timeout); if (ret >= 0 && ret != size) { debug_printf ("rip_manager_recv: expected %d, got %d\n",size,ret); ret = SR_ERROR_RECV_FAILED; } return ret; } /* Data followed by meta-data */ static error_code get_stream_data (RIP_MANAGER_INFO* rmi, char *data_buf, char *track_buf) { int ret = 0; char c; char newtrack[MAX_TRACK_LEN]; *track_buf = 0; rmi->current_track.have_track_info = 0; ret = ripstream_recvall (rmi, data_buf, rmi->getbuffer_size); if (ret <= 0) return ret; if (rmi->meta_interval == NO_META_INTERVAL) { return SR_SUCCESS; } if ((ret = ripstream_recvall (rmi, &c, 1)) <= 0) return ret; debug_printf ("METADATA LEN: %d\n",(int)c); if (c < 0) { debug_printf ("Got invalid metadata: %d\n",c); return SR_ERROR_INVALID_METADATA; } else if (c == 0) { /* We didn't get any metadata this time. */ return SR_SUCCESS; } else { /* We got metadata this time. */ ret = get_track_from_metadata (rmi, c * 16, newtrack); if (ret != SR_SUCCESS) { debug_printf("get_trackname had a bad return %d\n", ret); return ret; } strncpy(track_buf, newtrack, MAX_TRACK_LEN); rmi->current_track.have_track_info = 1; } return SR_SUCCESS; } static error_code get_track_from_metadata (RIP_MANAGER_INFO* rmi, int size, char *newtrack) { int i; int ret; char *namebuf; char *p; gchar *gnamebuf; /* Default is no track info */ *newtrack = 0; if ((namebuf = malloc(size)) == NULL) return SR_ERROR_CANT_ALLOC_MEMORY; ret = ripstream_recvall (rmi, namebuf, size); if (ret <= 0) { free(namebuf); return ret; } debug_printf ("METADATA TITLE\n"); for (i=0; ibase_idx refers to the beginning of the filled region * * Chunks are always absolute * *****************************************************************************/ #include #include #include #include "errors.h" #include "relaylib.h" #include "cbuf2.h" #include "debug.h" #include "ripogg.h" /***************************************************************************** * Private functions *****************************************************************************/ static u_long cbuf2_idx_to_chunk (CBUF2 *cbuf2, u_long idx); static u_long cbuf2_add (CBUF2 *cbuf2, u_long pos, u_long len); static void cbuf2_get_used_fragments (CBUF2 *cbuf2, u_long* frag1, u_long* frag2); static void cbuf2_advance_metadata_list (RIP_MANAGER_INFO* rmi, CBUF2* cbuf2); static error_code cbuf2_extract_relay_mp3 (CBUF2 *cbuf2, RELAY_LIST* ptr); static error_code cbuf2_extract_relay_ogg (CBUF2 *cbuf2, RELAY_LIST* ptr); static u_long cbuf2_offset (CBUF2 *cbuf2, u_long pos); static u_long cbuf2_offset_2 (CBUF2 *cbuf2, u_long pos); static void cbuf2_debug_lists (RIP_MANAGER_INFO* rmi, CBUF2 *cbuf2); /***************************************************************************** * Function definitions *****************************************************************************/ error_code cbuf2_init (CBUF2 *cbuf2, int content_type, int have_relay, unsigned long chunk_size, unsigned long num_chunks) { if (chunk_size == 0 || num_chunks == 0) { return SR_ERROR_INVALID_PARAM; } cbuf2->have_relay = have_relay; cbuf2->content_type = content_type; cbuf2->chunk_size = chunk_size; cbuf2->num_chunks = num_chunks; cbuf2->size = chunk_size * num_chunks; cbuf2->buf = (char*) malloc (cbuf2->size); cbuf2->base_idx = 0; cbuf2->item_count = 0; cbuf2->next_song = 0; /* MP3 only */ cbuf2->song_page = 0; /* OGG only */ cbuf2->song_page_done = 0; /* OGG only */ INIT_LIST_HEAD (&cbuf2->metadata_list); INIT_LIST_HEAD (&cbuf2->ogg_page_list); cbuf2->cbuf_sem = threadlib_create_sem(); threadlib_signal_sem (&cbuf2->cbuf_sem); return SR_SUCCESS; } void cbuf2_destroy (CBUF2 *cbuf2) { if (cbuf2->buf) { free (cbuf2->buf); cbuf2->buf = NULL; /* GCS FIX: Delete metadata queue */ threadlib_destroy_sem(&cbuf2->cbuf_sem); } } static error_code cbuf2_insert (CBUF2 *cbuf2, const char *data, u_long count) { u_long ft; u_long write_idx; if (cbuf2_get_free (cbuf2) < count) { return SR_ERROR_BUFFER_FULL; } write_idx = cbuf2_write_index (cbuf2); ft = cbuf2_get_free_tail (cbuf2); if (ft >= count) { memcpy (&cbuf2->buf[write_idx], data, count); } else { memcpy (&cbuf2->buf[write_idx], data, ft); memcpy (&cbuf2->buf[0], &data[ft], count-ft); } cbuf2->item_count += count; return SR_SUCCESS; } static void cbuf2_advance_metadata_list (RIP_MANAGER_INFO* rmi, CBUF2* cbuf2) { u_long frag1, frag2; u_long metadata_pos; u_long chunk_no; LIST *p; METADATA_LIST *tmp; cbuf2_get_used_fragments (cbuf2, &frag1, &frag2); chunk_no = cbuf2_idx_to_chunk (cbuf2, cbuf2->base_idx); /* Loop through all metadata, from tail to head */ list_for_each_prev (p, &(cbuf2->metadata_list)) { /* Get position of metadata */ tmp = list_entry(p, METADATA_LIST, m_list); metadata_pos = (tmp->m_chunk + 1) * cbuf2->chunk_size - 1; debug_printf ("CE3: %d\n", metadata_pos); if (metadata_pos >= cbuf2->base_idx && metadata_pos < cbuf2->base_idx + frag1) { /* Nothing to do */ } else if (frag2 > 0 && metadata_pos <= frag2) { /* Nothing to do */ } else { /* Push metadata forward to most recent read pointer */ tmp->m_chunk = chunk_no; } /* If metadata is at head, evict all previous metadata from the list */ debug_printf ("CE4: %d %d\n", tmp->m_chunk, chunk_no); if (tmp->m_chunk == chunk_no) { while (p->prev != &cbuf2->metadata_list) { LIST* pp = p->prev; list_del (p->prev); free (list_entry (pp,METADATA_LIST,m_list)); } } } debug_printf ("CBUF_EXTRACT\n"); cbuf2_debug_lists (rmi, cbuf2); } static void cbuf2_advance_relay_list (RIP_MANAGER_INFO* rmi, CBUF2* cbuf2, u_long count) { RELAY_LIST *prev, *ptr, *next; ptr = rmi->relay_list; if (ptr == NULL) { return; } prev = NULL; while (ptr != NULL) { next = ptr->m_next; if (!ptr->m_is_new) { if (ptr->m_cbuf_offset >= count) { u_long old_pos = ptr->m_cbuf_offset; ptr->m_cbuf_offset -= count; debug_printf ("Updated relay pointer: %d -> %d\n", old_pos, ptr->m_cbuf_offset); prev = ptr; } else { debug_printf ("Relay: Client %d couldn't keep up with cbuf\n", ptr->m_sock); relaylib_disconnect (rmi, prev, ptr); } } ptr = next; } } void cbuf2_set_next_song (CBUF2 *cbuf2, u_long pos) { cbuf2->next_song = pos; } /* Advance the cbuffer while respecting ogg page boundaries */ error_code cbuf2_advance_ogg (RIP_MANAGER_INFO* rmi, CBUF2 *cbuf2, int requested_free_size) { u_long count; LIST *p, *n; OGG_PAGE_LIST *tmp; if (cbuf2->item_count + requested_free_size <= cbuf2->size) { return SR_SUCCESS; } if (cbuf2->have_relay) { debug_printf ("Waiting for rmi->relay_list_sem\n"); threadlib_waitfor_sem (&rmi->relay_list_sem); } debug_printf ("Waiting for cbuf2->cbuf_sem\n"); threadlib_waitfor_sem (&cbuf2->cbuf_sem); /* count is the amount we're going to free up */ count = requested_free_size - (cbuf2->size - cbuf2->item_count); /* Loop through ogg pages, from head to tail. Eject pages that that map into the portion of the buffer that we are freeing. */ p = cbuf2->ogg_page_list.next; list_for_each_safe (p, n, &(cbuf2->ogg_page_list)) { u_long pos; tmp = list_entry(p, OGG_PAGE_LIST, m_list); pos = cbuf2_offset (cbuf2, tmp->m_page_start); if (pos > count) { break; } list_del (p); if (tmp->m_page_flags & OGG_PAGE_EOS) { free (tmp->m_header_buf_ptr); } free (tmp); if (cbuf2->item_count + requested_free_size <= cbuf2->size) { break; } } cbuf2->base_idx = cbuf2_add (cbuf2, cbuf2->base_idx, count); cbuf2->item_count -= count; if (cbuf2->have_relay) { cbuf2_advance_relay_list (rmi, cbuf2, count); } threadlib_signal_sem (&cbuf2->cbuf_sem); if (cbuf2->have_relay) { threadlib_signal_sem (&rmi->relay_list_sem); } if (cbuf2->item_count + requested_free_size <= cbuf2->size) { return SR_SUCCESS; } else { return SR_ERROR_BUFFER_EMPTY; } } /* On extract, we need to update all the relay pointers. */ /* GCS Now it always extracts a chunk */ error_code cbuf2_extract (RIP_MANAGER_INFO* rmi, CBUF2 *cbuf2, char *data, u_long count, u_long* curr_song) { u_long frag1, frag2; /* Don't need to lock this, only the ripping thread changes it. */ if (cbuf2->item_count < count) { return SR_ERROR_BUFFER_EMPTY; } if (cbuf2->have_relay) { debug_printf ("Waiting for rmi->relay_list_sem\n"); threadlib_waitfor_sem (&rmi->relay_list_sem); } debug_printf ("Waiting for cbuf2->cbuf_sem\n"); threadlib_waitfor_sem (&cbuf2->cbuf_sem); cbuf2_get_used_fragments (cbuf2, &frag1, &frag2); if (frag1 >= count) { memcpy (data, &cbuf2->buf[cbuf2->base_idx], count); } else { debug_printf ("This should never happen\n"); memcpy (data, &cbuf2->buf[cbuf2->base_idx], frag1); memcpy (&data[frag1], &cbuf2->buf[0], count-frag1); } cbuf2->base_idx = cbuf2_add (cbuf2, cbuf2->base_idx, count); cbuf2->item_count -= count; debug_printf ("CE2: %d\n", cbuf2->base_idx); *curr_song = cbuf2->next_song; if (cbuf2->next_song < count) { cbuf2->next_song = 0; } else { cbuf2->next_song -= count; } cbuf2_advance_metadata_list (rmi, cbuf2); if (cbuf2->have_relay) { cbuf2_advance_relay_list (rmi, cbuf2, count); } threadlib_signal_sem (&cbuf2->cbuf_sem); if (cbuf2->have_relay) { threadlib_signal_sem (&rmi->relay_list_sem); } return SR_SUCCESS; } error_code cbuf2_fastforward (CBUF2 *cbuf2, u_long count) { threadlib_waitfor_sem (&cbuf2->cbuf_sem); if (cbuf2->item_count < count) { threadlib_signal_sem (&cbuf2->cbuf_sem); return SR_ERROR_BUFFER_EMPTY; } cbuf2->base_idx = cbuf2_add (cbuf2, cbuf2->base_idx, count); cbuf2->item_count -= count; threadlib_signal_sem (&cbuf2->cbuf_sem); return SR_SUCCESS; } error_code cbuf2_peek (CBUF2 *cbuf2, char *data, u_long count) { u_long frag1, frag2; if (cbuf2->item_count < count) { return SR_ERROR_BUFFER_EMPTY; } threadlib_waitfor_sem (&cbuf2->cbuf_sem); cbuf2_get_used_fragments (cbuf2, &frag1, &frag2); if (frag1 >= count) { memcpy (data, &cbuf2->buf[cbuf2->base_idx], count); } else { memcpy (data, &cbuf2->buf[cbuf2->base_idx], frag1); memcpy (&data[frag1], &cbuf2->buf[0], count-frag1); } threadlib_signal_sem (&cbuf2->cbuf_sem); return SR_SUCCESS; } error_code cbuf2_insert_chunk (RIP_MANAGER_INFO* rmi, CBUF2 *cbuf2, const char *data, u_long count, int content_type, TRACK_INFO* ti) { LIST this_page_list; int chunk_no; error_code rc; /* Identify OGG pages using rip_ogg_process_chunk(). We can do this before locking the CBUF to improve concurrency with relay threads. */ if (content_type == CONTENT_TYPE_OGG) { OGG_PAGE_LIST* tmp; LIST *p; unsigned long page_loc; rip_ogg_process_chunk (rmi, &this_page_list, data, count, ti); if (list_empty(&cbuf2->ogg_page_list)) { page_loc = 0; } else { p = cbuf2->ogg_page_list.prev; tmp = list_entry(p, OGG_PAGE_LIST, m_list); page_loc = cbuf2_add (cbuf2, tmp->m_page_start, tmp->m_page_len); } // p = &this_page_list.next; list_for_each (p, &this_page_list) { tmp = list_entry(p, OGG_PAGE_LIST, m_list); tmp->m_page_start = page_loc; page_loc = cbuf2_add (cbuf2, page_loc, tmp->m_page_len); } } /* Insert data */ threadlib_waitfor_sem (&cbuf2->cbuf_sem); chunk_no = cbuf2_idx_to_chunk (cbuf2, cbuf2_write_index(cbuf2)); rc = cbuf2_insert (cbuf2, data, count); if (rc != SR_SUCCESS) { threadlib_signal_sem (&cbuf2->cbuf_sem); return rc; } if (content_type == CONTENT_TYPE_OGG) { list_splice (&this_page_list, cbuf2->ogg_page_list.prev); } else if (ti && ti->have_track_info) { /* Insert metadata data */ METADATA_LIST* ml; ml = (METADATA_LIST*) malloc (sizeof(METADATA_LIST)); /* GCS FIX: Check malloc error */ ml->m_chunk = chunk_no; memcpy (ml->m_composed_metadata, ti->composed_metadata, MAX_METADATA_LEN+1); list_add_tail (&(ml->m_list), &(cbuf2->metadata_list)); } debug_printf ("CBUF_INSERT\n"); cbuf2_debug_lists (rmi, cbuf2); threadlib_signal_sem (&cbuf2->cbuf_sem); return SR_SUCCESS; } /* Relay always gets one chunk. Return 1 if we got a chunk, return 0 if the buffer is empty. */ error_code cbuf2_extract_relay (CBUF2 *cbuf2, RELAY_LIST* ptr) { if (cbuf2->content_type == CONTENT_TYPE_OGG) { return cbuf2_extract_relay_ogg (cbuf2, ptr); } else { return cbuf2_extract_relay_mp3 (cbuf2, ptr); } } static error_code cbuf2_extract_relay_ogg (CBUF2 *cbuf2, RELAY_LIST* ptr) { if (ptr->m_header_buf_ptr) { u_long remaining = ptr->m_header_buf_len - ptr->m_header_buf_off; if (remaining > ptr->m_buffer_size) { memcpy (ptr->m_buffer, &ptr->m_header_buf_ptr[ptr->m_header_buf_off], ptr->m_buffer_size); ptr->m_header_buf_off += ptr->m_buffer_size; ptr->m_left_to_send = ptr->m_buffer_size; } else { memcpy (ptr->m_buffer, &ptr->m_header_buf_ptr[ptr->m_header_buf_off], remaining); ptr->m_header_buf_ptr = 0; ptr->m_header_buf_off = 0; ptr->m_header_buf_len = 0; ptr->m_left_to_send = remaining; } } else { u_long frag1, frag2; u_long relay_idx, remaining; threadlib_waitfor_sem (&cbuf2->cbuf_sem); relay_idx = cbuf2_add (cbuf2, cbuf2->base_idx, ptr->m_cbuf_offset); cbuf2_get_used_fragments (cbuf2, &frag1, &frag2); if (ptr->m_cbuf_offset < frag1) { remaining = frag1 - ptr->m_cbuf_offset; } else { remaining = cbuf2->item_count - ptr->m_cbuf_offset; } debug_printf ("%p p=%d/t=%d (f1=%d,f2=%d) [r=%d/bs=%d]\n", ptr, ptr->m_cbuf_offset, cbuf2->item_count, frag1, frag2, remaining, ptr->m_buffer_size); if (remaining == 0) { threadlib_signal_sem (&cbuf2->cbuf_sem); return SR_ERROR_BUFFER_EMPTY; } if (remaining > ptr->m_buffer_size) { memcpy (ptr->m_buffer, &cbuf2->buf[relay_idx], ptr->m_buffer_size); ptr->m_left_to_send = ptr->m_buffer_size; ptr->m_cbuf_offset += ptr->m_buffer_size; } else { memcpy (ptr->m_buffer, &cbuf2->buf[relay_idx], remaining); ptr->m_left_to_send = remaining; ptr->m_cbuf_offset += remaining; } threadlib_signal_sem (&cbuf2->cbuf_sem); } return SR_SUCCESS; } static error_code cbuf2_extract_relay_mp3 (CBUF2 *cbuf2, RELAY_LIST* ptr) { u_long frag1, frag2; u_long relay_chunk_no; u_long relay_idx; u_long old_offset; char *data = ptr->m_buffer; u_long *offset = &ptr->m_cbuf_offset; u_long *len = &ptr->m_left_to_send; /* Amount that relay lib needs to send to client */ int icy_metadata = ptr->m_icy_metadata; *len = 0; /* Check if there is data to send to the relay */ threadlib_waitfor_sem (&cbuf2->cbuf_sem); cbuf2_get_used_fragments (cbuf2, &frag1, &frag2); if (*offset + cbuf2->chunk_size > cbuf2->item_count) { threadlib_signal_sem (&cbuf2->cbuf_sem); return SR_ERROR_BUFFER_EMPTY; } /* Otherwise, there is enough data */ /* The *offset is the offset from the filled part of the buffer */ old_offset = *offset; relay_idx = cbuf2_add (cbuf2, cbuf2->base_idx, *offset); relay_chunk_no = cbuf2_idx_to_chunk (cbuf2, relay_idx); memcpy (data, &cbuf2->buf[relay_idx], cbuf2->chunk_size); *offset += cbuf2->chunk_size; *len = cbuf2->chunk_size; debug_printf ("RELAY_DEBUG Was: offset=%d, idx=%d, chunk=%d\n", old_offset, relay_idx, relay_chunk_no); debug_printf ("RELAY_DEBUG Changed to: offset=%d\n", *offset); if (icy_metadata) { int have_metadata = 0; LIST *p = cbuf2->metadata_list.next; METADATA_LIST *tmp; list_for_each (p, &(cbuf2->metadata_list)) { tmp = list_entry(p, METADATA_LIST, m_list); debug_printf ("RELAY_DEBUG Comparing metadata: meta=%d relay=%d\n", tmp->m_chunk, relay_chunk_no); if (tmp->m_chunk == relay_chunk_no) { debug_printf ("RELAY_DEBUG Got metadata!\n"); have_metadata = 1; break; } } if (have_metadata) { int metadata_len = tmp->m_composed_metadata[0] * 16 + 1; memcpy (&data[cbuf2->chunk_size],tmp->m_composed_metadata, metadata_len); *len += metadata_len; } else { data[cbuf2->chunk_size] = '\0'; (*len) ++; } } debug_printf ("Final request fulfilled: %d bytes\n", *len); threadlib_signal_sem (&cbuf2->cbuf_sem); return SR_SUCCESS; } void cbuf2_debug_lists (RIP_MANAGER_INFO* rmi, CBUF2 *cbuf2) { LIST *p; if (rmi->http_info.content_type != CONTENT_TYPE_OGG) { debug_printf ("---CBUF_DEBUG_META_LIST---\n"); debug_printf("%ld: \n", cbuf2->size); debug_printf("%ld: Start\n", cbuf2->base_idx); list_for_each (p, &(cbuf2->metadata_list)) { METADATA_LIST *meta_tmp; int metadata_pos; meta_tmp = list_entry (p, METADATA_LIST, m_list); metadata_pos = (meta_tmp->m_chunk + 1) * cbuf2->chunk_size - 1; debug_printf("%ld: %d [%d]%s\n", metadata_pos, meta_tmp->m_chunk, (int) meta_tmp->m_composed_metadata[0], &meta_tmp->m_composed_metadata[1]); } debug_printf("%ld: End\n", cbuf2_write_index(cbuf2)); } else { debug_printf ("---CBUF_DEBUG_OGG_LIST---\n"); debug_printf("%ld: \n", cbuf2->size); debug_printf("%ld: Start\n", cbuf2->base_idx); list_for_each (p, &(cbuf2->ogg_page_list)) { OGG_PAGE_LIST *ogg_tmp; ogg_tmp = list_entry (p, OGG_PAGE_LIST, m_list); debug_printf("ogg page = %02x [%ld, %ld, %ld]\n", ogg_tmp->m_page_flags, ogg_tmp->m_page_start, ogg_tmp->m_page_len, cbuf2_add(cbuf2,ogg_tmp->m_page_start, ogg_tmp->m_page_len)); } if (cbuf2->song_page) { debug_printf ("%ld(%ld): Song Page\n", cbuf2->song_page->m_page_start, cbuf2->song_page_done); } else { debug_printf ("---: Song Page\n"); } debug_printf ("%ld: End\n", cbuf2_write_index(cbuf2)); debug_printf ("---\n"); } } error_code cbuf2_ogg_peek_song (CBUF2 *cbuf2, char* out_buf, unsigned long buf_size, unsigned long* amt_filled, int* eos) { error_code ret; unsigned long song_offset; *amt_filled = 0; *eos = 0; /* First time through, set the song_page */ if (!cbuf2->song_page) { if (cbuf2->ogg_page_list.next) { cbuf2->song_page = list_entry (cbuf2->ogg_page_list.next, OGG_PAGE_LIST, m_list); cbuf2->song_page_done = 0; } else { return SR_SUCCESS; } } /* Advance song_page if old one is finished */ if (cbuf2->song_page_done == cbuf2->song_page->m_page_len) { if (cbuf2->song_page->m_list.next == &cbuf2->ogg_page_list) { return SR_SUCCESS; } else { cbuf2->song_page = list_entry (cbuf2->song_page->m_list.next, OGG_PAGE_LIST, m_list); cbuf2->song_page_done = 0; } } /* Calculate the amount to return to the caller */ *amt_filled = cbuf2->song_page->m_page_len - cbuf2->song_page_done; if (*amt_filled > buf_size) { *amt_filled = buf_size; } else { if (cbuf2->song_page->m_page_flags & OGG_PAGE_EOS) { *eos = 1; } } song_offset = cbuf2_offset_2 (cbuf2, cbuf2->song_page->m_page_start); song_offset += cbuf2->song_page_done; ret = cbuf2_peek_rgn (cbuf2, out_buf, song_offset, *amt_filled); if (ret != SR_SUCCESS) { return ret; } cbuf2->song_page_done += *amt_filled; return SR_SUCCESS; } u_long cbuf2_get_free (CBUF2 *cbuf2) { return cbuf2->size - cbuf2->item_count; } /* Returns the amount of contiguous free memory immediately following the write index */ u_long cbuf2_get_free_tail (CBUF2 *cbuf2) { unsigned long ft = cbuf2->size - cbuf2_write_index(cbuf2); unsigned long fr = cbuf2_get_free(cbuf2); if (ft > fr) { return fr; } else { return ft; } } /* Returns the amount of contiguous used memory from read_ptr to end of cbuf, and then from start to end of used. */ static void cbuf2_get_used_fragments (CBUF2 *cbuf2, u_long* frag1, u_long* frag2) { u_long ut = cbuf2->size - cbuf2->base_idx; u_long us = cbuf2->item_count; if (us > ut) { *frag1 = ut; *frag2 = us - ut; } else { *frag1 = us; *frag2 = 0; } } u_long cbuf2_write_index (CBUF2 *cbuf2) { return cbuf2_add (cbuf2, cbuf2->base_idx, cbuf2->item_count); } static u_long cbuf2_add (CBUF2 *cbuf2, u_long pos, u_long len) { pos += len; if (pos >= cbuf2->size) pos -= cbuf2->size; return pos; } static u_long cbuf2_offset (CBUF2 *cbuf2, u_long pos) { long diff = pos - cbuf2->base_idx; if (diff >= 0) { return diff; } else { return diff + cbuf2->size; } } /* This is like the above, but it never returns zero */ static u_long cbuf2_offset_2 (CBUF2 *cbuf2, u_long pos) { long diff = pos - cbuf2->base_idx; if (diff > 0) { return diff; } else { return diff + cbuf2->size; } } /* returns pos1 - pos2 (not used) */ #if defined (commentout) static u_long cbuf2_subtract (CBUF2 *cbuf2, u_long pos1, u_long pos2) { long diff = pos1 - pos2; if (diff > 0) { return diff; } else { return diff + cbuf2->item_count; } } #endif static u_long cbuf2_idx_to_chunk (CBUF2 *cbuf2, u_long idx) { return idx / cbuf2->chunk_size; } error_code cbuf2_peek_rgn (CBUF2 *cbuf2, char *out_buf, u_long start_offset, u_long length) { u_long sidx; if (length > cbuf2->item_count) return SR_ERROR_BUFFER_EMPTY; sidx = cbuf2_add (cbuf2, cbuf2->base_idx, start_offset); if (sidx + length > cbuf2->size) { int first_hunk = cbuf2->size - sidx; memcpy (out_buf, cbuf2->buf+sidx, first_hunk); sidx = 0; length -= first_hunk; out_buf += first_hunk; } memcpy (out_buf, cbuf2->buf+sidx, length); return SR_SUCCESS; } error_code cbuf2_init_relay_entry (CBUF2 *cbuf2, RELAY_LIST* ptr, u_long burst_request) { int buffer_size; LIST *p; OGG_PAGE_LIST *tmp; threadlib_waitfor_sem (&cbuf2->cbuf_sem); if (burst_request >= cbuf2->item_count) { ptr->m_cbuf_offset = 0; } else { ptr->m_cbuf_offset = cbuf2->item_count - burst_request; } if (cbuf2->content_type == CONTENT_TYPE_OGG) { /* Move to ogg page boundary */ int no_boundary_yet = 1; u_long req_pos = ptr->m_cbuf_offset; p = cbuf2->ogg_page_list.next; list_for_each (p, &(cbuf2->ogg_page_list)) { u_long page_offset; tmp = list_entry(p, OGG_PAGE_LIST, m_list); page_offset = cbuf2_offset (cbuf2, tmp->m_page_start); if (page_offset < req_pos || no_boundary_yet) { if (tmp->m_page_flags & OGG_PAGE_BOS) { ptr->m_cbuf_offset = page_offset; ptr->m_header_buf_ptr = 0; ptr->m_header_buf_len = 0; ptr->m_header_buf_off = 0; no_boundary_yet = 0; } else if (!(tmp->m_page_flags & OGG_PAGE_2)) { ptr->m_cbuf_offset = page_offset; ptr->m_header_buf_ptr = tmp->m_header_buf_ptr; ptr->m_header_buf_len = tmp->m_header_buf_len; ptr->m_header_buf_off = 0; no_boundary_yet = 0; } } debug_printf ("Computing cbuf2_offset: " "req=%d pos=%d bas=%d pag=%d off=%d hbuf=%d\n", req_pos, ptr->m_cbuf_offset, cbuf2->base_idx, tmp->m_page_start, page_offset, ptr->m_header_buf_ptr); if (!no_boundary_yet && page_offset > req_pos) { debug_printf ("Done computing cbuf2_offset\n"); break; } } if (no_boundary_yet) { return SR_ERROR_NO_OGG_PAGES_FOR_RELAY; } } else { /* Move to metadata boundary */ ptr->m_cbuf_offset = (ptr->m_cbuf_offset / cbuf2->chunk_size) * cbuf2->chunk_size; } debug_printf ("cbuf2_init_relay_entry: %d %d %d %d\n", ptr->m_cbuf_offset, cbuf2->base_idx, cbuf2->item_count, cbuf2->size ); if (ptr->m_icy_metadata) { buffer_size = cbuf2->chunk_size + 16*256; ptr->m_buffer = (char*) malloc (sizeof(char)*buffer_size); ptr->m_buffer_size = buffer_size; } else { buffer_size = cbuf2->chunk_size; ptr->m_buffer = (char*) malloc (sizeof(char)*buffer_size); ptr->m_buffer_size = buffer_size; } /* GCS FIX: check for memory error */ threadlib_signal_sem (&cbuf2->cbuf_sem); debug_printf ("Setting relay buffer size to %d\n", buffer_size); return SR_SUCCESS; } streamripper-1.64.6.orig/lib/external.h0000644000175000017500000000171010762552273016105 0ustar abiabi/* external.h * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __external_h__ #define __external_h__ #include "srtypes.h" External_Process* spawn_external (char* cmd); int read_external (RIP_MANAGER_INFO* rmi, External_Process* ep, TRACK_INFO* ti); void close_external (External_Process** epp); #endif streamripper-1.64.6.orig/lib/cbuf2.h0000644000175000017500000000566710773744147015310 0ustar abiabi/* cbuf2.h * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __CBUF2_H__ #define __CBUF2_H__ #include "srtypes.h" #include "threadlib.h" #include "list.h" #include "relaylib.h" /* Each metadata within the cbuf gets this struct */ typedef struct METADATA_LIST_struct METADATA_LIST; struct METADATA_LIST_struct { unsigned long m_chunk; /* m_composed_metadata includes 1 byte for size*16 */ char m_composed_metadata[MAX_METADATA_LEN+1]; LIST m_list; }; #define OGG_PAGE_BOS 0x01 #define OGG_PAGE_EOS 0x02 #define OGG_PAGE_2 0x04 /***************************************************************************** * Global variables *****************************************************************************/ extern CBUF2 g_cbuf2; /***************************************************************************** * Function prototypes *****************************************************************************/ error_code cbuf2_init (CBUF2 *cbuf2, int content_type, int have_relay, unsigned long chunk_size, unsigned long num_chunks); void cbuf2_destroy(CBUF2 *buffer); error_code cbuf2_extract (RIP_MANAGER_INFO* rmi, CBUF2 *cbuf2, char *data, u_long count, u_long* curr_song); error_code cbuf2_peek(CBUF2 *buffer, char *items, u_long count); error_code cbuf2_insert_chunk (RIP_MANAGER_INFO* rmi, CBUF2 *cbuf2, const char *data, u_long count, int content_type, TRACK_INFO* ti); error_code cbuf2_fastforward (CBUF2 *buffer, u_long count); error_code cbuf2_peek_rgn (CBUF2 *buffer, char *out_buf, u_long start, u_long length); u_long cbuf2_get_free(CBUF2 *buffer); u_long cbuf2_get_free_tail (CBUF2 *cbuf2); u_long cbuf2_write_index (CBUF2 *cbuf2); void cbuf2_set_next_song (CBUF2 *cbuf2, u_long pos); error_code cbuf2_init_relay_entry (CBUF2 *cbuf2, RELAY_LIST* ptr, u_long burst_request); error_code cbuf2_ogg_peek_song (CBUF2 *cbuf2, char* out_buf, unsigned long buf_size, unsigned long* amt_filled, int* eos); #if defined (commentout) error_code cbuf2_extract_relay (CBUF2 *cbuf2, char *data, u_long *pos, u_long *len, int icy_metadata); #endif error_code cbuf2_extract_relay (CBUF2 *cbuf2, RELAY_LIST* ptr); error_code cbuf2_advance_ogg (RIP_MANAGER_INFO* rmi, CBUF2 *cbuf2, int requested_free_size); #endif streamripper-1.64.6.orig/lib/utf8.c0000644000175000017500000001701310774000155015135 0ustar abiabi/* * Copyright (C) 2001 Peter Harris * Copyright (C) 2001 Edmund Grimley Evans * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * Convert a string between UTF-8 and the locale's charset. */ #include #include #include "utf8.h" #include "charset.h" #ifdef _WIN32 /* Thanks to Peter Harris for this win32 * code. */ #include #include static unsigned char *make_utf8_string(const wchar_t *unicode) { int size = 0, index = 0, out_index = 0; unsigned char *out; unsigned short c; /* first calculate the size of the target string */ c = unicode[index++]; while(c) { if(c < 0x0080) { size += 1; } else if(c < 0x0800) { size += 2; } else { size += 3; } c = unicode[index++]; } out = malloc(size + 1); if (out == NULL) return NULL; index = 0; c = unicode[index++]; while(c) { if(c < 0x080) { out[out_index++] = (unsigned char)c; } else if(c < 0x800) { out[out_index++] = 0xc0 | (c >> 6); out[out_index++] = 0x80 | (c & 0x3f); } else { out[out_index++] = 0xe0 | (c >> 12); out[out_index++] = 0x80 | ((c >> 6) & 0x3f); out[out_index++] = 0x80 | (c & 0x3f); } c = unicode[index++]; } out[out_index] = 0x00; return out; } static wchar_t *make_unicode_string(const unsigned char *utf8) { int size = 0, index = 0, out_index = 0; wchar_t *out; unsigned char c; /* first calculate the size of the target string */ c = utf8[index++]; while(c) { if((c & 0x80) == 0) { index += 0; } else if((c & 0xe0) == 0xe0) { index += 2; } else { index += 1; } size += 1; c = utf8[index++]; } out = malloc((size + 1) * sizeof(wchar_t)); if (out == NULL) return NULL; index = 0; c = utf8[index++]; while(c) { if((c & 0x80) == 0) { out[out_index++] = c; } else if((c & 0xe0) == 0xe0) { out[out_index] = (c & 0x1F) << 12; c = utf8[index++]; out[out_index] |= (c & 0x3F) << 6; c = utf8[index++]; out[out_index++] |= (c & 0x3F); } else { out[out_index] = (c & 0x3F) << 6; c = utf8[index++]; out[out_index++] |= (c & 0x3F); } c = utf8[index++]; } out[out_index] = 0; return out; } int utf8_encode(const char *from, char **to) { wchar_t *unicode; int wchars, err; wchars = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, from, strlen(from), NULL, 0); if(wchars == 0) { fprintf(stderr, "Unicode translation error %d\n", GetLastError()); return -1; } unicode = calloc(wchars + 1, sizeof(unsigned short)); if(unicode == NULL) { fprintf(stderr, "Out of memory processing string to UTF8\n"); return -1; } err = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, from, strlen(from), unicode, wchars); if(err != wchars) { free(unicode); fprintf(stderr, "Unicode translation error %d\n", GetLastError()); return -1; } /* On NT-based windows systems, we could use WideCharToMultiByte(), but * MS doesn't actually have a consistent API across win32. */ *to = make_utf8_string(unicode); free(unicode); return 0; } int utf8_decode(const char *from, char **to) { wchar_t *unicode; int chars, err; /* On NT-based windows systems, we could use MultiByteToWideChar(CP_UTF8), but * MS doesn't actually have a consistent API across win32. */ unicode = make_unicode_string(from); if(unicode == NULL) { fprintf(stderr, "Out of memory processing string from UTF8 to UNICODE16\n"); return -1; } chars = WideCharToMultiByte(GetConsoleCP(), WC_COMPOSITECHECK, unicode, -1, NULL, 0, NULL, NULL); if(chars == 0) { fprintf(stderr, "Unicode translation error %d\n", GetLastError()); free(unicode); return -1; } *to = calloc(chars + 1, sizeof(unsigned char)); if(*to == NULL) { fprintf(stderr, "Out of memory processing string to local charset\n"); free(unicode); return -1; } err = WideCharToMultiByte(GetConsoleCP(), WC_COMPOSITECHECK, unicode, -1, *to, chars, NULL, NULL); if(err != chars) { fprintf(stderr, "Unicode translation error %d\n", GetLastError()); free(unicode); free(*to); *to = NULL; return -1; } free(unicode); return 0; } #else /* End win32. Rest is for real operating systems */ #ifdef HAVE_LANGINFO_CODESET #include #endif int iconvert(const char *fromcode, const char *tocode, const char *from, size_t fromlen, char **to, size_t *tolen); #if defined (commentout) static char *current_charset = 0; /* means "US-ASCII" */ void convert_set_charset(const char *charset) { if (!charset) charset = getenv("CHARSET"); #ifdef HAVE_LANGINFO_CODESET if (!charset) charset = nl_langinfo(CODESET); #endif free(current_charset); current_charset = 0; if (charset && *charset) current_charset = strdup(charset); } #endif static int convert_buffer(const char *fromcode, const char *tocode, const char *from, size_t fromlen, char **to, size_t *tolen) { int ret = -1; #ifdef HAVE_ICONV ret = iconvert(fromcode, tocode, from, fromlen, to, tolen); if (ret != -1) return ret; #endif #ifndef HAVE_ICONV /* should be ifdef USE_CHARSET_CONVERT */ ret = charset_convert(fromcode, tocode, from, fromlen, to, tolen); if (ret != -1) return ret; #endif return ret; } static int convert_string(const char *fromcode, const char *tocode, const char *from, char **to, char replace) { int ret; size_t fromlen; char *s; fromlen = strlen(from); ret = convert_buffer(fromcode, tocode, from, fromlen, to, 0); if (ret == -2) return -1; if (ret != -1) return ret; s = malloc(fromlen + 1); if (!s) return -1; strcpy(s, from); *to = s; for (; *s; s++) if (*s & ~0x7f) *s = replace; return 3; } #if defined (commentout) int utf8_encode(const char *from, char **to) { char *charset; if (!current_charset) convert_set_charset(0); charset = current_charset ? current_charset : "US-ASCII"; return convert_string(charset, "UTF-8", from, to, '#'); } #endif int utf8_decode(const char *from, char **to) { char *charset; if(*from == 0) { *to = malloc(1); **to = 0; return 1; } #if defined (commentout) if (!current_charset) convert_set_charset(0); charset = current_charset ? current_charset : "US-ASCII"; return convert_string("UTF-8", charset, from, to, '?'); #endif return convert_string("UTF-8", "US-ASCII", from, to, '?'); } #endif streamripper-1.64.6.orig/lib/parse.h0000644000175000017500000000040110771274632015371 0ustar abiabi#ifndef __PARSE_H__ #define __PARSE_H__ #include "srtypes.h" void init_metadata_parser (RIP_MANAGER_INFO* rmi, char* rules_file); void parse_metadata (RIP_MANAGER_INFO* rmi, TRACK_INFO* ti); void parser_free (RIP_MANAGER_INFO* rmi); #endif //__PARSE_H__ streamripper-1.64.6.orig/lib/iconvert.c0000644000175000017500000001415310405101005016065 0ustar abiabi/* * Copyright (C) 2001 Edmund Grimley Evans * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_ICONV #include #include #include #include #include /* * Convert data from one encoding to another. Return: * * -2 : memory allocation failed * -1 : unknown encoding * 0 : data was converted exactly * 1 : data was converted inexactly * 2 : data was invalid (but still converted) * * We convert in two steps, via UTF-8, as this is the only * reliable way of distinguishing between invalid input * and valid input which iconv refuses to transliterate. * We convert from UTF-8 twice, because we have no way of * knowing whether the conversion was exact if iconv returns * E2BIG (due to a bug in the specification of iconv). * An alternative approach is to assume that the output of * iconv is never more than 4 times as long as the input, * but I prefer to avoid that assumption if possible. */ int iconvert(const char *fromcode, const char *tocode, const char *from, size_t fromlen, char **to, size_t *tolen) { int ret = 0; iconv_t cd1, cd2; char *ib; char *ob; char *utfbuf = 0, *outbuf, *newbuf; size_t utflen, outlen, ibl, obl, k; char tbuf[2048]; cd1 = iconv_open("UTF-8", fromcode); if (cd1 == (iconv_t)(-1)) return -1; cd2 = (iconv_t)(-1); /* Don't use strcasecmp() as it's locale-dependent. */ if (!strchr("Uu", tocode[0]) || !strchr("Tt", tocode[1]) || !strchr("Ff", tocode[2]) || tocode[3] != '-' || tocode[4] != '8' || tocode[5] != '\0') { char *tocode1; /* * Try using this non-standard feature of glibc and libiconv. * This is deliberately not a config option as people often * change their iconv library without rebuilding applications. */ tocode1 = (char *)malloc(strlen(tocode) + 11); if (!tocode1) goto fail; strcpy(tocode1, tocode); strcat(tocode1, "//TRANSLIT"); cd2 = iconv_open(tocode1, "UTF-8"); free(tocode1); if (cd2 == (iconv_t)(-1)) cd2 = iconv_open(tocode, fromcode); if (cd2 == (iconv_t)(-1)) { iconv_close(cd1); return -1; } } utflen = 1; /*fromlen * 2 + 1; XXX */ utfbuf = (char *)malloc(utflen); if (!utfbuf) goto fail; /* Convert to UTF-8 */ ib = (char *)from; ibl = fromlen; ob = utfbuf; obl = utflen; for (;;) { k = iconv(cd1, &ib, &ibl, &ob, &obl); assert((!k && !ibl) || (k == (size_t)(-1) && errno == E2BIG && ibl && obl < 6) || (k == (size_t)(-1) && (errno == EILSEQ || errno == EINVAL) && ibl)); if (!ibl) break; if (obl < 6) { /* Enlarge the buffer */ utflen *= 2; newbuf = (char *)realloc(utfbuf, utflen); if (!newbuf) goto fail; ob = (ob - utfbuf) + newbuf; obl = utflen - (ob - newbuf); utfbuf = newbuf; } else { /* Invalid input */ ib++, ibl--; *ob++ = '#', obl--; ret = 2; iconv(cd1, 0, 0, 0, 0); } } if (cd2 == (iconv_t)(-1)) { /* The target encoding was UTF-8 */ if (tolen) *tolen = ob - utfbuf; if (!to) { free(utfbuf); iconv_close(cd1); return ret; } newbuf = (char *)realloc(utfbuf, (ob - utfbuf) + 1); if (!newbuf) goto fail; ob = (ob - utfbuf) + newbuf; *ob = '\0'; *to = newbuf; iconv_close(cd1); return ret; } /* Truncate the buffer to be tidy */ utflen = ob - utfbuf; newbuf = (char *)realloc(utfbuf, utflen); if (!newbuf) goto fail; utfbuf = newbuf; /* Convert from UTF-8 to discover how long the output is */ outlen = 0; ib = utfbuf; ibl = utflen; while (ibl) { ob = tbuf; obl = sizeof(tbuf); k = iconv(cd2, &ib, &ibl, &ob, &obl); assert((k != (size_t)(-1) && !ibl) || (k == (size_t)(-1) && errno == E2BIG && ibl) || (k == (size_t)(-1) && errno == EILSEQ && ibl)); if (ibl && !(k == (size_t)(-1) && errno == E2BIG)) { /* Replace one character */ char *tb = "?"; size_t tbl = 1; outlen += ob - tbuf; ob = tbuf; obl = sizeof(tbuf); k = iconv(cd2, &tb, &tbl, &ob, &obl); assert((!k && !tbl) || (k == (size_t)(-1) && errno == EILSEQ && tbl)); for (++ib, --ibl; ibl && (*ib & 0x80); ib++, ibl--) ; } outlen += ob - tbuf; } ob = tbuf; obl = sizeof(tbuf); k = iconv(cd2, 0, 0, &ob, &obl); assert(!k); outlen += ob - tbuf; /* Convert from UTF-8 for real */ outbuf = (char *)malloc(outlen + 1); if (!outbuf) goto fail; ib = utfbuf; ibl = utflen; ob = outbuf; obl = outlen; while (ibl) { k = iconv(cd2, &ib, &ibl, &ob, &obl); assert((k != (size_t)(-1) && !ibl) || (k == (size_t)(-1) && errno == EILSEQ && ibl)); if (k && !ret) ret = 1; if (ibl && !(k == (size_t)(-1) && errno == E2BIG)) { /* Replace one character */ char *tb = "?"; size_t tbl = 1; k = iconv(cd2, &tb, &tbl, &ob, &obl); assert((!k && !tbl) || (k == (size_t)(-1) && errno == EILSEQ && tbl)); for (++ib, --ibl; ibl && (*ib & 0x80); ib++, ibl--) ; } } k = iconv(cd2, 0, 0, &ob, &obl); assert(!k); assert(!obl); *ob = '\0'; free(utfbuf); iconv_close(cd1); iconv_close(cd2); if (tolen) *tolen = outlen; if (!to) { free(outbuf); return ret; } *to = outbuf; return ret; fail: free(utfbuf); iconv_close(cd1); if (cd2 != (iconv_t)(-1)) iconv_close(cd2); return -2; } #endif /* HAVE_ICONV */ streamripper-1.64.6.orig/lib/ripstream.h0000644000175000017500000000045110755675305016276 0ustar abiabi#ifndef __RIPLIB_H__ #define __RIPLIB_H__ #include "rip_manager.h" #include "srtypes.h" #include "prefs.h" #include "socklib.h" error_code ripstream_init (RIP_MANAGER_INFO* rmi); error_code ripstream_rip (RIP_MANAGER_INFO* rmi); void ripstream_clear(RIP_MANAGER_INFO* rmi); #endif //__RIPLIB__ streamripper-1.64.6.orig/lib/Makefile.am0000644000175000017500000000200411154767347016151 0ustar abiabi## Process this file with automake to produce Makefile.in AM_CPPFLAGS = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @GLIB_CFLAGS@ if SUBDIR_LIBMAD AM_CPPFLAGS += -I@abs_top_srcdir@/libmad-0.15.1b endif # if SUBDIR_GLIB # MAYBE_GLIB = glib-2.16.6 # AM_CPPFLAGS += -I@abs_top_srcdir@/glib-2.16.6/glib # AM_CPPFLAGS += -I@abs_top_srcdir@/glib-2.16.6 # endif AM_CPPFLAGS += -I@abs_top_srcdir@/lib noinst_LIBRARIES = libstreamripper.a libstreamripper_a_SOURCES = \ cbuf2.c \ charset.c \ debug.c \ errors.c \ external.c \ filelib.c \ findsep.c \ findsep2.c \ http.c \ iconvert.c \ mchar.c \ parse.c \ prefs.c \ relaylib.c \ rip_manager.c \ ripaac.c \ ripogg.c \ ripstream.c \ socklib.c \ threadlib.c \ utf8.c \ cbuf2.h \ charmaps.h \ charset.h \ compat.h \ debug.h \ errors.h \ external.h \ filelib.h \ findsep.h \ http.h \ list.h \ mchar.h \ parse.h \ prefs.h \ relaylib.h \ rip_manager.h \ ripogg.h \ ripstream.h \ socklib.h \ srconfig.h \ threadlib.h \ srtypes.h \ uce_dirent.h \ utf8.h streamripper-1.64.6.orig/lib/confw32.h0000644000175000017500000001127010754167674015556 0ustar abiabi/* lib/config.h. Generated by configure. */ /* lib/config.h.in. Generated from configure.ac by autoheader. */ /* Stifle noisy MSVC Express warnings */ #if _MSC_VER >= 1400 #pragma warning(disable:4996) #endif /* Whether the system has connect() */ #undef HAVE_CONNECT /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have faad2 libraries installed */ #undef HAVE_FAAD /* Define if you have the iconv() function. */ #define HAVE_ICONV 1 /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `iswcntrl' function. */ #define HAVE_ISWCNTRL 1 /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET /* Define to 1 if you have the `inet' library (-linet). */ #undef HAVE_LIBINET /* Define to 1 if you have the `m' library (-lm). */ #define HAVE_LIBM 1 /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `nsl_s' library (-lnsl_s). */ #undef HAVE_LIBNSL_S /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT /* Define to 1 if you have the `sem' library (-lsem). */ #undef HAVE_LIBSEM /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the `tre' library (-ltre). */ #define HAVE_LIBTRE 1 /* Define if you have locale_charset() in . */ #define HAVE_LOCALE_CHARSET 1 /* Define to 1 if mbrtowc and mbstate_t are properly declared. */ #define HAVE_MBRTOWC 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `mkdir' function. */ #define HAVE_MKDIR 1 /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have both the ogg and vorbis libraries installed */ #define HAVE_OGG_VORBIS 1 /* Define to 1 if you have the `socket' function. */ #define HAVE_SOCKET 1 /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strstr' function. */ #define HAVE_STRSTR 1 /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_H /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if the system has the type `uint32_t'. */ #undef HAVE_UINT32_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `u_int32_t'. */ #undef HAVE_U_INT32_T /* Define to 1 if you have the `vprintf' function. */ #define HAVE_VPRINTF 1 /* Define to 1 if you have the `vswprintf' function. */ #undef HAVE_VSWPRINTF /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 /* Define to 1 if wide characters is supported */ #define HAVE_WCHAR_SUPPORT 1 /* Define to 1 if the system has the type `wchar_t'. */ #define HAVE_WCHAR_T 1 /* Define to 1 if you have the header file. */ #define HAVE_WCTYPE_H 1 /* Define as const if the declaration of iconv() needs const. */ #define ICONV_CONST /* Name of package */ #define PACKAGE "streamripper" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ #define PACKAGE_NAME "streamripper" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "streamripper 1.61.0b" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "streamripper" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.61.0b" /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ #define VERSION "1.61.0b" /* Define to `unsigned' if does not define. */ /* #undef size_t */ /* Substitute for socklen_t */ #define socklen_t int streamripper-1.64.6.orig/lib/srtypes.h0000644000175000017500000004275711164242501015777 0ustar abiabi/* srtypes.h * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __SRTYPES_H__ #define __SRTYPES_H__ #include //#include "regex.h" #include "srconfig.h" #include "compat.h" #include "list.h" #if WIN32 /* Warning: Not allowed to mix windows.h & cdk.h */ #include #else #include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_SYS_SOCKIO_H #include #endif /****************************************************************************** * Types *****************************************************************************/ /* Note: uint32_t is standardized in ISO C99, so let's use that one */ #if !HAVE_UINT32_T # if HAVE_U_INT32_T typedef u_int32_t uint32_t; # else typedef unsigned int uint32_t; # endif #endif #if HAVE_WCHAR_SUPPORT #if HAVE_WCHAR_H #include #endif #if HAVE_WCTYPE_H #include #endif #endif #if STDC_HEADERS #include #endif #if (HAVE_OGG_VORBIS) #include #endif #define BOOL int #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif #define USE_GLIB_REGEX 1 /* New PCRE regex */ #define NO_META_INTERVAL -1 /* GCS - Grr. I don't care. Max path is 254 until I get around to fixing this for other platforms. */ #define SR_MAX_PATH 254 #define MAX_HOST_LEN 512 #define MAX_IP_LEN 3+1+3+1+3+1+3+1 #define MAX_HEADER_LEN 8192 #define MAX_URL_LEN 8192 #define MAX_VERSION_LEN 256 #define MAX_ICY_STRING 4024 #define MAX_SERVER_LEN 1024 //#define MAX_TRACK_LEN MAX_PATH #define MAX_TRACK_LEN SR_MAX_PATH /* GCS - be careful here... */ #define MAX_URI_STRING 1024 #define MAX_ERROR_STR (4096) #define MAX_USERAGENT_STR 1024 #define MAX_AUTH_LEN 255 //#define MAX_DROPSTRING_LEN 255 #define MAX_METADATA_LEN (127*16) #define MAX_STATUS_LEN 256 #define MAX_STREAMNAME_LEN 1024 #define MAX_SERVER_LEN 1024 #define MAX_EXT_LINE_LEN 255 #define DEFAULT_META_INTERVAL 1024 #ifdef WIN32 #ifndef _WINSOCKAPI_ #define __DEFINE_TYPES__ #endif #endif #ifdef __DEFINE_TYPES__ typedef unsigned long u_long; typedef unsigned char u_char; typedef unsigned short u_short; #endif /* Different types of streams */ #define CONTENT_TYPE_MP3 1 #define CONTENT_TYPE_NSV 2 #define CONTENT_TYPE_OGG 3 #define CONTENT_TYPE_ULTRAVOX 4 #define CONTENT_TYPE_AAC 5 #define CONTENT_TYPE_PLS 6 #define CONTENT_TYPE_M3U 7 #define CONTENT_TYPE_UNKNOWN 99 /* * IO_DATA_INPUT is a interface for socket input data, it has one * method 'get_data' and is called by a "ripper" which is effectivly * only ripshout.c (and the R.I.P. riplive365.c) */ typedef struct IO_DATA_INPUTst{ int (*get_input_data)(char* buffer, int size); } IO_DATA_INPUT; #define NO_TRACK_STR "No track info..." /* * IO_GET_STREAM is an interface for getting data and track info from * a better splite on the track seperation. it keeps a back buffer and * does the "find silent point" shit. */ #if defined (commentout) typedef struct IO_GET_STREAMst{ int (*get_stream_data)(char* data_buf, char *track_buf); u_long getsize; } IO_GET_STREAM; #endif /* * SPLITPOINT_OPTIONS are the options used to tweek how the silence * separation is done. */ typedef struct SPLITPOINT_OPTIONSst { int xs; int xs_min_volume; int xs_silence_length; int xs_search_window_1; int xs_search_window_2; int xs_offset; //int xd_offset; //int xpadding_1; //int xpadding_2; int xs_padding_1; int xs_padding_2; } SPLITPOINT_OPTIONS; /* * CODESET_OPTIONS are the options used to decide how to parse * and convert the metadata */ #define MAX_CODESET_STRING 128 typedef struct CODESET_OPTIONSst { char codeset_locale[MAX_CODESET_STRING]; char codeset_filesys[MAX_CODESET_STRING]; char codeset_id3[MAX_CODESET_STRING]; char codeset_metadata[MAX_CODESET_STRING]; char codeset_relay[MAX_CODESET_STRING]; } CODESET_OPTIONS; /* * Various CODESET types */ #define CODESET_UTF8 1 #define CODESET_LOCALE 2 #define CODESET_FILESYS 3 #define CODESET_ID3 4 #define CODESET_METADATA 5 #define CODESET_RELAY 6 /* The Lstring is not null-terminated, and can belong to any locale */ struct lstring { gsize num_bytes; gchar* data; }; typedef struct lstring Lstring; /* The mchar is a legacy data structure, and should be removed */ typedef gchar mchar; /* * Parse_Rule is a single line of the parse rules file */ struct parse_rule { int cmd; int flags; int artist_idx; int title_idx; int album_idx; int trackno_idx; int year_idx; #if defined (USE_GLIB_REGEX) GRegex* reg; #else regex_t* reg; #endif mchar* match; mchar* subst; }; typedef struct parse_rule Parse_Rule; /* * TRACK_INFO is the parsed metadata */ typedef struct TRACK_INFOst { int have_track_info; char raw_metadata[MAX_TRACK_LEN]; mchar w_raw_metadata[MAX_TRACK_LEN]; mchar artist[MAX_TRACK_LEN]; mchar title[MAX_TRACK_LEN]; mchar album[MAX_TRACK_LEN]; mchar track_p[MAX_TRACK_LEN]; /* Track# parsed */ mchar track_a[MAX_TRACK_LEN]; /* Track# assigned to id3 */ mchar year[MAX_TRACK_LEN]; char composed_metadata[MAX_METADATA_LEN+1]; /* For relay stream */ BOOL save_track; } TRACK_INFO; #ifndef WIN32 typedef int SOCKET; #endif typedef struct HSOCKETst { SOCKET s; BOOL closed; } HSOCKET; /* * OverwriteOpt controls how files in complete directory are overwritten */ enum OverwriteOpt { OVERWRITE_UNKNOWN, // Error case OVERWRITE_ALWAYS, // Always replace file in complete with newer OVERWRITE_NEVER, // Never replace file in complete with newer OVERWRITE_LARGER, // Replace file in complete if newer is larger OVERWRITE_VERSION // Never overwrite, instead make a new version }; /* Information extracted from the stream's HTTP header */ typedef struct SR_HTTP_HEADERst { int content_type; int meta_interval; int have_icy_name; char icy_name[MAX_ICY_STRING]; int icy_code; int icy_bitrate; char icy_genre[MAX_ICY_STRING]; char icy_url[MAX_ICY_STRING]; char http_location[MAX_HOST_LEN]; char server[MAX_SERVER_LEN]; } SR_HTTP_HEADER; typedef struct URLINFOst { char host[MAX_HOST_LEN]; char path[SR_MAX_PATH]; u_short port; char username[MAX_URI_STRING]; char password[MAX_URI_STRING]; } URLINFO; typedef struct external_process External_Process; struct external_process { #if defined (WIN32) HANDLE mypipe; /* read from child stdout */ HANDLE hproc; DWORD pid; #else int mypipe[2]; /* 0 is for parent reading, 1 is for parent writing */ pid_t pid; #endif int line_buf_idx; char line_buf[MAX_EXT_LINE_LEN]; char album_buf[MAX_EXT_LINE_LEN]; char artist_buf[MAX_EXT_LINE_LEN]; char title_buf[MAX_EXT_LINE_LEN]; char metadata_buf[MAX_EXT_LINE_LEN]; }; /* Each ogg page boundary within the cbuf gets this struct */ typedef struct OGG_PAGE_LIST_struct OGG_PAGE_LIST; struct OGG_PAGE_LIST_struct { unsigned long m_page_start; unsigned long m_page_len; unsigned long m_page_flags; char *m_header_buf_ptr; unsigned long m_header_buf_len; LIST m_list; }; typedef struct CBUF2_struct { char* buf; int content_type; int have_relay; u_long num_chunks; u_long chunk_size; u_long size; /* size is chunk_size * num_chunks */ u_long base_idx; u_long item_count; /* Amount filled */ u_long next_song; /* start of next song (mp3 only) */ OGG_PAGE_LIST* song_page; /* current page being written (ogg only) */ u_long song_page_done; /* amount finished in current page (ogg) */ HSEM cbuf_sem; LIST metadata_list; LIST ogg_page_list; LIST frame_list; } CBUF2; /* Each relay server gets this list of clients */ typedef struct RELAY_LIST_struct RELAY_LIST; struct RELAY_LIST_struct { SOCKET m_sock; int m_is_new; char* m_buffer; // large enough for 1 block & 1 metadata u_long m_buffer_size; u_long m_cbuf_offset; // must lie along chunck boundary for mp3 u_long m_offset; u_long m_left_to_send; int m_icy_metadata; // true if client requested metadata char* m_header_buf_ptr; // for ogg header pages u_long m_header_buf_len; // for ogg header pages u_long m_header_buf_off; // for ogg header pages RELAY_LIST* m_next; }; #if (HAVE_OGG_VORBIS) typedef struct _stream_processor { void (*process_end)(struct _stream_processor *); int isillegal; int constraint_violated; int shownillegal; int isnew; long seqno; int lostseq; int start; int end; int num; char *type; ogg_uint32_t serial; /* must be 32 bit unsigned */ ogg_stream_state os; void *data; } stream_processor; #endif typedef struct RELAYLIB_INFO_struct RELAYLIB_INFO; struct RELAYLIB_INFO_struct { HSEM m_sem_not_connected; char m_http_header[MAX_HEADER_LEN]; SOCKET m_listensock; BOOL m_running; BOOL m_running_accept; BOOL m_running_send; THREAD_HANDLE m_hthread_accept; THREAD_HANDLE m_hthread_send; }; #define DATEBUF_LEN 50 typedef struct FILELIB_INFO_struct FILELIB_INFO; struct FILELIB_INFO_struct { FHANDLE m_file; FHANDLE m_show_file; FHANDLE m_cue_file; int m_count; int m_do_show; mchar m_default_pattern[SR_MAX_PATH]; mchar m_default_showfile_pattern[SR_MAX_PATH]; mchar m_output_directory[SR_MAX_PATH]; mchar m_output_pattern[SR_MAX_PATH]; mchar m_incomplete_directory[SR_MAX_PATH]; mchar m_incomplete_filename[SR_MAX_PATH]; mchar m_showfile_directory[SR_MAX_PATH]; mchar m_showfile_pattern[SR_MAX_PATH]; BOOL m_keep_incomplete; int m_max_filename_length; mchar m_show_name[SR_MAX_PATH]; mchar m_cue_name[SR_MAX_PATH]; mchar m_icy_name[SR_MAX_PATH]; mchar* m_extension; BOOL m_do_individual_tracks; mchar m_session_datebuf[DATEBUF_LEN]; mchar m_stripped_icy_name[SR_MAX_PATH]; int m_track_no; }; #define RIPLIST_LEN 10 typedef struct stream_prefs STREAM_PREFS; struct stream_prefs { char label[MAX_URL_LEN]; // logical name for this stream char url[MAX_URL_LEN]; // url of the stream to connect to char proxyurl[MAX_URL_LEN]; // url of a http proxy server, // '\0' otherwise char output_directory[SR_MAX_PATH]; // base directory to output files too char output_pattern[SR_MAX_PATH]; // filename pattern when ripping // with splitting char showfile_pattern[SR_MAX_PATH]; // filename base when ripping to // single file without splitting char if_name[SR_MAX_PATH]; // local interface to use char rules_file[SR_MAX_PATH]; // file that holds rules for // parsing metadata char pls_file[SR_MAX_PATH]; // optional, where to create a // rely .pls file char relay_ip[SR_MAX_PATH]; // optional, ip to bind relaying // socket to char ext_cmd[SR_MAX_PATH]; // cmd to spawn for external metadata char useragent[MAX_USERAGENT_STR]; // optional, use a different useragent u_short relay_port; // port to use for the relay server // GCS 3/30/07 change to u_short u_short max_port; // highest port the relay server // can look if it needs to search u_long max_connections; // max number of connections // to relay stream // GCS 8/18/07 change int to u_long u_long maxMB_rip_size; // max number of megabytes that // can by writen out before we stop u_long flags; // all booleans logically OR'd // together (see above) u_long timeout; // timeout, in seconds, before a // stalled connection is forcefully // closed // GCS 8/18/07 change int to u_long u_long dropcount; // number of tracks at beginning // of connection to always ignore // GCS 8/18/07 change int to u_long int count_start; // which number to start counting? enum OverwriteOpt overwrite; // overwrite file in complete? SPLITPOINT_OPTIONS sp_opt; // options for splitpoint rules CODESET_OPTIONS cs_opt; // which codeset should i use? }; typedef struct wstreamripper_prefs WSTREAMRIPPER_PREFS; struct wstreamripper_prefs { int m_add_finished_tracks_to_playlist; int m_start_minimized; long oldpos_x; long oldpos_y; int m_enabled; char localhost[MAX_HOST_LEN]; // hostname of 'localhost' char default_skin[SR_MAX_PATH]; int use_old_playlist_ret; char riplist[RIPLIST_LEN][MAX_URL_LEN]; }; typedef struct global_prefs GLOBAL_PREFS; struct global_prefs { char version[MAX_VERSION_LEN]; // default stream char url[MAX_URL_LEN]; // default stream STREAM_PREFS stream_prefs; // default prefs for new streams WSTREAMRIPPER_PREFS wstreamripper_prefs; // prefs for winamp plugin }; typedef struct RIP_MANAGER_INFOst RIP_MANAGER_INFO; typedef void(*RIP_MANAGER_CALLBACK)(RIP_MANAGER_INFO* rmi, int message, void *data); struct RIP_MANAGER_INFOst { STREAM_PREFS *prefs; char streamname[MAX_STREAMNAME_LEN]; char server_name[MAX_SERVER_LEN]; u_long filesize; int status; int meta_interval; /* Bitrate as reported by http header */ int http_bitrate; /* Bitrate detected in first frame */ int detected_bitrate; /* Bitrate used to compute buffer size */ int bitrate; /* it's not the filename, it's the trackname */ char filename[SR_MAX_PATH]; /* Process id & handle for external process */ External_Process *ep; #if __UNIX__ /* Write to the abort pipe to exit select() of the ripping thread */ int abort_pipe[2]; #endif /* Is rip manager active? */ int started; HSEM started_sem; /* Info from stream http header. It's used for generating relay header, and formatting strings for winamp playlist. */ SR_HTTP_HEADER http_info; /* Socket for connection to stream */ HSOCKET stream_sock; /* Handle to ripping thread */ THREAD_HANDLE hthread_ripper; /* Callback function */ //void (*m_status_callback)(RIP_MANAGER_INFO* rmi, int message, void *data); RIP_MANAGER_CALLBACK status_callback; /* Bytes ripped is stored to send to callback, also used to decide when to stop based on bytes ripped. */ u_long bytes_ripped; u_long megabytes_ripped; /* Should we write a file for this track? */ BOOL write_data; /* Used by ripstream ogg logic */ /* 0 : Track inactive, file closed */ /* 1 : Track active, file open */ /* 2 : Got eos, file open pending confirmed title change */ int ogg_track_state; /* Title & artist info */ TRACK_INFO old_track; /* The track that's being ripped now */ TRACK_INFO new_track; /* The track that's gonna start soon */ TRACK_INFO current_track; /* The metadata as I'm parsing it */ /* After the first buffer, we collect statistics about the stream */ int ripstream_first_time_through; /* What is the title if there is no metadata? */ char no_meta_name[MAX_TRACK_LEN]; /* A temporary buffer used by ripstream.c */ char* getbuffer; unsigned long getbuffer_size; /* A counter that keeps track of how many more blocks to read before we can do silence detection. Used by ripstream.c */ int find_silence; /* Keep track of bytes ripped, to use by cue sheet to compute time. */ unsigned int cue_sheet_bytes; /* Keep track of how many tracks we have ripped */ unsigned int track_count; /* The circular buffer */ CBUF2 cbuf2; /* CBuf size variables. Used by ripstream.c */ int cbuf2_size; /* blocks */ int rw_start_to_cb_end; /* bytes */ int rw_start_to_sw_start; /* milliseconds */ int rw_end_to_cb_end; /* bytes */ int mic_to_cb_end; /* blocks */ /* The Relay list */ RELAY_LIST* relay_list; unsigned long relay_list_len; HSEM relay_list_sem; /* Private data used by filelib.c */ FILELIB_INFO filelib_info; /* Private data used by relaylib.c */ RELAYLIB_INFO relaylib_info; /* Private data used by parse.c */ Parse_Rule* parse_rules; #if (HAVE_OGG_VORBIS) /* Ogg state, used by ripogg.c */ ogg_sync_state ogg_sync; ogg_page ogg_pg; stream_processor stream; char* ogg_curr_header; int ogg_curr_header_len; #endif /* Mchar codesets -- these shadow prefs codesets */ CODESET_OPTIONS mchar_cs; }; #endif //__SRIPPER_H__ streamripper-1.64.6.orig/lib/prefs.h0000644000175000017500000000244310755660415015406 0ustar abiabi/* prefs.h * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __PREFS_H__ #define __PREFS_H__ #include #define DEFAULT_SKINFILE "srskin.bmp" /* Prototypes */ int prefs_load (void); void prefs_save (void); void prefs_get_global_prefs (GLOBAL_PREFS *global_prefs); void prefs_set_global_prefs (GLOBAL_PREFS *global_prefs); void prefs_get_stream_prefs (STREAM_PREFS *prefs, char *label); void prefs_set_stream_prefs (STREAM_PREFS *prefs, char *label); void prefs_get_wstreamripper_prefs (WSTREAMRIPPER_PREFS *wsr_prefs); void prefs_set_wstreamripper_prefs (WSTREAMRIPPER_PREFS *wsr_prefs); void debug_stream_prefs (STREAM_PREFS* prefs); #endif streamripper-1.64.6.orig/lib/ripogg.h0000644000175000017500000000202010755704074015545 0ustar abiabi/* ripogg.h * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __RIP_OGG_H__ #define __RIP_OGG_H__ #include "list.h" void rip_ogg_init (RIP_MANAGER_INFO* rmi); void rip_ogg_get_current_header (RIP_MANAGER_INFO* rmi, char** ptr, int* len); void rip_ogg_process_chunk (RIP_MANAGER_INFO* rmi, LIST* page_list, const char* buf, u_long size, TRACK_INFO* ti); #endif streamripper-1.64.6.orig/lib/mchar.c0000644000175000017500000004431011164265267015354 0ustar abiabi/* mchar.c * Codeset and wide character processing * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * * REFS: * http://mail.nl.linux.org/linux-utf8/2001-04/msg00083.html * http://www.cl.cam.ac.uk/~mgk25/unicode.html * http://mail.nl.linux.org/linux-utf8/2001-06/msg00020.html * http://mail.nl.linux.org/linux-utf8/2001-04/msg00254.html */ #include #include #include #include #include #include "srconfig.h" #if defined HAVE_UNISTD_H #include #endif #include #if defined HAVE_LOCALE_CHARSET #include #elif defined HAVE_LANGINFO_CODESET #include #endif #include #include #include #include "debug.h" #include "srtypes.h" #include "mchar.h" #if WIN32 #define ICONV_WCHAR "UCS-2-INTERNAL" #define vsnprintf _vsnprintf // #define vswprintf _vsnwprintf #else #define ICONV_WCHAR "WCHAR_T" /* This prototype is missing in some systems */ // int vswprintf (wchar_t * ws, size_t n, const wchar_t * format, va_list arg); #endif /***************************************************************************** * Public functions *****************************************************************************/ char *left_str(char *str, int len); char *subnstr_until(const char *str, char *until, char *newstr, int maxlen); char *format_byte_size(char *str, long size); void trim(char *str); /***************************************************************************** * These functions are NOT mchar related *****************************************************************************/ char* subnstr_until(const char *str, char *until, char *newstr, int maxlen) { const char *p = str; int len = 0; for (len = 0; strncmp(p, until, strlen(until)) != 0 && len < maxlen-1; p++) { newstr[len] = *p; len++; } newstr[len] = '\0'; return newstr; } char *left_str(char *str, int len) { int slen = strlen(str); if (slen <= len) return str; str[len] = '\0'; return str; } char *format_byte_size(char *str, long size) { const long ONE_K = 1024; const long ONE_M = ONE_K*ONE_K; if (size < ONE_K) sprintf(str, "%ldb", size); else if (size < ONE_M) sprintf(str, "%ldkb", size/ONE_K); else sprintf(str, "%.2fM", (float)size/(ONE_M)); return str; } void trim(char *str) { char *start = str; char *end; char *original_end; char *test; /* skip over initial whitespace */ while (*start && isspace(*start)) { ++start; } /* locate end of string */ end = start; while (*end) { ++end; } original_end = end; /* backtrack over final whitespace */ while (end > start) { test = end-1; if (isspace(*test)) { end = test; } else { break; } } /* move non-whitespace text if initial whitespace was found above. */ /* move is unnecessary if resulting string is empty */ if (start > str && start != end) { memmove(str, start, end-start); } /* null-terminate resulting string. */ /* this is necessary in all cases except when the string was not modified */ if (start > str || end < original_end) { str[end-start] = '\0'; } } /* This is a little different from standard strncpy, because: 1) behavior is known when dst & src overlap 2) only copy n-1 characters max 3) then add the null char */ void sr_strncpy (char* dst, char* src, int n) { int i = 0; for (i = 0; i < n-1; i++) { if (!(dst[i] = src[i])) { return; } } dst[i] = 0; } /***************************************************************************** * Lstring functions *****************************************************************************/ void lstring_initialize (Lstring* lstring) { lstring->num_bytes = 0; lstring->data = 0; } /***************************************************************************** * These functions ARE mchar related *****************************************************************************/ void gmem_concat ( gchar** base_mem, /* In/Out: The memory to be concatenated to */ gsize base_bytes, /* Input: Size of base memory (in bytes) */ char* concat_mem, /* Input: The memory to concatenate */ gsize concat_bytes /* Input: Size of concat_mem (in bytes) */ ) { *base_mem = g_realloc (*base_mem, base_bytes + concat_bytes); memcpy (*base_mem + base_bytes, concat_mem, concat_bytes); } /* Convert a string, replacing unconvertable characters. Returns a gchar* string, which must be freed by caller using g_free. */ void convert_string_with_replacement ( gchar** output_string, /* Output: The converted string */ gsize* output_bytes, /* Output: Size of output string (in bytes) */ char* input_string, /* Input: String to convert */ gsize input_bytes, /* Input: Length of input string (in bytes) */ char* from_codeset, /* Input: Codeset of input string */ char* to_codeset, /* Input: Codeset of output string */ char* repl /* Input: Replacement character (zero terminated, in utf-8) */ ) { GIConv giconv; gsize cur = 0; /* Current byte to convert */ GError *error = 0; gsize bytes_to_convert = input_bytes; int need_repl = 1; gsize br, bw; gchar* repl_string; gsize repl_bytes; *output_string = 0; *output_bytes = 0; giconv = g_iconv_open (to_codeset, from_codeset); if (giconv == (GIConv) -1) { /* Not sure why this would happen */ debug_printf ("g_iconv_open returned zero\n"); return; } /* Convert replacement character from UTF-8 to to_codeset */ repl_string = g_convert (repl, strlen (repl), to_codeset, "UTF-8", &br, &bw, &error); if (repl_string && br == strlen (repl)) { repl_bytes = bw; } else { repl_bytes = 0; if (repl_string) { g_free (repl_string); } } while (cur < input_bytes) { gchar* os; int drop_byte = 0; /* Should we drop a byte? */ br = 0; os = g_convert_with_iconv (&input_string[cur], bytes_to_convert, giconv, &br, &bw, &error); debug_printf ("cur=%d, btc=%d, br=%d, bw=%d (b1=0x%02x)\n", cur, bytes_to_convert, br, bw, input_string[cur]); /* If the conversion was unsuccessful, usually it means that either the input byte doesn't belong to the from_codeset, or the code point doesn't belong to the to_codeset. */ if (error) { /* There could be a partial output -- the specs aren't clear about this. Better free it just in case. */ if (os) { g_free (os); } switch (error->code) { case G_CONVERT_ERROR_ILLEGAL_SEQUENCE: case G_CONVERT_ERROR_FAILED: case G_CONVERT_ERROR_PARTIAL_INPUT: debug_printf ("g_convert_with_iconv returned error: %d (%s)\n", error->code, error->message); break; case G_CONVERT_ERROR_NO_CONVERSION: default: /* This shouldn't happen, as GNU inconv guarantees conversion to/from UTF-8. */ debug_printf ("g_convert_with_iconv returned error: %d (%s)\n", error->code, error->message); g_error_free (error); g_free (repl_string); return; } /* How many bytes to try next time? */ switch (bytes_to_convert) { case 4: case 3: case 2: bytes_to_convert --; break; case 1: /* Crapped out. Drop current byte, and add "?" to string. */ drop_byte = 1; break; default: /* Best guess based on br value returned from iconv */ if (br < bytes_to_convert && br > 0) { bytes_to_convert = br; } else { bytes_to_convert = 4; } } g_error_free (error); error = 0; } else { if (br == 0) { /* glib 2.16.5 (and probably other versions) doesn't properly return G_CONVERT_ERROR_PARTIAL_INPUT with partially translated characters. We'll detect this condition when there is no error, but br is 0. */ drop_byte = 1; } else { /* A successful conversion. */ debug_printf ("Successful conversion: %d bytes read\n", br); gmem_concat (output_string, *output_bytes, os, bw); g_free (os); cur += br; bytes_to_convert = input_bytes - cur; *output_bytes += bw; need_repl = 1; } } /* drop_byte will be true if a conversion failure happened. Drop current byte from input, and append replacement character into output. But only append a single replacement character for each group of dropped bytes. */ if (drop_byte) { cur ++; bytes_to_convert = input_bytes - cur; if (need_repl) { gmem_concat (output_string, *output_bytes, repl, repl_bytes); *output_bytes += repl_bytes; need_repl = 0; } } } g_free (repl_string); g_iconv_close (giconv); debug_printf ("convert_string_with_replacement |%s| -> |%s| (%s -> %s)\n", input_string, *output_string, from_codeset, to_codeset); return; } /* Assumes src is valid utf8 */ int utf8cpy (gchar* dst, gchar* src, int dst_len) { gchar *s = src; gchar *d = dst; gunichar c; gint dlen = 0; gint clen; while (dst_len > 6) { c = g_utf8_get_char(s); if (!c) break; clen = g_unichar_to_utf8 (c, d); d += clen; dlen += clen; dst_len -= clen; s = g_utf8_next_char (s); } *d = 0; return dlen; } void lstring_from_lstring (Lstring* lstring_out,/* Output: Output string */ Lstring* lstring_in, /* Input: Input string */ char* from_codeset, /* Input: Codeset of input string */ char* to_codeset) /* Input: Codeset of output string */ { convert_string_with_replacement (&lstring_out->data, &lstring_out->num_bytes, lstring_in->data, lstring_out->num_bytes, from_codeset, to_codeset, "?"); } void lstring_from_gstring (Lstring* lstring_out,/* Output: Output string */ gchar* gstring_in, /* Input: Input string */ char* to_codeset) /* Input: Codeset of output string */ { convert_string_with_replacement (&lstring_out->data, &lstring_out->num_bytes, gstring_in, strlen (gstring_in) + 1, "UTF-8", to_codeset, "?"); } /* Input value mlen is measured in mchar, not bytes. Return value is the number of mchar occupied by the converted string, not including the null character. For GLIB UTF8, it makes more sense to return the dynamically allocated string, and pass in the codeset string itself rather than rmi & codeset type. GLIB UTF8 returns number of bytes. */ int gstring_from_string (RIP_MANAGER_INFO* rmi, mchar* m, int mlen, char* c, int codeset_type) { CODESET_OPTIONS* mchar_cs = &rmi->mchar_cs; if (mlen < 0) return 0; *m = 0; if (!c) return 0; { gchar* gstring; gsize gstring_len; char* src_codeset; int rc; switch (codeset_type) { case CODESET_UTF8: src_codeset = "UTF-8"; break; case CODESET_LOCALE: src_codeset = mchar_cs->codeset_locale; break; case CODESET_FILESYS: src_codeset = mchar_cs->codeset_filesys; break; case CODESET_ID3: src_codeset = mchar_cs->codeset_id3; break; case CODESET_METADATA: src_codeset = mchar_cs->codeset_metadata; break; case CODESET_RELAY: src_codeset = mchar_cs->codeset_relay; break; default: printf ("Program error. Bad codeset m->c (%d)\n", codeset_type); exit (-1); } /* GCS FIX: This is not correct, as strlen(c) won't work for UTF-16. */ convert_string_with_replacement (&gstring, &gstring_len, c, strlen(c) + 1, src_codeset, "UTF-8", "?"); if (!gstring) { debug_printf ("Error converting gstring_from_string\n"); return 0; } rc = utf8cpy (m, gstring, mlen); g_free (gstring); return rc; } } /* Return value is the number of char occupied by the converted string, not including the null character. */ int string_from_gstring (RIP_MANAGER_INFO* rmi, char* c, int clen, mchar* m, int codeset_type) { CODESET_OPTIONS* mchar_cs = &rmi->mchar_cs; if (clen <= 0) return 0; *c = 0; if (!m) return 0; { gchar* cstring; gsize cstring_len; char* tgt_codeset; switch (codeset_type) { case CODESET_UTF8: tgt_codeset = "UTF-8"; break; case CODESET_LOCALE: tgt_codeset = mchar_cs->codeset_locale; break; case CODESET_FILESYS: tgt_codeset = mchar_cs->codeset_filesys; break; case CODESET_ID3: tgt_codeset = mchar_cs->codeset_id3; break; case CODESET_METADATA: tgt_codeset = mchar_cs->codeset_metadata; break; case CODESET_RELAY: tgt_codeset = mchar_cs->codeset_relay; break; default: printf ("Program error. Bad codeset m->c (%d)\n", codeset_type); exit (-1); } /* This is the new method */ convert_string_with_replacement (&cstring, &cstring_len, m, strlen(m) + 1, "UTF-8", tgt_codeset, "?"); if (!cstring) { debug_printf ("Error converting string_from_gstring\n"); return 0; } /* GCS FIX: truncation can chop multibyte string */ /* This will be fixed by using dynamic memory here... */ if (cstring_len >= clen) { cstring_len = clen - 1; } memcpy (c, cstring, cstring_len); /* GCS FIX: If converting to UTF-16, need to add 00 to end */ c[cstring_len] = 0; g_free (cstring); return cstring_len; } } const char* default_codeset (void) { const char* fromcode = 0; #if defined HAVE_LOCALE_CHARSET debug_printf ("Using locale_charset() to get system codeset.\n"); fromcode = locale_charset (); #elif defined HAVE_LANGINFO_CODESET debug_printf ("Using nl_langinfo() to get system codeset.\n"); fromcode = nl_langinfo (CODESET); #else debug_printf ("No way to get system codeset.\n"); #endif if (!fromcode || !fromcode[0]) { debug_printf ("No default codeset, using ISO-8859-1.\n"); fromcode = "ISO-8859-1"; } else { debug_printf ("Found default codeset %s\n", fromcode); } #if defined (WIN32) { /* This is just for debugging */ LCID lcid; lcid = GetSystemDefaultLCID (); debug_printf ("SystemDefaultLCID: %04x\n", lcid); lcid = GetUserDefaultLCID (); debug_printf ("UserDefaultLCID: %04x\n", lcid); } #endif // #if defined HAVE_ICONV // debug_printf ("Have iconv.\n"); // #else // debug_printf ("No iconv.\n"); // #endif return fromcode; } void sr_set_locale (void) { setlocale (LC_ALL, ""); setlocale (LC_CTYPE, ""); debug_printf ("LOCALE is %s\n",setlocale(LC_ALL,NULL)); } void set_codesets_default (CODESET_OPTIONS* cs_opt) { const char* fromcode = 0; /* Set default codesets */ fromcode = default_codeset (); if (fromcode) { strncpy (cs_opt->codeset_locale, fromcode, MAX_CODESET_STRING); strncpy (cs_opt->codeset_filesys, fromcode, MAX_CODESET_STRING); strncpy (cs_opt->codeset_metadata, fromcode, MAX_CODESET_STRING); strncpy (cs_opt->codeset_relay, fromcode, MAX_CODESET_STRING); } /* Always use UTF-16 for id3 */ strncpy (cs_opt->codeset_id3, "UTF-16", MAX_CODESET_STRING); /* Don't use UTF-8 for metadata */ if (!strcmp (fromcode, "UTF-8")) { strncpy (cs_opt->codeset_metadata, "ISO-8859-1", MAX_CODESET_STRING); strncpy (cs_opt->codeset_relay, "ISO-8859-1", MAX_CODESET_STRING); } } void register_codesets (RIP_MANAGER_INFO* rmi, CODESET_OPTIONS* cs_opt) { CODESET_OPTIONS* mchar_cs = &rmi->mchar_cs; /* For ID3, force UCS-2, UCS-2LE, UCS-2BE, UTF-16LE, and UTF-16BE to be UTF-16. This way, we get the BOM like we need. This might change if we upgrade to id3v2.4, which allows UTF-8 and UTF-16 without BOM. */ if (!strncmp (cs_opt->codeset_id3, "UCS-2", strlen("UCS-2")) || !strncmp (cs_opt->codeset_id3, "UTF-16", strlen("UTF-16"))) { strcpy (cs_opt->codeset_id3, "UTF-16"); } strcpy (mchar_cs->codeset_locale, cs_opt->codeset_locale); strcpy (mchar_cs->codeset_filesys, cs_opt->codeset_filesys); strcpy (mchar_cs->codeset_id3, cs_opt->codeset_id3); strcpy (mchar_cs->codeset_metadata, cs_opt->codeset_metadata); strcpy (mchar_cs->codeset_relay, cs_opt->codeset_relay); debug_printf ("Locale codeset: %s\n", mchar_cs->codeset_locale); debug_printf ("Filesys codeset: %s\n", mchar_cs->codeset_filesys); debug_printf ("ID3 codeset: %s\n", mchar_cs->codeset_id3); debug_printf ("Metadata codeset: %s\n", mchar_cs->codeset_metadata); debug_printf ("Relay codeset: %s\n", mchar_cs->codeset_relay); } /* This is used to set the codeset byte for id3v2 frames */ int is_id3_unicode (RIP_MANAGER_INFO* rmi) { CODESET_OPTIONS* mchar_cs = &rmi->mchar_cs; if (!strcmp ("UTF-16", mchar_cs->codeset_id3)) { return 1; } return 0; } void mstrncpy (mchar* dst, mchar* src, int n) { int i = 0; for (i = 0; i < n-1; i++) { if (!(dst[i] = src[i])) { return; } } dst[i] = 0; } mchar* mstrdup (mchar* src) { return strdup (src); } mchar* mstrcpy (mchar* dest, const mchar* src) { return strcpy (dest, src); } size_t mstrlen (mchar* s) { return strlen (s); } /* GCS FIX: gcc can give a warning about vswprintf. This may require setting gcc -std=c99, or gcc -lang-c99 */ int msnprintf (mchar* dest, size_t n, const mchar* fmt, ...) { int rc; va_list ap; va_start (ap, fmt); rc = vsnprintf (dest, n, fmt, ap); va_end (ap); return rc; } mchar* mstrchr (const mchar* ws, mchar wc) { return g_utf8_strchr (ws, -1, g_utf8_get_char(&wc)); } mchar* mstrrchr (const mchar* ws, mchar wc) { return g_utf8_strrchr (ws, -1, g_utf8_get_char(&wc)); } mchar* mstrncat (mchar* ws1, const mchar* ws2, size_t n) { return strncat (ws1, ws2, n); } int mstrcmp (const mchar* ws1, const mchar* ws2) { return strcmp (ws1, ws2); } long int mtol (const mchar* string) { return strtol (string, 0, 0); } streamripper-1.64.6.orig/lib/socklib.h0000644000175000017500000000132311120643412015672 0ustar abiabi#ifndef __socklib_h__ #define __socklib_h__ #include "srtypes.h" #include "rip_manager.h" #ifndef INADDR_NONE #define INADDR_NONE (-1) #endif error_code socklib_init (); error_code socklib_open (HSOCKET *socket_handle, char *host, int port, char *if_name, int timeout); void socklib_close (HSOCKET *socket_handle); void socklib_cleanup (); error_code socklib_read_header(RIP_MANAGER_INFO* rmi, HSOCKET *socket_handle, char *buffer, int size); error_code socklib_recvall (RIP_MANAGER_INFO* rmi, HSOCKET *socket_handle, char* buffer, int size, int timeout); int socklib_sendall (HSOCKET *socket_handle, char* buffer, int size); error_code read_interface (char *if_name, uint32_t *addr); #endif //__socklib_h__ streamripper-1.64.6.orig/lib/socklib.c0000644000175000017500000002060411125436147015702 0ustar abiabi/* socklib.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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #if WIN32 #include #else #include #include #include #include #include #include #include #include #include #include #endif #if __UNIX__ #include #elif __BEOS__ #include #endif #include "srtypes.h" #include "socklib.h" #include "threadlib.h" #include "compat.h" #include "debug.h" #if WIN32 #define DEFAULT_TIMEOUT (15 * 1000) #define FIRST_READ_TIMEOUT (30 * 1000) #endif /**************************************************************************** * Function definitions ****************************************************************************/ error_code socklib_init() { #if WIN32 WORD wVersionRequested; WSADATA wsaData; int err; wVersionRequested = MAKEWORD( 2, 2 ); err = WSAStartup( wVersionRequested, &wsaData ); if ( err != 0 ) return SR_ERROR_WIN32_INIT_FAILURE; #endif return SR_SUCCESS; } /* Try to find the local interface to bind to */ error_code read_interface (char *if_name, uint32_t *addr) { #if defined (WIN32) return -1; #else int fd; struct ifreq ifr; memset(&ifr, 0, sizeof(struct ifreq)); if((fd = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) { ifr.ifr_addr.sa_family = AF_INET; strcpy(ifr.ifr_name, if_name); if (ioctl(fd, SIOCGIFADDR, &ifr) == 0) *addr = ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr; else { close(fd); return -2; } } else return -1; close(fd); return 0; #endif } /* * open's a tcp connection to host at port, host can be a dns name or IP, * socket_handle gets assigned to the handle for the connection */ error_code socklib_open (HSOCKET *socket_handle, char *host, int port, char *if_name, int timeout) { int rc; struct sockaddr_in address, local; struct hostent *hp; int len; if (!socket_handle || !host) return SR_ERROR_INVALID_PARAM; /* On error: Unix returns -1 and sets errno. Windows??? */ socket_handle->s = socket(AF_INET, SOCK_STREAM, 0); if (socket_handle->s == SOCKET_ERROR) { debug_printf ("socket() failed\n"); WSACleanup (); return SR_ERROR_CANT_CREATE_SOCKET; } if (if_name) { if (read_interface (if_name, &local.sin_addr.s_addr) != 0) local.sin_addr.s_addr = htonl(INADDR_ANY); local.sin_family = AF_INET; local.sin_port = htons(0); /* On error: Unix returns -1 and sets errno. Windows??? */ debug_printf ("Calling bind\n"); if (bind(socket_handle->s, (struct sockaddr *)&local, sizeof(local)) == SOCKET_ERROR) { debug_printf ("Bind failed\n"); WSACleanup (); closesocket (socket_handle->s); return SR_ERROR_CANT_BIND_ON_INTERFACE; } } if ((address.sin_addr.s_addr = inet_addr(host)) == INADDR_NONE) { debug_printf ("Calling gethostbyname\n"); hp = gethostbyname (host); if (hp) { memcpy (&address.sin_addr, hp->h_addr_list[0], hp->h_length); } else { debug_printf ("resolving hostname: %s failed\n", host); WSACleanup (); /* GCS Added... */ closesocket (socket_handle->s); return SR_ERROR_CANT_RESOLVE_HOSTNAME; } } address.sin_family = AF_INET; address.sin_port = htons((unsigned short)port); len = sizeof(address); debug_printf ("Calling connect\n"); rc = connect (socket_handle->s, (struct sockaddr *)&address, len); debug_printf ("Connect complete\n"); if (rc == SOCKET_ERROR) { debug_printf ("connect failed\n"); /* GCS Added... */ WSACleanup (); closesocket (socket_handle->s); return SR_ERROR_CONNECT_FAILED; } #ifdef WIN32 { struct timeval tv = {timeout, 0}; rc = setsockopt (socket_handle->s, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval)); if (rc == SOCKET_ERROR) { debug_printf ("setsockopt failed\n"); /* GCS Added... */ WSACleanup (); closesocket (socket_handle->s); return SR_ERROR_CANT_SET_SOCKET_OPTIONS; } } #endif socket_handle->closed = FALSE; return SR_SUCCESS; } void socklib_cleanup() { WSACleanup(); } void socklib_close(HSOCKET *socket_handle) { closesocket(socket_handle->s); socket_handle->closed = TRUE; } error_code socklib_read_header(RIP_MANAGER_INFO* rmi, HSOCKET *socket_handle, char *buffer, int size) { int i; #ifdef WIN32 int timeout; #endif int ret; char *t; if (socket_handle->closed) return SR_ERROR_SOCKET_CLOSED; #ifdef WIN32 timeout = 2 * rmi->prefs->timeout * 1000; /* Convert sec to msec */ if (setsockopt (socket_handle->s, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(int)) == SOCKET_ERROR) return SR_ERROR_CANT_SET_SOCKET_OPTIONS; #endif memset(buffer, 0, size); for (i = 0; i < size; i++) { ret = socklib_recvall (rmi, socket_handle, &buffer[i], 1, 0); if (ret < 0) { return ret; } if (ret == 0) { debug_printf("http header:\n%s\n", buffer); return SR_ERROR_NO_HTTP_HEADER; } if (socket_handle->closed) return SR_ERROR_SOCKET_CLOSED; #if defined (commentout) /* This is too restrictive. Some servers do not send this. */ if (!strstr(buffer, "icy-") && !strstr(buffer,"ice-")) continue; #endif t = buffer + (i > 3 ? i - 3: i); if (strncmp(t, "\r\n\r\n", 4) == 0) break; /* Allegedly live365 used to do this */ if (strncmp(t, "\n\0\r\n", 4) == 0) break; } if (i == size) { debug_printf("http header:\n%s\n", buffer); return SR_ERROR_NO_HTTP_HEADER; } buffer[i] = '\0'; #ifdef WIN32 timeout = rmi->prefs->timeout * 1000; /* Convert sec to msec */ if (setsockopt (socket_handle->s, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(timeout)) == SOCKET_ERROR) return SR_ERROR_CANT_SET_SOCKET_OPTIONS; #endif return SR_SUCCESS; } error_code socklib_recvall (RIP_MANAGER_INFO* rmi, HSOCKET *socket_handle, char* buffer, int size, int timeout) { int ret = 0, read = 0; int sock; fd_set fds; struct timeval tv; sock = socket_handle->s; FD_ZERO(&fds); while(size) { if (socket_handle->closed) return SR_ERROR_SOCKET_CLOSED; if (timeout > 0) { /* Wait up to 'timeout' seconds for data on socket to be ready for read */ #if __UNIX__ FD_SET(rmi->abort_pipe[0], &fds); #endif FD_SET(sock, &fds); tv.tv_sec = timeout; tv.tv_usec = 0; ret = select (sock + 1, &fds, NULL, NULL, &tv); if (ret == SOCKET_ERROR) { /* This happens when I kill winamp while ripping */ return SR_ERROR_SELECT_FAILED; } if (ret == 0) { return SR_ERROR_TIMEOUT; } } #if __UNIX__ if (FD_ISSET(rmi->abort_pipe[0], &fds)) { debug_printf ("socklib_recvall detected write to abort pipe.\n"); return SR_ERROR_ABORT_PIPE_SIGNALLED; } #endif ret = recv(socket_handle->s, &buffer[read], size, 0); debug_printf ("RECV req %5d bytes, got %5d bytes\n", size, ret); if (ret == SOCKET_ERROR) { debug_printf ("RECV failed, errno = %d\n", errno); debug_printf ("Err = %s\n",strerror(errno)); return SR_ERROR_RECV_FAILED; } /* Got zero bytes on blocking read. For unix this is an orderly shutdown. */ if (ret == 0) { debug_printf ("recv received zero bytes!\n"); break; } read += ret; size -= ret; } return read; } int socklib_sendall (HSOCKET *socket_handle, char* buffer, int size) { int ret = 0, sent = 0; while(size) { if (socket_handle->closed) return SR_ERROR_SOCKET_CLOSED; ret = send(socket_handle->s, &buffer[sent], size, 0); if (ret == SOCKET_ERROR) return SR_ERROR_SEND_FAILED; if (ret == 0) break; sent += ret; size -= ret; } return sent; } streamripper-1.64.6.orig/lib/charmaps.h0000644000175000017500000000477710405100636016063 0ustar abiabi /* * If you need to generate more maps, use makemap.c on a system * with a decent iconv. */ static const unsigned short mapping_iso_8859_2[256] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7, 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b, 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7, 0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c, 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9 }; static struct { const char *name; const unsigned short *map; struct charset *charset; } maps[] = { { "ISO-8859-2", mapping_iso_8859_2, 0 }, { 0, 0, 0 } }; static const struct { const char *bad; const char *good; } names[] = { { "ANSI_X3.4-1968", "us-ascii" }, { 0, 0 } }; streamripper-1.64.6.orig/lib/ripaac.c0000644000175000017500000002011310566424070015506 0ustar abiabi/* ripaac.c * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * This file is adapted from faad.c of the ffmpeg project. * Copyright (c) 2003 Zdenek Kabelac. * Copyright (c) 2004 Thomas Raivio. */ #include "srconfig.h" #if defined (HAVE_FAAD) #if defined (commentout) #include "faad.h" typedef struct { void* handle; /* dlopen handle */ void* faac_handle; /* FAAD library handle */ int sample_size; int init; /* faad calls */ faacDecHandle (*faacDecOpen)(void); faacDecConfigurationPtr (*faacDecGetCurrentConfiguration)(faacDecHandle hDecoder); void (*faacDecClose)(faacDecHandle hDecoder); } FAACContext; static const unsigned long faac_srates[] = { 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000 }; static int faac_init_mp4 (AVCodecContext *avctx) { FAACContext *s = (FAACContext *) avctx->priv_data; unsigned long samplerate; #ifndef FAAD2_VERSION unsigned long channels; #else unsigned char channels; #endif int r = 0; if (avctx->extradata){ r = s->faacDecInit2(s->faac_handle, (uint8_t*) avctx->extradata, avctx->extradata_size, &samplerate, &channels); if (r < 0){ av_log(avctx, AV_LOG_ERROR, "faacDecInit2 failed r:%d sr:%ld ch:%ld s:%d\n", r, samplerate, (long)channels, avctx->extradata_size); } else { avctx->sample_rate = samplerate; avctx->channels = channels; s->init = 1; } } return r; } static int faac_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) { FAACContext *s = (FAACContext *) avctx->priv_data; #ifndef FAAD2_VERSION unsigned long bytesconsumed; short *sample_buffer = NULL; unsigned long samples; int out; #else faacDecFrameInfo frame_info; void *out; #endif if(buf_size == 0) return 0; #ifndef FAAD2_VERSION out = s->faacDecDecode(s->faac_handle, (unsigned char*)buf, &bytesconsumed, data, &samples); samples *= s->sample_size; if (data_size) *data_size = samples; return (buf_size < (int)bytesconsumed) ? buf_size : (int)bytesconsumed; #else if(!s->init){ unsigned long srate; unsigned char channels; int r = s->faacDecInit(s->faac_handle, buf, buf_size, &srate, &channels); if(r < 0){ av_log(avctx, AV_LOG_ERROR, "faac: codec init failed: %s\n", s->faacDecGetErrorMessage(frame_info.error)); return -1; } avctx->sample_rate = srate; avctx->channels = channels; s->init = 1; } out = s->faacDecDecode(s->faac_handle, &frame_info, (unsigned char*)buf, (unsigned long)buf_size); if (frame_info.error > 0) { av_log(avctx, AV_LOG_ERROR, "faac: frame decoding failed: %s\n", s->faacDecGetErrorMessage(frame_info.error)); return -1; } frame_info.samples *= s->sample_size; memcpy(data, out, frame_info.samples); // CHECKME - can we cheat this one if (data_size) *data_size = frame_info.samples; return (buf_size < (int)frame_info.bytesconsumed) ? buf_size : (int)frame_info.bytesconsumed; #endif } static int faac_decode_end(AVCodecContext *avctx) { FAACContext *s = (FAACContext *) avctx->priv_data; if (s->faacDecClose) s->faacDecClose(s->faac_handle); dlclose(s->handle); return 0; } static int faac_decode_init(AVCodecContext *avctx) { FAACContext *s = (FAACContext *) avctx->priv_data; faacDecConfigurationPtr faac_cfg; #ifdef CONFIG_FAADBIN const char* err = 0; s->handle = dlopen(libfaadname, RTLD_LAZY); if (!s->handle) { av_log(avctx, AV_LOG_ERROR, "FAAD library: %s could not be opened! \n%s\n", libfaadname, dlerror()); return -1; } #define dfaac(a, b) \ do { static const char* n = "faacDec" #a; \ if ((s->faacDec ## a = b dlsym( s->handle, n )) == NULL) { err = n; break; } } while(0) for(;;) { #else /* !CONFIG_FAADBIN */ #define dfaac(a, b) s->faacDec ## a = faacDec ## a #endif /* CONFIG_FAADBIN */ // resolve all needed function calls dfaac(Open, (faacDecHandle FAADAPI (*)(void))); dfaac(GetCurrentConfiguration, (faacDecConfigurationPtr FAADAPI (*)(faacDecHandle))); #ifndef FAAD2_VERSION dfaac(SetConfiguration, (int FAADAPI (*)(faacDecHandle, faacDecConfigurationPtr))); dfaac(Init, (int FAADAPI (*)(faacDecHandle, unsigned char*, unsigned long*, unsigned long*))); dfaac(Init2, (int FAADAPI (*)(faacDecHandle, unsigned char*, unsigned long, unsigned long*, unsigned long*))); dfaac(Close, (void FAADAPI (*)(faacDecHandle hDecoder))); dfaac(Decode, (int FAADAPI (*)(faacDecHandle, unsigned char*, unsigned long*, short*, unsigned long*))); #else dfaac(SetConfiguration, (unsigned char FAADAPI (*)(faacDecHandle, faacDecConfigurationPtr))); dfaac(Init, (long FAADAPI (*)(faacDecHandle, unsigned char*, unsigned long, unsigned long*, unsigned char*))); dfaac(Init2, (char FAADAPI (*)(faacDecHandle, unsigned char*, unsigned long, unsigned long*, unsigned char*))); dfaac(Decode, (void *FAADAPI (*)(faacDecHandle, faacDecFrameInfo*, unsigned char*, unsigned long))); dfaac(GetErrorMessage, (char* FAADAPI (*)(unsigned char))); #endif #undef dfacc #ifdef CONFIG_FAADBIN break; } if (err) { dlclose(s->handle); av_log(avctx, AV_LOG_ERROR, "FAAD library: cannot resolve %s in %s!\n", err, libfaadname); return -1; } #endif s->faac_handle = s->faacDecOpen(); if (!s->faac_handle) { av_log(avctx, AV_LOG_ERROR, "FAAD library: cannot create handler!\n"); faac_decode_end(avctx); return -1; } faac_cfg = s->faacDecGetCurrentConfiguration(s->faac_handle); if (faac_cfg) { switch (avctx->bits_per_sample) { case 8: av_log(avctx, AV_LOG_ERROR, "FAADlib unsupported bps %d\n", avctx->bits_per_sample); break; default: case 16: #ifdef FAAD2_VERSION faac_cfg->outputFormat = FAAD_FMT_16BIT; #endif s->sample_size = 2; break; case 24: #ifdef FAAD2_VERSION faac_cfg->outputFormat = FAAD_FMT_24BIT; #endif s->sample_size = 3; break; case 32: #ifdef FAAD2_VERSION faac_cfg->outputFormat = FAAD_FMT_32BIT; #endif s->sample_size = 4; break; } faac_cfg->defSampleRate = (!avctx->sample_rate) ? 44100 : avctx->sample_rate; faac_cfg->defObjectType = LC; } s->faacDecSetConfiguration(s->faac_handle, faac_cfg); faac_init_mp4(avctx); return 0; } #endif /* commentout */ #endif /* HAVE_FAAD */ streamripper-1.64.6.orig/lib/external.c0000644000175000017500000002273611164244622016104 0ustar abiabi/* external.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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #if defined (WIN32) #include #include #else #include #include #endif #include #include #include #include #include #include "debug.h" #include "mchar.h" #include "external.h" #include "compat.h" /* Unix: http://www.cs.uleth.ca/~holzmann/C/system/pipeforkexec.html http://www.ecst.csuchico.edu/~beej/guide/ipc/fork.html */ /* Win32: Non-blocking pipe using PeekNamedPipe(): http://list-archive.xemacs.org/xemacs-beta/199910/msg00263.html Using GenerateConsoleCtrlEvent(): http://www.byte.com/art/9410/sec14/art3.htm */ /* ----------------------------- SHARED FUNCTIONS ------------------------ */ External_Process* alloc_ep (void) { External_Process* ep; ep = (External_Process*) malloc (sizeof (External_Process)); if (!ep) return 0; ep->line_buf[0] = 0; ep->line_buf_idx = 0; ep->album_buf[0] = 0; ep->artist_buf[0] = 0; ep->title_buf[0] = 0; return ep; } static int parse_external_byte (RIP_MANAGER_INFO* rmi, External_Process* ep, TRACK_INFO* ti, char c) { int got_metadata = 0; if (c != '\r' && c != '\n') { if (ep->line_buf_idx < MAX_EXT_LINE_LEN-1) { ep->line_buf[ep->line_buf_idx++] = c; ep->line_buf[ep->line_buf_idx] = 0; } } else { if (!strcmp (".",ep->line_buf)) { /* Found end of record! */ mchar tmp_raw_metadata[MAX_TRACK_LEN]; gstring_from_string (rmi, ti->artist, MAX_TRACK_LEN, ep->artist_buf, CODESET_METADATA); gstring_from_string (rmi, ti->album, MAX_TRACK_LEN, ep->album_buf, CODESET_METADATA); gstring_from_string (rmi, ti->title, MAX_TRACK_LEN, ep->title_buf, CODESET_METADATA); g_snprintf (tmp_raw_metadata, MAX_TRACK_LEN, "%s - %s", ti->artist, ti->title); string_from_gstring (rmi, ti->raw_metadata, MAX_TRACK_LEN, tmp_raw_metadata, CODESET_METADATA); ti->have_track_info = 1; ti->save_track = TRUE; ep->artist_buf[0] = 0; ep->album_buf[0] = 0; ep->title_buf[0] = 0; got_metadata = 1; } else if (!strncmp ("ARTIST=", ep->line_buf, strlen("ARTIST="))) { strcpy (ep->artist_buf, &ep->line_buf[strlen("ARTIST=")]); } else if (!strncmp ("ALBUM=", ep->line_buf, strlen("ALBUM="))) { strcpy (ep->album_buf, &ep->line_buf[strlen("ALBUM=")]); } else if (!strncmp ("TITLE=", ep->line_buf, strlen("TITLE="))) { strcpy (ep->title_buf, &ep->line_buf[strlen("TITLE=")]); } ep->line_buf[0] = 0; ep->line_buf_idx = 0; } return got_metadata; } /* ----------------------------- WIN32 FUNCTIONS ------------------------- */ #if defined (WIN32) External_Process* spawn_external (char* cmd) { External_Process* ep; HANDLE hChildStdinRd; HANDLE hChildStdinWr; HANDLE hChildStdoutWr; SECURITY_ATTRIBUTES saAttr; PROCESS_INFORMATION piProcInfo; STARTUPINFO startup_info; BOOL rc; DWORD creation_flags; ep = alloc_ep (); if (!ep) return 0; /* Set the bInheritHandle flag so pipe handles are inherited. */ saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); saAttr.bInheritHandle = TRUE; saAttr.lpSecurityDescriptor = NULL; /* Create a pipe for the child process's STDOUT. */ if (!CreatePipe (&ep->mypipe, &hChildStdoutWr, &saAttr, 0)) { debug_printf ("Stdout pipe creation failed\n"); free (ep); return 0; } /* Ensure the read handle to the pipe for STDOUT is not inherited.*/ SetHandleInformation (ep->mypipe, HANDLE_FLAG_INHERIT, 0); /* Create a pipe for the child process's STDIN. */ if (!CreatePipe (&hChildStdinRd, &hChildStdinWr, &saAttr, 0)) { debug_printf ("Stdin pipe creation failed\n"); free (ep); return 0; } /* Ensure the write handle to the pipe for STDIN is not inherited. */ SetHandleInformation (hChildStdinWr, HANDLE_FLAG_INHERIT, 0); /* create the child process */ ZeroMemory (&piProcInfo, sizeof(PROCESS_INFORMATION)); ZeroMemory (&startup_info, sizeof(STARTUPINFO)); startup_info.cb = sizeof(STARTUPINFO); startup_info.hStdError = hChildStdoutWr; startup_info.hStdOutput = hChildStdoutWr; startup_info.hStdInput = hChildStdinRd; startup_info.dwFlags |= STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; //startup_info.wShowWindow = SW_SHOW; startup_info.wShowWindow = SW_HIDE; creation_flags = 0; creation_flags |= CREATE_NEW_PROCESS_GROUP; //creation_flags |= CREATE_NEW_CONSOLE; rc = CreateProcess ( NULL, // executable name cmd, // command line NULL, // process security attributes NULL, // primary thread security attributes TRUE, // handles are inherited creation_flags, // creation flags NULL, // use parent's environment NULL, // use parent's current directory &startup_info, // STARTUPINFO pointer &piProcInfo); // receives PROCESS_INFORMATION if (rc == 0) { debug_printf ("CreateProcess() failed\n"); free (ep); return 0; } ep->hproc = piProcInfo.hProcess; ep->pid = piProcInfo.dwProcessId; //CloseHandle (piProcInfo.hProcess); CloseHandle (piProcInfo.hThread); Sleep (0); return ep; } int read_external (RIP_MANAGER_INFO* rmi, External_Process* ep, TRACK_INFO* ti) { char c; int rc; int got_metadata = 0; DWORD num_read; ti->have_track_info = 0; Sleep (0); while (1) { DWORD bytes_avail = 0; rc = PeekNamedPipe (ep->mypipe, NULL, 0, NULL, &bytes_avail, NULL); if (!rc) { DWORD error_code; /* Pipe closed? */ /* GCS FIX: Restart external program if pipe closed */ error_code = GetLastError (); debug_printf ("PeekNamedPipe failed, error_code = %d\n", error_code); return 0; } if (bytes_avail <= 0) { /* Pipe blocked */ return got_metadata; } /* Pipe has data available, so read it */ rc = ReadFile (ep->mypipe, &c, 1, &num_read, NULL); if (rc > 0 && num_read > 0) { int got_meta_byte; got_meta_byte = parse_external_byte (rmi, ep, ti, c); if (got_meta_byte) { got_metadata = 1; } } } } void close_external (External_Process** epp) { External_Process* ep = *epp; BOOL rc; rc = GenerateConsoleCtrlEvent (CTRL_C_EVENT, ep->pid); if (!rc) { /* The console control event will fail for the winamp plugin. Therefore, no choice but to kill the process using TerminateProcess()... */ debug_print_error (); debug_printf ("rc = %d, gle = %d\n", rc, GetLastError()); rc = TerminateProcess (ep->hproc, 0); debug_printf ("Terminated process: %d\n", rc); } CloseHandle (ep->hproc); free (ep); *epp = 0; } /* ----------------------------- UNIX FUNCTIONS -------------------------- */ #else /* These functions are in either libiberty, or included in argv.c */ char** buildargv (char *sp); External_Process* spawn_external (char* cmd) { External_Process* ep; int rc; ep = alloc_ep (); if (!ep) return 0; /* Create the pipes */ rc = pipe (ep->mypipe); if (rc) { fprintf (stderr, "Can't open pipes\n"); free (ep); return 0; } /* Create the child process. */ ep->pid = fork (); if (ep->pid == (pid_t) 0) { /* This is the child process. */ int i = 0; char** argv; close (ep->mypipe[0]); dup2 (ep->mypipe[1],1); close (ep->mypipe[1]); argv = buildargv (cmd); while (argv[i]) { debug_printf ("argv[%d] = %s\n", i, argv[i]); i++; } execvp (argv[0],&argv[0]); /* Doesn't return */ fprintf (stderr, "Error, returned from execlp\n"); exit (-1); } else if (ep->pid < (pid_t) 0) { /* The fork failed. */ close (ep->mypipe[0]); close (ep->mypipe[1]); fprintf (stderr, "Fork failed.\n"); free (ep); return 0; } else { /* This is the parent process. */ close (ep->mypipe[1]); rc = fcntl (ep->mypipe[0], F_SETFL, O_NONBLOCK); return ep; } } int read_external (RIP_MANAGER_INFO* rmi, External_Process* ep, TRACK_INFO* ti) { char c; int rc; int got_metadata = 0; ti->have_track_info = 0; while (1) { rc = read (ep->mypipe[0],&c,1); if (rc > 0) { int got_meta_byte; got_meta_byte = parse_external_byte (rmi, ep, ti, c); if (got_meta_byte) { got_metadata = 1; } } else if (rc == 0) { /* Pipe closed */ /* GCS FIX: Restart external program if pipe closed */ return 0; } else { if (errno == EAGAIN) { /* Would block */ return got_metadata; } /* GCS FIX: Figure out the error here. */ return 0; } } } void close_external (External_Process** epp) { int rv; External_Process* ep = *epp; printf ("I should be exiting soon...\n"); kill (ep->pid,SIGTERM); usleep (0); if (waitpid (ep->pid,&rv,WNOHANG) == 0) { printf ("Waiting for cleanup\n"); usleep (2000); kill (ep->pid,SIGKILL); } wait(&rv); free (ep); *epp = 0; } #endif streamripper-1.64.6.orig/lib/srconfig.h0000644000175000017500000000030710124453576016074 0ustar abiabi#ifndef __SRCONFIG_H__ #define __SRCONFIG_H__ #if defined (WIN32) #include "confw32.h" #elif defined (HAVE_CONFIG_H) #include "config.h" #else /* Do something */ #endif #endif /* __SRCONFIG_H__ */ streamripper-1.64.6.orig/lib/charset.h0000755000175000017500000000531510405100636015706 0ustar abiabi/* * Copyright (C) 2001 Edmund Grimley Evans * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include /* * These functions are like the C library's mbtowc() and wctomb(), * but instead of depending on the locale they always work in UTF-8, * and they use int instead of wchar_t. */ int utf8_mbtowc(int *pwc, const char *s, size_t n); int utf8_wctomb(char *s, int wc); /* * This is an object-oriented version of mbtowc() and wctomb(). * The caller first uses charset_find() to get a pointer to struct * charset, then uses the mbtowc() and wctomb() methods on it. * The function charset_max() gives the maximum length of a * multibyte character in that encoding. * This API is only appropriate for stateless encodings like UTF-8 * or ISO-8859-3, but I have no intention of implementing anything * other than UTF-8 and 8-bit encodings. * * MINOR BUG: If there is no memory charset_find() may return 0 and * there is no way to distinguish this case from an unknown encoding. */ struct charset; struct charset *charset_find(const char *code); int charset_mbtowc(struct charset *charset, int *pwc, const char *s, size_t n); int charset_wctomb(struct charset *charset, char *s, int wc); int charset_max(struct charset *charset); /* * Function to convert a buffer from one encoding to another. * Invalid bytes are replaced by '#', and characters that are * not available in the target encoding are replaced by '?'. * Each of TO and TOLEN may be zero if the result is not wanted. * The input or output may contain null bytes, but the output * buffer is also null-terminated, so it is all right to * use charset_convert(fromcode, tocode, s, strlen(s), &t, 0). * * Return value: * * -2 : memory allocation failed * -1 : unknown encoding * 0 : data was converted exactly * 1 : valid data was converted approximately (using '?') * 2 : input was invalid (but still converted, using '#') */ int charset_convert(const char *fromcode, const char *tocode, const char *from, size_t fromlen, char **to, size_t *tolen); streamripper-1.64.6.orig/lib/findsep2.c0000644000175000017500000003743211005145330015761 0ustar abiabi/* findsep.c * library routines for find silent points in mp3 data * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * * Portions are adapted from minimad.c, included with the * libmad library, distributed under the GNU General Public License. * Copyright (C) 2000-2004 Underbit Technologies, Inc. */ #include #include #include #include #include #include #include #include "mad.h" #include "findsep.h" #include "srtypes.h" #include "debug.h" #include "list.h" #define MAX_RMS_SILENCE 32767 //max short #define READSIZE 2000 // #define READSIZE 1000 /* Uncomment to dump an mp3 of the search window. */ // #define MAKE_DUMP_MP3 1 typedef struct FRAME_LIST_struct FRAME_LIST; struct FRAME_LIST_struct { const unsigned char* m_framepos; long m_samples; long m_pcmpos; LIST m_list; }; typedef struct MIN_POSst { unsigned short volume; unsigned long pos; } MIN_POS; typedef struct DECODE_STRUCTst { unsigned char* mpgbuf; long mpgsize; long mpgpos; long len_to_sw_ms; long searchwindow_ms; long silence_ms; long silence_samples; unsigned long len_to_sw_start_samp; unsigned long len_to_sw_end_samp; unsigned long pcmpos; long samplerate; short prev_sample; LIST frame_list; unsigned short* maxvolume_buffer; unsigned long maxvolume_buffer_offs; int maxvolume_buffer_depth; int max_search_depth; MIN_POS* min_maxvolume_buffer; } DECODE_STRUCT; typedef struct GET_BITRATE_STRUCTst { unsigned long bitrate; unsigned char* mpgbuf; long mpgsize; } GET_BITRATE_STRUCT; /***************************************************************************** * Public functions *****************************************************************************/ /***************************************************************************** * Private functions *****************************************************************************/ static void apply_padding (DECODE_STRUCT* ds, unsigned long silsplit, long padding1, long padding2, u_long* pos1, u_long* pos2); static void free_frame_list (DECODE_STRUCT* ds); static enum mad_flow input(void *data, struct mad_stream *ms); static void search_for_silence(DECODE_STRUCT *ds, unsigned short vol); static signed int scale(mad_fixed_t sample); static enum mad_flow output(void *data, struct mad_header const *header, struct mad_pcm *pcm); static enum mad_flow filter (void *data, struct mad_stream const *ms, struct mad_frame *frame); static enum mad_flow error(void *data, struct mad_stream *ms, struct mad_frame *frame); static enum mad_flow header(void *data, struct mad_header const *pheader); /***************************************************************************** * Private Vars *****************************************************************************/ /***************************************************************************** * Functions *****************************************************************************/ error_code findsep_silence_2 (const char* mpgbuf, long mpgsize, long len_to_sw, long searchwindow, long silence_length, long padding1, long padding2, u_long* pos1, u_long* pos2 ) { DECODE_STRUCT ds; struct mad_decoder decoder; int result; int bestsil; int i; double delta = 1; ds.mpgbuf = (unsigned char*)mpgbuf; ds.mpgsize = mpgsize; ds.pcmpos = 0; ds.mpgpos= 0; ds.samplerate = 0; ds.prev_sample = 0; ds.len_to_sw_ms = len_to_sw; ds.searchwindow_ms = searchwindow; ds.silence_ms = silence_length; ds.maxvolume_buffer = 0; ds.maxvolume_buffer_offs = 0; ds.maxvolume_buffer_depth = 0; ds.max_search_depth = 0; ds.min_maxvolume_buffer = 0; INIT_LIST_HEAD (&ds.frame_list); debug_printf ("FINDSEP 2: %p -> %p (%d)\n", mpgbuf, mpgbuf+mpgsize, mpgsize); #if defined (MAKE_DUMP_MP3) { FILE* fp = fopen("dump.mp3", "wb"); fwrite(mpgbuf, mpgsize, 1, fp); fclose(fp); } #endif /* Run decoder */ mad_decoder_init(&decoder, &ds, input /* input */, header/* header */, filter /* filter */, output /* output */, error /* error */, NULL /* message */); result = mad_decoder_run(&decoder, MAD_DECODER_MODE_SYNC); mad_decoder_finish(&decoder); debug_printf ("total length: %d\n", ds.pcmpos); debug_printf ("silence_length: %d ms\n", ds.silence_ms); debug_printf ("silence_samples: %d\n", ds.silence_samples); /* Search through siltrackers to find minimum volume point */ assert(ds.mpgsize != 0); /* Start with the highest silence-length */ bestsil = 0; for (i = 1; i <= ds.max_search_depth; ++i) { unsigned long current = ds.min_maxvolume_buffer[bestsil].volume; unsigned long candidate = ds.min_maxvolume_buffer[i].volume; delta *= 0.6; /* Only halve the silence-length if we can reduce the max-volume by at least 40 % by doing so. */ if (current * delta > candidate) { bestsil = i; delta = 1; } } debug_printf("Most silent region: depth %d, max-volume %d, pos %ld," "sample window %ld (%f ms)\n", bestsil, ds.min_maxvolume_buffer[bestsil].volume, ds.min_maxvolume_buffer[bestsil].pos, ds.silence_samples / (1 << bestsil), ds.silence_samples * 1000.0 / (double)(ds.samplerate * (1 << bestsil))); /* Now that we have the silence position, let's add the padding */ apply_padding (&ds, ds.min_maxvolume_buffer[bestsil].pos, padding1, padding2, pos1, pos2); /* Free the max volume buffers */ free (ds.maxvolume_buffer); free (ds.min_maxvolume_buffer); /* Free the list of frame info */ free_frame_list (&ds); return SR_SUCCESS; } static void apply_padding (DECODE_STRUCT* ds, unsigned long silsplit, long padding1, long padding2, u_long* pos1, u_long* pos2 ) { /* Compute positions in samples */ FRAME_LIST *pos; long pos1s, pos2s; pos1s = silsplit + padding1 * (ds->samplerate/1000); pos2s = silsplit - padding2 * (ds->samplerate/1000); debug_printf ("Applying padding: p1,p2 = (%d,%d), pos1s,pos2s = (%d,%d)\n", padding1, padding2, pos1s, pos2s); /* GCS FIX: Need to check for pos == null */ /* GCS FIX: Watch out for -1, might have mem error! */ pos = list_entry (ds->frame_list.next, FRAME_LIST, m_list); if (pos1s < pos->m_pcmpos) { *pos1 = pos->m_framepos - ds->mpgbuf - 1; } if (pos2s < pos->m_pcmpos) { *pos2 = pos->m_framepos - ds->mpgbuf; } list_for_each_entry (pos, FRAME_LIST, &(ds->frame_list), m_list) { if (pos1s >= pos->m_pcmpos) { *pos1 = pos->m_framepos - ds->mpgbuf - 1; } if (pos2s >= pos->m_pcmpos) { *pos2 = pos->m_framepos - ds->mpgbuf; } } debug_printf ("pos1, pos2 = %d,%d (%d) (%02x%02x)\n", *pos1, *pos2, *pos1 - *pos2, ds->mpgbuf[*pos2], ds->mpgbuf[*pos2+1]); } static void free_frame_list (DECODE_STRUCT* ds) { FRAME_LIST *pos, *n; /* GCS: This seems to be the best way to go through a list. Note no compiler warnings. */ list_for_each_entry_safe (pos, FRAME_LIST, n, &(ds->frame_list), m_list) { list_del (&(pos->m_list)); free (pos); } } static enum mad_flow input(void *data, struct mad_stream *ms) { DECODE_STRUCT *ds = (DECODE_STRUCT *)data; long frameoffset = 0; long espnextpos = ds->mpgpos+READSIZE; /* GCS FIX: This trims the last READSIZE from consideration */ if (espnextpos > ds->mpgsize) { return MAD_FLOW_STOP; } if (ms->next_frame) { frameoffset = &(ds->mpgbuf[ds->mpgpos]) - ms->next_frame; /* GCS July 8, 2004 This is the famous frameoffset != READSIZE bug. What appears to be happening is libmad is not syncing properly on the broken initial frame. Therefore, if there is no header yet (hence no ds->samplerate), we'll nudge along the buffer to try to resync. */ if (frameoffset == READSIZE) { if (!ds->samplerate) { frameoffset--; } else { FILE* fp; debug_printf ("%p | %p | %p | %p | %d\n", ds->mpgbuf, ds->mpgpos, &(ds->mpgbuf[ds->mpgpos]), ms->next_frame, frameoffset); fprintf (stderr, "ERROR: frameoffset != READSIZE\n"); debug_printf ("ERROR: frameoffset != READSIZE\n"); fp = fopen ("gcs1.txt","w"); fwrite(ds->mpgbuf,1,ds->mpgsize,fp); fclose(fp); exit (-1); } } } debug_printf ("%p | %p | %p |< %p | %p >| %d\n", ds->mpgbuf, ds->mpgpos, &(ds->mpgbuf[ds->mpgpos]), ms->this_frame, ms->next_frame, frameoffset); mad_stream_buffer (ms, (const unsigned char*) (ds->mpgbuf+ds->mpgpos)-frameoffset, READSIZE); ds->mpgpos += READSIZE - frameoffset; return MAD_FLOW_CONTINUE; } static void propagate_max_value (unsigned short *max_buffer, unsigned long node_pos, int depth) { unsigned long current_pos = node_pos; unsigned long parent_pos = current_pos / 2; while (depth-- > 0) { unsigned long sibling_pos = current_pos ^ 1; unsigned short current_val = max_buffer[current_pos]; unsigned short sibling_val = max_buffer[sibling_pos]; if (current_val > sibling_val) max_buffer[parent_pos] = current_val; else max_buffer[parent_pos] = sibling_val; current_pos = parent_pos; parent_pos /= 2; } } static void insert_value (DECODE_STRUCT *ds, unsigned short vol, unsigned long pos) { int i; unsigned long current_pos = 1; unsigned short prev = ds->maxvolume_buffer[ds->maxvolume_buffer_offs]; int depth = 1; ds->maxvolume_buffer[ds->maxvolume_buffer_offs] = vol; vol = prev; for (i = 1; i < ds->maxvolume_buffer_depth; ++i) { unsigned long index = ds->maxvolume_buffer_offs + current_pos + (pos % current_pos); prev = ds->maxvolume_buffer[index]; ds->maxvolume_buffer[index] = vol; vol = prev; propagate_max_value (ds->maxvolume_buffer, index, depth++); current_pos *= 2; } } static void search_for_silence (DECODE_STRUCT *ds, unsigned short vol) { unsigned long window_size = 1; unsigned long window_pos = ds->pcmpos - ds->len_to_sw_start_samp; unsigned long node_pos = ds->maxvolume_buffer_offs; int i; insert_value (ds, vol, ds->pcmpos); window_size = 1; for (i = ds->maxvolume_buffer_depth - 1; i >= 0; --i) { if (i <= ds->max_search_depth && window_pos >= window_size && ds->maxvolume_buffer[node_pos] < ds->min_maxvolume_buffer[i].volume) { ds->min_maxvolume_buffer[i].volume = ds->maxvolume_buffer[node_pos]; ds->min_maxvolume_buffer[i].pos = ds->pcmpos - window_size / 2; } node_pos /= 2; window_size *= 2; } } static signed int scale(mad_fixed_t sample) { /* round */ sample += (1L << (MAD_F_FRACBITS - 16)); /* clip */ if (sample >= MAD_F_ONE) sample = MAD_F_ONE - 1; else if (sample < -MAD_F_ONE) sample = -MAD_F_ONE; /* quantize */ return sample >> (MAD_F_FRACBITS + 1 - 16); } static enum mad_flow filter (void *data, struct mad_stream const *ms, struct mad_frame *frame) { DECODE_STRUCT *ds = (DECODE_STRUCT *)data; FRAME_LIST* fl; fl = (FRAME_LIST*) malloc (sizeof(FRAME_LIST)); fl->m_framepos = ms->this_frame; fl->m_samples = 0; fl->m_pcmpos = 0; list_add_tail (&(fl->m_list), &(ds->frame_list)); #if defined (commentout) debug_printf ("FILTER: %p (%02x%02x) | %p\n", ms->this_frame, ms->this_frame[0], ms->this_frame[1], ms->next_frame); #endif return MAD_FLOW_CONTINUE; } static enum mad_flow output (void *data, struct mad_header const *header, struct mad_pcm *pcm) { DECODE_STRUCT *ds = (DECODE_STRUCT *)data; FRAME_LIST *fl; unsigned int nchannels, nsamples; mad_fixed_t const *left_ch, *right_ch; static signed int sample; double v; nchannels = pcm->channels; nsamples = pcm->length; left_ch = pcm->samples[0]; right_ch = pcm->samples[1]; /* Get frame entry */ fl = list_entry (ds->frame_list.prev, FRAME_LIST, m_list); fl->m_samples = nsamples; fl->m_pcmpos = ds->pcmpos; if (ds->pcmpos > ds->len_to_sw_start_samp && ds->pcmpos < ds->len_to_sw_end_samp) { debug_printf ("* %d\n", ds->pcmpos); } else { debug_printf ("- %d\n", ds->pcmpos); } #if defined (commentout) #endif while(nsamples--) { /* output sample(s) in 16-bit signed little-endian PCM */ /* GCS FIX: Does this work on big endian machines??? */ sample = (short) scale (*left_ch++); // fwrite(&sample, sizeof(short), 1, fp); if (nchannels == 2) { // make mono sample = (sample+scale(*right_ch++))/2; } // get the instantanous volume v = (ds->prev_sample*ds->prev_sample)+(sample*sample); v = sqrt(v / 2); if (ds->pcmpos > ds->len_to_sw_start_samp && ds->pcmpos < ds->len_to_sw_end_samp) { search_for_silence(ds, (short) v); } ds->pcmpos++; ds->prev_sample = sample; } return MAD_FLOW_CONTINUE; } static unsigned long next_power_of_two(long value) { long result = 1; while (result < value) result *= 2; return result; } static void init_maxvolume_buffer(DECODE_STRUCT *ds) { unsigned long buffer_offset = 1; unsigned long temp = ds->silence_samples; unsigned long depth = 0; unsigned long i; while (temp > 0) { ++depth; temp /= 2; buffer_offset += temp; } ds->maxvolume_buffer_depth = depth; /* Let the minimum silence-length be 10 ms. */ ds->max_search_depth = depth - (int)ceil(log(10 * (ds->samplerate / 1000.0)) / log(2)) - 1; /* Unless the user specified silence-length is lower. */ if (ds->max_search_depth < 0) ds->max_search_depth = 0; ds->maxvolume_buffer = (unsigned short*) calloc(buffer_offset + ds->silence_samples, sizeof(unsigned short)); ds->maxvolume_buffer_offs = buffer_offset; ds->min_maxvolume_buffer = (MIN_POS*) malloc(depth * sizeof(MIN_POS)); for (i = 0; i < depth; ++i) { ds->min_maxvolume_buffer[i].volume = MAX_RMS_SILENCE; ds->min_maxvolume_buffer[i].pos = 0; } } static enum mad_flow header(void *data, struct mad_header const *pheader) { DECODE_STRUCT *ds = (DECODE_STRUCT *)data; if (!ds->samplerate) { ds->samplerate = pheader->samplerate; ds->silence_samples = next_power_of_two(ds->silence_ms * (ds->samplerate/1000)); ds->len_to_sw_start_samp = ds->len_to_sw_ms * (ds->samplerate/1000); ds->len_to_sw_end_samp = (ds->len_to_sw_ms + ds->searchwindow_ms) * (ds->samplerate/1000); init_maxvolume_buffer(ds); debug_printf ("Setting samplerate: %ld\n",ds->samplerate); } return MAD_FLOW_CONTINUE; } static enum mad_flow error(void *data, struct mad_stream *ms, struct mad_frame *frame) { if (MAD_RECOVERABLE(ms->error)) { debug_printf("mad error 0x%04x\n", ms->error); return MAD_FLOW_CONTINUE; } debug_printf("unrecoverable mad error 0x%04x\n", ms->error); return MAD_FLOW_BREAK; } streamripper-1.64.6.orig/lib/relaylib.c0000644000175000017500000004553411137077422016070 0ustar abiabi/* relaylib.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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if WIN32 #include #else #include #include #include #include #include #include #include #include #include #include #include #include #include #endif #if __UNIX__ #include #elif __BEOS__ #include #endif #include #include "relaylib.h" #include "srtypes.h" #include "http.h" #include "socklib.h" #include "threadlib.h" #include "debug.h" #include "compat.h" #include "rip_manager.h" #include "cbuf2.h" #if defined (WIN32) #ifdef errno #undef errno #endif #define errno WSAGetLastError() #endif /***************************************************************************** * Private functions *****************************************************************************/ static void thread_accept (void *arg); static error_code try_port (RELAYLIB_INFO* rli, u_short port, char *if_name, char *relay_ip); static void thread_send (void *arg); static error_code relaylib_start_threads (RIP_MANAGER_INFO* rmi); #define BUFSIZE (1024) #define HTTP_HEADER_DELIM "\n" #define ICY_METADATA_TAG "Icy-MetaData:" static void destroy_all_hostsocks (RIP_MANAGER_INFO* rmi) { RELAY_LIST* ptr; threadlib_waitfor_sem (&rmi->relay_list_sem); while (rmi->relay_list != NULL) { ptr = rmi->relay_list; closesocket(ptr->m_sock); rmi->relay_list = ptr->m_next; if (ptr->m_buffer != NULL) { free (ptr->m_buffer); ptr->m_buffer = NULL; } free(ptr); } rmi->relay_list_len = 0; rmi->relay_list = NULL; threadlib_signal_sem (&rmi->relay_list_sem); } static int tag_compare (char *str, char *tag) { int i, a,b; int len; len = strlen(tag); for (i=0; i 0) { hasmore = TRUE; } else if (ret == SOCKET_ERROR) { break; } } else if (ret == SOCKET_ERROR) { break; } } return ret; } // Makes a socket non-blocking void make_nonblocking (int sock) { #if defined (WIN32) long opt = 1; ioctlsocket(sock, FIONBIO, &opt); #else int opt = fcntl(sock, F_GETFL); if (opt != SOCKET_ERROR) { fcntl(sock, F_SETFL, opt | O_NONBLOCK); } #endif } #if defined (commentout) error_code relaylib_set_response_header(char *http_header) { if (!http_header) return SR_ERROR_INVALID_PARAM; strcpy(m_http_header, http_header); return SR_SUCCESS; } #endif #ifndef WIN32 void catch_pipe(int code) { //m_sock = 0; //m_connected = FALSE; // JCBUG, not sure what to do about this } #endif error_code relaylib_start (RIP_MANAGER_INFO* rmi, BOOL search_ports, u_short relay_port, u_short max_port, u_short *port_used, char *if_name, int max_connections, char *relay_ip, int have_metadata) { int ret; #ifdef WIN32 WSADATA wsd; #endif RELAYLIB_INFO* rli = &rmi->relaylib_info; /* GCS: These were globally initialized... */ rli->m_listensock = SOCKET_ERROR; rli->m_running = FALSE; rli->m_running_accept = FALSE; rli->m_running_send = FALSE; debug_printf ("relaylib_start()\n"); rmi->relay_list = 0; rmi->relay_list_len = 0; #ifdef WIN32 if (WSAStartup(MAKEWORD(2,2), &wsd) != 0) { debug_printf ("relaylib_init(): SR_ERROR_CANT_BIND_ON_PORT\n"); return SR_ERROR_CANT_BIND_ON_PORT; } #endif if (relay_port < 1 || !port_used) { debug_printf ("relaylib_init(): SR_ERROR_INVALID_PARAM\n"); return SR_ERROR_INVALID_PARAM; } #ifndef WIN32 // catch a SIGPIPE if send fails signal(SIGPIPE, catch_pipe); #endif rli->m_sem_not_connected = threadlib_create_sem(); rmi->relay_list_sem = threadlib_create_sem(); threadlib_signal_sem (&rmi->relay_list_sem); // NOTE: we need to signal it here in case we try to destroy // relaylib before the thread starts! threadlib_signal_sem (&rli->m_sem_not_connected); //m_max_connections = max_connections; //m_have_metadata = have_metadata; *port_used = 0; if (!search_ports) max_port = relay_port; for(;relay_port <= max_port; relay_port++) { ret = try_port (rli, (u_short) relay_port, if_name, relay_ip); if (ret == SR_ERROR_CANT_BIND_ON_PORT) continue; // Keep searching. if (ret == SR_SUCCESS) { *port_used = relay_port; debug_printf ("Relay: Listening on port %d\n", relay_port); ret = SR_SUCCESS; if (!rli->m_running) { ret = relaylib_start_threads (rmi); } return ret; } else { return ret; } } return SR_ERROR_CANT_BIND_ON_PORT; } static error_code try_port (RELAYLIB_INFO* rli, u_short port, char *if_name, char *relay_ip) { struct hostent *he; struct sockaddr_in local; rli->m_listensock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); if (rli->m_listensock == SOCKET_ERROR) { debug_printf ("try_port(%d) failed socket() call\n", port); return SR_ERROR_SOCK_BASE; } make_nonblocking(rli->m_listensock); if ('\0' == *relay_ip) { if (read_interface(if_name,&local.sin_addr.s_addr) != 0) local.sin_addr.s_addr = htonl(INADDR_ANY); } else { he = gethostbyname(relay_ip); memcpy(&local.sin_addr, he->h_addr_list[0], he->h_length); } local.sin_family = AF_INET; local.sin_port = htons(port); #ifndef WIN32 { // Prevent port error when restarting quickly after a previous exit int opt = 1; setsockopt(rli->m_listensock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)); } #endif if (bind(rli->m_listensock, (struct sockaddr *)&local, sizeof(local)) == SOCKET_ERROR) { debug_printf ("try_port(%d) failed bind() call\n", port); closesocket(rli->m_listensock); rli->m_listensock = SOCKET_ERROR; return SR_ERROR_CANT_BIND_ON_PORT; } if (listen(rli->m_listensock, 1) == SOCKET_ERROR) { debug_printf ("try_port(%d) failed listen() call\n", port); closesocket(rli->m_listensock); rli->m_listensock = SOCKET_ERROR; return SR_ERROR_SOCK_BASE; } debug_printf ("try_port(%d) succeeded\n", port); return SR_SUCCESS; } void relaylib_stop (RIP_MANAGER_INFO* rmi) { int ix; RELAYLIB_INFO* rli = &rmi->relaylib_info; debug_printf("relaylib_stop:start\n"); if (!rli->m_running) { debug_printf("***relaylib_stop:return\n"); return; } rli->m_running = FALSE; ix = 0; while (ix<120 && (rli->m_running_accept | rli->m_running_send)) { sleep(1); ++ix; } if (ix==120) { debug_printf ("relay threads refused to end, aborting\n"); fprintf (stderr,"relay threads refused to end, aborting\n"); exit(1); } threadlib_signal_sem (&rli->m_sem_not_connected); if (closesocket(rli->m_listensock) == SOCKET_ERROR) { // JCBUG, what can we do? } /* Accept thread will watch for this and not try to accept anymore */ rli->m_listensock = SOCKET_ERROR; debug_printf ("waiting for relay close\n"); threadlib_waitforclose (&rli->m_hthread_accept); threadlib_waitforclose (&rli->m_hthread_send); destroy_all_hostsocks (rmi); threadlib_destroy_sem (&rli->m_sem_not_connected); debug_printf("relaylib_stop:done!\n"); } static error_code relaylib_start_threads (RIP_MANAGER_INFO* rmi) { int ret; RELAYLIB_INFO* rli = &rmi->relaylib_info; rli->m_running = TRUE; ret = threadlib_beginthread (&rli->m_hthread_accept, thread_accept, (void*) rmi); if (ret != SR_SUCCESS) return ret; rli->m_running_accept = TRUE; ret = threadlib_beginthread (&rli->m_hthread_send, thread_send, (void*) rmi); if (ret != SR_SUCCESS) return ret; rli->m_running_send = TRUE; return SR_SUCCESS; } void thread_accept (void* arg) { int ret; int newsock; BOOL good; struct sockaddr_in client; socklen_t iAddrSize = sizeof(client); RELAY_LIST* newhostsock; int icy_metadata; char* client_http_header; RIP_MANAGER_INFO* rmi = (RIP_MANAGER_INFO*) arg; RELAYLIB_INFO* rli = &rmi->relaylib_info; STREAM_PREFS* prefs = rmi->prefs; int have_metadata; if (rmi->http_info.meta_interval == NO_META_INTERVAL) { have_metadata = 0; } else { have_metadata = 1; } debug_printf("thread_accept:start\n"); while (rli->m_running) { fd_set fds; struct timeval tv; // this event will keep use from accepting while we // have a connection active // when a connection gets dropped, or when streamripper shuts down // this event will get signaled debug_printf("thread_accept:waiting on m_sem_not_connected\n"); threadlib_waitfor_sem (&rli->m_sem_not_connected); if (!rli->m_running) { debug_printf("thread_accept:exit (no longer m_running)\n"); break; } // Poll once per second, instead of blocking forever in // accept(), so that we can regain control if relaylib_stop() // called FD_ZERO (&fds); while (rli->m_listensock != SOCKET_ERROR && rli->m_running) { FD_SET (rli->m_listensock, &fds); tv.tv_sec = 1; tv.tv_usec = 0; debug_printf("thread_accept:calling select()\n"); ret = select (rli->m_listensock + 1, &fds, NULL, NULL, &tv); debug_printf("thread_accept:select() returned %d\n", ret); if (ret == 1) { unsigned long num_connected; /* If connections are full, do nothing. Note that m_max_connections is 0 for infinite connections allowed. */ threadlib_waitfor_sem (&rmi->relay_list_sem); num_connected = rmi->relay_list_len; threadlib_signal_sem (&rmi->relay_list_sem); if (prefs->max_connections > 0 && num_connected >= (unsigned long) prefs->max_connections) { continue; } /* Check for connections */ debug_printf ("Calling accept()\n"); newsock = accept (rli->m_listensock, (struct sockaddr *)&client, &iAddrSize); if (newsock != SOCKET_ERROR) { // Got successful accept debug_printf ("Relay: Client %d new from %s:%hu\n", newsock, inet_ntoa(client.sin_addr), ntohs(client.sin_port)); // Socket is new and its buffer had better have // room to hold the entire HTTP header! good = FALSE; if (header_receive (newsock, &icy_metadata) == 0 && rmi->cbuf2.buf != NULL) { int header_len; make_nonblocking (newsock); client_http_header = client_relay_header_generate (rmi, icy_metadata); header_len = strlen (client_http_header); ret = send (newsock, client_http_header, strlen(client_http_header), 0); debug_printf ("Relay: Sent response header to client %d (%d)\n", ret, header_len); client_relay_header_release (client_http_header); if (ret == header_len) { newhostsock = malloc (sizeof(RELAY_LIST)); if (newhostsock != NULL) { // Add new client to list (headfirst) threadlib_waitfor_sem (&rmi->relay_list_sem); newhostsock->m_is_new = 1; newhostsock->m_sock = newsock; newhostsock->m_next = rmi->relay_list; if (have_metadata) { newhostsock->m_icy_metadata = icy_metadata; } else { newhostsock->m_icy_metadata = 0; } rmi->relay_list = newhostsock; rmi->relay_list_len++; threadlib_signal_sem (&rmi->relay_list_sem); good = TRUE; } } } if (!good) { closesocket (newsock); debug_printf ("Relay: Client %d disconnected (Unable to receive HTTP header) or cbuf2.buf is NULL\n", newsock); //if (rmi->cbuf2.buf == NULL) { // debug_printf ("In fact, cbuf2.buf is NULL\n"); //} } } } else if (ret == SOCKET_ERROR) { /* Something went wrong with select */ break; } } threadlib_signal_sem (&rli->m_sem_not_connected); /* loop back up to select */ } rli->m_running_accept = FALSE; rli->m_running = FALSE; } /* Sock is ready to receive, so send it from cbuf to relay */ static BOOL send_to_relay (RIP_MANAGER_INFO* rmi, RELAY_LIST* ptr) { int ret; int err_errno; BOOL good = TRUE; int done = 0; /* For new clients, initialize cbuf pointers */ if (ptr->m_is_new) { int burst_amount = 32*1024; // int burst_amount = 64*1024; // int burst_amount = 128*1024; ptr->m_offset = 0; ptr->m_left_to_send = 0; cbuf2_init_relay_entry (&rmi->cbuf2, ptr, burst_amount); ptr->m_is_new = 0; } while (!done) { /* If our private buffer is empty, copy some from the cbuf */ if (!ptr->m_left_to_send) { error_code rc; ptr->m_offset = 0; rc = cbuf2_extract_relay (&rmi->cbuf2, ptr); if (rc == SR_ERROR_BUFFER_EMPTY) { break; } } /* Send from the private buffer to the client */ debug_printf ("Relay: Sending Client %d to the client\n", ptr->m_left_to_send ); ret = send (ptr->m_sock, ptr->m_buffer+ptr->m_offset, ptr->m_left_to_send, 0); debug_printf ("Relay: Sending to Client returned %d\n", ret ); if (ret == SOCKET_ERROR) { /* Sometimes windows gives me an errno of 0 Sometimes windows gives me an errno of 183 See this thread for details: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=8956d3e8.0309100905.6ba60e7f%40posting.google.com */ err_errno = errno; if (err_errno == EWOULDBLOCK || err_errno == 0 || err_errno == 183) { #if defined (WIN32) // Client is slow. Retry later. WSASetLastError (0); #endif } else { debug_printf ("Relay: socket error is %d\n",errno); good = FALSE; } done = 1; } else { // Send was successful ptr->m_offset += ret; ptr->m_left_to_send -= ret; if (ptr->m_left_to_send < 0) { /* GCS: can this ever happen??? */ debug_printf ("ptr->m_left_to_send < 0\n"); ptr->m_left_to_send = 0; done = 1; } } } return good; } void relaylib_disconnect (RIP_MANAGER_INFO* rmi, RELAY_LIST* prev, RELAY_LIST* ptr) { RELAY_LIST* next = ptr->m_next; int sock = ptr->m_sock; closesocket (sock); // Carefully delete this client from list without // affecting list order if (prev != NULL) { prev->m_next = next; } else { rmi->relay_list = next; } if (ptr->m_buffer != NULL) { free (ptr->m_buffer); ptr->m_buffer = NULL; } free (ptr); rmi->relay_list_len --; } void thread_send (void* arg) { RELAY_LIST* prev; RELAY_LIST* ptr; RELAY_LIST* next; int sock; BOOL good; error_code err = SR_SUCCESS; RIP_MANAGER_INFO* rmi = (RIP_MANAGER_INFO*) arg; RELAYLIB_INFO* rli = &rmi->relaylib_info; while (rli->m_running) { threadlib_waitfor_sem (&rmi->relay_list_sem); ptr = rmi->relay_list; if (ptr != NULL) { prev = NULL; while (ptr != NULL) { sock = ptr->m_sock; next = ptr->m_next; if (swallow_receive(sock) != 0) { good = FALSE; } else { good = send_to_relay (rmi, ptr); } if (!good) { debug_printf ("Relay: Client %d disconnected (%s)\n", sock, strerror(errno)); relaylib_disconnect (rmi, prev, ptr); } else if (ptr != NULL) { prev = ptr; } ptr = next; } } else { err = SR_ERROR_HOST_NOT_CONNECTED; } threadlib_signal_sem (&rmi->relay_list_sem); Sleep (50); } rli->m_running_send = FALSE; } streamripper-1.64.6.orig/lib/findsep.c0000644000175000017500000003504611004730527015705 0ustar abiabi/* findsep.c * library routines for find silent points in mp3 data * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * * Portions are adapted from minimad.c, included with the * libmad library, distributed under the GNU General Public License. * Copyright (C) 2000-2004 Underbit Technologies, Inc. */ #include #include #include #include #include #include #include #include "mad.h" #include "findsep.h" #include "srtypes.h" #include "debug.h" #include "list.h" #define MIN_RMS_SILENCE 100 #define MAX_RMS_SILENCE 32767 //max short #define NUM_SILTRACKERS 30 #define READSIZE 2000 // #define READSIZE 1000 /* Uncomment to dump an mp3 of the search window. */ // #define MAKE_DUMP_MP3 1 typedef struct FRAME_LIST_struct FRAME_LIST; struct FRAME_LIST_struct { const unsigned char* m_framepos; long m_samples; long m_pcmpos; LIST m_list; }; typedef struct SILENCETRACKERst { long insilencecount; double silencevol; unsigned long silstart_samp; BOOL foundsil; } SILENCETRACKER; typedef struct DECODE_STRUCTst { unsigned char* mpgbuf; long mpgsize; long mpgpos; long len_to_sw_ms; long searchwindow_ms; long silence_ms; long silence_samples; unsigned long len_to_sw_start_samp; unsigned long len_to_sw_end_samp; unsigned long pcmpos; long samplerate; short prev_sample; SILENCETRACKER siltrackers[NUM_SILTRACKERS]; LIST frame_list; } DECODE_STRUCT; typedef struct GET_BITRATE_STRUCTst { unsigned long bitrate; unsigned char* mpgbuf; long mpgsize; } GET_BITRATE_STRUCT; /***************************************************************************** * Public functions *****************************************************************************/ /***************************************************************************** * Private functions *****************************************************************************/ static void init_siltrackers(SILENCETRACKER* siltrackers); static void apply_padding (DECODE_STRUCT* ds, unsigned long silstart, long padding1, long padding2, u_long* pos1, u_long* pos2); static void free_frame_list (DECODE_STRUCT* ds); static enum mad_flow input(void *data, struct mad_stream *ms); static void search_for_silence(DECODE_STRUCT *ds, double vol); static signed int scale(mad_fixed_t sample); static enum mad_flow output(void *data, struct mad_header const *header, struct mad_pcm *pcm); static enum mad_flow filter (void *data, struct mad_stream const *ms, struct mad_frame *frame); static enum mad_flow error(void *data, struct mad_stream *ms, struct mad_frame *frame); static enum mad_flow header(void *data, struct mad_header const *pheader); static enum mad_flow input_get_bitrate (void *data, struct mad_stream *stream); static enum mad_flow header_get_bitrate (void *data, struct mad_header const *pheader); /***************************************************************************** * Private Vars *****************************************************************************/ /***************************************************************************** * Functions *****************************************************************************/ error_code findsep_silence (const char* mpgbuf, long mpgsize, long len_to_sw, long searchwindow, long silence_length, long padding1, long padding2, u_long* pos1, u_long* pos2 ) { DECODE_STRUCT ds; struct mad_decoder decoder; int result; unsigned long silstart; int i; ds.mpgbuf = (unsigned char*)mpgbuf; ds.mpgsize = mpgsize; ds.pcmpos = 0; ds.mpgpos = 0; ds.samplerate = 0; ds.prev_sample = 0; ds.len_to_sw_ms = len_to_sw; ds.searchwindow_ms = searchwindow; ds.silence_ms = silence_length; INIT_LIST_HEAD (&ds.frame_list); debug_printf ("FINDSEP 1: %p -> %p (%d)\n", mpgbuf, mpgbuf+mpgsize, mpgsize); init_siltrackers(ds.siltrackers); #if defined (MAKE_DUMP_MP3) { FILE* fp = fopen("dump.mp3", "wb"); fwrite(mpgbuf, mpgsize, 1, fp); fclose(fp); } #endif /* Run decoder */ mad_decoder_init(&decoder, &ds, input /* input */, header/* header */, filter /* filter */, output /* output */, error /* error */, NULL /* message */); result = mad_decoder_run(&decoder, MAD_DECODER_MODE_SYNC); mad_decoder_finish(&decoder); debug_printf ("total length: %d\n", ds.pcmpos); debug_printf ("silence_length: %d ms\n", ds.silence_ms); debug_printf ("silence_samples: %d\n", ds.silence_samples); /* Search through siltrackers to find minimum volume point */ assert(ds.mpgsize != 0); silstart = ds.pcmpos/2; for(i = 0; i < NUM_SILTRACKERS; i++) { debug_printf("SILT: %2d/%8g, pcm=%4d, found=%d, insil=%d\n", i, ds.siltrackers[i].silencevol, ds.siltrackers[i].silstart_samp, ds.siltrackers[i].foundsil, ds.siltrackers[i].insilencecount ); if (ds.siltrackers[i].foundsil) { debug_printf("found!\n"); silstart = ds.siltrackers[i].silstart_samp; break; } } if (i == NUM_SILTRACKERS) { debug_printf("warning: no silence found between tracks\n"); } /* Now that we have the start of the silence, let's add the padding */ apply_padding (&ds, silstart, padding1, padding2, pos1, pos2); /* Free the list of frame info */ free_frame_list (&ds); return SR_SUCCESS; } static void init_siltrackers(SILENCETRACKER* siltrackers) { int i; long stepsize = (MAX_RMS_SILENCE - MIN_RMS_SILENCE) / (NUM_SILTRACKERS-1); long rms = MIN_RMS_SILENCE; for (i = 0; i < NUM_SILTRACKERS; i++, rms += stepsize) { siltrackers[i].foundsil = 0; siltrackers[i].silstart_samp = 0; siltrackers[i].insilencecount = 0; siltrackers[i].silencevol = rms; } } static void apply_padding (DECODE_STRUCT* ds, unsigned long silstart, long padding1, long padding2, u_long* pos1, u_long* pos2 ) { /* Compute positions in samples */ FRAME_LIST *pos; long pos1s, pos2s; pos1s = silstart + (ds->silence_samples/2) + padding1 * (ds->samplerate/1000); pos2s = silstart + (ds->silence_samples/2) - padding2 * (ds->samplerate/1000); debug_printf ("Applying padding: p1,p2 = (%d,%d), pos1s,pos2s = (%d,%d)\n", padding1, padding2, pos1s, pos2s); /* GCS FIX: Need to check for pos == null */ /* GCS FIX: Watch out for -1, might have mem error! */ pos = list_entry (ds->frame_list.next, FRAME_LIST, m_list); if (pos1s < pos->m_pcmpos) { *pos1 = pos->m_framepos - ds->mpgbuf - 1; } if (pos2s < pos->m_pcmpos) { *pos2 = pos->m_framepos - ds->mpgbuf; } list_for_each_entry (pos, FRAME_LIST, &(ds->frame_list), m_list) { if (pos1s >= pos->m_pcmpos) { *pos1 = pos->m_framepos - ds->mpgbuf - 1; } if (pos2s >= pos->m_pcmpos) { *pos2 = pos->m_framepos - ds->mpgbuf; } } debug_printf ("pos1, pos2 = %d,%d (%d) (%02x%02x)\n", *pos1, *pos2, *pos1 - *pos2, ds->mpgbuf[*pos2], ds->mpgbuf[*pos2+1]); } static void free_frame_list (DECODE_STRUCT* ds) { FRAME_LIST *pos, *n; /* GCS: This seems to be the best way to go through a list. Note no compiler warnings. */ list_for_each_entry_safe (pos, FRAME_LIST, n, &(ds->frame_list), m_list) { list_del (&(pos->m_list)); free (pos); } } static enum mad_flow input(void *data, struct mad_stream *ms) { DECODE_STRUCT *ds = (DECODE_STRUCT *)data; long frameoffset = 0; long espnextpos = ds->mpgpos+READSIZE; /* GCS FIX: This trims the last READSIZE from consideration */ if (espnextpos > ds->mpgsize) { return MAD_FLOW_STOP; } if (ms->next_frame) { frameoffset = &(ds->mpgbuf[ds->mpgpos]) - ms->next_frame; /* GCS July 8, 2004 This is the famous frameoffset != READSIZE bug. What appears to be happening is libmad is not syncing properly on the broken initial frame. Therefore, if there is no header yet (hence no ds->samplerate), we'll nudge along the buffer to try to resync. */ if (frameoffset == READSIZE) { if (!ds->samplerate) { frameoffset--; } else { FILE* fp; debug_printf ("%p | %p | %p | %p | %d\n", ds->mpgbuf, ds->mpgpos, &(ds->mpgbuf[ds->mpgpos]), ms->next_frame, frameoffset); fprintf (stderr, "ERROR: frameoffset != READSIZE\n"); debug_printf ("ERROR: frameoffset != READSIZE\n"); fp = fopen ("gcs1.txt","w"); fwrite(ds->mpgbuf,1,ds->mpgsize,fp); fclose(fp); exit (-1); } } } debug_printf ("%p | %p | %p |< %p | %p >| %d\n", ds->mpgbuf, ds->mpgpos, &(ds->mpgbuf[ds->mpgpos]), ms->this_frame, ms->next_frame, frameoffset); mad_stream_buffer (ms, (const unsigned char*) (ds->mpgbuf+ds->mpgpos)-frameoffset, READSIZE); ds->mpgpos += READSIZE - frameoffset; return MAD_FLOW_CONTINUE; } static void search_for_silence (DECODE_STRUCT *ds, double vol) { int i; for(i = 0; i < NUM_SILTRACKERS; i++) { SILENCETRACKER *pstracker = &ds->siltrackers[i]; if (pstracker->foundsil) continue; if (vol < pstracker->silencevol) { if (pstracker->insilencecount == 0) { pstracker->silstart_samp = ds->pcmpos; } pstracker->insilencecount++; } else { pstracker->insilencecount = 0; } if (pstracker->insilencecount > ds->silence_samples) { pstracker->foundsil = TRUE; } } } static signed int scale(mad_fixed_t sample) { /* round */ sample += (1L << (MAD_F_FRACBITS - 16)); /* clip */ if (sample >= MAD_F_ONE) sample = MAD_F_ONE - 1; else if (sample < -MAD_F_ONE) sample = -MAD_F_ONE; /* quantize */ return sample >> (MAD_F_FRACBITS + 1 - 16); } static enum mad_flow filter (void *data, struct mad_stream const *ms, struct mad_frame *frame) { DECODE_STRUCT *ds = (DECODE_STRUCT *)data; FRAME_LIST* fl; fl = (FRAME_LIST*) malloc (sizeof(FRAME_LIST)); fl->m_framepos = ms->this_frame; fl->m_samples = 0; fl->m_pcmpos = 0; list_add_tail (&(fl->m_list), &(ds->frame_list)); #if defined (commentout) debug_printf ("FILTER: %p (%02x%02x) | %p\n", ms->this_frame, ms->this_frame[0], ms->this_frame[1], ms->next_frame); #endif return MAD_FLOW_CONTINUE; } static enum mad_flow output (void *data, struct mad_header const *header, struct mad_pcm *pcm) { DECODE_STRUCT *ds = (DECODE_STRUCT *)data; FRAME_LIST *fl; unsigned int nchannels, nsamples; mad_fixed_t const *left_ch, *right_ch; signed int sample; double v; nchannels = pcm->channels; nsamples = pcm->length; left_ch = pcm->samples[0]; right_ch = pcm->samples[1]; /* Get frame entry */ fl = list_entry (ds->frame_list.prev, FRAME_LIST, m_list); fl->m_samples = nsamples; fl->m_pcmpos = ds->pcmpos; if (ds->pcmpos > ds->len_to_sw_start_samp && ds->pcmpos < ds->len_to_sw_end_samp) { debug_printf ("* %d\n", ds->pcmpos); } else { debug_printf ("- %d\n", ds->pcmpos); } #if defined (commentout) #endif while(nsamples--) { /* output sample(s) in 16-bit signed little-endian PCM */ /* GCS FIX: Does this work on big endian machines??? */ sample = (short) scale (*left_ch++); // fwrite(&sample, sizeof(short), 1, fp); if (nchannels == 2) { // make mono sample = (sample+scale(*right_ch++))/2; } // get the instantanous volume v = (ds->prev_sample*ds->prev_sample)+(sample*sample); v = sqrt(v / 2); if (ds->pcmpos > ds->len_to_sw_start_samp && ds->pcmpos < ds->len_to_sw_end_samp) { search_for_silence(ds, v); } ds->pcmpos++; ds->prev_sample = sample; } return MAD_FLOW_CONTINUE; } static enum mad_flow header(void *data, struct mad_header const *pheader) { DECODE_STRUCT *ds = (DECODE_STRUCT *)data; if (!ds->samplerate) { ds->samplerate = pheader->samplerate; ds->silence_samples = ds->silence_ms * (ds->samplerate/1000); ds->len_to_sw_start_samp = ds->len_to_sw_ms * (ds->samplerate/1000); ds->len_to_sw_end_samp = (ds->len_to_sw_ms + ds->searchwindow_ms) * (ds->samplerate/1000); debug_printf ("Setting samplerate: %ld\n",ds->samplerate); } return MAD_FLOW_CONTINUE; } static enum mad_flow error(void *data, struct mad_stream *ms, struct mad_frame *frame) { if (MAD_RECOVERABLE(ms->error)) { debug_printf("mad error 0x%04x\n", ms->error); return MAD_FLOW_CONTINUE; } debug_printf("unrecoverable mad error 0x%04x\n", ms->error); return MAD_FLOW_BREAK; } /* The following routines have nothing to do with finding a separation * point. Instead, they have to do with finding the bitrate. However, * they are included here because they are "mad" related. */ error_code find_bitrate (unsigned long* bitrate, const char* mpgbuf, long mpgsize) { struct mad_decoder decoder; GET_BITRATE_STRUCT gbs; int result; /* initialize and start decoder */ gbs.mpgbuf = (unsigned char*) mpgbuf; gbs.mpgsize = mpgsize; gbs.bitrate = 0; mad_decoder_init(&decoder, &gbs, input_get_bitrate /* input */, header_get_bitrate /* header */, NULL /* filter */, NULL /* output */, NULL /* error */, NULL /* message */); result = mad_decoder_run(&decoder, MAD_DECODER_MODE_SYNC); mad_decoder_finish(&decoder); *bitrate = gbs.bitrate; return SR_SUCCESS; } static enum mad_flow input_get_bitrate (void *data, struct mad_stream *stream) { GET_BITRATE_STRUCT* gbs = (GET_BITRATE_STRUCT*) data; if (!gbs->mpgsize) return MAD_FLOW_STOP; mad_stream_buffer(stream, gbs->mpgbuf, gbs->mpgsize); gbs->mpgsize = 0; return MAD_FLOW_CONTINUE; } static enum mad_flow header_get_bitrate (void *data, struct mad_header const *pheader) { GET_BITRATE_STRUCT* gbs = (GET_BITRATE_STRUCT*) data; gbs->bitrate = pheader->bitrate; /* stream bitrate (bps) */ debug_printf ("Decoded bitrate from stream: %ld\n", gbs->bitrate); return MAD_FLOW_STOP; } streamripper-1.64.6.orig/lib/uce_dirent.h0000644000175000017500000005351710264273011016403 0ustar abiabi/* * uce-dirent.h - operating system independent dirent implementation * * Copyright (C) 1998-2002 Toni Ronkko * * 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 TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * * May 28 1998, Toni Ronkko * * $Id: uce_dirent.h,v 1.1 2005/07/10 19:24:57 gregsharp Exp $ * * $Log: uce_dirent.h,v $ * Revision 1.1 2005/07/10 19:24:57 gregsharp * Add this cool dirent compatibility layer file. * * Revision 1.7 2002/05/13 10:48:35 tr * embedded some source code directly to the header so that no source * modules need to be included in the MS Visual C project using the * interface, removed all the dependencies to other headers of the `uce' * library so that the header can be made public * * Revision 1.6 2002/04/12 16:22:04 tr * Unified Compiling Environment (UCE) replaced `std' library * * Revision 1.5 2001/07/20 16:33:40 tr * moved to `std' library and re-named defines accordingly * * Revision 1.4 2001/07/10 16:47:18 tronkko * revised comments * * Revision 1.3 2001/01/11 13:16:43 tr * using ``uce-machine.h'' for finding out defines such as `FREEBSD' * * Revision 1.2 2000/10/08 16:00:41 tr * copy of FreeBSD man page * * Revision 1.1 2000/07/10 05:53:16 tr * Initial revision * * Revision 1.2 1998/07/19 18:29:14 tr * Added error reporting capabilities and some asserts. * * Revision 1.1 1998/07/04 16:27:51 tr * Initial revision * * * MSVC 1.0 scans automatic dependencies incorrectly when your project * contains this very header. The problem is that MSVC cannot handle * include directives inside #if..#endif block those are never entered. * Since this header ought to compile in many different operating systems, * there had to be several conditional blocks that are compiled only in * operating systems for what they were designed for. MSVC 1.0 cannot * handle inclusion of sys/dir.h in a part that is compiled only in Apollo * operating system. To fix the problem you need to insert DIR.H into * SYSINCL.DAT located in MSVC\BIN directory and restart visual C++. * Consult manuals for more informaton about the problem. * * Since many UNIX systems have dirent.h we assume to have one also. * However, if your UNIX system does not have dirent.h you can download one * for example at: http://ftp.uni-mannheim.de/ftp/GNU/dirent/dirent.tar.gz. * You can also see if you have one of dirent.h, direct.h, dir.h, ndir.h, * sys/dir.h and sys/ndir.h somewhere. Try defining HAVE_DIRENT_H, * HAVE_DIRECT_H, HAVE_DIR_H, HAVE_NDIR_H, HAVE_SYS_DIR_H and * HAVE_SYS_NDIR_H according to the files found. */ #ifndef DIRENT_H #define DIRENT_H #define DIRENT_H_INCLUDED /* find out platform */ #if defined(MSDOS) /* MS-DOS */ #elif defined(__MSDOS__) /* Turbo C/Borland */ # define MSDOS #elif defined(__DOS__) /* Watcom */ # define MSDOS #endif #if defined(WIN32) /* MS-Windows */ #elif defined(__NT__) /* Watcom */ # define WIN32 #elif defined(_WIN32) /* Microsoft */ # define WIN32 #elif defined(__WIN32__) /* Borland */ # define WIN32 #endif /* * See what kind of dirent interface we have unless autoconf has already * determinated that. */ #if !defined(HAVE_DIRENT_H) && !defined(HAVE_DIRECT_H) && !defined(HAVE_SYS_DIR_H) && !defined(HAVE_NDIR_H) && !defined(HAVE_SYS_NDIR_H) && !defined(HAVE_DIR_H) # if defined(_MSC_VER) /* Microsoft C/C++ */ /* no dirent.h */ # elif defined(__BORLANDC__) /* Borland C/C++ */ # define HAVE_DIRENT_H # define VOID_CLOSEDIR # elif defined(__TURBOC__) /* Borland Turbo C */ /* no dirent.h */ # elif defined(__WATCOMC__) /* Watcom C/C++ */ # define HAVE_DIRECT_H # elif defined(__apollo) /* Apollo */ # define HAVE_SYS_DIR_H # elif defined(__hpux) /* HP-UX */ # define HAVE_DIRENT_H # elif defined(__alpha) || defined(__alpha__) /* Alpha OSF1 */ # error "not implemented" # elif defined(__sgi) /* Silicon Graphics */ # define HAVE_DIRENT_H # elif defined(sun) || defined(_sun) /* Sun Solaris */ # define HAVE_DIRENT_H # elif defined(__FreeBSD__) /* FreeBSD */ # define HAVE_DIRENT_H # elif defined(__linux__) /* Linux */ # define HAVE_DIRENT_H # elif defined(__GNUC__) /* GNU C/C++ */ # define HAVE_DIRENT_H # else # error "not implemented" # endif #endif /* include proper interface headers */ #if defined(HAVE_DIRENT_H) # include # ifdef FREEBSD # define NAMLEN(dp) ((int)((dp)->d_namlen)) # else # define NAMLEN(dp) ((int)(strlen((dp)->d_name))) # endif #elif defined(HAVE_NDIR_H) # include # define NAMLEN(dp) ((int)((dp)->d_namlen)) #elif defined(HAVE_SYS_NDIR_H) # include # define NAMLEN(dp) ((int)((dp)->d_namlen)) #elif defined(HAVE_DIRECT_H) # include # define NAMLEN(dp) ((int)((dp)->d_namlen)) #elif defined(HAVE_DIR_H) # include # define NAMLEN(dp) ((int)((dp)->d_namlen)) #elif defined(HAVE_SYS_DIR_H) # include # include # ifndef dirent # define dirent direct # endif # define NAMLEN(dp) ((int)((dp)->d_namlen)) #elif defined(MSDOS) || defined(WIN32) /* figure out type of underlaying directory interface to be used */ # if defined(WIN32) # define DIRENT_WIN32_INTERFACE # elif defined(MSDOS) # define DIRENT_MSDOS_INTERFACE # else # error "missing native dirent interface" # endif /*** WIN32 specifics ***/ # if defined(DIRENT_WIN32_INTERFACE) # include # if !defined(DIRENT_MAXNAMLEN) # define DIRENT_MAXNAMLEN (MAX_PATH) # endif /*** MS-DOS specifics ***/ # elif defined(DIRENT_MSDOS_INTERFACE) # include /* Borland defines file length macros in dir.h */ # if defined(__BORLANDC__) # include # if !defined(DIRENT_MAXNAMLEN) # define DIRENT_MAXNAMLEN ((MAXFILE)+(MAXEXT)) # endif # if !defined(_find_t) # define _find_t find_t # endif /* Turbo C defines ffblk structure in dir.h */ # elif defined(__TURBOC__) # include # if !defined(DIRENT_MAXNAMLEN) # define DIRENT_MAXNAMLEN ((MAXFILE)+(MAXEXT)) # endif # define DIRENT_USE_FFBLK /* MSVC */ # elif defined(_MSC_VER) # if !defined(DIRENT_MAXNAMLEN) # define DIRENT_MAXNAMLEN (12) # endif /* Watcom */ # elif defined(__WATCOMC__) # if !defined(DIRENT_MAXNAMLEN) # if defined(__OS2__) || defined(__NT__) # define DIRENT_MAXNAMLEN (255) # else # define DIRENT_MAXNAMLEN (12) # endif # endif # endif # endif /*** generic MS-DOS and MS-Windows stuff ***/ # if !defined(NAME_MAX) && defined(DIRENT_MAXNAMLEN) # define NAME_MAX DIRENT_MAXNAMLEN # endif # if NAME_MAX < DIRENT_MAXNAMLEN # error "assertion failed: NAME_MAX >= DIRENT_MAXNAMLEN" # endif /* * Substitute for real dirent structure. Note that `d_name' field is a * true character array although we have it copied in the implementation * dependent data. We could save some memory if we had declared `d_name' * as a pointer refering the name within implementation dependent data. * We have not done that since some code may rely on sizeof(d_name) to be * something other than four. Besides, directory entries are typically so * small that it takes virtually no time to copy them from place to place. */ typedef struct dirent { char d_name[NAME_MAX + 1]; /*** Operating system specific part ***/ # if defined(DIRENT_WIN32_INTERFACE) /*WIN32*/ WIN32_FIND_DATA data; # elif defined(DIRENT_MSDOS_INTERFACE) /*MSDOS*/ # if defined(DIRENT_USE_FFBLK) struct ffblk data; # else struct _find_t data; # endif # endif } dirent; /* DIR substitute structure containing directory name. The name is * essential for the operation of ``rewinndir'' function. */ typedef struct DIR { char *dirname; /* directory being scanned */ dirent current; /* current entry */ int dirent_filled; /* is current un-processed? */ /*** Operating system specific part ***/ # if defined(DIRENT_WIN32_INTERFACE) HANDLE search_handle; # elif defined(DIRENT_MSDOS_INTERFACE) # endif } DIR; # ifdef __cplusplus extern "C" { # endif /* supply prototypes for dirent functions */ static DIR *opendir (const char *dirname); static struct dirent *readdir (DIR *dirp); static int closedir (DIR *dirp); static void rewinddir (DIR *dirp); /* * Implement dirent interface as static functions so that the user does not * need to change his project in any way to use dirent function. With this * it is sufficient to include this very header from source modules using * dirent functions and the functions will be pulled in automatically. */ #include #include #include #include #include /* use ffblk instead of _find_t if requested */ #if defined(DIRENT_USE_FFBLK) # define _A_ARCH (FA_ARCH) # define _A_HIDDEN (FA_HIDDEN) # define _A_NORMAL (0) # define _A_RDONLY (FA_RDONLY) # define _A_SUBDIR (FA_DIREC) # define _A_SYSTEM (FA_SYSTEM) # define _A_VOLID (FA_LABEL) # define _dos_findnext(dest) findnext(dest) # define _dos_findfirst(name,flags,dest) findfirst(name,dest,flags) #endif static int _initdir (DIR *p); static const char *_getdirname (const struct dirent *dp); static void _setdirname (struct DIR *dirp); /* * * open directory stream for reading * DIR *opendir (const char *dirname); * * Open named directory stream for read and return pointer to the * internal working area that is used for retrieving individual directory * entries. The internal working area has no fields of your interest. * * Returns a pointer to the internal working area or NULL in case the * directory stream could not be opened. Global `errno' variable will set * in case of error as follows: * * * [EACESS |Permission denied. * [EMFILE |Too many open files used by the process. * [ENFILE |Too many open files in system. * [ENOENT |Directory does not exist. * [ENOMEM |Insufficient memory. * [ENOTDIR |dirname does not refer to directory. This value is not * reliable on MS-DOS and MS-Windows platforms. Many * implementations return ENOENT even when the name refers to a * file.] *
*
*/ static DIR * opendir( const char *dirname) { DIR *dirp; assert (dirname != NULL); dirp = (DIR*)malloc (sizeof (struct DIR)); if (dirp != NULL) { char *p; /* allocate room for directory name */ dirp->dirname = (char*) malloc (strlen (dirname) + 1 + strlen ("\\*.*")); if (dirp->dirname == NULL) { /* failed to duplicate directory name. errno set by malloc() */ free (dirp); return NULL; } /* Copy directory name while appending directory separator and "*.*". * Directory separator is not appended if the name already ends with * drive or directory separator. Directory separator is assumed to be * '/' or '\' and drive separator is assumed to be ':'. */ strcpy (dirp->dirname, dirname); p = strchr (dirp->dirname, '\0'); if (dirp->dirname < p && *(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':') { strcpy (p++, "\\"); } # ifdef DIRENT_WIN32_INTERFACE strcpy (p, "*"); /*scan files with and without extension in win32*/ # else strcpy (p, "*.*"); /*scan files with and without extension in DOS*/ # endif /* open stream */ if (_initdir (dirp) == 0) { /* initialization failed */ free (dirp->dirname); free (dirp); return NULL; } } return dirp; } /* * * read a directory entry * struct dirent *readdir (DIR *dirp); * * Read individual directory entry and return pointer to a structure * containing the name of the entry. Individual directory entries returned * include normal files, sub-directories, pseudo-directories "." and ".." * and also volume labels, hidden files and system files in MS-DOS and * MS-Windows. You might want to use stat(2) function to determinate which * one are you dealing with. Many dirent implementations already contain * equivalent information in dirent structure but you cannot depend on * this. * * The dirent structure contains several system dependent fields that * generally have no interest to you. The only interesting one is char * d_name[] that is also portable across different systems. The d_name * field contains the name of the directory entry without leading path. * While d_name is portable across different systems the actual storage * capacity of d_name varies from system to system and there is no portable * way to find out it at compile time as different systems define the * capacity of d_name with different macros and some systems do not define * capacity at all (besides actual declaration of the field). If you really * need to find out storage capacity of d_name then you might want to try * NAME_MAX macro. The NAME_MAX is defined in POSIX standard althought * there are many MS-DOS and MS-Windows implementations those do not define * it. There are also systems that declare d_name as "char d_name[1]" and * then allocate suitable amount of memory at run-time. Thanks to Alain * Decamps (Alain.Decamps@advalvas.be) for pointing it out to me. * * This all leads to the fact that it is difficult to allocate space * for the directory names when the very same program is being compiled on * number of operating systems. Therefore I suggest that you always * allocate space for directory names dynamically. * * * Returns a pointer to a structure containing name of the directory entry * in `d_name' field or NULL if there was an error. In case of an error the * global `errno' variable will set as follows: * * * [EBADF |dir parameter refers to an invalid directory stream. This value * is not set reliably on all implementations.] *
*
*/ static struct dirent * readdir (DIR *dirp) { assert (dirp != NULL); if (dirp == NULL) { errno = EBADF; return NULL; } #if defined(DIRENT_WIN32_INTERFACE) if (dirp->search_handle == INVALID_HANDLE_VALUE) { /* directory stream was opened/rewound incorrectly or it ended normally */ errno = EBADF; return NULL; } #endif if (dirp->dirent_filled != 0) { /* * Directory entry has already been retrieved and there is no need to * retrieve a new one. Directory entry will be retrieved in advance * when the user calls readdir function for the first time. This is so * because real dirent has separate functions for opening and reading * the stream whereas Win32 and DOS dirents open the stream * automatically when we retrieve the first file. Therefore, we have to * save the first file when opening the stream and later we have to * return the saved entry when the user tries to read the first entry. */ dirp->dirent_filled = 0; } else { /* fill in entry and return that */ #if defined(DIRENT_WIN32_INTERFACE) if (FindNextFile (dirp->search_handle, &dirp->current.data) == FALSE) { /* Last file has been processed or an error occured */ FindClose (dirp->search_handle); dirp->search_handle = INVALID_HANDLE_VALUE; errno = ENOENT; return NULL; } # elif defined(DIRENT_MSDOS_INTERFACE) if (_dos_findnext (&dirp->current.data) != 0) { /* _dos_findnext and findnext will set errno to ENOENT when no * more entries could be retrieved. */ return NULL; } # endif _setdirname (dirp); assert (dirp->dirent_filled == 0); } return &dirp->current; } /* * * close directory stream. * int closedir (DIR *dirp); * * Close directory stream opened by the `opendir' function. Close of * directory stream invalidates the DIR structure as well as previously read * dirent entry. * * The function typically returns 0 on success and -1 on failure but * the function may be declared to return void on same systems. At least * Borland C/C++ and some UNIX implementations use void as a return type. * The dirent wrapper tries to define VOID_CLOSEDIR whenever closedir is * known to return nothing. The very same definition is made by the GNU * autoconf if you happen to use it. * * The global `errno' variable will set to EBADF in case of error. * */ static int closedir (DIR *dirp) { int retcode = 0; /* make sure that dirp points to legal structure */ assert (dirp != NULL); if (dirp == NULL) { errno = EBADF; return -1; } /* free directory name and search handles */ if (dirp->dirname != NULL) free (dirp->dirname); #if defined(DIRENT_WIN32_INTERFACE) if (dirp->search_handle != INVALID_HANDLE_VALUE) { if (FindClose (dirp->search_handle) == FALSE) { /* Unknown error */ retcode = -1; errno = EBADF; } } #endif /* clear dirp structure to make sure that it cannot be used anymore*/ memset (dirp, 0, sizeof (*dirp)); # if defined(DIRENT_WIN32_INTERFACE) dirp->search_handle = INVALID_HANDLE_VALUE; # endif free (dirp); return retcode; } /* * * rewind directory stream to the beginning * void rewinddir (DIR *dirp); * * Rewind directory stream to the beginning so that the next call of * readdir() returns the very first directory entry again. However, note * that next call of readdir() may not return the same directory entry as it * did in first time. The directory stream may have been affected by newly * created files. * * Almost every dirent implementation ensure that rewinddir will update * the directory stream to reflect any changes made to the directory entries * since the previous ``opendir'' or ``rewinddir'' call. Keep an eye on * this if your program depends on the feature. I know at least one dirent * implementation where you are required to close and re-open the stream to * see the changes. * * Returns nothing. If something went wrong while rewinding, you will * notice it later when you try to retrieve the first directory entry. */ static void rewinddir (DIR *dirp) { /* make sure that dirp is legal */ assert (dirp != NULL); if (dirp == NULL) { errno = EBADF; return; } assert (dirp->dirname != NULL); /* close previous stream */ #if defined(DIRENT_WIN32_INTERFACE) if (dirp->search_handle != INVALID_HANDLE_VALUE) { if (FindClose (dirp->search_handle) == FALSE) { /* Unknown error */ errno = EBADF; } } #endif /* re-open previous stream */ if (_initdir (dirp) == 0) { /* initialization failed but we cannot deal with error. User will notice * error later when she tries to retrieve first directory enty. */ /*EMPTY*/; } } /* * Open native directory stream object and retrieve first file. * Be sure to close previous stream before opening new one. */ static int _initdir (DIR *dirp) { assert (dirp != NULL); assert (dirp->dirname != NULL); dirp->dirent_filled = 0; # if defined(DIRENT_WIN32_INTERFACE) /* Open stream and retrieve first file */ dirp->search_handle = FindFirstFile (dirp->dirname, &dirp->current.data); if (dirp->search_handle == INVALID_HANDLE_VALUE) { /* something went wrong but we don't know what. GetLastError() could * give us more information about the error, but then we should map * the error code into errno. */ errno = ENOENT; return 0; } # elif defined(DIRENT_MSDOS_INTERFACE) if (_dos_findfirst (dirp->dirname, _A_SUBDIR | _A_RDONLY | _A_ARCH | _A_SYSTEM | _A_HIDDEN, &dirp->current.data) != 0) { /* _dos_findfirst and findfirst will set errno to ENOENT when no * more entries could be retrieved. */ return 0; } # endif /* initialize DIR and it's first entry */ _setdirname (dirp); dirp->dirent_filled = 1; return 1; } /* * Return implementation dependent name of the current directory entry. */ static const char * _getdirname (const struct dirent *dp) { #if defined(DIRENT_WIN32_INTERFACE) return dp->data.cFileName; #elif defined(DIRENT_USE_FFBLK) return dp->data.ff_name; #else return dp->data.name; #endif } /* * Copy name of implementation dependent directory entry to the d_name field. */ static void _setdirname (struct DIR *dirp) { /* make sure that d_name is long enough */ assert (strlen (_getdirname (&dirp->current)) <= NAME_MAX); strncpy (dirp->current.d_name, _getdirname (&dirp->current), NAME_MAX); dirp->current.d_name[NAME_MAX] = '\0'; /*char d_name[NAME_MAX+1]*/ } # ifdef __cplusplus } # endif # define NAMLEN(dp) ((int)(strlen((dp)->d_name))) #else # error "missing dirent interface" #endif #endif /*DIRENT_H*/ streamripper-1.64.6.orig/lib/threadlib.h0000644000175000017500000000145510755655354016235 0ustar abiabi#ifndef __THREADLIB_H__ #define __THREADLIB_H__ #include "srtypes.h" #include "errors.h" #include "compat.h" /****************************************************************************** * Public functions *****************************************************************************/ error_code threadlib_beginthread (THREAD_HANDLE *thread, void (*callback)(void *), void* arg); extern BOOL threadlib_isrunning(THREAD_HANDLE *thread); extern void threadlib_waitforclose(THREAD_HANDLE *thread); extern void threadlib_endthread(THREAD_HANDLE *thread); extern BOOL threadlib_sem_signaled(HSEM *e); extern HSEM threadlib_create_sem(); extern error_code threadlib_waitfor_sem(HSEM *e); extern error_code threadlib_signal_sem(HSEM *e); extern void threadlib_destroy_sem(HSEM *e); #endif //__THREADLIB__ streamripper-1.64.6.orig/fake_external_metadata.pl0000755000175000017500000000171210335216171020344 0ustar abiabi#! /usr/bin/perl ########################################################################### # This is an external script that I use for testing streamripper's # external program interface. It implements the following: # # 1) Generates (random) title and artist information # 2) Sends the information to streamripper # # To invoke the script, do this: # streamripper URL -E "perl fake_external_metadata.pl" # # This script is in the public domain. You are free to use, modify and # redistribute without restrictions. ########################################################################### $repno = 4; $ts = "AAA"; $as = "001"; $title = "TITLE=$ts\n"; $artist = "ARTIST=$as\n"; while (1) { if ($repno-- < 0) { $repno = 4; $as++; $ts++; $title = "TITLE=$ts\n"; $artist = "ARTIST=$as\n"; } $end_of_record = ".\n"; $meta_data = $title . $artist . $end_of_record; syswrite (STDOUT, $meta_data, length($meta_data)); sleep (10); } streamripper-1.64.6.orig/configure0000755000175000017500000127552711164273421015267 0ustar abiabi#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63 for streamripper 1.64.6. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## 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 # PATH needs CR # 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_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 if (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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. 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 # Name of the executable. 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'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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 { (exit 1); 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 } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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=: 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 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='streamripper' PACKAGE_TARNAME='streamripper' PACKAGE_VERSION='1.64.6' PACKAGE_STRING='streamripper 1.64.6' PACKAGE_BUGREPORT='' # 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" enable_option_checking=no ac_subst_vars='LTLIBOBJS LIBOBJS VORBISENC_LIBS VORBISFILE_LIBS OGG_LIBS OGG_CFLAGS VORBIS_LIBS VORBIS_CFLAGS WANT_CSTREAMRIPPER_FALSE WANT_CSTREAMRIPPER_TRUE FAAD_LIBS LIBIBERTY_LIBS USE_INCLUDED_ARGV_FALSE USE_INCLUDED_ARGV_TRUE LIBCHARSET LTLIBICONV LIBICONV host_os host_vendor host_cpu host build_os build_vendor build_cpu build THREADLIBS subdirs SUBDIR_LIBMAD_FALSE SUBDIR_LIBMAD_TRUE LIBMAD GLIB_MKENUMS GOBJECT_QUERY GLIB_GENMARSHAL GLIB_LIBS GLIB_CFLAGS PKG_CONFIG EGREP GREP CPP ALLOCA RANLIB am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM 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_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking with_included_libmad with_included_argv with_curses enable_glibtest with_gnu_ld enable_rpath with_libiconv_prefix with_curses_dir with_ogg with_ogg_libraries with_ogg_includes enable_oggtest with_vorbis with_vorbis_libraries with_vorbis_includes enable_vorbistest ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG' ac_subdirs_all='libmad-0.15.1b' # 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_TARNAME}' 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_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $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_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } 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 streamripper 1.64.6 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/streamripper] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of streamripper 1.64.6:";; esac 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-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-glibtest do not try to compile and run a test GLIB program --disable-rpath do not hardcode runtime library paths --disable-oggtest Do not try to compile and run a test Ogg program --disable-vorbistest Do not try to compile and run a test Vorbis program Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-included-libmad use the libmad library included with streamripper --with-included-argv use argv.c included with streamripper --with-curses(=XXX) compile curses front-end (XXX is curses (default), ncurses, ncursesw, pdcurses or slang) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-curses-dir=DIR directory in which (n)curses is installed --with-ogg=PFX Prefix where libogg is installed (optional) --with-ogg-libraries=DIR Directory where libogg library is installed (optional) --with-ogg-includes=DIR Directory where libogg header files are installed (optional) --with-vorbis=PFX Prefix where libvorbis is installed (optional) --with-vorbis-libraries=DIR Directory where libvorbis library is installed (optional) --with-vorbis-includes=DIR Directory where libvorbis header files are installed (optional) 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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 streamripper configure 1.64.6 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 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 streamripper $as_me 1.64.6, which was generated by GNU Autoconf 2.63. 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) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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:$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= ;; #( *) $as_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'; { (exit 1); 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 # 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 # 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 -r "$ac_site_file"; then { $as_echo "$as_me:$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. if test -f "$cache_file"; then { $as_echo "$as_me:$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:$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:$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:$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:$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:$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:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$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_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 am__api_version='1.10' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 $as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } 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:$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:$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' { $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 $as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 $as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P 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. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk 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:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # 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_AWK="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:$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:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='streamripper' VERSION='1.64.6' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$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 STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers lib/config.h" 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:$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:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$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:$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:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$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:$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:$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:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$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:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$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:$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:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$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:$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:$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:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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:$LINENO: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 $as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$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:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$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:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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" 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { $as_echo "$as_me:$LINENO: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$GCC"; then CFLAGS="$CFLAGS -Wall" fi # 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:$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:$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' 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:$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:$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:$LINENO: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:$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:$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:$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:$LINENO: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:$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:$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:$LINENO: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if test "${ac_cv_c_inline+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { $as_echo "$as_me:$LINENO: checking for main in -lm" >&5 $as_echo_n "checking for main in -lm... " >&6; } if test "${ac_cv_lib_m_main+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_m_main=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_main=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 $as_echo "$ac_cv_lib_m_main" >&6; } if test "x$ac_cv_lib_m_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" 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:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # 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:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # 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:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } 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:$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 ac_count=`expr $ac_count + 1` 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_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$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 ac_count=`expr $ac_count + 1` 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_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : 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 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` 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 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:$LINENO: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_working_alloca_h=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_alloca_works=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF { $as_echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if test "${ac_cv_os_cray+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { $as_echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { $as_echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { return find_stack_direction () < 0; } _ACEOF rm -f conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 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 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi # Check whether --with-included-libmad was given. if test "${with_included_libmad+set}" = set; then withval=$with_included_libmad; fi # Check whether --with-included-argv was given. if test "${with_included_argv+set}" = set; then withval=$with_included_argv; fi # Check whether --with-curses was given. if test "${with_curses+set}" = set; then withval=$with_curses; fi CPPFLAGS="-D__UNIX__" # Check whether --enable-glibtest was given. if test "${enable_glibtest+set}" = set; then enableval=$enable_glibtest; else enable_glibtest=yes fi pkg_config_args=glib-2.0 for module in . do case "$module" in gmodule) pkg_config_args="$pkg_config_args gmodule-2.0" ;; gmodule-no-export) pkg_config_args="$pkg_config_args gmodule-no-export-2.0" ;; gobject) pkg_config_args="$pkg_config_args gobject-2.0" ;; gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # 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_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # 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_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$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 PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.7 { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi no_glib="" if test "x$PKG_CONFIG" = x ; then no_glib=yes PKG_CONFIG=no fi min_glib_version=2.16.0 { $as_echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 $as_echo_n "checking for GLIB - version >= $min_glib_version... " >&6; } if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" enable_glibtest=no fi if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then : else no_glib=yes fi fi if test x"$no_glib" = x ; then GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" rm -f conf.glibtest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.glibtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_glib_version"); exit(1); } if ((glib_major_version != $glib_config_major_version) || (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || (glib_micro_version != GLIB_MICRO_VERSION)) { printf("*** GLIB header files (version %d.%d.%d) do not match\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", glib_major_version, glib_minor_version, glib_micro_version); } else { if ((glib_major_version > major) || ((glib_major_version == major) && (glib_minor_version > minor)) || ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", glib_major_version, glib_minor_version, glib_micro_version); printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF rm -f conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : 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 ( exit $ac_status ) no_glib=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then { $as_echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 $as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; } : else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB is incorrectly installed." fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" GLIB_GENMARSHAL="" GOBJECT_QUERY="" GLIB_MKENUMS="" { { $as_echo "$as_me:$LINENO: error: Glib 2.16 or greater required" >&5 $as_echo "$as_me: error: Glib 2.16 or greater required" >&2;} { (exit 1); exit 1; }; } fi rm -f conf.glibtest LIBMAD="" use_included_libmad=yes if test "x$with_included_libmad" != xyes; then sr_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-Ilib -D__UNIX__" { $as_echo "$as_me:$LINENO: checking for mad_stream_buffer in -lmad" >&5 $as_echo_n "checking for mad_stream_buffer in -lmad... " >&6; } if test "${ac_cv_lib_mad_mad_stream_buffer+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmad $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char mad_stream_buffer (); int main () { return mad_stream_buffer (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_mad_mad_stream_buffer=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mad_mad_stream_buffer=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mad_mad_stream_buffer" >&5 $as_echo "$ac_cv_lib_mad_mad_stream_buffer" >&6; } if test "x$ac_cv_lib_mad_mad_stream_buffer" = x""yes; then use_included_libmad=no else use_included_libmad=yes fi CPPFLAGS="$sr_save_CPPFLAGS" fi if test "$use_included_libmad" = yes; then SUBDIR_LIBMAD_TRUE= SUBDIR_LIBMAD_FALSE='#' else SUBDIR_LIBMAD_TRUE='#' SUBDIR_LIBMAD_FALSE= fi if test "$use_included_libmad" = yes; then LIBMAD="libmad-0.15.1b/.libs/libmad.a" subdirs="$subdirs libmad-0.15.1b" else LIBMAD=-lmad fi THREADLIBS=no { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_pthread_pthread_create=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then THREADLIBS="-lpthread" fi if test "$THREADLIBS" = no; then { $as_echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 $as_echo_n "checking for pthread_create in -lc_r... " >&6; } if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_c_r_pthread_create=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_create=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 $as_echo "$ac_cv_lib_c_r_pthread_create" >&6; } if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then THREADLIBS="-pthread" fi fi if test "$THREADLIBS" = no; then { $as_echo "$as_me:$LINENO: checking for pthread_create in -ldce" >&5 $as_echo_n "checking for pthread_create in -ldce... " >&6; } if test "${ac_cv_lib_dce_pthread_create+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldce $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dce_pthread_create=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dce_pthread_create=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dce_pthread_create" >&5 $as_echo "$ac_cv_lib_dce_pthread_create" >&6; } if test "x$ac_cv_lib_dce_pthread_create" = x""yes; then THREADLIBS="-ldce" fi fi if test "$THREADLIBS" = no; then { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5 $as_echo_n "checking for pthread_create in -lpthreads... " >&6; } if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_pthreads_pthread_create=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_create=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5 $as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; } if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then THREADLIBS="-lpthreads" fi fi if test "$THREADLIBS" = no; then { { $as_echo "$as_me:$LINENO: error: Your system doesn't seem to support posix threads" >&5 $as_echo "$as_me: error: Your system doesn't seem to support posix threads" >&2;} { (exit 1); exit 1; }; } exit fi { $as_echo "$as_me:$LINENO: checking for socklen_t" >&5 $as_echo_n "checking for socklen_t... " >&6; } if test "${ac_cv_type_socklen_t+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { socklen_t len = 42; return 0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_socklen_t=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_socklen_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 $as_echo "$ac_cv_type_socklen_t" >&6; } if test $ac_cv_type_socklen_t != yes; then cat >>confdefs.h <<\_ACEOF #define socklen_t int _ACEOF fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_opendir=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_opendir=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { $as_echo "$as_me:$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : 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 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$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:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` 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 wchar.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$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:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` 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 wctype.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$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:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` 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 { $as_echo "$as_me:$LINENO: checking for wchar_t" >&5 $as_echo_n "checking for wchar_t... " >&6; } if test "${ac_cv_type_wchar_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_wchar_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_WCHAR_H #include #endif #if STDC_HEADERS #include #endif int main () { if (sizeof (wchar_t)) return 0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_WCHAR_H #include #endif #if STDC_HEADERS #include #endif int main () { if (sizeof ((wchar_t))) return 0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_wchar_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5 $as_echo "$ac_cv_type_wchar_t" >&6; } if test "x$ac_cv_type_wchar_t" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_WCHAR_T 1 _ACEOF fi for ac_func in iswcntrl do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in vswprintf do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5 $as_echo_n "checking whether mbrtowc and mbstate_t are properly declared... " >&6; } if test "${ac_cv_func_mbrtowc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { wchar_t wc; char const s[] = ""; size_t n = 1; mbstate_t state; return ! (sizeof state && (mbrtowc) (&wc, s, n, &state)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_mbrtowc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_mbrtowc=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_mbrtowc" >&5 $as_echo "$ac_cv_func_mbrtowc" >&6; } if test $ac_cv_func_mbrtowc = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MBRTOWC 1 _ACEOF fi if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 $as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 $as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:$LINENO: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 $as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:$LINENO: checking for ld used by GCC" >&5 $as_echo_n "checking for ld used by GCC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${acl_cv_path_LD+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$acl_cv_path_LD" if test -n "$LD"; then { $as_echo "$as_me:$LINENO: result: $LD" >&5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then acl_cv_prog_gnu_ld=yes else acl_cv_prog_gnu_ld=no fi fi { $as_echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:$LINENO: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if test "${acl_cv_rpath+set}" = set; then $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then enableval=$enable_rpath; : else enable_rpath=yes fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi fi LIBICONV= LTLIBICONV= INCICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:$LINENO: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if test "${am_cv_func_iconv+set}" = set; then $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then am_cv_func_iconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:$LINENO: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:$LINENO: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:$LINENO: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } if test "${am_cv_proto_iconv+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then am_cv_proto_iconv_arg1="" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { $as_echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 $as_echo "${ac_t:- }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; } if test "${am_cv_langinfo_codeset+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char* cs = nl_langinfo(CODESET); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then am_cv_langinfo_codeset=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_langinfo_codeset=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 $as_echo "$am_cv_langinfo_codeset" >&6; } if test $am_cv_langinfo_codeset = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LANGINFO_CODESET 1 _ACEOF fi sr_find_locale_charset=yes if test $am_cv_langinfo_codeset = yes; then sr_find_locale_charset=no fi if test $sr_find_locale_charset = yes; then { $as_echo "$as_me:$LINENO: checking for locale_charset in -lcharset" >&5 $as_echo_n "checking for locale_charset in -lcharset... " >&6; } if test "${ac_cv_lib_charset_locale_charset+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcharset $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char locale_charset (); int main () { return locale_charset (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_charset_locale_charset=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_charset_locale_charset=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_charset_locale_charset" >&5 $as_echo "$ac_cv_lib_charset_locale_charset" >&6; } if test "x$ac_cv_lib_charset_locale_charset" = x""yes; then sr_find_locale_charset=yes else sr_find_locale_charset=no fi fi if test $sr_find_locale_charset = yes; then { $as_echo "$as_me:$LINENO: checking whether locale_charset is declared" >&5 $as_echo_n "checking whether locale_charset is declared... " >&6; } if test "${ac_cv_have_decl_locale_charset+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef locale_charset (void) locale_charset; #endif ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_locale_charset=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_locale_charset=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_locale_charset" >&5 $as_echo "$ac_cv_have_decl_locale_charset" >&6; } if test "x$ac_cv_have_decl_locale_charset" = x""yes; then sr_find_locale_charset=yes else sr_find_locale_charset=no fi fi if test $sr_find_locale_charset = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LOCALE_CHARSET 1 _ACEOF LIBCHARSET="-lcharset" fi have_wchar=no if test "$ac_cv_type_wchar_t" = yes; then if test "$ac_cv_func_mbrtowc" = yes; then if test "$ac_cv_func_iswcntrl" = yes; then if test "$am_cv_func_iconv" = yes; then have_wchar=yes fi fi fi fi use_included_argv=yes if test "x$with_included_argv" != xyes; then { $as_echo "$as_me:$LINENO: checking for buildargv in -liberty" >&5 $as_echo_n "checking for buildargv in -liberty... " >&6; } if test "${ac_cv_lib_iberty_buildargv+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liberty $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char buildargv (); int main () { return buildargv (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_iberty_buildargv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iberty_buildargv=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_iberty_buildargv" >&5 $as_echo "$ac_cv_lib_iberty_buildargv" >&6; } if test "x$ac_cv_lib_iberty_buildargv" = x""yes; then use_included_argv=no else use_included_argv=yes fi fi if test "$use_included_argv" = yes; then USE_INCLUDED_ARGV_TRUE= USE_INCLUDED_ARGV_FALSE='#' else USE_INCLUDED_ARGV_TRUE='#' USE_INCLUDED_ARGV_FALSE= fi if test "$use_included_argv" = yes; then LIBIBERTY_LIBS="" else LIBIBERTY_LIBS="-liberty" fi { $as_echo "$as_me:$LINENO: checking for NeAACDecDecode2 in -lfaad" >&5 $as_echo_n "checking for NeAACDecDecode2 in -lfaad... " >&6; } if test "${ac_cv_lib_faad_NeAACDecDecode2+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfaad $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char NeAACDecDecode2 (); int main () { return NeAACDecDecode2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_faad_NeAACDecDecode2=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_faad_NeAACDecDecode2=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_faad_NeAACDecDecode2" >&5 $as_echo "$ac_cv_lib_faad_NeAACDecDecode2" >&6; } if test "x$ac_cv_lib_faad_NeAACDecDecode2" = x""yes; then FAAD_LIBS="-lfaad" cat >>confdefs.h <<\_ACEOF #define HAVE_FAAD 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_FAAD 0 _ACEOF fi if test x$with_curses = xyes || test x$with_curses = x ; then found_curses=no if test x$found_curses = xno; then { $as_echo "$as_me:$LINENO: checking for initscr in -lncurses " >&5 $as_echo_n "checking for initscr in -lncurses ... " >&6; } if test "${ac_cv_lib_ncurses__initscr+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char initscr (); int main () { return initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_ncurses__initscr=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ncurses__initscr=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses__initscr" >&5 $as_echo "$ac_cv_lib_ncurses__initscr" >&6; } if test "x$ac_cv_lib_ncurses__initscr" = x""yes; then found_curses=yes with_curses=ncurses fi fi if test x$found_curses = xno; then { $as_echo "$as_me:$LINENO: checking for initscr in -lcurses " >&5 $as_echo_n "checking for initscr in -lcurses ... " >&6; } if test "${ac_cv_lib_curses___initscr+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char initscr (); int main () { return initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_curses___initscr=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_curses___initscr=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_curses___initscr" >&5 $as_echo "$ac_cv_lib_curses___initscr" >&6; } if test "x$ac_cv_lib_curses___initscr" = x""yes; then found_curses=yes with_curses=curses fi fi if test x$found_curses = xno; then { $as_echo "$as_me:$LINENO: checking for initscr in -lncursesw" >&5 $as_echo_n "checking for initscr in -lncursesw... " >&6; } if test "${ac_cv_lib_ncursesw_initscr+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncursesw $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char initscr (); int main () { return initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_ncursesw_initscr=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ncursesw_initscr=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ncursesw_initscr" >&5 $as_echo "$ac_cv_lib_ncursesw_initscr" >&6; } if test "x$ac_cv_lib_ncursesw_initscr" = x""yes; then found_curses=yes with_curses=ncursesw fi fi if test x$found_curses = xno; then { $as_echo "$as_me:$LINENO: checking for initscr in -lpdcurses" >&5 $as_echo_n "checking for initscr in -lpdcurses... " >&6; } if test "${ac_cv_lib_pdcurses_initscr+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpdcurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char initscr (); int main () { return initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_pdcurses_initscr=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pdcurses_initscr=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pdcurses_initscr" >&5 $as_echo "$ac_cv_lib_pdcurses_initscr" >&6; } if test "x$ac_cv_lib_pdcurses_initscr" = x""yes; then found_curses=yes with_curses=pdcurses fi fi if test x$found_curses = xno; then with_curses=no fi fi case x$with_curses in xcurses) # Check whether --with-curses-dir was given. if test "${with_curses_dir+set}" = set; then withval=$with_curses_dir; if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".$withval" in #(vi .\$\(*\)*|.\'*\'*) #(vi ;; ..|./*|.\\*) #(vi ;; .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX ;; .\${*prefix}*) #(vi eval withval="$withval" case ".$withval" in #(vi .NONE/*) withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; #(vi .no|.NONE/*) withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) { { $as_echo "$as_me:$LINENO: error: expected a pathname, not \"$withval\"" >&5 $as_echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; esac cf_cv_curses_dir=$withval else cf_cv_curses_dir=no fi { $as_echo "$as_me:$LINENO: Request for curses" >&5 $as_echo "$as_me: Request for curses" >&6;} ;; xncurses) # Check whether --with-curses-dir was given. if test "${with_curses_dir+set}" = set; then withval=$with_curses_dir; if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".$withval" in #(vi .\$\(*\)*|.\'*\'*) #(vi ;; ..|./*|.\\*) #(vi ;; .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX ;; .\${*prefix}*) #(vi eval withval="$withval" case ".$withval" in #(vi .NONE/*) withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; #(vi .no|.NONE/*) withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) { { $as_echo "$as_me:$LINENO: error: expected a pathname, not \"$withval\"" >&5 $as_echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; esac cf_cv_curses_dir=$withval else cf_cv_curses_dir=no fi { $as_echo "$as_me:$LINENO: Request for ncurses" >&5 $as_echo "$as_me: Request for ncurses" >&6;} ;; xncursesw) # Check whether --with-curses-dir was given. if test "${with_curses_dir+set}" = set; then withval=$with_curses_dir; if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".$withval" in #(vi .\$\(*\)*|.\'*\'*) #(vi ;; ..|./*|.\\*) #(vi ;; .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX ;; .\${*prefix}*) #(vi eval withval="$withval" case ".$withval" in #(vi .NONE/*) withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; #(vi .no|.NONE/*) withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) { { $as_echo "$as_me:$LINENO: error: expected a pathname, not \"$withval\"" >&5 $as_echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; esac cf_cv_curses_dir=$withval else cf_cv_curses_dir=no fi { $as_echo "$as_me:$LINENO: Request for ncursesw" >&5 $as_echo "$as_me: Request for ncursesw" >&6;} ;; xpdcurses) { $as_echo "$as_me:$LINENO: Request for pdncurses" >&5 $as_echo "$as_me: Request for pdncurses" >&6;} ;; xno) { $as_echo "$as_me:$LINENO: Request no curses" >&5 $as_echo "$as_me: Request no curses" >&6;} ;; esac if test x$use_cdk != xno; then WANT_CSTREAMRIPPER_TRUE= WANT_CSTREAMRIPPER_FALSE='#' else WANT_CSTREAMRIPPER_TRUE='#' WANT_CSTREAMRIPPER_FALSE= fi sr_have_ogg=no # Check whether --with-ogg was given. if test "${with_ogg+set}" = set; then withval=$with_ogg; ogg_prefix="$withval" else ogg_prefix="" fi # Check whether --with-ogg-libraries was given. if test "${with_ogg_libraries+set}" = set; then withval=$with_ogg_libraries; ogg_libraries="$withval" else ogg_libraries="" fi # Check whether --with-ogg-includes was given. if test "${with_ogg_includes+set}" = set; then withval=$with_ogg_includes; ogg_includes="$withval" else ogg_includes="" fi # Check whether --enable-oggtest was given. if test "${enable_oggtest+set}" = set; then enableval=$enable_oggtest; else enable_oggtest=yes fi if test "x$ogg_libraries" != "x" ; then OGG_LIBS="-L$ogg_libraries" elif test "x$ogg_prefix" != "x" ; then OGG_LIBS="-L$ogg_prefix/lib" elif test "x$prefix" != "xNONE" ; then OGG_LIBS="-L$prefix/lib" fi OGG_LIBS="$OGG_LIBS -logg" if test "x$ogg_includes" != "x" ; then OGG_CFLAGS="-I$ogg_includes" elif test "x$ogg_prefix" != "x" ; then OGG_CFLAGS="-I$ogg_prefix/include" elif test "x$prefix" != "xNONE"; then OGG_CFLAGS="-I$prefix/include" fi { $as_echo "$as_me:$LINENO: checking for Ogg" >&5 $as_echo_n "checking for Ogg... " >&6; } no_ogg="" if test "x$enable_oggtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $OGG_CFLAGS" LIBS="$LIBS $OGG_LIBS" rm -f conf.oggtest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { system("touch conf.oggtest"); return 0; } _ACEOF rm -f conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : 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 ( exit $ac_status ) no_ogg=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi if test "x$no_ogg" = "x" ; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } # Check whether --with-vorbis was given. if test "${with_vorbis+set}" = set; then withval=$with_vorbis; vorbis_prefix="$withval" else vorbis_prefix="" fi # Check whether --with-vorbis-libraries was given. if test "${with_vorbis_libraries+set}" = set; then withval=$with_vorbis_libraries; vorbis_libraries="$withval" else vorbis_libraries="" fi # Check whether --with-vorbis-includes was given. if test "${with_vorbis_includes+set}" = set; then withval=$with_vorbis_includes; vorbis_includes="$withval" else vorbis_includes="" fi # Check whether --enable-vorbistest was given. if test "${enable_vorbistest+set}" = set; then enableval=$enable_vorbistest; else enable_vorbistest=yes fi if test "x$vorbis_libraries" != "x" ; then VORBIS_LIBS="-L$vorbis_libraries" elif test "x$vorbis_prefix" != "x" ; then VORBIS_LIBS="-L$vorbis_prefix/lib" elif test "x$prefix" != "xNONE"; then VORBIS_LIBS="-L$prefix/lib" fi VORBIS_LIBS="$VORBIS_LIBS -lvorbis -lm" VORBISFILE_LIBS="-lvorbisfile" VORBISENC_LIBS="-lvorbisenc" if test "x$vorbis_includes" != "x" ; then VORBIS_CFLAGS="-I$vorbis_includes" elif test "x$vorbis_prefix" != "x" ; then VORBIS_CFLAGS="-I$vorbis_prefix/include" elif test "x$prefix" != "xNONE"; then VORBIS_CFLAGS="-I$prefix/include" fi { $as_echo "$as_me:$LINENO: checking for Vorbis" >&5 $as_echo_n "checking for Vorbis... " >&6; } no_vorbis="" if test "x$enable_vorbistest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $VORBIS_CFLAGS $OGG_CFLAGS" LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS" rm -f conf.vorbistest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include #include int main () { vorbis_block vb; vorbis_dsp_state vd; vorbis_info vi; vorbis_info_init (&vi); vorbis_encode_init (&vi, 2, 44100, -1, 128000, -1); vorbis_analysis_init (&vd, &vi); vorbis_block_init (&vd, &vb); /* this function was added in 1.0rc3, so this is what we're testing for */ vorbis_bitrate_addblock (&vb); system("touch conf.vorbistest"); return 0; } _ACEOF rm -f conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : 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 ( exit $ac_status ) no_vorbis=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi if test "x$no_vorbis" = "x" ; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_OGG_VORBIS 1 _ACEOF sr_have_ogg=yes else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } if test -f conf.vorbistest ; then : else echo "*** Could not run Vorbis test program, checking why..." CFLAGS="$CFLAGS $VORBIS_CFLAGS" LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding Vorbis or finding the wrong" echo "*** version of Vorbis. If it is not finding Vorbis, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means Vorbis was incorrectly installed" echo "*** or that you have moved Vorbis since it was installed." fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi VORBIS_CFLAGS="" VORBIS_LIBS="" VORBISFILE_LIBS="" VORBISENC_LIBS="" cat >>confdefs.h <<\_ACEOF #define HAVE_OGG_VORBIS 0 _ACEOF fi rm -f conf.vorbistest else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } if test -f conf.oggtest ; then : else echo "*** Could not run Ogg test program, checking why..." CFLAGS="$CFLAGS $OGG_CFLAGS" LIBS="$LIBS $OGG_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding Ogg or finding the wrong" echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means Ogg was incorrectly installed" echo "*** or that you have moved Ogg since it was installed." fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi OGG_CFLAGS="" OGG_LIBS="" cat >>confdefs.h <<\_ACEOF #define HAVE_OGG_VORBIS 0 _ACEOF fi rm -f conf.oggtest { $as_echo "$as_me:$LINENO: checking for sem_init" >&5 $as_echo_n "checking for sem_init... " >&6; } if test "${ac_cv_func_sem_init+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define sem_init to an innocuous variant, in case declares sem_init. For example, HP-UX 11i declares gettimeofday. */ #define sem_init innocuous_sem_init /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sem_init (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef sem_init /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sem_init (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_sem_init || defined __stub___sem_init choke me #endif int main () { return sem_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_sem_init=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_sem_init=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_sem_init" >&5 $as_echo "$ac_cv_func_sem_init" >&6; } if test "x$ac_cv_func_sem_init" = x""yes; then : else { $as_echo "$as_me:$LINENO: checking for sem_init in -lsem" >&5 $as_echo_n "checking for sem_init in -lsem... " >&6; } if test "${ac_cv_lib_sem_sem_init+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsem $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sem_init (); int main () { return sem_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_sem_sem_init=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sem_sem_init=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_sem_sem_init" >&5 $as_echo "$ac_cv_lib_sem_sem_init" >&6; } if test "x$ac_cv_lib_sem_sem_init" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSEM 1 _ACEOF LIBS="-lsem $LIBS" fi fi { $as_echo "$as_me:$LINENO: checking for sem_init" >&5 $as_echo_n "checking for sem_init... " >&6; } if test "${ac_cv_func_sem_init+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define sem_init to an innocuous variant, in case declares sem_init. For example, HP-UX 11i declares gettimeofday. */ #define sem_init innocuous_sem_init /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sem_init (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef sem_init /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sem_init (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_sem_init || defined __stub___sem_init choke me #endif int main () { return sem_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_sem_init=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_sem_init=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_sem_init" >&5 $as_echo "$ac_cv_func_sem_init" >&6; } if test "x$ac_cv_func_sem_init" = x""yes; then : else { $as_echo "$as_me:$LINENO: checking for sem_init in -lrt" >&5 $as_echo_n "checking for sem_init in -lrt... " >&6; } if test "${ac_cv_lib_rt_sem_init+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sem_init (); int main () { return sem_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_rt_sem_init=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_rt_sem_init=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_rt_sem_init" >&5 $as_echo "$ac_cv_lib_rt_sem_init" >&6; } if test "x$ac_cv_lib_rt_sem_init" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF LIBS="-lrt $LIBS" fi fi for ac_header in stdint.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$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:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` 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 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$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:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` 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 { $as_echo "$as_me:$LINENO: checking for uint32_t" >&5 $as_echo_n "checking for uint32_t... " >&6; } if test "${ac_cv_type_uint32_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_uint32_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (uint32_t)) return 0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((uint32_t))) return 0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_uint32_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 $as_echo "$ac_cv_type_uint32_t" >&6; } if test "x$ac_cv_type_uint32_t" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_UINT32_T 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for u_int32_t" >&5 $as_echo_n "checking for u_int32_t... " >&6; } if test "${ac_cv_type_u_int32_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_u_int32_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (u_int32_t)) return 0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((u_int32_t))) return 0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_int32_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 $as_echo "$ac_cv_type_u_int32_t" >&6; } if test "x$ac_cv_type_u_int32_t" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_U_INT32_T 1 _ACEOF fi for ac_header in sys/sockio.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$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:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` 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_func in connect do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test x"$ac_cv_func_connect" = x"no"; then case "$LIBS" in *-lnsl*) ;; *) { $as_echo "$as_me:$LINENO: checking for printf in -lnsl_s" >&5 $as_echo_n "checking for printf in -lnsl_s... " >&6; } if test "${ac_cv_lib_nsl_s_printf+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl_s $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char printf (); int main () { return printf (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_nsl_s_printf=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_s_printf=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_s_printf" >&5 $as_echo "$ac_cv_lib_nsl_s_printf" >&6; } if test "x$ac_cv_lib_nsl_s_printf" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL_S 1 _ACEOF LIBS="-lnsl_s $LIBS" fi ;; esac case "$LIBS" in *-lnsl*) ;; *) { $as_echo "$as_me:$LINENO: checking for printf in -lnsl" >&5 $as_echo_n "checking for printf in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_printf+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char printf (); int main () { return printf (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_nsl_printf=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_printf=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_printf" >&5 $as_echo "$ac_cv_lib_nsl_printf" >&6; } if test "x$ac_cv_lib_nsl_printf" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi ;; esac case "$LIBS" in *-lsocket*) ;; *) { $as_echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if test "${ac_cv_lib_socket_connect+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_socket_connect=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi ;; esac case "$LIBS" in *-linet*) ;; *) { $as_echo "$as_me:$LINENO: checking for connect in -linet" >&5 $as_echo_n "checking for connect in -linet... " >&6; } if test "${ac_cv_lib_inet_connect+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_inet_connect=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_inet_connect=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_inet_connect" >&5 $as_echo "$ac_cv_lib_inet_connect" >&6; } if test "x$ac_cv_lib_inet_connect" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBINET 1 _ACEOF LIBS="-linet $LIBS" fi ;; esac if test x"$ac_cv_lib_socket_connect" = x"yes" || test x"$ac_cv_lib_inet_connect" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_CONNECT 1 _ACEOF fi fi { $as_echo "$as_me:$LINENO: checking for size_t" >&5 $as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_size_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (size_t)) return 0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((size_t))) return 0; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 $as_echo "$ac_cv_type_size_t" >&6; } if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if test "${ac_cv_type_signal+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_func in vprintf do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF { $as_echo "$as_me:$LINENO: checking for _doprnt" >&5 $as_echo_n "checking for _doprnt... " >&6; } if test "${ac_cv_func__doprnt+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define _doprnt to an innocuous variant, in case declares _doprnt. For example, HP-UX 11i declares gettimeofday. */ #define _doprnt innocuous__doprnt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef _doprnt /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char _doprnt (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub__doprnt || defined __stub____doprnt choke me #endif int main () { return _doprnt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func__doprnt=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 $as_echo "$ac_cv_func__doprnt" >&6; } if test "x$ac_cv_func__doprnt" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DOPRNT 1 _ACEOF fi fi done for ac_func in mkdir socket strerror strstr do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext 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:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_files="$ac_config_files lib/Makefile Makefile" 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:$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= ;; #( *) $as_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:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SUBDIR_LIBMAD_TRUE}" && test -z "${SUBDIR_LIBMAD_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"SUBDIR_LIBMAD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"SUBDIR_LIBMAD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_INCLUDED_ARGV_TRUE}" && test -z "${USE_INCLUDED_ARGV_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"USE_INCLUDED_ARGV\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"USE_INCLUDED_ARGV\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_CSTREAMRIPPER_TRUE}" && test -z "${WANT_CSTREAMRIPPER_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_CSTREAMRIPPER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"WANT_CSTREAMRIPPER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${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:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_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 # PATH needs CR # 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_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 if (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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. 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 # Name of the executable. 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'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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 { (exit 1); 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 } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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=: 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 # 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 streamripper $as_me 1.64.6, which was generated by GNU Autoconf 2.63. 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" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, 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 Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ streamripper config.status 1.64.6 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 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' MKDIR_P='$MKDIR_P' AWK='$AWK' 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 ;; --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 CONFIG_FILES="$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 CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --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_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _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 "lib/config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands 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 '{ (exit 1); 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_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # 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=' ' 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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } 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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } 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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } 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_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _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_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } 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_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" 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_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[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_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$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:$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_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { 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_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } 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 ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; 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:$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 s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } 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:$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_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :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_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$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_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { 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_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # 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 || { (exit 1); exit 1; } fi # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file, --srcdir, and --disable-option-checking arguments # so they do not pile up. ac_sub_configure_args= ac_prev= eval "set x $ac_configure_args" shift for ac_arg do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -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=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; --disable-option-checking) ;; *) case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" # Pass --silent if test "$silent" = yes; then ac_sub_configure_args="--silent $ac_sub_configure_args" fi # Always prepend --disable-option-checking to silence warnings, since # different subdirs can have different --enable and --with options. ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" $as_echo "$as_me:$LINENO: $ac_msg" >&5 $as_echo "$ac_msg" >&6 { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { 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_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } 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" # Check for guested configure; otherwise get Cygnus style configure. if test -f "$ac_srcdir/configure.gnu"; then ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure elif test -f "$ac_srcdir/configure.in"; then # This should be Cygnus configure. ac_sub_configure=$ac_aux_dir/configure else { $as_echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative name. ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac { $as_echo "$as_me:$LINENO: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || { { $as_echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 $as_echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} { (exit 1); exit 1; }; } fi cd "$ac_popdir" done fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi cat < sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 13 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/cf_curses.m4]) m4_include([m4/codeset.m4]) m4_include([m4/glib-2.0.m4]) m4_include([m4/iconv.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/ogg.m4]) m4_include([m4/pkg.m4]) m4_include([m4/sr_locale_charset.m4]) m4_include([m4/type_socklen_t.m4]) m4_include([m4/vorbis.m4]) streamripper-1.64.6.orig/depcomp0000644000175000017500000003477110041125257014717 0ustar abiabi#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2003-11-08.23 # Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. # 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, 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit 0 ;; -v | --v*) echo "depcomp $scriptversion" exit 0 ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: streamripper-1.64.6.orig/fetch_external_metadata.pl0000755000175000017500000000252110335216171020526 0ustar abiabi#! /usr/bin/perl ########################################################################### # This is an example script that sends external metadata to streamripper. # It implements an external program that: # 1) Fetches a web page # 2) Searches the web page for the artist and title information # 3) Sends the information to streamripper # # To invoke the script, do this: # streamripper URL -E "perl fetch_external_metadata.pl META_URL" # # This assumes that META_URL is the URL with the artist/title information # # You will need perl and LWP::Simple installed to run this script. # On unix, you install LWP::Simple as root, like this: # perl -MCPAN -e 'install LWP::Simple'; # On windows, LWP::Simple is included in the ActiveState perl distribution. # # This script is in the public domain. You are free to use, modify and # redistribute without restrictions. ########################################################################### use LWP::Simple; if ($#ARGV != 0) { die "Usage: fetch_external_metadata.pl URL\n"; } $url = $ARGV[0]; while (1) { my $content = get $url; if ($content =~ m/title="(.*)" artist="(.*)"/) { $title = "TITLE=$1\n"; $artist = "ARTIST=$2\n"; $end_of_record = ".\n"; $meta_data = $title . $artist . $end_of_record; syswrite (STDOUT, $meta_data, length($meta_data)); } sleep (10); }