upse-1.0.0/0000755000175000017500000000000011006314310012327 5ustar nenolodnenolodupse-1.0.0/.hg_archival.txt0000644000175000017500000000013611006314306015422 0ustar nenolodnenolodrepo: 06054c40150690ee4724362bdc3fa8ca821a5591 node: 54f96542e8432625933e7379c30bc093d98b9f7e upse-1.0.0/Makefile0000644000175000017500000000004311006314306013771 0ustar nenolodnenolodSUBDIRS = src include buildsys.mk upse-1.0.0/.hgtags0000644000175000017500000000006411006314306013612 0ustar nenolodnenolodd3fee44f53d842ece7de4be8b1155c7f68045a44 upse-0.6.0 upse-1.0.0/THANKS0000644000175000017500000000261111006314306013247 0ustar nenolodnenolodThanks to: Michael "mf0102" Farber, for testing coefficients, and speaking up when they were CLEARLY WRONG, writing patches and trying to break the emulation code. upse would not sound the way it does without his help, and probably would not be nearly as accurate. Xodnizel, for writing SexyPSF, which provided for some motivation for writing a PSF replayer. CaitSith2 for explaining a lot of details on how the PSF format in general works on his webpages. Tony Vroon and Giacomo Lozito for their hard work on the plugins collection in Audacious (SexyPSF would not have ever been realised on Audacious without their efforts, and as such, UPSE would never exist.) Neill Corlett for a lot of research information about when to apply what coefficients and filters and such. He was the first one to write a somewhat accurate SPU emulation, and this one builds on his research. Pete Bernert for writing PeOPS, which, while inaccurate, is the only really complete SPU implementation that is open source. Hopefully, someone will hack UPSE into a PSX/PS2 software SPU now. ;) ||basement for hosting many esoteric PSX mod rips which can now be enjoyed without the use of Highly Experimental. Check out his archive at . If I missed somebody, I'm sorry, and you should consider yourself thanked too. upse-1.0.0/configure0000755000175000017500000073232311006314310014250 0ustar nenolodnenolod#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for upse 1.0.0. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # Zsh 3.x and 4.x performs 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh 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.) as_nl=' ' 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 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. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # 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 || 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=: # Zsh 3.x and 4.x performs 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=: # Zsh 3.x and 4.x performs 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 autoconf@gnu.org about your system, echo including any error possibly output before this echo message } 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" || { 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 fi echo >conf$$.file 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 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='upse' PACKAGE_TARNAME='upse' PACKAGE_VERSION='1.0.0' PACKAGE_STRING='upse 1.0.0' PACKAGE_BUGREPORT='nenolod+upse@sacredspiral.co.uk' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os LIBBEEP_MAJOR_VERSION LIBBEEP_MINOR_VERSION LIBBEEP_MICRO_VERSION PACKAGE VERSION CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP GREP EGREP CCAS CCASFLAGS am__leading_dot DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCASDEPMODE am__fastdepCCAS_TRUE am__fastdepCCAS_FALSE LN_S SET_MAKE RM MV CP AR RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB PKG_CONFIG AUDACIOUS_CFLAGS AUDACIOUS_LIBS UPSE_TARGET_AUD AO_CFLAGS AO_LIBS LIB_CPPFLAGS LIB_CFLAGS LIB_LDFLAGS LIB_PREFIX LIB_SUFFIX PLUGIN_CPPFLAGS PLUGIN_CFLAGS PLUGIN_LDFLAGS PLUGIN_SUFFIX INSTALL_LIB UNINSTALL_LIB CLEAN_LIB PROG_IMPLIB_NEEDED PROG_IMPLIB_LDFLAGS LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP CCAS CCASFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # 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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { 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 && { 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. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { 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 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 .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { 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" || { 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 upse 1.0.0 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/upse] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of upse 1.0.0:";; esac cat <<\_ACEOF Optional Features: --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-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths --enable-audplugin enable audacious plugin (default=yes) --enable-ao enable libao support (default=yes) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --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-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir 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 CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor CCAS assembler compiler command (defaults to CC) CCASFLAGS assembler compiler flags (defaults to CFLAGS) Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 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 upse configure 1.0.0 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 upse $as_me 1.0.0, which was generated by GNU Autoconf 2.61. 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=. 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=`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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $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=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac 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=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac 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 && echo "$as_me: caught signal $ac_signal" 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 explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 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 { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 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,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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 { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 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 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 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 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. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 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` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 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 { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 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 { echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- ac_config_headers="$ac_config_headers config.h" LIBBEEP_MAJOR_VERSION=2 LIBBEEP_MINOR_VERSION=0 LIBBEEP_MICRO_VERSION=0 LIBBEEP_VERSION=$LIBBEEP_MAJOR_VERSION.$LIBBEEP_MINOR_VERSION.$LIBBEEP_MICRO_VERSION if test -d "/usr/X11R6/include"; then CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" fi if test "$prefix" != "NONE" ; then CPPFLAGS="$CPPFLAGS -I${includedir}" fi PACKAGE=upse VERSION=1.0.0 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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" 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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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" 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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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" 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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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" 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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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" 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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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" 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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 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. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? 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.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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 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. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? 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 { { 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 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 { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out 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. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 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 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 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 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 "echo \"\$as_me:$LINENO: $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 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 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 "echo \"\$as_me:$LINENO: $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 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 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 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 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$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 ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # 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_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_CXX="$ac_prog" 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_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else 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_cxx_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-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 "echo \"\$as_me:$LINENO: $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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" 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 "echo \"\$as_me:$LINENO: $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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-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 "echo \"\$as_me:$LINENO: $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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else 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_cxx_werror_flag=$ac_save_cxx_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi 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 { echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5 echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6; } if test "${ac_cv_lib_cposix_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcposix $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 strerror (); int main () { return strerror (); ; 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 "echo \"\$as_me:$LINENO: $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 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 && $as_test_x conftest$ac_exeext; then ac_cv_lib_cposix_strerror=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cposix_strerror=no fi 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 { echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5 echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6; } if test $ac_cv_lib_cposix_strerror = yes; then LIBS="$LIBS -lcposix" 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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 echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 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 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 "echo \"\$as_me:$LINENO: $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 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 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 "echo \"\$as_me:$LINENO: $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 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 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 "echo \"\$as_me:$LINENO: $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 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 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 { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 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 { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name 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 { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 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 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 echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. 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 () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) bogus endian macros #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 "echo \"\$as_me:$LINENO: $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 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 # It does; now see whether it defined to BIG_ENDIAN or not. 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 () { #if BYTE_ORDER != BIG_ENDIAN not big endian #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 "echo \"\$as_me:$LINENO: $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 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_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; 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 "echo \"\$as_me:$LINENO: $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 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 if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else 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 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 main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac if test x"$GCC" = x"yes"; then CFLAGS="$CFLAGS -pipe -Wall" CXXFLAGS="$CXXFLAGS -pipe -Wall" fi GCC42_CFLAGS="-fgnu89-inline" for ac_prog in ${ac_tool_prefix}gcc ${ac_tool_prefix}cc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_prog" 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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done if test -z "$CC"; then ac_verc_fail=yes else # Found it, now check the version. { echo "$as_me:$LINENO: checking version of $CC" >&5 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6; } ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 4.[2-9]* ) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac { echo "$as_me:$LINENO: result: $ac_prog_version" >&5 echo "${ECHO_T}$ac_prog_version" >&6; } fi if test $ac_verc_fail = yes; then GCC42_CFLAGS="" 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 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. { echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&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 { echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_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 # By default we simply use the C compiler to build assembly code. test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS depcc="$CCAS" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CCAS_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_CCAS_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_CCAS_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CCAS_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CCAS_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CCAS_dependencies_compiler_type" >&6; } CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then am__fastdepCCAS_TRUE= am__fastdepCCAS_FALSE='#' else am__fastdepCCAS_TRUE='#' am__fastdepCCAS_FALSE= fi { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`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 echo $ECHO_N "(cached) $ECHO_C" >&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 { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_RM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RM in [\\/]* | ?:[\\/]*) ac_cv_path_RM="$RM" # 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_RM="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi RM=$ac_cv_path_RM if test -n "$RM"; then { echo "$as_me:$LINENO: result: $RM" >&5 echo "${ECHO_T}$RM" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MV+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MV in [\\/]* | ?:[\\/]*) ac_cv_path_MV="$MV" # 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_MV="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MV=$ac_cv_path_MV if test -n "$MV"; then { echo "$as_me:$LINENO: result: $MV" >&5 echo "${ECHO_T}$MV" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_CP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CP in [\\/]* | ?:[\\/]*) ac_cv_path_CP="$CP" # 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_CP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CP=$ac_cv_path_CP if test -n "$CP"; then { echo "$as_me:$LINENO: result: $CP" >&5 echo "${ECHO_T}$CP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $AR in [\\/]* | ?:[\\/]*) ac_cv_path_AR="$AR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi AR=$ac_cv_path_AR if test -n "$AR"; then { echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RANLIB in [\\/]* | ?:[\\/]*) ac_cv_path_RANLIB="$RANLIB" # 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_RANLIB="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi RANLIB=$ac_cv_path_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } 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. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS 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 { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$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' MKINSTALLDIRS= if test -n "$ac_aux_dir"; then case "$ac_aux_dir" in /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; esac fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6; } # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # 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_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 echo "${ECHO_T}$GMSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f messages.po # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { echo "$as_me:$LINENO: result: $MSGMERGE" >&5 echo "${ECHO_T}$MSGMERGE" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$GMSGFMT" != ":"; then if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` { echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6; } GMSGFMT=":" fi fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else { echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi rm -f messages.po fi ac_config_commands="$ac_config_commands default-1" 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" # 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 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by GCC" >&5 echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&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 { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${acl_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { echo "$as_me:$LINENO: checking for shared library run path origin" >&5 echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6; } if test "${acl_cv_rpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 echo "${ECHO_T}$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" # 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 { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6; } LIBINTL= LTLIBINTL= POSUB= if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no { echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6; } if test "${gt_cv_func_gnugettext1_libc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings ; 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 "echo \"\$as_me:$LINENO: $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 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 && $as_test_x conftest$ac_exeext; then gt_cv_func_gnugettext1_libc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_gnugettext1_libc=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6; } if test "$gt_cv_func_gnugettext1_libc" != "yes"; then 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 { echo "$as_me:$LINENO: checking for iconv" >&5 echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 "echo \"\$as_me:$LINENO: $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 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 && $as_test_x conftest$ac_exeext; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi 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 "echo \"\$as_me:$LINENO: $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 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 && $as_test_x conftest$ac_exeext; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking how to link with libiconv" >&5 echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $LIBICONV" >&5 echo "${ECHO_T}$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= 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-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then withval=$with_libintl_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 LIBINTL= LTLIBINTL= INCINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' 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" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$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 $LTLIBINTL; 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 LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-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 LIBINTL="${LIBINTL}${LIBINTL:+ }$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 LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$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 $LIBINTL; 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 LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-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 $INCINTL; 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 INCINTL="${INCINTL}${INCINTL:+ }-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 $LIBINTL; 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 LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; 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 LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-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$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-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" LIBINTL="${LIBINTL}${LIBINTL:+ }$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" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6; } if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (); int main () { bindtextdomain ("", ""); return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (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 "echo \"\$as_me:$LINENO: $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 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 && $as_test_x conftest$ac_exeext; then gt_cv_func_gnugettext1_libintl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_gnugettext1_libintl=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then 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 extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (); int main () { bindtextdomain ("", ""); return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (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 "echo \"\$as_me:$LINENO: $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 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 && $as_test_x conftest$ac_exeext; then LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext1_libintl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi { echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6; } fi if test "$gt_cv_func_gnugettext1_libc" = "yes" \ || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF else USE_NLS=no fi fi { echo "$as_me:$LINENO: checking whether to use NLS" >&5 echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { echo "$as_me:$LINENO: result: $gt_source" >&5 echo "${ECHO_T}$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then { echo "$as_me:$LINENO: checking how to link with libintl" >&5 echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $LIBINTL" >&5 echo "${ECHO_T}$LIBINTL" >&6; } for element in $INCINTL; 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 fi cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_DCGETTEXT 1 _ACEOF fi POSUB=po fi INTLLIBS="$LIBINTL" UPSE_TARGET_AUD="" # Check whether --enable-audplugin was given. if test "${enable_audplugin+set}" = set; then enableval=$enable_audplugin; audplugin=$enableval else audplugin=yes fi if test "x$audplugin" == "xyes"; then succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test "$PKG_CONFIG" = "no" ; then echo "*** The pkg-config script could not be found. Make sure it is" echo "*** in your path, or set the PKG_CONFIG environment variable" echo "*** to the full path to pkg-config." echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then { echo "$as_me:$LINENO: checking for audacious >= 1.3.99" >&5 echo $ECHO_N "checking for audacious >= 1.3.99... $ECHO_C" >&6; } if $PKG_CONFIG --exists "audacious >= 1.3.99" ; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } succeeded=yes { echo "$as_me:$LINENO: checking AUDACIOUS_CFLAGS" >&5 echo $ECHO_N "checking AUDACIOUS_CFLAGS... $ECHO_C" >&6; } AUDACIOUS_CFLAGS=`$PKG_CONFIG --cflags "audacious >= 1.3.99"` { echo "$as_me:$LINENO: result: $AUDACIOUS_CFLAGS" >&5 echo "${ECHO_T}$AUDACIOUS_CFLAGS" >&6; } { echo "$as_me:$LINENO: checking AUDACIOUS_LIBS" >&5 echo $ECHO_N "checking AUDACIOUS_LIBS... $ECHO_C" >&6; } AUDACIOUS_LIBS=`$PKG_CONFIG --libs "audacious >= 1.3.99"` { echo "$as_me:$LINENO: result: $AUDACIOUS_LIBS" >&5 echo "${ECHO_T}$AUDACIOUS_LIBS" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } AUDACIOUS_CFLAGS="" AUDACIOUS_LIBS="" ## If we have a custom action on failure, don't print errors, but ## do set a variable so people can do so. AUDACIOUS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "audacious >= 1.3.99"` fi else echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." echo "*** See http://www.freedesktop.org/software/pkgconfig" fi fi if test $succeeded = yes; then UPSE_TARGET_AUD="upse-audacious" audplugin="yes" else audplugin="no" fi fi # Check whether --enable-ao was given. if test "${enable_ao+set}" = set; then enableval=$enable_ao; ao=$enableval else ao=yes fi if test "x$ao" == "xyes"; then succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test "$PKG_CONFIG" = "no" ; then echo "*** The pkg-config script could not be found. Make sure it is" echo "*** in your path, or set the PKG_CONFIG environment variable" echo "*** to the full path to pkg-config." echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then { echo "$as_me:$LINENO: checking for ao" >&5 echo $ECHO_N "checking for ao... $ECHO_C" >&6; } if $PKG_CONFIG --exists "ao" ; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } succeeded=yes { echo "$as_me:$LINENO: checking AO_CFLAGS" >&5 echo $ECHO_N "checking AO_CFLAGS... $ECHO_C" >&6; } AO_CFLAGS=`$PKG_CONFIG --cflags "ao"` { echo "$as_me:$LINENO: result: $AO_CFLAGS" >&5 echo "${ECHO_T}$AO_CFLAGS" >&6; } { echo "$as_me:$LINENO: checking AO_LIBS" >&5 echo $ECHO_N "checking AO_LIBS... $ECHO_C" >&6; } AO_LIBS=`$PKG_CONFIG --libs "ao"` { echo "$as_me:$LINENO: result: $AO_LIBS" >&5 echo "${ECHO_T}$AO_LIBS" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } AO_CFLAGS="" AO_LIBS="" ## If we have a custom action on failure, don't print errors, but ## do set a variable so people can do so. AO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "ao"` fi else echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." echo "*** See http://www.freedesktop.org/software/pkgconfig" fi fi if test $succeeded = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_AO 1 _ACEOF else ao="no" fi fi { echo "$as_me:$LINENO: checking for shared library system" >&5 echo $ECHO_N "checking for shared library system... $ECHO_C" >&6; } case "$target" in intel-apple-*) { echo "$as_me:$LINENO: result: Mac OS X (Intel)" >&5 echo "${ECHO_T}Mac OS X (Intel)" >&6; } LIB_CPPFLAGS='-DPIC' LIB_CFLAGS='-fPIC' LIB_LDFLAGS='-dynamiclib -fPIC -install_name ${libdir}/${LIB}' LIB_PREFIX='lib' LIB_SUFFIX='.dylib' PLUGIN_CPPFLAGS='' PLUGIN_CFLAGS='' PLUGIN_LDFLAGS='-bundle -fno-common -flat_namespace -undefined suppress' PLUGIN_SUFFIX='.impl' INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib' CLEAN_LIB='' ;; *-apple-*) { echo "$as_me:$LINENO: result: Mac OS X" >&5 echo "${ECHO_T}Mac OS X" >&6; } LIB_CPPFLAGS='-DPIC' LIB_CFLAGS='' LIB_LDFLAGS='-dynamiclib -fPIC -install_name ${libdir}/${LIB}' LIB_PREFIX='lib' LIB_SUFFIX='.dylib' PLUGIN_CPPFLAGS='' PLUGIN_CFLAGS='' PLUGIN_LDFLAGS='-bundle -fno-common -flat_namespace -undefined suppress' PLUGIN_SUFFIX='.impl' INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib' CLEAN_LIB='' ;; *-*-solaris* | *-openbsd-* | *-mirbsd-*) { echo "$as_me:$LINENO: result: Solaris" >&5 echo "${ECHO_T}Solaris" >&6; } LIB_CPPFLAGS='-DPIC' LIB_CFLAGS='-fPIC' LIB_LDFLAGS='-shared -fPIC -Wl,-soname=${LIB}.${LIB_MAJOR}.${LIB_MINOR}' LIB_PREFIX='lib' LIB_SUFFIX='.so' PLUGIN_CPPFLAGS='-DPIC' PLUGIN_CFLAGS='-fPIC' PLUGIN_LDFLAGS='-shared -fPIC' PLUGIN_SUFFIX='.so' INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR} && rm -f ${DESTDIR}${libdir}/$$i && ${LN_S} $$i.${LIB_MAJOR}.${LIB_MINOR} ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}' CLEAN_LIB='' ;; *-*-cygwin | *-*-mingw32) { echo "$as_me:$LINENO: result: Win32" >&5 echo "${ECHO_T}Win32" >&6; } LIB_CPPFLAGS='-DPIC' LIB_CFLAGS='' LIB_LDFLAGS='-shared -Wl,--out-implib,${LIB}.a' LIB_PREFIX='lib' LIB_SUFFIX='.dll' PLUGIN_CPPFLAGS='' PLUGIN_CFLAGS='' PLUGIN_LDFLAGS='-shared' PLUGIN_SUFFIX='.dll' INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/$$i && ${INSTALL} -m 755 $$i.a ${DESTDIR}${libdir}/$$i.a' UNINSTALL_LIB='rm -f ${DESTDIR}${bindir}/$$i ${DESTDIR}${libdir}/$$i.a' CLEAN_LIB='${LIB}.a' ;; *) { echo "$as_me:$LINENO: result: POSIX" >&5 echo "${ECHO_T}POSIX" >&6; } LIB_CPPFLAGS='-DPIC' LIB_CFLAGS='-fPIC' LIB_LDFLAGS='-shared -fPIC -Wl,-soname=${LIB}.${LIB_MAJOR}.${LIB_MINOR}.0' LIB_PREFIX='lib' LIB_SUFFIX='.so' PLUGIN_CPPFLAGS='-DPIC' PLUGIN_CFLAGS='-fPIC' PLUGIN_LDFLAGS='-shared -fPIC' PLUGIN_SUFFIX='.so' INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0 && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0' CLEAN_LIB='' ;; esac { echo "$as_me:$LINENO: checking whether we need an implib" >&5 echo $ECHO_N "checking whether we need an implib... $ECHO_C" >&6; } case "$target" in *-*-cygwin | *-*-mingw32) { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PROG_IMPLIB_NEEDED='yes' PROG_IMPLIB_LDFLAGS='-Wl,-export-all-symbols,--out-implib,lib${PROG}.a' ;; *) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } PROG_IMPLIB_NEEDED='no' PROG_IMPLIB_LDFLAGS='' ;; esac CFLAGS="$CFLAGS $EXTRA_CFLAGS" ac_config_files="$ac_config_files buildsys.mk extra.mk" 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $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" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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=`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 { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 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__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCCAS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCCAS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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 ## --------------------- ## ## 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=: # Zsh 3.x and 4.x performs 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh 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.) as_nl=' ' 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 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. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # 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 || 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" || { 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 fi echo >conf$$.file 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 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 upse $as_me 1.0.0, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # 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_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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_cs_version="\\ upse config.status 1.0.0 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { 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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it # from automake. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "buildsys.mk") CONFIG_FILES="$CONFIG_FILES buildsys.mk" ;; "extra.mk") CONFIG_FILES="$CONFIG_FILES extra.mk" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 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") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim target!$target$ac_delim target_cpu!$target_cpu$ac_delim target_vendor!$target_vendor$ac_delim target_os!$target_os$ac_delim LIBBEEP_MAJOR_VERSION!$LIBBEEP_MAJOR_VERSION$ac_delim LIBBEEP_MINOR_VERSION!$LIBBEEP_MINOR_VERSION$ac_delim LIBBEEP_MICRO_VERSION!$LIBBEEP_MICRO_VERSION$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim CCAS!$CCAS$ac_delim CCASFLAGS!$CCASFLAGS$ac_delim am__leading_dot!$am__leading_dot$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCASDEPMODE!$CCASDEPMODE$ac_delim am__fastdepCCAS_TRUE!$am__fastdepCCAS_TRUE$ac_delim am__fastdepCCAS_FALSE!$am__fastdepCCAS_FALSE$ac_delim LN_S!$LN_S$ac_delim SET_MAKE!$SET_MAKE$ac_delim RM!$RM$ac_delim MV!$MV$ac_delim CP!$CP$ac_delim AR!$AR$ac_delim RANLIB!$RANLIB$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim MKINSTALLDIRS!$MKINSTALLDIRS$ac_delim USE_NLS!$USE_NLS$ac_delim MSGFMT!$MSGFMT$ac_delim GMSGFMT!$GMSGFMT$ac_delim XGETTEXT!$XGETTEXT$ac_delim MSGMERGE!$MSGMERGE$ac_delim LIBICONV!$LIBICONV$ac_delim LTLIBICONV!$LTLIBICONV$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 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 ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF INTLLIBS!$INTLLIBS$ac_delim LIBINTL!$LIBINTL$ac_delim LTLIBINTL!$LTLIBINTL$ac_delim POSUB!$POSUB$ac_delim PKG_CONFIG!$PKG_CONFIG$ac_delim AUDACIOUS_CFLAGS!$AUDACIOUS_CFLAGS$ac_delim AUDACIOUS_LIBS!$AUDACIOUS_LIBS$ac_delim UPSE_TARGET_AUD!$UPSE_TARGET_AUD$ac_delim AO_CFLAGS!$AO_CFLAGS$ac_delim AO_LIBS!$AO_LIBS$ac_delim LIB_CPPFLAGS!$LIB_CPPFLAGS$ac_delim LIB_CFLAGS!$LIB_CFLAGS$ac_delim LIB_LDFLAGS!$LIB_LDFLAGS$ac_delim LIB_PREFIX!$LIB_PREFIX$ac_delim LIB_SUFFIX!$LIB_SUFFIX$ac_delim PLUGIN_CPPFLAGS!$PLUGIN_CPPFLAGS$ac_delim PLUGIN_CFLAGS!$PLUGIN_CFLAGS$ac_delim PLUGIN_LDFLAGS!$PLUGIN_LDFLAGS$ac_delim PLUGIN_SUFFIX!$PLUGIN_SUFFIX$ac_delim INSTALL_LIB!$INSTALL_LIB$ac_delim UNINSTALL_LIB!$UNINSTALL_LIB$ac_delim CLEAN_LIB!$CLEAN_LIB$ac_delim PROG_IMPLIB_NEEDED!$PROG_IMPLIB_NEEDED$ac_delim PROG_IMPLIB_LDFLAGS!$PROG_IMPLIB_LDFLAGS$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 26; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 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 ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _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 fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 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 || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; 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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 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=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out 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"; } && { 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 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 ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 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 || 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 || 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=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "default-1":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= GMOFILES= UPDATEPOFILES= DUMMYPOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 echo echo "Features:" echo echo " upse123: yes" echo " + libao support: $ao" echo " audacious 1.4 plugin: $audplugin" echo echo "Type make to compile, and make install to install." echo upse-1.0.0/NEWS0000644000175000017500000000140311006314306013031 0ustar nenolodnenolodupse 0.6.0 (2008-02-10): * the "protect the fact that information is free" release. * Add option to load in a PSone ROM image for replayers which need it. No UPSE will not come with a ROM image, and no I won't tell you where you can get one. Pro tip: I got mine by JTAGing my PSone, and you can do the same. Also, some replayers seem to use values in the ROM which changes the way the replayer plays back the sound. (crash2.psflib, I'm looking at you for _all_ of the above.) * Do some reworking of the analogue filter on the SPU. * upse123: Add -B option to specify a playstation ROM image. * HLE bios: Display function ID on unimplemented syscalls. upse 0.5.0 (2007-12-28): * fix some bugs and other stuff upse 0.4.0 (2007-11-19): * first public release upse-1.0.0/buildsys.mk.in0000644000175000017500000002414211006314306015133 0ustar nenolodnenolod# # Copyright (c) 2007, Jonathan Schleifer # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice is present in all copies. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # PACKAGE = @PACKAGE@ CC = @CC@ CXX = @CXX@ CPP = @CPP@ DC = @DC@ ERLC = @ERLC@ OBJC = @OBJC@ AR = @AR@ LD = ${CC} CFLAGS = @CFLAGS@ CXXFLAGS = @CXXFLAGS@ CPPFLAGS = @CPPFLAGS@ DFLAGS = @DFLAGS@ ERLCFLAGS = @ERLCFLAGS@ OBJCFLAGS = @OBJCFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ PROG_IMPLIB_NEEDED = @PROG_IMPLIB_NEEDED@ PROG_IMPLIB_LDFLAGS = @PROG_IMPLIB_LDFLAGS@ PROG_SUFFIX = @EXEEXT@ LIB_CPPFLAGS = @LIB_CPPFLAGS@ LIB_CFLAGS = @LIB_CFLAGS@ LIB_LDFLAGS = @LIB_LDFLAGS@ LIB_PREFIX = @LIB_PREFIX@ LIB_SUFFIX = @LIB_SUFFIX@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_CFLAGS = @PLUGIN_CFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PLUGIN_SUFFIX = @PLUGIN_SUFFIX@ INSTALL_LIB = @INSTALL_LIB@ UNINSTALL_LIB = @UNINSTALL_LIB@ CLEAN_LIB = @CLEAN_LIB@ LN_S = @LN_S@ MKDIR_P = mkdir -p INSTALL = install SHELL = @SHELL@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ plugindir ?= ${libdir}/${PACKAGE} datarootdir = @datarootdir@ datadir = @datadir@ includedir = @includedir@ includesubdir ?= ${PACKAGE} mandir = @mandir@ mansubdir ?= man1 OBJS1 = ${SRCS:.c=.o} OBJS2 = ${OBJS1:.cc=.o} OBJS3 = ${OBJS2:.cxx=.o} OBJS4 = ${OBJS3:.d=.o} OBJS5 = ${OBJS4:.erl=.beam} OBJS += ${OBJS5:.m=.o} .SILENT: .SUFFIXES: .beam .c .cc .cxx .d .erl .m .PHONY: all subdirs pre-depend depend install install-extra uninstall uninstall-extra clean distclean all: for i in subdirs depend ${STATIC_LIB} ${STATIC_LIB_NOINST} ${LIB} ${LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST}; do \ ${MAKE} ${MFLAGS} $$i || exit 1; \ done subdirs: for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} || exit 1; \ ${DIR_LEAVE}; \ done depend: pre-depend ${SRCS} regen=0; \ test -f .deps || regen=1; \ for i in ${SRCS}; do test $$i -nt .deps && regen=1; done; \ if test x"$$regen" = x"1"; then \ list=""; \ ${DEPEND_STATUS}; \ for i in ${SRCS}; do \ case $${i##*.} in \ c|cc|cxx|m) \ list="$$list $$i"; \ ;; \ esac; \ done; \ if test x"$$list" != "x"; then \ if ${CPP} ${CPPFLAGS} -M $$list >.deps; then \ ${DEPEND_OK}; \ else \ ${DEPEND_FAILED}; \ fi; \ fi; \ fi pre-depend: ${PROG} ${PROG_NOINST}: ${EXT_DEPS} ${OBJS} ${LINK_STATUS} if ${LD} -o $@ ${OBJS} ${LDFLAGS} ${LIBS}; then \ ${LINK_OK}; \ else \ ${LINK_FAILED}; \ fi ${LIB} ${LIB_NOINST}: ${EXT_DEPS} ${OBJS} ${LINK_STATUS} if ${LD} -o $@ ${OBJS} ${LIB_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ ${LINK_OK}; \ else \ ${LINK_FAILED}; \ fi ${PLUGIN} ${PLUGIN_NONST}: ${EXT_DEPS} ${OBJS} ${LINK_STATUS} if ${LD} -o $@ ${OBJS} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ ${LINK_OK}; \ else \ ${LINK_FAILED}; \ fi ${STATIC_LIB} ${STATIC_LIB_NOINST}: ${EXT_DEPS} ${OBJS} ${LINK_STATUS} if ${AR} cr $@ ${OBJS}; then \ ${LINK_OK}; \ else \ ${LINK_FAILED}; \ fi .c.o: ${COMPILE_STATUS} if ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .cc.o .cxx.o: ${COMPILE_STATUS} if ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .d.o: ${COMPILE_STATUS} if test x"$(basename ${DC})" = x"dmd"; then \ if ${DC} ${DFLAGS} -c -of$@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi \ else \ if ${DC} ${DFLAGS} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi \ fi .erl.beam: ${COMPILE_STATUS} if ${ERLC} ${ERLCFLAGS} -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi .m.o: ${COMPILE_STATUS} if ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi install: ${LIB} ${STATIC_LIB} ${PLUGIN} ${PROG} install-extra for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} install || exit 1; \ ${DIR_LEAVE}; \ done for i in ${LIB}; do \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${libdir} && ${INSTALL_LIB}; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done for i in ${STATIC_LIB}; do \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${libdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${libdir}/$$i; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done for i in ${PLUGIN}; do \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${plugindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${plugindir}/$$i; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done for i in ${DATA}; do \ ${INSTALL_STATUS}; \ if ${MKDIR_P} $$(dirname ${DESTDIR}${datadir}/${PACKAGE}/$$i) && ${INSTALL} -m 644 $$i ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done for i in ${PROG}; do \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${bindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/$$i; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done for i in ${INCLUDES}; do \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${includedir}/${includesubdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${includedir}/${includesubdir}/$$i; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done for i in ${MAN}; do \ ${INSTALL_STATUS}; \ if ${MKDIR_P} ${DESTDIR}${mandir}/${mansubdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${mandir}/${mansubdir}/$$i; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done install-extra: uninstall: uninstall-extra for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} uninstall || exit 1; \ ${DIR_LEAVE}; \ done for i in ${LIB}; do \ if test -f ${DESTDIR}${libdir}/$$i; then \ if ${UNINSTALL_LIB}; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi; \ done for i in ${STATIC_LIB}; do \ if test -f ${DESTDIR}${libdir}/$$i; then \ if rm -f ${DESTDIR}${libdir}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done for i in ${PLUGIN}; do \ if test -f ${DESTDIR}${plugindir}/$$i; then \ if rm -f ${DESTDIR}${plugindir}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done -rmdir ${DESTDIR}${plugindir} >/dev/null 2>&1 for i in ${DATA}; do \ if test -f ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \ if rm -f ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done for i in ${PROG}; do \ if test -f ${DESTDIR}${bindir}/$$i; then \ if rm -f ${DESTDIR}${bindir}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done for i in ${INCLUDES}; do \ if test -f ${DESTDIR}${includedir}/${includesubdir}/$$i; then \ if rm -f ${DESTDIR}${includedir}/${includesubdir}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done -rmdir ${DESTDIR}${includedir}/${includesubdir} >/dev/null 2>&1 for i in ${MAN}; do \ if test -f ${DESTDIR}${mandir}/${mansubdir}/$$i; then \ if rm -f ${DESTDIR}${mandir}/${mansubdir}/$$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done uninstall-extra: clean: for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} clean || exit 1; \ ${DIR_LEAVE}; \ done for i in ${OBJS} ${CLEAN} ${CLEAN_LIB} .deps; do \ if test -f $$i -o -d $$i; then \ if rm -fr $$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done distclean: clean for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} distclean || exit 1; \ ${DIR_LEAVE}; \ done for i in ${PROG} ${PROG_NOINST} ${LIB} ${LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${DISTCLEAN} *~; do \ if test -f $$i -o -d $$i; then \ if rm -fr $$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done DIR_ENTER = printf "\033[K\033[0;36mEntering directory \033[1;36m$$i\033[0;36m.\033[0m\n"; cd $$i || exit 1 DIR_LEAVE = printf "\033[K\033[0;36mLeaving directory \033[1;36m$$i\033[0;36m.\033[0m\n"; cd .. || exit 1 DEPEND_STATUS = printf "\033[K\033[0;33mGenerating dependencies...\033[0m\r" DEPEND_OK = printf "\033[K\033[0;32mSuccessfully generated dependencies.\033[0m\n" DEPEND_FAILED = printf "\033[K\033[0;31mFailed to generate dependencies!\033[0m\n"; exit 1 COMPILE_STATUS = printf "\033[K\033[0;33mCompiling \033[1;33m$<\033[0;33m...\033[0m\r" COMPILE_OK = printf "\033[K\033[0;32mSuccessfully compiled \033[1;32m$<\033[0;32m.\033[0m\n" COMPILE_FAILED = printf "\033[K\033[0;31mFailed to compile \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1 LINK_STATUS = printf "\033[K\033[0;33mLinking \033[1;33m$@\033[0;33m...\033[0m\r" LINK_OK = printf "\033[K\033[0;32mSuccessfully linked \033[1;32m$@\033[0;32m.\033[0m\n" LINK_FAILED = printf "\033[K\033[0;31mFailed to link \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1 INSTALL_STATUS = printf "\033[K\033[0;33mInstalling \033[1;33m$$i\033[0;33m...\033[0m\r" INSTALL_OK = printf "\033[K\033[0;32mSuccessfully installed \033[1;32m$$i\033[0;32m.\033[0m\n" INSTALL_FAILED = printf "\033[K\033[0;31mFailed to install \033[1;31m$$i\033[0;31m!\033[0m\n"; exit 1 DELETE_OK = printf "\033[K\033[0;34mDeleted \033[1;34m$$i\033[0;34m.\033[0m\n" DELETE_FAILED = printf "\033[K\033[0;31mFailed to delete \033[1;31m$$i\033[0;31m!\033[0m\n"; exit 1 -include .deps upse-1.0.0/config.h.in0000644000175000017500000000366511006314306014371 0ustar nenolodnenolod/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define this if you have AO. */ #undef HAVE_AO /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* 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 header file. */ #undef HAVE_MEMORY_H /* 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 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 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 you have the header file. */ #undef HAVE_UNISTD_H /* 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 to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN upse-1.0.0/m4/0000755000175000017500000000000011006314306012654 5ustar nenolodnenolodupse-1.0.0/m4/isc-posix.m40000644000175000017500000000213311006314306015033 0ustar nenolodnenolod# isc-posix.m4 serial 2 (gettext-0.11.2) dnl Copyright (C) 1995-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. # This file is not needed with autoconf-2.53 and newer. Remove it in 2005. # This test replaces the one in autoconf. # Currently this macro should have the same name as the autoconf macro # because gettext's gettext.m4 (distributed in the automake package) # still uses it. Otherwise, the use in gettext.m4 makes autoheader # give these diagnostics: # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX undefine([AC_ISC_POSIX]) AC_DEFUN([AC_ISC_POSIX], [ dnl This test replaces the obsolescent AC_ISC_POSIX kludge. AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) ] ) upse-1.0.0/m4/lcmessage.m40000644000175000017500000000261611006314306015066 0ustar nenolodnenolod# lcmessage.m4 serial 3 (gettext-0.11.3) dnl Copyright (C) 1995-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 dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995. # Check whether LC_MESSAGES is available in . AC_DEFUN([AM_LC_MESSAGES], [ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi ]) upse-1.0.0/m4/lirc.m40000644000175000017500000001507311006314306014055 0ustar nenolodnenolod## lirc.m4 (Macros for autoconf) ## ## (C) 1999 Christoph Bartelmus (lirc@bartelmus.de) ## ####################################################################### ## ## Check for LIRC ## ####################################################################### dnl AC_PATH_LIRC([MINIMUM-VERSION]) dnl Check for LIRC and define LIRCD dnl AC_DEFUN([AC_PATH_LIRC], [ min_lirc_version=ifelse([$1], ,0.5.5,$1) AC_MSG_CHECKING(for LIRC>=$min_lirc_version) AC_CACHE_VAL(ac_cv_have_lirc,[ no_lirc=no lirc_version=none lirc_cross_compiling=no if test ! -S /dev/lircd; then LIRCD=/dev/null no_lirc=yes else LIRCD=/dev/lircd rm -f conf.lirc ac_save_cflags="${CFLAGS}" CFLAGS="$CFLAGS -DLIRCD=\"$LIRCD\"" AC_TRY_RUN( [ #include #include #include #include #include #include #include #include #include #include #include #include #include #define PACKET_SIZE 256 /* three seconds */ #define TIMEOUT 3 int timeout=0; void sigalrm(int sig) { timeout=1; } const char *read_string(int fd) { static char buffer[PACKET_SIZE+1]=""; char *end; static int ptr=0; ssize_t ret; if(ptr>0) { memmove(buffer,buffer+ptr,strlen(buffer+ptr)+1); ptr=strlen(buffer); end=strchr(buffer,'\n'); } else { end=NULL; } alarm(TIMEOUT); while(end==NULL) { if(PACKET_SIZE<=ptr) { ptr=0; return(NULL); } ret=read(fd,buffer+ptr,PACKET_SIZE-ptr); if(ret<=0 || timeout) { if(!timeout) { alarm(0); } ptr=0; return(NULL); } buffer[ptr+ret]=0; ptr=strlen(buffer); end=strchr(buffer,'\n'); } alarm(0);timeout=0; end[0]=0; ptr=strlen(buffer)+1; return(buffer); } enum packet_state { P_BEGIN, P_MESSAGE, P_STATUS, P_DATA, P_N, P_DATA_N, P_END }; char *get_version(int fd,const char *packet) { int done,todo; const char *string,*data; char *endptr; enum packet_state state; int status,n; unsigned long data_n; unsigned int major,minor,micro; static char version[100]; todo=strlen(packet); data=packet; while(todo>0) { done=write(fd,(void *) data,todo); if(done<0) { return(NULL); } data+=done; todo-=done; } /* get response */ status=0; state=P_BEGIN; n=0; while(1) { string=read_string(fd); if(string==NULL) return(NULL); switch(state) { case P_BEGIN: if(strcasecmp(string,"BEGIN")!=0) { continue; } state=P_MESSAGE; break; case P_MESSAGE: if(strncasecmp(string,packet,strlen(string))!=0 || strlen(string)+1!=strlen(packet)) { state=P_BEGIN; continue; } state=P_STATUS; break; case P_STATUS: if(strcasecmp(string,"SUCCESS")==0) { status=0; } else if(strcasecmp(string,"END")==0) { status=0; return(NULL); } else if(strcasecmp(string,"ERROR")==0) { status=-1; } else { goto bad_packet; } state=P_DATA; break; case P_DATA: if(strcasecmp(string,"END")==0) { return(NULL); } else if(strcasecmp(string,"DATA")==0) { state=P_N; break; } goto bad_packet; case P_N: errno=0; data_n=strtoul(string,&endptr,0); if(!*string || *endptr) { goto bad_packet; } if(data_n==0) { state=P_END; } else { state=P_DATA_N; } break; case P_DATA_N: if(data_n==1 && status==0) { if(sscanf(string,"%u.%u.%u", &major,&minor,µ)==3) { sprintf(version,"%u.%u.%u", major,minor,micro); } else { goto bad_packet; } } n++; if(n==data_n) state=P_END; break; case P_END: if(strcasecmp(string,"END")==0) { return(version); } goto bad_packet; break; } } bad_packet: return(NULL); } int main(int argc,char **argv) { char *version,*min_version; unsigned int major,minor,micro,min_major,min_minor,min_micro; struct sockaddr_un addr; FILE *result; int fd; struct sigaction act; result=fopen("conf.lirc","w"); if(result==NULL) exit(EXIT_FAILURE); act.sa_handler=sigalrm; sigemptyset(&act.sa_mask); act.sa_flags=0; /* we need EINTR */ sigaction(SIGALRM,&act,NULL); addr.sun_family=AF_UNIX; strcpy(addr.sun_path,LIRCD); fd=socket(AF_UNIX,SOCK_STREAM,0); if(fd==-1) { fprintf(result,"unknown"); fclose(result); close(fd); exit(EXIT_FAILURE); }; if(connect(fd,(struct sockaddr *)&addr,sizeof(addr))==-1) { fprintf(result,"unknown"); fclose(result); close(fd); exit(EXIT_FAILURE); }; version=get_version(fd,"VERSION\n"); if(version==NULL) { fprintf(result,"<0.5.5"); fclose(result); close(fd); exit(EXIT_FAILURE); } fprintf(result,"%s",version); fclose(result); close(fd); /* HP/UX 9 (%@#!) writes to sscanf strings */ min_version=strdup("$min_lirc_version"); if(min_version==NULL) exit(EXIT_FAILURE); if(sscanf(version,"%u.%u.%u",&major,&minor,µ)!=3 || sscanf(min_version,"%u.%u.%u",&min_major,&min_minor,&min_micro)!=3) { exit(EXIT_FAILURE); } if(major #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 ]) upse-1.0.0/m4/intdiv0.m40000644000175000017500000000356511006314306014504 0ustar nenolodnenolod# intdiv0.m4 serial 1 (gettext-0.11.3) dnl Copyright (C) 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([gt_INTDIV0], [ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], gt_cv_int_divbyzero_sigfpe, [ AC_TRY_RUN([ #include #include static void #ifdef __cplusplus sigfpe_handler (int sig) #else sigfpe_handler (sig) int sig; #endif { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, [ # Guess based on the CPU. case "$host_cpu" in alpha* | i[34567]86 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac ]) ]) case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, [Define if integer division by zero raises signal SIGFPE.]) ]) upse-1.0.0/m4/sidplay.m40000644000175000017500000004065211006314306014572 0ustar nenolodnenolod# Configure paths for SID support dnl ------------------------------------------------------------------------- dnl Try to find a file (or one of more files in a list of dirs). dnl ------------------------------------------------------------------------- AC_DEFUN([SIDPLAY_FIND_FILE], [ $3="" for i in $2; do for j in $1; do if test -r "$i/$j"; then $3=$i break 2 fi done done ]) AC_DEFUN([SIDPLAY_TRY_LINK_SAVE], [ xs_cxx_save="$CXX" xs_cxxflags_save="$CXXFLAGS" xs_ldflags_save="$LDFLAGS" xs_libs_save="$LIBS" ]) AC_DEFUN([SIDPLAY_TRY_LINK_RESTORE], [ CXX="$xs_cxx_save" CXXFLAGS="$xs_cxxflags_save" LDFLAGS="$xs_ldflags_save" LIBS="$xs_libs_save" ]) dnl ------------------------------------------------------------------------- dnl Try to find SIDPLAY library and header files. dnl $xs_have_sidplay1 will be "yes" or "no" dnl @SIDPLAY1_LDADD@ will be substituted with linker parameters dnl @SIDPLAY1_INCLUDES@ will be substituted with compiler parameters dnl ------------------------------------------------------------------------- AC_DEFUN([XS_PATH_LIBSIDPLAY1], [ AC_MSG_CHECKING([for working SIDPlay1 library and headers]) AC_LANG_PUSH([C++]) # Use include path given by user (if any). if test -n "$xs_sidplay1_includes"; then xs_sidplay1_cxxflags="-I$xs_sidplay1_includes" else xs_sidplay1_cxxflags="" fi # Use library path given by user (if any). if test -n "$xs_sidplay1_library"; then xs_sidplay1_ldflags="-L$xs_sidplay1_library" else xs_sidplay1_ldflags="" fi AC_CACHE_VAL(xs_cv_have_sidplay1, [ # Run test compilation with either standard search path # or user-defined paths. SIDPLAY_TRY_LIBSIDPLAY1 if test "$xs_sidplay1_works" = yes; then xs_cv_have_sidplay1="xs_have_sidplay1=yes \ xs_sidplay1_cxxflags=\"$xs_sidplay1_cxxflags\" \ xs_sidplay1_ldflags=\"$xs_sidplay1_ldflags\" " else SIDPLAY_FIND_LIBSIDPLAY1 fi ]) eval "$xs_cv_have_sidplay1" if test "$xs_have_sidplay1" = yes; then if test -n "$xs_sidplay1_cxxflags" || test -n "$xs_sidplay1_ldflags"; then AC_MSG_RESULT([$xs_sidplay1_cxxflags $xs_sidplay1_ldflags]) else AC_MSG_RESULT([yes]) fi SIDPLAY1_LDADD="$xs_sidplay1_ldflags -lsidplay" SIDPLAY1_INCLUDES="$xs_sidplay1_cxxflags" AC_SUBST([SIDPLAY1_LDADD]) AC_SUBST([SIDPLAY1_INCLUDES]) else AC_MSG_RESULT([no]) fi AC_LANG_POP([C++]) ]) dnl Functions used by XS_PATH_LIBSIDPLAY1. AC_DEFUN([SIDPLAY_FIND_LIBSIDPLAY1], [ # Search common locations where header files might be stored. xs_sidplay1_incdirs="$xs_sidplay1_includes /usr/include /usr/local/include /usr/lib/sidplay/include /usr/local/lib/sidplay/include /opt/sfw/include /opt/csw/include" SIDPLAY_FIND_FILE(sidplay/sidtune.h, $xs_sidplay1_incdirs, xs_sidplay1_includes) # Search common locations where library might be stored. xs_sidplay1_libdirs="$xs_sidplay1_library /usr/lib /usr/lib/sidplay /usr/local/lib/sidplay /opt/sfw/lib /opt/csw/lib" SIDPLAY_FIND_FILE(libsidplay.a libsidplay.so libsidplay.so.1 libsidplay.so.1.36 libsidplay.so.1.37, $xs_sidplay1_libdirs, xs_sidplay1_library) if test -z "$xs_sidplay1_includes" || test -z "$xs_sidplay1_library"; then xs_cv_have_sidplay1="xs_have_sidplay1=no \ xs_sidplay1_ldflags=\"\" xs_sidplay1_cxxflags=\"\" " else # Test compilation with found paths. xs_sidplay1_ldflags="-L$xs_sidplay1_library" xs_sidplay1_cxxflags="-I$xs_sidplay1_includes" SIDPLAY_TRY_LIBSIDPLAY1 xs_cv_have_sidplay1="xs_have_sidplay1=$xs_sidplay1_works \ xs_sidplay1_ldflags=\"$xs_sidplay1_ldflags\" \ xs_sidplay1_cxxflags=\"$xs_sidplay1_cxxflags\" " fi ]) AC_DEFUN([SIDPLAY_TRY_LIBSIDPLAY1], [ SIDPLAY_TRY_LINK_SAVE CXXFLAGS="$CXXFLAGS $xs_sidplay1_cxxflags" LDFLAGS="$LDFLAGS $xs_sidplay1_ldflags" LIBS="$LIBS -lsidplay" AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[sidTune* myTest = new sidTune(0);]])], [xs_sidplay1_works=yes], [xs_sidplay1_works=no] ) SIDPLAY_TRY_LINK_RESTORE ]) dnl ------------------------------------------------------------------------- dnl Try to find SIDPLAY2 library and header files. dnl $xs_have_sidplay2 will be "yes" or "no" dnl @SIDPLAY_LDADD@ will be substituted with linker parameters dnl @SIDPLAY_INCLUDES@ will be substituted with compiler parameters dnl ------------------------------------------------------------------------- AC_DEFUN([XS_PATH_LIBSIDPLAY2], [ AC_MSG_CHECKING([for working SIDPlay2 library and headers]) AC_LANG_PUSH([C++]) AC_PATH_PROG([PKG_CONFIG], [pkg-config]) if test -n "$PKG_CONFIG" && $PKG_CONFIG --atleast-version $LIBSIDPLAY2_REQUIRED_VERSION libsidplay2; then xs_pkgcfg_knows=yes else xs_pkgcfg_knows=no fi # Derive sidbuilders path from libsidplay2 root. if test -n "$xs_sidplay2_library"; then xs_sidplay2_builders="$xs_sidplay2_library/sidplay/builders" elif test "$xs_pkgcfg_knows" = yes ; then xs_sidplay2_builders=`$PKG_CONFIG --variable=builders libsidplay2` fi AC_CACHE_VAL(xs_cv_have_sidplay2, [ # Run test compilation with either standard search path # or user-defined paths. xs_sidplay2_ldadd="-lsidplay2" SIDPLAY_TRY_LIBSIDPLAY2 if test "$xs_sidplay2_works" = yes; then xs_cv_have_sidplay2="xs_have_sidplay2=yes \ xs_sidplay2_cxxflags=\"$xs_sidplay2_cxxflags\" \ xs_sidplay2_ldadd=\"$xs_sidplay2_ldadd\" \ xs_sidplay2_builders=\"$xs_sidplay2_builders\" " else SIDPLAY_FIND_LIBSIDPLAY2 fi ]) eval "$xs_cv_have_sidplay2" if test "$xs_have_sidplay2" = yes; then if test -n "$xs_sidplay2_cxxflags" || test -n "$xs_sidplay2_ldadd"; then AC_MSG_RESULT([$xs_sidplay2_cxxflags $xs_sidplay2_ldadd]) else AC_MSG_RESULT([yes]) fi SIDPLAY2_LDADD="$xs_sidplay2_ldadd" SIDPLAY2_INCLUDES="$xs_sidplay2_cxxflags" AC_SUBST([SIDPLAY2_LDADD]) AC_SUBST([SIDPLAY2_INCLUDES]) else AC_MSG_RESULT([no]) fi AC_LANG_POP([C++]) ]) dnl Functions used by XS_PATH_LIBSIDPLAY2. AC_DEFUN([SIDPLAY_FIND_LIBSIDPLAY2], [ # See whether user didn't provide paths. if test -z "$xs_sidplay2_includes"; then if test "$xs_pkgcfg_knows" = yes ; then xs_sidplay2_includes=`$PKG_CONFIG --variable=includedir libsidplay2` xs_sidplay2_cxxflags=`$PKG_CONFIG --cflags libsidplay2` else # Search common locations where header files might be stored. xs_sidplay2_incdirs="$xs_sidplay2_includes $xs_sidplay2_includes/include /usr/include /usr/local/include /usr/lib/sidplay/include /usr/local/lib/sidplay/include /opt/sfw/include /opt/csw/include" SIDPLAY_FIND_FILE(sidplay/sidplay2.h,$xs_sidplay2_incdirs,xs_sidplay2_includes) xs_sidplay2_cxxflags="-I$xs_sidplay2_includes" fi else xs_sidplay2_cxxflags="-I$xs_sidplay2_includes" fi if test -z "$xs_sidplay2_library"; then if test "$xs_pkgcfg_knows" = yes ; then xs_sidplay2_library=`$PKG_CONFIG --variable=libdir libsidplay2` xs_sidplay2_ldadd=`$PKG_CONFIG --libs libsidplay2` xs_sidplay2_builders=`$PKG_CONFIG --variable=builders libsidplay2` else # Search common locations where library might be stored. xs_sidplay2_libdirs="$xs_sidplay2_library $xs_sidplay2_library/lib $xs_sidplay2_library/src /usr/lib /usr/lib/sidplay /usr/local/lib/sidplay /opt/sfw/lib /opt/csw/lib" SIDPLAY_FIND_FILE(libsidplay2.la,$xs_sidplay2_libdirs,xs_sidplay2_library) xs_sidplay2_ldadd="-L$xs_sidplay2_library -lsidplay2" xs_sidplay2_builders="$xs_sidplay2_library/sidplay/builders" fi else xs_sidplay2_ldadd="-L$xs_sidplay2_library -lsidplay2" fi if test -z "$xs_sidplay2_includes" || test -z "$xs_sidplay2_library"; then xs_cv_have_sidplay2="xs_have_sidplay2=no \ xs_sidplay2_ldadd=\"\" xs_sidplay2_cxxflags=\"\" \ xs_sidplay2_builders=\"\" " else # Test compilation with found paths. xs_sidplay2_ldadd="-L$xs_sidplay2_library -lsidplay2" xs_sidplay2_cxxflags="-I$xs_sidplay2_includes" SIDPLAY_TRY_LIBSIDPLAY2 xs_cv_have_sidplay2="xs_have_sidplay2=$xs_sidplay2_works \ xs_sidplay2_ldadd=\"$xs_sidplay2_ldadd\" \ xs_sidplay2_cxxflags=\"$xs_sidplay2_cxxflags\" \ xs_sidplay2_builders=\"$xs_sidplay2_builders\" " fi ]) AC_DEFUN([SIDPLAY_TRY_LIBSIDPLAY2], [ SIDPLAY_TRY_LINK_SAVE CXXFLAGS="$CXXFLAGS $xs_sidplay2_cxxflags -DHAVE_UNIX" LDFLAGS="$LDFLAGS $xs_sidplay2_ldadd" AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[sidplay2 *myEngine;]])], [xs_sidplay2_works=yes], [xs_sidplay2_works=no] ) SIDPLAY_TRY_LINK_RESTORE ]) dnl ------------------------------------------------------------------------- dnl Find libsidplay2 builders (sidbuilders) dir. dnl @BUILDERS_INCLUDES@ dnl @BUILDERS_LDFLAGS@ dnl ------------------------------------------------------------------------- AC_DEFUN([BUILDERS_FIND], [ AC_MSG_CHECKING([for SIDPlay2 builders directory]) AC_LANG_PUSH([C++]) AC_REQUIRE([XS_PATH_LIBSIDPLAY2]) dnl Be pessimistic. builders_available=no dnl Sidbuilder headers are included with "builders" prefix. builders_includedir=$xs_sidplay2_includes builders_libdir=$xs_sidplay2_builders dnl If libsidplay2 is in standard library search path, we need dnl to get an argument whether /usr, /usr/local, etc. Else we dnl can only use ${libdir}/sidplay/builders, but then are dnl unable to check whether files exist as long as ${exec_prefix} dnl is not defined in the configure script. So, this is a bit dnl ugly, but a satisfactory fallback default for those who dnl define ${prefix} and ${exec_prefix}. if test -z $builders_libdir; then eval "builders_libdir=$libdir/sidplay/builders" fi AC_ARG_WITH(sidbuilders, [ --with-sidbuilders=DIR what the SIDPlay2 builders install PREFIX is], [builders_includedir="$withval/include" builders_libdir="$withval/lib/sidplay/builders"]) AC_ARG_WITH(builders-inc, [ --with-builders-inc=DIR where the SIDPlay2 builders headers are located], [builders_includedir="$withval"]) AC_ARG_WITH(builders-lib, [ --with-builders-lib=DIR where the SIDPlay2 builders libraries are installed], [builders_libdir="$withval"]) if test -n "$builders_includedir"; then BUILDERS_INCLUDES="-I$builders_includedir" fi if test -n "$builders_libdir"; then BUILDERS_LDFLAGS="-L$builders_libdir" fi if test -d $builders_libdir; then xs_have_sidbuilders_dir=yes AC_MSG_RESULT([$builders_libdir]) else xs_have_sidbuilders_dir=no AC_MSG_RESULT([$xs_have_sidbuilders_dir]) AC_MSG_ERROR([$builders_libdir not found! Check --help on how to specify SIDPlay2 and/or builders library and header path, or set --exec-prefix to the same prefix as your installation of libsidplay2. ]) fi AC_SUBST([BUILDERS_INCLUDES]) AC_SUBST([BUILDERS_LDFLAGS]) AC_LANG_POP([C++]) ]) dnl ------------------------------------------------------------------------- dnl Test for working reSID builder. dnl sets $(RESID_LDADD), substitutes @RESID_LDADD@ dnl ------------------------------------------------------------------------- AC_DEFUN([BUILDERS_FIND_RESID], [ AC_MSG_CHECKING([for reSID builder module]) AC_LANG_PUSH([C++]) SIDPLAY_TRY_LINK_SAVE CXXFLAGS="$CXXFLAGS $BUILDERS_INCLUDES" LDFLAGS="$LDFLAGS $BUILDERS_LDFLAGS" LIBS="$LIBS -lresid-builder" AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[ReSIDBuilder *sid;]])], [builders_work=yes], [builders_work=no] ) SIDPLAY_TRY_LINK_RESTORE if test "$builders_work" = yes; then builders_available=yes xs_builders="reSID $xs_builders" AC_DEFINE([HAVE_RESID_BUILDER], [], [resid builder]) RESID_LDADD="-lresid-builder" fi AC_MSG_RESULT($builders_work) AC_SUBST([RESID_LDADD]) AC_LANG_POP([C++]) ]) dnl ------------------------------------------------------------------------- dnl Test for working HardSID builder. dnl sets $(HARDSID_LDADD), substitutes @HARDSID_LDADD@ dnl ------------------------------------------------------------------------- AC_DEFUN([BUILDERS_FIND_HARDSID], [ AC_MSG_CHECKING([for HardSID builder module]) AC_LANG_PUSH([C++]) SIDPLAY_TRY_LINK_SAVE CXXFLAGS="$CXXFLAGS $BUILDERS_INCLUDES" LDFLAGS="$LDFLAGS $BUILDERS_LDFLAGS" LIBS="$LIBS -lhardsid-builder" AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[HardSID *sid;]])], [builders_work=yes], [builders_work=no] ) SIDPLAY_TRY_LINK_RESTORE if test "$builders_work" = yes; then builders_available=yes xs_builders="HardSID $xs_builders" AC_DEFINE([HAVE_HARDSID_BUILDER], [], [harsid builder]) HARDSID_LDADD="-lhardsid-builder" fi AC_MSG_RESULT($builders_work) AC_SUBST([HARDSID_LDADD]) AC_LANG_POP([C++]) ]) dnl AM_PATH_SIDPLAY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl Test for SID libraries, and define SIDPLAY_CFLAGS and SIDPLAY_LIBS dnl AC_DEFUN([AM_PATH_SIDPLAY], [ dnl dnl Get the cflags and libraries dnl dnl *** dnl *** libSIDPlay 1 options dnl *** AC_ARG_WITH(sidplay1, [ --with-sidplay1=PREFIX Enable SIDPlay1 with install-PREFIX], [ if test "x$withval" = xyes; then xs_sidplay1=yes xs_sidplay1_library="" xs_sidplay1_includes="" else if test "x$withval" = xno; then xs_sidplay1=no else xs_sidplay1=yes xs_sidplay1_includes="$withval/include" xs_sidplay1_library="$withval/lib" fi fi ],[ xs_sidplay1=try xs_sidplay1_library="" xs_sidplay1_includes="" ]) AC_ARG_WITH(sidplay1-inc, [ --with-sidplay1-inc=DIR Where the SIDPlay1 headers are located], [xs_sidplay1_includes="$withval"],) AC_ARG_WITH(sidplay1-lib, [ --with-sidplay1-lib=DIR Where the SIDPlay1 library is installed], [xs_sidplay1_library="$withval"],) dnl *** dnl *** libSIDPlay 2 options dnl *** AC_ARG_WITH(sidplay2, [ --with-sidplay2=PREFIX Enable SIDPlay2 with install-PREFIX], [ if test "x$withval" = xyes; then xs_sidplay2=yes xs_sidplay2_library="" xs_sidplay2_includes="" else if test "x$withval" = xno; then xs_sidplay2=no else xs_sidplay2=yes xs_sidplay2_includes="$withval/include" xs_sidplay2_library="$withval/lib" fi fi ],[ xs_sidplay2=try xs_sidplay2_library="" xs_sidplay2_includes="" ]) AC_ARG_WITH(sidplay2-inc, [ --with-sidplay2-inc=DIR Where the SIDPlay2 headers are located], [xs_sidplay2_includes="$withval"],) AC_ARG_WITH(sidplay2-lib, [ --with-sidplay2-lib=DIR Where the SIDPlay2 library is installed], [xs_sidplay2_library="$withval"],) dnl *** dnl *** Determine if libraries are wanted and available dnl *** OPT_SIDPLAY1="no" if test "x$xs_sidplay1" = xtry; then XS_PATH_LIBSIDPLAY1 else if test "x$xs_sidplay1" = xyes; then XS_PATH_LIBSIDPLAY1 if test "x$xs_have_sidplay1" = xno; then AC_MSG_WARN([libSIDPlay1 library and/or headers were not found!]) fi fi fi if test "x$xs_have_sidplay1" = xyes; then AC_DEFINE([HAVE_SIDPLAY1],[],[sidplay1 available]) OPT_SIDPLAY1="yes" fi OPT_SIDPLAY2="no" LIBSIDPLAY2_REQUIRED_VERSION="2.1.0" if test "x$xs_sidplay2" = xtry; then XS_PATH_LIBSIDPLAY2 else if test "x$xs_sidplay2" = xyes; then XS_PATH_LIBSIDPLAY2 if test "x$xs_have_sidplay2" = xno; then AC_MSG_WARN([libSIDPlay2 library and/or headers were not found!]) fi fi fi if test "x$xs_have_sidplay2" = xyes; then AC_DEFINE([HAVE_SIDPLAY2],[],[sidplay2 available]) OPT_SIDPLAY2="yes" BUILDERS_FIND BUILDERS_FIND_RESID BUILDERS_FIND_HARDSID if test "x$builders_available" = xno; then AC_MSG_WARN([No builder modules were found in the sidbuilders directory!]); fi fi dnl *** dnl *** Check if we have some emulator library available? dnl *** if test "x$OPT_SIDPLAY1" = xno; then if test "x$OPT_SIDPLAY2" = xno; then SIDPLAY_HAVESOMETHING="no" fi fi if test "x$SIDPLAY_HAVESOMETHING" = xno; then ifelse([$2], , :, [$2]) else ifelse([$1], , :, [$1]) fi ]) upse-1.0.0/m4/ulonglong.m40000644000175000017500000000200011006314306015112 0ustar nenolodnenolod# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40) dnl Copyright (C) 1999-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 Paul Eggert. AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG], [ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;], [unsigned long long ullmax = (unsigned long long) -1; return ull << i | ull >> i | ullmax / ull | ullmax % ull;], ac_cv_type_unsigned_long_long=yes, ac_cv_type_unsigned_long_long=no)]) if test $ac_cv_type_unsigned_long_long = yes; then AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, [Define if you have the unsigned long long type.]) fi ]) upse-1.0.0/m4/inttypes_h.m40000644000175000017500000000210311006314306015300 0ustar nenolodnenolod# inttypes_h.m4 serial 5 (gettext-0.12) dnl Copyright (C) 1997-2003 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 Paul Eggert. # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([jm_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], jm_ac_cv_header_inttypes_h=yes, jm_ac_cv_header_inttypes_h=no)]) if test $jm_ac_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) upse-1.0.0/m4/glibc21.m40000644000175000017500000000172711006314306014350 0ustar nenolodnenolod# glibc21.m4 serial 2 (fileutils-4.1.3, 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. # Test for the GNU C Library, version 2.1 or newer. # 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" ] ) upse-1.0.0/m4/pkg.m40000644000175000017500000000400211006314306013673 0ustar nenolodnenolod dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page dnl also defines GSTUFF_PKG_ERRORS on error AC_DEFUN([PKG_CHECK_MODULES], [ succeeded=no if test -z "$PKG_CONFIG"; then AC_PATH_PROG(PKG_CONFIG, pkg-config, no) fi if test "$PKG_CONFIG" = "no" ; then echo "*** The pkg-config script could not be found. Make sure it is" echo "*** in your path, or set the PKG_CONFIG environment variable" echo "*** to the full path to pkg-config." echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then AC_MSG_CHECKING(for $2) if $PKG_CONFIG --exists "$2" ; then AC_MSG_RESULT(yes) succeeded=yes AC_MSG_CHECKING($1_CFLAGS) $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` AC_MSG_RESULT($$1_CFLAGS) AC_MSG_CHECKING($1_LIBS) $1_LIBS=`$PKG_CONFIG --libs "$2"` AC_MSG_RESULT($$1_LIBS) else AC_MSG_RESULT(no) $1_CFLAGS="" $1_LIBS="" ## If we have a custom action on failure, don't print errors, but ## do set a variable so people can do so. $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` ifelse([$4], ,echo $$1_PKG_ERRORS,) fi AC_SUBST($1_CFLAGS) AC_SUBST($1_LIBS) else echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." echo "*** See http://www.freedesktop.org/software/pkgconfig" fi fi if test $succeeded = yes; then ifelse([$3], , :, [$3]) else ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) fi ]) upse-1.0.0/m4/amidi-plug.m40000644000175000017500000000203511006314306015146 0ustar nenolodnenolod# Checks for amidi-plug dnl AM_PATH_AMIDIPLUG_HWSYNTH([ACTION-IF-FOUND , ACTION-IF-NOT-FOUND]) dnl Test for ALSA-supported hardware synth dnl AC_DEFUN([AM_PATH_AMIDIPLUG_HWSYNTH], [ AMIDIPLUG_EVERYTHINGOK="yes" dnl **** Search for a hardware synth (ALSA managed) **** AC_CHECK_FILE([/proc/asound/card0/wavetableD1], [ap_hwsynth_found=yes], [ap_hwsynth_found=no]) if test "x$ap_hwsynth_found" = "xno"; then AC_CHECK_FILE([/proc/asound/card1/wavetableD1], [ap_hwsynth_found=yes], [ap_hwsynth_found=no]) if test "x$ap_hwsynth_found" = "xno"; then AC_CHECK_FILE([/proc/asound/card2/wavetableD1], [ap_hwsynth_found=yes], [ap_hwsynth_found=no]) if test "x$ap_hwsynth_found" = "xno"; then AMIDIPLUG_EVERYTHINGOK="no" AC_MSG_WARN([*** Could not find an ALSA-supported hardware synth, amidi-plug won't be compiled. If you wish to compile it anyway, use --enable-amidiplug in configure. ***]) fi fi fi if test "x$AMIDIPLUG_EVERYTHINGOK" = "xyes"; then ifelse([$1], , :, [$1]) else ifelse([$2], , :, [$2]) fi ]) upse-1.0.0/m4/po.m40000644000175000017500000002152011006314306013534 0ustar nenolodnenolod# po.m4 serial 1 (gettext-0.12) dnl Copyright (C) 1995-2003 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 dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl AC_REQUIRE([AM_NLS])dnl dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU msgfmt. if test "$GMSGFMT" != ":"; then dnl If it is no GNU msgfmt we define it as : so that the dnl Makefiles still can work. if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` AC_MSG_RESULT( [found $GMSGFMT program is not GNU msgfmt; ignore it]) GMSGFMT=":" fi fi dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po fi AC_OUTPUT_COMMANDS([ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= GMOFILES= UPDATEPOFILES= DUMMYPOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it # from automake. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) upse-1.0.0/m4/codeset.m40000644000175000017500000000157611006314306014555 0ustar nenolodnenolod# 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 ]) upse-1.0.0/m4/libmikmod.m40000644000175000017500000000611111006314306015064 0ustar nenolodnenolod# Configure paths for libmikmod # # Derived from libmikmod.m4 (Owen Taylor 97-11-3) # dnl AM_PATH_LIBMIKMOD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and dnl LIBMIKMOD_LDADD dnl AC_DEFUN([AM_PATH_LIBMIKMOD], [dnl dnl Get the cflags and libraries from the libmikmod-config script dnl AC_ARG_WITH(libmikmod-prefix,[ --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional)], libmikmod_config_prefix="$withval", libmikmod_config_prefix="") AC_ARG_WITH(libmikmod-exec-prefix,[ --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional)], libmikmod_config_exec_prefix="$withval", libmikmod_config_exec_prefix="") if test x$libmikmod_config_exec_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config fi fi if test x$libmikmod_config_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config fi fi AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no) min_libmikmod_version=ifelse([$1], ,3.1.5,$1) AC_MSG_CHECKING(for libmikmod - version >= $min_libmikmod_version) no_libmikmod="" if test "$LIBMIKMOD_CONFIG" = "no" ; then no_libmikmod=yes else LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags` LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs` LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd` libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\1/'` libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\2/'` libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\3/'` fi if test "x$no_libmikmod" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$LIBMIKMOD_CONFIG" = "no" ; then echo "*** The libmikmod-config script installed by libmikmod could not be found" echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the" echo "*** full path to libmikmod-config." fi LIBMIKMOD_CFLAGS="" LIBMIKMOD_LIBS="" LIBMIKMOD_LDADD="" ifelse([$3], , :, [$3]) fi AC_SUBST(LIBMIKMOD_CFLAGS) AC_SUBST(LIBMIKMOD_LIBS) AC_SUBST(LIBMIKMOD_LDADD) rm -f conf.mikmodtest ]) AC_DEFUN([AC_FIND_FILE], [ $3=NO for i in $2; do for j in $1; do if test -r "$i/$j"; then $3=$i break 2 fi done done ] ) upse-1.0.0/m4/gettext.m40000644000175000017500000004052111006314306014604 0ustar nenolodnenolod# gettext.m4 serial 20 (gettext-0.12) dnl Copyright (C) 1995-2003 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 dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define(gt_included_intl, ifelse([$1], [external], [no], [yes])) define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Set USE_NLS. AM_NLS ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. dnl Add a version number to the cache macros. define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, [AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no)]) if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], gt_cv_func_gnugettext_libintl, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias ();], [bindtextdomain ("", ""); return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], gt_cv_func_gnugettext_libintl=yes, gt_cv_func_gnugettext_libintl=no) dnl Now see whether libintl exists and depends on libiconv. if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias ();], [bindtextdomain ("", ""); return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext_libintl=yes ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if test "$gt_cv_func_gnugettext_libc" = "yes" \ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE(HAVE_GETTEXT, 1, [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE(HAVE_DCGETTEXT, 1, [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) dnl For backward compatibility. Some Makefiles may be using this. if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST(INTLOBJS) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST(INTLLIBS) dnl Make all documented variables known to autoconf. AC_SUBST(LIBINTL) AC_SUBST(LTLIBINTL) AC_SUBST(POSUB) ]) dnl Checks for all prerequisites of the intl subdirectory, dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. AC_DEFUN([AM_INTL_SUBDIR], [ AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_ISC_POSIX])dnl AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_C_CONST])dnl AC_REQUIRE([AC_C_INLINE])dnl AC_REQUIRE([AC_TYPE_OFF_T])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([jm_GLIBC21])dnl AC_REQUIRE([gt_INTDIV0])dnl AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl AC_REQUIRE([gt_INTTYPES_PRI])dnl AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ stdlib.h string.h unistd.h sys/param.h]) AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \ __fsetlocking]) AM_ICONV AM_LANGINFO_CODESET if test $ac_cv_header_locale_h = yes; then AM_LC_MESSAGES fi dnl intl/plural.c is generated from intl/plural.y. It requires bison, dnl because plural.y uses bison specific features. It requires at least dnl bison-1.26 because earlier versions generate a plural.c that doesn't dnl compile. dnl bison is only needed for the maintainer (who touches plural.y). But in dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put dnl the rule in general Makefile. Now, some people carelessly touch the dnl files or have a broken "make" program, hence the plural.c rule will dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not dnl present or too old. AC_CHECK_PROGS([INTLBISON], [bison]) if test -z "$INTLBISON"; then ac_verc_fail=yes else dnl Found it, now check the version. AC_MSG_CHECKING([version of bison]) changequote(<<,>>)dnl ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) changequote([,])dnl ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac AC_MSG_RESULT([$ac_prog_version]) fi if test $ac_verc_fail = yes; then INTLBISON=: fi ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) upse-1.0.0/m4/stdint_h.m40000644000175000017500000000205311006314306014732 0ustar nenolodnenolod# stdint_h.m4 serial 3 (gettext-0.12) dnl Copyright (C) 1997-2003 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 Paul Eggert. # Define HAVE_STDINT_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([jm_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], jm_ac_cv_header_stdint_h=yes, jm_ac_cv_header_stdint_h=no)]) if test $jm_ac_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) upse-1.0.0/m4/libFLAC.m40000644000175000017500000000751611006314306014323 0ustar nenolodnenolod# For audacious by MSameer # Configure paths for libFLAC # "Inspired" by ogg.m4 dnl AM_PATH_LIBFLAC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl Test for libFLAC, and define LIBFLAC_CFLAGS and LIBFLAC_LIBS dnl AC_DEFUN([AM_PATH_LIBFLAC], [dnl dnl Get the cflags and libraries dnl AC_ARG_WITH(libFLAC,[ --with-libFLAC=PFX Prefix where libFLAC is installed (optional)], libFLAC_prefix="$withval", libFLAC_prefix="") AC_ARG_WITH(libFLAC-libraries,[ --with-libFLAC-libraries=DIR Directory where libFLAC library is installed (optional)], libFLAC_libraries="$withval", libFLAC_libraries="") AC_ARG_WITH(libFLAC-includes,[ --with-libFLAC-includes=DIR Directory where libFLAC header files are installed (optional)], libFLAC_includes="$withval", libFLAC_includes="") AC_ARG_ENABLE(libFLACtest, [ --disable-libFLACtest do not try to compile and run a test libFLAC program],, enable_libFLACtest=yes) if test "x$libFLAC_libraries" != "x" ; then LIBFLAC_LIBS="-L$libFLAC_libraries" elif test "x$libFLAC_prefix" != "x" ; then LIBFLAC_LIBS="-L$libFLAC_prefix/lib" elif test "x$prefix" != "xNONE" ; then LIBFLAC_LIBS="-L$libdir" fi LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -lm" if test "x$libFLAC_includes" != "x" ; then LIBFLAC_CFLAGS="-I$libFLAC_includes" elif test "x$libFLAC_prefix" != "x" ; then LIBFLAC_CFLAGS="-I$libFLAC_prefix/include" elif test "$prefix" != "xNONE"; then LIBFLAC_CFLAGS="-I$prefix/include" fi AC_MSG_CHECKING(for libFLAC >= 1.1.2) no_libFLAC="" if test "x$enable_libFLACtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_CXXFLAGS="$CXXFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $LIBFLAC_CFLAGS" CXXFLAGS="$CXXFLAGS $LIBFLAC_CFLAGS" LIBS="$LIBS $LIBFLAC_LIBS" dnl dnl Now check if the installed libFLAC is sufficiently new. dnl rm -f conf.libFLACtest AC_TRY_RUN([ #include #include #include #include int main () { FLAC__format_vorbiscomment_entry_name_is_legal("foo"); system("touch conf.libFLACtest"); return 0; } ],, no_libFLAC=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi if test "x$no_libFLAC" = "x" ; then AC_MSG_RESULT(yes) ifelse([$1], , :, [$1]) else AC_MSG_RESULT(no) if test -f conf.libFLACtest ; then : else echo "*** Could not run libFLAC test program, checking why..." CFLAGS="$CFLAGS $LIBFLAC_CFLAGS" LIBS="$LIBS $LIBFLAC_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 libFLAC or finding the wrong" echo "*** version of libFLAC. If it is not finding libFLAC, 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 libFLAC was incorrectly installed" echo "*** or that you have moved libFLAC since it was installed. In the latter case, you" echo "*** may want to edit the libFLAC-config script: $LIBFLAC_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi LIBFLAC_CFLAGS="" LIBFLAC_LIBS="" ifelse([$2], , :, [$2]) fi AC_SUBST(LIBFLAC_CFLAGS) AC_SUBST(LIBFLAC_LIBS) rm -f conf.libFLACtest ]) upse-1.0.0/m4/arts.m40000644000175000017500000001116011006314306014066 0ustar nenolodnenolod# CFLAGS and library paths for aRts # written 15 December 1999 by Ben Gertzfield # hacked for artsc by Haavard Kvaalen dnl Usage: dnl AM_PATH_ARTSC([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl dnl Example: dnl AM_PATH_ARTSC(0.9.5, , AC_MSG_ERROR([*** ARTSC >= 0.9.5 not installed - please install first ***])) dnl dnl Defines ARTSC_CFLAGS, ARTSC_LIBS and ARTSC_VERSION. dnl dnl ARTSC_TEST_VERSION(AVAILABLE-VERSION, NEEDED-VERSION [, ACTION-IF-OKAY [, ACTION-IF-NOT-OKAY]]) AC_DEFUN([ARTSC_TEST_VERSION], [ # Determine which version number is greater. Prints 2 to stdout if # the second number is greater, 1 if the first number is greater, # 0 if the numbers are equal. # Written 15 December 1999 by Ben Gertzfield # Revised 15 December 1999 by Jim Monty AC_PROG_AWK artsc_got_version=[` $AWK ' \ BEGIN { \ print vercmp(ARGV[1], ARGV[2]); \ } \ \ function vercmp(ver1, ver2, ver1arr, ver2arr, \ ver1len, ver2len, \ ver1int, ver2int, len, i, p) { \ \ ver1len = split(ver1, ver1arr, /\./); \ ver2len = split(ver2, ver2arr, /\./); \ \ len = ver1len > ver2len ? ver1len : ver2len; \ \ for (i = 1; i <= len; i++) { \ p = 1000 ^ (len - i); \ ver1int += ver1arr[i] * p; \ ver2int += ver2arr[i] * p; \ } \ \ if (ver1int < ver2int) \ return 2; \ else if (ver1int > ver2int) \ return 1; \ else \ return 0; \ }' $1 $2`] if test $artsc_got_version -eq 2; then # failure ifelse([$4], , :, $4) else # success! ifelse([$3], , :, $3) fi ]) AC_DEFUN([AM_PATH_ARTSC], [ AC_ARG_WITH(artsc-prefix,[ --with-artsc-prefix=PFX Prefix where aRts is installed (optional)], artsc_config_prefix="$withval", artsc_config_prefix="") AC_ARG_WITH(artsc-exec-prefix,[ --with-artsc-exec-prefix=PFX Exec prefix where aRts is installed (optional)], artsc_config_exec_prefix="$withval", artsc_config_exec_prefix="") if test x$artsc_config_exec_prefix != x; then artsc_config_args="$artsc_config_args --exec-prefix=$artsc_config_exec_prefix" if test x${ARTSC_CONFIG+set} != xset; then ARTSC_CONFIG=$artsc_config_exec_prefix/bin/artsc-config fi fi if test x$artsc_config_prefix != x; then artsc_config_args="$artsc_config_args --prefix=$artsc_config_prefix" if test x${ARTSC_CONFIG+set} != xset; then ARTSC_CONFIG=$artsc_config_prefix/bin/artsc-config fi fi AC_PATH_PROG(ARTSC_CONFIG, artsc-config, no) min_artsc_version=ifelse([$1], ,0.9.5.1, $1) if test "$ARTSC_CONFIG" = "no"; then no_artsc=yes else ARTSC_CFLAGS=`$ARTSC_CONFIG $artsc_config_args --cflags` ARTSC_LIBS=`$ARTSC_CONFIG $artsc_config_args --libs` ARTSC_VERSION=`$ARTSC_CONFIG $artsc_config_args --version` ARTSC_TEST_VERSION($ARTSC_VERSION, $min_artsc_version, ,no_artsc=version) fi AC_MSG_CHECKING(for artsc - version >= $min_artsc_version) if test "x$no_artsc" = x; then AC_MSG_RESULT(yes) AC_SUBST(ARTSC_CFLAGS) AC_SUBST(ARTSC_LIBS) AC_SUBST(ARTSC_VERSION) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$ARTSC_CONFIG" = "no" ; then echo "*** The artsc-config script installed by aRts could not be found." echo "*** If aRts was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the ARTSC_CONFIG environment variable to the" echo "*** full path to artsc-config." else if test "$no_artsc" = "version"; then echo "*** An old version of aRts, $ARTSC_VERSION, was found." echo "*** You need a version of aRts newer than $min_artsc_version." echo "*** The latest version of aRts is available from" echo "*** http://www.arts-project.org/" echo "***" echo "*** If you have already installed a sufficiently new version, this error" echo "*** probably means that the wrong copy of the artsc-config shell script is" echo "*** being found. The easiest way to fix this is to remove the old version" echo "*** of aRts, but you can also set the ARTSC_CONFIG environment to point to the" echo "*** correct copy of artsc-config. (In this case, you will have to" echo "*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf" echo "*** so that the correct libraries are found at run-time)" fi fi ARTSC_CFLAGS="" ARTSC_LIBS="" ifelse([$3], , :, [$3]) fi ]) upse-1.0.0/m4/sdl.m40000644000175000017500000000465111006314306013706 0ustar nenolodnenolod# Configure paths for SDL # Sam Lantinga 9/21/99 # stolen from Manish Singh # stolen back from Frank Belew # stolen from Manish Singh # Shamelessly stolen from Owen Taylor dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS dnl AC_DEFUN([AM_PATH_SDL], [dnl dnl Get the cflags and libraries from the sdl-config script dnl AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], sdl_prefix="$withval", sdl_prefix="") AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], sdl_exec_prefix="$withval", sdl_exec_prefix="") if test x$sdl_exec_prefix != x ; then sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config fi fi if test x$sdl_prefix != x ; then sdl_args="$sdl_args --prefix=$sdl_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_prefix/bin/sdl-config fi fi AC_REQUIRE([AC_CANONICAL_TARGET]) PATH="$prefix/bin:$prefix/usr/bin:$PATH" AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH]) min_sdl_version=ifelse([$1], ,0.11.0,$1) AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) no_sdl="" if test "$SDL_CONFIG" = "no" ; then no_sdl=yes else SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` fi if test "x$no_sdl" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$SDL_CONFIG" = "no" ; then echo "*** The sdl-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the SDL_CONFIG environment variable to the" echo "*** full path to sdl-config." fi SDL_CFLAGS="" SDL_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) rm -f conf.sdltest ]) upse-1.0.0/m4/buildsys.m40000644000175000017500000001244711006314306014764 0ustar nenolodnenoloddnl dnl Copyright (c) 2007, Jonathan Schleifer dnl dnl Permission to use, copy, modify, and/or distribute this software for any dnl purpose with or without fee is hereby granted, provided that the above dnl copyright notice and this permission notice is present in all copies. dnl dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" dnl AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE dnl ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE dnl LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE dnl POSSIBILITY OF SUCH DAMAGE. dnl AC_DEFUN([BUILDSYS_PROG_IMPLIB], [ AC_MSG_CHECKING(whether we need an implib) case "$target" in *-*-cygwin | *-*-mingw32) AC_MSG_RESULT(yes) PROG_IMPLIB_NEEDED='yes' PROG_IMPLIB_LDFLAGS='-Wl,-export-all-symbols,--out-implib,lib${PROG}.a' ;; *) AC_MSG_RESULT(no) PROG_IMPLIB_NEEDED='no' PROG_IMPLIB_LDFLAGS='' ;; esac AC_SUBST(PROG_IMPLIB_NEEDED) AC_SUBST(PROG_IMPLIB_LDFLAGS) ]) AC_DEFUN([BUILDSYS_SHARED_LIB], [ AC_MSG_CHECKING(for shared library system) case "$target" in intel-apple-*) AC_MSG_RESULT([Mac OS X (Intel)]) LIB_CPPFLAGS='-DPIC' LIB_CFLAGS='-fPIC' LIB_LDFLAGS='-dynamiclib -fPIC -install_name ${libdir}/${LIB}' LIB_PREFIX='lib' LIB_SUFFIX='.dylib' PLUGIN_CPPFLAGS='' PLUGIN_CFLAGS='' PLUGIN_LDFLAGS='-bundle -fno-common -flat_namespace -undefined suppress' PLUGIN_SUFFIX='.impl' INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib' CLEAN_LIB='' ;; *-apple-*) AC_MSG_RESULT(Mac OS X) LIB_CPPFLAGS='-DPIC' LIB_CFLAGS='' LIB_LDFLAGS='-dynamiclib -fPIC -install_name ${libdir}/${LIB}' LIB_PREFIX='lib' LIB_SUFFIX='.dylib' PLUGIN_CPPFLAGS='' PLUGIN_CFLAGS='' PLUGIN_LDFLAGS='-bundle -fno-common -flat_namespace -undefined suppress' PLUGIN_SUFFIX='.impl' INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib' CLEAN_LIB='' ;; *-*-solaris* | *-openbsd-* | *-mirbsd-*) AC_MSG_RESULT(Solaris) LIB_CPPFLAGS='-DPIC' LIB_CFLAGS='-fPIC' LIB_LDFLAGS='-shared -fPIC -Wl,-soname=${LIB}.${LIB_MAJOR}.${LIB_MINOR}' LIB_PREFIX='lib' LIB_SUFFIX='.so' PLUGIN_CPPFLAGS='-DPIC' PLUGIN_CFLAGS='-fPIC' PLUGIN_LDFLAGS='-shared -fPIC' PLUGIN_SUFFIX='.so' INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR} && rm -f ${DESTDIR}${libdir}/$$i && ${LN_S} $$i.${LIB_MAJOR}.${LIB_MINOR} ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}' CLEAN_LIB='' ;; *-*-cygwin | *-*-mingw32) AC_MSG_RESULT(Win32) LIB_CPPFLAGS='-DPIC' LIB_CFLAGS='' LIB_LDFLAGS='-shared -Wl,--out-implib,${LIB}.a' LIB_PREFIX='lib' LIB_SUFFIX='.dll' PLUGIN_CPPFLAGS='' PLUGIN_CFLAGS='' PLUGIN_LDFLAGS='-shared' PLUGIN_SUFFIX='.dll' INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/$$i && ${INSTALL} -m 755 $$i.a ${DESTDIR}${libdir}/$$i.a' UNINSTALL_LIB='rm -f ${DESTDIR}${bindir}/$$i ${DESTDIR}${libdir}/$$i.a' CLEAN_LIB='${LIB}.a' ;; *) AC_MSG_RESULT(POSIX) LIB_CPPFLAGS='-DPIC' LIB_CFLAGS='-fPIC' LIB_LDFLAGS='-shared -fPIC -Wl,-soname=${LIB}.${LIB_MAJOR}.${LIB_MINOR}.0' LIB_PREFIX='lib' LIB_SUFFIX='.so' PLUGIN_CPPFLAGS='-DPIC' PLUGIN_CFLAGS='-fPIC' PLUGIN_LDFLAGS='-shared -fPIC' PLUGIN_SUFFIX='.so' INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0 && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0' CLEAN_LIB='' ;; esac AC_SUBST(LIB_CPPFLAGS) AC_SUBST(LIB_CFLAGS) AC_SUBST(LIB_LDFLAGS) AC_SUBST(LIB_PREFIX) AC_SUBST(LIB_SUFFIX) AC_SUBST(PLUGIN_CPPFLAGS) AC_SUBST(PLUGIN_CFLAGS) AC_SUBST(PLUGIN_LDFLAGS) AC_SUBST(PLUGIN_SUFFIX) AC_SUBST(INSTALL_LIB) AC_SUBST(UNINSTALL_LIB) AC_SUBST(CLEAN_LIB) ]) upse-1.0.0/m4/lib-ld.m40000644000175000017500000000676111006314306014273 0ustar nenolodnenolod# lib-ld.m4 serial 2 (gettext-0.12) dnl Copyright (C) 1996-2003 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 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi 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 ]) upse-1.0.0/m4/libxml.m40000644000175000017500000001731011006314306014407 0ustar nenolodnenolod# Configure paths for LIBXML2 # Mike Hommey 2004-06-19 # use CPPFLAGS instead of CFLAGS # Toshio Kuratomi 2001-04-21 # Adapted from: # Configure paths for GLIB # Owen Taylor 97-11-3 dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS dnl AC_DEFUN([AM_PATH_XML2],[ AC_ARG_WITH(xml-prefix, [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)], xml_config_prefix="$withval", xml_config_prefix="") AC_ARG_WITH(xml-exec-prefix, [ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)], xml_config_exec_prefix="$withval", xml_config_exec_prefix="") AC_ARG_ENABLE(xmltest, [ --disable-xmltest Do not try to compile and run a test LIBXML program],, enable_xmltest=yes) if test x$xml_config_exec_prefix != x ; then xml_config_args="$xml_config_args" if test x${XML2_CONFIG+set} != xset ; then XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config fi fi if test x$xml_config_prefix != x ; then xml_config_args="$xml_config_args --prefix=$xml_config_prefix" if test x${XML2_CONFIG+set} != xset ; then XML2_CONFIG=$xml_config_prefix/bin/xml2-config fi fi AC_PATH_PROG(XML2_CONFIG, xml2-config, no) min_xml_version=ifelse([$1], ,2.0.0,[$1]) AC_MSG_CHECKING(for libxml - version >= $min_xml_version) no_xml="" if test "$XML2_CONFIG" = "no" ; then no_xml=yes else XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags` XML_LIBS=`$XML2_CONFIG $xml_config_args --libs` xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_xmltest" = "xyes" ; then ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" LIBS="$XML_LIBS $LIBS" dnl dnl Now check if the installed libxml is sufficiently new. dnl (Also sanity checks the results of xml2-config to some extent) dnl rm -f conf.xmltest AC_TRY_RUN([ #include #include #include #include int main() { int xml_major_version, xml_minor_version, xml_micro_version; int major, minor, micro; char *tmp_version; system("touch conf.xmltest"); /* Capture xml2-config output via autoconf/configure variables */ /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = (char *)strdup("$min_xml_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string from xml2-config\n", "$min_xml_version"); exit(1); } free(tmp_version); /* Capture the version information from the header files */ tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION); if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) { printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION"); exit(1); } free(tmp_version); /* Compare xml2-config output to the libxml headers */ if ((xml_major_version != $xml_config_major_version) || (xml_minor_version != $xml_config_minor_version) || (xml_micro_version != $xml_config_micro_version)) { printf("*** libxml header files (version %d.%d.%d) do not match\n", xml_major_version, xml_minor_version, xml_micro_version); printf("*** xml2-config (version %d.%d.%d)\n", $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version); return 1; } /* Compare the headers to the library to make sure we match */ /* Less than ideal -- doesn't provide us with return value feedback, * only exits if there's a serious mismatch between header and library. */ LIBXML_TEST_VERSION; /* Test that the library is greater than our minimum version */ if ((xml_major_version > major) || ((xml_major_version == major) && (xml_minor_version > minor)) || ((xml_major_version == major) && (xml_minor_version == minor) && (xml_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of libxml (%d.%d.%d) was found.\n", xml_major_version, xml_minor_version, xml_micro_version); printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** libxml is always available from ftp://ftp.xmlsoft.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 xml2-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n"); printf("*** correct copy of xml2-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_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_xml" = x ; then AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$XML2_CONFIG" = "no" ; then echo "*** The xml2-config script installed by LIBXML could not be found" echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the XML2_CONFIG environment variable to the" echo "*** full path to xml2-config." else if test -f conf.xmltest ; then : else echo "*** Could not run libxml test program, checking why..." CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" LIBS="$LIBS $XML_LIBS" AC_TRY_LINK([ #include #include ], [ LIBXML_TEST_VERSION; return 0;], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding LIBXML or finding the wrong" echo "*** version of LIBXML. If it is not finding LIBXML, 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 LIBXML was incorrectly installed" echo "*** or that you have moved LIBXML since it was installed. In the latter case, you" echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ]) CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" fi fi XML_CPPFLAGS="" XML_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(XML_CPPFLAGS) AC_SUBST(XML_LIBS) rm -f conf.xmltest ]) upse-1.0.0/m4/inttypes.m40000644000175000017500000000171711006314306015003 0ustar nenolodnenolod# inttypes.m4 serial 1 (gettext-0.11.4) dnl Copyright (C) 1997-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 Paul Eggert. # Define HAVE_INTTYPES_H if exists and doesn't clash with # . AC_DEFUN([gt_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, [ AC_TRY_COMPILE( [#include #include ], [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) ]) if test $gt_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, [Define if exists and doesn't clash with .]) fi ]) upse-1.0.0/m4/inttypes-pri.m40000644000175000017500000000222711006314306015570 0ustar nenolodnenolod# inttypes-pri.m4 serial 1 (gettext-0.11.4) dnl Copyright (C) 1997-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. # Define PRI_MACROS_BROKEN if exists and defines the PRI* # macros to non-string values. This is the case on AIX 4.3.3. AC_DEFUN([gt_INTTYPES_PRI], [ AC_REQUIRE([gt_HEADER_INTTYPES_H]) if test $gt_cv_header_inttypes_h = yes; then AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], gt_cv_inttypes_pri_broken, [ AC_TRY_COMPILE([#include #ifdef PRId32 char *p = PRId32; #endif ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) ]) fi if test "$gt_cv_inttypes_pri_broken" = yes; then AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, [Define if exists and defines unusable PRI* macros.]) fi ]) upse-1.0.0/m4/uintmax_t.m40000644000175000017500000000235011006314306015126 0ustar nenolodnenolod# uintmax_t.m4 serial 7 (gettext-0.12) dnl Copyright (C) 1997-2003 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 Paul Eggert. AC_PREREQ(2.13) # Define uintmax_t to 'unsigned long' or 'unsigned long long' # if it is not already defined in or . AC_DEFUN([jm_AC_TYPE_UINTMAX_T], [ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) AC_REQUIRE([jm_AC_HEADER_STDINT_H]) if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, [Define to unsigned long or unsigned long long if and don't define.]) else AC_DEFINE(HAVE_UINTMAX_T, 1, [Define if you have the 'uintmax_t' type in or .]) fi ]) upse-1.0.0/m4/nls.m40000644000175000017500000000350511006314306013715 0ustar nenolodnenolod# nls.m4 serial 1 (gettext-0.12) dnl Copyright (C) 1995-2003 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 dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) ]) AC_DEFUN([AM_MKINSTALLDIRS], [ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but $(top_srcdir). dnl Try to locate it. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then case "$ac_aux_dir" in /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; esac fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) ]) upse-1.0.0/m4/lib-link.m40000644000175000017500000005534311006314306014631 0ustar nenolodnenolod# lib-link.m4 serial 4 (gettext-0.12) dnl Copyright (C) 2001-2003 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. 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" 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_LIB_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 ]) upse-1.0.0/m4/progtest.m40000644000175000017500000000563411006314306014775 0ustar nenolodnenolod# progtest.m4 serial 3 (gettext-0.12) dnl Copyright (C) 1996-2003 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 dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) upse-1.0.0/m4/jack.m40000644000175000017500000000271711006314306014035 0ustar nenolodnenolod# Configure paths for JACK dnl AM_PATH_JACK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for JACK, and define JACK_CFLAGS and JACK_LIBS dnl AC_DEFUN([AM_PATH_JACK], [dnl dnl **** Check for Jack sound server **** dnl JACK_LIBS= JACK_CFLAGS= JACK_EVERYTHINGOK=yes AC_CHECK_HEADERS(jack/jack.h) if test "${ac_cv_header_jack_jack_h}" = "no" then AC_MSG_WARN([Could not find jack/jack.h Install jack headers to build bio2jack]) JACK_EVERYTHINGOK=no else JACK_CFLAGS="-lpthread -ljack -ldl" fi AC_CHECK_LIB(jack, jack_activate, JACK_LIBS="-ljack -ldl") if test "${ac_cv_lib_jack_jack_activate}" = "no" then AC_MSG_WARN([Could not find jack_activate in libjack. Ensure that you have libjack installed and that it a current version.]) JACK_EVERYTHINGOK=no fi AC_SUBST(JACK_CFLAGS) AC_SUBST(JACK_LIBS) dnl **** Check for libsamplerate necessary for bio2jack **** PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.15, ac_cv_samplerate=1, ac_cv_samplerate=0) AC_DEFINE_UNQUOTED([HAVE_SAMPLERATE],${ac_cv_samplerate}, [Set to 1 if you have libsamplerate.]) dnl Make sure libsamplerate is found, we can't compile without it if test "${ac_cv_samplerate}" = 0 then AC_MSG_WARN([Could not find libsamplerate, necessary for jack output plugin.]) JACK_EVERYTHINGOK=no fi AC_SUBST(SAMPLERATE_CFLAGS) AC_SUBST(SAMPLERATE_LIBS) if test "x$JACK_EVERYTHINGOK" = xno; then ifelse([$2], , :, [$2]) else ifelse([$1], , :, [$1]) fi ]) upse-1.0.0/m4/lib-prefix.m40000644000175000017500000001250511006314306015162 0ustar nenolodnenolod# lib-prefix.m4 serial 2 (gettext-0.12) dnl Copyright (C) 2001-2003 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_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) 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_LIB_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" ]) upse-1.0.0/AUTHORS0000644000175000017500000000005511006314306013404 0ustar nenolodnenolodWilliam Pitcock upse-1.0.0/config.sub0000644000175000017500000007771211006314306014332 0ustar nenolodnenolod#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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, 2002, 2003, 2004, 2005 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 ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # 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 ;; * ) 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* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) 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 | -knuth | -cray) 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 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -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/'` ;; -sco5v6*) # 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] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx | dvp \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | 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) ;; ms1) basic_machine=mt-unknown ;; # 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]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | 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 ;; abacus) basic_machine=abacus-unknown ;; 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 ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; 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 ;; c90) basic_machine=c90-cray os=-unicos ;; 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 | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; 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 ;; mipsEE* | ee | ps2) basic_machine=mips64r5900el-scei case $os in -linux*) ;; *) os=-elf ;; esac ;; iop) basic_machine=mipsel-scei os=-irx ;; dvp) basic_machine=dvp-scei os=-elf ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; 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 ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; 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 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-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-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`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 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; 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=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; 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 ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; 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 ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; 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 ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) 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 ;; *-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* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -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* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -irx*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -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 ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -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 ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -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 spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. 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 ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-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 ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) 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 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: upse-1.0.0/install-sh0000644000175000017500000002202111006314306014332 0ustar nenolodnenolod#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-05-14.22 # 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 $?;; -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 $?;; *) # 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: upse-1.0.0/acinclude.m40000644000175000017500000000026111006314306014524 0ustar nenolodnenoloddnl ADD_PKG_REQUIRES([requirement]) AC_DEFUN([ADD_PC_REQUIRES], [ test -z "$PC_REQUIRES" && PC_REQUIRES="$1" || PC_REQUIRES="$PC_REQUIRES, $1" AC_SUBST(PC_REQUIRES) ] ) upse-1.0.0/TODO0000644000175000017500000000307211006314306013026 0ustar nenolodnenolodlist of things to do... libupse (emulation core): - seperate public API into their own files - lots of stuff is in various static variables littered around the source, turn that into a struct upse_state_t so that multiple upse sessions can run at once - implement ADSR filter dithering for 44100->22050kHZ transcoding, interpolation SUCKS here -- many bits are simply lost - make it possible to trap CPU and SPU instructions at runtime, and expose public APIs for doing so - implement config parser, and support for .upserc - check my math on the differential interpolation phase (is it different on PSone than it is on PS2/PSX? some say PSone uses a logarhythmic method...) - find out why crash bandicoot sets fail - improve tracing - PSone MIDI extensions - lots of dead code: find and kill - document the public API (doxygen) - gaussian curve used to start post-mix interpolation is probably wrong wishlist: - code-level debugger? - PSF autoripping tool - implement missing PS2 bits from PCSX2 (lu_zero says he is possibly interested in this) -- but this isn't so big as most PS2 games use AAC or ATRAC files -- only like 20 games actually use mods - winamp and/or foobar2000 plugins? upse123: - handle audio system errors better (right now we lock up solid) upse-audacious: - configuration dialog upse-xmms2: - implement? is it worth it? gst-upse: - implement so that gst users get quality PSF playback! + pick deadchip's brain on how best to handle upse's callback design upse-1.0.0/config.guess0000644000175000017500000012735011006314306014661 0ustar nenolodnenolod#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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, 2002, 2003, 2004, 2005 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 ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # 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 trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; 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 ; set_cc_for_build= ;' # 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 if [ "${UNAME_SYSTEM}" = "Linux" ] ; then eval $set_cc_for_build cat << EOF > $dummy.c #include #ifdef __UCLIBC__ # ifdef __UCLIBC_CONFIG_VERSION__ LIBC=uclibc __UCLIBC_CONFIG_VERSION__ # else LIBC=uclibc # endif #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'` fi # 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. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) 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 # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # 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 ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # 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. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; 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 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; 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 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; 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 ;; 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 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /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 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # 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 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; 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 -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; 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 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????: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 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; 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 ;; *: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 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi 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 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | 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 ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 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 -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 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 -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; 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 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; 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 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 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 i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo cris-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo frv-unknown-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; 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="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; 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-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-${LIBC} exit ;; 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. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C 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-${LIBC}" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld" exit ;; esac # This should get integrated into the C code below, but now we hack if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; 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 ;; 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 ;; 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 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; 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 ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. 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 ;; 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|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; 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 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; 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 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*: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; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *: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 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; 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 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *: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 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; 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\n"); 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 -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # 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 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; 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: upse-1.0.0/scripts/0000755000175000017500000000000011006314306014023 5ustar nenolodnenolodupse-1.0.0/scripts/makerelease.sh0000755000175000017500000000522711006314306016646 0ustar nenolodnenolod#!/bin/sh # mkrelease.sh: Creates a release suitable for distfiles.atheme.org. # # Copyright (c) 2007 atheme.org # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # if [ "x$1" = "x" ]; then echo "usage: $0 releasename [--automatic]" exit else RELEASENAME="$1" fi if [ "x$2" = "x--automatic" ]; then AUTOMATIC="yes" fi TIP=`hg tip --template "#rev#:#node|short#"` WRKDIR=`pwd` if [ -d $RELEASENAME ]; then echo "Deleting previous release named $RELEASENAME." rm -rf $WRKDIR/$RELEASENAME/ fi echo "Making release named $RELEASENAME (tip $TIP)" echo echo "Building root: $RELEASENAME/" hg archive $RELEASENAME cd $RELEASENAME sh autogen.sh rm -rf autogen.sh autom4te.cache # Run application specific instructions here. if [ -x "$WRKDIR/application.sh" ]; then source $WRKDIR/application.sh fi cd .. echo "Building $RELEASENAME.tgz from $RELEASENAME/" tar zcf $RELEASENAME.tgz $RELEASENAME/ echo "Building $RELEASENAME.tbz2 from $RELEASENAME/" tar jcf $RELEASENAME.tbz2 $RELEASENAME/ PUBLISH="yes" ok="0" if [ "x$AUTOMATIC" != "xyes" ]; then echo echo "Would you like to publish these releases now?" while [ $ok -eq 0 ]; do echo -n "[$PUBLISH] " read INPUT case $INPUT in [Yy]*) PUBLISH="yes" ok=1 ;; [Nn]*) PUBLISH="no" ok=1 ;; esac done fi if [ "x$PUBLISH" = "xyes" ]; then scp $RELEASENAME.tgz distfiles-master.atheme.org:/srv/distfiles scp $RELEASENAME.tbz2 distfiles-master.atheme.org:/srv/distfiles echo echo "The releases have been published, and will be available to the entire" echo "distribution network within 15 minutes." fi echo echo "Done. If you have any bugs to report, report them against" echo "the distfiles.atheme.org component at http://bugzilla.atheme.org" echo "Thanks!" echo upse-1.0.0/src/0000755000175000017500000000000011006314306013123 5ustar nenolodnenolodupse-1.0.0/src/libupse/0000755000175000017500000000000011006314306014566 5ustar nenolodnenolodupse-1.0.0/src/libupse/upse_ps1_memory_manager.c0000644000175000017500000001455411006314306021564 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_ps1_memory_manager.c * Purpose: libupse: UPSE PS1 Memory Manager * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include #include #include "upse-internal.h" char *psxM; char *psxP; char *psxR; char *psxH; char **upse_ps1_memory_LUT; void LoadPSXMem(u32 address, s32 length, unsigned char *data) { //printf("%08x %08x\n",address,length); while (length > 0) { if (address & 65535) { u32 tmplen; tmplen = ((65536 - (address & 65535)) > (u32) length) ? (u32) length : 65536 - (address & 65535); if (upse_ps1_memory_LUT[address >> 16]) memcpy((char *) (upse_ps1_memory_LUT[address >> 16] + (address & 65535)), data, tmplen); address += tmplen; data += tmplen; length -= tmplen; //printf("%08x %08x\n",address,tmplen); continue; } if (upse_ps1_memory_LUT[address >> 16]) { memcpy((char *) (upse_ps1_memory_LUT[address >> 16]), data, (length < 65536) ? length : 65536); } data += 65536; address += 65536; length -= 65536; } } static int writeok; int upse_ps1_memory_init() { int i; writeok = 1; upse_ps1_memory_LUT = malloc(0x10000 * sizeof *upse_ps1_memory_LUT); memset(upse_ps1_memory_LUT, 0, 0x10000 * sizeof *upse_ps1_memory_LUT); psxM = (char *) malloc(0x00200000); psxP = (char *) malloc(0x00010000); psxH = (char *) malloc(0x00010000); psxR = (char *) malloc(0x00080000); if (upse_ps1_memory_LUT == NULL || psxM == NULL || psxP == NULL || psxH == NULL || psxR == NULL) { printf("Error allocating memory"); return -1; } for (i = 0; i < 0x80; i++) upse_ps1_memory_LUT[i + 0x0000] = &psxM[(i & 0x1f) << 16]; memcpy(upse_ps1_memory_LUT + 0x8000, upse_ps1_memory_LUT, 0x80 * sizeof *upse_ps1_memory_LUT); memcpy(upse_ps1_memory_LUT + 0xa000, upse_ps1_memory_LUT, 0x80 * sizeof *upse_ps1_memory_LUT); for (i = 0; i < 0x01; i++) upse_ps1_memory_LUT[i + 0x1f00] = &psxP[i << 16]; for (i = 0; i < 0x01; i++) upse_ps1_memory_LUT[i + 0x1f80] = &psxH[i << 16]; for (i = 0; i < 0x08; i++) upse_ps1_memory_LUT[i + 0xbfc0] = &psxR[i << 16]; return 0; } void upse_ps1_memory_reset() { memset(psxM, 0, 0x00200000); memset(psxP, 0, 0x00010000); if (upse_has_custom_bios()) { FILE *f; _DEBUG("custom bios: %s", upse_get_custom_bios()); f = fopen(upse_get_custom_bios(), "rb"); if (f == NULL) { _DEBUG("opening custom bios failed"); memset(psxR, 0, 0x80000); upse_set_custom_bios(NULL); } else { fread(psxR, 1, 0x80000, f); fclose(f); } } } void upse_ps1_memory_shutdown() { if (psxM) free(psxM); if (psxP) free(psxP); if (psxH) free(psxH); if (psxR) free(psxR); if (upse_ps1_memory_LUT) free(upse_ps1_memory_LUT); psxM = psxP = psxH = psxR = NULL; upse_ps1_memory_LUT = NULL; } u8 upse_ps1_memory_read_8(u32 mem) { char *p; u32 t; t = mem >> 16; if (t == 0x1f80) { if (mem < 0x1f801000) return psxHu8(mem); else return upse_ps1_hal_read_8(mem); } else { p = (char *) (upse_ps1_memory_LUT[t]); if (p != NULL) { return *(u8 *) (p + (mem & 0xffff)); } else { return 0; } } } u16 upse_ps1_memory_read_16(u32 mem) { char *p; u32 t; t = mem >> 16; if (t == 0x1f80) { if (mem < 0x1f801000) return BFLIP16(psxHu16(mem)); else return upse_ps1_hal_read_16(mem); } else { p = (char *) (upse_ps1_memory_LUT[t]); if (p != NULL) { return BFLIP16(*(u16 *) (p + (mem & 0xffff))); } else { return 0; } } } u32 upse_ps1_memory_read_32(u32 mem) { char *p; u32 t; t = mem >> 16; if (t == 0x1f80) { if (mem < 0x1f801000) return BFLIP32(psxHu32(mem)); else return upse_ps1_hal_read_32(mem); } else { p = (char *) (upse_ps1_memory_LUT[t]); if (p != NULL) { return BFLIP32(*(u32 *) (p + (mem & 0xffff))); } else { return 0; } } } void upse_ps1_memory_write_8(u32 mem, u8 value) { char *p; u32 t; t = mem >> 16; if (t == 0x1f80) { if (mem < 0x1f801000) psxHu8(mem) = value; else upse_ps1_hal_write_8(mem, value); } else { p = (char *) (upse_ps1_memory_LUT[t]); if (p != NULL) { *(u8 *) (p + (mem & 0xffff)) = value; } } } void upse_ps1_memory_write_16(u32 mem, u16 value) { char *p; u32 t; t = mem >> 16; if (t == 0x1f80) { if (mem < 0x1f801000) psxHu16(mem) = BFLIP16(value); else upse_ps1_hal_write_16(mem, value); } else { p = (char *) (upse_ps1_memory_LUT[t]); if (p != NULL) { *(u16 *) (p + (mem & 0xffff)) = BFLIP16(value); } } } void upse_ps1_memory_write_32(u32 mem, u32 value) { char *p; u32 t; t = mem >> 16; if (t == 0x1f80) { if (mem < 0x1f801000) psxHu32(mem) = BFLIP32(value); else upse_ps1_hal_write_32(mem, value); } else { p = (char *) (upse_ps1_memory_LUT[t]); if (p != NULL) { *(u32 *) (p + (mem & 0xffff)) = BFLIP32(value); } else { if (mem != 0xfffe0130) { } else { int i; switch (value) { case 0x800: case 0x804: if (writeok == 0) break; writeok = 0; memset(upse_ps1_memory_LUT + 0x0000, 0, 0x80 * sizeof *upse_ps1_memory_LUT); memset(upse_ps1_memory_LUT + 0x8000, 0, 0x80 * sizeof *upse_ps1_memory_LUT); memset(upse_ps1_memory_LUT + 0xa000, 0, 0x80 * sizeof *upse_ps1_memory_LUT); break; case 0x1e988: if (writeok == 1) break; writeok = 1; for (i = 0; i < 0x80; i++) upse_ps1_memory_LUT[i + 0x0000] = &psxM[(i & 0x1f) << 16]; memcpy(upse_ps1_memory_LUT + 0x8000, upse_ps1_memory_LUT, 0x80 * sizeof *upse_ps1_memory_LUT); memcpy(upse_ps1_memory_LUT + 0xa000, upse_ps1_memory_LUT, 0x80 * sizeof *upse_ps1_memory_LUT); break; default: break; } } } } } upse-1.0.0/src/libupse/upse-ps1-bios-base.h0000644000175000017500000000202311006314306020253 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-ps1-bios-base.h * Purpose: libupse: UPSE PS1 FakeBIOS public header * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef _UPSE__LIBUPSE__UPSE_PS1_BIOS_BASE_H__GUARD #define _UPSE__LIBUPSE__UPSE_PS1_BIOS_BASE_H__GUARD /* these are for tracing in the executive layer --nenolod */ extern char *biosA0n[256]; extern char *biosB0n[256]; extern char *biosC0n[256]; void upse_ps1_bios_init(void); void upse_ps1_bios_shutdown(void); void upse_ps1_bios_exception(void); extern void (*biosA0[256]) (void); extern void (*biosB0[256]) (void); extern void (*biosC0[256]) (void); #endif upse-1.0.0/src/libupse/upse-string.h0000644000175000017500000000137211006314306017222 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-string.h * Purpose: libupse: string utility function header * * Copyright (c) 2007 William Pitcock * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef __UPSE__LIBUPSE__UPSE_STRING_H__GUARD #define __UPSE__LIBUPSE__UPSE_STRING_H__GUARD #include "upse.h" #include "upse-string.h" /* * fgets() wrapper - inefficient, but it will do. */ char *upse_io_fgets(char *s, int n, void *stream, upse_iofuncs_t * iofuncs); #endif upse-1.0.0/src/libupse/upse-ps1-dma-manager.h0000644000175000017500000000156111006314306020566 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-ps1-dma-manager.h * Purpose: libupse: UPSE PS1 DMA Manager headers * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef _UPSE__LIBUPSE__UPSE_PS1_DMA_MANAGER_H__GUARD #define _UPSE__LIBUPSE__UPSE_PS1_DMA_MANAGER_H__GUARD void psxDma2(u32 madr, u32 bcr, u32 chcr); void psxDma3(u32 madr, u32 bcr, u32 chcr); void psxDma4(u32 madr, u32 bcr, u32 chcr); void psxDma6(u32 madr, u32 bcr, u32 chcr); #endif upse-1.0.0/src/libupse/Makefile0000644000175000017500000000145511006314306016233 0ustar nenolodnenolodLIB = ${LIB_PREFIX}upse${LIB_SUFFIX} LIB_MAJOR = 2 LIB_MINOR = 0 SRCS = upse_string.c \ upse_util.c \ upse_unpack_psf.c \ upse_bios_manager.c \ upse_r3000_bytecode_evaluator.c \ upse_r3000_abstract.c \ upse_ps1_executive.c \ upse_ps1_counters.c \ upse_ps1_gpu.c \ upse_ps1_hal.c \ upse_ps1_bios_base.c \ upse_ps1_memory_manager.c \ upse_ps1_dma_manager.c \ upse_ps1_spu_base.c \ upse_ps1_spu_dma_handler.c \ upse_ps1_spu_register_io.c \ upse_ps1_spu_reverb.c \ upse_ps1_spu_adsr_filter.c \ INCLUDES = upse.h upse-types.h include ../../buildsys.mk include ../../extra.mk CFLAGS += ${PLUGIN_CFLAGS} CPPFLAGS += ${PLUGIN_CPPFLAGS} -I../../intl -I../.. -Ispu/ -I. LIBS += -lz upse-1.0.0/src/libupse/upse-ps1-executive.h0000644000175000017500000000132111006314306020410 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-ps1-executive.h * Purpose: libupse: PS1 application executive entrypoint list * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef __PSXHLE_H__ #define __PSXHLE_H__ extern void (*psxHLEt[256]) (); #endif /* __PSXHLE_H__ */ upse-1.0.0/src/libupse/upse_ps1_gpu.c0000644000175000017500000000317311006314306017350 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_ps1_gpu.c * Purpose: libupse: PS1 bogus GPU emulator (for lame replayers) * * Copyright (c) 2008 William Pitcock * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #define UPSE_DEBUG #include "upse-internal.h" typedef enum { UPSE_PS1_GPU_INITIALIZED = 0x14802000, /* primitive ops */ UPSE_PS1_GPU_DITHER = 0x00000200, UPSE_PS1_GPU_CANDRAW = 0x00000400, UPSE_PS1_GPU_MASKDRAWN = 0x00000800, UPSE_PS1_GPU_MASKENABLE = 0x00001000, /* generic flags */ UPSE_PS1_GPU_BITWIDTH = 0x00070000, UPSE_PS1_GPU_DBLHEIGHT = 0x00080000, UPSE_PS1_GPU_PAL = 0x00100000, UPSE_PS1_GPU_TRUECOLOR = 0x00200000, UPSE_PS1_GPU_INTERLACED = 0x00400000, UPSE_PS1_GPU_NODISPLAY = 0x00800000, /* status flags */ UPSE_PS1_GPU_IDLE = 0x04000000, UPSE_PS1_GPU_VRAMXFER = 0x08000000, UPSE_PS1_GPU_READY = 0x10000000, UPSE_PS1_GPU_DMA = 0x60000000, UPSE_PS1_GPU_ODDLINES = 0x80000000 } upse_gpu_status_t; struct { upse_gpu_status_t status; } upse_gpu_state = {}; void upse_ps1_gpu_set_status(u32 cmd) { printf("dongs.\n\n\n"); switch(cmd) { default: _DEBUG("Unknown cmd [0x%x]", cmd); return; } } u32 upse_ps1_gpu_get_status(void) { return upse_gpu_state.status; } upse-1.0.0/src/libupse/upse-ps1-spu-adsr-filter.h0000644000175000017500000000135511006314306021437 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-ps1-spu-adsr-filter.h * Purpose: libupse: PS1 SPU ADSR filter header * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 2002 Pete Bernert * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef _UPSE__LIBUPSE__UPSE_PS1_SPU_ADSR_FILTER_H__GUARD #define _UPSE__LIBUPSE__UPSE_PS1_SPU_ADSR_FILTER_H__GUARD void InitADSR(void); void StartADSR(int ch); int MixADSR(int ch); #endif upse-1.0.0/src/libupse/upse-types.h0000644000175000017500000000177311006314306017065 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-types.h * Purpose: libupse: type aliases * * Copyright (c) 2007 William Pitcock * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef _UPSE__LIBUPSE__UPSE_TYPES_H__GUARD #define _UPSE__LIBUPSE__UPSE_TYPES_H__GUARD #include #include #include #include #include #include #define INLINE inline typedef int8_t s8; typedef int16_t s16; typedef int32_t s32; typedef int64_t s64; typedef intptr_t sptr; typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; typedef uintptr_t uptr; #ifdef __GNUC__ # define upse_packed_t __attribute__ ((packed)) #else # define upse_packed_t #endif #endif upse-1.0.0/src/libupse/upse-ps1-hal.h0000644000175000017500000000166011006314306017161 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-ps1-hal.h * Purpose: libupse: PS1 HAL implementation header * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef _UPSE__LIBUPSE__UPSE_PS1_HAL_H__GUARD #define _UPSE__LIBUPSE__UPSE_PS1_HAL_H__GUARD void upse_ps1_hal_reset(); u8 upse_ps1_hal_read_8(u32 add); u16 upse_ps1_hal_read_16(u32 add); u32 upse_ps1_hal_read_32(u32 add); void upse_ps1_hal_write_8(u32 add, u8 value); void upse_ps1_hal_write_16(u32 add, u16 value); void upse_ps1_hal_write_32(u32 add, u32 value); #endif upse-1.0.0/src/libupse/upse_ps1_spu_adsr_filter.c0000644000175000017500000004570011006314306021744 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_ps1_spu_adsr_filter.c * Purpose: libupse: PS1 SPU ADSR filter * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 2002 Pete Bernert * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include "upse-types.h" #include "upse-spu-internal.h" //////////////////////////////////////////////////////////////////////// // ADSR func //////////////////////////////////////////////////////////////////////// static u32 RateTable[160]; void InitADSR(void) // INIT ADSR { u32 r, rs, rd; int i; memset(RateTable, 0, sizeof(u32) * 160); // build the rate table according to Neill's rules (see at bottom of file) r = 3; rs = 1; rd = 0; for (i = 32; i < 160; i++) // we start at pos 32 with the real values... everything before is 0 { if (r < 0x3FFFFFFF) { r += rs; rd++; if (rd == 5) { rd = 1; rs *= 2; } } if (r > 0x3FFFFFFF) r = 0x3FFFFFFF; RateTable[i] = r; } } //////////////////////////////////////////////////////////////////////// void StartADSR(int ch) // MIX ADSR { s_chan[ch].ADSRX.lVolume = 1; // and init some adsr vars s_chan[ch].ADSRX.State = 0; s_chan[ch].ADSRX.EnvelopeVol = 0; } //////////////////////////////////////////////////////////////////////// int MixADSR(int ch) // MIX ADSR { static const int sexytable[8] = { 0, 4, 6, 8, 9, 10, 11, 12 }; if (s_chan[ch].bStop) // should be stopped: { // do release if (s_chan[ch].ADSRX.ReleaseModeExp) { s_chan[ch].ADSRX.EnvelopeVol -= RateTable[(4 * (s_chan[ch].ADSRX.ReleaseRate ^ 0x1F)) - 0x18 + 32 + sexytable[(s_chan[ch].ADSRX.EnvelopeVol >> 28) & 0x7]]; } else { s_chan[ch].ADSRX.EnvelopeVol -= RateTable[(4 * (s_chan[ch].ADSRX.ReleaseRate ^ 0x1F)) - 0x0C + 32]; } if (s_chan[ch].ADSRX.EnvelopeVol < 0) { s_chan[ch].ADSRX.EnvelopeVol = 0; s_chan[ch].bOn = 0; s_chan[ch].bNoise = 0; } s_chan[ch].ADSRX.lVolume = s_chan[ch].ADSRX.EnvelopeVol >> 21; return s_chan[ch].ADSRX.lVolume; } else // not stopped yet? { if (s_chan[ch].ADSRX.State == 0) // -> attack { if (s_chan[ch].ADSRX.AttackModeExp) { if (s_chan[ch].ADSRX.EnvelopeVol < 0x60000000) s_chan[ch].ADSRX.EnvelopeVol += RateTable[(s_chan[ch].ADSRX.AttackRate ^ 0x7F) - 0x10 + 32]; else s_chan[ch].ADSRX.EnvelopeVol += RateTable[(s_chan[ch].ADSRX.AttackRate ^ 0x7F) - 0x18 + 32]; } else { s_chan[ch].ADSRX.EnvelopeVol += RateTable[(s_chan[ch].ADSRX.AttackRate ^ 0x7F) - 0x10 + 32]; } if (s_chan[ch].ADSRX.EnvelopeVol < 0) { s_chan[ch].ADSRX.EnvelopeVol = 0x7FFFFFFF; s_chan[ch].ADSRX.State = 1; } s_chan[ch].ADSRX.lVolume = s_chan[ch].ADSRX.EnvelopeVol >> 21; return s_chan[ch].ADSRX.lVolume; } //--------------------------------------------------// if (s_chan[ch].ADSRX.State == 1) // -> decay { s_chan[ch].ADSRX.EnvelopeVol -= RateTable[(4 * (s_chan[ch].ADSRX.DecayRate ^ 0x1F)) - 0x18 + 32 + sexytable[(s_chan[ch].ADSRX.EnvelopeVol >> 28) & 0x7]]; if (s_chan[ch].ADSRX.EnvelopeVol < 0) s_chan[ch].ADSRX.EnvelopeVol = 0; if (((s_chan[ch].ADSRX.EnvelopeVol >> 27) & 0xF) <= s_chan[ch].ADSRX.SustainLevel) { s_chan[ch].ADSRX.State = 2; } s_chan[ch].ADSRX.lVolume = s_chan[ch].ADSRX.EnvelopeVol >> 21; return s_chan[ch].ADSRX.lVolume; } //--------------------------------------------------// if (s_chan[ch].ADSRX.State == 2) // -> sustain { if (s_chan[ch].ADSRX.SustainIncrease) { if (s_chan[ch].ADSRX.SustainModeExp) { if (s_chan[ch].ADSRX.EnvelopeVol < 0x60000000) s_chan[ch].ADSRX.EnvelopeVol += RateTable[(s_chan[ch].ADSRX.SustainRate ^ 0x7F) - 0x10 + 32]; else s_chan[ch].ADSRX.EnvelopeVol += RateTable[(s_chan[ch].ADSRX.SustainRate ^ 0x7F) - 0x18 + 32]; } else { s_chan[ch].ADSRX.EnvelopeVol += RateTable[(s_chan[ch].ADSRX.SustainRate ^ 0x7F) - 0x10 + 32]; } if (s_chan[ch].ADSRX.EnvelopeVol < 0) { s_chan[ch].ADSRX.EnvelopeVol = 0x7FFFFFFF; } } else { if (s_chan[ch].ADSRX.SustainModeExp) s_chan[ch].ADSRX.EnvelopeVol -= RateTable[((s_chan[ch].ADSRX.SustainRate ^ 0x7F)) - 0x1B + 32 + sexytable[(s_chan[ch].ADSRX.EnvelopeVol >> 28) & 0x7]]; else s_chan[ch].ADSRX.EnvelopeVol -= RateTable[((s_chan[ch].ADSRX.SustainRate ^ 0x7F)) - 0x0F + 32]; if (s_chan[ch].ADSRX.EnvelopeVol < 0) { s_chan[ch].ADSRX.EnvelopeVol = 0; } } s_chan[ch].ADSRX.lVolume = s_chan[ch].ADSRX.EnvelopeVol >> 21; return s_chan[ch].ADSRX.lVolume; } } return 0; } /* James Higgs ADSR investigations: PSX SPU Envelope Timings ~~~~~~~~~~~~~~~~~~~~~~~~ First, here is an extract from doomed's SPU doc, which explains the basics of the SPU "volume envelope": *** doomed doc extract start *** -------------------------------------------------------------------------- Voices. -------------------------------------------------------------------------- The SPU has 24 hardware voices. These voices can be used to reproduce sample data, noise or can be used as frequency modulator on the next voice. Each voice has it's own programmable ADSR envelope filter. The main volume can be programmed independently for left and right output. The ADSR envelope filter works as follows: Ar = Attack rate, which specifies the speed at which the volume increases from zero to it's maximum value, as soon as the note on is given. The slope can be set to lineair or exponential. Dr = Decay rate specifies the speed at which the volume decreases to the sustain level. Decay is always decreasing exponentially. Sl = Sustain level, base level from which sustain starts. Sr = Sustain rate is the rate at which the volume of the sustained note increases or decreases. This can be either lineair or exponential. Rr = Release rate is the rate at which the volume of the note decreases as soon as the note off is given. lvl | ^ | /\Dr __ Sl _| _ / _ \__--- \ | / ---__ \ Rr | /Ar Sr \ \ | / \\ |/___________________\________ ->time The overal volume can also be set to sweep up or down lineairly or exponentially from it's current value. This can be done seperately for left and right. Relevant SPU registers: ------------------------------------------------------------- $1f801xx8 Attack/Decay/Sustain level bit |0f|0e 0d 0c 0b 0a 09 08|07 06 05 04|03 02 01 00| desc.|Am| Ar |Dr |Sl | Am 0 Attack mode Linear 1 Exponential Ar 0-7f attack rate Dr 0-f decay rate Sl 0-f sustain level ------------------------------------------------------------- $1f801xxa Sustain rate, Release Rate. bit |0f|0e|0d|0c 0b 0a 09 08 07 06|05|04 03 02 01 00| desc.|Sm|Sd| 0| Sr |Rm|Rr | Sm 0 sustain rate mode linear 1 exponential Sd 0 sustain rate mode increase 1 decrease Sr 0-7f Sustain Rate Rm 0 Linear decrease 1 Exponential decrease Rr 0-1f Release Rate Note: decay mode is always Expontial decrease, and thus cannot be set. ------------------------------------------------------------- $1f801xxc Current ADSR volume bit |0f 0e 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00| desc.|ADSRvol | ADSRvol Returns the current envelope volume when read. -- James' Note: return range: 0 -> 32767 *** doomed doc extract end *** By using a small PSX proggie to visualise the envelope as it was played, the following results for envelope timing were obtained: 1. Attack rate value (linear mode) Attack value range: 0 -> 127 Value | 48 | 52 | 56 | 60 | 64 | 68 | 72 | | 80 | ----------------------------------------------------------------- Frames | 11 | 21 | 42 | 84 | 169| 338| 676| |2890| Note: frames is no. of PAL frames to reach full volume (100% amplitude) Hmm, noticing that the time taken to reach full volume doubles every time we add 4 to our attack value, we know the equation is of form: frames = k * 2 ^ (value / 4) (You may ponder about envelope generator hardware at this point, or maybe not... :) By substituting some stuff and running some checks, we get: k = 0.00257 (close enuf) therefore, frames = 0.00257 * 2 ^ (value / 4) If you just happen to be writing an emulator, then you can probably use an equation like: %volume_increase_per_tick = 1 / frames ------------------------------------ Pete: ms=((1<<(value>>2))*514)/10000 ------------------------------------ 2. Decay rate value (only has log mode) Decay value range: 0 -> 15 Value | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ------------------------------------------------ frames | | | | | 6 | 12 | 24 | 47 | Note: frames here is no. of PAL frames to decay to 50% volume. formula: frames = k * 2 ^ (value) Substituting, we get: k = 0.00146 Further info on logarithmic nature: frames to decay to sustain level 3 = 3 * frames to decay to sustain level 9 Also no. of frames to 25% volume = roughly 1.85 * no. of frames to 50% volume. Frag it - just use linear approx. ------------------------------------ Pete: ms=((1< 127 Value | 48 | 52 | 56 | 60 | 64 | 68 | 72 | ------------------------------------------- frames | 9 | 19 | 37 | 74 | 147| 293| 587| Here, frames = no. of PAL frames for volume amplitude to go from 100% to 0% (or vice-versa). Same formula as for attack value, just a different value for k: k = 0.00225 ie: frames = 0.00225 * 2 ^ (value / 4) For emulation purposes: %volume_increase_or_decrease_per_tick = 1 / frames ------------------------------------ Pete: ms=((1<<(value>>2))*450)/10000 ------------------------------------ 4. Release rate (linear mode) Release rate range: 0 -> 31 Value | 13 | 14 | 15 | 16 | 17 | --------------------------------------------------------------- frames | 18 | 36 | 73 | 146| 292| Here, frames = no. of PAL frames to decay from 100% vol to 0% vol after "note-off" is triggered. Formula: frames = k * 2 ^ (value) And so: k = 0.00223 ------------------------------------ Pete: ms=((1< release phase { if(s_chan[ch].ADSR.ReleaseVal!=0) // -> release not 0: do release (if 0: stop right now) { if(!s_chan[ch].ADSR.ReleaseVol) // --> release just started? set up the release stuff { s_chan[ch].ADSR.ReleaseStartTime=s_chan[ch].ADSR.lTime; s_chan[ch].ADSR.ReleaseVol=s_chan[ch].ADSR.lVolume; s_chan[ch].ADSR.ReleaseTime = // --> calc how long does it take to reach the wanted sus level (s_chan[ch].ADSR.ReleaseTime* s_chan[ch].ADSR.ReleaseVol)/1024; } // -> NO release exp mode used (yet) v=s_chan[ch].ADSR.ReleaseVol; // -> get last volume lT=s_chan[ch].ADSR.lTime- // -> how much time is past? s_chan[ch].ADSR.ReleaseStartTime; l1=s_chan[ch].ADSR.ReleaseTime; if(lT we still have to release { v=v-((v*lT)/l1); // --> calc new volume } else // -> release is over: now really stop that sample {v=0;s_chan[ch].bOn=0;s_chan[ch].ADSR.ReleaseVol=0;s_chan[ch].bNoise=0;} } else // -> release IS 0: release at once { v=0;s_chan[ch].bOn=0;s_chan[ch].ADSR.ReleaseVol=0;s_chan[ch].bNoise=0; } } else {//--------------------------------------------------// not in release phase: v=1024; lT=s_chan[ch].ADSR.lTime; l1=s_chan[ch].ADSR.AttackTime; if(lT0) { if(l3!=0) v2+=((v-v2)*lT)/l3; else v2=v; } else { if(l3!=0) v2-=(v2*lT)/l3; else v2=v; } if(v2>v) v2=v; if(v2<=0) {v2=0;s_chan[ch].bOn=0;s_chan[ch].ADSR.ReleaseVol=0;s_chan[ch].bNoise=0;} v=v2; } } } //----------------------------------------------------// // ok, done for this channel, so increase time s_chan[ch].ADSR.lTime+=1; // 1 = 1.020408f ms; if(v>1024) v=1024; // adjust volume if(v<0) v=0; s_chan[ch].ADSR.lVolume=v; // store act volume return v; // return the volume factor */ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- /* ----------------------------------------------------------------------------- Neill Corlett Playstation SPU envelope timing notes ----------------------------------------------------------------------------- This is preliminary. This may be wrong. But the model described herein fits all of my experimental data, and it's just simple enough to sound right. ADSR envelope level ranges from 0x00000000 to 0x7FFFFFFF internally. The value returned by channel reg 0xC is (envelope_level>>16). Each sample, an increment or decrement value will be added to or subtracted from this envelope level. Create the rate log table. The values double every 4 entries. entry #0 = 4 4, 5, 6, 7, 8,10,12,14, 16,20,24,28, ... entry #40 = 4096... entry #44 = 8192... entry #48 = 16384... entry #52 = 32768... entry #56 = 65536... increments and decrements are in terms of ratelogtable[n] n may exceed the table bounds (plan on n being between -32 and 127). table values are all clipped between 0x00000000 and 0x3FFFFFFF when you "voice on", the envelope is always fully reset. (yes, it may click. the real thing does this too.) envelope level begins at zero. each state happens for at least 1 cycle (transitions are not instantaneous) this may result in some oddness: if the decay rate is uberfast, it will cut the envelope from full down to half in one sample, potentially skipping over the sustain level ATTACK ------ - if the envelope level has overflowed past the max, clip to 0x7FFFFFFF and proceed to DECAY. Linear attack mode: - line extends upward to 0x7FFFFFFF - increment per sample is ratelogtable[(Ar^0x7F)-0x10] Logarithmic attack mode: if envelope_level < 0x60000000: - line extends upward to 0x60000000 - increment per sample is ratelogtable[(Ar^0x7F)-0x10] else: - line extends upward to 0x7FFFFFFF - increment per sample is ratelogtable[(Ar^0x7F)-0x18] DECAY ----- - if ((envelope_level>>27)&0xF) <= Sl, proceed to SUSTAIN. Do not clip to the sustain level. - current line ends at (envelope_level & 0x07FFFFFF) - decrement per sample depends on (envelope_level>>28)&0x7 0: ratelogtable[(4*(Dr^0x1F))-0x18+0] 1: ratelogtable[(4*(Dr^0x1F))-0x18+4] 2: ratelogtable[(4*(Dr^0x1F))-0x18+6] 3: ratelogtable[(4*(Dr^0x1F))-0x18+8] 4: ratelogtable[(4*(Dr^0x1F))-0x18+9] 5: ratelogtable[(4*(Dr^0x1F))-0x18+10] 6: ratelogtable[(4*(Dr^0x1F))-0x18+11] 7: ratelogtable[(4*(Dr^0x1F))-0x18+12] (note that this is the same as the release rate formula, except that decay rates 10-1F aren't possible... those would be slower in theory) SUSTAIN ------- - no terminating condition except for voice off - Sd=0 (increase) behavior is identical to ATTACK for both log and linear. - Sd=1 (decrease) behavior: Linear sustain decrease: - line extends to 0x00000000 - decrement per sample is ratelogtable[(Sr^0x7F)-0x0F] Logarithmic sustain decrease: - current line ends at (envelope_level & 0x07FFFFFF) - decrement per sample depends on (envelope_level>>28)&0x7 0: ratelogtable[(Sr^0x7F)-0x1B+0] 1: ratelogtable[(Sr^0x7F)-0x1B+4] 2: ratelogtable[(Sr^0x7F)-0x1B+6] 3: ratelogtable[(Sr^0x7F)-0x1B+8] 4: ratelogtable[(Sr^0x7F)-0x1B+9] 5: ratelogtable[(Sr^0x7F)-0x1B+10] 6: ratelogtable[(Sr^0x7F)-0x1B+11] 7: ratelogtable[(Sr^0x7F)-0x1B+12] RELEASE ------- - if the envelope level has overflowed to negative, clip to 0 and QUIT. Linear release mode: - line extends to 0x00000000 - decrement per sample is ratelogtable[(4*(Rr^0x1F))-0x0C] Logarithmic release mode: - line extends to (envelope_level & 0x0FFFFFFF) - decrement per sample depends on (envelope_level>>28)&0x7 0: ratelogtable[(4*(Rr^0x1F))-0x18+0] 1: ratelogtable[(4*(Rr^0x1F))-0x18+4] 2: ratelogtable[(4*(Rr^0x1F))-0x18+6] 3: ratelogtable[(4*(Rr^0x1F))-0x18+8] 4: ratelogtable[(4*(Rr^0x1F))-0x18+9] 5: ratelogtable[(4*(Rr^0x1F))-0x18+10] 6: ratelogtable[(4*(Rr^0x1F))-0x18+11] 7: ratelogtable[(4*(Rr^0x1F))-0x18+12] ----------------------------------------------------------------------------- */ upse-1.0.0/src/libupse/upse-internal.h0000644000175000017500000000245011006314306017526 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-internal.h * Purpose: libupse: UPSE Internal header * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef __PSXCOMMON_H__ #define __PSXCOMMON_H__ #if PSS_STYLE==2 #define PSS "\\" #define PS '\\' #elif PSS_STYLE==1 #define PSS "/" #define PS '/' #elif PSS_STYLE==3 #define PSS "\\" #define PS '\\' #endif #include #include #include "upse-types.h" void __Log(char *fmt, ...); #define BIAS 2 #define PSXCLK 33868800 /* 33.8688 Mhz */ #include "upse.h" #include "upse-debug.h" #include "upse-r3000-abstract.h" #include "upse-ps1-memory-manager.h" #include "upse-ps1-hal.h" #include "upse-ps1-gpu.h" #include "upse-ps1-bios-base.h" #include "upse-ps1-dma-manager.h" #include "upse-ps1-counters.h" #include "upse-ps1-executive.h" #include "upse-ps1-spu-abstract.h" #include "upse-ps1-spu-base.h" #endif /* __PSXCOMMON_H__ */ upse-1.0.0/src/libupse/.indent.pro0000644000175000017500000000143511006314306016652 0ustar nenolodnenolod/* $Id: .indent.pro 238 2005-09-21 05:26:03Z nenolod $ */ /* copy this file to the source dir then run indent file.c */ --gnu-style /* This is the indent before the brace not inside the block. */ --brace-indent0 /* Indent case: by 2 and braces inside case by 0(then by 0)... */ --case-brace-indentation0 --case-indentation2 --indent-level4 /* Put while() on the brace from do... */ --cuddle-do-while /* Disable an annoying format... */ --no-space-after-function-call-names /* Disable an annoying format... */ --dont-break-procedure-type --line-length200 /* typedefs */ -T boolean_t -T node_t -T list_t -T tld_t -T kline_t -T EVH -T sra_t -T server_t -T user_t -T channel_t -T chanuser_t -T myuser_t -T mychan_t -T chanacs_t -T CONFIGENTRY -T CONFIGFILE -T Block -T MemBlock -T BlockHeap upse-1.0.0/src/libupse/upse-ps1-spu-reverb.h0000644000175000017500000000143011006314306020502 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-ps1-spu-reverb.h * Purpose: libupse: PS1 SPU reverb header * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 2002 Pete Bernert * Portions copyright (c) 2003 Neill Corlett * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef _UPSE__LIBUPSE__UPSE_PS1_SPU_REVERB_H__GUARD #define _UPSE__LIBUPSE__UPSE_PS1_SPU_REVERB_H__GUARD extern void MixREVERBLeftRight(s32 * oleft, s32 * oright, s32 inleft, s32 inright); #endif upse-1.0.0/src/libupse/upse-debug.h0000644000175000017500000000177511006314306017011 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-debug.h * Purpose: libupse: UPSE debug infrastructure * * Copyright (c) 2007 William Pitcock * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef _UPSE__LIBUPSE__UPSE_DEBUG_H__GUARD #define _UPSE__LIBUPSE__UPSE_DEBUG_H__GUARD #define _ENTER _DEBUG("enter") #define _LEAVE _DEBUG("leave") #define _MESSAGE(tag, string, ...) do { fprintf(stderr, "libupse: %s: %s:%d (%s): " string "\n", \ tag, __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); } while(0) #define _ERROR(...) _MESSAGE("ERROR", __VA_ARGS__) #define _WARN(...) _MESSAGE("WARN", __VA_ARGS__) #ifdef UPSE_DEBUG #define _DEBUG(...) _MESSAGE("DEBUG", __VA_ARGS__) #else #define _DEBUG(...) {} #endif #endif upse-1.0.0/src/libupse/upse_ps1_hal.c0000644000175000017500000001606711006314306017327 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_ps1_hal.c * Purpose: libupse: PS1 HAL implementation * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include #include #include "upse-internal.h" #define HW_DMA4_MADR (psxHu32(0x10c0)) // SPU DMA #define HW_DMA4_BCR (psxHu32(0x10c4)) #define HW_DMA4_CHCR (psxHu32(0x10c8)) #define HW_DMA_PCR (psxHu32(0x10f0)) #define HW_DMA_ICR (psxHu32(0x10f4)) void upse_ps1_hal_reset() { memset(psxH, 0, 0x10000); psxRcntInit(); } u8 upse_ps1_hal_read_8(u32 add) { u8 hard; switch (add) { default: hard = psxHu8(add); return hard; } return hard; } u16 upse_ps1_hal_read_16(u32 add) { u16 hard; switch (add) { case 0x1f801100: hard = psxRcntRcount(0); return hard; case 0x1f801104: hard = psxCounters[0].mode; return hard; case 0x1f801108: hard = psxCounters[0].target; return hard; case 0x1f801110: hard = psxRcntRcount(1); return hard; case 0x1f801114: hard = psxCounters[1].mode; return hard; case 0x1f801118: hard = psxCounters[1].target; return hard; case 0x1f801120: hard = psxRcntRcount(2); return hard; case 0x1f801124: hard = psxCounters[2].mode; return hard; case 0x1f801128: hard = psxCounters[2].target; return hard; case 0x1f801070: hard = psxHu16(0x1070); return hard; case 0x1f801074: hard = psxHu16(0x1074); return hard; case 0x1f8010f0: hard = psxHu16(0x10f0); return hard; case 0x1f8010f4: hard = psxHu16(0x10f4); return hard; default: if (add >= 0x1f801c00 && add < 0x1f801e00) { hard = SPUreadRegister(add); } else { _DEBUG("unknown address [0x%x]", add); hard = BFLIP16(psxHu16(add)); } return hard; } return hard; } u32 upse_ps1_hal_read_32(u32 add) { u32 hard; switch (add) { // time for rootcounters :) case 0x1f801100: hard = psxRcntRcount(0); return hard; case 0x1f801104: hard = psxCounters[0].mode; return hard; case 0x1f801108: hard = psxCounters[0].target; return hard; case 0x1f801110: hard = psxRcntRcount(1); return hard; case 0x1f801114: hard = psxCounters[1].mode; return hard; case 0x1f801118: hard = psxCounters[1].target; return hard; case 0x1f801120: hard = psxRcntRcount(2); return hard; case 0x1f801124: hard = psxCounters[2].mode; return hard; case 0x1f801128: hard = psxCounters[2].target; return hard; case 0x1f801070: hard = psxHu32(0x1070); return hard; case 0x1f801074: hard = psxHu32(0x1074); return hard; case 0x1f8010f0: hard = psxHu32(0x10f0); return hard; case 0x1f8010f4: hard = psxHu32(0x10f4); return hard; case 0x1f801814: hard = BFLIP32(upse_ps1_gpu_get_status()); return hard; default: _DEBUG("unknown address [0x%x]", add); hard = BFLIP32(psxHu32(add)); return hard; } return hard; } void upse_ps1_hal_write_8(u32 add, u8 value) { switch (add) { default: psxHu8(add) = value; return; } psxHu8(add) = value; } void upse_ps1_hal_write_16(u32 add, u16 value) { switch (add) { case 0x1f801100: psxRcntWcount(0, value); return; case 0x1f801104: psxRcntWmode(0, value); return; case 0x1f801108: psxRcntWtarget(0, value); return; case 0x1f801110: psxRcntWcount(1, value); return; case 0x1f801114: psxRcntWmode(1, value); return; case 0x1f801118: psxRcntWtarget(1, value); return; case 0x1f801120: psxRcntWcount(2, value); return; case 0x1f801124: psxRcntWmode(2, value); return; case 0x1f801128: psxRcntWtarget(2, value); return; case 0x1f801070: psxHu16(0x1070) |= BFLIP16(0x200); psxHu16(0x1070) &= BFLIP16((psxHu16(0x1074) & value)); return; case 0x1f801074: psxHu16(0x1074) = BFLIP16(value); upse_r3000_cpu_regs.interrupt |= 0x80000000; return; default: if (add >= 0x1f801c00 && add < 0x1f801e00) { SPUwriteRegister(add, value); return; } _DEBUG("unknown address [0x%x]", add); psxHu16(add) = BFLIP16(value); return; } psxHu16(add) = BFLIP16(value); } #define DMA_INTERRUPT(n) \ if (BFLIP32(HW_DMA_ICR) & (1 << (16 + n))) { \ HW_DMA_ICR|= BFLIP32(1 << (24 + n)); \ psxHu32(0x1070) |= BFLIP32(8); \ } #define DmaExec(n) { \ if (BFLIP32(HW_DMA##n##_CHCR) & 0x01000000 && BFLIP32(HW_DMA_PCR) & (8 << (n * 4))) { \ psxDma##n(BFLIP32(HW_DMA##n##_MADR), BFLIP32(HW_DMA##n##_BCR), BFLIP32(HW_DMA##n##_CHCR)); \ HW_DMA##n##_CHCR &= BFLIP32(~0x01000000); \ DMA_INTERRUPT(n); \ } \ } void upse_ps1_hal_write_32(u32 add, u32 value) { switch (add) { case 0x1f8010c8: HW_DMA4_CHCR = BFLIP32(value); // DMA4 chcr (SPU DMA) DmaExec(4); return; case 0x1f8010f4: { u32 tmp = (~value) & BFLIP32(HW_DMA_ICR); HW_DMA_ICR = BFLIP32(((tmp ^ value) & 0xffffff) ^ tmp); return; } case 0x1f801100: psxRcntWcount(0, value & 0xffff); return; case 0x1f801104: psxRcntWmode(0, value); return; case 0x1f801108: psxRcntWtarget(0, value & 0xffff); return; // HW_DMA_ICR&= (~value)&0xff000000; case 0x1f801110: psxRcntWcount(1, value & 0xffff); return; case 0x1f801114: psxRcntWmode(1, value); return; case 0x1f801118: psxRcntWtarget(1, value & 0xffff); return; case 0x1f801120: psxRcntWcount(2, value & 0xffff); return; case 0x1f801124: psxRcntWmode(2, value); return; case 0x1f801128: psxRcntWtarget(2, value & 0xffff); return; case 0x1f8010c0: _DEBUG("DMA4 MADR 32bit write %x", value); HW_DMA4_MADR = BFLIP32(value); return; case 0x1f8010c4: _DEBUG("DMA4 BCR 32bit write %lx", value); HW_DMA4_BCR = BFLIP32(value); return; case 0x1f801070: psxHu32(0x1070) |= BFLIP32(0x200); psxHu32(0x1070) &= BFLIP32((psxHu32(0x1074) & value)); return; case 0x1f801074: psxHu32(0x1074) = BFLIP32(value); upse_r3000_cpu_regs.interrupt |= 0x80000000; return; case 0x1f801814: upse_ps1_gpu_set_status(BFLIP32(value)); return; default: _DEBUG("unknown address [0x%x]", add); psxHu32(add) = BFLIP32(value); return; } psxHu32(add) = BFLIP32(value); } void SPUirq(void) { psxHu32(0x1070) |= BFLIP32(0x200); } upse-1.0.0/src/libupse/upse_ps1_spu_base.c0000644000175000017500000005717711006314306020373 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_ps1_spu_base.c * Purpose: libupse: PS1 SPU base code * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 2002 Pete Bernert * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #define _IN_SPU #include "upse-types.h" #include "upse-internal.h" #include "upse-ps1-spu-base.h" #include "upse-spu-internal.h" #include "upse-ps1-spu-register-io.h" #include "upse-ps1-spu-reverb.h" #include "upse-ps1-spu-adsr-filter.h" #include "upse.h" #include "upse-ps1-memory-manager.h" //////////////////////////////////////////////////////////////////////// // globals //////////////////////////////////////////////////////////////////////// // psx buffer / addresses u16 regArea[0x200]; u16 spuMem[256 * 1024]; u8 *spuMemC; u8 *pSpuIrq = 0; u8 *pSpuBuffer; // user settings static int iVolume; // MAIN infos struct for each channel SPUCHAN s_chan[MAXCHAN + 1]; // channel + 1 infos (1 is security for fmod handling) REVERBInfo rvb; u32 dwNoiseVal = 1; // global noise generator u16 spuCtrl = 0; // some vars to store psx reg infos u16 spuStat = 0; u16 spuIrq = 0; u32 spuAddr = 0xffffffff; // address into spu mem int bSPUIsOpen = 0; static const int f[5][2] = { {0, 0}, {60, 0}, {115, -52}, {98, -55}, {122, -60} }; s16 *pS; //////////////////////////////////////////////////////////////////////// // CODE AREA //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // helpers for so-called "gauss interpolation" #define gval0 (((int *)(&s_chan[ch].SB[29]))[gpos]) #define gval(x) (((int *)(&s_chan[ch].SB[29]))[(gpos+x)&3]) // 1024 entries const int gauss[] = { 0x172, 0x519, 0x176, 0x000, 0x16E, 0x519, 0x17A, 0x000, 0x16A, 0x518, 0x17D, 0x000, 0x166, 0x518, 0x181, 0x000, 0x162, 0x518, 0x185, 0x000, 0x15F, 0x518, 0x189, 0x000, 0x15B, 0x518, 0x18D, 0x000, 0x157, 0x517, 0x191, 0x000, 0x153, 0x517, 0x195, 0x000, 0x150, 0x517, 0x19A, 0x000, 0x14C, 0x516, 0x19E, 0x000, 0x148, 0x516, 0x1A2, 0x000, 0x145, 0x515, 0x1A6, 0x000, 0x141, 0x514, 0x1AA, 0x000, 0x13E, 0x514, 0x1AE, 0x000, 0x13A, 0x513, 0x1B2, 0x000, 0x137, 0x512, 0x1B7, 0x001, 0x133, 0x511, 0x1BB, 0x001, 0x130, 0x511, 0x1BF, 0x001, 0x12C, 0x510, 0x1C3, 0x001, 0x129, 0x50F, 0x1C8, 0x001, 0x125, 0x50E, 0x1CC, 0x001, 0x122, 0x50D, 0x1D0, 0x001, 0x11E, 0x50C, 0x1D5, 0x001, 0x11B, 0x50B, 0x1D9, 0x001, 0x118, 0x50A, 0x1DD, 0x001, 0x114, 0x508, 0x1E2, 0x001, 0x111, 0x507, 0x1E6, 0x002, 0x10E, 0x506, 0x1EB, 0x002, 0x10B, 0x504, 0x1EF, 0x002, 0x107, 0x503, 0x1F3, 0x002, 0x104, 0x502, 0x1F8, 0x002, 0x101, 0x500, 0x1FC, 0x002, 0x0FE, 0x4FF, 0x201, 0x002, 0x0FB, 0x4FD, 0x205, 0x003, 0x0F8, 0x4FB, 0x20A, 0x003, 0x0F5, 0x4FA, 0x20F, 0x003, 0x0F2, 0x4F8, 0x213, 0x003, 0x0EF, 0x4F6, 0x218, 0x003, 0x0EC, 0x4F5, 0x21C, 0x004, 0x0E9, 0x4F3, 0x221, 0x004, 0x0E6, 0x4F1, 0x226, 0x004, 0x0E3, 0x4EF, 0x22A, 0x004, 0x0E0, 0x4ED, 0x22F, 0x004, 0x0DD, 0x4EB, 0x233, 0x005, 0x0DA, 0x4E9, 0x238, 0x005, 0x0D7, 0x4E7, 0x23D, 0x005, 0x0D4, 0x4E5, 0x241, 0x005, 0x0D2, 0x4E3, 0x246, 0x006, 0x0CF, 0x4E0, 0x24B, 0x006, 0x0CC, 0x4DE, 0x250, 0x006, 0x0C9, 0x4DC, 0x254, 0x006, 0x0C7, 0x4D9, 0x259, 0x007, 0x0C4, 0x4D7, 0x25E, 0x007, 0x0C1, 0x4D5, 0x263, 0x007, 0x0BF, 0x4D2, 0x267, 0x008, 0x0BC, 0x4D0, 0x26C, 0x008, 0x0BA, 0x4CD, 0x271, 0x008, 0x0B7, 0x4CB, 0x276, 0x009, 0x0B4, 0x4C8, 0x27B, 0x009, 0x0B2, 0x4C5, 0x280, 0x009, 0x0AF, 0x4C3, 0x284, 0x00A, 0x0AD, 0x4C0, 0x289, 0x00A, 0x0AB, 0x4BD, 0x28E, 0x00A, 0x0A8, 0x4BA, 0x293, 0x00B, 0x0A6, 0x4B7, 0x298, 0x00B, 0x0A3, 0x4B5, 0x29D, 0x00B, 0x0A1, 0x4B2, 0x2A2, 0x00C, 0x09F, 0x4AF, 0x2A6, 0x00C, 0x09C, 0x4AC, 0x2AB, 0x00D, 0x09A, 0x4A9, 0x2B0, 0x00D, 0x098, 0x4A6, 0x2B5, 0x00E, 0x096, 0x4A2, 0x2BA, 0x00E, 0x093, 0x49F, 0x2BF, 0x00F, 0x091, 0x49C, 0x2C4, 0x00F, 0x08F, 0x499, 0x2C9, 0x00F, 0x08D, 0x496, 0x2CE, 0x010, 0x08B, 0x492, 0x2D3, 0x010, 0x089, 0x48F, 0x2D8, 0x011, 0x086, 0x48C, 0x2DC, 0x011, 0x084, 0x488, 0x2E1, 0x012, 0x082, 0x485, 0x2E6, 0x013, 0x080, 0x481, 0x2EB, 0x013, 0x07E, 0x47E, 0x2F0, 0x014, 0x07C, 0x47A, 0x2F5, 0x014, 0x07A, 0x477, 0x2FA, 0x015, 0x078, 0x473, 0x2FF, 0x015, 0x076, 0x470, 0x304, 0x016, 0x075, 0x46C, 0x309, 0x017, 0x073, 0x468, 0x30E, 0x017, 0x071, 0x465, 0x313, 0x018, 0x06F, 0x461, 0x318, 0x018, 0x06D, 0x45D, 0x31D, 0x019, 0x06B, 0x459, 0x322, 0x01A, 0x06A, 0x455, 0x326, 0x01B, 0x068, 0x452, 0x32B, 0x01B, 0x066, 0x44E, 0x330, 0x01C, 0x064, 0x44A, 0x335, 0x01D, 0x063, 0x446, 0x33A, 0x01D, 0x061, 0x442, 0x33F, 0x01E, 0x05F, 0x43E, 0x344, 0x01F, 0x05E, 0x43A, 0x349, 0x020, 0x05C, 0x436, 0x34E, 0x020, 0x05A, 0x432, 0x353, 0x021, 0x059, 0x42E, 0x357, 0x022, 0x057, 0x42A, 0x35C, 0x023, 0x056, 0x425, 0x361, 0x024, 0x054, 0x421, 0x366, 0x024, 0x053, 0x41D, 0x36B, 0x025, 0x051, 0x419, 0x370, 0x026, 0x050, 0x415, 0x374, 0x027, 0x04E, 0x410, 0x379, 0x028, 0x04D, 0x40C, 0x37E, 0x029, 0x04C, 0x408, 0x383, 0x02A, 0x04A, 0x403, 0x388, 0x02B, 0x049, 0x3FF, 0x38C, 0x02C, 0x047, 0x3FB, 0x391, 0x02D, 0x046, 0x3F6, 0x396, 0x02E, 0x045, 0x3F2, 0x39B, 0x02F, 0x043, 0x3ED, 0x39F, 0x030, 0x042, 0x3E9, 0x3A4, 0x031, 0x041, 0x3E5, 0x3A9, 0x032, 0x040, 0x3E0, 0x3AD, 0x033, 0x03E, 0x3DC, 0x3B2, 0x034, 0x03D, 0x3D7, 0x3B7, 0x035, 0x03C, 0x3D2, 0x3BB, 0x036, 0x03B, 0x3CE, 0x3C0, 0x037, 0x03A, 0x3C9, 0x3C5, 0x038, 0x038, 0x3C5, 0x3C9, 0x03A, 0x037, 0x3C0, 0x3CE, 0x03B, 0x036, 0x3BB, 0x3D2, 0x03C, 0x035, 0x3B7, 0x3D7, 0x03D, 0x034, 0x3B2, 0x3DC, 0x03E, 0x033, 0x3AD, 0x3E0, 0x040, 0x032, 0x3A9, 0x3E5, 0x041, 0x031, 0x3A4, 0x3E9, 0x042, 0x030, 0x39F, 0x3ED, 0x043, 0x02F, 0x39B, 0x3F2, 0x045, 0x02E, 0x396, 0x3F6, 0x046, 0x02D, 0x391, 0x3FB, 0x047, 0x02C, 0x38C, 0x3FF, 0x049, 0x02B, 0x388, 0x403, 0x04A, 0x02A, 0x383, 0x408, 0x04C, 0x029, 0x37E, 0x40C, 0x04D, 0x028, 0x379, 0x410, 0x04E, 0x027, 0x374, 0x415, 0x050, 0x026, 0x370, 0x419, 0x051, 0x025, 0x36B, 0x41D, 0x053, 0x024, 0x366, 0x421, 0x054, 0x024, 0x361, 0x425, 0x056, 0x023, 0x35C, 0x42A, 0x057, 0x022, 0x357, 0x42E, 0x059, 0x021, 0x353, 0x432, 0x05A, 0x020, 0x34E, 0x436, 0x05C, 0x020, 0x349, 0x43A, 0x05E, 0x01F, 0x344, 0x43E, 0x05F, 0x01E, 0x33F, 0x442, 0x061, 0x01D, 0x33A, 0x446, 0x063, 0x01D, 0x335, 0x44A, 0x064, 0x01C, 0x330, 0x44E, 0x066, 0x01B, 0x32B, 0x452, 0x068, 0x01B, 0x326, 0x455, 0x06A, 0x01A, 0x322, 0x459, 0x06B, 0x019, 0x31D, 0x45D, 0x06D, 0x018, 0x318, 0x461, 0x06F, 0x018, 0x313, 0x465, 0x071, 0x017, 0x30E, 0x468, 0x073, 0x017, 0x309, 0x46C, 0x075, 0x016, 0x304, 0x470, 0x076, 0x015, 0x2FF, 0x473, 0x078, 0x015, 0x2FA, 0x477, 0x07A, 0x014, 0x2F5, 0x47A, 0x07C, 0x014, 0x2F0, 0x47E, 0x07E, 0x013, 0x2EB, 0x481, 0x080, 0x013, 0x2E6, 0x485, 0x082, 0x012, 0x2E1, 0x488, 0x084, 0x011, 0x2DC, 0x48C, 0x086, 0x011, 0x2D8, 0x48F, 0x089, 0x010, 0x2D3, 0x492, 0x08B, 0x010, 0x2CE, 0x496, 0x08D, 0x00F, 0x2C9, 0x499, 0x08F, 0x00F, 0x2C4, 0x49C, 0x091, 0x00F, 0x2BF, 0x49F, 0x093, 0x00E, 0x2BA, 0x4A2, 0x096, 0x00E, 0x2B5, 0x4A6, 0x098, 0x00D, 0x2B0, 0x4A9, 0x09A, 0x00D, 0x2AB, 0x4AC, 0x09C, 0x00C, 0x2A6, 0x4AF, 0x09F, 0x00C, 0x2A2, 0x4B2, 0x0A1, 0x00B, 0x29D, 0x4B5, 0x0A3, 0x00B, 0x298, 0x4B7, 0x0A6, 0x00B, 0x293, 0x4BA, 0x0A8, 0x00A, 0x28E, 0x4BD, 0x0AB, 0x00A, 0x289, 0x4C0, 0x0AD, 0x00A, 0x284, 0x4C3, 0x0AF, 0x009, 0x280, 0x4C5, 0x0B2, 0x009, 0x27B, 0x4C8, 0x0B4, 0x009, 0x276, 0x4CB, 0x0B7, 0x008, 0x271, 0x4CD, 0x0BA, 0x008, 0x26C, 0x4D0, 0x0BC, 0x008, 0x267, 0x4D2, 0x0BF, 0x007, 0x263, 0x4D5, 0x0C1, 0x007, 0x25E, 0x4D7, 0x0C4, 0x007, 0x259, 0x4D9, 0x0C7, 0x006, 0x254, 0x4DC, 0x0C9, 0x006, 0x250, 0x4DE, 0x0CC, 0x006, 0x24B, 0x4E0, 0x0CF, 0x006, 0x246, 0x4E3, 0x0D2, 0x005, 0x241, 0x4E5, 0x0D4, 0x005, 0x23D, 0x4E7, 0x0D7, 0x005, 0x238, 0x4E9, 0x0DA, 0x005, 0x233, 0x4EB, 0x0DD, 0x004, 0x22F, 0x4ED, 0x0E0, 0x004, 0x22A, 0x4EF, 0x0E3, 0x004, 0x226, 0x4F1, 0x0E6, 0x004, 0x221, 0x4F3, 0x0E9, 0x004, 0x21C, 0x4F5, 0x0EC, 0x003, 0x218, 0x4F6, 0x0EF, 0x003, 0x213, 0x4F8, 0x0F2, 0x003, 0x20F, 0x4FA, 0x0F5, 0x003, 0x20A, 0x4FB, 0x0F8, 0x003, 0x205, 0x4FD, 0x0FB, 0x002, 0x201, 0x4FF, 0x0FE, 0x002, 0x1FC, 0x500, 0x101, 0x002, 0x1F8, 0x502, 0x104, 0x002, 0x1F3, 0x503, 0x107, 0x002, 0x1EF, 0x504, 0x10B, 0x002, 0x1EB, 0x506, 0x10E, 0x002, 0x1E6, 0x507, 0x111, 0x001, 0x1E2, 0x508, 0x114, 0x001, 0x1DD, 0x50A, 0x118, 0x001, 0x1D9, 0x50B, 0x11B, 0x001, 0x1D5, 0x50C, 0x11E, 0x001, 0x1D0, 0x50D, 0x122, 0x001, 0x1CC, 0x50E, 0x125, 0x001, 0x1C8, 0x50F, 0x129, 0x001, 0x1C3, 0x510, 0x12C, 0x001, 0x1BF, 0x511, 0x130, 0x001, 0x1BB, 0x511, 0x133, 0x001, 0x1B7, 0x512, 0x137, 0x000, 0x1B2, 0x513, 0x13A, 0x000, 0x1AE, 0x514, 0x13E, 0x000, 0x1AA, 0x514, 0x141, 0x000, 0x1A6, 0x515, 0x145, 0x000, 0x1A2, 0x516, 0x148, 0x000, 0x19E, 0x516, 0x14C, 0x000, 0x19A, 0x517, 0x150, 0x000, 0x195, 0x517, 0x153, 0x000, 0x191, 0x517, 0x157, 0x000, 0x18D, 0x518, 0x15B, 0x000, 0x189, 0x518, 0x15F, 0x000, 0x185, 0x518, 0x162, 0x000, 0x181, 0x518, 0x166, 0x000, 0x17D, 0x518, 0x16A, 0x000, 0x17A, 0x519, 0x16E, 0x000, 0x176, 0x519, 0x172 }; //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // START SOUND... called by main thread to setup a new sound on a channel //////////////////////////////////////////////////////////////////////// static INLINE void StartSound(int ch) { StartADSR(ch); s_chan[ch].pCurr = s_chan[ch].pStart; // set sample start s_chan[ch].s_1 = 0; // init mixing vars s_chan[ch].s_2 = 0; s_chan[ch].iSBPos = 28; s_chan[ch].bNew = 0; // init channel flags s_chan[ch].bStop = 0; s_chan[ch].bOn = 1; s_chan[ch].SB[29] = 0; // init our interpolation helpers s_chan[ch].SB[30] = 0; s_chan[ch].spos = 0x40000L; s_chan[ch].SB[28] = 0; // -> start with more decoding } //////////////////////////////////////////////////////////////////////// // MAIN SPU FUNCTION // here is the main job handler... thread, timer or direct func call // basically the whole sound processing is done in this fat func! //////////////////////////////////////////////////////////////////////// static u32 sampcount; static u32 decaybegin; static u32 decayend; // Counting to 65536 results in full volume offage. void upse_ps1_spu_setlength(s32 stop, s32 fade) { _ENTER; if (stop == ~0) { decaybegin = ~0; } else { stop = (stop * 441) / 10; fade = (fade * 441) / 10; decaybegin = stop; decayend = stop + fade; } _LEAVE; } void upse_ps1_spu_setvolume(int volume) { _ENTER; if (volume >= 32) iVolume = 0; else iVolume = (volume / 4); _DEBUG("new volume [%d] [%d]", iVolume, volume); _LEAVE; } static u32 seektime; static s32 poo; int upse_seek(u32 t) { seektime = t * 441 / 10; if (seektime > sampcount) return (1); return (0); } static u32 _do_interpolation = 1; static double _interpolation_coefficient = 3.759285613; #define CLIP(_x) {if(_x>32767) _x=32767; if(_x<-32767) _x=-32767;} int upse_ps1_spu_render(u32 cycles) { static s32 dosampies; s32 temp; poo += cycles; dosampies = poo / 384; if (!dosampies) return (1); poo -= dosampies * 384; temp = dosampies; while (temp) { s32 revLeft = 0, revRight = 0; s32 sl = 0, sr = 0; int ch, fa; temp--; //--------------------------------------------------// //- main channel loop -// //--------------------------------------------------// { for (ch = 0; ch < MAXCHAN; ch++) // loop em all. { if (s_chan[ch].bNew) StartSound(ch); // start new sound if (!s_chan[ch].bOn) continue; // channel not playing? next if (s_chan[ch].iActFreq != s_chan[ch].iUsedFreq) // new psx frequency? { s_chan[ch].iUsedFreq = s_chan[ch].iActFreq; // -> take it and calc steps s_chan[ch].sinc = s_chan[ch].iRawPitch << 4; if (!s_chan[ch].sinc) s_chan[ch].sinc = 1; } while (s_chan[ch].spos >= 0x10000L) { if (s_chan[ch].iSBPos == 28) // 28 reached? { int predict_nr, shift_factor, flags, d, s; u8 *start; unsigned int nSample; int s_1, s_2; start = s_chan[ch].pCurr; // set up the current pos if (start == (u8 *) - 1) // special "stop" sign { s_chan[ch].bOn = 0; // -> turn everything off s_chan[ch].ADSRX.lVolume = 0; s_chan[ch].ADSRX.EnvelopeVol = 0; goto ENDX; // -> and done for this channel } s_chan[ch].iSBPos = 0; // Reset buffer play index. //////////////////////////////////////////// spu irq handler here? mmm... do it later s_1 = s_chan[ch].s_1; s_2 = s_chan[ch].s_2; predict_nr = (int) *start; start++; shift_factor = predict_nr & 0xf; predict_nr >>= 4; flags = (int) *start; start++; // -------------------------------------- // // Decode new samples into s_chan[ch].SB[0 through 27] for (nSample = 0; nSample < 28; start++) { d = (int) *start; s = ((d & 0xf) << 12); if (s & 0x8000) s |= 0xffff0000; fa = (s >> shift_factor); fa = fa + ((s_1 * f[predict_nr][0]) >> 6) + ((s_2 * f[predict_nr][1]) >> 6); s_2 = s_1; s_1 = fa; s = ((d & 0xf0) << 8); s_chan[ch].SB[nSample++] = fa; if (s & 0x8000) s |= 0xffff0000; fa = (s >> shift_factor); fa = fa + ((s_1 * f[predict_nr][0]) >> 6) + ((s_2 * f[predict_nr][1]) >> 6); s_2 = s_1; s_1 = fa; s_chan[ch].SB[nSample++] = fa; } //////////////////////////////////////////// irq check if (spuCtrl & 0x40) // irq active? { if ((pSpuIrq > start - 16 && // irq address reached? pSpuIrq <= start) || ((flags & 1) && // special: irq on looping addr, when stop/loop flag is set (pSpuIrq > s_chan[ch].pLoop - 16 && pSpuIrq <= s_chan[ch].pLoop))) { //extern s32 spuirqvoodoo; s_chan[ch].iIrqDone = 1; // -> debug flag SPUirq(); //puts("IRQ"); //if(spuirqvoodoo!=-1) //{ // spuirqvoodoo=temp*384; // temp=0; //} } } //////////////////////////////////////////// flag handler if ((flags & 4) && (!s_chan[ch].bIgnoreLoop)) s_chan[ch].pLoop = start - 16; // loop adress if (flags & 1) // 1: stop/loop { // We play this block out first... //if(!(flags&2)) // 1+2: do loop... otherwise: stop if (flags != 3 || s_chan[ch].pLoop == NULL) // PETE: if we don't check exactly for 3, loop hang ups will happen (DQ4, for example) { // and checking if pLoop is set avoids crashes, yeah start = (u8 *) - 1; } else { start = s_chan[ch].pLoop; } } s_chan[ch].pCurr = start; // store values for next cycle s_chan[ch].s_1 = s_1; s_chan[ch].s_2 = s_2; //////////////////////////////////////////// } fa = s_chan[ch].SB[s_chan[ch].iSBPos++]; // get sample data if ((spuCtrl & 0x4000) == 0) fa = 0; // muted? else CLIP(fa); { int gpos; gpos = s_chan[ch].SB[28]; gval0 = fa; gpos = (gpos + 1) & 3; s_chan[ch].SB[28] = gpos; } s_chan[ch].spos -= 0x10000L; } //////////////////////////////////////////////// // noise handler... just produces some noise data // surely wrong... and no noise frequency (spuCtrl&0x3f00) will be used... // and sometimes the noise will be used as fmod modulation... pfff if (s_chan[ch].bNoise) { //puts("Noise"); if ((dwNoiseVal <<= 1) & 0x80000000L) { dwNoiseVal ^= 0x0040001L; fa = ((dwNoiseVal >> 2) & 0x7fff); fa = -fa; } else fa = (dwNoiseVal >> 2) & 0x7fff; // mmm... depending on the noise freq we allow bigger/smaller changes to the previous val fa = s_chan[ch].iOldNoise + ((fa - s_chan[ch].iOldNoise) / ((0x001f - ((spuCtrl & 0x3f00) >> 9)) + 1)); if (fa > 32767L) fa = 32767L; if (fa < -32767L) fa = -32767L; s_chan[ch].iOldNoise = fa; } //---------------------------------------- else // NO NOISE (NORMAL SAMPLE DATA) HERE { int vl, vr, gpos; vl = (s_chan[ch].spos >> 6) & ~3; gpos = s_chan[ch].SB[28]; vr = (gauss[vl] * gval0) >> 9; vr += (gauss[vl + 1] * gval(1)) >> 9; vr += (gauss[vl + 2] * gval(2)) >> 9; vr += (gauss[vl + 3] * gval(3)) >> 9; fa = vr >> 2; } s_chan[ch].sval = (MixADSR(ch) * fa) >> 10; // / 1023; // add adsr if (s_chan[ch].bFMod == 2) // fmod freq channel { int NP = s_chan[ch + 1].iRawPitch; NP = ((32768L + s_chan[ch].sval) * NP) >> 15; ///32768L; if (NP > 0x3fff) NP = 0x3fff; if (NP < 0x1) NP = 0x1; // mmmm... if I do this, all is screwed // s_chan[ch+1].iRawPitch=NP; NP = (44100L * NP) / (4096L); // calc frequency s_chan[ch + 1].iActFreq = NP; s_chan[ch + 1].iUsedFreq = NP; s_chan[ch + 1].sinc = (((NP / 10) << 16) / 4410); if (!s_chan[ch + 1].sinc) s_chan[ch + 1].sinc = 1; // mmmm... set up freq decoding positions? // s_chan[ch+1].iSBPos=28; // s_chan[ch+1].spos=0x10000L; } else { ////////////////////////////////////////////// // ok, left/right sound volume (psx volume goes from 0 ... 0x3fff) int tmpl, tmpr; tmpl = (s_chan[ch].sval * s_chan[ch].iLeftVolume) >> 14; tmpr = (s_chan[ch].sval * s_chan[ch].iRightVolume) >> 14; sl += tmpl; sr += tmpr; if (((rvb.Enabled >> ch) & 1) && (spuCtrl & 0x80)) { revLeft += tmpl; revRight += tmpr; } } s_chan[ch].spos += s_chan[ch].sinc; ENDX:; } } /////////////////////////////////////////////////////// // mix all channels (including reverb) into one buffer MixREVERBLeftRight(&sl, &sr, revLeft, revRight); if (sampcount >= decaybegin) { s32 dmul; if (decaybegin != (u32) ~ 0) // Is anyone REALLY going to be playing a song // for 13 hours? { if (sampcount >= decayend) return (0); dmul = 256 - (256 * (sampcount - decaybegin) / (decayend - decaybegin)); sl = (sl * dmul) >> 8; sr = (sr * dmul) >> 8; } } sampcount++; // post-processing: interpolation if (_do_interpolation) { double ldiff, rdiff, avg, tmp; avg = ((sl + sr) / 2); ldiff = sl - avg; rdiff = sr - avg; tmp = avg + ldiff * _interpolation_coefficient; if (tmp < -32768) tmp = -32768; if (tmp > 32767) tmp = 32767; sl = tmp; tmp = avg + rdiff * _interpolation_coefficient; if (tmp < -32768) tmp = -32768; if (tmp > 32767) tmp = 32767; sr = tmp; } /* fix dynamic range. */ sl >>= iVolume; sr >>= iVolume; if (sl > 32767) sl = 32767; if (sl < -32767) sl = -32767; if (sr > 32767) sr = 32767; if (sr < -32767) sr = -32767; *pS++ = sl; *pS++ = sr; } return (1); } void upse_stop(void) { decaybegin = decayend = 0; } static upse_audio_callback_func_t _upse_audio_callback_f = NULL; static void *_upse_audio_cb_user_data = NULL; void upse_set_audio_callback(upse_audio_callback_func_t func, void *user_data) { _ENTER; _upse_audio_callback_f = func; _upse_audio_cb_user_data = user_data; _DEBUG("set audio callback function to <%p>", _upse_audio_callback_f); _DEBUG("set audio callback userdata to <%p>", _upse_audio_cb_user_data); _LEAVE; } void upse_set_interpolation_mode(u32 setting) { _ENTER; _do_interpolation = setting; _LEAVE; } void upse_set_interpolation_coefficient(double setting) { _ENTER; _interpolation_coefficient = setting; _LEAVE; } void upse_ps1_spu_finalize(void) { if ((seektime != (u32) ~ 0) && seektime > sampcount) { pS = (s16 *) pSpuBuffer; if (_upse_audio_callback_f) _upse_audio_callback_f(0, 0, _upse_audio_cb_user_data); } else if ((u8 *) pS > ((u8 *) pSpuBuffer + 1024)) { if (_upse_audio_callback_f) _upse_audio_callback_f((u8 *) pSpuBuffer, (u8 *) pS - (u8 *) pSpuBuffer, _upse_audio_cb_user_data); pS = (s16 *) pSpuBuffer; } } #ifdef TIMEO static u64 begintime; static u64 SexyTime64(void) { struct timeval tv; u64 ret; gettimeofday(&tv, 0); ret = tv.tv_sec; ret *= 1000000; ret += tv.tv_usec; return (ret); } #endif //////////////////////////////////////////////////////////////////////// // INIT/EXIT STUFF //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // SPUINIT: this func will be called first by the main emu //////////////////////////////////////////////////////////////////////// int upse_ps1_spu_init(void) { spuMemC = (u8 *) spuMem; // just small setup memset((void *) s_chan, 0, MAXCHAN * sizeof(SPUCHAN)); memset((void *) &rvb, 0, sizeof(REVERBInfo)); memset(regArea, 0, sizeof(regArea)); memset(spuMem, 0, sizeof(spuMem)); InitADSR(); sampcount = poo = 0; seektime = (u32) ~ 0; #ifdef TIMEO begintime = SexyTime64(); #endif return 0; } //////////////////////////////////////////////////////////////////////// // SETUPSTREAMS: init most of the spu buffers //////////////////////////////////////////////////////////////////////// void SetupStreams(void) { int i; pSpuBuffer = (u8 *) malloc(32768); // alloc mixing buffer pS = (s16 *) pSpuBuffer; for (i = 0; i < MAXCHAN; i++) // loop sound channels { s_chan[i].ADSRX.SustainLevel = 1024; // -> init sustain s_chan[i].iIrqDone = 0; s_chan[i].pLoop = spuMemC; s_chan[i].pStart = spuMemC; s_chan[i].pCurr = spuMemC; } } //////////////////////////////////////////////////////////////////////// // REMOVESTREAMS: free most buffer //////////////////////////////////////////////////////////////////////// void RemoveStreams(void) { free(pSpuBuffer); // free mixing buffer pSpuBuffer = NULL; #ifdef TIMEO { u64 tmp; tmp = SexyTime64(); tmp -= begintime; if (tmp) tmp = (u64) sampcount *1000000 / tmp; printf("%lld samples per second\n", tmp); } #endif } //////////////////////////////////////////////////////////////////////// // SPUOPEN: called by main emu after init //////////////////////////////////////////////////////////////////////// int upse_ps1_spu_open(void) { if (bSPUIsOpen) return 0; // security for some stupid main emus spuIrq = 0; spuStat = spuCtrl = 0; spuAddr = 0xffffffff; dwNoiseVal = 1; spuMemC = (u8 *) spuMem; memset((void *) s_chan, 0, (MAXCHAN + 1) * sizeof(SPUCHAN)); pSpuIrq = 0; iVolume = 0; // full volume (0dB), volume past this point is seen as a pad, where 8 = -64dB SetupStreams(); // prepare streaming bSPUIsOpen = 1; return 1; } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // SPUCLOSE: called before shutdown //////////////////////////////////////////////////////////////////////// int upse_ps1_spu_close(void) { if (!bSPUIsOpen) return 0; // some security bSPUIsOpen = 0; // no more open RemoveStreams(); // no more streaming return 0; } //////////////////////////////////////////////////////////////////////// // SPUSHUTDOWN: called by main emu on final exit //////////////////////////////////////////////////////////////////////// int SPUshutdown(void) { return 0; } upse-1.0.0/src/libupse/upse-ps1-spu-base.h0000644000175000017500000000041111006314306020125 0ustar nenolodnenolodint upse_ps1_spu_init(void); int upse_ps1_spu_open(void); void upse_ps1_spu_setlength(s32 stop, s32 fade); int upse_ps1_spu_close(void); void upse_ps1_spu_finalize(void); // External, called by SPU code. void SPUirq(void); void upse_ps1_spu_setvolume(int volume); upse-1.0.0/src/libupse/upse-spu-internal.h0000644000175000017500000001342011006314306020332 0ustar nenolodnenolod/*************************************************************************** upse-spu-internal.h - description ------------------- begin : Wed May 15 2002 copyright : (C) 2002 by Pete Bernert email : BlackDove@addcom.de ***************************************************************************/ /*************************************************************************** * * * 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. See also the license.txt file for * * additional informations. * * * ***************************************************************************/ #include "upse-types.h" #include "upse-ps1-memory-manager.h" //*************************************************************************// // History of changes: // // 2002/05/15 - Pete // - generic cleanup for the Peops release // //*************************************************************************// #define max(a,b) (((a) > (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b)) //////////////////////////////////////////////////////////////////////// // spu defines //////////////////////////////////////////////////////////////////////// // num of channels #define MAXCHAN 24 /////////////////////////////////////////////////////////// // struct defines /////////////////////////////////////////////////////////// // ADSR INFOS PER CHANNEL typedef struct { int AttackModeExp; s32 AttackTime; s32 DecayTime; s32 SustainLevel; int SustainModeExp; s32 SustainModeDec; s32 SustainTime; int ReleaseModeExp; u32 ReleaseVal; s32 ReleaseTime; s32 ReleaseStartTime; s32 ReleaseVol; s32 lTime; s32 lVolume; } ADSRInfo; typedef struct { int State; int AttackModeExp; int AttackRate; int DecayRate; int SustainLevel; int SustainModeExp; int SustainIncrease; int SustainRate; int ReleaseModeExp; int ReleaseRate; int EnvelopeVol; s32 lVolume; s32 lDummy1; s32 lDummy2; } ADSRInfoEx; /////////////////////////////////////////////////////////// // Tmp Flags // used for debug channel muting #define FLAG_MUTE 1 /////////////////////////////////////////////////////////// // MAIN CHANNEL STRUCT typedef struct { int bNew; // start flag int iSBPos; // mixing stuff int spos; int sinc; int SB[32 + 1]; int sval; u8 *pStart; // start ptr into sound mem u8 *pCurr; // current pos in sound mem u8 *pLoop; // loop ptr in sound mem int bOn; // is channel active (sample playing?) int bStop; // is channel stopped (sample _can_ still be playing, ADSR Release phase) int iActFreq; // current psx pitch int iUsedFreq; // current pc pitch int iLeftVolume; // left volume int iLeftVolRaw; // left psx volume value int bIgnoreLoop; // ignore loop bit, if an external loop address is used int iRightVolume; // right volume int iRightVolRaw; // right psx volume value int iRawPitch; // raw pitch (0...3fff) int iIrqDone; // debug irq done flag int s_1; // last decoding infos int s_2; int bRVBActive; // reverb active flag int iRVBOffset; // reverb offset int iRVBRepeat; // reverb repeat int bNoise; // noise active flag int bFMod; // freq mod (0=off, 1=sound channel, 2=freq channel) int iOldNoise; // old noise val for this channel ADSRInfo ADSR; // active ADSR settings ADSRInfoEx ADSRX; // next ADSR settings (will be moved to active on sample start) } SPUCHAN; /////////////////////////////////////////////////////////// typedef struct { int StartAddr; // reverb area start addr in samples int CurrAddr; // reverb area curr addr in samples int Enabled; int VolLeft; int VolRight; int iLastRVBLeft; int iLastRVBRight; int iRVBLeft; int iRVBRight; int FB_SRC_A; // (offset) int FB_SRC_B; // (offset) int IIR_ALPHA; // (coef.) int ACC_COEF_A; // (coef.) int ACC_COEF_B; // (coef.) int ACC_COEF_C; // (coef.) int ACC_COEF_D; // (coef.) int IIR_COEF; // (coef.) int FB_ALPHA; // (coef.) int FB_X; // (coef.) int IIR_DEST_A0; // (offset) int IIR_DEST_A1; // (offset) int ACC_SRC_A0; // (offset) int ACC_SRC_A1; // (offset) int ACC_SRC_B0; // (offset) int ACC_SRC_B1; // (offset) int IIR_SRC_A0; // (offset) int IIR_SRC_A1; // (offset) int IIR_DEST_B0; // (offset) int IIR_DEST_B1; // (offset) int ACC_SRC_C0; // (offset) int ACC_SRC_C1; // (offset) int ACC_SRC_D0; // (offset) int ACC_SRC_D1; // (offset) int IIR_SRC_B1; // (offset) int IIR_SRC_B0; // (offset) int MIX_DEST_A0; // (offset) int MIX_DEST_A1; // (offset) int MIX_DEST_B0; // (offset) int MIX_DEST_B1; // (offset) int IN_COEF_L; // (coef.) int IN_COEF_R; // (coef.) } REVERBInfo; extern u16 regArea[0x200]; extern u16 spuMem[256 * 1024]; extern u8 *spuMemC; extern u8 *pSpuIrq; extern u8 *pSpuBuffer; extern u32 dwNoiseVal; // global noise generator extern u16 spuCtrl; // some vars to store psx reg infos extern u16 spuStat; extern u16 spuIrq; extern u32 spuAddr; // address into spu mem extern int bSPUIsOpen; extern SPUCHAN s_chan[MAXCHAN + 1]; // channel + 1 infos (1 is security for fmod handling) extern REVERBInfo rvb; upse-1.0.0/src/libupse/upse_unpack_psf.c0000644000175000017500000002452411006314306020126 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_unpack_psf.c * Purpose: libupse: PSF/MiniPSF/PSF2/MiniPSF2 unpacker * * Copyright (c) 2007 William Pitcock * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include #include #include #include #include "upse-internal.h" #include "upse.h" #include "upse-string.h" // LOAD STUFF typedef struct { unsigned char id[8]; u32 text; u32 data; u32 pc0; u32 gp0; u32 t_addr; u32 t_size; u32 d_addr; u32 d_size; u32 b_addr; u32 b_size; u32 s_addr; u32 s_size; u32 SavedSP; u32 SavedFP; u32 SavedGP; u32 SavedRA; u32 SavedS0; } upse_packed_t upse_exe_header_t; static long _upse_time_to_ms(const char *str) { int x, c = 0; int acc = 0; char s[100]; strncpy(s, str, 100); s[99] = 0; for (x = strlen(s); x >= 0; x--) if (s[x] == '.' || s[x] == ',') { acc = atoi(s + x + 1); s[x] = 0; } else if (s[x] == ':') { if (c == 0) acc += atoi(s + x + 1) * 10; else if (c == 1) acc += atoi(s + x + (x ? 1 : 0)) * 10 * 60; c++; s[x] = 0; } else if (x == 0) { if (c == 0) acc += atoi(s + x) * 10; else if (c == 1) acc += atoi(s + x) * 10 * 60; else if (c == 2) acc += atoi(s + x) * 10 * 60 * 60; } acc *= 100; // To milliseconds. return (acc); } static char *_upse_resolve_path(char *f, char *newfile) { static char *ret; char *tp1; #if PSS_STYLE==1 tp1 = ((char *) strrchr(f, '/')); #else tp1 = ((char *) strrchr(f, '\\')); #if PSS_STYLE!=3 { char *tp3; tp3 = ((char *) strrchr(f, '/')); if (tp1 < tp3) tp1 = tp3; } #endif #endif if (!tp1) { ret = malloc(strlen(newfile) + 1); strcpy(ret, newfile); } else { ret = malloc(tp1 - f + 2 + strlen(newfile)); // 1(NULL), 1(/). memcpy(ret, f, tp1 - f); ret[tp1 - f] = '/'; ret[tp1 - f + 1] = 0; strcat(ret, newfile); } return (ret); } static int _upse_psf_get_tag(char *buf, char **key, char **val) { char *tmp; tmp = buf; /* First, convert any weirdo ASCII characters to spaces. */ while (*tmp++) if (*tmp > 0 && *tmp < 0x20) *tmp = 0x20; /* Strip off white space off end of string(which should be the "value"). */ for (tmp = buf + strlen(buf) - 1; tmp >= buf; tmp--) { if (*tmp != 0x20) break; *tmp = 0; } /* Now, search for the first non-whitespace character. */ while (*buf == 0x20) buf++; tmp = buf; while ((*buf != 0x20) && (*buf != '=')) { if (!*buf) return (0); /* Null character. */ buf++; } /* Allocate memory, copy string, and terminate string. */ if (!(*key = malloc(buf - tmp + 1))) return (0); strncpy(*key, tmp, buf - tmp); (*key)[(buf - tmp)] = 0; /* Search for "=" character. */ while (*buf != '=') { if (!*buf) return (0); /* Null character. */ buf++; } buf++; /* Skip over equals character. */ /* Remove leading whitespace on value. */ while (*buf == 0x20) { if (!*buf) return (0); /* Null character. */ buf++; } /* Allocate memory, and copy string over. Trailing whitespace was eliminated earlier. */ if (!(*val = malloc(strlen(buf) + 1))) return (0); strcpy(*val, buf); //puts(*key); //puts(*val); return (1); } static void _upse_psf_free_tags(upse_psftag_t * tags) { while (tags) { upse_psftag_t *tmp = tags->next; free(tags->key); free(tags->value); free(tags); tags = tmp; } } static void _upse_psf_add_tag(upse_psftag_t ** tag, const char *key, const char *val) { upse_psftag_t *tmp; tmp = malloc(sizeof(upse_psftag_t)); memset(tmp, 0, sizeof(upse_psftag_t)); tmp->key = strdup(key); tmp->value = strdup(val); tmp->next = NULL; if (!*tag) *tag = tmp; else { upse_psftag_t *rec; rec = *tag; while (rec->next) rec = rec->next; rec->next = tmp; } } typedef struct { int num; char *value; } upse_libcache_slot_t; static int ccomp(const void *v1, const void *v2) { const upse_libcache_slot_t *a1, *a2; a1 = v1; a2 = v2; return (a1->num - a2->num); } static upse_psf_t *_upse_load(char *path, int level, int type, upse_iofuncs_t *_upse_iofuncs) // Type==1 for just info load. { void *fp; upse_exe_header_t tmpHead; unsigned char *in, *out = 0; u8 head[4]; u32 reserved; u32 complen; u32 crc32; uLongf outlen; upse_psf_t *psfi; upse_psf_t *tmpi; _ENTER; if (!(fp = _upse_iofuncs->open_impl(path, "rb"))) { _ERROR("path %s failed to load\n", path); return NULL; } _upse_iofuncs->read_impl(head, 1, 4, fp); if (memcmp(head, "PSF\x01", 4)) return NULL; psfi = calloc(sizeof(upse_psf_t), 1); psfi->stop = ~0; psfi->fade = 0; _upse_iofuncs->read_impl(&reserved, 1, 4, fp); _upse_iofuncs->read_impl(&complen, 1, 4, fp); complen = BFLIP32(complen); _upse_iofuncs->read_impl(&crc32, 1, 4, fp); crc32 = BFLIP32(crc32); _upse_iofuncs->seek_impl(fp, reserved, SEEK_CUR); if (type) _upse_iofuncs->seek_impl(fp, complen, SEEK_CUR); else { in = malloc(complen); out = malloc(1024 * 1024 * 2 + 0x800); _upse_iofuncs->read_impl(in, 1, complen, fp); outlen = 1024 * 1024 * 2; uncompress(out, &outlen, in, complen); free(in); memcpy(&tmpHead, out, sizeof(upse_exe_header_t)); upse_r3000_cpu_regs.pc = BFLIP32(tmpHead.pc0); upse_r3000_cpu_regs.GPR.n.gp = BFLIP32(tmpHead.gp0); upse_r3000_cpu_regs.GPR.n.sp = BFLIP32(tmpHead.s_addr); if (upse_r3000_cpu_regs.GPR.n.sp == 0) upse_r3000_cpu_regs.GPR.n.sp = 0x801fff00; if (level) { LoadPSXMem(BFLIP32(tmpHead.t_addr), BFLIP32(tmpHead.t_size), out + 0x800); free(out); } } { u8 tagdata[5]; if (_upse_iofuncs->read_impl(tagdata, 1, 5, fp) == 5) { if (!memcmp(tagdata, "[TAG]", 5)) { char linebuf[1024]; while (upse_io_fgets(linebuf, 1024, fp, _upse_iofuncs)) { int x; char *key = NULL, *value = NULL; if (!_upse_psf_get_tag(linebuf, &key, &value)) { if (key) free(key); if (value) free(value); continue; } _upse_psf_add_tag(&psfi->taglist, key, value); if (!level) { static char *yoinks[8] = { "title", "artist", "game", "year", "genre", "copyright", "psfby", "comment" }; char **yoinks2[8] = { &psfi->title, &psfi->artist, &psfi->game, &psfi->year, &psfi->genre, &psfi->copyright, &psfi->psfby, &psfi->comment }; for (x = 0; x < 8; x++) if (!strcasecmp(key, yoinks[x])) *yoinks2[x] = value; if (!strcasecmp(key, "length")) psfi->stop = _upse_time_to_ms(value); else if (!strcasecmp(key, "fade")) psfi->fade = _upse_time_to_ms(value); else if (!strcasecmp(key, "volume")) psfi->volume = upse_strtof(value) * 32; } if (!strcasecmp(key, "_lib") && !type) { char *tmpfn; /* Load file name "value" from the directory specified in the full path(directory + file name) "path" */ tmpfn = _upse_resolve_path(path, value); if (!(tmpi = _upse_load(tmpfn, level + 1, 0, _upse_iofuncs))) { free(key); free(value); free(tmpfn); if (!level) free(out); _upse_iofuncs->close_impl(fp); _upse_psf_free_tags(psfi->taglist); free(psfi); return NULL; } _upse_psf_free_tags(tmpi->taglist); free(tmpi); free(tmpfn); } if (key) free(key); } } } } _upse_iofuncs->close_impl(fp); /* Now, if we're at level 0(main PSF), load the main executable, and any libN stuff */ if (!level && !type) { LoadPSXMem(BFLIP32(tmpHead.t_addr), BFLIP32(tmpHead.t_size), out + 0x800); free(out); } if (!type) /* Load libN */ { upse_libcache_slot_t *cache; upse_psftag_t *tag; unsigned int libncount = 0; unsigned int cur = 0; tag = psfi->taglist; while (tag) { if (!strncasecmp(tag->key, "_lib", 4) && tag->key[4]) libncount++; tag = tag->next; } if (libncount) { cache = malloc(sizeof(upse_libcache_slot_t) * libncount); tag = psfi->taglist; while (tag) { if (!strncasecmp(tag->key, "_lib", 4) && tag->key[4]) { cache[cur].num = atoi(&tag->key[4]); cache[cur].value = tag->value; cur++; } tag = tag->next; } qsort(cache, libncount, sizeof(upse_libcache_slot_t), ccomp); for (cur = 0; cur < libncount; cur++) { u32 ba[3]; char *tmpfn; if (cache[cur].num < 2) continue; ba[0] = upse_r3000_cpu_regs.pc; ba[1] = upse_r3000_cpu_regs.GPR.n.gp; ba[2] = upse_r3000_cpu_regs.GPR.n.sp; /* Load file name "value" from the directory specified in the full path(directory + file name) "path" */ tmpfn = _upse_resolve_path(path, cache[cur].value); if (!(tmpi = _upse_load(tmpfn, level + 1, 0, _upse_iofuncs))) { //free(key); //free(value); //free(tmpfn); //_upse_iofuncs->close_impl(fp); //return(0); } free(tmpfn); _upse_psf_free_tags(tmpi->taglist); free(tmpi); upse_r3000_cpu_regs.pc = ba[0]; upse_r3000_cpu_regs.GPR.n.gp = ba[1]; upse_r3000_cpu_regs.GPR.n.sp = ba[2]; } free(cache); } // if(libncount) } // if(!type) _LEAVE; return psfi; } void upse_free_psf_metadata(upse_psf_t * info) { _upse_psf_free_tags(info->taglist); free(info); } upse_psf_t *upse_get_psf_metadata(char *path, upse_iofuncs_t * iofuncs) { upse_psf_t *ret; _ENTER; if (!(ret = _upse_load(path, 0, 1, iofuncs))) return NULL; if (ret->stop == (u32) ~ 0) ret->fade = 0; ret->length = ret->stop + ret->fade; _LEAVE; return ret; } upse_psf_t *upse_load(char *path, upse_iofuncs_t * iofuncs) { upse_psf_t *ret; _ENTER; psxInit(); psxReset(); upse_ps1_spu_init(); upse_ps1_spu_open(); if (!(ret = _upse_load(path, 0, 0, iofuncs))) { psxShutdown(); return NULL; } if (ret->stop == (u32) ~ 0) ret->fade = 0; upse_ps1_spu_setvolume(ret->volume); upse_ps1_spu_setlength(ret->stop, ret->fade); ret->length = ret->stop + ret->fade; _LEAVE; return ret; } upse-1.0.0/src/libupse/upse_ps1_spu_reverb.c0000644000175000017500000003213311006314306020727 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_ps1_spu_reverb.c * Purpose: libupse: PS1 SPU reverb * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 2002 Pete Bernert * Portions copyright (c) 2003 Neill Corlett * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include "upse-types.h" #include "upse-spu-internal.h" #include "upse-debug.h" //////////////////////////////////////////////////////////////////////// // globals //////////////////////////////////////////////////////////////////////// // REVERB info and timing vars... //////////////////////////////////////////////////////////////////////// static INLINE s64 g_buffer(int iOff) // get_buffer content helper: takes care about wraps { s16 *p = (s16 *) spuMem; iOff = (iOff * 4) + rvb.CurrAddr; while (iOff > 0x3FFFF) iOff = rvb.StartAddr + (iOff - 0x40000); while (iOff < rvb.StartAddr) iOff = 0x3ffff - (rvb.StartAddr - iOff); return (int) (s16) BFLIP16(*(p + iOff)); } //////////////////////////////////////////////////////////////////////// static INLINE void s_buffer(int iOff, int iVal) // set_buffer content helper: takes care about wraps and clipping { s16 *p = (s16 *) spuMem; iOff = (iOff * 4) + rvb.CurrAddr; while (iOff > 0x3FFFF) iOff = rvb.StartAddr + (iOff - 0x40000); while (iOff < rvb.StartAddr) iOff = 0x3ffff - (rvb.StartAddr - iOff); if (iVal < -32768L) iVal = -32768L; if (iVal > 32767L) iVal = 32767L; *(p + iOff) = (s16) BFLIP16((s16) iVal); } //////////////////////////////////////////////////////////////////////// static INLINE void s_buffer1(int iOff, int iVal) // set_buffer (+1 sample) content helper: takes care about wraps and clipping { s16 *p = (s16 *) spuMem; iOff = (iOff * 4) + rvb.CurrAddr + 1; while (iOff > 0x3FFFF) iOff = rvb.StartAddr + (iOff - 0x40000); while (iOff < rvb.StartAddr) iOff = 0x3ffff - (rvb.StartAddr - iOff); if (iVal < -32768L) iVal = -32768L; if (iVal > 32767L) iVal = 32767L; *(p + iOff) = (s16) BFLIP16((s16) iVal); } static u32 _do_reverb = 1; static u32 _reverb_no_downsample = 0; void upse_set_reverb_mode(u32 setting) { _ENTER; _do_reverb = setting; _LEAVE; } void upse_set_reverb_no_downsample(u32 setting) { _ENTER; _reverb_no_downsample = setting; _LEAVE; } void MixREVERBLeftRight(s32 * oleft, s32 * oright, s32 inleft, s32 inright) { static s32 downbuf[2][8]; static s32 upbuf[2][8]; static int dbpos = 0, ubpos = 0; static s32 downcoeffs[8] = { /* Symmetry is sexy. */ 1283, 5344, 10895, 15243, 15243, 10895, 5344, 1283 }; int x; if (!rvb.StartAddr || !_do_reverb) // reverb is off or forcefully disabled { rvb.iRVBLeft = rvb.iRVBRight = 0; return; } //if(inleft<-32767 || inleft>32767) printf("%d\n",inleft); //if(inright<-32767 || inright>32767) printf("%d\n",inright); downbuf[0][dbpos] = inleft; downbuf[1][dbpos] = inright; dbpos = (dbpos + 1) & 7; if (dbpos & 1 || _reverb_no_downsample) // we work on every second left value: downsample to 22 khz { if (spuCtrl & 0x80) // -> reverb on? oki { int ACC0, ACC1, FB_A0, FB_A1, FB_B0, FB_B1; s32 INPUT_SAMPLE_L = 0; s32 INPUT_SAMPLE_R = 0; for (x = 0; x < 8; x++) { INPUT_SAMPLE_L += (downbuf[0][(dbpos + x) & 7] * downcoeffs[x]) >> 8; /* Lose insignificant digits to prevent overflow(check this) */ INPUT_SAMPLE_R += (downbuf[1][(dbpos + x) & 7] * downcoeffs[x]) >> 8; } INPUT_SAMPLE_L >>= (16 - 8); INPUT_SAMPLE_R >>= (16 - 8); { const s64 IIR_INPUT_A0 = ((g_buffer(rvb.IIR_SRC_A0) * rvb.IIR_COEF) >> 15) + ((INPUT_SAMPLE_L * rvb.IN_COEF_L) >> 15); const s64 IIR_INPUT_A1 = ((g_buffer(rvb.IIR_SRC_A1) * rvb.IIR_COEF) >> 15) + ((INPUT_SAMPLE_R * rvb.IN_COEF_R) >> 15); const s64 IIR_INPUT_B0 = ((g_buffer(rvb.IIR_SRC_B0) * rvb.IIR_COEF) >> 15) + ((INPUT_SAMPLE_L * rvb.IN_COEF_L) >> 15); const s64 IIR_INPUT_B1 = ((g_buffer(rvb.IIR_SRC_B1) * rvb.IIR_COEF) >> 15) + ((INPUT_SAMPLE_R * rvb.IN_COEF_R) >> 15); const s64 IIR_A0 = ((IIR_INPUT_A0 * rvb.IIR_ALPHA) >> 15) + ((g_buffer(rvb.IIR_DEST_A0) * (32768L - rvb.IIR_ALPHA)) >> 15); const s64 IIR_A1 = ((IIR_INPUT_A1 * rvb.IIR_ALPHA) >> 15) + ((g_buffer(rvb.IIR_DEST_A1) * (32768L - rvb.IIR_ALPHA)) >> 15); const s64 IIR_B0 = ((IIR_INPUT_B0 * rvb.IIR_ALPHA) >> 15) + ((g_buffer(rvb.IIR_DEST_B0) * (32768L - rvb.IIR_ALPHA)) >> 15); const s64 IIR_B1 = ((IIR_INPUT_B1 * rvb.IIR_ALPHA) >> 15) + ((g_buffer(rvb.IIR_DEST_B1) * (32768L - rvb.IIR_ALPHA)) >> 15); s_buffer1(rvb.IIR_DEST_A0, IIR_A0); s_buffer1(rvb.IIR_DEST_A1, IIR_A1); s_buffer1(rvb.IIR_DEST_B0, IIR_B0); s_buffer1(rvb.IIR_DEST_B1, IIR_B1); ACC0 = ((g_buffer(rvb.ACC_SRC_A0) * rvb.ACC_COEF_A) >> 15) + ((g_buffer(rvb.ACC_SRC_B0) * rvb.ACC_COEF_B) >> 15) + ((g_buffer(rvb.ACC_SRC_C0) * rvb.ACC_COEF_C) >> 15) + ((g_buffer(rvb.ACC_SRC_D0) * rvb.ACC_COEF_D) >> 15); ACC1 = ((g_buffer(rvb.ACC_SRC_A1) * rvb.ACC_COEF_A) >> 15) + ((g_buffer(rvb.ACC_SRC_B1) * rvb.ACC_COEF_B) >> 15) + ((g_buffer(rvb.ACC_SRC_C1) * rvb.ACC_COEF_C) >> 15) + ((g_buffer(rvb.ACC_SRC_D1) * rvb.ACC_COEF_D) >> 15); FB_A0 = g_buffer(rvb.MIX_DEST_A0 - rvb.FB_SRC_A); FB_A1 = g_buffer(rvb.MIX_DEST_A1 - rvb.FB_SRC_A); FB_B0 = g_buffer(rvb.MIX_DEST_B0 - rvb.FB_SRC_B); FB_B1 = g_buffer(rvb.MIX_DEST_B1 - rvb.FB_SRC_B); s_buffer(rvb.MIX_DEST_A0, ACC0 - ((FB_A0 * rvb.FB_ALPHA) >> 15)); s_buffer(rvb.MIX_DEST_A1, ACC1 - ((FB_A1 * rvb.FB_ALPHA) >> 15)); s_buffer(rvb.MIX_DEST_B0, ((rvb.FB_ALPHA * ACC0) >> 15) - ((FB_A0 * (int) (rvb.FB_ALPHA ^ 0xFFFF8000)) >> 15) - ((FB_B0 * rvb.FB_X) >> 15)); s_buffer(rvb.MIX_DEST_B1, ((rvb.FB_ALPHA * ACC1) >> 15) - ((FB_A1 * (int) (rvb.FB_ALPHA ^ 0xFFFF8000)) >> 15) - ((FB_B1 * rvb.FB_X) >> 15)); rvb.iRVBLeft = (g_buffer(rvb.MIX_DEST_A0) + g_buffer(rvb.MIX_DEST_B0)) / 3; rvb.iRVBRight = (g_buffer(rvb.MIX_DEST_A1) + g_buffer(rvb.MIX_DEST_B1)) / 3; rvb.iRVBLeft = ((s64) rvb.iRVBLeft * rvb.VolLeft) >> 14; rvb.iRVBRight = ((s64) rvb.iRVBRight * rvb.VolRight) >> 14; upbuf[0][ubpos] = rvb.iRVBLeft; upbuf[1][ubpos] = rvb.iRVBRight; ubpos = (ubpos + 1) & 7; } } else // -> reverb off { rvb.iRVBLeft = rvb.iRVBRight = 0; return; } rvb.CurrAddr++; if (rvb.CurrAddr > 0x3ffff) rvb.CurrAddr = rvb.StartAddr; } else { upbuf[0][ubpos] = 0; upbuf[1][ubpos] = 0; ubpos = (ubpos + 1) & 7; } { s32 retl = 0, retr = 0; for (x = 0; x < 8; x++) { retl += (upbuf[0][(ubpos + x) & 7] * downcoeffs[x]) >> 8; retr += (upbuf[1][(ubpos + x) & 7] * downcoeffs[x]) >> 8; } retl >>= (16 - 8 - 1); /* -1 To adjust for the null padding. */ retr >>= (16 - 8 - 1); *oleft += retl; *oright += retr; } } //////////////////////////////////////////////////////////////////////// /* ----------------------------------------------------------------------------- PSX reverb hardware notes by Neill Corlett ----------------------------------------------------------------------------- Yadda yadda disclaimer yadda probably not perfect yadda well it's okay anyway yadda yadda. ----------------------------------------------------------------------------- Basics ------ - The reverb buffer is 22khz 16-bit mono PCM. - It starts at the reverb address given by 1DA2, extends to the end of sound RAM, and wraps back to the 1DA2 address. Setting the address at 1DA2 resets the current reverb work address. This work address ALWAYS increments every 1/22050 sec., regardless of whether reverb is enabled (bit 7 of 1DAA set). And the contents of the reverb buffer ALWAYS play, scaled by the "reverberation depth left/right" volumes (1D84/1D86). (which, by the way, appear to be scaled so 3FFF=approx. 1.0, 4000=-1.0) ----------------------------------------------------------------------------- Register names -------------- These are probably not their real names. These are probably not even correct names. We will use them anyway, because we can. 1DC0: FB_SRC_A (offset) 1DC2: FB_SRC_B (offset) 1DC4: IIR_ALPHA (coef.) 1DC6: ACC_COEF_A (coef.) 1DC8: ACC_COEF_B (coef.) 1DCA: ACC_COEF_C (coef.) 1DCC: ACC_COEF_D (coef.) 1DCE: IIR_COEF (coef.) 1DD0: FB_ALPHA (coef.) 1DD2: FB_X (coef.) 1DD4: IIR_DEST_A0 (offset) 1DD6: IIR_DEST_A1 (offset) 1DD8: ACC_SRC_A0 (offset) 1DDA: ACC_SRC_A1 (offset) 1DDC: ACC_SRC_B0 (offset) 1DDE: ACC_SRC_B1 (offset) 1DE0: IIR_SRC_A0 (offset) 1DE2: IIR_SRC_A1 (offset) 1DE4: IIR_DEST_B0 (offset) 1DE6: IIR_DEST_B1 (offset) 1DE8: ACC_SRC_C0 (offset) 1DEA: ACC_SRC_C1 (offset) 1DEC: ACC_SRC_D0 (offset) 1DEE: ACC_SRC_D1 (offset) 1DF0: IIR_SRC_B1 (offset) 1DF2: IIR_SRC_B0 (offset) 1DF4: MIX_DEST_A0 (offset) 1DF6: MIX_DEST_A1 (offset) 1DF8: MIX_DEST_B0 (offset) 1DFA: MIX_DEST_B1 (offset) 1DFC: IN_COEF_L (coef.) 1DFE: IN_COEF_R (coef.) The coefficients are signed fractional values. -32768 would be -1.0 32768 would be 1.0 (if it were possible... the highest is of course 32767) The offsets are (byte/8) offsets into the reverb buffer. i.e. you multiply them by 8, you get byte offsets. You can also think of them as (samples/4) offsets. They appear to be signed. They can be negative. None of the documented presets make them negative, though. Yes, 1DF0 and 1DF2 appear to be backwards. Not a typo. ----------------------------------------------------------------------------- What it does ------------ We take all reverb sources: - regular channels that have the reverb bit on - cd and external sources, if their reverb bits are on and mix them into one stereo 44100hz signal. Lowpass/downsample that to 22050hz. The PSX uses a proper bandlimiting algorithm here, but I haven't figured out the hysterically exact specifics. I use an 8-tap filter with these coefficients, which are nice but probably not the real ones: 0.037828187894 0.157538631280 0.321159685278 0.449322115345 0.449322115345 0.321159685278 0.157538631280 0.037828187894 So we have two input samples (INPUT_SAMPLE_L, INPUT_SAMPLE_R) every 22050hz. * IN MY EMULATION, I divide these by 2 to make it clip less. (and of course the L/R output coefficients are adjusted to compensate) The real thing appears to not do this. At every 22050hz tick: - If the reverb bit is enabled (bit 7 of 1DAA), execute the reverb steady-state algorithm described below - AFTERWARDS, retrieve the "wet out" L and R samples from the reverb buffer (This part may not be exactly right and I guessed at the coefs. TODO: check later.) L is: 0.333 * (buffer[MIX_DEST_A0] + buffer[MIX_DEST_B0]) R is: 0.333 * (buffer[MIX_DEST_A1] + buffer[MIX_DEST_B1]) - Advance the current buffer position by 1 sample The wet out L and R are then upsampled to 44100hz and played at the "reverberation depth left/right" (1D84/1D86) volume, independent of the main volume. ----------------------------------------------------------------------------- Reverb steady-state ------------------- The reverb steady-state algorithm is fairly clever, and of course by "clever" I mean "batshit insane". buffer[x] is relative to the current buffer position, not the beginning of the buffer. Note that all buffer offsets must wrap around so they're contained within the reverb work area. Clipping is performed at the end... maybe also sooner, but definitely at the end. IIR_INPUT_A0 = buffer[IIR_SRC_A0] * IIR_COEF + INPUT_SAMPLE_L * IN_COEF_L; IIR_INPUT_A1 = buffer[IIR_SRC_A1] * IIR_COEF + INPUT_SAMPLE_R * IN_COEF_R; IIR_INPUT_B0 = buffer[IIR_SRC_B0] * IIR_COEF + INPUT_SAMPLE_L * IN_COEF_L; IIR_INPUT_B1 = buffer[IIR_SRC_B1] * IIR_COEF + INPUT_SAMPLE_R * IN_COEF_R; IIR_A0 = IIR_INPUT_A0 * IIR_ALPHA + buffer[IIR_DEST_A0] * (1.0 - IIR_ALPHA); IIR_A1 = IIR_INPUT_A1 * IIR_ALPHA + buffer[IIR_DEST_A1] * (1.0 - IIR_ALPHA); IIR_B0 = IIR_INPUT_B0 * IIR_ALPHA + buffer[IIR_DEST_B0] * (1.0 - IIR_ALPHA); IIR_B1 = IIR_INPUT_B1 * IIR_ALPHA + buffer[IIR_DEST_B1] * (1.0 - IIR_ALPHA); buffer[IIR_DEST_A0 + 1sample] = IIR_A0; buffer[IIR_DEST_A1 + 1sample] = IIR_A1; buffer[IIR_DEST_B0 + 1sample] = IIR_B0; buffer[IIR_DEST_B1 + 1sample] = IIR_B1; ACC0 = buffer[ACC_SRC_A0] * ACC_COEF_A + buffer[ACC_SRC_B0] * ACC_COEF_B + buffer[ACC_SRC_C0] * ACC_COEF_C + buffer[ACC_SRC_D0] * ACC_COEF_D; ACC1 = buffer[ACC_SRC_A1] * ACC_COEF_A + buffer[ACC_SRC_B1] * ACC_COEF_B + buffer[ACC_SRC_C1] * ACC_COEF_C + buffer[ACC_SRC_D1] * ACC_COEF_D; FB_A0 = buffer[MIX_DEST_A0 - FB_SRC_A]; FB_A1 = buffer[MIX_DEST_A1 - FB_SRC_A]; FB_B0 = buffer[MIX_DEST_B0 - FB_SRC_B]; FB_B1 = buffer[MIX_DEST_B1 - FB_SRC_B]; buffer[MIX_DEST_A0] = ACC0 - FB_A0 * FB_ALPHA; buffer[MIX_DEST_A1] = ACC1 - FB_A1 * FB_ALPHA; buffer[MIX_DEST_B0] = (FB_ALPHA * ACC0) - FB_A0 * (FB_ALPHA^0x8000) - FB_B0 * FB_X; buffer[MIX_DEST_B1] = (FB_ALPHA * ACC1) - FB_A1 * (FB_ALPHA^0x8000) - FB_B1 * FB_X; ----------------------------------------------------------------------------- */ upse-1.0.0/src/libupse/upse_ps1_executive.c0000644000175000017500000000562311006314306020560 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_ps1_executive.c * Purpose: libupse: PS1 application executive (lowlevel "Kernel") * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include "upse-internal.h" /* tracing */ #ifdef UPSE_TRACE # define _TRACE(...) _MESSAGE("TRACE", __VA_ARGS__) #else # define _TRACE(...) {} #endif #define _CALL(id, idN) do { _TRACE("call<%s> %s<%p> [0x%x]", #id, idN[call], id[call], call); id[call](); } while(0) #define _UNIMPLEMENTED(id, idN) do { _WARN("call<%s> %s<%p> [0x%x]", #id, idN[call], id[call], call); } while(0) static void upse_ps1_executive_dummy(void) { upse_r3000_cpu_regs.pc = upse_r3000_cpu_regs.GPR.n.ra; psxBranchTest(); } static void upse_ps1_executive_run_bios_A0(void) { u32 call = upse_r3000_cpu_regs.GPR.n.t1 & 0xff; if (biosA0[call]) _CALL(biosA0, biosA0n); else _UNIMPLEMENTED(biosA0, biosA0n); psxBranchTest(); } static void upse_ps1_executive_run_bios_B0(void) { u32 call = upse_r3000_cpu_regs.GPR.n.t1 & 0xff; if (biosB0[call]) _CALL(biosB0, biosB0n); else _UNIMPLEMENTED(biosB0, biosB0n); psxBranchTest(); } static void upse_ps1_executive_run_bios_C0() { u32 call = upse_r3000_cpu_regs.GPR.n.t1 & 0xff; if (biosC0[call]) _CALL(biosC0, biosC0n); else _UNIMPLEMENTED(biosC0, biosC0n); psxBranchTest(); } static void upse_ps1_executive_bootstrap(void) { // 0xbfc00000 } typedef struct { u32 _pc0; u32 gp0; u32 t_addr; u32 t_size; u32 d_addr; u32 d_size; u32 b_addr; u32 b_size; u32 s_addr; u32 s_size; u32 _sp, _fp, _gp, ret, base; } upse_packed_t upse_ps1_executive_exec_record_t; static void upse_ps1_executive_task_switch(void) { upse_ps1_executive_exec_record_t *header = (upse_ps1_executive_exec_record_t *) PSXM(upse_r3000_cpu_regs.GPR.n.s0); //SysPrintf("ExecRet %x: %x\n", upse_r3000_cpu_regs.GPR.n.s0, header->ret); upse_r3000_cpu_regs.GPR.n.ra = BFLIP32(header->ret); upse_r3000_cpu_regs.GPR.n.sp = BFLIP32(header->_sp); upse_r3000_cpu_regs.GPR.n.s8 = BFLIP32(header->_fp); upse_r3000_cpu_regs.GPR.n.gp = BFLIP32(header->_gp); upse_r3000_cpu_regs.GPR.n.s0 = BFLIP32(header->base); upse_r3000_cpu_regs.GPR.n.v0 = 1; upse_r3000_cpu_regs.pc = upse_r3000_cpu_regs.GPR.n.ra; } void (*psxHLEt[256])(void) = { upse_ps1_executive_dummy, upse_ps1_executive_run_bios_A0, upse_ps1_executive_run_bios_B0, upse_ps1_executive_run_bios_C0, upse_ps1_executive_bootstrap, upse_ps1_executive_task_switch }; upse-1.0.0/src/libupse/upse_ps1_spu_register_io.c0000644000175000017500000003341111006314306021755 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_ps1_spu_register_io.c * Purpose: libupse: PS1 SPU register I/O operations * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 2002 Neill Corlett * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include "upse-types.h" #include "upse-internal.h" #include "upse-ps1-spu-base.h" #include "upse-spu-internal.h" #include "upse-ps1-spu-register-io.h" #include "upse.h" #include "upse-ps1-memory-manager.h" //////////////////////////////////////////////////////////////////////// // WRITE REGISTERS: called by main emu //////////////////////////////////////////////////////////////////////// void SPUwriteRegister(u32 reg, u16 val) { const u32 r = reg & 0xfff; regArea[(r - 0xc00) >> 1] = val; if (r >= 0x0c00 && r < 0x0d80) // some channel info? { int ch = (r >> 4) - 0xc0; // calc channel //if(ch==20) printf("%08x: %04x\n",reg,val); switch (r & 0x0f) { //------------------------------------------------// r volume case 0: SetVolumeLR(0, (u8) ch, val); break; //------------------------------------------------// l volume case 2: SetVolumeLR(1, (u8) ch, val); break; //------------------------------------------------// pitch case 4: SetPitch(ch, val); break; //------------------------------------------------// start case 6: s_chan[ch].pStart = spuMemC + ((u32) val << 3); break; //------------------------------------------------// level with pre-calcs case 8: { const u32 lval = val; // DEBUG CHECK //---------------------------------------------// s_chan[ch].ADSRX.AttackModeExp = (lval & 0x8000) ? 1 : 0; s_chan[ch].ADSRX.AttackRate = (lval >> 8) & 0x007f; s_chan[ch].ADSRX.DecayRate = (lval >> 4) & 0x000f; s_chan[ch].ADSRX.SustainLevel = lval & 0x000f; //---------------------------------------------// } break; //------------------------------------------------// adsr times with pre-calcs case 10: { const u32 lval = val; // DEBUG CHECK //----------------------------------------------// s_chan[ch].ADSRX.SustainModeExp = (lval & 0x8000) ? 1 : 0; s_chan[ch].ADSRX.SustainIncrease = (lval & 0x4000) ? 0 : 1; s_chan[ch].ADSRX.SustainRate = (lval >> 6) & 0x007f; s_chan[ch].ADSRX.ReleaseModeExp = (lval & 0x0020) ? 1 : 0; s_chan[ch].ADSRX.ReleaseRate = lval & 0x001f; //----------------------------------------------// } break; //------------------------------------------------// adsr volume... mmm have to investigate this //case 0xC: // break; //------------------------------------------------// case 0xE: // loop? s_chan[ch].pLoop = spuMemC + ((u32) val << 3); s_chan[ch].bIgnoreLoop = 1; break; //------------------------------------------------// } return; } switch (r) { //-------------------------------------------------// case H_SPUaddr: spuAddr = (u32) val << 3; break; //-------------------------------------------------// case H_SPUdata: spuMem[spuAddr >> 1] = BFLIP16(val); spuAddr += 2; if (spuAddr > 0x7ffff) spuAddr = 0; break; //-------------------------------------------------// case H_SPUctrl: spuCtrl = val; break; //-------------------------------------------------// case H_SPUstat: spuStat = val & 0xf800; break; //-------------------------------------------------// case H_SPUReverbAddr: if (val == 0xFFFF || val <= 0x200) { rvb.StartAddr = rvb.CurrAddr = 0; } else { const s32 iv = (u32) val << 2; if (rvb.StartAddr != iv) { rvb.StartAddr = (u32) val << 2; rvb.CurrAddr = rvb.StartAddr; } } break; //-------------------------------------------------// case H_SPUirqAddr: spuIrq = val; pSpuIrq = spuMemC + ((u32) val << 3); break; //-------------------------------------------------// /* Volume settings appear to be at least 15-bit unsigned in this case. Definitely NOT 15-bit signed. Probably 16-bit signed, so s16 type cast. Check out "Chrono Cross: Shadow's End Forest" */ case H_SPUrvolL: rvb.VolLeft = (s16) val; //printf("%d\n",val); break; //-------------------------------------------------// case H_SPUrvolR: rvb.VolRight = (s16) val; //printf("%d\n",val); break; //-------------------------------------------------// /* case H_ExtLeft: //auxprintf("EL %d\n",val); break; //-------------------------------------------------// case H_ExtRight: //auxprintf("ER %d\n",val); break; //-------------------------------------------------// case H_SPUmvolL: //auxprintf("ML %d\n",val); break; //-------------------------------------------------// case H_SPUmvolR: //auxprintf("MR %d\n",val); break; //-------------------------------------------------// case H_SPUMute1: //printf("M0 %04x\n",val); break; //-------------------------------------------------// case H_SPUMute2: // printf("M1 %04x\n",val); break; */ //-------------------------------------------------// case H_SPUon1: SoundOn(0, 16, val); break; //-------------------------------------------------// case H_SPUon2: // printf("Boop: %08x: %04x\n",reg,val); SoundOn(16, 24, val); break; //-------------------------------------------------// case H_SPUoff1: SoundOff(0, 16, val); break; //-------------------------------------------------// case H_SPUoff2: SoundOff(16, 24, val); // printf("Boop: %08x: %04x\n",reg,val); break; //-------------------------------------------------// case H_FMod1: FModOn(0, 16, val); break; //-------------------------------------------------// case H_FMod2: FModOn(16, 24, val); break; //-------------------------------------------------// case H_Noise1: NoiseOn(0, 16, val); break; //-------------------------------------------------// case H_Noise2: NoiseOn(16, 24, val); break; //-------------------------------------------------// case H_RVBon1: rvb.Enabled &= ~0xFFFF; rvb.Enabled |= val; break; //-------------------------------------------------// case H_RVBon2: rvb.Enabled &= 0xFFFF; rvb.Enabled |= val << 16; break; //-------------------------------------------------// case H_Reverb + 0: rvb.FB_SRC_A = val; break; case H_Reverb + 2: rvb.FB_SRC_B = (s16) val; break; case H_Reverb + 4: rvb.IIR_ALPHA = (s16) val; break; case H_Reverb + 6: rvb.ACC_COEF_A = (s16) val; break; case H_Reverb + 8: rvb.ACC_COEF_B = (s16) val; break; case H_Reverb + 10: rvb.ACC_COEF_C = (s16) val; break; case H_Reverb + 12: rvb.ACC_COEF_D = (s16) val; break; case H_Reverb + 14: rvb.IIR_COEF = (s16) val; break; case H_Reverb + 16: rvb.FB_ALPHA = (s16) val; break; case H_Reverb + 18: rvb.FB_X = (s16) val; break; case H_Reverb + 20: rvb.IIR_DEST_A0 = (s16) val; break; case H_Reverb + 22: rvb.IIR_DEST_A1 = (s16) val; break; case H_Reverb + 24: rvb.ACC_SRC_A0 = (s16) val; break; case H_Reverb + 26: rvb.ACC_SRC_A1 = (s16) val; break; case H_Reverb + 28: rvb.ACC_SRC_B0 = (s16) val; break; case H_Reverb + 30: rvb.ACC_SRC_B1 = (s16) val; break; case H_Reverb + 32: rvb.IIR_SRC_A0 = (s16) val; break; case H_Reverb + 34: rvb.IIR_SRC_A1 = (s16) val; break; case H_Reverb + 36: rvb.IIR_DEST_B0 = (s16) val; break; case H_Reverb + 38: rvb.IIR_DEST_B1 = (s16) val; break; case H_Reverb + 40: rvb.ACC_SRC_C0 = (s16) val; break; case H_Reverb + 42: rvb.ACC_SRC_C1 = (s16) val; break; case H_Reverb + 44: rvb.ACC_SRC_D0 = (s16) val; break; case H_Reverb + 46: rvb.ACC_SRC_D1 = (s16) val; break; case H_Reverb + 48: rvb.IIR_SRC_B1 = (s16) val; break; case H_Reverb + 50: rvb.IIR_SRC_B0 = (s16) val; break; case H_Reverb + 52: rvb.MIX_DEST_A0 = (s16) val; break; case H_Reverb + 54: rvb.MIX_DEST_A1 = (s16) val; break; case H_Reverb + 56: rvb.MIX_DEST_B0 = (s16) val; break; case H_Reverb + 58: rvb.MIX_DEST_B1 = (s16) val; break; case H_Reverb + 60: rvb.IN_COEF_L = (s16) val; break; case H_Reverb + 62: rvb.IN_COEF_R = (s16) val; break; } } //////////////////////////////////////////////////////////////////////// // READ REGISTER: called by main emu //////////////////////////////////////////////////////////////////////// u16 SPUreadRegister(u32 reg) { const u32 r = reg & 0xfff; if (r >= 0x0c00 && r < 0x0d80) { switch (r & 0x0f) { case 0xC: // get adsr vol { const int ch = (r >> 4) - 0xc0; if (s_chan[ch].bNew) return 1; // we are started, but not processed? return 1 if (s_chan[ch].ADSRX.lVolume && // same here... we haven't decoded one sample yet, so no envelope yet. return 1 as well !s_chan[ch].ADSRX.EnvelopeVol) return 1; return (u16) (s_chan[ch].ADSRX.EnvelopeVol >> 16); } case 0xE: // get loop address { const int ch = (r >> 4) - 0xc0; if (s_chan[ch].pLoop == NULL) return 0; return (u16) ((s_chan[ch].pLoop - spuMemC) >> 3); } } } switch (r) { case H_SPUctrl: return spuCtrl; case H_SPUstat: return spuStat; case H_SPUaddr: return (u16) (spuAddr >> 3); case H_SPUdata: { u16 s = BFLIP16(spuMem[spuAddr >> 1]); spuAddr += 2; if (spuAddr > 0x7ffff) spuAddr = 0; return s; } case H_SPUirqAddr: return spuIrq; //case H_SPUIsOn1: // return IsSoundOn(0,16); //case H_SPUIsOn2: // return IsSoundOn(16,24); } return regArea[(r - 0xc00) >> 1]; } //////////////////////////////////////////////////////////////////////// // SOUND ON register write //////////////////////////////////////////////////////////////////////// void SoundOn(int start, int end, u16 val) // SOUND ON PSX COMAND { int ch; for (ch = start; ch < end; ch++, val >>= 1) // loop channels { if ((val & 1) && s_chan[ch].pStart) // mmm... start has to be set before key on !?! { s_chan[ch].bIgnoreLoop = 0; s_chan[ch].bNew = 1; } } } //////////////////////////////////////////////////////////////////////// // SOUND OFF register write //////////////////////////////////////////////////////////////////////// void SoundOff(int start, int end, u16 val) // SOUND OFF PSX COMMAND { int ch; for (ch = start; ch < end; ch++, val >>= 1) // loop channels { if (val & 1) // && s_chan[i].bOn) mmm... { s_chan[ch].bStop = 1; } } } //////////////////////////////////////////////////////////////////////// // FMOD register write //////////////////////////////////////////////////////////////////////// void FModOn(int start, int end, u16 val) // FMOD ON PSX COMMAND { int ch; for (ch = start; ch < end; ch++, val >>= 1) // loop channels { if (val & 1) // -> fmod on/off { if (ch > 0) { s_chan[ch].bFMod = 1; // --> sound channel s_chan[ch - 1].bFMod = 2; // --> freq channel } } else { s_chan[ch].bFMod = 0; // --> turn off fmod } } } //////////////////////////////////////////////////////////////////////// // NOISE register write //////////////////////////////////////////////////////////////////////// void NoiseOn(int start, int end, u16 val) // NOISE ON PSX COMMAND { int ch; for (ch = start; ch < end; ch++, val >>= 1) // loop channels { if (val & 1) // -> noise on/off { s_chan[ch].bNoise = 1; } else { s_chan[ch].bNoise = 0; } } } //////////////////////////////////////////////////////////////////////// // LEFT VOLUME register write //////////////////////////////////////////////////////////////////////// // please note: sweep is wrong. void SetVolumeLR(int right, u8 ch, s16 vol) // LEFT VOLUME { //if(vol&0xc000) //printf("%d %08x\n",right,vol); if (right) s_chan[ch].iRightVolRaw = vol; else s_chan[ch].iLeftVolRaw = vol; if (vol & 0x8000) // sweep? { s16 sInc = 1; // -> sweep up? if (vol & 0x2000) sInc = -1; // -> or down? if (vol & 0x1000) vol ^= 0xffff; // -> mmm... phase inverted? have to investigate this vol = ((vol & 0x7f) + 1) / 2; // -> sweep: 0..127 -> 0..64 vol += vol / (2 * sInc); // -> HACK: we don't sweep right now, so we just raise/lower the volume by the half! vol *= 128; vol &= 0x3fff; //puts("Sweep"); } else // no sweep: { if (vol & 0x4000) vol = (vol & 0x3FFF) - 0x4000; else vol &= 0x3FFF; //if(vol&0x4000) // -> mmm... phase inverted? have to investigate this // vol=0-(0x3fff-(vol&0x3fff)); //else // vol&=0x3fff; } if (right) s_chan[ch].iRightVolume = vol; else s_chan[ch].iLeftVolume = vol; // store volume } //////////////////////////////////////////////////////////////////////// // PITCH register write //////////////////////////////////////////////////////////////////////// void SetPitch(int ch, u16 val) // SET PITCH { int NP; if (val > 0x3fff) NP = 0x3fff; // get pitch val else NP = val; s_chan[ch].iRawPitch = NP; NP = (44100L * NP) / 4096L; // calc frequency if (NP < 1) NP = 1; // some security s_chan[ch].iActFreq = NP; // store frequency } upse-1.0.0/src/libupse/upse_string.c0000644000175000017500000000165111006314306017277 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_string.c * Purpose: libupse: string utility functions * * Copyright (c) 2007 William Pitcock * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include "upse.h" #include "upse-string.h" /* * fgets() wrapper - inefficient, but it will do. */ char *upse_io_fgets(char *s, int n, void *stream, upse_iofuncs_t * iofuncs) { int c; register char *p; if (n <= 0) return NULL; p = s; while (--n) { if (iofuncs->read_impl(&c, 1, 1, stream) == 0) { break; } if ((*p++ = c) == '\n') { break; } } if (p > s) { *p = 0; return s; } return NULL; } upse-1.0.0/src/libupse/upse_ps1_dma_manager.c0000644000175000017500000000230111006314306021000 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_ps1_dma_manager.c * Purpose: libupse: UPSE PS1 DMA Manager * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include "upse-internal.h" void psxDma4(u32 madr, u32 bcr, u32 chcr) { // SPU switch (chcr) { case 0x01000201: //cpu to spu transfer bcr = (bcr >> 16) * (bcr & 0xffff) * 2; //printf("%08x, %08x\n",madr,bcr); SPUwriteDMAMem(madr, bcr); break; case 0x01000200: //spu to cpu transfer //printf("%08x\n",madr); SPUreadDMAMem(madr, (bcr >> 16) * (bcr & 0xffff) * 2); break; } } void psxDma6(u32 madr, u32 bcr, u32 chcr) { u32 *mem = (u32 *) PSXM(madr); if (chcr == 0x11000002) { while (bcr--) { *mem-- = (madr - 4) & 0xffffff; madr -= 4; } mem++; *mem = 0xffffff; } } upse-1.0.0/src/libupse/upse-r3000-abstract.h0000644000175000017500000001027211006314306020260 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-r3000-abstract.h * Purpose: libupse: r3K abstract implementation factory headers * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef _UPSE__LIBUPSE__UPSE_R3000_ABSTRACT_H__GUARD #define _UPSE__LIBUPSE__UPSE_R3000_ABSTRACT_H__GUARD #include #include "upse-internal.h" typedef union { struct { u32 r0, at, v0, v1, a0, a1, a2, a3, t0, t1, t2, t3, t4, t5, t6, t7, s0, s1, s2, s3, s4, s5, s6, s7, t8, t9, k0, k1, gp, sp, s8, ra, lo, hi; } n upse_packed_t; u32 r[34]; /* Lo, Hi in r[33] and r[34] */ } psxGPRRegs; typedef union { struct { u32 Index, Random, EntryLo0, EntryLo1, Context, PageMask, Wired, Reserved0, BadVAddr, Count, EntryHi, Compare, Status, Cause, EPC, PRid, Config, LLAddr, WatchLO, WatchHI, XContext, Reserved1, Reserved2, Reserved3, Reserved4, Reserved5, ECC, CacheErr, TagLo, TagHi, ErrorEPC, Reserved6; } n upse_packed_t; u32 r[32]; } psxCP0Regs; typedef struct { psxGPRRegs GPR; /* General Purpose Registers */ psxCP0Regs CP0; /* Coprocessor0 Registers */ u32 pc; /* Program counter */ u32 code; /* The instruction */ u32 cycle; u32 interrupt; } upse_r3000_cpu_registers_t; extern upse_r3000_cpu_registers_t upse_r3000_cpu_regs; #define _i32(x) (s32)x #define _u32(x) (u32)x #define _i16(x) (s16)x #define _u16(x) (u32)x #define _i8(x) (s8)x #define _u8(x) (u8)x /**** R3000A Instruction Macros ****/ #define _PC_ upse_r3000_cpu_regs.pc // The next PC to be executed #define _Funct_ ((upse_r3000_cpu_regs.code ) & 0x3F) // The funct part of the instruction register #define _Rd_ ((upse_r3000_cpu_regs.code >> 11) & 0x1F) // The rd part of the instruction register #define _Rt_ ((upse_r3000_cpu_regs.code >> 16) & 0x1F) // The rt part of the instruction register #define _Rs_ ((upse_r3000_cpu_regs.code >> 21) & 0x1F) // The rs part of the instruction register #define _Sa_ ((upse_r3000_cpu_regs.code >> 6) & 0x1F) // The sa part of the instruction register #define _Im_ ((u16)upse_r3000_cpu_regs.code) // The immediate part of the instruction register #define _Target_ (upse_r3000_cpu_regs.code & 0x03ffffff) // The target part of the instruction register #define _Imm_ ((s16)upse_r3000_cpu_regs.code) // sign-extended immediate #define _ImmU_ (upse_r3000_cpu_regs.code&0xffff) // zero-extended immediate #define _rRs_ upse_r3000_cpu_regs.GPR.r[_Rs_] // Rs register #define _rRt_ upse_r3000_cpu_regs.GPR.r[_Rt_] // Rt register #define _rRd_ upse_r3000_cpu_regs.GPR.r[_Rd_] // Rd register #define _rSa_ upse_r3000_cpu_regs.GPR.r[_Sa_] // Sa register #define _rFs_ upse_r3000_cpu_regs.CP0.r[_Rd_] // Fs register #define _c2dRs_ upse_r3000_cpu_regs.CP2D.r[_Rs_] // Rs cop2 data register #define _c2dRt_ upse_r3000_cpu_regs.CP2D.r[_Rt_] // Rt cop2 data register #define _c2dRd_ upse_r3000_cpu_regs.CP2D.r[_Rd_] // Rd cop2 data register #define _c2dSa_ upse_r3000_cpu_regs.CP2D.r[_Sa_] // Sa cop2 data register #define _rHi_ upse_r3000_cpu_regs.GPR.n.hi // The HI register #define _rLo_ upse_r3000_cpu_regs.GPR.n.lo // The LO register #define _JumpTarget_ ((_Target_ * 4) + (_PC_ & 0xf0000000)) // Calculates the target during a jump instruction #define _BranchTarget_ ((s16)_Im_ * 4 + _PC_) // Calculates the target during a branch instruction #define _SetLink(x) upse_r3000_cpu_regs.GPR.r[x] = _PC_ + 4; // Sets the return address in the link register int psxInit(); void psxReset(); void psxShutdown(); void psxException(u32 code, u32 bd); void psxBranchTest(); void psxExecuteBios(); int upse_r3000_cpu_init(void); void upse_r3000_cpu_reset(void); void upse_r3000_cpu_execute(void); void upse_r3000_cpu_execute_block(void); void upse_r3000_cpu_clear(u32 Addr, u32 Size); void upse_r3000_cpu_shutdown(void); #endif /* __R3000A_H__ */ upse-1.0.0/src/libupse/upse-ps1-spu-register-io.h0000644000175000017500000001155011006314306021452 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-ps1-spu-register-0io.h * Purpose: libupse: PS1 SPU register I/O operations * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 2002 Neill Corlett * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #define H_SPUReverbAddr 0x0da2 #define H_SPUirqAddr 0x0da4 #define H_SPUaddr 0x0da6 #define H_SPUdata 0x0da8 #define H_SPUctrl 0x0daa #define H_SPUstat 0x0dae #define H_SPUmvolL 0x0d80 #define H_SPUmvolR 0x0d82 #define H_SPUrvolL 0x0d84 #define H_SPUrvolR 0x0d86 #define H_SPUon1 0x0d88 #define H_SPUon2 0x0d8a #define H_SPUoff1 0x0d8c #define H_SPUoff2 0x0d8e #define H_FMod1 0x0d90 #define H_FMod2 0x0d92 #define H_Noise1 0x0d94 #define H_Noise2 0x0d96 #define H_RVBon1 0x0d98 #define H_RVBon2 0x0d9a #define H_SPUMute1 0x0d9c #define H_SPUMute2 0x0d9e #define H_CDLeft 0x0db0 #define H_CDRight 0x0db2 #define H_ExtLeft 0x0db4 #define H_ExtRight 0x0db6 #define H_Reverb 0x0dc0 #define H_SPUPitch0 0x0c04 #define H_SPUPitch1 0x0c14 #define H_SPUPitch2 0x0c24 #define H_SPUPitch3 0x0c34 #define H_SPUPitch4 0x0c44 #define H_SPUPitch5 0x0c54 #define H_SPUPitch6 0x0c64 #define H_SPUPitch7 0x0c74 #define H_SPUPitch8 0x0c84 #define H_SPUPitch9 0x0c94 #define H_SPUPitch10 0x0ca4 #define H_SPUPitch11 0x0cb4 #define H_SPUPitch12 0x0cc4 #define H_SPUPitch13 0x0cd4 #define H_SPUPitch14 0x0ce4 #define H_SPUPitch15 0x0cf4 #define H_SPUPitch16 0x0d04 #define H_SPUPitch17 0x0d14 #define H_SPUPitch18 0x0d24 #define H_SPUPitch19 0x0d34 #define H_SPUPitch20 0x0d44 #define H_SPUPitch21 0x0d54 #define H_SPUPitch22 0x0d64 #define H_SPUPitch23 0x0d74 #define H_SPUStartAdr0 0x0c06 #define H_SPUStartAdr1 0x0c16 #define H_SPUStartAdr2 0x0c26 #define H_SPUStartAdr3 0x0c36 #define H_SPUStartAdr4 0x0c46 #define H_SPUStartAdr5 0x0c56 #define H_SPUStartAdr6 0x0c66 #define H_SPUStartAdr7 0x0c76 #define H_SPUStartAdr8 0x0c86 #define H_SPUStartAdr9 0x0c96 #define H_SPUStartAdr10 0x0ca6 #define H_SPUStartAdr11 0x0cb6 #define H_SPUStartAdr12 0x0cc6 #define H_SPUStartAdr13 0x0cd6 #define H_SPUStartAdr14 0x0ce6 #define H_SPUStartAdr15 0x0cf6 #define H_SPUStartAdr16 0x0d06 #define H_SPUStartAdr17 0x0d16 #define H_SPUStartAdr18 0x0d26 #define H_SPUStartAdr19 0x0d36 #define H_SPUStartAdr20 0x0d46 #define H_SPUStartAdr21 0x0d56 #define H_SPUStartAdr22 0x0d66 #define H_SPUStartAdr23 0x0d76 #define H_SPULoopAdr0 0x0c0e #define H_SPULoopAdr1 0x0c1e #define H_SPULoopAdr2 0x0c2e #define H_SPULoopAdr3 0x0c3e #define H_SPULoopAdr4 0x0c4e #define H_SPULoopAdr5 0x0c5e #define H_SPULoopAdr6 0x0c6e #define H_SPULoopAdr7 0x0c7e #define H_SPULoopAdr8 0x0c8e #define H_SPULoopAdr9 0x0c9e #define H_SPULoopAdr10 0x0cae #define H_SPULoopAdr11 0x0cbe #define H_SPULoopAdr12 0x0cce #define H_SPULoopAdr13 0x0cde #define H_SPULoopAdr14 0x0cee #define H_SPULoopAdr15 0x0cfe #define H_SPULoopAdr16 0x0d0e #define H_SPULoopAdr17 0x0d1e #define H_SPULoopAdr18 0x0d2e #define H_SPULoopAdr19 0x0d3e #define H_SPULoopAdr20 0x0d4e #define H_SPULoopAdr21 0x0d5e #define H_SPULoopAdr22 0x0d6e #define H_SPULoopAdr23 0x0d7e #define H_SPU_ADSRLevel0 0x0c08 #define H_SPU_ADSRLevel1 0x0c18 #define H_SPU_ADSRLevel2 0x0c28 #define H_SPU_ADSRLevel3 0x0c38 #define H_SPU_ADSRLevel4 0x0c48 #define H_SPU_ADSRLevel5 0x0c58 #define H_SPU_ADSRLevel6 0x0c68 #define H_SPU_ADSRLevel7 0x0c78 #define H_SPU_ADSRLevel8 0x0c88 #define H_SPU_ADSRLevel9 0x0c98 #define H_SPU_ADSRLevel10 0x0ca8 #define H_SPU_ADSRLevel11 0x0cb8 #define H_SPU_ADSRLevel12 0x0cc8 #define H_SPU_ADSRLevel13 0x0cd8 #define H_SPU_ADSRLevel14 0x0ce8 #define H_SPU_ADSRLevel15 0x0cf8 #define H_SPU_ADSRLevel16 0x0d08 #define H_SPU_ADSRLevel17 0x0d18 #define H_SPU_ADSRLevel18 0x0d28 #define H_SPU_ADSRLevel19 0x0d38 #define H_SPU_ADSRLevel20 0x0d48 #define H_SPU_ADSRLevel21 0x0d58 #define H_SPU_ADSRLevel22 0x0d68 #define H_SPU_ADSRLevel23 0x0d78 void SoundOn(int start, int end, u16 val); void SoundOff(int start, int end, u16 val); void FModOn(int start, int end, u16 val); void NoiseOn(int start, int end, u16 val); void SetVolumeLR(int right, u8 ch, s16 vol); void SetPitch(int ch, u16 val); void SPUwriteRegister(u32 reg, u16 val); upse-1.0.0/src/libupse/upse-ps1-counters.h0000644000175000017500000000215311006314306020255 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-ps1-counters.h * Purpose: libupse: PS1 timekeeping implementation headers * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef __PSXCOUNTERS_H__ #define __PSXCOUNTERS_H__ typedef struct { u32 count, mode, target; u32 sCycle, Cycle, rate, interrupt; } psxCounter; extern psxCounter psxCounters[5]; extern u32 psxNextCounter, psxNextsCounter; void psxRcntInit(); void psxRcntUpdate(); void psxRcntWcount(u32 index, u32 value); void psxRcntWmode(u32 index, u32 value); void psxRcntWtarget(u32 index, u32 value); u32 psxRcntRcount(u32 index); void psxUpdateVSyncRate(); int CounterSPURun(void); void CounterDeadLoopSkip(); #endif /* __PSXCOUNTERS_H__ */ upse-1.0.0/src/libupse/upse.h0000644000175000017500000000461311006314306015717 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse.h * Purpose: libupse development header * * Copyright (c) 2007 William Pitcock * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef __UPSE_LIBUPSE_UPSE_H_GUARD #define __UPSE_LIBUPSE_UPSE_H_GUARD #include #include typedef struct _upse_psftag { struct _upse_psftag *next; char *key; char *value; } upse_psftag_t; typedef struct { u32 length; u32 stop; u32 fade; u32 volume; char *title; char *artist; char *game; char *year; char *genre; char *psfby; char *comment; char *copyright; upse_psftag_t *taglist; } upse_psf_t; int upse_seek(u32 t); void upse_stop(void); void upse_execute(void); typedef struct { void *(*open_impl) (char *path, char *mode); size_t(*read_impl) (void *ptr, size_t size, size_t nmemb, void *file); int (*seek_impl) (void *file, long offset, int whence); int (*close_impl) (void *file); } upse_iofuncs_t; upse_psf_t *upse_load(char *path, upse_iofuncs_t * iofuncs); upse_psf_t *upse_get_psf_metadata(char *path, upse_iofuncs_t * iofuncs); void upse_free_psf_metadata(upse_psf_t * info); typedef void (*upse_audio_callback_func_t) (unsigned char *, long, void *); void upse_set_audio_callback(upse_audio_callback_func_t func, void *user_data); /* * Set the interpolation mode. * * 1: interpolation (like a real PSX/PS2) * 0: interpolation only on reverb * (PeOPS/Neill Corlett's model says interpolation always but doesn't do it) */ void upse_set_interpolation_mode(u32 setting); /* * Set a custom interpolation coefficient. * Implies that interpolation_mode is non-zero. */ void upse_set_interpolation_coefficient(double setting); /* * Enable or disable reverb. */ void upse_set_reverb_mode(u32 setting); /* * Enable or disable non-downsampled reverb. [EXPERIMENTAL] */ void upse_set_reverb_no_downsample(u32 setting); /* * Custom BIOS stuff. */ int upse_has_custom_bios(void); const char *upse_get_custom_bios(void); void upse_set_custom_bios(const char *bios); /* * Utility functions. */ float upse_strtof(const char *value); #endif upse-1.0.0/src/libupse/upse_r3000_bytecode_evaluator.c0000644000175000017500000005747511006314306022514 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_r3000_bytecode_evaluator.c * Purpose: libupse: r3K machine bytecode evaluator * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include #include "upse-internal.h" static int branch; static int branch2; static u32 branchPC; // These macros are used to assemble the repassembler functions // if(!PSXM(upse_r3000_cpu_regs.pc)) puts("Whoops"); // Fix this... // printf("%08x ", upse_r3000_cpu_regs.pc); #define execI() { \ upse_r3000_cpu_regs.code = BFLIP32(PSXMu32(upse_r3000_cpu_regs.pc)); \ \ upse_r3000_cpu_regs.pc+= 4; upse_r3000_cpu_regs.cycle++; \ psxBSC[upse_r3000_cpu_regs.code >> 26](); \ } // Subsets static void (*psxBSC[64]) (); static void (*psxSPC[64]) (); static void (*psxREG[32]) (); static void (*psxCP0[32]) (); static void delayRead(int reg, u32 bpc) { u32 rold, rnew; // SysPrintf("delayRead at %x!\n", upse_r3000_cpu_regs.pc); rold = upse_r3000_cpu_regs.GPR.r[reg]; psxBSC[upse_r3000_cpu_regs.code >> 26] (); // branch delay load rnew = upse_r3000_cpu_regs.GPR.r[reg]; upse_r3000_cpu_regs.pc = bpc; psxBranchTest(); upse_r3000_cpu_regs.GPR.r[reg] = rold; execI(); // first branch opcode upse_r3000_cpu_regs.GPR.r[reg] = rnew; branch = 0; } static void delayWrite(int reg, u32 bpc) { /* SysPrintf("delayWrite at %x!\n", upse_r3000_cpu_regs.pc); // SysPrintf("%s\n", disR3000AF(upse_r3000_cpu_regs.code, upse_r3000_cpu_regs.pc-4)); // SysPrintf("%s\n", disR3000AF(PSXMu32(bpc), bpc));*/ // no changes from normal behavior psxBSC[upse_r3000_cpu_regs.code >> 26] (); branch = 0; upse_r3000_cpu_regs.pc = bpc; psxBranchTest(); } static void delayReadWrite(int reg, u32 bpc) { // SysPrintf("delayReadWrite at %x!\n", upse_r3000_cpu_regs.pc); // the branch delay load is skipped branch = 0; upse_r3000_cpu_regs.pc = bpc; psxBranchTest(); } // this defines shall be used with the tmp // of the next func (instead of _Funct_...) #define _tFunct_ ((tmp ) & 0x3F) // The funct part of the instruction register #define _tRd_ ((tmp >> 11) & 0x1F) // The rd part of the instruction register #define _tRt_ ((tmp >> 16) & 0x1F) // The rt part of the instruction register #define _tRs_ ((tmp >> 21) & 0x1F) // The rs part of the instruction register #define _tSa_ ((tmp >> 6) & 0x1F) // The sa part of the instruction register static void psxDelayTest(u32 reg, u32 bpc) { u32 tmp; tmp = BFLIP32(PSXMu32(bpc)); branch = 1; switch (tmp >> 26) { case 0x00: // SPECIAL switch (_tFunct_) { case 0x00: // SLL if (!tmp) break; // NOP case 0x02: case 0x03: // SRL/SRA if (_tRd_ == reg && _tRt_ == reg) { delayReadWrite(reg, bpc); return; } else if (_tRt_ == reg) { delayRead(reg, bpc); return; } else if (_tRd_ == reg) { delayWrite(reg, bpc); return; } break; case 0x08: // JR if (_tRs_ == reg) { delayRead(reg, bpc); return; } break; case 0x09: // JALR if (_tRd_ == reg && _tRs_ == reg) { delayReadWrite(reg, bpc); return; } else if (_tRs_ == reg) { delayRead(reg, bpc); return; } else if (_tRd_ == reg) { delayWrite(reg, bpc); return; } break; // SYSCALL/BREAK just a break; case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: case 0x2a: case 0x2b: // ADD/ADDU... case 0x04: case 0x06: case 0x07: // SLLV... if (_tRd_ == reg && (_tRt_ == reg || _tRs_ == reg)) { delayReadWrite(reg, bpc); return; } else if (_tRt_ == reg || _tRs_ == reg) { delayRead(reg, bpc); return; } else if (_tRd_ == reg) { delayWrite(reg, bpc); return; } break; case 0x10: case 0x12: // MFHI/MFLO if (_tRd_ == reg) { delayWrite(reg, bpc); return; } break; case 0x11: case 0x13: // MTHI/MTLO if (_tRs_ == reg) { delayRead(reg, bpc); return; } break; case 0x18: case 0x19: case 0x1a: case 0x1b: // MULT/DIV... if (_tRt_ == reg || _tRs_ == reg) { delayRead(reg, bpc); return; } break; } break; case 0x01: // REGIMM switch (_tRt_) { case 0x00: case 0x02: case 0x10: case 0x12: // BLTZ/BGEZ... if (_tRs_ == reg) { delayRead(reg, bpc); return; } break; } break; // J would be just a break; case 0x03: // JAL if (31 == reg) { delayWrite(reg, bpc); return; } break; case 0x04: case 0x05: // BEQ/BNE if (_tRs_ == reg || _tRt_ == reg) { delayRead(reg, bpc); return; } break; case 0x06: case 0x07: // BLEZ/BGTZ if (_tRs_ == reg) { delayRead(reg, bpc); return; } break; case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: // ADDI/ADDIU... if (_tRt_ == reg && _tRs_ == reg) { delayReadWrite(reg, bpc); return; } else if (_tRs_ == reg) { delayRead(reg, bpc); return; } else if (_tRt_ == reg) { delayWrite(reg, bpc); return; } break; case 0x0f: // LUI if (_tRt_ == reg) { delayWrite(reg, bpc); return; } break; case 0x10: // COP0 switch (_tFunct_) { case 0x00: // MFC0 if (_tRt_ == reg) { delayWrite(reg, bpc); return; } break; case 0x02: // CFC0 if (_tRt_ == reg) { delayWrite(reg, bpc); return; } break; case 0x04: // MTC0 if (_tRt_ == reg) { delayRead(reg, bpc); return; } break; case 0x06: // CTC0 if (_tRt_ == reg) { delayRead(reg, bpc); return; } break; // RFE just a break; } break; case 0x22: case 0x26: // LWL/LWR if (_tRt_ == reg) { delayReadWrite(reg, bpc); return; } else if (_tRs_ == reg) { delayRead(reg, bpc); return; } break; case 0x20: case 0x21: case 0x23: case 0x24: case 0x25: // LB/LH/LW/LBU/LHU if (_tRt_ == reg && _tRs_ == reg) { delayReadWrite(reg, bpc); return; } else if (_tRs_ == reg) { delayRead(reg, bpc); return; } else if (_tRt_ == reg) { delayWrite(reg, bpc); return; } break; case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2e: // SB/SH/SWL/SW/SWR if (_tRt_ == reg || _tRs_ == reg) { delayRead(reg, bpc); return; } break; case 0x32: case 0x3a: // LWC2/SWC2 if (_tRs_ == reg) { delayRead(reg, bpc); return; } break; } psxBSC[upse_r3000_cpu_regs.code >> 26] (); branch = 0; upse_r3000_cpu_regs.pc = bpc; psxBranchTest(); } static void psxNULL(void); static INLINE void doBranch(u32 tar) { u32 tmp; branch2 = branch = 1; branchPC = tar; upse_r3000_cpu_regs.code = BFLIP32(PSXMu32(upse_r3000_cpu_regs.pc)); upse_r3000_cpu_regs.pc += 4; upse_r3000_cpu_regs.cycle++; // check for load delay tmp = upse_r3000_cpu_regs.code >> 26; switch (tmp) { case 0x10: // COP0 switch (_Rs_) { case 0x00: // MFC0 case 0x02: // CFC0 psxDelayTest(_Rt_, branchPC); return; } break; case 0x32: // LWC2 psxDelayTest(_Rt_, branchPC); return; default: if (tmp >= 0x20 && tmp <= 0x26) { // LB/LH/LWL/LW/LBU/LHU/LWR psxDelayTest(_Rt_, branchPC); return; } break; } psxBSC[upse_r3000_cpu_regs.code >> 26] (); if ((upse_r3000_cpu_regs.pc - 8) == branchPC && !(upse_r3000_cpu_regs.code >> 26)) { //printf("%08x\n",upse_r3000_cpu_regs.code>>26); CounterDeadLoopSkip(); } branch = 0; upse_r3000_cpu_regs.pc = branchPC; psxBranchTest(); } /********************************************************* * Arithmetic with immediate operand * * Format: OP rt, rs, immediate * *********************************************************/ static void psxADDI() { if (!_Rt_) return; _rRt_ = _u32(_rRs_) + _Imm_; } // Rt = Rs + Im (Exception on Integer Overflow) static void psxADDIU() { if (!_Rt_) return; _rRt_ = _u32(_rRs_) + _Imm_; } // Rt = Rs + Im static void psxANDI() { if (!_Rt_) return; _rRt_ = _u32(_rRs_) & _ImmU_; } // Rt = Rs And Im static void psxORI() { if (!_Rt_) return; _rRt_ = _u32(_rRs_) | _ImmU_; } // Rt = Rs Or Im static void psxXORI() { if (!_Rt_) return; _rRt_ = _u32(_rRs_) ^ _ImmU_; } // Rt = Rs Xor Im static void psxSLTI() { if (!_Rt_) return; _rRt_ = _i32(_rRs_) < _Imm_; } // Rt = Rs < Im (Signed) static void psxSLTIU() { if (!_Rt_) return; _rRt_ = _u32(_rRs_) < ((u32) _ImmU_); } // Rt = Rs < Im (Unsigned) /********************************************************* * Register arithmetic * * Format: OP rd, rs, rt * *********************************************************/ static void psxADD() { if (!_Rd_) return; _rRd_ = _u32(_rRs_) + _u32(_rRt_); } // Rd = Rs + Rt (Exception on Integer Overflow) static void psxADDU() { if (!_Rd_) return; _rRd_ = _u32(_rRs_) + _u32(_rRt_); } // Rd = Rs + Rt static void psxSUB() { if (!_Rd_) return; _rRd_ = _u32(_rRs_) - _u32(_rRt_); } // Rd = Rs - Rt (Exception on Integer Overflow) static void psxSUBU() { if (!_Rd_) return; _rRd_ = _u32(_rRs_) - _u32(_rRt_); } // Rd = Rs - Rt static void psxAND() { if (!_Rd_) return; _rRd_ = _u32(_rRs_) & _u32(_rRt_); } // Rd = Rs And Rt static void psxOR() { if (!_Rd_) return; _rRd_ = _u32(_rRs_) | _u32(_rRt_); } // Rd = Rs Or Rt static void psxXOR() { if (!_Rd_) return; _rRd_ = _u32(_rRs_) ^ _u32(_rRt_); } // Rd = Rs Xor Rt static void psxNOR() { if (!_Rd_) return; _rRd_ = ~(_u32(_rRs_) | _u32(_rRt_)); } // Rd = Rs Nor Rt static void psxSLT() { if (!_Rd_) return; _rRd_ = _i32(_rRs_) < _i32(_rRt_); } // Rd = Rs < Rt (Signed) static void psxSLTU() { if (!_Rd_) return; _rRd_ = _u32(_rRs_) < _u32(_rRt_); } // Rd = Rs < Rt (Unsigned) /********************************************************* * Register mult/div & Register trap logic * * Format: OP rs, rt * *********************************************************/ static void psxDIV() { if (_i32(_rRt_) != 0) { _rLo_ = _i32(_rRs_) / _i32(_rRt_); _rHi_ = _i32(_rRs_) % _i32(_rRt_); } } static void psxDIVU() { if (_rRt_ != 0) { _rLo_ = _rRs_ / _rRt_; _rHi_ = _rRs_ % _rRt_; } } static void psxMULT() { u64 res = (s64) ((s64) _i32(_rRs_) * (s64) _i32(_rRt_)); upse_r3000_cpu_regs.GPR.n.lo = (u32) (res & 0xffffffff); upse_r3000_cpu_regs.GPR.n.hi = (u32) ((res >> 32) & 0xffffffff); } static void psxMULTU() { u64 res = (u64) ((u64) _u32(_rRs_) * (u64) _u32(_rRt_)); upse_r3000_cpu_regs.GPR.n.lo = (u32) (res & 0xffffffff); upse_r3000_cpu_regs.GPR.n.hi = (u32) ((res >> 32) & 0xffffffff); } /********************************************************* * Register branch logic * * Format: OP rs, offset * *********************************************************/ #define RepZBranchi32(op) if(_i32(_rRs_) op 0) doBranch(_BranchTarget_); #define RepZBranchLinki32(op) if(_i32(_rRs_) op 0) { _SetLink(31); doBranch(_BranchTarget_); } static void psxBGEZ() { RepZBranchi32(>=)} // Branch if Rs >= 0 static void psxBGEZAL() { RepZBranchLinki32(>=)} // Branch if Rs >= 0 and link static void psxBGTZ() { RepZBranchi32(>)} // Branch if Rs > 0 static void psxBLEZ() { RepZBranchi32(<=)} // Branch if Rs <= 0 static void psxBLTZ() { RepZBranchi32(<)} // Branch if Rs < 0 static void psxBLTZAL() { RepZBranchLinki32(<)} // Branch if Rs < 0 and link /********************************************************* * Shift arithmetic with constant shift * * Format: OP rd, rt, sa * *********************************************************/ static void psxSLL() { if (!_Rd_) return; _rRd_ = _u32(_rRt_) << _Sa_; } // Rd = Rt << sa static void psxSRA() { if (!_Rd_) return; _rRd_ = _i32(_rRt_) >> _Sa_; } // Rd = Rt >> sa (arithmetic) static void psxSRL() { if (!_Rd_) return; _rRd_ = _u32(_rRt_) >> _Sa_; } // Rd = Rt >> sa (logical) /********************************************************* * Shift arithmetic with variant register shift * * Format: OP rd, rt, rs * *********************************************************/ static void psxSLLV() { if (!_Rd_) return; _rRd_ = _u32(_rRt_) << _u32(_rRs_); } // Rd = Rt << rs static void psxSRAV() { if (!_Rd_) return; _rRd_ = _i32(_rRt_) >> _u32(_rRs_); } // Rd = Rt >> rs (arithmetic) static void psxSRLV() { if (!_Rd_) return; _rRd_ = _u32(_rRt_) >> _u32(_rRs_); } // Rd = Rt >> rs (logical) /********************************************************* * Load higher 16 bits of the first word in GPR with imm * * Format: OP rt, immediate * *********************************************************/ static void psxLUI() { if (!_Rt_) return; _rRt_ = upse_r3000_cpu_regs.code << 16; } // Upper halfword of Rt = Im /********************************************************* * Move from HI/LO to GPR * * Format: OP rd * *********************************************************/ static void psxMFHI() { if (!_Rd_) return; _rRd_ = _rHi_; } // Rd = Hi static void psxMFLO() { if (!_Rd_) return; _rRd_ = _rLo_; } // Rd = Lo /********************************************************* * Move to GPR to HI/LO & Register jump * * Format: OP rs * *********************************************************/ static void psxMTHI() { _rHi_ = _rRs_; } // Hi = Rs static void psxMTLO() { _rLo_ = _rRs_; } // Lo = Rs /********************************************************* * Special purpose instructions * * Format: OP * *********************************************************/ static void psxBREAK() { // Break exception - psx rom doens't handles this } static void psxSYSCALL() { upse_r3000_cpu_regs.pc -= 4; psxException(0x20, branch); } static void psxRFE() { upse_r3000_cpu_regs.CP0.n.Status = (upse_r3000_cpu_regs.CP0.n.Status & 0xfffffff0) | ((upse_r3000_cpu_regs.CP0.n.Status & 0x3c) >> 2); } /********************************************************* * Register branch logic * * Format: OP rs, rt, offset * *********************************************************/ #define RepBranchi32(op) if(_i32(_rRs_) op _i32(_rRt_)) { doBranch(_BranchTarget_); } static void psxBEQ() { RepBranchi32( ==)} // Branch if Rs == Rt static void psxBNE() { RepBranchi32(!=)} // Branch if Rs != Rt /********************************************************* * Jump to target * * Format: OP target * *********************************************************/ static void psxJ() { doBranch(_JumpTarget_); } static void psxJAL() { _SetLink(31); doBranch(_JumpTarget_); } /********************************************************* * Register jump * * Format: OP rs, rd * *********************************************************/ static void psxJR() { doBranch(_u32(_rRs_)); } static void psxJALR() { if (_Rd_) { _SetLink(_Rd_); } doBranch(_u32(_rRs_)); } /********************************************************* * Load and store for GPR * * Format: OP rt, offset(base) * *********************************************************/ #define _oB_ (_u32(_rRs_) + _Imm_) static void psxLB() { if (_Rt_) { _rRt_ = (s8) upse_ps1_memory_read_8(_oB_); } else { upse_ps1_memory_read_8(_oB_); } } static void psxLBU() { if (_Rt_) { _rRt_ = upse_ps1_memory_read_8(_oB_); } else { upse_ps1_memory_read_8(_oB_); } } static void psxLH() { if (_Rt_) { _rRt_ = (s16) upse_ps1_memory_read_16(_oB_); } else { upse_ps1_memory_read_16(_oB_); } } static void psxLHU() { if (_Rt_) { _rRt_ = upse_ps1_memory_read_16(_oB_); } else { upse_ps1_memory_read_16(_oB_); } } static void psxLW() { if (_Rt_) { _rRt_ = upse_ps1_memory_read_32(_oB_); } else { upse_ps1_memory_read_32(_oB_); } } static u32 LWL_MASK[4] = { 0xffffff, 0xffff, 0xff, 0 }; static u32 LWL_SHIFT[4] = { 24, 16, 8, 0 }; static void psxLWL() { u32 addr = _oB_; u32 shift = addr & 3; u32 mem = upse_ps1_memory_read_32(addr & ~3); if (!_Rt_) return; _rRt_ = (_u32(_rRt_) & LWL_MASK[shift]) | (mem << LWL_SHIFT[shift]); /* Mem = 1234. Reg = abcd 0 4bcd (mem << 24) | (reg & 0x00ffffff) 1 34cd (mem << 16) | (reg & 0x0000ffff) 2 234d (mem << 8) | (reg & 0x000000ff) 3 1234 (mem ) | (reg & 0x00000000) */ } static u32 LWR_MASK[4] = { 0, 0xff000000, 0xffff0000, 0xffffff00 }; static u32 LWR_SHIFT[4] = { 0, 8, 16, 24 }; static void psxLWR() { u32 addr = _oB_; u32 shift = addr & 3; u32 mem = upse_ps1_memory_read_32(addr & ~3); if (!_Rt_) return; _rRt_ = (_u32(_rRt_) & LWR_MASK[shift]) | (mem >> LWR_SHIFT[shift]); /* Mem = 1234. Reg = abcd 0 1234 (mem ) | (reg & 0x00000000) 1 a123 (mem >> 8) | (reg & 0xff000000) 2 ab12 (mem >> 16) | (reg & 0xffff0000) 3 abc1 (mem >> 24) | (reg & 0xffffff00) */ } static void psxSB() { upse_ps1_memory_write_8(_oB_, _u8(_rRt_)); } static void psxSH() { upse_ps1_memory_write_16(_oB_, _u16(_rRt_)); } static void psxSW() { upse_ps1_memory_write_32(_oB_, _u32(_rRt_)); } static const u32 SWL_MASK[4] = { 0xffffff00, 0xffff0000, 0xff000000, 0 }; static const u32 SWL_SHIFT[4] = { 24, 16, 8, 0 }; static void psxSWL() { u32 addr = _oB_; u32 shift = addr & 3; u32 mem = upse_ps1_memory_read_32(addr & ~3); upse_ps1_memory_write_32(addr & ~3, (_u32(_rRt_) >> SWL_SHIFT[shift]) | (mem & SWL_MASK[shift])); /* Mem = 1234. Reg = abcd 0 123a (reg >> 24) | (mem & 0xffffff00) 1 12ab (reg >> 16) | (mem & 0xffff0000) 2 1abc (reg >> 8) | (mem & 0xff000000) 3 abcd (reg ) | (mem & 0x00000000) */ } static const u32 SWR_MASK[4] = { 0, 0xff, 0xffff, 0xffffff }; static const u32 SWR_SHIFT[4] = { 0, 8, 16, 24 }; static void psxSWR() { u32 addr = _oB_; u32 shift = addr & 3; u32 mem = upse_ps1_memory_read_32(addr & ~3); upse_ps1_memory_write_32(addr & ~3, (_u32(_rRt_) << SWR_SHIFT[shift]) | (mem & SWR_MASK[shift])); /* Mem = 1234. Reg = abcd 0 abcd (reg ) | (mem & 0x00000000) 1 bcd4 (reg << 8) | (mem & 0x000000ff) 2 cd34 (reg << 16) | (mem & 0x0000ffff) 3 d234 (reg << 24) | (mem & 0x00ffffff) */ } /********************************************************* * Moves between GPR and COPx * * Format: OP rt, fs * *********************************************************/ static void psxMFC0() { if (!_Rt_) return; _rRt_ = (int) _rFs_; } static void psxCFC0() { if (!_Rt_) return; _rRt_ = (int) _rFs_; } static INLINE void MTC0(int reg, u32 val) { switch (reg) { case 13: // Cause upse_r3000_cpu_regs.CP0.n.Cause = val & ~(0xfc00); // the next code is untested, if u know please // tell me if it works ok or not (linuzappz) if (upse_r3000_cpu_regs.CP0.n.Cause & upse_r3000_cpu_regs.CP0.n.Status & 0x0300 && upse_r3000_cpu_regs.CP0.n.Status & 0x1) { psxException(upse_r3000_cpu_regs.CP0.n.Cause, 0); } break; default: upse_r3000_cpu_regs.CP0.r[reg] = val; break; } } static void psxMTC0() { MTC0(_Rd_, _u32(_rRt_)); } static void psxCTC0() { MTC0(_Rd_, _u32(_rRt_)); } /********************************************************* * Unknow instruction (would generate an exception) * * Format: ? * *********************************************************/ static void psxNULL() { #ifdef PSXCPU_LOG PSXCPU_LOG("psx: Unimplemented op %x\n", upse_r3000_cpu_regs.code); #endif } static void psxSPECIAL() { psxSPC[_Funct_] (); } static void psxREGIMM() { psxREG[_Rt_] (); } static void psxCOP0() { psxCP0[_Rs_] (); } static void psxHLE() { psxHLEt[upse_r3000_cpu_regs.code & 0xff] (); } static void (*psxBSC[64]) () = { psxSPECIAL, psxREGIMM, psxJ, psxJAL, psxBEQ, psxBNE, psxBLEZ, psxBGTZ, psxADDI, psxADDIU, psxSLTI, psxSLTIU, psxANDI, psxORI, psxXORI, psxLUI, psxCOP0, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxLB, psxLH, psxLWL, psxLW, psxLBU, psxLHU, psxLWR, psxNULL, psxSB, psxSH, psxSWL, psxSW, psxNULL, psxNULL, psxSWR, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxHLE, psxNULL, psxNULL, psxNULL, psxNULL}; static void (*psxSPC[64]) () = { psxSLL, psxNULL, psxSRL, psxSRA, psxSLLV, psxNULL, psxSRLV, psxSRAV, psxJR, psxJALR, psxNULL, psxNULL, psxSYSCALL, psxBREAK, psxNULL, psxNULL, psxMFHI, psxMTHI, psxMFLO, psxMTLO, psxNULL, psxNULL, psxNULL, psxNULL, psxMULT, psxMULTU, psxDIV, psxDIVU, psxNULL, psxNULL, psxNULL, psxNULL, psxADD, psxADDU, psxSUB, psxSUBU, psxAND, psxOR, psxXOR, psxNOR, psxNULL, psxNULL, psxSLT, psxSLTU, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL}; static void (*psxREG[32]) () = { psxBLTZ, psxBGEZ, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxBLTZAL, psxBGEZAL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL}; static void (*psxCP0[32]) () = { psxMFC0, psxNULL, psxCFC0, psxNULL, psxMTC0, psxNULL, psxCTC0, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxRFE, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL}; /////////////////////////////////////////// int upse_r3000_cpu_init(void) { return 0; } void upse_r3000_cpu_reset(void) { branch = branch2 = 0; } void upse_r3000_cpu_execute(void) { for (;;) { if (!CounterSPURun()) { psxShutdown(); return; } upse_ps1_spu_finalize(); execI(); } } void upse_r3000_cpu_execute_block(void) { branch2 = 0; while (!branch2) execI(); } void upse_r3000_cpu_clear(u32 Addr, u32 Size) { } void upse_r3000_cpu_shutdown(void) { } upse-1.0.0/src/libupse/upse_util.c0000644000175000017500000000153311006314306016745 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_util.c * Purpose: libupse: utility functions * * Copyright (c) 2007 William Pitcock * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #define _ISOC99_SOURCE #include #include #include #include #include "upse-internal.h" #include "upse.h" #include "upse-string.h" void upse_execute(void) { _ENTER; upse_r3000_cpu_execute(); _LEAVE; } float upse_strtof(const char *value) { float val; _ENTER; val = strtof(value, NULL); _LEAVE; return val; } upse-1.0.0/src/libupse/upse_ps1_counters.c0000644000175000017500000001530611006314306020420 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_ps1_counters.c * Purpose: libupse: PS1 timekeeping implementation * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include #include "upse-internal.h" psxCounter psxCounters[5]; u32 psxNextCounter, psxNextsCounter; static int cnts = 4; static u32 last = 0; static void psxRcntUpd(u32 index) { psxCounters[index].sCycle = upse_r3000_cpu_regs.cycle; if (((!(psxCounters[index].mode & 1)) || (index != 2)) && psxCounters[index].mode & 0x30) { if (psxCounters[index].mode & 0x10) { // Interrupt on target psxCounters[index].Cycle = ((psxCounters[index].target - psxCounters[index].count) * psxCounters[index].rate) / BIAS; } else { // Interrupt on 0xffff psxCounters[index].Cycle = ((0xffff - psxCounters[index].count) * psxCounters[index].rate) / BIAS; } } else psxCounters[index].Cycle = 0xffffffff; } static void psxRcntReset(u32 index) { psxCounters[index].count = 0; psxRcntUpd(index); psxHu32(0x1070) |= BFLIP32(psxCounters[index].interrupt); if (!(psxCounters[index].mode & 0x40)) { // Only 1 interrupt psxCounters[index].Cycle = 0xffffffff; } } static void psxRcntSet() { int i; psxNextCounter = 0x7fffffff; psxNextsCounter = upse_r3000_cpu_regs.cycle; for (i = 0; i < cnts; i++) { s32 count; if (psxCounters[i].Cycle == 0xffffffff) continue; count = psxCounters[i].Cycle - (upse_r3000_cpu_regs.cycle - psxCounters[i].sCycle); if (count < 0) { psxNextCounter = 0; break; } if (count < (s32) psxNextCounter) { psxNextCounter = count; } } } void psxRcntInit() { memset(psxCounters, 0, sizeof(psxCounters)); psxCounters[0].rate = 1; psxCounters[0].interrupt = 0x10; psxCounters[1].rate = 1; psxCounters[1].interrupt = 0x20; psxCounters[2].rate = 1; psxCounters[2].interrupt = 64; psxCounters[3].interrupt = 1; psxCounters[3].mode = 0x58; // The VSync counter mode psxCounters[3].target = 1; psxUpdateVSyncRate(); cnts = 4; psxRcntUpd(0); psxRcntUpd(1); psxRcntUpd(2); psxRcntUpd(3); psxRcntSet(); last = 0; } int CounterSPURun(void) { u32 cycles; if (upse_r3000_cpu_regs.cycle < last) { cycles = 0xFFFFFFFF - last; cycles += upse_r3000_cpu_regs.cycle; } else cycles = upse_r3000_cpu_regs.cycle - last; if (cycles >= 16) { if (!upse_ps1_spu_render(cycles)) return (0); last = upse_r3000_cpu_regs.cycle; } return (1); } /* Set by spu irq stuff in spu code to number of cpu cycles to back up(if necessary). Very crazy hack. Eh, not implemented. Hmm. TODO! */ s32 spuirqvoodoo = -1; void CounterDeadLoopSkip() { s32 min, x, lmin; lmin = 0x7FFFFFFF; for (x = 0; x < 4; x++) { if (psxCounters[x].Cycle != 0xffffffff) { min = psxCounters[x].Cycle; min -= (upse_r3000_cpu_regs.cycle - psxCounters[x].sCycle); if (min < lmin) lmin = min; // if(min<0) exit(); // printf("Poo: %d, ",min); } } if (lmin > 0) { // printf("skip %u\n",lmin); upse_r3000_cpu_regs.cycle += lmin; } } void psxUpdateVSyncRate() { //if (Config.PsxType) // ntsc - 0 | pal - 1 // psxCounters[3].rate = (PSXCLK / 50);// / BIAS; //else psxCounters[3].rate = (PSXCLK / 60); // / BIAS; } void psxRcntUpdate() { if ((upse_r3000_cpu_regs.cycle - psxCounters[3].sCycle) >= psxCounters[3].Cycle) { //printf("%d\n",(upse_r3000_cpu_regs.cycle - psxCounters[3].sCycle)- psxCounters[3].Cycle); psxRcntUpd(3); psxHu32(0x1070) |= BFLIP32(1); } if ((upse_r3000_cpu_regs.cycle - psxCounters[0].sCycle) >= psxCounters[0].Cycle) { psxRcntReset(0); } if ((upse_r3000_cpu_regs.cycle - psxCounters[1].sCycle) >= psxCounters[1].Cycle) { psxRcntReset(1); } if ((upse_r3000_cpu_regs.cycle - psxCounters[2].sCycle) >= psxCounters[2].Cycle) { psxRcntReset(2); } psxRcntSet(); } void psxRcntWcount(u32 index, u32 value) { psxCounters[index].count = value; psxRcntUpd(index); psxRcntSet(); } void psxRcntWmode(u32 index, u32 value) { psxCounters[index].mode = value; psxCounters[index].count = 0; if (index == 0) { switch (value & 0x300) { case 0x100: psxCounters[index].rate = ((psxCounters[3].rate /** BIAS*/ ) / 386) / 262; // seems ok break; default: psxCounters[index].rate = 1; } } else if (index == 1) { switch (value & 0x300) { case 0x100: psxCounters[index].rate = (psxCounters[3].rate /** BIAS*/ ) / 262; // seems ok //psxCounters[index].rate = (PSXCLK / 60)/262; //(psxCounters[3].rate*16/262); //printf("%d\n",psxCounters[index].rate); break; default: psxCounters[index].rate = 1; } } else if (index == 2) { switch (value & 0x300) { case 0x200: psxCounters[index].rate = 8; // 1/8 speed break; default: psxCounters[index].rate = 1; // normal speed } } // Need to set a rate and target psxRcntUpd(index); psxRcntSet(); } void psxRcntWtarget(u32 index, u32 value) { // SysPrintf("writeCtarget[%ld] = %lx\n", index, value); psxCounters[index].target = value; psxRcntUpd(index); psxRcntSet(); } u32 psxRcntRcount(u32 index) { u32 ret; // if ((!(psxCounters[index].mode & 1)) || (index!=2)) { if (psxCounters[index].mode & 0x08) { // Wrap at target //if (Config.RCntFix) { // Parasite Eve 2 // ret = (psxCounters[index].count + /*BIAS **/ ((upse_r3000_cpu_regs.cycle - psxCounters[index].sCycle) / psxCounters[index].rate)) & 0xffff; //} else { ret = (psxCounters[index].count + BIAS * ((upse_r3000_cpu_regs.cycle - psxCounters[index].sCycle) / psxCounters[index].rate)) & 0xffff; //} } else { // Wrap at 0xffff ret = (psxCounters[index].count + BIAS * (upse_r3000_cpu_regs.cycle / psxCounters[index].rate)) & 0xffff; //if (Config.RCntFix) { // Vandal Hearts 1/2 // ret/= 16; //} } // return (psxCounters[index].count + BIAS * ((upse_r3000_cpu_regs.cycle - psxCounters[index].sCycle) / psxCounters[index].rate)) & 0xffff; // } else return 0; // SysPrintf("readCcount[%ld] = %lx (mode %lx, target %lx, cycle %lx)\n", index, ret, psxCounters[index].mode, psxCounters[index].target, upse_r3000_cpu_regs.cycle); return ret; } upse-1.0.0/src/libupse/upse_bios_manager.c0000644000175000017500000000134211006314306020414 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_bios_manager.c * Purpose: libupse: BIOS management functions. * * Copyright (c) 2008 William Pitcock * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include "upse-internal.h" static const char *bios_ = NULL; int upse_has_custom_bios(void) { return bios_ != NULL; } const char * upse_get_custom_bios(void) { return bios_; } void upse_set_custom_bios(const char *bios) { bios_ = bios; } upse-1.0.0/src/libupse/upse-ps1-gpu.h0000644000175000017500000000126111006314306017205 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-ps1-gpu.h * Purpose: libupse: PS1 bogus GPU emulator (for lame replayers) * * Copyright (c) 2008 William Pitcock * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef __UPSE__LIBUPSE__UPSE_PS1_GPU_H__GUARD #define __UPSE__LIBUPSE__UPSE_PS1_GPU_H__GUARD extern void upse_ps1_gpu_set_status(u32 cmd); extern u32 upse_ps1_gpu_get_status(void); #endif upse-1.0.0/src/libupse/upse_ps1_spu_dma_handler.c0000644000175000017500000000407711006314306021706 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_ps1_spu_dma_handler.c * Purpose: libupse: PS1 SPU DMA handling engine * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 2002 Pete Bernert * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #define _IN_DMA #include "upse-types.h" #include "upse-internal.h" #include "upse-ps1-spu-base.h" #include "upse-spu-internal.h" #include "upse.h" #include "upse-ps1-memory-manager.h" //////////////////////////////////////////////////////////////////////// // READ DMA (many values) //////////////////////////////////////////////////////////////////////// void SPUreadDMAMem(u32 usPSXMem, int iSize) { int i; for (i = 0; i < iSize; i++) { *(u16 *) PSXM(usPSXMem) = spuMem[spuAddr >> 1]; // spu addr got by writeregister usPSXMem += 2; spuAddr += 2; // inc spu addr if (spuAddr > 0x7ffff) spuAddr = 0; // wrap } } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // to investigate: do sound data updates by writedma affect spu // irqs? Will an irq be triggered, if new data is written to // the memory irq address? //////////////////////////////////////////////////////////////////////// // WRITE DMA (many values) //////////////////////////////////////////////////////////////////////// void SPUwriteDMAMem(u32 usPSXMem, int iSize) { int i; for (i = 0; i < iSize; i++) { spuMem[spuAddr >> 1] = *(u16 *) PSXM(usPSXMem); usPSXMem += 2; // spu addr got by writeregister spuAddr += 2; // inc spu addr if (spuAddr > 0x7ffff) spuAddr = 0; // wrap } } //////////////////////////////////////////////////////////////////////// upse-1.0.0/src/libupse/upse-ps1-memory-manager.h0000644000175000017500000000454111006314306021336 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-ps1-memory-manager.h * Purpose: libupse: UPSE PS1 Memory Manager headers * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include "config.h" #ifndef _UPSE__LIBUPSE__UPSE_PS1_MEMORY_MANAGER_H__GUARD #define _UPSE__LIBUPSE__UPSE_PS1_MEMORY_MANAGER_H__GUARD #ifdef WORDS_BIGENDIAN static INLINE u16 BFLIP16(u16 x) { return (((x >> 8) & 0xFF) | ((x & 0xFF) << 8)); } static INLINE u32 BFLIP32(u32 x) { return (((x >> 24) & 0xFF) | ((x >> 8) & 0xFF00) | ((x << 8) & 0xFF0000) | ((x << 24) & 0xFF000000)); } #else static INLINE u16 BFLIP16(u16 x) { return x; } static INLINE u32 BFLIP32(u32 x) { return x; } #endif static INLINE s32 BFLIP32S(s32 x) { return (s32) BFLIP32((u32) x); } static INLINE s16 BFLIP16S(s16 x) { return (s16) BFLIP16((u16) x); } extern char *psxM; #define psxMu32(mem) (*(u32*)&psxM[(mem) & 0x1fffff]) extern char *psxP; extern char *psxR; #define psxRu32(mem) (*(u32*)&psxR[(mem) & 0x7ffff]) extern char *psxH; #define psxHu8(mem) (*(u8*) &psxH[(mem) & 0xffff]) #define psxHu16(mem) (*(u16*)&psxH[(mem) & 0xffff]) #define psxHu32(mem) (*(u32*)&psxH[(mem) & 0xffff]) extern char **upse_ps1_memory_LUT; #define PSXM(mem) (upse_ps1_memory_LUT[(mem) >> 16] == 0 ? NULL : (void*)(upse_ps1_memory_LUT[(mem) >> 16] + ((mem) & 0xffff))) #define PSXMu8(mem) (*(u8 *)PSXM(mem)) #define PSXMu32(mem) (*(u32*)PSXM(mem)) #define PSXMuR8(mem) (PSXM(mem)?PSXMu8(mem):0) #define PSXMuW8(mem,val) (PSXM(mem)?PSXMu8(mem)=val:;) int upse_ps1_memory_init(); void upse_ps1_memory_reset(); void upse_ps1_memory_shutdown(); u8 upse_ps1_memory_read_8(u32 mem); u16 upse_ps1_memory_read_16(u32 mem); u32 upse_ps1_memory_read_32(u32 mem); void upse_ps1_memory_write_8(u32 mem, u8 value); void upse_ps1_memory_write_16(u32 mem, u16 value); void upse_ps1_memory_write_32(u32 mem, u32 value); void LoadPSXMem(u32 address, s32 length, unsigned char *data); #endif /* __PSXMEMORY_H__ */ upse-1.0.0/src/libupse/upse-ps1-bios-private.h0000644000175000017500000000434511006314306021024 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse-ps1-bios-private.h * Purpose: libupse: UPSE PS1 FakeBIOS private defines/functions * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef _UPSE__LIBUPSE__UPSE_PS1_BIOS_PRIVATE_H__GUARD #define _UPSE__LIBUPSE__UPSE_PS1_BIOS_PRIVATE_H__GUARD //#define r0 (upse_r3000_cpu_regs.GPR.n.r0) #define at (upse_r3000_cpu_regs.GPR.n.at) #define v0 (upse_r3000_cpu_regs.GPR.n.v0) #define v1 (upse_r3000_cpu_regs.GPR.n.v1) #define a0 (upse_r3000_cpu_regs.GPR.n.a0) #define a1 (upse_r3000_cpu_regs.GPR.n.a1) #define a2 (upse_r3000_cpu_regs.GPR.n.a2) #define a3 (upse_r3000_cpu_regs.GPR.n.a3) #define t0 (upse_r3000_cpu_regs.GPR.n.t0) #define t1 (upse_r3000_cpu_regs.GPR.n.t1) #define t2 (upse_r3000_cpu_regs.GPR.n.t2) #define t3 (upse_r3000_cpu_regs.GPR.n.t3) #define t4 (upse_r3000_cpu_regs.GPR.n.t4) #define t5 (upse_r3000_cpu_regs.GPR.n.t5) #define t6 (upse_r3000_cpu_regs.GPR.n.t6) #define t7 (upse_r3000_cpu_regs.GPR.n.t7) #define s0 (upse_r3000_cpu_regs.GPR.n.s0) #define s1 (upse_r3000_cpu_regs.GPR.n.s1) #define s2 (upse_r3000_cpu_regs.GPR.n.s2) #define s3 (upse_r3000_cpu_regs.GPR.n.s3) #define s4 (upse_r3000_cpu_regs.GPR.n.s4) #define s5 (upse_r3000_cpu_regs.GPR.n.s5) #define s6 (upse_r3000_cpu_regs.GPR.n.s6) #define s7 (upse_r3000_cpu_regs.GPR.n.s7) #define t8 (upse_r3000_cpu_regs.GPR.n.t6) #define t9 (upse_r3000_cpu_regs.GPR.n.t7) #define k0 (upse_r3000_cpu_regs.GPR.n.k0) #define k1 (upse_r3000_cpu_regs.GPR.n.k1) #define gp (upse_r3000_cpu_regs.GPR.n.gp) #define sp (upse_r3000_cpu_regs.GPR.n.sp) #define fp (upse_r3000_cpu_regs.GPR.n.s8) #define ra (upse_r3000_cpu_regs.GPR.n.ra) #define pc0 (upse_r3000_cpu_regs.pc) #define Ra0 ((char*)PSXM(a0)) #define Ra1 ((char*)PSXM(a1)) #define Ra2 ((char*)PSXM(a2)) #define Ra3 ((char*)PSXM(a3)) #define Rv0 ((char*)PSXM(v0)) #define Rsp ((char*)PSXM(sp)) #endif upse-1.0.0/src/libupse/upse_r3000_abstract.c0000644000175000017500000000510611006314306020417 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_r3000_abstract.c * Purpose: libupse: r3K abstract implementation factory * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include #include #include #include "upse-internal.h" upse_r3000_cpu_registers_t upse_r3000_cpu_regs; int psxInit() { if (upse_ps1_memory_init() == -1) return -1; return upse_r3000_cpu_init(); } void psxReset() { upse_r3000_cpu_reset(); upse_ps1_memory_reset(); memset(&upse_r3000_cpu_regs, 0, sizeof(upse_r3000_cpu_regs)); upse_r3000_cpu_regs.pc = 0xbfc00000; // Start in bootstrap upse_r3000_cpu_regs.CP0.r[12] = 0x10900000; // COP0 enabled | BEV = 1 | TS = 1 upse_r3000_cpu_regs.CP0.r[15] = 0x00000002; // PRevID = Revision ID, same as R3000A upse_ps1_hal_reset(); upse_ps1_bios_init(); /* start up the bios */ if (upse_has_custom_bios()) psxExecuteBios(); } void psxShutdown() { upse_ps1_memory_shutdown(); upse_ps1_bios_shutdown(); upse_r3000_cpu_shutdown(); upse_ps1_spu_close(); } void psxException(u32 code, u32 bd) { // Set the Cause upse_r3000_cpu_regs.CP0.n.Cause = code; #ifdef PSXCPU_LOG if (bd) PSXCPU_LOG("bd set\n"); #endif // Set the EPC & PC if (bd) { upse_r3000_cpu_regs.CP0.n.Cause |= 0x80000000; upse_r3000_cpu_regs.CP0.n.EPC = (upse_r3000_cpu_regs.pc - 4); } else upse_r3000_cpu_regs.CP0.n.EPC = (upse_r3000_cpu_regs.pc); if (upse_r3000_cpu_regs.CP0.n.Status & 0x400000) upse_r3000_cpu_regs.pc = 0xbfc00180; else upse_r3000_cpu_regs.pc = 0x80000080; // Set the Status upse_r3000_cpu_regs.CP0.n.Status = (upse_r3000_cpu_regs.CP0.n.Status & ~0x3f) | ((upse_r3000_cpu_regs.CP0.n.Status & 0xf) << 2); if (!upse_has_custom_bios()) upse_ps1_bios_exception(); } void psxBranchTest() { if ((upse_r3000_cpu_regs.cycle - psxNextsCounter) >= psxNextCounter) psxRcntUpdate(); if (psxHu32(0x1070) & psxHu32(0x1074)) { if ((upse_r3000_cpu_regs.CP0.n.Status & 0x401) == 0x401) { psxException(0x400, 0); } } } void psxExecuteBios() { while (upse_r3000_cpu_regs.pc != 0x80030000) upse_r3000_cpu_execute_block(); } upse-1.0.0/src/libupse/upse-ps1-spu-abstract.h0000644000175000017500000000224111006314306021021 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_util.c * Purpose: libupse: PS1 SPU abstraction * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #ifndef _UPSE__LIBUPSE__UPSE_PS1_SPU_ABSTRACT_H__GUARD #define _UPSE__LIBUPSE__UPSE_PS1_SPU_ABSTRACT_H__GUARD #define H_SPUirqAddr 0x0da4 #define H_SPUaddr 0x0da6 #define H_SPUdata 0x0da8 #define H_SPUctrl 0x0daa #define H_SPUstat 0x0dae #define H_SPUon1 0x0d88 #define H_SPUon2 0x0d8a #define H_SPUoff1 0x0d8c #define H_SPUoff2 0x0d8e void SPUirq(void); u16 SPUreadRegister(u32 reg); void SPUwriteRegister(u32 reg, u16 val); int upse_ps1_spu_render(u32 cycle); void SPUwriteDMAMem(u32 usPSXMem, int iSize); void SPUreadDMAMem(u32 usPSXMem, int iSize); #endif upse-1.0.0/src/libupse/upse-ps1-spu-dma-handler.h0000644000175000017500000000304211006314306021372 0ustar nenolodnenolod/*************************************************************************** dma.h - description ------------------- begin : Wed May 15 2002 copyright : (C) 2002 by Pete Bernert email : BlackDove@addcom.de ***************************************************************************/ /*************************************************************************** * * * 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. See also the license.txt file for * * additional informations. * * * ***************************************************************************/ //*************************************************************************// // History of changes: // // 2002/05/15 - Pete // - generic cleanup for the Peops release // //*************************************************************************// u16 CALLBACK SPUreadDMA(void); void CALLBACK SPUreadDMAMem(u16 * pusPSXMem, int iSize); void CALLBACK SPUwriteDMA(u16 val); void CALLBACK SPUwriteDMAMem(u16 * pusPSXMem, int iSize); upse-1.0.0/src/libupse/upse_ps1_bios_base.c0000644000175000017500000010126511006314306020504 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse_ps1_bios_base.c * Purpose: libupse: UPSE PS1 FakeBIOS base code * * Copyright (c) 2007 William Pitcock * Portions copyright (c) 1999-2002 Pcsx Team * Portions copyright (c) 2004 "Xodnizel" * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include #include #include #include #include #include "upse-internal.h" #include "upse-ps1-bios-private.h" //We try to emulate bios :) HELP US :P /* *INDENT-OFF* */ char *biosA0n[256] = { // 0x00 "open", "lseek", "read", "write", "close", "ioctl", "exit", "sys_a0_07", "getc", "putc", "todigit", "atof", "strtoul", "strtol", "abs", "labs", // 0x10 "atoi", "atol", "atob", "setjmp", "longjmp", "strcat", "strncat", "strcmp", "strncmp", "strcpy", "strncpy", "strlen", "index", "rindex", "strchr", "strrchr", // 0x20 "strpbrk", "strspn", "strcspn", "strtok", "strstr", "toupper", "tolower", "bcopy", "bzero", "bcmp", "memcpy", "memset", "memmove", "memcmp", "memchr", "rand", // 0x30 "srand", "qsort", "strtod", "malloc", "free", "lsearch", "bsearch", "calloc", "realloc", "InitHeap", "_exit", "getchar", "putchar", "gets", "puts", "printf", // 0x40 "sys_a0_40", "LoadTest", "Load", "Exec", "FlushCache", "InstallInterruptHandler", "GPU_dw", "mem2vram", "SendGPUStatus", "GPU_cw", "GPU_cwb", "SendPackets", "sys_a0_4c", "GetGPUStatus", "GPU_sync", "sys_a0_4f", // 0x50 "sys_a0_50", "LoadExec", "GetSysSp", "sys_a0_53", "_96_init()", "_bu_init()", "_96_remove()", "sys_a0_57", "sys_a0_58", "sys_a0_59", "sys_a0_5a", "dev_tty_init", "dev_tty_open", "sys_a0_5d", "dev_tty_ioctl","dev_cd_open", // 0x60 "dev_cd_read", "dev_cd_close", "dev_cd_firstfile", "dev_cd_nextfile", "dev_cd_chdir", "dev_card_open", "dev_card_read", "dev_card_write", "dev_card_close", "dev_card_firstfile", "dev_card_nextfile","dev_card_erase", "dev_card_undelete","dev_card_format", "dev_card_rename", "dev_card_6f", // 0x70 "_bu_init", "_96_init", "_96_remove", "sys_a0_73", "sys_a0_74", "sys_a0_75", "sys_a0_76", "sys_a0_77", "_96_CdSeekL", "sys_a0_79", "sys_a0_7a", "sys_a0_7b", "_96_CdGetStatus", "sys_a0_7d", "_96_CdRead", "sys_a0_7f", // 0x80 "sys_a0_80", "sys_a0_81", "sys_a0_82", "sys_a0_83", "sys_a0_84", "_96_CdStop", "sys_a0_86", "sys_a0_87", "sys_a0_88", "sys_a0_89", "sys_a0_8a", "sys_a0_8b", "sys_a0_8c", "sys_a0_8d", "sys_a0_8e", "sys_a0_8f", // 0x90 "sys_a0_90", "sys_a0_91", "sys_a0_92", "sys_a0_93", "sys_a0_94", "sys_a0_95", "AddCDROMDevice", "AddMemCardDevide", "DisableKernelIORedirection", "EnableKernelIORedirection", "sys_a0_9a", "sys_a0_9b", "SetConf", "GetConf", "sys_a0_9e", "SetMem", // 0xa0 "_boot", "SystemError", "EnqueueCdIntr", "DequeueCdIntr", "sys_a0_a4", "ReadSector", "get_cd_status", "bufs_cb_0", "bufs_cb_1", "bufs_cb_2", "bufs_cb_3", "_card_info", "_card_load", "_card_auto", "bufs_cd_4", "sys_a0_af", // 0xb0 "sys_a0_b0", "sys_a0_b1", "do_a_long_jmp", "sys_a0_b3", "?? sub_function", }; char *biosB0n[256] = { // 0x00 "SysMalloc", "sys_b0_01", "sys_b0_02", "sys_b0_03", "sys_b0_04", "sys_b0_05", "sys_b0_06", "DeliverEvent", "OpenEvent", "CloseEvent", "WaitEvent", "TestEvent", "EnableEvent", "DisableEvent", "OpenTh", "CloseTh", // 0x10 "ChangeTh", "sys_b0_11", "InitPAD", "StartPAD", "StopPAD", "PAD_init", "PAD_dr", "ReturnFromException", "ResetEntryInt", "HookEntryInt", "sys_b0_1a", "sys_b0_1b", "sys_b0_1c", "sys_b0_1d", "sys_b0_1e", "sys_b0_1f", // 0x20 "UnDeliverEvent", "sys_b0_21", "sys_b0_22", "sys_b0_23", "sys_b0_24", "sys_b0_25", "sys_b0_26", "sys_b0_27", "sys_b0_28", "sys_b0_29", "sys_b0_2a", "sys_b0_2b", "sys_b0_2c", "sys_b0_2d", "sys_b0_2e", "sys_b0_2f", // 0x30 "sys_b0_30", "sys_b0_31", "open", "lseek", "read", "write", "close", "ioctl", "exit", "sys_b0_39", "getc", "putc", "getchar", "putchar", "gets", "puts", // 0x40 "cd", "format", "firstfile", "nextfile", "rename", "delete", "undelete", "AddDevice", "RemoteDevice", "PrintInstalledDevices", "InitCARD", "StartCARD", "StopCARD", "sys_b0_4d", "_card_write", "_card_read", // 0x50 "_new_card", "Krom2RawAdd", "sys_b0_52", "sys_b0_53", "_get_errno", "_get_error", "GetC0Table", "GetB0Table", "_card_chan", "sys_b0_59", "sys_b0_5a", "ChangeClearPAD", "_card_status", "_card_wait", }; char *biosC0n[256] = { // 0x00 "InitRCnt", "InitException", "SysEnqIntRP", "SysDeqIntRP", "get_free_EvCB_slot", "get_free_TCB_slot", "ExceptionHandler", "InstallExeptionHandler", "SysInitMemory", "SysInitKMem", "ChangeClearRCnt", "SystemError", "InitDefInt", "sys_c0_0d", "sys_c0_0e", "sys_c0_0f", // 0x10 "sys_c0_10", "sys_c0_11", "InstallDevices", "FlushStfInOutPut", "sys_c0_14", "_cdevinput", "_cdevscan", "_circgetc", "_circputc", "ioabort", "sys_c0_1a", "KernelRedirect", "PatchAOTable", }; /* *INDENT-ON* */ typedef struct _malloc_chunk { u32 stat; u32 size; u32 fd; u32 bk; } upse_packed_t malloc_chunk; #define INUSE 0x1 typedef struct { u32 desc; s32 status; s32 mode; u32 fhandler; } upse_packed_t EvCB[32]; #define EvStUNUSED 0x0000 #define EvStWAIT 0x1000 #define EvStACTIVE 0x2000 #define EvStALREADY 0x4000 #define EvMdINTR 0x1000 #define EvMdNOINTR 0x2000 typedef struct { s32 status; s32 mode; u32 reg[32]; u32 func; } upse_packed_t TCB; static u32 *jmp_int; static u32 regs[35]; static EvCB *Event; //static EvCB *HwEV; // 0xf0 //static EvCB *EvEV; // 0xf1 static EvCB *RcEV; // 0xf2 //static EvCB *UeEV; // 0xf3 //static EvCB *SwEV; // 0xf4 //static EvCB *ThEV; // 0xff static u32 heap_addr; static u32 SysIntRP[8]; static TCB Thread[8]; static int CurThread; static INLINE void softCall(u32 pc) { pc0 = pc; ra = 0x80001000; while (pc0 != 0x80001000) upse_r3000_cpu_execute_block(); } static INLINE void softCall2(u32 pc) { u32 sra = ra; pc0 = pc; ra = 0x80001000; while (pc0 != 0x80001000) upse_r3000_cpu_execute_block(); ra = sra; } static INLINE void DeliverEvent(u32 ev, u32 spec) { if (Event[ev][spec].status != BFLIP32S(EvStACTIVE)) return; // Event[ev][spec].status = BFLIP32S(EvStALREADY); if (Event[ev][spec].mode == BFLIP32S(EvMdINTR)) { softCall2(BFLIP32S(Event[ev][spec].fhandler)); } else Event[ev][spec].status = BFLIP32S(EvStALREADY); } /* * // * // * // System calls A0 */ /* Abs and labs do the same thing? */ static void bios_abs() { // 0x0e if ((s32) a0 < 0) v0 = 0 - (s32) a0; else v0 = a0; //v0 = abs(a0); pc0 = ra; } static void bios_labs() { // 0x0f if ((s32) a0 < 0) v0 = 0 - (s32) a0; else v0 = a0; //v0 = labs(a0); pc0 = ra; } static void bios_atoi() { // 0x10 char *arg = Ra0; v0 = atoi(arg); pc0 = ra; } static void bios_atol() { // 0x11 char *arg = Ra0; v0 = atol(arg); pc0 = ra; } static void bios_setjmp() { // 13 u32 *jmp_buf = (u32 *) Ra0; int i; jmp_buf[0] = BFLIP32(ra); jmp_buf[1] = BFLIP32(sp); jmp_buf[2] = BFLIP32(fp); for (i = 0; i < 8; i++) // s0-s7 jmp_buf[3 + i] = BFLIP32(upse_r3000_cpu_regs.GPR.r[16 + i]); jmp_buf[11] = BFLIP32(gp); v0 = 0; pc0 = ra; } static void bios_longjmp() { //14 u32 *jmp_buf = (u32 *) Ra0; int i; ra = BFLIP32(jmp_buf[0]); /* ra */ sp = BFLIP32(jmp_buf[1]); /* sp */ fp = BFLIP32(jmp_buf[2]); /* fp */ for (i = 0; i < 8; i++) // s0-s7 upse_r3000_cpu_regs.GPR.r[16 + i] = BFLIP32(jmp_buf[3 + i]); gp = BFLIP32(jmp_buf[11]); /* gp */ v0 = a1; pc0 = ra; } static void bios_strcat() { // 0x15 char *pcA0 = (char *) Ra0; char *pcA1 = (char *) Ra1; if (pcA0 == NULL || pcA1 == NULL) return; strcat(pcA0, pcA1 != NULL ? pcA1 : ""); v0 = a0; pc0 = ra; } /*0x16*/ static void bios_strncat() { char *pcA0 = (char *) Ra0; char *pcA1 = (char *) Ra1; if (pcA0 == NULL || pcA1 == NULL) return; strncat(pcA0, pcA1, a2); v0 = a0; pc0 = ra; } static void bios_strcmp() { // 0x17 char *pcA0 = (char *) Ra0; char *pcA1 = (char *) Ra1; v0 = strcmp(pcA0, pcA1); pc0 = ra; } static void bios_strncmp() { // 0x18 u32 max = a2; u32 string1 = a0; u32 string2 = a1; s8 tmpv = 0; while (max > 0) { u8 tmp1 = PSXMuR8(string1); u8 tmp2 = PSXMuR8(string2); if (!tmp1 || !tmp2) break; tmpv = tmp1 - tmp2; if (tmpv) break; if (!tmp1 || !tmp2) break; if (!PSXM(string1) || !PSXM(string2)) break; max--; string1++; string2++; } if (tmpv > 0) v0 = 1; else if (tmpv < 0) v0 = -1; else v0 = 0; //printf("%s:%s, %d, %d\n",Ra0,Ra1,a2,v0); //v0 = strncmp(Ra0, Ra1, a2); pc0 = ra; } /*0x19*/ static void bios_strcpy() { u32 src = a1, dest = a0; u8 val; do { val = PSXMu8(src); PSXMu8(dest) = val; src++; dest++; } while (val); //strcpy(Ra0, Ra1); v0 = a0; pc0 = ra; } /*0x1a*/ static void bios_strncpy() { u32 src = a1, dest = a0, max = a2; u8 val; do { val = PSXMu8(src); PSXMu8(dest) = val; src++; dest++; max--; } while (val && max); //strncpy(Ra0, Ra1, a2); v0 = a0; pc0 = ra; } /*0x1b*/ static void bios_strlen() { u32 src = a0; while (PSXMu8(src)) src++; v0 = src - a0; pc0 = ra; } static void bios_index() { // 0x1c char *pcA0 = (char *) Ra0; char *pcRet = strchr(pcA0, a1); if (pcRet) v0 = a0 + pcRet - pcA0; else v0 = 0; pc0 = ra; } static void bios_rindex() { // 0x1d char *pcA0 = (char *) Ra0; char *pcRet = strrchr(pcA0, a1); if (pcRet) v0 = a0 + pcRet - pcA0; else v0 = 0; pc0 = ra; } static void bios_strchr() { // 0x1e char *pcA0 = (char *) Ra0; char *pcRet = strchr(pcA0, a1); if (pcRet) v0 = a0 + pcRet - pcA0; else v0 = 0; pc0 = ra; } static void bios_strrchr() { // 0x1f char *pcA0 = (char *) Ra0; char *pcRet = strrchr(pcA0, a1); if (pcRet) v0 = a0 + pcRet - pcA0; else v0 = 0; pc0 = ra; } static void bios_strpbrk() { // 0x20 char *pcA0 = (char *) Ra0; char *pcA1 = (char *) Ra1; char *pcRet = strpbrk(pcA0, pcA1); if (pcRet) v0 = a0 + pcRet - pcA0; else v0 = 0; pc0 = ra; } static void bios_strspn() { char *pcA0 = (char *) Ra0; char *pcA1 = (char *) Ra1; v0 = strspn(pcA0, pcA1); pc0 = ra; } /*21 */ static void bios_strcspn() { char *pcA0 = (char *) Ra0; char *pcA1 = (char *) Ra1; v0 = strcspn(pcA0, pcA1); pc0 = ra; } /*22 */ static void bios_strtok() { // 0x23 char *pcA0 = (char *) Ra0; char *pcA1 = (char *) Ra1; char *pcRet = strtok(pcA0, pcA1); if (pcRet) v0 = a0 + pcRet - pcA0; else v0 = 0; pc0 = ra; } static void bios_strstr() { // 0x24 char *pcA0 = (char *) Ra0; char *pcA1 = (char *) Ra1; char *pcRet = strstr(pcA0, pcA1); if (pcRet) v0 = a0 + pcRet - pcA0; else v0 = 0; pc0 = ra; } /*0x25*/ static void bios_toupper() { v0 = toupper(a0); pc0 = ra; } /*0x26*/ static void bios_tolower() { v0 = tolower(a0); pc0 = ra; } /*0x27*/ static void bios_bcopy() { u32 dest = a1, src = a0, len = a2; while (len--) { PSXMu8(dest) = PSXMu8(src); dest++; src++; } //memcpy(Ra1,Ra0,a2); pc0 = ra; } /*0x28*/ static void bios_bzero() { u32 dest = a0, len = a1; while (len--) { PSXMu8(dest) = 0; dest++; } //memset(Ra0,0,a1); pc0 = ra; } /*0x29*/ static void bios_bcmp() { char *pcA0 = (char *) Ra0; char *pcA1 = (char *) Ra1; v0 = memcmp(pcA0, pcA1, a2); pc0 = ra; } /*0x2a*/ static void bios_memcpy() { u32 dest = a0, src = a1, len = a2; while (len--) { PSXMu8(dest) = PSXMu8(src); dest++; src++; } //memcpy(Ra0, Ra1, a2); v0 = a0; pc0 = ra; } static void bios_memset() /*0x2b */ { u32 len = a2; u32 dest = a0; while (len--) { if (PSXM(dest)) PSXMu8(dest) = a1; dest++; } //memset(Ra0, a1, a2); v0 = a0; pc0 = ra; } static void bios_memmove() { char *pcA0 = (char *) Ra0; char *pcA1 = (char *) Ra1; memmove(pcA0, pcA1, a2); v0 = a0; pc0 = ra; } /*0x2d*/ static void bios_memcmp() { char *pcA0 = (char *) Ra0; char *pcA1 = (char *) Ra1; v0 = memcmp(pcA0, pcA1, a2); pc0 = ra; } static void bios_memchr() { // 2e char *pcA0 = (char *) Ra0; void *ret = memchr(pcA0, a1, a2); if (ret != NULL) v0 = (u32) ((char *) ret - Ra0) + a0; else v0 = 0; pc0 = ra; } static void bios_rand() { // 2f v0 = 1 + (int) (32767.0 * rand() / (RAND_MAX + 1.0)); pc0 = ra; } static void bios_srand() { // 30 srand(a0); pc0 = ra; } static void bios_malloc() { // 33 u32 chunk; u32 fd; /* a0: Number of bytes to allocate. */ chunk = heap_addr; /* Search for first chunk that's large enough and not currently being used. */ while ((a0 > BFLIP32(((malloc_chunk *) PSXM(chunk))->size)) || (BFLIP32(((malloc_chunk *) PSXM(chunk))->stat) == INUSE)) chunk = ((malloc_chunk *) PSXM(chunk))->fd; //printf("%08x\n",chunk); /* split free chunk */ fd = chunk + sizeof(malloc_chunk) + a0; ((malloc_chunk *) PSXM(fd))->stat = ((malloc_chunk *) PSXM(chunk))->stat; ((malloc_chunk *) PSXM(fd))->size = BFLIP32(BFLIP32(((malloc_chunk *) PSXM(chunk))->size) - a0); ((malloc_chunk *) PSXM(fd))->fd = ((malloc_chunk *) PSXM(chunk))->fd; ((malloc_chunk *) PSXM(fd))->bk = chunk; /* set new chunk */ ((malloc_chunk *) PSXM(chunk))->stat = BFLIP32(INUSE); ((malloc_chunk *) PSXM(chunk))->size = BFLIP32(a0); ((malloc_chunk *) PSXM(chunk))->fd = fd; v0 = chunk + sizeof(malloc_chunk); v0 |= 0x80000000; // printf ("malloc %lx,%lx\n", v0, a0); pc0 = ra; } static void bios_InitHeap() { // 39 malloc_chunk *chunk; heap_addr = a0; // Ra0 chunk = (malloc_chunk *) PSXM(heap_addr); chunk->stat = 0; if (((a0 & 0x1fffff) + a1) >= 0x200000) chunk->size = BFLIP32(0x1ffffc - (a0 & 0x1fffff)); else chunk->size = BFLIP32(a1); chunk->fd = 0; chunk->bk = 0; pc0 = ra; } static void bios_printf() { pc0 = ra; } static void bios_puts() { pc0 = ra; #ifdef UPSE_DEBUG _DEBUG("%s", Ra0); #endif } static void bios_FlushCache() { // 44 pc0 = ra; } static void bios__bu_init() { // 70 DeliverEvent(0x11, 0x2); // 0xf0000011, 0x0004 DeliverEvent(0x81, 0x2); // 0xf4000001, 0x0004 pc0 = ra; } static void bios__96_init() { // 71 pc0 = ra; } static void bios__96_remove() { // 72 pc0 = ra; } /* System calls B0 */ static void bios_SetRCnt() { // 02 a0 &= 0x3; if (a0 != 3) { u32 mode = 0; psxRcntWtarget(a0, a1); if (a2 & 0x1000) mode |= 0x050; // Interrupt Mode if (a2 & 0x0100) mode |= 0x008; // Count to 0xffff if (a2 & 0x0010) mode |= 0x001; // Timer stop mode if (a0 == 2) { if (a2 & 0x0001) mode |= 0x200; } // System Clock mode else { if (a2 & 0x0001) mode |= 0x100; } // System Clock mode psxRcntWmode(a0, mode); } pc0 = ra; } static void bios_GetRCnt() { // 03 a0 &= 0x3; if (a0 != 3) v0 = psxRcntRcount(a0); else v0 = 0; pc0 = ra; } static void bios_StartRCnt() { // 04 a0 &= 0x3; if (a0 != 3) psxHu32(0x1074) |= BFLIP32(1 << (a0 + 4)); else psxHu32(0x1074) |= BFLIP32(0x1); v0 = 1; pc0 = ra; } static void bios_StopRCnt() { // 05 a0 &= 0x3; if (a0 != 3) psxHu32(0x1074) &= BFLIP32(~(1 << (a0 + 4))); else psxHu32(0x1074) &= BFLIP32(~0x1); pc0 = ra; } static void bios_ResetRCnt() { // 06 a0 &= 0x3; if (a0 != 3) { psxRcntWmode(a0, 0); psxRcntWtarget(a0, 0); psxRcntWcount(a0, 0); } pc0 = ra; } /* gets ev for use with Event */ #define GetEv() \ ev = (a0 >> 24) & 0xf; \ if (ev == 0xf) ev = 0x5; \ ev*= 32; \ ev+= a0&0x1f; /* gets spec for use with Event */ #define GetSpec() \ spec = 0; \ switch (a1) { \ case 0x0301: spec = 16; break; \ case 0x0302: spec = 17; break; \ default: \ for (i=0; i<16; i++) if (a1 & (1 << i)) { spec = i; break; } \ break; \ } static void bios_DeliverEvent() { // 07 int ev, spec; int i; GetEv(); GetSpec(); DeliverEvent(ev, spec); pc0 = ra; } static void bios_OpenEvent() { // 08 int ev, spec; int i; GetEv(); GetSpec(); Event[ev][spec].status = BFLIP32S(EvStWAIT); Event[ev][spec].mode = BFLIP32(a2); Event[ev][spec].fhandler = BFLIP32(a3); v0 = ev | (spec << 8); pc0 = ra; } static void bios_CloseEvent() { // 09 int ev, spec; ev = a0 & 0xff; spec = (a0 >> 8) & 0xff; Event[ev][spec].status = BFLIP32S(EvStUNUSED); v0 = 1; pc0 = ra; } static void bios_WaitEvent() { // 0a int ev, spec; ev = a0 & 0xff; spec = (a0 >> 8) & 0xff; Event[ev][spec].status = BFLIP32S(EvStACTIVE); v0 = 1; pc0 = ra; } static void bios_TestEvent() { // 0b int ev, spec; ev = a0 & 0xff; spec = (a0 >> 8) & 0xff; if (Event[ev][spec].status == BFLIP32S(EvStALREADY)) { Event[ev][spec].status = BFLIP32S(EvStACTIVE); v0 = 1; } else v0 = 0; pc0 = ra; } static void bios_EnableEvent() { // 0c int ev, spec; ev = a0 & 0xff; spec = (a0 >> 8) & 0xff; Event[ev][spec].status = BFLIP32S(EvStACTIVE); v0 = 1; pc0 = ra; } static void bios_DisableEvent() { // 0d int ev, spec; ev = a0 & 0xff; spec = (a0 >> 8) & 0xff; Event[ev][spec].status = BFLIP32S(EvStWAIT); v0 = 1; pc0 = ra; } /* * long OpenTh(long (*func)(), unsigned long sp, unsigned long gp); */ static void bios_OpenTh() { // 0e int th; for (th = 1; th < 8; th++) if (Thread[th].status == 0) break; Thread[th].status = BFLIP32(1); Thread[th].func = BFLIP32(a0); Thread[th].reg[29] = BFLIP32(a1); Thread[th].reg[28] = BFLIP32(a2); v0 = th; pc0 = ra; } /* * int CloseTh(long thread); */ static void bios_CloseTh() { // 0f int th = a0 & 0xff; if (Thread[th].status == 0) { v0 = 0; } else { Thread[th].status = 0; v0 = 1; } pc0 = ra; } /* * int ChangeTh(long thread); */ static void bios_ChangeTh() { // 10 int th = a0 & 0xff; if (Thread[th].status == 0 || CurThread == th) { v0 = 0; pc0 = ra; } else { v0 = 1; if (Thread[CurThread].status == BFLIP32S(2)) { Thread[CurThread].status = BFLIP32S(1); Thread[CurThread].func = BFLIP32(ra); memcpy(Thread[CurThread].reg, upse_r3000_cpu_regs.GPR.r, 32 * 4); } memcpy(upse_r3000_cpu_regs.GPR.r, Thread[th].reg, 32 * 4); pc0 = BFLIP32(Thread[th].func); Thread[th].status = BFLIP32(2); CurThread = th; } } static void bios_ReturnFromException() { // 17 memcpy(upse_r3000_cpu_regs.GPR.r, regs, 32 * 4); upse_r3000_cpu_regs.GPR.n.lo = regs[32]; upse_r3000_cpu_regs.GPR.n.hi = regs[33]; pc0 = upse_r3000_cpu_regs.CP0.n.EPC; if (upse_r3000_cpu_regs.CP0.n.Cause & 0x80000000) pc0 += 4; upse_r3000_cpu_regs.CP0.n.Status = (upse_r3000_cpu_regs.CP0.n.Status & 0xfffffff0) | ((upse_r3000_cpu_regs.CP0.n.Status & 0x3c) >> 2); } static void bios_ResetEntryInt() { // 18 jmp_int = NULL; pc0 = ra; } static void bios_HookEntryInt() { // 19 jmp_int = (u32 *) Ra0; pc0 = ra; } static void bios_UnDeliverEvent() { // 0x20 int ev, spec; int i; GetEv(); GetSpec(); if (Event[ev][spec].status == BFLIP32S(EvStALREADY) && Event[ev][spec].mode == BFLIP32S(EvMdNOINTR)) Event[ev][spec].status = BFLIP32S(EvStACTIVE); pc0 = ra; } static void bios_GetC0Table() { // 56 v0 = 0x674; pc0 = ra; } static void bios_GetB0Table() { // 57 v0 = 0x874; pc0 = ra; } /* System calls C0 */ /* * int SysEnqIntRP(int index , long *queue); */ static void bios_SysEnqIntRP() { // 02 SysIntRP[a0] = a1; v0 = 0; pc0 = ra; } /* * int SysDeqIntRP(int index , long *queue); */ static void bios_SysDeqIntRP() { // 03 SysIntRP[a0] = 0; v0 = 0; pc0 = ra; } static void bios_ChangeClearRCnt() { // 0a u32 *ptr; ptr = (u32 *) PSXM((a0 << 2) + 0x8600); v0 = BFLIP32(*ptr); *ptr = BFLIP32(a1); upse_r3000_cpu_regs.CP0.n.Status|= 0x404; pc0 = ra; } static void bios_dummy() { pc0 = ra; v0 = a1; } void (*biosA0[256]) (); void (*biosB0[256]) (); void (*biosC0[256]) (); void upse_ps1_bios_init() { u32 base, size; u32 *ptr; int i; if (upse_has_custom_bios()) return; heap_addr = 0; CurThread = 0; jmp_int = NULL; for (i = 0; i < 256; i++) { biosA0[i] = NULL; biosB0[i] = NULL; biosC0[i] = NULL; } for (i = 0; i < 256; i++) { if (biosA0[i] == NULL) biosA0[i] = bios_dummy; if (biosB0[i] == NULL) biosB0[i] = bios_dummy; if (biosC0[i] == NULL) biosC0[i] = bios_dummy; } biosA0[0x0e] = bios_abs; biosA0[0x0f] = bios_labs; biosA0[0x10] = bios_atoi; biosA0[0x11] = bios_atol; //biosA0[0x12] = bios_atob; biosA0[0x13] = bios_setjmp; biosA0[0x14] = bios_longjmp; biosA0[0x15] = bios_strcat; biosA0[0x16] = bios_strncat; biosA0[0x17] = bios_strcmp; biosA0[0x18] = bios_strncmp; biosA0[0x19] = bios_strcpy; biosA0[0x1a] = bios_strncpy; biosA0[0x1b] = bios_strlen; biosA0[0x1c] = bios_index; biosA0[0x1d] = bios_rindex; biosA0[0x1e] = bios_strchr; biosA0[0x1f] = bios_strrchr; biosA0[0x20] = bios_strpbrk; biosA0[0x21] = bios_strspn; biosA0[0x22] = bios_strcspn; biosA0[0x23] = bios_strtok; biosA0[0x24] = bios_strstr; biosA0[0x25] = bios_toupper; biosA0[0x26] = bios_tolower; biosA0[0x27] = bios_bcopy; biosA0[0x28] = bios_bzero; biosA0[0x29] = bios_bcmp; biosA0[0x2a] = bios_memcpy; biosA0[0x2b] = bios_memset; biosA0[0x2c] = bios_memmove; biosA0[0x2c] = bios_memcpy; /* Our code should be compatible with both memcpy and memmove semantics. */ biosA0[0x2d] = bios_memcmp; biosA0[0x2e] = bios_memchr; biosA0[0x2f] = bios_rand; biosA0[0x30] = bios_srand; //biosA0[0x31] = bios_qsort; //biosA0[0x32] = bios_strtod; biosA0[0x33] = bios_malloc; //biosA0[0x34] = bios_free; //biosA0[0x35] = bios_lsearch; //biosA0[0x36] = bios_bsearch; //biosA0[0x37] = bios_calloc; //biosA0[0x38] = bios_realloc; biosA0[0x39] = bios_InitHeap; //biosA0[0x3a] = bios__exit; biosA0[0x3e] = bios_puts; biosA0[0x3f] = bios_printf; biosA0[0x44] = bios_FlushCache; //biosA0[0x45] = bios_InstallInterruptHandler; //biosA0[0x4f] = bios_sys_a0_4f; //biosA0[0x50] = bios_sys_a0_50; biosA0[0x70] = bios__bu_init; biosA0[0x71] = bios__96_init; biosA0[0x72] = bios__96_remove; //biosA0[0x73] = bios_sys_a0_73; //biosA0[0x74] = bios_sys_a0_74; //biosA0[0x75] = bios_sys_a0_75; //biosA0[0x76] = bios_sys_a0_76; //biosA0[0x77] = bios_sys_a0_77; //biosA0[0x78] = bios__96_CdSeekL; //biosA0[0x79] = bios_sys_a0_79; //biosA0[0x7a] = bios_sys_a0_7a; //biosA0[0x7b] = bios_sys_a0_7b; //biosA0[0x7c] = bios__96_CdGetStatus; //biosA0[0x7d] = bios_sys_a0_7d; //biosA0[0x7e] = bios__96_CdRead; //biosA0[0x7f] = bios_sys_a0_7f; //biosA0[0x80] = bios_sys_a0_80; //biosA0[0x81] = bios_sys_a0_81; //biosA0[0x82] = bios_sys_a0_82; //biosA0[0x83] = bios_sys_a0_83; //biosA0[0x84] = bios_sys_a0_84; //biosA0[0x85] = bios__96_CdStop; //biosA0[0x86] = bios_sys_a0_86; //biosA0[0x87] = bios_sys_a0_87; //biosA0[0x88] = bios_sys_a0_88; //biosA0[0x89] = bios_sys_a0_89; //biosA0[0x8a] = bios_sys_a0_8a; //biosA0[0x8b] = bios_sys_a0_8b; //biosA0[0x8c] = bios_sys_a0_8c; //biosA0[0x8d] = bios_sys_a0_8d; //biosA0[0x8e] = bios_sys_a0_8e; //biosA0[0x8f] = bios_sys_a0_8f; //biosA0[0x90] = bios_sys_a0_90; //biosA0[0x91] = bios_sys_a0_91; //biosA0[0x92] = bios_sys_a0_92; //biosA0[0x93] = bios_sys_a0_93; //biosA0[0x94] = bios_sys_a0_94; //biosA0[0x95] = bios_sys_a0_95; //biosA0[0x96] = bios_AddCDROMDevice; //biosA0[0x97] = bios_AddMemCardDevide; //biosA0[0x98] = bios_DisableKernelIORedirection; //biosA0[0x99] = bios_EnableKernelIORedirection; //biosA0[0x9a] = bios_sys_a0_9a; //biosA0[0x9b] = bios_sys_a0_9b; //biosA0[0x9c] = bios_SetConf; //biosA0[0x9d] = bios_GetConf; //biosA0[0x9e] = bios_sys_a0_9e; //biosA0[0x9f] = bios_SetMem; //biosA0[0xa0] = bios__boot; //biosA0[0xa1] = bios_SystemError; //biosA0[0xa2] = bios_EnqueueCdIntr; //biosA0[0xa3] = bios_DequeueCdIntr; //biosA0[0xa4] = bios_sys_a0_a4; //biosA0[0xa5] = bios_ReadSector; //biosA0[0xa6] = bios_get_cd_status; //biosA0[0xa7] = bios_bufs_cb_0; //biosA0[0xa8] = bios_bufs_cb_1; //biosA0[0xa9] = bios_bufs_cb_2; //biosA0[0xaa] = bios_bufs_cb_3; //biosA0[0xab] = bios__card_info; //biosA0[0xac] = bios__card_load; //biosA0[0axd] = bios__card_auto; //biosA0[0xae] = bios_bufs_cd_4; //biosA0[0xaf] = bios_sys_a0_af; //biosA0[0xb0] = bios_sys_a0_b0; //biosA0[0xb1] = bios_sys_a0_b1; //biosA0[0xb2] = bios_do_a_long_jmp //biosA0[0xb3] = bios_sys_a0_b3; //biosA0[0xb4] = bios_sub_function; //*******************B0 CALLS**************************** //biosB0[0x00] = bios_SysMalloc; //biosB0[0x01] = bios_sys_b0_01; biosB0[0x02] = bios_SetRCnt; biosB0[0x03] = bios_GetRCnt; biosB0[0x04] = bios_StartRCnt; biosB0[0x05] = bios_StopRCnt; biosB0[0x06] = bios_ResetRCnt; biosB0[0x07] = bios_DeliverEvent; biosB0[0x08] = bios_OpenEvent; biosB0[0x09] = bios_CloseEvent; biosB0[0x0a] = bios_WaitEvent; biosB0[0x0b] = bios_TestEvent; biosB0[0x0c] = bios_EnableEvent; biosB0[0x0d] = bios_DisableEvent; biosB0[0x0e] = bios_OpenTh; biosB0[0x0f] = bios_CloseTh; biosB0[0x10] = bios_ChangeTh; //biosB0[0x11] = bios_bios_b0_11; biosB0[0x17] = bios_ReturnFromException; biosB0[0x18] = bios_ResetEntryInt; biosB0[0x19] = bios_HookEntryInt; //biosB0[0x1a] = bios_sys_b0_1a; //biosB0[0x1b] = bios_sys_b0_1b; //biosB0[0x1c] = bios_sys_b0_1c; //biosB0[0x1d] = bios_sys_b0_1d; //biosB0[0x1e] = bios_sys_b0_1e; //biosB0[0x1f] = bios_sys_b0_1f; biosB0[0x20] = bios_UnDeliverEvent; //biosB0[0x21] = bios_sys_b0_21; //biosB0[0x22] = bios_sys_b0_22; //biosB0[0x23] = bios_sys_b0_23; //biosB0[0x24] = bios_sys_b0_24; //biosB0[0x25] = bios_sys_b0_25; //biosB0[0x26] = bios_sys_b0_26; //biosB0[0x27] = bios_sys_b0_27; //biosB0[0x28] = bios_sys_b0_28; //biosB0[0x29] = bios_sys_b0_29; //biosB0[0x2a] = bios_sys_b0_2a; //biosB0[0x2b] = bios_sys_b0_2b; //biosB0[0x2c] = bios_sys_b0_2c; //biosB0[0x2d] = bios_sys_b0_2d; //biosB0[0x2e] = bios_sys_b0_2e; //biosB0[0x2f] = bios_sys_b0_2f; //biosB0[0x30] = bios_sys_b0_30; //biosB0[0x31] = bios_sys_b0_31; biosB0[0x3f] = bios_puts; biosB0[0x56] = bios_GetC0Table; biosB0[0x57] = bios_GetB0Table; //biosB0[0x58] = bios__card_chan; //biosB0[0x59] = bios_sys_b0_59; //biosB0[0x5a] = bios_sys_b0_5a; //biosB0[0x5c] = bios__card_status; //biosB0[0x5d] = bios__card_wait; //*******************C0 CALLS**************************** //biosC0[0x00] = bios_InitRCnt; //biosC0[0x01] = bios_InitException; biosC0[0x02] = bios_SysEnqIntRP; biosC0[0x03] = bios_SysDeqIntRP; //biosC0[0x04] = bios_get_free_EvCB_slot; //biosC0[0x05] = bios_get_free_TCB_slot; //biosC0[0x06] = bios_ExceptionHandler; //biosC0[0x07] = bios_InstallExeptionHandler; //biosC0[0x08] = bios_SysInitMemory; //biosC0[0x09] = bios_SysInitKMem; biosC0[0x0a] = bios_ChangeClearRCnt; //biosC0[0x0b] = bios_SystemError; //biosC0[0x0c] = bios_InitDefInt; //biosC0[0x0d] = bios_sys_c0_0d; //biosC0[0x0e] = bios_sys_c0_0e; //biosC0[0x0f] = bios_sys_c0_0f; //biosC0[0x10] = bios_sys_c0_10; //biosC0[0x11] = bios_sys_c0_11; //biosC0[0x12] = bios_InstallDevices; //biosC0[0x13] = bios_FlushStfInOutPut; //biosC0[0x14] = bios_sys_c0_14; //biosC0[0x15] = bios__cdevinput; //biosC0[0x16] = bios__cdevscan; //biosC0[0x17] = bios__circgetc; //biosC0[0x18] = bios__circputc; //biosC0[0x19] = bios_ioabort; //biosC0[0x1a] = bios_sys_c0_1a //biosC0[0x1b] = bios_KernelRedirect; //biosC0[0x1c] = bios_PatchAOTable; biosC0[0x3f] = bios_printf; //************** THE END *************************************** base = 0x1000; size = sizeof(EvCB) * 32; Event = (void *) &psxR[base]; base += size * 6; memset(Event, 0, size * 6); //HwEV = Event; //EvEV = Event + 32; RcEV = Event + 32 * 2; //UeEV = Event + 32*3; //SwEV = Event + 32*4; //ThEV = Event + 32*5; ptr = (u32 *) & psxM[0x0874]; // b0 table ptr[0] = BFLIP32(0x4c54 - 0x884); ptr = (u32 *) & psxM[0x0674]; // c0 table ptr[6] = BFLIP32(0xc80); memset(SysIntRP, 0, sizeof(SysIntRP)); memset(Thread, 0, sizeof(Thread)); Thread[0].status = BFLIP32(2); // main thread psxMu32(0x0150) = BFLIP32(0x160); psxMu32(0x0154) = BFLIP32(0x320); psxMu32(0x0160) = BFLIP32(0x248); strcpy(&psxM[0x248], "bu"); psxMu32(0x0ca8) = BFLIP32(0x1f410004); psxMu32(0x0cf0) = BFLIP32(0x3c020000); psxMu32(0x0cf4) = BFLIP32(0x2442641c); psxMu32(0x09e0) = BFLIP32(0x43d0); psxMu32(0x4d98) = BFLIP32(0x946f000a); // opcode HLE psxRu32(0x0000) = BFLIP32((0x3b << 26) | 4); psxMu32(0x0000) = BFLIP32((0x3b << 26) | 0); psxMu32(0x00a0) = BFLIP32((0x3b << 26) | 1); psxMu32(0x00b0) = BFLIP32((0x3b << 26) | 2); psxMu32(0x00c0) = BFLIP32((0x3b << 26) | 3); psxMu32(0x4c54) = BFLIP32((0x3b << 26) | 0); psxMu32(0x8000) = BFLIP32((0x3b << 26) | 5); psxMu32(0x07a0) = BFLIP32((0x3b << 26) | 0); psxMu32(0x0884) = BFLIP32((0x3b << 26) | 0); psxMu32(0x0894) = BFLIP32((0x3b << 26) | 0); } void upse_ps1_bios_shutdown() { } void biosInterrupt() { if (BFLIP32(psxHu32(0x1070)) & 0x1) { // Vsync if (RcEV[3][1].status == BFLIP32S(EvStACTIVE)) { softCall(BFLIP32(RcEV[3][1].fhandler)); // hwwrite_32(0x1f801070, ~(1)); } } if (BFLIP32(psxHu32(0x1070)) & 0x70) { // Rcnt 0,1,2 int i; for (i = 0; i < 3; i++) { if (BFLIP32(psxHu32(0x1070)) & (1 << (i + 4))) { if (RcEV[i][1].status == BFLIP32S(EvStACTIVE)) { softCall(BFLIP32(RcEV[i][1].fhandler)); upse_ps1_hal_write_32(0x1f801070, ~(1 << (i + 4))); } } } } } static INLINE void SaveRegs() { memcpy(regs, upse_r3000_cpu_regs.GPR.r, 32 * 4); regs[32] = upse_r3000_cpu_regs.GPR.n.lo; regs[33] = upse_r3000_cpu_regs.GPR.n.hi; regs[34] = upse_r3000_cpu_regs.pc; } void upse_ps1_bios_exception() { int i; switch (upse_r3000_cpu_regs.CP0.n.Cause & 0x3c) { case 0x00: // Interrupt #ifdef PSXCPU_LOG // PSXCPU_LOG("interrupt\n"); #endif SaveRegs(); biosInterrupt(); for (i = 0; i < 8; i++) { if (SysIntRP[i]) { u32 *queue = (u32 *) PSXM(SysIntRP[i]); s0 = BFLIP32(queue[2]); softCall(BFLIP32(queue[1])); } } if (jmp_int != NULL) { int i; upse_ps1_hal_write_32(0x1f801070, 0xffffffff); ra = BFLIP32(jmp_int[0]); sp = BFLIP32(jmp_int[1]); fp = BFLIP32(jmp_int[2]); for (i = 0; i < 8; i++) // s0-s7 upse_r3000_cpu_regs.GPR.r[16 + i] = BFLIP32(jmp_int[3 + i]); gp = BFLIP32(jmp_int[11]); v0 = 1; pc0 = ra; return; } upse_ps1_hal_write_16(0x1f801070, 0); break; case 0x20: // Syscall #ifdef PSXCPU_LOG // PSXCPU_LOG("syscall exp %x\n", a0); #endif switch (a0) { case 1: // EnterCritical - disable irq's upse_r3000_cpu_regs.CP0.n.Status &= ~0x404; break; case 2: // ExitCritical - enable irq's upse_r3000_cpu_regs.CP0.n.Status |= 0x404; break; } pc0 = upse_r3000_cpu_regs.CP0.n.EPC + 4; upse_r3000_cpu_regs.CP0.n.Status = (upse_r3000_cpu_regs.CP0.n.Status & 0xfffffff0) | ((upse_r3000_cpu_regs.CP0.n.Status & 0x3c) >> 2); return; default: #ifdef PSXCPU_LOG PSXCPU_LOG("unk exp\n"); #endif break; } pc0 = upse_r3000_cpu_regs.CP0.n.EPC; if (upse_r3000_cpu_regs.CP0.n.Cause & 0x80000000) pc0 += 4; upse_r3000_cpu_regs.CP0.n.Status = (upse_r3000_cpu_regs.CP0.n.Status & 0xfffffff0) | ((upse_r3000_cpu_regs.CP0.n.Status & 0x3c) >> 2); } upse-1.0.0/src/Makefile0000644000175000017500000000010111006314306014553 0ustar nenolodnenolodSUBDIRS = libupse upse-audacious upse123 include ../buildsys.mk upse-1.0.0/src/upse123/0000755000175000017500000000000011006314306014325 5ustar nenolodnenolodupse-1.0.0/src/upse123/Makefile0000644000175000017500000000040311006314306015762 0ustar nenolodnenolodPROG = upse123${PROG_SUFFIX} SRCS = upse123_main.c MAN = upse123.1 include ../../buildsys.mk include ../../extra.mk plugindir := ${plugindir}/${INPUT_PLUGIN_DIR} CFLAGS += CPPFLAGS += $(AO_CFLAGS) -I../libupse LIBS += -lz -L../libupse -lupse $(AO_LIBS) upse-1.0.0/src/upse123/upse123_main.c0000644000175000017500000002036711006314306016707 0ustar nenolodnenolod/* * UPSE: the unix playstation sound emulator. * * Filename: upse123_main.c * Purpose: libupse: UPSE123 (console player) main loop * * Copyright (c) 2007 William Pitcock * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include #include #include #include #include #include #include #include #include #include #include #include #include "../../config.h" #ifdef HAVE_AO # include #endif static void * upse123_open_impl(char *path, char *mode) { return fopen(path, mode); } static size_t upse123_read_impl(void *ptr, size_t sz, size_t nmemb, void *file) { FILE *f = (FILE *) ptr; return fread(f, sz, nmemb, file); } static int upse123_seek_impl(void *ptr, long offset, int whence) { FILE *f = (FILE *) ptr; return fseek(f, offset, whence); } static int upse123_close_impl(void *ptr) { FILE *f = (FILE *) ptr; return fclose(f); } static upse_iofuncs_t upse123_iofuncs = { upse123_open_impl, upse123_read_impl, upse123_seek_impl, upse123_close_impl }; #ifndef HAVE_AO static int oss_audio_fd = -1; #else static ao_device *ao_dev_ = NULL; static ao_option *ao_opts_ = NULL; #endif static char *audio_dev_ = NULL; static int decode_position = 0; static upse_psf_t *psf; #ifdef HAVE_AO int upse123_ao_add_option(ao_option **optv, const char *string) { char *key, *value; int ret; if (string == NULL) return 0; key = strdup(string); if (key == NULL) return 0; value = strchr(key, ':'); if (value == NULL) { free(key); return 0; } *value++ = '\0'; ret = ao_append_option(optv, key, value); free(key); return ret; } #endif void upse123_write_audio(unsigned char* data, long bytes, void *unused) { int remaining; #ifndef HAVE_AO if (oss_audio_fd == -1) return; write(oss_audio_fd, data, bytes); #else if (ao_dev_ == NULL) return; ao_play(ao_dev_, (char *) data, bytes); #endif decode_position += ((bytes / 4 * 1000) / 44100); remaining = psf->length - decode_position; printf("\033[00;36mTime:\033[0m %02d:%02d.%02d%s", (int)(decode_position / 1000.0) / 60, (int)(decode_position / 1000.0) % 60, (int)(decode_position / 10.0) % 100, psf->length == -1 ? "\r" : ""); if (psf->length != -1) { printf(" [-%02d:%02d.%02d]", (int)(remaining / 1000.0) / 60, (int)(remaining / 1000.0) % 60, (int)(remaining / 10.0) % 100); printf(" of %02d:%02d.%02d\r", (int)(psf->length / 1000.0) / 60, (int)(psf->length / 1000.0) % 60, (int)(psf->length / 10.0) % 100); } fflush(stdout); } void upse123_init_audio(void) { #ifndef HAVE_AO int pspeed = 44100; int pstereo = 1; int format; int oss_speed, oss_stereo; oss_speed = pspeed; oss_stereo = pstereo; if ((oss_audio_fd = open(audio_dev_ != NULL ? audio_dev_ : "/dev/dsp", O_WRONLY, 0)) == -1) { printf("Sound device not available!\n"); exit(EXIT_FAILURE); } if (ioctl(oss_audio_fd, SNDCTL_DSP_RESET, 0) == -1) { printf("Sound reset failed\n"); exit(EXIT_FAILURE); } format = AFMT_S16_LE; if (ioctl(oss_audio_fd, SNDCTL_DSP_SETFMT, &format) == -1) { printf("Sound format not supported!\n"); exit(EXIT_FAILURE); } if (format != AFMT_S16_LE) { printf("Sound format not supported!\n"); exit(EXIT_FAILURE); } if (ioctl(oss_audio_fd,SNDCTL_DSP_STEREO,&oss_stereo)==-1) { printf("Stereo mode not supported!\n"); exit(EXIT_FAILURE); } if (ioctl(oss_audio_fd,SNDCTL_DSP_SPEED,&oss_speed)==-1) { printf("Sound frequency not supported\n"); exit(EXIT_FAILURE); } if (oss_speed!=pspeed) { printf("Sound frequency not supported\n"); exit(EXIT_FAILURE); } #else ao_initialize(); { ao_sample_format format_ = { 16, 44100, 2, AO_FMT_NATIVE }; ao_dev_ = ao_open_live(audio_dev_ != NULL ? ao_driver_id(audio_dev_) : ao_default_driver_id(), &format_, ao_opts_); } #endif upse_set_audio_callback(upse123_write_audio, NULL); } void upse123_close_audio(void) { upse_set_audio_callback(NULL, NULL); #ifndef HAVE_AO if (oss_audio_fd > 0) close(oss_audio_fd); oss_audio_fd = -1; #else ao_close(ao_dev_); ao_dev_ = NULL; ao_free_options(ao_opts_); ao_opts_ = NULL; ao_shutdown(); #endif } void upse123_print_field(char *field, char *data) { if (data == NULL) return; printf("\033[00;36m%-20s\033[01;36m|\033[0m %s\n", field, data); } void usage(const char *progname) { printf("\nUsage: %s [options] files - plays PSF files\n\n", progname); #ifdef HAVE_AO printf(" -o Sets an audio device option.\n"); #endif printf(" -d Sets the audio output device to use.\n"); #ifdef HAVE_AO printf(" Use a sound system name like 'oss', 'alsa' or 'esd' here.\n"); #else printf(" Use a path to your OSS /dev/dsp here. (default: /dev/dsp)\n"); #endif printf(" -s [secs] Pauses [secs] between songs.\n"); printf(" -R Disables reverb.\n"); printf(" -q Enables non-resampled reverb. [experimental]\n"); printf(" -h Displays this message.\n"); printf(" -v Displays upse123's version.\n"); printf(" -B Sets a custom BIOS to use.\n"); printf("\nReport bugs to <" PACKAGE_BUGREPORT ">.\n"); exit(EXIT_SUCCESS); } void version(const char *progname) { printf("%s " PACKAGE_VERSION "\n", progname); } int main(int argc, char *argv[]) { int i; char r; int sleep_value_ = 0; while ((r = getopt(argc, argv, "hvo:d:s:RqB:")) >= 0) { switch(r) { case 'h': usage(argv[0]); return 0; break; case 'v': version(argv[0]); return 0; break; #ifdef HAVE_AO case 'o': upse123_ao_add_option(&ao_opts_, optarg); break; #endif case 'd': audio_dev_ = strdup(optarg); break; case 's': sleep_value_ = atoi(optarg); break; case 'R': upse_set_reverb_mode(0); break; case 'q': upse_set_reverb_no_downsample(1); break; case 'B': upse_set_custom_bios(optarg); break; default: break; } } printf("\033[K\033[01;36mUPSE123\033[00;36m: High quality PSF player.\033[0m\n"); printf("\033[K\033[00;36mCopyright (C) 2007 William Pitcock \033[0m\n"); printf("\n\033[01mUPSE123 is free software; licensed under the GNU GPL version 2.\nAs such, NO WARRANTY IS PROVIDED. USE AT YOUR OWN RISK!\033[0m\n"); upse123_init_audio(); if (argc - optind <= 0) usage(argv[0]); for (i = optind; i < argc; i++) { if ((psf = upse_load(argv[i], &upse123_iofuncs)) == NULL) { printf("%s: failed to load `%s'\n", argv[0], argv[1]); continue; } decode_position = 0; printf("\nInformation about \033[01m%s\033[00;0m:\n\n", argv[i]); upse123_print_field("Game", psf->game); upse123_print_field("Title", psf->title); upse123_print_field("Artist", psf->artist); upse123_print_field("Year", psf->year); upse123_print_field("Genre", psf->genre); upse123_print_field("Ripper", psf->psfby); upse123_print_field("Copyright", psf->copyright); printf("\n"); upse_execute(); upse_free_psf_metadata(psf); if (sleep_value_) sleep(sleep_value_); } upse123_close_audio(); return 0; } upse-1.0.0/src/upse123/upse123.10000644000175000017500000000223511006314306015613 0ustar nenolodnenolod.TH UPSE123 "1" "November 2007" "upse" "User Commands" .SH NAME upse123 \- commandline player for PSF files .SH SYNOPSIS .B upse123 [\fIoptions\fR] \fIfiles\fR .SH DESCRIPTION upse123 is a commandline player of PSF files. It's semantics are comparable to other commandline players like ogg123 and mpg123. Unlike those players, upse123 uses the libupse library to play PSF files. PSF files are sound modules ripped from various PlayStation games and demos. .SH "COMMANDLINE OPTIONS" .TP \fB\-o\fR Sets an audio device option. .TP \fB\-d\fR Sets the audio output device to use. Use a sound system name like 'oss', 'alsa' or 'esd' here. .HP \fB\-s\fR [secs] Pauses [secs] between songs. .TP \fB\-R\fR Disables reverb. .TP \fB\-q\fR Enables non\-resampled reverb. [experimental] .TP \fB\-h\fR Displays a help message. .TP \fB\-v\fR Displays upse123's version. .SH "SEE ALSO" If you are interested in more information about UPSE or the PSF sound format, visit the UPSE website at . Also for further information about the PSF sound format, visit . .SH "REPORTING BUGS" Report bugs to . upse-1.0.0/src/upse-audacious/0000755000175000017500000000000011006314306016052 5ustar nenolodnenolodupse-1.0.0/src/upse-audacious/Makefile0000644000175000017500000000047711006314306017522 0ustar nenolodnenolodPLUGIN = upse-audacious${PLUGIN_SUFFIX} SRCS = plugin.c include ../../buildsys.mk include ../../extra.mk # XXX plugindir = `pkg-config audacious --variable=input_plugin_dir` CFLAGS += ${PLUGIN_CFLAGS} CPPFLAGS += ${PLUGIN_CPPFLAGS} ${AUDACIOUS_CFLAGS} -I../libupse LIBS += ${AUDACIOUS_LIBS} -lz -L../libupse -lupse upse-1.0.0/src/upse-audacious/plugin.c0000644000175000017500000002025411006314306017517 0ustar nenolodnenolod/* * UPSE: the unix playstation emulator. * * Filename: plugin.c * Purpose: Glue to Audacious' 1.4 Component API. * * Copyright (c) 2007 William Pitcock * * UPSE is free software, released under the GNU General Public License, * version 2. * * A copy of the GNU General Public License, version 2, is included in * the UPSE source kit as COPYING. * * UPSE is offered without any warranty of any kind, explicit or implicit. */ #include #include #include #include #include #include #include #include #include #include "../../config.h" static volatile int seek = 0; static Tuple *upse_aud_get_tuple_psf(const gchar *fn, upse_psf_t *psf); static gchar *upse_aud_get_title_psf(const gchar *fn, upse_psf_t *psf); static void *upse_aud_open_impl(gchar *path, gchar *mode) { return aud_vfs_fopen(path, mode); } static size_t upse_aud_read_impl(void *ptr, size_t sz, size_t nmemb, void *file) { return aud_vfs_fread(ptr, sz, nmemb, file); } static int upse_aud_seek_impl(void *ptr, long offset, int whence) { return aud_vfs_fseek(ptr, offset, whence); } static int upse_aud_close_impl(void *ptr) { return aud_vfs_fclose(ptr); } static upse_iofuncs_t upse_aud_iofuncs = { upse_aud_open_impl, upse_aud_read_impl, upse_aud_seek_impl, upse_aud_close_impl }; static int is_our_fd(gchar *filename, VFSFile *file) { gchar magic[4]; aud_vfs_fread(magic, 1, 4, file); // only allow PSF1 for now if (!memcmp(magic, "PSF\x01", 4)) return 1; return 0; } void upse_aud_update(unsigned char *buffer, long count, gpointer data) { InputPlayback *playback = (InputPlayback *) data; const int mask = ~((((16 / 8) * 2)) - 1); while (count > 0) { int t = playback->output->buffer_free() & mask; if (playback->playing == FALSE) upse_stop(); if (t > count) playback->pass_audio(playback, FMT_S16_NE, 2, count, buffer, &playback->playing); else { if (t) playback->pass_audio(playback, FMT_S16_NE, 2, t, buffer, &playback->playing); /* XXX: wait for the buffer to drain */ g_usleep((count - t)*1000*5/441/2); } count -= t; buffer += t; } if (seek) { if(upse_seek(seek)) { playback->output->flush(seek); seek = 0; } else // negative time - must make a C time machine { upse_stop(); return; } } if (playback->playing == FALSE) upse_stop(); } static void upse_aud_play(InputPlayback *playback) { upse_psf_t *psf; gchar *name; if(!(playback->data = upse_load(playback->filename, &upse_aud_iofuncs))) return; psf = (upse_psf_t *) playback->data; seek = 0; /* XXX */ name = upse_aud_get_title_psf(playback->filename, psf); playback->set_params(playback, name, psf->length, 44100 * 2 * 2 * 8, 44100, 2); g_free(name); if (!playback->output->open_audio(FMT_S16_NE, 44100, 2)) { upse_free_psf_metadata(psf); playback->error = TRUE; return; } upse_set_audio_callback(upse_aud_update, playback); playback->playing = TRUE; playback->set_pb_ready(playback); for (;;) { upse_execute(); /* we have reached the end of the song or a command was issued */ playback->output->buffer_free(); playback->output->buffer_free(); if (playback->playing == FALSE) break; if (seek) { playback->output->flush(seek); if(!(playback->data = upse_load(playback->filename, &upse_aud_iofuncs))) break; upse_seek(seek); seek = 0; continue; } while (playback->output->buffer_playing()) g_usleep(10000); break; } playback->output->close_audio(); playback->playing = FALSE; playback->eof = TRUE; } static void upse_aud_stop(InputPlayback *playback) { if (!playback->playing) return; playback->output->pause(0); playback->playing = FALSE; upse_free_psf_metadata(playback->data); } static void upse_aud_pause(InputPlayback *playback, short p) { playback->output->pause(p); } static void upse_aud_seek(InputPlayback *playback, int time) { if (!playback->playing) return; seek = time * 1000; } static void upse_aud_getsonginfo(char *fn, char **title, int *length) { upse_psf_t *tmp; if((tmp = upse_get_psf_metadata(fn, &upse_aud_iofuncs))) { *length = tmp->length; *title = upse_aud_get_title_psf(fn, tmp); upse_free_psf_metadata(tmp); } } static Tuple *upse_aud_get_tuple_psf(const gchar *fn, upse_psf_t *psf) { Tuple *tuple = NULL; if (psf->length) { tuple = aud_tuple_new_from_filename(fn); aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, psf->length); aud_tuple_associate_string(tuple, FIELD_ARTIST, NULL, psf->artist); aud_tuple_associate_string(tuple, FIELD_ALBUM, NULL, psf->game); aud_tuple_associate_string(tuple, -1, "game", psf->game); aud_tuple_associate_string(tuple, FIELD_TITLE, NULL, psf->title); aud_tuple_associate_string(tuple, FIELD_GENRE, NULL, psf->genre); aud_tuple_associate_string(tuple, FIELD_COPYRIGHT, NULL, psf->copyright); aud_tuple_associate_string(tuple, FIELD_QUALITY, NULL, "sequenced"); aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, "PlayStation Audio"); aud_tuple_associate_string(tuple, -1, "console", "PlayStation"); aud_tuple_associate_string(tuple, -1, "dumper", psf->psfby); aud_tuple_associate_string(tuple, FIELD_COMMENT, NULL, psf->comment); } return tuple; } static Tuple *get_tuple_psf(gchar *fn) { upse_psf_t *psf = upse_get_psf_metadata(fn, &upse_aud_iofuncs); if (psf != NULL) { Tuple *ret = upse_aud_get_tuple_psf(fn, psf); upse_free_psf_metadata(psf); return ret; } return NULL; } static gchar *upse_aud_get_title_psf(const gchar *fn, upse_psf_t *psf) { gchar *title = NULL; Tuple *tuple = upse_aud_get_tuple_psf(fn, psf); if (tuple != NULL) { title = aud_tuple_formatter_make_title_string(tuple, aud_get_gentitle_format()); aud_tuple_free(tuple); } else title = g_path_get_basename(fn); return title; } static void upse_aud_about(void) { audacious_info_dialog("About " PACKAGE_STRING, PACKAGE " is a plugin and emulation library which produces near-bit-exact\n" "output comparable to a PlayStation. It can be used to play chiptunes, and other\n" "fun things.\n" "\n" "Find out more at http://carpathia.dereferenced.org/~nenolod/upse\n" "\n" PACKAGE_STRING " is licensed to you under the GNU General Public License, \n" "version 2. A copy of this license is included in the " PACKAGE " source kit,\n" "or on the internet at .\n" "\n" "Talk about " PACKAGE " in it's very own forum! \n" "Report bugs in " PACKAGE " to <" PACKAGE_BUGREPORT ">.", "Close", FALSE, G_CALLBACK(gtk_widget_destroy), NULL); } gchar *upse_fmts[] = { "psf", "minipsf", NULL }; InputPlugin upse_ip = { .description = "UNIX Playstation Sound Emulator", .about = upse_aud_about, .play_file = upse_aud_play, .stop = upse_aud_stop, .pause = upse_aud_pause, .seek = upse_aud_seek, .get_song_info = upse_aud_getsonginfo, .get_song_tuple = get_tuple_psf, .is_our_file_from_vfs = is_our_fd, .vfs_extensions = upse_fmts, }; InputPlugin *upse_iplist[] = { &upse_ip, NULL }; SIMPLE_INPUT_PLUGIN(upse, upse_iplist); upse-1.0.0/config.rpath0000644000175000017500000003502511006314306014646 0ustar nenolodnenolod#! /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-2005 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # 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. # # 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. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` cc_basename=`echo "$CC" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; darwin*) case "$cc_basename" in xlc*) wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux*) case $cc_basename in icc* | ecc*) wl='-Wl,' ;; pgcc | pgf77 | pgf90) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; como) wl='-lopt=' ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; sco3.2v5*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) wl='-Wl,' ;; sysv4*MP*) ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. 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/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; 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 cannot use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': 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' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sunos4*) hardcode_direct=yes ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. 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 # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" 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 ;; bsdi[45]*) ;; 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=no if test "$GCC" = yes ; then : else case "$cc_basename" in xlc*) ;; *) ld_shlibs=no ;; esac fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | kfreebsd*-gnu | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10* | hpux11*) if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) 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) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4.2uw2*) hardcode_direct=yes hardcode_minus_L=no ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) ;; sysv5*) hardcode_libdir_flag_spec= ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. libname_spec='lib$name' case "$host_os" in aix3*) ;; aix4* | aix5*) ;; amigaos*) ;; beos*) ;; bsdi[45]*) ;; cygwin* | mingw* | pw32*) shrext=.dll ;; darwin* | rhapsody*) shrext=.dylib ;; dgux*) ;; freebsd1*) ;; kfreebsd*-gnu) ;; freebsd*) ;; gnu*) ;; hpux9* | hpux10* | hpux11*) case "$host_cpu" in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac ;; irix5* | irix6* | nonstopux*) case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux*) ;; knetbsd*-gnu) ;; netbsd*) ;; newsos6) ;; nto-qnx*) ;; openbsd*) ;; os2*) libname_spec='$name' shrext=.dll ;; osf3* | osf4* | osf5*) ;; sco3.2v5*) ;; solaris*) ;; sunos4*) ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) ;; sysv4*MP*) ;; uts4*) ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < 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"]) ]) # 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 ]) # 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])]) # 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]) m4_include([m4/buildsys.m4]) m4_include([m4/gettext.m4]) m4_include([m4/iconv.m4]) m4_include([m4/isc-posix.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/nls.m4]) m4_include([m4/pkg.m4]) m4_include([m4/po.m4]) m4_include([m4/progtest.m4]) m4_include([acinclude.m4]) upse-1.0.0/extra.mk.in0000644000175000017500000002740711006314306014427 0ustar nenolodnenolod@SET_MAKE@ srcdir ?= @srcdir@ top_srcdir ?= @top_srcdir@ VPATH ?= @srcdir@ pkgdatadir ?= $(datadir)/@PACKAGE@ pkglibdir ?= $(libdir)/@PACKAGE@ pkgincludedir ?= $(includedir)/@PACKAGE@ top_builddir ?= . am__cd ?= CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL ?= @INSTALL@ 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@ target_triplet ?= @target@ subdir ?= . ACLOCAL_M4 ?= $(top_srcdir)/aclocal.m4 CONFIG_HEADER ?= config.h CONFIG_CLEAN_FILES ?= audacious.1 audacious.spec audacious.pc \ intl/Makefile SOURCES = DIST_SOURCES = man1dir ?= $(mandir)/man1 am__installdirs ?= "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" NROFF ?= nroff MANS ?= $(man_MANS) am__vpath_adj_setup ?= srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj ?= case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir ?= `echo $$p | sed -e 's|^.*/||'`; pkgconfigDATA_INSTALL ?= $(INSTALL_DATA) DATA ?= $(pkgconfig_DATA) ETAGS ?= etags CTAGS ?= ctags DIST_SUBDIRS ?= $(SUBDIRS) 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@ ALSA_CFLAGS ?= @ALSA_CFLAGS@ ALSA_LIBS ?= @ALSA_LIBS@ AMDEP_FALSE ?= @AMDEP_FALSE@ AMDEP_TRUE ?= @AMDEP_TRUE@ AMIDIPLUG_BACKEND_DIR ?= @AMIDIPLUG_BACKEND_DIR@ AMIDIPLUG_BACKENDS ?= @AMIDIPLUG_BACKENDS@ AMTAR ?= @AMTAR@ AR ?= @AR@ ARCH_DEFINES ?= @ARCH_DEFINES@ ARCH_X86_FALSE ?= @ARCH_X86_FALSE@ ARCH_X86_TRUE ?= @ARCH_X86_TRUE@ ARTSC_CFLAGS ?= @ARTSC_CFLAGS@ ARTSC_LIBS ?= @ARTSC_LIBS@ AUTOCONF ?= @AUTOCONF@ AUTOHEADER ?= @AUTOHEADER@ AUTOMAKE ?= @AUTOMAKE@ AWK ?= @AWK@ BEEP_DEFINES ?= @BEEP_DEFINES@ BEEP_PATH ?= @BEEP_PATH@ BINIO_CFLAGS ?= @BINIO_CFLAGS@ BINIO_LIBS ?= @BINIO_LIBS@ BUILDERS_INCLUDES ?= @BUILDERS_INCLUDES@ BUILDERS_LDFLAGS ?= @BUILDERS_LDFLAGS@ BUILD_INCLUDED_LIBINTL ?= @BUILD_INCLUDED_LIBINTL@ CAIRO_CFLAGS ?= @CAIRO_CFLAGS@ CAIRO_LIBS ?= @CAIRO_LIBS@ CATOBJEXT ?= @CATOBJEXT@ CC = @CC@ CCAS ?= @CCAS@ CCASFLAGS ?= @CCASFLAGS@ CCDEPMODE ?= @CCDEPMODE@ CFLAGS += @CFLAGS@ CPP = @CPP@ CPPFLAGS += @CPPFLAGS@ CXX = @CXX@ CXXCPP ?= @CXXCPP@ CXXDEPMODE ?= @CXXDEPMODE@ CXXFLAGS += @CXXFLAGS@ CYGPATH_W ?= @CYGPATH_W@ DATADIRNAME ?= @DATADIRNAME@ DBUS_CFLAGS ?= @DBUS_CFLAGS@ DBUS_LIBS ?= @DBUS_LIBS@ DCT64 ?= @DCT64@ DEFS ?= @DEFS@ DEPDIR ?= @DEPDIR@ ECHO ?= @ECHO@ ECHO_C ?= @ECHO_C@ ECHO_N ?= @ECHO_N@ ECHO_T ?= @ECHO_T@ EFFECT_PLUGINS ?= @EFFECT_PLUGINS@ EFFECT_PLUGIN_DIR ?= @EFFECT_PLUGIN_DIR@ EGREP ?= @EGREP@ ENABLE_AAC_FALSE ?= @ENABLE_AAC_FALSE@ ENABLE_AAC_TRUE ?= @ENABLE_AAC_TRUE@ ENABLE_AMIDIPLUG_FALSE ?= @ENABLE_AMIDIPLUG_FALSE@ ENABLE_AMIDIPLUG_TRUE ?= @ENABLE_AMIDIPLUG_TRUE@ ENABLE_CROSSFADE_FALSE ?= @ENABLE_CROSSFADE_FALSE@ ENABLE_CROSSFADE_TRUE ?= @ENABLE_CROSSFADE_TRUE@ ENABLE_MPG123_FALSE ?= @ENABLE_MPG123_FALSE@ ENABLE_MPG123_TRUE ?= @ENABLE_MPG123_TRUE@ ENABLE_MUSEPACK_FALSE ?= @ENABLE_MUSEPACK_FALSE@ ENABLE_MUSEPACK_TRUE ?= @ENABLE_MUSEPACK_TRUE@ ENABLE_TIMIDITY_FALSE ?= @ENABLE_TIMIDITY_FALSE@ ENABLE_TIMIDITY_TRUE ?= @ENABLE_TIMIDITY_TRUE@ ENABLE_WMA_FALSE ?= @ENABLE_WMA_FALSE@ ENABLE_WMA_TRUE ?= @ENABLE_WMA_TRUE@ ESD_CFLAGS ?= @ESD_CFLAGS@ ESD_LIBS ?= @ESD_LIBS@ EXEEXT ?= @EXEEXT@ FLUIDSYNTH_CFLAGS ?= @FLUIDSYNTH_CFLAGS@ FLUIDSYNTH_LIBS ?= @FLUIDSYNTH_LIBS@ GCONF_CFLAGS ?= @GCONF_CFLAGS@ GCONF_LIBS ?= @GCONF_LIBS@ GDKX11_CFLAGS ?= @GDKX11_CFLAGS@ GDKX11_LIBS ?= @GDKX11_LIBS@ GENCAT ?= @GENCAT@ GENERAL_PLUGINS ?= @GENERAL_PLUGINS@ GENERAL_PLUGIN_DIR ?= @GENERAL_PLUGIN_DIR@ GLIBC21 ?= @GLIBC21@ GLIB_CFLAGS ?= @GLIB_CFLAGS@ GLIB_LIBS ?= @GLIB_LIBS@ GMODULE_CFLAGS ?= @GMODULE_CFLAGS@ GMODULE_LIBS ?= @GMODULE_LIBS@ GMSGFMT ?= @GMSGFMT@ GNOMEVFS_CFLAGS ?= @GNOMEVFS_CFLAGS@ GNOMEVFS_LIBS ?= @GNOMEVFS_LIBS@ GTK_CFLAGS ?= @GTK_CFLAGS@ GTK_LIBS ?= @GTK_LIBS@ HARDSID_LDADD ?= @HARDSID_LDADD@ HAVE_ADPLUG_FALSE ?= @HAVE_ADPLUG_FALSE@ HAVE_ADPLUG_TRUE ?= @HAVE_ADPLUG_TRUE@ HAVE_ALSA_FALSE ?= @HAVE_ALSA_FALSE@ HAVE_ALSA_TRUE ?= @HAVE_ALSA_TRUE@ HAVE_CDROM_FALSE ?= @HAVE_CDROM_FALSE@ HAVE_CDROM_TRUE ?= @HAVE_CDROM_TRUE@ HAVE_ESD_FALSE ?= @HAVE_ESD_FALSE@ HAVE_ESD_TRUE ?= @HAVE_ESD_TRUE@ HAVE_FLAC_FALSE ?= @HAVE_FLAC_FALSE@ HAVE_FLAC_TRUE ?= @HAVE_FLAC_TRUE@ HAVE_GCONF_FALSE ?= @HAVE_GCONF_FALSE@ HAVE_GCONF_TRUE ?= @HAVE_GCONF_TRUE@ HAVE_GNOME_VFS_FALSE ?= @HAVE_GNOME_VFS_FALSE@ HAVE_GNOME_VFS_TRUE ?= @HAVE_GNOME_VFS_TRUE@ HAVE_JACK_FALSE ?= @HAVE_JACK_FALSE@ HAVE_JACK_TRUE ?= @HAVE_JACK_TRUE@ HAVE_NULL_TRUE ?= @HAVE_NULL_TRUE@ HAVE_LIBSAMPLERATE_FALSE ?= @HAVE_LIBSAMPLERATE_FALSE@ HAVE_LIBSAMPLERATE_TRUE ?= @HAVE_LIBSAMPLERATE_TRUE@ HAVE_LIBSNDFILE_FALSE ?= @HAVE_LIBSNDFILE_FALSE@ HAVE_LIBSNDFILE_TRUE ?= @HAVE_LIBSNDFILE_TRUE@ HAVE_LIBVISUAL_FALSE ?= @HAVE_LIBVISUAL_FALSE@ HAVE_LIBVISUAL_TRUE ?= @HAVE_LIBVISUAL_TRUE@ HAVE_LINUX_JOYSTICK_FALSE ?= @HAVE_LINUX_JOYSTICK_FALSE@ HAVE_LINUX_JOYSTICK_TRUE ?= @HAVE_LINUX_JOYSTICK_TRUE@ HAVE_LIRC_FALSE ?= @HAVE_LIRC_FALSE@ HAVE_LIRC_TRUE ?= @HAVE_LIRC_TRUE@ HAVE_MODPLUG_FALSE ?= @HAVE_MODPLUG_FALSE@ HAVE_MODPLUG_TRUE ?= @HAVE_MODPLUG_TRUE@ HAVE_OGGVORBIS_FALSE ?= @HAVE_OGGVORBIS_FALSE@ HAVE_OGGVORBIS_TRUE ?= @HAVE_OGGVORBIS_TRUE@ HAVE_OSS_FALSE ?= @HAVE_OSS_FALSE@ HAVE_OSS_TRUE ?= @HAVE_OSS_TRUE@ HAVE_SIDPLAY_FALSE ?= @HAVE_SIDPLAY_FALSE@ HAVE_SIDPLAY_TRUE ?= @HAVE_SIDPLAY_TRUE@ HAVE_SOLARIS_FALSE ?= @HAVE_SOLARIS_FALSE@ HAVE_SOLARIS_TRUE ?= @HAVE_SOLARIS_TRUE@ HAVE_SUN_FALSE ?= @HAVE_SUN_FALSE@ HAVE_SUN_TRUE ?= @HAVE_SUN_TRUE@ INPUT_PLUGINS ?= @INPUT_PLUGINS@ INPUT_PLUGIN_DIR ?= @INPUT_PLUGIN_DIR@ INSTALL_DATA ?= @INSTALL_DATA@ INSTALL_PROGRAM ?= @INSTALL_PROGRAM@ INSTALL_SCRIPT ?= @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM ?= @INSTALL_STRIP_PROGRAM@ INSTOBJEXT ?= @INSTOBJEXT@ INTLBISON ?= @INTLBISON@ INTLLIBS ?= @INTLLIBS@ INTLOBJS ?= @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX ?= @INTL_LIBTOOL_SUFFIX_PREFIX@ JACK_CFLAGS ?= @JACK_CFLAGS@ JACK_LIBS ?= @JACK_LIBS@ LDFLAGS ?= @LDFLAGS@ LEDCODE ?= @LEDCODE@ LIBBEEP_MAJOR_VERSION ?= @LIBBEEP_MAJOR_VERSION@ LIBBEEP_MICRO_VERSION ?= @LIBBEEP_MICRO_VERSION@ LIBBEEP_MINOR_VERSION ?= @LIBBEEP_MINOR_VERSION@ FLAC_CFLAGS ?= @FLAC_CFLAGS@ FLAC_LIBS ?= @FLAC_LIBS@ LIBGLADE_CFLAGS ?= @LIBGLADE_CFLAGS@ LIBGLADE_LIBS ?= @LIBGLADE_LIBS@ LIBNMS_CFLAGS ?= @LIBNMS_CFLAGS@ LIBNMS_LIBS ?= @LIBNMS_LIBS@ LIBNMS_SRC ?= @LIBNMS_SRC@ LIBICONV ?= @LIBICONV@ LIBINTL ?= @LIBINTL@ LIBOBJS ?= @LIBOBJS@ LIBS ?= @LIBS@ LIBTOOL ?= @LIBTOOL@ LIBVISUAL_CFLAGS ?= @LIBVISUAL_CFLAGS@ LIBVISUAL_LIBS ?= @LIBVISUAL_LIBS@ LN_S ?= @LN_S@ LTLIBICONV ?= @LTLIBICONV@ LTLIBINTL ?= @LTLIBINTL@ LTLIBOBJS ?= @LTLIBOBJS@ MAKEINFO ?= @MAKEINFO@ MKINSTALLDIRS ?= @MKINSTALLDIRS@ MSGFMT ?= @MSGFMT@ MSGMERGE ?= @MSGMERGE@ MTP_CFLAGS ?= @MTP_CFLAGS@ MTP_LIBS ?= @MTP_LIBS@ OBJEXT ?= @OBJEXT@ OGG_VORBIS_CFLAGS ?= @OGG_VORBIS_CFLAGS@ OGG_VORBIS_LIBS ?= @OGG_VORBIS_LIBS@ OSS_LIBS ?= @OSS_LIBS@ OUTPUT_PLUGINS ?= @OUTPUT_PLUGINS@ OUTPUT_PLUGIN_DIR ?= @OUTPUT_PLUGIN_DIR@ PACKAGE ?= @PACKAGE@ PACKAGE_BUGREPORT ?= @PACKAGE_BUGREPORT@ PACKAGE_NAME ?= @PACKAGE_NAME@ PACKAGE_STRING ?= @PACKAGE_STRING@ PACKAGE_TARNAME ?= @PACKAGE_TARNAME@ PACKAGE_VERSION ?= @PACKAGE_VERSION@ PANGO_CFLAGS ?= @PANGO_CFLAGS@ PANGO_LIBS ?= @PANGO_LIBS@ PANGOCAIRO_CFLAGS ?= @PANGOCAIRO_CFLAGS@ PANGOCAIRO_LIBS ?= @PANGOCAIRO_LIBS@ PATH_SEPARATOR ?= @PATH_SEPARATOR@ PC_REQUIRES ?= @PC_REQUIRES@ PKG_CONFIG ?= @PKG_CONFIG@ PLUGIN_LDFLAGS ?= @PLUGIN_LDFLAGS@ POSUB ?= @POSUB@ RANLIB ?= @RANLIB@ RESID_LDADD ?= @RESID_LDADD@ SAMPLERATE_CFLAGS ?= @SAMPLERATE_CFLAGS@ SAMPLERATE_LIBS ?= @SAMPLERATE_LIBS@ SDL_CFLAGS ?= @SDL_CFLAGS@ SDL_CONFIG ?= @SDL_CONFIG@ SDL_LIBS ?= @SDL_LIBS@ SET_MAKE ?= @SET_MAKE@ SHELL ?= @SHELL@ SIDPLAY1_INCLUDES ?= @SIDPLAY1_INCLUDES@ SIDPLAY1_LDADD ?= @SIDPLAY1_LDADD@ SIDPLAY2_INCLUDES ?= @SIDPLAY2_INCLUDES@ SIDPLAY2_LDADD ?= @SIDPLAY2_LDADD@ SNDFILE_CFLAGS ?= @SNDFILE_CFLAGS@ SNDFILE_LIBS ?= @SNDFILE_LIBS@ STRIP ?= @STRIP@ TAGLIB_CFLAGS ?= @TAGLIB_CFLAGS@ TAGLIB_CONFIG ?= @TAGLIB_CONFIG@ TAGLIB_LIBS ?= @TAGLIB_LIBS@ USE_INCLUDED_LIBINTL ?= @USE_INCLUDED_LIBINTL@ USE_NLS ?= @USE_NLS@ USE_X86ASM_FALSE ?= @USE_X86ASM_FALSE@ USE_X86ASM_TRUE ?= @USE_X86ASM_TRUE@ VERSION ?= @VERSION@ VISUALIZATION_PLUGINS ?= @VISUALIZATION_PLUGINS@ VISUALIZATION_PLUGIN_DIR ?= @VISUALIZATION_PLUGIN_DIR@ XGETTEXT ?= @XGETTEXT@ ac_ct_AR ?= @ac_ct_AR@ ac_ct_CC ?= @ac_ct_CC@ ac_ct_CXX ?= @ac_ct_CXX@ ac_ct_RANLIB ?= @ac_ct_RANLIB@ ac_ct_STRIP ?= @ac_ct_STRIP@ am__fastdepCC_FALSE ?= @am__fastdepCC_FALSE@ am__fastdepCC_TRUE ?= @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE ?= @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE ?= @am__fastdepCXX_TRUE@ am__include ?= @am__include@ am__leading_dot ?= @am__leading_dot@ am__quote ?= @am__quote@ am__tar ?= @am__tar@ am__untar ?= @am__untar@ beepdir ?= @beepdir@ bindir ?= @bindir@ build ?= @build@ build_alias ?= @build_alias@ build_cpu ?= @build_cpu@ build_os ?= @build_os@ build_vendor ?= @build_vendor@ datadir ?= @datadir@ datarootdir ?= @datarootdir@ exec_prefix ?= @exec_prefix@ host ?= @host@ host_alias ?= @host_alias@ host_cpu ?= @host_cpu@ host_os ?= @host_os@ host_vendor ?= @host_vendor@ includedir ?= @includedir@ infodir ?= @infodir@ install_sh ?= @install_sh@ libdir ?= @libdir@ libexecdir ?= @libexecdir@ localedir ?= @localedir@ localstatedir ?= @localstatedir@ mandir ?= @mandir@ mkdir_p ?= @mkdir_p@ oldincludedir ?= @oldincludedir@ pluginsubs ?= @pluginsubs@ prefix ?= @prefix@ program_transform_name ?= @program_transform_name@ sbindir ?= @sbindir@ sharedstatedir ?= @sharedstatedir@ sysconfdir ?= @sysconfdir@ target ?= @target@ target_alias ?= @target_alias@ target_cpu ?= @target_cpu@ target_os ?= @target_os@ target_vendor ?= @target_vendor@ WAV_SNDFILE ?= @WAV_SNDFILE@ VFS_BACKEND ?= @VFS_BACKEND@ CONFIGDB_BACKEND ?= @CONFIGDB_BACKEND@ CURL_CFLAGS ?= @CURL_CFLAGS@ CURL_LIBS ?= @CURL_LIBS@ NEON_CFLAGS ?= @NEON_CFLAGS@ NEON_LIBS ?= @NEON_LIBS@ CHARDET_LIBS ?= @CHARDET_LIBS@ SUBDIR_GUESS ?= @SUBDIR_GUESS@ LIBNOTIFY_CFLAGS ?= @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS ?= @LIBNOTIFY_LIBS@ XML_CPPFLAGS ?= @XML_CPPFLAGS@ XML_LIBS ?= @XML_LIBS@ CONTAINER_PLUGIN_DIR ?= @CONTAINER_PLUGIN_DIR@ CONTAINER_PLUGINS ?= @CONTAINER_PLUGINS@ SHARED_SUFFIX ?= @SHARED_SUFFIX@ PICFLAGS ?= @PICFLAGS@ PICLDFLAGS ?= @PICLDFLAGS@ LIBLDFLAGS ?= @LIBLDFLAGS@ AUDLDFLAGS ?= @AUDLDFLAGS@ WAVPACK_CFLAGS ?= @WAVPACK_CFLAGS@ WAVPACK_LIBS ?= @WAVPACK_LIBS@ XCOMPOSITE_CFLAGS ?= @XCOMPOSITE_CFLAGS@ XCOMPOSITE_LIBS ?= @XCOMPOSITE_LIBS@ XRENDER_CFLAGS ?= @XRENDER_CFLAGS@ XRENDER_LIBS ?= @XRENDER_LIBS@ XXF86VM_CFLAGS ?= @XXF86VM_CFLAGS@ XXF86VM_LIBS ?= @XXF86VM_LIBS@ LIBPROJECTM_CFLAGS ?= @LIBPROJECTM_CFLAGS@ LIBPROJECTM_LIBS ?= @LIBPROJECTM_LIBS@ LIBPROJECTM1_CFLAGS ?= @LIBPROJECTM1_CFLAGS@ LIBPROJECTM1_LIBS ?= @LIBPROJECTM1_LIBS@ MMS_CFLAGS ?= @MMS_CFLAGS@ MMS_LIBS ?= @MMS_LIBS@ MAD_CFLAGS ?= @MAD_CFLAGS@ MAD_LIBS ?= @MAD_LIBS@ IMLIB2_CFLAGS ?= @IMLIB2_CFLAGS@ IMLIB2_LIBS ?= @IMLIB2_LIBS@ SIMD_CFLAGS ?= @SIMD_CFLAGS@ FILEWRITER_LIBS ?= @FILEWRITER_LIBS@ GCC42_CFLAGS ?= @GCC42_CFLAGS@ CDIO_LIBS ?= @CDIO_LIBS@ CDIO_CFLAGS ?= @CDIO_CFLAGS@ CDDB_LIBS ?= @CDDB_LIBS@ CDDB_CFLAGS ?= @CDDB_CFLAGS@ TRANSPORT_PLUGIN_DIR ?= @TRANSPORT_PLUGIN_DIR@ TRANSPORT_PLUGINS ?= @TRANSPORT_PLUGINS@ LIBFLAC_LIBS ?= @LIBFLAC_LIBS@ LIBFLAC_CFLAGS ?= @LIBFLAC_CFLAGS@ MOWGLI_CFLAGS ?= @MOWGLI_CFLAGS@ MOWGLI_LIBS ?= @MOWGLI_LIBS@ plugindir = @plugindir@ AUDACIOUS_CFLAGS ?= @AUDACIOUS_CFLAGS@ AUDACIOUS_LIBS ?= @AUDACIOUS_LIBS@ AO_CFLAGS ?= @AO_CFLAGS@ AO_LIBS ?= @AO_LIBS@ upse-1.0.0/configure.ac0000644000175000017500000000671611006314306014634 0ustar nenolodnenoloddnl Process this file with autoconf to produce a configure script. AC_INIT([upse], [1.0.0], [nenolod+upse@sacredspiral.co.uk]) AC_PREREQ([2.59]) AC_CANONICAL_HOST AC_CANONICAL_TARGET AC_CONFIG_HEADERS([config.h]) dnl libbeep LIBBEEP_MAJOR_VERSION=2 LIBBEEP_MINOR_VERSION=0 LIBBEEP_MICRO_VERSION=0 LIBBEEP_VERSION=$LIBBEEP_MAJOR_VERSION.$LIBBEEP_MINOR_VERSION.$LIBBEEP_MICRO_VERSION AC_SUBST(LIBBEEP_MAJOR_VERSION) AC_SUBST(LIBBEEP_MINOR_VERSION) AC_SUBST(LIBBEEP_MICRO_VERSION) dnl XXX kludge for FreeBSD if test -d "/usr/X11R6/include"; then CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" fi dnl append audacious header path to CPPFLAGS when --prefix is specified. if test "$prefix" != "NONE" ; then CPPFLAGS="$CPPFLAGS -I${includedir}" fi dnl OMK bootstrap AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME]) AC_SUBST([VERSION], [AC_PACKAGE_VERSION]) AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]) dnl Check for C compiler AC_PROG_CC AC_PROG_CXX AC_ISC_POSIX AC_C_BIGENDIAN if test x"$GCC" = x"yes"; then CFLAGS="$CFLAGS -pipe -Wall" CXXFLAGS="$CXXFLAGS -pipe -Wall" fi dnl Locate a program and check that its version is acceptable. dnl AC_PROG_CHECK_VER(var, namelist, version-switch, dnl [version-extract-regexp], version-glob [, do-if-fail]) AC_DEFUN([AC_CHECK_PROG_VER], [AC_CHECK_PROGS([$1], [$2]) if test -z "[$]$1"; then ac_verc_fail=yes else # Found it, now check the version. AC_MSG_CHECKING([version of [$]$1]) changequote(<<,>>)dnl ac_prog_version=`<<$>>$1 $3 2>&1 ifelse(<<$4>>,,, <<| sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'>>)` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; <<$5>>) changequote([,])dnl ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac AC_MSG_RESULT([$ac_prog_version]) fi ifelse([$6],,, [if test $ac_verc_fail = yes; then $6 fi]) ]) GCC42_CFLAGS="-fgnu89-inline" AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v, [version \([egcygnustpi-]*[0-9.]*\)], [4.[2-9]* ], GCC42_CFLAGS="") dnl Check for assembler AM_PROG_AS dnl Checks for various programs AC_PROG_LN_S AC_PROG_MAKE_SET AC_PATH_PROG(RM, rm) AC_PATH_PROG(MV, mv) AC_PATH_PROG(CP, cp) AC_PATH_PROG(AR, ar) AC_PATH_PROG(RANLIB, ranlib) dnl Gettext -nenolod AM_GNU_GETTEXT([external]) dnl Path settings dnl Check for Audacious UPSE_TARGET_AUD="" AC_ARG_ENABLE(audplugin, [ --enable-audplugin enable audacious plugin (default=yes)], audplugin=$enableval, audplugin=yes) if test "x$audplugin" == "xyes"; then PKG_CHECK_MODULES(AUDACIOUS, [audacious >= 1.3.99], [UPSE_TARGET_AUD="upse-audacious" audplugin="yes"], [audplugin="no"] ) fi AC_SUBST(UPSE_TARGET_AUD) AC_ARG_ENABLE(ao, [ --enable-ao enable libao support (default=yes)], ao=$enableval, ao=yes) if test "x$ao" == "xyes"; then PKG_CHECK_MODULES(AO, [ao], [AC_DEFINE(HAVE_AO, 1, [Define this if you have AO.])], [ao="no"] ) fi BUILDSYS_SHARED_LIB BUILDSYS_PROG_IMPLIB CFLAGS="$CFLAGS $EXTRA_CFLAGS" AC_CONFIG_FILES([ buildsys.mk extra.mk ]) AC_OUTPUT echo echo "Features:" echo echo " upse123: yes" echo " + libao support: $ao" echo " audacious 1.4 plugin: $audplugin" echo echo "Type make to compile, and make install to install." echo