mikmod-3.2.9/0000755000000000000000000000000014734753426011522 5ustar rootrootmikmod-3.2.9/autotools/0000755000000000000000000000000014734753426013553 5ustar rootrootmikmod-3.2.9/autotools/compile0000755000000000000000000001635014072725711015125 0ustar rootroot#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: mikmod-3.2.9/autotools/depcomp0000755000000000000000000005602014072725711015122 0ustar rootroot#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: mikmod-3.2.9/autotools/config.sub0000755000000000000000000011544114701676710015536 0ustar rootroot#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale timestamp='2024-05-27' # 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 3 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, see . # # 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. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # 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. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # 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. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -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 1992-2024 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 ;; *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 # Split fields of configuration type saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in cloudabi*-eabi* \ | kfreebsd*-gnu* \ | knetbsd*-gnu* \ | kopensolaris*-gnu* \ | linux-* \ | managarm-* \ | netbsd*-eabi* \ | netbsd*-gnu* \ | nto-qnx* \ | os2-emx* \ | rtmk-nova* \ | storm-chaos* \ | uclinux-gnu* \ | uclinux-uclibc* \ | windows-* ) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) case $field1-$field2 in # Shorthands that happen to contain a single dash convex-c[12] | convex-c3[248]) basic_machine=$field2-convex basic_os= ;; decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Do not treat sunos as a manufacturer sun*os*) basic_machine=$field1 basic_os=$field2 ;; # Manufacturers 3100* \ | 32* \ | 3300* \ | 3600* \ | 7300* \ | acorn \ | altos* \ | apollo \ | apple \ | atari \ | att* \ | axis \ | be \ | bull \ | cbm \ | ccur \ | cisco \ | commodore \ | convergent* \ | convex* \ | cray \ | crds \ | dec* \ | delta* \ | dg \ | digital \ | dolphin \ | encore* \ | gould \ | harris \ | highlevel \ | hitachi* \ | hp \ | ibm* \ | intergraph \ | isi* \ | knuth \ | masscomp \ | microblaze* \ | mips* \ | motorola* \ | ncr* \ | news \ | next \ | ns \ | oki \ | omron* \ | pc533* \ | rebel \ | rom68k \ | rombug \ | semi \ | sequent* \ | siemens \ | sgi* \ | siemens \ | sim \ | sni \ | sony* \ | stratus \ | sun \ | sun[234]* \ | tektronix \ | tti* \ | ultra \ | unicom* \ | wec \ | winbond \ | wrs) basic_machine=$field1-$field2 basic_os= ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # 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) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | delta-motorola | 3300-motorola | motorola-delta | motorola-3300) cpu=m68k vendor=motorola ;; # This used to be dpx2*, but that gets the RS6000-based # DPX/20 and the x86-based DPX/2-100 wrong. See # https://oldskool.silicium.org/stations/bull_dpx20.htm # https://www.feb-patrimoine.com/english/bull_dpx2.htm # https://www.feb-patrimoine.com/english/unix_and_bull.htm dpx2 | dpx2[23]00 | dpx2[23]xx) cpu=m68k vendor=bull ;; dpx2100 | dpx21xx) cpu=i386 vendor=bull ;; dpx20) cpu=rs6000 vendor=bull ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x"$basic_os" != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. obj= case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) saved_IFS=$IFS IFS="-" read kernel os <&2 fi ;; *) echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 exit 1 ;; esac case $obj in aout* | coff* | elf* | pe*) ;; '') # empty is fine ;; *) echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 exit 1 ;; esac # Here we handle the constraint that a (synthetic) cpu and os are # valid only in combination with each other and nowhere else. case $cpu-$os in # The "javascript-unknown-ghcjs" triple is used by GHC; we # accept it here in order to tolerate that, but reject any # variations. javascript-ghcjs) ;; javascript-* | *-ghcjs) echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os-$obj in linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ | linux-mlibc*- | linux-musl*- | linux-newlib*- \ | linux-relibc*- | linux-uclibc*- | linux-ohos*- ) ;; uclinux-uclibc*- | uclinux-gnu*- ) ;; managarm-mlibc*- | managarm-kernel*- ) ;; windows*-msvc*-) ;; -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ | -uclibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; -kernel*- ) echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 exit 1 ;; *-kernel*- ) echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 exit 1 ;; *-msvc*- ) echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 exit 1 ;; kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) ;; vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; nto-qnx*-) ;; os2-emx-) ;; rtmk-nova-) ;; *-eabi*- | *-gnueabi*-) ;; none--*) # None (no kernel, i.e. freestanding / bare metal), # can be paired with an machine code file format ;; -*-) # Blank kernel with real OS is always fine. ;; --*) # Blank kernel and OS with real machine code file format is always fine. ;; *-*-*) echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos* | *-solaris*) vendor=sun ;; *-cnk* | *-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 ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) 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 ;; esac echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mikmod-3.2.9/autotools/config.guess0000755000000000000000000014306714701676710016100 0ustar rootroot#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2024-07-27' # 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 3 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, see . # # 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. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system '$me' is run on. Options: -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 1992-2024 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 # Just in case it came from the environment. GUESS= # 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. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { 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" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c17 c99 c89 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver 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 } # 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 ; 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 case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #if defined(__ANDROID__) LIBC=android #else #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #elif defined(__LLVM_LIBC__) LIBC=llvm #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # 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 tuples: *-*-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". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-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) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ 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 # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; 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/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 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. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; 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. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; 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'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; 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) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # 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:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) 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; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int 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 GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) 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 test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 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 test -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 test "$HP_ARCH" = ""; then 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 test "$HP_ARCH" = hppa2.0w then 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 -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) 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; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; 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*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; 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:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; 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/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 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/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-pc-managarm-mlibc" ;; *:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __ARM_EABI__ #ifdef __ARM_PCS_VFP ABI=eabihf #else ABI=eabi #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; esac fi GUESS=$CPU-unknown-linux-$LIBCABI ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` 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 -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; kvx:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; kvx:cos:*:*) GUESS=$UNAME_MACHINE-unknown-cos ;; kvx:mbr:*:*) GUESS=$UNAME_MACHINE-unknown-mbr ;; loongarch32:Linux:*:* | loongarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __i386__ ABI=x86 #else #ifdef __ILP32__ ABI=x32 #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in x86) CPU=i686 ;; x32) LIBCABI=${LIBC}x32 ;; esac fi GUESS=$CPU-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; 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. GUESS=i386-sequent-sysv4 ;; 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. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; 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 GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; 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 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; 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 i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; 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; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' 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; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; ppc:Haiku:*:*) # Haiku running on Apple PowerPC GUESS=powerpc-apple-haiku ;; *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) GUESS=$UNAME_MACHINE-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *: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 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; *:Ironclad:*:*) GUESS=$UNAME_MACHINE-unknown-ironclad ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif int 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 (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 #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #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; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&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 fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mikmod-3.2.9/autotools/install-sh0000755000000000000000000003577613753651557015603 0ustar rootroot#!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: mikmod-3.2.9/autotools/missing0000755000000000000000000001533614072725711015151 0ustar rootroot#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: mikmod-3.2.9/config.h.cmake0000644000000000000000000000663014362453356014220 0ustar rootroot/* Define if your system is AIX 3.* - might be needed for 4.* too. */ #cmakedefine MIKMOD_AIX /* Define to 1 if `TIOCGWINSZ' requires . */ #cmakedefine GWINSZ_IN_SYS_IOCTL /* Define to 1 if you have the header file. */ #cmakedefine HAVE_CURSES_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_FCNTL_H /* Define to 1 if your system has a working POSIX `fnmatch' function. */ #cmakedefine HAVE_FNMATCH /* Define to 1 if you have the header file. */ #cmakedefine HAVE_FNMATCH_H /* Define to 1 if you have the `getopt_long_only' function. */ #cmakedefine HAVE_GETOPT_LONG_ONLY /* Define to 1 if you have the header file. */ #cmakedefine HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_MEMORY_H /* Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2). */ #cmakedefine HAVE_MIKMOD_FREE /* Define to 1 if you have the `mkstemp' function. */ #cmakedefine HAVE_MKSTEMP /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NCURSES_CURSES_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NCURSES_H /* Define if your libncurses defines resizeterm (not found in <4.2). */ #cmakedefine HAVE_NCURSES_RESIZETERM /* Define if your system provides POSIX.4 threads. */ #cmakedefine HAVE_PTHREAD /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SCHED_H /* Define to 1 if you have the `snprintf' function. */ #cmakedefine HAVE_SNPRINTF /* Define to 1 if you have the `srandom' function. */ #cmakedefine HAVE_SRANDOM /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDINT_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRING_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #cmakedefine HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UNISTD_H /* Define to 1 if you have the `usleep' function. */ #cmakedefine HAVE_USLEEP /* Define if your system has the prototype for usleep(3). */ #cmakedefine HAVE_USLEEP_PROTO /* Define to 1 if you have the `vsnprintf' function. */ #cmakedefine HAVE_VSNPRINTF /* Define the directory for shared data. */ #cmakedefine PACKAGE_DATA_DIR "${PACKAGE_DATA_DIR}" /* Define to 1 if you have the ANSI C header files. */ #cmakedefine STDC_HEADERS /* Define to empty if `const' does not conform to ANSI C. */ #cmakedefine const /* Define to `int' if does not define. */ #cmakedefine pid_t /* Define to `unsigned int' if does not define. */ #cmakedefine size_t mikmod-3.2.9/CMakeLists.txt0000644000000000000000000001330014717213100014234 0ustar rootroot# if necessary, set CMAKE_PREFIX_PATH to the path where libmikmod # is installed, which you can do on your cmake command line, like: # cmake -DCMAKE_PREFIX_PATH=/path/to/libmikmod_dir .... CMAKE_MINIMUM_REQUIRED(VERSION 3.1...3.10) PROJECT(mikmod C) LIST(APPEND CMAKE_MODULE_PATH "${mikmod_SOURCE_DIR}/cmake") SET(VERSION "3.2.9") STRING(REGEX MATCHALL "([0-9]+)" VERSION_DIGITS "${VERSION}") LIST(GET VERSION_DIGITS 0 CPACK_PACKAGE_VERSION_MAJOR) LIST(GET VERSION_DIGITS 1 CPACK_PACKAGE_VERSION_MINOR) LIST(GET VERSION_DIGITS 2 CPACK_PACKAGE_VERSION_PATCH) # package generation (make package[_source]) SET(CPACK_PACKAGE_NAME "mikmod") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MikMod - a module player") SET(CPACK_PACKAGE_VENDOR "Shlomi Fish") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README") SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY} ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") SET(base_with_ver "mikmod-[0-9]+\\\\.[0-9]+\\\\.[0-9]+") SET(CPACK_SOURCE_IGNORE_FILES "/_CPack_Packages/" "/CMakeFiles/" "/.deps/" "^${base_with_ver}(-Source|-Linux)?/" "${base_with_ver}.tar\\\\.(gz|bz2|Z|lzma|xz)$" "\\\\.o$" "~$" "/\\\\.svn/" "/CMakeCache\\\\.txt$" "/CTestTestfile\\\\.cmake$" "/cmake_install\\\\.cmake$" "/CPackConfig\\\\.cmake$" "/CPackSourceConfig\\\\.cmake$" "/tags$" "^config\\\\.h$" "/install_manifest\\\\.txt$" "/Testing/" "ids-whitelist\\\\.txt" "/_Inline/" "/(B|build|BUILD)/" "/autom4te.cache/" ) IF (POLICY CMP0075) CMAKE_POLICY(SET CMP0075 NEW) ENDIF() INCLUDE(CPack) INCLUDE(CheckFunctionExists) INCLUDE(CheckSymbolExists) INCLUDE(CheckCCompilerFlag) INCLUDE(CheckCSourceCompiles) include(GNUInstallDirs) include(mik_macros) CHECK_MULTI_INCLUDE_FILES( "ncurses.h" "curses.h" "ncurses/curses.h" "termios.h" "fcntl.h" "fnmatch.h" "inttypes.h" "limits.h" "memory.h" "sched.h" "sys/ioctl.h" "sys/param.h" "sys/wait.h" "sys/time.h" "sys/types.h" "sys/stat.h" "stdint.h" "stdlib.h" "string.h" "strings.h" "unistd.h" "pthread.h" ) CHECK_SYMBOL_EXISTS(TIOCGWINSZ "sys/ioctl.h" GWINSZ_IN_SYS_IOCTL) CHECK_SYMBOL_EXISTS(usleep unistd.h HAVE_USLEEP_PROTO) IF (NOT HAVE_USLEEP_PROTO) CHECK_SYMBOL_EXISTS(usleep "sys/unistd.h" HAVE_USLEEP_PROTO) ENDIF() SET(EXTRA_LIBS ) find_path(MIKMOD_INCLUDE_DIR mikmod.h) find_library(MIKMOD_LIBRARIES mikmod) IF (NOT MIKMOD_LIBRARIES) MESSAGE(FATAL_ERROR "libmikmod not found.") ELSE() MESSAGE(STATUS "Found MikMod: ${MIKMOD_LIBRARIES}") ENDIF() IF(UNIX OR APPLE) INCLUDE(FindCurses) IF(NOT CURSES_FOUND) MESSAGE(FATAL_ERROR "Curses not found.") ENDIF() IF(HAVE_NCURSES_H) SET(CURSES_HDR "ncurses.h") ELSEIF(HAVE_CURSES_H) SET(CURSES_HDR "curses.h") ELSEIF(HAVE_NCURSES_CURSES_H) SET(CURSES_HDR "ncurses/curses.h") ELSE() MESSAGE(FATAL_ERROR "Neither ncurses.h nor curses.h found.") ENDIF() SET(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY}) CHECK_FUNCTION_EXISTS (resizeterm HAVE_NCURSES_RESIZETERM) CHECK_C_SOURCE_COMPILES( "#include <${CURSES_HDR}> int main(void) { #ifdef ACS_ULCORNER return ACS_ULCORNER; #endif return 0; }" CURSES_LINKSOK ) IF(CURSES_LINKSOK) LIST (APPEND EXTRA_LIBS ${CURSES_LIBRARY}) ELSE() find_library(TINFO_LIBRARY tinfo) IF(NOT TINFO_LIBRARY) MESSAGE(FATAL_ERROR "libtinfo needed for ncurses, but not found.") ELSE() MESSAGE(STATUS "Found libtinfo: ${TINFO_LIBRARY}") SET(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY} ${TINFO_LIBRARY}) CHECK_C_SOURCE_COMPILES( "#include <${CURSES_HDR}> int main(void) { #ifdef ACS_ULCORNER return ACS_ULCORNER; #endif return 0; }" TINFO_LINKSOK ) IF(TINFO_LINKSOK) LIST (APPEND EXTRA_LIBS ${CURSES_LIBRARY}) LIST (APPEND EXTRA_LIBS ${TINFO_LIBRARY}) ELSE() MESSAGE(FATAL_ERROR "failed linking to ncurses library.") ENDIF() ENDIF() ENDIF() ENDIF() IF (NOT WIN32) INCLUDE(FindThreads) IF (CMAKE_USE_PTHREADS_INIT) SET (HAVE_PTHREAD 1) IF (CMAKE_THREAD_LIBS_INIT) LIST (APPEND EXTRA_LIBS ${CMAKE_THREAD_LIBS_INIT}) ENDIF() ENDIF() ENDIF() CHECK_MULTI_FUNCTIONS_EXISTS( getopt_long_only mkstemp srandom snprintf vsnprintf usleep srandom fnmatch ) SET(CMAKE_REQUIRED_INCLUDES ${MIKMOD_INCLUDE_DIR}) SET(CMAKE_REQUIRED_LIBRARIES ${MIKMOD_LIBRARIES}) CHECK_FUNCTION_EXISTS (MikMod_free HAVE_MIKMOD_FREE) ########### compiler flags ############## SET(COMPILER_FLAGS_TO_CHECK "-Wall" "-Werror=implicit-function-declaration" ) IF (CPU_ARCH) LIST(APPEND COMPILER_FLAGS_TO_CHECK "-march=${CPU_ARCH}") ENDIF() SET (IDX 1) FOREACH (CFLAG_TO_CHECK ${COMPILER_FLAGS_TO_CHECK}) SET (FLAG_EXISTS_VAR "FLAG_EXISTS_${IDX}") MATH (EXPR IDX "${IDX} + 1") CHECK_C_COMPILER_FLAG("${CFLAG_TO_CHECK}" ${FLAG_EXISTS_VAR}) IF (${FLAG_EXISTS_VAR}) ADD_DEFINITIONS(${CFLAG_TO_CHECK}) ENDIF (${FLAG_EXISTS_VAR}) ENDFOREACH(CFLAG_TO_CHECK) ########### install files ############### ADD_DEFINITIONS("-DHAVE_CONFIG_H") SET (PACKAGE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/mikmod") configure_file(${PROJECT_SOURCE_DIR}/config.h.cmake ${PROJECT_BINARY_DIR}/config.h) # So it can find config.h INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}) INCLUDE_DIRECTORIES(BEFORE ${PROJECT_BINARY_DIR}) install( FILES mikmodrc DESTINATION ${CMAKE_INSTALL_DATADIR}/mikmod ) add_subdirectory(src) mikmod-3.2.9/README0000644000000000000000000001242114037505106012364 0ustar rootroot Hello folks ! This is MikMod, version 3.2.9, a module player for Unix. As usual with each new version, there's a lot of bug fixes and improvements. Check out the file 'NEWS' for more information. >> BUILDING MIKMOD ------------------ This MikMod version can build with any libmikmod version starting from 3.1.5, but building with 3.2.0 or newer (preferably 3.3.6 or newer) is recommended because some of the features and configuration functions are not available for older versions. - If you want to build MikMod for Windows, refer to the 'README' file under the 'win32' subdirectory. - If you want to build MikMod for Mac OS X, refer to the 'README' file under the 'macosx' subdirectory. - If you're building MikMod for DOS, refer to the 'README' file under the 'dos' subdirectory. - If you're building MikMod for OS/2, refer to the 'README' file under the 'os2' subdirectory. - If you're building MikMod for AmigaOS, or its variants like MorphOS or AROS, the configury method as explained below should work fine. The first thing you need is to get and compile the libmikmod sound library, which is not bundled with MikMod anymore ! If you don't know where to get libmikmod, look at the "contact and download info" section later in this document. So you're on a good old Unix workstation, aren't you ? You'll need an ANSI C compiler to build MikMod. To prevent clobbering the sources, I recommend building MikMod in an alternate directory, for example 'build': mkdir build cd build In this directory, run MikMod's configure script: ../configure The configure script will attempt to guess correct values for various system-dependent variables used during the build process, and will create appropriate Makefiles for proper compilation. If you're not familiar with configure scripts and their standard options, you can find more general information about them in the file INSTALL. After you've successfully run configure, simply run make to get all things build. Then, run make install to have the player installed. Depending on where you choose to install it (using the --prefix= option to configure), you may need root privileges for this operation. >> USING MIKMOD --------------- Run MikMod with the ``--help'' parameter to get the available options, or display its man page (if you did "make install") with man mikmod Also, after you've run MikMod for the first time, you might want to customize your $HOME/.mikmodrc, either from the configuration panel or by editing the file, so you won't need to supply the same options to MikMod all the time. Once you're in the player, pressing the H key will give you an help screen with the list of the keys you can use. I hope it's understandable. If you're playing MikMod in quiet mode (with the -q/-quiet switch), you can tell MikMod to jump to the next/previous song by sending the MikMod process SIGUSR1 or SIGUSR2 respectivly. In other words, let's say you're doing something like this: $ mikmod myalltimefavmods.mpl -quiet & [1] 7531 You've told MikMod to read the songs out of the playlist myalltimefavmods, to not spit out any output (-quiet), and to run in the background. Your shell will give you the process ID, in this case it's 7531. You can also find this out from "ps", "top", or a number of process management utilities. Now, let's say a song you don't like as much comes on, or for some reason one seems to be looping forever, you can do this... $ kill -s SIGUSR1 7531 or $ kill -USR1 %1 (if your shell supports the %n process notation) and MikMod will start playing the next file in the list. If you want the previous file, just use SIGUSR2 in place of SIGUSR1. This feature also works when MikMod is in interactive mode (with the curses interface), but is less useful then, since you have full player control... >> Y2K COMPLIANCE ----------------- MikMod does not deal with dates. So, as long as the few libc functions used by the program are Y2K-compliant, MikMod is Y2K-compliant. However, the archive handler invokes archiver programs to display the contents of the archive files ; if these external programs are not Y2K compliant when displaying archive contents, MikMod may not work as expected when dealing with archives. >> THANKS --------- I would like to thank everyone who contributed to libmikmod. Their names are in the AUTHORS file for the significative contributions, but some other names can be found in the NEWS file. Thanks a lot ! Keeping MikMod alive wouldn't be much fun without you. >> LICENSE ---------- The MikMod module player is covered by the GNU General Public License as published by the Free Software Fundation (you'll find it in the file COPYING) ; either version 2 of the licence, or (at your option) any later version. >> CONTACT AND DOWNLOAD INFO ---------------------------- MikMod and libmikmod home page is located at SourceForge: http://mikmod.sourceforge.net/ http://sourceforge.net/projects/mikmod/ There's a mailing list (mikmod-public) for discussing the development of MikMod (new features, bugs, ideas...) Look for more information on the web site. >> LAST NOTES ------------- I hope you'll enjoy using this version of MikMod as well as I enjoyed debugging and improving it. -- Miodrag ("Miod") Vallat, 10/19/1999 miodrag@mikmod.darkorb.net Raphael Assenat, 28/01/2004 raph@raphnet.net mikmod-3.2.9/Makefile.in0000644000000000000000000006650614734750516013601 0ustar rootroot# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_recursive_eval.m4 \ $(top_srcdir)/m4/libmikmod.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgdatadir)" DATA = $(pkgdata_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/autotools/compile \ $(top_srcdir)/autotools/config.guess \ $(top_srcdir)/autotools/config.sub \ $(top_srcdir)/autotools/install-sh \ $(top_srcdir)/autotools/missing AUTHORS COPYING INSTALL NEWS \ README autotools/compile autotools/config.guess \ autotools/config.sub autotools/install-sh autotools/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXTRA_OBJ = @EXTRA_OBJ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLAYER_LIB = @PLAYER_LIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src pkgdata_DATA = mikmodrc EXTRA_DIST = mikmod.lsm mikmod.cfg $(pkgdata_DATA) \ dos os2 macosx win32 \ config.h.cmake CMakeLists.txt cmake all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgdataDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgdataDATA .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ dist-zstd distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkgdataDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-am uninstall uninstall-am uninstall-pkgdataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mikmod-3.2.9/m4/0000755000000000000000000000000014734753426012042 5ustar rootrootmikmod-3.2.9/m4/ax_recursive_eval.m40000644000000000000000000000455013163017540015777 0ustar rootroot# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_recursive_eval.html # =========================================================================== # # SYNOPSIS # # AX_RECURSIVE_EVAL(VALUE, RESULT) # # DESCRIPTION # # Interpolate the VALUE in loop until it doesn't change, and set the # result to $RESULT. WARNING: It's easy to get an infinite loop with some # unsane input. # # LICENSE # # Copyright (c) 2008 Alexandre Duret-Lutz # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 1 AC_DEFUN([AX_RECURSIVE_EVAL], [_lcl_receval="$1" $2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" _lcl_receval_old='' while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do _lcl_receval_old="[$]_lcl_receval" eval _lcl_receval="\"[$]_lcl_receval\"" done echo "[$]_lcl_receval")`]) mikmod-3.2.9/m4/libmikmod.m40000644000000000000000000002142313767662230014252 0ustar rootroot# Configure paths for libmikmod # # Derived from glib.m4 (Owen Taylor 97-11-3) # Improved by Chris Butler # dnl AM_PATH_LIBMIKMOD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and dnl LIBMIKMOD_LDADD dnl AC_DEFUN([AM_PATH_LIBMIKMOD], [dnl dnl Get the cflags and libraries from the libmikmod-config script dnl AC_ARG_WITH(libmikmod-prefix,[ --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional)], libmikmod_config_prefix="$withval", libmikmod_config_prefix="") AC_ARG_WITH(libmikmod-exec-prefix,[ --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional)], libmikmod_config_exec_prefix="$withval", libmikmod_config_exec_prefix="") AC_ARG_ENABLE(libmikmodtest, [ --disable-libmikmodtest Do not try to compile and run a test libmikmod program], , enable_libmikmodtest=yes) if test x$libmikmod_config_exec_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config fi fi if test x$libmikmod_config_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config fi fi AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no) min_libmikmod_version=ifelse([$1], ,3.1.5,$1) AC_MSG_CHECKING(for libmikmod - version >= $min_libmikmod_version) no_libmikmod="" if test "$LIBMIKMOD_CONFIG" = "no" ; then no_libmikmod=yes else LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags` LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs` LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd` libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\1/'` libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\2/'` libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\3/'` if test "x$enable_libmikmodtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" AC_LANG_PUSH([C]) CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD" LIBS="$LIBMIKMOD_LIBS $LIBS" dnl dnl Now check if the installed libmikmod is sufficiently new. (Also sanity dnl checks the results of libmikmod-config to some extent dnl rm -f conf.mikmodtest AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include int main (void) { int major,minor,micro; int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version; FILE *fp = fopen("conf.mikmodtest", "w"); if (fp) fclose(fp); if (sscanf("$min_libmikmod_version", "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_libmikmod_version"); exit(1); } libmikmod_major_version=(MikMod_GetVersion() >> 16) & 255; libmikmod_minor_version=(MikMod_GetVersion() >> 8) & 255; libmikmod_micro_version=(MikMod_GetVersion() ) & 255; if ((libmikmod_major_version != $libmikmod_config_major_version) || (libmikmod_minor_version != $libmikmod_config_minor_version) || (libmikmod_micro_version != $libmikmod_config_micro_version)) { printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n", $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version, libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf ("*** was found! If libmikmod-config was correct, then it is best\n"); printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n"); printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) || (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) || (libmikmod_micro_version != LIBMIKMOD_REVISION)) { printf("*** libmikmod header files (version %d.%d.%d) do not match\n", LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION); printf("*** library (version %d.%d.%d)\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); } else { if ((libmikmod_major_version > major) || ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) || ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf("*** You need a version of libmikmod newer than %d.%d.%d.\n", major, minor, micro); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n"); printf("*** correct copy of libmikmod-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ]])], [], [no_libmikmod=yes], [echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" AC_LANG_POP([C]) fi fi if test "x$no_libmikmod" = x ; then AC_MSG_RESULT([yes, `$LIBMIKMOD_CONFIG --version`]) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$LIBMIKMOD_CONFIG" = "no" ; then echo "*** The libmikmod-config script installed by libmikmod could not be found" echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the" echo "*** full path to libmikmod-config." else if test -f conf.mikmodtest ; then : else echo "*** Could not run libmikmod test program, checking why..." CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS" LIBS="$LIBS $LIBMIKMOD_LIBS" AC_LANG_PUSH([C]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[ return (MikMod_GetVersion()!=0); ]])], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding libmikmod or finding the wrong" echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location. Also, make sure you have run ldconfig if that" echo "*** is required on your system." echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means libmikmod was incorrectly installed" echo "*** or that you have moved libmikmod since it was installed. In the latter case, you" echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" AC_LANG_POP([C]) fi fi LIBMIKMOD_CFLAGS="" LIBMIKMOD_LIBS="" LIBMIKMOD_LDADD="" ifelse([$3], , :, [$3]) fi AC_SUBST(LIBMIKMOD_CFLAGS) AC_SUBST(LIBMIKMOD_LIBS) AC_SUBST(LIBMIKMOD_LDADD) rm -f conf.mikmodtest ]) mikmod-3.2.9/cmake/0000755000000000000000000000000014734753426012602 5ustar rootrootmikmod-3.2.9/cmake/mik_macros.cmake0000644000000000000000000000326314317363456015731 0ustar rootroot# Copyright (c) 2012 Shlomi Fish # # 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 AUTHORS OR COPYRIGHT # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # # (This copyright notice applies only to this file) include(CheckIncludeFile) include(CheckIncludeFiles) include(CheckFunctionExists) MACRO(CHECK_MULTI_INCLUDE_FILES) FOREACH(name ${ARGN}) STRING(TOUPPER have_${name} SYMBOL_NAME) STRING(REGEX REPLACE "\\." "_" SYMBOL_NAME ${SYMBOL_NAME}) STRING(REGEX REPLACE "/" "_" SYMBOL_NAME ${SYMBOL_NAME}) CHECK_INCLUDE_FILE(${name} ${SYMBOL_NAME}) ENDFOREACH() ENDMACRO() MACRO(CHECK_MULTI_FUNCTIONS_EXISTS) FOREACH(name ${ARGN}) STRING(TOUPPER have_${name} SYMBOL_NAME) CHECK_FUNCTION_EXISTS(${name} ${SYMBOL_NAME}) ENDFOREACH() ENDMACRO() mikmod-3.2.9/config.h.in0000644000000000000000000000741214734750516013546 0ustar rootroot/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if `TIOCGWINSZ' requires . */ #undef GWINSZ_IN_SYS_IOCTL /* Define to 1 if you have the header file. */ #undef HAVE_CURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if your system has a working POSIX `fnmatch' function. */ #undef HAVE_FNMATCH /* Define to 1 if you have the header file. */ #undef HAVE_FNMATCH_H /* Define to 1 if you have the `getopt_long_only' function. */ #undef HAVE_GETOPT_LONG_ONLY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2). */ #undef HAVE_MIKMOD_FREE /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_CURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_H /* Define if your libncurses defines resizeterm (not found in <4.2). */ #undef HAVE_NCURSES_RESIZETERM /* Define if your system provides POSIX.4 threads. */ #undef HAVE_PTHREAD /* Define to 1 if you have the header file. */ #undef HAVE_SCHED_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `srandom' function. */ #undef HAVE_SRANDOM /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP /* Define if your system has the prototype for usleep(3). */ #undef HAVE_USLEEP_PROTO /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define if your system is AIX 3.* - might be needed for 4.* too. */ #undef MIKMOD_AIX /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define the directory for shared data. */ #undef PACKAGE_DATA_DIR /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t mikmod-3.2.9/configure0000755000000000000000000062552614734750516013446 0ustar rootroot#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for mikmod 3.2.9. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='mikmod' PACKAGE_TARNAME='mikmod' PACKAGE_VERSION='3.2.9' PACKAGE_STRING='mikmod 3.2.9' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="src/mikmod.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS PLAYER_LIB EXTRA_OBJ LIBMIKMOD_LDADD LIBMIKMOD_LIBS LIBMIKMOD_CFLAGS LIBMIKMOD_CONFIG LN_S EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_threads enable_dependency_tracking with_libmikmod_prefix with_libmikmod_exec_prefix enable_libmikmodtest ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures mikmod 3.2.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/mikmod] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of mikmod 3.2.9:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-threads use an own thread for the player [default=guessed] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libmikmodtest Do not try to compile and run a test libmikmod program Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional) --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF mikmod configure 3.2.9 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by mikmod $as_me 3.2.9, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in autotools "$srcdir"/autotools; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in autotools \"$srcdir\"/autotools" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='mikmod' VERSION='3.2.9' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac mikmod_threads=yes # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then : enableval=$enable_threads; if test "$enableval" = "yes" then mikmod_threads=yes else mikmod_threads=no fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); if (!f) return 1; return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" = maybe && test "x$build" != "x$host"; then cross_compiling=yes elif test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi if test $ac_cv_c_compiler_gnu = yes ; then CFLAGS="$CFLAGS -Wall" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi for ac_header in fcntl.h limits.h stdint.h fnmatch.h sys/ioctl.h sys/param.h sys/time.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sched.h do : ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" if test "x$ac_cv_header_sched_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SCHED_H 1 _ACEOF fi done for ac_header in ncurses.h curses.h ncurses/curses.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in termios.h do : ac_fn_c_check_header_mongrel "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" if test "x$ac_cv_header_termios_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_TERMIOS_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether termios.h defines TIOCGWINSZ" >&5 $as_echo_n "checking whether termios.h defines TIOCGWINSZ... " >&6; } if ${ac_cv_sys_tiocgwinsz_in_termios_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifdef TIOCGWINSZ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : ac_cv_sys_tiocgwinsz_in_termios_h=yes else ac_cv_sys_tiocgwinsz_in_termios_h=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_tiocgwinsz_in_termios_h" >&5 $as_echo "$ac_cv_sys_tiocgwinsz_in_termios_h" >&6; } if test $ac_cv_sys_tiocgwinsz_in_termios_h != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/ioctl.h defines TIOCGWINSZ" >&5 $as_echo_n "checking whether sys/ioctl.h defines TIOCGWINSZ... " >&6; } if ${ac_cv_sys_tiocgwinsz_in_sys_ioctl_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifdef TIOCGWINSZ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes else ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&5 $as_echo "$ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&6; } if test $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h = yes; then $as_echo "#define GWINSZ_IN_SYS_IOCTL 1" >>confdefs.h fi fi # Check whether --with-libmikmod-prefix was given. if test "${with_libmikmod_prefix+set}" = set; then : withval=$with_libmikmod_prefix; libmikmod_config_prefix="$withval" else libmikmod_config_prefix="" fi # Check whether --with-libmikmod-exec-prefix was given. if test "${with_libmikmod_exec_prefix+set}" = set; then : withval=$with_libmikmod_exec_prefix; libmikmod_config_exec_prefix="$withval" else libmikmod_config_exec_prefix="" fi # Check whether --enable-libmikmodtest was given. if test "${enable_libmikmodtest+set}" = set; then : enableval=$enable_libmikmodtest; else enable_libmikmodtest=yes fi if test x$libmikmod_config_exec_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config fi fi if test x$libmikmod_config_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config fi fi # Extract the first word of "libmikmod-config", so it can be a program name with args. set dummy libmikmod-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LIBMIKMOD_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LIBMIKMOD_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBMIKMOD_CONFIG="$LIBMIKMOD_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBMIKMOD_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LIBMIKMOD_CONFIG" && ac_cv_path_LIBMIKMOD_CONFIG="no" ;; esac fi LIBMIKMOD_CONFIG=$ac_cv_path_LIBMIKMOD_CONFIG if test -n "$LIBMIKMOD_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBMIKMOD_CONFIG" >&5 $as_echo "$LIBMIKMOD_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi min_libmikmod_version=3.1.5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmikmod - version >= $min_libmikmod_version" >&5 $as_echo_n "checking for libmikmod - version >= $min_libmikmod_version... " >&6; } no_libmikmod="" if test "$LIBMIKMOD_CONFIG" = "no" ; then no_libmikmod=yes else LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags` LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs` LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd` libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'` libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'` libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\3/'` if test "x$enable_libmikmodtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD" LIBS="$LIBMIKMOD_LIBS $LIBS" rm -f conf.mikmodtest if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main (void) { int major,minor,micro; int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version; FILE *fp = fopen("conf.mikmodtest", "w"); if (fp) fclose(fp); if (sscanf("$min_libmikmod_version", "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_libmikmod_version"); exit(1); } libmikmod_major_version=(MikMod_GetVersion() >> 16) & 255; libmikmod_minor_version=(MikMod_GetVersion() >> 8) & 255; libmikmod_micro_version=(MikMod_GetVersion() ) & 255; if ((libmikmod_major_version != $libmikmod_config_major_version) || (libmikmod_minor_version != $libmikmod_config_minor_version) || (libmikmod_micro_version != $libmikmod_config_micro_version)) { printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n", $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version, libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf ("*** was found! If libmikmod-config was correct, then it is best\n"); printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n"); printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) || (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) || (libmikmod_micro_version != LIBMIKMOD_REVISION)) { printf("*** libmikmod header files (version %d.%d.%d) do not match\n", LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION); printf("*** library (version %d.%d.%d)\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); } else { if ((libmikmod_major_version > major) || ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) || ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf("*** You need a version of libmikmod newer than %d.%d.%d.\n", major, minor, micro); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n"); printf("*** correct copy of libmikmod-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_libmikmod=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi fi if test "x$no_libmikmod" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, \`$LIBMIKMOD_CONFIG --version\`" >&5 $as_echo "yes, \`$LIBMIKMOD_CONFIG --version\`" >&6; } : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$LIBMIKMOD_CONFIG" = "no" ; then echo "*** The libmikmod-config script installed by libmikmod could not be found" echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the" echo "*** full path to libmikmod-config." else if test -f conf.mikmodtest ; then : else echo "*** Could not run libmikmod test program, checking why..." CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS" LIBS="$LIBS $LIBMIKMOD_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return (MikMod_GetVersion()!=0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding libmikmod or finding the wrong" echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location. Also, make sure you have run ldconfig if that" echo "*** is required on your system." echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means libmikmod was incorrectly installed" echo "*** or that you have moved libmikmod since it was installed. In the latter case, you" echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi fi LIBMIKMOD_CFLAGS="" LIBMIKMOD_LIBS="" LIBMIKMOD_LDADD="" as_fn_error $? " --- ERROR: No suitable libmikmod library found. You need at least libmikmod 3.1.5 for this program to work. " "$LINENO" 5 fi rm -f conf.mikmodtest # MikMod_free() is in libmikmod-3.2.0b3 and later. The only fool-proof # way of detecting MikMod_free() is a configury check at compile time # or a dlsym() check at runtime, and the bad thing is 3.2.0beta1/2 were # (still are?) in distros.. ac_save_LIBS=$LIBS LIBS="$LIBS $LIBMIKMOD_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MikMod_free in -lmikmod" >&5 $as_echo_n "checking for MikMod_free in -lmikmod... " >&6; } if ${ac_cv_lib_mikmod_MikMod_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmikmod $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char MikMod_free (); int main () { return MikMod_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mikmod_MikMod_free=yes else ac_cv_lib_mikmod_MikMod_free=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mikmod_MikMod_free" >&5 $as_echo "$ac_cv_lib_mikmod_MikMod_free" >&6; } if test "x$ac_cv_lib_mikmod_MikMod_free" = xyes; then : $as_echo "#define HAVE_MIKMOD_FREE 1" >>confdefs.h fi LIBS="$ac_save_LIBS" case $host_os in mingw*|emx*|*djgpp) need_curses=no ;; *) need_curses=yes ;; esac if test "$need_curses" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5 $as_echo_n "checking for initscr in -lncurses... " >&6; } if ${ac_cv_lib_ncurses_initscr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char initscr (); int main () { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncurses_initscr=yes else ac_cv_lib_ncurses_initscr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5 $as_echo "$ac_cv_lib_ncurses_initscr" >&6; } if test "x$ac_cv_lib_ncurses_initscr" = xyes; then : libcurses=ncurses else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lcurses" >&5 $as_echo_n "checking for initscr in -lcurses... " >&6; } if ${ac_cv_lib_curses_initscr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char initscr (); int main () { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_curses_initscr=yes else ac_cv_lib_curses_initscr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_initscr" >&5 $as_echo "$ac_cv_lib_curses_initscr" >&6; } if test "x$ac_cv_lib_curses_initscr" = xyes; then : libcurses=curses else as_fn_error $? "--- ERROR: No curses library found." "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetflag in -ltinfo" >&5 $as_echo_n "checking for tgetflag in -ltinfo... " >&6; } if ${ac_cv_lib_tinfo_tgetflag+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltinfo $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char tgetflag (); int main () { return tgetflag (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_tinfo_tgetflag=yes else ac_cv_lib_tinfo_tgetflag=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_tgetflag" >&5 $as_echo "$ac_cv_lib_tinfo_tgetflag" >&6; } if test "x$ac_cv_lib_tinfo_tgetflag" = xyes; then : have_tinfo=yes else have_tinfo=no fi # resizeterm is an optional part of ncurses as_ac_Lib=`$as_echo "ac_cv_lib_$libcurses""_resizeterm" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resizeterm in -l$libcurses" >&5 $as_echo_n "checking for resizeterm in -l$libcurses... " >&6; } if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$libcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char resizeterm (); int main () { return resizeterm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : $as_echo "#define HAVE_NCURSES_RESIZETERM 1" >>confdefs.h fi ac_save_LIBS=$LIBS LIBS="$LIBS -l$libcurses" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether curses links without libtinfo" >&5 $as_echo_n "checking whether curses links without libtinfo... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_NCURSES_H #include #elif defined(HAVE_CURSES_H) #include #elif defined(HAVE_NCURSES_CURSES_H) #include #endif int main () { #ifdef ACS_ULCORNER return ACS_ULCORNER; #endif ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : need_tinfo=no else need_tinfo=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$need_tinfo" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$have_tinfo" = "no" ; then as_fn_error $? "--- ERROR: libtinfo needed for ncurses, but not found." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ncurses links with libtinfo" >&5 $as_echo_n "checking whether ncurses links with libtinfo... " >&6; } LIBS="$LIBS -ltinfo" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_NCURSES_H #include #elif defined(HAVE_CURSES_H) #include #endif int main () { #ifdef ACS_ULCORNER return ACS_ULCORNER; #endif ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else as_fn_error $? "--- ERROR: failed linking to ncurses library." "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi LIBS="$ac_save_LIBS" fi case "$host_os" in # mikmod_threads variable is for pthreads only mingw*|amigaos*|aros*|morphos*) mikmod_threads=no ;; esac if test "$mikmod_threads" = "yes"; then mikmod_threads=no # AC_CHECK_HEADERS(pthread.h) unreliable { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : mikmod_threads=-lpthread else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_attr_init in -lc_r" >&5 $as_echo_n "checking for pthread_attr_init in -lc_r... " >&6; } if ${ac_cv_lib_c_r_pthread_attr_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_attr_init (); int main () { return pthread_attr_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_r_pthread_attr_init=yes else ac_cv_lib_c_r_pthread_attr_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_attr_init" >&5 $as_echo "$ac_cv_lib_c_r_pthread_attr_init" >&6; } if test "x$ac_cv_lib_c_r_pthread_attr_init" = xyes; then : mikmod_threads=-lc_r fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working POSIX fnmatch" >&5 $as_echo_n "checking for working POSIX fnmatch... " >&6; } if ${ac_cv_func_fnmatch_works+:} false; then : $as_echo_n "(cached) " >&6 else # Some versions of Solaris, SCO, and the GNU C Library # have a broken or incompatible fnmatch. # So we run a test program. If we are cross-compiling, take no chance. # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test. if test "$cross_compiling" = yes; then : ac_cv_func_fnmatch_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # define y(a, b, c) (fnmatch (a, b, c) == 0) # define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH) int main () { return (!(y ("a*", "abc", 0) && n ("d*/*1", "d/s/1", FNM_PATHNAME) && y ("a\\\\bc", "abc", 0) && n ("a\\\\bc", "abc", FNM_NOESCAPE) && y ("*x", ".x", 0) && n ("*x", ".x", FNM_PERIOD) && 1)); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fnmatch_works=yes else ac_cv_func_fnmatch_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fnmatch_works" >&5 $as_echo "$ac_cv_func_fnmatch_works" >&6; } if test $ac_cv_func_fnmatch_works = yes; then : $as_echo "#define HAVE_FNMATCH 1" >>confdefs.h fi for ac_func in getopt_long_only do : ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only" if test "x$ac_cv_func_getopt_long_only" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETOPT_LONG_ONLY 1 _ACEOF have_getopt_long_only=yes fi done for ac_func in mkstemp srandom snprintf vsnprintf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "usleep" >/dev/null 2>&1; then : $as_echo "#define HAVE_USLEEP_PROTO 1" >>confdefs.h fi rm -f conftest* cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "usleep" >/dev/null 2>&1; then : $as_echo "#define HAVE_USLEEP_PROTO 1" >>confdefs.h fi rm -f conftest* _lcl_receval="${datadir}/${PACKAGE}" ax_package_data_dir=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" _lcl_receval_old='' while test "$_lcl_receval_old" != "$_lcl_receval"; do _lcl_receval_old="$_lcl_receval" eval _lcl_receval="\"$_lcl_receval\"" done echo "$_lcl_receval")` cat >>confdefs.h <<_ACEOF #define PACKAGE_DATA_DIR "$ax_package_data_dir" _ACEOF #AC_SUBST(PACKAGE_DATA_DIR) case $host in *-aix*) $as_echo "#define MIKMOD_AIX 1" >>confdefs.h ;; esac if test "$mikmod_threads" != "no"; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h CFLAGS="$CFLAGS -D_REENTRANT" PLAYER_LIB="$mikmod_threads $PLAYER_LIB" REENTRANT="-D_REENTRANT" fi case $host in *-*-solaris*) if test "$mikmod_threads" != "no"; then have_usleep=no else for ac_func in usleep do : ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" if test "x$ac_cv_func_usleep" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_USLEEP 1 _ACEOF have_usleep=yes fi done fi ;; *) for ac_func in usleep do : ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" if test "x$ac_cv_func_usleep" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_USLEEP 1 _ACEOF have_usleep=yes fi done ;; esac if test "$have_getopt_long_only" != "yes"; then EXTRA_OBJ="getopt_long.o $EXTRA_OBJ" fi if test "$ac_cv_func_fnmatch_works" != "yes"; then EXTRA_OBJ="mfnmatch.o $EXTRA_OBJ" fi if test "$have_usleep" != "yes"; then EXTRA_OBJ="musleep.o $EXTRA_OBJ" fi if test "$need_curses" = "yes"; then PLAYER_LIB="$PLAYER_LIB -l$libcurses" if test "$need_tinfo" = "yes"; then PLAYER_LIB="$PLAYER_LIB -ltinfo" fi fi ac_config_files="$ac_config_files Makefile src/Makefile" ac_config_headers="$ac_config_headers config.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by mikmod $as_me 3.2.9, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ mikmod config.status 3.2.9 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi mikmod-3.2.9/mikmod.lsm0000644000000000000000000000116014037505106013477 0ustar rootrootBegin3 Title: MikMod module player Version: 3.2.9 Entered-date: no date yet Description: MikMod is a full-featured GPL module player based on the libmikmod Description: sound library. Keywords: mikmod player digital music sound audio Keywords: mod s3m xm mtm stm it ult dsm med 669 far med amf gdm alsa esd Author: (Many - see file AUTHORS for complete list) Maintained-by: O.Sezer Primary-site: http://mikmod.sourceforge.net/ Alternate-site: none Platforms: AIX, DOS, FreeBSD, HP-UX, IRIX, Linux, OSF/1, OS/2, NetBSD, Platforms: OpenBSD, Mac OS X, Solaris... more on request ! Copying-policy: GPL End mikmod-3.2.9/configure.ac0000644000000000000000000001475114362453344014011 0ustar rootrootdnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.59]) AC_INIT([mikmod],[3.2.9]) AC_CONFIG_AUX_DIR([autotools]) AM_INIT_AUTOMAKE([1.7 foreign]) AC_CONFIG_SRCDIR([src/mikmod.c]) AC_CONFIG_MACRO_DIR([m4]) AM_MAINTAINER_MODE AC_CANONICAL_HOST dnl ============================================================== dnl mikmod specific control variables and their default values. dnl ============================================================== mikmod_threads=yes dnl ========================= dnl Configure script options. dnl ========================= AC_ARG_ENABLE([threads],[AS_HELP_STRING([--enable-threads],[use an own thread for the player [default=guessed]])], [if test "$enableval" = "yes" then mikmod_threads=yes else mikmod_threads=no fi]) dnl ==================== dnl Checks for programs. dnl ==================== AC_PROG_CC AC_PROG_CPP AC_PROG_EGREP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET dnl ================================= dnl Use -Wall warning level with gcc. dnl ================================= if test $ac_cv_c_compiler_gnu = yes ; then CFLAGS="$CFLAGS -Wall" fi dnl ============================================================== dnl Checks for typedefs, structures, and compiler characteristics. dnl ============================================================== AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T dnl ======================== dnl Checks for header files. dnl ======================== AC_CHECK_HEADERS(fcntl.h limits.h stdint.h fnmatch.h sys/ioctl.h sys/param.h sys/time.h unistd.h) AC_CHECK_HEADERS(sched.h) AC_CHECK_HEADERS(ncurses.h curses.h ncurses/curses.h) AC_CHECK_HEADERS(termios.h) AC_HEADER_SYS_WAIT AC_HEADER_TIOCGWINSZ dnl ===================== dnl Checks for libraries. dnl ===================== dnl libmikmod AM_PATH_LIBMIKMOD(3.1.5, , AC_MSG_ERROR([ --- ERROR: No suitable libmikmod library found. You need at least libmikmod 3.1.5 for this program to work. ])) # MikMod_free() is in libmikmod-3.2.0b3 and later. The only fool-proof # way of detecting MikMod_free() is a configury check at compile time # or a dlsym() check at runtime, and the bad thing is 3.2.0beta1/2 were # (still are?) in distros.. ac_save_LIBS=$LIBS LIBS="$LIBS $LIBMIKMOD_LIBS" AC_CHECK_LIB(mikmod, MikMod_free, AC_DEFINE(HAVE_MIKMOD_FREE, 1, [Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2).])) LIBS="$ac_save_LIBS" dnl ncurses case $host_os in mingw*|emx*|*djgpp) need_curses=no ;; *) need_curses=yes ;; esac if test "$need_curses" = "yes" ; then AC_CHECK_LIB([ncurses], [initscr], [libcurses=ncurses], AC_CHECK_LIB([curses], [initscr], [libcurses=curses], AC_MSG_ERROR([--- ERROR: No curses library found.]))) AC_CHECK_LIB([tinfo], [tgetflag], [have_tinfo=yes], [have_tinfo=no]) # resizeterm is an optional part of ncurses AC_CHECK_LIB($libcurses, resizeterm, AC_DEFINE(HAVE_NCURSES_RESIZETERM, 1, [Define if your libncurses defines resizeterm (not found in <4.2).])) ac_save_LIBS=$LIBS LIBS="$LIBS -l$libcurses" AC_MSG_CHECKING([whether curses links without libtinfo]) AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#ifdef HAVE_NCURSES_H #include #elif defined(HAVE_CURSES_H) #include #elif defined(HAVE_NCURSES_CURSES_H) #include #endif]], [[#ifdef ACS_ULCORNER return ACS_ULCORNER; #endif]])], [need_tinfo=no], [need_tinfo=yes] ) if test "$need_tinfo" = "yes" ; then AC_MSG_RESULT(no) if test "$have_tinfo" = "no" ; then AC_MSG_ERROR([--- ERROR: libtinfo needed for ncurses, but not found.]) else AC_MSG_CHECKING([whether ncurses links with libtinfo]) LIBS="$LIBS -ltinfo" AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#ifdef HAVE_NCURSES_H #include #elif defined(HAVE_CURSES_H) #include #endif]], [[#ifdef ACS_ULCORNER return ACS_ULCORNER; #endif]])], [AC_MSG_RESULT(yes)], [AC_MSG_ERROR(--- ERROR: failed linking to ncurses library.)] ) fi else AC_MSG_RESULT(yes) fi LIBS="$ac_save_LIBS" fi dnl POSIX.4 threads dnl --------------- case "$host_os" in # mikmod_threads variable is for pthreads only mingw*|amigaos*|aros*|morphos*) mikmod_threads=no ;; esac if test "$mikmod_threads" = "yes"; then mikmod_threads=no # AC_CHECK_HEADERS(pthread.h) unreliable AC_CHECK_LIB([pthread], [pthread_create], [mikmod_threads=-lpthread], AC_CHECK_LIB([c_r], [pthread_attr_init], [mikmod_threads=-lc_r]) ) fi dnl ============================= dnl Checks for library functions. dnl ============================= AC_FUNC_FNMATCH AC_CHECK_FUNCS(getopt_long_only, have_getopt_long_only=yes) AC_CHECK_FUNCS(mkstemp srandom snprintf vsnprintf) AC_EGREP_HEADER(usleep, unistd.h, AC_DEFINE(HAVE_USLEEP_PROTO, 1, [Define if your system has the prototype for usleep(3).])) AC_EGREP_HEADER(usleep, sys/unistd.h, AC_DEFINE(HAVE_USLEEP_PROTO)) dnl ================================= dnl Set PACKAGE_DATA_DIR in config.h. dnl ================================= AX_RECURSIVE_EVAL(${datadir}/${PACKAGE},ax_package_data_dir) AC_DEFINE_UNQUOTED([PACKAGE_DATA_DIR],"$ax_package_data_dir",[Define the directory for shared data.]) #AC_SUBST(PACKAGE_DATA_DIR) dnl ================ dnl Choose settings. dnl ================ case $host in *-aix*) AC_DEFINE(MIKMOD_AIX, 1, [Define if your system is AIX 3.* - might be needed for 4.* too.]) ;; esac if test "$mikmod_threads" != "no"; then AC_DEFINE(HAVE_PTHREAD, 1, [Define if your system provides POSIX.4 threads.]) CFLAGS="$CFLAGS -D_REENTRANT" PLAYER_LIB="$mikmod_threads $PLAYER_LIB" REENTRANT="-D_REENTRANT" fi dnl =================== dnl Choose extra stuff. dnl =================== dnl solaris usleep is not thread safe, use an alternative dnl implementation on this system case $host in *-*-solaris*) if test "$mikmod_threads" != "no"; then have_usleep=no else AC_CHECK_FUNCS(usleep, have_usleep=yes) fi ;; *) AC_CHECK_FUNCS(usleep, have_usleep=yes) ;; esac if test "$have_getopt_long_only" != "yes"; then EXTRA_OBJ="getopt_long.o $EXTRA_OBJ" fi dnl Yet another kluge to get the result of AC_FUNC_FNMATCH. if test "$ac_cv_func_fnmatch_works" != "yes"; then EXTRA_OBJ="mfnmatch.o $EXTRA_OBJ" fi if test "$have_usleep" != "yes"; then EXTRA_OBJ="musleep.o $EXTRA_OBJ" fi if test "$need_curses" = "yes"; then PLAYER_LIB="$PLAYER_LIB -l$libcurses" if test "$need_tinfo" = "yes"; then PLAYER_LIB="$PLAYER_LIB -ltinfo" fi fi dnl ================= dnl Create Makefiles. dnl ================= AC_SUBST(EXTRA_OBJ) AC_SUBST(PLAYER_LIB) AC_CONFIG_FILES([Makefile src/Makefile]) AC_CONFIG_HEADERS([config.h]) AC_OUTPUT mikmod-3.2.9/macosx/0000755000000000000000000000000014734753426013014 5ustar rootrootmikmod-3.2.9/macosx/config.h0000644000000000000000000000552614317363456014437 0ustar rootroot/* config.h. Generated for Mac OS X. */ /* Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2). */ #define HAVE_MIKMOD_FREE 1 /* Define the directory for shared data. */ #define PACKAGE_DATA_DIR "/usr/local/share/mikmod" /* Define to 1 if `TIOCGWINSZ' requires . */ /* #undef GWINSZ_IN_SYS_IOCTL */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if your system has a working POSIX `fnmatch' function. */ #define HAVE_FNMATCH 1 /* Define to 1 if you have the header file. */ #define HAVE_FNMATCH_H 1 /* Define to 1 if you have the `getopt_long_only' function. */ #define HAVE_GETOPT_LONG_ONLY 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 /* Define to 1 if you have the header file. */ #define HAVE_CURSES_H 1 /* Define if your libncurses defines resizeterm (not found in <4.2). */ #define HAVE_NCURSES_RESIZETERM 1 /* Define if your system provides POSIX.4 threads. */ #define HAVE_PTHREAD 1 /* Define to 1 if you have the header file. */ #define HAVE_SCHED_H 1 /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 /* Define to 1 if you have the `srandom' function. */ #define HAVE_SRANDOM 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have that is POSIX.1 compatible. */ #define HAVE_SYS_WAIT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TERMIOS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the `usleep' function. */ #define HAVE_USLEEP 1 /* Define if your system has the prototype for usleep(3). */ #define HAVE_USLEEP_PROTO 1 /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 mikmod-3.2.9/macosx/Makefile.darwin0000644000000000000000000000700413743515624015733 0ustar rootroot# Makefile for MikMod for Darwin (i.e. Mac OS X) # Edit the compiler/linker flags, etc. to meet your needs # This is a Makefile designed explicitly for GNU Make. ifeq ($(CROSS),) CC=gcc AS=as LIPO=lipo else CC=$(CROSS)-gcc AS=$(CROSS)-as LIPO=$(CROSS)-lipo endif LINKER=$(CC) # if building against a static libmikmod, add -DMIKMOD_STATIC to CFLAGS CFLAGS=-O2 -Wall -DHAVE_CONFIG_H -D_THREAD_SAFE COMPILE=$(CC) $(CFLAGS) -I. -o $@ -c ../src/$*.c # if building against static libmikmod, you will need adding # -Wl,-framework,CoreAudio (for drv_osx) to LIBS too, along with any # other extra driver libs that static libmikmod was compiled against. LIBS= -pthread -lcurses -L. -lmikmod OBJS= display.o marchive.o mconfedit.o mconfig.o mdialog.o mikmod.o \ mlist.o mlistedit.o mmenu.o mplayer.o mutilities.o mwidget.o \ mwindow.o rcfile.o all: mikmod clean: rm -f mikmod *.o mikmod: $(OBJS) $(LINKER) -o mikmod $(OBJS) $(LIBS) display.o: ../src/display.c ../src/display.h ../src/player.h ../src/mconfig.h \ ../src/rcfile.h ../src/mlist.h ../src/mutilities.h ../src/mwindow.h \ ../src/mconfedit.h ../src/mmenu.h ../src/keys.h ../src/mplayer.h \ ../src/mlistedit.h config.h $(COMPILE) marchive.o: ../src/marchive.c ../src/mfnmatch.h ../src/mlist.h \ ../src/marchive.h ../src/mconfig.h ../src/rcfile.h \ ../src/mutilities.h ../src/display.h config.h $(COMPILE) mconfedit.o: ../src/mconfedit.c ../src/rcfile.h ../src/mconfig.h \ ../src/mconfedit.h ../src/mmenu.h ../src/mwindow.h ../src/mlist.h \ ../src/mdialog.h ../src/mwidget.h ../src/mutilities.h config.h $(COMPILE) mconfig.o: ../src/mconfig.c ../src/player.h ../src/mconfig.h ../src/rcfile.h \ ../src/mwindow.h ../src/mlist.h ../src/mutilities.h config.h $(COMPILE) mdialog.o: ../src/mdialog.c ../src/mwidget.h ../src/mwindow.h ../src/mconfig.h \ ../src/rcfile.h ../src/mdialog.h ../src/display.h ../src/mutilities.h \ config.h $(COMPILE) mikmod.o: ../src/mikmod.c ../src/player.h ../src/mutilities.h \ ../src/display.h ../src/rcfile.h ../src/mconfig.h ../src/mlist.h \ ../src/mlistedit.h ../src/mmenu.h ../src/mwindow.h ../src/marchive.h \ ../src/mdialog.h ../src/mwidget.h ../src/mplayer.h ../src/keys.h config.h $(COMPILE) mlist.o: ../src/mlist.c ../src/mfnmatch.h ../src/mlist.h ../src/marchive.h \ ../src/mutilities.h config.h $(COMPILE) mlistedit.o: ../src/mlistedit.c ../src/mlistedit.h ../src/mmenu.h \ ../src/mwindow.h ../src/mconfig.h ../src/rcfile.h ../src/mlist.h \ ../src/player.h ../src/mdialog.h ../src/mwidget.h \ ../src/mconfedit.h ../src/marchive.h ../src/keys.h \ ../src/display.h ../src/mutilities.h config.h $(COMPILE) mmenu.o: ../src/mmenu.c ../src/display.h ../src/mmenu.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mdialog.h ../src/mwidget.h \ ../src/keys.h ../src/mutilities.h config.h $(COMPILE) mplayer.o: ../src/mplayer.c ../src/mplayer.h ../src/mthreads.h ../src/mconfig.h \ ../src/rcfile.h ../src/mutilities.h config.h $(COMPILE) mutilities.o: ../src/mutilities.c ../src/player.h ../src/mlist.h \ ../src/marchive.h ../src/mutilities.h config.h $(COMPILE) mwidget.o: ../src/mwidget.c ../src/display.h ../src/player.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mwidget.h ../src/keys.h \ ../src/mutilities.h config.h $(COMPILE) mwindow.o: ../src/mwindow.c ../src/display.h ../src/player.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mutilities.h ../src/keys.h \ ../src/mthreads.h ../src/winvideo.inc config.h $(COMPILE) rcfile.o: ../src/rcfile.c ../src/rcfile.h ../src/mutilities.h config.h $(COMPILE) mikmod-3.2.9/win32/0000755000000000000000000000000014734753426012464 5ustar rootrootmikmod-3.2.9/win32/MSVC6/0000755000000000000000000000000014734753426013322 5ustar rootrootmikmod-3.2.9/win32/MSVC6/mikmod.dsw0000644000000000000000000000103112226306364015301 0ustar rootrootMicrosoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "mikmod"=".\mikmod.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### mikmod-3.2.9/win32/MSVC6/mikmod.dsp0000644000000000000000000001443013743515624015307 0ustar rootroot# Microsoft Developer Studio Project File - Name="mikmod" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=mikmod - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "mikmod.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "mikmod.mak" CFG="mikmod - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "mikmod - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mikmod - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "mikmod - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\win32" /I "..\..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "HAVE_CONFIG_H" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib libmikmod.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "mikmod - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\win32" /I "..\..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "HAVE_CONFIG_H" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib libmikmod.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "mikmod - Win32 Release" # Name "mikmod - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\src\display.c # End Source File # Begin Source File SOURCE=..\..\src\getopt_long.c # End Source File # Begin Source File SOURCE=..\..\src\marchive.c # End Source File # Begin Source File SOURCE=..\..\src\mconfedit.c # End Source File # Begin Source File SOURCE=..\..\src\mconfig.c # End Source File # Begin Source File SOURCE=..\..\src\mdialog.c # End Source File # Begin Source File SOURCE=..\..\src\mfnmatch.c # End Source File # Begin Source File SOURCE=..\..\src\mikmod.c # End Source File # Begin Source File SOURCE=..\..\src\mlist.c # End Source File # Begin Source File SOURCE=..\..\src\mlistedit.c # End Source File # Begin Source File SOURCE=..\..\src\mmenu.c # End Source File # Begin Source File SOURCE=..\..\src\mplayer.c # End Source File # Begin Source File SOURCE=..\..\src\mutilities.c # End Source File # Begin Source File SOURCE=..\..\src\mwidget.c # End Source File # Begin Source File SOURCE=..\..\src\mwindow.c # End Source File # Begin Source File SOURCE=..\..\src\rcfile.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\config.h # End Source File # Begin Source File SOURCE=..\..\src\display.h # End Source File # Begin Source File SOURCE=..\..\src\getopt_long.h # End Source File # Begin Source File SOURCE=..\..\src\keys.h # End Source File # Begin Source File SOURCE=..\..\src\marchive.h # End Source File # Begin Source File SOURCE=..\..\src\mconfedit.h # End Source File # Begin Source File SOURCE=..\..\src\mconfig.h # End Source File # Begin Source File SOURCE=..\..\src\mdialog.h # End Source File # Begin Source File SOURCE=..\..\src\mfnmatch.h # End Source File # Begin Source File SOURCE=..\..\src\mlist.h # End Source File # Begin Source File SOURCE=..\..\src\mlistedit.h # End Source File # Begin Source File SOURCE=..\..\src\mmenu.h # End Source File # Begin Source File SOURCE=..\..\src\mplayer.h # End Source File # Begin Source File SOURCE=..\..\src\mthreads.h # End Source File # Begin Source File SOURCE=..\..\src\mutilities.h # End Source File # Begin Source File SOURCE=..\..\src\mwidget.h # End Source File # Begin Source File SOURCE=..\..\src\mwindow.h # End Source File # Begin Source File SOURCE=..\..\src\player.h # End Source File # Begin Source File SOURCE=..\..\src\rcfile.h # End Source File # Begin Source File SOURCE=..\winvideo.inc # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project mikmod-3.2.9/win32/README0000644000000000000000000000256414606714744013351 0ustar rootrootThis is the instructions to compile mikmod on win32. Mikmod can be compiler using Microsoft Visual Studio, MinGW, or Watcom compilers. 1) First, compile libmikmod, and install it. To install libmikmod, copy libmikmod.lib (generated when compiling libmikmod) in the /lib directory of MinGW. Next, copy the file mikmod.h in the /include directory of MinGW. Should be similar if you use MSVC or Watcom. 2) Compiling mikmod: - using MinGW or MinGW-w64: cd to the win32 directory and type make -f Makefile.mingw (you need GNU make: gmake, or mingw32-make, or whatever) - using MSVC: Compile using project files from the 'VisualStudio' directory: they are compatible with Visual Studio 2010 and newer. (If you really need, the 'VS8' (for MSVC 2005/2008) and 'MSVC6' project files are still there, too.) 3) Try it! There are 2 audio drivers for windows. - DirectSound Driver (Requires DirectX 6 or newer) - waveform-audio Depending on how you compliled libmikmod, the XAudio2 driver, and possibly others may be there too. To choose which driver to use from the command line, do a mikmod -n to get the list of drivers, and once you know the correct driver id, do mikmod -d ?? where ?? is the id. do mikmod -h for more command line options. -- Good Luck! Raphael Assenat raph@raphnet.net mikmod-3.2.9/win32/VS8/0000755000000000000000000000000014734753426013104 5ustar rootrootmikmod-3.2.9/win32/VS8/mikmod.vcproj0000644000000000000000000002256213743515624015613 0ustar rootroot mikmod-3.2.9/win32/VS8/mikmod.sln0000644000000000000000000000231612226306364015071 0ustar rootroot Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mikmod", "mikmod.vcproj", "{D3C21AC0-6154-451E-BDAA-26D4776D52E0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Debug|Win32.ActiveCfg = Debug|Win32 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Debug|Win32.Build.0 = Debug|Win32 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Debug|x64.ActiveCfg = Debug|x64 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Debug|x64.Build.0 = Debug|x64 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Release|Win32.ActiveCfg = Release|Win32 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Release|Win32.Build.0 = Release|Win32 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Release|x64.ActiveCfg = Release|x64 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal mikmod-3.2.9/win32/Makefile.wat0000644000000000000000000000251614610201306014674 0ustar rootroot# Makefile for Win32 using Open Watcom compiler. # # wmake -f Makefile.wat # # to statically link to mikmod: # wmake -f Makefile.wat target=static !ifndef target target = dynamic !endif CC=wcc386 INCLUDES=-I. CPPFLAGS=-DHAVE_FCNTL_H -DHAVE_LIMITS_H -DHAVE_SYS_TIME_H -DHAVE_SNPRINTF -DHAVE_MKSTEMP # Mikmod_free() is available in libmikmod >= 3.2.0-beta3: CPPFLAGS+= -DHAVE_MIKMOD_FREE !ifneq target static LIBS=libmikmod.lib !else CPPFLAGS+= -DMIKMOD_STATIC LIBS=mikmod-static.lib winmm.lib dsound.lib dxguid.lib !endif CFLAGS = -bt=nt -bm -fp5 -fpi87 -mf -oeatxh -w4 -zp8 -ei -zq # newer OpenWatcom versions enable W303 by default. CFLAGS+= -wcd=303 # -5s : Pentium stack calling conventions. # -5r : Pentium register calling conventions. CFLAGS+= -5s .SUFFIXES: .SUFFIXES: .obj .c AOUT=mikmod.exe COMPILE=$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) OBJ = display.obj marchive.obj mconfedit.obj mconfig.obj mdialog.obj mikmod.obj mlist.obj mlistedit.obj & mmenu.obj mplayer.obj mutilities.obj mwidget.obj mwindow.obj rcfile.obj EXTRA_OBJ = getopt_long.obj all: $(AOUT) $(AOUT): $(OBJ) $(EXTRA_OBJ) wlink N $(AOUT) SYS NT OP q LIBR {$(LIBS)} F {$(OBJ)} F {$(EXTRA_OBJ)} .c: ../src .c.obj: $(COMPILE) -fo=$^@ $< distclean: clean .symbolic rm -f $(AOUT) clean: .symbolic rm -f *.obj mikmod-3.2.9/win32/VisualStudio/0000755000000000000000000000000014734753426015117 5ustar rootrootmikmod-3.2.9/win32/VisualStudio/mikmod.vcxproj.filters0000644000000000000000000001057714606714744021473 0ustar rootroot {4FC737F1-C7A5-4376-A066-2A32D752A2FF} cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hpp;hxx;hm;inl;inc;xsd {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav Source Files Source Files Source Files Source Files Source Files Source Files Source Files Source Files Source Files Source Files Source Files Source Files Source Files Source Files Source Files Source Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files Header Files mikmod-3.2.9/win32/VisualStudio/mikmod.vcxproj0000644000000000000000000003147114606714744020020 0ustar rootroot Debug Win32 Debug x64 Release Win32 Release x64 {D3C21AC0-6154-451E-BDAA-26D4776D52E0} mikmod 10.0 Application NotSet $(DefaultPlatformToolset) true Application NotSet $(DefaultPlatformToolset) Application NotSet $(DefaultPlatformToolset) true Application NotSet $(DefaultPlatformToolset) <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Configuration)\ $(Configuration)\ true $(SolutionDir)$(Configuration)\ $(Configuration)\ false $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ true $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ false AllRules.ruleset AllRules.ruleset AllRules.ruleset AllRules.ruleset Disabled ..\..\win32;..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue CompileAsC libmikmod.lib;%(AdditionalDependencies) true Console MachineX86 ..\..\win32;..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;%(PreprocessorDefinitions) MultiThreadedDLL Level3 CompileAsC libmikmod.lib;%(AdditionalDependencies) false Console true true MachineX86 X64 Disabled ..\..\win32;..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 ProgramDatabase CompileAsC libmikmod.lib;%(AdditionalDependencies) true Console MachineX64 X64 ..\..\win32;..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;%(PreprocessorDefinitions) MultiThreadedDLL Level3 CompileAsC libmikmod.lib;%(AdditionalDependencies) false Console true true MachineX64 mikmod-3.2.9/win32/VisualStudio/mikmod.sln0000644000000000000000000000232014606714744017110 0ustar rootroot Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mikmod", "mikmod.vcxproj", "{D3C21AC0-6154-451E-BDAA-26D4776D52E0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Debug|Win32.ActiveCfg = Debug|Win32 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Debug|Win32.Build.0 = Debug|Win32 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Debug|x64.ActiveCfg = Debug|x64 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Debug|x64.Build.0 = Debug|x64 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Release|Win32.ActiveCfg = Release|Win32 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Release|Win32.Build.0 = Release|Win32 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Release|x64.ActiveCfg = Release|x64 {D3C21AC0-6154-451E-BDAA-26D4776D52E0}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal mikmod-3.2.9/win32/config.h0000644000000000000000000000174014607406616014077 0ustar rootroot/* config.h. Generated manually for Windows. */ /* Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2). */ #define HAVE_MIKMOD_FREE /* Define the directory for shared data. */ #undef PACKAGE_DATA_DIR /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* but we do define HAVE_VSNPRINTF */ /* Define to 1 if you have the `srandom' function. */ /* #undef HAVE_SRANDOM */ /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #define HAVE_STRING_H /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF mikmod-3.2.9/win32/Makefile.mingw0000644000000000000000000000730414056465164015244 0ustar rootroot# Makefile for MikMod for the MinGW / MingGW-w64 compiler system # ifeq ($(CROSS),) CC=gcc AS=as else CC=$(CROSS)-gcc AS=$(CROSS)-as endif LINKER=$(CC) #RM=del RM=rm -f # if building against a static libmikmod, add -DMIKMOD_STATIC to CFLAGS CFLAGS=-O2 -Wall -DHAVE_CONFIG_H -DWIN32 COMPILE=$(CC) $(CFLAGS) -I. -o $@ -c ../src/$*.c # if building against static libmikmod, you will need adding -ldsound # (for drv_ds) and -lwinmm (for drv_win) to LIBS too, along with any # other extra driver libs that static libmikmod was compiled against. LIBS= -L. -lmikmod OBJS= display.o marchive.o mconfedit.o mconfig.o mdialog.o \ mfnmatch.o getopt_long.o mikmod.o mlist.o \ mlistedit.o mmenu.o mplayer.o mutilities.o mwidget.o \ mwindow.o rcfile.o all: mikmod.exe clean: $(RM) mikmod.exe *.o mikmod.exe: $(OBJS) $(LINKER) -mconsole -o mikmod.exe $(OBJS) $(LIBS) display.o: ../src/display.c ../src/display.h ../src/player.h ../src/mconfig.h \ ../src/rcfile.h ../src/mlist.h ../src/mutilities.h ../src/mwindow.h \ ../src/mconfedit.h ../src/mmenu.h ../src/keys.h ../src/mplayer.h \ ../src/mlistedit.h config.h $(COMPILE) marchive.o: ../src/marchive.c ../src/mfnmatch.h ../src/mlist.h \ ../src/marchive.h ../src/mconfig.h ../src/rcfile.h \ ../src/mutilities.h ../src/display.h config.h $(COMPILE) mconfedit.o: ../src/mconfedit.c ../src/rcfile.h ../src/mconfig.h \ ../src/mconfedit.h ../src/mmenu.h ../src/mwindow.h ../src/mlist.h \ ../src/mdialog.h ../src/mwidget.h ../src/mutilities.h config.h $(COMPILE) mconfig.o: ../src/mconfig.c ../src/player.h ../src/mconfig.h ../src/rcfile.h \ ../src/mwindow.h ../src/mlist.h ../src/mutilities.h config.h $(COMPILE) mdialog.o: ../src/mdialog.c ../src/mwidget.h ../src/mwindow.h ../src/mconfig.h \ ../src/rcfile.h ../src/mdialog.h ../src/display.h ../src/mutilities.h \ config.h $(COMPILE) mfnmatch.o: ../src/mfnmatch.c ../src/mfnmatch.h $(COMPILE) getopt_long.o: ../src/getopt_long.c ../src/getopt_long.h $(COMPILE) mikmod.o: ../src/mikmod.c ../src/getopt_long.h ../src/player.h ../src/mutilities.h \ ../src/display.h ../src/rcfile.h ../src/mconfig.h ../src/mlist.h \ ../src/mlistedit.h ../src/mmenu.h ../src/mwindow.h ../src/marchive.h \ ../src/mdialog.h ../src/mwidget.h ../src/mplayer.h ../src/keys.h config.h $(COMPILE) mlist.o: ../src/mlist.c ../src/mfnmatch.h ../src/mlist.h ../src/marchive.h \ ../src/mutilities.h config.h $(COMPILE) mlistedit.o: ../src/mlistedit.c ../src/mlistedit.h ../src/mmenu.h \ ../src/mwindow.h ../src/mconfig.h ../src/rcfile.h ../src/mlist.h \ ../src/player.h ../src/mdialog.h ../src/mwidget.h \ ../src/mconfedit.h ../src/marchive.h ../src/keys.h \ ../src/display.h ../src/mutilities.h config.h $(COMPILE) mmenu.o: ../src/mmenu.c ../src/display.h ../src/mmenu.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mdialog.h ../src/mwidget.h \ ../src/keys.h ../src/mutilities.h config.h $(COMPILE) mplayer.o: ../src/mplayer.c ../src/mplayer.h ../src/mthreads.h ../src/mconfig.h \ ../src/rcfile.h ../src/mutilities.h config.h $(COMPILE) mutilities.o: ../src/mutilities.c ../src/player.h ../src/mlist.h \ ../src/marchive.h ../src/mutilities.h config.h $(COMPILE) mwidget.o: ../src/mwidget.c ../src/display.h ../src/player.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mwidget.h ../src/keys.h \ ../src/mutilities.h config.h $(COMPILE) mwindow.o: ../src/mwindow.c ../src/display.h ../src/player.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mutilities.h ../src/keys.h \ ../src/mthreads.h ../src/winvideo.inc config.h $(COMPILE) rcfile.o: ../src/rcfile.c ../src/rcfile.h ../src/mutilities.h config.h $(COMPILE) mikmod-3.2.9/os2/0000755000000000000000000000000014734753426012225 5ustar rootrootmikmod-3.2.9/os2/README0000644000000000000000000000715514037505106013077 0ustar rootroot Hello folks ! This is MikMod, version 3.2.9, a module player for OS/2. As usual with each new version, there's a lot of bugfixes and improvements. Check out the file 'NEWS' for more information. >> BUILDING MIKMOD ------------------ - If you're not building libmikmod for OS/2, then you're lost in the sources. Go up one directory, and read the main README file. So you're on a good old OS/2 system, aren't you ? With a customized Object Desktop or some equivalent tool collection ? I hope you've installed REXX support during the system installation. If you didn't, you lose. Run 'selective install' from the system setup folder, install REXX support, check it works, and come back here. The first thing you need is to get and compile the libmikmod sound library, which is not bundled with MikMod anymore ! If you don't know where to get libmikmod, look at the "contact and download info" section later in this document. You need long filenames to compile MikMod, so you'll have to compile it on an HPFS drive, or an ext2fs drive, or a network drive where you can use decent-size filenames. Currently, MikMod can be build under OS/2 only with the Watcom compiler (tested with OpenWatcom 1.9), or with the EMX compiler (not tested). Edit the makefiles if you need to customize the build options and/or want to learn any details. For EMX, run: make -f Makefile.emx For Watcom, run: wmake -f Makefile.wat and you'll get your MikMod binary in this directory. Just copy the file 'mikmod.exe' somewhere in your PATH, and enjoy ! If the build fails, I'd like to hear from you to correct the problem. >> USING MIKMOD --------------- Run MikMod with the '--help' parameter to get the available options. Program documentation is available as an Unix man page (..\src\mikmod.1) which you can read if you've got a port of the 'man' tool. Also, after you've run MikMod for the first time, you might want to customize your mikmod.cfg file, either from the configuration panel or by editing the file yourself, so you won't need to supply the same options to MikMod all the time. This file will be created in the directory pointed to by the HOME environment variable. If you don't have the HOME environment variable, the file will be created in C:\, which is probably not what you want and should encourage you to have the HOME environment variable set. Once you're in the player, pressing the H key will give you an help screen with the list of the keys you can use. I hope it's understandable. >> THANKS --------- I would like to thank everyone who contributed to libmikmod. Their names are in the AUTHORS file for the significative contributions, but some other names can be found in the NEWS file. Thanks a lot ! Keeping MikMod alive wouldn't be much fun without you. >> LICENSE ---------- The MikMod module player is covered by the GNU General Public License as published by the Free Software Fundation (you'll find it in the file COPYING) ; either version 2 of the licence, or (at your option) any later version. >> CONTACT AND DOWNLOAD INFO ---------------------------- MikMod/libmikmod home page is located at SourceForge: http://mikmod.sourceforge.net/ http://sourceforge.net/projects/mikmod/ There's a mailing list (mikmod-public) for discussing the development of MikMod (new features, bugs, ideas...) Look for more information on the web site. >> LAST NOTES ------------- I hope you'll enjoy using this version of MikMod as well as I enjoyed debugging and improving it. -- Miodrag ("Miod") Vallat, 10/19/1999 miodrag@mikmod.darkorb.net mikmod-3.2.9/os2/Makefile.wat0000644000000000000000000000223414607406654014455 0ustar rootroot# Makefile for OS/2 using Open Watcom compiler. # # wmake -f Makefile.wat # # to statically link to mikmod: # wmake -f Makefile.wat target=static !ifndef target target = dynamic !endif CC=wcc386 INCLUDES=-I. CPPFLAGS=-DHAVE_CONFIG_H !ifneq target static LIBS=mikmod3.lib !else CPPFLAGS+= -DMIKMOD_STATIC LIBS=mikmod_static.lib mmpm2.lib !endif CFLAGS = -bt=os2 -bm -fp5 -fpi87 -mf -oeatxh -w4 -zp8 -ei -zq # newer OpenWatcom versions enable W303 by default. CFLAGS+= -wcd=303 # -5s : Pentium stack calling conventions. # -5r : Pentium register calling conventions. CFLAGS+= -5s .SUFFIXES: .SUFFIXES: .obj .c AOUT=mikmod.exe COMPILE=$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) OBJ = display.obj marchive.obj mconfedit.obj mconfig.obj mdialog.obj mikmod.obj mlist.obj mlistedit.obj & mmenu.obj mplayer.obj mutilities.obj mwidget.obj mwindow.obj rcfile.obj EXTRA_OBJ = getopt_long.obj all: $(AOUT) $(AOUT): $(OBJ) $(EXTRA_OBJ) wlink N $(AOUT) SYS OS2V2 OP q LIBR {$(LIBS)} F {$(OBJ) $(EXTRA_OBJ)} .c: ../src .c.obj: $(COMPILE) -fo=$^@ $< distclean: clean .symbolic rm -f $(AOUT) clean: .symbolic rm -f *.obj mikmod-3.2.9/os2/config.h0000644000000000000000000000230414607406616013635 0ustar rootroot/* config.h.in. Generated manually for OS/2. */ /* Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2). */ #define HAVE_MIKMOD_FREE 1 /* Define if your system has a working fnmatch function. */ #define HAVE_FNMATCH 1 /* Define if you have the mkstemp function. */ #define HAVE_MKSTEMP 1 /* Define if your system has random(3) and srandom(3) */ /* #undef HAVE_SRANDOM */ /* Define if your system has snprintf(3) */ #define HAVE_SNPRINTF 1 /* Define if you have the usleep function. */ /* #undef HAVE_USLEEP */ /* Define if you have the vsnprintf function. */ #define HAVE_VSNPRINTF 1 /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ #define HAVE_FNMATCH_H 1 /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define if you have the header file. */ #define HAVE_SYS_TIME_H 1 #ifdef __EMX__ /* Define if you have that is POSIX.1 compatible. */ #define HAVE_SYS_WAIT_H 1 /* Define if you have the header file. */ #define HAVE_UNISTD_H 1 #endif mikmod-3.2.9/os2/Makefile.emx0000644000000000000000000000734414607406654014462 0ustar rootroot#------------------------------------------------------------------------------# # Makefile for building MikMod player under GCC/EMX # This is a Makefile designed explicitly for GNU Make. # # Targets: # - all (default): build mikmod.exe # - depend: Rebuild dependencies (at the end of this file) # You should have makedep from Crystal Space project installed # - clean: Clean up all generated files #------------------------------------------------------------------------------# # Use CMD.EXE for launching commands SHELL=$(COMSPEC) # The tools CC = gcc -c CFLAGS = -O2 -Wall -funroll-loops -ffast-math -fno-strength-reduce -Zomf -Zmt CPPFLAGS = -DHAVE_CONFIG_H INCLUDE = -I. -I../src LD = gcc LDFLAGS = -s -Zomf -Zmt -Zcrtdll -L. -lmikmod3 # if linking against static libmikmod.a, mmpm2 is needed too (for drv_os2 and drv_dart.) LDFLAGS+= -lmmpm2 # Output directory OUT = out SRC = $(filter-out %mfnmatch.c %musleep.c,$(wildcard ../src/*.c)) OBJ = $(addprefix $(OUT)/,$(notdir $(SRC:.c=.o))) # Build rules $(OUT)/%.o: ../src/%.c $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE) -o $@ $< all: $(OUT) mikmod.exe depend: makedep -r -p $$(OUT)/ -DHAVE_CONFIG_H -D__EMX__ $(INCLUDE) $(SRC) clean: rm -rf $(OUT) mikmod.exe $(OUT): mkdir $@ mikmod.exe: $(OBJ) $(LD) -o $@ $^ $(LDFLAGS) # DO NOT DELETE this line - makedep uses it as a separator line $(OUT)/display.o: config.h ../src/display.h ../src/player.h ../src/mconfig.h \ ../src/rcfile.h ../src/mlist.h ../src/mutilities.h ../src/mwindow.h \ ../src/mconfedit.h ../src/mmenu.h ../src/keys.h ../src/mplayer.h \ ../src/mlistedit.h $(OUT)/marchive.o: config.h ../src/mlist.h ../src/marchive.h ../src/mconfig.h \ ../src/rcfile.h ../src/mutilities.h ../src/display.h $(OUT)/mconfedit.o: config.h ../src/rcfile.h ../src/mconfig.h \ ../src/mconfedit.h ../src/mmenu.h ../src/mwindow.h ../src/mlist.h \ ../src/mdialog.h ../src/mwidget.h ../src/mutilities.h $(OUT)/mconfig.o: config.h ../src/player.h ../src/mconfig.h ../src/rcfile.h \ ../src/mwindow.h ../src/mlist.h ../src/mutilities.h $(OUT)/mdialog.o: config.h ../src/mwidget.h ../src/mwindow.h ../src/mconfig.h \ ../src/rcfile.h ../src/mdialog.h ../src/display.h ../src/mutilities.h $(OUT)/mikmod.o: config.h ../src/getopt_long.h ../src/player.h ../src/mutilities.h \ ../src/display.h ../src/rcfile.h ../src/mconfig.h ../src/mlist.h \ ../src/mlistedit.h ../src/mmenu.h ../src/mwindow.h ../src/marchive.h \ ../src/mdialog.h ../src/mwidget.h ../src/mplayer.h ../src/keys.h $(OUT)/mlist.o: config.h ../src/mlist.h ../src/marchive.h ../src/mutilities.h $(OUT)/mlistedit.o: config.h ../src/mlistedit.h ../src/mmenu.h \ ../src/mwindow.h ../src/mconfig.h ../src/rcfile.h ../src/mlist.h \ ../src/player.h ../src/mdialog.h ../src/mwidget.h ../src/mconfedit.h \ ../src/marchive.h ../src/keys.h ../src/display.h ../src/mutilities.h $(OUT)/mmenu.o: config.h ../src/display.h ../src/mmenu.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mdialog.h ../src/mwidget.h \ ../src/keys.h ../src/mutilities.h $(OUT)/mplayer.o: config.h ../src/mplayer.h ../src/mthreads.h ../src/mconfig.h \ ../src/rcfile.h ../src/mutilities.h $(OUT)/mutilities.o: config.h ../src/player.h ../src/mlist.h ../src/marchive.h \ ../src/mutilities.h $(OUT)/mwidget.o: config.h ../src/display.h ../src/player.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mwidget.h ../src/keys.h \ ../src/mutilities.h $(OUT)/mwindow.o: config.h ../src/display.h ../src/player.h ../src/mwindow.h \ ../src/mconfig.h ../src/rcfile.h ../src/mutilities.h ../src/keys.h \ ../src/mthreads.h ../src/os2video.inc $(OUT)/rcfile.o: config.h ../src/rcfile.h ../src/mutilities.h $(OUT)/getopt_long.o: ../src/getopt_long.h mikmod-3.2.9/dos/0000755000000000000000000000000014734753426012307 5ustar rootrootmikmod-3.2.9/dos/Makefile.dj0000644000000000000000000000645514320756746014354 0ustar rootroot#------------------------------------------------------------------------------# # GNU Makefile for building MikMod under DOS/DJGPP # NOTE: Edit config.h, if necessary. #------------------------------------------------------------------------------# # Set to 1 for debug build DEBUG = 0 # The tools ifeq ($(CROSS),) CC=gcc AS=as else CC=$(CROSS)-gcc AS=$(CROSS)-as endif LD = $(CC) CFLAGS = -DHAVE_CONFIG_H $(INCLUDE) INCLUDE = -I. LDFLAGS = -L. -lmikmod ifeq ($(DEBUG),1) CFLAGS += -g -Wall else CFLAGS += -O2 -Wall -fomit-frame-pointer -ffast-math endif # Build rules %.o: ../src/%.c $(CC) -c $(CFLAGS) -o $@ $< SRC = $(filter-out %mfnmatch.c %musleep.c,$(wildcard ../src/*.c)) OBJ = $(notdir $(SRC:.c=.o)) all: mikmod.exe depend: makedep -r -DHAVE_CONFIG_H -D__DJGPP__ $(INCLUDE) $(SRC) -f Makefile.dj mikmod.exe: $(OBJ) $(LD) -o $@ $^ $(LDFLAGS) clean: rm -rf $(OBJ) mikmod.exe # DO NOT DELETE this line - makedep uses it as a separator line display.o: ../src/display.c config.h ../src/display.h ../src/player.h ../src/mconfig.h \ ../src/rcfile.h ../src/mlist.h ../src/mutilities.h ../src/mwindow.h ../src/mconfedit.h ../src/mmenu.h \ ../src/keys.h ../src/mplayer.h ../src/mlistedit.h marchive.o: ../src/marchive.c config.h ../src/mlist.h ../src/marchive.h \ ../src/mutilities.h ../src/display.h mconfedit.o: ../src/mconfedit.c config.h ../src/rcfile.h ../src/mconfig.h ../src/mconfedit.h \ ../src/mmenu.h ../src/mwindow.h ../src/mlist.h ../src/mdialog.h ../src/mwidget.h ../src/mutilities.h mconfig.o: ../src/mconfig.c config.h ../src/player.h ../src/mconfig.h ../src/rcfile.h ../src/mwindow.h \ ../src/mlist.h ../src/mutilities.h mdialog.o: ../src/mdialog.c config.h ../src/mwidget.h ../src/mwindow.h ../src/mconfig.h ../src/rcfile.h \ ../src/mdialog.h ../src/display.h ../src/mutilities.h mikmod.o: ../src/mikmod.c config.h ../src/getopt_long.h ../src/player.h ../src/mutilities.h ../src/display.h \ ../src/rcfile.h ../src/mconfig.h ../src/mlist.h ../src/mlistedit.h ../src/mmenu.h ../src/mwindow.h \ ../src/marchive.h ../src/mdialog.h ../src/mwidget.h ../src/mplayer.h ../src/keys.h mlist.o: ../src/mlist.c config.h ../src/mlist.h ../src/marchive.h \ ../src/mutilities.h mlistedit.o: ../src/mlistedit.c config.h ../src/mlistedit.h ../src/mmenu.h \ ../src/mwindow.h ../src/mconfig.h ../src/rcfile.h ../src/mlist.h ../src/player.h ../src/mdialog.h \ ../src/mwidget.h ../src/mconfedit.h ../src/marchive.h ../src/keys.h ../src/display.h ../src/mutilities.h mmenu.o: ../src/mmenu.c config.h ../src/display.h ../src/mmenu.h ../src/mwindow.h ../src/mconfig.h \ ../src/rcfile.h ../src/mdialog.h ../src/mwidget.h ../src/keys.h ../src/mutilities.h mplayer.o: ../src/mplayer.c config.h ../src/mplayer.h ../src/mthreads.h ../src/mconfig.h ../src/rcfile.h \ ../src/mutilities.h mutilities.o: ../src/mutilities.c config.h ../src/player.h ../src/mlist.h \ ../src/marchive.h ../src/mutilities.h mwidget.o: ../src/mwidget.c config.h ../src/display.h ../src/player.h ../src/mwindow.h ../src/mconfig.h \ ../src/rcfile.h ../src/mwidget.h ../src/keys.h ../src/mutilities.h mwindow.o: ../src/mwindow.c config.h ../src/display.h ../src/player.h ../src/mwindow.h ../src/mconfig.h \ ../src/rcfile.h ../src/mutilities.h ../src/keys.h ../src/mthreads.h ../src/dosvideo.inc rcfile.o: ../src/rcfile.c config.h ../src/rcfile.h getopt_long.o: ../src/getopt_long.h mikmod-3.2.9/dos/README0000644000000000000000000000556014037505106013157 0ustar rootroot Hello folks ! This is MikMod, version 3.2.9, a module player for DOS. Comments & feedback are welcome. >> BUILDING MIKMOD ------------------ - If you're not building libmikmod for DOS, then you're lost in the sources. Go up one directory, and read the main README file. This port has been designed to work only with DJGPP compiler. However, it should not be too complex to make it compile with any other compiler. If you manage to make libmikmod compile and work with another compiler, we'd like to hear from you. You'll likely have to write an appropiate makefile, or build things manually ... You should have pre-built libmikmod.a either in %DJGPP%/lib or in $(MIKMOD) (see Makefile) directory. Refer to the libmikmod source for instructions on how to build libmikmod under DOS. If you have all proper tools installed, just type make -f Makefile.dj You should end up with a MIKMOD.EXE binary in the current directory. >> USING MIKMOD --------------- Run MikMod with the ``--help'' parameter to get the available options. Program documentation is available as an Unix man page (..\src\mikmod.1) which you can read if you've got a port of the 'man' tool. Also, after you've run MikMod for the first time, you might want to customize your mikmod.cfg file, either from the configuration panel or by editing the file yourself, so you won't need to supply the same options to MikMod all the time. This file will be created in in C:\ Once you're in the player, pressing the H key will give you an help screen with the list of the keys you can use. I hope it's understandable. >> THANKS --------- We would like to thank everyone who contributed to libmikmod. Their names are in the AUTHORS file for the significative contributions, but some other names can be found in the NEWS file. Thanks a lot ! Keeping MikMod alive wouldn't be much fun without you. >> LICENSE ---------- The MikMod module player is covered by the GNU General Public License as published by the Free Software Fundation (you'll find it in the file COPYING) ; either version 2 of the licence, or (at your option) any later version. >> CONTACT AND DOWNLOAD INFO ---------------------------- MikMod and libmikmod home page is located at SourceForge: http://mikmod.sourceforge.net/ http://sourceforge.net/projects/mikmod/ There's a mailing list (mikmod-public) for discussing the development of MikMod (new features, bugs, ideas...) Look for more information on the web site. Things related to the DOS port should also be forwarded to the DOS ``portmaster'', Andrew Zabolotny, at: bit@eltech.ru >> LAST NOTES ------------- We hope you'll enjoy using this version of MikMod as well as we enjoyed debugging and improving it. -- Miodrag ("Miod") Vallat, 10/19/1999 miodrag@mikmod.darkorb.net Andrew Zabolotny bit@eltech.ru mikmod-3.2.9/dos/config.h0000644000000000000000000000241314607406616013720 0ustar rootroot/* config.h.in. Generated manually for DOS/DJGPP. */ /* Define if your libmikmod has MikMod_free (not found in <= 3.2.0-beta2). */ #define HAVE_MIKMOD_FREE 1 /* djgpp-v2.04 and newer provide snprintf() and vsnprintf(). * djgpp-v2.05 is already released, so let's enable them by * default here. */ /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 /* Define if your system has a working fnmatch function. */ #define HAVE_FNMATCH 1 /* Define if you have the mkstemp function. */ #define HAVE_MKSTEMP 1 /* Define if your system has random(3) and srandom(3) */ #if defined(__DJGPP__) #define HAVE_SRANDOM 1 #endif /* Define if you have the usleep function. */ #define HAVE_USLEEP 1 /* Define if your system has the prototype for usleep(3). */ #define HAVE_USLEEP_PROTO /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ #define HAVE_FNMATCH_H 1 /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define if you have the header file. */ #define HAVE_UNISTD_H 1 mikmod-3.2.9/NEWS0000644000000000000000000004421714734653272012227 0ustar rootrootSummary of changes between MikMod 3.2.8 and MikMod 3.2.9: ================================================================== MikMod 3.2.9 was released on Dec. 31, 2024. - Avoid possible undefined behavior in display code if the songname is NULL (github bug #67.) - Fixed a startup crash with _FORTIFY_SOURCE=3 on some systems. - Fixed warnings from new gcc versions. - Fixed a stack size issue in os2 builds. - Multiple other cleanups throughout the code. - Several build and portability fixes/updates. - Removed support for lcc-win32 compiler. Summary of changes between MikMod 3.2.7 and MikMod 3.2.8: ================================================================== MikMod 3.2.8 was released on June 14, 2017. - Fixed several warnings from clang static analyzer. - Fixed a misleading indentation warning from gcc6. - A few minor OS/2 fixes. - Support for building the Windows version using Open Watcom compiler. - Other minor fix/tidy-ups. Summary of changes between MikMod 3.2.6 and MikMod 3.2.7: ================================================================== MikMod 3.2.7 was released on 15-Nov-2015. - Documentation update. - Update DOS build for the new djgpp-2.05 release. Summary of changes between MikMod 3.2.5 and MikMod 3.2.6: ================================================================== MikMod 3.2.6 was released on 31-Aug-2014. - Fix curses linkage on some setups. (add -ltinfo if necessary.) - Windows version now relies on %USERPROFILE% instead of %HOME% for its config and playlist. - The dos version doesn't check %HOME% anymore and simply uses C: for its config and playlist. - Support for AmigaOS and its variants like MorphOS, AROS. (thanks to Szilard Biro for lots of help.) - Build system configuration and packaging simplifications, tidy-ups. - Configury: fix link tests for older binutils. - Cmake updates and improvements. Several makefile clean-ups. - Several portability tweaks. - Fix some OS/2 bit rot. (for nostalgia...) - Removed ancient convert_playlist script which used to supposed to convert pre-ancient mikmod playlists. Documentation updates. Summary of changes between MikMod 3.2.4 and MikMod 3.2.5: ================================================================== MikMod 3.2.5 was released on 10-Jan-2014. - New CMake build system. - Small autotols updates. - Fix configury $datadir variable expansion in PACKAGE_DATA_DIR. - Fix ALSA driver options menu for libmikmod2 versions >= 3.1.13. - Fix compilation against ancient libmikmod1 versions <= 3.1.6. - Several code clean-ups. Summary of changes between MikMod 3.2.3 and MikMod 3.2.4: ================================================================== MikMod 3.2.4 was released on 14/Oct/2013. This is a minor bug fix/maintenance release. - Addressed some snprintf issues and MSVC6 compilation issues. - New MSVC6 and VS2005 project files. The latter imports into newer Visual Studio versions, e.g. VS2012. - Use MikMod_free() on the string returned by Player_LoadTitle() if it is available. - Fixed some compiler warnings, minor cleanups. Summary of changes between MikMod 3.2.2 and MikMod 3.2.3: ================================================================== MikMod 3.2.3 was released on 05/Oct/2013. This is a maintenance release to fix minor bugs since mikmod-3.2.2 BUGFIXES - Made MikMod compilable against older versions of libmikmod without MikMod_Free(). - Fixed a minor buffer overrun (sf.net bug #2). - Fixed a minor string format issue. - Updated configury to support latest autotools. - Fixed djgpp builds. - Fixed windows mingw builds, proper win64 support. Summary of changes between MikMod 3.1.6 and MikMod 3.2.2 (Vitray): ================================================================== MikMod 3.2.2 was released on 23/Jun/2012 beta1: Mon Feb 2, 2004 beta0: never officially released THANKS - The winner of the ``it's rainy day, so I'll rewrite MikMod'' contest this time is Andrew Zabolotny. The colored MikMod looks great ! Thanks a lot ! - To Frank Loemker, who has done many changes since the last release in 1999, has improved the widget system a lot, added a file selector, theme support, improved the configuration routines, recursive directory scanning, made the player and library run in a separate thread, added win32 support (with lcc), fixed problems with DJGPP, and fixed a lot of small bugs. (please note that some of theses changes may have been done by Andrew Zabolotny. Frank Loemker sent me a big patch so I cannot know for sure who did what). NEW FEATURES - On terminals that support it, colors. There is a built-in theme editor in the configuration panel. Themes are loaded and saved from the config file. Set the environment variable TERM to mono to disable this under OS/2 and DOS. - Mikmod will now display it's version and the song name or filename currently being played in the terminal title bar. On unix, there is support for xterm compatible title setting (rxvt, Eterm, aixterm, dtterm...), and a few others (iris-ansi, hpterm). It is also supported under win32. - If using libmikmod 3.2, sample and instrument panels are dynamic, displaying which samples/instruments are currently played, and a volume panel displays volume bars and instruments/samples numbers. - A file selector for the load/insert/save operations: - Marks files which are in the actual playlist. - Includes the possibility to add/remove any number of entries to/from the playlist. - Directories can be changed with cursor keys and with an input line. - Editable hotlist allows quick switching to preferred directories. - Recursive directory scanning if "Add" or "Toggle" is used if a directory is selected. - Recursive directory scanning at startup with the option "-y, -di[rectory] dir Scan directory recursively for modules". - Threaded player (that is an own thread for MikMod_Update()), is switched off at compile time if the system supports no threads and at run tmie if libmikmod does not support threads. - Better archive support - Support for archivers which need short file names - The definition of archivers is loaded from the config file. - Many other improvements. - Of course, many bug fixes and clean ups. PLATFORM SPECIFIC - DOS is a supported platform again. - Can be compiled on WIN32 with lcc - Fixes for DJGPP - the MIKMOD_SRAND_CONSTANT environment variable can be used to set the srandom() seed on UNIX platforms. Its primary intent is to assist in testing - see https://bitbucket.org/shlomif/mikmod-test-suite . Summary of changes between MikMod 3.2.0 and MikMod 3.2.1: ================================================================ MikMod 3.2.1 was released on 07/10/2003 BUGFIXES - Enable/disable color gui should have appeared in configuration dialog, and On exit sub-menu in other options did not appear. NEW FEATURES - If a supported terminal is detected int the $TERM env var, MikMod will set the title bar with -= MikMod x.x.x =- followed by the song title between (). There is a configuration option for this in config->other_options Summary of changes between MikMod 3.1.6 and MikMod 3.2.0: ================================================================ MikMod 3.2.0 was released on 04/10/2003 THANKS - Info Saitz , the debian MikMod package maintainer for many bug fixes. BUGFIXES - Bugfixes from the debian MikMod package + cleaned up the documentation to match the output of the manpage, mikmod --help and the actual option processing. + Security fix when dealing with archives + Won't play LHA-compressed MODs with spaces in their names + Support for files with the extension prepended to the filename. Pretty common on Aminet. Maybe an Amiga convention? + Installed new versions of configure.{guess.sub} to support compiling on newer arches. They are taken from autotools-dev 20030110.1. NEW FEATURES - Color ncurse interface, and Option to enable/disable it. - Option to quit MikMod automatically when the playlist is finished. Summary of changes between MikMod 3.1.5 and MikMod 3.1.6 (Riom): ================================================================ MikMod 3.1.6 was released on 07/05/1999. THANKS - As usual, Frank Loemker contributed lots of stuff to the player. Thanks for your work. BUGFIXES - MikMod segfaulted when run as root (there was a public patch to 3.1.5 for this). - The mono/stereo setting in the -output option was ignored. - The frequency range was restricted to 8kHz-44.1kHz without reason. - Loading playlist not located in the current directory should work now. NEW FEATURES - Interface is even more featured: * On-screen configuration panel. * Playlist sorting, loading files or playlists from the player. - Added a restart module (R key) feature. REMOVED FEATURES - Support for the ARJ archiver has been dropped, as unarj needed an 'extra to stdout' extra feature, and the URL of the patch gave me an error 404 recently... Besides, ARJ isn't widely used in the Unix world (perhaps because we don't like plagiarism...) PLATFORM SPECIFIC - Fixed a compilation problem on HP-UX systems lacking ncurses (HP-UX curses doesn't define KEY_END). Summary of changes between MikMod 3.1.2 and MikMod 3.1.5 (Pradelles): ===================================================================== MikMod 3.1.5 was released on 03/01/1999. Starting from this version, the engine (libmikmod) and the module player (MikMod) are made separate, to make the life easier for people who use libmikmod and don't need the player. THANKS - The player was nearly completely rewritten by Frank Loemker. Nice job ! BUGFIXES - If the player is interrupted while loading a compressed file, a temporary file was not removed. - Dealing with archives containing a lot of files hanged the player at start (under Unix only). - When playing from a playlist, the last file of the playlist was played twice. NEW FEATURES - Player now displays which information panels are available, and should look better with less than 80 character wide terminals. - Bzip2 compressed modules, as well as tar and compressed tar archives, are recognized. - MikMod now stores your default settings in $HOME/.mikmodrc, so you don't have to specify a butch of options each time you invoke MikMod. Summary of changes between MikMod 3.1.1 and MikMod 3.1.2 (Monistrol): ===================================================================== MikMod 3.1.2 was released on 12/07/1998. THANKS - For this version, the special thanks distinction is awarded to Michal Svec, Thomas Sailer and Winfried Scheibe. You guys rule ! And as usual, thanks to all the people who submitted bug reports and helped me to get rid of'em. BUG FIXES - Due to an inverted test, the DSM loader rejected every valid DSM module. - Surround panning was misunderstood by the DSM loader. - FAR modules with more than 64 notes per pattern were incorrectly rejected. - report whether an IT module was compressed or not wasn't accurate. - STM identification test was broken and didn't reject some incorrect modules. - A few glitches in the pattern break and pattern jump effect have been fixed (thanks to Firelight for his "Backwards" module which showed the problem !) - The OSS driver had a serious memory allocation bug which could cause systematic coredumps, depending on your hardware and your environment variable settings. - Archive support didn't work correctly with some versions of lharc (1.01, 1.14c+) and unzip (5.40+), hopefully they should work now. NEW FEATURES - Support for rar archives has been added. The player looks for 'unrar' to display and extract the archives ; don't forget to put a symbolic link if you only have rar. PLATFORM SPECIFIC - The Sun audio driver didn't work correctly at 44100 Hz 16 bit stereo under Solaris, due to an incorrect default buffer size. - The generated Makefiles for Watcom C++ under OS/2 were incorrect. - When compiling with emx under OS/2, the optimization level was set too high and caused incorrect playback for some modules. MISC - I've found more DSM information to throw in the documentation. Summary of changes between MikMod 3.1 and MikMod 3.1.1 (Landos): ================================================================ MikMod 3.1.1 was released on 12/02/1998. This version contains only bugfixes and was released shortly after 3.1 because of a really annoying bug in the error messages. THANKS - Special thanks to Scott Miller for his help in tracking a nasty bug. And as usual, thanks to all the people who submitted bug reports and helped me to get rid of'em. BUG FIXES - Due to a missing coma, most error message texts didn't correspond to what was really happening. - MikMod 3.1 was too strict regarding the S3M speed effect and did not allow >32 speeds. - The 15 instrument MOD loader has been made more robust by recognizing and some non module filetypes which could be misunderstood as valid modules and caused coredumps. - IT effects S5x (set panbrello waveform), S7x (instrument/NNA commands) and SAx (set sample offset high part) were not processed correctly. - Modules written by Impulse Tracker 2.14p3 in the uncompressed Impulse 2 format could be rejected (detection routine had to be modified to cope with an IT2.14p3 save bug...) PLATFORM SPECIFIC - A bug in the configure script prevented MikMod from compiling correctly under IRIX, AIX and perhaps some other Unices. - Another bug in the configure script caused the detection of esd_close() in libesd to always return true. - The README.OS2 file was missing in 3.1 Summary of changes between MikMod 3.0.4 and MikMod 3.1 (Davayat): ================================================================= MikMod 3.1 was released on 11/30/1998. THANKS - Many thanks to Bjornar Henden, Steve Martin, "MenTaLguY", Sebastiaan Megens and Thomas Neumann for their precise bug reports and bug fixes. Also thanks to all the people who submitted bug reports and helped me to make MikMod better. Thanks, guys ! BUG FIXES - Panning overflows which resulted in extra noises of high volume )-: are now fixed. - Surround mixer fixed. - 669 pitch slides are rendered correctly now (used logarithmic periods before). - FAR modules now play at correct speed, and more effects implemented. - IT pitch envelope now works correctly. - IT effect G (porta to note) misbehaviour when changing instrument on the same row, or after a note cut, fixed. - IT volume column effect G was misunderstood (G0 was treated as G1, G1 as G2 etc). - Lots of bug fixes in MED loader. Should now play modules at correct speed, but still not perfect. - Some notes were not played in MODs. - Some effect fixes in ULT loader. - The S3M volume slides were not rendered correctly. - XM modules with more than 256 samples caused systematic coredumps when trying to load them. - XM effect G (set global volume) was misinterpreted, resulting in halved volumes during playback. NEW FEATURES - MikMod now plays DMP's AMF files. - A "curious" option has been added to look for extra patterns in MODs, S3Ms and ITs (useful for some Skaven's modules). - MikMod now uses autoconf for building, and you can build a shared MikMod library. - Programmer's documentation in texinfo format, suitable for online browsing (with GNU info) as well as printing. API function names made more consistant and more thematic. PLATFORM SPECIFIC - New driver for the Advanced Linux Sound Architecture (ALSA). - The EsounD driver has been improved and will attempt daemon reconnection on a regular time basis, should the esd been killed. - The SGI driver caused coredumps on some machines ; hopefully this is now fixed. - integrated OS/2 support, with a new DART driver for use under Warp 4 and CPU snagger feature. MISC - I was asked to put a copyright notice in MikMod. Although I don't like that, it seems that there has to be one to be sure the GPL and LGPL apply correctly. I really hate copyrighting free software I haven't entirely written... - I've also shaved my beard the day before this release. Nice to see there was still skin under the thick beard (-: Summary of changes between MikMod 3.0.3 and MikMod 3.0.4 (Combronde): ===================================================================== MikMod 3.0.4 was released on 09/21/1998. BUG FIXES - FAR, STM and ULT loader are fixed and work (at least for me...) - Imbricated loops won't block the player. - Updated all the old drivers to work with MikMod 3 interface. - Nosound driver now works. - 669 modules are now played at correct speed. - MED loader pattern size bug fixed. - MOD sample offsets (in file) computation fixed. - S3M with more than 16 channels (i.e not created with Scream Tracker) caused previous version to coredump, but worked in 2.* - End of song marker is now recognized in S3M and IT when it appears inside the pattern list. - It was possible to register the same loader or driver twice and this made the library hang. - Speed and Tempo can't escape their bounds (1-31 for speed, 32-255 for tempo) now. - Delay note effect did not work correctly in previous version, but did in 2.* - All divide by zero conditions are prevented. - Archive code forgot to erase its temporary file (and had too short buffers). - More accurate error messages in player. NEW FEATURES - Compressed IT samples are now supported. - If you use ncurses >= 4.0, MikMod is resize-aware and will continue to display correctly in an xterm. - New driver for the Enlightened sound daemon (http://www.tux.org/~ricdude/EsounD.html) - New "volume fadeout" option. - New "don't loop" option. - Help screen in the curses player. - Module time is displayed in the player. - MikMod 2 banners are back. - Randomized playlist can now be walked through correctly. REMOVED FEATURES - The Unimod format is not supported anymore (nobody used it, right ?). The MikCvt utility has been withdrawn, too. Both will be put back on request if someone really need them. Just ask ! PLATFORM SPECIFIC - OpenBSD support, although in mono 8bit 8000 Hz only, but that's a start. - Merged NetBSD and FreeBSD specific patches from their "ports collection". - Player works with old AIX curses, as well as with old HP-UX curses. MISC - Rewritten building mechanism. It's not yet Autoconf, but it's coming... - License terms are clear : LGPL for the library, GPL for the player. mikmod-3.2.9/Makefile.am0000644000000000000000000000032712350764324013547 0ustar rootrootAUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src pkgdata_DATA = mikmodrc EXTRA_DIST = mikmod.lsm mikmod.cfg $(pkgdata_DATA) \ dos os2 macosx win32 \ config.h.cmake CMakeLists.txt cmake mikmod-3.2.9/COPYING0000644000000000000000000004325412255302430012542 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. mikmod-3.2.9/INSTALL0000644000000000000000000000303614717245136012550 0ustar rootrootINSTALL file for mikmod ======================= COMPILE USING CMAKE : ===================== Mikmod versions 3.2.5 and newer support CMake. CMake version 3.1.0 or later is required. CMake homepage is at http://www.cmake.org/ . Run: mkdir build cd build cmake-gui .. # For the GUI configuration applet Or: mkdir build cd build ccmake .. # For the Curses-based configuration applet With a fallback to: mkdir build cd build cmake .. # Non-interactive application. You need libmikmod compiled and installed on your system. For installing under windows, consult the CMake documentation for generating a Visual C, MinGW, etc. compatible makefile or project. COMPILE USING CONFIGURE / AUTOTOOLS : ===================================== In most systems just run: $ ./configure $ make You need GNU make. On BSD or SysV systems, you may need to use gmake instead of make. Use ./configure --help to see configuration options. You need libmikmod compiled and installed on your system. To install mikmod, run "make install" as the superuser. To cross-compile, you will need to use the --host option of configury. For example: $ ./configure --host=powerpc-apple-darwin9 # for Mac OS X (powerpc) $ ./configure --host=i686-pc-mingw32 # for Windows (win32) $ ./configure --host=x86_64-w64-mingw32 # for Windows (win64) We also provide standalone makefiles for Windows, Mac OS X, DJGPP (DOS) which you can use for both compiling on the relevant native system, or for cross-compiling. mikmod-3.2.9/aclocal.m40000644000000000000000000012600714734750516013365 0ustar rootroot# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ax_recursive_eval.m4]) m4_include([m4/libmikmod.m4]) mikmod-3.2.9/AUTHORS0000644000000000000000000000445612506451324012566 0ustar rootrootMikMod main authors ------------------- * Jean-Paul Mikkers (MikMak) wrote MikMod and maintained it until version 3. * Jake Stine (Air Richter) [email doesn't work anymore...] made decisive contributions to the code (esp. IT support) and maintained MikMod version 3 until it was discontinued. * Frank Loemker rewrote nearly all the player, adding lots of features (independent panels, windowing system, playlist editor, better archive support, etc). * Andrew Zabolotny ported to DOS, added color support, volume panel, dynamic panels. Unix maintainers --------------- * Ozkan Sezer Took over the baton from Shlomi in 2013. (current maintainer.) * Shlomi Fish, http://www.shlomifish.org/ Revived the project after many years of inactivity, in 2012. * Steve McIntyre maintained MikMod'Unix version 2, and wrote the curses interface and the archive support. * Peter Amstutz maintained MikMod'Unix version 3.0, and wrote the playlist support. * Miodrag Vallat Maintained and developed MikMod from version 3.0.4 up to version 3.1.6, made an audit of the code resulting in many bugs fixed. * Raphael Assenat Initially added color to Mikmod 3.1.6, thus releasing version 3.2.0. Using patches contributed by Frank Loemker, has finally released MikMod 3.2.2, which contains many changes and improvements that had been made since version 3.1.6 but never officially released. Revived the project in 2003, and passed the baton to Shlomi Fish in 2012. Contributors on the Unix side ----------------------------- * "MenTaLguY" autoconfized the Unix MikMod distribution. Contributors on other platforms ------------------------------- * Anders Bjoerklund ported MikMod 3 to the Macintosh. * Dimitri Boldyrev ported MikMod 2 to the Macintosh. * Shlomi Fish, http://www.shlomifish.org/ ported MikMod to Java, and contributed bug fixes. * Stefan Tibus ported MikMod to OS/2. * Tinic Urou <5uro@informatik.uni-hamburg.de> ported MikMod 2 to BeOS. -- If your name is missing, don't hesitate to remind the current maintainer. mikmod-3.2.9/src/0000755000000000000000000000000014734753426012311 5ustar rootrootmikmod-3.2.9/src/mwidget.c0000644000000000000000000010751013157652006014107 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mwidget.c,v 1.1.1.1 2004/01/16 02:07:33 raph Exp $ Widget and Dialog creation functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "display.h" #include "player.h" #include "mwindow.h" #include "mwidget.h" #include "keys.h" #include "mutilities.h" #define STR_WIDTH_MAX 70 #define STR_WIDTH_MIN 20 #define INT_WIDTH_MAX 11 #define LIST_WIDTH_DEFAULT 60 #define LIST_WIDTH_MIN 15 #define LIST_HEIGHT_DEFAULT 20 #define LIST_HEIGHT_MIN 5 #define WWIN(w) ((w)->w.d->win) static ATTRS base_attr (DIALOG *d, ATTRS attrs) { if (d->attrs >= 0) return d->attrs; return attrs; } static void label_free(WID_LABEL *w) { free(w->msg); free(w); } static void label_paint(WID_LABEL *w) { char *start, *pos; int y = w->w.y; win_attrset(base_attr(w->w.d,ATTR_DLG_LABEL)); start = w->msg; for (pos = w->msg; *pos; pos++) { if (*pos == '\n') { *pos = '\0'; win_print(WWIN(w),w->w.x, y, start); *pos = '\n'; start = pos + 1; y++; } } win_print(WWIN(w),w->w.x, y, start); } static int label_handle_event(WID_LABEL *w, WID_EVENT event, int ch) { return 0; } static void label_get_size(WID_LABEL *w, int *width, int *height) { char *pos; int x = 0; *width = 0; *height = 0; for (pos = w->msg; *pos; pos++) { if (*pos == '\n') { (*height)++; if (x > *width) *width = x; x = -1; } x++; } if (x > *width) *width = x; (*height)++; } static void str_free(WID_STR *w) { free(w->input); free(w); } static void str_paint(WID_STR *w) { char hl[2] = " ", ch = ' ', *pos = &w->input[w->start]; int dx = 0, len; win_attrset(ATTR_DLG_STR_TEXT); if (w->w.has_focus) { hl[0] = ch = w->input[w->cur_pos]; if (!hl[0]) hl[0] = ' '; w->input[w->cur_pos] = '\0'; if (*pos) win_print(WWIN(w),w->w.x, w->w.y, pos); dx = strlen(pos); win_attrset(ATTR_DLG_STR_CURSOR); win_print(WWIN(w),w->w.x + dx, w->w.y, hl); win_attrset(ATTR_DLG_STR_TEXT); pos += dx; dx++; *pos = ch; if (*pos) pos++; } len = strlen(pos); if (len + dx > w->w.width) { ch = w->input[w->w.width + w->start]; w->input[w->w.width + w->start] = '\0'; } win_print(WWIN(w),w->w.x + dx, w->w.y, pos); if (len + dx > w->w.width) w->input[w->w.width + w->start] = ch; else if (len + dx < w->w.width) { dx += len; for (len = 0; len < w->w.width - dx; len++) storage[len] = ' '; storage[len] = '\0'; win_print(WWIN(w),w->w.x + dx, w->w.y, storage); } } static int handle_focus(WIDGET *w, int ret, int from_activate) { if (ret && (ret != EVENT_HANDLED) && w->handle_focus) { return w->handle_focus((WIDGET *) w, ret); } else { if (ret == FOCUS_ACTIVATE) { ret = from_activate; if (ret == EVENT_HANDLED) dialog_close(w->d); } return ret; } } static int input_handle_event(WID_STR *w, WID_EVENT event, int ch, BOOL int_input) { char *pos; int i; if (event == WID_HOTKEY) return 0; if (event == WID_GET_FOCUS) return EVENT_HANDLED; if ((event == WID_KEY) && w->w.handle_key) { i = w->w.handle_key((WIDGET *) w, ch); if (i) return i; } switch (ch) { case KEY_UP: return handle_focus((WIDGET*)w, FOCUS_PREV, 0); case KEY_TAB: case KEY_DOWN: return handle_focus((WIDGET*)w, FOCUS_NEXT, 0); case KEY_LEFT: case CTRL_B: if (w->cur_pos > 0) w->cur_pos--; break; case KEY_RIGHT: case CTRL_F: if (w->cur_pos < strlen(w->input)) w->cur_pos++; break; case KEY_HOME: case KEY_PPAGE: case CTRL_A: w->cur_pos = 0; break; #ifdef KEY_END case KEY_END: #endif case KEY_NPAGE: case CTRL_E: w->cur_pos = strlen(w->input); break; case CTRL_K: w->input[w->cur_pos] = '\0'; break; case CTRL_U: w->cur_pos = 0; w->input[w->cur_pos] = '\0'; break; case KEY_DC: case CTRL_D: #ifdef KEY_ASCII_DEL case KEY_ASCII_DEL: #endif if (w->cur_pos < strlen(w->input)) for (pos = &w->input[w->cur_pos]; *pos; pos++) *pos = *(pos + 1); break; case KEY_BACKSPACE: #ifdef KEY_ASCII_BS case KEY_ASCII_BS: #endif if (w->cur_pos > 0) { for (pos = &w->input[w->cur_pos - 1]; *pos; pos++) *pos = *(pos + 1); w->cur_pos--; } break; case KEY_ENTER: case '\r': return handle_focus((WIDGET*)w, FOCUS_ACTIVATE, FOCUS_NEXT); default: if (ch >= 256 || ch < ' ') return 0; if ((int_input && isdigit(ch)) || !int_input) { i = strlen(w->input); if (i < w->length) { for (; i >= w->cur_pos; i--) w->input[i + 1] = w->input[i]; w->input[w->cur_pos] = ch; w->cur_pos++; } } } if (w->cur_pos < w->start) w->start = w->cur_pos; if (w->cur_pos >= w->start + w->w.width) w->start = w->cur_pos - w->w.width + 1; str_paint(w); return EVENT_HANDLED; } static int str_handle_event(WID_STR *w, WID_EVENT event, int ch) { return input_handle_event(w, event, ch, 0); } static void str_get_size(WID_STR *w, int *width, int *height) { if (*width > w->w.def_width) *width = w->w.def_width; if (*width > w->length) *width = w->length + 1; if (*width < STR_WIDTH_MIN) *width = STR_WIDTH_MIN; w->start = w->cur_pos - *width + 1; if (w->start < 0) w->start = 0; *height = 1; } static void int_free(WID_INT *w) { free(w->input); free(w); } static void int_paint(WID_INT *w) { str_paint((WID_STR *) w); } static BOOL int_handle_event(WID_INT *w, WID_EVENT event, int ch) { return input_handle_event((WID_STR *) w, event, ch, 1); } static void int_get_size(WID_INT *w, int *width, int *height) { *width = w->w.def_width; *height = 1; } static void button_free(WID_BUTTON *w) { free(w->button); free(w); } static void button_paint(WID_BUTTON *w) { int cur, x, cnt_hl = 0; char *pos, *hl_pos, *start, hl[2]; BOOL end; for (pos = w->button; *pos; pos++) if (*pos == '&') cnt_hl++; x = (w->w.d->win->width - 1 - w->w.x - ((int)strlen(w->button) + 5 * w->cnt - 1 - cnt_hl)) / 2; cur = 0; hl_pos = NULL; hl[1] = '\0'; start = w->button; end = 0; for (pos = w->button; !end; pos++) { end = !(*pos); if ((*pos == '|') || (*pos == '\0')) { *pos = '\0'; if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_INACTIVE); else win_attrset(ATTR_DLG_BUT_ACTIVE); win_print(WWIN(w),w->w.x + x, w->w.y, "[ "); if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_ITEXT); else win_attrset(ATTR_DLG_BUT_ATEXT); win_print(WWIN(w),w->w.x + x + 2, w->w.y, start); x += strlen(start) + 2; if (hl_pos) { if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_IHOTKEY); else win_attrset(ATTR_DLG_BUT_AHOTKEY); win_print(WWIN(w),w->w.x + x, w->w.y, hl); if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_ITEXT); else win_attrset(ATTR_DLG_BUT_ATEXT); win_print(WWIN(w),w->w.x + x + 1, w->w.y, hl_pos); *(hl_pos - 2) = '&'; x += strlen(hl_pos) + 1; hl_pos = NULL; } if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_INACTIVE); else win_attrset(ATTR_DLG_BUT_ACTIVE); win_print(WWIN(w),w->w.x + x, w->w.y, " ]"); x += 4; *pos = '|'; start = pos + 1; cur++; } if (*pos == '&') { *pos = '\0'; pos++; hl_pos = pos + 1; hl[0] = *pos; } } *(pos-1) = '\0'; } static BOOL button_handle_event(WID_BUTTON *w, WID_EVENT event, int ch) { int cur; char *pos; if (event == WID_GET_FOCUS) { if (ch < 0) w->active = w->cnt - 1; else w->active = 0; return EVENT_HANDLED; } if ((event == WID_KEY) && (w->w.handle_key)) { cur = w->w.handle_key((WIDGET *) w, ch); if (cur) return cur; } if ((ch < 256) && (isalpha(ch))) ch = toupper(ch); switch (ch) { case KEY_UP: case KEY_LEFT: if (event == WID_KEY) { w->active--; if (w->active < 0) return handle_focus ((WIDGET*)w, FOCUS_PREV, 0); button_paint(w); } break; case KEY_DOWN: case KEY_RIGHT: case KEY_TAB: if (event == WID_KEY) { w->active++; if (w->active >= w->cnt) return handle_focus ((WIDGET*)w, FOCUS_NEXT, 0); button_paint(w); } break; case KEY_ENTER: case '\r': if (event == WID_KEY) return handle_focus ((WIDGET*)w, FOCUS_ACTIVATE, EVENT_HANDLED); break; default: cur = 0; for (pos = w->button; *pos; pos++) { if (*pos == '|') cur++; if (*pos == '&' && (toupper((int)*(pos+1)) == ch)) { w->active = cur; button_paint(w); return handle_focus ((WIDGET*)w, FOCUS_ACTIVATE, EVENT_HANDLED); } } return 0; } return EVENT_HANDLED; } static void button_get_size(WID_BUTTON *w, int *width, int *height) { char *pos; int hl_cnt = 0; w->cnt = 1; for (pos = w->button; *pos; pos++) { if (*pos == '&') hl_cnt++; if (*pos == '|') w->cnt++; } *width = strlen(w->button) + 5 * w->cnt - 1 - hl_cnt; *height = 1; } static void list_free(WID_LIST *w) { int i; for (i=0; icnt; i++) free (w->entries[i]); free (w->entries); if (w->title) free (w->title); free (w); } static void list_paint(WID_LIST *w) { int i,x,visible; char ch; x = w->w.x+w->w.width-1; visible = w->w.height-2; win_attrset(base_attr(w->w.d,ATTR_DLG_FRAME)); win_box (WWIN(w),w->w.x, w->w.y, x, w->w.y+w->w.height-1); if (w->title) { if (strlen(w->title) > w->w.width-2) { ch = w->title[w->w.width-2]; w->title[w->w.width-2] = '\0'; win_print (WWIN(w),w->w.x+1, w->w.y, w->title); w->title[w->w.width-2] = ch; } else win_print (WWIN(w),w->w.x+1, w->w.y, w->title); } if (w->first > 0) win_print (WWIN(w),x, w->w.y+1, "^"); else win_print (WWIN(w),x, w->w.y+1, "-"); if (w->first+visible < w->cnt) win_print (WWIN(w),x, w->w.y+w->w.height-2, "v"); else win_print (WWIN(w),x, w->w.y+w->w.height-2, "-"); if (visible>2) { i = 0; if (w->cnt > 1) i = w->cur*(visible-3)/(w->cnt-1); win_print (WWIN(w),x, w->w.y+i+2, "*"); } for (i=w->first; ifirst; i++) { storage[0] = '\0'; if (i == w->cur) { if (w->w.has_focus) win_attrset(ATTR_DLG_LIST_FOCUS); else win_attrset(ATTR_DLG_LIST_NOFOCUS); } else win_attrset(base_attr(w->w.d,ATTR_DLG_FRAME)); if (i < w->cnt) { strncpy (storage,w->entries[i],w->w.width-2); storage[w->w.width-2] = '\0'; } for (x=strlen(storage); xw.width-2; x++) storage[x] = ' '; storage[w->w.width-2] = '\0'; win_print (WWIN(w),w->w.x+1, w->w.y+i-w->first+1, storage); } } static int list_handle_event(WID_LIST *w, WID_EVENT event, int ch) { int i, old_cur; if (event == WID_HOTKEY) return 0; if (event == WID_GET_FOCUS) return EVENT_HANDLED; if ((event == WID_KEY) && w->w.handle_key) { i = w->w.handle_key((WIDGET *) w, ch); if (i) return i; } old_cur = w->cur; switch (ch) { case KEY_UP: if (w->cur>0) w->cur--; break; case KEY_DOWN: if (w->curcnt-1) w->cur++; break; case KEY_PPAGE: w->cur -= w->w.height-3; if (w->cur<0) w->cur = 0; break; case KEY_NPAGE: w->cur += w->w.height-3; if (w->cur>=w->cnt) w->cur = w->cnt>0 ? w->cnt-1 : 0; break; case KEY_HOME: w->cur = 0; break; #ifdef KEY_END case KEY_END: w->cur = w->cnt-1; break; #endif case KEY_LEFT: return handle_focus((WIDGET*)w, FOCUS_PREV, 0); case KEY_RIGHT: case KEY_TAB: return handle_focus((WIDGET*)w, FOCUS_NEXT, 0); case KEY_ENTER: case '\r': return handle_focus((WIDGET*)w, FOCUS_ACTIVATE, FOCUS_ACTIVATE); default: return 0; } if (w->cur < w->first) w->first = w->cur; if (w->cur >= w->first + w->w.height-2) w->first = w->cur - w->w.height + 3; list_paint(w); if (w->sel_mode == WID_SEL_BROWSE && old_cur != w->cur) return handle_focus((WIDGET*)w, FOCUS_ACTIVATE, FOCUS_ACTIVATE); return EVENT_HANDLED; } static void list_get_size(WID_LIST *w, int *width, int *height) { if (*width > w->w.def_width) *width = w->w.def_width; if (*width < LIST_WIDTH_MIN) *width = LIST_WIDTH_MIN; if (*height > w->w.def_height) *height = w->w.def_height; if (*height < LIST_HEIGHT_MIN) *height = LIST_HEIGHT_MIN; } static void check_toggle_paint(WID_CHECK *w, BOOL toggle) { char *start, *pos, *hl_pos, hl[2], end; char marker[] = " x", help[STORAGELEN]; int cur = 0, x, xx; hl_pos = NULL; hl[1] = '\0'; if (toggle) strcpy (help,"[ ] "); else { strcpy (help,"( ) "); marker[1] = '*'; } help[w->w.width] = '\0'; start = w->button; pos = w->button-1; do { pos++; if ((*pos == '|') || (*pos == '\0')) { end = *pos; *pos = '\0'; if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_ITEXT); else win_attrset(ATTR_DLG_BUT_ATEXT); help[1] = marker[BTST(w->selected,1<w.x, w->w.y+cur, help); if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_IHOTKEY); else win_attrset(ATTR_DLG_BUT_AHOTKEY); win_print(WWIN(w),w->w.x + x, w->w.y+cur, hl); x++; if ((w->active != cur) || (!w->w.has_focus)) win_attrset(ATTR_DLG_BUT_ITEXT); else win_attrset(ATTR_DLG_BUT_ATEXT); strcpy (&help[x],hl_pos); xx = x+strlen(hl_pos); if (xx != w->w.width) memset (&help[xx],' ',w->w.width-xx); win_print(WWIN(w),w->w.x + x, w->w.y+cur, &help[x]); *(hl_pos - 2) = '&'; hl_pos = NULL; } else { if (x != w->w.width) memset (&help[x],' ',w->w.width-x); win_print(WWIN(w),w->w.x, w->w.y+cur, help); } *pos = end; start = pos + 1; cur++; } else if (*pos == '&') { *pos = '\0'; pos++; hl_pos = pos + 1; hl[0] = *pos; } } while (*pos); } static BOOL check_toggle_handle_event(WID_CHECK *w, WID_EVENT event, int ch, BOOL toggle) { static WID_EVENT last = WID_KEY; int cur; char *pos; if (event == WID_GET_FOCUS) { if (last != WID_HOTKEY) { /* active entry was already set */ if (ch < 0) w->active = w->cnt - 1; else w->active = 0; } return EVENT_HANDLED; } last = event; if ((event == WID_KEY) && (w->w.handle_key)) { cur = w->w.handle_key((WIDGET *) w, ch); if (cur) return cur; } if ((ch < 256) && (isalpha(ch))) ch = toupper(ch); switch (ch) { case KEY_UP: case KEY_LEFT: if (event == WID_KEY) { w->active--; if (w->active < 0) return handle_focus ((WIDGET*)w, FOCUS_PREV, 0); check_toggle_paint(w,toggle); } break; case KEY_DOWN: case KEY_RIGHT: case KEY_TAB: if (event == WID_KEY) { w->active++; if (w->active >= w->cnt) return handle_focus ((WIDGET*)w, FOCUS_NEXT, 0); check_toggle_paint(w,toggle); } break; case KEY_ENTER: case '\r': if (event == WID_KEY) { cur = handle_focus ((WIDGET*)w, FOCUS_ACTIVATE, 0); if (cur && cur!=FOCUS_ACTIVATE && cur!=FOCUS_DONT) return cur; if (toggle) w->selected ^= 1<active; else w->selected = 1<active; check_toggle_paint(w,toggle); } break; default: cur = 0; for (pos = w->button; *pos; pos++) { if (*pos == '|') cur++; if (*pos == '&' && (toupper((int)*(pos+1)) == ch)) { w->active = cur; check_toggle_paint(w,toggle); cur = handle_focus ((WIDGET*)w, FOCUS_ACTIVATE, FOCUS_ACTIVATE); if (cur!=FOCUS_ACTIVATE && cur!=FOCUS_DONT) return cur; if (toggle) w->selected ^= 1<active; else w->selected = 1<active; check_toggle_paint(w,toggle); return cur; } } return 0; } return EVENT_HANDLED; } static void check_free(WID_CHECK *w) { free(w->button); free(w); } static void check_paint(WID_CHECK *w) { check_toggle_paint(w, 0); } static BOOL check_handle_event(WID_CHECK *w, WID_EVENT event, int ch) { return check_toggle_handle_event(w, event, ch, 0); } static void check_get_size(WID_CHECK *w, int *width, int *height) { char *pos; int x = 0, hl_cnt = 0; *width = 0; *height = 0; w->cnt = 0; for (pos = w->button; *pos; pos++) { if (*pos == '&') hl_cnt++; if (*pos == '|') { w->cnt++; (*height)++; x += 4 - hl_cnt; if (x > *width) *width = x; hl_cnt = 0; x = -1; } x++; } w->cnt++; (*height)++; x += 4 - hl_cnt; if (x > *width) *width = x; } static void toggle_free(WID_TOGGLE *w) { free(w->button); free(w); } static void toggle_paint(WID_TOGGLE *w) { check_toggle_paint((WID_CHECK *) w, 1); } static BOOL toggle_handle_event(WID_TOGGLE *w, WID_EVENT event, int ch) { return check_toggle_handle_event((WID_CHECK *) w, event, ch, 1); } static void toggle_get_size(WID_TOGGLE *w, int *width, int *height) { check_get_size((WID_CHECK *) w, width, height); } static void colorsel_free(WID_COLORSEL *w) { free(w); } static void colorsel_paint(WID_COLORSEL *w) { int y = w->w.y, x = w->w.x; int act_x = (w->active & COLOR_BMASK) >> COLOR_BSHIFT; int act_y = (w->active & COLOR_FMASK) >> COLOR_FSHIFT; ATTRS border[COLOR_CNT+2][COLOR_CNT*3+2], b[12], attr; win_attrset(base_attr(w->w.d, ATTR_DLG_FRAME)); win_box (WWIN(w), w->w.x, w->w.y, w->w.x+COLOR_CNT*3+1, w->w.y+COLOR_CNT+1); attr = (win_get_theme_color(ATTR_DLG_FRAME) & COLOR_BMASK) >> COLOR_BSHIFT; for (x=0; xw.x+x*3+1, w->w.y+y+1, " X "); } } { ATTRS hotkey = w->w.has_focus ? ATTR_DLG_BUT_AHOTKEY:ATTR_DLG_BUT_IHOTKEY; ATTRS text = w->w.has_focus ? ATTR_DLG_BUT_ATEXT:ATTR_DLG_BUT_ITEXT; char key[2] = " "; const char *pat[2] = {".......< h h >", "..^h hv"}; int p, h = 0; for (p=0; p<2; p++) { for (x=0; x> COLOR_BSHIFT; win_attrset (text); key[0] = pat[p][x]; if (pat[p][x] == 'h') { if (w->hkeys[h]) { border[x*p][x*(1-p)] = (win_get_theme_color(hotkey) & COLOR_BMASK) >> COLOR_BSHIFT; win_attrset (hotkey); key[0] = w->hkeys[h]; } h++; } win_print (WWIN(w), w->w.x+x*(1-p), w->w.y+x*p, key); } } } } for (x=0; x<5; x++) { b[x] = border[act_y][act_x*3+x]; b[10-x] = border[act_y+2][act_x*3+x]; } b[5] = border[act_y+1][act_x*3+4]; b[11] = border[act_y+1][act_x*3]; win_set_forground (COLOR_BLACK_F); win_box_color (WWIN(w),w->w.x+act_x*3, w->w.y+act_y, w->w.x+act_x*3+4, w->w.y+act_y+2, b); } static int colorsel_handle_event(WID_COLORSEL *w, WID_EVENT event, int ch) { int act_x = (w->active & COLOR_BMASK) >> COLOR_BSHIFT; int act_y = (w->active & COLOR_FMASK) >> COLOR_FSHIFT; int i, old_act_x = act_x, old_act_y = act_y; if (event == WID_GET_FOCUS) return EVENT_HANDLED; if (event == WID_KEY && w->w.handle_key) { i = w->w.handle_key((WIDGET *) w, ch); if (i) return i; } if (ch < 256 && isalpha(ch)) ch = toupper(ch); switch (ch) { case KEY_UP: if (event == WID_KEY && act_y>0) act_y--; break; case KEY_LEFT: if (event == WID_KEY && act_x>0) act_x--; break; case KEY_DOWN: if (event == WID_KEY && act_yhkeys, ch)) { if (ch == w->hkeys[0]) if (act_x>0) act_x--; if (ch == w->hkeys[1]) if (act_xhkeys[2]) if (act_y>0) act_y--; if (ch == w->hkeys[3]) if (act_yactive = (act_x << COLOR_BSHIFT) + (act_y << COLOR_FSHIFT); colorsel_paint(w); i = handle_focus ((WIDGET*)w, FOCUS_ACTIVATE, FOCUS_ACTIVATE); if (i != FOCUS_ACTIVATE && i != FOCUS_DONT) return i; colorsel_paint(w); return i; } return 0; } w->active = (act_x << COLOR_BSHIFT) + (act_y << COLOR_FSHIFT); colorsel_paint (w); if (w->sel_mode == WID_SEL_BROWSE && (old_act_x != act_x || old_act_y != act_y)) return handle_focus((WIDGET*)w, FOCUS_ACTIVATE, FOCUS_ACTIVATE); return EVENT_HANDLED; } static void colorsel_get_size(WID_COLORSEL *w, int *width, int *height) { *width = 26; *height = 10; } static void dialog_add(DIALOG *d, WIDGET *w) { d->widget = (WIDGET **) realloc(d->widget, (d->cnt + 1) * sizeof(WIDGET *)); d->widget[d->cnt] = w; d->cnt++; } static void widget_init(WIDGET *w, DIALOG *d, BOOL focus, int spacing) { w->x = w->y = w->width = w->height = 1; w->def_width = w->def_height = -1; w->spacing = spacing; w->can_focus = focus; w->has_focus = 0; w->d = d; w->handle_key = w->handle_focus = NULL; w->w_free = w->w_paint = NULL; w->w_handle_event = NULL; w->w_get_size = NULL; w->data = NULL; } WIDGET *wid_label_add(DIALOG *d, int spacing, const char *msg) { WID_LABEL *w = (WID_LABEL *) malloc(sizeof(WID_LABEL)); widget_init((WIDGET *) w, d, 0, spacing); w->w.type = TYPE_LABEL; w->w.w_free = (freeFunc) label_free; w->w.w_paint = (paintFunc) label_paint; w->w.w_handle_event = (handleEventFunc) label_handle_event; w->w.w_get_size = (getSizeFunc) label_get_size; w->msg = strdup(msg); dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_label_set_label (WID_LABEL *w, const char *label) { if (w->msg) free (w->msg); w->msg = strdup (label); } WIDGET *wid_str_add(DIALOG *d, int spacing, const char *input, int length) { int i; WID_STR *w = (WID_STR *) malloc(sizeof(WID_STR)); widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_STR; w->w.w_free = (freeFunc) str_free; w->w.w_paint = (paintFunc) str_paint; w->w.w_handle_event = (handleEventFunc) str_handle_event; w->w.w_get_size = (getSizeFunc) str_get_size; w->length = length; w->w.def_width = STR_WIDTH_MAX; w->input = (char *) malloc(length + 1); i = MIN(strlen(input), length); strncpy(w->input, input, i); w->input[i] = '\0'; w->cur_pos = strlen(w->input); dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_str_set_input (WID_STR *w, const char *input, int length) { if (length>=0) { if (w->input) free (w->input); if (length) w->input = (char *) malloc(length + 1); w->length = length; } if (w->length == 0) { w->input = NULL; w->cur_pos = w->start = 0; } else { int i = MIN (strlen(input), w->length); strncpy (w->input, input, i); w->input[i] = '\0'; if (w->cur_pos > strlen(w->input)) w->cur_pos = strlen(w->input); if (w->cur_pos < w->start) w->start = w->cur_pos; if (w->cur_pos >= w->start + w->w.width) w->start = w->cur_pos - w->w.width + 1; } } WIDGET *wid_int_add(DIALOG *d, int spacing, int value, int length) { WID_INT *w = (WID_INT *) malloc(sizeof(WID_INT)); widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_INT; w->w.w_free = (freeFunc) int_free; w->w.w_paint = (paintFunc) int_paint; w->w.w_handle_event = (handleEventFunc) int_handle_event; w->w.w_get_size = (getSizeFunc) int_get_size; w->start = 0; w->length = length; w->w.def_width = INT_WIDTH_MAX; w->input = (char *) malloc(w->length + 1); sprintf(w->input, "%d", value); w->cur_pos = strlen(w->input); dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_int_set_input (WID_INT *w, int value, int length) { char val[20]; sprintf(val, "%d", value); wid_str_set_input ((WID_STR*)w, val,length); } WIDGET *wid_button_add(DIALOG *d, int spacing, const char *button, int active) { WID_BUTTON *w = (WID_BUTTON *) malloc(sizeof(WID_BUTTON)); widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_BUTTON; w->w.w_free = (freeFunc) button_free; w->w.w_paint = (paintFunc) button_paint; w->w.w_handle_event = (handleEventFunc) button_handle_event; w->w.w_get_size = (getSizeFunc) button_get_size; w->button = strdup(button); w->active = active; dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } WIDGET *wid_list_add(DIALOG *d, int spacing, const char **entries, int cnt) { WID_LIST *w = (WID_LIST *) malloc(sizeof(WID_LIST)); widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_LIST; w->title = NULL; w->entries = NULL; w->sel_mode = WID_SEL_SINGLE; w->cnt = w->cur = w->first = 0; w->w.def_width = LIST_WIDTH_DEFAULT; w->w.def_height = LIST_HEIGHT_DEFAULT; wid_list_set_entries (w,entries,-1,cnt); w->w.w_free = (freeFunc) list_free; w->w.w_paint = (paintFunc) list_paint; w->w.w_handle_event = (handleEventFunc) list_handle_event; w->w.w_get_size = (getSizeFunc) list_get_size; dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_list_set_title (WID_LIST *w, const char *title) { if (w->title) free (w->title); w->title = strdup (title); } void wid_list_set_entries (WID_LIST *w, const char **entries, int cur, int cnt) { int i; if (w->entries) { for (i=0; icnt; i++) free (w->entries[i]); free (w->entries); w->entries = NULL; } w->cnt = cnt; if (cur>=0) { w->cur = cur; w->first = cur>0 ? cur-1:0; } if (w->cur >= cnt) w->cur = cnt>0 ? cnt-1:0; if (w->first > w->cur) w->first = w->cur>0 ? w->cur-1:0; if (cnt>0) { w->entries = (char **) malloc(sizeof(char*) * cnt); for (i=0; ientries[i] = strdup(entries[i]); } } void wid_list_set_active (WID_LIST *w, int cur) { if (cur>=0 && cur < w->cnt) { w->cur = cur; if (w->cur < w->first) w->first = w->cur; if (w->cur >= w->first + w->w.height-2) w->first = w->cur - w->w.height + 3; } } void wid_list_set_selection_mode (WID_LIST *w, WID_SEL_MODE mode) { w->sel_mode = mode; } WIDGET *wid_check_add(DIALOG *d, int spacing, const char *button, int active, int selected) { WID_CHECK *w = (WID_CHECK *) malloc(sizeof(WID_CHECK)); widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_CHECK; w->w.w_free = (freeFunc) check_free; w->w.w_paint = (paintFunc) check_paint; w->w.w_handle_event = (handleEventFunc) check_handle_event; w->w.w_get_size = (getSizeFunc) check_get_size; w->button = strdup(button); w->active = active; w->selected = selected; dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_check_set_selected(WID_CHECK *w, int selected) { w->selected = selected; } WIDGET *wid_toggle_add(DIALOG *d, int spacing, const char *button, int active, int selected) { WID_TOGGLE *w = (WID_TOGGLE *) malloc(sizeof(WID_TOGGLE)); widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_TOGGLE; w->w.w_free = (freeFunc) toggle_free; w->w.w_paint = (paintFunc) toggle_paint; w->w.w_handle_event = (handleEventFunc) toggle_handle_event; w->w.w_get_size = (getSizeFunc) toggle_get_size; w->button = strdup(button); w->active = active; w->selected = selected; dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_toggle_set_selected(WID_TOGGLE *w, int selected) { w->selected = selected; } WIDGET *wid_colorsel_add(DIALOG *d, int spacing, const char *hotkeys, int active) { WID_COLORSEL *w = (WID_COLORSEL *) malloc(sizeof(WID_COLORSEL)); int i; widget_init((WIDGET *) w, d, 1, spacing); w->w.type = TYPE_COLORSEL; w->w.w_free = (freeFunc) colorsel_free; w->w.w_paint = (paintFunc) colorsel_paint; w->w.w_handle_event = (handleEventFunc) colorsel_handle_event; w->w.w_get_size = (getSizeFunc) colorsel_get_size; w->active = active; if (hotkeys && *hotkeys) { strcpy (w->hkeys, hotkeys); w->hkeys[4] = '\0'; for (i=0; ihkeys); i++) w->hkeys[i] = toupper(w->hkeys[i]); } else memset (w->hkeys, 0, 5); w->sel_mode = WID_SEL_SINGLE; dialog_add(d, (WIDGET *) w); return (WIDGET *) w; } void wid_colorsel_set_active(WID_COLORSEL *w, int active) { w->active = active; } void wid_set_size (WIDGET *w, int width, int height) { if (width>=0) w->def_width = width; if (height>=0) w->def_height = height; } void wid_set_func(WIDGET *w, handleKeyFunc key, handleFocusFunc focus, void *data) { w->handle_key = key; w->handle_focus = focus; w->data = data; } void wid_repaint (WIDGET *w) { if (w->w_paint) w->w_paint (w); } BOOL dialog_repaint(MWINDOW *win) { DIALOG *d = (DIALOG *) win->data; int i = 0; win_attrset(base_attr(d,ATTR_DLG_FRAME)); win_clear(win); for (i = 0; i < d->cnt; i++) d->widget[i]->w_paint(d->widget[i]); return 1; } void dialog_close(DIALOG *d) { int i; for (i = 0; i < d->cnt; i++) d->widget[i]->w_free(d->widget[i]); if (d->cnt) free(d->widget); win_close(d->win); free(d); } static BOOL dialog_handle_key(MWINDOW *win, int ch) { DIALOG *d = (DIALOG *) win->data; int ret, i; /* Handle keys common for all widgets here */ #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) if (ch == KEY_ESC) { dialog_close(d); return 1; } #endif ret = d->widget[d->active]->w_handle_event(d->widget[d->active], WID_KEY,ch); if (!ret) { /* KEY not handled -> try the hotkeys */ for (i = 0; !ret && i < d->cnt; i++) { ret = d->widget[i]->w_handle_event(d->widget[i], WID_HOTKEY, ch); if (ret == FOCUS_ACTIVATE) { d->widget[d->active]->has_focus = 0; d->widget[i]->has_focus = 1; d->active = i; d->widget[d->active]->w_handle_event(d->widget[d->active], WID_GET_FOCUS, ret); dialog_repaint(win); } } } else if (ret < EVENT_HANDLED) { /* FOCUS_{NEXT|PREV} */ d->widget[d->active]->has_focus = 0; do { d->active += ret; if (d->active < 0) d->active = d->cnt - 1; else if (d->active >= d->cnt) d->active = 0; } while (!d->widget[d->active]->can_focus); d->widget[d->active]->has_focus = 1; d->widget[d->active]->w_handle_event(d->widget[d->active], WID_GET_FOCUS, ret); dialog_repaint(win); } return !!ret; } /* Return size of column of widgets which starts at widget start */ static void column_dim (DIALOG *d, int start, int *width, int *height) { int i; *width = d->widget[start]->width; i = start+1; while (icnt && d->widget[i]->spacing>0) { if (d->widget[i]->width > *width) *width = d->widget[i]->width; i++; }; *height = d->widget[i-1]->y+d->widget[i-1]->height-d->widget[start]->y; } /* Layout the dialog widgets and return the calculated size and position of the dialog window (which must be still opened). initial = true: the the focus of the widgets is changed */ static void dialog_layout(DIALOG *d, int initial, int *w_x, int *w_y, int *w_width, int *w_height) { int m_y, m_width = 0, m_height = 0, i, x, y, width, height; int spacing, c_spacing = 1, c_height, c_width; BOOL focus = 1; i = 0; width = 1; height = c_width = c_height = m_height = m_width = 0; while (i < d->cnt) { /* Init all widgets(position and focus) */ spacing = d->widget[i]->spacing; if (i==0 || spacing<0) c_spacing = (spacing == 0 ? 1:abs(spacing)); x = 999; y = 999; d->widget[i]->w_get_size(d->widget[i], &x, &y); d->widget[i]->width = x; d->widget[i]->height = y; if (spacing>0) { c_height += spacing-1; d->widget[i]->x = width; d->widget[i]->y = m_height+c_height; if (x>c_width) c_width = x; } else if (spacing==0) { if (c_height>height) height = c_height; c_height = c_spacing-1; width += c_width + 1; d->widget[i]->x = width; d->widget[i]->y = m_height+c_height; c_width = x; } else { width += c_width + 1; if (width > m_width) m_width = width; if (c_height>height) height = c_height; m_height += height; c_height = -spacing-1; height = 0; width = 1; d->widget[i]->x = width; d->widget[i]->y = m_height+c_height; c_width = x; } c_height += y; if (initial) { if (d->widget[i]->can_focus) { d->widget[i]->has_focus = focus; if (focus) d->active = i; focus = 0; } else d->widget[i]->has_focus = 0; } i++; } width += c_width+1; if (width > m_width) m_width = width; if (c_height>height) height = c_height; m_height += height; width = m_width; height = m_height; win_get_size_max(&m_y, &m_width, &m_height); if (width > m_width-2 || height > m_height-2) { /* preferred size of widgets was to big, try to reduce the size */ int dx = width-m_width+2, dy = height-m_height+2, free_x, old_width = width, old_height = height, i_start, m_c_height, m_c_height_old, c_height_old, c_width_old, m_x; m_width = m_height = 0; i = 0; while (i < d->cnt) { /* reinit all widget positions */ spacing = abs(d->widget[i]->spacing); m_height += (spacing == 0 ? 0:spacing-1); width = 1; /* get height of highest column in row */ x = i; do { x++; } while (xcnt && d->widget[x]->spacing>=0); if (xcnt) m_c_height_old = d->widget[x]->y+d->widget[x]->spacing - d->widget[i]->y+1; else m_c_height_old = old_height - d->widget[i]->y; /* get max x coordinate of last column in row */ m_x = 0; do { x--; if ((d->widget[x]->x+d->widget[x]->width - 1) > m_x) m_x = d->widget[x]->x+d->widget[x]->width - 1; } while (x>0 && d->widget[x]->spacing>0); /* free space on right side of last column in row */ free_x = old_width-1-m_x; m_c_height = 0; /* for all columns in one row */ do { c_height = c_width = 0; i_start = i; column_dim (d, i_start, &c_width_old, &c_height_old); /* for all widgets in one column */ do { x = d->widget[i]->width - dx + free_x; y = d->widget[i]->height - dy + m_c_height_old-c_height_old; d->widget[i]->w_get_size(d->widget[i], &x, &y); if (i>0 && d->widget[i]->spacing > 0) c_height += d->widget[i]->spacing-1; d->widget[i]->x = width; d->widget[i]->y = m_height + c_height; d->widget[i]->width = x; d->widget[i]->height = y; if (x>c_width) c_width = x; c_height += y; y = c_width_old; column_dim (d, i_start, &c_width_old, &c_height_old); free_x += y - c_width_old; i++; } while ((i < d->cnt) && (d->widget[i]->spacing > 0)); width += c_width +1; if (c_height > m_c_height) m_c_height = c_height; } while ((i < d->cnt) && (d->widget[i]->spacing >= 0)); if (width > m_width) m_width = width; m_height += m_c_height; } width = m_width; height = m_height; win_get_size_max(&m_y, &m_width, &m_height); } m_width -= 2; m_height -= 2; *w_x = (m_width - width) / 2 + 1; if (*w_x < 1) *w_x = 1; *w_y = (m_height - height) / 2 + m_y +1; if (*w_y <= m_y) *w_y = m_y+1; *w_width = (width>m_width ? m_width:width); *w_height = (height>m_height ? m_height:height); } static void dialog_handle_resize(MWINDOW *win, int dx, int dy) { DIALOG *d = (DIALOG *) win->data; int x,y,width,height; dialog_layout (d,0,&x,&y,&width,&height); win->x = x; win->y = y; win->width = width; win->height = height; } void dialog_open(DIALOG *d, const char *title) { int x,y,width,height; dialog_layout (d,1,&x,&y,&width,&height); if (!title) title = "Dialog"; win_open(x, y, width, height, 1, title, base_attr(d,ATTR_DLG_FRAME)); win_set_repaint(dialog_repaint); win_set_handle_key(dialog_handle_key); win_set_resize(0, dialog_handle_resize); win_set_data((void *)d); d->win = win_get_window(); dialog_repaint(d->win); } /* set attribute which is used for DLG_FRAME and DLG_LABEL, works only before dialog_open() */ void dialog_set_attr (DIALOG *d, ATTRS attrs) { d->attrs = attrs; } DIALOG *dialog_new(void) { DIALOG *d = (DIALOG *) malloc(sizeof(DIALOG)); d->active = 0; d->cnt = 0; d->attrs = ATTR_NONE; d->win = NULL; d->widget = NULL; return d; } /* ex:set ts=4: */ mikmod-3.2.9/src/os2video.inc0000644000000000000000000000646513040414034014523 0ustar rootroot/* MikMod module player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== OS/2 console i/o routines ==============================================================================*/ static HVIO hvio = 0; static VIOCURSORINFO viocursorinfo; static BYTE clearscreen [2] = { ' ', A_NORMAL }; static BYTE mvattr = A_NORMAL; #define attrset(a) mvattr = a void clear(void) { /* overwrite entire screen with 0s */ clearscreen [1] = mvattr; VioWrtNCell(clearscreen, winy * winx, 0, 0, hvio); } void mvaddnstr(int y,int x,const char *str,int len) { char buffer[STORAGELEN]; int l=strlen(str); strncpy(buffer,str,len); if (lwidth-x>0) { clearscreen[1] = mvattr; VioWrtNCell(clearscreen, win->width - x, win->y + y, win->x + x, hvio); } } #ifdef __EMX__ static int _mik_kbhit(void) { KBDKEYINFO k; if (KbdPeek(&k, 0)) return 0; return (k.fbStatus & KBDTRF_FINAL_CHAR_IN); } #else #define _mik_kbhit kbhit #endif static int win_getch(void) { int c = 0; if (_mik_kbhit()) { c = getch(); if ((!c) || (c == 0xe0)) c = 0x100 | getch(); } return c; } mikmod-3.2.9/src/CMakeLists.txt0000644000000000000000000000140614603465374015047 0ustar rootroot ########### next target ############### SET(mikmod_SRCS display.c marchive.c mikmod.c mlist.c mconfig.c mwindow.c mmenu.c mwidget.c mdialog.c mconfedit.c mutilities.c mplayer.c mlistedit.c rcfile.c ) IF (NOT HAVE_USLEEP AND NOT WIN32 AND NOT OS2) LIST (APPEND mikmod_SRCS "musleep.c") ENDIF() IF (NOT HAVE_FNMATCH) LIST (APPEND mikmod_SRCS "mfnmatch.c") ENDIF() IF (NOT HAVE_GETOPT_LONG_ONLY) LIST (APPEND mikmod_SRCS "getopt_long.c") ENDIF() include_directories(${MIKMOD_INCLUDE_DIR}) add_executable(mikmod ${mikmod_SRCS}) target_link_libraries(mikmod ${MIKMOD_LIBRARIES} ${EXTRA_LIBS}) install(TARGETS mikmod DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES mikmod.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) mikmod-3.2.9/src/mlistedit.c0000644000000000000000000010417114606707072014451 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mlistedit.c,v 1.1.1.1 2004/01/16 02:07:43 raph Exp $ The playlist editor ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include #include #if defined(__MINGW32__) || defined(__EMX__) || defined(__DJGPP__) #include #elif defined(__OS2__) /* Watcom */ #include #elif defined(_WIN32) /* MSVC, etc. */ #include #else #include #endif #include #include "mlistedit.h" #include "mlist.h" #include "player.h" #include "mdialog.h" #include "rcfile.h" #include "mconfig.h" #include "mconfedit.h" #include "marchive.h" #include "mwidget.h" #include "keys.h" #include "display.h" #include "mutilities.h" #define FREQ_SEL '*' #define FREQ_SEL_STR "*" #define FREQ_UNSEL ' ' #define FREQ_UNSEL_STR " " /* Function, which is called on Ok/Cancel button select button: 0: Ok 1: Cancel path: Selected file data: user-pointer which was passed to freq_open() Return: close fileselector? */ typedef BOOL (*handleFreqFunc) (int button, char *file, void *data); /* Function, which is called for every new directory during directory scanning in scan_dir(). scan_dir() is canceled if the function returns 1. */ typedef BOOL (*handleScandirFunc) (char *path, int added, int removed, void *data); typedef enum { FREQ_ADD, FREQ_TOGGLE, FREQ_REMOVE } FREQ_MODE; typedef struct { WID_LIST *w; /* the directory list */ char path[PATH_MAX<<1]; /* path of currently displayed directory */ BOOL before_add; /* TRUE until first call of entry_add() */ int actline; /* pos in playlist for insertion */ /* -1 -> append entries */ int cnt_list; char **searchlist; /* sorted playlist archives or files */ /* (if archives are not available)*/ handleFreqFunc handle_freq; void *data; } FREQ_DATA; typedef struct { WID_LIST *w; /* the directory list */ FREQ_DATA *freq; } HLIST_DATA; typedef struct { MMENU *menu; int *actLine; } MENU_DATA; typedef struct { WID_LABEL *w; BOOL stop; } FREQ_SCAN_DATA; #if defined (_MSC_VER) #define CMP_CALLCONV __cdecl #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1240) && defined(_M_IX86) #define CMP_CALLCONV __watcall #else #define CMP_CALLCONV #endif /* compare function for qsort on the searchlist */ static int CMP_CALLCONV searchlist_cmp (const void *key, const void *member) { return filecmp(*(const char **)key, *(const char **)member); } /* compare function for bsearch on the searchlist */ static int CMP_CALLCONV searchlist_search_cmp (const void *key, const void *member) { return filecmp((const char *)key, *(const char **)member); } /* compare function for qsort on the directory list */ static int CMP_CALLCONV dirlist_cmp (const void *s, const void *b) { const char **small = (const char **)s; const char **big = (const char **)b; if (IS_PATH_SEP((*small)[strlen(*small)-1])) { if (IS_PATH_SEP((*big)[strlen(*big)-1])) return(filecmp(*small+2,*big+2)); else return -1; } if (IS_PATH_SEP((*big)[strlen(*big)-1])) return 1; return(filecmp(*small+2,*big+2)); } /* compare function for bearch on the directory list */ static int CMP_CALLCONV dirlist_search_cmp (const void *k, const void *m) { const char * key = (const char *)k; const char **member = (const char**)m; if (IS_PATH_SEP(key[strlen(key)-1])) { if (IS_PATH_SEP((*member)[strlen(*member)-1])) return(filecmp(key,*member+2)); else return -1; } if (IS_PATH_SEP((*member)[strlen(*member)-1])) return 1; return(filecmp(key,*member+2)); } /* Add/Remove tag marks to the files in entries (count: cnt) from directory path according to the searchlist */ static void freq_set_marks (char **entries, int cnt, const char *path, FREQ_DATA *data) { int i; char file[PATH_MAX<<1], *fstart; strcpy (file,path); fstart = file+strlen(file); for (i=0; icnt_list > 0 && bsearch (file,data->searchlist,data->cnt_list, sizeof(char*),searchlist_search_cmp)) *(entries[i]) = FREQ_SEL; else *(entries[i]) = FREQ_UNSEL; } } /* Check if size of playlist has changed (due to e.g. resolving of playlists). If so, rebuild searchlist. */ static void freq_check_searchlist (FREQ_DATA *data) { int i, len = PL_GetLength(&playlist); if (len != data->cnt_list) { data->searchlist = (char **) realloc (data->searchlist, sizeof(char*) * len); data->cnt_list = len; if (len) { for (i=0; iarchive) data->searchlist[i] = entry->archive; else data->searchlist[i] = entry->file; } qsort (data->searchlist, len, sizeof(char*),searchlist_cmp); } if (data->w) { freq_set_marks (data->w->entries,data->w->cnt,data->path,data); wid_repaint ((WIDGET*)data->w); } } } /* Insert ins in (already enlarged) searchlist pl. pl must be sorted (according to filecmp()).*/ static void entry_insert (int left, int right, char **pl, char *ins) { int pos=0, cmp=0, last = right; if (right<0) { pl[0] = ins; } else { while (left<=right) { pos = (left+right)/2; cmp = filecmp(ins,pl[pos]); if (cmp<0) right = pos-1; else left = pos+1; } if (cmp>0) pos++; for (cmp=last; cmp>=pos; cmp--) pl[cmp+1] = pl[cmp]; pl[pos] = ins; } } /* Insert entry path+file at position data->actline into the playlist and update the (before and afterwards sorted) searchlist and actline from data. Return: Number of added entries */ static int entry_add (char *path, char *file, FREQ_DATA *data) { int len, old_len = PL_GetLength(&playlist); char buffer[STORAGELEN]; strcpy (buffer,path); if (file) strcat (buffer,file); if (data) { if (data->actline < 0 && data->before_add) { /* "Load" was selected -> Remove old entries */ data->before_add = 0; PL_ClearList(&playlist); old_len = PL_GetLength(&playlist); freq_check_searchlist (data); } else PL_StartInsert(&playlist, data->actline); } MA_FindFiles(&playlist, buffer); PL_StopInsert(&playlist); len = PL_GetLength(&playlist); if (!old_len && len) PL_InitCurrent(&playlist); /* Update the searchlist */ if (len>old_len && data) { int i, start, end; data->searchlist = (char **) realloc (data->searchlist, sizeof(char*) * len); start = data->actline; if (start<0) start = old_len; end = start+len-old_len; for (i=start; iarchive ? entry->archive:entry->file; entry_insert (0,data->cnt_list-1,data->searchlist,ins); data->cnt_list++; } if (data->actline>=0) data->actline += len-old_len; } return len-old_len; } /* remove all entries with archive==path+file (or file==path+file, if archive not set) from the playlist and update the (before and afterwards sorted) searchlist and actline from data. Return: Number of removed entries */ static int entry_remove_by_name(char *path, char *file, FREQ_DATA *data) { int len = PL_GetLength(&playlist); char buffer[STORAGELEN]; int cnt_remove = 0, i; char **pos; strcpy (buffer,path); if (file) strcat (buffer,file); /* Update the searchlist */ while (data->cnt_list>0 && (pos = (char **) bsearch(buffer,data->searchlist,data->cnt_list, sizeof(char*),searchlist_search_cmp))) { while (pos < data->searchlist + data->cnt_list - 1) { *pos = *(pos+1); pos++; } data->cnt_list--; } data->searchlist = (char **) realloc (data->searchlist, sizeof(char*) * data->cnt_list); /* Remove the entries from the playlist */ for (i=len-1; i>=0; i--) { PLAYENTRY *entry = PL_GetEntry(&playlist, i); if (!filecmp (entry->archive ? entry->archive:entry->file, buffer)) { PL_DelEntry(&playlist, i); if (i < data->actline) data->actline--; cnt_remove++; } } return cnt_remove; } /* Scan directory path for modules and add all files to the playlist, which are not already in data->searchlist (if data!=NULL). recursive: Scan recursively links : Follow links */ static void scan_dir (char *path, BOOL recursive, BOOL links, FREQ_DATA *freq_data, FREQ_MODE mode, handleScandirFunc func, void *data, int *added, int *removed) { #define DIR_BLOCK 10 DIR *dir; struct dirent *entry; struct stat statbuf; char file[PATH_MAX<<1], *pathend, **dirs=NULL; int cnt = 0, max = 0, i; if ( #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32)&&!defined(_mikmod_amiga) !strcmp (path,"/proc/") || !strcmp (path,"/dev/") || #endif !(dir = opendir (path_conv_sys(path)))) return; if (func) { int add=-1, rem=-1; if (added) add = *added; if (removed) rem = *removed; if (func (path,add,rem,data)) { closedir (dir); return; } } strcpy (file,path); pathend = file+strlen(file); while ((entry = readdir (dir))) { strcpy (pathend,entry->d_name); path_conv(pathend); if (!lstat(path_conv_sys(file), &statbuf)) { if (S_ISDIR(statbuf.st_mode)) { /* if dir, process it after the files */ if (recursive && (links || !S_ISLNK(statbuf.st_mode)) && strcmp (entry->d_name,"..") && strcmp (entry->d_name,".")) { /* FIXME: check for cyclic links is missing */ if (cnt >= max) { max += DIR_BLOCK; dirs = (char **) realloc (dirs, sizeof(char*) * max); } dirs[cnt++] = strdup (entry->d_name); } } else if (!S_ISCHR(statbuf.st_mode) && !S_ISBLK(statbuf.st_mode) && !S_ISFIFO(statbuf.st_mode) && !S_ISSOCK(statbuf.st_mode) && MA_TestName (file, 0 , 0)) { /* file of known type: add/remove it */ char **pos = NULL; int j = 0; if (freq_data && freq_data->cnt_list > 0) pos = (char **) bsearch(file,freq_data->searchlist,freq_data->cnt_list, sizeof(char*),searchlist_search_cmp); if (pos) { if (mode != FREQ_ADD) { j = entry_remove_by_name(file, NULL, freq_data); if (removed) *removed += j; } else if (freq_data->actline < 0 && freq_data->before_add) { j = entry_add(file, NULL, freq_data); if (added) *added += j; } } else { if (mode != FREQ_REMOVE) { j = entry_add(file, NULL, freq_data); if (added) *added += j; } } } } while (win_main_iteration()); } /* now process dirs after files are already processed */ for (i=0; i= max) { max += ENT_BLOCK; *entries = (char **) realloc (*entries, sizeof(char*) * max); } strcpy (pathend,entry->d_name); path_conv (pathend); if (!stat(path_conv_sys(file), &statbuf)) if (S_ISDIR(statbuf.st_mode)) strcat (pathend,PATH_SEP_STR); help = (char *) malloc (sizeof(char) * (strlen(pathend) + 3)); strcpy (help," "); strcat (help,pathend); (*entries)[(*cnt)++] = help; } freq_set_marks (*entries,*cnt,path,data); closedir (dir); if (*cnt) qsort (*entries, *cnt, sizeof(char*),dirlist_cmp); } } /* free directory list read with freq_readdir() */ static void freq_freedir (char **entries, int cnt) { int i; for (i=0; iw->w.width-2; if (strlen(data->path) <= max) wid_list_set_title (data->w, data->path); else { char path[MAXWIDTH]; strcpy (path, "..."); strcat (path, &data->path[strlen(data->path)-max+3]); wid_list_set_title (data->w, path); } wid_repaint ((WIDGET*)data->w); } /* change directory to path (read directory and display it) */ static void freq_changedir (const char *path, FREQ_DATA *data) { char **entries, *last= NULL, *end, **pos = NULL, ch; int cnt; freq_readdir (path,&entries,&cnt,data); if (entries && cnt>0) { /* Check if new path is part of the old one and find position in entries where the old path continues to correctly reposition active entry */ if (strlen(path) < strlen(data->path)) { last = data->path+strlen(path); ch = *last; *last = '\0'; if (!filecmp (data->path, path)) { *last = ch; end = last; while (*end && !IS_PATH_SEP(*end)) end++; if (IS_PATH_SEP(*end)) { *(end+1) = '\0'; pos=(char**) bsearch(last, entries, cnt, sizeof(char*), dirlist_search_cmp); } else pos = NULL; } } if (!pos) pos = entries; strcpy (data->path, path); wid_list_set_entries (data->w, (const char **)entries, 0, cnt); wid_list_set_active (data->w, pos-entries); freq_set_title (data); freq_freedir (entries,cnt); } else dlg_error_show ("Unable to read directory \"%s\"!",path); } static void hlist_close (HLIST_DATA *data) { dialog_close(data->w->w.d); free (data); } static int cb_hlist_list_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { HLIST_DATA *data = (HLIST_DATA *) w->data; int cur = ((WID_LIST*)w)->cur; /* return in hotlist -> change to the selected dir */ freq_check_searchlist (data->freq); if (cur < config.cnt_hotlist) freq_changedir (config.hotlist[cur],data->freq); hlist_close(data); return EVENT_HANDLED; } return focus; } static int cb_hlist_button_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { HLIST_DATA *data = (HLIST_DATA *) w->data; int button = ((WID_BUTTON *) w)->active; int cur = data->w->cur; freq_check_searchlist (data->freq); switch (button) { case 0: /* change To */ if (cur < config.cnt_hotlist) freq_changedir (config.hotlist[cur],data->freq); hlist_close(data); break; case 1: /* Add current */ CF_string_array_insert (cur,&config.hotlist,&config.cnt_hotlist, data->freq->path,PATH_MAX); wid_list_set_entries (data->w,(const char **)config.hotlist,-1,config.cnt_hotlist); wid_repaint ((WIDGET*)data->w); break; case 2: /* Remove */ CF_string_array_remove (cur,&config.hotlist,&config.cnt_hotlist); wid_list_set_entries (data->w,(const char **)config.hotlist,-1,config.cnt_hotlist); wid_repaint ((WIDGET*)data->w); break; case 3: /* Cancel */ hlist_close(data); break; } return EVENT_HANDLED; } return focus; } /* open the directory hotlist editor */ static void freq_hotlist (FREQ_DATA *freq_data) { DIALOG *d = dialog_new(); WIDGET *w; HLIST_DATA *data = (HLIST_DATA *) malloc (sizeof(HLIST_DATA)); w = wid_list_add(d, 1, (const char **)config.hotlist, config.cnt_hotlist); wid_set_size (w, 74, 10); data->w = (WID_LIST*)w; data->freq = freq_data; wid_set_func(w, NULL, cb_hlist_list_focus, data); w = wid_button_add(d, 1, "|&Add current|&Remove|&Cancel", 0); wid_set_func(w, NULL, cb_hlist_button_focus, data); dialog_open(d, "Directory hotlist"); } /* Check if file is a directory and copy the resulting path from path and file to dest */ static BOOL path_update (char *dest, char *path, char *file) { char *end; if (!strcmp (file,".."PATH_SEP_STR)) { strcpy (dest, path); end = dest+strlen(dest)-2; while (end>dest && !IS_PATH_SEP(*end)) *end-- = '\0'; } else if (!strcmp (file,"."PATH_SEP_STR)) { strcpy (dest, path); } else if (IS_PATH_SEP(file[strlen(file)-1])) { strcpy (dest, path); strcat (dest, file); } else return 0; return 1; } static int cb_scan_dir_stop_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { if (((WID_BUTTON *) w)->active == 0) ((FREQ_SCAN_DATA*)w->data)->stop = 1; return EVENT_HANDLED; } return focus; } /* Show progress during directory scanning */ BOOL cb_freq_scan_dir (char *path, int added, int removed, void *data) { FREQ_SCAN_DATA *scan_data = (FREQ_SCAN_DATA*)data; if (strlen(path) > 50) sprintf (storage,"Scanning ...%s...\n" "%4d entrie(s) added, %4d entrie(s) removed", &path[strlen(path)-47], added, removed); else sprintf (storage,"Scanning %s...\n" "%4d entrie(s) added, %4d entrie(s) removed", path, added, removed); wid_label_set_label ((WID_LABEL*)(scan_data->w),storage); dialog_repaint (scan_data->w->w.d->win); win_refresh(); return scan_data->stop; } /* Scan directory path for modules and add/remove them to the playlist according to mode */ static void freq_scan_dir (char *path, FREQ_DATA *data, FREQ_MODE mode) { int added=0, removed=0; DIALOG *d = dialog_new(); WIDGET *w; FREQ_SCAN_DATA scan_data; scan_data.stop = 0; if (strlen(path) > 50) sprintf (storage,"Scanning ...%-47s...\n" " 0 entrie(s) added, 0 entrie(s) removed", &path[strlen(path)-47]); else sprintf (storage,"Scanning %-50s...\n" " 0 entrie(s) added, 0 entrie(s) removed",path); scan_data.w = (WID_LABEL*)wid_label_add(d, 1, storage); w = wid_button_add(d, 2, "&Stop", 0); wid_set_func(w, NULL, cb_scan_dir_stop_focus, &scan_data); dialog_open(d, "Message"); win_refresh(); scan_dir (path, 1, 0, data, mode, cb_freq_scan_dir, &scan_data, &added, &removed); dialog_close(d); freq_set_marks (data->w->entries,data->w->cnt,data->path,data); sprintf (storage,"Added %d entrie(s) and removed %d entrie(s).", added,removed); dlg_message_open(storage, "&Ok", 0, 0, NULL, NULL); } /* Add/Remove entries to/from the playlist */ static void freq_add (FREQ_DATA *data, FREQ_MODE mode) { char *file = data->w->entries[data->w->cur]; char *path = data->path; char help[PATH_MAX<<1]; if (path_update (help,path,file+2)) { freq_scan_dir (help, data, mode); } else if (*file == FREQ_SEL) { if (mode != FREQ_ADD) { if (entry_remove_by_name(path, file+2, data) > 0) *file = FREQ_UNSEL; } else if (data->actline < 0 && data->before_add) if (entry_add(path, file+2, data) > 0) *file = FREQ_SEL; } else { if (mode != FREQ_REMOVE) { if (entry_add(path, file+2, data) > 0) *file = FREQ_SEL; } } wid_list_set_active (data->w,data->w->cur+1); win_panel_repaint(); } static void freq_close (FREQ_DATA *data) { if (data) { if (data->w) dialog_close(data->w->w.d); if (data->searchlist) free (data->searchlist); free (data); } PL_DelDouble(&playlist); } /* Ok/Back was selected and data->handle_freq() is present -> call function Return: close fileselector? */ static BOOL freq_call_func (int button, FREQ_DATA *data) { char file[PATH_MAX<<1]; strcpy (file, data->path); strcat (file, data->w->entries[data->w->cur]+2); return data->handle_freq (button,file,data->data); } static int cb_freq_list_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { FREQ_DATA *data = (FREQ_DATA *) w->data; int cur = ((WID_LIST*)w)->cur; char path[PATH_MAX<<1], *cur_entry; freq_check_searchlist (data); path[0] = '\0'; cur_entry = ((WID_LIST*)w)->entries[cur]+2; /* Default action for dirs: change dir For files: call user-function or add entry to playlist */ if (!path_update(path,data->path,cur_entry)) { if (data->handle_freq) { if (freq_call_func (0,data)) freq_close (data); } else freq_add (data,FREQ_ADD); } if (path[0] != '\0') freq_changedir (path,data); return EVENT_HANDLED; } return focus; } static BOOL cb_freq_cd_do (WIDGET *w,int button, void *input, void *data) { if (button<=0) { char *pos; path_conv((char *)input); pos = (char*)input + strlen((char*)input); /* Check if path ends with '/' */ if (!IS_PATH_SEP(*(pos-1))) { *pos = PATH_SEP; *(pos+1) = '\0'; } freq_check_searchlist ((FREQ_DATA *)data); freq_changedir ((char *)input, (FREQ_DATA *)data); } return 1; } static void freq_cd (FREQ_DATA *data) { dlg_input_str ("Change directory to:", "<&Ok>|&Cancel", data->path, PATH_MAX, cb_freq_cd_do, data); } static int cb_freq_list_key(WIDGET *w, int ch) { FREQ_DATA *data = (FREQ_DATA *) w->data; freq_check_searchlist (data); if ((ch < 256) && (isalpha(ch))) ch = toupper(ch); switch (ch) { case KEY_IC: /* Insert -> Add */ freq_add (data,FREQ_ADD); break; default: return 0; } return EVENT_HANDLED; } static int cb_freq_button_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { FREQ_DATA *data = (FREQ_DATA *) w->data; int button = ((WID_BUTTON *) w)->active; freq_check_searchlist (data); switch (button) { case 0: /* Add */ freq_add (data,FREQ_ADD); break; case 1: /* Toggle */ freq_add (data,FREQ_TOGGLE); break; case 2: /* Cd */ freq_cd (data); break; case 3: /* HotList */ freq_hotlist (data); break; case 4: /* Back / Ok */ if (!data->handle_freq || freq_call_func (0,data)) freq_close (data); break; case 5: /* Back */ if (data->handle_freq && freq_call_func (1,data)) freq_close (data); break; } return EVENT_HANDLED; } return focus; } /* Init initial path and searchlist */ static FREQ_DATA *freq_data_init (const char *path) { struct stat statbuf; FREQ_DATA *data = (FREQ_DATA *) malloc(sizeof(FREQ_DATA)); char *pos; data->path[0] = '\0'; if (path_relative(path)) { getcwd (data->path,PATH_MAX); path_conv (data->path); if (!IS_PATH_SEP(data->path[strlen(data->path)-1])) strcat (data->path, PATH_SEP_STR); } strcat (data->path,path); if (stat(path_conv_sys(data->path), &statbuf) || !S_ISDIR(statbuf.st_mode)) if ((pos = FIND_LAST_DIRSEP(data->path)) != NULL) *(pos+1) = '\0'; pos = data->path+strlen(data->path); if (!IS_PATH_SEP(*(pos-1))) { *pos = PATH_SEP; *(pos+1) = '\0'; } data->w = NULL; data->before_add = 1; data->actline = -1; data->cnt_list = 0; data->searchlist = NULL; freq_check_searchlist (data); return data; } /* Open a file requester. func!=NULL: func is called if Ok or Cancel is selected func==NULL: no Ok button, Add is default */ void freq_open (const char *title, const char *path, int actline, handleFreqFunc func, void *data) { FREQ_DATA *freq_data; DIALOG *d = dialog_new(); WIDGET *w; char **entries, *path_first = NULL; int cnt; freq_data = freq_data_init (path); freq_data->actline = actline; freq_data->handle_freq = func; freq_data->data = data; freq_readdir(freq_data->path,&entries,&cnt,freq_data); if (!entries || !cnt) { /* show error after file selector is open */ path_first = strdup (freq_data->path); /* error on initial path -> try root directory */ #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) strcpy (freq_data->path,"c:"PATH_SEP_STR); #elif defined _mikmod_amiga strcpy (freq_data->path,"SYS:"); /* or use ":" instead??? */ #else strcpy (freq_data->path,PATH_SEP_STR); #endif freq_readdir(freq_data->path,&entries,&cnt,freq_data); if (!entries || !cnt) { /* again an error -> give up */ freq_close (freq_data); if (path_first) free (path_first); return; } } w = wid_list_add(d, 1, (const char **)entries, cnt); freq_data->w = (WID_LIST*)w; wid_set_func(w, cb_freq_list_key, cb_freq_list_focus, freq_data); freq_freedir(entries, cnt); if (func) w = wid_button_add(d, 1, "&Add|&Toggle|&Cd|&Hlist|<&Ok>|&Back", 0); else w = wid_button_add(d, 1, "<&Add>|&Toggle|&Cd|&Hlist|&Back", 0); wid_set_func(w, NULL, cb_freq_button_focus, freq_data); dialog_open(d, title); /* Size of list widget is necessary -> set title after dialog_open() */ freq_set_title (freq_data); if (path_first) { dlg_error_show ("Unable to read directory \"%s\"!",path_first); free (path_first); } } static BOOL cb_list_scan_dir (char *path, int added, int removed, void *data) { BOOL quiet = (BOOL)(SINTPTR_T)data; char str[70], *pos; int i; if (!quiet) { if (strlen(path) > 43) sprintf (str,"\rScanning ...%s... (%d added)", &path[strlen(path)-40],added); else sprintf (str,"\rScanning %s... (%d added)",path,added); pos = str+strlen(str); for (i=strlen(str); i<(70-1); i++) *pos++ = ' '; *pos = '\0'; printf ("%s", str); fflush(stdout); } return 0; } /* test if path is a directory and recursively scan it for modules */ int list_scan_dir (char *path, BOOL quiet) { struct stat statbuf; int added = 0; char dir[PATH_MAX<<1]="", *pos; #if defined(__EMX__)||defined(__OS2__)||defined(__DJGPP__)||defined(_WIN32) if (*path!=PATH_SEP && *(path+1)!=':') #else if (!IS_PATH_SEP(*path)) #endif { getcwd (dir,PATH_MAX); path_conv (dir); if (!IS_PATH_SEP(dir[strlen(dir)-1])) strcat (dir, PATH_SEP_STR); } strcat (dir,path); pos = dir+strlen(dir); if (!IS_PATH_SEP(*(pos-1))) { *pos = PATH_SEP; *(pos+1) = '\0'; } if (!stat(path_conv_sys(dir), &statbuf) && S_ISDIR(statbuf.st_mode)) scan_dir (dir, 1, 0, NULL, FREQ_ADD, cb_list_scan_dir, (void *)(SINTPTR_T)quiet, &added, NULL); return added; } /* remove an entry from the playlist */ static void entry_remove (int entry) { PL_DelEntry(&playlist, entry); } /* remove an entry from the playlist and delete the associated module */ static BOOL cb_delete_entry(WIDGET *w, int button, void *input, void *entry) { if (button<=0) { PLAYENTRY *cur = PL_GetEntry(&playlist, (SINTPTR_T)entry); if (cur->archive) { if (unlink(path_conv_sys(cur->archive)) == -1) dlg_error_show("Error deleting archive \"%s\"!",cur->archive); } else { if (unlink(path_conv_sys(cur->file)) == -1) dlg_error_show("Error deleting file \"%s\"!",cur->file); } entry_remove((SINTPTR_T)entry); } return 1; } /* split a filename into the name and the last extension */ static void split_name(char *file, char **name, char **ext) { *name = FIND_LAST_DIRSEP(file); if (!*name) *name = file; *ext = strrchr(*name, '.'); if (!*ext) *ext = &(*name[strlen(*name)]); } static BOOL sort_rev = 0; /* *INDENT-OFF* */ static enum { SORT_NAME, SORT_EXT, SORT_PATH, SORT_TIME } sort_mode = SORT_NAME; /* *INDENT-ON* */ static int cb_cmp_sort(PLAYENTRY * small, PLAYENTRY * big) { char ch_s = ' ', ch_b = ' ', *ext_s, *ext_b, *name_s, *name_b; int ret = 0; switch (sort_mode) { case SORT_NAME: split_name(small->file, &name_s, &ext_s); split_name(big->file, &name_b, &ext_b); ch_s = *ext_s; ch_b = *ext_b; *ext_s = '\0'; *ext_b = '\0'; ret = strcasecmp(name_s, name_b); *ext_s = ch_s; *ext_b = ch_b; break; case SORT_EXT: split_name(small->file, &name_s, &ext_s); split_name(big->file, &name_b, &ext_b); ret = strcasecmp(ext_s, ext_b); break; case SORT_PATH: ext_s = small->archive; if (!ext_s) ext_s = small->file; name_s = FIND_LAST_DIRSEP(ext_s); if (name_s) { ch_s = *name_s; *name_s = '\0'; } ext_b = big->archive; if (!ext_b) ext_b = big->file; name_b = FIND_LAST_DIRSEP(ext_b); if (name_b) { ch_b = *name_b; *name_b = '\0'; } ret = strcasecmp(ext_s, ext_b); if (name_s) *name_s = ch_s; if (name_b) *name_b = ch_b; break; case SORT_TIME: ret = (small->time == big->time ? 0 : (small->time < big->time ? -1 : 1)); break; } return (sort_rev) ? -ret : ret; } /* overwrites an existdng playlist */ static BOOL cb_overwrite (WIDGET *w, int button, void *input, void *file) { if (button<=0) { path_conv((char *)file); if (PL_Save(&playlist, (char *)file)) rc_set_string(&config.pl_name, (char *)file, PATH_MAX); else dlg_error_show("Error saving playlist \"%s\"!",file); } if (file) free(file); return 1; } static BOOL cb_browse (int button, char *file, void *data) { if (!button) { wid_str_set_input ((WID_STR*)data, file, -1); wid_repaint ((WIDGET*)data); } return 1; } /* saves a playlist */ static BOOL cb_save_as(WIDGET *w, int button, void *input, void *data) { path_conv((char *)input); if (button == 0) { /* Browse */ freq_open ("Select directory/file",(char*)input,(SINTPTR_T)data, cb_browse,w); return 0; } else if (button == 1 || button == -1) { /* Ok / Str-Widget */ if (file_exist((char*)input)) { char *f_copy = strdup((char*)input); char *msg = str_sprintf("File \"%s\" exists.\n" "Really overwrite the file?", f_copy); dlg_message_open(msg, "&Yes|&No", 1, 1, cb_overwrite, f_copy); free(msg); } else { if (PL_Save(&playlist, (char*)input)) rc_set_string(&config.pl_name, (char*)input, PATH_MAX); else dlg_error_show("Error saving playlist \"%s\"!",input); } } return 1; } /* playlist menu handler */ static void cb_handle_menu(MMENU * menu) { MENU_DATA *data = (MENU_DATA *) menu->data; int actLine = *data->actLine; PLAYENTRY *cur; char *name, *msg; /* main menu */ if (!menu->id) { switch (menu->cur) { case 0: /* play highlighted module */ if (actLine >= 0) Player_SetNextMod(actLine); break; case 1: /* remove highlighted module */ if (actLine >= 0) entry_remove(actLine); break; case 2: /* delete highlighted module */ cur = PL_GetEntry(&playlist, actLine); if (!cur) break; if (cur->archive) { name = FIND_LAST_DIRSEP(cur->file); if (name) name++; else name = cur->file; if (strlen(cur->archive) > 60) msg = str_sprintf2("File \"%s\" is in an archive!\n" "Really delete whole archive\n" " \"...%s\"?", name, &(cur-> archive[strlen(cur->archive) - 57])); else msg = str_sprintf2("File \"%s\" is in an archive!\n" "Really delete whole archive\n" " \"%s\"?", name, cur->archive); dlg_message_open(msg, "&Yes|&No", 1, 1, cb_delete_entry, (void *)(SINTPTR_T)actLine); } else { if (strlen(cur->file) > 50) msg = str_sprintf("Delete file \"...%s\"?", &(cur->file[strlen(cur->file) - 47])); else msg = str_sprintf("Delete file \"%s\"?", cur->file); dlg_message_open(msg, "&Yes|&No", 1, 1, cb_delete_entry, (void *)(SINTPTR_T)actLine); } free(msg); break; case 5: /* shuffle list */ PL_Randomize(&playlist); break; case 7: /* cancel */ break; default: return; } /* file menu */ } else if (menu->id == 1) { switch (menu->cur) { case 0: /* load */ freq_open ("Load modules/playlists", config.pl_name, -1, NULL, NULL); break; case 1: /* insert */ freq_open ("Insert modules/playlists", config.pl_name, actLine, NULL, NULL); break; case 2: /* save */ if (!PL_Save(&playlist, config.pl_name)) dlg_error_show("Error saving playlist \"%s\"!",config.pl_name); break; case 3: /* save as */ dlg_input_str("Save playlist as:", "&Browse|<&Ok>|&Cancel", config.pl_name, PATH_MAX, cb_save_as, (void*)(SINTPTR_T)actLine); break; default: return; } /* sort menu */ } else { /* reverse flag */ sort_rev = (SINTPTR_T)menu->entries[5].data; switch (menu->cur) { case 0: /* by name */ sort_mode = SORT_NAME; PL_Sort(&playlist, cb_cmp_sort); break; case 1: /* by extension */ sort_mode = SORT_EXT; PL_Sort(&playlist, cb_cmp_sort); break; case 2: /* by path */ sort_mode = SORT_PATH; PL_Sort(&playlist, cb_cmp_sort); break; case 3: /* by time */ sort_mode = SORT_TIME; PL_Sort(&playlist, cb_cmp_sort); break; default: return; } } menu_close(data->menu); return; } void list_open(int *actLine) { static MENU_DATA menu_data; static MENTRY file_entries[] = { {"&Load...", 0, "Load new playlists/modules"}, {"&Insert...", 0, "Insert new playlists/modules in current playlist"}, {"&Save", 0, NULL}, {"Save &as...", 0, "Save playlist in a specified file"}, {NULL,NULL,NULL} }; static MMENU file_menu = { 0, 0, -1, 1, file_entries, cb_handle_menu, NULL, &menu_data, 1 }; static MENTRY sort_entries[] = { {"by &name", 0, "Sort list by name of modules"}, {"by &extension", 0, "Sort list by extension of modules"}, {"by &path", 0, "Sort list by path of modules/archives"}, {"by &time", 0, "Sort list by playing time of modules"}, {"%---------", 0, NULL}, {"[%c] &reverse", 0, "Smaller to bigger or reverse sort"}, {NULL,NULL,NULL} }; static MMENU sort_menu = { 0, 0, -1, 1, sort_entries, cb_handle_menu, NULL, &menu_data, 2 }; static MENTRY entries[] = { {"&Play", 0, "Play selected entry"}, {"&Remove", 0, "Remove selected entry from list"}, {"&Delete...", 0, "Remove selected entry from list and delete it on disk"}, {"%----------", 0, NULL}, {"&File %>", &file_menu, "Load/Save playlist/modules"}, {"&Shuffle", 0, "Shuffle the list"}, {"S&ort %>", &sort_menu, "Sort the list"}, {"&Back", 0, "Leave menu"}, {NULL,NULL,NULL} }; static MMENU menu = { 0, 0, -1, 1, entries, cb_handle_menu, NULL, &menu_data, 0 }; menu_data.menu = &menu; menu_data.actLine = actLine; set_help(&file_entries[2], "Save list in '%s'", config.pl_name); menu_open(&menu, 5, 5); } mikmod-3.2.9/src/keys.h0000644000000000000000000000404012361532174013420 0ustar rootroot/* MikMod module player (c) 1998-2014 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: keys.h,v 1.1.1.1 2004/01/16 02:07:41 raph Exp $ Various key definitions ==============================================================================*/ #ifndef KEYS_H #define KEYS_H #define CTRL_A 1 #define CTRL_B 2 #define CTRL_D 4 #define CTRL_E 5 #define CTRL_F 6 #define CTRL_K 11 #define CTRL_L 12 #define CTRL_U 21 #define KEY_TAB ('\t') #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) #define KEY_ESC 27 /* '\e' isn't recognized by some compilers */ #define KEY_UP (0x100|72) #define KEY_DOWN (0x100|80) #define KEY_LEFT (0x100|75) #define KEY_RIGHT (0x100|77) #define KEY_NPAGE (0x100|81) #define KEY_PPAGE (0x100|73) #define KEY_HOME (0x100|71) #define KEY_END (0x100|79) #define KEY_ENTER ('\n') #define KEY_DC (127) #define KEY_IC (0x100|82) #define KEY_BACKSPACE (8) #define KEY_F(x) (0x100|(58+(x))) #define KEY_SF(x) (0x100|(83+(x))) #else #ifdef HAVE_NCURSES_H #include #elif defined HAVE_CURSES_H #include #elif defined HAVE_NCURSES_CURSES_H #include #endif #define KEY_ASCII_DEL 127 #define KEY_ASCII_BS ('\b') #endif #endif /* ifndef KEYS_H */ /* ex:set ts=4: */ mikmod-3.2.9/src/mwidget.h0000644000000000000000000001737412255111204014110 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mwidget.h,v 1.1.1.1 2004/01/16 02:07:33 raph Exp $ Widget and Dialog creation functions ==============================================================================*/ #ifndef MWIDGET_H #define MWIDGET_H #include "mwindow.h" #define EVENT_HANDLED 100 #define FOCUS_NEXT (1) /* next widget gets focus */ #define FOCUS_PREV (-1) /* prev widget gets focus */ #define FOCUS_ACTIVATE (EVENT_HANDLED+1) /* button select, return in input field */ #define FOCUS_DONT (EVENT_HANDLED+2) /* on hotkey: action is done (e.g. toggle */ /* button is toggled), focus is not changed */ typedef enum { WID_SEL_SINGLE, WID_SEL_BROWSE } WID_SEL_MODE; typedef enum { WID_GET_FOCUS, WID_HOTKEY, WID_KEY } WID_EVENT; typedef enum { TYPE_LABEL, TYPE_STR, TYPE_INT, TYPE_BUTTON, TYPE_LIST, TYPE_CHECK, TYPE_TOGGLE, TYPE_COLORSEL } WID_TYPE; typedef struct WIDGET WIDGET; typedef struct { int active; /* active widget */ int cnt; /* Nuber of widgets */ ATTRS attrs; /* >=0: use it for DLG_FRAME and DLG_LABEL */ MWINDOW *win; WIDGET **widget; /* the widgets */ } DIALOG; struct WIDGET { WID_TYPE type; BOOL can_focus; /* can the widget have the focus? */ BOOL has_focus; /* has this widget the focus? */ int x, y, width, height; /* pos and size of widget (calculated) */ int def_width, def_height; /* size set by wid_set_size(), can be used */ /* by the widget as a default size */ /* >0 : Number of free lines to last widget =0 : Start of a new column of widget <0 : Start of a new row of columns of widgets, value is spacing between this and the previous row */ int spacing; DIALOG *d; void (*w_free) (WIDGET *w); void (*w_paint) (WIDGET *w); int (*w_handle_event) (WIDGET *w, WID_EVENT event, int ch); void (*w_get_size) (WIDGET *w, int *width, int *height); int (*handle_key) (WIDGET *w, int ch); int (*handle_focus) (WIDGET *w, int focus); void *data; /* not used by widget functions */ }; /* called on key press, back: +/-n : Widget n entries before/behind Widget w gets the focus EVENT_HANDLED: Key is not processed any more 0 : key is processed by the widgets own handleEventFunc */ typedef int (*handleKeyFunc) (WIDGET *w, int ch); /* called on focus loose with FOCUS_NEXT, FOCUS_PREV, or FOCUS_ACTIVATE, back: EVENT_HANDLED, FOCUS_ACTIVATE, +/-n, or 0 */ typedef int (*handleFocusFunc) (WIDGET *w, int focus); /* Free substructs of w and w itself */ typedef void (*freeFunc) (WIDGET *w); /* Display widget w */ typedef void (*paintFunc) (WIDGET *w); /* GET_FOCUS: Widget w gets the focus ch: -1: Last active widget was behind the new one 1: Last active widget was before the new one HOTKEY: ch: The Key which was pressed back: FOCUS_ACTIVATE: Widget w gets the focus EVENT_HANDLED : Focus is not changed, Key is not processed any more, e.g. necessary if function closes the dialog KEY: Key ch was pressed back: +/-n : Widget n entries before/behind Widget w gets the focus EVENT_HANDLED: Key is not processed any more 0 : event HOTKEY is send to the widgets */ typedef int (*handleEventFunc) (WIDGET *w, WID_EVENT event, int ch); /* Return the size of widget w Input: preferred maximal size */ typedef void (*getSizeFunc) (WIDGET *w, int *width, int *height); typedef struct { WIDGET w; char *msg; } WID_LABEL; typedef struct { WIDGET w; char *input; int cur_pos; /* cursor position */ int start; /* first visible char */ int length; /* max length of input */ } WID_STR; typedef struct { WIDGET w; char *input; int cur_pos; /* cursor position */ int start; /* first visible char */ int length; /* max length of input */ } WID_INT; typedef struct { WIDGET w; char *button; /* &but1|but2|... */ int cnt; /* number of buttons */ int active; /* active button */ } WID_BUTTON; typedef struct { WIDGET w; int cur; /* selected entry */ int first; /* first line of list which is displayed */ int cnt; /* number of list entries */ char **entries; /* the list entries */ char *title; WID_SEL_MODE sel_mode; /* SINGLE: call of handle_focus() only on return */ } WID_LIST; /* BROWSE: call of handle_focus() when cur changes */ typedef struct { WIDGET w; char *button; /* &but1|but2\nbu&t3\n... */ int cnt; /* number of buttons */ int selected; /* selected buttons */ int active; /* active button */ } WID_CHECK; typedef struct { WIDGET w; char *button; /* &but1|but2\nbu&t3\n... */ int cnt; /* number of buttons */ int selected; /* selected buttons */ int active; /* active button */ } WID_TOGGLE; typedef struct { WIDGET w; int active; /* selected color */ char hkeys[5]; /* hotkeys to move the selector <>^v */ WID_SEL_MODE sel_mode; /* SINGLE: call of handle_focus() only on return */ } WID_COLORSEL; /* BROWSE: call of handle_focus() when cur changes */ /* spacing: >0 : Number of free lines to last widget =0 : Start of a new column of widget <0 : Start of a new row of columns of widgets, value is spacing between this and the previous row */ WIDGET *wid_label_add(DIALOG *d, int spacing, const char *msg); void wid_label_set_label (WID_LABEL *w, const char *label); WIDGET *wid_str_add(DIALOG *d, int spacing, const char *input, int length); void wid_str_set_input (WID_STR *w, const char *input, int length); WIDGET *wid_int_add(DIALOG *d, int spacing, int value, int length); void wid_int_set_input(WID_INT *w, int value, int length); WIDGET *wid_button_add(DIALOG *d, int spacing, const char *button, int active); WIDGET *wid_list_add(DIALOG *d, int spacing, const char **entries, int cnt); void wid_list_set_title(WID_LIST *w, const char *title); void wid_list_set_entries(WID_LIST *w, const char **entries, int cur, int cnt); void wid_list_set_active(WID_LIST *w, int cur); void wid_list_set_selection_mode (WID_LIST *w, WID_SEL_MODE mode); WIDGET *wid_check_add(DIALOG *d, int spacing, const char *button, int selected, int active); void wid_check_set_selected(WID_CHECK *w, int selected); WIDGET *wid_toggle_add(DIALOG *d, int spacing, const char *button, int selected, int active); void wid_toggle_set_selected(WID_TOGGLE *w, int selected); WIDGET *wid_colorsel_add(DIALOG *d, int spacing, const char *hotkeys, int active); void wid_colorsel_set_active(WID_COLORSEL *w, int active); /* Set default size of widget, -1: ignore value */ void wid_set_size (WIDGET *w, int width, int height); void wid_set_func(WIDGET *w, handleKeyFunc key, handleFocusFunc focus, void *data); void wid_repaint (WIDGET *w); DIALOG *dialog_new(void); void dialog_open(DIALOG *d, const char *title); /* set attribute which is used for DLG_FRAME and DLG_LABEL, works only before dialog_open() */ void dialog_set_attr (DIALOG *d, ATTRS attrs); BOOL dialog_repaint(MWINDOW *win); void dialog_close(DIALOG *d); #endif /* MWIDGET_H */ /* ex:set ts=4: */ mikmod-3.2.9/src/mconfig.h0000644000000000000000000001655012276756040014105 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mconfig.h,v 1.3 2004/01/29 03:09:23 raph Exp $ Configuration file management ==============================================================================*/ #ifndef MCONFIG_H #define MCONFIG_H #include #include "rcfile.h" #define RENICE_NONE 0 #define RENICE_PRI 1 #define RENICE_REAL 2 /*========== Color and attribute definitions */ #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) #define A_REVERSE 0x70 #define A_NORMAL 0x07 #define A_BOLD 0x0f #endif #define COLOR_BLACK_B 0x00 #define COLOR_BLUE_B 0x10 #define COLOR_GREEN_B 0x20 #define COLOR_CYAN_B 0x30 #define COLOR_RED_B 0x40 #define COLOR_MAGENTA_B 0x50 #define COLOR_BROWN_B 0x60 #define COLOR_GRAY_B 0x70 #define COLOR_BMASK 0x70 #define COLOR_BSHIFT 4 #define COLOR_BLACK_F 0x00 #define COLOR_BLUE_F 0x01 #define COLOR_GREEN_F 0x02 #define COLOR_CYAN_F 0x03 #define COLOR_RED_F 0x04 #define COLOR_MAGENTA_F 0x05 #define COLOR_BROWN_F 0x06 #define COLOR_GRAY_F 0x07 #define COLOR_DGRAY_F 0x08 #define COLOR_LBLUE_F 0x09 #define COLOR_LGREEN_F 0x0a #define COLOR_LCYAN_F 0x0b #define COLOR_LRED_F 0x0c #define COLOR_LMAGENTA_F 0x0d #define COLOR_YELLOW_F 0x0e #define COLOR_WHITE_F 0x0f #define COLOR_FMASK 0x07 #define COLOR_FSHIFT 0 #define COLOR_BOLDMASK 0x08 #define COLOR_CNT 8 /* These are the color table indices for win_attrset(); to the right in comment brackets are the default values for monochrome palette */ typedef enum { ATTR_NONE=-1, ATTR_WARNING, /* A_REVERSE */ ATTR_TITLE, /* A_REVERSE */ ATTR_BANNER, /* A_NORMAL */ ATTR_SONG_STATUS, /* A_NORMAL */ ATTR_INFO_INACTIVE, /* A_REVERSE */ ATTR_INFO_ACTIVE, /* A_NORMAL */ ATTR_INFO_IHOTKEY, /* A_NORMAL */ ATTR_INFO_AHOTKEY, /* A_NORMAL */ ATTR_HELP, /* A_NORMAL */ ATTR_PLAYENTRY_INACTIVE,/* A_NORMAL */ ATTR_PLAYENTRY_ACTIVE, /* A_REVERSE */ ATTR_SAMPLES, /* A_NORMAL */ ATTR_SAMPLES_KICK3, /* A_BOLD */ ATTR_SAMPLES_KICK2, /* A_NORMAL */ ATTR_SAMPLES_KICK1, /* A_NORMAL */ ATTR_SAMPLES_KICK0, /* A_NORMAL */ ATTR_CONFIG, /* A_NORMAL */ ATTR_VOLBAR, /* A_NORMAL */ ATTR_VOLBAR_LOW, /* A_NORMAL */ ATTR_VOLBAR_MED, /* A_NORMAL */ ATTR_VOLBAR_HIGH, /* A_BOLD */ ATTR_VOLBAR_INSTR, /* A_NORMAL */ ATTR_MENU_FRAME, /* A_REVERSE */ ATTR_MENU_INACTIVE, /* A_REVERSE */ ATTR_MENU_ACTIVE, /* A_NORMAL */ ATTR_MENU_IHOTKEY, /* A_NORMAL */ ATTR_MENU_AHOTKEY, /* A_REVERSE */ ATTR_DLG_FRAME, /* A_REVERSE */ ATTR_DLG_LABEL, /* A_REVERSE */ ATTR_DLG_STR_TEXT, /* A_NORMAL */ ATTR_DLG_STR_CURSOR, /* A_REVERSE */ ATTR_DLG_BUT_INACTIVE, /* A_REVERSE */ ATTR_DLG_BUT_ACTIVE, /* A_BOLD */ ATTR_DLG_BUT_IHOTKEY, /* A_NORMAL */ ATTR_DLG_BUT_AHOTKEY, /* A_REVERSE */ ATTR_DLG_BUT_ITEXT, /* A_REVERSE */ ATTR_DLG_BUT_ATEXT, /* A_BOLD */ ATTR_DLG_LIST_FOCUS, /* A_BOLD */ ATTR_DLG_LIST_NOFOCUS, /* A_NORMAL */ ATTR_STATUS_LINE, /* A_NORMAL */ ATTR_STATUS_TEXT /* A_NORMAL */ } ATTRS; #define ATTRS_COUNT ((int)ATTR_STATUS_TEXT+1) #define THEME_COLOR 0 #define THEME_MONO 1 #define THEME_COUNT 2 /* number of program intern themes */ #define THEME_NAME_LEN 99 /* max length of theme name */ extern const char *attrs_label[ATTRS_COUNT]; /* "WARNING", "TITLE", ... */ typedef struct { char *name; /* name of the theme */ BOOL color; /* color or mono */ int *attrs; /* attributes for the different screen elements */ } THEME; typedef struct { int location; /* if < 0, file extensions are checked */ char *marker; /* signature or possible file extensions */ char *list; int nameoffset; /* position of file name in list output */ char *extract; char *skippat; int skipstart, skipend; /* lines to skip in the extracted file */ } ARCHIVE; typedef struct { int driver; /* nth driver for output */ #if LIBMIKMOD_VERSION >= 0x030107 char *driveroptions; #endif BOOL stereo; /* mono/stereo output */ BOOL mode_16bit; /* 8/16 bit output */ int frequency; /* mixing frequency */ BOOL interpolate; /* Use interpolate mixing */ BOOL hqmixer; /* Use high-quality (but slow) mixer */ BOOL surround; /* surround mixing */ int reverb; /* reverb amount (0-15) */ int volume; /* volume from 0% (silence) to 100% */ BOOL volrestrict; /* restrict playervolume to volume supplied by user */ BOOL fade; /* allow volume fade at the end of the module */ BOOL loop; /* allow in-module loops */ BOOL panning; /* process panning effects */ BOOL extspd; /* extended protracker effects */ int playmode; /* PM_MODULE | PM_MULTI | PM_SHUFFLE | PM_RANDOM */ BOOL curious; /* look for hidden patterns in module */ BOOL tolerant; /* don't halt on file access errors */ int renice; /* RENICE_xxx */ int statusbar; /* size of statusbar */ BOOL save_config; /* save config on exit */ BOOL save_playlist; /* save playlist on exit */ char *pl_name; /* current playlist name */ int cnt_hotlist; /* size of next entry */ char **hotlist; /* entries in the directory hotlist */ BOOL fullpaths; /* display full path of the filenames */ #if LIBMIKMOD_VERSION >= 0x030200 BOOL forcesamples; /* always display sample names in bars panel */ BOOL fakevolbars; /* display fast, not accurate, volume bars */ #endif BOOL window_title; /* set the title in xterm (or equivalent) */ int theme; /* active theme */ int cnt_themes; /* size of next entry */ THEME *themes; /* the known themes (color definitions) */ int cnt_archiver; /* size of next entry */ ARCHIVE *archiver; /* definition of archivers (lha tar, ...) */ } CONFIG; extern CONFIG config; char *CF_GetFilename(void); void CF_theme_free (THEME *theme); void CF_theme_copy (THEME*dest, THEME *src); /* Free all themes and return {NULL, 0} */ void CF_themes_free (THEME **themes, int *cnt); /* Free the user themes (themes above THEME_COUNT) */ void CF_themes_free_user (THEME **themes, int *cnt); /* Free the theme at 'pos' in the array themes (length: cnt) */ void CF_theme_remove (int pos, THEME **themes, int *cnt); /* Copy theme and insert it alphabetically sorted in themes (after the intern themes). cnt: size of the array themes Return: position of insertion */ int CF_theme_insert (THEME **themes, int *cnt, THEME *theme); void CF_string_array_insert (int pos, char ***value, int *cnt, char *arg, int length); void CF_string_array_remove (int pos, char ***value, int *cnt); void CF_Init(CONFIG * cfg); BOOL CF_Save(CONFIG * cfg); BOOL CF_Load(CONFIG * cfg); void Player_SetConfig(CONFIG * cfg); #endif /* ex:set ts=4: */ mikmod-3.2.9/src/mfnmatch.c0000644000000000000000000001450313743515624014250 0ustar rootroot/* $OpenBSD: fnmatch.c,v 1.13 2006/03/31 05:34:14 deraadt Exp $ */ /* * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Guido van Rossum. * * 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 University 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 REGENTS 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 REGENTS 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. */ /* * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6. * Compares a filename or pathname to a pattern. */ #include #include #include #include "mfnmatch.h" #define EOS '\0' #define RANGE_MATCH 1 #define RANGE_NOMATCH 0 #define RANGE_ERROR (-1) /* Limit of recursion during matching attempts. */ #define __FNM_MAX_RECUR 64 static int rangematch(const char *, char, int, char **); static int __fnmatch(const char *, const char *, int, int); int fnmatch(const char *pattern, const char *string, int flags) { int e; e = __fnmatch(pattern, string, flags, __FNM_MAX_RECUR); if (e == -1) e = FNM_NOMATCH; return (e); } static int __fnmatch(const char *pattern, const char *string, int flags, int recur) { const char *stringstart; char *newp; char c, test; int e; if (recur-- == 0) return (-1); for (stringstart = string;;) switch (c = *pattern++) { case EOS: if ((flags & FNM_LEADING_DIR) && *string == '/') return (0); return (*string == EOS ? 0 : FNM_NOMATCH); case '?': if (*string == EOS) return (FNM_NOMATCH); if (*string == '/' && (flags & FNM_PATHNAME)) return (FNM_NOMATCH); if (*string == '.' && (flags & FNM_PERIOD) && (string == stringstart || ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) return (FNM_NOMATCH); ++string; break; case '*': c = *pattern; /* Collapse multiple stars. */ while (c == '*') c = *++pattern; if (*string == '.' && (flags & FNM_PERIOD) && (string == stringstart || ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) return (FNM_NOMATCH); /* Optimize for pattern with * at end or before /. */ if (c == EOS) { if (flags & FNM_PATHNAME) return ((flags & FNM_LEADING_DIR) || strchr(string, '/') == NULL ? 0 : FNM_NOMATCH); else return (0); } else if (c == '/' && (flags & FNM_PATHNAME)) { if ((string = strchr(string, '/')) == NULL) return (FNM_NOMATCH); break; } /* General case, use recursion. */ while ((test = *string) != EOS) { e = __fnmatch(pattern, string, flags & ~FNM_PERIOD, recur); if (e != FNM_NOMATCH) return (e); if (test == '/' && (flags & FNM_PATHNAME)) break; ++string; } return (FNM_NOMATCH); case '[': if (*string == EOS) return (FNM_NOMATCH); if (*string == '/' && (flags & FNM_PATHNAME)) return (FNM_NOMATCH); if (*string == '.' && (flags & FNM_PERIOD) && (string == stringstart || ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) return (FNM_NOMATCH); switch (rangematch(pattern, *string, flags, &newp)) { case RANGE_ERROR: /* not a good range, treat as normal text */ goto normal; case RANGE_MATCH: pattern = newp; break; case RANGE_NOMATCH: return (FNM_NOMATCH); } ++string; break; case '\\': if (!(flags & FNM_NOESCAPE)) { if ((c = *pattern++) == EOS) { c = '\\'; --pattern; } } /* FALLTHROUGH */ default: normal: if (c != *string && !((flags & FNM_CASEFOLD) && (tolower((unsigned char)c) == tolower((unsigned char)*string)))) return (FNM_NOMATCH); ++string; break; } /* NOTREACHED */ } static int rangematch(const char *pattern, char test, int flags, char **newp) { int negate, ok; char c, c2; /* * A bracket expression starting with an unquoted circumflex * character produces unspecified results (IEEE 1003.2-1992, * 3.13.2). This implementation treats it like '!', for * consistency with the regular expression syntax. * J.T. Conklin (conklin@ngai.kaleida.com) */ if ((negate = (*pattern == '!' || *pattern == '^'))) ++pattern; if (flags & FNM_CASEFOLD) test = (char)tolower((unsigned char)test); /* * A right bracket shall lose its special meaning and represent * itself in a bracket expression if it occurs first in the list. * -- POSIX.2 2.8.3.2 */ ok = 0; c = *pattern++; do { if (c == '\\' && !(flags & FNM_NOESCAPE)) c = *pattern++; if (c == EOS) return (RANGE_ERROR); if (c == '/' && (flags & FNM_PATHNAME)) return (RANGE_NOMATCH); if ((flags & FNM_CASEFOLD)) c = (char)tolower((unsigned char)c); if (*pattern == '-' && (c2 = *(pattern+1)) != EOS && c2 != ']') { pattern += 2; if (c2 == '\\' && !(flags & FNM_NOESCAPE)) c2 = *pattern++; if (c2 == EOS) return (RANGE_ERROR); if (flags & FNM_CASEFOLD) c2 = (char)tolower((unsigned char)c2); if (c <= test && test <= c2) ok = 1; } else if (c == test) ok = 1; } while ((c = *pattern++) != ']'); *newp = (char *)pattern; return (ok == negate ? RANGE_NOMATCH : RANGE_MATCH); } mikmod-3.2.9/src/getopt_long.h0000644000000000000000000000517313743515624015004 0ustar rootroot/* $OpenBSD: getopt.h,v 1.3 2013/11/22 21:32:49 millert Exp $ */ /* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Dieter Baron and Thomas Klausner. * * 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. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. */ #ifndef _GETOPT_H_ #define _GETOPT_H_ /* * GNU-like getopt_long() */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 struct option { /* name of long option */ const char *name; /* * one of no_argument, required_argument, and optional_argument: * whether option takes an argument */ int has_arg; /* if not NULL, set *flag to val when option found */ int *flag; /* if flag not NULL, value to set *flag to; else return value */ int val; }; #if defined(__cplusplus) extern "C" { #endif int getopt_long(int, char * const *, const char *, const struct option *, int *); int getopt_long_only(int, char * const *, const char *, const struct option *, int *); #ifndef _GETOPT_DEFINED_ #define _GETOPT_DEFINED_ int getopt(int, char * const *, const char *); extern char *optarg; /* getopt(3) external variables */ extern int opterr; extern int optind; extern int optopt; extern int optreset; #endif #if defined(__cplusplus) } #endif #endif /* !_GETOPT_H_ */ mikmod-3.2.9/src/Makefile.in0000644000000000000000000006131114734750516014355 0ustar rootroot# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = mikmod$(EXEEXT) subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_recursive_eval.m4 \ $(top_srcdir)/m4/libmikmod.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_mikmod_OBJECTS = display.$(OBJEXT) marchive.$(OBJEXT) \ mikmod.$(OBJEXT) mlist.$(OBJEXT) mconfig.$(OBJEXT) \ mwindow.$(OBJEXT) mmenu.$(OBJEXT) mwidget.$(OBJEXT) \ mdialog.$(OBJEXT) mconfedit.$(OBJEXT) mutilities.$(OBJEXT) \ mplayer.$(OBJEXT) mlistedit.$(OBJEXT) rcfile.$(OBJEXT) mikmod_OBJECTS = $(am_mikmod_OBJECTS) mikmod_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(mikmod_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/display.Po \ ./$(DEPDIR)/getopt_long.Po ./$(DEPDIR)/marchive.Po \ ./$(DEPDIR)/mconfedit.Po ./$(DEPDIR)/mconfig.Po \ ./$(DEPDIR)/mdialog.Po ./$(DEPDIR)/mfnmatch.Po \ ./$(DEPDIR)/mikmod.Po ./$(DEPDIR)/mlist.Po \ ./$(DEPDIR)/mlistedit.Po ./$(DEPDIR)/mmenu.Po \ ./$(DEPDIR)/mplayer.Po ./$(DEPDIR)/musleep.Po \ ./$(DEPDIR)/mutilities.Po ./$(DEPDIR)/mwidget.Po \ ./$(DEPDIR)/mwindow.Po ./$(DEPDIR)/rcfile.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(mikmod_SOURCES) $(EXTRA_mikmod_SOURCES) DIST_SOURCES = $(mikmod_SOURCES) $(EXTRA_mikmod_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/autotools/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXTRA_OBJ = @EXTRA_OBJ@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLAYER_LIB = @PLAYER_LIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = @LIBMIKMOD_CFLAGS@ man_MANS = mikmod.1 mikmod_SOURCES = \ display.c marchive.c mikmod.c mlist.c mconfig.c mwindow.c mmenu.c \ mwidget.c mdialog.c mconfedit.c mutilities.c mplayer.c mlistedit.c \ rcfile.c noinst_HEADERS = \ display.h keys.h marchive.h mconfedit.h mconfig.h mdialog.h mlist.h \ mlistedit.h mmenu.h mplayer.h mthreads.h mutilities.h mwidget.h \ mwindow.h player.h rcfile.h EXTRA_mikmod_SOURCES = \ mfnmatch.c getopt_long.c musleep.c EXTRA_DIST = CMakeLists.txt \ dosvideo.inc os2video.inc winvideo.inc mfnmatch.h getopt_long.h $(man_MANS) mikmod_LDFLAGS = @LIBMIKMOD_LDADD@ mikmod_LDADD = @EXTRA_OBJ@ @LIBMIKMOD_LIBS@ @PLAYER_LIB@ mikmod_DEPENDENCIES = @EXTRA_OBJ@ all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) mikmod$(EXEEXT): $(mikmod_OBJECTS) $(mikmod_DEPENDENCIES) $(EXTRA_mikmod_DEPENDENCIES) @rm -f mikmod$(EXEEXT) $(AM_V_CCLD)$(mikmod_LINK) $(mikmod_OBJECTS) $(mikmod_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/display.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt_long.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/marchive.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mconfedit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mconfig.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mdialog.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mfnmatch.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mikmod.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlist.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlistedit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmenu.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mplayer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/musleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mutilities.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mwidget.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mwindow.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rcfile.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/display.Po -rm -f ./$(DEPDIR)/getopt_long.Po -rm -f ./$(DEPDIR)/marchive.Po -rm -f ./$(DEPDIR)/mconfedit.Po -rm -f ./$(DEPDIR)/mconfig.Po -rm -f ./$(DEPDIR)/mdialog.Po -rm -f ./$(DEPDIR)/mfnmatch.Po -rm -f ./$(DEPDIR)/mikmod.Po -rm -f ./$(DEPDIR)/mlist.Po -rm -f ./$(DEPDIR)/mlistedit.Po -rm -f ./$(DEPDIR)/mmenu.Po -rm -f ./$(DEPDIR)/mplayer.Po -rm -f ./$(DEPDIR)/musleep.Po -rm -f ./$(DEPDIR)/mutilities.Po -rm -f ./$(DEPDIR)/mwidget.Po -rm -f ./$(DEPDIR)/mwindow.Po -rm -f ./$(DEPDIR)/rcfile.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/display.Po -rm -f ./$(DEPDIR)/getopt_long.Po -rm -f ./$(DEPDIR)/marchive.Po -rm -f ./$(DEPDIR)/mconfedit.Po -rm -f ./$(DEPDIR)/mconfig.Po -rm -f ./$(DEPDIR)/mdialog.Po -rm -f ./$(DEPDIR)/mfnmatch.Po -rm -f ./$(DEPDIR)/mikmod.Po -rm -f ./$(DEPDIR)/mlist.Po -rm -f ./$(DEPDIR)/mlistedit.Po -rm -f ./$(DEPDIR)/mmenu.Po -rm -f ./$(DEPDIR)/mplayer.Po -rm -f ./$(DEPDIR)/musleep.Po -rm -f ./$(DEPDIR)/mutilities.Po -rm -f ./$(DEPDIR)/mwidget.Po -rm -f ./$(DEPDIR)/mwindow.Po -rm -f ./$(DEPDIR)/rcfile.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-binPROGRAMS install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile getopt_long.o: $(srcdir)/getopt_long.c $(srcdir)/getopt_long.h $(COMPILE) -o $@ -c $(srcdir)/getopt_long.c mfnmatch.o: $(srcdir)/mfnmatch.c $(srcdir)/mfnmatch.h $(COMPILE) -o $@ -c $(srcdir)/mfnmatch.c musleep.o: $(srcdir)/musleep.c $(COMPILE) -o $@ -c $(srcdir)/musleep.c # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mikmod-3.2.9/src/winvideo.inc0000644000000000000000000002133712350755760014631 0ustar rootroot/* MikMod module player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: winvideo.inc,v 1.1.1.1 2004/01/16 02:07:45 raph Exp $ Windows console i/o routines ==============================================================================*/ #include struct SCREEN { WORD act_attr; char *changed; CHAR_INFO *text; SHORT minx,miny,maxx,maxy; } screen = {A_NORMAL, NULL, NULL, 0, 0, 0, 0}; static HANDLE WINAPI GetConHandle (const TCHAR *name) { SECURITY_ATTRIBUTES sa; sa.nLength = sizeof(sa); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = TRUE; return CreateFile (name, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, &sa, OPEN_EXISTING, (DWORD) 0, (HANDLE) 0); } #define GetConOut() GetConHandle(TEXT("CONOUT$")) #define GetConIn() GetConHandle(TEXT("CONIN$")) static void console_store (BOOL restore) { HANDLE conOut; COORD bufSize, bufOrg; SMALL_RECT srSource; static int oldx = -1, oldy = -1; static CHAR_INFO *screen_content = NULL; if (!restore && (oldx!=winx || oldy!=winy)) { screen_content = (CHAR_INFO *) realloc(screen_content, sizeof(CHAR_INFO)*winx*winy); oldx = winx; oldy = winy; } if (!screen_content) return; conOut = GetConOut(); if (conOut == INVALID_HANDLE_VALUE) return; srSource.Left = screen.minx; srSource.Top = screen.miny; srSource.Right = screen.maxx; srSource.Bottom = screen.maxy; bufSize.X = srSource.Right - srSource.Left + 1; bufSize.Y = srSource.Bottom - srSource.Top + 1; bufOrg.X = 0; bufOrg.Y = 0; if (restore) WriteConsoleOutput (conOut, screen_content, bufSize, bufOrg, &srSource); else ReadConsoleOutput (conOut, screen_content, bufSize, bufOrg, &srSource); CloseHandle (conOut); } static void console_get_size (SHORT *minx, SHORT *miny, SHORT *maxx, SHORT *maxy) { HANDLE conOut; CONSOLE_SCREEN_BUFFER_INFO bufInfo; conOut = GetConOut(); if (conOut != INVALID_HANDLE_VALUE) { if (GetConsoleScreenBufferInfo (conOut, &bufInfo)) { *minx = bufInfo.srWindow.Left; *miny = bufInfo.srWindow.Top; *maxx = bufInfo.srWindow.Right; *maxy = bufInfo.srWindow.Bottom; } CloseHandle (conOut); } } static void screen_alloc (void) { int oldx = screen.maxx-screen.minx+1; int oldy = screen.maxy-screen.miny+1; int x, y; console_get_size (&screen.minx, &screen.miny, &screen.maxx, &screen.maxy); winx = screen.maxx-screen.minx+1; winy = screen.maxy-screen.miny+1; screen.changed = (char *) realloc (screen.changed, winx*winy); screen.text = (CHAR_INFO *) realloc(screen.text, sizeof(CHAR_INFO)*winx*winy); for (y=0; y=winy) return; if (x<0) { str -= x; len += x; x = 0; } d = y*winx+x; for (i=0; iwidth - x; if (len > 0) { memset(storage, ' ', len); mvaddnstr(win->y + y, win->x + x, storage, len); } } void gotoxy (int x, int y) { HANDLE conOut; COORD coord; conOut = GetConOut(); if (conOut != INVALID_HANDLE_VALUE) { coord.X = screen.minx + x; coord.Y = screen.miny + y; SetConsoleCursorPosition (conOut, coord); CloseHandle (conOut); } } void win_cursor_set(BOOL visible) { HANDLE conOut; CONSOLE_CURSOR_INFO cci; conOut = GetConOut(); if (conOut != INVALID_HANDLE_VALUE) { GetConsoleCursorInfo (conOut, &cci); cci.bVisible = visible; SetConsoleCursorInfo (conOut, &cci); CloseHandle (conOut); } } void win_refresh(void) { int x, y, d, start; HANDLE conOut; COORD bufSize, bufOrg; SMALL_RECT srDest; conOut = GetConOut(); if (conOut == INVALID_HANDLE_VALUE) return; for (y=0; y=winx) break; d--; x = start; while (screen.changed[++d] && x 0) { ReadConsoleInputA (conIn, &input, 1, &nread); if (input.EventType == KEY_EVENT && input.Event.KeyEvent.bKeyDown) { KEY_EVENT_RECORD *key = &input.Event.KeyEvent; if (key->uChar.AsciiChar > 0) { ch = key->uChar.AsciiChar; } else { DWORD control = key->dwControlKeyState & ~CAPSLOCK_ON; ch = 0x100 | key->wVirtualScanCode; if (control == SHIFT_PRESSED && (ch >= KEY_F(1) && ch <= KEY_F(10))) { ch = KEY_SF(1) + ch - KEY_F(1); } else if ((control & ENHANCED_KEY) || control == 0) { if (key->wVirtualScanCode == 83) ch = KEY_DC; } else ch = 0; } } else if (input.EventType == WINDOW_BUFFER_SIZE_EVENT) { /* new size: input.Event.WindowBufferSizeEvent.dwSize.{X|Y} */ resize_window(); } GetNumberOfConsoleInputEvents (conIn, &nevents); } CloseHandle (conIn); return ch; } mikmod-3.2.9/src/display.c0000644000000000000000000010124014550611122014076 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: display.c,v 1.8 2004/02/02 01:35:52 raph Exp $ Display routines for the different panels and the playlist menu ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include #include #include #include "display.h" #include "player.h" #include "mconfig.h" #include "mlist.h" #include "mutilities.h" #include "mwindow.h" #include "mconfedit.h" #include "keys.h" #include "mplayer.h" #include "mlistedit.h" /*========== Display layout */ /* minimum width of one column */ #define MINWIDTH 20 /* minimum width of second column */ #define MINVISIBLE 10 /* half width */ static int halfwidth; /* format used for message/banner lines : like "%-80.80s" */ static char fmt_fullwidth[32]; /* format used for sample/instrument lines - like "%3i %-35.35s" (the big number being halfwidth-5) */ static char fmt_halfwidth[32]; /* start of information panels */ #define PANEL_Y 7 #if LIBMIKMOD_VERSION >= 0x030200 static MP_DATA playdata; /* The characters used to represent different visual things */ #define CHAR_AMPLITUDE1 '=' #define CHAR_AMPLITUDE0 '-' #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) #define CHAR_SAMPLE_KICK3 '*' #define CHAR_SAMPLE_KICK2 '\x07' #define CHAR_SAMPLE_KICK1 '\xf9' #define CHAR_SAMPLE_KICK0 '\xfa' #else #define CHAR_SAMPLE_KICK3 '@' #define CHAR_SAMPLE_KICK2 'O' #define CHAR_SAMPLE_KICK1 'o' #define CHAR_SAMPLE_KICK0 '.' #endif static char samp_char[4] = { CHAR_SAMPLE_KICK0, CHAR_SAMPLE_KICK1, CHAR_SAMPLE_KICK2, CHAR_SAMPLE_KICK3 }; static ATTRS samp_attr[4] = { ATTR_SAMPLES_KICK0, ATTR_SAMPLES_KICK1, ATTR_SAMPLES_KICK2, ATTR_SAMPLES_KICK3 }; /* The routine for dynamically repainting current panel */ static void (*dynamic_repaint) (MWINDOW *win) = NULL; static MWINDOW *dynamic_repaint_win; #endif static void display_title(void); static void set_window_title(const char *content); /*========== Variables */ extern BOOL quiet; extern MODULE *mf; static MWINDOW *root; static int cur_display = DISPLAY_SAMPLE, old_display = DISPLAY_SAMPLE; /* first line of displayed information in the panels */ static int first_help = 0; static int first_sample = 0; static int first_inst = 0; static int first_comment = 0; static int first_list = 0; #if LIBMIKMOD_VERSION >= 0x030200 static int first_volbar = 0; #endif /* computes printf templates when screen size changes, so that two-column display fills the screen */ static void setup_printf(void) { int maxx, winy; win_get_size(root, &maxx, &winy); if (maxx > MAXWIDTH) maxx = MAXWIDTH; if (maxx < 0) maxx = 0; halfwidth = maxx >> 1; if (halfwidth < MINWIDTH) halfwidth = MINWIDTH; SNPRINTF(fmt_fullwidth, sizeof(fmt_fullwidth), "%%-%d.%ds", maxx, maxx); SNPRINTF(fmt_halfwidth, sizeof(fmt_halfwidth), "%%3i %%-%d.%ds", halfwidth - 5, halfwidth - 5); } /* enlarges a text line to fill the root window width */ static void enlarge (int x, char *str) { int winx, winy, len; win_get_size(root, &winx, &winy); winx -= x; len = strlen (str); if (len < winx) memset(str + len, ' ', winx - len); if (winx>=0) str[winx] = '\0'; } /* first line : MikMod version */ static void display_version(void) { if (quiet) return; strcpy (storage,mikversion); enlarge (0,storage); win_attrset(ATTR_TITLE); win_print(root, 0, 0, storage); } static BOOL remove_msg = 0; static time_t start_time; static char old_message[STORAGELEN + 1]; /* displays a warning message on the top right corner of the display */ void display_message(char *str) { int len = strlen(str)+1; if (quiet) return; if (len > STORAGELEN) len = STORAGELEN; old_message[0] = ' '; strncpy(&old_message[1], str, len-1); old_message[len] = '\0'; enlarge (strlen(mikversion),old_message); win_attrset(ATTR_WARNING); win_print(root, strlen(mikversion), 0, str); remove_msg = 1; start_time = time(NULL); } /* changes the warning message */ static void update_message(void) { if (remove_msg && old_message[0]) { win_attrset(ATTR_WARNING); win_print(root, strlen(mikversion), 0, old_message); } } /* removes the warning message */ static void remove_message(void) { if (remove_msg) { time_t end_time = time(NULL); if (end_time - start_time >= 6) { display_version(); remove_msg = 0; } } } /* display a banner/message from line skip, at position origin returns updated skip value if it is out of bounds and would prevent the message from being seen. */ static int display_banner(MWINDOW *win, const char *banner, int origin, int skip, BOOL wrap) { const char *buf = banner; char str[MAXWIDTH + 1]; int i, n, t, winx, winy; win_get_size(win, &winx, &winy); if (winx < 5 || winy < 1) return skip; /* count message lines */ for (t = 0; *buf; t++) { n = 0; while ((((n < winx) && (n < MAXWIDTH)) || (!wrap)) && (*buf != '\r') && (*buf != '\n') && (*buf)) buf++, n++; if ((*buf == '\r') || (*buf == '\n')) buf++; } /* update skip value */ if (skip < 0) skip = 0; if (skip + winy - origin > t) skip = t - winy + origin; if (skip < 0) skip = 0; if (t - skip + origin > winy) t = winy - origin + skip; /* skip first lines */ buf = banner; for (i = 0; i < skip && i < t; i++) { n = 0; while ((((n < winx) && (n < MAXWIDTH)) || (!wrap)) && ((*buf != '\r') && (*buf != '\n') && (*buf))) buf++, n++; if ((*buf == '\r') || (*buf == '\n')) buf++; } /* display lines */ for (i = skip; i < t; i++) { for (n = 0; (((n < winx) && (n < MAXWIDTH)) || (!wrap)) && (*buf != '\r') && (*buf != '\n') && (*buf); buf++) { if (*buf < ' ') str[n] = ' '; else str[n] = *buf; if (n < MAXWIDTH) n++; } if ((*buf == '\r') || (*buf == '\n')) buf++; if (n) { str[n] = '\0'; SNPRINTF(storage, STORAGELEN, fmt_fullwidth, str); win_print(win, 0, i - skip + origin, storage); } else win_clrtoeol(win, 0, i - skip + origin); } if (!origin) /* clear to bottom of window */ for(i += origin - skip; i < winy; i++) win_clrtoeol(win, 0, i); return skip; } /* displays the "paused" banner */ void display_pausebanner(void) { if (quiet) return; win_attrset(ATTR_BANNER); display_banner(root, pausebanner, 1, 0, 0); } /* display the "extracting" banner */ void display_extractbanner(void) { if (quiet) return; win_attrset(ATTR_BANNER); display_banner(root, extractbanner, 1, 0, 0); win_refresh(); } /* display the "loading" banner */ void display_loadbanner(void) { if (quiet) return; win_attrset(ATTR_BANNER); display_banner(root, loadbanner, 1, 0, 0); win_refresh(); } /* second line : driver settings */ static void display_driver(void) { char reverb[13]; if (quiet) return; if (md_reverb) SNPRINTF(reverb, 12, "reverb: %2d", md_reverb); else strcpy(reverb, "no reverb"); SNPRINTF(storage, STORAGELEN, "%s: %d bit %s %s, %u Hz, %s", md_driver->Name, (md_mode & DMODE_16BITS) ? 16 : 8, (md_mode & DMODE_INTERP) ? (md_mode & DMODE_SURROUND ? "interp. surround" : "interpolated") : (md_mode & DMODE_SURROUND ? "surround" : "normal"), (md_mode & DMODE_STEREO) ? "stereo" : "mono", md_mixfreq, reverb); enlarge(0,storage); win_print(root, 0, 1, storage); } /* third line : filename */ static void display_file(void) { PLAYENTRY *entry; if (quiet) return; storage[0] = '\0'; if ((entry = PL_GetCurrent(&playlist))) { CHAR *archive = entry->archive, *file; size_t filelen, archivelen; if (archive && !config.fullpaths) { archive = FIND_LAST_DIRSEP(entry->archive); if (archive) archive++; else archive = entry->archive; } file = FIND_LAST_DIRSEP(entry->file); if (file && !config.fullpaths) file++; else file = entry->file; if ((archive) && ((filelen = strlen(file)) < MAXWIDTH - 13)) { archivelen = strlen(archive); if (archivelen > MAXWIDTH - 10 - filelen) { archive += archivelen - (MAXWIDTH - 13 - filelen); SNPRINTF(storage, STORAGELEN, "File: %s (...%s)", file, archive); } else SNPRINTF(storage, STORAGELEN, "File: %s (%s)", file, archive); } else SNPRINTF(storage, STORAGELEN, "File: %.70s", file); } enlarge(0,storage); win_print(root, 0, 2, storage); } /* fourth and fifth lines : module name and format */ static void display_name(void) { const char *name; if (quiet || !mf) return; name = mf->songname; if(!name) name = ""; SNPRINTF(storage, STORAGELEN, "Name: %.70s", name); enlarge(0,storage); win_print(root, 0, 3, storage); SNPRINTF(storage, STORAGELEN, "Type: %s, Periods: %s, %s", mf->modtype, (mf->flags & UF_XMPERIODS) ? "XM type" : "mod type", (mf->flags & UF_LINEAR) ? "linear" : "log"); enlarge(0,storage); win_print(root, 0, 4, storage); } /* sixth line : player status */ void display_status(void) { #if LIBMIKMOD_VERSION >= 0x030200 int i; unsigned long cur_time; static MP_DATA data; #endif if (quiet) return; remove_message(); if (MP_Paused() || !mf) return; win_attrset(ATTR_SONG_STATUS); if (mf->sngpos < mf->numpos) { PLAYENTRY *cur = PL_GetCurrent(&playlist); char time[7] = ""; char channels[18] = ""; if (cur && cur->time > 0) SNPRINTF(time, 7, "/%2d:%02d", (int)((cur->time / 60) % 60), (int)(cur->time % 60)); #if LIBMIKMOD_VERSION >= 0x030107 if (mf->flags & UF_NNA) { SNPRINTF(channels, sizeof(channels), "%2d/%d+%d->%d", mf->realchn, mf->numchn, mf->totalchn - mf->realchn, mf->totalchn); } else #endif SNPRINTF(channels, sizeof(channels), "%2d/%d ", mf->realchn, mf->numchn); SNPRINTF(storage, STORAGELEN, "pat:%03d/%03d pos:%2.2X spd:%2d/%3d " "vol:%3d%%/%3d%% time:%2d:%02d%s chn:%s", mf->sngpos, mf->numpos - 1, mf->patpos, mf->sngspd, mf->bpm, (mf->volume * 100 + 127) >> 7, (md_volume * 100 + 127) >> 7, (int)(((mf->sngtime >> 10) / 60) % 60), (int)((mf->sngtime >> 10) % 60), time, channels); enlarge(0,storage); win_print(root, 0, 5, storage); } #if LIBMIKMOD_VERSION >= 0x030200 if (config.fakevolbars) { MP_GetData (&data); cur_time = Time1000(); for (i = 0; i < mf->numchn; i++) { unsigned int delta = (cur_time - playdata.vstatus[i].time) / 10; if (delta>0) playdata.vstatus[i].time = cur_time; if (playdata.vstatus[i].volamp > delta) playdata.vstatus[i].volamp -= delta; else playdata.vstatus[i].volamp = 0; } for (i = 0; i < mf->numchn; i++) { playdata.vinfo[i] = data.vinfo[i]; if (playdata.vinfo[i].kick) playdata.vstatus[i].volamp = playdata.vinfo[i].volume; } } else { MP_GetData (&playdata); } if (dynamic_repaint) dynamic_repaint(dynamic_repaint_win); #endif } /* seventh line to bottom of screen: information panel */ static BOOL display_information(void) { static const char *panel_name[] = { "Help", "Samples", "Instruments", "Message", "playList", "Configuration", #if LIBMIKMOD_VERSION >= 0x030200 "Volume", #endif }; char paneltitle[STORAGELEN]; BOOL change = 0; int i; ATTRS attr; char *tmp; if (quiet) return 1; /* sanity check */ if (!mf && ((cur_display == DISPLAY_INST) || (cur_display == DISPLAY_SAMPLE) || (cur_display == DISPLAY_MESSAGE) #if LIBMIKMOD_VERSION >= 0x030200 || (cur_display == DISPLAY_VOLBARS) #endif )) { cur_display = DISPLAY_LIST; change = 1; } while (1) { if ((cur_display == DISPLAY_INST && (!(mf->flags & UF_INST))) || (cur_display == DISPLAY_MESSAGE && !mf->comment)) { cur_display = (cur_display == old_display) ? DISPLAY_SAMPLE : old_display; change = 1; } else break; } if (change) { win_change_panel(cur_display); return 0; } /* set panel title */ paneltitle[0] = 0; for (i = DISPLAY_HELP; i < DISPLAY_COUNT; i++) { if ((i == DISPLAY_SAMPLE && !mf) || (i == DISPLAY_INST && (!mf || !(mf->flags & UF_INST))) || (i == DISPLAY_MESSAGE && (!mf || !mf->comment)) #if LIBMIKMOD_VERSION >= 0x030200 || (i == DISPLAY_VOLBARS && !mf) #endif ) continue; SNPRINTF(paneltitle + strlen(paneltitle), STORAGELEN - strlen(paneltitle), "%c%s%c", i == cur_display ? '[' : ' ', panel_name[i - 1], i == cur_display ? ']' : ' '); } enlarge (0,paneltitle); tmp = paneltitle + strlen(paneltitle); attr = ATTR_INFO_INACTIVE; while (--tmp >= paneltitle) { ATTRS newattr = attr; if (*tmp == ']') newattr = ATTR_INFO_ACTIVE; else if (tmp[1] == '[') newattr = ATTR_INFO_INACTIVE; else if (isupper((int)*tmp)) newattr = (attr == ATTR_INFO_ACTIVE) ? ATTR_INFO_AHOTKEY : (attr == ATTR_INFO_INACTIVE) ? ATTR_INFO_IHOTKEY : newattr; else if (isupper((int)tmp[1])) newattr = (attr == ATTR_INFO_AHOTKEY) ? ATTR_INFO_ACTIVE : (attr == ATTR_INFO_IHOTKEY) ? ATTR_INFO_INACTIVE : newattr; if ((newattr != attr) && (tmp[1])) { win_attrset(attr); win_print(root, tmp - paneltitle + 1, 6, tmp + 1); tmp[1] = 0; } attr = newattr; } win_attrset(attr); win_print(root, 0, 6, paneltitle); return 1; } /* help panel */ static void display_help(MWINDOW *win, int diff) { /* *INDENT-OFF* */ static const char helptext[] = #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) "Keys help (depending on your terminal and your curses library,\n" "========= some of these keys might not be recognized)\n" #else "Keys help\n" "=========\n" #endif "\n" "H/F1 show help panel " "() decrease/increase tempo\n" "S/F2 show samples panel " "{} decrease/increase bpm\n" "I/F3 show instrument panel " ":/; toggle interpolation\n" "M/F4 show message panel " "U toggle surround sound\n" "L/F5 show list panel " "1..0 volume 10%..100%\n" "C/F6 show config panel " "<> decrease/increase volume\n" #if LIBMIKMOD_VERSION >= 0x030200 "V/F7 show volume bars " "P switch to previous module\n" "ENTER in list panel, activate menu " "N switch to next module\n" "Left/- previous pattern " "R restart module\n" "Right/+ next pattern " "Space toggle pause\n" "Up/Down scroll panel " "^L refresh screen\n" "PgUp/PgDn scroll panel (faster) " "F toggle fake/real volume bars\n" "Home/End start/end of panel " "Q exit MikMod\n"; #else "ENTER in list panel, activate menu " "P switch to previous module\n" "Left/- previous pattern " "N switch to next module\n" "Right/+ next pattern " "R restart module\n" "Up/Down scroll panel " "Space toggle pause\n" "PgUp/PgDn scroll panel (faster) " "^L refresh screen\n" "Home/End start/end of panel " "Q exit MikMod\n"; #endif /* *INDENT-ON* */ first_help += diff; win_attrset(ATTR_HELP); first_help = display_banner(win, helptext, 0, first_help, 0); win_status(""); } static void convert_string(char *str) { for (; str && *str; str++) if (*str < ' ') *str = ' '; } /* helper function for scrollable panels */ void updatefirst(MWINDOW *win, int *first, int *winx, int *count, int *semicount, int diff, int total) { int wx, scount; *first += diff; win_get_size(win, &wx, &scount); *winx = wx; if (semicount) { if (wx < MINWIDTH + MINVISIBLE) *count = scount; else *count = scount * 2; } else *count = scount; if ((wx <= 0) || (scount <= 0)) *count = 0; if (*first >= total - *count) *first = total - *count; if (*first < 0) *first = 0; if (semicount) { if ((total > scount) && (total < *count)) { scount = (total + 1) >> 1; if (wx < MINWIDTH + MINVISIBLE) *count = scount; else *count = scount * 2; } *semicount = scount; } } /* sample panel */ static void display_sample(MWINDOW *win, int diff) { int count, semicount, t, winx; updatefirst(win, &first_sample, &winx, &count, &semicount, diff, mf->numsmp); win_clear(win); /* Sets attrs */ for (t = first_sample; t < mf->numsmp && t < (count + first_sample); t++) { int x = ((t - first_sample) < semicount) ? 0 : halfwidth; if (x < winx) { SNPRINTF(storage, STORAGELEN, fmt_halfwidth, t, mf->samples[t].samplename ? mf->samples[t]. samplename : ""); convert_string(storage); win_print(win, x, (t - first_sample) % semicount, storage); } } if (mf->numsmp == 1) win_status("1 Sample"); else { SNPRINTF(storage, STORAGELEN, "%d Samples", mf->numsmp); win_status(storage); } } #if LIBMIKMOD_VERSION >= 0x030200 static void dynamic_display_sample(MWINDOW *win) { int count, semicount, t, winx; int voice, vol, chancount; char sampchar[2]; if (cur_display != DISPLAY_SAMPLE) return; sampchar[1] = 0; updatefirst(win, &first_sample, &winx, &count, &semicount, 0, mf->numsmp); for (t = first_sample; t < mf->numsmp && t < (count + first_sample); t++) { int x = ((t - first_sample) < semicount) ? 0 : halfwidth; sampchar[0] = ' '; if (x < winx) { vol = chancount = 0; for (voice = 0; voice < mf->numchn; voice++) { if (playdata.vinfo[voice].s == &mf->samples[t]) { vol += playdata.vstatus[voice].volamp; chancount++; } } if (chancount) { vol /= chancount; if (vol >= 56) voice = 3; else if (vol >= 44) voice = 2; else if (vol >= 26) voice = 1; else voice = 0; sampchar[0] = samp_char[voice]; win_attrset(samp_attr[voice]); } else win_attrset(ATTR_SAMPLES); win_print(win, x + 3, (t - first_sample) % semicount, sampchar); } } } #endif /* instrument panel */ static void display_inst(MWINDOW *win, int diff) { int count, semicount, t, winx; updatefirst(win, &first_inst, &winx, &count, &semicount, diff, mf->numins); win_clear(win); /* Sets attrs */ for (t = first_inst; t < mf->numins && t < (count + first_inst); t++) { int x = ((t - first_inst) < semicount) ? 0 : halfwidth; if (x < winx) { SNPRINTF(storage, STORAGELEN, fmt_halfwidth, t, mf->instruments[t].insname ? mf->instruments[t]. insname : ""); convert_string(storage); win_print(win, x, (t - first_inst) % semicount, storage); } } if (mf->numins == 1) win_status("1 Instrument"); else { SNPRINTF(storage, STORAGELEN, "%d Instruments", mf->numins); win_status(storage); } } #if LIBMIKMOD_VERSION >= 0x030200 static void dynamic_display_inst(MWINDOW *win) { int count, semicount, t, winx; int voice, vol, chancount; char sampchar[2]; if (cur_display != DISPLAY_INST) return; sampchar[1] = 0; updatefirst(win, &first_inst, &winx, &count, &semicount, 0, mf->numins); for (t = first_inst; t < mf->numins && t < (count + first_inst); t++) { int x = ((t - first_inst) < semicount) ? 0 : halfwidth; sampchar[0] = ' '; if (x < winx) { vol = chancount = 0; for (voice = 0; voice < mf->numchn; voice++) { if (playdata.vinfo[voice].i == &mf->instruments[t]) { vol += playdata.vstatus[voice].volamp; chancount++; } } if (chancount) { vol /= chancount * 16; if (vol >= 4) vol = 3; sampchar[0] = samp_char[vol]; win_attrset(samp_attr[vol]); } else win_attrset(ATTR_SAMPLES); win_print(win, x + 3, (t - first_inst) % semicount, sampchar); } } } #endif /* comment panel */ static void display_comment(MWINDOW *win, int diff) { first_comment += diff; win_attrset(ATTR_HELP); first_comment = display_banner(win, mf->comment, 0, first_comment, 1); win_status(""); } #if LIBMIKMOD_VERSION >= 0x030200 static void dynamic_display_volbars(MWINDOW *win) { int count, t, i, v, winx, barw; int loww, medw; char *tmp; if (cur_display != DISPLAY_VOLBARS) return; updatefirst(win, &first_volbar, &winx, &count, NULL, 0, mf->numchn); winx -= 5; barw = winx / 2; if (barw < 3) return; else if (barw > 30) barw = 30; loww = barw * 3 / 4; medw = (barw - loww) * 3 / 4; for (t = first_volbar; t < (first_volbar + count) && t < mf->numchn; t++) { v = playdata.vstatus[t].volamp * barw / 32; memset(storage, ' ', barw); storage[barw] = '\0'; memset(storage, CHAR_AMPLITUDE1, v / 2); if (v & 1) { storage[v / 2] = CHAR_AMPLITUDE0; v = v/2 + 1; } else v = v/2; if (v < barw) { win_attrset(ATTR_VOLBAR); win_print(win, (mf->numchn > 100 ? 6 : 5) + v, t - first_volbar, storage + v); storage[v] = '\0'; } if (v > loww + medw) { win_attrset(ATTR_VOLBAR_HIGH); win_print(win,(mf->numchn > 100 ? 6 : 5) + loww + medw, t - first_volbar, storage + loww + medw); storage[loww + medw] = '\0'; } if (v > loww) { win_attrset(ATTR_VOLBAR_MED); win_print(win, (mf->numchn > 100 ? 6 : 5) + loww, t - first_volbar, storage + loww); storage[loww] = '\0'; } if (v > 0) { win_attrset(ATTR_VOLBAR_LOW); win_print(win, (mf->numchn > 100 ? 6 : 5), t - first_volbar, storage); } storage[0] = '\0'; if (playdata.vinfo[t].i && !config.forcesamples) { for (i=0; i < mf->numins && playdata.vinfo[t].i != &mf->instruments[i]; i++); SNPRINTF(storage, STORAGELEN, "%3i %s", i, playdata.vinfo[t].i->insname ? playdata.vinfo[t].i->insname : ""); } else if (playdata.vinfo[t].s) { for (i=0; i < mf->numsmp && playdata.vinfo[t].s != &mf->samples[i]; i++); SNPRINTF(storage, STORAGELEN, "%3i %s", i, playdata.vinfo[t].s->samplename ? playdata.vinfo[t].s->samplename : ""); } convert_string(storage); tmp = storage; for (v = 0; *tmp && (v < winx - barw - 2); tmp++, v++); for (; v < winx - barw - 2; tmp++, v++) *tmp = ' '; *tmp = 0; win_attrset(ATTR_VOLBAR_INSTR); win_print(win, (mf->numchn > 100 ? 6 : 5) + barw + 2, t - first_volbar, storage); } if (mf->numchn == 1) strcpy(storage, "1 Channel"); else SNPRINTF(storage, STORAGELEN, "%d Channels", mf->numchn); if (!config.forcesamples && (mf->flags & UF_INST)) strcat(storage, ", displaying instrument names"); else strcat(storage, ", displaying sample names"); if (config.fakevolbars) strcat(storage, " and fake volume bars"); else strcat(storage, " and real volume bars"); win_status(storage); } static void display_volbars(MWINDOW *win, int diff) { int count, t, winx; updatefirst(win, &first_volbar, &winx, &count, NULL, diff, mf->numchn); win_clear(win); /* Sets attrs */ for (t = first_volbar; t < (first_volbar + count) && t < mf->numchn; t++) { if (mf->numchn > 100) SNPRINTF(storage, STORAGELEN, "[%3d]", t); else SNPRINTF(storage, STORAGELEN, "[%2d]", t); win_print(win, 0, t - first_volbar, storage); } /* display the remaining of the window immediately to prevent flickering */ dynamic_display_volbars(win); } #endif static void display_playentry(MWINDOW *win, PLAYENTRY *pos, PLAYENTRY *cur, int nr, int y, int x, BOOL reverse, int width) { char *name, sort; char time[8] = "", tmpfmt[32]; int timelen = 0; if (pos->time > 0) { SNPRINTF(time, 7, " %2d:%02d", (int)((pos->time / 60) % 60), (int)(pos->time % 60)); timelen = strlen(time); } name = FIND_LAST_DIRSEP(pos->file); if (name && !config.fullpaths) name++; else name = pos->file; if (pos == cur) sort = '>'; else if (pos->played) sort = '*'; else sort = ' '; if (pos->archive) { if (strlen(name) > width - 13 - timelen) { name = name + strlen(name) - (width - 16 - timelen); if (timelen) { sprintf(tmpfmt, "%%4i %%c...%%-%ds%%s(pack)", width - 22); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name, time); } else { sprintf(tmpfmt, "%%4i %%c...%%-%ds(pack)", width - 16); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name); } } else if (timelen) { sprintf(tmpfmt, "%%4i %%c%%-%ds%%s(pack)", width - 19); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name, time); } else { sprintf(tmpfmt, "%%4i %%c%%-%ds(pack)", width - 13); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name); } } else if (strlen(name) > width - 7 - timelen) { name = name + strlen(name) - (width - 10 - timelen); if (timelen) { sprintf(tmpfmt, "%%4i %%c...%%-%ds%%s", width - 16); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name, time); } else { sprintf(tmpfmt, "%%4i %%c...%%-%ds", width - 10); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name); } } else if (timelen) { sprintf(tmpfmt, "%%4i %%c%%-%ds%%s", width - 13); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name, time); } else { sprintf(tmpfmt, "%%4i %%c%%-%ds", width - 7); SNPRINTF(storage, STORAGELEN, tmpfmt, nr, sort, name); } win_attrset(reverse ? ATTR_PLAYENTRY_ACTIVE : ATTR_PLAYENTRY_INACTIVE); win_print(win, x, y, storage); } /* playlist panel */ static void display_list(MWINDOW *win, int diff, COMMAND com) { static const char *no_data = "\nPlaylist is empty!\n"; static int actLine = -1; int count, semicount, playcount, t, winx, x, width; PLAYENTRY *cur; playcount = PL_GetLength(&playlist); if (actLine >= playcount) actLine = playcount - 1; if (com == MENU_ACTIVATE) { list_open (&actLine); return; } win_clear(win); if (playcount) { win_get_size(win, &winx, &semicount); if (semicount < 0) semicount = 0; if (winx < 40 + MINVISIBLE) { count = semicount; width = winx; } else { count = semicount * 2; width = winx >> 1; } cur = PL_GetCurrent(&playlist); if (actLine < 0) { actLine = PL_GetCurrentPos(&playlist); first_list = actLine - semicount / 2; if (first_list < 0) first_list = 0; } actLine += diff; if (actLine < 0) actLine = 0; else if (actLine >= playcount) actLine = playcount - 1; if (actLine < first_list) first_list = actLine; else if (actLine >= first_list + count) first_list = actLine - count + 1; for (t = first_list; t < playcount && t < (count + first_list); t++) { x = (t - first_list) < semicount ? 0 : width; if (x < winx) display_playentry(win, PL_GetEntry(&playlist, t), cur, t, (t - first_list) % semicount, x, actLine == t, width); } } else { first_list += diff; first_list = display_banner(win, no_data, 0, first_list, 1); } switch (playcount) { case 0: win_status("Press enter to open playlist menu"); break; case 1: win_status("1 Module"); break; default: SNPRINTF(storage, STORAGELEN, "%d Modules", playcount); win_status(storage); break; } } /* open config-editor panel */ static void display_config(MWINDOW *win, int diff) { static BOOL open = 0; win_clear(win); if (!open) { config_open(); open = 1; } } /* display panel contents */ static void display_panel(MWINDOW *win, int diff, COMMAND com) { #if LIBMIKMOD_VERSION >= 0x030200 dynamic_repaint = NULL; dynamic_repaint_win = win; #endif switch (cur_display) { case DISPLAY_HELP: display_help(win, diff); break; case DISPLAY_SAMPLE: #if LIBMIKMOD_VERSION >= 0x030200 dynamic_repaint = dynamic_display_sample; #endif display_sample(win, diff); break; case DISPLAY_INST: #if LIBMIKMOD_VERSION >= 0x030200 dynamic_repaint = dynamic_display_inst; #endif display_inst(win, diff); break; case DISPLAY_MESSAGE: display_comment(win, diff); break; case DISPLAY_LIST: display_list(win, diff, com); break; case DISPLAY_CONFIG: display_config(win, diff); break; #if LIBMIKMOD_VERSION >= 0x030200 case DISPLAY_VOLBARS: dynamic_repaint = dynamic_display_volbars; display_volbars(win, diff); break; #endif } } /* displays the top of the screen */ int display_header(void) { if (quiet) return 1; display_version(); update_message(); if (MP_Paused()) { display_pausebanner(); set_window_title("paused"); } else { win_attrset(ATTR_SONG_STATUS); display_driver(); display_file(); display_name(); display_status(); display_title(); } return display_information(); } static void display_head_resize (MWINDOW *win, int dx, int dy) { setup_printf(); } static BOOL display_head_repaint(MWINDOW * win) { int cur_panel = win_get_panel(); if (cur_panel != cur_display) old_display = cur_display; cur_display = cur_panel; return display_header(); } static BOOL display_panel_repaint(MWINDOW * win) { display_panel(win, 0, COM_NONE); return 1; } void display_start(void) { if (quiet) return; first_inst = first_sample = first_comment = 0; win_panel_repaint(); } /* handle interface-specific keys */ static BOOL display_handle_key(MWINDOW * win, int ch) { switch (ch) { case KEY_DOWN: display_panel(win, 1, COM_NONE); break; case KEY_UP: display_panel(win, -1, COM_NONE); break; case KEY_RIGHT: if (cur_display != DISPLAY_LIST) return 0; /* fall through */ case KEY_NPAGE: display_panel(win, win->height, COM_NONE); break; case KEY_LEFT: if (cur_display != DISPLAY_LIST) return 0; /* fall through */ case KEY_PPAGE: display_panel(win, -win->height, COM_NONE); break; case KEY_HOME: display_panel(win, -32000, COM_NONE); break; #ifdef KEY_END case KEY_END: display_panel(win, 32000, COM_NONE); break; #endif case KEY_ENTER: case '\r': if (cur_display == DISPLAY_LIST) display_panel(win, 0, MENU_ACTIVATE); else return 0; break; default: return 0; } return 1; } /* setup interface */ void display_init(void) { static ATTRS attrs[]={ATTR_HELP, /* Help */ ATTR_SAMPLES, /* Sample */ ATTR_SAMPLES, /* Inst */ ATTR_HELP, /* Message */ ATTR_PLAYENTRY_INACTIVE,/* Playlist */ ATTR_CONFIG, /* Config */ ATTR_VOLBAR}; /* Volbars */ int i; root = win_get_window_root(); win_panel_set_repaint(DISPLAY_ROOT, display_head_repaint); win_panel_set_resize(DISPLAY_ROOT, 1, display_head_resize); for (i = 1; i < DISPLAY_COUNT; i++) { win_panel_open(i, 0, PANEL_Y, 999, 999, 0, NULL, attrs[i-1]); win_panel_set_repaint(i, display_panel_repaint); win_panel_set_handle_key(i, display_handle_key); win_panel_set_resize(i, 1, NULL); } win_change_panel(cur_display); setup_printf(); } static void display_title(void) { char *file; if (!mf) { return; } if (!mf->songname || !*mf->songname) { PLAYENTRY *entry=NULL; entry = PL_GetCurrent(&playlist); if (entry != NULL) { file = entry->file; if (!config.fullpaths) { file = FIND_LAST_DIRSEP(entry->file); if (file) { file++; } else { file = entry->file; } } set_window_title(file); } return; } set_window_title(mf->songname); } /* This will set the xterm (or equivalent) Title and Icon title. * * The title contains -= MikMod x.x.x =- (%s) where %s is the content * the icon contains -= MikMod x.x.x =- * * pass NULL as songname to reset the title */ static void set_window_title(const char *content) { /* TODO: Can we do something similar for OS2? */ /* Win32 console application set title */ #if defined(_WIN32) SNPRINTF(storage,STORAGELEN,"%s (%s)", mikversion, content); SetConsoleTitle(storage); #endif /* Unix/Xterm (and compatible/similar) * * Written using the 'Xterm-Title mini-howto' */ #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) char *env_term; static int last_config=0; if (!config.window_title && !last_config) { return; } if (last_config && !config.window_title) { /* xterm title setting has just been disabled */ content = NULL; } last_config = config.window_title; env_term = getenv("TERM"); if (env_term==NULL) { return; } if (content!=NULL) { SNPRINTF(storage,STORAGELEN,"%s (%s)", mikversion, content); } else { storage[0] = '\0'; } if ( strcmp(env_term, "xterm")==0 || strcmp(env_term, "xterm-color")==0 || strcmp(env_term, "rxvt")==0 || strcmp(env_term, "aixterm")==0 || strcmp(env_term, "dtterm")==0 || strcmp(env_term, "Eterm")==0 ) { printf("%c]0;%s%c", '\033', storage, '\007'); printf("%c]1;%s%c", '\033', mikversion, '\007'); } else if (strcmp(env_term, "iris-ansi")==0) { printf("%cP1.y%s%c\\", '\033', storage, '\033'); printf("%cP3.y%s%c\\", '\033', mikversion, '\033'); } else if (strcmp(env_term, "hpterm")==0) { printf("\033&f0k%dD%s", (int) strlen(storage), storage); printf("\033&f-1k%dD%s", (int) strlen(mikversion), mikversion); } #endif } /* ex:set ts=4: */ mikmod-3.2.9/src/display.h0000644000000000000000000000357712221561560014124 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: display.h,v 1.1.1.1 2004/01/16 02:07:35 raph Exp $ Common display definitions, curses-related ==============================================================================*/ #ifndef DISPLAY_H #define DISPLAY_H /*========== Core definitions */ /* maximum screen width we handle */ #define MAXWIDTH 200 /*========== Panel definitions */ #define DISPLAY_ROOT 0 #define DISPLAY_HELP 1 #define DISPLAY_SAMPLE 2 #define DISPLAY_INST 3 #define DISPLAY_MESSAGE 4 #define DISPLAY_LIST 5 #define DISPLAY_CONFIG 6 #if LIBMIKMOD_VERSION >= 0x030200 #define DISPLAY_VOLBARS 7 #define DISPLAY_COUNT 8 #else #define DISPLAY_COUNT 7 #endif /*========== Routines */ typedef enum { COM_NONE, MENU_ACTIVATE } COMMAND; void display_message(char *str); void display_status(void); int display_header(void); void display_start(void); void display_extractbanner(void); void display_loadbanner(void); void display_pausebanner(void); void display_init(void); #endif /* DISPLAY_H */ /* ex:set ts=4: */ mikmod-3.2.9/src/mikmod.c0000644000000000000000000006612114607406616013736 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mikmod.c,v 1.3 2004/01/30 18:01:40 raph Exp $ Module player which uses the MikMod library as the player engine. ==============================================================================*/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #ifdef HAVE_GETOPT_LONG_ONLY # include #else # include "getopt_long.h" #endif #ifndef _WIN32 # include #endif #if defined(__OS2__)||defined(__EMX__) # define INCL_DOS # define INCL_KBD # define INCL_DOSPROCESS # include # include /* unlink() */ #elif defined HAVE_UNISTD_H # include #endif #if defined(__FreeBSD__)||defined(__NetBSD__)||defined(__OpenBSD__) # ifdef HAVE_SYS_TIME_H # include # endif # include # include # ifdef __FreeBSD__ # include # endif #endif #if defined(__linux) # include #endif #include #include "player.h" #include "mutilities.h" #include "display.h" #include "rcfile.h" #include "mconfig.h" #include "mlist.h" #include "mlistedit.h" #include "marchive.h" #include "mwindow.h" #include "mdialog.h" #include "mplayer.h" #include "keys.h" #define CFG_MAXCHN 128 /* Long options definition */ static struct option options[] = { /* Output options */ {"driver", required_argument, NULL, 'd'}, {"output", required_argument, NULL, 'o'}, {"frequency", required_argument, NULL, 'f'}, {"interpolate", no_argument, NULL, 'i'}, {"nointerpolate", no_argument, NULL, 1}, {"hqmixer", no_argument, NULL, 2}, {"nohqmixer", no_argument, NULL, 3}, {"surround", no_argument, NULL, 4}, {"nosurround", no_argument, NULL, 5}, {"reverb", required_argument, NULL, 'r'}, /* Playback options */ {"volume", required_argument, NULL, 'v'}, {"fadeout", no_argument, NULL, 'F'}, {"nofadeout", no_argument, NULL, 6}, {"loops", no_argument, NULL, 'l'}, {"noloops", no_argument, NULL, 7}, {"panning", no_argument, NULL, 'a'}, {"nopanning", no_argument, NULL, 8}, {"protracker", no_argument, NULL, 'x'}, {"noprotracker", no_argument, NULL, 9}, /* Loading options */ {"directory", required_argument, NULL, 'y'}, {"curious", no_argument, NULL, 'c'}, {"nocurious", no_argument, NULL, 10}, {"playmode", required_argument, NULL, 'p'}, {"tolerant", no_argument, NULL, 't'}, {"notolerant", no_argument, NULL, 11}, /* Scheduling options */ {"renice", no_argument, NULL, 's'}, {"norenice", no_argument, NULL, 12}, {"realtime", no_argument, NULL, 'S'}, {"norealtime", no_argument, NULL, 12}, /* Display options */ {"quiet", no_argument, NULL, 'q'}, /* Information options */ {"information", optional_argument, NULL, 'n'}, {"drvinfo", required_argument, NULL, 'N'}, {"version", no_argument, NULL, 'V'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; static const CHAR *PRG_NAME; PLAYLIST playlist; CONFIG config; MODULE *mf = NULL; /* current module */ BOOL quiet = 0; /* set if quiet mode is enabled */ typedef enum { STATE_INIT, /* Library not initialised */ STATE_INIT_ERROR, /* Error during MikMod_Init() */ STATE_ERROR, /* Error during MikMod_Reset() */ STATE_READY, /* Player is ready for playing */ STATE_PLAY /* Playing in progess */ } PL_STATE; static struct { PL_STATE state; BOOL quit; /* quit was scheduled */ BOOL listend; /* end of playlist was reached */ BOOL norc; /* don't load default config file */ } status = {STATE_INIT,0,0,0}; /* playlist handling */ static int next = 0; /* 0 or a PL_CONT_xxx code */ static int next_pl_pos = 0; /* for PL_CONT_POS, next pos in playlist */ static int next_sng_pos = 0; /* next pos in module */ static BOOL settime = 1; static int uservolume = 128; /* help text */ #define S_B(b) ((b)?"Yes":"No") static void help(CONFIG * c) { char output[4]; char *conf_name = CF_GetFilename(); puts(mikcopyr); SNPRINTF(output, 4, "%s%c", c->mode_16bit ? "16" : "8", c->stereo ? 's' : 'm'); printf("\n" "Usage: %s [option|-y dir]... [module|playlist]...\n" "\n" "Output options:\n" " -d[river] n,options Use nth driver for output (0: autodetect), default: %d\n" " -o[utput] 8m|8s|16m|16s 8/16 bit output in stereo/mono, default: %s\n" " -f[requency] nnnnn Set mixing frequency, default: %d\n" "* -i[nterpolate] Use interpolate mixing, default: %s\n" "* -hq[mixer] Use high-quality (but slower) software mixer,\n" " default: %s\n" "* -su[rround] Use surround mixing, default: %s\n" " -r[everb] nn Set reverb amount (0-15), default: %d\n" "Playback options:\n" " -v[olume] nn Set volume from 0%% (silence) to 100%%, default: %d%%\n" "* -F, -fa[deout] Force volume fade at the end of module, default: %s\n" "* -l[oops] Enable in-module loops, default: %s\n" "* -a, -pa[nning] Process panning effects, default: %s\n" "* -x, -pr[otracker] Disable extended protracker effects, default: %s\n" "Loading options:\n" " -y, -di[rectory] dir Scan directory recursively for modules\n" "* -c[urious] Look for hidden patterns in module, default: %s\n" " -p[laymode] n Playlist mode (1: loop module, 2: list multi\n" " 4: shuffle list, 8: list random), default: %d\n" "* -t[olerant] Don't halt on file access errors, default: %s\n", PRG_NAME, c->driver, output, c->frequency, S_B(c->interpolate), S_B(c->hqmixer), S_B(c->surround), c->reverb, c->volume, S_B(c->fade), S_B(c->loop), S_B(c->panning), S_B(!c->extspd), S_B(c->curious), c->playmode, S_B(c->tolerant)); #if defined(__OS2__)||defined(__EMX__)||defined(__linux)||defined(__FreeBSD__)||defined(__NetBSD__)||defined(__OpenBSD__) #if defined(__OS2__)||defined(__EMX__) printf("Scheduling options:\n"); #else printf("Scheduling options (need root privileges or a setuid root binary):\n"); #endif printf("* -s, -ren[ice] Renice to -20 (more scheduling priority), default: %s\n", (c->renice == RENICE_PRI ? "Yes" : "No" )); #if !defined(__NetBSD__)&&!defined(__OpenBSD__) printf("* -S, -rea[ltime] Get realtime priority (will hog CPU power), default: %s\n", (c->renice == RENICE_REAL ? "Yes" : "No" )); #endif #endif printf("Display options:\n" " -q[uiet] Quiet mode, no interface, displays only errors.\n" "Information options:\n" " -n, -in[formation] List all available drivers and module loaders.\n" " -N n, -drvinfo Print information on a specific driver.\n" " -V -ve[rsion] Display MikMod version.\n" " -h[elp] Display this help screen.\n" "Configuration option:\n" " -norc Don't parse the file '%s' on startup\n" "\n" "Options marked with '*' also exist in negative form (eg -nointerpolate)\n" "F1 or H while playing: Display help panel.\n", conf_name); if (conf_name) free(conf_name); } /* nice exit function */ static void exit_player(int exitcode, const char *message, ...) { va_list args; win_exit(); if (status.state > STATE_INIT) { MikMod_Exit(); status.state = STATE_INIT; } if (message) { va_start(args, message); if (exitcode > 0) vfprintf(stderr, message, args); else if (!quiet) vprintf(message, args); va_end(args); } if (!exitcode && !status.norc) { if (config.save_config) CF_Save(&config); if (config.save_playlist) PL_SaveDefault(&playlist); } printf("\n"); exit(exitcode); } #ifndef _WIN32 /* signal handlers */ static void GotoNext(int signum) { next = PL_CONT_NEXT; signal(SIGUSR1, GotoNext); } static void GotoPrev(int signum) { next = PL_CONT_PREV; signal(SIGUSR2, GotoPrev); } static void ExitGracefully(int signum) { /* can't exit now if playing */ if (status.state == STATE_PLAY) { status.quit = 1; signal(signum, ExitGracefully); } else { win_exit(); if (!quiet) fputs((signum == SIGTERM) ? "Halted by SIGTERM\n" : "Halted by SIGINT\n", stderr); signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); exit(0); } } #endif static void Player_SetNextModPos(int pos, int sng_pos) { next_pl_pos = pos; next_sng_pos = sng_pos; next = PL_CONT_POS; } void Player_SetNextMod(int pos) { Player_SetNextModPos(pos, 0); } static void Player_InitLib(void) { long engineversion = MikMod_GetVersion(); if (engineversion < LIBMIKMOD_VERSION) exit_player(2, "The current engine version (%ld.%ld.%ld) is too old.\n" "This programs requires at least version %ld.%ld.%ld\n", (engineversion >> 16) & 255, (engineversion >> 8) & 255, (engineversion) & 255, LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION); /* Register the loaders we want to use: */ MikMod_RegisterAllLoaders(); /* Register the drivers we want to use: */ MikMod_RegisterAllDrivers(); } static void set_priority(CONFIG *cfg) { if (cfg->renice == RENICE_PRI) { #if defined(__FreeBSD__)||defined(__NetBSD__)||defined(__OpenBSD__) setpriority(PRIO_PROCESS, 0, -20); #endif #ifdef __linux nice(-20); #endif #if defined(__OS2__)||defined(__EMX__) DosSetPriority(PRTYS_PROCESSTREE, PRTYC_NOCHANGE, 20, 0); #endif } else if (cfg->renice == RENICE_REAL) { #ifdef __FreeBSD__ struct rtprio rtp; rtp.type = RTP_PRIO_REALTIME; rtp.prio = 0; rtprio(RTP_SET, 0, &rtp); #endif #ifdef __linux struct sched_param sp; memset(&sp, 0, sizeof(struct sched_param)); sp.sched_priority = sched_get_priority_min(SCHED_RR); sched_setscheduler(0, SCHED_RR, &sp); #endif #if defined(__OS2__)||defined(__EMX__) DosSetPriority(PRTYS_PROCESSTREE, PRTYC_TIMECRITICAL, 20, 0); #endif } } static BOOL cmp_bit (int value, int mask, BOOL cmp) { return (BTST(value, mask)) ? cmp : !cmp; } static void set_bit (UWORD *value, int mask, BOOL boolv) { if (boolv) *value |= mask; else *value &= ~mask; } static void config_error (const char *err, PL_STATE state) { if (quiet) { exit_player (1, "%s: %s.\n", err, MikMod_strerror(MikMod_errno)); } else { if (win_get_panel() != DISPLAY_CONFIG) win_change_panel (DISPLAY_CONFIG); sprintf (storage, "%s:\n %s.\nTry changing the configuration.", err, MikMod_strerror(MikMod_errno)); dlg_message_open (storage, "&Ok", 0, 1, NULL, NULL); status.state = state; } } void Player_SetConfig (CONFIG * cfg) { #if LIBMIKMOD_VERSION >= 0x030107 static char *driveroptions = NULL; #endif BOOL restart = MP_Active() && ( (cfg->frequency != md_mixfreq) || ((cfg->driver) && (cfg->driver != md_device)) || (!cmp_bit(md_mode, DMODE_16BITS, cfg->mode_16bit)) || (!cmp_bit(md_mode, DMODE_STEREO, cfg->stereo)) || (!cmp_bit(md_mode, DMODE_HQMIXER, cfg->hqmixer)) #if LIBMIKMOD_VERSION >= 0x030107 || ( (!driveroptions && cfg->driveroptions) || (driveroptions && strcmp(driveroptions, cfg->driveroptions))) #endif ); PL_STATE oldstate = status.state; if (status.state <= STATE_ERROR) status.state = STATE_READY; #if LIBMIKMOD_VERSION >= 0x030107 if (driveroptions) free(driveroptions); driveroptions = strdup(cfg->driveroptions); #endif md_pansep = 128; /* panning separation (0=mono 128=full stereo) */ md_volume = (cfg->volume * 128) / 100; md_reverb = cfg->reverb; md_device = cfg->driver; md_mixfreq = cfg->frequency; md_mode |= DMODE_SOFT_MUSIC; set_bit (&md_mode, DMODE_INTERP, cfg->interpolate); set_bit (&md_mode, DMODE_HQMIXER, cfg->hqmixer); set_bit (&md_mode, DMODE_SURROUND, cfg->surround); set_bit (&md_mode, DMODE_16BITS, cfg->mode_16bit); set_bit (&md_mode, DMODE_STEREO, cfg->stereo); if (!win_has_colors() && cfg->themes[cfg->theme].color) cfg->theme = THEME_MONO; win_set_theme (&cfg->themes[cfg->theme]); if (restart || oldstate == STATE_ERROR) { int cur = PL_GetCurrentPos(&playlist), pos = 0; if (cur >= 0) { if (mf) pos = mf->sngpos; Player_SetNextModPos(cur, pos); } if (mf) MP_End(); #if LIBMIKMOD_VERSION >= 0x030107 if (MikMod_Reset(cfg->driveroptions)) #else if (MikMod_Reset()) #endif config_error ("MikMod reset error", STATE_ERROR); cfg->frequency = md_mixfreq; } else win_panel_repaint(); win_init_status(cfg->statusbar); if (mf) mf->wrap = (BTST(config.playmode, PM_MODULE) ? 1 : 0); if (oldstate == STATE_INIT || oldstate == STATE_INIT_ERROR) #if LIBMIKMOD_VERSION >= 0x030107 if (MikMod_Init(config.driveroptions)) #else if (MikMod_Init()) #endif config_error ("MikMod initialisation error", STATE_INIT_ERROR); } /* Display the error when loading a file, and take the appropriate resume action */ static void handle_ListError(BOOL tolerant, const CHAR *filename, const CHAR *archive, BOOL mm_error) { char buf[PATH_MAX + 40] = ""; if (!tolerant) { if (mm_error) SNPRINTF(buf, PATH_MAX + 40, "(reason: %s)\n", MikMod_strerror(MikMod_errno)); if (!filename) exit_player(1, "Corrupted playlist, filename is NULL.\n%s", buf); else if (archive) exit_player(1, "MikMod error: can't load \"%s\" from archive \"%s\".\n%s", filename, archive, buf); else exit_player(1, "MikMod error: can't load %s\n%s", filename, buf); } else { if (filename) SNPRINTF(buf, PATH_MAX + 40, "Error loading list entry \"%s\" !", filename); else SNPRINTF(buf, PATH_MAX + 40, "Error loading list entry !"); display_message(buf); PL_DelEntry(&playlist, PL_GetCurrentPos(&playlist)); } } /* parse an integer argument */ static void get_int(const char *arg, int *value, int min, int max) { char *end = NULL; int t = min - 1; if (arg) t = strtol(arg, &end, 10); if (end && (!*end) && (t >= min) && (t <= max)) *value = t; else exit_player(1, mikcopyr "\n\n" "Argument '%s' out of bounds, must be between %d and %d.\n" "Use '%s --help' for more information.\n", arg ? arg : "(not given)", min, max, PRG_NAME); } static void display_driver_help (int drvno) { #define MAX_VALUES 64 char *version, *cmdline, *cmdend, *cur; driver_get_info (drvno, &version, &cmdline); if (!drvno || !version) exit_player (1, "Bad driver ordinal number: %d\n", drvno); printf ("Parameter list for %s:\n", version); free (version); if (!cmdline) { printf (" No arguments with this driver\n"); return; } cmdend = cmdline + strlen (cmdline); cur = cmdline; while (cur < cmdend) { char *tmp, *tmp2, *lineend; char *values [MAX_VALUES]; int nvalues = 0; char valuetype; int i; lineend = strchr (cur, '\n'); if (!lineend) lineend = cur + strlen (cur); *lineend = 0; if (!(tmp = strchr (cur, ':'))) break; *tmp++ = 0; valuetype = *tmp; if (!(tmp = strchr (tmp, ':'))) break; tmp++; if (!(tmp2 = strchr (tmp, ':'))) break; if (valuetype != 't') { while (tmp < tmp2 && nvalues < MAX_VALUES) { values [nvalues++] = tmp; tmp = strchr (tmp, ','); if (tmp && tmp < tmp2) *tmp++ = 0; else break; } } else values [nvalues++] = tmp; tmp = tmp2; *tmp++ = 0; printf (" %s (%s): %s\n", cur, (valuetype == 'c') ? "choice" : (valuetype == 't') ? "text" : (valuetype == 'r') ? "range" : (valuetype == 'b') ? "yes/no" : "unknown", tmp); if (valuetype == 'c' || valuetype == 'r') { printf (" %s:", valuetype == 'c' ? "values" : "range"); for (i = 0; i < nvalues - 1; i++) printf (" %s%c", values [i], i < nvalues - 2 ? ',' : '\n'); } printf (" default value: %s\n", values [nvalues - 1]); cur = lineend + 1; } free (cmdline); } /* handle global keys */ static BOOL player_handle_key(MWINDOW *win, int ch) { BOOL handled = 1; if (ch < 256 && isalpha(ch)) ch = toupper(ch); /* always enabled commands */ switch (ch) { case ' ': /* toggle pause */ MP_TogglePause(); win_panel_repaint(); break; case 'N': next = PL_CONT_NEXT; break; case 'P': next = PL_CONT_PREV; break; case 'Q': status.quit = 1; break; case CTRL_L: #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) case KEY_CLEAR: #endif win_panel_repaint_force(); break; case 'H': win_change_panel(DISPLAY_HELP); break; case 'S': win_change_panel(DISPLAY_SAMPLE); break; case 'I': win_change_panel(DISPLAY_INST); break; case 'M': win_change_panel(DISPLAY_MESSAGE); break; case 'L': win_change_panel(DISPLAY_LIST); break; case 'C': win_change_panel(DISPLAY_CONFIG); break; #if LIBMIKMOD_VERSION >= 0x030200 case 'V': win_change_panel(DISPLAY_VOLBARS); break; case 'F': config.fakevolbars = 1 - config.fakevolbars; break; #endif default: handled = 0; } /* commands which only work when module is not paused */ if (!MP_Paused()) { handled = 1; switch (ch) { case '+': case KEY_RIGHT: Player_NextPosition(); settime = 0; break; case '-': case KEY_LEFT: Player_PrevPosition(); settime = 0; break; case 'R': Player_SetPosition(0); settime = 1; break; case '(': if (mf) Player_SetSpeed(mf->sngspd - 1); settime = 0; break; case ')': if (mf) Player_SetSpeed(mf->sngspd + 1); settime = 0; break; case '{': if (mf) Player_SetTempo(mf->bpm - 1); settime = 0; break; case '}': if (mf) Player_SetTempo(mf->bpm + 1); settime = 0; break; case ';': case ':': md_mode ^= DMODE_INTERP; display_header(); break; case 'U': md_mode ^= DMODE_SURROUND; display_header(); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': Player_SetVolume(uservolume = ((ch - '0') << 7) / 10); break; case '0': Player_SetVolume(uservolume = 128); break; case '<': if (mf && mf->volume) Player_SetVolume(uservolume = mf->volume - 1); break; case '>': if (mf && mf->volume < 128) Player_SetVolume(uservolume = mf->volume + 1); break; default: handled = 0; } } return handled; } static void player_quit(void) { if (status.quit) exit_player(0,NULL); else if (!status.listend) exit_player(1, "MikMod error: %s\n", MikMod_strerror(MikMod_errno)); else exit_player(0,"Finished playlist..."); } static BOOL player_timeout (MWINDOW *win, void *data) { char *filename, *archive; /* exit if quit was scheduled */ if (status.quit) { if (status.state == STATE_PLAY) { MP_End(); Player_Stop(); Player_Free(mf); status.state = STATE_READY; } mf = NULL; player_quit(); } if (status.state >= STATE_READY && (!MP_Active() || next || PL_CurrentDeleted(&playlist)) && (!status.listend || (PL_GetLength(&playlist) > 0))) { /* stop playing */ if (status.state == STATE_PLAY) { MP_End(); if (!BTST(config.playmode, PM_MODULE) && !next && settime) PL_SetTimeCurrent(&playlist, mf->sngtime); PL_SetPlayedCurrent(&playlist); Player_Stop(); Player_Free(mf); status.state = STATE_READY; } mf = NULL; filename = archive = NULL; switch (next) { case 0: case PL_CONT_NEXT: status.listend = !PL_ContNext(&playlist, &filename, &archive, config.playmode); break; case PL_CONT_PREV: status.listend = !PL_ContPrev(&playlist, &filename, &archive); break; case PL_CONT_POS: status.listend = !PL_ContPos(&playlist, &filename, &archive, next_pl_pos); break; } next = 0; settime = 1; if (status.listend && (PL_GetLength(&playlist) > 0 || quiet)) player_quit(); if (!status.listend) { int playfd; FILE *playfile = NULL; char *playname; if (!filename) { handle_ListError(config.tolerant, filename, archive, 0); return 1; } /* load the module */ playfd = MA_dearchive(archive, filename, &playname); if (playfd >= 0) playfile = fdopen (playfd, "rb"); if (playfd < 0 || !playfile) { handle_ListError(config.tolerant, filename, archive, 0); return 1; } display_loadbanner(); mf = Player_LoadFP(playfile, CFG_MAXCHN, config.curious); fclose (playfile); if (playname) { unlink (path_conv_sys(playname)); free (playname); } if (!mf) { handle_ListError(config.tolerant, filename, archive, 1); return 1; } /* start playing */ mf->extspd = config.extspd; mf->panflag = config.panning; mf->wrap = (BTST(config.playmode, PM_MODULE) ? 1 : 0); mf->loop = config.loop; mf->fadeout = config.fade; Player_Start(mf); if (mf->volume > uservolume) Player_SetVolume(uservolume); if (next_sng_pos > 0) { Player_SetPosition(next_sng_pos); settime = 0; next_sng_pos = 0; } MP_Start(); status.state = STATE_PLAY; } display_start(); } MP_Update(); if (config.volrestrict && mf) if (mf->volume > uservolume) MP_Volume(uservolume); /* update the status display... */ display_status(); win_refresh(); return 1; } int main(int argc, char *argv[]) { int t; BOOL use_threads = 0; char *pos = NULL; long engineversion = MikMod_GetVersion(); #ifdef __EMX__ _wildcard(&argc, &argv); #endif /* Find program name without path component */ pos = FIND_LAST_DIRSEP(argv[0]); PRG_NAME = (pos)? pos + 1 : argv[0]; for (t = 0; t < argc; t++) if ((!strcmp(argv[t], "-norc")) || (!strcmp(argv[t], "--norc"))) { status.norc = 1; argv[t][0] = 0; break; } /* Read configuration */ CF_Init(&config); if (!status.norc) CF_Load(&config); /* Initialize libmikmod */ Player_InitLib(); /* Setup playlist */ PL_InitList(&playlist); /* Parse commandline */ opterr = 0; while ((t = getopt_long_only(argc, argv, "d:o:f:r:v:y:p:iFlaxctsSqn::N:Vh", options, NULL)) != -1) { switch (t) { case 'd': /* -d --driver */ #if LIBMIKMOD_VERSION >= 0x030107 if (strlen(optarg) > 2) { char *opts = strchr(optarg, ','); if (opts) { *opts = 0; /* numeric driver specification ? */ if (opts - optarg <= 2) get_int(optarg, &config.driver, 0, 999); else config.driver = MikMod_DriverFromAlias(optarg); rc_set_string(&config.driveroptions, ++opts, 99); } else config.driver = MikMod_DriverFromAlias(optarg); } else #endif get_int(optarg, &config.driver, 0, 999); break; case 'o': /* -o --output */ for (pos = optarg; pos && *pos; pos++) switch (toupper((int)*pos)) { case '1': case '6': config.mode_16bit = 1; break; case '8': config.mode_16bit = 0; break; case 'S': config.stereo = 1; break; case 'M': config.stereo = 0; break; } break; case 'f': /* -f --frequency */ get_int(optarg, &config.frequency, 4000, 60000); break; case 'i': /* -i --interpolate */ config.interpolate = 1; break; case 1: /* --nointerpolate */ config.interpolate = 0; break; case 2: /* --hqmixer */ config.hqmixer = 1; break; case 3: /* --nohqmixer */ config.hqmixer = 0; break; case 4: /* --surround */ config.surround = 1; break; case 5: /* --nosurround */ config.surround = 0; break; case 'r': /* -r --reverb */ get_int(optarg, &config.reverb, 0, 15); break; case 'v': /* -v --volume */ get_int(optarg, &config.volume, 0, 100); break; case 'F': /* -F --fadeout */ config.fade = 1; break; case 6: /* --nofadeout */ config.fade = 0; break; case 'l': /* -l --loops */ config.loop = 1; break; case 7: /* --noloops */ config.loop = 0; break; case 'a': /* -a --panning */ config.panning = 1; break; case 8: /* --nopanning */ config.panning = 0; break; case 'x': /* -x --protracker */ config.extspd = 0; break; case 9: /* --noprotracker */ config.extspd = 1; break; case 'y': /* -y --directory */ path_conv(optarg); list_scan_dir (optarg,quiet); break; case 'c': /* -c --curious */ config.curious = 1; break; case 10: /* --nocurious */ config.curious = 0; break; case 'p': /* -p --playmode */ get_int(optarg, &config.playmode, 0, PM_MODULE | PM_MULTI | PM_SHUFFLE | PM_RANDOM); break; case 't': /* -t --tolerant */ config.tolerant = 1; break; case 11: /* --notolerant */ config.tolerant = 0; break; case 's': /* -s --renice */ config.renice = RENICE_PRI; break; case 'S': /* -S --realtime */ config.renice = RENICE_REAL; break; case 12: /* --norenice --norealtime */ config.renice = RENICE_NONE; break; case 'q': /* -q --quiet */ quiet = 1; break; case 'n': /* -n --information */ if (optarg) { int drvno; get_int(optarg, &drvno, 1, 99); puts(mikcopyr); display_driver_help(drvno); } else { puts(mikcopyr); printf("Sound engine version %ld.%ld.%ld\n", (engineversion >> 16) & 255, (engineversion >> 8) & 255, (engineversion) & 255); printf("\nAvailable drivers are :\n%s\n" "\nRecognized module formats are :\n%s\n", MikMod_InfoDriver(), MikMod_InfoLoader()); } exit(0); case 'N': { int drvno; get_int(optarg, &drvno, 1, 99); puts(mikcopyr); display_driver_help(drvno); exit(0); } case 'V': /* --version */ puts(mikcopyr); printf("Sound engine version %ld.%ld.%ld\n", (engineversion >> 16) & 255, (engineversion >> 8) & 255, (engineversion) & 255); exit(0); case 'h': /* -h --help */ help(&config); exit(0); default: /* ignore errors */ break; } } set_priority(&config); /* Add remaining parameters to the playlist */ for (t = optind; t < argc; t++) { if (!quiet) { printf("\rScanning files... %c (%d left) ", ("/-\\|")[t & 3], argc - t); fflush(stdout); } path_conv(argv[t]); MA_FindFiles(&playlist, argv[t]); } if (!PL_GetLength(&playlist) && !status.norc) PL_LoadDefault(&playlist); PL_DelDouble(&playlist); if (BTST(config.playmode, PM_SHUFFLE)) PL_Randomize(&playlist); PL_InitCurrent(&playlist); if (!quiet) puts(mikbanner); /* initialize interface */ win_init(quiet); display_init(); Player_SetConfig(&config); use_threads = MP_Init(); #ifndef _WIN32 signal(SIGTERM, ExitGracefully); signal(SIGINT, ExitGracefully); #if defined(__linux) if (!use_threads) #endif { signal(SIGUSR1, GotoNext); signal(SIGUSR2, GotoPrev); } #endif if (!quiet) win_panel_set_handle_key(DISPLAY_ROOT, player_handle_key); win_timeout_add (5, player_timeout, NULL); win_run(); return 0; /* never reached */ } /* ex:set ts=4: */ mikmod-3.2.9/src/mconfedit.c0000644000000000000000000005573214362342042014422 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mconfedit.c,v 1.2 2004/01/29 17:36:13 raph Exp $ The config editor ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "rcfile.h" #include "mconfig.h" #include "mconfedit.h" #include "mlist.h" #include "mmenu.h" #include "mdialog.h" #include "mutilities.h" #define OPT_DRIVER 0 #if LIBMIKMOD_VERSION >= 0x030107 #define OPT_DRV_OPTION 1 #define OPT_STEREO 2 #define OPT_MODE_16BIT 3 #define OPT_FREQUENCY 4 #define OPT_INTERPOLATE 5 #define OPT_HQMIXER 6 #define OPT_SURROUND 7 #define OPT_REVERB 8 #else #define OPT_STEREO 1 #define OPT_MODE_16BIT 2 #define OPT_FREQUENCY 3 #define OPT_INTERPOLATE 4 #define OPT_HQMIXER 5 #define OPT_SURROUND 6 #define OPT_REVERB 7 #endif #define OPT_VOLUME 0 #define OPT_VOLRESTRICT 1 #define OPT_FADE 2 #define OPT_LOOP 3 #define OPT_PANNING 4 #define OPT_EXTSPD 5 #define OPT_PM_MODULE 0 #define OPT_PM_MULTI 1 #define OPT_PM_SHUFFLE 2 #define OPT_PM_RANDOM 3 #define OPT_CURIOUS 1 #define OPT_TOLERANT 2 #define OPT_FULLPATHS 3 #define OPT_EDITTHEME 4 #define OPT_THEME 5 #define OPT_WINDOWTITLE 6 #if LIBMIKMOD_VERSION >= 0x030200 #define OPT_SAMPLES 7 #define OPT_FAKEVOLBARS 8 #define OPT_RENICE 9 #define OPT_STATUSBAR 10 #else #define OPT_RENICE 7 #define OPT_STATUSBAR 8 #endif #define OPT_S_CONFIG 0 #define OPT_S_PLAYLIST 1 #define MENU_MAIN 0 #define MENU_OUTPUT 1 #define MENU_PLAYBACK 2 #define MENU_OTHER 3 #define MENU_USE 4 #define MENU_SAVE 5 #define MENU_REVERT 6 static void handle_menu(MMENU *menu); #if LIBMIKMOD_VERSION >= 0x030107 static char driveroptions[100] = ""; #endif static MENTRY output_entries[] = { {NULL, 0, "The device driver for output"}, #if LIBMIKMOD_VERSION >= 0x030107 {NULL, driveroptions, "Driver options (e.g. \"buffer=14,count=16\" for the OSS-driver)"}, #endif {"[%c] &Stereo", 0, "mono/stereo output"}, {"[%c] 16 &bit output", 0, "8/16 bit output"}, {"&Frequency [%d]|Enter mixing frequency:|4000|60000", 0, "Mixing frequency in hertz (from 4000 Hz to 60000 Hz)"}, {"[%c] &Interpolate", 0, "Use interpolated mixing"}, {"[%c] &HQmixer", 0, "Use high-quality (but slower) software mixer"}, {"[%c] S&urround", 0, "Use surround mixing"}, {"&Reverb [%d]|Enter reverb amount:|0|15", 0, "Reverb amount from 0 (no reverb) to 15"}, {NULL,NULL,NULL} }; static MMENU output_menu = { 0, 0, -1, 1, output_entries, handle_menu, NULL, NULL, 1 }; static MENTRY playback_entries[] = { {"&Volume [%d]|Enter output volume:|0|100", 0, "Output volume from 0 to 100 in %"}, {"[%c] &Restrict Volume", 0, "Restrict volume of player to volume supplied by user (with 1..0,<,>)"}, {"[%c] &Fadeout", 0, "Force volume fade at the end of module"}, {"[%c] &Loops", 0, "Enable in-module loops"}, {"[%c] &Panning", 0, "Process panning effects"}, {"[%c] Pro&tracker", 0, "Use extended protracker effects"}, {NULL,NULL,NULL} }; static MMENU playback_menu = { 0, 0, -1, 1, playback_entries, handle_menu, NULL, NULL, 2 }; static MENTRY plmode_entries[] = { {"[%c] Loop &module", 0, "Loop current module"}, {"[%c] Loop &list", 0, "Play the list repeatedly"}, {"[%c] &Shuffle list", 0, "Shuffle list at start and when all entries are played"}, {"[%c] List &random", 0, "Play list in random order"}, {NULL,NULL,NULL} }; static MMENU plmode_menu = { 0, 0, -1, 1, plmode_entries, handle_menu, NULL, NULL, 4 }; static MENTRY exit_entries[] = { {"[%c] Save &config", 0, NULL}, {"[%c] Save &playlist", 0, NULL}, {NULL,NULL,NULL} }; static MMENU exit_menu = { 0, 0, -1, 1, exit_entries, handle_menu, NULL, NULL, 5 }; static MENTRY other_entries[] = { {"&Playmode %>", &plmode_menu, "Playlist playing mode"}, {"[%c] &Curious", 0, "Look for hidden patterns in module"}, {"[%c] &Tolerant", 0, "Don't halt on file access errors"}, {"[%c] &Full path", 0, "Display full path of files"}, {"&Edit theme", 0, "Copy, edit, or delete active theme"}, {NULL, 0, "Color theme to use ((C) color theme, (M) mono theme)"}, {"[%c] &Window title", 0, "Set the term/window title to song name/filename"}, #if LIBMIKMOD_VERSION >= 0x030200 {"[%c] Sample&names", 0, "Always display sample names in volumebars panel"}, {"[%c] Fake &volumebars", 0, "Display fast (non CPU-intensive) volumebars"}, #endif {"&Scheduling [%o]|Normal|Renice|Realtime", 0, "Change process priority, MikMod must be restarted to change this"}, {"Status&bar [%o]|None|Small|Big", 0, "Size of the statusbar"}, {"&On exit %>", &exit_menu, ""}, {NULL,NULL,NULL} }; static MMENU other_menu = { 0, 0, -1, 1, other_entries, handle_menu, NULL, NULL, 3 }; static MENTRY entries[] = { {"&Output options %>", &output_menu, ""}, {"&Playback options %>", &playback_menu, ""}, {"O&ther options %>", &other_menu, ""}, {"%------------", 0, NULL}, {"&Use config", 0, "Activate the edited configuration"}, {"S&ave config", 0, "Save and activate the edited configuration"}, {"R&evert config", 0, "Reset the configuration to the actual used one"}, {NULL,NULL,NULL} }; static MMENU menu = { 0, 0, -1, 0, entries, handle_menu, NULL, NULL, 0 }; typedef struct { WIDGET *w; /* bold/... - indicator */ WID_STR *str_w; WID_COLORSEL *col_w; WID_LIST *list_w; int cur_attr; /* selected attribute in list widget */ THEME theme; THEME test_theme; int orig_theme; /* index into themes-arry */ } THEME_DATA; /* Copies of the config theme entries, needed for use/save/revert config */ static int cnt_themes = 0; static THEME *themes = NULL; /* set help text of menu entry free old menu->help and malloc new entry */ void set_help(MENTRY *entry, const char *str, ...) { va_list args; int len = 0; if (entry->help) free(entry->help); va_start(args, str); VSNPRINTF (storage, STORAGELEN, str, args); va_end(args); len = MIN(strlen(storage), STORAGELEN); entry->help = (char *) malloc(sizeof(char) * (len + 1)); strncpy(entry->help, storage, len); entry->help[len] = '\0'; } static char *skip_number(char *str) { if (!str) { return NULL; } while (*str == ' ') { str++; } while (isdigit((unsigned char)*str)) { str++; } while (*str == ' ') { str++; } return str; } /* extract drivers for the option menu */ static void get_drivers(MENTRY *entry) { char *driver = MikMod_InfoDriver(), *pos, *start; int len = 0, x = 0; BOOL end; for (pos = skip_number(driver); pos && *pos; pos++) { if (*pos == '\n') { if (x > 35) x = 35; len += x; x = 0; pos = skip_number(pos + 1); } x++; } x--; if (*(pos - 1) != '\n') len += (x >= 35 ? 35 : x); if (entry->text) free(entry->text); entry->text = (char *) malloc(sizeof(char) * (len + 25)); strcpy(entry->text, "&Driver [%o]|Autodetect"); start = skip_number(driver); end = !(start && *start); for (pos = start; !end; pos++) { end = !*pos; if (*pos == '\n' || (!*pos && *(pos - 1) != '\n')) { strcat(entry->text, "|"); len = strlen(entry->text); /* don't embed text in braces or 'v#.#' in string */ for (x = 0; x < 34 && start + x <= pos; x++) { if (*(start + x) == '(') break; if ((*(start + x)) == 'v' && isdigit((unsigned char) *(start + x + 1))) break; } while (x > 0 && *(start + x - 1) == ' ') x--; strncat(entry->text, start, x); entry->text[len + x] = '\0'; pos = skip_number(pos + 1); start = pos; } } #if (LIBMIKMOD_VERSION >= 0x030200) && defined(HAVE_MIKMOD_FREE) /* MikMod_free() is in libmikmod-3.2.0 beta3 and newer versions. */ MikMod_free(driver); #else free(driver); #endif } /* extract drivers options for the option menu */ static void get_driver_options(MENTRY *entry, MENTRY *dr_entry) { int drvno = (SINTPTR_T) dr_entry->data; char *cmdline; if (entry->text) free (entry->text); if (driver_get_info (drvno, NULL, &cmdline) && drvno) { int cmdlen = 0, i = drvno; char *end, *pos = strchr(dr_entry->text, '|'); while (pos && i>0) { pos = strchr(pos+1, '|'); i--; } end = pos; if (pos && *pos && i==0) { pos++; end = strchr(pos, '|'); if (!end) end = pos+strlen(pos); } if (cmdline) { cmdlen = strlen (cmdline); if (cmdline[cmdlen-1] == '\n') cmdlen--; } entry->text = (char *) malloc(sizeof(char) * (cmdlen+end-pos+50+20)); strcpy(entry->text, "Driver &options [%s]|Enter driver options"); if (end > pos && cmdlen > 0) { strcat (entry->text, " (Options for "); strncat(entry->text, pos, end-pos); strcat (entry->text, ":\n"); strncat(entry->text, cmdline, cmdlen); strcat (entry->text, "):|255|16"); } else strcat(entry->text, ":|255|16"); if (cmdline) free (cmdline); } else { entry->text = (char *) malloc(sizeof(char) * 50); strcpy(entry->text, "Driver &options [%s]|Enter driver options:|255|16"); } } /* extract themes for the other menu */ static void get_themes(MENTRY *entry) { char *pos; int i, j, len = 0; for (i=0; i32 ? 32:j) + 5; } if (entry->text) free (entry->text); entry->text = (char *) malloc(sizeof(char) * (len + 15)); strcpy(entry->text, "T&heme [%o]"); pos = entry->text + strlen(entry->text); for (i=0; i32 ? 32:j); memcpy(pos, themes[i].name, j); pos += j; *pos = '\0'; } } static int config_get_act_theme(void) { return (SINTPTR_T)other_entries[OPT_THEME].data; } static void config_set_act_theme(int act_theme) { other_entries[OPT_THEME].data = (void *)(SINTPTR_T)act_theme; } static void theme_get_attrs (THEME_DATA *data) { int *attr = &data->theme.attrs[data->cur_attr]; if (data->theme.color) { if (data->col_w) *attr = data->col_w->active; if (((WID_TOGGLE*)data->w)->selected == 1) *attr |= COLOR_BOLDMASK; else *attr &= ~COLOR_BOLDMASK; } else { WID_CHECK *cw = (WID_CHECK*)data->w; if (cw->selected == 1) *attr = A_NORMAL; else if (cw->selected == 2) *attr = A_BOLD; else if (cw->selected == 4) *attr = A_REVERSE; } } static void theme_set_attrs (THEME_DATA *data, int repaint) { int cur = data->cur_attr, i = 0; if (data->theme.color) { if (data->col_w) { wid_colorsel_set_active((WID_COLORSEL*)data->col_w, data->theme.attrs[cur]); if (repaint) wid_repaint ((WIDGET*)data->col_w); } if (data->theme.attrs[cur] & COLOR_BOLDMASK) i = 1; else i = 0; wid_toggle_set_selected((WID_TOGGLE*)data->w, i); } else { if (data->theme.attrs[cur] == A_NORMAL) i = 1; else if (data->theme.attrs[cur] == A_BOLD) i = 2; else if (data->theme.attrs[cur] == A_REVERSE) i = 4; wid_check_set_selected ((WID_CHECK*)data->w, i); } if (repaint) wid_repaint (data->w); } static int cb_theme_list_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { THEME_DATA *data = (THEME_DATA *) w->data; theme_get_attrs (data); data->cur_attr = ((WID_LIST*)w)->cur; theme_set_attrs (data,1); return EVENT_HANDLED; } return focus; } static void theme_edit_close (THEME_DATA *data) { win_set_theme (&config.themes[config.theme]); config_set_act_theme (data->orig_theme); get_themes(&other_entries[OPT_THEME]); if (data->w) dialog_close(data->w->d); CF_theme_free (&data->theme); CF_theme_free (&data->test_theme); free (data); } static int cb_theme_button_focus(WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { THEME_DATA *data = (THEME_DATA *) w->data; int button = ((WID_BUTTON *) w)->active; switch (button) { case 0: /* Ok */ theme_get_attrs (data); if (data->theme.name) free (data->theme.name); data->theme.name = strdup(data->str_w->input); CF_theme_remove (data->orig_theme,&themes,&cnt_themes); data->orig_theme = CF_theme_insert (&themes, &cnt_themes, &data->theme); theme_edit_close (data); break; case 1: /* Test */ if (win_has_colors() || !data->theme.color) { theme_get_attrs (data); CF_theme_free (&data->test_theme); CF_theme_copy (&data->test_theme,&data->theme); win_set_theme (&data->test_theme); win_panel_repaint(); } else { /* Cancel */ theme_edit_close (data); } break; case 2: /* Cancel */ theme_edit_close (data); break; } return EVENT_HANDLED; } return focus; } static int cb_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { THEME_DATA *data = (THEME_DATA *) w->data; if (data->list_w->w.has_focus) return FOCUS_DONT; } return focus; } static void theme_edit (int act_theme) { DIALOG *d = dialog_new(); WIDGET *w; char title[200]; THEME_DATA *data = (THEME_DATA *) malloc(sizeof(THEME_DATA)); data->cur_attr = 0; data->orig_theme = act_theme; data->test_theme.name = NULL; data->test_theme.attrs = NULL; CF_theme_copy (&data->theme, &themes[act_theme]); w = wid_list_add(d, 1, attrs_label, ATTRS_COUNT); wid_list_set_selection_mode ((WID_LIST*)w, WID_SEL_BROWSE); wid_set_size (w, 20, -1); wid_set_func(w, NULL, cb_theme_list_focus, data); data->list_w = (WID_LIST*) w; data->str_w = (WID_STR*)wid_str_add(d, 0, data->theme.name, THEME_NAME_LEN); wid_set_size ((WIDGET*)data->str_w, 26, -1); if (data->theme.color) { if (win_has_colors()) { data->col_w = (WID_COLORSEL*)wid_colorsel_add(d, 1, "sdex", 0); wid_set_func((WIDGET*)data->col_w, NULL, cb_focus, data); data->w = wid_toggle_add (d,0,"&bold",0,0); } else { data->col_w = NULL; data->w = wid_toggle_add (d,2,"&bold",0,0); } wid_set_func(data->w, NULL, cb_focus, data); } else { data->w = wid_check_add (d,2,"&normal|&bold|&reverse",0,0); wid_set_func(data->w, NULL, cb_focus, data); } theme_set_attrs (data,0); if (win_has_colors() || !data->theme.color) w = wid_button_add(d, -1, "&Ok|&Test|&Cancel", 0); else w = wid_button_add(d, -1, "&Ok|&Cancel", 0); wid_set_func(w, NULL, cb_theme_button_focus, data); strcpy (title,"Edit theme "); strncat (title, data->theme.name, 180); dialog_open(d, title); } /* Return a unique name among the themes which is based on src_name */ static char *theme_uniq_name (char *src_name) { char buf[THEME_NAME_LEN+1], *pos, *name; int i, n, len; strncpy (buf,src_name,THEME_NAME_LEN); buf[THEME_NAME_LEN] = '\0'; for (pos = buf+strlen(buf)-1; pos>=buf && isspace((int)*pos); pos--) *pos = '\0'; if (pos>buf && isdigit((unsigned char) *pos) && isdigit((unsigned char) *(pos-1))) *(pos-2) = '\0'; if (strlen(buf) > THEME_NAME_LEN-5) buf[THEME_NAME_LEN-5] = '\0'; strcat (buf," %02d"); len = strlen(buf)+1; name = (char *) malloc (sizeof(char)*len); n = 2; do { SNPRINTF (name,len,buf,n); for (i=0; i=cnt_themes) return name; n++; } while (n<100); free (name); return NULL; } static void theme_copy (int *act_theme) { THEME newtheme; newtheme.color = themes[*act_theme].color; newtheme.attrs = themes[*act_theme].attrs; if ((newtheme.name = theme_uniq_name (themes[*act_theme].name))) { *act_theme = CF_theme_insert (&themes,&cnt_themes,&newtheme); free (newtheme.name); } } /* theme edit callback */ static BOOL cb_themeedit (WIDGET *w, int button, void *input, void *data) { int act_theme = config_get_act_theme(); BOOL user_theme = act_theme >= THEME_COUNT; if (button>2 || (!user_theme && button>1)) return 1; switch (button) { case 0: /* Copy */ theme_copy (&act_theme); break; case 1: /* Edit or Copy + Edit */ if (!user_theme) theme_copy (&act_theme); theme_edit (act_theme); break; case 2: /* Delete (if user_theme) */ CF_theme_remove (act_theme,&themes,&cnt_themes); if (act_theme>=cnt_themes) act_theme--; break; } config_set_act_theme (act_theme); get_themes(&other_entries[OPT_THEME]); return 1; } static void config_set_config(CONFIG *cfg) { int i; output_entries[OPT_DRIVER].data = (void *)(SINTPTR_T)cfg->driver; #if LIBMIKMOD_VERSION >= 0x030107 strcpy ((char *)output_entries[OPT_DRV_OPTION].data,cfg->driveroptions); #endif output_entries[OPT_STEREO].data = (void *)(SINTPTR_T)cfg->stereo; output_entries[OPT_MODE_16BIT].data = (void *)(SINTPTR_T)cfg->mode_16bit; output_entries[OPT_FREQUENCY].data = (void *)(SINTPTR_T)cfg->frequency; output_entries[OPT_INTERPOLATE].data = (void *)(SINTPTR_T)cfg->interpolate; output_entries[OPT_HQMIXER].data = (void *)(SINTPTR_T)cfg->hqmixer; output_entries[OPT_SURROUND].data = (void *)(SINTPTR_T)cfg->surround; output_entries[OPT_REVERB].data = (void *)(SINTPTR_T)cfg->reverb; playback_entries[OPT_VOLUME].data = (void *)(SINTPTR_T)cfg->volume; playback_entries[OPT_VOLRESTRICT].data = (void *)(SINTPTR_T)cfg->volrestrict; playback_entries[OPT_FADE].data = (void *)(SINTPTR_T)cfg->fade; playback_entries[OPT_LOOP].data = (void *)(SINTPTR_T)cfg->loop; playback_entries[OPT_PANNING].data = (void *)(SINTPTR_T)cfg->panning; playback_entries[OPT_EXTSPD].data = (void *)(SINTPTR_T)cfg->extspd; plmode_entries[OPT_PM_MODULE].data = (void *)(SINTPTR_T)BTST(cfg->playmode, PM_MODULE); plmode_entries[OPT_PM_MULTI].data = (void *)(SINTPTR_T)BTST(cfg->playmode, PM_MULTI); plmode_entries[OPT_PM_SHUFFLE].data = (void *)(SINTPTR_T)BTST(cfg->playmode, PM_SHUFFLE); plmode_entries[OPT_PM_RANDOM].data = (void *)(SINTPTR_T)BTST(cfg->playmode, PM_RANDOM); other_entries[OPT_CURIOUS].data = (void *)(SINTPTR_T)cfg->curious; other_entries[OPT_TOLERANT].data = (void *)(SINTPTR_T)cfg->tolerant; other_entries[OPT_FULLPATHS].data = (void *)(SINTPTR_T)cfg->fullpaths; other_entries[OPT_WINDOWTITLE].data = (void *)(SINTPTR_T)cfg->window_title; #if LIBMIKMOD_VERSION >= 0x030200 other_entries[OPT_SAMPLES].data = (void *)(SINTPTR_T)cfg->forcesamples; other_entries[OPT_FAKEVOLBARS].data = (void *)(SINTPTR_T)cfg->fakevolbars; #endif other_entries[OPT_RENICE].data = (void *)(SINTPTR_T)cfg->renice; other_entries[OPT_STATUSBAR].data = (void *)(SINTPTR_T)cfg->statusbar; exit_entries[OPT_S_CONFIG].data = (void *)(SINTPTR_T)cfg->save_config; exit_entries[OPT_S_PLAYLIST].data = (void *)(SINTPTR_T)cfg->save_playlist; #if LIBMIKMOD_VERSION >= 0x030107 get_driver_options (&output_entries[OPT_DRV_OPTION], &output_entries[OPT_DRIVER]); #endif CF_themes_free (&themes, &cnt_themes); for (i = 0; i < cfg->cnt_themes; i++) CF_theme_insert (&themes, &cnt_themes, &cfg->themes[i]); config_set_act_theme(cfg->theme); get_themes(&other_entries[OPT_THEME]); } static void config_get_config(CONFIG *cfg) { int i; cfg->driver = (SINTPTR_T)output_entries[OPT_DRIVER].data; #if LIBMIKMOD_VERSION >= 0x030107 rc_set_string(&cfg->driveroptions, (char *)output_entries[OPT_DRV_OPTION].data, 99); #endif cfg->stereo = (BOOL)(SINTPTR_T)output_entries[OPT_STEREO].data; cfg->mode_16bit = (BOOL)(SINTPTR_T)output_entries[OPT_MODE_16BIT].data; cfg->frequency = (SINTPTR_T)output_entries[OPT_FREQUENCY].data; cfg->interpolate = (BOOL)(SINTPTR_T)output_entries[OPT_INTERPOLATE].data; cfg->hqmixer = (BOOL)(SINTPTR_T)output_entries[OPT_HQMIXER].data; cfg->surround = (BOOL)(SINTPTR_T)output_entries[OPT_SURROUND].data; cfg->reverb = (SINTPTR_T)output_entries[OPT_REVERB].data; cfg->volume = (SINTPTR_T)playback_entries[OPT_VOLUME].data; cfg->volrestrict = (BOOL)(SINTPTR_T)playback_entries[OPT_VOLRESTRICT].data; cfg->fade = (BOOL)(SINTPTR_T)playback_entries[OPT_FADE].data; cfg->loop = (BOOL)(SINTPTR_T)playback_entries[OPT_LOOP].data; cfg->panning = (BOOL)(SINTPTR_T)playback_entries[OPT_PANNING].data; cfg->extspd = (BOOL)(SINTPTR_T)playback_entries[OPT_EXTSPD].data; cfg->playmode = (((BOOL)(SINTPTR_T)plmode_entries[OPT_PM_MODULE].data) ? PM_MODULE : 0) | (((BOOL)(SINTPTR_T)plmode_entries[OPT_PM_MULTI].data) ? PM_MULTI : 0) | (((BOOL)(SINTPTR_T)plmode_entries[OPT_PM_SHUFFLE].data) ? PM_SHUFFLE : 0) | (((BOOL)(SINTPTR_T)plmode_entries[OPT_PM_RANDOM].data) ? PM_RANDOM : 0); cfg->curious = (BOOL)(SINTPTR_T)other_entries[OPT_CURIOUS].data; cfg->tolerant = (BOOL)(SINTPTR_T)other_entries[OPT_TOLERANT].data; cfg->fullpaths = (BOOL)(SINTPTR_T)other_entries[OPT_FULLPATHS].data; cfg->window_title = (BOOL)(SINTPTR_T)other_entries[OPT_WINDOWTITLE].data; #if LIBMIKMOD_VERSION >= 0x030200 cfg->forcesamples = (BOOL)(SINTPTR_T)other_entries[OPT_SAMPLES].data; cfg->fakevolbars = (BOOL)(SINTPTR_T)other_entries[OPT_FAKEVOLBARS].data; #endif cfg->renice = (SINTPTR_T)other_entries[OPT_RENICE].data; cfg->statusbar = (SINTPTR_T)other_entries[OPT_STATUSBAR].data; cfg->save_config = (BOOL)(SINTPTR_T)exit_entries[OPT_S_CONFIG].data; cfg->save_playlist = (BOOL)(SINTPTR_T)exit_entries[OPT_S_PLAYLIST].data; CF_themes_free_user (&cfg->themes, &cfg->cnt_themes); for (i=THEME_COUNT; ithemes, &cfg->cnt_themes, &themes[i]); cfg->theme = config_get_act_theme(); } static void handle_menu(MMENU *mn) { switch (mn->id) { case MENU_MAIN: switch (mn->cur) { case MENU_USE: config_get_config(&config); Player_SetConfig(&config); win_status("Configuration activated"); config_set_config(&config); break; case MENU_SAVE: config_get_config(&config); CF_Save(&config); Player_SetConfig(&config); win_status("Configuration saved and activated"); config_set_config(&config); break; case MENU_REVERT: config_set_config(&config); win_status("Changed configuration reseted"); break; } break; case MENU_OUTPUT: #if LIBMIKMOD_VERSION >= 0x030107 if (mn->cur == OPT_DRIVER) get_driver_options(&output_entries[OPT_DRV_OPTION], &output_entries[OPT_DRIVER]); #endif break; case MENU_OTHER: if (mn->cur == OPT_EDITTHEME) { if (config_get_act_theme() < THEME_COUNT) dlg_message_open("Copy or copy and edit active (default-)theme?", "&Copy|Copy + &Edit|&Cancel", 2, 0, cb_themeedit, NULL); else dlg_message_open("Copy, edit, or delete the active theme?", "&Copy|&Edit|Delete|&Cancel", 3, 0, cb_themeedit, NULL); } break; } } /* open config editor */ void config_open(void) { char *name = CF_GetFilename(); set_help(&exit_entries[OPT_S_CONFIG], "Save config at exit in '%s'", name); if (name) free(name); name = PL_GetFilename(); set_help(&exit_entries[OPT_S_PLAYLIST], "Save playlist at exit in '%s'", name); if (name) free(name); get_drivers(&output_entries[OPT_DRIVER]); config_set_config(&config); menu_open(&menu, 5, 5); } /* ex:set ts=4: */ mikmod-3.2.9/src/mmenu.c0000644000000000000000000003135612276756040013600 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mmenu.c,v 1.1.1.1 2004/01/16 02:07:38 raph Exp $ Menu functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "display.h" #include "mmenu.h" #include "mwindow.h" #include "mdialog.h" #include "keys.h" #include "mutilities.h" static BOOL menu_check (char *text, char ch) { while (*text) { if (*text == '%') { text++; if (*text == ch) return 1; else if (*text != '%') return 0; } text++; } return 0; } static BOOL menu_is_sub(MENTRY *entry) { int i = 0, end = strlen(entry->text) - 1; if (entry->text[end--] == '>') { while (entry->text[end--] == '%') i++; return (i%2) != 0; } return 0; } static BOOL menu_is_option(MENTRY *entry) { return menu_check (entry->text,'o'); } static BOOL menu_is_toggle(MENTRY *entry) { return menu_check (entry->text,'c'); } static BOOL menu_is_int(MENTRY *entry) { return menu_check (entry->text,'d'); } static BOOL menu_is_str(MENTRY *entry) { return menu_check (entry->text,'s'); } static BOOL menu_has_sub(MENTRY *entry) { return menu_is_str(entry) || menu_is_int(entry) || menu_is_option(entry) || menu_is_sub(entry); } static int menu_width (char *txt) { int width = strlen(txt); char *help; while ((help = strchr(txt, '&'))) { txt = help+2; width--; } return width; } static char *get_text(MENTRY *entry, int width) { char *text, help[100], sub[100], *start, *pos; int i; if (entry) { if (entry->text[0] == '%' && entry->text[1] == '-') text = strdup(&entry->text[1]); else text = strdup(entry->text); if (menu_is_sub(entry)) { i = strlen(text); text[i-2] = '>'; text[i-1] = '\0'; } pos = text-1; do { pos++; pos = strchr(pos, '%'); if (pos) pos++; } while (pos && (*pos == '%' || *pos == '>' || *pos == '-')); if (pos) { if (*pos == 'c') sprintf(storage, text, (SINTPTR_T)(entry->data) ? 'x' : ' '); else if ((*pos == 'o') && (start = strchr(pos, '|'))) { char *s_pos = NULL; int max = 0; strncpy(help, text, start - text); help[start - text] = '\0'; help[pos - text] = 's'; start++; i = (SINTPTR_T)(entry->data); pos = start; while (start) { if (!i) s_pos = pos; if ((start = strchr(pos, '|'))) { if (start - pos > max) max = start - pos; pos = start + 1; } i--; } if (strlen(pos) > max) max = strlen(pos); if (width>0 && menu_width(help)-2+max > width) max = width - menu_width(help)+2; i = 0; while (s_pos && (*s_pos) && (*s_pos != '|')) sub[i++] = *s_pos++; while (i < max) sub[i++] = ' '; sub[max] = '\0'; sprintf(storage, help, sub); } else if ((*pos == 'd' || *pos == 's') && (start = strchr(pos, '|'))) { char *right = strrchr(start, '|') + 1; strncpy(help, text, pos - text); help[pos - text] = '\0'; if (*pos == 'd') { sprintf(sub, "%d", (int)strlen(right)); strcat(help, sub); } else strcat(help, right); i = strlen(help); strncat(help, pos, start - pos); help[i + start - pos] = '\0'; if (*pos == 'd') sprintf(storage, help, (int)(SINTPTR_T)(entry->data)); else { char ch; sscanf(right, "%d", &i); pos = (char *)(entry->data); ch = pos[i]; pos[i] = '\0'; sprintf(storage, help, pos); pos[i] = ch; } } else sprintf(storage, "%s", text); } else sprintf(storage, "%s", text); free (text); /* '...%>' -> '...>' */ i = strlen(storage); if (menu_is_sub(entry)) { i--; while (i < width) storage[i++] = ' '; storage[i++] = '>'; } else { while (i < width) storage[i++] = ' '; } storage[i] = '\0'; return storage; } return NULL; } static void menu_do_repaint(MWINDOW * win, int diff) { MMENU *m = (MMENU *) win->data; int height, t, hl_pos; char *pos, *txt, hl[2], *help; height = win->height; if (height > m->count) height = m->count; m->cur += diff; if (m->cur < 0) m->cur = m->count - 1; else if (m->cur >= m->count) m->cur = 0; while (m->entries[m->cur].text[0] == '%' && m->entries[m->cur].text[1] == '-') m->cur += diff > 0 ? 1 : -1; if (m->cur < m->first) m->first = m->cur; else if (m->cur >= m->first + height) m->first = m->cur - height + 1; hl[1] = '\0'; for (t = m->first; t < m->count && t < (height + m->first); t++) { txt = get_text(&m->entries[t], win->width); hl_pos = -1; help = txt; while ((pos = strchr(help, '&'))) { help = pos+1; if ((*(pos + 1) != '&')) { hl_pos = pos - txt; hl[0] = *(pos + 1); } for (++pos; *pos; pos++) *(pos - 1) = *pos; *(pos - 1) = ' '; if (hl_pos >= 0) txt[hl_pos] = '\0'; } if (t == m->cur) { win_attrset(ATTR_MENU_ACTIVE); win_print(win, 0, t - m->first, txt); if (hl_pos >= 0) { win_attrset(ATTR_MENU_AHOTKEY); win_print(win, hl_pos, t - m->first, hl); win_attrset(ATTR_MENU_ACTIVE); win_print(win, hl_pos + 1, t - m->first, &txt[hl_pos + 1]); } win_status(m->entries[t].help); } else if (m->entries[t].text[0] == '%' && m->entries[t].text[1] == '-') { win_attrset(ATTR_MENU_FRAME); win_line (win, 0, t - m->first, win->width-1, t - m->first); } else { win_attrset(ATTR_MENU_INACTIVE); if (hl_pos >= 0) { win_print(win, 0, t - m->first, txt); win_attrset(ATTR_MENU_IHOTKEY); win_print(win, hl_pos, t - m->first, hl); win_attrset(ATTR_MENU_INACTIVE); win_print(win, hl_pos + 1, t - m->first, &txt[hl_pos + 1]); } else win_print(win, 0, t - m->first, txt); } } } static BOOL menu_repaint(MWINDOW * win) { menu_do_repaint(win, 0); return 1; } static void handle_opt_menu(MMENU * menu) { int i; MMENU *m = (MMENU *) menu->data; m->entries[m->cur].data = (void *)(SINTPTR_T)menu->cur; menu_close(menu); for (i = 0; i < menu->count; i++) free(menu->entries[i].text); free(menu->entries); free(menu); if (m->handle_select) m->handle_select(m); } static BOOL handle_input_str(WIDGET *w, int button, void *input, void *data) { if (button<=0) { MMENU* m = (MMENU*) data; strcpy((char*)m->entries[m->cur].data, (char*)input); if (m->handle_select) m->handle_select(m); } return 1; } static BOOL handle_input_int(WIDGET *w, int button, void *input, void *data) { if (button<=0) { MMENU* m = (MMENU*) data; m->entries[m->cur].data = (void *)(SINTPTR_T)atoi((char*)input); if (m->handle_select) m->handle_select(m); } return 1; } static BOOL menu_do_select(MWINDOW * win) { MMENU *m = (MMENU *) win->data; MENTRY *entry = &m->entries[m->cur]; if (menu_is_toggle(entry)) { entry->data = (void *)(SINTPTR_T)(!((SINTPTR_T)(entry->data))); menu_do_repaint(win, 0); } else if (menu_is_option(entry)) { char *pos, *start; MENTRY *sub; MMENU *newmenu = (MMENU *) malloc(sizeof(MMENU)); int cnt = 1, i; start = strchr(entry->text, '|'); pos = ++start; while ((pos = strchr(pos, '|'))) { pos++; cnt++; } newmenu->cur = (SINTPTR_T)(entry->data); newmenu->first = 0; newmenu->count = cnt; newmenu->key_left = 1; newmenu->entries = (MENTRY *) malloc(sizeof(MENTRY) * cnt); newmenu->handle_select = handle_opt_menu; newmenu->win = NULL; newmenu->data = m; sub = newmenu->entries; for (i = 0; i < cnt; i++) { if (!(pos = strchr(start, '|'))) pos = &start[strlen(start)]; sub->text = (char *) malloc(sizeof(char) * (pos - start + 1)); strncpy(sub->text, start, pos - start); sub->text[pos - start] = '\0'; sub->data = NULL; sub->help = entry->help; start = pos + 1; sub++; } menu_open(newmenu, win->x + win->width + 1, win->y + m->cur - m->first); return 1; } else if (menu_is_str(entry)) { char *msg = NULL, *start, *pos; int length = 0; start = strchr(entry->text, '|') + 1; pos = strchr(start, '|'); msg = (char *) malloc(sizeof(char) * (pos - start + 1)); strncpy(msg, start, pos - start); msg[pos - start] = '\0'; sscanf(pos + 1, "%d", &length); dlg_input_str(msg, "<&Ok>|&Cancel", (char *)(entry->data), length, handle_input_str, m); free(msg); return 1; } else if (menu_is_int(entry)) { const char *start, *pos; char *msg = NULL; int min = 0, max = 0; start = strchr(entry->text, '|') + 1; pos = strchr(start, '|'); msg = (char *) malloc(sizeof(char) * (pos - start + 1)); strncpy(msg, start, pos - start); msg[pos - start] = '\0'; sscanf(pos + 1, "%d|%d", &min, &max); dlg_input_int(msg, "<&Ok>|&Cancel", (SINTPTR_T)(entry->data), min, max, handle_input_int, m); free(msg); return 1; } else if (menu_is_sub(entry)) { MMENU *sub = (MMENU *) entry->data; sub->cur = sub->first = 0; menu_open(sub, win->x + win->width + 1, win->y + m->cur - m->first); return 1; } return 0; } void menu_close(MMENU * menu) { int i; for (i = 0; i < menu->count; i++) if (menu_is_sub(&menu->entries[i])) menu_close((MMENU *) menu->entries[i].data); if (menu->win) { win_status(NULL); win_close(menu->win); menu->win = NULL; } } static BOOL menu_handle_key(MWINDOW * win, int ch) { MMENU *menu = (MMENU *) win->data; const char *pos, *help; int i, key; if ((ch < 256) && (isalpha(ch))) ch = toupper(ch); switch (ch) { case KEY_DOWN: menu_do_repaint(win, 1); break; case KEY_UP: menu_do_repaint(win, -1); break; #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) case KEY_ESC: #endif case KEY_LEFT: if (menu->key_left) menu_close(menu); break; case KEY_RIGHT: if (menu_has_sub(&menu->entries[menu->cur])) menu_do_select(win); break; case KEY_ENTER: case '\r': if (!menu_do_select(win)) if (menu->handle_select) menu->handle_select(menu); break; default: for (i = 0; i < menu->count; i++) { key = 0; help = menu->entries[i].text; while ((pos = strchr(help, '&'))) { help = pos+2; if (*(pos+1) != '&') { key = toupper((int)(*(pos + 1))); break; } } if (key == ch) { menu_do_repaint(win, i - menu->cur); if (!menu_do_select(win)) if (menu->handle_select) menu->handle_select(menu); return 1; } } return 0; } return 1; } static void menu_handle_resize(MWINDOW * win, int dx, int dy) { int m_y, m_width, m_height; MMENU *menu = (MMENU *) win->data; win_get_size_max(&m_y, &m_width, &m_height); m_width -= 2; m_height -= 2; if (win->x + win->width > m_width) { win->x = m_width - win->width + 1; if (win->x < 1) win->x = 1; } if (win->y + win->height - m_y > m_height || win->y + menu->count - m_y > m_height) { win->y = m_height - menu->count + m_y + 1; if (win->y <= m_y) win->y = m_y + 1; } if (win->height < menu->count) win->height = menu->count; if (win->height > m_height) win->height = m_height; if (menu->first + win->height > menu->count) menu->first = menu->count - win->height; if (menu->first < 0) menu->first = 0; } void menu_open(MMENU * menu, int x, int y) { MWINDOW *win; char *entry; int m_y, m_width, m_height, width = 0; if (menu->count < 0) { menu->count = 0; while (menu->entries[menu->count].text) menu->count++; } /* get max. width of entries */ for (m_y = 0; m_y < menu->count; m_y++) { entry = get_text(&menu->entries[m_y], 0); m_width = menu_width(entry); if (m_width > width) width = m_width; } win_get_size_max(&m_y, &m_width, &m_height); m_width -= 2; m_height -= 2; if (x + width - 1 > m_width) x = m_width - width + 1; if (x < 1) x = 1; if (y + menu->count - m_y - 1 > m_height) y = m_height - menu->count + m_y + 1; if (y < m_y) y = m_y + 1; menu->win = win_open(x, y, width, menu->count, 1, NULL, ATTR_MENU_FRAME); win_set_repaint(menu_repaint); win_set_handle_key(menu_handle_key); win_set_resize(0, menu_handle_resize); win_set_data((void *)menu); win = win_get_window(); if (menu->first + win->height > menu->count) menu->first = menu->count - win->height; if (menu->first < 0) menu->first = 0; menu_repaint(win); } /* ex:set ts=4: */ mikmod-3.2.9/src/getopt_long.c0000644000000000000000000003430714316544546015002 0ustar rootroot/* $OpenBSD: getopt_long.c,v 1.32 2020/05/27 22:25:09 schwarze Exp $ */ /* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */ /* * Copyright (c) 2002 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Sponsored in part by the Defense Advanced Research Projects * Agency (DARPA) and Air Force Research Laboratory, Air Force * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Dieter Baron and Thomas Klausner. * * 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. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. */ #include #include #include #include #include "getopt_long.h" int opterr = 1; /* if error message should be printed */ int optind = 1; /* index into parent argv vector */ int optopt = '?'; /* character checked for validity */ /* initialize these two too to avoid symbol clashes from system libc: */ int optreset = 0; /* reset getopt */ char *optarg = NULL; /* argument associated with option */ #define PRINT_ERROR ((opterr) && (*options != ':')) #define FLAG_PERMUTE 0x01 /* permute non-options to the end of argv */ #define FLAG_ALLARGS 0x02 /* treat non-options as args to option "-1" */ #define FLAG_LONGONLY 0x04 /* operate as getopt_long_only */ /* return values */ #define BADCH (int)'?' #define BADARG ((*options == ':') ? (int)':' : (int)'?') #define INORDER (int)1 static char EMSG[] = {0,0,0,0}; /* #define EMSG "" */ static int getopt_internal(int, char * const *, const char *, const struct option *, int *, int); static int parse_long_options(char * const *, const char *, const struct option *, int *, int, int); static int gcd(int, int); static void permute_args(int, int, int, char * const *); static char *place = EMSG; /* option letter processing */ /* XXX: set optreset to 1 rather than these two */ static int nonopt_start = -1; /* first non option argument (for permute) */ static int nonopt_end = -1; /* first option after non options (for permute) */ /* Error messages */ static const char recargchar[] = "option requires an argument -- %c"; static const char recargstring[] = "option requires an argument -- %s"; static const char ambig[] = "ambiguous option -- %.*s"; static const char noarg[] = "option doesn't take an argument -- %.*s"; static const char illoptchar[] = "unknown option -- %c"; static const char illoptstring[] = "unknown option -- %s"; /* * Compute the greatest common divisor of a and b. */ static int gcd(int a, int b) { int c; c = a % b; while (c != 0) { a = b; b = c; c = a % b; } return (b); } /* * Exchange the block from nonopt_start to nonopt_end with the block * from nonopt_end to opt_end (keeping the same order of arguments * in each block). */ static void permute_args(int panonopt_start, int panonopt_end, int opt_end, char * const *nargv) { int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos; char *swap; /* * compute lengths of blocks and number and size of cycles */ nnonopts = panonopt_end - panonopt_start; nopts = opt_end - panonopt_end; ncycle = gcd(nnonopts, nopts); cyclelen = (opt_end - panonopt_start) / ncycle; for (i = 0; i < ncycle; i++) { cstart = panonopt_end+i; pos = cstart; for (j = 0; j < cyclelen; j++) { if (pos >= panonopt_end) pos -= nnonopts; else pos += nopts; swap = nargv[pos]; ((char **)nargv)[pos] = nargv[cstart]; ((char **)nargv)[cstart] = swap; } } } /* * parse_long_options -- * Parse long options in argc/argv argument vector. * Returns -1 if short_too is set and the option does not match long_options. */ static int parse_long_options(char * const *nargv, const char *options, const struct option *long_options, int *idx, int short_too, int flags) { char *current_argv, *has_equal; size_t current_argv_len; int i, match, exact_match, second_partial_match; current_argv = place; match = -1; exact_match = 0; second_partial_match = 0; optind++; if ((has_equal = strchr(current_argv, '=')) != NULL) { /* argument found (--option=arg) */ current_argv_len = has_equal - current_argv; has_equal++; } else current_argv_len = strlen(current_argv); for (i = 0; long_options[i].name; i++) { /* find matching long option */ if (strncmp(current_argv, long_options[i].name, current_argv_len)) continue; if (strlen(long_options[i].name) == current_argv_len) { /* exact match */ match = i; exact_match = 1; break; } /* * If this is a known short option, don't allow * a partial match of a single character. */ if (short_too && current_argv_len == 1) continue; if (match == -1) /* first partial match */ match = i; else if ((flags & FLAG_LONGONLY) || long_options[i].has_arg != long_options[match].has_arg || long_options[i].flag != long_options[match].flag || long_options[i].val != long_options[match].val) second_partial_match = 1; } if (!exact_match && second_partial_match) { /* ambiguous abbreviation */ if (PRINT_ERROR) fprintf(stderr, ambig, (int)current_argv_len, current_argv); optopt = 0; return (BADCH); } if (match != -1) { /* option found */ if (long_options[match].has_arg == no_argument && has_equal) { if (PRINT_ERROR) fprintf(stderr, noarg, (int)current_argv_len, current_argv); /* * XXX: GNU sets optopt to val regardless of flag */ if (long_options[match].flag == NULL) optopt = long_options[match].val; else optopt = 0; return (BADARG); } if (long_options[match].has_arg == required_argument || long_options[match].has_arg == optional_argument) { if (has_equal) optarg = has_equal; else if (long_options[match].has_arg == required_argument) { /* * optional argument doesn't use next nargv */ optarg = nargv[optind++]; } } if ((long_options[match].has_arg == required_argument) && (optarg == NULL)) { /* * Missing argument; leading ':' indicates no error * should be generated. */ if (PRINT_ERROR) fprintf(stderr, recargstring, current_argv); /* * XXX: GNU sets optopt to val regardless of flag */ if (long_options[match].flag == NULL) optopt = long_options[match].val; else optopt = 0; --optind; return (BADARG); } } else { /* unknown option */ if (short_too) { --optind; return (-1); } if (PRINT_ERROR) fprintf(stderr, illoptstring, current_argv); optopt = 0; return (BADCH); } if (idx) *idx = match; if (long_options[match].flag) { *long_options[match].flag = long_options[match].val; return (0); } else return (long_options[match].val); } /* * getopt_internal -- * Parse argc/argv argument vector. Called by user level routines. */ static int getopt_internal(int nargc, char * const *nargv, const char *options, const struct option *long_options, int *idx, int flags) { char *oli; /* option letter list index */ int optchar, short_too; static int posixly_correct = -1; if (options == NULL) return (-1); /* * XXX Some GNU programs (like cvs) set optind to 0 instead of * XXX using optreset. Work around this braindamage. */ if (optind == 0) optind = optreset = 1; /* * Disable GNU extensions if POSIXLY_CORRECT is set or options * string begins with a '+'. */ if (posixly_correct == -1 || optreset) posixly_correct = (getenv("POSIXLY_CORRECT") != NULL); if (*options == '-') flags |= FLAG_ALLARGS; else if (posixly_correct || *options == '+') flags &= ~FLAG_PERMUTE; if (*options == '+' || *options == '-') options++; optarg = NULL; if (optreset) nonopt_start = nonopt_end = -1; start: if (optreset || !*place) { /* update scanning pointer */ optreset = 0; if (optind >= nargc) { /* end of argument vector */ place = EMSG; if (nonopt_end != -1) { /* do permutation, if we have to */ permute_args(nonopt_start, nonopt_end, optind, nargv); optind -= nonopt_end - nonopt_start; } else if (nonopt_start != -1) { /* * If we skipped non-options, set optind * to the first of them. */ optind = nonopt_start; } nonopt_start = nonopt_end = -1; return (-1); } if (*(place = nargv[optind]) != '-' || (place[1] == '\0' && strchr(options, '-') == NULL)) { place = EMSG; /* found non-option */ if (flags & FLAG_ALLARGS) { /* * GNU extension: * return non-option as argument to option 1 */ optarg = nargv[optind++]; return (INORDER); } if (!(flags & FLAG_PERMUTE)) { /* * If no permutation wanted, stop parsing * at first non-option. */ return (-1); } /* do permutation */ if (nonopt_start == -1) nonopt_start = optind; else if (nonopt_end != -1) { permute_args(nonopt_start, nonopt_end, optind, nargv); nonopt_start = optind - (nonopt_end - nonopt_start); nonopt_end = -1; } optind++; /* process next argument */ goto start; } if (nonopt_start != -1 && nonopt_end == -1) nonopt_end = optind; /* * If we have "-" do nothing, if "--" we are done. */ if (place[1] != '\0' && *++place == '-' && place[1] == '\0') { optind++; place = EMSG; /* * We found an option (--), so if we skipped * non-options, we have to permute. */ if (nonopt_end != -1) { permute_args(nonopt_start, nonopt_end, optind, nargv); optind -= nonopt_end - nonopt_start; } nonopt_start = nonopt_end = -1; return (-1); } } /* * Check long options if: * 1) we were passed some * 2) the arg is not just "-" * 3) either the arg starts with -- we are getopt_long_only() */ if (long_options != NULL && place != nargv[optind] && (*place == '-' || (flags & FLAG_LONGONLY))) { short_too = 0; if (*place == '-') place++; /* --foo long option */ else if (*place != ':' && strchr(options, *place) != NULL) short_too = 1; /* could be short option too */ optchar = parse_long_options(nargv, options, long_options, idx, short_too, flags); if (optchar != -1) { place = EMSG; return (optchar); } } if ((optchar = (int)*place++) == (int)':' || (oli = strchr(options, optchar)) == NULL) { if (!*place) ++optind; if (PRINT_ERROR) fprintf(stderr, illoptchar, optchar); optopt = optchar; return (BADCH); } if (long_options != NULL && optchar == 'W' && oli[1] == ';') { /* -W long-option */ if (*place) /* no space */ /* NOTHING */; else if (++optind >= nargc) { /* no arg */ place = EMSG; if (PRINT_ERROR) fprintf(stderr, recargchar, optchar); optopt = optchar; return (BADARG); } else /* white space */ place = nargv[optind]; optchar = parse_long_options(nargv, options, long_options, idx, 0, flags); place = EMSG; return (optchar); } if (*++oli != ':') { /* doesn't take argument */ if (!*place) ++optind; } else { /* takes (optional) argument */ optarg = NULL; if (*place) /* no white space */ optarg = place; else if (oli[1] != ':') { /* arg not optional */ if (++optind >= nargc) { /* no arg */ place = EMSG; if (PRINT_ERROR) fprintf(stderr, recargchar, optchar); optopt = optchar; return (BADARG); } else optarg = nargv[optind]; } place = EMSG; ++optind; } /* dump back option letter */ return (optchar); } /* * getopt -- * Parse argc/argv argument vector. */ int getopt(int nargc, char * const *nargv, const char *options) { /* * We don't pass FLAG_PERMUTE to getopt_internal() since * the BSD getopt(3) (unlike GNU) has never done this. * * Furthermore, since many privileged programs call getopt() * before dropping privileges it makes sense to keep things * as simple (and bug-free) as possible. */ return (getopt_internal(nargc, nargv, options, NULL, NULL, 0)); } /* * getopt_long -- * Parse argc/argv argument vector. */ int getopt_long(int nargc, char * const *nargv, const char *options, const struct option *long_options, int *idx) { return (getopt_internal(nargc, nargv, options, long_options, idx, FLAG_PERMUTE)); } /* * getopt_long_only -- * Parse argc/argv argument vector. */ int getopt_long_only(int nargc, char * const *nargv, const char *options, const struct option *long_options, int *idx) { return (getopt_internal(nargc, nargv, options, long_options, idx, FLAG_PERMUTE|FLAG_LONGONLY)); } mikmod-3.2.9/src/mutilities.c0000644000000000000000000004267614320756746014663 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mutilities.c,v 1.1.1.1 2004/01/16 02:07:34 raph Exp $ Some utility functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) #include #endif #include #include #if defined(_WIN32) #include #elif defined(__OS2__) || defined(__EMX__) #define INCL_DOS #include #include #elif defined(HAVE_SYS_TIME_H) #include #endif #include "player.h" #include "mlist.h" #include "marchive.h" #include "mutilities.h" #ifdef _mikmod_amiga #include #include #endif #if defined(__DJGPP__) static const char *get_homedir (void) { return "C:"; /* good enough for msdos */ } #elif defined(_mikmod_amiga) static const char *get_homedir (void) { static char homdir[PATH_MAX]; static char *home = NULL; if (!home) { BPTR lock = GetProgramDir(); if (!lock || !NameFromLock(lock, homdir, PATH_MAX)) strcpy(homdir, "SYS:"); if (!homdir[0]) /* possible?? */ strcpy(homdir, "SYS:"); else { home = homdir + strlen(homdir); if (!IS_PATH_SEP(home[-1])) { home[0] = PATH_SEP; home[1] = 0; } } home = homdir; } return home; } #elif defined(__OS2__)||defined(__EMX__) static const char *get_homedir (void) { const char *home = getenv("HOME"); if (!home || !*home) return "C:"; return home; } #elif defined(_WIN32) static const char *get_homedir (void) { const char *home; # ifndef _WIN64 static int is_w9x = -1; if (is_w9x < 0) { OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(v); if (!GetVersionEx(&v) || v.dwMajorVersion < 4 || v.dwPlatformId < VER_PLATFORM_WIN32_NT) { is_w9x = 1; } else is_w9x = 0; } if (is_w9x) return "C:"; # endif home = getenv("USERPROFILE"); if (!home || !*home) return "C:"; return home; } #else /* unix */ static const char *get_homedir (void) { static const char *home = NULL; static char d[PATH_MAX]; if (!home) { struct passwd *pw = getpwuid(getuid()); memset(d, 0, sizeof(d)); if (pw && pw->pw_dir) { strncpy(d, pw->pw_dir, sizeof(d)); d[sizeof(d) - 1] = 0; home = d; } else if ((home = getenv("HOME")) != NULL) { strncpy(d, home, sizeof(d)); d[sizeof(d) - 1] = 0; home = d; } else { home = ""; /* fubar'ed.. */ } } return home; } #endif /* get_homedir */ #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) void path_conv(char *file) { if (!file) return; for (; *file; file++) { if (*file == PATH_SEP_SYS) *file = PATH_SEP; } } char *path_conv_sys(const char *file) { static char f[PATH_MAX]; char *pos = f; const char *end = file + PATH_MAX-1; if (!file) return NULL; for (; *file && filef && *(pos-1) == PATH_SEP_SYS && *(pos-2) != ':') pos--; *pos = '\0'; return f; } char *path_conv_sys2(const char *file) { static char f[PATH_MAX]; char *pos = f; const char *end = file + PATH_MAX-1; if (!file) return NULL; for (; *file && file= 0) return fd; else if (errno != EEXIST) /* Any other error will apply also to other names we might try, and there are 2^32 or so of them, so give up now. */ return -1; } /* We got out of the loop because we ran out of combinations to try. */ return -1; #endif } /* tmpl: file name template ending in 'XXXXXX' without path or NULL name_used: if !=NULL pointer to name of temp file, must be freed return: file descriptor or -1 */ int get_tmp_file (const char *tmpl, char **name_used) { static const char *tmpdir = NULL; static const char *tmpsep = ""; char *fulltmpl; int retval; if (!tmpdir) { #if defined(_mikmod_amiga) tmpdir = "T:"; #else /* ! amiga: */ tmpdir = getenv ("TMPDIR"); if (!tmpdir) tmpdir = getenv ("TMP"); if (!tmpdir) tmpdir = getenv ("TEMP"); #ifdef P_tmpdir if (!tmpdir) tmpdir = P_tmpdir; #endif #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) if (!tmpdir) tmpdir = "C:\\"; #else if (!tmpdir) tmpdir = "/tmp"; #endif if (*tmpdir && tmpdir[strlen(tmpdir) - 1] == PATH_SEP_SYS) tmpsep = ""; else tmpsep = PATH_SEP_SYS_STR; #endif /* !amiga */ } if (tmpl == NULL) tmpl = "mmXXXXXX"; fulltmpl = (char *) malloc (strlen(tmpdir)+strlen(tmpsep)+strlen(tmpl)+1); sprintf (fulltmpl, "%s%s%s", tmpdir, tmpsep, tmpl); retval = m_mkstemp (fulltmpl); if (retval == -1) { free (fulltmpl); return -1; } if (name_used) { path_conv (fulltmpl); *name_used = fulltmpl; } else free (fulltmpl); return retval; } #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) /* allocate and return a name for a temporary file (under UNIX not used because of tempnam race condition) */ char *get_tmp_name(void) { CHAR *tmp_file; #if defined(__OS2__) && defined(__WATCOMC__) tmp_file = str_sprintf2("%s" PATH_SEP_STR "%s", getenv("TEMP"), "!MikMod.tmp"); #elif defined(_WIN32) if (!(tmp_file = _tempnam(NULL, ".mod"))) if (!(tmp_file = _tempnam(get_homedir(), ".mod"))) return NULL; #elif defined(_mikmod_amiga) char s[16]; sprintf(s,"%d", rand()); tmp_file = str_sprintf("T:%s.mik", s); #else if (!(tmp_file = tempnam(NULL, ".mod"))) if (!(tmp_file = tempnam(get_homedir(), ".mod"))) return NULL; #endif path_conv(tmp_file); return tmp_file; } #endif /* allocate and return a filename including the path for a config file 'name': filename without the path */ char *get_cfg_name(const char *name) { #if defined(_mikmod_amiga) char *p = str_sprintf2("%s%s", get_homedir(), name); #else char *p = str_sprintf2("%s" PATH_SEP_STR "%s", get_homedir(), name); #endif path_conv (p); return p; } #ifndef HAVE_SNPRINTF /* Not a viable snprintf implementation, but makes code more clear */ int mik_snprintf(char *buffer, size_t n, const char *format, ...) { va_list args; int len; va_start(args, format); len = VSNPRINTF(buffer, n, format, args); va_end(args); if (len < 0) len = (int)n; if ((size_t)len >= n) buffer[n-1] = '\0'; return len; } #endif unsigned long Time1000(void) { #ifdef _WIN32 static __int64 Freq = 0; static __int64 LastCount = 0; static __int64 LastRest = 0; static long LastTime = 0; __int64 Count, Delta; /* Freq was set to -1, if the current hardware does not support high resolution timers. We will use GetTickCount instead then. */ if (Freq < 0) return GetTickCount(); /* Freq is 0 the first time this function is being called. */ if (!Freq) /* try to determine the frequency of the high resulution timer */ if (!QueryPerformanceFrequency((LARGE_INTEGER *) & Freq)) { /* There is no such timer... */ Freq = -1; return GetTickCount(); } /* retrieve current count */ Count = 0; QueryPerformanceCounter((LARGE_INTEGER *) & Count); /* calculate the time passed since last call, and add the rest of those tics that didn't make it into the last reported time. */ Delta = 1000 * (Count - LastCount) + LastRest; LastTime += (long)(Delta / Freq); /* save the new value */ LastRest = Delta % Freq; /* save those ticks not being counted */ LastCount = Count; /* save last count */ return LastTime; #elif defined(__OS2__) || defined(__EMX__) static int first = 1; static ULONG Freq; static long long LastCount = 0; static long long LastRest = 0; static long LastTime = 0; long long Delta, Count; if (first) { first = 0; DosTmrQueryFreq(&Freq); } DosTmrQueryTime((QWORD *) & Count); Delta = 1000 * (Count - LastCount) + LastRest; LastTime += (long)(Delta / Freq); LastRest = Delta % Freq; LastCount = Count; return LastTime; #else struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec * 1000 + tv.tv_usec / 1000; #endif } #if defined(_WIN32)&&!defined(__MINGW32__)&&!defined(__WATCOMC__) DIR* opendir (const char* dirName) { struct stat statbuf; DIR* dir; if (stat(dirName,&statbuf) || !S_ISDIR(statbuf.st_mode)) return NULL; dir = (DIR*)malloc(sizeof(DIR)); strcpy (dir->name, dirName); if (dir->name[strlen(dir->name)-1] != PATH_SEP_SYS && dir->name[strlen(dir->name)-1] != PATH_SEP) strcat (dir->name,PATH_SEP_SYS_STR); strcat (dir->name, "*"); dir->handle = INVALID_HANDLE_VALUE; dir->filecnt = 0; return dir; } struct dirent *readdir (DIR* dir) { WIN32_FIND_DATA fileBuffer; if (dir->filecnt == 0) { dir->handle = FindFirstFile (dir->name, &fileBuffer); if (dir->handle == INVALID_HANDLE_VALUE) return NULL; } else if (!FindNextFile (dir->handle, &fileBuffer)) return NULL; strcpy (dir->d_name, fileBuffer.cFileName); dir->filecnt++; return dir; } int closedir (DIR* dir) { if (!FindClose(dir->handle)) { free (dir); return -1; } free (dir); return 0; } #endif /* dirent _WIN32 */ #if LIBMIKMOD_VERSION < 0x030200 static char *skip_number(char *str) { while (str && *str == ' ') str++; while (str && isdigit((int)*str)) str++; while (str && *str == ' ') str++; return str; } #endif /* Return newly malloced version and cmdline for the driver with the number drvno. */ BOOL driver_get_info (int drvno, char **version, char **cmdline) { #if LIBMIKMOD_VERSION >= 0x030200 struct MDRIVER *driver = MikMod_DriverByOrdinal (drvno); if (version) *version = NULL; if (cmdline) *cmdline = NULL; if (drvno<=0 || !driver) return 0; if (driver->Version && version) *version = strdup (driver->Version); if (driver->CmdLineHelp && cmdline) *cmdline = strdup (driver->CmdLineHelp); return 1; #else static char *drv_cmdlineNul[] = { NULL, NULL}; static char *drv_cmdline317[] = { "AudioFile", "machine:t::Audio server machine (hostname:port)\n", "AIX Audio", "buffer:r:12,19,15:Audio buffer log2 size\n", "Advanced Linux Sound", "card:r:0,31,0:Soundcard number\n" "pcm:r:0,3,0:PCM device number\n" "buffer:r:2,16,4:Number of buffer fragments\n", "OS/2 DART", NULL, "DirectSound", "buffer:r:12,19,16:Audio buffer log2 size\n", "Enlightened sound daemon","machine:t::Audio server machine (hostname:port)\n", "HP-UX Audio", "buffer:r:12,19,15:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n", "Macintosh Sound Manager", NULL, "Nosound", NULL, "OS/2 MMPM/2 MCI", "buffer:r:12,19,16:Audio buffer log2 size\n", "Open Sound System","buffer:r:7,17,14:Audio buffer log2 size\n" "count:r:2,255,16:Audio buffer count\n", "Piped Output", "pipe:t::Pipe command\n", "Raw disk writer", "file:t:music.raw:Output file name\n", "Linux sam9407", "card:r:0,999,0:Device number (/dev/sam%d_mod)", "SGI Audio System", "fragsize:r:0,99999,20000:Sound buffer fragment size\n" "bufsize:r:0,199999,40000:Sound buffer total size\n", "Standard output", NULL, "OpenBSD audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n", "NetBSD audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n", "SunOS audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n", "Sun audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n", "Solaris audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n", "Linux Ultrasound", NULL, "Wav disk writer", "file:t:music.wav:Output file name\n", "Windows waveform-audio", NULL, NULL, NULL}; static char *drv_cmdline318[] = { "OS/2 DART", "device:r:0,8,0:Waveaudio device index to use (0 - default)\n" "buffer:r:12,16:Audio buffer log2 size\n" "count:r:2,8,2:Number of audio buffers\n", "OS/2 MMPM/2 MCI", "device:r:0,8,0:Waveaudio device index to use (0 - default)\n" "buffer:r:12,16:Audio buffer log2 size\n", "OpenBSD audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n" "speaker:b:0:Use speaker\n", "NetBSD audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n" "speaker:b:0:Use speaker\n", "SunOS audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n" "speaker:b:0:Use speaker\n", "Sun audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n" "speaker:b:0:Use speaker\n", "Solaris audio", "buffer:r:7,17,12:Audio buffer log2 size\n" "headphone:b:0:Use headphone\n" "speaker:b:0:Use speaker\n", NULL, NULL}; static char *drv_cmdline319[] = { "DirectSound", "buffer:r:12,19,16:Audio buffer log2 size\n" "globalfocus:b:0:Play if window does not have the focus\n", "Open Sound System","buffer:r:7,17,14:Audio buffer log2 size\n" "count:r:2,255,16:Audio buffer count\n" "card:r:0,99,0:Device number (/dev/dsp%d)\n", NULL, NULL}; static char *drv_cmdline3113[] = { /* 3.1.13 retires alsa-0.4/0.5 driver, adds alsa-1.0.x driver * and removes options */ "Advanced Linux Sound", NULL, NULL, NULL}; #define VERSION_MAX 7 static char **drv_cmdline[VERSION_MAX] = { drv_cmdline317, drv_cmdline318, drv_cmdline319, drv_cmdlineNul, drv_cmdlineNul, drv_cmdlineNul, drv_cmdline3113}; char *driver = MikMod_InfoDriver(), *pos, *start; char **cmd; if (version) *version = NULL; if (cmdline) *cmdline = NULL; for (pos = skip_number(driver); pos && *pos; pos++) { if (*pos == '\n') { drvno--; pos = skip_number(pos + 1); } if (drvno == 1) { int mm_version = (MikMod_GetVersion() & 255) - 7; mm_version = mm_version < 0 ? 0 : (mm_version >= VERSION_MAX ? VERSION_MAX-1 : mm_version); for (; mm_version>=0; mm_version--) { for (cmd = drv_cmdline[mm_version]; *cmd; cmd+=2) { if (!strncmp (*cmd, pos, strlen(*cmd))) { if (version) { start = pos; while (*pos && *pos != '\n') pos++; *version = (char *) malloc (pos-start+1); strncpy (*version, start, pos-start); (*version)[pos-start] = '\0'; } #if LIBMIKMOD_VERSION >= 0x030107 cmd++; if (*cmd && cmdline) *cmdline = strdup (*cmd); #else if (cmdline) *cmdline = strdup ("???\n"); #endif free (driver); return 1; } } } /* unknown driver */ if (cmdline) *cmdline = strdup ("???\n"); break; } } free (driver); return 0; #endif } /* ex:set ts=4: */ mikmod-3.2.9/src/mplayer.c0000644000000000000000000000777413040414034014117 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mplayer.c,v 1.1.1.1 2004/01/16 02:07:36 raph Exp $ Threaded player functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #if defined(__OS2__)||defined(__EMX__) #define INCL_DOS #include #endif #ifdef HAVE_UNISTD_H #include #endif #include "mplayer.h" #include "mthreads.h" #include "mconfig.h" #include "mutilities.h" extern MODULE *mf; #if LIBMIKMOD_VERSION >= 0x030200 static MP_DATA playdata; #endif static BOOL active = 0, paused = 1, use_threads = 0; static int volume = -1; #ifdef USE_THREADS static DEFINE_MUTEX(data); #endif static DEFINE_THREAD(updater,updater_mode); static void do_update(void) { #if LIBMIKMOD_VERSION >= 0x030200 int i; unsigned long cur_time; #endif BOOL locked = 0; MikMod_Update(); if (updater_mode == MTH_RUNNING) { MUTEX_LOCK(data); locked = 1; } if (volume>=0) { Player_SetVolume (volume); volume = -1; } paused = Player_Paused(); active = Player_Active(); #if LIBMIKMOD_VERSION >= 0x030200 if (mf) { if (!config.fakevolbars) { cur_time = Time1000(); for (i = 0; i < mf->numchn; i++) { playdata.vstatus[i].time = cur_time; playdata.vstatus[i].volamp = (Voice_RealVolume(Player_GetChannelVoice(i)) * playdata.vinfo[i].volume) >> 16; } } /* Query current voice status */ Player_QueryVoices(mf->numchn, playdata.vinfo); } #endif if (locked) MUTEX_UNLOCK(data); } #ifdef USE_THREADS #ifdef HAVE_PTHREAD static void* MP_updater(void *dummy) #else static void MP_updater(void *dummy) #endif { while (active && (updater_mode == MTH_RUNNING)) { do_update(); SLEEP(5); } updater_mode = MTH_NORUN; active = 0; paused = 1; #ifdef HAVE_PTHREAD return NULL; #else return; #endif } #endif /* Initialise the threads. Returns if threads are used. */ BOOL MP_Init (void) { #ifdef USE_THREADS static int firstcall = 1; if (firstcall) { firstcall = 0; use_threads = 1; if (!MikMod_InitThreads() || !INIT_MUTEX(data)) use_threads = 0; } #endif return use_threads; } /* Inits a new thread for a new song to be played */ void MP_Start (void) { MP_Init(); do_update(); #ifdef USE_THREADS if (use_threads) { updater_mode = MTH_RUNNING; use_threads = THREAD_START(updater, MP_updater, NULL); } #endif } /* MikMod_Update(), if threads are not used */ void MP_Update (void) { if (!use_threads) { do_update(); } } /* Removes the thread started by MP_Start() */ void MP_End (void) { if (updater_mode == MTH_RUNNING) THREAD_JOIN(updater,updater_mode); active = 0; paused = 1; } /* Wrapper for Player_Active() */ BOOL MP_Active (void) { return (active != 0); } /* Wrapper for Player_TogglePause() */ void MP_TogglePause (void) { Player_TogglePause(); paused = Player_Paused(); } /* Wrapper for Player_Paused() */ BOOL MP_Paused (void) { return (paused != 0); } /* Wrapper for Player_SetVolume() */ void MP_Volume (int vol) { MUTEX_LOCK(data); volume = vol; MUTEX_UNLOCK(data); } #if LIBMIKMOD_VERSION >= 0x030200 /* Returns a copy of the actual playdata */ void MP_GetData (MP_DATA *data) { MUTEX_LOCK(data); *data = playdata; MUTEX_UNLOCK(data); } #endif mikmod-3.2.9/src/mthreads.h0000644000000000000000000001036114607733562014270 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mthreads.h,v 1.1.1.1 2004/01/16 02:07:43 raph Exp $ More or less portable thread functions ==============================================================================*/ #ifndef MTHREADS_H #define MTHREADS_H #ifdef HAVE_USLEEP #ifndef HAVE_USLEEP_PROTO void usleep(unsigned long); #endif #else int usleep_new(unsigned long); #endif #if defined(__OS2__)||defined(__EMX__) #define SLEEP(n) DosSleep(n) #elif defined(_WIN32) #define SLEEP(n) Sleep(n*10) #elif !defined(HAVE_USLEEP) #define SLEEP(n) usleep_new(n*1000) #else #define SLEEP(n) usleep(n*1000) #endif typedef enum { MTH_NORUN, /* thread does not run */ MTH_RUNNING, /* thread runs */ MTH_QUITTING /* thread is scheduled for quitting */ } MTH_MODE; #define USE_THREADS #ifdef HAVE_PTHREAD #if defined(__OpenBSD__) && !defined(_POSIX_THREADS) #define _POSIX_THREADS #endif #include #define DECLARE_MUTEX(name) \ extern pthread_mutex_t _mm_mutex_##name #define DEFINE_MUTEX(name) \ pthread_mutex_t _mm_mutex_##name = PTHREAD_MUTEX_INITIALIZER #define INIT_MUTEX(name) \ (1) #define MUTEX_LOCK(name) \ pthread_mutex_lock(&_mm_mutex_##name) #define MUTEX_UNLOCK(name) \ pthread_mutex_unlock(&_mm_mutex_##name) #define DEFINE_THREAD(name,modevar) \ MTH_MODE modevar = MTH_NORUN; \ pthread_t _mm_thread_##name #define THREAD_START(name,fkt,arg) \ (pthread_create(&_mm_thread_##name, NULL, &fkt, arg)==0) #define THREAD_JOIN(name,modevar) \ { modevar = MTH_QUITTING; \ pthread_join (_mm_thread_##name, NULL); \ } #elif defined(__OS2__)||defined(__EMX__) #include #define DECLARE_MUTEX(name) \ extern HMTX _mm_mutex_##name #define DEFINE_MUTEX(name) \ HMTX _mm_mutex_##name = NULLHANDLE #define INIT_MUTEX(name) \ (!DosCreateMutexSem((PSZ) NULL, &_mm_mutex_##name, 0, 0)) #define MUTEX_LOCK(name) \ if (_mm_mutex_##name) \ DosRequestMutexSem(_mm_mutex_##name, SEM_INDEFINITE_WAIT) #define MUTEX_UNLOCK(name) \ if (_mm_mutex_##name) \ DosReleaseMutexSem(_mm_mutex_##name) #define DEFINE_THREAD(name,modevar) \ int modevar = MTH_NORUN #define THREAD_STKSIZE 8192 /* was 4096, wasn't enough with my old emx environment */ #define THREAD_START(name,fkt,arg) \ (_beginthread(fkt, NULL, THREAD_STKSIZE, arg) != -1) #define THREAD_JOIN(name,modevar) \ { modevar = MTH_QUITTING; \ while (modevar==MTH_QUITTING) SLEEP(1); \ } #elif defined(_WIN32) #include #include #define DECLARE_MUTEX(name) \ extern HANDLE _mm_mutex_##name #define DEFINE_MUTEX(name) \ HANDLE _mm_mutex_##name #define INIT_MUTEX(name) \ (_mm_mutex_##name = CreateMutex(NULL, FALSE, "mm_mutex("#name")")) #define MUTEX_LOCK(name) \ if (_mm_mutex_##name) WaitForSingleObject(_mm_mutex_##name, INFINITE) #define MUTEX_UNLOCK(name) \ if (_mm_mutex_##name) ReleaseMutex(_mm_mutex_##name) #define DEFINE_THREAD(name,modevar) \ int modevar = MTH_NORUN #define THREAD_STKSIZE 8192 /* was 4096 */ #define THREAD_START(name,fkt,arg) \ (_beginthread(fkt, THREAD_STKSIZE, arg) != -1) #define THREAD_JOIN(name,modevar) \ { modevar = MTH_QUITTING; \ while (modevar==MTH_QUITTING) SLEEP(1); \ } #else #undef USE_THREADS #define DECLARE_MUTEX(name) #define DEFINE_MUTEX(name) #define INIT_MUTEX(name) (0) #define MUTEX_LOCK(name) #define MUTEX_UNLOCK(name) #define DEFINE_THREAD(name,modevar) \ int modevar = MTH_NORUN #define THREAD_START(name,fkt,arg) (0) #define THREAD_JOIN(name,modevar) #endif #endif /* MTHREADS_H */ mikmod-3.2.9/src/marchive.c0000644000000000000000000004754714362342042014255 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: marchive.c,v 1.2 2004/02/01 16:31:16 raph Exp $ Archive support These routines are used to detect different archive/compression formats and decompress/de-archive the mods from them if necessary. ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #ifndef HAVE_FNMATCH_H #include "mfnmatch.h" #else #include #endif #include #include #include #include #include #include #if !defined(S_IREAD) && defined(S_IRUSR) #define S_IREAD S_IRUSR #endif #if !defined(S_IWRITE) && defined(S_IWUSR) #define S_IWRITE S_IWUSR #endif #ifdef HAVE_FCNTL_H #include #endif #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) #include #include #ifdef HAVE_SYS_WAIT_H #include #endif #ifndef WIFEXITED #define WIFEXITED(x) (((x) & 255) == 0) #endif #endif #ifndef O_BINARY #define O_BINARY 0 #endif #include #include "mlist.h" #include "marchive.h" #include "mconfig.h" #include "mutilities.h" #include "display.h" /* module filenames patterns */ static const CHAR *modulepatterns[] = { "*.669", "*.[Aa][Mm][Ff]", "*.[Aa][Pp][Uu][Nn]", "*.[Dd][Ss][Mm]", "*.[Ff][Aa][Rr]", "*.[Gg][Dd][Mm]", "*.[Ii][Mm][Ff]", "*.[Ii][Tt]", "*.[Mm][Ee][Dd]", "*.[Mm][Oo][Dd]", "*.[Mm][Tt][Mm]", "*.[Nn][Ss][Tt]", /* noisetracker */ "*.[Ss]3[Mm]", "*.[Ss][Tt][Mm]", "*.[Ss][Tt][Xx]", "*.[Uu][Ll][Tt]", #if LIBMIKMOD_VERSION >= 0x030303 "*.[Uu][Mm][Xx]", /* unreal umx container */ #endif "*.[Uu][Nn][Ii]", "*.[Xx][Mm]", NULL }; static const CHAR *prefixmodulepatterns[] = { "[Mm][Ee][Dd].*", "[Mm][Oo][Dd].*", "[Nn][Ss][Tt].*", "[Xx][Mm].*", /* found on Aminet */ NULL }; #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32)&&!defined(_mikmod_amiga) /* Drop all root privileges we might have. */ BOOL DropPrivileges(void) { if (!geteuid()) { if (getuid()) { /* we are setuid root -> drop setuid to become the real user */ if (setuid(getuid())) return 1; } else { /* we are run as root -> drop all and become user 'nobody' */ struct passwd *nobody; int uid; if (!(nobody = getpwnam("nobody"))) return 1; /* no such user ? */ uid = nobody->pw_uid; if (!uid) /* user 'nobody' has root privileges ? weird... */ return 1; if (setuid(uid)) return 1; } } return 0; } #endif /* Determines if a filename matches a module filename pattern */ static BOOL MA_isModuleFilename(const CHAR *filename) { int t = 0; while (modulepatterns[t]) if (!fnmatch(modulepatterns[t++], filename, FNM_NOESCAPE)) return 1; return 0; } /* The same, but also checks for prefix names */ static BOOL MA_isModuleFilename2(const CHAR *filename) { int t = 0; if (MA_isModuleFilename(filename)) return 1; else while (prefixmodulepatterns[t]) if (!fnmatch(prefixmodulepatterns[t++], filename, FNM_NOESCAPE)) return 1; return 0; } /* Determines if a filename extension matches an archive filename extension pattern */ static BOOL MA_MatchExtension(const CHAR *archive, const CHAR *ends) { const CHAR *pos = ends; int nr, arch_nr; do { while (*pos && *pos != ' ') pos++; nr = pos - ends; arch_nr = strlen(archive); while (nr > 0 && arch_nr > 0 && toupper((int)archive[arch_nr - 1]) == *(ends + nr - 1)) nr--, arch_nr--; if (nr <= 0) return 1; pos++; ends = pos; } while (*(pos - 1)); return 0; } /* Tests if 'filename' has the signature 'header-string' at offset 'header_location' */ static int MA_identify(const CHAR *filename, int header_location, const CHAR *header_string) { int len = MIN(strlen(header_string), 255); if (!len) return 0; if (header_location < 0) { /* check extension of file rather than signature */ return MA_MatchExtension(filename, header_string); } else { /* check in-file signature */ FILE *fp; CHAR id[255+1]; if (!(fp = fopen(path_conv_sys(filename), "rb"))) return 0; fseek(fp, header_location, SEEK_SET); if (!fread(id, len, 1, fp)) { fclose(fp); return 0; } if (!memcmp(id, header_string, len)) { fclose(fp); return 1; } fclose(fp); } return 0; } #if defined(__DJGPP__) #include #include static BOOL filename2short (const char *l, char *s, int len_s) { __dpmi_regs r; r.x.ax = 0x7160; r.h.cl = 1; /* 2 for short -> long conversion */ r.h.ch = 0x80; dosmemput (l, strlen(l)+1, _go32_info_block.linear_address_of_transfer_buffer); r.x.si = _go32_info_block.linear_address_of_transfer_buffer & 0x0f; r.x.ds = _go32_info_block.linear_address_of_transfer_buffer >> 4; r.x.di = (_go32_info_block.linear_address_of_transfer_buffer+512) & 0x0f; r.x.es = (_go32_info_block.linear_address_of_transfer_buffer+512) >> 4; __dpmi_int (0x21, &r); if (r.x.flags & 1) { /* is carry flag set (-> error) ? */ strncpy (s, l, len_s - 1); s[len_s - 1] = '\0'; return 0; } else { dosmemget (_go32_info_block.linear_address_of_transfer_buffer+512, len_s, s); s[len_s - 1] = '\0'; return 1; } } #elif defined(_WIN32) static BOOL filename2short (const char *l, char *s, int len_s) { int copied = GetShortPathName (l, s, len_s); if (copied == 0 || copied >= len_s) { strncpy (s, l, len_s - 1); s[len_s - 1] = '\0'; return 0; } else return 1; } #else static BOOL filename2short (const char *l, char *s, int len_s) { strncpy (s, l, len_s - 1); s[len_s - 1] = '\0'; return 1; } #endif /* Copy pattern, replace in the copy %A with arc, %a with a short version of arc, %f with file, and %d with dest, and return the copy. */ static char* get_command (const char *pattern, const char *arc, const char *file, const char *dest) { int i = 0, len = 0; const char *arg[3]; char *pos, *pat, *command; char buf[PATH_MAX]; pat = strdup (pattern); len = strlen(pattern) + 1; for (pos=pat; i<3 && *pos; pos++) { if (*pos == '%' && (*(pos+1) == 'A' || *(pos+1) == 'a' || *(pos+1) == 'f' || *(pos+1) == 'd')) { switch (*(pos+1)) { case 'A': arg[i] = arc; break; case 'a': filename2short (arc, buf, PATH_MAX); arg[i] = buf; break; case 'f': arg[i] = file; break; case 'd': arg[i] = dest; break; } *(pos+1) = 's'; len += strlen(arg[i]); i++; } } command = (char *) malloc (len*sizeof(char)); SNPRINTF (command,len,pat,arg[0],arg[1],arg[2]); free (pat); return command; } #if !(defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga)) /* Split command in single arguments by inserting '\0' in command and store them in argv. Size of argv: sizeargv */ static void split_command (char *command, char **argv, int sizeargv) { char *pos = command; int i = 0; while (1) { if (!*pos || i >= sizeargv-1) { argv[i] = NULL; return; } if (isspace((int)*pos)) { *pos = '\0'; pos++; while (isspace((int)*pos)) pos++; } if (*pos == '"') { *pos++ = '\0'; argv[i++] = pos; while (*pos != '"' && *pos) pos++; if (*pos) *pos++ = '\0'; } else { argv[i++] = pos; while (!isspace((int)*pos) && *pos) pos++; } } } #endif /* Create a copy of file 'fd' with the first 'start' lines and the last 'end' lines removed. Ignore all lines up to the first occurence of startpat. Unlink the copy and return a file descriptor to the copy. If the file could not be unlinked (e.g. under Windows an open file can not be unlinked), return its name in 'file'.*/ static int MA_truncate (int fd, const char *startpat, int start, int end, char **file) { #define BUFSIZE 5000 char buf[BUFSIZE]; const char *pos; int dest, cnt = -1; long size; char *fdest; if (file) *file = NULL; size = (long) lseek (fd, 0, SEEK_END); if (size < 0) return -1; dest = get_tmp_file(NULL, &fdest); if (dest < 0) return -1; if (unlink (path_conv_sys(fdest)) == 0) { free (fdest); fdest = NULL; } if (end>0 && !lseek(fd, size>BUFSIZE ? -BUFSIZE:-size, SEEK_END) && (cnt=read(fd, buf, sizeof(char)*BUFSIZE)) > 0) { pos = buf+cnt-1; while (end>0 && pos>=buf) { if (*pos == '\n') end--; pos--; size--; } if (pos>=buf && *pos == '\r') size--; } lseek (fd, 0, SEEK_SET); if (((startpat && *startpat) || start>0) && (cnt=read(fd, buf, sizeof(char)*(size>BUFSIZE ? BUFSIZE:size))) > 0) { pos = NULL; if (startpat && *startpat) pos = strstr(buf, startpat); if (!pos) pos = buf; while (start>0 && pos-buf < cnt) { if (*pos == '\n') start--; pos++; } if (pos-buf < cnt) write (dest, pos, sizeof(char)*(cnt-(pos-buf))); size -= cnt; } while (size>0) { cnt = read(fd, buf, sizeof(char)*(size>BUFSIZE ? BUFSIZE:size)); write (dest, buf, sizeof(char)*cnt); size -= cnt; } if (file) { if (fdest) *file = fdest; } else if (fdest) free (fdest); lseek (dest, 0, SEEK_SET); return dest; } #ifdef _mikmod_amiga #define start_redirect() do {} while (0) #define stop_redirect() do {} while (0) #endif #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) static int rd_err, rd_outbak=-1, rd_errbak; #ifdef _WIN32 static char *rd_file = NULL; #endif static void start_redirect (void) { fflush(stdin); /* so any buffered chars will be written out */ fflush(stdout); fflush(stderr); #ifdef _WIN32 /* "nul" seems not to work, use a temp file instead */ rd_err = get_tmp_file(NULL, &rd_file); #else rd_err = open("nul", O_WRONLY | O_CREAT, S_IREAD | S_IWRITE); #endif if (rd_err != -1) { rd_outbak=dup(1); rd_errbak=dup(2); dup2(rd_err,1); dup2(rd_err,2); close(rd_err); } } static void stop_redirect (void) { if (rd_outbak != -1) { dup2(rd_outbak,1); dup2(rd_errbak,2); close(rd_outbak); close(rd_errbak); rd_outbak = -1; #ifdef _WIN32 if (rd_file) { unlink (path_conv_sys(rd_file)); free (rd_file); rd_file = NULL; } #endif } } #endif /* Extracts the file 'file' from the archive 'arc'. Return a file descriptor to the extracted file. If the file could not be unlinked (e.g. under Windows an open file can not be unlinked), return its name in 'extracted'. */ int MA_dearchive(const CHAR *arc, const CHAR *file, CHAR **extracted) { CHAR *tmp_file = NULL, tmp_file_sys[PATH_MAX+1], *command; int tmp_fd = -1, t; if (extracted) *extracted = NULL; /* not an archive file... */ if (!arc || !arc[0]) { tmp_fd = open (path_conv_sys(file), O_RDONLY | O_BINARY, 0600); return tmp_fd; } tmp_file_sys[PATH_MAX] = '\0'; for (t = 0; t= 0) { if (unlink(tmp_file_sys) == 0) { free (tmp_file); tmp_file = NULL; } } #else /* extracting, the Unix way */ { pid_t pid; int status; char *argv[20]; tmp_fd = get_tmp_file (NULL, &tmp_file); if (tmp_fd < 0) return -1; strncpy (tmp_file_sys, path_conv_sys(tmp_file), PATH_MAX); unlink (tmp_file_sys); free (tmp_file); tmp_file = NULL; switch (pid = fork()) { case -1: /* fork failed */ close (tmp_fd); return -1; break; case 0: /* fork succeeded, child process code */ /* if we have root privileges, drop them */ if (DropPrivileges()) exit(0); close(0); close(1); close(2); dup2(tmp_fd, 1); signal(SIGINT, SIG_DFL); signal(SIGQUIT, SIG_DFL); command = get_command (config.archiver[t].extract, path_conv_sys(arc), path_conv_sys2(file), NULL); if (command && *command) { split_command (command, argv, 20); execvp (argv[0], argv); free (command); } close(1); exit(0); break; default: /* fork succeeded, main process code */ waitpid(pid, &status, 0); if (!WIFEXITED(status)) { close(tmp_fd); return -1; } break; } } #endif break; } } if (tmp_fd >= 0) { lseek (tmp_fd, 0, SEEK_SET); if ((config.archiver[t].skippat && config.archiver[t].skippat[0]) || config.archiver[t].skipstart>0 || config.archiver[t].skipend>0) { char *f; t = MA_truncate (tmp_fd, config.archiver[t].skippat, config.archiver[t].skipstart, config.archiver[t].skipend, &f); close (tmp_fd); if (tmp_file) { unlink (tmp_file_sys); free (tmp_file); } tmp_file = f; tmp_fd = t; } } if (extracted) { if (tmp_file) *extracted = tmp_file; } else if (tmp_file) free (tmp_file); return tmp_fd; } /* Test if filename looks like a module or an archive playlist==1: also test against a playlist deep==1 : use Player_LoadTitle() for testing against a module, otherwise test based on the filename */ #if LIBMIKMOD_VERSION < 0x030302 BOOL MA_TestName (char *filename, BOOL plist, BOOL deep) #else BOOL MA_TestName (const char *filename, BOOL plist, BOOL deep) #endif { int t; if (plist && PL_isPlaylistFilename(filename)) return 1; if (deep) { char *title; if ((title=Player_LoadTitle(path_conv_sys(filename)))) { #if (LIBMIKMOD_VERSION >= 0x030200) && defined(HAVE_MIKMOD_FREE) MikMod_free (title); #else free (title); #endif return 1; } else if (MikMod_errno != MMERR_NOT_A_MODULE) return 1; } else if (MA_isModuleFilename2(filename)) return 1; /* FIXME: should only be on if deep==1 */ for (t = 0; t= 0) { if (config.archiver[archive].list && *config.archiver[archive].list) { /* multi-file archive, need to invoke list function */ BOOL endspace = config.archiver[archive].nameoffset < 0; int offset = endspace ? 0:config.archiver[archive].nameoffset; char *string = (char *) malloc (PATH_MAX + 2 + offset); char *command; #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) /* Archive display, the non-Unix way */ FILE *file; char *dest = NULL; #ifdef _mikmod_amiga dest = get_tmp_name(); #endif command = get_command (config.archiver[archive].list, path_conv_sys(filename), NULL, dest); start_redirect(); #ifdef _mikmod_amiga system(command); file = fopen(dest, "r"); #elif defined(__WATCOMC__)||defined(_WIN32) file = _popen (command, "r"); #else file = popen (command, "r"); #endif stop_redirect(); free (command); if (!file) goto done; fgets(string, PATH_MAX + offset + 1, file); while (!feof(file)) { string[strlen(string) - 1] = 0; if (endspace) { for (t = 0; string[t]!=' ' && string[t]!='\0'; t++); string[t] = 0; } t = offset; while (isspace((int)*(string+t))) t++; if (MA_isModuleFilename2(string + t)) PL_Add(pl, string + t, filename, 0, 0); fgets(string, PATH_MAX + offset + 1, file); } #ifdef _mikmod_amiga fclose(file); unlink(dest); free(dest); #elif defined(__WATCOMC__)||defined(_WIN32) _pclose(file); #else pclose(file); #endif done: ; #else /* Archive display, the Unix way */ int fd[2]; if (!pipe(fd)) { pid_t pid; int status, cur, finished = 0; char ch; switch (pid = fork()) { case -1: /* fork failed */ break; case 0: /* fork succeeded, child process code */ { char *argv[20]; /* if we have root privileges, drop them */ if (DropPrivileges()) exit(0); close(0); close(1); close(2); dup2 (fd[1], 1); dup2 (fd[1], 2); signal (SIGINT, SIG_DFL); signal (SIGQUIT, SIG_DFL); command = get_command (config.archiver[archive].list, path_conv_sys(filename), NULL, NULL); split_command (command, argv, 20); execvp (argv[0], argv); free (command); close(fd[1]); exit(0); break; } default: /* fork succeeded, main process code */ /* have to wait for the child to ensure the command was successful and the pipe contains useful information */ /* read from the pipe */ close(fd[1]); cur = 0; for (;;) { /* check if child process has finished */ if (!finished && waitpid(pid, &status, WNOHANG)) { finished = 1; /* abnormal exit */ if (!WIFEXITED(status)) { close(fd[0]); break; } } /* check for end of pipe, otherwise read char */ if (!read(fd[0], &ch, 1) && finished) break; if (ch == '\n') ch = 0; string[cur++] = ch; if (cur >= PATH_MAX + offset + 1) cur = PATH_MAX + offset; if (!ch) { cur = 0; if (endspace) { for (t = 0; string[t]!=' ' && string[t]!='\0'; t++); string[t] = 0; } t = offset; while (isspace((int)*(string+t))) t++; if (MA_isModuleFilename2(string + t)) PL_Add(pl, string + t, filename, 0, 0); } } close(fd[0]); break; } } #endif free (string); } else { /* single-file archive, guess the name */ const CHAR *dot, *slash; CHAR *spare; dot = strrchr(filename, '.'); slash = FIND_LAST_DIRSEP(filename); if (!slash) slash = filename; else slash++; if (!dot) for (dot = slash; *dot; dot++); spare = (CHAR *) malloc((1 + dot - slash) * sizeof(CHAR)); if (spare) { strncpy(spare, slash, dot - slash); spare[dot - slash] = 0; if (MA_isModuleFilename2(spare)) PL_Add(pl, spare, filename, 0, 0); free(spare); } } } else PL_Add(pl, filename, NULL, 0, 0); } /* ex:set ts=4: */ mikmod-3.2.9/src/mplayer.h0000644000000000000000000000413110001643550014105 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mplayer.h,v 1.1.1.1 2004/01/16 02:07:36 raph Exp $ Threaded player functions ==============================================================================*/ #ifndef MPLAYER_H #define MPLAYER_H #include #if LIBMIKMOD_VERSION >= 0x030200 #define MAXVOICES 256 #endif #if LIBMIKMOD_VERSION >= 0x030200 typedef struct { VOICEINFO vinfo[MAXVOICES]; /* Current status for all module voices */ struct { unsigned long time; /* Last time this structure was updated */ UBYTE volamp; /* Volume meter amplitude */ } vstatus[MAXVOICES]; /* Dynamic voice status */ } MP_DATA; /* Returns a copy of the actual playdata */ void MP_GetData (MP_DATA *data); #endif /* Initialise the threads. Returns if threads are used. */ BOOL MP_Init (void); /* Inits a new thread for a new song to be played */ void MP_Start (void); /* MikMod_Update(), if threads are not used */ void MP_Update (void); /* Removes the thread started by MP_Start() */ void MP_End (void); /* Wrapper for Player_Active() */ BOOL MP_Active (void); /* Wrapper for Player_TogglePause() */ void MP_TogglePause (void); /* Wrapper for Player_Paused() */ BOOL MP_Paused (void); /* Wrapper for Player_SetVolume() */ void MP_Volume (int vol); #endif /* MPLAYER_H */ mikmod-3.2.9/src/mmenu.h0000644000000000000000000000454710001643552013572 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mmenu.h,v 1.1.1.1 2004/01/16 02:07:38 raph Exp $ Menu functions ==============================================================================*/ #ifndef MMENU_H #define MMENU_H #include "mwindow.h" /* text metacharacters: '&x': highlight 'x' '&&' -> '&' '%%' -> '%' '%-' : separator, if at start of text '%c': toggle menu data: menu active yes|no '%o...|opt0|opt1|...': option menu data: active option '%d...|label|min|max': int input data: current value '%s...|label|maxlength|length of inserted text': string input data: current value '%>': submenu, if at end of text data: struct *MMENU, the sub menu else: normal menu data: unused */ typedef struct { char *text; void *data; char *help; } MENTRY; typedef struct MMENU { int cur; /* selected entry */ int first; /* first line of menu which is displayed */ int count; /* number of menu entries, -1 -> count is determined */ /* by first NULL entry in entries[].text */ BOOL key_left; /* can menu be closed with KEY_LEFT or KEY_ESC? */ MENTRY *entries; void (*handle_select) (struct MMENU *menu); /* called on menu selection */ MWINDOW *win; /* the window for this menu */ void *data; /* not used by menu functions */ int id; /* not used by menu functions */ } MMENU; typedef void (*MenuSelectFunc) (MMENU *menu); void menu_open(MMENU * menu, int x, int y); void menu_close(MMENU * menu); #endif /* MMENU_H */ /* ex:set ts=4: */ mikmod-3.2.9/src/rcfile.c0000644000000000000000000003105012370621772013710 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: rcfile.c,v 1.1.1.1 2004/01/16 02:07:41 raph Exp $ General configuration file management ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "rcfile.h" #include "mutilities.h" #define INDENT_MAX 40 #define LINE_LEN 1024 #define OPTION_BLOCK 10 #define BTST(v, m) ((v) & (m) ? 1 : 0) typedef struct _OPTION OPTION; typedef struct _OPTIONS OPTIONS; typedef struct _STACK STACK; struct _OPTION { char *label; char *arg; OPTIONS *options; }; struct _OPTIONS { int cnt, max; OPTION *option; OPTIONS *parent; }; struct _STACK { STACK *next; char *data; }; static FILE *fp = NULL; static OPTIONS *options = NULL; static char indent[INDENT_MAX+1] = ""; static STACK *structs = NULL; static void indent_change (int delta) { int len = strlen(indent); delta *= 2; if (len+delta>=0 && len+delta<=INDENT_MAX) len += delta; indent[len] = '\0'; if (len>0) { indent[len-1] = ' '; indent[len-2] = ' '; } } static void options_free (OPTIONS *opts) { if (opts && opts->max>0) { while (opts->cnt>0) { opts->cnt--; if (opts->option[opts->cnt].label) free (opts->option[opts->cnt].label); if (opts->option[opts->cnt].arg) free (opts->option[opts->cnt].arg); if (opts->option[opts->cnt].options) { options_free (opts->option[opts->cnt].options); } } free (opts->option); opts->cnt = opts->max = 0; } if (opts) free (opts); } /* Save desc in file fp. Add '# ' in front of all lines. */ static void write_description (const char *desc) { const char *start; if (fp && desc) { fputs ("\n",fp); while (*desc) { start = desc; while (*desc && *desc!='\n') desc++; fprintf (fp, "%s# ", indent); fwrite (start,desc-start,1,fp); fputs ("\n",fp); if (*desc) desc++; } } } /* write argument arg with optional description and mark it with label */ BOOL rc_write_bool (const char *label, int arg, const char *description) { if (fp) { write_description (description); if (arg) return fprintf(fp, "%s%s = yes\n", indent, label) > 0; else return fprintf(fp, "%s%s = no\n", indent, label) > 0; } return 0; } BOOL rc_write_bit (const char *label, int arg, int mask, const char *description) { return rc_write_bool (label,BTST(arg,mask),description); } BOOL rc_write_int (const char *label, int arg, const char *description) { if (fp) { write_description (description); return fprintf(fp, "%s%s = %d\n", indent, label, arg) > 0; } return 0; } BOOL rc_write_float (const char *label, float arg, const char *description) { if (fp) { write_description (description); return fprintf(fp, "%s%s = %f\n", indent, label, arg) > 0; } return 0; } BOOL rc_write_label(const char *label, LABEL_CONV *convert, int arg, const char *description) { if (fp) { int i; write_description (description); for (i = 0; convert[i].id != arg; i++); return fprintf(fp, "%s%s = %s\n", indent, label, convert[i].label) > 0; } return 0; } BOOL rc_write_string (const char *label, const char *arg, const char *description) { if (fp) { write_description (description); if (arg) { if (fprintf(fp,"%s%s = \"", indent,label) <= 0) return 0; while (*arg) { if (*arg<32 || (unsigned char)*arg>127) fprintf (fp, "\\x%02x",*(const unsigned char*)arg); else if (*arg == '"') fputs ("\\\"", fp); else fputc (*arg, fp); arg++; } return fprintf(fp,"\"\n") > 0; } else return fprintf(fp,"%s%s = \"\"\n", indent,label) > 0; } return 0; } BOOL rc_write_struct (const char *label, const char *description) { if (fp) { BOOL ret; STACK *newstack = (STACK *) malloc (sizeof(STACK)); newstack->data = strdup (label); newstack->next = structs; structs = newstack; write_description (description); ret = fprintf(fp,"%sBEGIN \"%s\"\n", indent, label) > 0; indent_change (1); return ret; } return 0; } BOOL rc_write_struct_end (const char *description) { if (fp && structs) { BOOL ret; STACK *next = structs->next; char *label = structs->data; free (structs); structs = next; indent_change (-1); write_description (description); ret = fprintf(fp,"%sEND \"%s\"\n", indent, label) > 0; free (label); return ret; } return 0; } /* search for label in loaded options and return the associated value */ static char *get_argument (const char *label) { int i; for (i=0; icnt; i++) if (options->option[i].label && !strcasecmp (options->option[i].label,label)) { /* mark entry as handled */ free (options->option[i].label); options->option[i].label = NULL; return options->option[i].arg; } return NULL; } /* search for label in loaded options and return the associated value */ static OPTIONS *get_begin (const char *label) { int i; for (i=0; icnt; i++) if (options->option[i].label && !strcasecmp (options->option[i].label,"BEGIN") && !strcasecmp (options->option[i].arg,label)) { /* mark entry as handled */ free (options->option[i].label); options->option[i].label = NULL; return options->option[i].options; } return NULL; } /* Read 'value', which is saved in the config-file under label. Change 'value' only if label is present in config-file and associated value is valid. Return: value changed ? */ BOOL rc_read_bool (const char *label, BOOL *value) { char *arg = get_argument (label); if (arg) { if ((!strcasecmp(arg, "YES")) || (!strcasecmp(arg, "ON")) || (*arg == '1')) { *value = 1; return 1; } else if ((!strcasecmp(arg, "NO")) || (!strcasecmp(arg, "OFF")) || (*arg == '0')) { *value = 0; return 1; } } return 0; } BOOL rc_read_bit (const char *label, int *value, int mask) { const char *arg = get_argument (label); if (arg) { if ((!strcasecmp(arg, "YES")) || (!strcasecmp(arg, "ON")) || (*arg == '1')) { *value |= mask; return 1; } else if ((!strcasecmp(arg, "NO")) || (!strcasecmp(arg, "OFF")) || (*arg == '0')) { *value &= ~mask; return 1; } } return 0; } BOOL rc_read_int (const char *label, int *value, int min, int max) { const char *arg = get_argument (label); if (arg) { char *end; int t = strtol(arg, &end, 10); if ((!*end) && (t >= min) && (t <= max)) { *value = t; return 1; } } return 0; } BOOL rc_read_float (const char *label, float *value, float min, float max) { const char *arg = get_argument (label); if (arg) { float t; if (sscanf (arg,"%f",&t) == 1) if ((t >= min) && (t <= max)) { *value = t; return 1; } } return 0; } BOOL rc_read_label(const char *label, int *value, LABEL_CONV *convert) { const char *arg = get_argument (label); if (arg) { int i = 0; while (convert[i].label) { if (!strcasecmp(convert[i].label, arg)) { *value = convert[i].id; return 1; } i++; } } return 0; } BOOL rc_read_struct (const char *label) { OPTIONS *arg = get_begin (label); if (arg) { options = arg; return 1; } return 0; } BOOL rc_read_struct_end (void) { if (options->parent) { options = options->parent; return 1; } else return 0; } /* Free old *value and allocate min(strlen(newvalue),length)+1 bytes for new string. */ void rc_set_string (char **value, const char *arg, int length) { int len = strlen(arg); if (len > length) len = length; if (*value) free(*value); *value = (char *)malloc((len + 1) * sizeof(char)); strncpy(*value, arg, len); (*value)[len] = '\0'; } /* Read a string. Free old *value and allocate min(strlen(newvalue),length)+1 bytes for new string. */ BOOL rc_read_string (const char *label, char **value, int length) { const char *arg = get_argument (label); if (arg) { rc_set_string (value,arg,length); return 1; } return 0; } static char skip_space (char **line) { while (**line==' ' || **line=='\t') (*line)++; return **line; } static BOOL parse_line (char *line, char **label, char **arg) { char *end; *label = NULL; *arg = NULL; if (skip_space(&line) == '#') return 0; *label = line; while (isalnum((int)*line) || *line == '_') { *line = toupper ((int)*line); line++; } end = line; skip_space(&line); if (*line=='=') { line++; *end = '\0'; skip_space (&line); } else { *end = '\0'; if (strcmp(*label,"BEGIN") && strcmp(*label,"END")) return 0; } if (isgraph((int)*line)) { char *pos, ch1, ch2; BOOL string = (*line == '"'); if (string) line++; *arg = pos = line; while ((!string && *line && *line != '#') || (string && *line && *line!='"')) { if (!string) { *line=toupper((int)*line); } else { if (*line == '\\') { line++; switch (*line) { case 'a': *pos = '\a'; break; case 'b': *pos = '\b'; break; case 'f': *pos = '\f'; break; case 'n': *pos = '\n'; break; case 'r': *pos = '\r'; break; case 't': *pos = '\t'; break; case 'v': *pos = '\v'; break; case '\'': *pos = '\''; break; case '"': *pos = '\"'; break; case '\\': *pos = '\\'; break; case 'x': ch1 = toupper((int)*(line+1)); ch2 = toupper((int)*(line+2)); *pos = (ch1>='A' ? (ch1-'A'+10):(ch1-'0'))*16+ (ch2>='A' ? (ch2-'A'+10):(ch2-'0')); line += 2; break; default: line--; *pos = *line; } } else *pos = *line; } line++; pos++; } if (!string) { do { pos--; } while (*pos == ' ' || *pos == '\t'); pos++; } *pos = '\0'; return 1; } return 0; } static BOOL rc_parse (OPTIONS *opts, const char *sec_name) { char line[LINE_LEN],*label,*arg; BOOL ret = 1; while (ret && fgets(line,LINE_LEN,fp)) { if (line[strlen(line)-1]=='\n') line[strlen(line)-1]='\0'; if (parse_line(line,&label,&arg)) { if (!strcmp("END", label)) { if (strcmp(arg,sec_name)) { fprintf (stderr, "Error in config file: expected 'END %s', found 'END %s'" " Ignoring (remaining) config file...", sec_name, arg); return 0; } return 1; } else { if (opts->cnt >= opts->max) { opts->max += OPTION_BLOCK; opts->option = (OPTION *) realloc (opts->option,sizeof(OPTION)*opts->max); } opts->option[opts->cnt].label = strdup (label); opts->option[opts->cnt].arg = strdup (arg); if (!strcmp("BEGIN", label)) { OPTIONS *new_opts = (OPTIONS *) malloc(sizeof(OPTIONS)); new_opts->cnt = new_opts->max = 0; new_opts->option = NULL; new_opts->parent = opts; opts->option[opts->cnt].options = new_opts; ret = rc_parse (new_opts, opts->option[opts->cnt].arg); } else { opts->option[opts->cnt].options = NULL; } opts->cnt++; } } } if (ferror(fp)) fprintf (stderr, "Error in config file, ignoring (remaining) file..."); return ret && !ferror(fp); } /* open config-file 'name' and parse the file for following rc_read_...() */ BOOL rc_load (const char *name) { BOOL ret = 0; if (!(fp = fopen (path_conv_sys(name),"r"))) return 0; options = (OPTIONS *) malloc(sizeof(OPTIONS)); options->cnt = options->max = 0; options->option = NULL; options->parent = NULL; ret = rc_parse (options,"'NO END'"); fclose (fp); fp = NULL; return ret; } /* open config-file 'name' for following rc_write_...() and write a header for program 'prg_name' */ BOOL rc_save (const char *name, const char *prg_name) { if (!(fp=fopen(path_conv_sys(name),"w"))) return 0; if (fprintf (fp,"#\n" "# %s\n" "# configuration file\n" "#\n",prg_name) <= 0) { fclose (fp); fp = NULL; return 0; } return 1; } /* close config-file opened by rc_load() or rc_save() */ void rc_close (void) { if (fp) { fclose (fp); fp = NULL; } options_free (options); options = NULL; } mikmod-3.2.9/src/mutilities.h0000644000000000000000000001563214607406626014655 0ustar rootroot/* MikMod module player (c) 1998 - 2014 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== Some utility functions ==============================================================================*/ #ifndef MUTILITIES_H #define MUTILITIES_H #ifdef _WIN32 #include #endif #if defined(__OS2__)||defined(__EMX__) #include #endif #if defined(__MORPHOS__) || defined(__AROS__) || defined(AMIGAOS) || \ defined(__amigaos__) || defined(__amigados__) || \ defined(AMIGA) || defined(_AMIGA) || defined(__AMIGA__) #include #define _mikmod_amiga 1 #endif #ifdef HAVE_STDINT_H #include #endif #include /* for BOOL */ #if (LIBMIKMOD_VERSION < 0x030200) || (LIBMIKMOD_VERSION == 0x030200 && !defined(DMODE_NOISEREDUCTION)) #undef HAVE_MIKMOD_FREE /* MikMod_free() not found in <= 3.2.0-beta2. */ #endif /*========== Constants */ #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifndef PATH_MAX #if defined(MAXPATHLEN) /* */ #define PATH_MAX MAXPATHLEN #elif defined(_WIN32) && defined(_MAX_PATH) #define PATH_MAX _MAX_PATH #elif defined(_WIN32) && defined(MAX_PATH) #define PATH_MAX MAX_PATH #elif defined(__OS2__) && defined(CCHMAXPATH) #define PATH_MAX CCHMAXPATH #else #define PATH_MAX 256 #endif #endif /* PATH_MAX */ #include #define PATH_SEP '/' #define PATH_SEP_STR "/" #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) #define PATH_SEP_SYS '\\' #define PATH_SEP_SYS_STR "\\" void path_conv(char *file); char *path_conv_sys(const char *file); char *path_conv_sys2(const char *file); #else #define PATH_SEP_SYS '/' #define PATH_SEP_SYS_STR "/" #define path_conv(file) #define path_conv_sys(file) (file) #define path_conv_sys2(file) (file) #endif #ifdef _mikmod_amiga #define IS_PATH_SEP(c) ((c) == PATH_SEP || (c) == ':') static inline char *FIND_FIRST_DIRSEP(const char *_the_path) { char *p = strchr(_the_path, ':'); if (p != NULL) return p; return strchr(_the_path, PATH_SEP); } static inline char *FIND_LAST_DIRSEP (const char *_the_path) { char *p = strrchr(_the_path, PATH_SEP); if (p != NULL) return p; return strchr(_the_path, ':'); } #else #define IS_PATH_SEP(c) ((c) == PATH_SEP) #define FIND_FIRST_DIRSEP(p) strchr((p), PATH_SEP) #define FIND_LAST_DIRSEP(p) strrchr((p), PATH_SEP) #endif /*========== Types */ /* pointer-sized signed int (intptr_t) : */ #ifdef HAVE_STDINT_H typedef intptr_t SINTPTR_T; #elif defined(_WIN32) typedef INT_PTR SINTPTR_T; #else /* long should be pointer-sized for all others : */ typedef long SINTPTR_T; #endif /*========== Variables */ /* storage buffer length - used everywhere */ #define STORAGELEN 320 extern char storage[STORAGELEN+2]; /*========== Routines and macros */ #undef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define BTST(v, m) ((v) & (m) ? 1 : 0) #ifdef _WIN32 #define strdup _strdup #define stricmp _stricmp #define getcwd _getcwd #define open _open #define fdopen _fdopen #define dup _dup #define dup2 _dup2 #define lseek _lseek #define read _read #define write _write #define close _close #define unlink _unlink #define stat _stat #ifndef S_ISDIR #define S_ISDIR(st_mode) ((st_mode & _S_IFDIR) == _S_IFDIR) #endif #ifndef S_ISCHR #define S_ISCHR(st_mode) ((st_mode & _S_IFCHR) == _S_IFCHR) #endif #ifndef S_ISFIFO #define S_ISFIFO(st_mode) ((st_mode & _S_IFIFO) == _S_IFIFO) #endif #endif #if defined(__EMX__)||defined(_WIN32) #undef S_ISBLK /* MinGW sys/stat.h does define S_ISBLK */ #define S_ISBLK(st_mode) 0 #endif #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) #undef S_ISLNK /* djgpp-v2.04 does define S_ISLNK (and has lstat, too..) */ #define lstat stat #undef S_ISSOCK #define S_ISSOCK(st_mode) 0 #define S_ISLNK(st_mode) 0 #endif #if defined(_WIN32)&&!defined(__MINGW32__)&&!defined(__WATCOMC__) typedef struct dirent { char name[PATH_MAX+1]; unsigned long* handle; int filecnt; char d_name[PATH_MAX+1]; } DIR; DIR* opendir (const char* dirName); struct dirent *readdir (DIR* dir); int closedir (DIR* dir); #endif /* dirent _WIN32 */ /* allocate memory for a formated string and do a sprintf */ char *str_sprintf2(const char *fmt, const char *arg1, const char *arg2); char *str_sprintf(const char *fmt, const char *arg); /* tmpl: file name template ending in 'XXXXXX' without path or NULL name_used: if !=NULL pointer to name of temp file, must be freed return: file descriptor or -1 */ int get_tmp_file (const char *tmpl, char **name_used); /* allocate and return a name for a temporary file (under UNIX not used because of tempnam race condition) */ #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) char *get_tmp_name(void); #endif BOOL file_exist(const char *file); /* determines if a given path is absolute or relative */ BOOL path_relative(const char *path); /* allocate and return a filename including the path for a config file 'name': filename without the path */ char *get_cfg_name(const char *name); /* Return precise time in milliseconds */ unsigned long Time1000(void); #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) #define filecmp strcasecmp #else #define filecmp strcmp #endif #if defined(__OS2__)||defined(__EMX__)||(defined(_WIN32)&&!defined(__MINGW32__)) #define strcasecmp(s,t) stricmp(s,t) #endif #ifdef HAVE_VSNPRINTF # ifdef _WIN32 # define VSNPRINTF _vsnprintf # else # define VSNPRINTF vsnprintf # endif #else #define VSNPRINTF(str,size,format,ap) vsprintf(str,format,ap) #endif #ifndef HAVE_SNPRINTF #define SNPRINTF mik_snprintf int mik_snprintf(char *buffer, size_t n, const char *format, ...); #else # ifdef _WIN32 # define SNPRINTF _snprintf # else # define SNPRINTF snprintf # endif #endif /* Return newly malloced version and cmdline for the driver with the number drvno. */ BOOL driver_get_info (int drvno, char **version, char **cmdline); #endif /* MUTILITIES_H */ /* ex:set ts=4: */ mikmod-3.2.9/src/dosvideo.inc0000644000000000000000000001004312255111204014570 0ustar rootroot/* MikMod module player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: dosvideo.inc,v 1.1.1.1 2004/01/16 02:07:29 raph Exp $ DOS/DJGPP console i/o routines ==============================================================================*/ #include static struct text_info screen_info; static unsigned char *screen_contents; static int cursor_old = 0; struct SCREEN { int act_attr; char *changed; char *attrs; char *text; } screen = {A_NORMAL, NULL, NULL, NULL}; void clear(void) { memset (screen.changed, 1, winx*winy); memset (screen.attrs, screen.act_attr, winx*winy); memset (screen.text, ' ', winx*winy); } int attrset(int attrs) { screen.act_attr = attrs; return 1; } void mvaddnstr(int y,int x,const char *str,int len) { int i, d; if (y<0 || y>=winy) return; if (x<0) { str -= x; len += x; x = 0; } d = y*winx+x; for (i=0; iwidth - x; if (len > 0) { memset(storage, ' ', len); mvaddnstr(win->y + y, win->x + x, storage, len); } } void win_cursor_set(BOOL visible) { _setcursortype(visible ? cursor_old : _NOCURSOR); } void win_refresh(void) { int x, y, d, start, pos; char buffer[STORAGELEN * 2]; for (y=0; y=winx) break; d--; x = start; pos = 0; while (x after Imatch. */ #define FNM_CASEFOLD 0x10 /* Case insensitive search. */ #define FNM_IGNORECASE FNM_CASEFOLD #define FNM_FILE_NAME FNM_PATHNAME #if defined(__cplusplus) extern "C" { #endif int fnmatch(const char *, const char *, int); #if defined(__cplusplus) } #endif #endif /* !_FNMATCH_H_ */ mikmod-3.2.9/src/marchive.h0000644000000000000000000000414012364127454014250 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: marchive.h,v 1.1.1.1 2004/01/16 02:07:32 raph Exp $ Archive support ==============================================================================*/ #ifndef MARCHIVE_H #define MARCHIVE_H #include "mlist.h" #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32)&&!defined(_mikmod_amiga) /* Drop all root privileges we might have. */ BOOL DropPrivileges (void); #endif /* Extracts the file 'file' from the archive 'arc'. Return a file descriptor to the extracted file. If the file could not be unlinked (e.g. under Windows an open file can not be unlinked), return its name in 'extracted'. */ int MA_dearchive (const CHAR *arc, const CHAR *file, CHAR **extracted); /* Test if filename looks like a module or an archive playlist==1: also test against a playlist deep==1 : use Player_LoadTitle() for testing against a module, otherwise test based on the filename */ #if LIBMIKMOD_VERSION < 0x030302 BOOL MA_TestName (char *filename, BOOL playlist, BOOL deep); #else BOOL MA_TestName (const char *filename, BOOL playlist, BOOL deep); #endif /* Examines file 'filename' to add modules to the playlist 'pl'. */ void MA_FindFiles (PLAYLIST * pl, const CHAR *filename); #endif /* ex:set ts=4: */ mikmod-3.2.9/src/mwindow.h0000644000000000000000000001375412361532174014145 0ustar rootroot/* MikMod module player (c) 1998-2014 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mwindow.h,v 1.1.1.1 2004/01/16 02:07:36 raph Exp $ Some window functions ==============================================================================*/ #ifndef MWINDOW_H #define MWINDOW_H #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) # ifdef HAVE_NCURSES_H # include # elif defined HAVE_CURSES_H # include # elif defined HAVE_NCURSES_CURSES_H # include # endif # define MIK_CURSES_ERROR ERR #else # define MIK_CURSES_ERROR (-1) #endif #include #include "mconfig.h" typedef struct MWINDOW { int x, y, width, height; /* Inner pos. and size */ ATTRS attrs; /* Window attributes, used for border */ /* and win_clear() */ BOOL border; /* Has window a border? */ BOOL resize; /* Window is automatically resized */ char *title; BOOL (*repaint) (struct MWINDOW * win); BOOL (*handle_key) (struct MWINDOW * win, int ch); void (*handle_resize) (struct MWINDOW * win, int dx, int dy); struct MWINDOW *next; void *data; /* not used by window functions */ } MWINDOW; /* return: 1: continue repaint with other windows 0: cancel repaint (if a new repaint was scheduled in the repaint func,e.g. by win_change_panel() */ typedef BOOL (*WinRepaintFunc) (MWINDOW *win); /* return: 1: key was handled */ typedef BOOL (*WinKeyFunc) (MWINDOW *win, int ch); /* dx,dy: amount of window size change */ typedef void (*WinResizeFunc) (MWINDOW *win, int dx, int dy); /* called on a timeout, timeout is removed if 0 is returned */ typedef BOOL (*WinTimeoutFunc) (MWINDOW *win, void *data); /* init window functions (e.g. init curses) */ void win_init(BOOL quiet); /* clean up (e.g. exit curses) */ void win_exit(void); /* Does the terminal support colors? */ BOOL win_has_colors(void); /* set the attribute translation table */ void win_set_theme (THEME *new_theme); /* open new window on current panel */ MWINDOW *win_open(int x, int y, int width, int height, BOOL border, const char *title, ATTRS attrs); /* open new window on panel 'panel' */ MWINDOW *win_panel_open(int dst_panel, int x, int y, int width, int height, BOOL border, const char *title, ATTRS attrs); /* set function which should be called on a repaint request */ void win_set_repaint(WinRepaintFunc func); void win_panel_set_repaint(int panel, WinRepaintFunc func); /* set function which sould be called on a key press */ void win_set_handle_key(WinKeyFunc func); void win_panel_set_handle_key(int panel, WinKeyFunc func); /* should window be automatically resized? should a function be called on resize? */ void win_set_resize(BOOL auto_resize, WinResizeFunc func); void win_panel_set_resize(int panel, BOOL auto_resize, WinResizeFunc func); /* set private data */ void win_set_data(void *data); void win_panel_set_data(int panel, void *data); /* close window win */ void win_close(MWINDOW * win); /* repaint the whole panel */ void win_panel_repaint(void); /* repaint the whole panel, clear whole panel before */ void win_panel_repaint_force(void); /* init the status line (height=0,1,2 0: no status line) */ void win_init_status(int height); /* set the status line */ void win_status(const char *msg); /* clear to end of line on window win */ void win_clrtoeol(MWINDOW *win, int x, int y); /* clear window win */ BOOL win_clear(MWINDOW *win); /* get size of window win */ void win_get_size(MWINDOW *win, int *x, int *y); /* get maximal size of a new window without a border and therefore the needed minimal y position */ void win_get_size_max(int *y, int *width, int *height); /* get uppermost window */ MWINDOW *win_get_window(void); /* get root window */ MWINDOW *win_get_window_root(void); /* print string in window win */ void win_print(MWINDOW *win, int x, int y, const char *str); /* draw horizontal/verticall line */ void win_line(MWINDOW *win, int x1, int y1, int x2, int y2); /* draw a box with colored background back: background colors from UL UR LR LL to UL */ void win_box_color(MWINDOW *win, int x1, int y1, int x2, int y2, ATTRS *back); /* draw a box */ void win_box(MWINDOW *win, int x1, int y1, int x2, int y2); /* set attribute for the following output operations, "attrs" is an index into the theme->attr translation table */ void win_attrset(ATTRS attrs); ATTRS win_get_theme_color (ATTRS attrs); /* set color for the following output operations */ void win_set_color(ATTRS attrs); void win_set_forground(ATTRS fg); void win_set_background(ATTRS bg); void win_cursor_set(BOOL visible); /* update window -> call curses.refresh() */ void win_refresh(void); /* change current panel */ void win_change_panel(int new_panel); /* return current panel */ int win_get_panel(void); /* handle key press (panel change and call of key handler of uppermost window), return: was key handled */ BOOL win_handle_key(int ch); /* add a new timeout function called approx. every interval ms */ void win_timeout_add (int interval, WinTimeoutFunc func, void *data); /* Handle scheduled timeouts and up to one key press, return 1 if key presses are pending. */ BOOL win_main_iteration(void); /* main event handling routine, does NOT return */ void win_run(void); #endif /* MWINDOW_H */ mikmod-3.2.9/src/mconfig.c0000644000000000000000000007234413040414034014063 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mconfig.c,v 1.3 2004/01/29 17:36:13 raph Exp $ Configuration file management ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "player.h" #include "mconfig.h" #include "mwindow.h" #include "mlist.h" #include "mutilities.h" #include "rcfile.h" static LABEL_CONV renice_conv[] = { {RENICE_NONE, "RENICE_NONE"}, {RENICE_PRI, "RENICE_PRI"}, {RENICE_REAL, "RENICE_REAL"}, {-1, NULL} }; static LABEL_CONV attrs_mono_conv[] = { {A_NORMAL, "normal"}, {A_BOLD, "bold"}, {A_REVERSE, "reverse"}, {-1, NULL} }; static const char *attrs_colf_label[] = { "black","blue","green","cyan","red","magenta","brown","gray", "b_black","b_blue","b_green","b_cyan","b_red","b_magenta", "yellow","white", NULL }; static const char *attrs_colb_label[] = { "black","blue","green","cyan","red","magenta","brown","gray", NULL }; const char *attrs_label[ATTRS_COUNT] = { "WARNING", "TITLE", "BANNER", "SONG_STATUS", "INFO_INACTIVE", "INFO_ACTIVE", "INFO_IHOTKEY", "INFO_AHOTKEY", "HELP", "PLAYENTRY_INACTIVE", "PLAYENTRY_ACTIVE", "SAMPLES", "SAMPLES_KICK3", "SAMPLES_KICK2", "SAMPLES_KICK1", "SAMPLES_KICK0", "CONFIG", "VOLBAR", "VOLBAR_LOW", "VOLBAR_MED", "VOLBAR_HIGH", "VOLBAR_INSTR", "MENU_FRAME", "MENU_INACTIVE", "MENU_ACTIVE", "MENU_IHOTKEY", "MENU_AHOTKEY", "DLG_FRAME", "DLG_LABEL", "DLG_STR_TEXT", "DLG_STR_CURSOR", "DLG_BUT_INACTIVE", "DLG_BUT_ACTIVE", "DLG_BUT_IHOTKEY", "DLG_BUT_AHOTKEY", "DLG_BUT_ITEXT", "DLG_BUT_ATEXT", "DLG_LIST_FOCUS", "DLG_LIST_NOFOCUS", "STATUS_LINE", "STATUS_TEXT" }; /*========== Color scheme */ static int color_attributes[ATTRS_COUNT] = { COLOR_RED_B | COLOR_WHITE_F, /* ATTR_WARNING */ COLOR_CYAN_B | COLOR_WHITE_F, /* ATTR_TITLE */ COLOR_BLACK_B | COLOR_LGREEN_F, /* ATTR_BANNER */ COLOR_BLUE_B | COLOR_WHITE_F, /* ATTR_SONG_STATUS */ COLOR_CYAN_B | COLOR_BLUE_F, /* ATTR_INFO_INACTIVE */ COLOR_BLACK_B | COLOR_WHITE_F, /* ATTR_INFO_ACTIVE */ COLOR_CYAN_B | COLOR_YELLOW_F, /* ATTR_INFO_IHOTKEY */ COLOR_BLACK_B | COLOR_YELLOW_F, /* ATTR_INFO_AHOTKEY */ COLOR_BLACK_B | COLOR_BROWN_F, /* ATTR_HELP */ COLOR_BLACK_B | COLOR_CYAN_F, /* ATTR_PLAYENTRY_INACTIVE */ COLOR_BLACK_B | COLOR_LCYAN_F, /* ATTR_PLAYENTRY_ACTIVE */ COLOR_BLACK_B | COLOR_CYAN_F, /* ATTR_SAMPLES */ COLOR_BLACK_B | COLOR_WHITE_F, /* ATTR_SAMPLES_KICK3 */ COLOR_BLACK_B | COLOR_LCYAN_F, /* ATTR_SAMPLES_KICK2 */ COLOR_BLACK_B | COLOR_LBLUE_F, /* ATTR_SAMPLES_KICK1 */ COLOR_BLACK_B | COLOR_BLUE_F, /* ATTR_SAMPLES_KICK0 */ COLOR_BLACK_B | COLOR_CYAN_F, /* ATTR_CONFIG */ COLOR_BLACK_B | COLOR_CYAN_F, /* ATTR_VOLBAR */ COLOR_BLACK_B | COLOR_LGREEN_F, /* ATTR_VOLBAR_LOW */ COLOR_BLACK_B | COLOR_YELLOW_F, /* ATTR_VOLBAR_MED */ COLOR_BLACK_B | COLOR_LRED_F, /* ATTR_VOLBAR_HIGH */ COLOR_BLACK_B | COLOR_GREEN_F, /* ATTR_VOLBAR_INSTR */ COLOR_CYAN_B | COLOR_BLACK_F, /* ATTR_MENU_FRAME */ COLOR_CYAN_B | COLOR_BLACK_F, /* ATTR_MENU_INACTIVE */ COLOR_BLACK_B | COLOR_WHITE_F, /* ATTR_MENU_ACTIVE */ COLOR_CYAN_B | COLOR_YELLOW_F, /* ATTR_MENU_IHOTKEY */ COLOR_BLACK_B | COLOR_YELLOW_F, /* ATTR_MENU_AHOTKEY */ COLOR_GRAY_B | COLOR_BLACK_F, /* ATTR_DLG_FRAME */ COLOR_GRAY_B | COLOR_BLUE_F, /* ATTR_DLG_LABEL */ COLOR_BLACK_B | COLOR_WHITE_F, /* ATTR_DLG_STR_TEXT */ COLOR_CYAN_B | COLOR_BLACK_F, /* ATTR_DLG_STR_CURSOR */ COLOR_CYAN_B | COLOR_GRAY_F, /* ATTR_DLG_BUT_INACTIVE */ COLOR_BLACK_B | COLOR_WHITE_F, /* ATTR_DLG_BUT_ACTIVE */ COLOR_CYAN_B | COLOR_YELLOW_F, /* ATTR_DLG_BUT_IHOTKEY */ COLOR_BLACK_B | COLOR_YELLOW_F, /* ATTR_DLG_BUT_AHOTKEY */ COLOR_CYAN_B | COLOR_BLACK_F, /* ATTR_DLG_BUT_ITEXT */ COLOR_BLACK_B | COLOR_WHITE_F, /* ATTR_DLG_BUT_ATEXT */ COLOR_CYAN_B | COLOR_BLACK_F, /* ATTR_DLG_LIST_FOCUS */ COLOR_CYAN_B | COLOR_YELLOW_F, /* ATTR_DLG_LIST_NOFOCUS */ COLOR_BLACK_B | COLOR_LCYAN_F, /* ATTR_STATUS_LINE */ COLOR_BLACK_B | COLOR_CYAN_F /* ATTR_STATUS_TEXT */ }; static int mono_attributes[ATTRS_COUNT] = { A_REVERSE, /* ATTR_WARNING */ A_REVERSE, /* ATTR_TITLE */ A_NORMAL, /* ATTR_BANNER */ A_NORMAL, /* ATTR_SONG_STATUS */ A_REVERSE, /* ATTR_INFO_INACTIVE */ A_NORMAL, /* ATTR_INFO_ACTIVE */ A_NORMAL, /* ATTR_INFO_IHOTKEY */ A_NORMAL, /* ATTR_INFO_AHOTKEY */ A_NORMAL, /* ATTR_HELP */ A_NORMAL, /* ATTR_PLAYENTRY_INAVTIVE */ A_REVERSE, /* ATTR_PLAYENTRY_ACTIVE */ A_NORMAL, /* ATTR_SAMPLES */ A_BOLD, /* ATTR_SAMPLES_KICK3 */ A_NORMAL, /* ATTR_SAMPLES_KICK2 */ A_NORMAL, /* ATTR_SAMPLES_KICK1 */ A_NORMAL, /* ATTR_SAMPLES_KICK0 */ A_NORMAL, /* ATTR_CONFIG */ A_NORMAL, /* ATTR_VOLBAR */ A_NORMAL, /* ATTR_VOLBAR_LOW */ A_NORMAL, /* ATTR_VOLBAR_MED */ A_BOLD, /* ATTR_VOLBAR_HIGH */ A_NORMAL, /* ATTR_VOLBAR_INSTR */ A_REVERSE, /* ATTR_MENU_FRAME */ A_REVERSE, /* ATTR_MENU_INACTIVE */ A_NORMAL, /* ATTR_MENU_ACTIVE */ A_NORMAL, /* ATTR_MENU_IHOTKEY */ A_REVERSE, /* ATTR_MENU_AHOTKEY */ A_REVERSE, /* ATTR_DLG_FRAME */ A_REVERSE, /* ATTR_DLG_LABEL */ A_NORMAL, /* ATTR_DLG_STR_TEXT */ A_REVERSE, /* ATTR_DLG_STR_CURSOR */ A_REVERSE, /* ATTR_DLG_BUT_INACTIVE */ A_BOLD, /* ATTR_DLG_BUT_ACTIVE */ A_NORMAL, /* ATTR_DLG_BUT_IHOTKEY */ A_REVERSE, /* ATTR_DLG_BUT_AHOTKEY */ A_REVERSE, /* ATTR_DLG_BUT_ITEXT */ A_BOLD, /* ATTR_DLG_BUT_ATEXT */ A_BOLD, /* ATTR_DLG_LIST_FOCUS */ A_NORMAL, /* ATTR_DLG_LIST_NOFOCUS */ A_NORMAL, /* ATTR_STATUS_LINE */ A_NORMAL /* ATTR_STATUS_TEXT */ }; /*========== default archiver */ /* The following table describes how MikMod should deal with archives. The first two fields are for identification. The code will consider that a given file is a recognized archive if a signature is found at a fixed location in the file. The first field is the offset into the archive of the signature, and the second field points to the signature to check. If the offset is negative, the extension of the file is matched against the parts of the second field. The third field contains the name of the program and its arguments to invoke to list the archive. Here %A is replaced with the archive name and %a with a short version of the archive name (for DOS and WIN) or the archive name. For the special case of mono-file archives (gzip and bzip2 compressed files, for example), set this field to NULL. In this case, the code will determine the contents of the file without having to invoke the list function of the archiver. This is necessary since bzip2 has no list function, and the only way to get the archive contents is to test it, which can be a really slow process. The fourth field is the column in the archive listing output where the filenames begin (starting from zero for the leftmost column). A good archiver will put them last on the line, so they can embed spaces and be as long as necessary. The fifth field contains the program and its arguments to extract the modules from archives. Here %A is replaced with the archive name, %a with a short version of the archive name (for DOS and WIN) or the archive name, %f with the file name, and %d with the destination name (for non UNIX systems only). The last three fields specify which part to use from the extracted file (if the extraction program mixes status information and the module). The first skipstart lines starting from the first occurence of skippat and the last skipend lines from the extracted file are removed. */ /* use similar signature idea to "file" to see what format we have... */ static char pksignat[] = "PK\x03\x04"; static char zoosignat[] = "\xdc\xa7\xc4\xfd"; static char rarsignat[] = "Rar!"; static char gzsignat[] = "\x1f\x8b"; static char bzip2signat[] = "BZh"; static char tarsignat[] = "ustar"; static char lhsignat[] = "-lh"; static char lzsignat[] = "-lz"; /* interesting file extensions */ static char targzext[] = ".TAR.GZ .TAZ .TGZ"; #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) static char tarbzip2ext[] = ".TAR.BZ2 .TBZ .TBZ2"; #endif static ARCHIVE archiver_def[] = { /* location, marker, list, filenames column, extract, skippat, skipstart, skipend */ #ifdef _mikmod_amiga { 0, pksignat, "unzip -vqq \"%a\" > \"%d\"", 58, "unzip -pqq \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { 20, zoosignat, "zoo lq \"%a\" > \"%d\"", 47, "zoo xpq \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { 0, rarsignat, "unrar v -c- \"%a\" > \"%d\"", 1, "unrar p -inul \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { 2, lhsignat, "lha vvq \"%a\" > \"%d\"", -1, "lha pq \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { 2, lzsignat, "lha vvq \"%a\" > \"%d\"", -1, "lha pq \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, {257, tarsignat, "tar -tf \"%a\" > \"%d\"", 0, "tar -xOf \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { -1, targzext, "tar -tzf \"%a\" > \"%d\"", 0, "tar -xOzf \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { -1, tarbzip2ext, "tar --use-compress-program=bzip2 -tf \"%a\" > \"%d\"", 0, "tar --use-compress-program=bzip2 -xOf \"%a\" \"%f\" > \"%d\"", NULL, 0, 0}, { 0, gzsignat, NULL, 0, "gzip -dqc \"%a\" > \"%d\"", NULL, 0, 0}, { 0, bzip2signat, NULL, 0, "bzip2 -dqc \"%a\" > \"%d\"", NULL, 0, 0} #elif !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) { 0, pksignat, "unzip -vqq \"%a\"", 58, "unzip -pqq \"%a\" \"%f\"", NULL, 0, 0}, { 20, zoosignat, "zoo lq \"%a\"", 47, "zoo xpq \"%a\" \"%f\"", NULL, 0, 0}, { 0, rarsignat, "unrar v -c- \"%a\"", 1, "unrar p -inul \"%a\" \"%f\"", NULL, 0, 0}, { 2, lhsignat, "lha vvq \"%a\"", -1, "lha pq \"%a\" \"%f\"", NULL, 0, 0}, { 2, lzsignat, "lha vvq \"%a\"", -1, "lha pq \"%a\" \"%f\"", NULL, 0, 0}, {257, tarsignat, "tar -tf \"%a\"", 0, "tar -xOf \"%a\" \"%f\"", NULL, 0, 0}, { -1, targzext, "tar -tzf \"%a\"", 0, "tar -xOzf \"%a\" \"%f\"", NULL, 0, 0}, { -1, tarbzip2ext, "tar --use-compress-program=bzip2 -tf \"%a\"", 0, "tar --use-compress-program=bzip2 -xOf \"%a\" \"%f\"", NULL, 0, 0}, { 0, gzsignat, NULL, 0, "gzip -dqc \"%a\"", NULL, 0, 0}, { 0, bzip2signat, NULL, 0, "bzip2 -dqc \"%a\"", NULL, 0, 0} #else /* { 0, pksignat, "unzip -lqq \"%a\"", 41, "unzip -pqq \"%a\" \"%f\" >\"%d\"", NULL, 0, 0}, { 0, rarsignat, "unrar v -c- \"%a\"", 1, "unrar p -inul \"%a\" \"%f\" >\"%d\"", NULL, 0, 0}, {257, tarsignat, "tar -tf \"%a\"", 0, "tar -xOf \"%a\" \"%f\" >\"%d\"", NULL, 0, 0}, */ { 0, pksignat, "pkunzip -vb \"%a\"", 47, "pkunzip -c \"%a\" \"%f\" >\"%d\"", "to console", 2, 1}, { 20, zoosignat, "zoo lq \"%a\"", 47, "zoo xpq \"%a\" \"%f\" >\"%d\"", NULL, 0, 0}, { 0, rarsignat, "rar v -y -c- \"%a\"", 1, "rar p -y -c- \"%a\" \"%f\" >\"%d\"", "--- Printing ", 2, 2}, { 2, lhsignat, "lha v %a", -1, "lha p /n %a %f >\"%d\"", NULL, 3, 0}, { 2, lzsignat, "lha v %a", -1, "lha p /n %a %f >\"%d\"", NULL, 3, 0}, {257, tarsignat, "djtar -t \"%A\"", 36, "djtar -x -p -b -o \"%f\" \"%A\" >\"%d\"", NULL, 0, 0}, { -1, targzext, "djtar -t \"%A\"", 36, "djtar -x -p -b -o \"%f\" \"%A\" >\"%d\"", NULL, 0, 0}, { 0, gzsignat, NULL, 27, "gzip -dqc \"%a\" >\"%d\"", NULL, 0, 0}, { 0, bzip2signat, NULL, 0, "bzip2 -dqc \"%a\" >\"%d\"", NULL, 0, 0} #endif }; #define CNT_ARCHIVER_DEF (sizeof(archiver_def)/sizeof(archiver_def[0])) char *CF_GetFilename(void) { #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) return get_cfg_name("mikmod.cfg"); #else return get_cfg_name(".mikmodrc"); #endif } char *CF_GetDefaultFilename(void) { #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) return NULL; #else return str_sprintf2("%s" PATH_SEP_STR "%s", PACKAGE_DATA_DIR, "mikmodrc"); #endif } static void init_themes(CONFIG *cfg) { cfg->cnt_themes = THEME_COUNT; cfg->themes = (THEME *) malloc (sizeof(THEME)*cfg->cnt_themes); cfg->themes[THEME_COLOR].name = ""; cfg->themes[THEME_COLOR].color = 1; cfg->themes[THEME_COLOR].attrs = color_attributes; cfg->themes[THEME_MONO].name = ""; cfg->themes[THEME_MONO].color = 0; cfg->themes[THEME_MONO].attrs = mono_attributes; cfg->theme = THEME_COLOR; } static void write_theme(THEME *theme) { int i; rc_write_string("NAME", theme->name, NULL); if (theme->color) { char str[30]; for (i=0; iattrs[i] & (COLOR_FMASK+COLOR_BOLDMASK)) >> COLOR_FSHIFT]); strcat (str,","); strcat (str,attrs_colb_label [(theme->attrs[i] & COLOR_BMASK) >> COLOR_BSHIFT]); rc_write_string(attrs_label[i], str, NULL); } } else { for (i=0; iattrs[i],NULL); } } void CF_theme_free (THEME *theme) { if (theme) { if (theme->name) free (theme->name); if (theme->attrs) free (theme->attrs); } } void CF_theme_copy (THEME *dest, THEME *src) { dest->color = src->color; dest->name = strdup (src->name); dest->attrs = (int *) malloc (sizeof(int)*ATTRS_COUNT); memcpy (dest->attrs,src->attrs,sizeof(int)*ATTRS_COUNT); } /* Free all themes and return {NULL, 0} */ void CF_themes_free (THEME **themes, int *cnt) { if (themes && *themes) { int i; for (i=0; i<*cnt; i++) CF_theme_free (&(*themes)[i]); free (*themes); } *cnt = 0; if (themes) *themes = NULL; } /* Free the user themes (themes above THEME_COUNT) */ void CF_themes_free_user (THEME **themes, int *cnt) { if (themes && *themes) { int i; for (i=THEME_COUNT; i<*cnt; i++) CF_theme_free (&(*themes)[i]); *cnt = THEME_COUNT; *themes = (THEME *) realloc (*themes, sizeof(THEME)*(*cnt)); } } /* Free the theme at 'pos' in the array themes (length: cnt) */ void CF_theme_remove (int pos, THEME **themes, int *cnt) { int i; if (*cnt>0) { (*cnt)--; if (*themes) CF_theme_free (&(*themes)[pos]); if (*cnt>0) { for (i=pos; i<*cnt; i++) (*themes)[i] = (*themes)[i+1]; *themes = (THEME *) realloc (*themes, sizeof(THEME)*(*cnt)); } else { free (*themes); *themes = NULL; } } } /* Copy theme and insert it alphabetically sorted in themes (after the intern themes). cnt: size of the array themes Return: position of insertion */ int CF_theme_insert (THEME **themes, int *cnt, THEME *theme) { int i, pos = *cnt; if (*cnt >= THEME_COUNT) { pos = THEME_COUNT; while (pos<*cnt && strcasecmp((*themes)[pos].name,theme->name) < 0) pos++; } (*cnt)++; *themes = (THEME *) realloc (*themes,sizeof(THEME)*(*cnt)); for (i=*cnt-1; i>pos; i--) (*themes)[i] = (*themes)[i-1]; CF_theme_copy (&(*themes)[pos], theme); return pos; } static void read_theme(CONFIG *cfg) { int i, fg, bg; int attrs[ATTRS_COUNT]; THEME theme = {NULL,-1,NULL}; char *str = NULL, *pos, *end; theme.attrs = attrs; if (!rc_read_string("NAME", &theme.name, THEME_NAME_LEN)) return; for (i=0; ithemes, &cfg->cnt_themes, &theme); free (theme.name); } static void write_archiver(ARCHIVE *archiver) { rc_write_int("LOCATION", archiver->location, NULL); rc_write_string("MARKER", archiver->marker, NULL); rc_write_string("LIST", archiver->list, NULL); rc_write_int("NAMEOFFSET", archiver->nameoffset, NULL); rc_write_string("EXTRACT", archiver->extract, NULL); rc_write_string("SKIPPAT", archiver->skippat, NULL); rc_write_int("SKIPSTART", archiver->skipstart, NULL); rc_write_int("SKIPEND", archiver->skipend, NULL); } static void read_archiver(CONFIG *cfg) { ARCHIVE arch; memset (&arch, 0, sizeof(ARCHIVE)); if (!rc_read_int("LOCATION", &arch.location, -1, 999)) return; rc_read_string("MARKER", &arch.marker, 999); rc_read_string("LIST", &arch.list, PATH_MAX+200); rc_read_int("NAMEOFFSET", &arch.nameoffset, -1, 999); rc_read_string("EXTRACT", &arch.extract, PATH_MAX+200); rc_read_string("SKIPPAT", &arch.skippat, 999); rc_read_int("SKIPSTART", &arch.skipstart, 0, 999); rc_read_int("SKIPEND", &arch.skipend, 0, 999); if (cfg->archiver == archiver_def) { cfg->cnt_archiver = 1; cfg->archiver = (ARCHIVE *) malloc (sizeof(ARCHIVE)); } else { cfg->cnt_archiver++; cfg->archiver = (ARCHIVE *) realloc (cfg->archiver, sizeof(ARCHIVE)*cfg->cnt_archiver); } cfg->archiver[cfg->cnt_archiver-1] = arch; } void CF_Init(CONFIG *cfg) { cfg->driver = 0; #if LIBMIKMOD_VERSION >= 0x030107 rc_set_string(&cfg->driveroptions, "", 255); #endif cfg->stereo = 1; cfg->mode_16bit = 1; cfg->frequency = 44100; cfg->interpolate = 1; cfg->hqmixer = 0; cfg->surround = 0; cfg->reverb = 0; cfg->volume = 100; cfg->volrestrict = 0; cfg->fade = 0; cfg->loop = 0; cfg->panning = 1; cfg->extspd = 1; cfg->playmode = PM_MULTI; cfg->curious = 0; cfg->tolerant = 1; cfg->renice = RENICE_NONE; cfg->statusbar = 2; cfg->save_config = 1; cfg->save_playlist = 1; rc_set_string(&cfg->pl_name, "playlist.mpl", PATH_MAX); cfg->cnt_hotlist = 0; cfg->hotlist = NULL; cfg->fullpaths = 0; #if LIBMIKMOD_VERSION >= 0x030200 cfg->forcesamples = 0; cfg->fakevolbars = 1; #endif cfg->window_title = 1; init_themes (cfg); cfg->cnt_archiver = CNT_ARCHIVER_DEF; cfg->archiver = archiver_def; } BOOL CF_Save(CONFIG * cfg) { char *name; int i; if (!(name = CF_GetFilename())) return 0; if (!rc_save (name,mikversion)) { free(name); rc_close(); return 0; } free(name); rc_write_int("DRIVER", cfg->driver, "DRIVER = , nth driver for output, default: 0\n"); #if LIBMIKMOD_VERSION >= 0x030107 rc_write_string("DRV_OPTIONS", cfg->driveroptions, "DRV_OPTIONS = \"options\", the driver options, e.g. \"buffer=14,count=16\"\n" " for the OSS-driver\n"); #endif rc_write_bool("STEREO", cfg->stereo, "STEREO = Yes|No, stereo or mono output, default: stereo\n"); rc_write_bool("16BIT", cfg->mode_16bit, "16BIT = Yes|No, 8 or 16 bit output, default: 16 bit\n"); rc_write_int("FREQUENCY", cfg->frequency, "FREQUENCY = , mixing frequency, default: 44100 Hz\n"); rc_write_bool("INTERPOLATE", cfg->interpolate, "INTERPOLATE = Yes|No, use interpolate mixing, default: Yes\n"); rc_write_bool("HQMIXER", cfg->hqmixer, "HQMIXER = Yes|No, use high-quality (but slow) software mixer, default: No\n"); rc_write_bool("SURROUND", cfg->surround, "SURROUND = Yes|No, use surround mixing, default: No\n"); rc_write_int("REVERB", cfg->reverb, "REVERB = , set reverb amount (0-15), default: 0 (none)\n"); rc_write_int("VOLUME", cfg->volume, "VOLUME = , volume from 0 (silence) to 100, default: 100\n"); rc_write_bool("VOLRESTRICT", cfg->volrestrict, "VOLRESTRICT = Yes|No, restrict volume of player to volume supplied by user,\n" " default: No\n"); rc_write_bool("FADEOUT", cfg->fade, "FADEOUT = Yes|No, volume fade at the end of the module, default: No\n"); rc_write_bool("LOOP", cfg->loop, "LOOP = Yes|No, enable in-module loops, default: No\n"); rc_write_bool("PANNING", cfg->panning, "PANNING = Yes|No, process panning effects, default: Yes\n"); rc_write_bool("EXTSPD", cfg->extspd, "EXTSPD = Yes|No, process Protracker extended speed effect, default: Yes\n"); rc_write_bool("PM_MODULE", BTST(cfg->playmode, PM_MODULE), "PM_MODULE = Yes|No, Module repeats, default: No\n"); rc_write_bool("PM_MULTI", BTST(cfg->playmode, PM_MULTI), "PM_MULTI = Yes|No, PlayList repeats, default: Yes\n"); rc_write_bool("PM_SHUFFLE", BTST(cfg->playmode, PM_SHUFFLE), "PM_SHUFFLE = Yes|No, Shuffle list at start and if all entries are played,\n" " default: No\n"); rc_write_bool("PM_RANDOM", BTST(cfg->playmode, PM_RANDOM), "PM_RANDOM = Yes|No, PlayList in random order, default: No\n"); rc_write_bool("CURIOUS", cfg->curious, "CURIOUS = Yes|No, look for hidden patterns in module, default: No\n"); rc_write_bool("TOLERANT", cfg->tolerant, "TOLERANT = Yes|No, don't halt on file access errors, default: Yes\n"); rc_write_label("RENICE", renice_conv, cfg->renice, "RENICE = RENICE_NONE (change nothing), RENICE_PRI (Renice to -20) or\n" " RENICE_REAL (get realtime priority), default: RENICE_NONE\n" " Note that RENICE_PRI is only available under FreeBSD, Linux, NetBSD,\n" " OpenBSD and OS/2, and RENICE_REAL is only available under FreeBSD, Linux\n" " and OS/2.\n"); rc_write_int("STATUSBAR", cfg->statusbar, "STATUSBAR = , size of statusbar from 0 to 2, default: 2\n"); rc_write_bool("SAVECONFIG", cfg->save_config, "SAVECONFIG = Yes|No, save configuration on exit, default: Yes\n"); rc_write_bool("SAVEPLAYLIST", cfg->save_playlist, "SAVEPLAYLIST = Yes|No, save playlist on exit, default: Yes\n"); rc_write_string("PL_NAME", cfg->pl_name, "PL_NAME = \"name\", name under which the playlist will be saved\n" " by selecting 'Save' in the playlist-menu\n"); if (cfg->cnt_hotlist > 0) { rc_write_string("HOTLIST", cfg->hotlist[0], "HOTLIST = \"name\", entries in the directory hotlist,\n" " can occur any time in this file\n"); for (i=1; icnt_hotlist; i++) rc_write_string("HOTLIST",cfg->hotlist[i],NULL); } rc_write_bool("FULLPATHS", cfg->fullpaths, "FULLPATHS = Yes|No, display full path of files, default: Yes\n"); #if LIBMIKMOD_VERSION >= 0x030200 rc_write_bool("FORCESAMPLES", cfg->forcesamples, "FORCESAMPLES = Yes|No, always display sample names (instead of\n" " instrument names) in volumebars panel, default: No\n"); rc_write_bool("FAKEVOLUMEBARS", cfg->fakevolbars, "FAKEVOLUMEBARS = Yes|No, display fast, but not always accurate, volumebars\n" " in volumebars panel, default: Yes\n" " The real volumebars (when this setting is \"No\") take some CPU time to\n" " be computed, and don't work with every driver.\n"); #endif rc_write_bool("WINDOWTITLE", cfg->window_title, "WINDOWTITLE = Yes|No, set the term/window title to song name\n" " (or filename if song has no title), default: Yes\n"); rc_write_string ("THEME",cfg->themes[cfg->theme].name, "THEME = \"name\", name of the theme to use, default: "); if (cfg->cnt_themes>THEME_COUNT) { rc_write_struct ("THEME", "Definition of the themes\n" " NAME = \"name\", specifies the name of the theme\n" " = normal | bold | reverse , for mono themes or\n" " = , , for color themes\n" " where = black | blue | green | cyan | red | magenta |\n" " brown | gray | b_black | b_blue | b_green |\n" " b_cyan | b_red | b_magenta | yellow | white\n" " = black | blue | green | cyan | red | magenta |\n" " brown | gray\n"); write_theme (&cfg->themes[THEME_COUNT]); rc_write_struct_end (NULL); for (i=THEME_COUNT+1; icnt_themes; i++) { rc_write_struct ("THEME",NULL); write_theme (&cfg->themes[i]); rc_write_struct_end (NULL); } } if (cfg->cnt_archiver > 0) { rc_write_struct ("ARCHIVER", "Definition of the archiver\n" " LOCATION = , -1: MARKER gives list of possible file extensions\n" " otherwise: location where MARKER must be found in the file\n" " MARKER = , see LOCATION, e.g. \".TAR.GZ .TGZ\" or \"PK\\x03\\x04\"\n" " LIST = , command to list archive content (%A archive name,\n" " %a short(DOS/WIN) archive name)\n" " NAMEOFFSET = , column where file names begin,\n" " -1: start at column 0 and end at first space\n" " EXTRACT = , command to extract a file to stdout (%A archive name,\n" " %a short archive name, %f file name, %d destination name(non UNIX))\n" " SKIPPAT = , Remove the first SKIPSTART lines starting from the first\n" " occurence of SKIPPAT and the last SKIPEND lines from the\n" " extracted file (if the command EXTRACT mixes status\n" " information and the module).\n" " SKIPSTART = , \n" " SKIPEND = , \n"); write_archiver (&cfg->archiver[0]); rc_write_struct_end (NULL); for (i=1; icnt_archiver; i++) { rc_write_struct ("ARCHIVER",NULL); write_archiver (&cfg->archiver[i]); rc_write_struct_end (NULL); } } rc_close(); return 1; } void CF_string_array_insert (int pos, char ***value, int *cnt, char *arg, int length) { int i; (*cnt)++; *value = (char **) realloc (*value, sizeof(char*)*(*cnt)); for (i=*cnt-1; i>pos; i--) (*value)[i] = (*value)[i-1]; (*value)[pos] = NULL; rc_set_string (&(*value)[pos], arg, length); } void CF_string_array_remove (int pos, char ***value, int *cnt) { int i; if (*cnt>0) { (*cnt)--; if (*value && (*value)[pos]) free ((*value)[pos]); if (*cnt>0) { for (i=pos; i<*cnt; i++) (*value)[i] = (*value)[i+1]; *value = (char **) realloc (*value, sizeof(char*)*(*cnt)); } else { free (*value); *value = NULL; } } } BOOL CF_Load(CONFIG *cfg) { char *name = CF_GetFilename(), *str = NULL; int i; if (!name) return 0; if (!rc_load(name)) { free(name); rc_close(); name = CF_GetDefaultFilename(); if (!name) return 0; if (!rc_load(name)) { free(name); rc_close(); return 0; } } free(name); rc_read_int("DRIVER", &cfg->driver, 0, 999); #if LIBMIKMOD_VERSION >= 0x030107 rc_read_string("DRV_OPTIONS", &cfg->driveroptions, 255); #endif rc_read_bool("STEREO", &cfg->stereo); rc_read_bool("16BIT", &cfg->mode_16bit); rc_read_int("FREQUENCY", &cfg->frequency, 4000, 60000); rc_read_bool("INTERPOLATE", &cfg->interpolate); rc_read_bool("HQMIXER", &cfg->hqmixer); rc_read_bool("SURROUND", &cfg->surround); rc_read_int("REVERB", &cfg->reverb, 0, 15); rc_read_int("VOLUME", &cfg->volume, 0, 100); rc_read_bool("VOLRESTRICT", &cfg->volrestrict); rc_read_bool("FADEOUT", &cfg->fade); rc_read_bool("LOOP", &cfg->loop); rc_read_bool("PANNING", &cfg->panning); rc_read_bool("EXTSPD", &cfg->extspd); rc_read_bit("PM_MODULE", &cfg->playmode, PM_MODULE); rc_read_bit("PM_MULTI",&cfg->playmode, PM_MULTI); rc_read_bit("PM_SHUFFLE", &cfg->playmode, PM_SHUFFLE); rc_read_bit("PM_RANDOM", &cfg->playmode, PM_RANDOM); rc_read_bool("CURIOUS", &cfg->curious); rc_read_bool("TOLERANT", &cfg->tolerant); rc_read_label("RENICE", &cfg->renice, renice_conv); rc_read_int("STATUSBAR", &cfg->statusbar, 0, 2); rc_read_bool("SAVECONFIG", &cfg->save_config); rc_read_bool("SAVEPLAYLIST", &cfg->save_playlist); rc_read_string("PL_NAME", &cfg->pl_name, PATH_MAX); path_conv(cfg->pl_name); while (rc_read_string("HOTLIST",&str,PATH_MAX)) { path_conv(str); CF_string_array_insert (cfg->cnt_hotlist, &cfg->hotlist, &cfg->cnt_hotlist, str, PATH_MAX); } rc_read_bool("FULLPATHS", &cfg->fullpaths); #if LIBMIKMOD_VERSION >= 0x030200 rc_read_bool("FORCESAMPLES", &cfg->forcesamples); rc_read_bool("FAKEVOLUMEBARS", &cfg->fakevolbars); #endif rc_read_bool("WINDOWTITLE", &cfg->window_title); while (rc_read_struct("THEME")) { read_theme (cfg); rc_read_struct_end(); } if (rc_read_string("THEME", &str, THEME_NAME_LEN)) { for (i=0; icnt_themes; i++) { if (!strcasecmp(str,cfg->themes[i].name)) { cfg->theme = i; break; } } } while (rc_read_struct("ARCHIVER")) { read_archiver (cfg); rc_read_struct_end(); } free (str); rc_close(); return 1; } /* ex:set ts=4: */ mikmod-3.2.9/src/mlist.c0000644000000000000000000003247114607406616013607 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mlist.c,v 1.1.1.1 2004/01/16 02:07:37 raph Exp $ Playlist management functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #ifndef HAVE_FNMATCH_H #include "mfnmatch.h" #else #include #endif #include #include #include #include #include "mlist.h" #include "marchive.h" #include "mutilities.h" static int mikmod_random(int limit) { #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga) return rand() % limit; #else return random() % limit; #endif } /* Mark all the modules in the playlist as not played */ static void PL_ClearPlayed(PLAYLIST * pl) { int i; for (i = 0; i < pl->length; i++) pl->entry[i].played = 0; } BOOL PL_isPlaylistFilename(const CHAR *filename) { char *cfg_name = NULL; if (!fnmatch("*.mpl", filename, 0)) return 1; if ((cfg_name = PL_GetFilename())) { const char *p1 = FIND_LAST_DIRSEP(cfg_name); const char *p2 = FIND_LAST_DIRSEP(filename); if (!p1) p1 = cfg_name; if (!p2) p2 = filename; if (!filecmp(p1, p2)) { free(cfg_name); return 1; } free(cfg_name); } return 0; } void PL_InitList(PLAYLIST * pl) { pl->entry = NULL; pl->length = 0; pl->current = -1; pl->curr_deleted = 0; pl->add_pos = -1; #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32)||defined(_mikmod_amiga)||!defined(HAVE_SRANDOM) srand(time(NULL)); #else { const char * s = getenv("MIKMOD_SRAND_CONSTANT"); if (s) { srandom((unsigned int)atoi(s)); } else { srandom(time(NULL)); } } #endif } /* Choose the first non-played module */ void PL_InitCurrent(PLAYLIST * pl) { pl->current = 0; while ((pl->current < pl->length) && (pl->entry[pl->current].played)) pl->current++; if (pl->current >= pl->length) { PL_ClearPlayed(pl); pl->current = 0; } pl->current--; } void PL_ClearList(PLAYLIST * pl) { int i; for (i = 0; i < pl->length; i++) { if (pl->entry[i].file) free(pl->entry[i].file); if (pl->entry[i].archive) free(pl->entry[i].archive); } if (pl->entry) { free(pl->entry); pl->entry = NULL; } pl->current = -1; pl->curr_deleted = 0; pl->length = 0; } BOOL PL_CurrentDeleted(PLAYLIST * pl) { return pl->curr_deleted; } PLAYENTRY *PL_GetCurrent(PLAYLIST * pl) { if (pl->current < 0 || !pl->length) return NULL; return &pl->entry[pl->current]; } int PL_GetCurrentPos(PLAYLIST * pl) { if (pl->current < 0 || !pl->length) return -1; return pl->current; } PLAYENTRY *PL_GetEntry(PLAYLIST * pl, int number) { if ((number < 0) || (number >= pl->length)) return NULL; return &pl->entry[number]; } int PL_GetLength(PLAYLIST * pl) { return pl->length; } void PL_SetTimeCurrent(PLAYLIST * pl, long sngtime) { if (!pl->curr_deleted && pl->current >= 0 && pl->current < pl->length) pl->entry[pl->current].time = sngtime >> 10; } void PL_SetPlayedCurrent(PLAYLIST * pl) { if (!pl->curr_deleted && pl->current >= 0 && pl->current < pl->length) pl->entry[pl->current].played = 1; } BOOL PL_DelEntry(PLAYLIST * pl, int number) { int i; if (!pl->length) return 0; if (pl->entry[number].file) free(pl->entry[number].file); if (pl->entry[number].archive) free(pl->entry[number].archive); pl->length--; if (number <= pl->current) { if (number == pl->current) pl->curr_deleted = 1; pl->current--; } for (i = number; i < pl->length; i++) pl->entry[i] = pl->entry[i + 1]; pl->entry = (PLAYENTRY *) realloc(pl->entry, pl->length * sizeof(PLAYENTRY)); return 1; } BOOL PL_DelDouble(PLAYLIST * pl) { int i, j; if (!pl->length) return 0; for (i = pl->length - 2; i >= 0; i--) for (j = i + 1; j < pl->length; j++) if (!filecmp(pl->entry[i].file, pl->entry[j].file) && (!(pl->entry[i].archive || pl->entry[j].archive) || (pl->entry[i].archive && pl->entry[j].archive && !filecmp(pl->entry[i].archive, pl->entry[j].archive)))) { /* keep the time and played information whenever possible */ if (!pl->entry[i].time) pl->entry[i].time = pl->entry[j].time; if (!pl->entry[i].played) pl->entry[i].played = pl->entry[j].played; PL_DelEntry(pl, j); } return 1; } /* Following PL_Add will insert at pos */ void PL_StartInsert(PLAYLIST * pl, int pos) { pl->add_pos = pos; } /* Following PL_Add will append at end of playlist */ void PL_StopInsert(PLAYLIST * pl) { pl->add_pos = -1; } static void PL_Insert(PLAYLIST * pl, int pos, const CHAR *file, const CHAR *arc, int time, BOOL played) { int i; pl->length++; pl->entry = (PLAYENTRY *) realloc(pl->entry, pl->length * sizeof(PLAYENTRY)); for (i = pl->length - 1; i > pos; i--) pl->entry[i] = pl->entry[i - 1]; if (pos <= pl->current) pl->current++; pl->entry[pos].file = strdup(file); if (arc) { pl->entry[pos].archive = strdup(arc); } else pl->entry[pos].archive = NULL; pl->entry[pos].time = time; pl->entry[pos].played = played; } /* pl->add_pos < 0 => Append entry at end of playlist pl->add_pos >= 0 => Insert entry at pl->add_pos and increment pl->add_pos */ void PL_Add(PLAYLIST * pl, const CHAR *file, const CHAR *arc, int time, BOOL played) { if (pl->add_pos >= 0) { PL_Insert(pl, pl->add_pos, file, arc, time, played); pl->add_pos++; } else PL_Insert(pl, pl->length, file, arc, time, played); } #define LINE_LEN (PATH_MAX*2+20) /* "file" "arc" time played */ /* Loads a playlist */ BOOL PL_Load(PLAYLIST * pl, const CHAR *filename) { FILE *file; CHAR line[LINE_LEN]; CHAR *mod, *arc, *pos, *slash; int time, played; CHAR *ok = NULL; if (!(file = fopen(path_conv_sys(filename), "r"))) return 0; while ((ok = fgets(line, LINE_LEN, file)) && (strcasecmp(line, PL_IDENT))); if (!ok) { fclose(file); return 0; /* file is not a playlist */ } slash = FIND_LAST_DIRSEP(filename); while (fgets(line, LINE_LEN, file)) { if (*line != '"') continue; /* line == '"file" "arc" time played' */ mod = line + 1; /* file */ pos = mod; while (*pos != '"' && *pos) pos++; if (*pos != '"' || pos == mod) continue; *pos = '\0'; pos++; /* archive */ while (*pos != '"' && *pos) pos++; if (*pos == '"') pos++; arc = pos; while (*pos != '"' && *pos) pos++; time = played = 0; if (*pos) { *pos = '\0'; if (arc == pos) arc = NULL; pos += 2; /* time played */ sscanf(pos, "%d %d", &time, &played); } else arc = NULL; path_conv (arc); path_conv (mod); if (!arc && !time && !played) MA_FindFiles(pl, mod); else { /* we're loading a playlist, so it might be necessary to convert playlist paths to relative paths from cwd */ if (slash && path_relative(arc ? arc : mod)) { CHAR *dummy; dummy = (CHAR *) malloc(slash + 1 - filename + strlen(arc ? arc : mod) + 1); strncpy(dummy, filename, slash + 1 - filename); dummy[slash + 1 - filename] = '\0'; strcat(dummy, arc ? arc : mod); PL_Add(pl, arc ? mod : dummy, arc ? dummy : NULL, time, (BOOL)played); free (dummy); } else PL_Add(pl, mod, arc, time, (BOOL)played); } } fclose(file); return 1; } BOOL PL_Save(PLAYLIST * pl, const CHAR *filename) { FILE *file; int i; PLAYENTRY *entry; if (!(file = fopen(path_conv_sys(filename), "w"))) return 0; if (fputs(PL_IDENT, file) != EOF) { for (i = 0; i < pl->length; i++) { entry = &pl->entry[i]; if (entry->archive) fprintf(file, "\"%s\" \"%s\" %d %d\n", entry->file, entry->archive, entry->time, (int)entry->played); else fprintf(file, "\"%s\" \"\" %d %d\n", entry->file, entry->time, (int)entry->played); } fclose(file); return 1; } fclose(file); return 0; } char *PL_GetFilename(void) { #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_mikmod_amiga) return get_cfg_name("mikmodpl.cfg"); #elif defined(_WIN32) return get_cfg_name("mikmod_playlist.mpl"); #else return get_cfg_name(".mikmod_playlist"); #endif } BOOL PL_LoadDefault(PLAYLIST * pl) { char *name = PL_GetFilename(); BOOL ret = 0; if (name) { ret = PL_Load(pl, name); free(name); } return ret; } BOOL PL_SaveDefault(PLAYLIST * pl) { char *name = PL_GetFilename(); BOOL ret = 0; if (name) { ret = PL_Save(pl, name); free(name); } return ret; } /* check if selected file is a playlist and exchange it with the playlist */ static BOOL PL_CheckPlaylist(PLAYLIST * pl, BOOL *ok, int old_current, int cont, CHAR **retfile, CHAR **retarc, int arg) { /* check if selected file is a playlist */ if ((pl->entry[pl->current].file) && (!pl->entry[pl->current].archive)) { pl->add_pos = pl->current + 1; if (PL_Load(pl, pl->entry[pl->current].file)) { /* Yes -> del playlist-entry and get next entry in now modified list */ pl->add_pos = -1; PL_DelEntry(pl, pl->current); pl->current = old_current; switch (cont) { case PL_CONT_NEXT: *ok = PL_ContNext(pl, retfile, retarc, arg); return 1; case PL_CONT_PREV: *ok = PL_ContPrev(pl, retfile, retarc); return 1; case PL_CONT_POS: *ok = PL_ContPos(pl, retfile, retarc, arg); return 1; } } pl->add_pos = -1; } return 0; } /* get next module to play mode: PM_MODULE, PM_MULTI, PM_SHUFFLE, or PM_RANDOM return: was there a module? */ BOOL PL_ContNext(PLAYLIST * pl, CHAR **retfile, CHAR **retarc, int mode) { int num, i, not_played, old_current = pl->current; BOOL ok = 1; pl->curr_deleted = 0; if (!pl->length) return 0; if (BTST(mode, PM_RANDOM)) { not_played = 0; for (i = 0; i < pl->length; i++) if (!pl->entry[i].played) not_played++; if (!not_played) { PL_ClearPlayed(pl); not_played = pl->length; if (BTST(mode, PM_SHUFFLE)) PL_Randomize(pl); if (!BTST(mode, PM_MULTI)) return 0; } num = mikmod_random(not_played) + 1; while (num > 0) { pl->current++; if (pl->current == pl->length) pl->current = 0; if (!pl->entry[pl->current].played) num--; } } else { pl->current++; if (pl->current >= pl->length) { not_played = 0; for (i = 0; i < pl->length; i++) if (!pl->entry[i].played) not_played++; if (!not_played) { PL_ClearPlayed(pl); if (BTST(mode, PM_SHUFFLE)) PL_Randomize(pl); } pl->current = 0; if (!BTST(mode, PM_MULTI)) return 0; } } /* check if selected file is a playlist and load it */ if (PL_CheckPlaylist(pl, &ok, old_current, PL_CONT_NEXT, retfile, retarc, mode)) return ok; if (retfile) *retfile = pl->entry[pl->current].file; if (retarc) *retarc = pl->entry[pl->current].archive; return 1; } BOOL PL_ContPrev(PLAYLIST * pl, CHAR **retfile, CHAR **retarc) { int old_current = pl->current; BOOL ok = 1; pl->curr_deleted = 0; if (!pl->length) return 0; pl->current--; if (pl->current < 0) pl->current = pl->length - 1; /* check if selected file is a playlist and load it */ if (PL_CheckPlaylist(pl, &ok, old_current, PL_CONT_PREV, retfile, retarc, 0)) return ok; if (retfile) *retfile = pl->entry[pl->current].file; if (retarc) *retarc = pl->entry[pl->current].archive; return 1; } BOOL PL_ContPos(PLAYLIST * pl, CHAR **retfile, CHAR **retarc, int number) { int old_current = pl->current; BOOL ok = 1; pl->curr_deleted = 0; if ((number < 0) || (number >= pl->length)) return 0; pl->current = number; /* check if selected file is a playlist and load it */ if (PL_CheckPlaylist(pl, &ok, old_current, PL_CONT_POS, retfile, retarc, number)) return ok; if (retfile) *retfile = pl->entry[pl->current].file; if (retarc) *retarc = pl->entry[pl->current].archive; return 1; } void PL_Sort(PLAYLIST * pl, int (*compar) (PLAYENTRY * small, PLAYENTRY * big)) { int i, j; BOOL end = 0; PLAYENTRY tmp; for (i = 0; i < pl->length && !end; i++) { end = 1; for (j = pl->length - 1; j > i; j--) if (compar(&pl->entry[j - 1], &pl->entry[j]) > 0) { tmp = pl->entry[j]; pl->entry[j] = pl->entry[j - 1]; pl->entry[j - 1] = tmp; if (pl->current == j) pl->current = j - 1; else if (pl->current == j - 1) pl->current = j; end = 0; } } } void PL_Randomize(PLAYLIST * pl) { if (pl->length > 1) { int i, target; for (i = 0; i < pl->length - 1; i++) { target = mikmod_random(pl->length - i) + i; if (target != i) { PLAYENTRY temp; temp = pl->entry[i]; pl->entry[i] = pl->entry[target]; pl->entry[target] = temp; /* track selection */ if (pl->current == i) pl->current = target; else if (pl->current == target) pl->current = i; } } } } /* ex:set ts=4: */ mikmod-3.2.9/src/mikmod.10000644000000000000000000003230714037505106013642 0ustar rootroot.TH MIKMOD 1 "Version 3.2.9, 20 April 2021" .SH NAME mikmod - play soundtracker etc. modules on a Unix machine. .SH SYNOPSIS .B mikmod [\fB\-options\fR]... [\fBmodule\fR|\fBplaylist\fR]... .SH DESCRIPTION \fIMikMod\fR is a \fIvery\fR portable module player based on libmikmod, written originally by Jean-Paul Mikkers (MikMak). It will play the IT, XM, MOD, MTM, S3M, STM, ULT, FAR, MED, DSM, AMF, IMF and 669 module formats. It works under AIX, FreeBSD, HP-UX, IRIX, Linux, NetBSD, OpenBSD, OSF/1, SunOS, Solaris, OS/2, DOS, and Windows. It is controllable via an easy-to-use curses interface and will extract and play modules from a variety of different archive formats. .SH OPTIONS Options can be given in any order, and are case-sensitive. For the options which have both a short and a long form, the long form can be prefixed by one or two dashes. Note that the settings in your $HOME/.mikmodrc will override the defaults shown in this man page. .SH OUTPUT OPTIONS .IP "\fB\-d \fIn\fR" .IP "\fB\-\-driver \fIn\fR" Use the specified device driver for output, 0 is autodetect. The default is 0. If your installed libmikmod engine is recent enough (>=3.1.7), you can also specify the driver with an alias, as well as driver options separated by commas. The list and driver aliases and recognized options can be found in libmikmod's documentation. .IP "\fB\-o[utput] \fI8m\fR|\fI8s\fR|\fI16m\fR|\fI16s\fR" Output settings, 8 or 16 bit in stereo or mono. The default is "16s". .IP "\fB\-f \fIfreq\fR" .IP "\fB\-\-frequency \fIfreq\fR" Set mixing frequency in hertz. The default is 44100. .IP "\fB\-i\fR" .IP "\fB\-\-interpolate\fR" Use interpolated mixing. This will generally improve audio quality, at the expense of a bit more CPU usage. Note that this option alters the behaviour of software drivers only ; hardware drivers are not affected (default). .IP "\fB\-\-nointerpolate\fR" Do not use interpolated mixing. .IP "\fB\-hq\fR" .IP "\fB\-\-hqmixer\fR" Use high quality software mixer. This improves audio quality, but requires a lot more CPU power. Note that this option alters the behaviour of software drivers only ; hardware drivers are not affected. .IP "\fB\-\-nohqmixer" Do not use high quality software mixer (default). .IP "\fB\-s\fR" .IP "\fB\-\-surround\fR" Use surround mixing. .IP "\fB\-\-nosurround\fR" Do not use surround mixing (default). .IP "\fB\-r \fIn\fR" .IP "\fB\-\-reverb \fIn\fR" Sets reverb amount from 0 (no reverb) to 15 (max reverb). The default is 0 (no reverb). .SH PLAYBACK OPTIONS .IP "\fB\-v \fIvolume\fR" .IP "\fB\-\-volume \fIvolume\fR" Set volume from 0% (silence) to 100%. The default is 100%. .IP "\fB\-F\fR" .IP "\fB\-\-fadeout\fR" Fade out the volume during the last pattern of each module. .IP "\fB\-\-nofadeout\fR" Do not fade out the volume during the last pattern of each module (default). .IP "\fB\-l\fR" .IP "\fB\-\-loops\fR" Enable in-module backwards loops. .IP "\fB\-\-noloops\fR" Disable in-module backwards loops (default). .IP "\fB\-a\fR" .IP "\fB\-\-panning\fR" Process panning effects (default). This should be disabled (using \-\-nopanning) for very old demo modules which use the panning effects for synchronization purposes. .IP "\fB\-\-nopanning\fR" Do not process panning effects. .IP "\fB\-x\fR" .IP "\fB\-\-protracker\fR" Enable protracker extended speed effect (default). This should be disabled (using \-\-noprotracker) for very old demo modules which use the extended speed effect for synchronization purposes. .IP "\fB\-\-noprotracker\fR" Disable protracker extended speed effect. .SH LOADING OPTIONS .IP "\fB\-y \fIdir\fR" .IP "\fB\-\-directory \fIdir\fR" Scan directory recursively for modules. .IP "\fB\-c\fR" .IP "\fB\-\-curious\fR" Look for hidden patterns in module. Most modules don't have hidden patterns, but you can find "bonus" patterns (or just silence) in some modules. .IP "\fB\-\-nocurious\fR" Do not look for hidden patterns in module (default). .IP "\fB\-p \fIn\fR" .IP "\fB\-\-playmode \fIn\fR" Playlist mode. The allowed values here are 1, to loop the current module; 2, to play the whole playlist repeatedly; 4, to shuffle the list before playing, and 8, to play the whole list randomly. The default is 2. .IP "\fB\-t\fR" .IP "\fB\-\-tolerant\fR" Don't halt MikMod if a module cannot be read or is an unknown format (default). .IP "\fB\-\-notolerant\fR" Halt MikMod if a module cannot be read or is an unknown format. .SH SCHEDULING OPTIONS The following options need root privileges (or a setuid root binary), and don't work under all systems. .IP "\fB\-s\fR" .IP "\fB\-\-renice\fR" Renice to \-20 if possible to gain more CPU priority. This option is only available under FreeBSD, Linux, NetBSD, OpenBSD and OS/2. .IP "\fB\-\-norenice\fR" Do not renice to \-20 (default). .IP "\fB\-S\fR" .IP "\fB\-\-realtime\fR" Reschedule mikmod to gain real-time priority (and thus more CPU time). \fBDANGEROUS! USE WITH CAUTION!\fR This option is only available under FreeBSD, Linux and OS/2. .IP "\fB\-\-norealtime\fR" Do not reschedule MikMod to gain real\-time priority (default). .SH DISPLAY OPTIONS .IP "\fB\-q\fR" .IP "\fB\-\-quiet\fR" Quiet mode. Disables interactive commands and displays only errors. .SH INFORMATION OPTIONS .IP "\fB\-n\fR" .IP "\fB\-\-information\fR" Display the list of the known drivers and module loaders. .IP "\fB\-N \fIn\fR" .IP "\fB\-\-drvinfo \fIn\fR" Display information about a specific driver. .IP "\fB\-V\fR" .IP "\fB\-\-version\fR" Display MikMod version. .IP "\fB\-h\fR" .IP "\fB\-\-help\fR" Display a summary of the options. .SH CONFIGURATION OPTION .IP "\fB\-\-norc\fR" Do not parse the $HOME/.mikmodrc configuration file. This file contains your default settings, so that you don't have to specify them each time you run MikMod. The file is read when you run MikMod and updated on exit. Using this option prevents MikMod from accessing this file. .SH RUNTIME COMMANDS At play time, the following keystrokes offer control over MikMod: .IP "\fBH\fR, \fBfunction key F1\fR" Display help panel. .IP "\fBS\fR, \fBfunction key F2\fR" Display samples panel. .IP "\fBI\fR, \fBfunction key F3\fR" Display instruments panel (if present in the module). .IP "\fBM\fR, \fBfunction key F4\fR" Display song message panel (if present in the module). .IP "\fBL\fR, \fBfunction key F5\fR" Display the playlist panel. .IP "\fBC\fR, \fBfunction key F6\fR" Display the configuration panel. .IP "\fBV\fR, \fBfunction key F7\fR" Display the volume panel. .IP "\fBdigits\fR" Set volume from 10% (digit 1) to 100% (digit 0). .IP "\fB<\fR" Decrease volume. .IP "\fB>\fR" Increase volume. .IP "\fB\-\fR, \fBLeft\fR" Restart current pattern / skip to previous pattern. .IP "\fB+\fR, \fBRight\fR" Skip to next pattern in current module. .IP "\fBUp\fR, \fBDown\fR" Scroll panel. .IP "\fBPgUp\fR, \fBPgDown\fR" Scroll panel (faster). .IP "\fBHome\fR" Go on top of the panel. .IP "\fBEnd\fR" Go to the end of the panel. .IP "\fB(\fR" Decrease speed variable (module plays faster). .IP "\fB)\fR" Increase speed variable (module plays slower). .IP "\fB{\fR" Decrease tempo variable (module plays slower). .IP "\fB}\fR" Increase tempo variable (module plays faster). .IP "\fB:\fR or \fB;\fR" Toggle interpolation mixing. .IP "\fBU\fR" Toggle surround mixing. .IP "\fBQ\fR" Exit MikMod. .IP "\fBP\fR" Switch to previous module in playlist. .IP "\fBN\fR" Switch to next module in playlist. .IP "\fBR\fR" Restart current module. .IP "\fBF\fR" Toggle fake/real volume bars in volume panel. .IP "\fBspace\fR" Toggle pause. .IP "\fBControl-L\fR" Refresh the screen. .SH MENU BASICS Some functions of MikMod are available through menus, in the playlist and configuration panels. You can select commands in the menus either by moving the selection with the arrow keys and pressing enter, or entering the highlighted letter corresponding ot the command you want to select. Menu entries ending with a \fB>\fR character open a submenu, whereas entries ending in \fB...\fR open a dialog box. You can dismiss a submenu either by choosing a command in this menu, or using the left arrow key to go back, or switching panels. In dialog boxes, you can move the focus from the input line to the \fBOk\fR and \fBCancel\fR buttons either with the "tab" key, or the up and down arrow keys. Also, if the statusbar is active (which is the default behaviour), it will contain a short help text describing the menu option currently highlighted. .SH PLAYLIST MENU When the playlist panel is displayed, pressing the \fIreturn\fR key will popup a menu. The menu commands are: .IP "\fBPlay\fR" Continue list playback from the currently highlighted module. .IP "\fBRemove\fR" Remove module from the playlist. .IP "\fBDelete...\fR" Remove module from the playlist, and delete module file on disk, or whole archive if the module is stored in an archive file. This function asks you to confirm your choice. .IP "\fBFile >\fR" This entry opens a submenu with four commands, "\fBLoad\fR", "\fBInsert\fR", "\fBSave\fR" and "\fBSave as\fR". The \fBLoad\fR and \fBInsert\fR commands ask you for a filename, and replace the playlist with it (load) or merge it with the playlist (insert). No wildcards are allowed. The \fBSave\fR and \fBSave as\fR commands save the current playlist in a file, by default ``playlist.mpl'', in the current directory. Note that playlist filenames should end in \fB.mpl\fR, or they won't be recognized immediately as a playlist by MikMod. .IP "\fBShuffle\fR" Randomize the playlist. .IP "\fBSort >\fR" This entry opens a submenu with sort commands. You can select a normal or \fBreverse\fR order, and then sort the playlist with one of the four criteria: \fBby name\fR, \fBby extension\fR, \fBby path\fR or \fBby time\fR. .IP "\fBBack\fR" Discards the menu. .SH CONFIGURATION PANEL The configuration panel lets you customize your MikMod settings, and save them. You can also try some particular settings without losing your previous configuration. .IP "\fBOutput options\fR" This section lets you choose various vital playback settings, such as the output driver, the stereo/mono and 16/8 bit output settings, the playback frequency, and the software mixer settings. .IP "\fBPlayback options\fR" This section lets you choose various module playback settings, such as the output volume, the processing of panning effects and bacwards loops, etc. .IP "\fBOther options\fR" This section lets you choose the remaining settings, such as the playlist mode, and various program settings. .IP "\fBUse config\fR" This command activates the current configuration settings, but does not save them. .IP "\fBSave config\fR" This command saves and activates the current configuration settings. .IP "\fBRevert config\fR" This command reverts to the on-disk configuration file settings. .SH MODULE FORMATS MikMod will currently play the following common and not so common formats: .IP "\fB669\fR" Composer 669 and Extended 669 modules. .IP "\fBAMF\fR" DSMI internal module format (Advanced Module Format, converted with M2AMF). .IP "\fBAMF\fR" ASYLUM Music format (From crusader games) .IP "\fBDSM\fR" DSIK's internal module format. .IP "\fBFAR\fR" Farandole composer modules. .IP "\fBGDM\fR" General Digital Munsic internal module format (converted with 2GDM). .IP "\fBIMF\fR" Imago Orpheus modules. .IP "\fBIT\fR" Impulse Tracker modules. .IP "\fBMED\fR" Amiga MED modules, but synthsounds are not supported. .IP "\fBMOD\fR" Protracker, Startracker, Fasttracker, Oktalyzer, and Taketracker modules. .IP "\fBMTM\fR" Multitracker module editor modules. .IP "\fBS3M\fR" Screamtracker version 3 modules. .IP "\fBSTM\fR" Screamtracker version 2 modules. .IP "\fBSTX\fR" STMIK converted modules. .IP "\fBULT\fR" Ultratracker modules. .IP "\fBUNI\fR, \fBAPUN\fR" Old MikMod (UNI) and APlayer (APUN) internal module format. .IP "\fBXM\fR" Fasttracker 2 modules. .SH ARCHIVE FORMATS MikMod should recognize and extract the following common archive formats. However, to use each of these you will need to find the appropriate program(s) for MikMod to use to extract them. These are commonly available and you will most likely find them with this distribution of MikMod. Other archive formats can be configured by editing the configuration file (see \fBFILES\fR below). .IP "\fBzip\fR" Info-zip or PkZip archives, commonly used on DOS/Windows platforms. .IP "\fBlha\fR, \fBlzh\fR" Lharc archives, commonly used on the Amiga. .IP "\fBzoo\fR" Zoo archives, quite rare those days... .IP "\fBrar\fR" Rar archives. .IP "\fBgz\fR" Gzip compressed files. .IP "\fBbz2\fR" Bzip2 compressed files. .IP "\fBtar\fR, \fBtar.gz\fR and \fBtar.bz2\fR" Tar archives, even compressed with gzip or bzip2. .SH FILES .IP "$HOME/.mikmodrc (or mikmod.cfg under OS/2 / Windows)" User configuration settings. .IP "$HOME/.mikmod_playlist (mikmodpl.cfg/mikmod_playlist.mpl under OS/2 / Windows)" The default playlist, loaded if no other files are specified on the command line. .IP playlist.mpl Default playlist filename. .SH AUTHORS \fIMikMod\fP is the result of the work of many people, including: Jean-Paul Mikkers, Jake Stine, Miodrag Vallat, Frank Loemker, Andrew Zabolotny, Raphael Assenat, Steve McIntyre, Peter Amstutz, "MenTaLguY", Dimitri Boldyrev, Shlomi Fish, Stefan Tibus, Tinic Urou. A full list of people having worked on libmikmod and MikMod is displayed when MikMod starts. .SH LOCATING NEWER VERSIONS The official MikMod and libmikmod home page is at http://mikmod.sourceforge.net/ mikmod-3.2.9/src/mlistedit.h0000644000000000000000000000246010001643557014444 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mlistedit.h,v 1.1.1.1 2004/01/16 02:07:43 raph Exp $ The playlist editor ==============================================================================*/ #ifndef MLISTEDIT_H #define MLISTEDIT_H #include "mmenu.h" /* test if path is a directory and recursively scan if for modules */ int list_scan_dir (char *path, BOOL quiet); /* open playlist menu */ void list_open(int *actLine); #endif /* MLISTEDIT_H */ /* ex:set ts=4: */ mikmod-3.2.9/src/mdialog.h0000644000000000000000000000524312255111204014054 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mdialog.h,v 1.1.1.1 2004/01/16 02:07:40 raph Exp $ Some common dialog types ==============================================================================*/ #ifndef MDIALOG_H #define MDIALOG_H #include "mwidget.h" /* Function which is called on input w : dlg_input() : the input widgets dlg_message(): the button widget button: selected button (str- and int-fields selected -> button==-1) input : input in a int- or str-field data : user-pointer which was passed to dlg-function Return: close dialog? */ typedef BOOL (*handleDlgFunc) (WIDGET *w, int button, void *input, void *data); /* Opens a message box msg : text to display, can contain '\n' button: ".&..|...|...", &: hotkey, e.g.: "&Yes|&No" active: active button (0...n) warn : open message box with ATTR_WARNING? data : passed to handle_dlg */ void dlg_message_open(const char *msg, const char *button, int active, BOOL warn, handleDlgFunc handle_dlg, void *data); /* Shows a message. If errno is set a text describing the errno error code is appended to the message. */ void dlg_error_show(const char *txt, ...); /* Opens a string input dialog msg : text to display, can contain '\n' buttons: definition of the dialog buttons str : default text length : max allowed input length */ void dlg_input_str(const char *msg, const char *buttons, const char *str, int length, handleDlgFunc handle_dlg, void *data); /* Opens an integer input dialog msg : text to display, can contain '\n' buttons: definition of the dialog buttons value : default integer min,max: min, max allowed values */ void dlg_input_int(const char *msg, const char *buttons, int value, int min, int max, handleDlgFunc handle_dlg, void *data); #endif /* MDIALOG_H */ /* ex:set ts=4: */ mikmod-3.2.9/src/rcfile.h0000644000000000000000000000620012350755760013717 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: rcfile.h,v 1.1.1.1 2004/01/16 02:07:41 raph Exp $ General configuration file management ==============================================================================*/ #ifndef RCFILE_H #define RCFILE_H typedef struct { int id; const char *label; } LABEL_CONV; /* Write argument arg with optional description (multiple lines allowed) and mark it with label. Return: arg successfully written ? */ BOOL rc_write_bool (const char *label, int arg, const char *description); BOOL rc_write_bit (const char *label, int arg, int mask, const char *description); BOOL rc_write_int (const char *label, int arg, const char *description); BOOL rc_write_float (const char *label, float arg, const char *description); BOOL rc_write_label(const char *label, LABEL_CONV *convert, int arg, const char *description); BOOL rc_write_string (const char *label, const char *arg, const char *description); BOOL rc_write_struct (const char *label, const char *description); BOOL rc_write_struct_end (const char *description); /* Read 'value', which is saved in the config-file under label. Change 'value' only if label is present in config-file and associated value is valid. Return: value changed ? */ BOOL rc_read_bool (const char *label, BOOL *value); BOOL rc_read_bit (const char *label, int *value, int mask); BOOL rc_read_int (const char *label, int *value, int min, int max); BOOL rc_read_float (const char *label, float *value, float min, float max); BOOL rc_read_label(const char *label, int *value, LABEL_CONV *convert); BOOL rc_read_struct (const char *label); BOOL rc_read_struct_end (void); /* Free old *value and allocate min(strlen(newvalue),length)+1 bytes for new string. */ void rc_set_string (char **value, const char *arg, int length); /* Read a string. Free old *value and allocate min(strlen(newvalue),length)+1 bytes for new string. */ BOOL rc_read_string (const char *label, char **value, int length); /* open config-file 'name' and parse the file for following rc_read_...() */ BOOL rc_load (const char *name); /* open config-file 'name' for following rc_write_...() and write a header for program 'prg_name' */ BOOL rc_save (const char *name, const char *prg_name); /* close config-file opened by rc_load() or rc_save() */ void rc_close (void); #endif /* RCFILE_H */ mikmod-3.2.9/src/Makefile.am0000644000000000000000000000205113743515624014336 0ustar rootroot## Process this file with automake to produce Makefile.in AM_CFLAGS = @LIBMIKMOD_CFLAGS@ bin_PROGRAMS = mikmod man_MANS = mikmod.1 mikmod_SOURCES = \ display.c marchive.c mikmod.c mlist.c mconfig.c mwindow.c mmenu.c \ mwidget.c mdialog.c mconfedit.c mutilities.c mplayer.c mlistedit.c \ rcfile.c noinst_HEADERS = \ display.h keys.h marchive.h mconfedit.h mconfig.h mdialog.h mlist.h \ mlistedit.h mmenu.h mplayer.h mthreads.h mutilities.h mwidget.h \ mwindow.h player.h rcfile.h EXTRA_mikmod_SOURCES = \ mfnmatch.c getopt_long.c musleep.c EXTRA_DIST = CMakeLists.txt \ dosvideo.inc os2video.inc winvideo.inc mfnmatch.h getopt_long.h $(man_MANS) mikmod_LDFLAGS = @LIBMIKMOD_LDADD@ mikmod_LDADD = @EXTRA_OBJ@ @LIBMIKMOD_LIBS@ @PLAYER_LIB@ mikmod_DEPENDENCIES = @EXTRA_OBJ@ getopt_long.o: $(srcdir)/getopt_long.c $(srcdir)/getopt_long.h $(COMPILE) -o $@ -c $(srcdir)/getopt_long.c mfnmatch.o: $(srcdir)/mfnmatch.c $(srcdir)/mfnmatch.h $(COMPILE) -o $@ -c $(srcdir)/mfnmatch.c musleep.o: $(srcdir)/musleep.c $(COMPILE) -o $@ -c $(srcdir)/musleep.c mikmod-3.2.9/src/player.h0000644000000000000000000000752514125017542013751 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for (c) 2004, Raphael Assenat complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: player.h,v 1.3 2004/01/29 02:48:06 raph Exp $ Module player which uses the MikMod library as the player engine. ==============================================================================*/ #ifndef PLAYER_H #define PLAYER_H /*========== Messages */ #define playerversion "3.2.9" #define mikversion "-= MikMod " playerversion " =-" #define mikcopyr mikversion \ "\n(c) 2004 Raphael Assenat and others - see file AUTHORS for complete list" #define mikbanner mikcopyr "\n\n" \ " - MikMod authors and contributors are:\n" \ " Jean-Philippe Ajirent - Peter Amstutz - Raphael Assenat - Anders Bjoerklund\n"\ " Dimitri Boldyrev - Peter Breitling - Arne de Bruijn - Douglas Carmichael\n"\ " Chris Conn - Arnout Cosman - Shlomi Fish - Paul Fisher - Tobias Gloth\n" \ " Roine Gustaffson - Bjornar Henden - Simon Hosie - Stephan Kanthak\n" \ " Alexander Kerkhove - ``Kodiak'' - Mario Koeppen - Mike Leibow\n" \ " Andy Lo A Foe - Frank Loemker - Sylvain Marchand - Claudio Matsuoka\n" \ " Jeremy McDonald - Steve McIntyre - Brian McKinney - Samuel A Megens\n" \ " ``MenTaLguY'' - Jean-Paul Mikkers - Thomas Neumann - C Ray C - Alice Rowan\n"\ " Steffen Rusitschka - Ozkan Sezer - Jake Stine - Stefan Tibus - Tinic Urou\n"\ " Miodrag Vallat - Kev Vance - Lutz Vieweg - Vince Vu\n" \ " Valtteri Vuorikoski - Andrew Zabolotny\n" \ "\n" \ " - This program is free software covered by the GNU General Public License\n" \ " and comes with ABSOLUTELY NO WARRANTY.\n" \ "\nType 'mikmod -h' for command line options!\n" #define pausebanner \ "'||''|. | '||' '|' .|'''.| '||''''| '||''|. \n" \ " || || ||| || | ||.. ' || . || || \n" \ " ||...|' | || || | ''|||. ||''| || ||\n" \ " || .''''|. || | . '|| || || ||\n" \ ".||. .|. .||. '|..' |'....|' .||.....|.||...|' \n" #define extractbanner \ "'||''''| . . || \n" \ " || . ... ....||. ... .. .... .... .||. ... .. ... ... .\n" \ " ||''| '|..' || ||' '''' .|| .| '' || || || || || || \n" \ " || .|. || || .|' || || || || || || |'' \n" \ ".||.....|.| ||. '|.'.||. '|..'|' '|...' '|.'.||..||. ||.'||||.\n" \ " .|....'\n" #define loadbanner \ "'||' '|| || \n" \ " || ... .... .. || ... .. ... ... .\n" \ " || .| '|. '' .|| .' '|| || || || || || \n" \ " || || || .|' || |. || || || || |'' \n" \ ".||.....| '|..|' '|..'|' '|..'||. .||. .||. || .'||||.\n" \ " .|....'\n" /*========== Player control */ void Player_SetNextMod(int pos); #endif /* ex:set ts=4: */ mikmod-3.2.9/src/mdialog.c0000644000000000000000000001172214317363456014071 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mdialog.c,v 1.1.1.1 2004/01/16 02:07:40 raph Exp $ Some common dialog types ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "mwidget.h" #include "mdialog.h" #include "display.h" #include "mutilities.h" typedef struct { handleDlgFunc handle_dlg; WIDGET *w; void *input; void *data; int min, max; } DLG_DATA; static int handle_focus(struct WIDGET *w, int focus) { if (focus == FOCUS_ACTIVATE) { DLG_DATA *data = (DLG_DATA *) w->data; if (data) { int button = -1; if (w->type == TYPE_BUTTON) button = ((WID_BUTTON *) w)->active; if ((button <= 0) && (data->min >= 0) && (data->max >= 0)) { int value = atoi((char*)data->input); if ((value < data->min) || (value > data->max)) return focus; } if (data->handle_dlg(data->w, button, data->input, data->data)) { free(data); dialog_close(w->d); } } else dialog_close(w->d); return EVENT_HANDLED; } return focus; } static DLG_DATA *init_dlg_data(handleDlgFunc handle_dlg, WIDGET *w, void *input, void *data) { DLG_DATA *dlg_data = NULL; if (handle_dlg) { dlg_data = (DLG_DATA *) malloc(sizeof(DLG_DATA)); dlg_data->handle_dlg = handle_dlg; dlg_data->w = w; dlg_data->input = input; dlg_data->data = data; dlg_data->min = dlg_data->max = -1; } return dlg_data; } /* Opens a message box msg : text to display,can contain '\n' button: ".&..|...|...",&: hotkey,e.g.: "&Yes|&No" active: active button(0...n) warn : open message box with ATTR_WARNING? data : passed to handle_dlg */ void dlg_message_open(const char *msg, const char *button, int active, BOOL warn, handleDlgFunc handle_dlg, void *data) { WIDGET *w; DIALOG *d = dialog_new(); if (warn) dialog_set_attr (d,ATTR_WARNING); wid_label_add(d, 1, msg); w = wid_button_add(d, 2, button, active); if (handle_dlg) wid_set_func(w, NULL, handle_focus, init_dlg_data(handle_dlg, w, NULL, data)); dialog_open(d, "Message"); } /* Shows a message. If errno is set a text describing the errno error code is appended to the message. */ void dlg_error_show(const char *txt, ...) { va_list args; char *err = NULL; int len; if (errno) { err = strerror(errno); } va_start(args, txt); VSNPRINTF (storage, STORAGELEN, txt, args); va_end(args); len = strlen(storage); if (leninput, data); wid_set_func(str_wid, NULL, handle_focus, dlg_data); wid_set_func(w, NULL, handle_focus, dlg_data); dialog_open(d, "Enter string"); } /* Opens an integer input dialog msg : text to display,can contain '\n' value : default integer min,max: min,max allowed values */ void dlg_input_int(const char *msg, const char *buttons, int value, int min, int max, handleDlgFunc handle_dlg, void *data) { char title[40]; WIDGET *w, *int_wid; DLG_DATA *dlg_data; DIALOG *d = dialog_new(); if (msg) wid_label_add(d, 1, msg); sprintf(title, "%d", max); int_wid = wid_int_add(d, 1, value, strlen(title)); w = wid_button_add(d, 2, buttons, 0); dlg_data = init_dlg_data(handle_dlg, int_wid, ((WID_INT*)int_wid)->input, data); dlg_data->min = min; dlg_data->max = max; wid_set_func(int_wid, NULL, handle_focus, dlg_data); wid_set_func(w, NULL, handle_focus, dlg_data); sprintf(title, "Enter value(%d - %d)", min, max); dialog_open(d, title); } /* ex:set ts=4: */ mikmod-3.2.9/src/mlist.h0000644000000000000000000000565712255111204013601 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mlist.h,v 1.1.1.1 2004/01/16 02:07:37 raph Exp $ Playlist management functions ==============================================================================*/ #ifndef MLIST_H #define MLIST_H #include /* for BOOL and CHAR */ #define PL_CONT_NEXT (1) #define PL_CONT_PREV (2) #define PL_CONT_POS (3) #define PM_MODULE (1) /* Module repeatly */ #define PM_MULTI (2) /* PlayList repeatly */ #define PM_SHUFFLE (4) /* shuffle PlayList */ #define PM_RANDOM (8) /* PlayList in random order */ #define PL_IDENT "MikMod playlist\n" typedef struct { CHAR *file; CHAR *archive; int time; BOOL played; } PLAYENTRY; typedef struct { PLAYENTRY *entry; int length; int current; BOOL curr_deleted; int add_pos; } PLAYLIST; extern PLAYLIST playlist; BOOL PL_isPlaylistFilename(const CHAR *filename); void PL_InitList(PLAYLIST * pl); void PL_InitCurrent(PLAYLIST * pl); void PL_ClearList(PLAYLIST * pl); BOOL PL_CurrentDeleted(PLAYLIST * pl); int PL_GetCurrentPos(PLAYLIST * pl); PLAYENTRY *PL_GetCurrent(PLAYLIST * pl); PLAYENTRY *PL_GetEntry(PLAYLIST * pl, int number); int PL_GetLength(PLAYLIST * pl); void PL_SetTimeCurrent(PLAYLIST * pl, long sngtime); void PL_SetPlayedCurrent(PLAYLIST * pl); BOOL PL_DelEntry(PLAYLIST * pl, int number); BOOL PL_DelDouble(PLAYLIST * pl); void PL_Add(PLAYLIST * pl, const CHAR *file, const CHAR *arc, int time, BOOL played); void PL_StartInsert(PLAYLIST * pl, int pos); void PL_StopInsert(PLAYLIST * pl); BOOL PL_Load(PLAYLIST * pl, const CHAR *filename); BOOL PL_Save(PLAYLIST * pl, const CHAR *filename); char *PL_GetFilename(void); BOOL PL_LoadDefault(PLAYLIST * pl); BOOL PL_SaveDefault(PLAYLIST * pl); /* Get new playlist entry and change current accordingly */ BOOL PL_ContNext(PLAYLIST * pl, CHAR **retfile, CHAR **retarc, int mode); BOOL PL_ContPrev(PLAYLIST * pl, CHAR **retfile, CHAR **retarc); BOOL PL_ContPos(PLAYLIST * pl, CHAR **retfile, CHAR **retarc, int number); void PL_Sort(PLAYLIST * pl, int (*compar) (PLAYENTRY * small, PLAYENTRY * big)); void PL_Randomize(PLAYLIST * pl); #endif /* ex:set ts=4: */ mikmod-3.2.9/src/musleep.c0000644000000000000000000000435114316423106014113 0ustar rootroot/* * NAME: * usleep -- This is the precision timer for Test Set * Automation. It uses the select(2) system * call to delay for the desired number of * micro-seconds. This call returns ZERO * (which is usually ignored) on successful * completion, -1 otherwise. * * ALGORITHM: * 1) We range check the passed in microseconds and log a * warning message if appropriate. We then return without * delay, flagging an error. * 2) Load the Seconds and micro-seconds portion of the * interval timer structure. * 3) Call select(2) with no file descriptors set, just the * timer, this results in either delaying the proper * ammount of time or being interupted early by a signal. * * HISTORY: * Added when the need for a subsecond timer was evident. * Modified for Solaris-specific bits by SAM 24/10/96 * AUTHOR: * Michael J. Dyer Telephone: AT&T 414.647.4044 * General Electric Medical Systems GE DialComm 8 *767.4044 * P.O. Box 414 Mail Stop 12-27 Sect'y AT&T 414.647.4584 * Milwaukee, Wisconsin USA 53201 8 *767.4584 * internet: mike@sherlock.med.ge.com GEMS WIZARD e-mail: DYER */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #ifdef HAVE_SYS_TIME_H #include #endif #include #include #include /* perror() */ int usleep_new(unsigned long microSeconds) { unsigned int Seconds, uSec; fd_set readfds, writefds, exceptfds; int nfds; struct timeval Timer; nfds = 0; FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); if (microSeconds == 0UL || microSeconds > 4000000UL) { errno = ERANGE; /* value out of range */ perror("usleep time out of range (0 -> 4000000)"); return -1; } Seconds = microSeconds / (unsigned long)1000000; uSec = microSeconds % (unsigned long)1000000; Timer.tv_sec = Seconds; Timer.tv_usec = uSec; if (select(nfds, &readfds, &writefds, &exceptfds, &Timer) < 0) { perror("usleep (select) failed"); return -1; } return 0; } mikmod-3.2.9/src/mwindow.c0000644000000000000000000005736014362342042014135 0ustar rootroot/* MikMod module player (c) 1998 - 2000 Miodrag Vallat and others - see file AUTHORS for complete list. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*============================================================================== $Id: mwindow.c,v 1.1.1.1 2004/01/16 02:07:36 raph Exp $ Some window functions ==============================================================================*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) #ifdef HAVE_SYS_IOCTL_H #include #endif #if !defined(GWINSZ_IN_SYS_IOCTL) && defined(HAVE_TERMIOS_H) #include #endif #endif #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) #if defined(__OS2__)||defined(__EMX__) #define INCL_VIO #define INCL_DOS #define INCL_KBD #define INCL_DOSPROCESS #endif #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include "display.h" #include "player.h" #include "mwindow.h" #include "mutilities.h" #include "keys.h" #include "mthreads.h" #define INVISIBLE(w) (win_quiet || ((w)!=cur_window && (w)!=panel[0])) #define INVISIBLE_RET(w) if (win_quiet || ((w)!=cur_window && (w)!=panel[0])) return; #ifdef ACS_ULCORNER #define BOX_UL ACS_ULCORNER #define BOX_UR ACS_URCORNER #define BOX_LL ACS_LLCORNER #define BOX_LR ACS_LRCORNER #define BOX_HLINE ACS_HLINE #define BOX_VLINE ACS_VLINE #else #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) #define BOX_UL '\xda' #define BOX_UR '\xbf' #define BOX_LL '\xc0' #define BOX_LR '\xd9' #define BOX_HLINE '\xc4' #define BOX_VLINE '\xb3' #else #define BOX_UL '+' #define BOX_UR '+' #define BOX_LL '+' #define BOX_LR '+' #define BOX_HLINE '-' #define BOX_VLINE '|' #endif #endif void win_do_resize(int dx, int dy, BOOL root); /* text creation buffer */ char storage[STORAGELEN+2]; static int root_y1 = 7, root_y2 = 0; /* size of visible root window partions */ static BOOL curses_on = 0, win_quiet = 1; static int cur_panel = 0, old_panel = 0; static MWINDOW *panel[DISPLAY_COUNT], *cur_window = NULL; static BOOL use_colors = 1; static int act_color = A_NORMAL; static THEME *theme = NULL; static int winx = 0, winy = 0; /* screen size */ typedef struct TIMEOUT { WinTimeoutFunc func; void *data; int interval; /* remaining time for the execution of this timeout compared to the timeout located in the timeouts array before this one */ int remaining; } TIMEOUT; static int cnt_timeouts = 0; static TIMEOUT *timeouts = NULL; /*========== Display routines */ #if defined(__OS2__)||defined(__EMX__) #include "os2video.inc" #elif defined(__DJGPP__) #include "dosvideo.inc" #elif defined(_WIN32) #include "winvideo.inc" #else /* unix, ncurses */ static int cursor_old = 0; static BOOL resize = 0; /* old AIX curses are very limited */ #if defined(MIKMOD_AIX) && !defined(mvaddnstr) void mvaddnstr(int y, int x, const char *str, int len) { char buffer[STORAGELEN]; int l = strlen(str); strncpy(buffer, str, len); if (l < len) while (l < len) buffer[l++] = ' '; buffer[len] = '\0'; mvaddstr(y, x, buffer); } #endif /* HP-UX curses macros don't work with every cpp */ #if defined(__hpux) void getmaxyx_hpux(MWINDOW * win, int *y, int *x) { *y = __getmaxy(win); *x = __getmaxx(win); } #define getmaxyx(win,y,x) getmaxyx_hpux((win),&(y),&(x)) #endif #if defined(MIKMOD_AIX) && !defined(NCURSES_VERSION) && !defined(getmaxyx) #define getmaxyx(win,y,x) (y = LINES, x = COLS) #endif #if !defined(getmaxyx) #define getmaxyx(w,y,x) ((y) = getmaxy(w), (x) = getmaxx(w)) #endif /* handler for terminal resize events */ void sigwinch_handler(int signum) { /* schedule a resizeterm() */ resize = 1; signal(SIGWINCH, sigwinch_handler); } /* update window */ void win_refresh(void) { if (win_quiet) return; refresh(); } void win_cursor_set(BOOL visible) { if (cursor_old != MIK_CURSES_ERROR) { if (visible) curs_set(cursor_old); else curs_set(0); } } #define COLOR_CNT 8 static void init_curses(void) { initscr(); cbreak(); noecho(); nonl(); nodelay(stdscr, TRUE); #if !defined(MIKMOD_AIX) || defined(NCURSES_VERSION) timeout(0); #endif keypad(stdscr, TRUE); cursor_old = curs_set(0); curses_on = 1; /* Color setup */ start_color(); if (has_colors() && (COLOR_PAIRS >= COLOR_CNT*COLOR_CNT)) { static short colors[] = { COLOR_BLACK, COLOR_BLUE, COLOR_GREEN, COLOR_CYAN, COLOR_RED, COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE }; int i,j; for (i = 0; i < COLOR_CNT; i++) for (j = 0; j < COLOR_CNT; j++) if (i*COLOR_CNT+j+1 < COLOR_CNT*COLOR_CNT) init_pair(i*COLOR_CNT+j+1, colors[j], colors[i]); use_colors = 1; } else use_colors = 0; } static int color_to_pair (int attrs) { return 1 + ((attrs & COLOR_FMASK) >> COLOR_FSHIFT) + ((attrs & COLOR_BMASK) >> COLOR_BSHIFT) * COLOR_CNT; } /* system dependant window init function */ void win_init_system(void) { if (!win_quiet) { init_curses(); getmaxyx(stdscr, winy, winx); signal(SIGWINCH, sigwinch_handler); } } /* clean up (e.g. exit curses) */ void win_exit(void) { if (win_quiet || !curses_on) return; signal(SIGWINCH, SIG_DFL); clear(); mvaddnstr(winy - 2, 0, mikversion, winx); win_refresh(); win_cursor_set(1); endwin(); curses_on = 0; } /* clear to end of line on window win */ void win_clrtoeol(MWINDOW *win, int x, int y) { int len = win->width - x; INVISIBLE_RET(win); if (len > 0) { memset(storage, ' ', len); storage[len] = '\0'; mvaddnstr(win->y + y, win->x + x, storage, len); } } /* check if a resize was scheduled and do it */ BOOL win_check_resize(void) { static BOOL in_check_resize = 0; if (win_quiet || in_check_resize) return 0; in_check_resize = 1; /* if a resize was scheduled, do it now */ if (resize) { int oldx, oldy; #if (NCURSES_VERSION_MAJOR >= 4) && defined(TIOCGWINSZ) && defined(HAVE_NCURSES_RESIZETERM) struct winsize ws; ws.ws_col = ws.ws_row = 0; ioctl(0, TIOCGWINSZ, &ws); if (ws.ws_col && ws.ws_row) resizeterm(ws.ws_row, ws.ws_col); #else endwin(); init_curses(); win_refresh(); #endif resize = 0; oldx = winx; oldy = winy; getmaxyx(stdscr, winy, winx); win_do_resize(winx - oldx, winy - oldy, 1); in_check_resize = 0; return 1; } in_check_resize = 0; return 0; } static int win_getch(void) { int c = getch(); win_check_resize(); /* if (c>0) fprintf (stderr," %d ",c);*/ return c == MIK_CURSES_ERROR ? 0 : c; } #endif /* #ifdef unix */ /*========== Windowing system */ /* init window functions (e.g. init curses) */ void win_init(BOOL quiet) { win_quiet = quiet; win_init_system(); win_open(0, 0, winx, winy, 0, NULL, ATTR_SONG_STATUS); win_set_resize(1, NULL); } /* Does the terminal support colors? */ BOOL win_has_colors (void) { return use_colors; } /* set the attribute translation table */ void win_set_theme (THEME *new_theme) { theme = new_theme; } /* clear window win */ BOOL win_clear(MWINDOW * win) { if (INVISIBLE(win)) return 1; if ((win->width > 0) && (win->height > 0)) { int i; win_attrset(win->attrs); memset(storage, ' ', win->width); storage[win->width] = '\0'; if (win==panel[0]) { for (i = 0; i < win->height && i < root_y1; i++) mvaddnstr(win->y + i, win->x, storage, win->width); i = win->height - root_y2; if (i < 0) i = 0; for (; i < win->height; i++) mvaddnstr(win->y + i, win->x, storage, win->width); } else { for (i = 0; i < win->height; i++) mvaddnstr(win->y + i, win->x, storage, win->width); } } return 1; } void win_box_win(int x1, int y1, int x2, int y2, const char *title) { int i, sx1, sx2, sy1, sy2; if (win_quiet) return; sx1 = x1 >= 0 ? x1 + 1 : 0; sx2 = x2 < winx ? x2 - 1 : winx - 1; sy1 = y1 >= root_y1 ? y1 + 1 : root_y1; sy2 = y2 < winy - root_y2 ? y2 - 1 : winy - root_y2; if (y2 < winy - root_y2) { if (x1 >= 0) mvaddch(y2, x1, BOX_LL); if (x2 < winx) mvaddch(y2, x2, BOX_LR); for (i = sx1; i <= sx2; i++) mvaddch(y2, i, BOX_HLINE); } if (y1 >= root_y1) { if (x1 >= 0) mvaddch(y1, x1, BOX_UL); if (x2 < winx) mvaddch(y1, x2, BOX_UR); i = sx1; if (title) for (; i <= sx2 && *title; i++) mvaddch(y1, i, *title++); for (; i <= sx2; i++) mvaddch(y1, i, BOX_HLINE); } for (i = sy1; i <= sy2; i++) { if (x1 >= 0) mvaddch(i, x1, BOX_VLINE); if (x2 < winx) mvaddch(i, x2, BOX_VLINE); } } /* open new window on panel 'panel' */ MWINDOW *win_panel_open(int dst_panel, int x, int y, int width, int height, BOOL border, const char *title, ATTRS attrs) { MWINDOW *win = (MWINDOW *) malloc(sizeof(MWINDOW)), *help; int ofs = (border ? 1 : 0); if (x < ofs) x = ofs; if (!dst_panel) { /* root panel */ if (y < ofs) y = ofs; if (y + height > winy - ofs) height = winy - y - ofs; } else { if (y < ofs + root_y1) y = ofs + root_y1; if (y + height > winy - ofs - root_y2) height = winy - y - ofs - root_y2; } if (x + width > winx - ofs) width = winx - x - ofs; if (width < 0) width = 0; if (height < 0) height = 0; win_attrset(attrs); if (border && (dst_panel == cur_panel)) win_box_win(x - 1, y - 1, x + width, y + height, title); win->x = x; win->y = y; win->width = width; win->height = height; win->attrs = attrs; win->border = border; win->resize = 0; if (title) win->title = strdup(title); else win->title = NULL; win->next = NULL; win->repaint = win_clear; win->handle_key = NULL; win->handle_resize = NULL; for (help = panel[dst_panel]; help && help->next; help = help->next); if (help) help->next = win; else panel[dst_panel] = win; if (dst_panel == cur_panel) cur_window = win; return win; } /* open new window on current panel */ MWINDOW *win_open(int x, int y, int width, int height, BOOL border, const char *title, ATTRS attrs) { return win_panel_open(cur_panel, x, y, width, height, border, title, attrs); } MWINDOW *win_get_first(int dst_panel) { MWINDOW *win; for (win = panel[dst_panel]; win && win->next; win = win->next); return win; } /* set function which sould be called on a repaint request */ void win_set_repaint(WinRepaintFunc func) { cur_window->repaint = func; } void win_panel_set_repaint(int _panel, WinRepaintFunc func) { win_get_first(_panel)->repaint = func; } /* set function which sould be called on a key press */ void win_set_handle_key(WinKeyFunc func) { cur_window->handle_key = func; } void win_panel_set_handle_key(int _panel, WinKeyFunc func) { win_get_first(_panel)->handle_key = func; } /* should window be automatically resized? should a function be called on resize? */ void win_set_resize(BOOL auto_resize, WinResizeFunc func) { cur_window->resize = auto_resize; cur_window->handle_resize = func; } void win_panel_set_resize(int _panel, BOOL auto_resize, WinResizeFunc func) { MWINDOW *win = win_get_first(_panel); win->resize = auto_resize; win->handle_resize = func; } /* set private data */ void win_set_data(void *data) { cur_window->data = data; } void win_panel_set_data(int _panel, void *data) { win_get_first(_panel)->data = data; } void win_do_resize(int dx, int dy, BOOL root) { MWINDOW *win; int i = root ? 0 : 1; if (win_quiet) return; for (; i < DISPLAY_COUNT; i++) for (win = panel[i]; win; win = win->next) { if (win->resize) { win->width += dx; win->height += dy; } if (win->handle_resize) win->handle_resize(win, dx, dy); } win_panel_repaint_force(); } static char status_message[MAXWIDTH + 2]; static void win_status_repaint(void) { MWINDOW *win = panel[0]; int i; if (win_quiet) return; if ((root_y2 > 1) && (win->height > root_y1+1)) { win_attrset(ATTR_STATUS_LINE); for (i = 0; i < win->width; i++) mvaddch(win->height - 2, i, BOX_HLINE); } } /* init the status line(height=0,1,2 0: no status line) */ void win_init_status(int height) { int old_y2 = root_y2; if (height != root_y2) { root_y2 = height < 0 ? 0 : (height > 2 ? 2 : height); #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) status_message[0] = '\0'; #else status_message[0] = '\n'; status_message[1] = '\0'; #endif win_do_resize(0, old_y2 - root_y2, 0); } } /* set the status line */ void win_status(const char *msg) { MWINDOW *win = panel[0]; if (msg) { SNPRINTF(status_message, MAXWIDTH, "%s", msg); } if (win_quiet) return; if ((root_y2 > 0) && (win->height > root_y1) && (win->width>0)) { win_attrset(ATTR_STATUS_TEXT); mvaddnstr(win->y + win->height - 1, win->x, status_message, win->width); win_clrtoeol(win, win->x + strlen(status_message), win->y + win->height - 1); } } /* repaint the whole panel */ void win_panel_repaint(void) { if (win_quiet) return; if (panel[cur_panel]) win_clear(panel[cur_panel]); if (panel[0]->repaint) if (!panel[0]->repaint(panel[0])) return; for (cur_window = panel[cur_panel]; cur_window; cur_window = cur_window->next) { win_attrset(cur_window->attrs); if (cur_window->border && cur_window->width >= 0 && cur_window->height >= 0) win_box_win(cur_window->x - 1, cur_window->y - 1, cur_window->x + cur_window->width, cur_window->y + cur_window->height, cur_window->title); if (cur_window->repaint && cur_window->width > 0 && cur_window->height > 0) if (!cur_window->repaint(cur_window)) return; } win_status_repaint(); win_status(NULL); for (cur_window = panel[cur_panel]; cur_window && cur_window->next; cur_window = cur_window->next); } /* repaint the whole panel, clear whole panel before */ void win_panel_repaint_force(void) { if (win_quiet) return; clear(); win_panel_repaint(); } /* close window win */ void win_close(MWINDOW * win) { int i; MWINDOW *pos; for (i = 0; i < DISPLAY_COUNT; i++) for (pos = panel[i]; pos; pos = pos->next) if (pos == win) { if (win == cur_window) for (cur_window = panel[i]; cur_window->next != win; cur_window = cur_window->next); for (pos = panel[i]; pos->next != win; pos = pos->next); pos->next = win->next; if (win->title) free(win->title); free(win); if (i == cur_panel) win_panel_repaint(); return; } } /* get size of window win */ void win_get_size(MWINDOW *win, int *x, int *y) { *x = win->width; *y = win->height; } /* get maximal size of a new window without a border and therefore the needed minimal y position */ void win_get_size_max(int *y, int *width, int *height) { *y = root_y1; *width = panel[0]->width; *height = panel[0]->height - root_y1 - root_y2; if (*height < 0) *height = 0; } /* get uppermost window */ MWINDOW *win_get_window(void) { return cur_window; } /* get root window */ MWINDOW *win_get_window_root(void) { return panel[0]; } /* print string in window win */ void win_print(MWINDOW *win, int x, int y, const char *str) { int len = strlen(str); #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) if (len > 1 && str[len - 1] == '\n' && str[len - 2] == '\r') len--; #endif INVISIBLE_RET(win); if ((x >= win->width) || (y >= win->height) || ((win != panel[0]) && (y + win->y >= winy - root_y2)) || (!len)) return; if (len + x > win->width) len = win->width - x; if (len > 0 && (str[len - 1] == '\n' || str[len - 1] == '\r')) #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) if (win->x + win->width < winx) #endif { len--; win_clrtoeol(win, x + len, y); } mvaddnstr(y + win->y, x + win->x, str, len); } /* draw horizontal/verticall line */ void win_line(MWINDOW *win, int x1, int y1, int x2, int y2) { int i; INVISIBLE_RET(win); if (y1 == y2) { if (y1 < cur_window->height) for (i = x1; i <= x2 && i < cur_window->width; i++) mvaddch(y1 + cur_window->y, i + cur_window->x, BOX_HLINE); } else { if (x1 < cur_window->width) for (i = y1; i <= y2 && i < cur_window->height; i++) mvaddch(i + cur_window->y, x1 + cur_window->x, BOX_VLINE); } } /* draw a box with colored background back: background colors from UL UR LR LL to UL */ void win_box_color(MWINDOW *win, int x1, int y1, int x2, int y2, ATTRS *back) { int i, j, k, sx1, sx2, sy1, sy2, maxx, maxy; INVISIBLE_RET(win); x1 += win->x; x2 += win->x; y1 += win->y; y2 += win->y; maxx = win->x+win->width-1; maxy = win->y+win->height-1; sx1 = x1>=win->x ? x1+1 : win->x; sy1 = y1>=win->y ? y1+1 : win->y; sx2 = x2<=maxx ? x2 - 1 : maxx; sy2 = y2<=maxy ? y2 - 1 : maxy; if (y2 <= maxy) { if (x1 >= win->x) { if (back) win_set_background (back[x2-x1+x2-x1+y2-y1]); mvaddch(y2, x1, BOX_LL); } if (x2 <= maxx) { if (back) win_set_background (back[x2-x1+y2-y1]); mvaddch(y2, x2, BOX_LR); } j = x2-x1+x2-sx1+y2-y1; for (i = sx1; i <= sx2; i++) { if (back) win_set_background (back[j--]); mvaddch(y2, i, BOX_HLINE); } } if (y1 >= win->y) { if (x1 >= win->x) { if (back) win_set_background (back[0]); mvaddch(y1, x1, BOX_UL); } if (x2 <= maxx) { if (back) win_set_background (back[x2-x1]); mvaddch(y1, x2, BOX_UR); } j = sx1-x1; for (i=sx1; i <= sx2; i++) { if (back) win_set_background (back[j++]); mvaddch(y1, i, BOX_HLINE); } } j = x2-x1+sy1-y1; k = x2-x1+x2-x1+y2-y1+y2-sy1; for (i = sy1; i <= sy2; i++) { if (x1 >= win->x) { if (back) win_set_background (back[k--]); mvaddch(i, x1, BOX_VLINE); } if (x2 <= maxx) { if (back) win_set_background (back[j++]); mvaddch(i, x2, BOX_VLINE); } } } /* draw a box */ void win_box(MWINDOW *win, int x1, int y1, int x2, int y2) { win_box_color (win, x1, y1, x2, y2, NULL); } /* set attribute for the following output operations, "attrs" is an index into the theme->attr translation table */ void win_attrset(ATTRS attrs) { if (theme && !win_quiet) { int theme_attr = theme->attrs[attrs]; act_color = theme_attr; #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) if (theme->color) { int pair; if (theme_attr == ((COLOR_CNT-1) << COLOR_BSHIFT) + ((COLOR_CNT-1) << COLOR_FSHIFT)) theme_attr = ((COLOR_CNT-1) << COLOR_BSHIFT) + ((COLOR_CNT-2) << COLOR_FSHIFT); act_color = theme_attr; pair = COLOR_PAIR(color_to_pair(theme_attr)); if (theme_attr & COLOR_BOLDMASK) attrset(pair | A_BOLD); else attrset(pair); } else #endif attrset(theme_attr); } } ATTRS win_get_theme_color (ATTRS attrs) { if (theme) { int theme_attr = theme->attrs[attrs]; #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) if (theme->color) if (theme_attr == ((COLOR_CNT-1) << COLOR_BSHIFT) + ((COLOR_CNT-1) << COLOR_FSHIFT)) theme_attr = ((COLOR_CNT-1) << COLOR_BSHIFT) + ((COLOR_CNT-2) << COLOR_FSHIFT); #endif return theme_attr; } else return 0; } /* set color for the following output operations */ void win_set_color(ATTRS attrs) { if (win_quiet) return; act_color = attrs; #if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__DJGPP__)&&!defined(_WIN32) if (win_has_colors()) { int pair; if (attrs == ((COLOR_CNT-1) << COLOR_BSHIFT) + ((COLOR_CNT-1) << COLOR_FSHIFT)) attrs = ((COLOR_CNT-1) << COLOR_BSHIFT) + ((COLOR_CNT-2) << COLOR_FSHIFT); act_color = attrs; pair = COLOR_PAIR(color_to_pair(attrs)); if (attrs & COLOR_BOLDMASK) attrset(pair | A_BOLD); else attrset(pair); } else #endif attrset(attrs); } void win_set_forground(ATTRS fg) { if (win_has_colors()) win_set_color ((act_color & COLOR_BMASK) + (fg << COLOR_FSHIFT)); } void win_set_background(ATTRS bg) { if (win_has_colors()) win_set_color ((act_color & COLOR_FMASK) + (bg << COLOR_BSHIFT)); } /* change current panel */ void win_change_panel(int new_panel) { if (new_panel == cur_panel) new_panel = old_panel; old_panel = cur_panel; if (new_panel != cur_panel) { cur_panel = new_panel; for (cur_window = panel[cur_panel]; cur_window && cur_window->next; cur_window = cur_window->next); win_panel_repaint(); } } int win_get_panel(void) { return cur_panel; } /* handle key press(panel change and call of key handler of uppermost window),return: was key handled */ BOOL win_handle_key(int ch) { int ret; switch (ch) { case KEY_F(1): win_change_panel(DISPLAY_HELP); break; case KEY_F(2): win_change_panel(DISPLAY_SAMPLE); break; case KEY_F(3): win_change_panel(DISPLAY_INST); break; case KEY_F(4): #if defined(__OS2__)||defined(__EMX__)||defined(__DJGPP__)||defined(_WIN32) case KEY_SF(9): /* shift-F9 */ #else case KEY_F(19): /* shift-F9 on some curses implementations */ #endif win_change_panel(DISPLAY_MESSAGE); break; case KEY_F(5): win_change_panel(DISPLAY_LIST); break; case KEY_F(6): win_change_panel(DISPLAY_CONFIG); break; #if LIBMIKMOD_VERSION >= 0x030200 case KEY_F(7): win_change_panel(DISPLAY_VOLBARS); break; #endif default: ret = 0; if (cur_window->handle_key) ret = cur_window->handle_key(cur_window, ch); if (!ret && panel[0]->handle_key) ret = panel[0]->handle_key(panel[0], ch); return ret; } return 1; } /* Insert src (src!=NULL) or timeouts[0] (src==NULL) sorted after next execution in timeouts and set remaining appropriate. Expand timeouts array if src!=NULL. */ static void win_timeout_insert (TIMEOUT *src) { int time; int sum = 0, oldsum = 0, pos = 0, i; if (!src) { time = timeouts[0].interval; pos++; } else time = src->interval; for (; pos<=cnt_timeouts; pos++) { oldsum = sum; if (postime || pos==cnt_timeouts) { if (src) { timeouts = (TIMEOUT *) realloc (timeouts, sizeof(TIMEOUT)*(++cnt_timeouts)); for (i=cnt_timeouts-1; i>pos; i--) timeouts[i] = timeouts[i-1]; timeouts[pos] = *src; } else { TIMEOUT help = timeouts[0]; pos--; for (i=0; ihelp and malloc new entry */ void set_help(MENTRY * entry, const char *str, ...); /* open config editor */ void config_open(void); #endif /* MCONFEDIT_H */ /* ex:set ts=4: */ mikmod-3.2.9/mikmodrc0000644000000000000000000002165714037505106013247 0ustar rootroot# # -= MikMod 3.2.9 =- # configuration file # # DRIVER = , nth driver for output, default: 0 DRIVER = 0 # DRV_OPTIONS = "options", the driver options, e.g. "buffer=14,count=16" # for the OSS-driver DRV_OPTIONS = "" # STEREO = Yes|No, stereo or mono output, default: stereo STEREO = yes # 16BIT = Yes|No, 8 or 16 bit output, default: 16 bit 16BIT = yes # FREQUENCY = , mixing frequency, default: 44100 Hz FREQUENCY = 44100 # INTERPOLATE = Yes|No, use interpolate mixing, default: Yes INTERPOLATE = yes # HQMIXER = Yes|No, use high-quality (but slow) software mixer, default: No HQMIXER = no # SURROUND = Yes|No, use surround mixing, default: No SURROUND = no # REVERB = , set reverb amount (0-15), default: 0 (none) REVERB = 0 # VOLUME = , volume from 0 (silence) to 100, default: 100 VOLUME = 100 # VOLRESTRICT = Yes|No, restrict volume of player to volume supplied by user, # default: No VOLRESTRICT = no # FADEOUT = Yes|No, volume fade at the end of the module, default: No FADEOUT = no # LOOP = Yes|No, enable in-module loops, default: No LOOP = no # PANNING = Yes|No, process panning effects, default: Yes PANNING = yes # EXTSPD = Yes|No, process Protracker extended speed effect, default: Yes EXTSPD = yes # PM_MODULE = Yes|No, Module repeats, default: No PM_MODULE = no # PM_MULTI = Yes|No, PlayList repeats, default: Yes PM_MULTI = yes # PM_SHUFFLE = Yes|No, Shuffle list at start and if all entries are played, # default: No PM_SHUFFLE = no # PM_RANDOM = Yes|No, PlayList in random order, default: No PM_RANDOM = no # CURIOUS = Yes|No, look for hidden patterns in module, default: No CURIOUS = no # TOLERANT = Yes|No, don't halt on file access errors, default: Yes TOLERANT = yes # RENICE = RENICE_NONE (change nothing), RENICE_PRI (Renice to -20) or # RENICE_REAL (get realtime priority), default: RENICE_NONE # Note that RENICE_PRI is only available under FreeBSD, Linux, NetBSD, # OpenBSD and OS/2, and RENICE_REAL is only available under FreeBSD, Linux # and OS/2. RENICE = RENICE_NONE # STATUSBAR = , size of statusbar from 0 to 2, default: 2 STATUSBAR = 2 # SAVECONFIG = Yes|No, save configuration on exit, default: Yes SAVECONFIG = yes # SAVEPLAYLIST = Yes|No, save playlist on exit, default: Yes SAVEPLAYLIST = yes # PL_NAME = "name", name under which the playlist will be saved # by selecting 'Save' in the playlist-menu PL_NAME = "playlist.mpl" # HOTLIST = "name", entries in the directory hotlist, # can occur any time in this file # FULLPATHS = Yes|No, display full path of files, default: Yes FULLPATHS = yes # FORCESAMPLES = Yes|No, always display sample names (instead of # instrument names) in volumebars panel, default: No FORCESAMPLES = no # FAKEVOLUMEBARS = Yes|No, display fast, but not always accurate, volumebars # in volumebars panel, default: Yes # The real volumebars (when this setting is "No") take some CPU time to # be computed, and don't work with every driver. FAKEVOLUMEBARS = yes # WINDOWTITLE = Yes|No, set the term/window title to song name # (or filename if song has no title), default: Yes WINDOWTITLE = yes # THEME = "name", name of the theme to use, default: THEME = "" # Definition of the themes # NAME = "name", specifies the name of the theme # = normal | bold | reverse , for mono themes or # = , , for color themes # where = black | blue | green | cyan | red | magenta | # brown | gray | b_black | b_blue | b_green | # b_cyan | b_red | b_magenta | yellow | white # = black | blue | green | cyan | red | magenta | # brown | gray BEGIN "THEME" NAME = "MC" WARNING = "white,red" TITLE = "white,cyan" BANNER = "b_green,black" SONG_STATUS = "white,blue" INFO_INACTIVE = "black,cyan" INFO_ACTIVE = "white,black" INFO_IHOTKEY = "yellow,cyan" INFO_AHOTKEY = "yellow,black" HELP = "gray,blue" PLAYENTRY_INACTIVE = "gray,blue" PLAYENTRY_ACTIVE = "black,cyan" SAMPLES = "gray,blue" SAMPLES_KICK3 = "white,blue" SAMPLES_KICK2 = "b_cyan,blue" SAMPLES_KICK1 = "b_blue,blue" SAMPLES_KICK0 = "blue,blue" CONFIG = "cyan,blue" VOLBAR = "cyan,blue" VOLBAR_LOW = "b_green,blue" VOLBAR_MED = "yellow,blue" VOLBAR_HIGH = "b_red,blue" VOLBAR_INSTR = "b_green,blue" MENU_FRAME = "black,cyan" MENU_INACTIVE = "white,cyan" MENU_ACTIVE = "white,black" MENU_IHOTKEY = "yellow,cyan" MENU_AHOTKEY = "yellow,black" DLG_FRAME = "black,gray" DLG_LABEL = "black,gray" DLG_STR_TEXT = "black,cyan" DLG_STR_CURSOR = "cyan,black" DLG_BUT_INACTIVE = "black,gray" DLG_BUT_ACTIVE = "black,cyan" DLG_BUT_IHOTKEY = "yellow,gray" DLG_BUT_AHOTKEY = "yellow,cyan" DLG_BUT_ITEXT = "black,gray" DLG_BUT_ATEXT = "black,cyan" DLG_LIST_FOCUS = "black,cyan" DLG_LIST_NOFOCUS = "yellow,cyan" STATUS_LINE = "gray,blue" STATUS_TEXT = "gray,blue" END "THEME" BEGIN "THEME" NAME = "Reverse" WARNING = normal TITLE = bold BANNER = reverse SONG_STATUS = reverse INFO_INACTIVE = normal INFO_ACTIVE = reverse INFO_IHOTKEY = reverse INFO_AHOTKEY = reverse HELP = reverse PLAYENTRY_INACTIVE = reverse PLAYENTRY_ACTIVE = normal SAMPLES = reverse SAMPLES_KICK3 = reverse SAMPLES_KICK2 = reverse SAMPLES_KICK1 = reverse SAMPLES_KICK0 = reverse CONFIG = reverse VOLBAR = reverse VOLBAR_LOW = reverse VOLBAR_MED = reverse VOLBAR_HIGH = reverse VOLBAR_INSTR = reverse MENU_FRAME = normal MENU_INACTIVE = normal MENU_ACTIVE = reverse MENU_IHOTKEY = reverse MENU_AHOTKEY = normal DLG_FRAME = normal DLG_LABEL = normal DLG_STR_TEXT = reverse DLG_STR_CURSOR = normal DLG_BUT_INACTIVE = normal DLG_BUT_ACTIVE = reverse DLG_BUT_IHOTKEY = reverse DLG_BUT_AHOTKEY = normal DLG_BUT_ITEXT = normal DLG_BUT_ATEXT = reverse DLG_LIST_FOCUS = reverse DLG_LIST_NOFOCUS = bold STATUS_LINE = reverse STATUS_TEXT = reverse END "THEME" # Definition of the archiver # LOCATION = , -1: MARKER gives list of possible file extensions # otherwise: location where MARKER must be found in the file # MARKER = , see LOCATION, e.g. ".TAR.GZ .TGZ" or "PK\x03\x04" # LIST = , command to list archive content (%A archive name, # %a short(DOS/WIN) archive name) # NAMEOFFSET = , column where file names begin, # -1: start at column 0 and end at first space # EXTRACT = , command to extract a file to stdout (%A archive name, # %a short archive name, %f file name, %d destination name(non UNIX)) # SKIPPAT = , Remove the first SKIPSTART lines starting from the first # occurence of SKIPPAT and the last SKIPEND lines from the # extracted file (if the command EXTRACT mixes status # information and the module). # SKIPSTART = , # SKIPEND = , BEGIN "ARCHIVER" LOCATION = 0 MARKER = "PK\x03\x04" LIST = "unzip -vqq \"%a\"" NAMEOFFSET = 58 EXTRACT = "unzip -pqq \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 20 MARKER = "\xdc\xa7\xc4\xfd" LIST = "zoo lq \"%a\"" NAMEOFFSET = 47 EXTRACT = "zoo xpq \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 0 MARKER = "Rar!" LIST = "unrar v -c- \"%a\"" NAMEOFFSET = 1 EXTRACT = "unrar p -inul \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 2 MARKER = "-lh" LIST = "lha vvq \"%a\"" NAMEOFFSET = -1 EXTRACT = "lha pq \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 2 MARKER = "-lz" LIST = "lha vvq \"%a\"" NAMEOFFSET = -1 EXTRACT = "lha pq \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 257 MARKER = "ustar" LIST = "tar -tf \"%a\"" NAMEOFFSET = 0 EXTRACT = "tar -xOf \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = -1 MARKER = ".TAR.GZ .TAZ .TGZ" LIST = "tar -tzf \"%a\"" NAMEOFFSET = 0 EXTRACT = "tar -xOzf \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = -1 MARKER = ".TAR.BZ2 .TBZ .TBZ2" LIST = "tar --use-compress-program=bzip2 -tf \"%a\"" NAMEOFFSET = 0 EXTRACT = "tar --use-compress-program=bzip2 -xOf \"%a\" \"%f\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 0 MARKER = "\x1f\x8b" LIST = "" NAMEOFFSET = 0 EXTRACT = "gzip -dqc \"%a\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 0 MARKER = "BZh" LIST = "" NAMEOFFSET = 0 EXTRACT = "bzip2 -dqc \"%a\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" mikmod-3.2.9/mikmod.cfg0000644000000000000000000002140414037505106013446 0ustar rootroot# # -= MikMod 3.2.9 =- # configuration file # # DRIVER = , nth driver for output, default: 0 DRIVER = 0 # DRV_OPTIONS = "options", the driver options, e.g. "buffer=14,count=16" # for the OSS-driver DRV_OPTIONS = "" # STEREO = Yes|No, stereo or mono output, default: stereo STEREO = yes # 16BIT = Yes|No, 8 or 16 bit output, default: 16 bit 16BIT = yes # FREQUENCY = , mixing frequency, default: 44100 Hz FREQUENCY = 44100 # INTERPOLATE = Yes|No, use interpolate mixing, default: Yes INTERPOLATE = yes # HQMIXER = Yes|No, use high-quality (but slow) software mixer, default: No HQMIXER = no # SURROUND = Yes|No, use surround mixing, default: No SURROUND = no # REVERB = , set reverb amount (0-15), default: 0 (none) REVERB = 0 # VOLUME = , volume from 0 (silence) to 100, default: 100 VOLUME = 100 # VOLRESTRICT = Yes|No, restrict volume of player to volume supplied by user, # default: No VOLRESTRICT = no # FADEOUT = Yes|No, volume fade at the end of the module, default: No FADEOUT = no # LOOP = Yes|No, enable in-module loops, default: No LOOP = no # PANNING = Yes|No, process panning effects, default: Yes PANNING = yes # EXTSPD = Yes|No, process Protracker extended speed effect, default: Yes EXTSPD = yes # PM_MODULE = Yes|No, Module repeats, default: No PM_MODULE = no # PM_MULTI = Yes|No, PlayList repeats, default: Yes PM_MULTI = yes # PM_SHUFFLE = Yes|No, Shuffle list at start and if all entries are played, # default: No PM_SHUFFLE = no # PM_RANDOM = Yes|No, PlayList in random order, default: No PM_RANDOM = no # CURIOUS = Yes|No, look for hidden patterns in module, default: No CURIOUS = no # TOLERANT = Yes|No, don't halt on file access errors, default: Yes TOLERANT = yes # RENICE = RENICE_NONE (change nothing), RENICE_PRI (Renice to -20) or # RENICE_REAL (get realtime priority), default: RENICE_NONE # Note that RENICE_PRI is only available under FreeBSD, Linux, NetBSD, # OpenBSD and OS/2, and RENICE_REAL is only available under FreeBSD, Linux # and OS/2. RENICE = RENICE_NONE # STATUSBAR = , size of statusbar from 0 to 2, default: 2 STATUSBAR = 2 # SAVECONFIG = Yes|No, save configuration on exit, default: Yes SAVECONFIG = yes # SAVEPLAYLIST = Yes|No, save playlist on exit, default: Yes SAVEPLAYLIST = yes # PL_NAME = "name", name under which the playlist will be saved # by selecting 'Save' in the playlist-menu PL_NAME = "playlist.mpl" # HOTLIST = "name", entries in the directory hotlist, # can occur any time in this file # FULLPATHS = Yes|No, display full path of files, default: Yes FULLPATHS = yes # FORCESAMPLES = Yes|No, always display sample names (instead of # instrument names) in volumebars panel, default: No FORCESAMPLES = no # FAKEVOLUMEBARS = Yes|No, display fast, but not always accurate, volumebars # in volumebars panel, default: Yes # The real volumebars (when this setting is "No") take some CPU time to # be computed, and don't work with every driver. FAKEVOLUMEBARS = yes # WINDOWTITLE = Yes|No, set the term/window title to song name # (or filename if song has no title), default: Yes WINDOWTITLE = yes # THEME = "name", name of the theme to use, default: THEME = "" # Definition of the themes # NAME = "name", specifies the name of the theme # = normal | bold | reverse , for mono themes or # = , , for color themes # where = black | blue | green | cyan | red | magenta | # brown | gray | b_black | b_blue | b_green | # b_cyan | b_red | b_magenta | yellow | white # = black | blue | green | cyan | red | magenta | # brown | gray BEGIN "THEME" NAME = "MC" WARNING = "white,red" TITLE = "white,cyan" BANNER = "b_green,black" SONG_STATUS = "white,blue" INFO_INACTIVE = "black,cyan" INFO_ACTIVE = "white,black" INFO_IHOTKEY = "yellow,cyan" INFO_AHOTKEY = "yellow,black" HELP = "gray,blue" PLAYENTRY_INACTIVE = "gray,blue" PLAYENTRY_ACTIVE = "black,cyan" SAMPLES = "gray,blue" SAMPLES_KICK3 = "white,blue" SAMPLES_KICK2 = "b_cyan,blue" SAMPLES_KICK1 = "b_blue,blue" SAMPLES_KICK0 = "blue,blue" CONFIG = "cyan,blue" VOLBAR = "cyan,blue" VOLBAR_LOW = "b_green,blue" VOLBAR_MED = "yellow,blue" VOLBAR_HIGH = "b_red,blue" VOLBAR_INSTR = "b_green,blue" MENU_FRAME = "black,cyan" MENU_INACTIVE = "white,cyan" MENU_ACTIVE = "white,black" MENU_IHOTKEY = "yellow,cyan" MENU_AHOTKEY = "yellow,black" DLG_FRAME = "black,gray" DLG_LABEL = "black,gray" DLG_STR_TEXT = "black,cyan" DLG_STR_CURSOR = "cyan,black" DLG_BUT_INACTIVE = "black,gray" DLG_BUT_ACTIVE = "black,cyan" DLG_BUT_IHOTKEY = "yellow,gray" DLG_BUT_AHOTKEY = "yellow,cyan" DLG_BUT_ITEXT = "black,gray" DLG_BUT_ATEXT = "black,cyan" DLG_LIST_FOCUS = "black,cyan" DLG_LIST_NOFOCUS = "yellow,cyan" STATUS_LINE = "gray,blue" STATUS_TEXT = "gray,blue" END "THEME" BEGIN "THEME" NAME = "Reverse" WARNING = normal TITLE = bold BANNER = reverse SONG_STATUS = reverse INFO_INACTIVE = normal INFO_ACTIVE = reverse INFO_IHOTKEY = reverse INFO_AHOTKEY = reverse HELP = reverse PLAYENTRY_INACTIVE = reverse PLAYENTRY_ACTIVE = normal SAMPLES = reverse SAMPLES_KICK3 = reverse SAMPLES_KICK2 = reverse SAMPLES_KICK1 = reverse SAMPLES_KICK0 = reverse CONFIG = reverse VOLBAR = reverse VOLBAR_LOW = reverse VOLBAR_MED = reverse VOLBAR_HIGH = reverse VOLBAR_INSTR = reverse MENU_FRAME = normal MENU_INACTIVE = normal MENU_ACTIVE = reverse MENU_IHOTKEY = reverse MENU_AHOTKEY = normal DLG_FRAME = normal DLG_LABEL = normal DLG_STR_TEXT = reverse DLG_STR_CURSOR = normal DLG_BUT_INACTIVE = normal DLG_BUT_ACTIVE = reverse DLG_BUT_IHOTKEY = reverse DLG_BUT_AHOTKEY = normal DLG_BUT_ITEXT = normal DLG_BUT_ATEXT = reverse DLG_LIST_FOCUS = reverse DLG_LIST_NOFOCUS = bold STATUS_LINE = reverse STATUS_TEXT = reverse END "THEME" # Definition of the archiver # LOCATION = , -1: MARKER gives list of possible file extensions # otherwise: location where MARKER must be found in the file # MARKER = , see LOCATION, e.g. ".TAR.GZ .TGZ" or "PK\x03\x04" # LIST = , command to list archive content (%A archive name, # %a short(DOS/WIN) archive name) # NAMEOFFSET = , column where file names begin, # -1: start at column 0 and end at first space # EXTRACT = , command to extract a file to stdout (%A archive name, # %a short archive name, %f file name, %d destination name(non UNIX)) # SKIPPAT = , Remove the first SKIPSTART lines starting from the first # occurence of SKIPPAT and the last SKIPEND lines from the # extracted file (if the command EXTRACT mixes status # information and the module). # SKIPSTART = , # SKIPEND = , BEGIN "ARCHIVER" LOCATION = 0 MARKER = "PK\x03\x04" LIST = "pkunzip -vb \"%a\"" NAMEOFFSET = 47 EXTRACT = "pkunzip -c \"%a\" \"%f\" >\"%d\"" SKIPPAT = "to console" SKIPSTART = 2 SKIPEND = 1 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 20 MARKER = "\xdc\xa7\xc4\xfd" LIST = "zoo lq \"%a\"" NAMEOFFSET = 47 EXTRACT = "zoo xpq \"%a\" \"%f\" >\"%d\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 0 MARKER = "Rar!" LIST = "rar v -y -c- \"%a\"" NAMEOFFSET = 1 EXTRACT = "rar p -y -c- \"%a\" \"%f\" >\"%d\"" SKIPPAT = "--- Printing " SKIPSTART = 2 SKIPEND = 2 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 2 MARKER = "-lh" LIST = "lha v %a" NAMEOFFSET = -1 EXTRACT = "lha p /n %a %f >\"%d\"" SKIPPAT = "" SKIPSTART = 3 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 2 MARKER = "-lz" LIST = "lha v %a" NAMEOFFSET = -1 EXTRACT = "lha p /n %a %f >\"%d\"" SKIPPAT = "" SKIPSTART = 3 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 257 MARKER = "ustar" LIST = "djtar -t \"%A\"" NAMEOFFSET = 36 EXTRACT = "djtar -x -p -b -o \"%f\" \"%A\" >\"%d\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = -1 MARKER = ".TAR.GZ .TAZ .TGZ" LIST = "djtar -t \"%A\"" NAMEOFFSET = 36 EXTRACT = "djtar -x -p -b -o \"%f\" \"%A\" >\"%d\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 0 MARKER = "\x1f\x8b" LIST = "" NAMEOFFSET = 27 EXTRACT = "gzip -dqc \"%a\" >\"%d\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER" BEGIN "ARCHIVER" LOCATION = 0 MARKER = "BZh" LIST = "" NAMEOFFSET = 0 EXTRACT = "bzip2 -dqc \"%a\" >\"%d\"" SKIPPAT = "" SKIPSTART = 0 SKIPEND = 0 END "ARCHIVER"