addfile ./ALUT.buildinfo.in addfile ./ALUT.cabal addfile ./LICENSE addfile ./Makefile adddir ./Sound adddir ./Sound/ALUT addfile ./Sound/ALUT.hs addfile ./Sound/ALUT/BuiltInSounds.hs addfile ./Sound/ALUT/Constants.hs addfile ./Sound/ALUT/Errors.hs addfile ./Sound/ALUT/Initialization.hs addfile ./Sound/ALUT/Loaders.hs addfile ./Sound/ALUT/Sleep.hs addfile ./Sound/ALUT/Version.hs addfile ./aclocal.m4 addfile ./config.mk.in addfile ./configure.ac adddir ./examples addfile ./examples/Makefile adddir ./include addfile ./include/HsALUT.h.in addfile ./include/Makefile addfile ./package.conf.in addfile ./prologue.txt hunk ./ALUT.buildinfo.in 1 +-- @configure_input@ +-- System-dependent values used by Distribution.Simple.defaultUserHooks +-- +buildable: @BUILD_PACKAGE_BOOL@ +ghc-options: -DCALLCONV=@CALLCONV@ +cc-options: -DCALLCONV=@CALLCONV@ @ALUT_CFLAGS@ +ld-options: @ALUT_LIBS@ +frameworks: @ALUT_FRAMEWORKS@ hunk ./ALUT.cabal 1 +name: ALUT +version: 1.0 +license: BSD3 +license-file: LICENSE +maintainer: Sven Panne +homepage: http://www.openal.org/ +category: Sound +synopsis: A binding for the OpenAL Utility Toolkit +description: + A Haskell binding for the OpenAL Utility Toolkit, which makes + managing of OpenAL contexts, loading sounds in various formats + and creating waveforms very easy. For more information about the + C library on which this binding is based, please see: + . +extra-source-files: + -- The first three files are not in this directory of the CVS + -- repository; copy them from ../.. + config.guess config.sub install-sh + configure.ac configure config.mk.in ALUT.buildinfo.in + include/HsALUTConfig.h.in include/HsALUT.h.in +extra-tmp-files: + config.log config.status autom4te.cache + config.mk ALUT.buildinfo include/HsALUTConfig.h include/HsALUT.h +exposed-modules: + Sound.ALUT, + Sound.ALUT.BuiltInSounds, + Sound.ALUT.Errors, + Sound.ALUT.Initialization, + Sound.ALUT.Loaders, + Sound.ALUT.Sleep, + Sound.ALUT.Version +other-modules: + Sound.ALUT.Constants +include-dirs: include +includes: "HsALUT.h" +c-sources: cbits/HsALUT.c +build-depends: base, OpenAL +extensions: CPP, ForeignFunctionInterface hunk ./LICENSE 1 +Copyright (c) 2005, Sven Panne +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +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. hunk ./Makefile 1 +# ----------------------------------------------------------------------------- + +TOP = .. +include $(TOP)/mk/boilerplate.mk +-include config.mk + +ifneq "$(findstring clean, $(MAKECMDGOALS))" "" +# if we're cleaning, then config.mk might have been cleaned already +ALUT_BUILD_PACKAGE=yes +PACKAGE=ALUT +endif + +ifneq "$(ALUT_BUILD_PACKAGE)" "no" + +# ----------------------------------------------------------------------------- + +SUBDIRS = include + +ifeq "$(IncludeExampleDirsInBuild)" "YES" +SUBDIRS += examples +endif + +ALL_DIRS = Sound/ALUT + +PACKAGE_DEPS = base OpenAL + +SRC_HC_OPTS += -Wall -fffi -Iinclude '-\#include "HsALUT.h"' -cpp + +# WinDoze DLL hell +ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" +SRC_HC_OPTS += -DCALLCONV=stdcall +else +SRC_HC_OPTS += -DCALLCONV=ccall +endif + +PACKAGE_CPP_OPTS += -DMAINTAINER=$(MAINTAINER) + +SRC_HADDOCK_OPTS += -t "HOpenAL Libraries (ALUT package)" + +# ----------------------------------------------------------------------------- + +package.conf.inplace \ +package.conf.installed \ +Sound/ALUT/Constants.$(way_)o : include/HsALUTConfig.h + +endif + +# ----------------------------------------------------------------------------- + +DIST_CLEAN_FILES += ALUT.buildinfo config.cache config.status config.mk + +extraclean:: + $(RM) -rf autom4te.cache + +# ----------------------------------------------------------------------------- + +include $(TOP)/mk/target.mk hunk ./Sound/ALUT/BuiltInSounds.hs 1 +-------------------------------------------------------------------------------- +-- | +-- Module : Sound.ALUT.BuiltInSounds +-- Copyright : (c) Sven Panne 2005 +-- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- +-- Maintainer : sven.panne@aedion.de +-- Stability : provisional +-- Portability : portable +-- +-------------------------------------------------------------------------------- + +module Sound.ALUT.BuiltInSounds ( +) where hunk ./Sound/ALUT/Constants.hs 1 +-- #hide +-------------------------------------------------------------------------------- +-- | +-- Module : Sound.ALUT.Constants +-- Copyright : (c) Sven Panne 2005 +-- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- +-- Maintainer : sven.panne@aedion.de +-- Stability : provisional +-- Portability : portable +-- +-------------------------------------------------------------------------------- + +module Sound.ALUT.Constants where + +import Sound.OpenAL.AL.BasicTypes ( ALint, ALenum ) + +-------------------------------------------------------------------------------- + +#include "HsALUTConfig.h" + +-------------------------------------------------------------------------------- + +alut_API_MAJOR_VERSION, alut_API_MINOR_VERSION :: ALint +alut_API_MAJOR_VERSION = CONST_ALUT_API_MAJOR_VERSION +alut_API_MINOR_VERSION = CONST_ALUT_API_MINOR_VERSION + +-------------------------------------------------------------------------------- + +alut_ERROR_NO_ERROR, alut_ERROR_OUT_OF_MEMORY, alut_ERROR_INVALID_ENUM, + alut_ERROR_INVALID_VALUE, alut_ERROR_INVALID_OPERATION, + alut_ERROR_NO_CURRENT_CONTEXT, alut_ERROR_AL_ERROR_ON_ENTRY, + alut_ERROR_ALC_ERROR_ON_ENTRY, alut_ERROR_OPEN_DEVICE, + alut_ERROR_CLOSE_DEVICE, alut_ERROR_CREATE_CONTEXT, + alut_ERROR_MAKE_CONTEXT_CURRENT, alut_ERROR_DESTROY_CONTEXT, + alut_ERROR_GEN_BUFFERS, alut_ERROR_BUFFER_DATA, alut_ERROR_IO_ERROR, + alut_ERROR_UNSUPPORTED_FILE_TYPE, alut_ERROR_UNSUPPORTED_FILE_SUBTYPE, + alut_ERROR_CORRUPT_OR_TRUNCATED_DATA :: ALenum +alut_ERROR_NO_ERROR = CONST_ALUT_ERROR_NO_ERROR +alut_ERROR_OUT_OF_MEMORY = CONST_ALUT_ERROR_OUT_OF_MEMORY +alut_ERROR_INVALID_ENUM = CONST_ALUT_ERROR_INVALID_ENUM +alut_ERROR_INVALID_VALUE = CONST_ALUT_ERROR_INVALID_VALUE +alut_ERROR_INVALID_OPERATION = CONST_ALUT_ERROR_INVALID_OPERATION +alut_ERROR_NO_CURRENT_CONTEXT = CONST_ALUT_ERROR_NO_CURRENT_CONTEXT +alut_ERROR_AL_ERROR_ON_ENTRY = CONST_ALUT_ERROR_AL_ERROR_ON_ENTRY +alut_ERROR_ALC_ERROR_ON_ENTRY = CONST_ALUT_ERROR_ALC_ERROR_ON_ENTRY +alut_ERROR_OPEN_DEVICE = CONST_ALUT_ERROR_OPEN_DEVICE +alut_ERROR_CLOSE_DEVICE = CONST_ALUT_ERROR_CLOSE_DEVICE +alut_ERROR_CREATE_CONTEXT = CONST_ALUT_ERROR_CREATE_CONTEXT +alut_ERROR_MAKE_CONTEXT_CURRENT = CONST_ALUT_ERROR_MAKE_CONTEXT_CURRENT +alut_ERROR_DESTROY_CONTEXT = CONST_ALUT_ERROR_DESTROY_CONTEXT +alut_ERROR_GEN_BUFFERS = CONST_ALUT_ERROR_GEN_BUFFERS +alut_ERROR_BUFFER_DATA = CONST_ALUT_ERROR_BUFFER_DATA +alut_ERROR_IO_ERROR = CONST_ALUT_ERROR_IO_ERROR +alut_ERROR_UNSUPPORTED_FILE_TYPE = CONST_ALUT_ERROR_UNSUPPORTED_FILE_TYPE +alut_ERROR_UNSUPPORTED_FILE_SUBTYPE = CONST_ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE +alut_ERROR_CORRUPT_OR_TRUNCATED_DATA = CONST_ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA + +-------------------------------------------------------------------------------- + +alut_WAVEFORM_SINE, alut_WAVEFORM_SQUARE, alut_WAVEFORM_SAWTOOTH, + alut_WAVEFORM_WHITENOISE, alut_WAVEFORM_IMPULSE :: ALenum +alut_WAVEFORM_SINE = CONST_ALUT_WAVEFORM_SINE +alut_WAVEFORM_SQUARE = CONST_ALUT_WAVEFORM_SQUARE +alut_WAVEFORM_SAWTOOTH = CONST_ALUT_WAVEFORM_SAWTOOTH +alut_WAVEFORM_WHITENOISE = CONST_ALUT_WAVEFORM_WHITENOISE +alut_WAVEFORM_IMPULSE = CONST_ALUT_WAVEFORM_IMPULSE + +-------------------------------------------------------------------------------- + +alut_LOADER_BUFFER, alut_LOADER_MEMORY :: ALenum +alut_LOADER_BUFFER = CONST_ALUT_LOADER_BUFFER +alut_LOADER_MEMORY = CONST_ALUT_LOADER_MEMORY hunk ./Sound/ALUT/Errors.hs 1 +-------------------------------------------------------------------------------- +-- | +-- Module : Sound.ALUT.Errors +-- Copyright : (c) Sven Panne 2005 +-- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- +-- Maintainer : sven.panne@aedion.de +-- Stability : provisional +-- Portability : portable +-- +-------------------------------------------------------------------------------- + +module Sound.ALUT.Errors ( +) where hunk ./Sound/ALUT/Initialization.hs 1 +-------------------------------------------------------------------------------- +-- | +-- Module : Sound.ALUT.Initialization +-- Copyright : (c) Sven Panne 2005 +-- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- +-- Maintainer : sven.panne@aedion.de +-- Stability : provisional +-- Portability : portable +-- +-------------------------------------------------------------------------------- + +module Sound.ALUT.Initialization ( +) where hunk ./Sound/ALUT/Loaders.hs 1 +-------------------------------------------------------------------------------- +-- | +-- Module : Sound.ALUT.Loaders +-- Copyright : (c) Sven Panne 2005 +-- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- +-- Maintainer : sven.panne@aedion.de +-- Stability : provisional +-- Portability : portable +-- +-------------------------------------------------------------------------------- + +module Sound.ALUT.Loaders ( +) where hunk ./Sound/ALUT/Sleep.hs 1 +-------------------------------------------------------------------------------- +-- | +-- Module : Sound.ALUT.Sleep +-- Copyright : (c) Sven Panne 2005 +-- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- +-- Maintainer : sven.panne@aedion.de +-- Stability : provisional +-- Portability : portable +-- +-------------------------------------------------------------------------------- + +module Sound.ALUT.Sleep ( +) where hunk ./Sound/ALUT/Version.hs 1 +-------------------------------------------------------------------------------- +-- | +-- Module : Sound.ALUT.Version +-- Copyright : (c) Sven Panne 2005 +-- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- +-- Maintainer : sven.panne@aedion.de +-- Stability : provisional +-- Portability : portable +-- +-------------------------------------------------------------------------------- + +module Sound.ALUT.Version ( +) where hunk ./Sound/ALUT.hs 1 +-------------------------------------------------------------------------------- +-- | +-- Module : Sound.ALUT +-- Copyright : (c) Sven Panne 2005 +-- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- +-- Maintainer : sven.panne@aedion.de +-- Stability : provisional +-- Portability : portable +-- +-- A Haskell binding for the OpenAL Utility Toolkit, which makes managing of +-- OpenAL contexts, loading sounds in various formats and creating waveforms +-- very easy. For more information about the C library on which this binding is +-- based, please see: . +-- +-------------------------------------------------------------------------------- + +module Sound.ALUT ( + module Sound.OpenAL, + + module Sound.ALUT.Errors, + module Sound.ALUT.Initialization, + module Sound.ALUT.Loaders, + module Sound.ALUT.BuiltInSounds, + module Sound.ALUT.Version, + module Sound.ALUT.Sleep +) where + +import Sound.OpenAL + +import Sound.ALUT.Errors +import Sound.ALUT.Initialization +import Sound.ALUT.Loaders +import Sound.ALUT.BuiltInSounds +import Sound.ALUT.Version +import Sound.ALUT.Sleep hunk ./aclocal.m4 1 +# FP_COMPUTE_INT(EXPRESSION, VARIABLE, INCLUDES, IF-FAILS) +# --------------------------------------------------------- +# Assign VARIABLE the value of the compile-time EXPRESSION using INCLUDES for +# compilation. Execute IF-FAILS when unable to determine the value. Works for +# cross-compilation, too. +# +# Implementation note: We are lazy and use an internal autoconf macro, but it +# is supported in autoconf versions 2.50 up to the actual 2.57, so there is +# little risk. +AC_DEFUN([FP_COMPUTE_INT], +[_AC_COMPUTE_INT([$1], [$2], [$3], [$4])[]dnl +])# FP_COMPUTE_INT + + +# FP_CHECK_CONST(EXPRESSION, [INCLUDES = DEFAULT-INCLUDES], [VALUE-IF-FAIL = -1]) +# ------------------------------------------------------------------------------- +# Defines CONST_EXPRESSION to the value of the compile-time EXPRESSION, using +# INCLUDES. If the value cannot be determined, use VALUE-IF-FAIL. +AC_DEFUN([FP_CHECK_CONST], +[AS_VAR_PUSHDEF([fp_Cache], [fp_cv_const_$1])[]dnl +AC_CACHE_CHECK([value of $1], fp_Cache, +[FP_COMPUTE_INT([$1], fp_check_const_result, [AC_INCLUDES_DEFAULT([$2])], + [fp_check_const_result=m4_default([$3], ['-1'])]) +AS_VAR_SET(fp_Cache, [$fp_check_const_result])])[]dnl +AC_DEFINE_UNQUOTED(AS_TR_CPP([CONST_$1]), AS_VAR_GET(fp_Cache), [The value of $1.])[]dnl +AS_VAR_POPDEF([fp_Cache])[]dnl +])# FP_CHECK_CONST + + +# FP_CHECK_CONSTS_TEMPLATE(EXPRESSION...) +# --------------------------------------- +# autoheader helper for FP_CHECK_CONSTS +m4_define([FP_CHECK_CONSTS_TEMPLATE], +[AC_FOREACH([fp_Const], [$1], + [AH_TEMPLATE(AS_TR_CPP(CONST_[]fp_Const), + [The value of ]fp_Const[.])])[]dnl +])# FP_CHECK_CONSTS_TEMPLATE + + +# FP_CHECK_CONSTS(EXPRESSION..., [INCLUDES = DEFAULT-INCLUDES], [VALUE-IF-FAIL = -1]) +# ----------------------------------------------------------------------------------- +# List version of FP_CHECK_CONST +AC_DEFUN([FP_CHECK_CONSTS], +[FP_CHECK_CONSTS_TEMPLATE([$1])dnl +for fp_const_name in $1 +do +FP_CHECK_CONST([$fp_const_name], [$2], [$3]) +done +])# FP_CHECK_CONSTS + +# FP_ARG_OPENAL +# ------------- +AC_DEFUN([FP_ARG_OPENAL], +[AC_ARG_ENABLE([openal], + [AC_HELP_STRING([--enable-openal], + [build a Haskell binding for OpenAL (default=autodetect)])], + [enable_openal=$enableval], + [enable_openal=yes]) +])# FP_ARG_OPENAL + + +# FP_ARG_ALUT +# ------------- +AC_DEFUN([FP_ARG_ALUT], +[AC_ARG_ENABLE([alut], + [AC_HELP_STRING([--enable-alut], + [build a Haskell binding for ALUT (default=autodetect)])], + [enable_alut=$enableval], + [enable_alut=yes]) +])# FP_ARG_ALUT + + +# FP_CHECK_ALUT +# ------------- +AC_DEFUN([FP_CHECK_ALUT], +[AC_REQUIRE([AC_CANONICAL_TARGET]) +ALUT_CFLAGS= +case $target_os in +darwin*) + ALUT_LIBS= + ALUT_FRAMEWORKS=ALUT + ;; +*) + fp_save_libs="$LIBS" + LIBS="$LIBS -lopenal" + AC_SEARCH_LIBS([alutGetMajorVersion], [alut alut32], [ALUT_LIBS="$ac_cv_search_alutGetMajorVersion"]) + test x"$ALUT_LIBS" = x"none required" && ALUT_LIBS= + LIBS="$fp_save_libs" + ALUT_FRAMEWORKS= + ;; +esac +AC_SUBST([ALUT_CFLAGS]) +AC_SUBST([ALUT_LIBS]) +AC_SUBST([ALUT_FRAMEWORKS]) +])# FP_CHECK_ALUT + + +# FP_HEADER_ALUT +# -------------- +# Check for an ALUT header, setting the variable fp_found_alut_header to no/yes, +# depending on the outcome. +AC_DEFUN([FP_HEADER_ALUT], +[if test -z "$fp_found_alut_header"; then + fp_found_alut_header=no + AC_CHECK_HEADERS([AL/alut.h OpenAL/alut.h], [fp_found_alut_header=yes; break]) +fi +]) # FP_HEADER_AL hunk ./config.mk.in 1 +ALUT_BUILD_PACKAGE=@ALUT_BUILD_PACKAGE@ +ifneq "$(ALUT_BUILD_PACKAGE)" "no" +ALUT_CFLAGS=@ALUT_CFLAGS@ +ALUT_LIBS=@ALUT_LIBS@ +ALUT_FRAMEWORKS=@ALUT_FRAMEWORKS@ +PACKAGE=@PACKAGE_TARNAME@ +VERSION=@PACKAGE_VERSION@ +MAINTAINER=@PACKAGE_BUGREPORT@ +endif hunk ./configure.ac 1 +AC_INIT([Haskell ALUT package], [1.0], [sven.panne@aedion.de], [ALUT]) + +# Safety check: Ensure that we are in the correct source directory. +AC_CONFIG_SRCDIR([include/HsALUT.h.in]) + +# The first file mentioned below will be generated by autoheader and contains +# defines which are needed during package build time only. The second header +# contains all kinds of stuff which is needed for using this package. +AC_CONFIG_HEADERS([include/HsALUTConfig.h include/HsALUT.h]) + +# We set this to "yes" later when we have found ALUT libs and headers. +ALUT_BUILD_PACKAGE=no +AC_SUBST([ALUT_BUILD_PACKAGE]) + +# Shall we build this package at all? +FP_ARG_ALUT + +if test x"$enable_alut" = xyes; then + +# Check for ALUT include paths and libraries +FP_CHECK_ALUT + +if test "$ALUT_LIBS" = no; then + AC_MSG_WARN([no ALUT library found, so this package will not be built]) +else + +# check for ALUT include files +FP_HEADER_ALUT + +if test "$fp_found_alut_header" = no; then + AC_MSG_WARN([no ALUT header found, so this package will not be built]) +else + +ALUT_BUILD_PACKAGE=yes + +FP_CHECK_CONSTS([ALUT_API_MAJOR_VERSION ALUT_API_MINOR_VERSION ALUT_ERROR_NO_ERROR ALUT_ERROR_OUT_OF_MEMORY ALUT_ERROR_INVALID_ENUM ALUT_ERROR_INVALID_VALUE ALUT_ERROR_INVALID_OPERATION ALUT_ERROR_NO_CURRENT_CONTEXT ALUT_ERROR_AL_ERROR_ON_ENTRY ALUT_ERROR_ALC_ERROR_ON_ENTRY ALUT_ERROR_OPEN_DEVICE ALUT_ERROR_CLOSE_DEVICE ALUT_ERROR_CREATE_CONTEXT ALUT_ERROR_MAKE_CONTEXT_CURRENT ALUT_ERROR_DESTROY_CONTEXT ALUT_ERROR_GEN_BUFFERS ALUT_ERROR_BUFFER_DATA ALUT_ERROR_IO_ERROR ALUT_ERROR_UNSUPPORTED_FILE_TYPE ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA ALUT_WAVEFORM_SINE ALUT_WAVEFORM_SQUARE ALUT_WAVEFORM_SAWTOOTH ALUT_WAVEFORM_WHITENOISE ALUT_WAVEFORM_IMPULSE ALUT_LOADER_BUFFER ALUT_LOADER_MEMORY], [#if HAVE_AL_ALUT_H +#include +#elif HAVE_OPENAL_ALUT_H +#include +#endif]) + +AC_DEFINE_UNQUOTED([ALUT_CFLAGS], + [`echo '' $ALUT_CFLAGS | sed -e 's/-[[^ ]]*/,"&"/g' -e 's/^ *,//'`], + [C flags for ALUT, as a list of string literals.]) + +AC_DEFINE_UNQUOTED([ALUT_LIBS], + [`echo '' $ALUT_LIBS | sed -e 's/-[[^ ]]*/,"&"/g' -e 's/^ *,//'`], + [Library flags for ALUT, as a list of string literals.]) + +AC_DEFINE_UNQUOTED([ALUT_FRAMEWORKS], + [`echo '' $ALUT_FRAMEWORKS | sed -e 's/-[[^ ]]*/,"&"/g' -e 's/^ *,//'`], + [Framework flags for ALUT, as a list of string literals.]) + +fi +fi +fi + +if test "$ALUT_BUILD_PACKAGE" = yes; then + BUILD_PACKAGE_BOOL=True +else + BUILD_PACKAGE_BOOL=False +fi +AC_SUBST([BUILD_PACKAGE_BOOL]) + +case "$host" in +*-mingw32) CALLCONV=stdcall ;; +*) CALLCONV=ccall ;; +esac +AC_SUBST([CALLCONV]) + +AC_CONFIG_FILES([config.mk ALUT.buildinfo]) +AC_OUTPUT hunk ./examples/Makefile 1 +# ----------------------------------------------------------------------------- + +TOP = ../.. +include $(TOP)/mk/boilerplate.mk + +# ----------------------------------------------------------------------------- + +ifeq "$(way)" "" + +#SUBDIRS = foo bar + +all: + @echo "No examples yet..." + +endif + +# ----------------------------------------------------------------------------- + +include $(TOP)/mk/target.mk hunk ./include/HsALUT.h.in 1 +/* ----------------------------------------------------------------------------- + * + * Module : C support for Sound.ALUT + * Copyright : (c) Sven Panne 2005 + * License : BSD-style (see the file libraries/ALUT/LICENSE) + * + * Maintainer : sven.panne@aedion.de + * Stability : provisional + * Portability : portable + * + * -------------------------------------------------------------------------- */ + +#ifndef HSALUT_H +#define HSALUT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_AL_ALUT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENAL_ALUT_H + +#if HAVE_AL_ALUT_H +#include +#elif HAVE_OPENAL_ALUT_H +#include +#endif + +#endif hunk ./include/Makefile 1 +# ----------------------------------------------------------------------------- + +TOP = ../.. +include $(TOP)/mk/boilerplate.mk + +H_FILES = $(wildcard *.h) + +includedir = $(libdir)/include +INSTALL_INCLUDES = $(H_FILES) + +DIST_CLEAN_FILES += HsALUT.h HsALUTConfig.h + +include $(TOP)/mk/target.mk hunk ./package.conf.in 1 +#include "HsALUTConfig.h" + +name: PACKAGE +version: VERSION +license: BSD3 +maintainer: MAINTAINER +exposed: True + +exposed-modules: + Sound.ALUT, + Sound.ALUT.BuiltInSounds, + Sound.ALUT.Errors, + Sound.ALUT.Initialization, + Sound.ALUT.Loaders, + Sound.ALUT.Sleep, + Sound.ALUT.Version + +hidden-modules: + Sound.ALUT.Constants + +import-dirs: IMPORT_DIR +library-dirs: LIB_DIR +hs-libraries: "HSALUT" +extra-libraries: +include-dirs: INCLUDE_DIR +includes: "HsALUT.h" +depends: base, OpenAL +hugs-options: +cc-options: ALUT_CFLAGS +ld-options: ALUT_LIBS +framework-dirs: +frameworks: ALUT_FRAMEWORKS + +haddock-interfaces: HADDOCK_IFACE +haddock-html: HTML_DIR hunk ./prologue.txt 1 +The @ALUT@ package contains a Haskell binding for the OpenAL Utility Toolkit, +which makes managing of OpenAL contexts, loading sounds in various formats and +creating waveforms very easy. For more information about the C library on which +this binding is based, please see: +. hunk ./Makefile 23 -ALL_DIRS = Sound/ALUT +ALL_DIRS = Sound Sound/ALUT addfile ./Sound/ALUT/ALboolean.hs hunk ./ALUT.cabal 33 + Sound.ALUT.ALboolean, hunk ./ALUT.cabal 38 -build-depends: base, OpenAL +build-depends: base, OpenGL, OpenAL hunk ./Makefile 25 -PACKAGE_DEPS = base OpenAL +PACKAGE_DEPS = base OpenGL OpenAL hunk ./Sound/ALUT/ALboolean.hs 1 +-- #hide +-------------------------------------------------------------------------------- +-- | +-- Module : Sound.ALUT.ALboolean +-- Copyright : (c) Sven Panne 2005 +-- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- +-- Maintainer : sven.panne@aedion.de +-- Stability : provisional +-- Portability : portable +-- +-------------------------------------------------------------------------------- + +module Sound.ALUT.ALboolean ( + unmarshalALboolean +) where + +import Sound.OpenAL.AL.BasicTypes ( ALboolean ) + +-------------------------------------------------------------------------------- + +unmarshalALboolean :: ALboolean -> Bool +unmarshalALboolean = (/= 0) hunk ./Sound/ALUT/BuiltInSounds.hs 14 + helloWorld, sine, square, sawtooth, whiteNoise, impulse hunk ./Sound/ALUT/BuiltInSounds.hs 17 +import Control.Monad ( liftM ) +import Sound.ALUT.Constants ( + alut_WAVEFORM_SINE, alut_WAVEFORM_SQUARE, alut_WAVEFORM_SAWTOOTH, + alut_WAVEFORM_WHITENOISE, alut_WAVEFORM_IMPULSE ) +import Sound.OpenAL.AL.BasicTypes ( ALuint, ALenum, ALfloat ) +import Sound.OpenAL.AL.Buffer ( Buffer ) + +-------------------------------------------------------------------------------- + +makeBuffer :: ALuint -> Buffer +makeBuffer = undefined + +-------------------------------------------------------------------------------- + +helloWorld :: IO Buffer +helloWorld = liftM makeBuffer alutCreateBufferHelloWorld + +foreign import CALLCONV unsafe "alutCreateBufferHelloWorld" + alutCreateBufferHelloWorld :: IO ALuint + +-------------------------------------------------------------------------------- + +type Frequency = ALfloat +type Phase = ALfloat +type Duration = ALfloat + +sine :: Frequency -> Phase -> Duration -> IO Buffer +sine = createBufferWaveform alut_WAVEFORM_SINE + +square :: Frequency -> Phase -> Duration -> IO Buffer +square = createBufferWaveform alut_WAVEFORM_SQUARE + +sawtooth :: Frequency -> Phase -> Duration -> IO Buffer +sawtooth = createBufferWaveform alut_WAVEFORM_SAWTOOTH + +whiteNoise :: Duration -> IO Buffer +whiteNoise = createBufferWaveform alut_WAVEFORM_WHITENOISE 1 0 + +impulse :: Frequency -> Phase -> Duration -> IO Buffer +impulse = createBufferWaveform alut_WAVEFORM_IMPULSE + +createBufferWaveform :: ALenum -> Frequency -> Phase -> Duration -> IO Buffer +createBufferWaveform = undefined + +foreign import CALLCONV unsafe "alutCreateBufferWaveform" + alutCreateBufferWaveform :: ALenum -> ALfloat -> ALfloat -> ALfloat -> IO ALuint + hunk ./Sound/ALUT/Errors.hs 14 + alutGetError, alutGetErrorString hunk ./Sound/ALUT/Errors.hs 17 +import Foreign.C.String ( CString ) +import Sound.OpenAL.AL.BasicTypes ( ALenum ) + +-------------------------------------------------------------------------------- + +foreign import CALLCONV unsafe "alutGetError" + alutGetError :: IO ALenum + +foreign import CALLCONV unsafe "alutGetErrorString" + alutGetErrorString :: ALenum -> IO CString + hunk ./Sound/ALUT/Initialization.hs 14 + ContextMode(..), runALUT hunk ./Sound/ALUT/Initialization.hs 17 +import Control.Monad ( liftM2 ) +import Data.IORef ( newIORef, readIORef, writeIORef ) +import Foreign.C.String ( CString ) +import Foreign.C.Types ( CInt ) +import Foreign.Ptr ( Ptr, nullPtr ) +import Sound.ALUT.ALboolean ( unmarshalALboolean ) +import Sound.OpenAL.AL.BasicTypes ( ALboolean ) +import System.Environment ( getProgName, getArgs ) + +-- Ugly: I see something like this in almost every package now... +#ifdef __NHC__ +import IO ( bracket ) + +finally :: IO a -> IO b -> IO a +action `finally` sequel = bracket (return ()) (const sequel) (const action) + +#else +import Control.Exception ( finally ) +#endif + +-------------------------------------------------------------------------------- + +data ContextMode = + CreateNewContext + | ReuseContext + deriving ( Eq, Ord, Show ) + +runALUT :: ContextMode -> Maybe (String, [String]) -> (String -> [String] -> IO a) -> IO (Maybe a) +runALUT mode maybeNameAndArgs action = do + let initAction = case mode of + CreateNewContext -> alutInit + ReuseContext -> alutInitWithoutContext + (name,args) <- maybe (liftM2 (,) getProgName getArgs) return maybeNameAndArgs + + -- Alas, neither "bracket" nor "finally" return the result of the "after" + -- computation, so we have to use some trickery involving an IO reference. + -- We could define a separate Monad for this, but it's not worth the trouble. + (check,returnIfFailed) <- do + okRef <- newIORef True + return (\act -> do returnValue <- act + writeIORef okRef (unmarshalALboolean returnValue), + \act -> do ok <- readIORef okRef + if ok then act else return Nothing) + + check $ initAction nullPtr nullPtr + returnIfFailed $ do + returnValue <- action name args `finally` check alutExit + returnIfFailed $ + return $ Just returnValue + +foreign import CALLCONV unsafe "alutInit" + alutInit :: Ptr CInt -> Ptr CString -> IO ALboolean + +foreign import CALLCONV unsafe "alutInitWithoutContext" + alutInitWithoutContext :: Ptr CInt -> Ptr CString -> IO ALboolean + +foreign import CALLCONV unsafe "alutExit" + alutExit :: IO ALboolean + hunk ./Sound/ALUT/Loaders.hs 14 + SoundDataSource(..), createBuffer, createBufferData, + bufferMIMETypes, bufferDataMIMETypes hunk ./Sound/ALUT/Loaders.hs 18 +import Control.Monad ( liftM ) +import Foreign.C.String ( CString, peekCString, withCString ) +import Foreign.Ptr ( Ptr ) +import Graphics.Rendering.OpenGL.GL.StateVar ( + GettableStateVar, makeGettableStateVar ) +import Sound.ALUT.Constants ( alut_LOADER_BUFFER, alut_LOADER_MEMORY ) +import Sound.OpenAL.AL.BasicTypes ( ALuint, ALsizei, ALenum, ALfloat ) +import Sound.OpenAL.AL.Buffer ( Buffer, BufferData ) +import System.IO ( FilePath ) + +-------------------------------------------------------------------------------- + +makeBuffer :: ALuint -> Buffer +makeBuffer = undefined + +-------------------------------------------------------------------------------- + +data SoundDataSource a = + File FilePath + | FileImage (Ptr a) ALsizei +#ifdef __HADDOCK__ +-- Help Haddock a bit, because it doesn't do any instance inference. +instance Eq (SoundDataSource a) +instance Ord (SoundDataSource a) +instance Show (SoundDataSource a) +#else + deriving ( Eq, Ord, Show ) +#endif + +-------------------------------------------------------------------------------- + +createBuffer :: SoundDataSource a -> IO Buffer +createBuffer src = + liftM makeBuffer $ + case src of + File filePath -> withCString filePath alutCreateBufferFromFile + FileImage buf size -> alutCreateBufferFromFileImage buf size + +foreign import CALLCONV unsafe "alutCreateBufferFromFile" + alutCreateBufferFromFile :: CString -> IO ALuint + +foreign import CALLCONV unsafe "alutCreateBufferFromFileImage" + alutCreateBufferFromFileImage :: Ptr a -> ALsizei -> IO ALuint + +-------------------------------------------------------------------------------- + +createBufferData :: SoundDataSource a -> IO (BufferData b) +createBufferData src = + case src of + File filePath -> withCString filePath $ \p -> foo (alutLoadMemoryFromFile p) + FileImage buf size -> foo (alutLoadMemoryFromFileImage buf size) + +foo :: (Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b)) -> IO (BufferData b) +foo = undefined + +foreign import CALLCONV unsafe "alutLoadMemoryFromFile" + alutLoadMemoryFromFile :: CString -> Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b) + +foreign import CALLCONV unsafe "alutLoadMemoryFromFileImage" + alutLoadMemoryFromFileImage :: Ptr a -> ALsizei -> Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b) + +-------------------------------------------------------------------------------- + +bufferMIMETypes :: GettableStateVar [String] +bufferMIMETypes = mimeTypes alut_LOADER_BUFFER + +bufferDataMIMETypes :: GettableStateVar [String] +bufferDataMIMETypes = mimeTypes alut_LOADER_MEMORY + +mimeTypes :: ALenum -> GettableStateVar [String] +mimeTypes loaderType = + makeGettableStateVar $ do + ts <- alutGetMIMETypes loaderType + liftM (splitBy (== ',')) $ peekCString ts + +splitBy :: (a -> Bool) -> [a] -> [[a]] +splitBy _ [] = [] +splitBy p xs = case break p xs of + (ys, [] ) -> [ys] + (ys, _:zs) -> ys : splitBy p zs + +foreign import CALLCONV unsafe "alutGetMIMETypes" + alutGetMIMETypes :: ALenum -> IO CString + hunk ./Sound/ALUT/Sleep.hs 14 + microSleep hunk ./Sound/ALUT/Sleep.hs 17 +import Control.Monad ( liftM ) +import Sound.ALUT.ALboolean ( unmarshalALboolean ) +import Sound.OpenAL.AL.BasicTypes ( ALboolean, ALuint ) + +-------------------------------------------------------------------------------- + +microSleep :: ALuint -> IO Bool +microSleep = liftM unmarshalALboolean . alutMicroSleep + +foreign import CALLCONV unsafe "alutMicroSleep" + alutMicroSleep :: ALuint -> IO ALboolean + hunk ./Sound/ALUT/Version.hs 14 + apiVersion, version hunk ./Sound/ALUT/Version.hs 17 +import Control.Monad ( liftM2 ) +import Graphics.Rendering.OpenGL.GL.StateVar ( + GettableStateVar, makeGettableStateVar ) +import Sound.OpenAL.AL.BasicTypes ( ALint ) +import Sound.ALUT.Constants ( alut_API_MAJOR_VERSION, alut_API_MINOR_VERSION ) + +-------------------------------------------------------------------------------- + +apiVersion :: (ALint, ALint) +apiVersion = (alut_API_MAJOR_VERSION, alut_API_MINOR_VERSION) + +-------------------------------------------------------------------------------- + +version :: GettableStateVar (ALint, ALint) +version = + makeGettableStateVar (liftM2 (,) alutGetMajorVersion alutGetMinorVersion) + +foreign import CALLCONV unsafe "alutGetMajorVersion" + alutGetMajorVersion :: IO ALint + +foreign import CALLCONV unsafe "alutGetMinorVersion" + alutGetMinorVersion :: IO ALint + hunk ./package.conf.in 19 + Sound.ALUT.ALboolean, hunk ./package.conf.in 28 -depends: base, OpenAL +depends: base, OpenGL, OpenAL hunk ./Sound/ALUT/BuiltInSounds.hs 14 - helloWorld, sine, square, sawtooth, whiteNoise, impulse + helloWorld, Phase, Duration, sine, square, sawtooth, impulse, whiteNoise hunk ./Sound/ALUT/BuiltInSounds.hs 23 +import Sound.OpenAL.ALC.Context ( Frequency ) hunk ./Sound/ALUT/BuiltInSounds.hs 40 -type Frequency = ALfloat -type Phase = ALfloat -type Duration = ALfloat +type Phase = Float + +type Duration = Float hunk ./Sound/ALUT/BuiltInSounds.hs 53 -whiteNoise :: Duration -> IO Buffer -whiteNoise = createBufferWaveform alut_WAVEFORM_WHITENOISE 1 0 - hunk ./Sound/ALUT/BuiltInSounds.hs 56 +whiteNoise :: Duration -> IO Buffer +whiteNoise = createBufferWaveform alut_WAVEFORM_WHITENOISE 1 0 + hunk ./Sound/ALUT/BuiltInSounds.hs 60 -createBufferWaveform = undefined +createBufferWaveform shape frequency phase duration = + liftM makeBuffer $ + alutCreateBufferWaveform shape frequency phase duration hunk ./Sound/ALUT/Errors.hs 14 - alutGetError, alutGetErrorString + ALUTError(..), ALUTErrorCategory(..), alutErrors hunk ./Sound/ALUT/Errors.hs 17 -import Foreign.C.String ( CString ) +import Foreign.C.String ( CString, peekCString ) +import Graphics.Rendering.OpenGL.GL.StateVar ( + GettableStateVar, makeGettableStateVar ) hunk ./Sound/ALUT/Errors.hs 21 +import Sound.ALUT.Constants ( + alut_ERROR_NO_ERROR, alut_ERROR_OUT_OF_MEMORY, alut_ERROR_INVALID_ENUM, + alut_ERROR_INVALID_VALUE, alut_ERROR_INVALID_OPERATION, + alut_ERROR_NO_CURRENT_CONTEXT, alut_ERROR_AL_ERROR_ON_ENTRY, + alut_ERROR_ALC_ERROR_ON_ENTRY, alut_ERROR_OPEN_DEVICE, + alut_ERROR_CLOSE_DEVICE, alut_ERROR_CREATE_CONTEXT, + alut_ERROR_MAKE_CONTEXT_CURRENT, alut_ERROR_DESTROY_CONTEXT, + alut_ERROR_GEN_BUFFERS, alut_ERROR_BUFFER_DATA, alut_ERROR_IO_ERROR, + alut_ERROR_UNSUPPORTED_FILE_TYPE, alut_ERROR_UNSUPPORTED_FILE_SUBTYPE, + alut_ERROR_CORRUPT_OR_TRUNCATED_DATA ) hunk ./Sound/ALUT/Errors.hs 34 +data ALUTError = ALUTError ALUTErrorCategory String + deriving ( Eq, Ord, Show ) + +data ALUTErrorCategory = + ALUTInvalidEnum + | ALUTInvalidValue + | ALUTInvalidOperation + | ALUTOutOfMemory + | ALUTNoCurrentContext + | ALUTALErrorOnEntry + | ALUTALCErrorOnEntry + | ALUTOpenDeviceFailed + | ALUTCloseDeviceFailed + | ALUTCreateContextFailed + | ALUTMakeContextCurrentFailed + | ALUTDestroyContextFailed + | ALUTGenBuffersFailed + | ALUTBufferDataFailed + | ALUTIOError + | ALUTUnsupportedFileType + | ALUTUnsupportedFileSubtype + | ALUTCorruptOrTruncatedData + deriving ( Eq, Ord, Show ) + +unmarshalALUTErrorCategory :: ALenum -> ALUTErrorCategory +unmarshalALUTErrorCategory x + | x == alut_ERROR_INVALID_ENUM = ALUTInvalidEnum + | x == alut_ERROR_INVALID_VALUE = ALUTInvalidValue + | x == alut_ERROR_INVALID_OPERATION = ALUTInvalidOperation + | x == alut_ERROR_OUT_OF_MEMORY = ALUTOutOfMemory + | x == alut_ERROR_NO_CURRENT_CONTEXT = ALUTNoCurrentContext + | x == alut_ERROR_AL_ERROR_ON_ENTRY = ALUTALErrorOnEntry + | x == alut_ERROR_ALC_ERROR_ON_ENTRY = ALUTALCErrorOnEntry + | x == alut_ERROR_OPEN_DEVICE = ALUTOpenDeviceFailed + | x == alut_ERROR_CLOSE_DEVICE = ALUTCloseDeviceFailed + | x == alut_ERROR_CREATE_CONTEXT = ALUTCreateContextFailed + | x == alut_ERROR_MAKE_CONTEXT_CURRENT = ALUTMakeContextCurrentFailed + | x == alut_ERROR_DESTROY_CONTEXT = ALUTDestroyContextFailed + | x == alut_ERROR_GEN_BUFFERS = ALUTGenBuffersFailed + | x == alut_ERROR_BUFFER_DATA = ALUTBufferDataFailed + | x == alut_ERROR_IO_ERROR = ALUTIOError + | x == alut_ERROR_UNSUPPORTED_FILE_TYPE = ALUTUnsupportedFileType + | x == alut_ERROR_UNSUPPORTED_FILE_SUBTYPE = ALUTUnsupportedFileSubtype + | x == alut_ERROR_CORRUPT_OR_TRUNCATED_DATA = ALUTCorruptOrTruncatedData + | otherwise = error ("unmarshalALUTErrorCategory: illegal value " ++ show x) + +-------------------------------------------------------------------------------- + +alutErrors :: GettableStateVar [ALUTError] +alutErrors = + makeGettableStateVar $ do + c <- alutGetError + if c == alut_ERROR_NO_ERROR + then return [] + else do + p <- alutGetErrorString c + s <- peekCString p + return [ ALUTError (unmarshalALUTErrorCategory c) s ] + hunk ./Sound/ALUT/Initialization.hs 14 - ContextMode(..), runALUT + ArgumentConsumer, Runner, runALUT, runALUTUsingCurrentContext, + withProgNameAndArgs hunk ./Sound/ALUT/Initialization.hs 18 -import Control.Monad ( liftM2 ) hunk ./Sound/ALUT/Initialization.hs 39 -data ContextMode = - CreateNewContext - | ReuseContext - deriving ( Eq, Ord, Show ) +type ArgumentConsumer a = String -> [String] -> a hunk ./Sound/ALUT/Initialization.hs 41 -runALUT :: ContextMode -> Maybe (String, [String]) -> (String -> [String] -> IO a) -> IO (Maybe a) -runALUT mode maybeNameAndArgs action = do - let initAction = case mode of - CreateNewContext -> alutInit - ReuseContext -> alutInitWithoutContext - (name,args) <- maybe (liftM2 (,) getProgName getArgs) return maybeNameAndArgs +type Runner a = ArgumentConsumer (IO a) -> IO (Maybe a) hunk ./Sound/ALUT/Initialization.hs 43 +-------------------------------------------------------------------------------- + +runALUT :: ArgumentConsumer (Runner a) +runALUT = runner alutInit + +type InitAction = Ptr CInt -> Ptr CString -> IO ALboolean + +foreign import CALLCONV unsafe "alutInit" + alutInit :: InitAction + +-------------------------------------------------------------------------------- + +runALUTUsingCurrentContext :: ArgumentConsumer (Runner a) +runALUTUsingCurrentContext = runner alutInitWithoutContext + +foreign import CALLCONV unsafe "alutInitWithoutContext" + alutInitWithoutContext :: InitAction + +-------------------------------------------------------------------------------- + +runner :: InitAction -> String -> [String] -> Runner a +runner initAction name args action = do hunk ./Sound/ALUT/Initialization.hs 81 -foreign import CALLCONV unsafe "alutInit" - alutInit :: Ptr CInt -> Ptr CString -> IO ALboolean - -foreign import CALLCONV unsafe "alutInitWithoutContext" - alutInitWithoutContext :: Ptr CInt -> Ptr CString -> IO ALboolean - hunk ./Sound/ALUT/Initialization.hs 84 +-------------------------------------------------------------------------------- + +withProgNameAndArgs :: (ArgumentConsumer (Runner a)) -> Runner a +withProgNameAndArgs alutRunner action = do + n <- getProgName + a <- getArgs + alutRunner n a action + hunk ./Sound/ALUT/Loaders.hs 25 -import Sound.OpenAL.AL.Buffer ( Buffer, BufferData ) +import Sound.OpenAL.AL.Buffer ( Buffer, MemoryRegion(..), BufferData ) hunk ./Sound/ALUT/Loaders.hs 37 - | FileImage (Ptr a) ALsizei + | FileImage (MemoryRegion a) hunk ./Sound/ALUT/Loaders.hs 54 - FileImage buf size -> alutCreateBufferFromFileImage buf size + FileImage (MemoryRegion buf size) -> alutCreateBufferFromFileImage buf size hunk ./Sound/ALUT/Loaders.hs 68 - FileImage buf size -> foo (alutLoadMemoryFromFileImage buf size) + FileImage (MemoryRegion buf size) -> foo (alutLoadMemoryFromFileImage buf size) hunk ./Sound/ALUT/Sleep.hs 23 -microSleep :: ALuint -> IO Bool -microSleep = liftM unmarshalALboolean . alutMicroSleep +microSleep :: Int -> IO Bool +microSleep = liftM unmarshalALboolean . alutMicroSleep . fromIntegral hunk ./Sound/ALUT/Version.hs 14 - apiVersion, version + alutAPIVersion, alutVersion hunk ./Sound/ALUT/Version.hs 25 -apiVersion :: (ALint, ALint) -apiVersion = (alut_API_MAJOR_VERSION, alut_API_MINOR_VERSION) +alutAPIVersion :: String +alutAPIVersion = makeVersionString alut_API_MAJOR_VERSION alut_API_MINOR_VERSION + +makeVersionString :: ALint -> ALint -> String +makeVersionString major minor = show major ++ "." ++ show minor hunk ./Sound/ALUT/Version.hs 33 -version :: GettableStateVar (ALint, ALint) -version = - makeGettableStateVar (liftM2 (,) alutGetMajorVersion alutGetMinorVersion) +alutVersion :: GettableStateVar String +alutVersion = + makeGettableStateVar $ + liftM2 makeVersionString alutGetMajorVersion alutGetMinorVersion hunk ./ALUT.cabal 33 - Sound.ALUT.ALboolean, hunk ./Sound/ALUT/ALboolean.hs 1 --- #hide --------------------------------------------------------------------------------- --- | --- Module : Sound.ALUT.ALboolean --- Copyright : (c) Sven Panne 2005 --- License : BSD-style (see the file libraries/ALUT/LICENSE) --- --- Maintainer : sven.panne@aedion.de --- Stability : provisional --- Portability : portable --- --------------------------------------------------------------------------------- - -module Sound.ALUT.ALboolean ( - unmarshalALboolean -) where - -import Sound.OpenAL.AL.BasicTypes ( ALboolean ) - --------------------------------------------------------------------------------- - -unmarshalALboolean :: ALboolean -> Bool -unmarshalALboolean = (/= 0) rmfile ./Sound/ALUT/ALboolean.hs hunk ./Sound/ALUT/BuiltInSounds.hs 23 +import Sound.OpenAL.AL.BufferInternal ( unmarshalBuffer ) hunk ./Sound/ALUT/BuiltInSounds.hs 28 -makeBuffer :: ALuint -> Buffer -makeBuffer = undefined - --------------------------------------------------------------------------------- - -helloWorld :: IO Buffer -helloWorld = liftM makeBuffer alutCreateBufferHelloWorld +helloWorld :: IO (Maybe Buffer) +helloWorld = liftM unmarshalBuffer alutCreateBufferHelloWorld hunk ./Sound/ALUT/BuiltInSounds.hs 40 -sine :: Frequency -> Phase -> Duration -> IO Buffer +sine :: Frequency -> Phase -> Duration -> IO (Maybe Buffer) hunk ./Sound/ALUT/BuiltInSounds.hs 43 -square :: Frequency -> Phase -> Duration -> IO Buffer +square :: Frequency -> Phase -> Duration -> IO (Maybe Buffer) hunk ./Sound/ALUT/BuiltInSounds.hs 46 -sawtooth :: Frequency -> Phase -> Duration -> IO Buffer +sawtooth :: Frequency -> Phase -> Duration -> IO (Maybe Buffer) hunk ./Sound/ALUT/BuiltInSounds.hs 49 -impulse :: Frequency -> Phase -> Duration -> IO Buffer +impulse :: Frequency -> Phase -> Duration -> IO (Maybe Buffer) hunk ./Sound/ALUT/BuiltInSounds.hs 52 -whiteNoise :: Duration -> IO Buffer +whiteNoise :: Duration -> IO (Maybe Buffer) hunk ./Sound/ALUT/BuiltInSounds.hs 55 -createBufferWaveform :: ALenum -> Frequency -> Phase -> Duration -> IO Buffer +createBufferWaveform :: ALenum -> Frequency -> Phase -> Duration -> IO (Maybe Buffer) hunk ./Sound/ALUT/BuiltInSounds.hs 57 - liftM makeBuffer $ + liftM unmarshalBuffer $ hunk ./Sound/ALUT/Initialization.hs 22 -import Sound.ALUT.ALboolean ( unmarshalALboolean ) +import Sound.OpenAL.AL.ALboolean ( unmarshalALboolean ) hunk ./Sound/ALUT/Loaders.hs 20 -import Foreign.Ptr ( Ptr ) +import Foreign.Marshal.Alloc ( alloca ) +import Foreign.Storable ( Storable(peek) ) +import Foreign.Ptr ( Ptr, nullPtr ) hunk ./Sound/ALUT/Loaders.hs 27 -import Sound.OpenAL.AL.Buffer ( Buffer, MemoryRegion(..), BufferData ) +import Sound.OpenAL.AL.Buffer ( Buffer, MemoryRegion(..), BufferData(..) ) +import Sound.OpenAL.AL.BufferInternal ( unmarshalBuffer ) +import Sound.OpenAL.AL.Format ( unmarshalFormat ) hunk ./Sound/ALUT/Loaders.hs 34 -makeBuffer :: ALuint -> Buffer -makeBuffer = undefined - --------------------------------------------------------------------------------- - hunk ./Sound/ALUT/Loaders.hs 48 -createBuffer :: SoundDataSource a -> IO Buffer +createBuffer :: SoundDataSource a -> IO (Maybe Buffer) hunk ./Sound/ALUT/Loaders.hs 50 - liftM makeBuffer $ + liftM unmarshalBuffer $ hunk ./Sound/ALUT/Loaders.hs 63 -createBufferData :: SoundDataSource a -> IO (BufferData b) -createBufferData src = - case src of - File filePath -> withCString filePath $ \p -> foo (alutLoadMemoryFromFile p) - FileImage (MemoryRegion buf size) -> foo (alutLoadMemoryFromFileImage buf size) +createBufferData :: SoundDataSource a -> IO (Maybe (BufferData b)) +createBufferData src = case src of + File filePath -> + withCString filePath $ \fp -> loadWith (alutLoadMemoryFromFile fp) + FileImage (MemoryRegion buf size) -> + loadWith (alutLoadMemoryFromFileImage buf size) hunk ./Sound/ALUT/Loaders.hs 70 -foo :: (Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b)) -> IO (BufferData b) -foo = undefined +loadWith :: (Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b)) -> IO (Maybe (BufferData b)) +loadWith loader = + alloca $ \formatBuf -> + alloca $ \sizeBuf -> + alloca $ \frequencyBuf -> do + buf <- loader formatBuf sizeBuf frequencyBuf + if buf == nullPtr + then return Nothing + else do + format <- peek formatBuf + size <- peek sizeBuf + frequency <- peek frequencyBuf + return $ Just (BufferData (MemoryRegion buf size) (unmarshalFormat format) frequency) hunk ./Sound/ALUT/Sleep.hs 18 -import Sound.ALUT.ALboolean ( unmarshalALboolean ) +import Sound.OpenAL.AL.ALboolean ( unmarshalALboolean ) hunk ./package.conf.in 19 - Sound.ALUT.ALboolean, adddir ./examples/Basic addfile ./examples/Basic/HelloWorld.hs addfile ./examples/Basic/Makefile addfile ./examples/Basic/PlayFile.hs adddir ./examples/TestSuite addfile ./examples/TestSuite/Makefile addfile ./examples/TestSuite/TestFileLoader.hs addfile ./examples/TestSuite/file1.wav addfile ./examples/TestSuite/file2.au addfile ./examples/TestSuite/file3.raw hunk ./examples/Basic/HelloWorld.hs 1 +{- + HelloWorld.hs (adapted from hello_world.c in freealut) + Copyright (c) Sven Panne 2005 + This file is part of the ALUT package & distributed under a BSD-style license + See the file libraries/ALUT/LICENSE +-} + +import Graphics.Rendering.OpenGL +import Sound.ALUT + +-- This is the Haskell version of the 'Hello World' program from the ALUT +-- reference manual. + +main :: IO (Maybe Bool) +main = + withProgNameAndArgs runALUT $ \_progName _args -> do + helloBuffer <- helloWorld + [helloSource] <- genObjectNames 1 + buffer helloSource $= helloBuffer + play [helloSource] + microSleep 3000000 hunk ./examples/Basic/Makefile 1 +# ----------------------------------------------------------------------------- + +TOP = ../../.. +include $(TOP)/mk/boilerplate.mk + +# ----------------------------------------------------------------------------- + +EXAMPLES := $(wildcard *.hs) +BINS := $(addsuffix $(exeext),$(EXAMPLES:.hs=)) +CLEAN_FILES += $(BINS) + +HC = $(GHC_INPLACE) +MKDEPENDHS = $(GHC_INPLACE) +SRC_HC_OPTS += -Wall -O -package ALUT + +all:: $(BINS) + +$(BINS): %$(exeext): %.o + $(HC) -o $@ $(HC_OPTS) $(LD_OPTS) $< + +# ----------------------------------------------------------------------------- + +include $(TOP)/mk/target.mk hunk ./examples/Basic/PlayFile.hs 1 +{- + PlayFile.hs (adapted from playfile.c in freealut) + Copyright (c) Sven Panne 2005 + This file is part of the ALUT package & distributed under a BSD-style license + See the file libraries/ALUT/LICENSE +-} + +import Control.Monad +import Data.List +import Graphics.Rendering.OpenGL +import Sound.ALUT +import System.Exit +import System.IO + +-- This program loads and plays a variety of files. + +printErrors :: String -> [String] -> IO () +printErrors prefix errs = do + hPutStrLn stderr . concat . (prefix :) . intersperse "," $ errs + exitFailure + +printALErrors :: String -> [ALError] -> IO () +printALErrors prefix errs = printErrors prefix [ d | ALError _ d <- errs ] + +printALUTErrors :: String -> [ALUTError] -> IO () +printALUTErrors prefix errs = printErrors prefix [ d | ALUTError _ d <- errs ] + +-- Check every 0.1 seconds if the sound is still playing. +waitWhilePlaying :: Source -> IO () +waitWhilePlaying source = do + microSleep 100000 + state <- get (sourceState source) + when (state == Playing) $ + waitWhilePlaying source + +playFile :: FilePath -> IO () +playFile fileName = do + -- Create an AL buffer from the given sound file. + maybeBuffer <- createBuffer (File fileName) + case maybeBuffer of + + Nothing -> do + errs <- get alutErrors + printALUTErrors ("Error loading file: ") errs + + justBuffer -> do + -- Generate a single source, attach the buffer to it and start playing. + [source] <- genObjectNames 1 + buffer source $= justBuffer + play [source] + + -- Normally nothing should go wrong above, but one never knows... + errs <- get alErrors + unless (null errs) $ + printALErrors "Error while trying to play sound: " errs + + waitWhilePlaying source + +main :: IO () +main = do + -- Initialise ALUT and eat any ALUT-specific commandline flags. + ok <- withProgNameAndArgs runALUT $ \progName args -> do + + -- Check for correct usage. + unless (length args == 1) $ do + hPutStrLn stderr ("usage: " ++ progName ++ " ") + exitFailure + + -- If everything is OK, play the sound file and exit when finished. + playFile (head args) + + when (ok == Nothing) $ do + errs <- get alutErrors + printALUTErrors "Error during ALUT (de-)initialization" errs hunk ./examples/Makefile 9 - -#SUBDIRS = foo bar - -all: - @echo "No examples yet..." - +SUBDIRS = Basic TestSuite hunk ./examples/TestSuite/Makefile 1 +# ----------------------------------------------------------------------------- + +TOP = ../../.. +include $(TOP)/mk/boilerplate.mk + +# ----------------------------------------------------------------------------- + +EXAMPLES := $(wildcard *.hs) +BINS := $(addsuffix $(exeext),$(EXAMPLES:.hs=)) +CLEAN_FILES += $(BINS) + +HC = $(GHC_INPLACE) +MKDEPENDHS = $(GHC_INPLACE) +SRC_HC_OPTS += -Wall -O -package ALUT + +all:: $(BINS) + +$(BINS): %$(exeext): %.o + $(HC) -o $@ $(HC_OPTS) $(LD_OPTS) $< + +# ----------------------------------------------------------------------------- + +include $(TOP)/mk/target.mk hunk ./examples/TestSuite/TestFileLoader.hs 1 +{- + TestFileLoader.hs (adapted from test_fileloader.c in freealut) + Copyright (c) Sven Panne 2005 + This file is part of the ALUT package & distributed under a BSD-style license + See the file libraries/ALUT/LICENSE +-} + +import Control.Monad +import Data.List +import Graphics.Rendering.OpenGL +import Sound.ALUT +import System.Exit +import System.IO + +-- This program loads and plays a variety of files, basically an automated +-- version of Basic/PlayFile.hs. + +printErrors :: String -> [String] -> IO () +printErrors prefix errs = do + hPutStrLn stderr . concat . (prefix :) . intersperse "," $ errs + exitFailure + +printALErrors :: String -> [ALError] -> IO () +printALErrors prefix errs = printErrors prefix [ d | ALError _ d <- errs ] + +printALUTErrors :: String -> [ALUTError] -> IO () +printALUTErrors prefix errs = printErrors prefix [ d | ALUTError _ d <- errs ] + +-- Check every 0.1 seconds if the sound is still playing. +waitWhilePlaying :: Source -> IO () +waitWhilePlaying source = do + microSleep 100000 + state <- get (sourceState source) + when (state == Playing) $ + waitWhilePlaying source + +playFile :: FilePath -> IO () +playFile fileName = do + -- Create an AL buffer from the given sound file. + maybeBuffer <- createBuffer (File fileName) + case maybeBuffer of + + Nothing -> do + errs <- get alutErrors + printALUTErrors ("Error loading file: ") errs + + justBuffer -> do + -- Generate a single source, attach the buffer to it and start playing. + [source] <- genObjectNames 1 + buffer source $= justBuffer + play [source] + + -- Normally nothing should go wrong above, but one never knows... + errs <- get alErrors + unless (null errs) $ + printALErrors "Error while trying to play sound: " errs + + waitWhilePlaying source + +main :: IO () +main = do + -- Initialise ALUT and eat any ALUT-specific commandline flags. + ok <- withProgNameAndArgs runALUT $ \_progName _args -> do + + -- If everything is OK, play the sound files and exit when finished. + mapM_ playFile [ "file1.wav", "file2.au", "file3.raw" ] + + when (ok == Nothing) $ do + errs <- get alutErrors + printALUTErrors "Error during ALUT (de-)initialization" errs binary ./examples/TestSuite/file1.wav oldhex * newhex *524946465e18000057415645666d74201000000001000100112b0000112b000001000800646174 *61e8170000848484848484848484848080808080808080808080808080807c5c362c3a64888988 *8888886c42343e62898e8c8e8c8e7a4e3a3e5e8a94929094804a3e6a949692967e4a4272969694 *967c4a46789a96969878484c7e9a989698744850829c989896724854889c9898966e48588a9c98 *98946a485e8e9c989a92664862909c989a90624a66949a969a8c5e4c6c969a969a8a5c4c70989a *969a88584e749898969a84564e789a9896988458507698989698885a4e70969a96988a604e6c94 *9a96988e644e68909a9698926a50628c9a96969470525e899a96969474525a869a9696967a5658 *82989694967e58567c98969496845c547896969496885e5472949694968a64546e929694968c68 *52688e9694948e6c52648a9694949478585a8096949494845e5672929492948c6a54668a969494 *9276585e8296949294825e5876929492948a68586a8c949292907458608494929292805e5a7892 *9492928966586c8c94929290725a6286949292927e605e7a9292909288665a6e8e9290928e705a *64889490909280605c76909290908c705a64869290909082625c76909290908c705c6686929090 *9082645e748e9290908c705c66869290909082645e748e9090908c725e668492908e9082645e74 *8e908e8e8c74606684908e8e90826660748c908e8e8c74606684908e8e8e846660748c908e8e8c *7862627c8e8e8e8e8970606884908e8e8e84686070898e8e8e8e7c6462788e8e8e8e8c76626880 *8e8e8e8e886e626c888e8c8e8a6e3c1c243c4e66889a867272889898988964361c26507694a2a0 *968078849a9e8968543a2a3c6a9ea8a4a4a08a7c8292886a56505050708a9ea8a4a49e703a2c4a *8aaaa6a6a49c845c42506489a6a69c88828c8662545e82988a8690a0a68e66564e5c8094a4a6a4 *a494603838609aa8a4a4a2947c5648566c92a8a4948688907c5c56668a94888996a2a08460544e *68899aa4a4a2a28850384676a0a6a2a49e8e7452505c7498a6a0908689927a5c56648892898996 *a0a08a68564e5e8298a0a2a0a0986c423e5889a4a2a0a096897054565e7a9aa49a8c888e92745c *586a8890898c9a9e9e8664544c64899aa0a09e9e90624244648ea2a09e9c90886e5858607e9ca0 *948a8992906e5a5a6e898e8a929c9c9a8062524e668a9c9e9e9c9c946a48445c849e9e9c9c928a *7e625a5a6c8a9e988c898a968868585c72898c8a949a9a987e6252506a8c9c9c9c9a9a90684c4a *60849c9c9a9a908a7e645a5a6c8a9e968c898c9686685a5e72888c8c949a9a967c6052526c8e9c *9a9a989a8c684e4e64849a9a9a98908a826a5e5a66829a988e8a8a9490725e5a667e8c8c8e9898 *988e725c505876949a989896988a6650506484989a98968e8a826c5e5c688498968c8a8a948e72 *5e5a687e8c8c909696968c725c525c78949896969496896652526684989896968e8a826c5e5c6a *8496948c8a8a929076625c64788a8c8e949494927e64565668889696969494948060545a6e8898 *9694948c8a846e605e688094948c8a8a909070340e103a82a09c9c9a9a96622412246098a4a2a2 *a09e824c26224a7c96a6a6a4a48c644a38486e8090a6a6a8966c54545a727a7c8aa4a06a5476a4 *ac9c896c342c68a8aca8ac9662546c827c7c8c8a625886acaaa8a47230286296a8aaaa8a5c5c8c *9c867c7c664e6494aea8a8a87e403c68848ea4a8805a6a98ac9c897a4e365e9eaca8a8a076565e *7c807e8c98765a76a2a8a6a082462c5490a8a8a8986c5c7e96887c807a605e7ea4a8a4a69a5e38 *4c7a8c9aa89e765c709ca49084785440649aa8a4a4a2805a527080808c9e8660668ea6a49e8c66 *3a4076a2a6a2a48c6460808c827c8480686282a2a4a0a48c543a568292a0a498725e769c9a8880 *785850749aa4a0a09c7a525274828694a080626a90a2a0948668424878a0a2a0a0947060708482 *7e848a7a626c92a29e9e98724640688c9aa0a0926e607a988e827e7c625a7092a09e9c9c84584c *688288929e906e647c9a9e92867a56486492a09c9c9c82666276827e828c8a6e647e9a9c9a9884 *5a4256849a9c9c9a80646c898e827e807a66667a989c9a9a987852506c848a989c8e706678969a *8c847c625062899c9a989a8e6e5e667c8082899480686c899a98968e78544a628a9a9a98988068 *6c8489827e82806e6878949a9896967652526e868e98988e726676929488807c6a5a6888989896 *968e725e627a80848a96866c6a809696948a8064505c7e989696968e74687284847e808682706a *7c94969494907456546e88909696907a6a728a9288807e7258342c404a5c7a98907a78899c9c9c *9a7e4a2826466886a2a69c867a849aa29a7e64462c32588aa6a6a4a2908080929a7c625450465a *869ca6a6a4a4894c2e3c70a0a8a4a69c8a7252505a729aa89e8a828a947658566c8a8c848c9ea4 *9e7a5c4c486c90a2a6a4a2a07842364e84a4a6a4a496886c52545e7ea0a6968886928e6a585c76 *8c898894a0a294705848527c98a2a2a0a098663e3c5e8ea4a2a29e90826454586486a2a0908888 *948c6a585a728a8a89949ea09a785e4c4c6e92a0a0a09e9e82503e4a7498a29ea0968a80645858 *6689a09a8c888a988866585e76898a8a989e9e9474584a527898a09e9e9c9a784e42567c9aa09c *9e90897e665a5a6c8ca0948a888e988262566076898a8e9a9c9c9070584a547a989e9c9c9a9a7e *56465270909e9c9c94898874605a6078969a8e898a9494785e586478898a909a989a8e6e564a58 *7e9a9c9a9a98987c564a5672909c9a9a928988746258607a96988c8a8a9692765e5a64788a8c92 *9a98988c6e544c5c809a9a989896947a564c5a728e9c98989089897a665a5e728e988e8a8a9296 *84665a5e6c848c8e969896968266525266899a98989696927658505c728e9a96969089897a665c *60728e968c8a8a909482665a5e6e848c8e94969494806452546889989696949490765a525e748e *9896948e89897a665c60748e968c8a8a9094866a5c5e6a7e8c8c929494948a705a525c78929694 *9494948a705a566278909694948e89897c685e62728a948c8a8a8e94864e180a24629a9e9c9c98 *9c7e3c161a4484a2a2a29ea090643624386a8a9ea8a2a49872544240627a849ca6a6a07c5a545a *6c7a788294a680546294aca4927c48264892aea8aaa2765464828078828c725872a2aaa6a88c48 *264884a0a8aa9c6c587aa0907e7c704e5482a8aaa6a8945838567e8898aa92645e88a8a4928460 *364286aca8a6a6885e5a74827c8494845e6694aaa4a4945e30407aa0a6a6a27c5c6e9490807c7e *66586c96a8a4a4a27a44406a8690a2a68860648ca69a898062425088a8a4a2a48e6654687e7e84 *94946c6080a2a4a0967a48365c92a4a2a49a725c728c887c80826e607298a4a0a09c6c3e46728a *98a2a082606a90a08e827c644a608ca4a0a0a08962506880828a9c8e6a64829ea09a8c784e4060 *92a29ea09c7e626a80867e7e88826866849e9e9c9e8856405682949e9e9a7c626e9096887e7e6c *5866889e9e9c9c90684e5c7a828a989a7a626e909e988a8264485282a09c9c9c8e6c626e82807e *888c786472929e9a9a906c484c72909a9c9c8c6c647e9288807e7e6a62708e9c9a989a895e4e60 *7e88909a967c666e8c9c9488806e54587a9a9a9898947a646276807e848e8a70687c9698989286 *624a567c969a98988a6e667a8c867e7e827268708a9a989698885e50607e899298947e686e8998 *8e8480725a5c7a96989696947e666074808086908e7468768e969690887054526e909896969480 *6a6c8088807e8284746a728c9694949484605462808a929694846e6c82928c82807864422a3846 *546c8e98807680969e9c9c8a5c2e20385e7a98a6a28e7c7e92a0a0896a50322a4678a0a8a4a498 *847e8a9c88685650464c7896a4a6a4a49a6232325892a8a6a6a2907e5a4a54648aa6a492848696 *845e545e829086899aa4a48a6450445c889ea6a4a2a48c52363e6e9ca8a4a49c8c7a5850586e94 *a69c8c848c9678585466888e888e9ea29e7e5e4c4a6a90a0a4a2a0a07c48384c7ea2a4a2a29689 *7256545c769aa4988a889096765a5666848c898e9ca09e88644e465e889ea2a09ea09260404262 *8ca2a0a09c8e886e58565e7c9ca09289899492705a586a848c8a949e9e9c80604c4a6890a09e9e *9c9e895840486a90a09e9e968a866e5c5862809c9a8e898a988c6a585a6c868c8c989c9c987e5e *4c4c6a909e9c9c9a9c8c62484a62869e9c9c988c897c6458586c8c9e928a89909a8464585c7086 *8c8e989a9a967a5c4a4e6e929e9a9a989a89624a4e66869c9c9a968a897e665a5a6e8c9c908a8a *92988264585e70868c8e989898947a5c4c5272949c9a9a989888624c5266869a9a98948a8a826c *5c5a68849a928a8a8e968c705c5a647a8c8c949896988c70584e5a7c9898989896968462505468 *86989898948a8a826c5c5a688698928a8a8e968a6e5c5a667c8c8c929694968a6e56505c7e9698 *96969494846252566a86989696928a8a826c5c5c6a8696908a8a8e948c74605a64768a8c909494 *94907c6252566c8a9894949494907a5e525a6e89989694908a8a826e5e5c688294908a8a8c928e *6c320c103c84a09c9c9a9a965e221026629aa4a2a2a09e824a2422487c98a6a6a4a48a624a3646 *6c7e92a8a6a6946c56545a70787c8ca49c68547aa6aa9a8666302e70aaaca8aa9262566e82787c *8c89625c89aca8a8a06c2e2c6698a8aaaa895c62909a847a7c62506896aca8a8a67a3e3c6a848e *a6a67c5a6e9caa9a8876483664a0aca6a89e7456607c7c7e8c96725a7aa4a8a69e7c402e5892a8 *a6a896685c8094867a7e78606080a6a8a4a6965a364c7a8a9ca89e745c749ea48e827650446a9c *a8a4a4a07e5854727e808c9e84626a92a6a29c8a6238427aa2a4a2a48a6464808a7e7c847e6864 *84a2a2a0a289503a588494a0a49670607a9e96847e745652769ca4a0a09a785254748086969e7e *626c92a29e92846440487ca2a2a0a0926e607084807c848a78647094a29e9e986e44446a8c9ca0 *a0906c627c988c807c7a625e7494a09c9c9c82564c688088949e8e6c647e9c9c908476544a6896 *a09c9c9a80666476807c828c896c66829c9c9a9682564258869a9c9c9a7e666c8a8c827c807866 *667e9a9c9a9a967450506e848a989c8c6e667c98988a827a6052648c9c9a989a8c6e60667c7e82 *8a9480686e8a9a98968c76524c668c9a9a98967e686e8488807c827e6e6a7a9498969694725252 *6e868e98988c726878949286807a665a6a89989896968c705e647a80848c96846c6a8296969489 *7e60505c82989696968c72687484827e7e8680706c7e94969494907054546e8890969690786a72 *8a9086807c70542c2c404e64829e8e78788a9e9c9e94744222264a6e8ca4a49c847a869aa29476 *5c422a366094a8a6a4a28e7e809492725c504e48668a9ea8a6a4a47e422c427ea8a8a6a69c8968 *484e5c7ca2a89c89828c8e6c565874928c8690a0a69870564a4e7694a2a6a4a49c6c3a32548ea8 *a4a4a29684624c546288a4a4968886928862545c7e92898896a2a28c68544a5a849aa2a4a0a290 *5c383e6698a6a2a29e907e5a5056688ca4a0908889948662565e7c908a8996a0a09470584a5278 *96a0a2a09e9c784a3c507e9ea2a0a0968a7a5c54586e90a29a8c888c967e5e54607e8c8a8c9a9e *9e8e6a544a58829aa09e9e9e986c46405a849ea09e9e9089785e585a7294a0948a899096785c56 *647e8c8a909c9c9c896852485c829c9e9c9c9a98764e445678989e9c9c928a846a5a5862829c9a *8e898a9690705a5868808c8a929a9a9a8868524a5e869c9c9c9a9a94724e485a7a969c9a9a908a *846c5c5864829a968c8a8c968c6e5a5868808c8c949a98988666524e62889c9a9a98989270524c *5c7a949c9898908a8874605a607a94988e8a8a92947a60586074898c8e969898947a5e4e526e8e *9a989896968e6e544e5e7a949a98968e8a8872605a627a94968c8a8a92927a625a6274898c8e96 *9696927a5e50566e8e98969694968c6e5652607c949896948e8a8872605a627a92948c8a8a9092 *7e645a5e6e868c8c92949494866a58546280969696949494866654546680949694948c8a887462 *5a63798f938d89898f9180695d5f6f838b8b91939193876f5b57617f939593939191886d595967 *7f919593918d898777675f63778b938b89898d91836b62626f818b8b8d918f918977645a607389 *9391918f8f8f7f665b606f839191918f898887776862667789908b89898b8e877264636c7b8989 *8b8e8e8e8d7f6c615f6c83908e8e8e8c8e8770615f6a7b8c908e8e8a88887f6e676770838e8c89 *88898c8a7b6b656b768589898c8c8c8c8574676269798a8e8c8c8c8c8a7f6d646670808c8e8c8c *8887877d716a6a72818c8a8787878a8a7f6f686a738088888a8c8a8a887d6d666671838c8c8c8a *8a8a86766a676c78868c8c8a88878683786e6a6e7a878b888787878a86786e6b707a8588888a8a *8a8a85766c676e7a888b8a8a8a888881736b69727c878b89898786868378706d707a8689878686 *8788877d726d6f7580878788888888877f746b6c727f888988888888877f726d6d747d87898787 *8786868177716f727c86878786868787867a726f727981878787878787877d746e6e7680878787 *878686867d736e70767f86878786868486837a73707379838786868686868680777171747c8486 *8686868686847c736f707881878686868686857f767272767e85878686858484827c7572737981 *8685848485858681797372757b82858586868686857e7571727880868686868585858078747477 *7c8486868584848484807a7574777e84858484848585857f787574777c84858585858585847e77 *7374787f85868585858584817b7774767a8085858584848484827c7776777b8185838383858585 *827d7776767a8085858585858585817a7675777d82858585858583827f7a7876797d8285858382 *828283817b7876797b8183838383858383827d7976777a7f83848483838383827d7877777a8083 *848484838382827e7a78787a7f8384838282828383807c7878797d8183828383838383817c7877 *787c8184838383838383817c78787a7d8084838383828282817e7b7a7a7c7f8283828282838383 *817d7a797a7c8083838383838383827e7b79797b7f8283838383828282807c7b7a7b7d81838382 *82828283827f7c7a7a7c7e8182828383838283817d7b797a7c8083838383838282817e7b7a7a7c *7e8283838282828282817e7b7a7b7d808282828282828282807d7b7a7b7c808383828282828282 *7f7c7c7b7d7f808282818180808181807e7c7c7d7f808181818181818181807e7c7b7c7f808281 *8181818181807f7d7c7c7d7f808181818080808080807d7c7c7e808081808181818181807f7d7c *7c7d808181818181818181807f7d7c7d7e80818181818080808080807e7d7d7e7f808180818181 *818181807e7c7c7d7f808181818181818080807e7d7d7d7f808181818080808081807f7e7d7d7e *80808080818181808080807e7c7d7e80808181818180808080807e7d7d7e7f8081808080808080 *80807f7e7d7d7e808081818080808080807f7e7d7d7e80808181808080808080807f7e7e7e7f80 *808080808080808080807f7e7e7e7f808181818080808080807f7e7e7e7f808081808080808080 *80807f7e7e7e7f80808080808080808080807f7e7f7f80808180808080808080807f7f7f7f7f80 *808080808080808080807f7f7f7f7f80808080808080808080807f7f7f7f7f8080808080808080 *8080807f7f7f7f7f808080808080808080807f7f7f7f7f8080808080808080808080807f7f7f7f *80808080808080808080807f7f7f7f7f80808080808080808080807f7f7f7f7f80808080808080 *8080808080807f8080808080808080808080808080808080808080808080808080808080808080 *80808080808080808080808080807f808080808080808080808080808080808080808080808080 *808080808080807f80808080808080808080808080808080808080808080808080808080808080 *808080808080808080808080808080808080808080808080808080808080808080808080808080 *808080808080808080808080808080808080808080808080808080808080808080808080808080 *808080808080808080808080808080808080808080808080808080808080808080808080808080 *808080808080808080808080808080808080808080808080808080808080808080808080808080 *808080808080808080808080808080808080808080808080808080808080808080808080808080 *808080808080808080808080808080808080808080808080808080808080808080808080808080 *808080808080808080808080808080808080808080808080808080808080808080808080808080 *808080808080808080808080808080808080808080808080808080808080808080808080808080 *80804c4953544a000000494e464f495346543e00000046696c6520637265617465642062792047 *6f6c64576176652e2020476f6c645761766520636f707972696768742028432920436872697320 *437261696700 binary ./examples/TestSuite/file2.au oldhex * newhex *2e736e6400000030000018d00000000100001f40000000016375636b6f6f20636c6f636b3a206f *6e65206368696d650074f07a7ef578f0fdfc7e79f5fb7c6d78ea72d3c245ce37ce9f2325dbb8b9 *2498b21d21a83230433f8a441923a9a22fa14e19384bc9bb9d95de421c1ea396532d5326241bad *b626cfaf97fd28ec9dcd204bb0b61d38d0bf3421afae39edaba12e63c44638a09737241356b8b5 *48eb9ee03a1e69acbdd0a8d3153b9ea52919c3ad3828c299bf3bee9e291e6dbca91cc83d2a51ac *a43bb1b9ac39349fab401f172999ac29becc5c2fe6a44dfcb8a424133b9a93211e43bf49399bb1 *512ec3c428bac65b553ebc3f26b8a43d7a3637b0d14e349dab271f35a847cce44a3b7a98ac3a1e *aba12c1e2a9cab1a3f4c2abc9fa6bd1de7b22db1aebe1c2f5749c936bba79f481d6baca92fc6a7 *2f2c32c14b2ca7bc38242e98941926aee4d623a9b24e5db13c1eb2a47c28316655bcb7a1cc1e26 *2fa0a72a38d9ab492baaa43caed72c4018aca83722b59b3d1f5193a32b393d2f2db0cf2036cca6 *cb2fa6abc24b3874cf46bcddd2540ed1a6afe12d70bfb04da1c5222ac3ab1d2a9c983518aeac35 *46dabc53cff2432aaa9bc42d1bb03743c134aad13f35a5d93be0c1b624283ba9a62d4cd75958ac *8ffe1229a14f1e47aaad1fc7d0b9afcda42032baab2a39c1d5b51b25e0a8a859a5bd343c49ab55 *3b2b4fb7322aaf98383dafbd1f1c96a43f183dabbccfc3b11f5dcd47cb66a3592935bd9c5f343f *abe51d3bd9b4e3be42bcb737afabb81428b63e2bc695dc2943a5bb1bafa4a930233c25c6b7b42c *24b7bba8ccad9fbf1d2ca7c83621423ed2be35aca76e2eb2ad1fe4b69d1f1ca8b93a339fbe252e *6aa23844ba3e43ae634dc84e9dc41b1bf29f7956a8af582850459c4a2331e6b132ada74623c09a *2e26b8aa4c1f2aab382ca3d05141efa4afbcc7d42e1fbabe3f19b9a54f3b31a4a9ab4d36bbe331 *2aaba31f1ab73038a69fa31e24a0b53654b1c33acd59e2275ee7ee3222a1b3becca5581d42a7a6 *2e233daa41bd283e954728b7cbc530bfa72c20cdae214fa49e391fc1bf9e57de3d23285fab3d39 *b4a32f4ad2a5d61f9da8203229bea34d1a22b3a8b635a4ae2fbaa9b51bbdae372635b53e2b389f *aec93bbab33ea4da2c221d9aa71f32c9452ebaafa43c43b472ab2237bc9b3b1442b1c17fa7c638 *49bbb5203670aa3d1ea3abce4d4cb0bd3e6fac1c379fba2e13b5abace04b533baab8fbb8441f38 *98d1232baed9244031bcb8a29e4328ed9ebe3d294bde164e56bb44cb9f5239ab9c431bc1aab92a *3a2a61b0342e4ca932af98ae2d1dbeadb7273a412dabe9b02a349dac381fc1a4df342c4d206b9d *a6304a9f41202c9fbf5f4726aeaac91f56c252483ca52f2fa7a5a3292ad2bddf3c541a2ab19caf *26649ea92ab8bd3e2db6aa1023afa72f36d2bba5fabdacb2bc1629b4c6df3462334838b1a14662 *a9a74f40245128469e4429259b9c3b2cb53624a1a82e244f9cf7254c64a9e12a27acaf37baafaf *d92b2aa03f3948296a2eaca4b7377db86266baa12518aabd231f4fa5eeaa9c701f579eb43e1f2a *b3a51b304ec4a92ac09fa6d06273683720414654dd5aaf2b5199aa3638b33f20b49d3c18f7a7fe *2f9f3438783f9f492646a29f581b21abc17c393eaa467c3fbca93dfaacce2edada2526baae203c *a898303b992f2adca6b72b2132c22bdabbc0f72c9e9ba92e22bbc3371e263ea4c92ecfbfb6699f *af406f45f61b639c2a1eb0a72542d7a9eb329dbc4829f1a83c3429c8cade4aa7c81f3cb79eb247 *263d9ef12a254bb431c9c6403c99b823bbadb81ebba33e2422c63139bb9fbb4bc7b5aa2d29ceb3 *36215b3e44c8b9a7bebe38d0a8a72918b763c65a792a27a1b237359fa4383bb0c92231c0e83435 *c9cdc33bafa53432ce9fc53a4f413828b525c7b34e6bc3a7292eaca0bfe468292dacac1f19cda2 *bc2daaab4ebad9af482d39d23d1e6bd0a92bc99c7d4548c9f4bbda2e35c66d33d7b7482dbfa9c8 *c4c7ca4140a51f19cf9db4252e4aa948adb1f0bb36afb71e23bbc6283faebb53c9f5bebdbaf035 *aab52b4a365b2b40b4462ecea939a7a5b82f2a9eb51e2230beb8362fb5b9c5a3a01e22acafc728 *59bf2de1343ac4b3d249b7b1c328b2bf32c0e3f43838b73e2ab2af34c6a7a74a2a29bda61c2bc4 *4dd8c1a53d2baf9be0263f3fabc73b2a24b27538c1b3cc49d8a9b84babda2b34e22f1bb5dfd1c3 *489fae3b2ea5a53b2355ab2b3fcd2b2f559cb12d43cdb8aee3254fb2a74e224e425c36ac3b2aa7 *bfbcb4ae4f3e2e44bf2e366dace91fb2a1bb31d7a148305ef72579b1593c2ac6cea6cc4352b396 *4c202e4530526125f4baa8bb4cb3cab6ecceac2f1f26afce232ca6a626b9a5ad31b8dd354b47ad *4139ed5c4b4a3f21af9fc43a3aadbab1df284c60ba352b33d1ae58cec7a43436aa9e261aa7b439 *2749e62ff2b2ac5baeae3cc9464b32404e1fcfb7b95ddcb2aeab664938b2c73c1f1f46c1b127ba *9aba3ab79e341f73a4f61c4e3e38cecab92ac0adc2babf4653afcc4640d737333335b768b93b3b *acbfb9e1395f9dac1e29c8a8261fa7402edf9daa35e4b74542db322f45bbf54fd837b4b1adbb3f *cb4754442c2af9dc3badcdb1a956d237ac9f2416d6a7301c63ab376fa9ac4444a2c4c1ce2e3e35 *764436343de9b4ac37b1cec0aa4655443fb6c640552c2ec9472c6e9bb723b59aa51c2fa7373b5f *382834ceb6bc45abf8a7b63ebe342e733c2a3632b9a6aeaa673240b5be56ac372c3d2c24289a94 *6f2cb0541853a48fab351e0d1c4ba3969e4446271cd79f9099d61b0f142c958ea2520f0d1dad8f *8c9553120b2e4d9b8a9b2d090b2bc08f8898310d0a2b9b898ecc1a060f329a8a94a4190a114396 *898fef1605144b92859a330e0b1ab58888a82a140a14ab8a8bb318091238978492c9150714eb8d *889d240b0a22a38b89a9200c0d259c878fbe1b070c4a8e8a9d4c10081ca08a8aae290e0b1f9f89 *91c0130a15728e88954a110b18ad8b8caa1f090c2b998894cf170a14c28e8d97ca0e0618ad8e8a *9d3f0c0823a2888ead2a0a0a21a88c8ca02c0f13399e8e95b11c0c0f28a99995b21a1b37ab9593 *ad28171e3a2fa597a62d151f4fcda89ea7481f20d3a79fb1cb3525342d4869b7c332e9b7cdbaa1 *ae5c4d3cdd46453a254fdf45d3b1b03f37ddabb4c848e14b2a3b3fbc57ddabcb392642b8a8a4af *2d1e48dedabcf6cd38315242b6a0acf7532a39d9accb343a313a31b39d9cb429303942395fc0eb *3f44cb3c36aebecbb3c74e42c4b453254249ccccee3c44b94abfbdafb3fdb1442128eebdda54c9 *b83a3051b9a05b3fbc41397eda3b4e7bbd3248b8d8d9c9ab3a35eac0aec34123295bbbc5c1b259 *4b74c1ba4bb3c2352a264badbc39b5da3746b6a4bdca4d34224db13e59c4d63538c4b9c7d3afd1 *4c5a32e5bfb24428394157b9aae46a6af3adda4055ac4f2b325abb3dcdbc3739d2bf6fb5afc738 *35bb453e455edd44d3cac7c0c946c6b33c4348e75c5f3e397b43b8afc34b39b3ad5231cbde344b *48f441bdb646fcd1bbee5bbcbe3e356f485d665149dbe842b8c8cdcb5abdd65a3745f5c87e46c7 *3133c7b0c036beb0d0cfd14a3e4158572d46bbdf4ec8afd7cdbddcb94d454052463d434ed656be *cacebc42edbebd54395c4f2e4bb674495bb9b0e96a7a766bc5bd2c3959e65256c4c2d04dbfd6cf *7d3dcb52405963d5cb5d62536fd93cc5af6751cab5f93e7b493f2ed3bf4348ecd1daafbbc8496d *b541383a3fe74c40cedd68d0c2b1c8e6c94273df3f3b4af23468bfcb7460b3bd5247b6cc485f3d *44374ec56ad7b67952cec2ba4e3352ddc7444bca695f69c94d57d454c4c4de45e0ddf74c5eb93a *38d5ce574adbb8ce52c25b49cf5c623e4f5f4b585bbdcd6adeb5ad443e5be255524e3e5f47d25d *debc53deafbc4f70defb3b33cc433550cac3d7bcd3d5fce3ca495f72d9493a5ec37b39bdc46145 *44b9c95d644e5cbdc23d62535a4cd9ba704b7eb65849c1e879435f5f4b4a4cdeecc1d1c8df5ab5 *f53d456dda3d3cd1be427ed2e6c8d0d5e7b9d244373cd03c4edd5b46d8afbed979cacefdd84259 *3b3a6b4efed1cc65e6d0bcd343c8be703bf8e74b5549df5a5bf459d5bac744dbc1ec735ade3c4c *e6495243dab9c06adb68edc7e95d3b4bfcd85b54bb733c50c4be62dbc7e9424d704dd74f495ac3 *bc3fdfbacbeddb5369644be8383d59cacf59d5d5bccaeef149f7bebb4331457a683acebf506466 *c2d3cfc26ce9c84841ca4d413858cbdce1dbc0d7d7ce695767c8cd463c55da57e959ece0eeb8f0 *3bffbbc63e3aea6c46bef45bea5b5ddbb9ce584d5664436be4e96257d4cbd062caef4bd5ecfa4e *43e96341efcb6ccecfb94e3eb9bd5a42ec67515e3e4b4e6ee6e1c0d35f67bcc3f05c47cf634eed *5c424d5d7dd962bcc4636a62c66251ec5e414ebd4c41d3bdc74965d9c87a544748c45166da54dd *dbf9c5dc41fdd7c9d448764b4b6fddeb447ce0c558d5ba5855ccc24b52714c3a34c4cd5fcfd0c9 *c46050ccdacc693e76615b474b7f4cfbdebdd072dbdcc6edcbdc463de9d63a5958e96dceb27e3d *d2c4535b6be7d6414b78d8df53e375c2f35fdd5edb4b5f74d77b6cdce7f03ed2d959cfe9e069d7 *bf483351e048dbcb6c57d6b6c8fe49d4bf5f59405f4b4c46fdc6d5d055d7d0c8cc5acf5a405a55 *4a4a59cfea47c4c5eabcbbf43774ce50493f784a51d6c3fb4cc8c2bd5549556add4a72cd64e15f *4fcbcf494f5ac8ca66cc6b4b64cdf13ed7e7575bcece58ebccc94748dad9614b75584768dac2cb *4b5fc2cfd8614fea6ef74b49745a4e58bec87ed8d2e2edc660454a6062435d72555aceb7c879c3 *cc4d50426bce4767f1f74f4dcfced2547cf4cebe6e4a61ce594edf504b4ad5dc60cee45dddc6c8 *533eccdf3fe4e7ef4c4acdcbdd55d5d1e9566bca4e445c685c6bcf5dcabfe74857bdc46e5b4f40 *5b58535d44c4ce66bdbdd64b7f7f5c474cef4a54ddc9d54955c3b95766d05c6f57f0595cf15e48 *e5cc47e3d6c7db4aceced4e5ff4043cedd5b4be1f64271c6bfebdef5f0d147f2e54246d2c95d47 *59c67dc7dd50dbdbd45259694d424bc6e4e7c9cfcfe5d464506cd15134e1ee5fdeeecfd75dfbb8 *d2574368ff40ddcc594257cedbd76dd9d8d1c95c5a67fe4c5cd95d6a41fbe35ec6794fcdbcdfe8 *5bdfd24a4e446de64a63cc523dbfbcf7e6d3c9d2dc59574d3d543a6cc9e77c5bc2c3cecac63c58 *d14d5d4c6659fecbecda60e5b9bd5d3de3463643d2e83fdccfdc4ccbb4cac3dd4a474a5a7b4a5c *dc3cfcbfc8cbe3cfeec9c6e15542473d4950dfe6485feabffa50c6bdc25adbd84155ce6d4c4348 *c06457d259cec9e24fdcc8606157625c6ceb56e26069465fc5bec56ef45c4c51e3c4ca464ac06e *434f6ccb57eed5473d52c4d6e4fc667bcfc94de7cecdfc4d5ff9f3767651556871eed8c9d5d857 *ecb75e494b463c3ad0c4cc466cc1d9dacac65066db6878514d4fd5d34e557dddd85b4af8e3c4c7 *5fd65051564ad6d7cd5468d6fa4a4fbabf614fe1553f72cbd551e6d357e9da6769543ff1cfcfcf *4354dbcfc84751f4c4dfedde60d15e4c3f51e6636ad1bd694dc6c07949dec9554ed74a3c4f49cc *c6cfbfebcc746a4c4a5d6acb7fc4de3e383a6acabecac4c2d674393bdec6d7cdbded3033644648 *bdaeacc95f3e2e324dccbbafbdc5452f2e37eebfa7a5ae6029252237beabafb5cf3a3d2a3a49b8 *9bacb7e4311c1c54bfacad9fad342c1e3ad7aaa5a7bd282f1e2751c1a39fa3e62e1c2744c8a5a7 *9cd927211b30e6aeb49f9bcd1f193947b89d9dac2e231b2336d39fa3a9ba3a212736b5a3a89fc0 *35201a2732b09c9bac4e2f1d2942b4ab9fa32f2223271f4c99979cb32a1f1c1fbaaaaca0c8dd2e *1e2931bc9f9ba0c4291c1e24b7a0a0a0cf2e1b182ab79e959c4d4532181637af9c9ba5b022171d *2fafa7989ef63123242a3fb99da1b2421a181ecd9e9c96a4602619202f459da3ada41e1a243ea5 *b4a699ba321d1b2c32bf999cab382a201cbcaab39cc4eccf1a1f2e36af9f90a61e391f1cc7c79f *9f656e331f292ce4a49896ea2e2a1a2b35a497a8a72316171dad9ba1a5c162331d30243e9a9ea3 *f2301f1752bfaa9b9da02f251f1c4ea19eabb6bc28172735b4a4a6a053221920595ab0a3a2ab4a *33291fdc9fac9eb36a371723243a9f9d9db323202a3dabaeaa9eb93d27252031c6ac9dad391f2b *3848aba59da7b8e61f1e253138b5afbf5e302f2243a49b9a9fae361e18242fb99fd8ced0c4d127 *3eb6a3a7a7ba3d231839d7333bcdbac4c1cfcc5fb0a8edc4bb3a29272a4a54c7a8b6abbedec248 *ef3d3b3c45454bd93c3847d4c9c9c2baa9c2ccbbef41232cec57cbb36a68bdf4f52eceafcdbc69 *dc383c4b4ad7d4b7bf663b2f3fc8c46dbdb8bf6631365c4f4bbdadaf523e4f2633e9b9b0bfb0e0 *4273cc453a5959cf4850cf4f59cfc2c5c2c44dce592c3b4e78bce3cebf5d5b3dbabc3cd2c2c93a *3a5eede8d3bf4ffbccdd6a44f5cd4f45c8bf5240454bbcafc5cc7c3e6942733d3ec55ece5842ef *bdde3fcdbec83e57bf4b4763695edbc3bdcd63e75c3a55b7d15dcd56683e4dea6dc23e4fcfd6c4 *c76c42524dc8be7a4a46becc3e50bcca4fea5a4c464d77e34ddbbb406ccfedf049c0ccdfdd6cd3 *6646416f5cdec4cdce5c5e6866d3c5ca68562e31ddc8494bcfc1b67dd3cf44d3d9d35556cc4a45 *58eb6dd6cbcdd05768dde256f7d869553d4b4649ded2d5bec24fc2c9526454c5473678bfc3454b *4f79cdbbc5425c68f64a4ed4daeb58cfe24e546cdccfe9e3c24dddd73dde505bd7ddd54d5ecbcd *4f7dbfda5740e3564652ebcfdfca4e4056cdbfca6153df5ecff9646d315cd75bd0d4cacdd0dddf *6d66e04b6e554f4c67d44558c6bcd0e9ceca5a4e5249de4feee24acb70f55840c0bf7357f65e5a *cfd3e03b43f5dfc7d7ea5cede6fbe1cdda525de3673de4ccdae348d1744be56dcdcfd7daec4a4c *ee3c49d4cbca6acecbe75ed2dc4d5fd8f747423b51e1bec368c0d16fced3d63d3a5efd5a5f6a6f *cb50fec7dfc5c4dd525e64554753cde04749cd6c6ce6d7ca76c5e447664d6cddcce04f5edc7540 *f86e54ccc6bfcc463fe9e071da6a4f4e78f66e5acbc3495ed5c97648cd744c516eeceac7ccde61 *dcfa52d8573e4adf605366f2c5cdddcbd05969d4dd743f4d5255cde9f348eebecceed6c6514052 *e2e652e46f55fde34eefca596bdaf3f6cdccdb6b3d5f6f63604bcf7be8eb6fe370d9cace7ed357 *3f53ebce4846d2ca79ecc77360e2e4ecdb5b40594beddce7bf6cdbf174dc4f6bd9ef46474ee1df *65cbe1eecac7d85f6d5f4c405fc95046c8bd69ea4e53cbfdcbe4ede6495b60fb5f5655f4eeedd4 *7b796adbc1cef5eedc524a5a587d6be56c4b44cdc558c6cbf35561ca694e505b6dd86455e8ebc9 *dcfbdf657570ef5e4e4d587d6bcdc0cc6bed6bfbe242704e45cad3685fcfcc7d55d4cf68d66d5a *5349fcdde9595360ebdde5dfdfdedad962def54ade565c654ddc5b66cdca754fead9dcd5d35641 *6bdc684e7ddaea6862dfd1dde3d6e67f6460ee4c56464ccdd5c7cff6f06963e5ee4d5ef25b565c *d5f2ebcfc8e866ea5c4cffcb6e474061d7fdd266e7df74c97aeed579d4e35b5d5346635d5ddece *cb7df97d575bd5c6755a5c5b4b7dde60eae0d05a4ddbdcd4eeddc7f04c4d5458775b7eec54daca *d4e8e45e69dafe594b5e6567e9d8e66ac7d0f25c5cd65867ee4a5de6ccde5053cfe172e5e9cd6e *4f5af5674d63596be4d7dfdedfdfccdbd35145fa617f58566046f2c7daf1d1dddde97fd2595fdf *5a434becddd85858ded1e3d5c9e9de66fef255ee4a4b645fea70dcee62d5c5f15ddb69df6e7377 *4655f8da6bebfd5af0cfd3e0fc5ad4ec494f57d37359da5fe6d3dcdd66596c63fbd05e5ee1666b *e1cfd9ee71dade52677d4d4edb68546561cfeed8d277ec62d5c8f94651ef6e5b56de746ad75d77 *d8cfdfe2fc57566adbe65e5377515bc7e7f0f3e9d572d1d46d5f595c595354796cf8e1ccd1505e *d2d26d5d665ff1df6e55ece6e0e07bcbfef8db4e4e5af1745ef16c4f76c9dcdfdff56e5a76fc77 *5e5c6fe9e368d3d95d7bced97a6f52ed6d56604b71d0de766c7d697ed0d9f6dcdeea726ff35459 *765f535ce3d4cfede3d970666acb6d475157795d74e66760e1ced1d1de6c75f1ed534e5f6569f9 *7868e6cfcce2e2ee685e58fc6375595cdb60e9d7d4de6eeefc4f4fdfe15d5f77dadfdcdb6d627c *fc69e0e0695bf6fd5e7d636656efdd5ee3efdcd970ecea6660eddff94f54e9605edbd2f564d9d1 *e270e5e1fc5d524b4de8fa77f1eddc7bcccfe6e55f61666069634f59f3efd4ded9dbfd70ee724d *5ee0f05a5eeef9eae7cf755cecf6da78fa6b60de5f5868f3e2df7368f17adeebf0e8f761596a73 *def2585bf7e1f3d6f26d7ed6ca5a5ae97d614f5d615af0dbf6e0e377d3e0dce85d675c585a666a *f7e9e8d8dbdaf5e37362f653545edfda555fe8ebe3d2d27853f6d95f746c617665636df8fbe6f1 *eddd7b7f7bfdfcf6705ef77bedeb65fe6bfaf46ae7da6c6aebfa7759e5df556beb685fdfd7da77 *5ce8d7daff5f5358645c7d6c77ddfadfdcddde7d75fe6b686a58757d6d706dd5de6ed8ce6053ec *ef675c6e6b605f74e46cead8ddda5c5effeddce6655b5f6ddce6e6ff5f7ceeddec65646964ede1 *606adde15e72da726b7de5e55deefa676a61716c6266e2dfdaeff9dde3e56e5f64f5f95a4d4fe3 *dfe4dbf4f4dad1ece4de5b5766f35a517aff5c66dfdfdde9d7d9666461f175646b73645b65fdd9 *d8dbdd6cf3f5705960e070f7f75e5e75dff177deeb65d7d2685456e1dff6645a5e5cf0dfdfe6e4 *e5716c5eefec7677626e61f3e068f4d7d97965ece6757e6d55f7ee62586ae374ecdce275ebd7dc *664f6f756f7b63735b72e6d8d3faeef36b706e5f6170f2f55b7be67ee9dee2efdeea6d7fe9694f *5b75ef70 hunk ./examples/TestSuite/file3.raw 1 - +~~~€‚€€~~€€€€€~€~€€€€€€‚€}~€‚ƒ‚ƒ~||„„„€‚€}y|ƒŠ†‚~||}z{‡ŒŒ€zy€ƒsn{•“xip…Ž{wmƒ‘ˆwŠ„xˆ‡h„Š“‹wz|}Œ€…‡†ik~“{px|…‡~‡‡‚ot„‹€w}{†|‹„vjnŒwu}{†|‚ŠpoŠˆwx{ƒŠ†‹ƒwl‚‹‡xt}|…|ˆ€|ymŠ‹Œt||‡…Š}~xtˆ”‘†n{w~„‰ywjx‘„t}|€„‚Š}qp“†‡uw}€ƒƒ€…jx’€—}„}…„Žsnn’€r}~ƒ‚}ƒ€€|w‹…ƒ}x€~ƒ€{}†r‡ˆŠw‰zŒ†}~so~–‡‹p€ƒ„€€u{y‰€|}y‚ˆ€€„„rrˆ~„ptˆ†xry”yŒ|ƒ„ˆ…}|‚„}t‚€‚{x…‡w|~}q~Œv~jz†…‹p}r}’€|yƒ‡‚‚ƒƒmx}‚prˆ„Žtu€r„™y‰m‡‡‰v„m›t{o†||y{Œ|xt‘uxy‹Ž€|t‡vr›x„mu„€‰p}‚„˜{r†…}„{‡{t–y{r{Š††y|wŒ †osŠ~xu{zz‚€q}‡ƒ†~€vrƒŽ~k}†‰ƒv‚v”–}€pˆƒ€}x…uw‰x‚vˆ‚uz}u˜‰vzm€‚Šwy{•‰sƒŠ†}w|„v”Œ|~y†‚‚€ws„‰„kqƒ‡xtŽp‹…yt€Š‰{w|ŒŠ}n„ŠŒvs€v—†~utz„ˆ‚„z†}n…ŠŽxp€„„z‘†zs†‹„|xtŠz‡…|x{z‚sz”…my‚ˆ…pz’zpz„„oz†€xu‘Œus…†‰zx~–‘{yq†Œ†{pƒ††p„…‚„r„„‚}sw•‚{ls”„ny„y{Š~‰rv|„Š|~yˆŽƒuqŠ“‰unzˆz‹ƒzqvƒ†€ˆuy†…~t}…wq~†v†“ƒq~„‡ƒxy”{v}„Š~u~‚‚tw“†|t{†ƒ€z€z–‡zt†ˆŠzt…ƒw†‚ƒvz€ˆ|v†‰~yrƒ‘†zt}†y‹†‚qz„†‚yy‹…~rx‹‡o†s~•}‚q~‹vx‡Œ}px~Ž†}rz„xv‰‰{tw‰‹€pt—Ž}wu{Ž‡vt}‰‚tŒŠ€~v†††{vx„—~xt„€{sƒw‹‚tp€ŠŒ|r~€†‡vy„~t~‚‚{Š„|wx€Š‡~ovŒ…xv„‹v{†‹zn~yt}†‰vtwŒ˜†ur”†yt|x~„sz}…Š€|t†‰‡vr…pv‚{†’ˆwpx†ˆztˆ’†wt‚”Žwow‹~}“|wsˆ…|x|“‘wrxŽ”pp††w}Š‚yt{†xyx}‹{~†{y}€€s‰”†ym€…ˆxz‚|vˆˆwr€Šƒvx}w‡‡€|u€Šˆ‚ry‹…zv„Ž„xz}ˆws“~rwŠ‡ƒx|u–‹wvy‰ˆ„vy‡y~‹ˆ}z{„‰€zwx€vvyŒ‘|u}ˆ‚Œ†{p}‚‰…~}u‰ˆ€uŠr~‚…•ƒ€r|€…‡v‰Ž|pv’“zp€‰„uˆ–|yw†‡…|r‰|zz„Œ„xw……zu……z{xƒ††|n‰“†xqv’{pzzyŠ‚‰puy‹Ž…ss“‡pt‚ƒmy‚zyŽŠxou‹Š„zw…Ž†{pvŠvr‡|tŽzsr†‰wv}xxzƒˆ€{wƒ‚~{ˆŠ|sy€‰ˆ~{|z†Šƒ‚}|‚y|sŒ†|ww‡…€z‚‚x{…„}vƒ‹ƒ}w~…’ˆuu‰‚xp†•‹wr‚„‡€}z}†wt€Œ|{z‚~€|v{Žzyx|‡‚ˆx€psˆˆ‡~u}‡‡„ss‘‚{{x‹ƒsv††ƒ|ˆ‹~r~Œ‹}{{{‰‚|x€„‚„€€}t…’ˆ‚u~|ƒ‚|~~•zxt|‡~y|}y|†pyƒŠ…~r~Œ€wx„†€„~z{„zw|ˆŒx|v€—xz{{„Š†zxt~ƒvuxŠŽ‰sr„‡‚t„‚yxƒ…‚€{tˆ‡ywxˆ}t|€€’†‰yvwƒ†€}|’}yvy‹’ƒvy…}wŠ„qq~‰†~uu’†}sx„‹tx€‚zy…~rs…ˆŠ}vŠ}zv}wv‚{x’Œ}sr„Š†{~}‚„~w}†}s|…€{†„vv{‰Œpt‰…{u|‚Œ‡}u€ƒvu’~zrz‰‰wyqŽ‘zz|‰Œtz€~„Žzpt‰ˆ€{yzxŠƒyp†‡ˆwtx€’~€y{Š‚{€‚€{…Š€v~{€‹‚v}z}‘Žvz€ƒx‰„~wxz……uu~zx‡Œ‚vt~……~v‘Œ}xs{‰‹{tx~v}Žyrs„†€y…Ž‚}|u‘|stƒ€wŽ€vp~†‡~‚|…ƒ}}{ƒ“vn„‰{‡’‚}r~‚†€|{’wtx„‚†z{~‚w~zv„‰~y}v}{u}ƒƒ‚|‚|x‹‰€y{Šƒst~x‰—‚t{}Š„t†ˆ}vx~…‚tw~{w„ƒvqz……ƒ|v”ˆ|vv„‚‚‚€y{{’†z|…†w{r‹–}v€ƒ…~zw‡•|xw|ˆ„|z}yw„‹‡€oy‰‰…}tyŒxr|”„yr€ƒw}ˆpvˆŒ‡}uy…xuv”‚p{ƒy…tr‚Š‹~qpˆ|w|‚~‚}|‚‹~z€ƒƒ}}w~Ž~yv|ˆ„‚~‡‚pw†ŒutzŽŠƒw|u{†~w}„†r|’yw~…ƒ~~€|y‰‚y|†}|€|‘|v|…ˆ{vz‹„|z|~„††}}|yt’€}sy‚‡~uˆ“„vƒ€|~…zv‰|xvƒzr}~so~„‰|~ˆwux‘}to†‚€„{qz„†ƒ~u~zx|„ƒ‚~|‚~}Œ~w}…ƒ}}w„’†€|{‹‹x{~v‹”Šxqt„‡ƒ}wƒŒ}r‡•vq€…x‡Šypy„€x†˜ˆrr„……„~x{~|yŽ~yu€ˆ}yyx‚Žy{x|‡}ƒ|ut„tsŽ†rs||„‰……vuy‡†zx~}wy…ŽŠxuyx“‡ytx€„…„sy‡€}w}”‚xo~„}’Žro†…w“stƒ…Šxu…wvŠ‰€tt‚ˆ„}uz‹€{x~‰€}~€zz}‰{x€Š„{}y‹”‚€wz†}x†•yq‚‹…~t|ƒ‚{ˆ…uv{†……s…’‡|y}Ž‹}uy~wŒ‡tsy‡Š{||‰†~z|}}tw„€w‡’…wn~‰‡zt{Œyvƒˆƒ||€†}x€Š~z|†€|~|t”Œ|xx„„ƒ}w„’‰{wy„†„||‚}|‚}|~†„qsˆ‡zx{†…|y…‰ywŒŒsxŒ„{z}x‚Ž…„vyy‰ƒ‚n}Œ}vz‚†…}z}z‡ˆƒu{€‚‚{}Œ†€{{‡…yv€utˆƒwv}„†|‹‰|y}{‹‡|t~€}…~s|†‹~x{ˆzvy‡„~‚ƒ€}|xu–„xtˆ~t{~ˆ”„~{|€†ƒ~yz†…ƒzz€ƒƒ~|sŠ€xz€ƒ†{|zy€Ž„yu‡‰~zy‚„‡ƒz||……|tv•†}uxˆ‡ƒxz{…Œ‚€}x}Žu‚„„szˆqz„‡~tz‹‚{z|~€ƒ‚‚xuzŽˆvtvŒsyx‘…yzwŠ†}v‰˜vs‚…‚…u{„ƒz……ys‡Š„u{{’uz{…‡ƒ}„ƒp‘†qsŒ’Štt€|xŠstz‡‡}~{…ƒwz€Œywxƒ€z‹“|ss‚‡‚‚€{vzŠ„||x‡†ƒw|vwŒˆ„x|€‚€}~~Ž|x€€}ˆ€t}†|x‹—‚st†ˆ„{{w”ˆwx|…€~„xxŒ‚t|‰|x|€w†‰~sz‚‡~y{‹„yq€†…„xz€‚„z‰‹y{x…‚|t…“|zx€‡‡~u~|‡’„|sz€ƒ‚€~||}z’‡{uy‡„}z}v–€~uy…‡…|z|„Ž€|xx‡w}ƒ‰wt…Ž}py‡Š|u}x“Œ}{{€€~~~y€ˆƒ{|€z~ƒ„p{{v}ƒˆ}€ƒu‰Ž‰{r|†wˆ…wx|€Œƒxr€„†|z…{w}‚}~|}ˆ~}{~…„€~y…‹ˆy{€‚€€|z€‹€zu{ˆ~u…}ŽŒzxy…„y|€…’…zt…„ƒ}{‚ˆ}ˆ…x€„€x€{|}xuyˆ‡„uz~Œ~wv~~‡zv~‡{„•‹sr{†„}t“‹|uyŒŠ†vz‚|sŒ–‰qt}‰…zy‹~v{ƒ…‹‡yx|‡}x‹”€qq†…~ˆ‚|x…ˆ~}{€‚‚ƒ‡v‡}y…‡ƒ~xvŠ“yvy†ˆw}y€Žz{{ƒ„}‚~‚x‚Š†~xz‚‡}~x‡Žyt}„‰|{ˆyxy‰†~}~}~€‡‰wz…‚z~€‚x‰“…xux‡‡zyy…Šxw~€€‰€y{„{y€u}„}|…}q”‹yusŠ‰qy€p…}v~ƒ‚†‚v‹†t}Šƒ|}„y‡†ww~‡~{†“ysw‡†‚~}|~„‚„yƒ€{zƒ…‚|ƒ{•~yq‚…ƒ|}„y|……z{|…Š„s|xv’Œƒpv‚…„|ty‚vx}‚{}|€~„†|‚‡yyƒƒwr—†tt}†ˆzz|z†ˆƒzyƒ‡‚~|‚ƒ{€…ˆxx{„ˆ„{s|Œy|€„…}~xyŽ”‡ps‡…ƒ~}|w|„yy„{v‹•‰qr„‰„{w}‚wx‚ƒ‚|~€{}~~€ƒt|yx}ˆ€„s„txƒ‡ƒ‚~€~…‡z{ƒ‚{~€ƒ~s~‘‚vu€…€y{“‡t|€~ƒ‚ƒ|||}{†~x{}‰t‚~u•ˆ€vs„ŠŒwwx…€zu€…~ƒtu€„rx€‡ƒ~‚‘Œ|{wˆ‚zw„{{€~yxw‘p{†zr”ƒst…ˆƒ~€t’yvz…€‚„|}w…ŒŒwu„‡€‚|t–…ru|……€}v‡‘„vz‚|„„|{‚|t‚}zu}ˆ‚|t}Š|xx€~~‚u~‹ˆ~ux{‰~z|†yp”‰rs|†€~yŽ‡|~|„€‚vzˆ~v‡‹}y…}uƒŒ‚~v‚‡‚y{|†z}€‚„{y}€…„zz†~|~…‚y{s…Š|xu€‡„}{{{Œ’}xx~…ˆ|zƒ‚}|z‚‘s{ƒ…z|sŽxy}ˆ{‚rz‡ztz…ƒ‡€|{~€|‰}v{…ˆ}€|s‡‡zxzƒ‡„~zyŽ‚wz„€~zƒˆ€‡‚z|†ƒw{z”‡wuzˆƒ|uˆ{y€‚…€~~~ƒz‡‹yyxŒ‚{€~|Ž’yx|ˆŠ‚{xy}Ž„zz}…€ƒ|~{‡}}|ƒ…ysx…yu{†‡„|yv|‘…wy|„…||ƒzyˆƒ|x}‚{vy~wv~ˆ†}zw‰Ž‡vw|‰‚u‚€~z…zt€†€€pyŽ~wt}‹‹‚yvy‹Œ‡xu|‡…€{x‰„}xwŠ†vwƒwqŽŠtu‚…„yy‹€xy‚‚‚ƒ{€|…‚|‡‚|}~†}z{w’†}wz‚€}x‹†t}~~‰ƒtˆtx‰‰vx‚‡…}~v‚…y{{ƒƒ…z}xƒ~x{…‡„}|€…yxˆ„tv}…‡rŽŠyy‰„„zz{}‡†‚tv€†…~|vu…†qs|‹x{€‡}zy‚€€z|yŠ‹ts„Šˆ||‚{pŽ”‰urƒŒ‰x{€€}{|ƒ€‡z{€|€‚Œyxƒ„€}x†“x{z€‡ƒyx~„€x}ƒ‚†ƒ|z‚{†sv€„‚}~‡q€‰}|t{Š‰s~„r„‡wq}…ˆ„€|w‚‰}ty‡…}y|~€„‡{z}„…}zˆ”†wxz‚ƒ„~z{{†„Šxx……|~yŠƒzs€…Œ{u}ƒ€…zvu‡~xu‚€u”{sq„‰‹}yt‘~zx€„ƒ‡‚y{~ƒƒ|ŠŒw~~€„„‚t‰–x{w…ˆƒ|{€~‚|tsƒ†‚|}}|ˆ‚xxu…‰€xz‚‚|vŠ’ˆrx‡†€|}x‹Š€{wƒ„…}~~ƒƒuy‹ƒzy‚ˆ~v{–tsxˆ‡yy}Œ‹‚y~‚‚€|€}‚‰‹{mxƒuz‚ƒs‰”ztu†…{~u„“|{~~‡„|}„ˆ…wy}Œ|x„‡pŠ€zu€†‚|uˆ‚{{}…‚‚~}{~€‹uw}Žwszˆ„ryŒƒvu~ˆzy{wŽ~yy{…ƒ€z{z†Š‚|zyŠ†|tƒ‡zyŒ…{s|‚†‚||x†ƒ}~‚€|x†‡ys……‚|{‚v„vy€ˆƒyw~|Œ€}y}…‚‚€}}€}€Š‚x}ƒˆy}ƒw~Œ„uzŠ‡{wx‡„{}~‚~ƒ{~€‡~~{|…„}{€ƒv‚Ž~{u|„‰ƒvzw‰{|‚„}{ƒ‚~€}t…{|wx•xu{‰ˆ†xxzw|}„†z|~ƒ†{€†~{yŠ…ƒz{|Ž–ww{†Œ…xr~xŽ„vty†‡|~z~Š„xw‰}zx†„wvˆŽ|q|„„€zy{……~z}‚„€ƒ}y|€p…„}~€||uˆvv‚…†€yy{‰…‚}zy†‹~wx‚‚y|‚‰€v~‡~~„su“†|tvˆŒ‡u|yzˆ‹„uw„‚…€x~‹u†~„‚zu{’{w}ƒƒ…~{‡†zz}Š‰vt|…„x…}tŒŠ}xzx‚Œ|v|†‡ƒu{}‹ƒ|v€‚„~‚‚{qŽtuŠ’Šyxy{|„ŒŽwsw……yw‹„ty…„~€€~ƒ„|‚ˆzyƒ‡z~zŠ‘{xx„……€yy{‰„|x~ƒ†…~~{€yŠ“‹uu|ˆ€‚{‹}|{ˆ…€z}€~Š‰ˆvyz}‚wu…~w‚“tx‚Š„}zt€‰|}{€€~|~‰„}v†Ž{{‚‚€uŒƒzu€ˆƒz|xy‘„~w„€€€|yˆŒxtw„|}v‚‘‡|s|†‡€xy€{z~‚~~}…„vƒŒzs€ˆ‡|{}{†‘Švuwˆ†€{|z‰{|~{ˆ‚~{~z€|‰Žvw†…‚~|{wy€…‚ƒxx€Žƒ}y{ƒ…~||v‰Œƒ~€|€„‚€}sy†xu{‹‰„u{xx‰‰‚yw€ƒ†„|ƒx~Š†zwŠŽ{v€‚}xŒ”v{ƒ‡„~wxƒ‰w{…€€€ƒ„yy…{}„‡~}|vu…‹vz‚ˆ„|}xy…}yz€ƒ„~~z‰Žwp‚‰Š}z}tŽ•†xty††}w‚‹zvƒ†€€€ƒ}|…ƒtz†ƒ}†~{w~Ž…ws€‰‡}|zxŽz|~~ƒ€|u†‹‡z{~ƒ‡€{|vzŒ†}vz€‡„{|yˆŽ„|{}€ƒƒy†ˆyt€…ƒ{‚ˆ~zv‚Ž–vv~„ˆ}xz}‹‚}x|ƒ‡|{zƒ|……{v„†…z~uƒŽ{ww|‡†‚|{}xŠŒ|qz‚ƒ„‚{~|€…‰€wu‰vyƒy‡vr‡€zy~yx€‡ƒ„|~y~‚Šƒr‡ƒ}y…‚q|”…vx‚†|}€yŽ‘ƒ{x€ƒ~~yzŒ…~xywxsyˆy‚~vv…†{|x}Ž{z„‚‚~~y…„yr}Œ}u†y|‰xuŠƒ~v{xˆ|z~€ƒ…~}~~}~Š‡vy‚‡ƒ~z}~vyv††ƒ{~{€Š‚€y|„}}|ƒ„{}ƒ€€z~‚€||Œwr€…†~v‚…z€…|uzƒˆƒ{x{|ƒ~xx‰‹†ww|††t|vx„‡~{u‚Œ~ux‚…~{~~yŒƒ}ww|‹|s~‚‚zˆŽŒwt{„ƒ}}‚vƒ|y|…†~~~ƒyƒvuyŒˆ~v}ƒxxxy‚‚~„€x‹w~„€y‡‹„~s„†ƒ}~}|zŒˆ‚wzz€‡‚~€}ˆ††~x{€Šz}€€‚‚†z‚ƒ€~€zwŒ†|x~‚…†{ƒ‡~v„ƒ~~…€~Š‰wv{Š€u~„‚tu’ƒrt†€€~v~‰…€zz}†…ƒ}|}x€‡†…t{††€‚~{‚Ž{vwˆƒ}x}|x‡}vv‚ƒƒƒz{u‡‘ŒytzŠŠyy‚~vu~‘‡vz€‚„‚}u|‡ƒ‚{||ƒ~‚‚}v„‡~~€}‚€}~vz‹†€w€|‡ƒz|xuŒŠwv{ˆ……w{}z~ŒŽˆtr€‰Œxv€~‰Š‡~ww{ˆ‹‰{ww|}†Œ€ys|„‹‰~zu€y‚vt|†…ˆ}zz€zz‰‹ˆ|tzz†‰ˆ|yy€y€‡uqy|††‹~xz€yyƒŽ†„p|}‰‰‡‚x{||y|’Š†uz€‚‡Š…zx}‚‚t…‘Œs{|ˆƒ~…„yu|y‹ˆ…{u}}}‚Š„~wz€|„Ž‰~uy€‡€|ƒ…{{}~„ˆ…z|~ƒ€ˆ~}~€~|vŒ‡‡y{€~}‚…„}||~€‹‡„|€~}~‚ƒƒ„x}€~~t~‰†‰}x{€ƒ„†ƒƒ{|}}…zs…ˆ†‚~|z|‚„‡}|z|‚†…us…„ˆ†„€||z~‚†„€~~€~€~}€…‚}~}‡€€…xw€ƒ†~‚€~€„€{€|ƒƒ€‚€yx}ƒ„}}~~~~‚†‡€|yv~‰ŒŠ|}|}ƒ…ƒ|{€‚}~‚ƒ}|}|‚„„†€‚‚€|{}ƒ‚…‚zz}ƒ„~|x€…†Š„~}}z|z‚„‹„€~~}|{}„ˆ„€|‚}~}€‚„€~€€}€ƒyz~‚€{‚‚‚~‚‚€~~}}€‚‚‚‚‚|{‚€€ƒ}z|}€ƒ†ƒ|}€€€~}„ƒ‚~{€‚€~x|„ƒƒ‚‚€~}~‡„~‚ƒ|y|‚ƒ‚~€‚ƒ€~~€€€€€}€~}„‚}{~ƒ‚€€„|}€€}‚†}}}~~€ƒ€~|‚†ƒ{}‚‚€}~€}†ƒ€|}}…„‚€~||~„„„€}|~‚‚‚‚‚ƒ|{€€€…‚€}}€~€~ƒ€ƒ„€€}~~€…„€|{„‚~}ƒ~~||}„~€€~‚ƒ‚||~„€}€€€€~€€‚}~€„~€‚€|{„}~€€€€‚|}€‚~„‚€€|‚ƒƒ€|~‚‚}}‚ƒ~}€€}|€€€‚~|~‚~€€}~~€ƒƒ~€~€€€~„~}}ƒƒ}‚€ƒ€|‚ƒƒ‚~~}~‚€‚‚‚~}|~„ƒ~€€€~}‚‚‚€}€‚‚~~€‚}€€€€‚€~}~~ƒ‚€‚}||€ƒ‚~€}~‚€~„~}€€||‚‚‚~~|„„€ƒ‚~}‚‚€‚„}{~…ƒ‚|}†}~€ƒ€}€€€‚ƒ~||€„€{€‚~~€€€€€~‚}}z‚~ƒ~|€‚‚~€€}~ƒ…{{~}€‚€‚‚~~}€‚~€€€€€€€€€€~€€€€€€€€€€€€€€~€€€€€€€€€€€€€€€€€€€€€€€€€€ hunk ./ALUT.cabal 27 - Sound.ALUT.Errors, hunk ./ALUT.cabal 32 - Sound.ALUT.Constants + Sound.ALUT.Constants, + Sound.ALUT.Errors hunk ./Sound/ALUT/BuiltInSounds.hs 17 -import Control.Monad ( liftM ) hunk ./Sound/ALUT/BuiltInSounds.hs 20 +import Sound.ALUT.Errors ( makeBuffer ) hunk ./Sound/ALUT/BuiltInSounds.hs 23 -import Sound.OpenAL.AL.BufferInternal ( unmarshalBuffer ) hunk ./Sound/ALUT/BuiltInSounds.hs 27 -helloWorld :: IO (Maybe Buffer) -helloWorld = liftM unmarshalBuffer alutCreateBufferHelloWorld +helloWorld :: IO Buffer +helloWorld = makeBuffer "helloWorld" alutCreateBufferHelloWorld hunk ./Sound/ALUT/BuiltInSounds.hs 39 -sine :: Frequency -> Phase -> Duration -> IO (Maybe Buffer) -sine = createBufferWaveform alut_WAVEFORM_SINE +sine :: Frequency -> Phase -> Duration -> IO Buffer +sine = createBufferWaveform "sine" alut_WAVEFORM_SINE hunk ./Sound/ALUT/BuiltInSounds.hs 42 -square :: Frequency -> Phase -> Duration -> IO (Maybe Buffer) -square = createBufferWaveform alut_WAVEFORM_SQUARE +square :: Frequency -> Phase -> Duration -> IO Buffer +square = createBufferWaveform "square" alut_WAVEFORM_SQUARE hunk ./Sound/ALUT/BuiltInSounds.hs 45 -sawtooth :: Frequency -> Phase -> Duration -> IO (Maybe Buffer) -sawtooth = createBufferWaveform alut_WAVEFORM_SAWTOOTH +sawtooth :: Frequency -> Phase -> Duration -> IO Buffer +sawtooth = createBufferWaveform "sawtooth" alut_WAVEFORM_SAWTOOTH hunk ./Sound/ALUT/BuiltInSounds.hs 48 -impulse :: Frequency -> Phase -> Duration -> IO (Maybe Buffer) -impulse = createBufferWaveform alut_WAVEFORM_IMPULSE +impulse :: Frequency -> Phase -> Duration -> IO Buffer +impulse = createBufferWaveform "impulse" alut_WAVEFORM_IMPULSE hunk ./Sound/ALUT/BuiltInSounds.hs 51 -whiteNoise :: Duration -> IO (Maybe Buffer) -whiteNoise = createBufferWaveform alut_WAVEFORM_WHITENOISE 1 0 +whiteNoise :: Duration -> IO Buffer +whiteNoise = createBufferWaveform "whiteNoise" alut_WAVEFORM_WHITENOISE 1 0 hunk ./Sound/ALUT/BuiltInSounds.hs 54 -createBufferWaveform :: ALenum -> Frequency -> Phase -> Duration -> IO (Maybe Buffer) -createBufferWaveform shape frequency phase duration = - liftM unmarshalBuffer $ +createBufferWaveform :: String -> ALenum -> Frequency -> Phase -> Duration -> IO Buffer +createBufferWaveform name shape frequency phase duration = + makeBuffer name $ hunk ./Sound/ALUT/Constants.hs 29 - -alut_ERROR_NO_ERROR, alut_ERROR_OUT_OF_MEMORY, alut_ERROR_INVALID_ENUM, - alut_ERROR_INVALID_VALUE, alut_ERROR_INVALID_OPERATION, - alut_ERROR_NO_CURRENT_CONTEXT, alut_ERROR_AL_ERROR_ON_ENTRY, - alut_ERROR_ALC_ERROR_ON_ENTRY, alut_ERROR_OPEN_DEVICE, - alut_ERROR_CLOSE_DEVICE, alut_ERROR_CREATE_CONTEXT, - alut_ERROR_MAKE_CONTEXT_CURRENT, alut_ERROR_DESTROY_CONTEXT, - alut_ERROR_GEN_BUFFERS, alut_ERROR_BUFFER_DATA, alut_ERROR_IO_ERROR, - alut_ERROR_UNSUPPORTED_FILE_TYPE, alut_ERROR_UNSUPPORTED_FILE_SUBTYPE, - alut_ERROR_CORRUPT_OR_TRUNCATED_DATA :: ALenum -alut_ERROR_NO_ERROR = CONST_ALUT_ERROR_NO_ERROR -alut_ERROR_OUT_OF_MEMORY = CONST_ALUT_ERROR_OUT_OF_MEMORY -alut_ERROR_INVALID_ENUM = CONST_ALUT_ERROR_INVALID_ENUM -alut_ERROR_INVALID_VALUE = CONST_ALUT_ERROR_INVALID_VALUE -alut_ERROR_INVALID_OPERATION = CONST_ALUT_ERROR_INVALID_OPERATION -alut_ERROR_NO_CURRENT_CONTEXT = CONST_ALUT_ERROR_NO_CURRENT_CONTEXT -alut_ERROR_AL_ERROR_ON_ENTRY = CONST_ALUT_ERROR_AL_ERROR_ON_ENTRY -alut_ERROR_ALC_ERROR_ON_ENTRY = CONST_ALUT_ERROR_ALC_ERROR_ON_ENTRY -alut_ERROR_OPEN_DEVICE = CONST_ALUT_ERROR_OPEN_DEVICE -alut_ERROR_CLOSE_DEVICE = CONST_ALUT_ERROR_CLOSE_DEVICE -alut_ERROR_CREATE_CONTEXT = CONST_ALUT_ERROR_CREATE_CONTEXT -alut_ERROR_MAKE_CONTEXT_CURRENT = CONST_ALUT_ERROR_MAKE_CONTEXT_CURRENT -alut_ERROR_DESTROY_CONTEXT = CONST_ALUT_ERROR_DESTROY_CONTEXT -alut_ERROR_GEN_BUFFERS = CONST_ALUT_ERROR_GEN_BUFFERS -alut_ERROR_BUFFER_DATA = CONST_ALUT_ERROR_BUFFER_DATA -alut_ERROR_IO_ERROR = CONST_ALUT_ERROR_IO_ERROR -alut_ERROR_UNSUPPORTED_FILE_TYPE = CONST_ALUT_ERROR_UNSUPPORTED_FILE_TYPE -alut_ERROR_UNSUPPORTED_FILE_SUBTYPE = CONST_ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE -alut_ERROR_CORRUPT_OR_TRUNCATED_DATA = CONST_ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA - --------------------------------------------------------------------------------- hunk ./Sound/ALUT/Errors.hs 14 - ALUTError(..), ALUTErrorCategory(..), alutErrors + throwIf, throwIfALfalse, makeBuffer hunk ./Sound/ALUT/Errors.hs 17 +import Control.Monad ( liftM, when ) +import Data.Maybe ( fromJust, isNothing ) hunk ./Sound/ALUT/Errors.hs 20 -import Graphics.Rendering.OpenGL.GL.StateVar ( - GettableStateVar, makeGettableStateVar ) -import Sound.OpenAL.AL.BasicTypes ( ALenum ) -import Sound.ALUT.Constants ( - alut_ERROR_NO_ERROR, alut_ERROR_OUT_OF_MEMORY, alut_ERROR_INVALID_ENUM, - alut_ERROR_INVALID_VALUE, alut_ERROR_INVALID_OPERATION, - alut_ERROR_NO_CURRENT_CONTEXT, alut_ERROR_AL_ERROR_ON_ENTRY, - alut_ERROR_ALC_ERROR_ON_ENTRY, alut_ERROR_OPEN_DEVICE, - alut_ERROR_CLOSE_DEVICE, alut_ERROR_CREATE_CONTEXT, - alut_ERROR_MAKE_CONTEXT_CURRENT, alut_ERROR_DESTROY_CONTEXT, - alut_ERROR_GEN_BUFFERS, alut_ERROR_BUFFER_DATA, alut_ERROR_IO_ERROR, - alut_ERROR_UNSUPPORTED_FILE_TYPE, alut_ERROR_UNSUPPORTED_FILE_SUBTYPE, - alut_ERROR_CORRUPT_OR_TRUNCATED_DATA ) +import Sound.OpenAL.AL.ALboolean ( unmarshalALboolean ) +import Sound.OpenAL.AL.BasicTypes ( ALboolean, ALenum, ALuint ) +import Sound.OpenAL.AL.Buffer ( Buffer ) +import Sound.OpenAL.AL.BufferInternal ( unmarshalBuffer ) hunk ./Sound/ALUT/Errors.hs 27 -data ALUTError = ALUTError ALUTErrorCategory String - deriving ( Eq, Ord, Show ) +throwIf :: (a -> Bool) -> String -> IO a -> IO a +throwIf failurePredicate name action = do + returnValue <- action + when (failurePredicate returnValue) $ do + description <- peekCString =<< alutGetErrorString =<< alutGetError + ioError (userError (name ++ ": " ++ description)) + return returnValue hunk ./Sound/ALUT/Errors.hs 35 -data ALUTErrorCategory = - ALUTInvalidEnum - | ALUTInvalidValue - | ALUTInvalidOperation - | ALUTOutOfMemory - | ALUTNoCurrentContext - | ALUTALErrorOnEntry - | ALUTALCErrorOnEntry - | ALUTOpenDeviceFailed - | ALUTCloseDeviceFailed - | ALUTCreateContextFailed - | ALUTMakeContextCurrentFailed - | ALUTDestroyContextFailed - | ALUTGenBuffersFailed - | ALUTBufferDataFailed - | ALUTIOError - | ALUTUnsupportedFileType - | ALUTUnsupportedFileSubtype - | ALUTCorruptOrTruncatedData - deriving ( Eq, Ord, Show ) +foreign import CALLCONV unsafe "alutGetError" + alutGetError :: IO ALenum hunk ./Sound/ALUT/Errors.hs 38 -unmarshalALUTErrorCategory :: ALenum -> ALUTErrorCategory -unmarshalALUTErrorCategory x - | x == alut_ERROR_INVALID_ENUM = ALUTInvalidEnum - | x == alut_ERROR_INVALID_VALUE = ALUTInvalidValue - | x == alut_ERROR_INVALID_OPERATION = ALUTInvalidOperation - | x == alut_ERROR_OUT_OF_MEMORY = ALUTOutOfMemory - | x == alut_ERROR_NO_CURRENT_CONTEXT = ALUTNoCurrentContext - | x == alut_ERROR_AL_ERROR_ON_ENTRY = ALUTALErrorOnEntry - | x == alut_ERROR_ALC_ERROR_ON_ENTRY = ALUTALCErrorOnEntry - | x == alut_ERROR_OPEN_DEVICE = ALUTOpenDeviceFailed - | x == alut_ERROR_CLOSE_DEVICE = ALUTCloseDeviceFailed - | x == alut_ERROR_CREATE_CONTEXT = ALUTCreateContextFailed - | x == alut_ERROR_MAKE_CONTEXT_CURRENT = ALUTMakeContextCurrentFailed - | x == alut_ERROR_DESTROY_CONTEXT = ALUTDestroyContextFailed - | x == alut_ERROR_GEN_BUFFERS = ALUTGenBuffersFailed - | x == alut_ERROR_BUFFER_DATA = ALUTBufferDataFailed - | x == alut_ERROR_IO_ERROR = ALUTIOError - | x == alut_ERROR_UNSUPPORTED_FILE_TYPE = ALUTUnsupportedFileType - | x == alut_ERROR_UNSUPPORTED_FILE_SUBTYPE = ALUTUnsupportedFileSubtype - | x == alut_ERROR_CORRUPT_OR_TRUNCATED_DATA = ALUTCorruptOrTruncatedData - | otherwise = error ("unmarshalALUTErrorCategory: illegal value " ++ show x) +foreign import CALLCONV unsafe "alutGetErrorString" + alutGetErrorString :: ALenum -> IO CString hunk ./Sound/ALUT/Errors.hs 43 -alutErrors :: GettableStateVar [ALUTError] -alutErrors = - makeGettableStateVar $ do - c <- alutGetError - if c == alut_ERROR_NO_ERROR - then return [] - else do - p <- alutGetErrorString c - s <- peekCString p - return [ ALUTError (unmarshalALUTErrorCategory c) s ] +throwIfALfalse :: String -> IO ALboolean -> IO () +throwIfALfalse name action = do + throwIf (not . unmarshalALboolean) name action + return () hunk ./Sound/ALUT/Errors.hs 48 -foreign import CALLCONV unsafe "alutGetError" - alutGetError :: IO ALenum +-------------------------------------------------------------------------------- hunk ./Sound/ALUT/Errors.hs 50 -foreign import CALLCONV unsafe "alutGetErrorString" - alutGetErrorString :: ALenum -> IO CString +makeBuffer :: String -> IO ALuint -> IO Buffer +makeBuffer name = + liftM fromJust . throwIf isNothing name . liftM unmarshalBuffer hunk ./Sound/ALUT/Initialization.hs 18 -import Data.IORef ( newIORef, readIORef, writeIORef ) hunk ./Sound/ALUT/Initialization.hs 21 -import Sound.OpenAL.AL.ALboolean ( unmarshalALboolean ) +import Sound.ALUT.Errors ( throwIfALfalse ) hunk ./Sound/ALUT/Initialization.hs 40 -type Runner a = ArgumentConsumer (IO a) -> IO (Maybe a) +type Runner a = ArgumentConsumer (IO a) -> IO a hunk ./Sound/ALUT/Initialization.hs 45 -runALUT = runner alutInit +runALUT = runner "runALUT" alutInit hunk ./Sound/ALUT/Initialization.hs 55 -runALUTUsingCurrentContext = runner alutInitWithoutContext +runALUTUsingCurrentContext = + runner "runALUTUsingCurrentContext" alutInitWithoutContext hunk ./Sound/ALUT/Initialization.hs 63 -runner :: InitAction -> String -> [String] -> Runner a -runner initAction name args action = do - -- Alas, neither "bracket" nor "finally" return the result of the "after" - -- computation, so we have to use some trickery involving an IO reference. - -- We could define a separate Monad for this, but it's not worth the trouble. - (check,returnIfFailed) <- do - okRef <- newIORef True - return (\act -> do returnValue <- act - writeIORef okRef (unmarshalALboolean returnValue), - \act -> do ok <- readIORef okRef - if ok then act else return Nothing) - - check $ initAction nullPtr nullPtr - returnIfFailed $ do - returnValue <- action name args `finally` check alutExit - returnIfFailed $ - return $ Just returnValue +runner :: String -> InitAction -> String -> [String] -> Runner a +runner name initAction progName args action = do + -- ToDo: Thread progName and args through initAction + throwIfALfalse name $ initAction nullPtr nullPtr + action progName args `finally` throwIfALfalse name alutExit hunk ./Sound/ALUT/Loaders.hs 26 +import Sound.ALUT.Errors ( throwIf, makeBuffer ) hunk ./Sound/ALUT/Loaders.hs 29 -import Sound.OpenAL.AL.BufferInternal ( unmarshalBuffer ) hunk ./Sound/ALUT/Loaders.hs 48 -createBuffer :: SoundDataSource a -> IO (Maybe Buffer) +createBuffer :: SoundDataSource a -> IO Buffer hunk ./Sound/ALUT/Loaders.hs 50 - liftM unmarshalBuffer $ + makeBuffer "createBuffer" $ hunk ./Sound/ALUT/Loaders.hs 63 -createBufferData :: SoundDataSource a -> IO (Maybe (BufferData b)) +createBufferData :: SoundDataSource a -> IO (BufferData b) hunk ./Sound/ALUT/Loaders.hs 70 -loadWith :: (Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b)) -> IO (Maybe (BufferData b)) +loadWith :: (Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b)) -> IO (BufferData b) hunk ./Sound/ALUT/Loaders.hs 75 - buf <- loader formatBuf sizeBuf frequencyBuf - if buf == nullPtr - then return Nothing - else do - format <- peek formatBuf - size <- peek sizeBuf - frequency <- peek frequencyBuf - return $ Just (BufferData (MemoryRegion buf size) (unmarshalFormat format) frequency) + buf <- throwIf (== nullPtr) "createBufferData" $ + loader formatBuf sizeBuf frequencyBuf + format <- peek formatBuf + size <- peek sizeBuf + frequency <- peek frequencyBuf + return $ BufferData (MemoryRegion buf size) (unmarshalFormat format) frequency hunk ./Sound/ALUT/Sleep.hs 17 -import Control.Monad ( liftM ) -import Sound.OpenAL.AL.ALboolean ( unmarshalALboolean ) +import Sound.ALUT.Errors ( throwIfALfalse ) hunk ./Sound/ALUT/Sleep.hs 22 -microSleep :: Int -> IO Bool -microSleep = liftM unmarshalALboolean . alutMicroSleep . fromIntegral +microSleep :: Int -> IO () +microSleep microSeconds = + throwIfALfalse "microSleep" $ alutMicroSleep (fromIntegral microSeconds) hunk ./configure.ac 36 -FP_CHECK_CONSTS([ALUT_API_MAJOR_VERSION ALUT_API_MINOR_VERSION ALUT_ERROR_NO_ERROR ALUT_ERROR_OUT_OF_MEMORY ALUT_ERROR_INVALID_ENUM ALUT_ERROR_INVALID_VALUE ALUT_ERROR_INVALID_OPERATION ALUT_ERROR_NO_CURRENT_CONTEXT ALUT_ERROR_AL_ERROR_ON_ENTRY ALUT_ERROR_ALC_ERROR_ON_ENTRY ALUT_ERROR_OPEN_DEVICE ALUT_ERROR_CLOSE_DEVICE ALUT_ERROR_CREATE_CONTEXT ALUT_ERROR_MAKE_CONTEXT_CURRENT ALUT_ERROR_DESTROY_CONTEXT ALUT_ERROR_GEN_BUFFERS ALUT_ERROR_BUFFER_DATA ALUT_ERROR_IO_ERROR ALUT_ERROR_UNSUPPORTED_FILE_TYPE ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA ALUT_WAVEFORM_SINE ALUT_WAVEFORM_SQUARE ALUT_WAVEFORM_SAWTOOTH ALUT_WAVEFORM_WHITENOISE ALUT_WAVEFORM_IMPULSE ALUT_LOADER_BUFFER ALUT_LOADER_MEMORY], [#if HAVE_AL_ALUT_H +FP_CHECK_CONSTS([ALUT_API_MAJOR_VERSION ALUT_API_MINOR_VERSION ALUT_WAVEFORM_SINE ALUT_WAVEFORM_SQUARE ALUT_WAVEFORM_SAWTOOTH ALUT_WAVEFORM_WHITENOISE ALUT_WAVEFORM_IMPULSE ALUT_LOADER_BUFFER ALUT_LOADER_MEMORY], [#if HAVE_AL_ALUT_H hunk ./examples/Basic/HelloWorld.hs 14 -main :: IO (Maybe Bool) +main :: IO () hunk ./examples/Basic/HelloWorld.hs 19 - buffer helloSource $= helloBuffer + buffer helloSource $= Just helloBuffer hunk ./examples/Basic/PlayFile.hs 17 -printErrors :: String -> [String] -> IO () -printErrors prefix errs = do - hPutStrLn stderr . concat . (prefix :) . intersperse "," $ errs - exitFailure - -printALErrors :: String -> [ALError] -> IO () -printALErrors prefix errs = printErrors prefix [ d | ALError _ d <- errs ] - -printALUTErrors :: String -> [ALUTError] -> IO () -printALUTErrors prefix errs = printErrors prefix [ d | ALUTError _ d <- errs ] - --- Check every 0.1 seconds if the sound is still playing. -waitWhilePlaying :: Source -> IO () -waitWhilePlaying source = do - microSleep 100000 - state <- get (sourceState source) - when (state == Playing) $ - waitWhilePlaying source - hunk ./examples/Basic/PlayFile.hs 20 - maybeBuffer <- createBuffer (File fileName) - case maybeBuffer of - - Nothing -> do - errs <- get alutErrors - printALUTErrors ("Error loading file: ") errs + buf <- createBuffer (File fileName) hunk ./examples/Basic/PlayFile.hs 22 - justBuffer -> do - -- Generate a single source, attach the buffer to it and start playing. - [source] <- genObjectNames 1 - buffer source $= justBuffer - play [source] + -- Generate a single source, attach the buffer to it and start playing. + [source] <- genObjectNames 1 + buffer source $= Just buf + play [source] hunk ./examples/Basic/PlayFile.hs 27 - -- Normally nothing should go wrong above, but one never knows... - errs <- get alErrors - unless (null errs) $ - printALErrors "Error while trying to play sound: " errs + -- Normally nothing should go wrong above, but one never knows... + errs <- get alErrors + unless (null errs) $ do + hPutStrLn stderr (concat (intersperse "," [ d | ALError _ d <- errs ])) + exitFailure hunk ./examples/Basic/PlayFile.hs 33 - waitWhilePlaying source + -- Check every 0.1 seconds if the sound is still playing. + let waitWhilePlaying = do + microSleep 100000 + state <- get (sourceState source) + when (state == Playing) $ + waitWhilePlaying + waitWhilePlaying hunk ./examples/Basic/PlayFile.hs 44 - ok <- withProgNameAndArgs runALUT $ \progName args -> do + withProgNameAndArgs runALUT $ \progName args -> do hunk ./examples/Basic/PlayFile.hs 54 - when (ok == Nothing) $ do - errs <- get alutErrors - printALUTErrors "Error during ALUT (de-)initialization" errs - hunk ./examples/TestSuite/TestFileLoader.hs 18 -printErrors :: String -> [String] -> IO () -printErrors prefix errs = do - hPutStrLn stderr . concat . (prefix :) . intersperse "," $ errs - exitFailure - -printALErrors :: String -> [ALError] -> IO () -printALErrors prefix errs = printErrors prefix [ d | ALError _ d <- errs ] - -printALUTErrors :: String -> [ALUTError] -> IO () -printALUTErrors prefix errs = printErrors prefix [ d | ALUTError _ d <- errs ] - --- Check every 0.1 seconds if the sound is still playing. -waitWhilePlaying :: Source -> IO () -waitWhilePlaying source = do - microSleep 100000 - state <- get (sourceState source) - when (state == Playing) $ - waitWhilePlaying source - hunk ./examples/TestSuite/TestFileLoader.hs 21 - maybeBuffer <- createBuffer (File fileName) - case maybeBuffer of - - Nothing -> do - errs <- get alutErrors - printALUTErrors ("Error loading file: ") errs + buf <- createBuffer (File fileName) hunk ./examples/TestSuite/TestFileLoader.hs 23 - justBuffer -> do - -- Generate a single source, attach the buffer to it and start playing. - [source] <- genObjectNames 1 - buffer source $= justBuffer - play [source] + -- Generate a single source, attach the buffer to it and start playing. + [source] <- genObjectNames 1 + buffer source $= Just buf + play [source] hunk ./examples/TestSuite/TestFileLoader.hs 28 - -- Normally nothing should go wrong above, but one never knows... - errs <- get alErrors - unless (null errs) $ - printALErrors "Error while trying to play sound: " errs + -- Normally nothing should go wrong above, but one never knows... + errs <- get alErrors + unless (null errs) $ do + hPutStrLn stderr (concat (intersperse "," [ d | ALError _ d <- errs ])) + exitFailure hunk ./examples/TestSuite/TestFileLoader.hs 34 - waitWhilePlaying source + -- Check every 0.1 seconds if the sound is still playing. + let waitWhilePlaying = do + microSleep 100000 + state <- get (sourceState source) + when (state == Playing) $ + waitWhilePlaying + waitWhilePlaying hunk ./examples/TestSuite/TestFileLoader.hs 45 - ok <- withProgNameAndArgs runALUT $ \_progName _args -> do + withProgNameAndArgs runALUT $ \_progName _args -> do hunk ./examples/TestSuite/TestFileLoader.hs 50 - when (ok == Nothing) $ do - errs <- get alutErrors - printALUTErrors "Error during ALUT (de-)initialization" errs - hunk ./package.conf.in 12 - Sound.ALUT.Errors, hunk ./package.conf.in 18 - Sound.ALUT.Constants + Sound.ALUT.Constants, + Sound.ALUT.Errors hunk ./Sound/ALUT/Initialization.hs 18 -import Foreign.C.String ( CString ) +import Data.List ( genericLength ) +import Foreign.C.String ( CString, withCString, peekCString ) hunk ./Sound/ALUT/Initialization.hs 21 +import Foreign.Marshal.Array ( withArray0, peekArray ) +import Foreign.Marshal.Utils ( with, withMany ) hunk ./Sound/ALUT/Initialization.hs 24 +import Foreign.Storable ( Storable(peek) ) hunk ./Sound/ALUT/Initialization.hs 68 -runner name initAction progName args action = do - -- ToDo: Thread progName and args through initAction - throwIfALfalse name $ initAction nullPtr nullPtr - action progName args `finally` throwIfALfalse name alutExit +runner name initAction progName args action = + with (1 + genericLength args) $ \argcBuf -> + withMany withCString (progName : args) $ \argvPtrs -> + withArray0 nullPtr argvPtrs $ \argvBuf -> do + throwIfALfalse name $ initAction argcBuf argvBuf + newArgc <- peek argcBuf + newArgvPtrs <- peekArray (fromIntegral newArgc) argvBuf + newArgv <- mapM peekCString newArgvPtrs + action (head newArgv) (tail newArgv) + `finally` throwIfALfalse name alutExit hunk ./Sound/ALUT/Errors.hs 14 - throwIf, throwIfALfalse, makeBuffer + throwIfALfalse, throwIfNullPtr, makeBuffer hunk ./Sound/ALUT/Errors.hs 20 +import Foreign.Ptr ( Ptr, nullPtr ) hunk ./Sound/ALUT/Errors.hs 49 +-------------------------------------------------------------------------------- + +throwIfNullPtr :: String -> IO (Ptr a) -> IO (Ptr a) +throwIfNullPtr = throwIf (== nullPtr) + hunk ./Sound/ALUT/Loaders.hs 22 -import Foreign.Ptr ( Ptr, nullPtr ) +import Foreign.Ptr ( Ptr ) hunk ./Sound/ALUT/Loaders.hs 26 -import Sound.ALUT.Errors ( throwIf, makeBuffer ) +import Sound.ALUT.Errors ( makeBuffer, throwIfNullPtr ) hunk ./Sound/ALUT/Loaders.hs 75 - buf <- throwIf (== nullPtr) "createBufferData" $ + buf <- throwIfNullPtr "createBufferData" $ hunk ./Sound/ALUT/Loaders.hs 91 -bufferMIMETypes = mimeTypes alut_LOADER_BUFFER +bufferMIMETypes = mimeTypes "bufferMIMETypes" alut_LOADER_BUFFER hunk ./Sound/ALUT/Loaders.hs 94 -bufferDataMIMETypes = mimeTypes alut_LOADER_MEMORY +bufferDataMIMETypes = mimeTypes "bufferDataMIMETypes" alut_LOADER_MEMORY hunk ./Sound/ALUT/Loaders.hs 96 -mimeTypes :: ALenum -> GettableStateVar [String] -mimeTypes loaderType = +mimeTypes :: String -> ALenum -> GettableStateVar [String] +mimeTypes name loaderType = hunk ./Sound/ALUT/Loaders.hs 99 - ts <- alutGetMIMETypes loaderType + ts <- throwIfNullPtr name $ alutGetMIMETypes loaderType hunk ./Sound/ALUT/Errors.hs 1 +-- #hide hunk ./Sound/ALUT.hs 21 - module Sound.ALUT.Errors, hunk ./Sound/ALUT.hs 30 -import Sound.ALUT.Errors addfile ./examples/TestSuite/TestErrorStuff.hs addfile ./examples/TestSuite/TestVersion.hs hunk ./examples/TestSuite/TestErrorStuff.hs 1 +{- + TestErrorStuff.hs (adapted from test_errorstuff.c in freealut) + Copyright (c) Sven Panne 2005 + This file is part of the ALUT package & distributed under a BSD-style license + See the file libraries/ALUT/LICENSE +-} + +import Sound.ALUT +import System.Exit +import System.IO + +-- This is a minimal test for error handling. + +main :: IO () +main = do + withProgNameAndArgs runALUT $ \_progName _args -> + createBuffer (File "no_such_file_in_existance.wav") + `catch` const (exitWith ExitSuccess) + hPutStrLn stderr "expected an I/O error" + exitFailure hunk ./examples/TestSuite/TestVersion.hs 1 +{- + TestVersion.hs (adapted from test_version.c in freealut) + Copyright (c) Sven Panne 2005 + This file is part of the ALUT package & distributed under a BSD-style license + See the file libraries/ALUT/LICENSE +-} + +import Control.Monad +import Graphics.Rendering.OpenGL +import Sound.ALUT +import System.Exit +import System.IO + +-- This program checks that the version of OpenAL in the library agrees with the +-- header file we're compiled against. + +main :: IO () +main = + withProgNameAndArgs runALUT $ \_progName _args -> do + av <- get alutVersion + unless (av == alutAPIVersion) $ do + hPutStrLn stderr ("WARNING: The ALUT library is version " ++ av ++ ".x but the ALUT binding says it's " ++ alutAPIVersion ++ ".x!") + exitFailure + hPutStrLn stderr ("The ALUT library is at version " ++ av ++ ".x") addfile ./examples/TestSuite/TestMemoryLoader.hs addfile ./examples/TestSuite/TestWaveforms.hs hunk ./examples/TestSuite/TestFileLoader.hs 43 -main = do +main = hunk ./examples/TestSuite/TestMemoryLoader.hs 1 +{- + TestMemoryLoader.hs (adapted from test_memoryloader.c in freealut) + Copyright (c) Sven Panne 2005 + This file is part of the ALUT package & distributed under a BSD-style license + See the file libraries/ALUT/LICENSE +-} + +import Control.Exception ( bracket ) +import Control.Monad +import Data.List +import Foreign.Marshal.Alloc +import Graphics.Rendering.OpenGL +import Sound.ALUT +import System.Exit +import System.IO + +-- This program loads and plays a variety of files from memory, basically a +-- modified version of TestFileLoader.hs. + +withFileContents :: FilePath -> (MemoryRegion a -> IO b) -> IO b +withFileContents filePath action = + bracket (openBinaryFile filePath ReadMode) hClose $ \handle -> do + numBytes <- liftM fromIntegral (hFileSize handle) + allocaBytes numBytes $ \buf -> do + bytesRead <- hGetBuf handle buf numBytes + when (bytesRead /= numBytes) $ + ioError (userError "hGetBuf") + action (MemoryRegion buf (fromIntegral numBytes)) + +playFile :: FilePath -> IO () +playFile fileName = do + -- Load the sound file into memory and create an AL buffer from it. + buf <- withFileContents fileName (createBuffer . FileImage) + + -- Generate a single source, attach the buffer to it and start playing. + [source] <- genObjectNames 1 + buffer source $= Just buf + play [source] + + -- Normally nothing should go wrong above, but one never knows... + errs <- get alErrors + unless (null errs) $ do + hPutStrLn stderr (concat (intersperse "," [ d | ALError _ d <- errs ])) + exitFailure + + -- Check every 0.1 seconds if the sound is still playing. + let waitWhilePlaying = do + microSleep 100000 + state <- get (sourceState source) + when (state == Playing) $ + waitWhilePlaying + waitWhilePlaying + +main :: IO () +main = + -- Initialise ALUT and eat any ALUT-specific commandline flags. + withProgNameAndArgs runALUT $ \_progName _args -> do + + -- If everything is OK, play the sound files and exit when finished. Note + -- that we can not play raw sound files from memory because the format + -- can't be guessed without a file name. + mapM_ playFile [ "file1.wav", "file2.au" ] hunk ./examples/TestSuite/TestWaveforms.hs 1 +{- + TestWaveforms.hs (adapted from test_waveforms.c in freealut) + Copyright (c) Sven Panne 2005 + This file is part of the ALUT package & distributed under a BSD-style license + See the file libraries/ALUT/LICENSE +-} + +import Control.Monad +import Graphics.Rendering.OpenGL +import Sound.ALUT +import System.IO + +-- This program plays a 440Hz tone using a variety of waveforms. + +playTone :: (Frequency -> Phase -> Duration -> IO Buffer) -> IO () +playTone makeBuffer = do + buf <- makeBuffer 440 0 1 + [source] <- genObjectNames 1 + buffer source $= Just buf + play [source] + microSleep 1000000 + +main :: IO () +main = + withProgNameAndArgs runALUT $ \_progName _args -> + mapM_ playTone [ sine, square, sawtooth, (const (const whiteNoise)), impulse ] hunk ./Sound/ALUT/Sleep.hs 14 - microSleep + sleep hunk ./Sound/ALUT/Sleep.hs 18 -import Sound.OpenAL.AL.BasicTypes ( ALboolean, ALuint ) +import Sound.OpenAL.AL.BasicTypes ( ALboolean, ALfloat ) hunk ./Sound/ALUT/Sleep.hs 22 -microSleep :: Int -> IO () -microSleep microSeconds = - throwIfALfalse "microSleep" $ alutMicroSleep (fromIntegral microSeconds) +sleep :: Float -> IO () +sleep = throwIfALfalse "sleep" . alutSleep hunk ./Sound/ALUT/Sleep.hs 25 -foreign import CALLCONV unsafe "alutMicroSleep" - alutMicroSleep :: ALuint -> IO ALboolean +foreign import CALLCONV unsafe "alutSleep" + alutSleep :: ALfloat -> IO ALboolean hunk ./examples/Basic/HelloWorld.hs 21 - microSleep 3000000 + sleep 1 hunk ./examples/Basic/PlayFile.hs 35 - microSleep 100000 + sleep 0.1 hunk ./examples/TestSuite/TestFileLoader.hs 36 - microSleep 100000 + sleep 0.1 hunk ./examples/TestSuite/TestMemoryLoader.hs 48 - microSleep 100000 + sleep 0.1 hunk ./examples/TestSuite/TestWaveforms.hs 21 - microSleep 1000000 + sleep 1 hunk ./examples/Basic/HelloWorld.hs 8 -import Graphics.Rendering.OpenGL +import Graphics.Rendering.OpenGL ( ObjectName(genObjectNames), HasSetter(($=)) ) hunk ./examples/Basic/PlayFile.hs 8 -import Control.Monad -import Data.List -import Graphics.Rendering.OpenGL +import Control.Monad ( when, unless ) +import Data.List ( intersperse ) +import Graphics.Rendering.OpenGL ( + ObjectName(genObjectNames), HasGetter(get), HasSetter(($=)) ) hunk ./examples/Basic/PlayFile.hs 13 -import System.Exit -import System.IO +import System.Exit ( exitFailure ) +import System.IO ( hPutStrLn, stderr ) hunk ./examples/TestSuite/TestErrorStuff.hs 9 -import System.Exit -import System.IO +import System.Exit ( exitFailure, exitWith, ExitCode(ExitSuccess) ) +import System.IO ( hPutStrLn, stderr ) hunk ./examples/TestSuite/TestFileLoader.hs 8 -import Control.Monad -import Data.List -import Graphics.Rendering.OpenGL +import Control.Monad ( when, unless ) +import Data.List ( intersperse ) +import Graphics.Rendering.OpenGL ( + ObjectName(genObjectNames), HasGetter(get), HasSetter(($=)) ) hunk ./examples/TestSuite/TestFileLoader.hs 13 -import System.Exit -import System.IO +import System.Exit ( exitFailure ) +import System.IO ( hPutStrLn, stderr ) hunk ./examples/TestSuite/TestMemoryLoader.hs 9 -import Control.Monad -import Data.List -import Foreign.Marshal.Alloc -import Graphics.Rendering.OpenGL +import Control.Monad ( when, unless ) +import Data.List ( intersperse ) +import Foreign.Marshal.Alloc ( allocaBytes ) +import Graphics.Rendering.OpenGL ( + ObjectName(genObjectNames), HasGetter(get), HasSetter(($=)) ) hunk ./examples/TestSuite/TestMemoryLoader.hs 15 -import System.Exit -import System.IO +import System.Exit ( exitFailure ) +import System.IO ( + openBinaryFile, IOMode(ReadMode), hClose, hFileSize, hGetBuf, hPutStrLn, + stderr ) hunk ./examples/TestSuite/TestMemoryLoader.hs 26 - numBytes <- liftM fromIntegral (hFileSize handle) + numBytes <- fmap fromIntegral (hFileSize handle) hunk ./examples/TestSuite/TestVersion.hs 8 -import Control.Monad -import Graphics.Rendering.OpenGL +import Control.Monad ( unless ) +import Graphics.Rendering.OpenGL ( HasGetter(get) ) hunk ./examples/TestSuite/TestVersion.hs 11 -import System.Exit -import System.IO +import System.Exit ( exitFailure ) +import System.IO ( hPutStrLn, stderr ) hunk ./examples/TestSuite/TestWaveforms.hs 8 -import Control.Monad -import Graphics.Rendering.OpenGL +import Graphics.Rendering.OpenGL ( ObjectName(genObjectNames), HasSetter(($=)) ) hunk ./examples/TestSuite/TestWaveforms.hs 10 -import System.IO hunk ./Sound/ALUT/Errors.hs 18 -import Control.Monad ( liftM, when ) +import Control.Monad ( when ) hunk ./Sound/ALUT/Errors.hs 59 - liftM fromJust . throwIf isNothing name . liftM unmarshalBuffer + fmap fromJust . throwIf isNothing name . fmap unmarshalBuffer hunk ./Sound/ALUT/Loaders.hs 18 -import Control.Monad ( liftM ) hunk ./Sound/ALUT/Loaders.hs 99 - liftM (splitBy (== ',')) $ peekCString ts + fmap (splitBy (== ',')) $ peekCString ts hunk ./examples/Basic/HelloWorld.hs 8 -import Graphics.Rendering.OpenGL ( ObjectName(genObjectNames), HasSetter(($=)) ) hunk ./examples/Basic/PlayFile.hs 10 -import Graphics.Rendering.OpenGL ( - ObjectName(genObjectNames), HasGetter(get), HasSetter(($=)) ) hunk ./examples/TestSuite/TestFileLoader.hs 10 -import Graphics.Rendering.OpenGL ( - ObjectName(genObjectNames), HasGetter(get), HasSetter(($=)) ) hunk ./examples/TestSuite/TestMemoryLoader.hs 12 -import Graphics.Rendering.OpenGL ( - ObjectName(genObjectNames), HasGetter(get), HasSetter(($=)) ) hunk ./examples/TestSuite/TestVersion.hs 9 -import Graphics.Rendering.OpenGL ( HasGetter(get) ) hunk ./examples/TestSuite/TestWaveforms.hs 8 -import Graphics.Rendering.OpenGL ( ObjectName(genObjectNames), HasSetter(($=)) ) addfile ./examples/Basic/OpenALInfo.hs hunk ./examples/Basic/OpenALInfo.hs 1 +{- + OpenALInfo.hs (modeled after OpenGL's glxinfo) + Copyright (c) Sven Panne 2005 + This file is part of the ALUT package & distributed under a BSD-style license + See the file libraries/ALUT/LICENSE +-} + +import Text.PrettyPrint +import Sound.ALUT + +-- This program prints some basic information about ALC and AL. + +printVar :: (a -> Doc) -> GettableStateVar a -> IO () +printVar format var = get var >>= putStrLn . render . format + +printStringVar :: String -> GettableStateVar String -> IO () +printStringVar header = printVar (\v -> text header <> colon <+> text v) + +printStringListVar :: String -> GettableStateVar [String] -> IO () +printStringListVar header = + printVar (\xs -> text header <> colon $$ + nest 4 (fsep (punctuate comma (map text xs)))) + +main :: IO () +main = + withProgNameAndArgs runALUT $ \_progName _args -> do + Just ctx <- get currentContext + Just dev <- get (contextsDevice ctx) + printStringVar "ALC version" alcVersion + printStringListVar "ALC extensions" (alcExtensions dev) + printStringVar "AL version" alVersion + printStringVar "AL renderer" alRenderer + printStringVar "AL vendor" alVendor + printStringListVar "AL extensions" alExtensions hunk ./ALUT.cabal 2 -version: 1.0 +version: 2.0 hunk ./ALUT.cabal 26 - Sound.ALUT.BuiltInSounds, hunk ./ALUT.cabal 31 + Sound.ALUT.Config, hunk ./Sound/ALUT.hs 23 - module Sound.ALUT.BuiltInSounds, hunk ./Sound/ALUT.hs 31 -import Sound.ALUT.BuiltInSounds hunk ./Sound/ALUT/BuiltInSounds.hs 1 --------------------------------------------------------------------------------- --- | --- Module : Sound.ALUT.BuiltInSounds --- Copyright : (c) Sven Panne 2005 --- License : BSD-style (see the file libraries/ALUT/LICENSE) --- --- Maintainer : sven.panne@aedion.de --- Stability : provisional --- Portability : portable --- --------------------------------------------------------------------------------- - -module Sound.ALUT.BuiltInSounds ( - helloWorld, Phase, Duration, sine, square, sawtooth, impulse, whiteNoise -) where - -import Sound.ALUT.Constants ( - alut_WAVEFORM_SINE, alut_WAVEFORM_SQUARE, alut_WAVEFORM_SAWTOOTH, - alut_WAVEFORM_WHITENOISE, alut_WAVEFORM_IMPULSE ) -import Sound.ALUT.Errors ( makeBuffer ) -import Sound.OpenAL.AL.BasicTypes ( ALuint, ALenum, ALfloat ) -import Sound.OpenAL.AL.Buffer ( Buffer ) -import Sound.OpenAL.ALC.Context ( Frequency ) - --------------------------------------------------------------------------------- - -helloWorld :: IO Buffer -helloWorld = makeBuffer "helloWorld" alutCreateBufferHelloWorld - -foreign import CALLCONV unsafe "alutCreateBufferHelloWorld" - alutCreateBufferHelloWorld :: IO ALuint - --------------------------------------------------------------------------------- - -type Phase = Float - -type Duration = Float - -sine :: Frequency -> Phase -> Duration -> IO Buffer -sine = createBufferWaveform "sine" alut_WAVEFORM_SINE - -square :: Frequency -> Phase -> Duration -> IO Buffer -square = createBufferWaveform "square" alut_WAVEFORM_SQUARE - -sawtooth :: Frequency -> Phase -> Duration -> IO Buffer -sawtooth = createBufferWaveform "sawtooth" alut_WAVEFORM_SAWTOOTH - -impulse :: Frequency -> Phase -> Duration -> IO Buffer -impulse = createBufferWaveform "impulse" alut_WAVEFORM_IMPULSE - -whiteNoise :: Duration -> IO Buffer -whiteNoise = createBufferWaveform "whiteNoise" alut_WAVEFORM_WHITENOISE 1 0 - -createBufferWaveform :: String -> ALenum -> Frequency -> Phase -> Duration -> IO Buffer -createBufferWaveform name shape frequency phase duration = - makeBuffer name $ - alutCreateBufferWaveform shape frequency phase duration - -foreign import CALLCONV unsafe "alutCreateBufferWaveform" - alutCreateBufferWaveform :: ALenum -> ALfloat -> ALfloat -> ALfloat -> IO ALuint rmfile ./Sound/ALUT/BuiltInSounds.hs addfile ./Sound/ALUT/Config.hs hunk ./Sound/ALUT/Config.hs 1 +-- #hide +-------------------------------------------------------------------------------- +-- | +-- Module : Sound.ALUT.Config +-- Copyright : (c) Sven Panne 2006 +-- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- +-- Maintainer : sven.panne@aedion.de +-- Stability : provisional +-- Portability : portable +-- +-- This purely internal module defines the platform-specific stuff which has +-- been figured out by configure. +-- +-------------------------------------------------------------------------------- + +module Sound.ALUT.Config ( + alut_Init, + alut_InitWithoutContext, + alut_Exit, + + alut_GetError, + alut_GetErrorString, + + alut_CreateBufferFromFile, + alut_CreateBufferFromFileImage, + alut_CreateBufferHelloWorld, + alut_CreateBufferWaveform, + + alut_LoadMemoryFromFile, + alut_LoadMemoryFromFileImage, + alut_LoadMemoryHelloWorld, + alut_LoadMemoryWaveform, + + alut_GetMIMETypes, + + alut_GetMajorVersion, + alut_GetMinorVersion, + + alut_Sleep +) where + +-------------------------------------------------------------------------------- + +#include "HsALUTConfig.h" + +-------------------------------------------------------------------------------- + +import Foreign.C +import Foreign.Ptr +import Sound.OpenAL.AL.BasicTypes + +#if ALUTINIT_VOID || !HAVE_ALUTINITWITHOUTCONTEXT || ALUTEXIT_VOID || !HAVE_ALUTSLEEP +import Sound.OpenAL.AL.ALboolean +#endif + +#if !HAVE_ALUTCREATEBUFFERFROMFILE || !HAVE_ALUTCREATEBUFFERFROMFILEIMAGE || !HAVE_ALUTCREATEBUFFERHELLOWORLD || !HAVE_ALUTCREATEBUFFERWAVEFORM +import Sound.OpenAL.AL.BufferInternal +#endif + +#if !HAVE_ALUTSLEEP && defined(__GLASGOW_HASKELL__) +import Control.Concurrent +#endif + + +-------------------------------------------------------------------------------- + +#if ALUTINIT_VOID + +alut_Init :: Ptr CInt -> Ptr CString -> IO ALboolean +alut_Init argc argv = alutInit argc argv >> return (marshalALboolean True) + +foreign import CALLCONV unsafe "alutInit" + alutInit :: Ptr CInt -> Ptr CString -> IO () + +#else + +foreign import CALLCONV unsafe "alutInit" + alut_Init :: Ptr CInt -> Ptr CString -> IO ALboolean + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTINITWITHOUTCONTEXT + +foreign import CALLCONV unsafe "alutInitWithoutContext" + alut_InitWithoutContext :: Ptr CInt -> Ptr CString -> IO ALboolean + +#else + +alut_InitWithoutContext :: Ptr CInt -> Ptr CString -> IO ALboolean +alut_InitWithoutContext _ _ = return (marshalALboolean True) + +#endif + +-------------------------------------------------------------------------------- + +#if ALUTEXIT_VOID + +alut_Exit :: IO ALboolean +alut_Exit = alutExit >> return (marshalALboolean True) + +foreign import CALLCONV unsafe "alutExit" + alutExit :: IO () + +#else + +foreign import CALLCONV unsafe "alutExit" + alut_Exit :: IO ALboolean + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTGETERROR + +foreign import CALLCONV unsafe "alutGetError" + alut_GetError :: IO ALenum + +#else + +alut_GetError :: IO ALenum +alut_GetError = return 0 + +#endif + +-------------------------------------------------------------------------------- + +alut_GetErrorString :: ALenum -> IO String + +#if HAVE_ALUTGETERRORSTRING + +alut_GetErrorString e = peekCString =<< alutGetErrorString e + +foreign import CALLCONV unsafe "alutGetErrorString" + alutGetErrorString :: ALenum -> IO CString + +#else + +alut_GetErrorString _ = return "" + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTCREATEBUFFERFROMFILE + +foreign import CALLCONV unsafe "alutCreateBufferFromFile" + alut_CreateBufferFromFile :: CString -> IO ALuint + +#else + +alut_CreateBufferFromFile :: CString -> IO ALuint +alut_CreateBufferFromFile _ = return (marshalBuffer Nothing) + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTCREATEBUFFERFROMFILEIMAGE + +foreign import CALLCONV unsafe "alutCreateBufferFromFileImage" + alut_CreateBufferFromFileImage :: Ptr a -> ALsizei -> IO ALuint + +#else + +alut_CreateBufferFromFileImage :: Ptr a -> ALsizei -> IO ALuint +alut_CreateBufferFromFileImage _ _ = return (marshalBuffer Nothing) + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTCREATEBUFFERHELLOWORLD + +foreign import CALLCONV unsafe "alutCreateBufferHelloWorld" + alut_CreateBufferHelloWorld :: IO ALuint + +#else + +alut_CreateBufferHelloWorld :: IO ALuint +alut_CreateBufferHelloWorld = return (marshalBuffer Nothing) + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTCREATEBUFFERWAVEFORM + +foreign import CALLCONV unsafe "alutCreateBufferWaveform" + alut_CreateBufferWaveform :: ALenum -> ALfloat -> ALfloat -> ALfloat -> IO ALuint + +#else + +alut_CreateBufferWaveform :: ALenum -> ALfloat -> ALfloat -> ALfloat -> IO ALuint +alut_CreateBufferWaveform _ _ _ _ = return (marshalBuffer Nothing) + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTLOADMEMORYFROMFILE + +foreign import CALLCONV unsafe "alutLoadMemoryFromFile" + alut_LoadMemoryFromFile :: CString -> Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b) + +#else + +alut_LoadMemoryFromFile :: CString -> Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b) +alut_LoadMemoryFromFile _ _ _ _ = return nullPtr + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTLOADMEMORYFROMFILEIMAGE + +foreign import CALLCONV unsafe "alutLoadMemoryFromFileImage" + alut_LoadMemoryFromFileImage :: Ptr a -> ALsizei -> Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b) + +#else + +alut_LoadMemoryFromFileImage :: Ptr a -> ALsizei -> Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b) +alut_LoadMemoryFromFileImage _ _ _ _ _ = return nullPtr + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTLOADMEMORYHELLOWORLD + +foreign import CALLCONV unsafe "alutLoadMemoryHelloWorld" + alut_LoadMemoryHelloWorld :: Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b) + +#else + +alut_LoadMemoryHelloWorld :: Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b) +alut_LoadMemoryHelloWorld _ _ _ = return nullPtr + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTLOADMEMORYWAVEFORM + +foreign import CALLCONV unsafe "alutLoadMemoryWaveform" + alut_LoadMemoryWaveform :: ALenum -> ALfloat -> ALfloat -> ALfloat -> Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b) + +#else + +alut_LoadMemoryWaveform :: ALenum -> ALfloat -> ALfloat -> ALfloat -> Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b) +alut_LoadMemoryWaveform _ _ _ _ _ _ _ = return nullPtr + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTGETMIMETYPES + +foreign import CALLCONV unsafe "alutGetMIMETypes" + alut_GetMIMETypes :: ALenum -> IO CString + +#else + +alut_GetMIMETypes :: ALenum -> IO CString +alut_GetMIMETypes _ = return nullPtr + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTGETMAJORVERSION + +foreign import CALLCONV unsafe "alutGetMajorVersion" + alut_GetMajorVersion :: IO ALint + +#else + +alut_GetMajorVersion :: IO ALint +alut_GetMajorVersion = return 0 + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTGETMINORVERSION + +foreign import CALLCONV unsafe "alutGetMinorVersion" + alut_GetMinorVersion :: IO ALint + +#else + +alut_GetMinorVersion :: IO ALint +alut_GetMinorVersion = return 0 + +#endif + +-------------------------------------------------------------------------------- + +#if HAVE_ALUTSLEEP + +foreign import CALLCONV unsafe "alutSleep" + alut_Sleep :: ALfloat -> IO ALboolean + +#else + +alut_Sleep :: ALfloat -> IO ALboolean +alut_Sleep d = mySleep d >> return (marshalALboolean True) + +mySleep :: ALfloat -> IO () + +#if defined(__GLASGOW_HASKELL__) + +mySleep = threadDelay . round . (* 1.0E6) + +#else + +mySleep = return () + +#endif + +#endif hunk ./Sound/ALUT/Constants.hs 31 - alut_WAVEFORM_WHITENOISE, alut_WAVEFORM_IMPULSE :: ALenum + alut_WAVEFORM_IMPULSE, alut_WAVEFORM_WHITENOISE :: ALenum hunk ./Sound/ALUT/Constants.hs 35 -alut_WAVEFORM_WHITENOISE = CONST_ALUT_WAVEFORM_WHITENOISE hunk ./Sound/ALUT/Constants.hs 36 +alut_WAVEFORM_WHITENOISE = CONST_ALUT_WAVEFORM_WHITENOISE hunk ./Sound/ALUT/Errors.hs 20 -import Foreign.C.String ( CString, peekCString ) hunk ./Sound/ALUT/Errors.hs 22 -import Sound.OpenAL.AL.BasicTypes ( ALboolean, ALenum, ALuint ) +import Sound.OpenAL.AL.BasicTypes ( ALboolean, ALuint ) hunk ./Sound/ALUT/Errors.hs 25 +import Sound.ALUT.Config ( alut_GetError, alut_GetErrorString ) hunk ./Sound/ALUT/Errors.hs 33 - description <- peekCString =<< alutGetErrorString =<< alutGetError + description <- alut_GetErrorString =<< alut_GetError hunk ./Sound/ALUT/Errors.hs 37 -foreign import CALLCONV unsafe "alutGetError" - alutGetError :: IO ALenum - -foreign import CALLCONV unsafe "alutGetErrorString" - alutGetErrorString :: ALenum -> IO CString - hunk ./Sound/ALUT/Initialization.hs 26 +import Sound.ALUT.Config ( alut_Init, alut_InitWithoutContext, alut_Exit ) hunk ./Sound/ALUT/Initialization.hs 50 -runALUT = runner "runALUT" alutInit - -type InitAction = Ptr CInt -> Ptr CString -> IO ALboolean - -foreign import CALLCONV unsafe "alutInit" - alutInit :: InitAction +runALUT = runner "runALUT" alut_Init hunk ./Sound/ALUT/Initialization.hs 56 - runner "runALUTUsingCurrentContext" alutInitWithoutContext - -foreign import CALLCONV unsafe "alutInitWithoutContext" - alutInitWithoutContext :: InitAction + runner "runALUTUsingCurrentContext" alut_InitWithoutContext hunk ./Sound/ALUT/Initialization.hs 60 -runner :: String -> InitAction -> String -> [String] -> Runner a +runner :: String -> (Ptr CInt -> Ptr CString -> IO ALboolean) -> String + -> [String] -> Runner a hunk ./Sound/ALUT/Initialization.hs 71 - `finally` throwIfALfalse name alutExit - -foreign import CALLCONV unsafe "alutExit" - alutExit :: IO ALboolean + `finally` throwIfALfalse name alut_Exit hunk ./Sound/ALUT/Loaders.hs 14 - SoundDataSource(..), createBuffer, createBufferData, + Phase, Duration, SoundDataSource(..), + createBuffer, createBufferData, hunk ./Sound/ALUT/Loaders.hs 19 -import Foreign.C.String ( CString, peekCString, withCString ) +import Foreign.C.String ( peekCString, withCString ) hunk ./Sound/ALUT/Loaders.hs 25 -import Sound.ALUT.Constants ( alut_LOADER_BUFFER, alut_LOADER_MEMORY ) +import Sound.ALUT.Config ( + alut_CreateBufferFromFile, alut_CreateBufferFromFileImage, + alut_CreateBufferHelloWorld, alut_CreateBufferWaveform, + alut_LoadMemoryFromFile, alut_LoadMemoryFromFileImage, + alut_LoadMemoryHelloWorld, alut_LoadMemoryWaveform, + alut_GetMIMETypes ) +import Sound.ALUT.Constants ( + alut_WAVEFORM_SINE, alut_WAVEFORM_SQUARE, alut_WAVEFORM_SAWTOOTH, + alut_WAVEFORM_IMPULSE, alut_WAVEFORM_WHITENOISE, + alut_LOADER_BUFFER, alut_LOADER_MEMORY ) hunk ./Sound/ALUT/Loaders.hs 36 -import Sound.OpenAL.AL.BasicTypes ( ALuint, ALsizei, ALenum, ALfloat ) +import Sound.OpenAL.AL.BasicTypes ( ALsizei, ALenum, ALfloat ) hunk ./Sound/ALUT/Loaders.hs 39 +import Sound.OpenAL.ALC.Context ( Frequency ) hunk ./Sound/ALUT/Loaders.hs 44 +type Phase = Float + +type Duration = Float + hunk ./Sound/ALUT/Loaders.hs 51 + | HelloWorld + | Sine Frequency Phase Duration + | Square Frequency Phase Duration + | Sawtooth Frequency Phase Duration + | Impulse Frequency Phase Duration + | WhiteNoise Duration hunk ./Sound/ALUT/Loaders.hs 69 -createBuffer src = - makeBuffer "createBuffer" $ - case src of - File filePath -> withCString filePath alutCreateBufferFromFile - FileImage (MemoryRegion buf size) -> alutCreateBufferFromFileImage buf size - -foreign import CALLCONV unsafe "alutCreateBufferFromFile" - alutCreateBufferFromFile :: CString -> IO ALuint - -foreign import CALLCONV unsafe "alutCreateBufferFromFileImage" - alutCreateBufferFromFileImage :: Ptr a -> ALsizei -> IO ALuint +createBuffer src = makeBuffer "createBuffer" $ case src of + File filePath -> withCString filePath alut_CreateBufferFromFile + FileImage (MemoryRegion buf size) -> alut_CreateBufferFromFileImage buf size + HelloWorld -> alut_CreateBufferHelloWorld + Sine f p d -> alut_CreateBufferWaveform alut_WAVEFORM_SINE f p d + Square f p d -> alut_CreateBufferWaveform alut_WAVEFORM_SQUARE f p d + Sawtooth f p d -> alut_CreateBufferWaveform alut_WAVEFORM_SAWTOOTH f p d + Impulse f p d -> alut_CreateBufferWaveform alut_WAVEFORM_IMPULSE f p d + WhiteNoise d -> alut_CreateBufferWaveform alut_WAVEFORM_WHITENOISE 1 0 d hunk ./Sound/ALUT/Loaders.hs 83 - File filePath -> - withCString filePath $ \fp -> loadWith (alutLoadMemoryFromFile fp) - FileImage (MemoryRegion buf size) -> - loadWith (alutLoadMemoryFromFileImage buf size) + File filePath -> withCString filePath $ \fp -> loadWith (alut_LoadMemoryFromFile fp) + FileImage (MemoryRegion buf size) -> loadWith (alut_LoadMemoryFromFileImage buf size) + HelloWorld -> loadWith alut_LoadMemoryHelloWorld + Sine f p d -> loadWith (alut_LoadMemoryWaveform alut_WAVEFORM_SINE f p d) + Square f p d -> loadWith (alut_LoadMemoryWaveform alut_WAVEFORM_SQUARE f p d) + Sawtooth f p d -> loadWith (alut_LoadMemoryWaveform alut_WAVEFORM_SAWTOOTH f p d) + Impulse f p d -> loadWith (alut_LoadMemoryWaveform alut_WAVEFORM_IMPULSE f p d) + WhiteNoise d -> loadWith (alut_LoadMemoryWaveform alut_WAVEFORM_WHITENOISE 1 0 d) hunk ./Sound/ALUT/Loaders.hs 104 -foreign import CALLCONV unsafe "alutLoadMemoryFromFile" - alutLoadMemoryFromFile :: CString -> Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b) - -foreign import CALLCONV unsafe "alutLoadMemoryFromFileImage" - alutLoadMemoryFromFileImage :: Ptr a -> ALsizei -> Ptr ALenum -> Ptr ALsizei -> Ptr ALfloat -> IO (Ptr b) - hunk ./Sound/ALUT/Loaders.hs 115 - ts <- throwIfNullPtr name $ alutGetMIMETypes loaderType + ts <- throwIfNullPtr name $ alut_GetMIMETypes loaderType hunk ./Sound/ALUT/Loaders.hs 124 -foreign import CALLCONV unsafe "alutGetMIMETypes" - alutGetMIMETypes :: ALenum -> IO CString - hunk ./Sound/ALUT/Sleep.hs 17 +import Sound.ALUT.Config ( alut_Sleep ) hunk ./Sound/ALUT/Sleep.hs 19 -import Sound.OpenAL.AL.BasicTypes ( ALboolean, ALfloat ) +import Sound.ALUT.Loaders ( Duration ) hunk ./Sound/ALUT/Sleep.hs 23 -sleep :: Float -> IO () -sleep = throwIfALfalse "sleep" . alutSleep - -foreign import CALLCONV unsafe "alutSleep" - alutSleep :: ALfloat -> IO ALboolean +sleep :: Duration -> IO () +sleep = throwIfALfalse "sleep" . alut_Sleep hunk ./Sound/ALUT/Version.hs 21 +import Sound.ALUT.Config ( alut_GetMajorVersion, alut_GetMinorVersion ) hunk ./Sound/ALUT/Version.hs 37 - liftM2 makeVersionString alutGetMajorVersion alutGetMinorVersion - -foreign import CALLCONV unsafe "alutGetMajorVersion" - alutGetMajorVersion :: IO ALint - -foreign import CALLCONV unsafe "alutGetMinorVersion" - alutGetMinorVersion :: IO ALint + liftM2 makeVersionString alut_GetMajorVersion alut_GetMinorVersion hunk ./aclocal.m4 84 + AL_LIBS=no + AC_SEARCH_LIBS([alGenSources], [openal openal32], [AL_LIBS="$ac_cv_search_alGenSources"]) + test x"$AL_LIBS" = x"none required" && AL_LIBS= + hunk ./aclocal.m4 89 - LIBS="$LIBS -lopenal" - AC_SEARCH_LIBS([alutGetMajorVersion], [alut alut32], [ALUT_LIBS="$ac_cv_search_alutGetMajorVersion"]) + LIBS="$AL_LIBS $LIBS" + AC_SEARCH_LIBS([alutExit], [alut alut32], [ALUT_LIBS="$ac_cv_search_alutExit"]) hunk ./aclocal.m4 113 + +# FP_CHECK_FUNC_ALUT(FUNCTION, ARGUMENTS) +# --------------------------------------- +AC_DEFUN([FP_CHECK_FUNC_ALUT], +[AS_VAR_PUSHDEF([alut_var], [alut_cv_func_$1])dnl +AC_CACHE_CHECK([for $1], + alut_var, + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_AL_ALUT_H +#include +#elif HAVE_OPENAL_ALUT_H +#include +#endif]], + [$1 $2;])], + [AS_VAR_SET(alut_var, yes)], + [AS_VAR_SET(alut_var, no)])]) +if test AS_VAR_GET(alut_var) = yes; then + AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]), [1], + [Define to 1 if you have the `$1' function.]) +fi +AS_VAR_POPDEF([alut_var])dnl +])# FP_CHECK_FUNC_ALUT + + +# FP_FUNC_ALUTINIT_VOID +# --------------------- +# Defines ALUTINIT_VOID to 1 if `alutInit' returns void. +AC_DEFUN([FP_FUNC_ALUTINIT_VOID], +[AC_REQUIRE([FP_HEADER_ALUT]) +AC_CACHE_CHECK([whether alutInit returns void], + [fp_cv_func_alutInit_void], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT +#if HAVE_AL_ALUT_H +#include +#elif HAVE_OPENAL_ALUT_H +#include +#endif +], + [[int x = (int)alutInit((int *)0, (char **)0);]])], + [fp_cv_func_alutInit_void=no], + [fp_cv_func_alutInit_void=yes])]) +if test x"$fp_cv_func_alutInit_void" = xyes; then + AC_DEFINE([ALUTINIT_VOID], [1], [Define to 1 if `alutInit' returns void.]) +fi +]) # FP_FUNC_ALUTINIT_VOID + + +# FP_FUNC_ALUTEXIT_VOID +# --------------------- +# Defines ALUTEXIT_VOID to 1 if `alutExit' returns void. +AC_DEFUN([FP_FUNC_ALUTEXIT_VOID], +[AC_REQUIRE([FP_HEADER_ALUT]) +AC_CACHE_CHECK([whether alutExit returns void], + [fp_cv_func_alutExit_void], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT +#if HAVE_AL_ALUT_H +#include +#elif HAVE_OPENAL_ALUT_H +#include +#endif +], + [[int x = (int)alutExit();]])], + [fp_cv_func_alutExit_void=no], + [fp_cv_func_alutExit_void=yes])]) +if test x"$fp_cv_func_alutExit_void" = xyes; then + AC_DEFINE([ALUTEXIT_VOID], [1], [Define to 1 if `alutExit' returns void.]) +fi +]) # FP_FUNC_ALUTEXIT_VOID + hunk ./configure.ac 1 -AC_INIT([Haskell ALUT package], [1.0], [sven.panne@aedion.de], [ALUT]) +AC_INIT([Haskell ALUT package], [2.0], [sven.panne@aedion.de], [ALUT]) hunk ./configure.ac 36 +# checks for library functions. + +fp_save_libs="$LIBS" +LIBS="$ALUT_LIBS $AL_LIBS $LIBS" + +FP_FUNC_ALUTINIT_VOID +FP_CHECK_FUNC_ALUT([alutInitWithoutContext], [((int *)0, (char **)0)]) +FP_FUNC_ALUTEXIT_VOID + +FP_CHECK_FUNC_ALUT([alutGetError], [()]) +FP_CHECK_FUNC_ALUT([alutGetErrorString], [(0)]) + +FP_CHECK_FUNC_ALUT([alutCreateBufferFromFile], [((const char *)0)]) +FP_CHECK_FUNC_ALUT([alutCreateBufferFromFileImage], [((const ALvoid *)0, 0)]) +FP_CHECK_FUNC_ALUT([alutCreateBufferHelloWorld], [()]) +FP_CHECK_FUNC_ALUT([alutCreateBufferWaveform], [(0, 0.0f, 0.0f, 0.0f)]) + +FP_CHECK_FUNC_ALUT([alutLoadMemoryFromFile], [((const char *)0, (ALenum *)0, (ALsizei *)0, (ALfloat *)0)]) +FP_CHECK_FUNC_ALUT([alutLoadMemoryFromFileImage], [((const ALvoid *)0, 0, (ALenum *)0, (ALsizei *)0, (ALfloat *)0)]) +FP_CHECK_FUNC_ALUT([alutLoadMemoryHelloWorld], [((ALenum *)0, (ALsizei *)0, (ALfloat *)0)]) +FP_CHECK_FUNC_ALUT([alutLoadMemoryWaveform], [(0, 0.0f, 0.0f, 0.0f, (ALenum *)0, (ALsizei *)0, (ALfloat *)0)]) + +FP_CHECK_FUNC_ALUT([alutGetMIMETypes], [(0)]) + +FP_CHECK_FUNC_ALUT([alutGetMajorVersion], [()]) +FP_CHECK_FUNC_ALUT([alutGetMinorVersion], [()]) + +FP_CHECK_FUNC_ALUT([alutSleep], [(0.0f)]) + +LIBS="$fp_save_libs" + +# checks for constant values + hunk ./configure.ac 73 +#endif + +#ifndef ALUT_API_MAJOR_VERSION +#define ALUT_API_MAJOR_VERSION 0 +#endif + +#ifndef ALUT_API_MINOR_VERSION +#define ALUT_API_MINOR_VERSION 0 +#endif + +#ifndef ALUT_WAVEFORM_SINE +#define ALUT_WAVEFORM_SINE 0x100 +#endif + +#ifndef ALUT_WAVEFORM_SQUARE +#define ALUT_WAVEFORM_SQUARE 0x101 +#endif + +#ifndef ALUT_WAVEFORM_SAWTOOTH +#define ALUT_WAVEFORM_SAWTOOTH 0x102 +#endif + +#ifndef ALUT_WAVEFORM_WHITENOISE +#define ALUT_WAVEFORM_WHITENOISE 0x103 +#endif + +#ifndef ALUT_WAVEFORM_IMPULSE +#define ALUT_WAVEFORM_IMPULSE 0x104 +#endif + +#ifndef ALUT_LOADER_BUFFER +#define ALUT_LOADER_BUFFER 0x300 +#endif + +#ifndef ALUT_LOADER_MEMORY +#define ALUT_LOADER_MEMORY 0x301 hunk ./configure.ac 111 +# tell our build system about the results + hunk ./examples/Basic/HelloWorld.hs 16 - helloBuffer <- helloWorld + helloBuffer <- createBuffer HelloWorld hunk ./examples/TestSuite/TestWaveforms.hs 12 -playTone :: (Frequency -> Phase -> Duration -> IO Buffer) -> IO () -playTone makeBuffer = do - buf <- makeBuffer 440 0 1 +playTone :: (Frequency -> Phase -> Duration -> SoundDataSource a) -> IO () +playTone soundDataSource = do + buf <- createBuffer (soundDataSource 440 0 1) hunk ./examples/TestSuite/TestWaveforms.hs 23 - mapM_ playTone [ sine, square, sawtooth, (const (const whiteNoise)), impulse ] + mapM_ playTone [ Sine, Square, Sawtooth, (const (const WhiteNoise)), Impulse ] hunk ./package.conf.in 11 - Sound.ALUT.BuiltInSounds, hunk ./package.conf.in 17 + Sound.ALUT.Config, hunk ./ALUT.cabal 36 -c-sources: cbits/HsALUT.c addfile ./config.guess addfile ./config.sub addfile ./install-sh hunk ./ALUT.cabal 16 - -- The first three files are not in this directory of the CVS - -- repository; copy them from ../.. hunk ./config.guess 1 +#! /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 Free Software Foundation, Inc. + +timestamp='2006-02-23' + +# 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 + +# 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 powerppc-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/[-(].*//'` ;; + *) + 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*:MSYS_NT-*:*:*) + 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*:[345]*) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T:Interix*:[345]*) + 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-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + 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-gnu"; 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-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + 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="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${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-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + 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-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # 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(__sun) + 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: hunk ./config.sub 1 +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2006-02-23' + +# 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 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | 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[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m32c) + 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-* \ + | 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-* \ + | 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[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | 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-*) + ;; + m32c-*) + ;; + # 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 + ;; + 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) + 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*) + # 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 + *-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: hunk ./install-sh 1 +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2003-09-24.23 + +# 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}" + +transformbasename= +transform_arg= +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= + +usage="Usage: $0 [OPTION]... SRCFILE DSTFILE + or: $0 -d DIR1 DIR2... + +In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. +In the second, create the directory path DIR. + +Options: +-b=TRANSFORMBASENAME +-c copy source (using $cpprog) instead of moving (using $mvprog). +-d create directories instead of installing files. +-g GROUP $chgrp installed files to GROUP. +-m MODE $chmod installed files to MODE. +-o USER $chown installed files to USER. +-s strip installed files (using $stripprog). +-t=TRANSFORM +--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 + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + -c) instcmd=$cpprog + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit 0;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + --version) echo "$0 $scriptversion"; exit 0;; + + *) if test -z "$src"; then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if test -z "$src"; then + echo "$0: no input file specified." >&2 + exit 1 +fi + +# Protect names starting with `-'. +case $src in + -*) src=./$src ;; +esac + +if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + instcmd=: + chmodcmd= + else + instcmd=$mkdirprog + fi +else + # Waiting for this to be detected by the "$instcmd $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + # 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 + dst=$dst/`basename "$src"` + fi +fi + +# This sed command emulates the dirname command. +dstdir=`echo "$dst" | sed -e '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 - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + test -d "$pathcomp" || $mkdirprog "$pathcomp" + pathcomp=$pathcomp/ + done +fi + +if test -n "$dir_arg"; then + $doit $instcmd "$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 + # If we're going to rename the final executable, determine the name now. + if test -z "$transformarg"; then + dstfile=`basename "$dst"` + else + dstfile=`basename "$dst" $transformbasename \ + | sed $transformarg`$transformbasename + fi + + # don't allow the sed command to completely eliminate the filename. + test -z "$dstfile" && 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 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Move or copy the file name to the temp name + $doit $instcmd "$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 $instcmd $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 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 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" +fi && + +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit +} + +# 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: addfile ./Setup.hs hunk ./Setup.hs 1 +module Main (main) where + +import Distribution.Simple (defaultMainWithHooks, defaultUserHooks) + +main :: IO () +main = defaultMainWithHooks defaultUserHooks hunk ./Makefile 28 + +EXCLUDED_SRCS += Setup.hs hunk ./Makefile 29 -EXCLUDED_SRCS += Setup.hs - hunk ./Makefile 48 +EXCLUDED_SRCS += Setup.hs + hunk ./ALUT.cabal 33 -includes: "HsALUT.h" +install-includes: HsALUT.h addfile ./README hunk ./README 1 +To build this package using Cabal directly from darcs, you must run +"autoreconf" before the usual Cabal build steps (configure/build/install). +autoreconf is included in the GNU autoconf tools. There is no need to run +the "configure" script: the "setup configure" step will do this for you. hunk ./Setup.hs 1 + hunk ./Setup.hs 4 -import Distribution.Simple (defaultMainWithHooks, defaultUserHooks) +import Data.List +import Distribution.Simple +import Distribution.PackageDescription +import Distribution.PreProcess +import Distribution.Setup +import Distribution.Simple.LocalBuildInfo +import System.Environment hunk ./Setup.hs 13 -main = defaultMainWithHooks defaultUserHooks +main = do args <- getArgs + let (ghcArgs, args') = extractGhcArgs args + (_, args'') = extractConfigureArgs args' + hooks = defaultUserHooks { + buildHook = add_ghc_options ghcArgs + $ buildHook defaultUserHooks } + withArgs args'' $ defaultMainWithHooks hooks + +extractGhcArgs :: [String] -> ([String], [String]) +extractGhcArgs = extractPrefixArgs "--ghc-option=" + +extractConfigureArgs :: [String] -> ([String], [String]) +extractConfigureArgs = extractPrefixArgs "--configure-option=" + +extractPrefixArgs :: String -> [String] -> ([String], [String]) +extractPrefixArgs prefix args + = let f [] = ([], []) + f (x:xs) = case f xs of + (wantedArgs, otherArgs) -> + case removePrefix prefix x of + Just wantedArg -> + (wantedArg:wantedArgs, otherArgs) + Nothing -> + (wantedArgs, x:otherArgs) + in f args + +removePrefix :: String -> String -> Maybe String +removePrefix "" ys = Just ys +removePrefix (x:xs) (y:ys) + | x == y = removePrefix xs ys + | otherwise = Nothing + +type Hook a = PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> a + -> IO () + +add_ghc_options :: [String] -> Hook a -> Hook a +add_ghc_options args f pd lbi muhs x + = do let lib' = case library pd of + Just lib -> + let bi = libBuildInfo lib + opts = options bi ++ [(GHC, args)] + bi' = bi { options = opts } + in lib { libBuildInfo = bi' } + Nothing -> error "Expected a library" + pd' = pd { library = Just lib' } + f pd' lbi muhs x + hunk ./Setup.hs 7 -import Distribution.PreProcess hunk ./Setup.hs 27 -extractPrefixArgs prefix args +extractPrefixArgs the_prefix args hunk ./Setup.hs 31 - case removePrefix prefix x of + case removePrefix the_prefix x of hunk ./Setup.hs 40 +removePrefix _ "" = Nothing hunk ./Setup.hs 45 -type Hook a = PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> a - -> IO () +type Hook a = PackageDescription -> LocalBuildInfo -> UserHooks -> a -> IO () hunk ./Setup.hs 48 -add_ghc_options args f pd lbi muhs x +add_ghc_options args f pd lbi uhs x hunk ./Setup.hs 57 - f pd' lbi muhs x + f pd' lbi uhs x hunk ./ALUT.cabal 2 -version: 2.0 +version: 2.0.1 hunk ./configure.ac 1 -AC_INIT([Haskell ALUT package], [2.0], [sven.panne@aedion.de], [ALUT]) +AC_INIT([Haskell ALUT package], [2.0.1], [sven.panne@aedion.de], [ALUT]) hunk ./configure.ac 24 - AC_MSG_WARN([no ALUT library found, so this package will not be built]) -else + AC_MSG_FAILURE([no ALUT library found, so this package cannot be built]) +fi hunk ./configure.ac 31 - AC_MSG_WARN([no ALUT header found, so this package will not be built]) -else + AC_MSG_FAILURE([no ALUT header found, so this package cannot be built]) +fi hunk ./configure.ac 126 -fi -fi hunk ./ALUT.cabal 33 +includes: HsALUT.h hunk ./Makefile 1 -# ----------------------------------------------------------------------------- - -TOP = .. -include $(TOP)/mk/boilerplate.mk --include config.mk - -ifneq "$(findstring clean, $(MAKECMDGOALS))" "" -# if we're cleaning, then config.mk might have been cleaned already -ALUT_BUILD_PACKAGE=yes -PACKAGE=ALUT -endif - -ifneq "$(ALUT_BUILD_PACKAGE)" "no" - -# ----------------------------------------------------------------------------- - -SUBDIRS = include - -ifeq "$(IncludeExampleDirsInBuild)" "YES" -SUBDIRS += examples -endif - -ALL_DIRS = Sound Sound/ALUT - -PACKAGE_DEPS = base OpenGL OpenAL - -SRC_HC_OPTS += -Wall -fffi -Iinclude '-\#include "HsALUT.h"' -cpp - -# WinDoze DLL hell -ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" -SRC_HC_OPTS += -DCALLCONV=stdcall -else -SRC_HC_OPTS += -DCALLCONV=ccall -endif - -PACKAGE_CPP_OPTS += -DMAINTAINER=$(MAINTAINER) - -SRC_HADDOCK_OPTS += -t "HOpenAL Libraries (ALUT package)" - -# ----------------------------------------------------------------------------- - -package.conf.inplace \ -package.conf.installed \ -Sound/ALUT/Constants.$(way_)o : include/HsALUTConfig.h - -endif - -EXCLUDED_SRCS += Setup.hs - -# ----------------------------------------------------------------------------- - -DIST_CLEAN_FILES += ALUT.buildinfo config.cache config.status config.mk - -extraclean:: - $(RM) -rf autom4te.cache - -# ----------------------------------------------------------------------------- - -include $(TOP)/mk/target.mk rmfile ./Makefile hunk ./package.conf.in 1 -#include "HsALUTConfig.h" - -name: PACKAGE -version: VERSION -license: BSD3 -maintainer: MAINTAINER -exposed: True - -exposed-modules: - Sound.ALUT, - Sound.ALUT.Initialization, - Sound.ALUT.Loaders, - Sound.ALUT.Sleep, - Sound.ALUT.Version - -hidden-modules: - Sound.ALUT.Config, - Sound.ALUT.Constants, - Sound.ALUT.Errors - -import-dirs: IMPORT_DIR -library-dirs: LIB_DIR -hs-libraries: "HSALUT" -extra-libraries: -include-dirs: INCLUDE_DIR -includes: "HsALUT.h" -depends: base, OpenGL, OpenAL -hugs-options: -cc-options: ALUT_CFLAGS -ld-options: ALUT_LIBS -framework-dirs: -frameworks: ALUT_FRAMEWORKS - -haddock-interfaces: HADDOCK_IFACE -haddock-html: HTML_DIR rmfile ./package.conf.in hunk ./Setup.hs 1 - hunk ./Setup.hs 3 -import Data.List hunk ./Setup.hs 4 -import Distribution.PackageDescription -import Distribution.Setup -import Distribution.Simple.LocalBuildInfo -import System.Environment hunk ./Setup.hs 6 -main = do args <- getArgs - let (ghcArgs, args') = extractGhcArgs args - (_, args'') = extractConfigureArgs args' - hooks = defaultUserHooks { - buildHook = add_ghc_options ghcArgs - $ buildHook defaultUserHooks } - withArgs args'' $ defaultMainWithHooks hooks - -extractGhcArgs :: [String] -> ([String], [String]) -extractGhcArgs = extractPrefixArgs "--ghc-option=" - -extractConfigureArgs :: [String] -> ([String], [String]) -extractConfigureArgs = extractPrefixArgs "--configure-option=" - -extractPrefixArgs :: String -> [String] -> ([String], [String]) -extractPrefixArgs the_prefix args - = let f [] = ([], []) - f (x:xs) = case f xs of - (wantedArgs, otherArgs) -> - case removePrefix the_prefix x of - Just wantedArg -> - (wantedArg:wantedArgs, otherArgs) - Nothing -> - (wantedArgs, x:otherArgs) - in f args - -removePrefix :: String -> String -> Maybe String -removePrefix "" ys = Just ys -removePrefix _ "" = Nothing -removePrefix (x:xs) (y:ys) - | x == y = removePrefix xs ys - | otherwise = Nothing - -type Hook a = PackageDescription -> LocalBuildInfo -> UserHooks -> a -> IO () - -add_ghc_options :: [String] -> Hook a -> Hook a -add_ghc_options args f pd lbi uhs x - = do let lib' = case library pd of - Just lib -> - let bi = libBuildInfo lib - opts = options bi ++ [(GHC, args)] - bi' = bi { options = opts } - in lib { libBuildInfo = bi' } - Nothing -> error "Expected a library" - pd' = pd { library = Just lib' } - f pd' lbi uhs x - +main = defaultMainWithHooks defaultUserHooks hunk ./ALUT.cabal 15 +build-type: Configure hunk ./ALUT.cabal 2 -version: 2.0.1 +version: 2.1.0.0 hunk ./config.mk.in 1 -ALUT_BUILD_PACKAGE=@ALUT_BUILD_PACKAGE@ -ifneq "$(ALUT_BUILD_PACKAGE)" "no" -ALUT_CFLAGS=@ALUT_CFLAGS@ -ALUT_LIBS=@ALUT_LIBS@ -ALUT_FRAMEWORKS=@ALUT_FRAMEWORKS@ -PACKAGE=@PACKAGE_TARNAME@ -VERSION=@PACKAGE_VERSION@ -MAINTAINER=@PACKAGE_BUGREPORT@ -endif rmfile ./config.mk.in hunk ./ALUT.cabal 18 - configure.ac configure config.mk.in ALUT.buildinfo.in + configure.ac configure ALUT.buildinfo.in hunk ./ALUT.cabal 22 - config.mk ALUT.buildinfo include/HsALUTConfig.h include/HsALUT.h + ALUT.buildinfo include/HsALUTConfig.h include/HsALUT.h hunk ./configure.ac 13 -AC_SUBST([ALUT_BUILD_PACKAGE]) hunk ./configure.ac 139 -AC_CONFIG_FILES([config.mk ALUT.buildinfo]) +AC_CONFIG_FILES([ALUT.buildinfo]) hunk ./Setup.hs 6 -main = defaultMainWithHooks defaultUserHooks +main = defaultMainWithHooks autoconfUserHooks hunk ./aclocal.m4 181 + +# FP_ARG_COMPILER +# ------------- +AC_DEFUN([FP_ARG_COMPILER], +[AC_ARG_WITH([compiler], + [AC_HELP_STRING([--with-compiler@<:@=HC@:>@], + [use the given Haskell compiler (default=ghc)])], + [with_compiler=$withval], + [with_compiler=ghc]) +])# FP_ARG_COMPILER + hunk ./configure.ac 11 +# we do not really care about this here, but this avoids a warning about an +# unknown option +FP_ARG_COMPILER + hunk ./ALUT.cabal 2 -version: 2.1.0.0 +version: 2.2 hunk ./configure.ac 1 -AC_INIT([Haskell ALUT package], [2.0.1], [sven.panne@aedion.de], [ALUT]) +AC_INIT([Haskell ALUT package], [2.2], [sven.panne@aedion.de], [ALUT]) hunk ./ALUT.cabal 2 -version: 2.2 +version: 2.1.0.1 hunk ./ALUT.cabal 6 +bug-reports: mailto:sven.panne@aedion.de hunk ./configure.ac 1 -AC_INIT([Haskell ALUT package], [2.2], [sven.panne@aedion.de], [ALUT]) +AC_INIT([Haskell ALUT package], [2.1.0.1], [sven.panne@aedion.de], [ALUT]) hunk ./ALUT.cabal 2 -version: 2.1.0.1 +version: 2.1.0.2 hunk ./configure.ac 1 -AC_INIT([Haskell ALUT package], [2.1.0.1], [sven.panne@aedion.de], [ALUT]) +AC_INIT([Haskell ALUT package], [2.1.0.2], [sven.panne@aedion.de], [ALUT]) hunk ./ALUT.cabal 7 -homepage: http://www.openal.org/ +homepage: http://connect.creativelabs.com/openal/ hunk ./ALUT.cabal 15 - . + . hunk ./examples/Basic/Makefile 1 -# ----------------------------------------------------------------------------- - -TOP = ../../.. -include $(TOP)/mk/boilerplate.mk - -# ----------------------------------------------------------------------------- - -EXAMPLES := $(wildcard *.hs) -BINS := $(addsuffix $(exeext),$(EXAMPLES:.hs=)) -CLEAN_FILES += $(BINS) - -HC = $(GHC_INPLACE) -MKDEPENDHS = $(GHC_INPLACE) -SRC_HC_OPTS += -Wall -O -package ALUT - -all:: $(BINS) - -$(BINS): %$(exeext): %.o - $(HC) -o $@ $(HC_OPTS) $(LD_OPTS) $< - -# ----------------------------------------------------------------------------- - -include $(TOP)/mk/target.mk rmfile ./examples/Basic/Makefile hunk ./examples/Makefile 1 -# ----------------------------------------------------------------------------- - -TOP = ../.. -include $(TOP)/mk/boilerplate.mk - -# ----------------------------------------------------------------------------- - -ifeq "$(way)" "" -SUBDIRS = Basic TestSuite -endif - -# ----------------------------------------------------------------------------- - -include $(TOP)/mk/target.mk rmfile ./examples/Makefile hunk ./examples/TestSuite/Makefile 1 -# ----------------------------------------------------------------------------- - -TOP = ../../.. -include $(TOP)/mk/boilerplate.mk - -# ----------------------------------------------------------------------------- - -EXAMPLES := $(wildcard *.hs) -BINS := $(addsuffix $(exeext),$(EXAMPLES:.hs=)) -CLEAN_FILES += $(BINS) - -HC = $(GHC_INPLACE) -MKDEPENDHS = $(GHC_INPLACE) -SRC_HC_OPTS += -Wall -O -package ALUT - -all:: $(BINS) - -$(BINS): %$(exeext): %.o - $(HC) -o $@ $(HC_OPTS) $(LD_OPTS) $< - -# ----------------------------------------------------------------------------- - -include $(TOP)/mk/target.mk rmfile ./examples/TestSuite/Makefile hunk ./include/Makefile 1 -# ----------------------------------------------------------------------------- - -TOP = ../.. -include $(TOP)/mk/boilerplate.mk - -H_FILES = $(wildcard *.h) - -includedir = $(libdir)/include -INSTALL_INCLUDES = $(H_FILES) - -DIST_CLEAN_FILES += HsALUT.h HsALUTConfig.h - -include $(TOP)/mk/target.mk rmfile ./include/Makefile hunk ./prologue.txt 1 -The @ALUT@ package contains a Haskell binding for the OpenAL Utility Toolkit, -which makes managing of OpenAL contexts, loading sounds in various formats and -creating waveforms very easy. For more information about the C library on which -this binding is based, please see: -. rmfile ./prologue.txt hunk ./ALUT.cabal 18 - config.guess config.sub install-sh - configure.ac configure ALUT.buildinfo.in - include/HsALUTConfig.h.in include/HsALUT.h.in + ALUT.buildinfo.in README aclocal.m4 config.guess config.sub configure + configure.ac examples/Basic/HelloWorld.hs examples/Basic/OpenALInfo.hs + examples/Basic/PlayFile.hs examples/TestSuite/TestErrorStuff.hs + examples/TestSuite/TestFileLoader.hs + examples/TestSuite/TestMemoryLoader.hs examples/TestSuite/TestVersion.hs + examples/TestSuite/TestWaveforms.hs examples/TestSuite/file1.wav + examples/TestSuite/file2.au examples/TestSuite/file3.raw + include/HsALUT.h.in include/HsALUTConfig.h.in install-sh hunk ./ALUT.cabal 2 -version: 2.1.0.2 +version: 2.2.0.0 hunk ./ALUT.cabal 42 -build-depends: base, OpenGL, OpenAL +ghc-options: -Wall +build-depends: base >= 3 && < 5, StateVar, OpenAL hunk ./Sound/ALUT/Loaders.hs 19 +import Data.StateVar hunk ./Sound/ALUT/Loaders.hs 24 -import Graphics.Rendering.OpenGL.GL.StateVar ( - GettableStateVar, makeGettableStateVar ) hunk ./Sound/ALUT/Version.hs 18 -import Graphics.Rendering.OpenGL.GL.StateVar ( - GettableStateVar, makeGettableStateVar ) +import Data.StateVar hunk ./Sound/ALUT.hs 5 --- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- License : BSD-style (see the file LICENSE) hunk ./Sound/ALUT.hs 8 --- Stability : provisional +-- Stability : stable hunk ./Sound/ALUT/Config.hs 6 --- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- License : BSD-style (see the file LICENSE) hunk ./Sound/ALUT/Config.hs 9 --- Stability : provisional +-- Stability : stable hunk ./Sound/ALUT/Constants.hs 6 --- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- License : BSD-style (see the file LICENSE) hunk ./Sound/ALUT/Constants.hs 9 --- Stability : provisional +-- Stability : stable hunk ./Sound/ALUT/Errors.hs 6 --- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- License : BSD-style (see the file LICENSE) hunk ./Sound/ALUT/Errors.hs 9 --- Stability : provisional +-- Stability : stable hunk ./Sound/ALUT/Initialization.hs 5 --- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- License : BSD-style (see the file LICENSE) hunk ./Sound/ALUT/Initialization.hs 8 --- Stability : provisional +-- Stability : stable hunk ./Sound/ALUT/Loaders.hs 5 --- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- License : BSD-style (see the file LICENSE) hunk ./Sound/ALUT/Loaders.hs 8 --- Stability : provisional +-- Stability : stable hunk ./Sound/ALUT/Sleep.hs 5 --- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- License : BSD-style (see the file LICENSE) hunk ./Sound/ALUT/Sleep.hs 8 --- Stability : provisional +-- Stability : stable hunk ./Sound/ALUT/Version.hs 5 --- License : BSD-style (see the file libraries/ALUT/LICENSE) +-- License : BSD-style (see the file LICENSE) hunk ./Sound/ALUT/Version.hs 8 --- Stability : provisional +-- Stability : stable hunk ./Sound/ALUT.hs 4 --- Copyright : (c) Sven Panne 2005 +-- Copyright : (c) Sven Panne 2005-2009 hunk ./Sound/ALUT/Constants.hs 5 --- Copyright : (c) Sven Panne 2005 +-- Copyright : (c) Sven Panne 2005-2009 hunk ./Sound/ALUT/Errors.hs 5 --- Copyright : (c) Sven Panne 2005 +-- Copyright : (c) Sven Panne 2005-2009 hunk ./Sound/ALUT/Initialization.hs 4 --- Copyright : (c) Sven Panne 2005 +-- Copyright : (c) Sven Panne 2005-2009 hunk ./Sound/ALUT/Loaders.hs 4 --- Copyright : (c) Sven Panne 2005 +-- Copyright : (c) Sven Panne 2005-2009 hunk ./Sound/ALUT/Sleep.hs 4 --- Copyright : (c) Sven Panne 2005 +-- Copyright : (c) Sven Panne 2005-2009 hunk ./Sound/ALUT/Version.hs 4 --- Copyright : (c) Sven Panne 2005 +-- Copyright : (c) Sven Panne 2005-2009 hunk ./examples/Basic/HelloWorld.hs 3 - Copyright (c) Sven Panne 2005 + Copyright (c) Sven Panne 2005-2009 hunk ./examples/Basic/OpenALInfo.hs 3 - Copyright (c) Sven Panne 2005 + Copyright (c) Sven Panne 2005-2009 hunk ./examples/Basic/PlayFile.hs 3 - Copyright (c) Sven Panne 2005 + Copyright (c) Sven Panne 2005-2009 hunk ./examples/TestSuite/TestErrorStuff.hs 3 - Copyright (c) Sven Panne 2005 + Copyright (c) Sven Panne 2005-2009 hunk ./examples/TestSuite/TestFileLoader.hs 3 - Copyright (c) Sven Panne 2005 + Copyright (c) Sven Panne 2005-2009 hunk ./examples/TestSuite/TestMemoryLoader.hs 3 - Copyright (c) Sven Panne 2005 + Copyright (c) Sven Panne 2005-2009 hunk ./examples/TestSuite/TestVersion.hs 3 - Copyright (c) Sven Panne 2005 + Copyright (c) Sven Panne 2005-2009 hunk ./examples/TestSuite/TestWaveforms.hs 3 - Copyright (c) Sven Panne 2005 + Copyright (c) Sven Panne 2005-2009 hunk ./include/HsALUT.h.in 4 - * Copyright : (c) Sven Panne 2005 + * Copyright : (c) Sven Panne 2005-2009